2-Way store to DB

2-Way store to DB SearchSearch
Author Message
Rizki Gunawan
New member
Username: Mgunawan

Post Number: 2
Registered: 11-2006
Posted on Friday, December 01, 2006 - 12:41 am:   

i have script in asp like this

<%
Response.ContentType = "text/plain"

If Request.QueryString("sender") = "" Then
Response.Write ("ERROR : 'sender' parameter missing!")
ElseIf (Request.QueryString("text") = "") Then
Response.Write ("ERROR : 'text' parameter missing!")
ElseIf (Request.QueryString("date") = "") Then
Response.Write ("ERROR : 'date' parameter missing!")
ElseIf (Request.QueryString("time") = "") Then
Response.Write ("ERROR : 'time' parameter missing!")
Else
sender = Request.QueryString("sender")
message = Request.QueryString("text")
datetime = Request.QueryString("date") + "-" + Request.QueryString("time")

Set Cn = CreateObject("ADODB.Connection")
cn.Open "Provider=SQLOLEDB; uid=***; pwd=***; Data Source=MYSERVER; Initial Catalog=MYDB"
cn.Execute "Insert Into DT_SMS_IN (NoHP, Message, DateTime) Values ('" + sender +"','" + message +"','" + datetime +"')"
End If
%>


that's script I save to inSMS.asp, then I set in 2-Way like this.

http://myhost/NowSMS/inSMS.asp?sender=@@SENDER@@&text=@@FULLSMS@@ &date=@@MSGDATE@@&time=@@MSGTIME@@

but ..., when I send SMS to modem, that message did not save to MYDB, does any body know what wrong with that ?
Rizki Gunawan
New member
Username: Mgunawan

Post Number: 3
Registered: 11-2006
Posted on Tuesday, December 05, 2006 - 01:32 am:   

Addtional Information SMSDEBUG.LOG
------------------------------------
07:46:47:078 [3] ThreadProcessModem: Modem initialization complete: COM1:
07:57:50:770 [3] ModemReceiveMessages:
+CMGL: 1,0,,75
07912658050000F0040C9126181651625000006021507075558240F4F29C0EA297F1F4179ADE6683 E86172DA9D0F83CA72F95BDE6840994750D2497C4E8354D092BA04498B47D094085A4A9BA0651184 C3D970

OK

07:57:50:770 [3] ModemReceiveMessages: Decoding received message index 1 from message storage SM
07:57:50:770 [3] ModemReceiveMessages: 07912658050000F0040C9126181651625000006021507075558240F4F29C0EA297F1F4179ADE6683 E86172DA9D0F83CA72F95BDE6840994750D2497C4E8354D092BA04498B47D094085A4A9BA0651184 C3D970
07:57:50:770 [3] ModemReceiveMessages: SMSC address len = 7
07:57:50:770 [3] ModemReceiveMessages: SMSC Address = +62855000000
07:57:50:770 [3] ModemReceiveMessages: SMS Message Type = SMS-DELIVER
07:57:50:770 [3] ModemReceiveMessages: Sender address len = 12
07:57:50:770 [3] ModemReceiveMessages: Sender Address = +628161152605
07:57:50:770 [3] ModemReceiveMessages: PID = 00
07:57:50:770 [3] ModemReceiveMessages: DCS = 00
07:57:50:770 [3] ModemReceiveMessages: Anticipated user data length = 64
07:57:50:801 [3] ModemReceiveMessages: Message = test text/html tadinya error

PLG INDOSAT KTK REG SD KRM KE 8868
07:57:50:832 [3] ModemReceiveMessages: AT+CMGD=1

