Configuration parameters

Introduction

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.

Parameters

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:

Here is the list of all parameters available and their possible values:

S variable nameDefault ValueMeaningCommand Line switch
SERIAL_NOFLUSHfalseIf 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_NOEVENTSfalseIf 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_POLLINGfalseIf 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_INTERVAL200 msThis 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_TIMEOUT30000 msThis is the master timeout set on the serial ports. The value is in milliseconds.-Dsmslib.serial.timeout=nnn
SERIAL_KEEPALIVE_INTERVAL60 sThis 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_SIZE16384 charsThis is the buffer size SMSLib uses for the internal queues. The value represents characters (bytes).-Dsmslib.serial.buffer=nnn
SERIAL_CLEAR_WAIT1000 msThis is a delay value, used when clearing the queues. The value is in milliseconds. -Dsmslib.serial.clearwait=nnn
SERIAL_RTSCTS_OUTfalseIf set, RTS/CTS will be enabled for outbound serial traffic as well. Useful for some types of phonesN/A
QUEUE_RETRIES3 timesThe 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_WAIT200 msThis is a delay value, used after some AT commands. The value is in milliseconds.-Dsmslib.at.wait=nnn
AT_WAIT_AFTER_RESET10000 msThis 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_CMD1100 msThis is a delay value, representing the time needed after issuing a "+++" command. The value is in milliseconds.-Dsmslib.at.cmdwait=nnn
AT_WAIT_CGMS200 msThis is a delay value, representing the time needed after issuing a "CMGS" command. The value is in milliseconds.-Dsmslib.at.cmgswait=nnn
AT_WAIT_NETWORK5000 msThis 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_SIMPIN5000 msThis 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_CNMI3000 msThis 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_INTERVAL30 sIf 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_RETRIES3 timesThis 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_WAIT3000 msThe wait time between two attemps for sending a failed message. Value is in milliseconds.-Dsmslib.outbound.retrywait=nnn
WATCHDOG_INTERVAL15 sThis is the process interval of the Service Watchdog background thread. The value is in seconds.-Dsmsib.watchdog=nnn
MASK_IMSItrueWhen true, the IMSI of the phone's/modem's SIM is not reported nor included in the logs (safety reasons).N/A
CONCURRENT_GATEWAY_STARTtrueWhen 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_CMTIfalseWhen true, SMSLib will try to disable all unsolicited inbound notifications. Use this as an emergency switch!-Dsmslib.nocmti to set to true.
HOURS_TO_ORPHAN72This 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_CMMSfalseThe 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_COPSfalseThe 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_DIRECTORYjava.homeThe generic cache directory location used by SMSLib.-Dsmslib.cachedir=myCacheDir
QUEUE_DIRECTORYUndefinedThe 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