This won't work. The "session_in_hangup_hook" literally means that the $session object is available in the hangup hook script. You need to use Lua, Perl, or Javascript to access the $session object. What you are doing is actually trying to access a uuid that does not exist. Once the call is over it's gone. The "session" object will be available only in the script that is called in the hangup hook. <div>
<br></div><div>Here's a simple script you can tinker with:</div><div><div><font class="Apple-style-span" face="'courier new', monospace">-- hook-test.lua </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">dat = env:serialize() </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">--freeswitch.consoleLog("INFO","Here you go:\n" .. dat .. "\nn") </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">uuid = env:getHeader("uuid") </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">freeswitch.consoleLog("INFO","Inside hangup hook, uuid is: " .. dat .. "\n") </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">my_var = env:getHeader("my_custom_var") </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">freeswitch.consoleLog("INFO","my_custom_var is '" .. dat .. "'\n") </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">api = freeswitch.API() </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">res = api:execute("uuid_dump",uuid) </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">freeswitch.consoleLog("INFO","result of 'uuid_dump " .. uuid .. "' is:\n" .. res .. "\n\n") </font></div>
<div><br></div><div>Hopefully that will illustrate the issue...</div><div>-MC</div><br><div class="gmail_quote">On Wed, Dec 1, 2010 at 8:53 AM, Madovsky <span dir="ltr"><<a href="mailto:infos@madovsky.org">infos@madovsky.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff">
<div><font size="2">I set this in my dialplan :</font></div>
<div><font size="2"></font> </div>
<div><font size="2"> <action application="set"
data="session_in_hangup_hook=true"/><br> <action
application="set" data="api_hangup_hook=system /usr/local/bin/php
/usr/local/freeswitch/scripts/php/test.php ${uuid}"/><br></font></div>
<div><font size="2"> and this in test.php:</font></div>
<div><font size="2"></font> </div>
<div><font size="2"> exec("/usr/local/freeswitch/bin/fs_cli -x \"uuid_getvar
".$argv[1]." test_var\"", $exTabRet, $req);</font></div>
<div><font size="2"></font> </div>
<div><font size="2"></font> </div>
<div><font size="2"> it results :</font></div>
<div><font size="2"></font> </div>
<div>-ERR No Such Channel!</div>
<div> </div>
<div><font size="2"></font> </div>
<div><font size="2">I tried to replace ${uuid} by ${call_uuid} without
success.</font></div>
<div><font size="2"></font> </div>
<div><font size="2">Thanks</font></div>
<div><font size="2"></font> </div>
<div><font size="2">Franck</font></div></div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>