diff --git a/main.js b/main.js index c13e68b..3f9b7e6 100644 --- a/main.js +++ b/main.js @@ -353,11 +353,29 @@ function sendMMS(number, from, mediauri, mimetype, callback) { httpmediaurl = httpmediaurl.replace("{{server-name}}", urichunks[2]); httpmediaurl = httpmediaurl.replace("{{media-id}}", urichunks[3]); + + var body = ""; + var media = [httpmediaurl]; + + switch (mimetype) { + case "image/jpeg": + case "image/png": + case "image/gif": + case "image/bmp": + // These are likely to work, so don't include the URL + body = ""; + break; + default: + // Send link to content as SMS, don't send actual content + body = httpmediaurl; + media = []; + } + var data = { to: [number], from: from, - body: httpmediaurl, - media: [httpmediaurl] + body: body, + media: media }; const jsondata = JSON.stringify(data); const options = {