Sending MMS through the Clickatell gateway

1.4k Views Asked by At

I'm trying to send an MMS to my phone via Clickatell. I can send plain SMS, but for MMS I get a 200 return code and an ID, but when the ID is looked up on their site I just get Status 9, that there was a routing error delivering my message.

I'm building the .mms file with a (patched) version of python-messaging:

from messaging.mms.message import MMSMessage, MMSMessagePage

mms = MMSMessage()
mms.headers['To'] = '+1<my phone number>/TYPE=PLMN'
mms.headers['Message-Type'] = 'm-send-req'
mms.headers['Subject'] = 'Test python-messaging.mms'

slide1 = MMSMessagePage()
slide1.add_image('/home/<me>/Pictures/test.jpg')

mms.add_page(slide1)

mms.to_file('test.mms')

I then put the test.mms file in my public Dropbox, and made an HTTP call like so:

r = requests.get('https://api.clickatell.com/mms/ind_push', params={
    'user': <username>,
    'password': <password>,
    'api_id': <api_id>,
    'to': +1<my phone number>,
    'mms_subject': 'test',
    'mms_from': 'testname',
    'mms_class': 80,
    'mms_expire': 10000,
    'mms_url': <public Dropbox link to the .mms file>
})

I then got this:

>>> r.status_code
200
>>> r.text
'ID: <a valid ID>'

But when I look that ID up on Clickatell's website, I get this: MMS Status 9 - Routing Error.

Am I doing something wrong? I feel it's weird that I have to include the to field in both the MMS file and to Clickatell's API, but I can't see anything that I'm doing completely incorrectly.

1

There are 1 best solutions below

0
On

Mobile operators tend to block third parties from submitting MMS messages to recipients on their mobile networks when the MMS message was not generated by a subscriber on a mobile network.

What you may want to do is to send a SMS with a link to the image which a user can click on to open up via their mobile phones web browser.