[asterisk-users] Messages out of calls. Is it really possible?

Matthew Jordan mjordan at digium.com
Fri Jul 10 13:29:13 CDT 2015


On Fri, Jul 10, 2015 at 11:51 AM, Rodrigo Pimenta Carvalho
<pimenta at inatel.br> wrote:
>
> Hi.
>
> I have read in some web sites that ASTERISK can support messages out of calls. What does it exactly means?
>
> 1 - Can a dialplan script accept and handle a message from a callee party, even before the call be connected?

Since it is out of call, yes.

SIP MESSAGE requests are handled by the respective channel driver
(chan_sip or the res_pjsip stack) and passed to the dialplan using a
"special" hidden channel, Message. That channel caries the payload and
some meta information about the MESSAGE request, which can be accessed
using the generic out-of-call messaging functions [1].

Likewise, you can send an out of call SIP MESSAGE request using MessageSend [2].

Note that all of this has been supported since Asterisk 10.

> 2 - Can a ringing callee send SIP MESSAGE to the ASTERISK even before answer the call?

Yes, hence the term "out-of-call".

> 3- Could I use dialplan function MESSAGE() to receive SIP messages from callees, even before the call be connected?

It does not receive messages; it accesses data on the message
currently being serviced by the executing Message channel.

chan_sip/res_pjsip will receive and dispatch MESSAGE requests at any
point in time. They have nothing to do with your "normal" SIP or PJSIP
channels, and hence nothing to do with whatever INVITE request derived
channels are currently executing in the dialplan.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_MESSAGE
and https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_MESSAGE_DATA
[2] https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_MessageSend

-- 
Matthew Jordan
Digium, Inc. | Director of Technology
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org



More information about the asterisk-users mailing list