Asterisk twilio config


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:
[Mar 12 14:31:40] NOTICE[91][C-0000000c]: chan_sip.c:26414 handle_request_invite: Call from ‘1001’ ( to extension ‘13122317895’ rejected because extension not found in context ‘from-phones’.

This is from extensions.conf

exten => _+1NXXXXXXXXX,1,Dial(SIP/1001)

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

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

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

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

Thanks guys I’ve corrected from all to num.