blupointmedia
blupointmedia

Reputation: 604

Twilio SIP Trunking and Sip Domain

I am currently using Twilio for my cloud communication platform. A client of ours wants to SIP over to us, with headers, so we can continue the call on our end using Twiml.

I have tried setting up a SIP Domain and it works if I use a soft phone for an end point, but this isn't what I am trying to accomplish. I have also tried setting up a SIP Elastic Trunk and have that trunk connect to our SIP domain which in return call the Voice URL on the SIP domain.

I currently have setup a simple application to test this process. I have a Twilio number that calls a webhook, in the webhook (my app) I call the sip to the Twilio SIP trunk, but it fails. I am expecting to call the SIP domain and the Voice URL. I keep getting the error that the You tried to Dial a SIP Endpoint that is not currently registered with the corresponding SIP Domain. Please check your TwiML or REST API. (reference: TWilio Error Documentation.

Can anyone help me with this, please? I am currently using Twiml with PHP.

-- Update --

I am also following this documentation to a tee. I have a SIP Domain setup in my Twilio account, but it is requiring a registered user at an endpoint. In this documentation, it says when a sip call comes into the sip domain it will call the webhook, which it is not doing. Twilio SIP Domains

Upvotes: 1

Views: 1674

Answers (2)

philnash
philnash

Reputation: 73027

Twilio developer evangelist here.

I believe you're right to be confused about the SIP domain documentation. But the error message clears it up when it says:

Make sure the username matches a username in the Credential List used to authenticate the SIP Endpoint with the SIP Domain.

So your username does need to be an existing one, the SIP domain is not acting as a wildcard catch all for SIP addresses.

I will work to make sure the documentation is clearer.

Given that you are already receiving a webhook from an incoming call, why are you trying to get a second webhook from the SIP request? Could you not use the first webhook to direct the call the way you need?

Upvotes: 1

Bucq
Bucq

Reputation: 1021

In general, if you try to call a SIP endpoint via a SIP server/proxy, that SIP server/proxy needs to know how to reach that endpoint (routing). From the error text I derive that that isn't possible at the moment. Also, sometimes SIP servers only allow outbound calls from registered endpoints.

There are a number of things you can do:

  1. Bypass the SIP server and call the endpoint directly (probably not what you want)
  2. Configure a static path in the SIP server to the endpoint
  3. Have the endpoint(s) register at the SIP server, so the SIP server knows who calls and how to reach the target.

Have you tried the possible solutions in the Error documentation?

  • Make sure the username (in the Request-URI) matches a username in the Credential List used to authenticate the SIP Endpoint with the SIP Domain
  • Prior to dialing, you can verify that your SIP Endpoint has successfully registered in the Console "Registered SIP Endpoints" tab found on the SIP Domains page.

Upvotes: 0

Related Questions