Module sms Management of Short Message Service

Type sms

sms.init() Initialize the module.
sms.register(callback, senderp, messagep) Registers a callback on SMS reception.
sms.send(recipient, message, format) Sends an SMS.
sms.unregister(userid) Cancels a callback registration on SMS reception.

Type sms

Field(s)

sms.init()

Initialize the module.
No service provided by this module will work unless this initializer function has been called first.

Return values

  1. a true value upon success
  2. nil followed by an error message otherwise.

sms.register(callback, senderp, messagep)

Registers a callback on SMS reception.
New SMS will be notified if the sender of the SMS matches the given patterns.

Parameters

Return values

  1. id (can be any Lua non-nil value) should to be used only to call #sms.unregister.
  2. nil followed by an error message otherwise.

sms.send(recipient, message, format)

Sends an SMS.
Multiple SMS sending is done automatically if the message cannot be held in one SMS.

Parameters

Return values

  1. "ok" on success.
  2. nil followed by an error message otherwise.

sms.unregister(userid)

Cancels a callback registration on SMS reception.

Parameter

Return values

  1. "ok" on success.
  2. nil followed by an error message otherwise.