This commit is contained in:
Mathieu Rene 2010-12-15 09:43:36 -05:00
parent e9958c5b0c
commit c4154633cc
1 changed files with 9 additions and 9 deletions

View File

@ -131,7 +131,6 @@ SWITCH_STANDARD_API(dump_hash)
static switch_status_t process_event(switch_event_t *event) static switch_status_t process_event(switch_event_t *event)
{ {
switch_core_session_t *session = NULL; switch_core_session_t *session = NULL;
switch_channel_t *channel;
char *username[3] = { 0 }; char *username[3] = { 0 };
char *domain[3] = { 0 }; char *domain[3] = { 0 };
char key[512]; char key[512];
@ -172,8 +171,8 @@ static switch_status_t process_event(switch_event_t *event)
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
session = switch_core_session_locate(uuid); if ((session = switch_core_session_locate(uuid))) {
channel = switch_core_session_get_channel(session); switch_channel_t *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); 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"); my_uuid = switch_event_get_header(event, "Unique-ID");
@ -184,6 +183,7 @@ static switch_status_t process_event(switch_event_t *event)
switch_channel_set_flag(channel, CF_BREAK); switch_channel_set_flag(channel, CF_BREAK);
switch_core_session_rwunlock(session); switch_core_session_rwunlock(session);
}
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }