<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks! I copied the lower-case version from another module while<br>
searching the code. I wonder how that module works (?!)
(mod_event_socket.c)<br>
<br>
Anthony Minessale wrote:
<blockquote
 cite="mid:191c3a030901300558o2df83250h59cae52dbc97a562@mail.gmail.com"
 type="cite">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 moz-do-not-send="true"
 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>
"channel name : %s\n",switch_event_get_header_nil(event,
"channel-name"));<br>
    <br>
&nbsp; &nbsp; &nbsp; &nbsp;char* uuid = switch_event_get_header(event, "session-id");<br>
    <br>
&nbsp; &nbsp; &nbsp; &nbsp;switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "uuid :<br>
%s\n",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 moz-do-not-send="true" href="mailto:regs@kinetix.gr">regs@kinetix.gr</a><br>
-------------------------------------------<br>
    <br>
    <br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
    <a moz-do-not-send="true"
 href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
    <a moz-do-not-send="true"
 href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev"
 target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a moz-do-not-send="true"
 href="http://lists.freeswitch.org/mailman/options/freeswitch-dev"
 target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
    <a moz-do-not-send="true" 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 moz-do-not-send="true" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>
ClueCon <a moz-do-not-send="true" href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
  <br>
AIM: anthm<br>
  <a moz-do-not-send="true"
 href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a moz-do-not-send="true"
 href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a moz-do-not-send="true" href="http://irc.freenode.net">irc.freenode.net</a>
#freeswitch<br>
  <br>
FreeSWITCH Developer Conference<br>
  <a moz-do-not-send="true"
 href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
  <a moz-do-not-send="true"
 href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
  <a moz-do-not-send="true"
 href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:213-799-1400<br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Freeswitch-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R &amp; D
email: <a class="moz-txt-link-abbreviated" href="mailto:regs@kinetix.gr">regs@kinetix.gr</a>
------------------------------------------- </pre>
</body>
</html>