[asterisk-users] Variables set by AGI lost in dialplan

Deepesh D deep.d2010 at gmail.com
Thu Feb 14 05:39:52 CST 2013


The calls are always handled in the same manner, and I am not swapping
any channels.

Its just a simple dialplan

[my_context]
exten => _X.,1,MSet(my_var=0,my_var1=0)
exten => _X.,n,AGI
exten => _X.,n,Log(NOTICE,"${my_var} ${my_var1}")
           :
     Do some processing with variables (these are just some simple
ExecIf statements to set some other variables)
           :
           :
exten => _X.,n,Dial(SIP/some_exten)
exten => _X.,n,Hangup


On Thu, Feb 14, 2013 at 4:24 PM, Yves A. <yves030 at gmx.de> wrote:
> are the calls always handled in the same manner, or sometimes different,
> e.g.
> with conferencing, bridging, transferring, using local channels and and
> and...?
> in that case try to use two underscores before the variablename to use
> inheritance.
>
> maybe you accidentially swap the channels? you could try to set the
> variables with
> help of the "shared" function to set it for both channels...
>
> regards,
> yves
>
> Am 14.02.2013 10:40, schrieb Deepesh D:
>>
>> Hello,
>>
>> I am using asterisk 1.8.17.0 with a fast agi written in C
>>
>> The following is a part of my dialplan
>>
>> exten => _X.,n,MSet(my_var=0,my_var1=0)
>> exten => _X.,n,AGI
>> ;; Call to a fast agi to set values of my_var my_var1
>> exten => _X.,n,Log(NOTICE,"${my_var} ${my_var1}") ;; log the values to
>> asterisk messages
>>
>> Inside the AGI I do some calculations and set the values of my_var and
>> my_var1 variables like
>> SET VARIABLE my_var "0.008"
>> SET VARIABLE my_var1 "0.009"
>>
>> The problem I am facing is that sometimes the variables are wrongly
>> received as 0 (zero) in the dialplan even if the AGI has set it to a
>> non-zero value. Inside the AGI I am logging the values of variables to
>> a log file, and the log file always shows non-zero values. But in my
>> asterisk messages file the values are zero for some calls.
>>
>> This error does not happen for all calls and is not reproducible, it
>> is random. My asterisk server handles about 100 calls per minute, so
>> its impossible for me to do an 'agi set debug' and observer the output
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>                 http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>     http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list