Hi,

Is there any easy way to configure the mapping between
SMSC ID's and short codes?

We have the following requirements for a project, and I'm trying to
determine what is the best and cleanest way to configure kannel to achieve
them. I'm using kannel v1.4.1 .

(Note that I know very little about SMSC's themselves. The SMSC's here
 are handled by another team and are out of my control.
)

i) We need to be able to receive SMS messages from various SMSC's ,
    e.g. messages sent by people to short code 111 would be received
    through one particular SMSC, and those sent to 222 would be received
    through another SMSC.
ii) An application processes each message, and sends any reply back
     to the sender via kannel's normal sendsms interface:
       http://localhost:13013/cgi-bin/sendsms?.....
     The message must be sent back through the same SMSC from which
     it was originally received, and with the same short code.

     (i.e. if a message is received from SMSC BBBB with short code 222,
      the reply has to go back through SMSC BBBB and appear to the customer
      as coming from '222'.
     )
iii) An application should also be able to send a random
     application-initiated message through SMSC that it wishes.
     If it doesn't specify any particular SMSC, it should through
     a specific default SMSC.

I think the following relevant bits of configuration are a good start.
    group = smsc
    smsc-id = AAAA
    allowed-smsc-id = AAAA

    group = smsc
    smsc-id = BBBB
    allowed-smsc-id = BBBB

    group = smsc
    smsc-id = CCCC
    allowed-smsc-id = CCCC

    group = smsc
    smsc-id = ZZZZ
    denied-smsc-id = AAAA;BBBB;CCCC
>From my testing, this means that if the application specifies
"smsc=BBBB" as a parameter, i.e.
    http://localhost:13013/cgi-bin/sendsms?....&smsc=BBBB
it will ALWAYS go through BBBB and nowhere else.
If the application doesn't specify the smsc= parameter (or specifies
a non-existant one), then the message will ALWAYS go through ZZZZ
and nowhere else.

That's what I want and I hope that's how it's meant to work.
It does mean that if I add a new SMSC in the future, then we have to
remember to also add it to the "denied-smsc-id" configuration above.
A bit convoluted, but that's how kannel seems to work.

Now, regarding the 'from=' parameter:

>From my observations, the SMSC's here (over which I have no control),
tolerate only certain source numbers. So for example if I try
sending back a SMS reply to a customer through SMSC BBBB, then that
SMSC will accept a 'from' address of 222, but not 111 for example.
    http://localhost:13013/cgi-bin/sendsms?....&smsc=BBBB&from=222

I was hoping that maybe I could leave out the from= parameter
and then perhaps the SMSC itself would fill it in with a default correct
value (I have no idea if our SMSC's are set up like that, but at least
I would have liked to test it).
But if I leave out the "from=" parameter from the URL above, kannel itself
refuses to accept the URL, giving:
    ERROR 400: Bad Request

Is there any clean way to configure kannel to tell it
the relationships between the short codes and the SMSC ID?
Continuing from above, requirement #4 is:

iv) Ideally the application should be able to specify just
the smsc or the 'from' field, and kannel should be able to
supply the rest.
    http://localhost:13013/cgi-bin/sendsms?....&smsc=BBBB
        or
    http://localhost:13013/cgi-bin/sendsms?....&from=222

There's a lot of documentation in the kannel user guide
so the solution may be staring me in the face, but I find a lot of it
challenging to understand, especially the parts about 'routing'.

The only way I could find to implement this is the following:
I haven't tried to test this yet.
I could set up one sendsms-user per SMSC. So for example
for SMSC BBBB, I could set up with user:
    group = sendsms-user
    username = user_BBBB
    default-smsc = BBBB
    default-sender = 61421260388

That way if the application wants to sends a message to
SMSC BBBB, it (hopefully) only needs to do
    http://localhost:13013/cgi-bin/sendsms?....&username=user_BBBB
and can leave out either or both the smsc= and from= parameters.
Of course, it has to then supply the correct username= parameter.

Is there a more standard or neater way to do what I want?
The application writers tell me that it might be hard for
them to specify different username= values like this in the
sendsms URL. They would rather be able to
specify only the smsc= or from= parameter,
and have kannel automatically work out how the other parameter.

Reply via email to