An FXS gateway is used to connect one or more lines of a traditional PBX to a VoIP phone system or provider. Alternatively, you can use it to connect analog phones to it and re-use your analog phones with a VoIP phone system. You need an FXS gateway because you want to connect the FXO ports (which normally are connected to the telephone company) to the Internet or a VoIP system.