I understood I had to use session directly to obtain the channel...<div><br></div><div>thanks<br><br><div class="gmail_quote">2012/6/7 cristian re <span dir="ltr">&lt;<a href="mailto:cristian.re.work@gmail.com" target="_blank">cristian.re.work@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes of course,<div>I put in my dialplan:</div><div><div class="im"><div>&lt;action application=&quot;set&quot; data=&quot;session_in_hangup_hook=true&quot;/&gt;</div>
<div><br></div></div>But I read somewhere that it&#39;s possible to manage session after &quot;api_hangup_hook&quot; only by Lua, Javascript or Perl scripts.</div>
<div>If my API is exposed in a module can I use it?</div><div>I try in my dialplan to call api with uuid parameter:</div><div><br></div><div>&lt;action application=&quot;set&quot; data=&quot;api_hangup_hook=my_hangup_api ${uuid}&quot;/&gt;
</div><div><br></div><div>and in my c++ module I try to get session using uuid without success:</div><div><br></div><div><div> switch_core_session_t * s = switch_core_session_locate(uuid);</div><div>if (s) {</div><div>   switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;SESSION\n&quot;);</div>

<div>   switch_core_session_rwunlock(s);</div><div>}</div></div><div class="HOEnZb"><div class="h5"><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div class="gmail_quote">2012/6/5 Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Are you setting session_in_hangup_hook?<br><a href="http://wiki.freeswitch.org/wiki/Channel_Variables#session_in_hangup_hook" target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#session_in_hangup_hook</a><br>

-MC<br><br><div class="gmail_quote"><div><div>
On Tue, Jun 5, 2012 at 8:33 AM, cristian re <span dir="ltr">&lt;<a href="mailto:cristian.re.work@gmail.com" target="_blank">cristian.re.work@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>
<div><div><div>Hello,</div><div><br></div><div>I write a custom cpp module for freeswitch that exposes an API:</div><div><br></div><div>SWITCH_ADD_API(commands_api_interface, &quot;my_hangup&quot;, &quot;my_hangup&quot;,  my_hangup_api , MY_HANGUP_USAGE);</div>



<div><br></div><div>I want to call this api from dialplan (after bridge hangup) for reading the variable &quot;billmsec&quot;.</div><div>I put this into my dialplan:</div><div><br></div><div>&lt;action application=&quot;set&quot; data=&quot;session_in_hangup_hook=true&quot;/&gt;</div>



<div>&lt;action application=&quot;set&quot; data=&quot;api_hangup_hook=my_hangup_api&quot;/&gt;</div><div><br></div><div>After hangup freeswitch call correctly my API but I have not figured out how to get the variable.</div>



</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
</div></div></blockquote></div><br></div>