Assume your web server is located at http://smsexample.com
Now when we send an HTTP request to http://smsexample.com/delivery_report.asp/, this route will be invoked.
This route will be the URL parameter when sending SMS using the Message API.
Sample Code Classic ASP:
- Copy the relevant code below into a text file and save it. Let's call it, 'delivery_report.asp'.
- Customize the delivery report to include the parameters you need.
- This sample code using a SQL insertion to save the DLR data and the status at the SQL DB side.
ASP Sample Code:
<% If trim (request. Form ("mno")) <>"" then Set Con= Server.CreateObject("ADODB.Connection") Con.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=smsexample;Data Source smsexample.com; Password=yourdbpassword" 'Get DLR post data 'Insert DLR information sSQL = "INSERT INTO dlr(sender,sMobileNo,sStatus,sMessageId,dtDone,dtSubmit) VALUES('" & _ request.form("sid") & "','" & request.form("mno") & "','" & request.form("status") & "','" & request.form("msgid") & "','" & request.form("date") & "','" & request.form("date") & "') " sSQL = sSQL & "END" Set rs = con.Execute(sSQL) If rs(0) = "Some Error!" Then Response.Write("nothing") Else ‘DLR been inserted in the DB End If con.Close End if %>
Sample Output
Sid: 1111111111, Mno: 3333333333, Status: delivered, Msgid: 201712261340650311013 Date: 26/12/2017 11:51:37
Note:
- For asp, the route will be smsexample.com/delivery_report.asp
-
In case your web server down or got any tech issue, we will keep retrying to send you the DLR data in interval of 10 min
All rights belong to 1s2u
1s2u.com | Quality SMS Solutions