This won&#39;t work. The &quot;session_in_hangup_hook&quot; 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&#39;s gone. The &quot;session&quot; object will be available only in the script that is called in the hangup hook. <div>
<br></div><div>Here&#39;s a simple script you can tinker with:</div><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">-- hook-test.lua                                                                                                                                                </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">dat = env:serialize()                                                                                                                                           </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">--freeswitch.consoleLog(&quot;INFO&quot;,&quot;Here you go:\n&quot; .. dat .. &quot;\nn&quot;)                                                                                                </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">                                                                                                                                                                </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">uuid = env:getHeader(&quot;uuid&quot;)                                                                                                                                    </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">freeswitch.consoleLog(&quot;INFO&quot;,&quot;Inside hangup hook, uuid is: &quot; .. dat .. &quot;\n&quot;)                                                                                    </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">                                                                                                                                                                </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">my_var = env:getHeader(&quot;my_custom_var&quot;)                                                                                                                         </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">freeswitch.consoleLog(&quot;INFO&quot;,&quot;my_custom_var is &#39;&quot; .. dat .. &quot;&#39;\n&quot;)                                                                                              </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">                                                                                                                                                                </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">api = freeswitch.API()                                                                                                                                          </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">res = api:execute(&quot;uuid_dump&quot;,uuid)                                                                                                                             </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">freeswitch.consoleLog(&quot;INFO&quot;,&quot;result of &#39;uuid_dump &quot; .. uuid .. &quot;&#39; is:\n&quot; .. res .. &quot;\n\n&quot;)                                                                     </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">&lt;<a href="mailto:infos@madovsky.org">infos@madovsky.org</a>&gt;</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">   &lt;action application=&quot;set&quot; 
data=&quot;session_in_hangup_hook=true&quot;/&gt;<br>   &lt;action 
application=&quot;set&quot; data=&quot;api_hangup_hook=system /usr/local/bin/php 
/usr/local/freeswitch/scripts/php/test.php ${uuid}&quot;/&gt;<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(&quot;/usr/local/freeswitch/bin/fs_cli -x \&quot;uuid_getvar 
&quot;.$argv[1].&quot;  test_var\&quot;&quot;, $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>