Twilio: SMS sent using <Sms> limited to 160 characters and without Delivery Steps info

旧城冷巷雨未停 提交于 2019-12-11 07:06:25

问题


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 Maximum body length is 160 characters

And I do not get Delivery Steps information in the SMS logs:

Delivery Steps

Delivery Steps are not available.

For messages sent with the deprecated /SMS/Messages Resource. Please upgrade to the Messages Resource to see Delivery Steps.

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.


回答1:


Twilio developer evangelist here.

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.

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.



来源:https://stackoverflow.com/questions/45020962/twilio-sms-sent-using-sms-limited-to-160-characters-and-without-delivery-step

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!