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
Mikhail Lischuk
2013-Feb-14 09:52 UTC
[asterisk-users] Variables set by AGI lost in dialplan
Deepesh D ????? 14.02.2013 11:40:> My asterisk serverhandles about 100 calls per minute, so> its impossible for me to do an'agi set debug' and observer the output You can turn debugging on for some period of time (until you get an error) and then just look back at /var/log/asterisk/debug (or whatever is configured in logger.conf) with less or something. No need to look at debugs realtime, besides most of time it is impossible as you've just said. -- With Best Regards Mikhail Lischuk -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130214/1b4409e2/attachment.htm>
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 >
Steve Edwards
2013-Feb-14 15:05 UTC
[asterisk-users] Variables set by AGI lost in dialplan
On Thu, 14 Feb 2013, Deepesh D wrote:> 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.Are the variables actually set to '0' and not '' (like an undefined variable)?> This error does not happen for all calls and is not reproducible, it is > random.Maybe you are violating the AGI protocol. Are you using an established library or did you roll your own?> My asterisk server handles about 100 calls per minute, so its impossible > for me to do an 'agi set debug' and observer the outputThat's less than 2 per second, so the output may be voluminous, but not impossible. Without some AGI debugging output it will be difficult to suggest anything relevant. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000