**>From: Matthew Hixson <[EMAIL PROTECTED]>
**>Subject: Re: receiving notifications from Kannel
**>Date: Mon, 24 Jan 2005 23:47:44 -0800
**>To: [email protected]
**>

  [ ... lines deleted ... ]

**>
**>Thanks for the reply, Davy.  Here is what I've tried by telnetting 
**>directly to Kannel:
**>
**>GET 
**>/cgi-bin/sendsms?username=foo&password=bar&to=<phonenumber>&text=test 
**>HTTP/1.1
**>Host: hostname.com
**>X-Kannel-DLR-Url: http://my.dev.machine/foo
**>X-Kannel-DLR-Mask: 31
**>
**>Kannel replies with:
**>
**>HTTP/1.1 202 Foo
**>Server: Kannel/1.3.1
**>Content-Length: 5
**>Content-type: text/html
**>Pragma: no-cache
**>Cache-Control: no-cache
**>
**>Sent.
**>
**>And it does not send a request to my machine.  Is there something else 
**>I need to be doing?  Is there some setting in a Kannel config file that 
**>needs to be tweaked to allow the notifications to be sent?

HTTP_GET's and HTTP_POST's use different mechanisms activate the
DLR notification system.  You are mixing both.

If you are issuing an HTTP_GET request, then you need to submit
the information in the cgi parameters like this:
  GET 
/cgi-bin/sendsms?username=foo&password=bar&to=<phonenumber>&test=test&dlr-url=http://host:port/notificatio-url%3Foa=%p&amp;da=%P&amp;smsc=%i&amp;dlr-type=%d&dlr-mask=31

The value of the dlr-url passed via an HTTP_GET must be URL-Encoded.

If you are issuing an HTTP_POST request, then you need to submit
the information as part of the HTTP optional headers:

  POST /cgi-bin/sendsms HTTP/1.0
  X-Kannel-Username: foo
  X-Kannel-Password: bar
  X-Kannel-To: <phonenumber>
  X-Kannel-DLR-URL: 
http://host:port/notification?oa=%p&da=%P&smsc=%i&dlr-type=%d
  X-Kannel-DLR-Mask: 31
  Content-Type: text/plain
  Content-Length: 4

  test

For and HTTP_POST request, the dlr-url does not need to be URL-Encoded.

Don't mixup the HTTP optional headers and cgi parameters. Their usage
are not interchangeable.  This point is not very clear in the userguide.
I'll add that to my TODO list of updates to the docs.

See ya...

d.c.

Reply via email to