[asterisk-users] Respond to an out of call SIP MESSAGE

Matthew Jordan mjordan at digium.com
Mon Sep 21 10:01:48 CDT 2015

On Mon, Sep 21, 2015 at 9:45 AM, D'Arcy J.M. Cain <darcy at vex.net> wrote:
> On Mon, 21 Sep 2015 06:48:52 +0000
> Emil Ohlsson <emo at svep.se> wrote:
>> [sip-im]
>> exten _X!, 1, NoOp(Got message)
>> exten _X!, n, Answer()
>> exten _X!, n, Agi(agi://localhost/messagehandler.agi?...)
>> exten _X!, n, SendText(Message received)
> I am not an expert but perhaps you want this.
> [sip-im]
>   exten s,1,NoOp(Got message)
>     same,n,Answer()
>     same,n,Agi(agi://localhost/messagehandler.agi?...)
>     same,n,SendText(Message received)
> Replacing "exten _X!" with "same" is just a shortcut.  I find that
> there are lots of places where spaces cause problems so I just remove
> them all for good measure.  Finally, I am not sure what the mechanism
> is here but if it is like a goto then I think that you want the 's'
> priority.
> Or, I totally don't know what I am talking about and my education will
> be advanced by the replies to this message.  :-)

If you want to send an out of call SIP MESSAGE request, you'll need to
use the MessageSend application:


SendText is used for sending text messages within a call. Since a SIP
channel is not servicing the out of call text message, you cannot use
it to send a SIP MESSAGE request back to whatever sent the original
SIP MESSAGE request.

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