update
This commit is contained in:
parent
1ed7837bc6
commit
32f6aa3b9e
|
@ -1761,6 +1761,11 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
|
|||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Presence-Data", v);
|
||||
}
|
||||
|
||||
|
||||
if ((v = switch_channel_get_variable(channel, "presence_data_cols"))) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Presence-Data-Cols", v);
|
||||
}
|
||||
|
||||
if ((v = switch_channel_get_variable(channel, "call_uuid"))) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Call-UUID", v);
|
||||
}
|
||||
|
@ -1813,13 +1818,15 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
|
|||
SWITCH_DECLARE(void) switch_channel_event_set_extended_data(switch_channel_t *channel, switch_event_t *event)
|
||||
{
|
||||
switch_event_header_t *hi;
|
||||
int x, global_verbos_events = 0;
|
||||
int x, global_verbose_events = 0;
|
||||
|
||||
switch_mutex_lock(channel->profile_mutex);
|
||||
|
||||
switch_core_session_ctl(SCSC_VERBOSE_EVENTS, &global_verbos_events);
|
||||
switch_core_session_ctl(SCSC_VERBOSE_EVENTS, &global_verbose_events);
|
||||
|
||||
if (global_verbos_events || switch_channel_test_flag(channel, CF_VERBOSE_EVENTS) ||
|
||||
if (global_verbose_events ||
|
||||
switch_channel_test_flag(channel, CF_VERBOSE_EVENTS) ||
|
||||
switch_event_get_header(event, "presence-data-cols") ||
|
||||
event->event_id == SWITCH_EVENT_CHANNEL_CREATE ||
|
||||
event->event_id == SWITCH_EVENT_CHANNEL_ORIGINATE ||
|
||||
event->event_id == SWITCH_EVENT_CHANNEL_UUID ||
|
||||
|
|
|
@ -973,7 +973,7 @@ static char *parse_presence_data_cols(switch_event_t *event)
|
|||
int i;
|
||||
char *r;
|
||||
char col_name[128] = "";
|
||||
const char *data = switch_event_get_header(event, "variable_presence_data_cols");
|
||||
const char *data = switch_event_get_header(event, "presence-data-cols");
|
||||
|
||||
if (zstr(data)) {
|
||||
return NULL;
|
||||
|
@ -1094,34 +1094,16 @@ static void core_event_handler(switch_event_t *event)
|
|||
case SWITCH_EVENT_CHANNEL_HOLD:
|
||||
case SWITCH_EVENT_CHANNEL_UNHOLD:
|
||||
case SWITCH_EVENT_CHANNEL_EXECUTE: {
|
||||
|
||||
if ((extra_cols = parse_presence_data_cols(event))) {
|
||||
|
||||
new_sql() = switch_mprintf("update channels set application='%q',application_data='%q',"
|
||||
"presence_id='%q',presence_data='%q',%s where uuid='%q' and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "application"),
|
||||
switch_event_get_header_nil(event, "application-data"),
|
||||
switch_event_get_header_nil(event, "channel-presence-id"),
|
||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||
extra_cols,
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname")
|
||||
|
||||
);
|
||||
|
||||
free(extra_cols);
|
||||
|
||||
} else {
|
||||
|
||||
new_sql() = switch_mprintf("update channels set application='%q',application_data='%q',"
|
||||
"presence_id='%q',presence_data='%q' where uuid='%q' and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "application"),
|
||||
switch_event_get_header_nil(event, "application-data"),
|
||||
switch_event_get_header_nil(event, "channel-presence-id"),
|
||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname")
|
||||
|
||||
);
|
||||
}
|
||||
new_sql() = switch_mprintf("update channels set application='%q',application_data='%q',"
|
||||
"presence_id='%q',presence_data='%q' where uuid='%q' and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "application"),
|
||||
switch_event_get_header_nil(event, "application-data"),
|
||||
switch_event_get_header_nil(event, "channel-presence-id"),
|
||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname")
|
||||
);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue