Hi, I'm having trouble configuring Asterisk to respond to an incoming out of call SIP MESSAGE. The transport protocol is TLS and the Asterisk version is 10 (it's old, but I'm kind of stuck with it at the moment). Currently I have roughly the following configuration and handling: sip.conf: [general] accet_outofcall_messages=yes outofcall_message_context=sip-im and extensions.conf [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 can see in the log from Asterisk that the script in the sip-im context is running, but there is no message sent. I have followed the code in the call, and it seems like there is no channel registered with the SendText application. Is there some other approach that I could use to send a SIP MESSAGE back to the client? Does the client need to register for this to work? BR, Emil
Could it be in the [general] section you should have; accept_outofcall_message=yes Your line appears to be missing the 'p' in accept and an extraneous 's' in message. Larry. On 21/09/2015 2:48 PM, Emil Ohlsson wrote:> Hi, > > I'm having trouble configuring Asterisk to respond to an incoming out of call SIP MESSAGE. The transport protocol is TLS and the Asterisk version is 10 (it's old, but I'm kind of stuck with it at the moment). Currently I have roughly the following configuration and handling: > > sip.conf: > > [general] > accet_outofcall_messages=yes > outofcall_message_context=sip-im > > and extensions.conf > > [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 can see in the log from Asterisk that the script in the sip-im context is running, but there is no message sent. I have followed the code in the call, and it seems like there is no channel registered with the SendText application. Is there some other approach that I could use to send a SIP MESSAGE back to the client? Does the client need to register for this to work? > > BR, > Emil >
D'Arcy J.M. Cain
2015-Sep-21 14:45 UTC
[asterisk-users] Respond to an out of call SIP MESSAGE
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. :-) -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy at Vex.Net VoIP: sip:darcy at Vex.Net
Matthew Jordan
2015-Sep-21 15:01 UTC
[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