SendText()
Synopsis
Send a Text Message on a channel.
Description
Sends text to the current channel.
The following variables can be set:
SENDTEXT_FROM_DISPLAYNAME
- If set and this channel supports enhanced messaging, this value will be used as theFrom
display name.SENDTEXT_TO_DISPLAYNAME
- If set and this channel supports enhanced messaging, this value will be used as theTo
display name.SENDTEXT_CONTENT_TYPE
- If set and this channel supports enhanced messaging, this value will be used as the messageContent-Type
. If not specified, the default oftext/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.
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