0

I have a question about integrating with a phone company (the Provider) using SIP.

I have a situation:

1. A call is made to a PSTN number
2. The Provider forwards the call to a SIP Gateway
3. Twilio is the SIP Gateway, so I receive an HTTP request for every new call 
4. I execute my application logic

As I understand the SIP integration between the Provider and Twilio is done using SIP INVITE.

Now a have the challenge is to implement the integration using SIP REGISTER. As I imagine, the scenario should look like this:

1. I register against the Provider using SIP REGISTER
2. A call is made to a PSTN number
3. The Provider gives me the call
4. I execute my application logic

I need to figure out what is needed in order to accomplish this:

  1. Firstly, does this scenario make sense?
  2. Do I need to use a PBX solution (like Asterisk, FreeSwitch) to implement SIP REGISTER and build my application on top of it?
  3. If so, which PBX solution do you recommend and which features/modules are needed? And do I have to host it on my server?
  4. Perhaps I don't need a PBX solution, and a library is enough as described here?

It is the Provider pushing for this way of integration and I have too little knowledge about it. What I have figured out is that Twilio can't help me with this. So it looks like I have to take a part of solution in-house.

Community
  • 1
  • 1
Alvis
  • 3,543
  • 5
  • 36
  • 41

1 Answers1

1

REGISTER is required if your terminal or terminals belong to the domain of a VoIP provider.

REGISTER records the mapping between the identity the VoIP provider gave you and the actual address and port where you will be listening for requests.

This way, calls addressed to you (sip:myuserid@voip.domain.com) will be sent by the VoIP provider to the address of record it has for you.

If you are a VoIP provider yourself (i.e. you have a sip:myuserid@myowndomain.com), then your peer voip providers will route requests to you based on DNS records or internal domain-based routing decisions. Once the call reaches you, then you can decide on how to handle it. If you are a real SIP provider, then you will have a registrar where you store the result of the REGISTER of your different users.

If you want to implement some application logic on your end, you have different options:

  • Easiest way is to implement a UAC/UAS, basically a terminal. Your application is the terminal, it registers with the VoIP provider and receives all your calls. You will just need the SIP stack, and you can do whatever you want with the call.

  • Using a PBX software. Basically it will handle normal calls for you, and the REGISTER when needed. Typically they will have APIs to perform some degree of automation/modification of the call handling.

Difference between the approaches, in the first case, you just have the protocol, so you must do everything else. In the second case, the objective is to process normal calls and they will offer you some window (smaller or greater) to see into those calls and do things with it.

jsantander
  • 4,972
  • 16
  • 27