Skip to end of metadata
Go to start of metadata

SendText()

Synopsis

Send a Text Message on a channel.

Description

Sends text to the current channel.

Note

Icon

current channel could be the caller or callee depending on the context in which this application is called.

The following variables can be set:

  • SENDTEXT_FROM_DISPLAYNAME - If set and this channel supports enhanced messaging, this value will be used as the From display name.
  • SENDTEXT_TO_DISPLAYNAME - If set and this channel supports enhanced messaging, this value will be used as the To display name.
  • SENDTEXT_CONTENT_TYPE - If set and this channel supports enhanced messaging, this value will be used as the message Content-Type. If not specified, the default of text/plain will be used.
    Warning: Messages of types other than text/* cannot be sent via channel drivers that do not support Enhanced Messaging. An attempt to do so will be ignored and will result in the SENDTEXTSTATUS variable being set to UNSUPPORTED.
  • SENDTEXT_BODY - If set this value will be used as the message body and any text supplied as a function parameter will be ignored.

Result of transmission will be stored in the following variables:

  • SENDTEXTTYPE
    • NONE - No message sent.
    • BASIC - Message body sent without attributes because the channel driver doesn't support enhanced messaging.
    • ENHANCED - The message was sent using enhanced messaging.
  • SENDTEXTSTATUS
    • SUCCESS - Transmission succeeded.
    • FAILURE - Transmission failed.
    • UNSUPPORTED - Text transmission not supported by channel.

Note

Icon

The text encoding and transmission method is completely at the discretion of the channel driver. chan_pjsip will use in-dialog SIP MESSAGE messages always. chan_sip will use T.140 via RTP if a text media type was negotiated and in-dialog SIP MESSAGE messages otherwise.

Examples:

Example: Send a simple message

If the channel driver supports enhanced messaging (currently only chan_pjsip), you can set additional variables:

Example: Alter the From display name
Example: Send a JSON String
Example: Send a JSON String (alternate)

Syntax

SendText([text])
Arguments
  • text

See Also

Import Version

This documentation was imported from Asterisk Version GIT-20-c7598ee

  • No labels