HTTP, SMPP and delivery reports...

HTTP, SMPP and delivery reports... SearchSearch
Author Message
Joris Keeman
New member
Username: Netfast

Post Number: 1
Registered: 10-2010
Posted on Friday, October 29, 2010 - 01:43 pm:   

Hi everybody,

Ik need help with the following "problem".

I have my own custom built SMS gateway. I developed my own http api and connections to various SMS providers. Al the business logic is there and works perfectly.

Now some of my potential customers want SMPP connections, but no HTTP connection. I downloaded the nowSMS demo and set it up. I've added my own HTTP api and sending messages though SMPP works perfect.

This is the problem: I would like to put delivery reports back through this SMPP connection... I've read almost every topic here on this forum, but have not found the solution to this.

The HTTP api gives back an SMSid (like this: OK 123456). But nowSMS also creates it own SMSid. How do I connect these 2 together (or replace the nowSMSid with my own http ID)

Next problem: My gateway automatically pushes delivery updates to an URL of the client. How do I connect this URL delivery callback to the nowSMS software. The best situation would be that the DLR is put back to the client through SMPP.
The URL push is like this: URL?id=[httpSMSid]&status=[statusid]&date=[dlr_date]

Any ideas/help/directions...

Thank you in advance!

Joris
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 2598
Registered: 08-2008
Posted on Friday, October 29, 2010 - 07:15 pm:   

Hi Joris,

We do have some hooks for accomplishing this.

I think this thread has the most information: http://support.nowsms.com/discus/messages/1/15186.html

If you search here using a keyword of TrackHttpReceipts, then this will reveal the most information.

I'll try to give a brief explanation of how it works, but as it's not a very common configuration, my recall may not be perfect, so those other searches may be helpful.

Step #1:

Edit the SMSGW.INI, and under the [HTTP - server:port] section, add the following:

TrackHTTPReceipts=Yes
MessageIDResponsePrefix=OK

MessageIDResponsePrefix tells us that we will find the assigned message ID after the text "OK" in the HTTP response.

That may be a problem ... however. I believe that NowSMS parses the entire HTTP response, including HTTP headers for this ... because it is possible that an implementation might return the message ID in a header. The fact that OK is a prefix becomes a problem in this case, because it is likely present in the first line of the HTTP response (HTTP/1.1 200 OK).

I'm not sure how to handle this, unless it is somehow possible for you to modify the response to use some other type of keyword.

One alternative for #1 is if you have a way that allows an HTTP client to pass you a message ID that you can return back in a receipt. If you include @@MessageID@@ in the URL template, NowSMS will includes its message ID in the URL request ... if you can return this back to NowSMS in a delivery receipt, then that will also work.

Step #2:

Assuming that you get past #1, you issue an HTTP request back to NowSMS to generate a delivery receipt.

The URL format is http://server:port/?ReceiptMsgID=xxxxxxxxx&ReceiptDelivered=Yes

I believe you also have to specify "&user=username&passsword=password" to match a defined local "SMS Users" account.

Instead of "ReceiptDelivered=Yes", you can specify "ReceiptFailed=Yes" to indicate failure, but there is no support for including a failure code.

There is also no support for a delivery timestamp .... NowSMS will only use the current time when it receives the receipt.

Hope that helps!

--
Des
NowSMS Support
Joris Keeman
New member
Username: Netfast

Post Number: 2
Registered: 10-2010
Posted on Monday, November 01, 2010 - 04:24 pm:   

Hi Des,

Thank you for your answer! Very clear!
Found most of the parts of your post in various other threats, but not in this clear explination.

So I'll try to implement #1 and #2 (#1 would be sufficient, if #2 works, you made me the happiest man alive!)

I'll post an update when I know more...

Keeping fingers crossed!

Best regards,
Joris
Joris Keeman
New member
Username: Netfast

Post Number: 3
Registered: 10-2010
Posted on Monday, November 01, 2010 - 05:43 pm:   

Hi Des (and others)

This is what I tried:
I changed the HTTP response of my gateway from "OK [messageid]" to "SMPPOK [messageid]"

Added the both settings in the smsgw.ini file.

So #1 should be OK now.

I tried sending through SMPP and it worked like before, so no errors. SMS got sent ok.

Is there any way where I can see if NowSMS used my HTTP messageID as the SMSID?

#2 is not quite clear to me... This is what I did:
Used the user credentials that also sent the SMS. Called the URL: http://[URL]:[PORT]/?ReceiptMsgID=[HTTP_SMS_ID]&ReceiptDelivered=Yes&user=user&p assword=pass

and nothing happens..

I enabled the 2way SMS.
Enabled SMPP access to that user
Enabled the option to route the message to the user. Does not get saved without any info on the sendernumber... Is there a way to add a wildcard? ('*' or something?)



So my next 2 questions are:
- How to obtain the used SMSid?
- How to send the DLR status through SMPP to the user


Extra info:
Only one user uses the SMPP gateway, so no problems with multiple users using this connection.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 2612
Registered: 08-2008
Posted on Tuesday, November 02, 2010 - 08:34 pm:   

If you issue this command from a browser:

http://[URL]:[PORT]/?ReceiptMsgID=[HTTP_SMS_ID]&ReceiptDelivered=Yes&user=user&p assword=pass

Does it return an error response?

That will tell us whether or not NowSMS is recognising the ID.

Another thing to look at ... the SMSOUT-yyyymmdd.LOG from NowSMS. Does it include ";SMSCMsgId=xxxx" ... that will show you what ID was parsed from the HTTP response.

If you are stuck, can you do a capture of the HTTP response to show me ... and tell me what the MessageIDResponsePrefix= setting value is?


--
Des
NowSMS Support