Status from SMSC

Status from SMSC SearchSearch
Author Message
yazeed al tibi
New member
Username: Tibi_tec

Post Number: 1
Registered: 08-2007
Posted on Tuesday, August 14, 2007 - 12:21 pm:   

I am developing an application that connects to an SMSC to send messages using "SMPP over TCP/IP", but I have one issue , I would like to know where to get the delivery status of the SMS ?

I do not want to check the log file , this way I need to parsing the log file and this will take time to know the status of the message
I found the status in the log file (SMSOUT-yyyymmdd.LOG) but I can not depend on it

Example : if I sent SMS message I would like to get the result of delivering the message (acknowledgment ) and trigger an other action if the message has been received by user successfully .

Can you tell me where to get the Message delivering status instead of checking it in the log file ?
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7464
Registered: 10-2002
Posted on Tuesday, September 11, 2007 - 09:34 pm:   

It depends on whether or not your service provider supports delivery receipts.

If they do ...

Then the first thing that you want to do is request a delivery receipt when you submit a message. You do this by including "&ReceiptRequested=Yes" in the parameters of the URL request.

When a message is submitted via HTTP, the HTTP 200 OK response includes text such as the following:

MessageID=54321098.req, Recipient=+xxxxxxxxxx

If the message was posted to multiple recipients, this will be repeated for each recipient.

You can parse the text from this HTTP response to determine the Message id that NowSMS has assigned to the message.

When a delivery receipt comes back into the system, it gets routed to the 2-way command facility.

Normally, the SMSC will prefix the text of all delivery receipts with "id:" ... and if the message is properly formatted as a delivery receipt, but this prefix is not present, NowSMS will reformat the message to include this prefix.

To define a 2-way command specific to processing delivery receipts, define the 2-way command with an "SMS Command Prefix" of id:*

Leave "Receive Phone Number(s)" blank (or in the context of receipts, it would be the sender address of the originally sent message, so you could define different scripts to process receipts for different sender phone numbers).

Then in the "Command to Execute" field, there is a parameter that you can use ... @@RECEIPTMESSAGEID@@, which will contain the message id for which this receipt applies. (This assumes that the service provider returns the message id properly in the receipt.)

You'll normally want to parse the "stat:" or "err:" text out of the text of the delivery receipt message.

For GSM modems, "stat:" will either be "DELIVRD", "ENROUTE", or "REJECTD". For SMPP servers, you might also see "EXPIRED", "DELETED", "UNDELIV" (undeliverable), "ACCEPTD", or "UNKNOWN".

"err:" will be "000" if there is no error, otherwise it will be non-zero.

Unfortunately, this last bit ... determining whether the message delivery receipt is a failure or a success can take some experimenting as the text formats can vary slightly between providers.

-bn