Twilio:通过 API 更新语音(或消息)URL? [英] Twilio: Update the Voice (or Message) URL via API?

查看:30
本文介绍了Twilio:通过 API 更新语音(或消息)URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 Twilio 有一段时间了,认为它是一项出色的服务,并希望使用 Twilio 为我的家庭自动化服务器(一台旧的 mac-mini)提供文本/语音功能.

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).

问题是,如果我的家庭 IP 地址发生变化,那么我的 Twilio 号码的 SMS 和语音 URL 将指向错误的 IP,这显然会阻止我的网络服务器 (Node.js) 执行......好吧,任何事情.

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.

我的计划是定期获取 mac-mini 的外部 IP 并通过将其发布到 Twilio API 来更新我号码的语音/短信 URL,但 Twilio API 似乎不支持此功能.

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.

谁能确认是否可以/不可能通过 Twilio API 更新号码的语音/短信 URL?否则,我将不得不对此进行网络驱动...谢谢!

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 布道者在这里.

Twilio evangelist here.

您绝对可以通过 REST API 更改电话号码的语音和消息请求 URL.这基本上就是你在门户中做的事情.

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.

要做到这一点,您可以向IncomingPhoneNumbers 实例资源并包含 VoiceUrl 和 SmsUrl 参数.这是一个示例.

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

您还可以查看为您的手机设置后备网址数字作为可靠性的附加层.回退 URL 允许您告诉 Twilio 使用第二个 URL,以防对主 URL 的请求失败.但是,您必须通过门户设置回退 URL,而不是 REST API.

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.

这篇关于Twilio:通过 API 更新语音(或消息)URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