Twilio:使用 <Sms> 发送的 SMS限制为 160 个字符且不包含交付步骤信息 [英] Twilio: SMS sent using <Sms> limited to 160 characters and without Delivery Steps info
问题描述
我正在使用以下 TwiML 代码(来自垃圾箱)通过 Twilio 发送短信.它在通话结束时使用
动词的 action
参数调用.
I am sending an SMS with Twilio using the following TwiML code (from a bin). It is called at the end of a call, using the action
parameter of the <Dial>
verb.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Sms from="+44XXXXXXXXXX" to="{{From}}">Recording of your call with {{To}}: {{RecordingUrl}}</Sms>
</Response>
它有效,但如果消息太长,我会收到错误消息:
It works, but if the message gets too long I get the error:
21605 最大正文长度为 160 个字符
21605 Maximum body length is 160 characters
而且我没有在 SMS 日志 中获得交付步骤信息:
And I do not get Delivery Steps information in the SMS logs:
交付步骤
交付步骤不可用.
对于使用已弃用的/SMS/Messages 资源发送的消息.请升级到消息资源以查看传递步骤.
For messages sent with the deprecated /SMS/Messages Resource. Please upgrade to the Messages Resource to see Delivery Steps.
此链接让我相信我以某种方式使用了已弃用的 API:https://support.twilio.com/hc/en-us/articles/223181028-Switching-from-SMS-Messages-resource-URI-to-Messages-resource-URI-
This link leads me to believe I am somehow using a deprecated API: https://support.twilio.com/hc/en-us/articles/223181028-Switching-from-SMS-Messages-resource-URI-to-Messages-resource-URI-
所有涉及的数字都来自英国,如果这有影响的话.
All the numbers involved are from UK, if this somehow has an influence.
推荐答案
Twilio 开发人员布道者在这里.
Twilio developer evangelist here.
事实证明,
在幕后使用已弃用的 /SMS/Messages
端点在通话期间发送消息.这就是您看到上面分享的结果的原因.
It turns out that <Sms>
under the hood, uses the deprecated /SMS/Messages
endpoint to send messages during calls. This is why you are seeing the results you have shared above.
有一个内部漏洞用于在语音通话中提供
,但同时解决方法是 使用 REST API 发送消息而不是 TwiML.
There is a bug open internally to provide <Message>
within voice calls, but in the meantime the workaround is to use the REST API to send messages instead of TwiML.
这篇关于Twilio:使用 <Sms> 发送的 SMS限制为 160 个字符且不包含交付步骤信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!