This is the third of four posts:

Ok, so I had my wireless phone connected to my Cisco ATA, and if I dialed 111 I could hear “hello world”… now I wanted to have twilio on extension 222. It was way easier than expected.

First, I had to create a SIP domain on twilio… and as I have dynamic IP, I needed a credential list. On that domain, I just set up as Voice URL a twimlet that congratulates me :) with this url:

http://twimlets.com/message?Message%5B0%5D=Congratulations!%20Congratulations!%20Congratulations!

Then, on my sip.conf I created a device with this data

[twiliocall]
type = peer
username = myusername
remotesecret = mypassword
host = mydomain.sip.twilio.com
qualify = no

And the last step was using it on the dialplan… so on my extensions.conf I just added

exten => 222,1,Dial(SIP/twiliocall)

And voilà… I have twilio on 222. From there, you can do whatever you want using their API (you could have it ask which phone number you want to dial out and just do a <Dial>… or have a fancy IVR giving you weather or traffic status?)

Extremely painless… which wasn’t the case when receiving calls from twilio, but more on that on the next post :)

Gervasio Marchand

@[email protected] g3rv4


Published