On Sat, Aug 16, 2008 at 10:21 AM, James Mubhoyi <[EMAIL PROTECTED]> wrote:
> When I receive an sms message via my GSM modem, no record insertion is
> made into the dlr table and likewise when I send an sms message through a 
> python
> script no record insertion is made either as I thought would happen.

drl record insertion is done only for the sent messages


> p = urllib.urlencode({'username': 'smsman', 'password': 'karooland', 'to': t,
> 'text': x, 'dlr-mask': 31, 'dlr-url':
> 'http://www.xyz.co.za/dlr/grabdlr/?status=%d&smsc-id=%i&answer=%A&to=%p&from=%P&ts=%t&service=%n'})

The drl-rurl look fine, but you are not calling the sendsms cgi-bin to
send the sms.

For example if you are using the sendsms cgi-bin than the complete url would be:

http://localhost:13000/cgi-bin/sendsms?username=USER&password=PASS&from=FROM&to=TO&text=TEXT&dlr-mask=DLR-MASK&dlr-url=DLR-URL

All string parameters should be url encoded.

The above url tells to Kannel to send a sms to some MSISDN using some
user, and to set delivery report handler on the url drl-url which will
be triggered on the dlr-mask events.

You have to pass the dlr-mask  and dlr-url parameters for each message
that you want to receive delivery report.


You are missing to set the url of the kannel sendsms in your Python script.
I've just added a line in it defining the url for sendsms and changed
the urlopen, try this one:

#!/usr/bin/python

import sys
import urllib
import re

u = 'http://localhost:14000/cgi-bin/sendsms'
p = urllib.urlencode({'username': 'smsman', 'password': 'karooland', 'to': t,
'text': x, 'dlr-mask': 31, 'dlr-url':
'http://www.xyz.co.za/dlr/grabdlr/?status=%d&smsc-id=%i&answer=%A&to=%p&from=%P&ts=%t&service=%n'})
f = urllib.urlopen(u, p)
print f.read()
f.close()




HTH, Jovan

Reply via email to