Auto Response Send by a GATEWAY

Auto Response Send by a GATEWAY SearchSearch
Author Message
Fahad Ahmed
New member
Username: Fahad

Post Number: 23
Registered: 06-2010
Posted on Tuesday, January 29, 2013 - 07:03 am:   

Hey ,
I investigate a very interesting and horrible error or bug

NowSMS Gateway sending an auto-Response SMS without Routing SMS to SMS Command Table in few cases WHY it happens ?

Because it Completely finish my SIM Card balance many time during execution while in the application I strongly restrict the Mobile number and only response to those who are registered to our SYSTEM
Fahad Ahmed
New member
Username: Fahad

Post Number: 24
Registered: 06-2010
Posted on Tuesday, January 29, 2013 - 07:08 am:   

In the SMSOUT file I found this error please check

2013-01-28 17:50:36,506F9D91.req,Auto-response to 7775,7775,OK -- D-Link HSPADataCard Proprietary USB Modem,SubmitUser=localsystem-2way;Text="Command not completed. Request returned invalid content type: text/html"
Fahad Ahmed
New member
Username: Fahad

Post Number: 25
Registered: 06-2010
Posted on Tuesday, January 29, 2013 - 07:12 am:   

Below is the response sent by an application


2013-01-28 17:45:58,506F9D8F.req,Auto-response to +923319163524,+923319163524,OK -- D-Link HSPADataCard Proprietary USB Modem,SubmitUser=localsystem-2way;Text="ABC received Your message :Your message date is: 28/01/2013"
Fahad Ahmed
New member
Username: Fahad

Post Number: 26
Registered: 06-2010
Posted on Wednesday, January 30, 2013 - 11:22 am:   

Awaiting for your response
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4264
Registered: 08-2008
Posted on Wednesday, January 30, 2013 - 07:14 pm:   

Hi,

I'm sorry but I don't understand your question.

If you are asking about: "Command not completed. Request returned invalid content type: text/html"

This means that your 2-way command was processed, but the command returned an HTML (text/html) response.

If you are using the "Command returns response text" setting with an HTTP 2-way command, the script processing the command must return a Content-type: text/plain response, otherwise this error response is generated.

If you are seeing this error only sometimes, it could be the result of a PHP or ASP script error.

The best way to troubleshoot is to enable the SMSDEBUG.LOG. That log will contain a lot of info that is not useful, but it will also include the raw HTTP request and response from the 2-way command. That will allow you to see what the error is that is occurring with your command.

--
Des
NowSMS Support
Fahad Ahmed
New member
Username: Fahad

Post Number: 27
Registered: 06-2010
Posted on Thursday, January 31, 2013 - 08:19 am:   

Thank You for your response :-)

I have checked my ASP file and found no script error.

Mr Des, Is there any way to restrict some Mobile numbers and don't send auto response via now SMS Gateway to restricted Senders ?
Fahad Ahmed
New member
Username: Fahad

Post Number: 28
Registered: 06-2010
Posted on Thursday, January 31, 2013 - 11:16 am:   

16:10:04:130 [9] HttpResponseWait: Ok
16:10:04:130 [9] RetrieveURL: HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 31 Jan 2013 11:10:04 GMT
Content-Length: 0


16:10:04:130 [9] RetrieveURL: Saving keep-alive socket
16:10:04:130 [9] RetrieveURL: got success response
16:10:04:130 [9] RetrieveURL: text/html
16:10:04:130 [9] ThreadProcessInboundSMS: Command not completed. Request returned invalid content type: text/html
16:10:04:131 [9] ThreadProcessInboundSMS: Processing complete 50DCB826.in...
16:10:04:204 [2] ModemReceiveMessages:
OK
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4270
Registered: 08-2008
Posted on Thursday, January 31, 2013 - 11:24 am:   

That log shows the response from your script.

It is an empty response with Content-Type set to text/html.

What are you expecting the response from your script to be?

Look before that in the log and you will see the HTTP request that NowSMS generated. Try that same request from a web browser.

I know you say your script has no error, but check again.

--
Des
NowSMS Support
Fahad Ahmed
New member
Username: Fahad

Post Number: 30
Registered: 06-2010
Posted on Thursday, January 31, 2013 - 11:34 am:   

If I don't send SMS then what should I do ?
Fahad Ahmed
New member
Username: Fahad

Post Number: 31
Registered: 06-2010
Posted on Thursday, January 31, 2013 - 11:38 am:   

Sorry
If I won't send response in some cases then What should I do
Fahad Ahmed
New member
Username: Fahad

Post Number: 32
Registered: 06-2010
Posted on Thursday, January 31, 2013 - 11:48 am:   

My Code
if ( sender == true )
{
Response.Write("ABC received Your message :Your message date is: 28/01/2013")
}
else
{

}

if the authorized sender send sms to our system they will get response SMS and if unauthorized user send SMS to our system I am not sending Response SMS to that sender.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4271
Registered: 08-2008
Posted on Thursday, January 31, 2013 - 11:55 am:   

Make sure your first line of ASP is this:

Response.ContentType = "text/plain"
Fahad Ahmed
New member
Username: Fahad

Post Number: 33
Registered: 06-2010
Posted on Thursday, January 31, 2013 - 12:01 pm:   

I added this line on the top of the method too

One more thing , If I won't send the sms to unauthorized sender above logic Is correct ?
Fahad Ahmed
New member
Username: Fahad

Post Number: 34
Registered: 06-2010
Posted on Thursday, January 31, 2013 - 12:05 pm:   

I tried below link sender is unauthorized

http://localhost:52562/SMSBulk/SMS_Receiver.aspx?sender=Telenor&message=Dear%20C ustomer%20you%20have%20%20bought%207500%20sms%20for%20Rs%2050%20tax%20validity%2 030%20days%20Abhee%20%2A345%2A111%23%20milain%20Kerain%20apnay%20FnF%20ko%20call %20@%20Rs1.5/ghanta%20masaway6pm-10pm@Rs2%20t%20daily


result Blank Page
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4272
Registered: 08-2008
Posted on Thursday, January 31, 2013 - 04:06 pm:   

I can't emphasize too much how important this is:


quote:

Make sure your first line of ASP is this:

Response.ContentType = "text/plain"




Even if your response is blank, NowSMS will generate "Command not completed. Request returned invalid content type: text/html" unless the Content-type: header in the response is text/plain.

When using ASP, the code above sets the content type for the response.

NowSMS will not generate a response if the Content-Type is text/plain and the content is blank.

--
Des
NowSMS Support
Fahad Ahmed
New member
Username: Fahad

Post Number: 36
Registered: 06-2010
Posted on Monday, February 04, 2013 - 06:11 am:   

Thank You for your help

but I have another problem please see the new threat below is the link

http://support.nowsms.com/discus/messages/1/71498.html