[Asterisk-Users] Re: Expressions - solved (chan_local)

John Todd jtodd at loligo.com
Thu Dec 18 20:18:23 MST 2003


At 6:45 PM +0100 12/18/03, Florian Overkamp wrote:
>Hi,
>
>At 17:21 18-12-2003 +0100, you wrote:
>>A first it seemed like the variable was set until Answer() was called but it
>>is not the case. More testing revealed the vars gets cleared when Asterisk
>>bridges the channel and chosen extension set in the call spool file.
>>
>>     -- Executing NoOp("Local/1234 at default-9d04,1", "id = 36") in new stack
>>     -- Executing Answer("Local/1234 at default-9d04,1", "") in new stack
>>     -- Executing NoOp("Local/1234 at default-9d04,1", "id = 36") in new stack
>>     -- Executing Wait("Local/1234 at default-9d04,1", "1") in new stack
>>   == Spawn extension (macro-dialprovider, s, 5) exited non-zero on
>>'Local/1234 at default-9d04,2' in macro 'dialprovider'
>>   == Spawn extension (default, 1234, 2) exited non-zero on
>>'Local/1234 at default-9d04,2'
>>     -- Executing NoOp("IAX2[x.x.x.x:4569]/1", "id = ") in new stack
>
>Yes, it seems to be related to some combination of using the Local 
>channel driver and applications (not just Answer, I see this with 
>Wait too):
>
>My extensions.conf has this context:
>
>exten = s,1,NoOp(${INLOG})
>exten = s,2,NoOp(${HUIS})
>exten = s,3,Wait(5)
>exten = s,4,NoOp(${INLOG})
>exten = s,5,NoOp(${HUIS})
>
>If I activate a call to this code with a Local driver, the variables 
>are erased after the Wait!
>If I activate a call to this code with i.e. MGCP driver, the 
>variables are untouched.
>
>Florian

One for the Wiki:

This is perhaps inverted from your explanation above, but I ran 
across this bug with Mark some months ago.

http://bugs.digium.com/bug_view_page.php?bug_id=0000239

An additional modifier to Dial was added specifically for Local 
channel types.  If you add the "/n" modifier at the end of a 
chan_local call, then the variables will be erased upon passage 
through the system.  Otherwise, you'll get the variables from the 
first leg of the call passed through upon native bridge - there is a 
brief interval, during the "ringing" phase of the second leg, where 
the second leg has it's own variables, but then those get wiped out 
upon bridging.  Adding the "/n" option prevents this.

Example syntax:

exten => 1X.,1,Dial(Local/${EXTEN}@from-outside1/n)

This is a difficult concept to grasp until unless you're looking at 
it in your own configs and wondering "WHAT THE @#(%@#% IS GOING ON 
HERE?"  Tuck this away for the rainy day that you're using chan_local.


JT




More information about the asterisk-users mailing list