SMS sent confirmation?

SMS sent confirmation? SearchSearch
Author Message
Kristian Hals
New member
Username: Khals

Post Number: 1
Registered: 02-2008
Posted on Monday, February 04, 2008 - 03:26 am:   

Is it possible to get a "SMS message successfully sent" confirmation using a PHP script so a given user can be billed for this?
Simranjit Singh
New member
Username: Manchanda_17

Post Number: 35
Registered: 06-2007
Posted on Thursday, February 07, 2008 - 03:59 pm:   

Don't you have a MT Url for this which automatically charges customer on reciving the SMS
Kristian Hals
New member
Username: Khals

Post Number: 7
Registered: 02-2008
Posted on Friday, February 08, 2008 - 12:57 am:   

Hi Samranjit
I don't know what you mean by "MT Url", but the site I'm building works something like this: The user registers on my website and pays for a certain service. Each time a SMS message is sent, from the website to Now SMS, this is billed to the user on the website.
This is not a problem, but I need to make sure that the message has been successfully sent by Now SMS, so that the customer doesn't have to pay for it, if the message never arrived in the first place.

I hope this is clear enough :-)
Kristian Hals
New member
Username: Khals

Post Number: 8
Registered: 02-2008
Posted on Friday, February 08, 2008 - 12:59 am:   

Sorry, I was a bit to fast on the submit button there.. Basicly I need a response from Now SMS when the message is being sent to it through HTTP :-)
Kristian Hals
New member
Username: Khals

Post Number: 11
Registered: 02-2008
Posted on Monday, February 11, 2008 - 07:09 am:   

Is Now SMS' support staff on holiday or something?
Kristian Hals
New member
Username: Khals

Post Number: 13
Registered: 02-2008
Posted on Monday, February 25, 2008 - 10:00 pm:   

Please help :-(
Marrakech
New member
Username: Walou

Post Number: 10
Registered: 11-2007
Posted on Wednesday, February 27, 2008 - 10:58 am:   

Hi Kristian,

"SMS message successfully sent" means Delivered.
If you use Smpp connection, you should:
- Add the tag: ReceiptDelivered=Yes into the http url.
- Configure an 2-Way Command via Now SMS based on a prefix (for more info, check the .pdf manual "2-Way SMS Support", Page 220)

this is a small 2-way php example:

<?
header ("Content-Type: text/plain");

/*
Get Requested fields (check the manual for more infos (Page 41)
*/
$champs = array(
array('MessageID', $_REQUEST['messageid']),
array('Recule', $_REQUEST['MSGDATE']),
array('Time', $_REQUEST['MSGTIME']),
array('sender', $_REQUEST['sender']),
array('message', $_REQUEST['message']),

/*
and the, insert query into sql/mysql

i'm not a php expert, but there are a many way to do that !

to store exactly the Delivery Tag, u can use "preg_match" php function
*/
?>

Hope that help

Abid
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7526
Registered: 10-2002
Posted on Wednesday, February 27, 2008 - 09:03 pm:   

I'm not sure that I understand the original question.

Let me explain what I mean ... when do you want this confirmation?

a.) When the user submits the message to NowSMS?

b.) When NowSMS submits the message to the upstream SMSC?

c.) When the upstream SMSC reports that the message is delivered?

Accouting callbacks ... http://www.nowsms.com/support/bulletins/tb-nowsms-001.htm ... are the answer to "a". You get a callback before NowSMS accepts the message from the user (so that you can verify that they have a credit balance/rights in your application) ... and you get a callback after NowSMS accepts the message.

If you want to be notified of "b", there is an additional callback that is not described in the link above. In fact, hmm ... I can't find it documented anywhere ... but it does, in fact, exist. The "Type=" value for the callback is "SMSOut", and it indicates when a message has been dispatched from NowSMS to the upstream SMSC. It follows the same format (and URL) as the other callbacks.

I should probably mention that these accounting callbacks have been updated considerably in the last 5 years (since the link I referenced above was written). There are additional variables in the callbacks, including complete details about the message, including its text.

If you're after "c" ... that is more complex. You need to enable receipt requests for all submitted messages (see http://support.nowsms.com/discus/messages/1/23657.html). And then in most SMPP environments, the delivery receipts come back as inbound messages that start with the text "id:". You'd need to route these messages to a 2-way script for processing. (And the description gets a bit more complicated from here ... I don't want to get into it all here unless that is what you are actually asking about.)

-bn