[asterisk-users] How to send a SIP MESSAGE outside a call

Tiago Vasconcelos tiago.o.vasconcelos at gmail.com
Sat Jul 28 13:12:57 CDT 2012


On 28-07-2012 18:23, Matthew Jordan wrote:
> In Asterisk 10, you can use the MessageSend application:
>
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_MessageSend
>
> In Asterisk 11, you'll also be able to use AMI:
>
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+ManagerAction_MessageSend
>
> You may also want to look at the functions that modify the message fields:
>
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Function_MESSAGE
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Function_MESSAGE_DATA
>
> You stated that you need to add some custom headers, which you can do with the
> MESSAGE_DATA function.  In order to activate the forwarding, you could
> do something like this:
>
> exten => send_msg,1,NoOp()
> same => n,Set(MESSAGE_DATA(X-Movial-Content)=application/x-movial-control;forwarding=true)
> ; If something needs to go in the body, replace this.  Otherwise,
> ; you can just remove it
> same => n,Set(MESSAGE(body)=hello world!)
> same => n,MessageSend(sip:to_address)
>
> (Note: this wasn't tested, but hopefully it will give you an idea)

Thank you so much for your prompt and detailed answer!

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?

--
Tiago




More information about the asterisk-users mailing list