freesmartphone.org GSM SMS Interface

Description

org.freesmartphone.GSM.SMS is a high level interface for textual Short Message Service (SMS). If you have special requirements or need direct access to individual messages, you may use the corresponding SMS functions provided by org.freesmartphone.GSM.SIM.

Namespace

org.freesmartphone.GSM.SMS

Methods

Signals

Properties

None

Errors

None

Methods

RetrieveTextMessages ( ) → a(issssa{sv})

Description: Retrieve all text messages.

Returns:

a(issssa{sv}): messages Messages matching the given category. This is an array of four-tuples. Every entry has the following structure:

  • (int:index) = storage index,
  • (string:status) = status of message, one of (“read”, “unread”, “sent”, “unsent”),
  • (string:number) = sender number.
  • (string:timestamp) = timestamp.
  • (string:content) = contents of the message.

GetSizeForTextMessage ( s ) → u

Description: Calculates the number of GSM Short Messages necessary to deliver a given text.

Parameters:*

s: contents The contents of the message.

Returns:

u: messages The number of SMS to be sent, if this message were to be delivered.

SendTextMessage ( ssb ) → is

Description: Sends a text message via the GSM Short Message Service (SMS)

Implementation Note

Text messages can be of unlimited length. They might get fragmented by the underlying message transport layers though. This will happen transparently.

Parameters:*

s: recipient_number The number of the recipient.

s: contents The contents of the message.

b: report If true, status reports (message receipts) will be sent by the SMS Center, delivered via the IncomingMessageReceipt signal.

Returns:

i: reference This is the message-reference number of this message. This can be used to identify status reports.

s: timestamp The timestamp this message was received by the SMSC.

Signals

IncomingTextMessage ( sss )

Description: Sent, when a text message has been received.

Parameters:

s: number The number of the sender.

s: timestamp The timestamp of the message.

s: contents The contents of the message.

IncomingMessageReport ( isss )

Description: Sent when a status report for a message has been received.

Parameters:

i: reference The message-reference number as returned by SendTextMessage

s: status The status. Expected values are:

  • COMPLETED_RECEIVED
  • COMPLETED_UNABLE_TO_CONFIRM
  • COMPLETED_REPLACED
  • COMPLETED_LAST
  • TEMPORARY_CONGESTION
  • TEMPORARY_SME_BUSY
  • TEMPORARY_NO_RESPONSE
  • TEMPORARY_SERVICE_REJECTED
  • TEMPORARY_QOS_UNAVAILABLE
  • TEMPORARY_SME_ERROR
  • TEMPORARY_LAST
  • PERMANENT_RP_ERROR
  • PERMANENT_INVALID_DESTINATION
  • PERMANENT_CONNECTION_REJECTED
  • PERMANENT_NOT_OBTAINABLE
  • PERMANENT_QOS_UNAVAILABLE
  • PERMANENT_INTERWORKING_UNAVAILABLE
  • PERMANENT_VALIDITY_PERIOD_EXPIRED
  • PERMANENT_DELETED
  • PERMANENT_SC_ADMIN_DELETED
  • PERMANENT_SM_DOES_NOT_EXIST
  • PERMANENT_LAST
  • TEMPFINAL_CONGESTION
  • TEMPFINAL_SME_BUSY
  • TEMPFINAL_NO_RESPONSE
  • TEMPFINAL_SERVICE_REJECTED
  • TEMPFINAL_QOS_UNAVAILABLE
  • TEMPFINAL_SME_ERROR
  • TEMPFINAL_LAST

s: sender_number The number of the sender.

s: contents Optional contents of the receipt. Will usually be empty.