I have made a same idea but to save in MS SQL I think you have to modify your URL like this:
http://192.168.xxx.xxx:13013/cgi-bin/sendsms?username=axpsmser&password=1q2w3e4r&to=123456789123&text=testMessage&from=1111&smsc=SMSC2&dlr-mask=31&dlr-url=urlencode(http://192.168.xxx.xxx:9876/storeRep.asp?msgid=1&state=%d&msisdn=%p and in the dlr-URL (StorRep) you need to write code to save the id with the status like <%@ Language=VBScript %> <!--#include virtual="/adovbs.inc"--> <% Dim MyDBconn Dim cn, rs Dim M 'End User Message Dim S Dim MessageID Dim MSISDN Dim Encoding 'SMS Message Encoding Dim MyAutoID, strSQL, retSQL M = Request("Type") S= Request("state") MessageID=Request("msgid") MSISDN=Request("msisdn") If MSISDN = "" Then response.End Else MyDBconn="Provider=SQLOLEDB.1;User ID=User;Pwd=pwd;Initial Catalog=DB1;Data Source=xxx.xxx.xx.xx" M=Replace(M,"'","") 'changed by abdulraheem to general DB End If set cn = CreateObject("ADODB.Connection") cn.open MyDBconn 'strSQL ="Update sms_outbox set DLR ='" & S & "', DLRDate= getdate() where recid=('" & MessageID & "')" ' cn.execute(strSQL) strSQL = "Insert into Info_Delivery_Report (status,msisdn,refid,StatusDate) values('" & S & "','" & MSISDN & "','" & MessageID & "',Getdate())" cn.execute(strSQL) response.write("Done") Function ExecuteID(SQL, DBCon) Dim cn, rs Dim AutoID Set cn = CreateObject("ADODB.Connection") Set rs = CreateObject("ADODB.Recordset") With rs 'Prepare the RecordSet .CursorLocation = adUseServer .CursorType = adOpenForwardOnly .LockType = adLockReadOnly .Source = "SELECT @@IDENTITY AS NewID" End With With cn .ConnectionString = DBCon .CursorLocation = adUseServer .Open .BeginTrans .Execute SQL, , adCmdText + adExecuteNoRecords With rs .ActiveConnection = cn .Open , , , , adCmdText AutoID = rs(0).Value .Close End With .CommitTrans .Close End With Set rs = Nothing Set cn = Nothing 'If we get here ALL was Okay ExecuteID = AutoID End Function Function myArabicDecoder(text) On Error Resume Next Dim var2, var1, i For i = 0 To ((Len(text) / 4) - 1) var1 = "&H" & Mid(text, i * 4 + 1, 4) var2 = var2 & ChrW(var1) Next myArabicDecoder = var2 End Function Function myArabicDecoder2(text) On Error Resume Next Dim var2, var1, i For i = 0 To ((Len(text) / 2) - 1) fpart = AscW(Mid(text, i * 2 + 1, 1)) lpart = AscW(Mid(text, i * 2 + 2, 1)) If Len(CStr(fpart)) < 2 Then fpart = "0" & CStr(fpart) If Len(CStr(lpart)) < 2 Then lpart = "0" & CStr(lpart) var1 = "&H" & fpart & lpart var2 = var2 & chrW(var1) Next myArabicDecoder = var2 End Function %> ........................................................... Best Regards Eng: Abdulraheem Ali Obaisi Software Engineer > Date: Wed, 20 May 2009 06:59:13 +0200 > From: [email protected] > To: [email protected]; [email protected] > Subject: Re: message id through sendsms url > > Piyush wrote: > > Hi, > > When I call... > > http://XX.XXX.X.XXX:13013/cgi-bin/sendsms?username=xxxxx&password=xxxxx&to=xxxxxxxxxx&text=hello&from=xxxxx&dlr-mask=31 > > > > it returns 0: accepted for delivery. > > But I want it to return message id. So that, later I can check out the > > status of the message in dlr through these specific message id. > > Put your own message id in the dlr-url parameter, like > dlr-url=http://myhost/dlr.php?myid=12345&status=%d > > Kannel will then call your url with the status and with your id, so you > can update your database. > > See > http://www.kannel.org/download/1.4.3/userguide-1.4.3/userguide.html#DELIVERY-REPORTS > > Arne > > _________________________________________________________________ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/
