]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix warning
authorMathieu Rene <mrene@avgs.ca>
Thu, 13 Aug 2009 22:28:22 +0000 (22:28 +0000)
committerMathieu Rene <mrene@avgs.ca>
Thu, 13 Aug 2009 22:28:22 +0000 (22:28 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14512 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_spy/mod_spy.c

index 751627edc758da947c9d2fed7b5287cc71257cd9..56d26c3c7dc6e53d217358725177be0cf85bc0c5 100644 (file)
@@ -130,7 +130,7 @@ SWITCH_STANDARD_API(dump_hash)
 
 static void event_handler(switch_event_t* event) 
 {
-       switch_core_session_t *session;
+       switch_core_session_t *session = NULL;
        switch_channel_t *channel;
        char *username[2] = {0};
        char* domain[2] = {0};
@@ -166,12 +166,12 @@ static void event_handler(switch_event_t* event)
                return;
        }
 
-       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,"UserSpy retrieved uuid %s for key %s, activating eavesdrop \n",uuid,key);
-       my_uuid = switch_event_get_header(event,"Unique-ID");
-
        session = switch_core_session_locate(uuid);
        channel = switch_core_session_get_channel(session);
 
+       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,"UserSpy retrieved uuid %s for key %s, activating eavesdrop \n",uuid,key);
+       my_uuid = switch_event_get_header(event,"Unique-ID");
+
        switch_channel_set_variable(channel,"spy_uuid",my_uuid);
 
        switch_channel_set_state(channel,CS_EXCHANGE_MEDIA);