Abstracting the PDU for carrier-specific requirements
Peter Beckman <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
So I posted this yesterday, and got a response (thanks Paul Keogh!):
Subject: [Kannel-Users] Re: Unknown TLV -- How to extract?
> SMPP: Unknown TLV(0x1402,0x0004,22312200) for PDU type (deliver_sm)
> received!
>
> Great! There it is, just waiting for me. The question is, on an
> sms-service get-url, how do I pass this information to my PHP script?
You'll need to write code to;
1. Capture the TLV value in the SMPP driver and hold it somewhere in the
Msg struct by either overloading an existing field or adding a new field.
2. Expose the same value in the Msg struct to the send SMS service code
in the SMS Box (smsbox.c) so that the value is passed in the HTTP session
as a CGI param, POST body, XML element, your choice.
And I started thinking that there are probably a lot of people who need to
do just that -- write extra code to grab or set certain parts of the PDU
for carrier or aggregator specific data.
Since, and I believe wisely, the leaders of Kannel don't want to add
specific carrier or aggregator code to Kannel. So let's abstract it.
For submitting SMS's via sendsms CGI, let's add some new fields. Here is
my initial proposal, not knowing squat about PDU's:
user=foo
pass=bar
to=17035551212
from=12345
text=hey+there+buddy
k1=0x1402
v1=0x0001
k2=0x1405
v2=0x0035
What does this do? It allows me to set several (1 to n) specific PDU
modifications via the web interface, without having to muck with the
proposed modified kannel code-base. Now, I'm assuming 0x1402 is an offset,
and thus by defining the value as a dual octet or longer, you decide how
much data you are updating in the PDU. And probably the PDU should be
created, and then modified by each k(n)/v(n) pair after its creation.
On the flip side, add some %k1 and %v1 tags to the URL for sms-service...
get-url =
"http://4.3.2.1/smsin.php?from=%p&to=%P&text=%a&smsc=%i&coding=%c&k1=0x1402&v1=%v1"
Now what I don't know is if I have to give a length? i.e. 2 octets please,
starting at 0x1402. If so, just add a colon after the offset to outline
how many octets to pass to %v1:
...&coding=%c&k1=0x1402:2&v1=%v1
and after processing, %v1 would be 0x0035 (or whatever the value was).
My motivation here is to allow me to screw with the PDU at a deeper level,
so that I can do some really cool stuff and write code in whatever language
I want to help me deal with stupid non-standard SMPP requirements that seem
to be different with each carrier/aggregator.
Thoughts? Has this been proposed and shot down?
Beckman
---------------------------------------------------------------------------
Peter Beckman Internet Guy
[email protected] http://www.purplecow.com/
---------------------------------------------------------------------------