Twilio: Update the Voice (or Message) URL via API?

I've been using Twilio for quite some time, think its a slick service, and would like to use Twilio to power text/voice capability to/from my home automation server (an old mac-mini).

The problem is, if my home IP address changes, then my Twilio number's SMS and Voice URLs would be pointing at the wrong IP, which would obviously prevent my webserver (Node.js) from doing ... well, anything.

My plan was to periodically grab the mac-mini's external IP and update my number's Voice/SMS URLs by POSTing it to the Twilio API, but it doesn't seem that the Twilio API supports this functionality.

Can anyone confirm that it is / is NOT possible to update a number's Voice/SMS URLs via the Twilio API? Otherwise, I'll have to webdrive this ... thank you!


Twilio evangelist here.

You absolutely change the Voice and Message Request URLS for your phone numbers via the REST API. Thats basically whats happening when you do it in the portal.

To do it you make a POST request to the IncomingPhoneNumbers instance resource and include the VoiceUrl and SmsUrl parameters. Here is an example.

You can also look at setting the Fallback URL's for you phone numbers as an additional layer of reliability. Fallback URL's let you tell Twilio a second URL to use in case the request to the primary URL fails. You do however have to set fallback URLS via the portal, not the REST API.

链接地址: http://www.djcxy.com/p/21904.html

上一篇: 如何用原始InputStream实例化FSDataInputStream?

下一篇: Twilio:通过API更新语音(或消息)URL?