what are FXO & FXS? Why do I need it?
FXO and FXS are interfaces (ports or plugs) commonly used with analog phones and phones lines.
FXO stands for Foreign eXchange Office
FXS stands for Foreign eXchange Subscriber
FXS Interface
FXS interface is the telephone jack on the wall in your house or office. This is the wall jack where you connect your phone using a telephone cable and make outgoing calls using the phone line. An FXS interface (the wall jack) has a number (phone number or in some cases an extension number) assigned to it. For example: the phone jack on the wall in your house has your home phone number assigned to it. When people call this number, the phone(s) attached to this FXS interface will ring.
FXO Interface
When you connect a phone to the phone line, one end of the phone cable connects to the wall jack (FXS interface). The other end of the cable connects to the interface on the back of the phone. This interface is called the FXO interface. As you might have already noticed, a FXS interface always has to connect to an FXO interface to work. You cannot connect two FXS interfaces together. For example: Two phones cannot be connected back-to-back using a telephone cable. No one can stop you from doing so, but it'll simply not work :-) and you wont be able to make or receive calls! A phone (FXO) always connects to a phone line (FXS).
Image 1: Relationships between Analog Phone, Phone Line, Wall Jack, FXO & FXS Interfaces

I don't see a Phone system (or PBX) in this picture! Where does the PBX fit in?
A PBX or a phone system is normally used when you have multiple lines (usually in offices) that need to be shared between multiple employees. The PBX comes with both FXS & FXO interfaces. The FXO interfaces on the PBX connect to phone lines from the phone company and the FXS interfaces on the PBX is where the phones (analog) or the extensions are connected to.
Image 2: Relationships between PBX, Analog Phone, Phone Line, Wall Jack, FXO & FXS Interfaces





FXS is known as station extensions that are designed for single line devices such as cordless phones, FAX and answering machines, etc. that are typically a part of a customer's key or PBX system. Typically these extensions should mimic the same characteristics as do the Central Office 2 wire lines that would normally be plugged into FXO ports. In fact, to demo the equipment you may loop an FXS to and FXO to demonstrate how the system handles inbound calls. Many key service systems supported these station lines but often at lower voltages of both the Battery feed and ringing voltages; this is sometimes a comparability problem as some devices don't operate correctly when the line isn't to Belcore specs.