Julian Lyndon-Smith
2008-Sep-29 19:59 UTC
[asterisk-users] Channel variables "materializing" ...
I am trying to track a strange bug down, and need to ask a really stupid question, just so I can eliminate the possibility .. When a SIP channel is hung up, I import a variable called "MEETMEROOM" from the BRIDGEPEER channel, and if it is set, jump to another part of the dialplan. [snip] exten => h,1,ImportVar(PARKED=${BRIDGEPEER},MEETMEROOM) exten => h,n,GotoIf($["${PARKED}" != ""]?end) exten => h,n,goto(DialStatus,${DIALSTATUS},1) exten => h,n(end),NoOp() [snip] There have been several occasions over the past couple of days where this variable has not executed the goto, and gone to the (end) label when I know for certain that the BRIDGEPEER channel does not have the variable set (I was able to duplicate the error once during a test phase when I was not setting the MEETMEROOM variable at all) so, to the stupid question: If at some stage the BRIDGEPEER channel *has* had the MEETMEROOM variable declared, are there any circumstances at all where this variable may be transmitted to the next call that uses this channel. There, I asked it. I don't believe that I just did. But there you have it. It's out in the open now ... The only other thing that I was thinking of - if the PARKED variable was already set on the SIP channel, would an import of a non-existant variable from the BRIDGEPEER channel overwrite it, or keep it at the previous value ? Hmmm. Time to experiment. Julian. ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
Brent Davidson
2008-Sep-29 20:18 UTC
[asterisk-users] Channel variables "materializing" ...
Julian Lyndon-Smith wrote:> I am trying to track a strange bug down, and need to ask a really stupid > question, just so I can eliminate the possibility .. > > When a SIP channel is hung up, I import a variable called "MEETMEROOM" > from the BRIDGEPEER channel, and if it is set, jump to another part of > the dialplan. > > [snip] > exten => h,1,ImportVar(PARKED=${BRIDGEPEER},MEETMEROOM) > exten => h,n,GotoIf($["${PARKED}" != ""]?end) > exten => h,n,goto(DialStatus,${DIALSTATUS},1) > exten => h,n(end),NoOp() > [snip] > > There have been several occasions over the past couple of days where > this variable has not executed the goto, and gone to the (end) label > when I know for certain that the BRIDGEPEER channel does not have the > variable set (I was able to duplicate the error once during a test phase > when I was not setting the MEETMEROOM variable at all) > > so, to the stupid question: If at some stage the BRIDGEPEER channel > *has* had the MEETMEROOM variable declared, are there any circumstances > at all where this variable may be transmitted to the next call that uses > this channel. > > There, I asked it. I don't believe that I just did. But there you have > it. It's out in the open now ... > > The only other thing that I was thinking of - if the PARKED variable was > already set on the SIP channel, would an import of a non-existant > variable from the BRIDGEPEER channel overwrite it, or keep it at the > previous value ? Hmmm. Time to experiment. > > Julian. > > ______________________________________________________________________ >This may be a long shot but would it not be better to check to see whether or not the MEETMEROOM variable is defined before assigning it's value to another variable? With just a cursory glance through the asterisk documentation I have available I don't see any indication of how asterisk variables behave if they are undefined. The other possibility I was considering is maybe BRIDGEPEER is not always being set to the correct channel? Good luck, -Brent