Twilio integration with Asterisk

Integration of Asterisk with Twilio must have been a cakewalk considering popularitiy of both. But it is not. See the integration details on this blog.

 · 1 min read


EXTENSIONS.CONF


[from-internal]


exten => 6002,1,NoOp(anything)

same => n,Dial(PJSIP/6002 )

same => n,Hangup


exten => 6001,1,NoOp(debug infor - ${EXTEN})

same => n,Dial(PJSIP/${EXTEN})

same => n,Hangup


exten => _+1.,1,Set(CALLERID(all)=<+170751XXXXX>)

same => n,Dial(PJSIP/${EXTEN}@mytwilio)

same => n,Hangup


exten => _+9.,1,Set(CALLERID(all)="David"<+97XXXXXXXXX>)

same => n,Dial(PJSIP/${EXTEN}@mytwilio)

same => n,Hangup


[from-twilio]

exten => _+1.,1,NoOp(debug info , this is the number ${EXTEN})

same => n,Goto(from-internal,6001,1)


***************************************************


PJSIP.CONF

****************************************************

[mytwilio-reg]

type=registration

outbound_auth=mytwilio-auth

server_uri=sip:XXXX.sip.twilio.com

client_uri=sip:userid1@XXXX.sip.twilio.com


[mytwilio]

type=endpoint

outbound_auth=mytwilio-auth

aors=mytwilio-aors

allow=all


[mytwilio-auth]

type=auth

auth_type=userpass

username=userid1

password=yourpassword


[mytwilio-aors]

type=aor

contact=sip:xxxx.pstn.twilio.com



[twilio-in]

type=endpoint

transport=transport-udp

context=from-twilio

disallow=all

allow=ulaw



[twilio0-ident]

type=identify

endpoint=twilio-in

match=xxxx.sip.twilio.com

match=54.244.51.1

match=164.132.113.240

match=185.40.193.22

match=54.244.51.27

match=54.244.51.0

match=54.244.51.2


[transport-udp]

type=transport

protocol=udp

bind=0.0.0.0:port


[6001]

type=endpoint

transport=transport-udp

context=from-internal

disallow=all

allow=ulaw

allow=gsm

auth=6001

aors=6001


[6001]

type=auth

auth_type=userpass

password=yourpassword

username=6001


[6001]

type=aor

max_contacts=1



[6002]

type=endpoint

transport=transport-udp

context=from-internal

disallow=all

allow=ulaw

auth=6002

aors=6002



[6002]

type=auth

auth_type=userpass

password=yourpassword

username=6002


[6002]

type=aor

max_contacts=2








Cloud support

Cloud support team provides hosting related support and technology updates. Cover technology like cloud printing, Cloud PBAX, VoIP, Kubernetes, Ubuntu, Linux etc. Contact us on support@ERPGulf.com

No comments yet

No comments yet. Start a new discussion.

Add Comment