I'm using Asterisk with chan_dongle (and Huawei UMTS stick) on Debian Wheezy. I can send and receive SMS successfully. The 7-bit de/encoding work is done by a simple PHP script.
My problem is, that I can't receive concatenated SMS. This is the Base64 text from two different messages:
Ym9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVX
WHNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVs=
CENdV0tBTH1lQUhLU11LQShLU1ldQ1FbS0FCXUFIS2VBYENzZ0NNS0dDZUlbAldpU19dXUAIS1NdS0FgS2VneV1ZU0dRS0FgQ3NnQ01LR0NlSUEEX11rZ0EgEx1BUGpACislU0BYQ2tpS2l1QEBgcGBsQGxyaHJAaHJiYkBubGBkdkAmS2VTS11da1tbS2V1cmJiZmxsbmxo
XEAOfVlpU09BRFNnQWZiXGBwXGRgYmhcAA==
The first one is a simple repeating "qwertz..." dummy text, sent from my Android phone.
The second one is a (German) reply from a service provider with a coupon code.
The first one looks easy to decode. 7/8 bit magic and we're done.
But the second one is really strange. Any ideas how to decode it?
There is only way to deal with multipart SMS is working as PDU with it and concatenating in your application.
Related
I would like to add a "Text Me" form to my website that will allow users to type their Name, Phone Number, and a Message that i receive on my phone via SMS. I would prefer something easy and free, perhaps a code snippet. Does anybody have any suggestions for a "Text Me" form or a service that provides one?
A quick google-search reveals (at least for German) customers: lox24.eu - they have a VERY simple way for sending SMS:
https://www.lox24.eu/API/httpsms.php?konto=<yourId>&password=<yourPassword>&service=<yourTariff>&text=<SMSText>&from=<yourSender>&to=<receivingNumber>
All you have to do, would be creating a short text from the $_POST variables of your form and then do a HTTP-request (preferrably cURL) from within the PHP-page that receives the form-data.
You might try to google for "websms api" to find a SMS-gateway in your country that provides the services you need.
HTH
^KMP
I recommend If This Then That. You can hit a simple web backend, supplying a JSON payload, and IFTTT will then send an SMS to your cell with the payload text, or whatever text you want.
Maker channel: https://ifttt.com/maker
SMS channel: https://ifttt.com/sms
IFTTT will abstract away the specifics of how the text is sent (doesn't matter what carrier, what country, etc.) and it will (probably) break the text into properly sized chunks. If not, you might have to do that yourself, though - just use substr() to divide the text payload into chunks of 160 characters and hit the backend as many times as necessary for the message to be sent.
You can use raw cURL to hit the backend, but I find that Guzzle is a great PHP library for making web requests of any kind.
A lot of mobile carriers in the US (not sure about abroad) will have a text equivalent email. For example, AT&T will text you if you send an email to yourmobilenumber#txt.att.net. Its free.
I'm a bit confused here and due to the keywords involved Google has not been much help. I want to send text messages from my website to users with cellphones via SMS. Sounds simple enough using things like 1234567890#carrier.com with php mail scripts right? Well one thing I've encountered before is that sometimes it sends an MMS(multimedia message) instead of a regular text message.
What I am trying to find out(using keywords in Google, send text message phone number php) is how to get a phone number for your website? I've seen sites that actually have a phone number linked to the site that you can receive messages from.
Example Facebook uses 32665 to send and receive messages on.
How do you accomplish this?
Is it any way possible using the 1234567890#carrier.com with php mail to strictly only send a text message and not multimedia?
Example php mail script using a phone number:
<?PHP
mail("5558349324#vtext.com", "", "Test SMS", "From: RRPowered <test#rrpowered.com>rn");
?>
Also thanks to any help ahead of time, because I am really really confused at this point.
UPDATE: I just tried using the regular PHP mail functions to a phone number and it appears to cut the messages off at around 140 characters(I believe that is standard message size).
UPDATE 2: Before anyone mentions API like Text Magic, I am aware of those things, BUT I am wanting to build my own code instead of integrating someone elses API(if possible).
i have studied and implemented Ray wenderlich's awesome tutorials on apns, and i am using this php script on server side
https://github.com/sebastianborggrewe/PHP-Apple-Push-Notification-Server
every thing is going well, but i just want to know that how can i send push notification in a language other than english, like arabic, urdu, hindi or french...???(i am sending notifications from php server using a web form) this is first part of question, the other part is that can i send a voice message with push notification, i know that there is a property for sound in apns but dont know its max. length (max length of push notification is 256 bytes). plz. guide me thanx and Regards Saad.
Sound support is limited to playing audio files of the app (you include PushSound.aiff in your app and send "PushSound.aiff" in your apns-message.. that's all you can do!)
For localization, you [need to include localized strings in your app and then include the String-Key(ID) in the push message.
You should read the guide apple provides for all questions regarding push notifications
To add localized strings, you can add a strings file (file->new, select iOS/Resource->Stringsfile; name it Localizable.strings). You can add format strings ("%# has sent you a new message") and supply the format string's arguments in the push notification (see guide).
Again there is a internationalization guide
How can I include a url in an outgoing text message using twilio API? I tried, but the message was not sent. Is there a specific format? syntax?
Update:
Here's the code: (I am using the php api)
Perhaps the problem is with using a variable in the link? or maybe in a different format?
$sms = $client->account->sms_messages->create(
"xxx-xxx-xxxx",
$send_to_number,
"Hey $var1. words words $var2. via example.com.
see: https://graph.facebook.com/$fb_id/picture");
The example.com link works perfect, so do $var1 and $var2. But when adding the last link which includes a variable (and it is from facebook graph api, but I don't think that matters), then the message is not sent. Is there any way to solve this without url shortener?
SMS messages sent via Twilio are limited to 160 characters because carriers will break messages up into 160 character sized chunks. These chunks doen't necessarily arrive in order, so it is recommended to send some sort of pagination along with the message if you expect it to be over 160 chars.
https://www.twilio.com/help/faq/sms#sms-technical-3
The official Twilio PHP helper library will error out if you attempt to send a message longer than 160 characters.
Something else to watch out for: if you break your message into two lines like you have done here, PHP will include the characters you used for indentation in the message, so the above code will produce an SMS message that looks like this:
Hey $var1. words words $var2. via example.com.
see: https://graph.facebook.com/$fb_id/picture
The message is too long.
There is a limit of characters in a twilio message. This has nothing to do with the variable. It now works, just shortened the text.
Twilio recently updated their api. You can now send messages longer than 140 characters.
Such messages will be automatically split into pieces for each carrier.
i have an iphone 3g and can successfully send text messages using the PHP mail() function. My issue is that for each message i receive, the "telephone number" associated with the incoming text message changes each time. If possible, I would like to somehow make this number constant so that I can take advantage of iphone's ability to aggregate all text messages from the same telephone number -Otherwise my iphone would be cluttered with messages. Is there a way to do this?
an example of the numbers I receive would be 1(410) 000-001, 1(410) 000-002, 1(410) 000-003, etc... can i make this constant somehow?
$message = stripslashes("new user just joined!");
mail("8185551111#txt.att.net", "Subject", "$message");
please let me know! thanks...
This is likely more to do with ATT than your PHP code.
This is a limitation of the carrier's email-to-SMS gateway. There's no way to guarantee which number the message will come from.
SHAMELESS PROMO: You could use a service like Twilio (whom I work for) and get a phone number for $1/month which you would be able to always send from. There's a ton of PHP sample code to get you started. There are other SMS APIs out there as well so look around and find the one that you like best.