SMS receiving configuration
|
Routing of Incoming SMS Messages
This document describes routing of incoming SMS messages and how it can be configured
by the administrator.
The routing process of incoming SMS messages consists of the following
steps:
- Testing for Delivery Report / NDR / INFO
- Routing in Accordance with User Rules
- Routing by suffix
- Automatic Routing to the Last Sender
- Routing to the Default Mailbox/Public Folder
Routing takes place in the shown order. If satisfactory routing is found,
search can continue (or can stop).
After you change the configuration, you must restart the MobilChange.Kernel
service.
Searching for Delivery Reports etc.
Incoming SMS can be confirmation of delivery of the sent SMS (or it
may contain information that the message could not be delivered). These
confirmations are sent by the operator's SMS center (if it supports this function).
Because the rules for evaluation of reports are the most complicated
part of incoming SMS messages, we do not expect that ordinary user should
modify them. Modification is only recommended, if the network operator
is not supported by the installation and then after a prior discussion with
Datasys support department.
Subkeys with recognition rules are in the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Datasys\MobilChange\receiving\report\<linename>\
(the line name is after default installation "line1")
The subkey name must be a number. This number determines priority
of given rule. Routing rules are evaluated in the alphabetical order,
i.e. the order is for example as follows: "1", "10", "2", "20", "200",
"201", "3"... As a result, you can insert another rule between any two rules.
Each routing rule consists of the following items:
-
body
-
A regular expression determining whether it is
a DR/NDR/INFO message. Information like the recipient's telephone number,
delivery time etc. in round brackets.
-
from
-
Text SC is here, if the message comes from the operator's SMS
center (e.g. T-Mobile CZ), or USER, if it was sent by the SMS center,
but the telephone number of the sender is the recipient of the original
SMS (e.g. CZ O2).
-
type
-
If the previously stated conditions are met, this item determines a message
type:
DR = delivery report
NDR = non-delivery report
INFO = the message was put in the queue and will be sent...
-
output
-
Here is the description of the meaning of the individual groups in a regular
expression. Individual characters separated by space are written here.
T = the recipient's telephone number in any standard format
t = the recipient's telephone number in normalised international format without plusor zeros at the beginning
Y N D H M S = the time an SMS was sent (N = month)
y n d h m s = SMS delivery time (n = month)
back to top of page
Routing in Accordance with User Rules
This part of the documentation is here for the general information purposes.
If you want to edit routing rules of incoming SMS messages, use the
mxRouteCfg program.
Sub keys with user routing rules are in the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Datasys\MobilChange\receiving\recipient\
The subkey name must be a number. This number determines the priority
of a given rule. Routing rules are evaluated in the alphabetical order,
i.e. the order may be "1", "10", "2", "20", "200", "201", "3"... As a result,
you can insert another rule between any two rules.
Each routing rule consists of the following items:
-
from
-
Regular expression identifying the sender, or
several regular expressions separated by comma or alias name.
Warning! Numbers are always processed in the international format
without plus mark at the beginning, i.e. the number 603899285
of the T-Mobile CZ network will be processed as 420603899285.
-
body
-
A regular expression that filters message text. If it is met together
with the from condition, the rule will be applied.
A regular expression can contain groups in round brackets, they can
be reused in other configurations as variables $1 to $9 (group 1 to 9).
The original message text is $0.
-
addr
-
The recipient's address. If the MS Exchange gateway is used, an address
type must be here, if it is not an SMTP address. E.g. EX:/o=Datasys/ou=Develop/cn=Recipients/cn=brouzda
or brouzda@datasys.cz. In the address you can also use variables from the
regular expression body, e.g. $1@datasys.cz where $1 will
be substituted by the first substring from the regular expression.
If the address is written as $Aname, the SMS is transferred to the script application
of given name. The application support is implemented only in MobilChange Enterprise.
-
output
-
Text of the message given to the recipient or application. If you enter
$0, the entire original message will be transferred, otherwise you can
enter anything here, including variables from the regular expression body.
-
language
-
The recipient's language
-
next
-
If END is here, further processing of the SMS, after it has been
transferred to the recipient/application, will stop. If CONT is
here, the SMS will be processed by other rules in the section (i.e. one
SMS can be delivered to more applications/users). SKIP is the
last option which identifies transition to another section of rules - automatically assigned recipients.
Examples of Application of Rules
- The following rule transfers all SMS messages beginning with "#pizza "
to the "kitchen" application. All that follows after "#pizza " will be sent as the SMS text
from=.*
body=^#pizza (.*)$
next=END
addr=$Akitchen
output=$1
language=cz
- The following rule sends all SMS messages beginning with "#name" to the
SMTP e-mail address name@datasys.cz. All that follows after the name and a space will be sent as the SMS text.
from=.*
body=^#([^ ]+) (.*)$
next=END
addr=$1@datasys.cz
output=$2
language=cz
back to top of page
Routing by suffix
This routing applies only to O2 SMS Connector and only if SMS was received to suffix number. Suffixes can be used only for "short"
application numbers (e.g. 1991017), but not for common MSISDN numbers (e.g. +420 720001017).
Every user has its own suffix behind the assigned number. Example: if company has assigned number 1991017, then one user
can have for example number 1991017565, the second one 1991017123. For suffix is used User ID item from UserManager (i_user_id
from database). If User ID contains characters different from numbers, they are ignored and only numbers are used, so "id15a4"
is changed to "154".
Suffixes work for both outgoing and incoming SMS (see example above):
- when first user sends SMS, it will look like sent from number 1991017565, for second user from number 1991017123.
- if SMS is received to number 1991017565 (1991017123), it will be delivered to the first (second) user.
- if SMS is received to number 1991017, routing by suffix will not be used
If users don't have User ID assigned (default condition for common MX installation), then after setting
HKLM\SOFTWARE\Datasys\MobilChange\global\system\AutoAssignIds = DWORD:1
will be every user assigned
automatically generated User ID during first SMS sending - usually 6 digit number. SMS Connector installation
turns this feature on.
Table for translation suffix->e-mail is stored in HKEY_LOCAL_MACHINE\SOFTWARE\Datasys\MobilChange\receiving\suffixes\
registry key. Records are created during SMS sending. If SMS is received for suffix which is not listed here, User IDs of ALL users
are read from database and written here.
If value HKLM\SOFTWARE\Datasys\MobilChange\receiving\SuffixSkipNext = DWORD:1
, processing ends here
(if SMS was received with suffix - if not, processing continues). If value = 0, processing goes to following
two steps. SMS Connector installation sets 0 here.
Notes:
- Suffix support is switched on separately for every line, see line configuration,
SuffixAllowed
value (DWORD:1 = yes, 0 = no). SMS Connector installation sets 1 here.
- Suffixes for incoming SMS (as well as incoming SMS itself) are received only from O2 CZ network!
back to top of page
Automatic Routing to the Last Sender
With MobilChange you can automatically route incoming SMS messages to the user
who was the last sender of SMS message to given mobile phone.
The configuration of this function is in the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Datasys\MobilChange\receiving\auto\
in the following items:
-
active
-
Should automatic routing be used? 0 = no, 1 = yes; 1 is the default.
-
expiration
-
During which timeframe after sending SMS to any number will be incoming SMS from this number routed to the sender
of original message? Time in seconds, default value (after the installation) is 172800, i.e. two days.
-
next
-
If the automatic rule is found, will the message be sent only to the sender
in accordance with this rule (0), or should it be sent to the default recipient also
(1)? After installation 1 is set and we recommend to keep this setting.
The function of automatic assigning of recipients stores its work data
in the subkeys of this key.
back to top of page
Routing to the Default Mailbox/Public Folder
The address of the default mailbox/public folder is in this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Datasys\MobilChange\receiving\public\
It may be changed by MobilChange/setup/_mailboxes.cmd.
back to top of page