mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 20:50:41 +00:00
FS-6452 mod_spy doesn't react on events without variable_domain_name
This commit is contained in:
parent
18df083c69
commit
190c241c81
@ -143,7 +143,7 @@ SWITCH_STANDARD_API(dump_hash)
|
|||||||
switch_core_hash_this(hi, &key, NULL, &val);
|
switch_core_hash_this(hi, &key, NULL, &val);
|
||||||
spy = (spy_t *) val;
|
spy = (spy_t *) val;
|
||||||
|
|
||||||
stream->write_function(stream, "%s :");
|
stream->write_function(stream, "%s :", key);
|
||||||
while (spy) {
|
while (spy) {
|
||||||
stream->write_function(stream, " %s", spy->uuid);
|
stream->write_function(stream, " %s", spy->uuid);
|
||||||
spy = spy->next;
|
spy = spy->next;
|
||||||
@ -165,6 +165,7 @@ static switch_status_t process_event(switch_event_t *event)
|
|||||||
char key[512];
|
char key[512];
|
||||||
char *uuid = NULL, *my_uuid = NULL;
|
char *uuid = NULL, *my_uuid = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
int found = 0;
|
||||||
|
|
||||||
|
|
||||||
switch_thread_rwlock_rdlock(globals.spy_hash_lock);
|
switch_thread_rwlock_rdlock(globals.spy_hash_lock);
|
||||||
@ -193,10 +194,11 @@ static switch_status_t process_event(switch_event_t *event)
|
|||||||
if ((session = switch_core_session_locate(spy->uuid))) {
|
if ((session = switch_core_session_locate(spy->uuid))) {
|
||||||
switch_channel_t *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);
|
|
||||||
my_uuid = switch_event_get_header(event, "Unique-ID");
|
my_uuid = switch_event_get_header(event, "Unique-ID");
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "UserSpy retrieved uuid %s for key %s, activating eavesdrop\n", uuid, key);
|
||||||
|
|
||||||
switch_channel_set_variable(channel, "spy_uuid", my_uuid);
|
switch_channel_set_variable(channel, "spy_uuid", my_uuid);
|
||||||
|
found++;
|
||||||
|
|
||||||
switch_channel_set_state(channel, CS_EXCHANGE_MEDIA);
|
switch_channel_set_state(channel, CS_EXCHANGE_MEDIA);
|
||||||
switch_channel_set_flag(channel, CF_BREAK);
|
switch_channel_set_flag(channel, CF_BREAK);
|
||||||
@ -212,6 +214,10 @@ static switch_status_t process_event(switch_event_t *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!found) {
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user