change global variable at runtime

Status
Not open for further replies.

haglo

New Member
May 14, 2021
8
0
1
63
I set initial via fs_cli from linuxconsole the following global variable:
Code:
fs_cli -x "global_setvar office_status=open"

When i set it for the first time, then i can read it in dialplan perfectly

XML:
    <!-- TOD Setting to Route -->
    <extension name="tod route, 422">
      <condition field="destination_number" expression="^(4221[0-2])$">
        <action application="execute_extension" data="$1_$${office_status}"/>
      </condition>
    </extension>


    <extension name="office is open">
      <condition field="destination_number" expression="^(4221[0-2][B]_open[/B])$" break="never">
        <action application="set" data="office_status=open" inline="true"/>
        <action application="bridge" data="{ignore_early_media=true}sofia/internal/42210%82.220.39.42,sofia/internal/42211%82.220.39.42,sofia/internal/42212%82.220.39.42"/>
      </condition>
    </extension>

    <extension name="office is closed">
      <condition field="destination_number" expression="^(4221[0-2][B]_closed[/B])$" break="never">
        <action application="set" data="office_status=closed" inline="true"/>
        <action application="answer"/>
        <action application="sleep" data="1000"/>
        <action application="playback" data="/usr/local/freeswitch/recordings/closed.mp3"/>
        <action application="sleep" data="500"/>
        <action application="hangup" data="NORMAL_CLEARING"/>
      </condition>
    </extension>

But when i change on Linuxconsole the variabel by the command
Code:
fs_cli -x "global_setvar office_status=closed"

then i get in dialplan above the result for office_status=open and not office_status=closed

Is there a cache or something i must flush?
 
Last edited:
Status
Not open for further replies.