Duplicates

Duplicates SearchSearch
Author Message
Mike
New member
Username: Messageguy1

Post Number: 8
Registered: 01-2009
Posted on Tuesday, February 03, 2009 - 04:49 pm:   

My previous post, entitled "quick question" which became rather involved, led me to finally stop using a 2-way scenario ( i unchecked the 'expects text' checkbox) for communication to a user's cellphone.

My idea here is that the user will send an sms to the gateway phone #, and the gateway hands off the query to the php code to process. It seems whenever it has to process the msg using my google geolocation webservice, it *occasionally* messes up and has to send multiple msgs. When it serves a cached result it's fine. I don't understand how the webservice (using curl) is the problem.. I only have one place in my code where it ultimately sends text out to the gateway to send to the user's cell phone..There aren't any infinite loops or spots where a function would be called several times..

What I noticed is that if i send one query, and let's assume it "messes up", i'll see a few of the same query in the smsin.log, even though I only sent one. In addition, i'm still getting the following error in the logs:


10:18:22:342 [4] HttpResponseWait: Expected 0 bytes, got 0 bytes
10:18:22:342 [4] HttpResponseWait:
10:18:22:342 [4] RetrieveURL: timeout waiting for response

But i thought there is no response anymore, now that i'm not using the 'expects results' feature?
yet when it gets this msg, it still tries to send over and over again.

In my previous post, the gateway was set to 'expect a response', so i could understand why it would try to hit the php script multiple times to try to get a result, however now that it's not set, wouldn't it just faithfully hand off all text to the script and have no reason to send anything again, or care about what happens?

Any ideas about why this would happen? sometimes I get 5-6 duplicates of the same output.
Thanks again
Mike
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 414
Registered: 08-2008
Posted on Tuesday, February 03, 2009 - 06:04 pm:   

Hi Mike,

I understand your confusion.

However, even though NowSMS does not care what the content of the response is, it wants to see a valid HTTP response (e.g., 200 OK) come back from the web server. This is an acknowledgement that the web server has received the request and was able to process it.

If we didn't require this response, then there is a likelihood that messages would be lost.

The underlying problem remains that there are times where we are waiting 2 minutes for a response to come back from the server, and it never comes. That does require some investigation, most likely with a protocol analyzer like WireShark, and/or additional debug code in your script. (Unfortunately, I believe WireShark would require the web server and NowSMS to be on different machines.)

As you are having problems with duplicates, there is a solution for this. If you include @@MESSAGEID@@ in your 2-way command, this will be replaced with the message id of the message being processed. If you are receiving duplicates because of HTTP transaction problems, you can detect it if you receive a duplicate @@MESSAGEID@@.

--
Des
NowSMS Support