SMS via HTTP no delivery raport | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through April 13, 2018 ⬆ |
◄ ► |
Author | Message | |||
abartas New member Username: Abartas Post Number: 1 Registered: 01-2017 |
Hello, We try use HTTP gateway for sms sending. Sms go out, but we need sms delivery status. How could we get it? Here is our request data and response from nowsms service: request: http://37.232.60.206:8800/?User=xxxxxxxxxx&Password=xxxxxxxxxxxxx&Sender=&PhoneN umber=%2B35555555555&Text=test2&charset=UTF-8&ReceiptRequested=Yes response: "<HTML>\r\n<HEAD><TITLE>Message Submitted<\/TITLE><\/HEAD>\r\n<BODY bgcolor=#cce8ff>\r\n<p>\r\nMessage Submitted\r\n<p>\r\n<a href=\"javascript:history.back()\">Continue<\/a>\r\n<p>\r\n<pre><small>\r\nMessa geID=5812E671, Recipient=+999999999999\r\n<\/small><\/pre>\r\n<p>\r\n<\/BODY>\r\n<\/HTML>\r\n" We have got messageID. How could we use it for getting sms delivery satus? | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5784 Registered: 08-2008 |
Hi, Delivery reports (if supported by the SMSC connection) are received back as inbound SMS messages, which can be processed via a 2-way command. There is more detail on the format here: https://support.nowsms.com/discus/messages/1/69962.html -- Des NowSMS Support | |||
abartas New member Username: Abartas Post Number: 2 Registered: 01-2017 |
its dificult to understand. We have only server, user, pass and web browser. Can you simple explain, what we must to do, to get that delivery status? What is that 2-way command? I guess it can be done by some application, wich using can I do those requests, or no? If yes, where it should be installed. You talk about some windows or command line action... Why is it so complicated? I have messageId, could I do a request to some api and get that delivery status? | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5788 Registered: 08-2008 |
I'm sorry, but it is complicated. NowSMS does not currently maintain a database to track the delivery status of messages. But it does allow you to request a delivery report (if they are supported by your provider). This delivery report can be delivered to you in one of 2 ways: a) NowSMS issues an HTTP command that you define, forwarding the delivery report details. b) NowSMS runs a local program on the Windows machine, forwarding the delivery report details. (This is defined using a 2-way command.) -- Des NowSMS Support | |||
abartas New member Username: Abartas Post Number: 3 Registered: 01-2017 |
OK, first way sounds is ok for us. Second way I must refuse, as we dont use Windows machines and all sms are send from remote server controlled by cron. How should I define that HTTP command? Could you give me an example, plaese? | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5790 Registered: 08-2008 |
I can see where an example would help. That link that I sent you before has a lot of good information, but it is very confusing, and more complicated than it needs to be. There is also one newer feature that is not well documented. So, thank you for your patience....I will try to explain more clearly. Delivery reports will arrive as inbound SMS messages. You can define a 2-way command, such that when the delivery report is received, NowSMS will issue an HTTP request to forward the delivery report details to your application. On the 2-Way page of the NowSMS configuration, make sure that "Process Received SMS Messages" is checked. Press "Add" to define a new command (or "Edit" to modify the command later). For the 2-way command itself, use a keyword of id:*, which will cause only delivery reports to be forwarded to this command. The HTTP request URL will receive the delivery report details via HTTP GET URL parameters. When defining this URL to NowSMS, there are some replaceable parameters. When NowSMS forwards a delivery report, it replaces these parameters with information from the delivery report. A typical implementation would use a URL like this: http://192.168.0.4/receipt.php?number=@@SENDER@@&text=@@FULLSMS@@&@@RECEIPTVARS@@ @@SENDER@@ would be replaced with the original recipient (original "To"). (Confusing terminology, but the delivery report SMS arrives as coming from the number to which the original message was sent.) In this example, your application would parse the "number" parameter to retrieve this value. For example, in a PHP script, use $_REQUEST['number'] @@FULLSMS@@ would be replaced with the text of the delivery report. More on this in a moment. @@RECEIPTVARS@@ is a special parameter. This will be replaced with zero or more of the following variables in the URL (depending on message properties): ReceiptMessageId=xxx specifies that this is a delivery report for the originally submitted message with Message ID xxx. ReceiptDelivered=Yes indicates that the delivery report was successful. ReceiptIntransit=Yes is a delivery report indication that the message was accepted but actual status is not known. ReceiptFailed=Yes is a non-delivery report indicating failure. An example in PHP to determine status:
For more detail on failure conditions, it is necessary to parse the text of the delivery report (@@FULLSMS@@ replacement), which usually looks something like this: id:58469A19 sub:001 dlvrd:001 submit date:1701122121622 done date:170112121639 stat:DELIVRD err:000 text: Text in the message tells you the status of the delivery report. The format is SMSC specific, but generally it is one of the following text strings following a keyword of "stat:" Look for the text that follows "stat:" DELIVRD means successful delivery ENROUTE is an interim OK response (some SMSCs cannot give delivery receipts, and by returning this response it indicates that the message has been queued for delivery, but an actual delivery receipt may not be available) REJECTD means failed or rejected EXPIRED means expired without being delivered DELETED means message was deleted without being delivered ACCEPTD is similar to ENROUTE UNKNOWN means an unknown type of failure Other values can generally be considered failure. -- Des NowSMS Support | |||
abartas New member Username: Abartas Post Number: 4 Registered: 01-2017 |
Is it the only way to define url addrees for delivery status is in that application? But we cannot use it, as our sms gateway is in remote server and operating system is CentOs. Could you define it manually, if I give you our nowSMS user name and our url for delivery status? | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5793 Registered: 08-2008 |
I do not understand your question. I have no access to your server. -- Des NowSMS Support | |||
abartas New member Username: Abartas Post Number: 5 Registered: 01-2017 |
Sorry, for my ignorance. I thought if I define report delivery url, it will be sent to your nowSMS server and when it make callback about delivery status, it uses that url. How does it work? nowSms responses to the server from wich have request for sending sms? If yes, so we dont get any callback from nowSms, how could we catch those delivery statuses I cant understand. | |||
abartas New member Username: Abartas Post Number: 6 Registered: 01-2017 |
Hello, We made all as you explained. The application sends to our local web server info, but those params number=@@SENDER@@&text=@@FULLSMS@@&@@RECEIPTVARS@@ aren't replaced to sms info strings. What do we do incorrect? | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5795 Registered: 08-2008 |
Can you send me a screen capture showing how you have configured this? Or e-mail the SMSGW.INI configuration file to nowsms@nowsms.com with Attention: Des in the subject line of the message. -- Des NowSMS Support | |||
abartas New member Username: Abartas Post Number: 7 Registered: 01-2017 |
ok, I sent our config file via email | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5796 Registered: 08-2008 |
Hi Bartas, I am sorry this is taking so long to resolve. I did see in your configuration that you need to change the keyword from id.* to id:* In other words, change the period "." to a colon ":" I think right now, NowSMS is not sending any delivery reports to your application. I suspect the requests you are seeing which include the @@ variables are manual tests. The next stage for troubleshooting would be to enable the SMSDEBUG.LOG (setting on the Serial # page), and I would like to see that file after you send a few delivery report tests. All this said, I did discover a bug while attempting to recreate your configuration. I do not think you are encountering this bug yet, but you soon will. @@RECEIPTVARS@@ does not currently work for delivery reports from an Android device. You will get the delivery report text, but not ReceiptMessageId=xxx and ReceiptDelivered=Yes Our engineering team created a quick fix update for this problem. An updated build of NowSMS is at https://www.nowsms.com/download/nowsms20170127.zip Run the EXE in the ZIP to update. If you have a purchased license and are unable to install because of expired upgrades, please email me license details and company info, so that we can authorize the update. As before, e-mail these details and/or SMSDEBUG.LOG to nowsms@nowsms.com with Attention: Des in the subject line of the message. -- Des NowSMS Support | |||
abartas New member Username: Abartas Post Number: 8 Registered: 01-2017 |
Hi Des, Everything is working correctly. The app licence is still valid, delivery is arriving. Thank you very much. | |||
abartas New member Username: Abartas Post Number: 9 Registered: 01-2017 |
Hi Des, One more small issue. We would like send also Sender name with sms message. Is it possible? | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5802 Registered: 08-2008 |
Hi Bartas, If the outbound SMSC in NowSMS is a modem, it is not possible to set the sender. The mobile operator will always apply the phone number associated with the SIM card in the modem. For other types of SMSC connections, it depends on what your provider (and their partners) allow. -- Des NowSMS Support |