Receiving Calls and SMS on your server and forwarding them to a different application, such as Matrix and VoIP, can be achieved using a SIP server.
There are multiple FOSS SIP solutions available, including:
- Asterisk
- Kamailio
- FreeSWITCH
To receive Calls and SMS from a Telecom Provider when you have a SIM card, you have two options. The first option is to use an SIP client that forwards the connections to the server. The second option is to utilize a GSM Gateway.
If you prefer to use a telephone line instead, you will need a Telephony Interface Card (TIC), typically a PCIe card.
Once the requirements are met, you will need to configure the SIP server and integrate it into the application of your choice, such as Matrix, Teams, etc.
Setting Up the SIP Server
- Install and configure one of the open source SIP servers like Asterisk, Kamailio or FreeSWITCH on a Linux server.
- Make sure the SIP server has a public IP address and that the necessary ports are open (usually 5060 for SIP and 10000-20000 for RTP).
- Configure the SIP domains, users, dialplans etc on the server. This will depend on the specific server software being used.
- Optionally install a web interface or admin panel to manage the SIP server configuration.
Receiving Calls/SMS
- To receive calls/SMS from a SIM card, install a GSM gateway hardware device and connect it to the server. Configure it as a SIP trunk in the SIP server.
- Or install a SIP client like chan_dongle on the server and connect a USB 3G/4G modem to it. Configure it as a SIP trunk.
- For a landline, install a Telephony Interface Card (TIC) and configure it in the SIP server to receive calls.
Forwarding Calls/Messages
- On the SIP server, setup extensions and dialplans to forward incoming calls and SMS to the desired application.
- For example, to forward to Matrix, install a SIP-Matrix gateway bridge. Configure dialpatterns to route calls to the bridge.
- To forward to VoIP phones, register SIP phones to the server and configure extensions and dialpatterns to route calls.
- Make sure the application server can reach the SIP server over the network.
This allows receiving calls and messages on the SIP server from any source and forwarding them to communicating apps.