0

I am trying to use Twilio to forward SMS and MMS messages to multiple phone numbers using Twilio recourses. I followed the online documentations and got SMS forwarding up easily. But I did not find any documentation on forwarding MMS messages.

What is the proper method to forward an MMS message using Twilio recourses? This will be working off of US based phone numbers.

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.

MSieg
  • 1

2 Answers2

0

I'm not exactly sure why the receiver is having to log in to Twilio to view the image. But to answer your second question, if more than 1 image is forwarded, you'll have to access them such that the MediaURL parameter is structured as MediaUrl0, MediaUrl1, MediaUrl2 and etc. MediaUrl0 is the first image in the MMS and MediaUrl1 is the second. And there can be a maximum of 10 images per MMS. Source

anthonyjdella
  • 481
  • 2
  • 16
0

To turn off HTTP Auth look in your Messaging settings for

Enforce HTTP Auth on Media URLs Enforces HTTP basic auth when requesting media such as recordings and images for both Voice and Messaging.

MrPHP
  • 152
  • 3
  • 12