Is there a way to unset SHARED variables?


I’m using shared variables (FUNC_SHARED) on my system and I notice, that it is constantly eating all my memory until I restart the whole asterisk process. Depending on the number of calls processed, this leads to a total of over 20 GB RAM consumed by a single asterisk process after a while.
I tracked that memory consumption down to the use of shared variables and noticed, they won’t be deleted automatically on hangup - which is to be expected.
Is there a way to unset these variables manually by dialplan? I have a registered hangup routine which could easily check if these shared variables are needed and unset them. But I did not find a way to really delete this variable. I could overwrite it with “”, but I think this wouldn’t help with the memory issues.

I need to use shared variables to have a link between one incoming and some internal/outgoing channels.
Inheriting a variable wouldn’t work here, because some of these channels might only get generated with a 302 redirect from a phone or an external PBX - but the original inbound channel needs to know some variables which are getting set by the outbound channel when these events occur.
That’s why I’m setting these variables via SHARED function and link them via my first inbound channel UID.


My guess would be something like 'set(SHARED(foo)=)' but it is only a guess.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.