SMS Gateway 4.4 - User's Guide
4. Configuring the software
The behavior of SMS Gateway is mainly controlled by a number of keywords used in the configuration file, SMSDIR/config. You can alter the way SMS Gateway acts by modifying config and then restarting smsd. You restart the smsd by finding the process id, kill the process and then start the daemon again. Do not use the -9 option when killing smsd.
4.1 Keywords
To use a new keyword in the configuration file add the keyword, preferably at the end of the file, and then restart smsd.
Examples of some useful keywords when connecting through dial-up:
Dial prefix, for example "0" to get out through a PBX
Initilisation string for modem
Specifies XON/XOFF flow control is to be used
Specifies do not try CTS/RTS flow control
Specifies a program to be executed after transmission
Maximum number of tries to send a message
Time, in seconds, between tries
Used with multiple modem devices
There are about 50 different keywords used by SMS Gateway.
4.2 SMS and Minicall Text in Sweden
By default SMS Gateway is configured with four gateways for the three Swedish SMS operators and Telia Mobitel's paging service Minicall Text. When sending a message using the sms command the message and the recipients are sent to smsd. Smsd looks at the first digits of the recipient's number to determine which gateway to use:
Telia
Tele2/Comviq
Europolitan
Minicall Text
It then tries to send as many messages as possible to the gateway for the first message in the send list. The cost for the message is the following:
The gateway is on a 0707 GSM number so the cost is the normal cost for a mobile phone call.
A 0708 number is used. Otherwise same as Comviq.
A 0740 number is used which cost SEK 2 for 1 message.
The cost depends on the number of characters in the message. The cost is invoiced to the customer who needs a special "sändarabonnemang" from Telia Mobitel.
To be able to send Minicall Text messages you need a "sändarabonnemang" from Telia Mobitel. This will get you a specific id and password that the software uses to log on to the gateway. You tell the software which id and password to use by using the keywords MINICALL_ID and MINICALL_PASSWORD in the configuration file. Telia Mobitel will send an invoice directly to the customer for the cost of the messages.
4.3 Defining a custom gateway
A custom gateway needs to be defined using the GATEWAY keyword for operation outside of Sweden and when not connecting through dial-up. The syntax is in the configuration file is GATEWAY="prefix:name:connmode:address:port:protocol[:extra]"
The parameters mean the following:
The prefix in the recipient's number. You can also use DEFAULT for a default gateway.
Name for the gateway. Used in lists.
Connection mode for the gateway. Possible values: IP, MODEM, TELNET
Destination address. Depending on the connection mode, either a hostname, an IP address or a phone number.
Used for IP and TELNET gateways. Specifies the port to connect to.
Protocol to be used for the gateway.
Possible values: CIMD, CIMD2, SMPP, TAP, THS, UCP, UCPE
Gateway-specific parameters. See the keyword reference section for mote information
4.4 Adding actions
You can tell smsd that it should execute a specific script or program after a message has been sent or could not be sent. This could be useful if you want to update your own database or similar and is done by using the EXECUTE_AFTER_SEND keyword in the configuration file:
EXECUTE_AFTER_SEND=/usr/local/bin/smsafter
The specified program will be called with the following parameters: ID of the message, recipient's number, return code, number of tries, note, total time connected, time on the format YYMMDD HH:MM, login of the user that sent the message, SCTS and error text.
4.5 Implementing the software
There are a number of situations where it could be nice to receive a message when a certain action takes place or an error occurs. What about the following examples:
There are probably as many ideas as people using the software but the ones above are a few of the most common situations.
4.6 Configuring a CIMD2 gateway
The SMSC from Nokia uses the CIMD2 protocol. SMS Gateway support bi-directional messaging using CIMD2. It operates in polling mode meaning SMS Gateway asks the SMSC if there are incoming messages and then retrieves the messages.
There are a number of parameters concerning the CIMD2 protocol.
4.7 Configuring a SMPP gateway
SMS Gateway supports SMPP 3.3 which can also be used to connect to SMPP 3.4 SMSCs since SMPP 3.4 in general is backwards compatible with SMPP 3.3.
4.8 Configuring a UCP gateway
The SMSC from CMG Holland uses the UCP/EMI protocol. There are a number of parameters concerning the UCP protocol.
These include UCP_MT, UCP_NRQ, UCP_OT and UCP_VP.
When using authentication though UCP operation 60 you need to specify the following parameters for the GATEWAY: AUTHTON, AUTHNPI, SESSION_USERNAME and SESSION_PASSWORD.



