Hi,
I knew very little about TON and NPI before, but I'm learning fast now.
When we give a message to kannel to send it to a SMSC, and the destination
number is a normal 10-digit raw number, kannel sends it with TON/NPI of 2/1
.
(I believe TON=2 means "national number").
It appears that at least one of our SMSC's is configured in this way:
When kannel gives it a message to send to the customer, this default
TON of 2 works fine only as long as the destination number begins
with 04 or 61 (61 being Australia, our country code).
Our SMSC treats any other number as "international" and will reject
the message unless we send the message with a TON of 1
("international number").
But how do we get kannel to 'recognize' an international number
and therefore set the correct TON? There is very little about TON/NPI
in the user guide unless I'm missing something.
A couple of ways that I could find:
a) If you give kannel a destination number and explicitly prefix it with "+"
(must be URL-encoded as %2B or it won't work), then kannel treats it
as an 'international' number and automatically sets the TON to 1.
According to http://www.kannel.org/pipermail/devel/2006-July/000067.html,
this is the "only" method that kannel uses to distinguish between
national and international numbers.
Is that the case?
So our application would have to be modified to put a "+" in front of
an "international" number, before pushing it to kannel.
b) In kannel's smsc configuration, the following setting could be made in
order to force the TON to 1 no matter what.
dest-addr-ton = 1
So for each SMSC that we connect to, we would probably have to have
to have a pair of near-identical smsc configs in kannel (e.g. SMSC_BOB1
and SMSC_BOB2) - one which forces the dest TON to 1, and one normal one
which
acts as normal.
Our application would then have to be modified to send it to the correct
smsc name configured in kannel, i.e. SMSC_BOB1 or SMSC_BOB2, depending
on
if the number is "international".
So in either case, we would have to modify our application, to "recognize"
an international number before passing to kannel.
Is there any way to configure kannel itself to "recognize" an international
number
without having to modify our application? (i.e. in our case: if the number
begins with 04 or 61 then kannel sets the TON to 1, otherwise use the
default TON of 2.)
I can't find any way of doing this so I don't think there is a way?
A couple more questions:
- Is there any documentation on the algorithm kannel uses to set the TON/NPI
of the destination number?
One of the very few references in the user guide say that
dest-addr-ton is 0 by default and dest-addr-npi is 1 by default.
So if the dest-addr-ton setting was omitted from my config, I expected
that
kannel would always set it to 0.
But it obviously doesn't because as described above, it automatically
sets it to 2
(National) for a fairly normal-looking raw numbers, and to 1 for a
number
with a + in front (%2B).
So even though it's not evident from the user's guide, kannel does
follow some sort of algorithm to set the dest-addr-ton dynamically.
- Are there any official websites which correctly describe all possible
values
for TON and NPI?
E.g. I've found
http://www.quintum.com/support/products/rs/sysdoc/webhelp/type_of_number_(ton).htm
http://en.wikipedia.org/wiki/Numbering_plan
but I'm sure I've seen more values than just these.