Authenticate SMPP Client from incoming SMS

Authenticate SMPP Client from incoming SMS SearchSearch
Author Message
joyce
New member
Username: Cheerie

Post Number: 2
Registered: 04-2007
Posted on Friday, April 13, 2007 - 10:27 am:   

My client is connected to my NOWSMS via SMPP.

1) How do i reroute this client's incoming SMS to a designated SMSC?

2) How do i authenticate the incoming SMS? Meaning, how do I know this incoming SMS is from which SMPP client? I need to authenticate the SMS so that I can charge my individual client for the sms sent through my nowsms.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7095
Registered: 10-2002
Posted on Friday, April 13, 2007 - 06:37 pm:   

Hi Joyce,

1.) This is more information than you asked for (and potentially overwhelming), but since I can't find another thread that describes all of the logic, it is worth posting here.

The outbound SMS routing logic in NowSMS works like this:

When NowSMS routes a message, it first looks to see if a sender address has been specified for the message submission (if a message was submitted via HTTP, there is normally not a sender address specified, unless you submitted the message via HTTP and specified a "Sender=" parameter).

Note that it is possible to configure NowSMS to force a unique sender address for all messages submitted by a particular client (ignoring the sender address specified by the client), by defining a "Forced Sender Address" when defining the client account under "SMS Users".

If a sender address is present for the message that is being routed, then NowSMS checks to see if the sender address matches the "Default Sender Address" that is configured for any of the SMSC links (or the "Phone Number" associated with a GSM modem). If NowSMS finds a match, then it will route the message only via an SMSC connection with a matching sender address.

If NowSMS did not find a match on the sender address, then it evaluates the recipient address, and it will look to see if it finds a match in the "Preferred SMSC Connection for" recipient address masks associated with any
of the SMSC connections. (These recipient address masks can be wildcards such as "+44*" to match any phone number that starts with "+44".) If NowSMS finds a match, then it looks for the longest mask that provides a match, and routes the message via the connection with the longest matching mask. (For example, if you were sending to +441624999999, and you had one connection with a mask of "+44*", and another with "+441624*", then the connection with the mask of "+441624*" would be used as it is a longer match than "+44*".)

If there is no match on the recipient address mask, then the message will be routed via any connection that has "Support any outbound message traffic" checked.

(Note: It should also be mentioned that if NowSMS found multiple matches on the sender address, it evaluates the "Preferred SMSC Connection for" recipient address masks for each of the connections that had a sender address match.)

For HTTP client submissions, there is also an HTTP parameter setting that can be used to explicitly route a message via a particular SMSC, so that you don't have to use the sender/recipient matching logic if it is not appropriate for your configuration.

It works like this, when you submit a message via HTTP, the HTTP interface now supports "&SMSCRoute=xxxxx", where the value of this setting can be the name of a defined SMSC (e.g., "Bluetooth Modem" or "SMPP - a.b.c.d:xyz"). Or, rather than using the SMSC name, it can be a route name that is defined as associated with an SMSC. To define a route name for an SMSC, it is necessary to manually edit SMSGW.INI, and under the appropriate section header (e.g., [Modem - Bluetooth Modem] or [SMPP - a.b.c.d:xyz]), add RouteName=xxxxx. It is possible for multiple SMSCs to share the same route name, meaning that if a message is submitted with "&SMSCRoute=xxxxx", it will be routed outbound over the first available SMSC that is configured with RouteName=xxxxx.

If you need more control over which clients are allowed to use which outbound SMSC connections, there are additional SMSGW.INI file settings that can be manually applied. The following settings can be applied in the SMSGW.INI, under the section header for any SMSC definition (e.g., [Modem - modem name] or [SMPP - server:port]):

AllowedUserOnly=
AllowedUser1=
AllowedUser2=
AllowedUser...=

These configuration settings are defined to limit particular outbound "SMSC" connections to use by selected "SMS Users" accounts.

AllowedUserOnly=Yes -- This setting specifies that the SMSC connection can only be used by users that are specifically authorised to use this SMSC. When routing messages from users that are not specifically authorised for this connection, NowSMS will not use this SMSC and route messages as if this SMSC definition did not exist.

AllowedUser1=username -- This setting can be repeated with sequentially assigned numbers (e.g., AllowedUser2=xxx; AllowedUser3=yyyy). This entry is used to specify specific "SMS Users" accounts that are allowed to use the SMSC connection when AllowedUserOnly=Yes.

Note: It is NOT necessary to restart NowSMS when making updates to the AllowedUserOnly or AllowedUser1 settings in SMSGW.INI. These changes will be detected dynamically by NowSMS.

2.) In order to submit a message, the client must have a user account defined under "SMS Users".

Whenever a user submits a message to NowSMS, you can have an HTTP callback defined, so that NowSMS calls a script that you provide to check to see if it is ok for the user to submit the message, and to record a charge.

The callbacks are defined in the following link: http://www.nowsms.com/support/bulletins/tb-nowsms-001.htm

-bn