Config-based Optional Parameter Functionality
Peter Beckman <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear Kannel Developers:
I've written about this before, but I thought I would bring it up again
because I hate patching.
Many SMSC's are starting to use the optional SMPP parameters for
information like billing issues, carrier failures, etc. Kannel really
doesn't allow for this -- it detects the parameters, but is unable to
actually turn them into some sort of passable escape code(s) via
sms-service.
Take for example this log dump:
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter tag (0x0427)
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter length read as 1
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter tag (0x001e)
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter length read as 29
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter tag (0x1402)
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter length read as 1
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter tag (0x1404)
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter length read as 22
2005-01-27 16:46:56 [30186] [7] ERROR: SMPP: Unknown TLV(0x1404,0x0016,4154265420576972656c657373205365727669636573) for PDU type (deliver_sm) received!
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter tag (0x1530)
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter length read as 3
2005-01-27 16:46:56 [30186] [7] ERROR: SMPP: Unknown TLV(0x1530,0x0003,504244) for PDU type (deliver_sm) received!
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter tag (0x1531)
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter length read as 90
2005-01-27 16:46:56 [30186] [7] ERROR: SMPP: Unknown TLV(0x1531,0x005a,4e6f2050686f6e65204e756d6265723a20537562736372696265722070686f6e65206e756d62657220776173206e6f74206d617463686
56420696e2074686520515073732073797374656d206f722041575320506f7274616c20) for PDU type (deliver_sm) received!
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter tag (0x1532)
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter length read as 6
2005-01-27 16:46:56 [30186] [7] ERROR: SMPP: Unknown TLV(0x1532,0x0006,2d3230313030) for PDU type (deliver_sm) received!
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter tag (0x1533)
2005-01-27 16:46:56 [30186] [7] DEBUG: Optional parameter length read as 90
2005-01-27 16:46:56 [30186] [7] ERROR: SMPP: Unknown TLV(0x1533,0x005a,4e6f2050686f6e65204e756d6265723a20537562736372696265722070686f6e65206e756d62657220776173206e6f74206d617463686
56420696e2074686520515073732073797374656d206f722041575320506f7274616c20) for PDU type (deliver_sm) received!
2005-01-27 16:46:56 [30186] [7] DEBUG: SMPP[mysmsc]: Got PDU:
2005-01-27 16:46:56 [30186] [7] DEBUG: SMPP PDU 0xb5c9a5e0 dump:
2005-01-27 16:46:56 [30186] [7] DEBUG: type_name: deliver_sm
2005-01-27 16:46:56 [30186] [7] DEBUG: command_id: 5 = 0x00000005
2005-01-27 16:46:56 [30186] [7] DEBUG: command_status: 0 = 0x00000000
2005-01-27 16:46:56 [30186] [7] DEBUG: sequence_number: 877 = 0x0000036d
[...]
My dream for the config file:
group = smsbox
smsc-id = mysmsc
[...]
optparam = 0x1404:22:N:billerr_msg
optparam = 0x1530:3:M:happy_tag
optparam = 0x1531:90:K:secret_code
optparam = 0x1532:6:J:test_msg_id
optparam = 0x1533:90:L:secret_code2
Now the following takes place:
When an SMS arrives, it can be passed to sms-service, using %N, %M, %K,
%J and %L (assuming those are available), so I can grab them with a PHP
script and do something with them.
When submitting an SMS to kannel, I can set the URL to:
http://localhost:13013/cgi-bin/sendsms?user=[...]&billerr_msg=you+spent+too+much&happy_tag=fun&text_msg_id=123FFF
And kannel will modify the PDU to include the data passed and send that
to the SMSC.
That is my dream.
Beckman
---------------------------------------------------------------------------
Peter Beckman Internet Guy
[email protected] http://www.purplecow.com/
---------------------------------------------------------------------------