MessageSend
Asterisk 10 now has protocol independent support for processing text messages outside of a call. Messages are routed through the Asterisk dialplan. SIP MESSAGE and XMPP are currently supported. There are options in jabber.conf and sip.conf to allow enabling these features.jabber.conf: see the "sendtodialplan" and "context" options.
sip.conf: see the "accept_outofcall_message", "auth_message_requests" and "outofcall_message_context" options.
The MESSAGE() dialplan function and MessageSend() application have been added to go along with this functionality. More detailed usage information can be found on the Asterisk wiki (https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_MessageSend).
Examples
exten => send_msg,1,NoOp()
same => n,Answer()
same => n,Set(MESSAGE_DATA(X-Movial-Content)=application/x-movial-control\;forwarding=true)
same => n,MessageSend(sip:127.0.0.1:5060)
same => n,Hangup()
Connecting a GoIP GSM VoIP gateway to an Asterisk AGI
Related AMI command
> Regarding the AMI MessageSend function available on Asterisk 11, I see
> on the syntax that it supports an argument named "Variable:". The doc is
> not very clear on this. Does this argument allows us to add custom SIP
> headers to the MESSAGE as well?
Yes. The syntax is similar to the Variable: header in other AMI commands,
such as Originate. Instead of setting a dialplan variable, however, you
are instead setting a Message technology variable that will be interpreted
by the channel technology that services the Message request. For the SIP
channel driver, that implies that each one specifies a header to set.
For example:
Action: MessageSend
To: sip:foo.com
From: mypeer
Variable: X-Movial-Content=application/x-movial-control;forwarding=true
Variable: X-Other-Header=bar
See also
- Asterisk func MESSAGE
- Asterisk func MESSAGE_DATA
- Asterisk cmd SendText
- Asterisk cmd SMS