Twilio outbound call - endpoint issue

I am trying to trigger a make outbound call using Twilio sip trunk. Done Tried multiple options to sort the issue every time I am making changes giving me a different error.

Getting below error:

Unable to create PJSIP channel - endpoint
Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)

Error from logs

 -- Executing [+1234567890@twlext:2] Dial("PJSIP/User1-00000000", "PJSIP/+1234567890@twl") in new stack
[2020-12-02 10:57:53] ERROR[26856]: chan_pjsip.c:2699 request: Unable to create PJSIP channel - endpoint 'twl' was not found
[2020-12-02 10:57:53] WARNING[26921][C-00000001]: app_dial.c:2576 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
    -- No devices or endpoints to dial (technology/resource)
    -- Executing [+1234567890@twlext:3] Answer("PJSIP/User1-00000000", "") in new stack
[2020-12-02 10:57:53] ERROR[26856]: pjproject: <?>: 	   icess0x7f67b894b038 ...Error sending STUN request: Operation not permitted
[2020-12-02 10:57:53] ERROR[26871]: pjproject: <?>: 	   icess0x7f67b894b038 ..Error sending STUN request: Operation not permitted
    -- Executing [+1234567890@twlext:4] Hangup("PJSIP/User1-00000000", "") in new stack
  == Spawn extension (twlext, +1234567890, 4) exited non-zero on 'PJSIP/User1-00000000'
[2020-12-02 11:02:47] WARNING[26870]: res_stun_monitor.c:138 stun_monitor_request: STUN poll failed. Re-evaluating STUN server address

Here is my pjsip.conf file

[twl]
type=aor
max_contacts=10
qualify_frequency=120
remove_existing=yes
contact=sip:NUMBER@SUB_DOMAIN.pstn.twilio.com

[twl]
type=endpoint
context=twl
username=USERNAME
secret=PASSWORD
host=SUB_DOMAIN.pstn.twilio.com
canreinvite=no
disallow=all
allow=ulaw
insecure=port,invite
fromdomain=SUB_DOMAIN.pstn.twilio.com
context=from-trunk
callerid="NAME" <+REGISTER_NUMBER>


[twl]
type=identify
endpoint=twl
match=SUB_DOMAIN.pstn.twilio.com
match=sip.twilio.com

These are some options that are invalid. There may be more, but these stand out. Are you sure that the whole section wasn’t thrown out as a result.

canreinvite isn’t even a current option for chan_sip, although I believe it is still accepted as an alias for a current one. chan_psjip never had the problem that existed in earlier versions of chan_sip and which required insecure=invite. It allows authentication to be controlled independently in each direction. Most people don’t need insecure=port, even in chan_sip, and I don’t know if it has any equivalent in chan_pjsip. fromdomain is incorrectly punctuated. Authentication is handled by type=auth sections, not by the use of secret in the type=endpoint one.

callerid="NAME" <+REGISTER_NUMBER>

You would have a strange system for this to make sense. Normally people want to receive the real originator’s caller ID from ITSPs.

You have two different context’s!

hey thank you for your quick response and finding where I was doing wrong david551

I was able to resolve my error by removing everything from the pjsip config and made another which resolved my error.

But there is another problem I am getting which is, I will add that in another post because thats not related this this subject.

thank you once again.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.