Variable Pollution? Stack Overflow? WTF Is Going On Here Or… How Can I TOTALLY Clear A Variable?

Home » Asterisk Users » Variable Pollution? Stack Overflow? WTF Is Going On Here Or… How Can I TOTALLY Clear A Variable?
Asterisk Users No Comments

The first time I run a loop, the AGI returns a list of files.

I append a path from a variable, and play out the files using SHIFT to loop them.

The FIRST time I enter the system, this is what the complete list to be looped looks like:

/audio/phone_service_live/menu1-eye_conditions/title,/audio/phone_service_live/menu2-benefits_concessions/title,audio/phone_service_live/menu3-living_with_sight_loss/title,/audio/phone_service_live/menu4…(etc)

When the menu is re-played, this is what the list looks like:

/audio/phone_service_live/menu1-eye_conditions/title,/audio/phone_service_live/menu2-benefits_concessions/io/phone_service_live/menu3-living_with_sight_loss/title,/audio/phone_service_live/menu4…

Did you notice? “concessions/title,audio/” has become “concessions/io/phone”

Another reload:

/audio/phone_service_live/menu1-eye_conditions/ti/phone_service_live/menu2-benefits_concessions/title,/audio/phone_service_live/menu3-living_with_sight_loss/title,/audio/phone_service_livle,/audio…

Again, see that? This time something different:
“conditions/title,/audio” has become: “conditions/ti/phone”

Seems totally random each time. Now, remember I had the problem a few days ago where a variable read from a FILE was getting corrupted?

Well, this is now a variable getting sent from a AGI.

Yes, I have tried to Set(myvar=) before each new loop, but it still does it.

It’s driving me freakin’ nuts and I’ve been trying to find a workaround since Saturday. Any ideas?

Bug? Or something I’m doing wrong?