[asterisk-dev] Dialplan AGI with SIP channels blocking if AGI already running - parallellism not possible?

Johan Sandgren jsa at svep.se
Wed Apr 3 13:26:42 CDT 2013


Thanks again Matt.

I see there are 2 parameters to import (Note i'm using asterisk V10.0.0, it is supported I see in the docs. Ok)
I can't find out how to get the channel to set as parameter 1, and the 2nd parameter, I'm guessing the format, not sure, since the docs is quite limited.

I don't succeed. I'm not sure I get the right Channel as well, If I print ${CHANNEL}, it shows "Local/

This is my dialplan for this I'm trying:

An incoming sip message enters in context sipmessage.

[sipmessage]
exten => 1000,1, Answer()
exten => 1000,n, NoOp("SIP-MESSAGE")
exten => 1000,n, NoOp(To ${MESSAGE(to)})
exten => 1000,n, NoOp(From ${MESSAGE(from)})
exten => 1000,n, NoOp(Body ${MESSAGE(body)})
exten => 1000,n, NoOp("Kanalnamn = " ${CHANNEL})    	; -> this outputs "Message/ast_msg_queue"
exten => 1000,n, NoOp(sip msg body=${MESSAGE(body)})		; I can print the SIP MESSAGE body here, it works.
exten => 1000, n, Originate(Local/message_handler at testhandler,app,Echo)
exten => 1000, n, Hangup()

[testhandler]
exten => message_handler,1,NoOp("testhandler")
exten => message_handler, n, NoOp("1 Imported value="IMPORT(${CHANNEL}, MESSAGE)		; returns "1 Imported value="IMPORT(Local/message_handler at scaiphandler-e3d2;2, MESSAGE"
exten => message_handler, n, NoOp("2 Imported value="IMPORT(${CHANNEL}, ${MESSAGE(body)})	; returns "2 Imported value="IMPORT(Local/message_handler at scaiphandler-e3d2;2, 
exten => message_handler,n, Answer()	; This will release the Originate in 1000
exten => message_handler, n,Agi(agi://localhost/sipmessageprocessor.agi?body=....SIP MESSAGE BODY when I get it right)
exten => message_handler, n,Hangup()





-----Ursprungligt meddelande-----
Från: asterisk-dev-bounces at lists.digium.com [mailto:asterisk-dev-bounces at lists.digium.com] För Matthew Jordan
Skickat: den 3 april 2013 19:50
Till: asterisk-dev at lists.digium.com
Ämne: Re: [asterisk-dev] Dialplan AGI with SIP channels blocking if AGI already running - parallellism not possible?

On 04/03/2013 12:43 PM, Johan Sandgren wrote:
> 
> Thanks for the suggestion Matt,
> It works on behalf of the blocking is gone! Yes, celebration!! 
> 
> But, variable transfer between contexts when using Originate doesn't seem to happen.
> I tried different ways of setting my variable (with and without __, lower and caps chars), still NULL when received. The debug output in asterisk doesn't show any copying taking place either, so guess it might not happen at all.
> 
> Just for comparison, I used Dial instead of Originate. The blocking is back, but the inherent variables (prefix __) are copied, and it shows in the debug output of asterisk.
> 
> Is this a limitation, or a bug perhaps?
> Any suggestions for how to transfer the needed variable between contexts using Originate is appreciated.
> 

That's my fault; I had forgotten that Originating doesn't create a child channel but rather a new independent channel. Hence, variable inheritance does not apply.

You can use the IMPORT function [1] to pull the channel variables from the Message channel. You would want to do this before you Answer the Local channel, so as to prevent the Message channel from being hung up.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Function_IMPORT


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



--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev





More information about the asterisk-dev mailing list