SMSLib has several configurable parameters. Some of them are switches which must be used in certain circumstances (like the one to overcome the Linux/RxTx eratic behavior) and others are parameters which have to do with timings and other internal settings.
Up to my knowledge, the default timing values should be sufficient for all modems. You can experiment with lowering those values - if you see that your modem(s) become unstable, switch to the defaults and retry.
All parameters are stored in the public class Settings which is instantiated as the global variable S during SMSLib execution. All parameters are initialized with standard or safe values. If you wish to change some parameter, you can do it:
Service.S
member variables.-Dxxx
runtime configuration switches, so you can change all of them directly from the command line, without messing with the code.Here is the list of all parameters available and their possible values:
S variable name | Default Value | Meaning | Command Line switch |
SERIAL_NOFLUSH | false | If true, SMSLib will not call the flush() system call upon writing to the serial port. This should normally be left as false, meaning that we need the flush() call. Set it to true for Linux/RxTx and virtual ports where the flush() call leads to errors | -Dsmslib.serial.noflush |
SERIAL_NOEVENTS | false | If true, SMSLib will not register the serial port callback events (i.e. framing errors, etc). This is reported to help with some Sony Ericsson models. | -Dsmslib.serial.noevents |
SERIAL_POLLING | false | If false, SMSLib will rely on the serial port interrupts to wake up and get incoming data. If true, if will create a separate thread in order to periodically poll the serial port for incoming data. Set it to true only on Linux/RxTx installations if you see that SMSLib behaves as if no modem is connected. | -Dsmslib.serial.polling |
SERIAL_POLLING_INTERVAL | 200 ms | This is the polling interval. It has a meaning only when the SERIAL_POLLING is true, i.e. SMSLib works in polling mode. The value is in milliseconds. The default value is a good starting point - you may experiment with different values | -Dsmslib.serial.pollinginterval=nnn |
SERIAL_TIMEOUT | 30000 ms | This is the master timeout set on the serial ports. The value is in milliseconds. | -Dsmslib.serial.timeout=nnn |
SERIAL_KEEPALIVE_INTERVAL | 60 s | This is the keep-alive interval. The keep-alive functionality in SMSLib periodically "pings" the modem in order to keep the connection active. The value is in seconds. | -Dsmslib.serial.keepalive=nnn |
SERIAL_BUFFER_SIZE | 16384 chars | This is the buffer size SMSLib uses for the internal queues. The value represents characters (bytes). | -Dsmslib.serial.buffer=nnn |
SERIAL_CLEAR_WAIT | 1000 ms | This is a delay value, used when clearing the queues. The value is in milliseconds. | -Dsmslib.serial.clearwait=nnn |
SERIAL_RTSCTS_OUT | false | If set, RTS/CTS will be enabled for outbound serial traffic as well. Useful for some types of phones | N/A |
QUEUE_RETRIES | 3 times | The retry count of the background queue manager for a message failing to be sent out. After this retry count, the queue manager will stop trying sending this message. | -Dsmslib.queue.retries=nnn |
AT_WAIT | 200 ms | This is a delay value, used after some AT commands. The value is in milliseconds. | -Dsmslib.at.wait=nnn |
AT_WAIT_AFTER_RESET | 10000 ms | This is the delay value. SMSLib will sleep for this period after issuing a modem reset command, in order to give time to the modem to initialize. The value is in milliseconds. | -Dsmslib.at.resetwait=nnn |
AT_WAIT_CMD | 1100 ms | This is a delay value, representing the time needed after issuing a "+++" command. The value is in milliseconds. | -Dsmslib.at.cmdwait=nnn |
AT_WAIT_CGMS | 200 ms | This is a delay value, representing the time needed after issuing a "CMGS" command. The value is in milliseconds. | -Dsmslib.at.cmgswait=nnn |
AT_WAIT_NETWORK | 5000 ms | This is a delay value, representing the time that SMSLib will give modem in order to attach to the GSM network. The value is in milliseconds. | -Dsmslib.at.networkwait=nnn |
AT_WAIT_SIMPIN | 5000 ms | This is a delay value, representing the time that SMSLib will give modem after the SIM PIN initialization. The value is in milliseconds. | -Dsmslib.at.simpinwait=nnn |
AT_WAIT_CNMI | 3000 ms | This is a delay value, representing the time that SMSLib will give modem before retrying a failed CNMI command. The value is in milliseconds. | -Dsmsib.at.cnmiwait=nnn |
CNMI_EMULATOR_INTERVAL | 30 s | If CNMI fails, SMSLib will launch a separate thread for periodically polling the modem for inbound messages and still act as an asynchronous reader. | N/A |
OUTBOUND_RETRIES | 3 times | This is the retry count, defining how many times SMSLib will try to send a failing message. After those retries, message will be marked as failed. | -Dsmslib.outbound.retries=nnn |
OUTBOUND_RETRY_WAIT | 3000 ms | The wait time between two attemps for sending a failed message. Value is in milliseconds. | -Dsmslib.outbound.retrywait=nnn |
WATCHDOG_INTERVAL | 15 s | This is the process interval of the Service Watchdog background thread. The value is in seconds. | -Dsmsib.watchdog=nnn |
MASK_IMSI | true | When true, the IMSI of the phone's/modem's SIM is not reported nor included in the logs (safety reasons). | N/A |
CONCURRENT_GATEWAY_START | true | When true, SMSLib will try to start all defined gateways concurrently (to speed up start up time). When false, gateways start one after the other. | -Dsmslib.disable.concurrent.gateway.startup to set to false. |
DISABLE_CMTI | false | When true, SMSLib will try to disable all unsolicited inbound notifications. Use this as an emergency switch! | -Dsmslib.nocmti to set to true. |
HOURS_TO_ORPHAN | 72 | This setting defines the age (in hours) after which SMSLib will treat a message part as "orphaned". Orphaned parts are parts of a big, multipart message which are received alone and their "sister" parts were never received in order for the full message to be reconstructed. Once a message part gets older than what the setting says, the relevant notification method is called. | N/A |
DISABLE_CMMS | false | The CMMS command (Keep GSM Link Open) is used to increase the sending rate, but may cause instability on some modems. It is set by default. | -Dsmslib.nocmms=1 to disable the CMMS command. |
DISABLE_COPS | false | The COPS command is used for network selection. The default should suffice, but you can disable the use of the command. | -Dsmslib.nocops=1 to disable the COPS command. |
CACHE_DIRECTORY | java.home | The generic cache directory location used by SMSLib. | -Dsmslib.cachedir=myCacheDir |
QUEUE_DIRECTORY | Undefined | The cache directory used by the Queue Manager. If left undefined, the Queue Manager acts in a non-persistent way. If you set it to a path, Queue Manager will save pending outbound messages (i.e. queued messages) and reload them between SMSLib invocations. | -Dsmslib.queuedir=myCacheDir |