Asterisk twilio config


#1

Hi,

I’m working on getting my current server working with twilio as a backup. I have duplicated the server and can receive phone calls no problem but can’t make phones calls out as it thinks I’m calling a local extension. Can you all have a look at the test config and let me know what might be the issue?

Connected to Asterisk 13.19.2 currently running on f45ae9851c6e (pid = 47)
== Using SIP RTP CoS mark 5
> 0x7f816800b990 – Strict RTP learning after remote address set to: 10.10.88.4:50008
[Mar 12 14:31:40] NOTICE[91][C-0000000c]: chan_sip.c:26414 handle_request_invite: Call from ‘1001’ (172.17.0.1:45332) to extension ‘13122317895’ rejected because extension not found in context ‘from-phones’.

This is from extensions.conf

[from-twilio]
exten => _+1NXXXXXXXXX,1,Dial(SIP/1001)

[from-phones]
exten => _NXXNXXXXXX,1,Set(CALLERID(all) 9044291158)
;same => _X.n,1,Dial({EXTEN}@banded.pstn.twilio.com)
exten => n,Dial(SIP/${EXTEN:1}@twilio-trunk)
exten => _NXXNXXXXXX,1,Hangup


#2

So far I’ve figured out I’m getting invalid caller id from Twillio but I’m using the correct number.


#3

I don’t know if this is a typo or what but you are missing equal sign (=) here.
Even the value to be set for Callerid(all) doesn’t look in proper format


#4

The correct syntax should be
exten => _NXXNXXXXXX,1,Set(CALLERID(num)=9044291158)


#5

Thanks guys I’ve corrected from all to num.