07:57:51:503 [4] ThreadProcessInboundSMS: Processing 4574C02D.in...
07:57:51:503 [4] GetProgramToExecute: http://subserver/NowSMS/inSMS.asp?sender=@@SENDER@@&text=@@FULLSMS@@ &date=@@MSGDATE@@&time=@@MSGTIME@@
07:57:51:503 [4] GetProgramToExecute: http://subserver/NowSMS/inSMS.asp?sender=%2B628161152605&text=test%20text/html%2 0tadinya%20error%0D%0DPLG%20INDOSAT%20KTK%20REG%20SD%20KRM%20KE%208868 &date=20061205&time=075750
07:57:51:503 [4] ThreadProcessInboundSMS: Executing http://subserver/NowSMS/inSMS.asp?sender=%2B628161152605&text=test%20text/html%2 0tadinya%20error%0D%0DPLG%20INDOSAT%20KTK%20REG%20SD%20KRM%20KE%208868 &date=20061205&time=075750
07:57:51:503 [4] RetrieveURL: Retrieving http://subserver/NowSMS/inSMS.asp?sender=%2B628161152605&text=test%20text/html%2 0tadinya%20error%0D%0DPLG%20INDOSAT%20KTK%20REG%20SD%20KRM%20KE%208868 &date=20061205&time=075750
07:57:51:503 [4] RetrieveURL: Looking up subserver
07:57:51:503 [4] RetrieveURL: Retrieving NowSMS/inSMS.asp?sender=%2B628161152605&text=test%20text/html%20tadinya%20error% 0D%0DPLG%20INDOSAT%20KTK%20REG%20SD%20KRM%20KE%208868 &date=20061205&time=075750
07:57:51:503 [4] RetrieveURL: GET /NowSMS/inSMS.asp?sender=%2B628161152605&text=test%20text/html%20tadinya%20error %0D%0DPLG%20INDOSAT%20KTK%20REG%20SD%20KRM%20KE%208868 &date=20061205&time=075750 HTTP/1.1
User-Agent: Now SMS/MMS Gateway v2006.10.30
Accept: */*
Connection: Close
Host: subserver


07:57:51:519 [4] HttpResponseWait: Ok
07:57:51:519 [4] RetrieveURL: got http error response
07:57:51:519 [4] RetrieveURL: text/html
07:57:51:519 [4] ThreadProcessInboundSMS: HTTP response indicates error
07:57:51:519 [4] ThreadProcessInboundSMS: HTTP/1.1 400 Bad Request
Server: Microsoft-IIS/5.0
Date: Tue, 05 Dec 2006 00:57:51 GMT
Content-Type: text/html
Content-Length: 87

<html><head><title>Error</title></head><body>The parameter is incorrect. </body></html>
07:57:52:081 [3] ModemReceiveMessages:
OK


--does any body help me ... please ---
Lars Nielsen, MobileNation ApS - Denmark
Frequent Contributor
Username: Larsmservice

Post Number: 275
Registered: 10-2003
Posted on Wednesday, December 13, 2006 - 11:34 am:   

<%

Response.ContentType = "text/plain"

If Request.QueryString("sender") = "" Then
Response.Write ("ERROR : 'sender' parameter missing!")
ElseIf (Request.QueryString("text") = "") Then
Response.Write ("ERROR : 'text' parameter missing!")
ElseIf (Request.QueryString("date") = "") Then
Response.Write ("ERROR : 'date' parameter missing!")
ElseIf (Request.QueryString("time") = "") Then
Response.Write ("ERROR : 'time' parameter missing!")
Else
sender = Request.QueryString("sender")
message = Request.QueryString("text")
datetime = Request.QueryString("date") + "-" + Request.QueryString("time")

Set Cn = CreateObject("ADODB.Connection")
cn.Open "Provider=SQLOLEDB; uid=***; pwd=***; Data Source=MYSERVER; Initial Catalog=MYDB"
cn.Execute "Insert Into DT_SMS_IN (NoHP, Message, DateTime) Values ('" & sender & "','" & message & "','" & datetime & "')"
End If

%>
Khusnul Fajri Rhomadon
New member
Username: Khusnulf12345

Post Number: 1
Registered: 12-2006
Posted on Sunday, December 17, 2006 - 07:02 am:   

i don't know save outgoing sms to db, can you help me?
Malcolm - Now Support
New member
Username: Malcolm

Post Number: 27
Registered: 12-2006
Posted on Monday, December 18, 2006 - 06:38 pm:   

Hi,

The easiest way to save outgoing SMS to a database would be to add them to the database when you submit them.

However, if you want to capture them through NowSMS, you can using the accounting callbacks. With these callbacks, NowSMS will call an HTTP link that you configure every time a client submits a message to NowSMS.

The following URL link describes the accounting callbacks:

http://www.nowsms.com/support/bulletins/tb-nowsms-001.htm

What the above link does not mention is that in NowSMS 2006, the SMS accounting callbacks were extended to also include the following parameters:

“&SubmitIP=” (IP address of submitting client)
“&Sender=” (sender address of SMS message)
“&Binary=” (set to 1 if message is binary)
“&PID=” (Protocol ID), “&DCS=” (data coding scheme value)
“&UDH=” (user data header)
“&Data=” (hex string with message data for binary messages)
“&Text=” (UTF-8 text of message).


--
Malcolm
Now Wireless Support