Inbound MMS documentation seems incorrect, MMS file present but not displaying

Status
Not open for further replies.

iaindooley

New User
Joined
Oct 24, 2023
Messages
13
Reaction score
3
Hi there,

Firstly, the MMS documentation here appears to be incorrect:

https://www.3cx.com/docs/supported-sip-trunk-requirements/#h.9lv8vi548lbk

The SMS documentation has the from/to/text inside a payload element, but the MMS documentation does not.

I implemented my initial POST to the 3CX webhook as per the documentation but MMS did not work, even though SMS did.

On a hunch, I tried simply adding a media element to my SMS payload, and that produced a better result, but still not all that good.

Firsly, when I post a PHP link that downloads an image, it doesn't render as an image. Okay so maybe it needs the link to end with a .jpg or something, that's fine.

So I tried with a JPG path:

https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg

But it sits there with a "loading" graphic infinitely.

The size, type and sha256 params in the MMS API documentation are all "null" so I assumed they were optional.

However I thought, maybe it's forever downloading and not displaying the preview because it doesn't know the size and type.

So I tried posting with size, type and sha256 parameters, like this:

{
"data": {
"id": "2023-10-29T08:59:59.171Z",
"type": "MMS",
"event_type": "message.received",
"payload": {
"id": "2023-10-29T08:59:59.171Z",
"type": "MMS",
"from": {
"phone_number": "+614xxxxxxxx"
},
"to": [
{
"phone_number": "+614xxxxxxxx"
}
],
"text": "This is hard coded",
"received_at": "2023-10-29T08:59:59.174Z",
"media": [
{
"url": "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg",
"content_type": "image/jpeg",
"size": 280576,
"sha256": "ec8ff0a6954a5f54e4ad246f0a788d076f675e457bca16a04248718cca3fe631"
}
]
}
}
}

Now, the picture is present, but doesn't display as an image in the thread, and I can't download it.

Note that in the SMS documentation, it says the following:

-------
Providers may extend this message with other data if needed. However, these are the required fields to be specified:
  • data.id
  • data.event_type
  • data.payload.from.phone_number
  • data.payload.to.phone_number
  • data.payload.text
  • data.payload.received_at
-------

No corresponding note is attached to the MMS documentation, but since the MMS documentation also appears to be inaccurate regarding the "payload" element, I'm skeptical as to whether or not filling in all those additional details will make a difference (I also don't know what most of them should be set to).

See attached a screenshot showing what the received MMS messages look like in my 3CX interface.
 
Oh, it appears I missed the attachment
 

Attachments

  • Monosnap Chat - 3CX 2023-10-29 20-34-01.png
    Monosnap Chat - 3CX 2023-10-29 20-34-01.png
    142.7 KB · Views: 20
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
111,973
Messages
590,075
Members
164,895
Latest member
jasonkkrause