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

Emil Ohlsson emo at svep.se
Tue Sep 22 01:53:11 CDT 2015


Yes, that is how the problem was solved before when the transport protocol for messages was UDP, but TLS (TCP) this doesn't work. Partly because MessageSend doesn't support SIPS and partly because it focuses on sending a new message instead of reusing an existing stream. Using wireshark I can see that the TLS stream is still alive as there is no tear down communication.

The "same,n," is a good shortcut to make the text more readable, I'll add that but I don't think that is the cause as I can follow the source code and see that the SendText command is executed but fails silently.

Thanks for the feedback,
Emil

________________________________________
From: Matthew Jordan <mjordan at digium.com>
Sent: Monday, September 21, 2015 5:01 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Cc: Emil Ohlsson
Subject: Re: [asterisk-users] Respond to an out of call SIP MESSAGE

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:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_MessageSend

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