【问题标题】:Forward Twilio MMS Messages Using Twilio Resources使用 Twilio 资源转发 Twilio MMS 消息
【发布时间】:2022-11-22 17:40:42
【问题描述】:

我正在尝试使用 Twilio 将 SMS 和 MMS 消息转发到使用 Twilio 资源的多个电话号码。我按照在线文档进行操作并轻松转发了 SMS。但是我没有找到任何关于转发彩信的文档。

使用 Twilio 资源转发彩信的正确方法是什么?这将使用美国的电话号码。

I took a stab at it using a function and I can get the media URL to be forwarded but it then requires the receiver to log into Twilio to view the image. 



`exports.handler = function(context, event, callback) {
  let twiml = new Twilio.twiml.MessagingResponse();
  twiml.message(`${event.From}: ${event.MediaUrl0}: ${event.Body}`, {
    to: '+19999999999'
  });
  callback(null, twiml);
};`


I can see I will also have a problem when more than 1 image is forwarded in the message and have to obtain the message image count.

【问题讨论】:

    标签: twilio forwarding mms twilio-functions


    【解决方案1】:

    我不确定为什么接收者必须登录 Twilio 才能查看图像。但是要回答你的第二个问题,如果转发了超过 1 张图像,你必须访问它们,以便 MediaURL 参数的结构为 MediaUrl0MediaUrl1MediaUrl2 等。MediaUrl0 是MMS 中的第一张图片,MediaUrl1 是第二张图片。每个彩信最多可以有 10 张图像。 Source

    【讨论】: