<br><br><div class="gmail_quote">On Sun, Feb 20, 2011 at 4:29 PM, Christian Hiller <span dir="ltr"><<a href="mailto:christian@yellox.de">christian@yellox.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
hello Erik,<br>
<br>
i have set<br>
<br>
<action application="set" data="my_var=123"/><br>
<action application="set" data="session_in_hangup_hook=true"/><br>
<action application="set" data="api_hangup_hook=jsrun cleanup.js<br>
${my_var}"/><br>
<action application="javascript" data="routing.js"/><br>
<br>
The channel_variable ${my_var} gets updated in routing.js but whenever<br>
cleanup.js is executed, then ${my_var} still has the old value of 123.<br>
Why that?<br>
<br></blockquote><div><br></div><div>At the time that the api_hangup_hook=jsrun cleanup.js ${my_var} action is parsed, the value of ${my_var} is "123" so that is what is set. The good news is that if you have session_in_hangup_hook set to true you should be able to see the updated value of my_var. I'm afraid I don't see any wiki examples of how to do this in Javascript. Does anyone have a code sample of how to access the channel variables in a js hangup hook when session_in_hangup_hook is true?</div>
<div><br></div><div>For reference, the Lua method is shown here:</div><div><a href="http://wiki.freeswitch.org/wiki/Lua#Special_Case:_env_object">http://wiki.freeswitch.org/wiki/Lua#Special_Case:_env_object</a></div><div>
<br></div><div>-MC</div></div>