if (!uuid || (l->session && strcmp(uuid, switch_core_session_get_uuid(l->session)))) {
send = 0;
}
+ if (!strcmp(switch_core_session_get_uuid(l->session), switch_event_get_header_nil(event, "Job-Owner-UUID"))) {
+ send = 1;
+ }
}
if (send) {
listener_t *listener;
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
int bg;
+ char bg_owner_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
int ack;
int console_execute;
switch_memory_pool_t *pool;
if (switch_event_create(&event, SWITCH_EVENT_BACKGROUND_JOB) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-UUID", acs->uuid_str);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Owner-UUID", acs->bg_owner_uuid_str);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Command", acs->api_cmd);
if (acs->arg) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Command-Arg", acs->arg);
switch_uuid_get(&uuid);
switch_uuid_format(acs->uuid_str, &uuid);
}
+ switch_copy_string(acs->bg_owner_uuid_str, switch_core_session_get_uuid(listener->session), sizeof(acs->bg_owner_uuid_str));
switch_snprintf(reply, reply_len, "~Reply-Text: +OK Job-UUID: %s\nJob-UUID: %s\n\n", acs->uuid_str, acs->uuid_str);
switch_thread_create(&thread, thd_attr, api_exec, acs, acs->pool);
sanity = 2000;