The name of the header is.<br><br>Unique-ID<br><br><div class="gmail_quote">On Fri, Jan 30, 2009 at 7:48 AM, Apostolos Pantsiopoulos <span dir="ltr">&lt;<a href="mailto:regs@kinetix.gr">regs@kinetix.gr</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
How can I get a session pointer within an event handler?<br>
<br>
I tried to extract the uuid from the event header and then I tried to<br>
locate the session using the uuid :<br>
<br>
static void my_event_handler(switch_event_t *event)<br>
{<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; switch_assert(event);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,<br>
&quot;channel name : %s\n&quot;,switch_event_get_header_nil(event, &quot;channel-name&quot;));<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;char* uuid = switch_event_get_header(event, &quot;session-id&quot;);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;uuid :<br>
%s\n&quot;,uuid);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;switch_core_session_t *session;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;session = switch_core_session_locate(uuid);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;switch_assert(session);<br>
<br>
 &nbsp; &nbsp;...<br>
<br>
}<br>
<br>
But the uuid is always null. The events that I am binding my routine is<br>
for CHANNEL_CREATE (I tried CHANNEL_EXECUTE too, same result)<br>
<br>
--<br>
-------------------------------------------<br>
Apostolos Pantsiopoulos<br>
Kinetix Tele.com R &amp; D<br>
email: <a href="mailto:regs@kinetix.gr">regs@kinetix.gr</a><br>
-------------------------------------------<br>
<br>
<br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>