sms
Management of Short Message Service
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. |
sms
sms.init()
nil
followed by an error message otherwise.
sms.register(callback, senderp, messagep)
callback
:
function to be called on sms reception matching both patterns
with recepient and message as parameters.
Callback signature: callback(recipient_string, message_string)
.
senderp
:
string lua pattern
that matches the sender address; nil
means "no filtering".
messagep
:
string lua pattern
that matches the message (sms content), nil
means "no filtering".
nil
followed by an error message otherwise.
sms.send(recipient, message, format)
recipient
:
string, number/name of the SMS recipient.
message
:
string containing the message (binary).
format
:
string defining the format to use to send the message.
Accepted values are "7bits" or "8bits".
"ok"
on success.
nil
followed by an error message otherwise.
sms.unregister(userid)
userid
:
id returned by previous #sms.register.
"ok"
on success.
nil
followed by an error message otherwise.