Dear All ...
I try to write cherrypy scrip to process incoming msg

here is the script
--------START--cherrypy-------
import cherrypy, urllib

class WelcomePage:
    def dlr(self, k=None, s=None, ss=None, \
        r=None, a=None, b=None, t=None, tt=None, \
        p=None, pp=None, q=None, qq=None, \
        i=None, ii=None, d=None, aa=None, \
        n=None, c=None, m=None, mm=None, \
        cc=None, uu=None, bb=None, o=None, \
        f=None, msgid=None) :

        print "K/A/P :" , k , a , p

    dlr.exposed = True


import os.path
tutconf = os.path.join(os.path.dirname(__file__), 'dlrrcv.conf')

if __name__ == '__main__':
    cherrypy.quickstart(WelcomePage(), config=tutconf)
else:
    cherrypy.tree.mount(WelcomePage(), config=tutconf)
------------STOP---------------

Below is how I test the request using python urllib
-------START---test script---------
import urllib
cpurl='http://127.0.0.1:13888/dlr?'
cpvalue = {'k':'mytest',
    'a':'mytest number 01',
    'p':'+62817111111'}
cpdata = urllib.urlencode(cpvalue)
cpreq = urllib.urlopen(cpurl+cpdata)
print cpreq.read()
------------STOP---------------

The test result
---------START test-script result----
[04/Oct/2011:17:04:26] ENGINE Serving on 127.0.0.1:13888
[04/Oct/2011:17:04:26] ENGINE Bus STARTED
K/A/P : mytest mytest number 01 +62817111111
127.0.0.1 - - [04/Oct/2011:17:08:25] "GET /dlr?a=mytest+number+01&p=%2B62817111111&k=mytest HTTP/1.0" 200 - "" "Python-urllib/1.17"
---------STOP---------------------
Note : So I'm sure the CherryPy Scrip work.

Next : I Try to send msg from my cell to my modem ... with msg "GGG JJJ"
The msg is received by modem and bearer box ... but bearer box did not call the HTTP server.

Here is my kannel config (sms-service part)
group = sms-service
keyword = default
get-url = "http://127.0.0.1:13888/dlr?k=%k&a=%a&p=%p";

Kindly please tell me how to fix it.
I use kannel-snapshot

Sincerely
-bino-



Reply via email to