<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18939">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Thanks Mike,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>and with PHP is $session available ?</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=msc@freeswitch.org href="mailto:msc@freeswitch.org">Michael
Collins</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=freeswitch-users@lists.freeswitch.org
href="mailto:freeswitch-users@lists.freeswitch.org">FreeSWITCH Users Help</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, December 01, 2010 3:48
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Freeswitch-users] can't get
channel variables after hangup</DIV>
<DIV><BR></DIV>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
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<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>
<P>
<HR>
<P></P>_______________________________________________<BR>FreeSWITCH-users
mailing
list<BR>FreeSWITCH-users@lists.freeswitch.org<BR>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<BR>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<BR>http://www.freeswitch.org<BR></BLOCKQUOTE></BODY></HTML>