SMSServer is a small application that you can use for sending and receiving SMS messages without writing your own code.
The new SMSServer is fully configurable and can be easily extended. It it based on two new concepts:
SMSServer is located in org.smslib.smsserver
package. Refer to the Installation instructions for information on how to build SMSServer.
SMSServer is controlled with a configuration file named SMSServer.conf
. There is a sample conf in the standard distribution package for your reference.
SMSServer expects to find its configuration file in the current (i.e. run from) directory. If you wish to instruct SMSServer to look elsewhere, use the -Dsmsserver.configdir
parameter. A sample SMSServer invocation will be like:
java -Dsmsserver.configdir=/path/to/where/conf/exists/ org.smslib.smsserver.SMSServer
You can also use the -Dsmsserver.configfile
parameter. This should point to the configuration file (filename should be included), for example:
java -Dsmsserver.configfile=/path/to/where/conf/exists/MyConfig.cfg org.smslib.smsserver.SMSServer
The configuration file holds a number of directives which configure SMSServer.
There is a sample configuration file located in SMSServer directory - have a look for a real life configuration file.
You must define at least one gateway in the configuration file. Each gateway has its own set of configurable items.
For more information about the implemented gateways, look at the Gateways documentation pages.
Interfaces are not mandatory, but I guess there is no reason to run SMSServer without any persistent storage at all... Please note that all active interfaces take part in the message propagation.
For more information about the implemented interfaces, look at the Interfaces documentation pages.
The following settings configure the general operation of SMSServer:
settings.delete_after_processing | Should SMSServer delete messages from the GSM modem after processing them? Allowed values: yes and no . no may be usefull during debugging. |
settings.send_mode | Mode of operation for outbound processing. Allowed values: sync and async . If you have more than one GSM modems connected, you are advised to switch to async as all modems will be used simultaneously, thus increasing your throughput. If you have one GSM modem, it doesn"t make any difference what mode you will use. |
settings.inbound_interval | Inbound polling interval in seconds. SMSServer uses the inbound message notifications from the modem in order to wake up and read messages upon their arrival. This interval defines the time when SMSServer will perform a forced read for new messages. If you find that message notifications work fine in your setup, you can increase this time to 300 or 600 seconds. If you see that you don't get inbound messages on time, you can lower this interval. |
settings.outbound_interval | Outbound polling interval in seconds. Every such interval, SMSServer will poll its interfaces for new to-be-sent messages and will attempt to send them. |
You also have the ability to select different time zones for different outbound messages. The time zones instruct SMSServer of when to send a message according to its priority.If, for example, you define the "0900-1700" as the zone for "normal" priority messages, all "normal" priority messages will be getting dispatched during normal office hours.
settings.timeframe.low | Time zone for low priority outbound messages. |
settings.timeframe.normal | Time zone for normal priority outbound messages. |
settings.timeframe.high | Time zone for high priority outbound messages. |
Notes:
You can modify the default balancer and/or router that SMSServer uses by setting the following directives.
smsserver.balancer | The class name of the Balancer you wish to use. |
smsserver.router | The class name of the Router you wish to use. |
If you supply -runonce
at the command line when you run SMSServer, SMSServer will run once, send all pending messages in the database and exit.
If you are interested in running SMSServer as a Windows Service, Mehrdad Abdoli (thanks Mehrdad!) has written some detailed instructions on how to do this. You may find this post here.