Merge pull request #1404 in FS/freeswitch from ~LAZEDO/freeswitch:feature/FS-10704 to master
* commit '96ae6ef4dd22297c803f821ee615ad86993c95a0': FS-10704 [core] add event-uuid-name FS-10704 [core] allow event-uuid (app_uuid) to be used in application
This commit is contained in:
commit
6eeaf76bc2
|
@ -2758,7 +2758,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
|
||||||
const char *var;
|
const char *var;
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
char *expanded = NULL;
|
char *expanded = NULL;
|
||||||
const char *app, *app_uuid_var;
|
const char *app, *app_uuid_var, *app_uuid_name;
|
||||||
switch_core_session_message_t msg = { 0 };
|
switch_core_session_message_t msg = { 0 };
|
||||||
char delim = ',';
|
char delim = ',';
|
||||||
int scope = 0;
|
int scope = 0;
|
||||||
|
@ -2772,6 +2772,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
|
||||||
switch_uuid_str(uuid_str, sizeof(uuid_str));
|
switch_uuid_str(uuid_str, sizeof(uuid_str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((app_uuid_name = switch_channel_get_variable(channel, "app_uuid_name"))) {
|
||||||
|
switch_channel_set_variable(channel, "app_uuid_name", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
switch_assert(application_interface);
|
switch_assert(application_interface);
|
||||||
|
|
||||||
app = application_interface->interface_name;
|
app = application_interface->interface_name;
|
||||||
|
@ -2856,6 +2860,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", expanded);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", expanded);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID", app_uuid);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID", app_uuid);
|
||||||
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID-Name", app_uuid_name);
|
||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2880,6 +2885,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", expanded);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", expanded);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Response", resp ? resp : "_none_");
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Response", resp ? resp : "_none_");
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID", app_uuid);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID", app_uuid);
|
||||||
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID-Name", app_uuid_name);
|
||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -550,6 +550,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
|
||||||
if (cmd_hash == CMD_EXECUTE) {
|
if (cmd_hash == CMD_EXECUTE) {
|
||||||
char *app_name = switch_event_get_header(event, "execute-app-name");
|
char *app_name = switch_event_get_header(event, "execute-app-name");
|
||||||
char *event_uuid = switch_event_get_header(event, "event-uuid");
|
char *event_uuid = switch_event_get_header(event, "event-uuid");
|
||||||
|
char *event_uuid_name = switch_event_get_header(event, "event-uuid-name");
|
||||||
char *app_arg = switch_event_get_header(event, "execute-app-arg");
|
char *app_arg = switch_event_get_header(event, "execute-app-arg");
|
||||||
char *content_type = switch_event_get_header(event, "content-type");
|
char *content_type = switch_event_get_header(event, "content-type");
|
||||||
char *loop_h = switch_event_get_header(event, "loops");
|
char *loop_h = switch_event_get_header(event, "loops");
|
||||||
|
@ -629,6 +630,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
|
||||||
if (event_uuid) {
|
if (event_uuid) {
|
||||||
switch_channel_set_variable(channel, "app_uuid", event_uuid);
|
switch_channel_set_variable(channel, "app_uuid", event_uuid);
|
||||||
}
|
}
|
||||||
|
if (event_uuid_name) {
|
||||||
|
switch_channel_set_variable(channel, "app_uuid_name", event_uuid_name);
|
||||||
|
}
|
||||||
|
|
||||||
switch_channel_set_variable_printf(channel, "current_loop", "%d", x + 1);
|
switch_channel_set_variable_printf(channel, "current_loop", "%d", x + 1);
|
||||||
switch_channel_set_variable_printf(channel, "total_loops", "%d", loops);
|
switch_channel_set_variable_printf(channel, "total_loops", "%d", loops);
|
||||||
|
|
Loading…
Reference in New Issue