MessageSend()
Synopsis
Send a text message.
Description
Send a text message. The body of the message that will be sent is what is currently set to MESSAGE(body)
. This may he come from an incoming message. The technology chosen for sending the message is determined based on a prefix to the destination
parameter.
This application sets the following channel variables:
MESSAGE_SEND_STATUS
- This is the message delivery status returned by this application.- INVALID_PROTOCOL - No handler for the technology part of the URI was found.
- INVALID_URI - The protocol handler reported that the URI was not valid.
- SUCCESS - Successfully passed on to the protocol handler, but delivery has not necessarily been guaranteed.
- FAILURE - The protocol handler reported that it was unabled to deliver the message for some reason.
Syntax
MessageSend(destination,[from,[to]])
Arguments
destination
- A To URI for the message.
- Technology: PJSIP
Thedestination
parameter is used to construct the Request URI for an outgoing message. It can be in one of the following formats, all prefixed with thepjsip:
message tech.
endpoint
- Request URI comes from the endpoint's default aor and contact.
endpoint/aor
- Request URI comes from the specific aor/contact.
[email protected]
- Request URI from the endpoint's default aor and contact. The domain is discarded.
These all use the endpoint to send the message with the specified URI:
endpoint/<sips:host>>
endpoint/<sips:[email protected]>
endpoint/"display name" <sips:host>
endpoint/"display name" <sips:[email protected]>
endpoint/sips:host
endpoint/sips:[email protected]
endpoint/host
endpoint/[email protected]
These all use the default endpoint to send the message with the specified URI:
<sips:host>
<sips:[email protected]>
"display name" <sips:host>
"display name" <sips:[email protected]>
sips:host
sips:[email protected]
These use the default endpoint to send the message with the specified host:
host
[email protected]
This form is similar to a dialstring:
PJSIP/[email protected]
You still need to prefix the destination with the pjsip:
message technology prefix. For example: pjsip:PJSIP/[email protected]
. The endpoint contact's URI will have the user
inserted into it and will become the Request URI. If the contact URI already has a user specified, it will be replaced.
-
endpoint
- Request URI comes from the endpoint's default aor and contact.endpoint/aor
- Request URI comes from the specific aor/contact.[email protected]
- Request URI from the endpoint's default aor and contact. The domain is discarded.endpoint/<sips:host>>
endpoint/<sips:[email protected]>
endpoint/"display name" <sips:host>
endpoint/"display name" <sips:[email protected]>
endpoint/sips:host
endpoint/sips:[email protected]
endpoint/host
endpoint/[email protected]
<sips:host>
<sips:[email protected]>
"display name" <sips:host>
"display name" <sips:[email protected]>
sips:host
sips:[email protected]
host
[email protected]
PJSIP/[email protected]
- Technology: SIP
Specifying a prefix ofsip:
will send the message as a SIP MESSAGE request.
- Technology: XMPP
Specifying a prefix ofxmpp:
will send the message as an XMPP chat message. from
- A From URI for the message if needed for the message technology being used to send this message. This can be a SIP(S) URI, such asAlice <sip:[email protected]>
, or a string in the format[email protected]
. This will override afrom
specified using the MESSAGE dialplan function or thefrom
that may have been on an incoming message.
- Technology: PJSIP
Thefrom
parameter is used to specity theFrom:
header in the outgoing SIP MESSAGE. It will override the value specified in MESSAGE(from) which itself will override anyfrom
value from an incoming SIP MESSAGE.
- Technology: SIP
Thefrom
parameter can be a configured peer name or in the form of "display-name" <URI>.
- Technology: XMPP
Specifying a prefix ofxmpp:
will specify the account defined inxmpp.conf
to send the message from. Note that this field is required for XMPP messages. to
- A To URI for the message if needed for the message technology being used to send this message. This can be a SIP(S) URI, such asAlice <sip:[email protected]>
, or a string in the format[email protected]
. This will override ato
specified using the MESSAGE dialplan function or theto
that may have been on an incoming message.
- Technology: PJSIP
Theto
parameter is used to specity theTo:
header in the outgoing SIP MESSAGE. It will override the value specified in MESSAGE(to) which itself will override anyto
value from an incoming SIP MESSAGE.
- Technology: SIP
Ignored
- Technology: XMPP
Ignored
See Also
Import Version
This documentation was imported from Asterisk Version GIT-18-702e1d3