cJSON *i, *indialog = cJSON_GetObjectItem(msg, "inDialog");
const char *body = cJSON_GetObjectCstr(msg, "body");
switch_bool_t is_dialog = indialog && (indialog->type == cJSON_True || (indialog->type == cJSON_String && switch_true(indialog->valuestring)));
+ const char *context = NULL;
+
+ switch_mutex_lock(jsock->flag_mutex);
+
+ if (!(context = switch_event_get_header(jsock->vars, "user_context"))) {
+ context = switch_either(jsock->context, jsock->profile->context);
+ }
+
+ switch_mutex_unlock(jsock->flag_mutex);
if (!zstr(to)) {
if (strchr(to, '+')) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call_id", call_id);
}
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "context", context);
+
switch_event_add_body(event, "%s", body);
if (strcasecmp(proto, VERTO_CHAT_PROTO)) {