FS-7855 pass userVariables back to the live array

v1.6
Brian West 8 years ago
parent 9d070b5c98
commit d262f07d0f
  1. 4
      src/mod/applications/mod_conference/conference_event.c
  2. 23
      src/mod/applications/mod_conference/conference_member.c

@ -417,8 +417,8 @@ void conference_event_adv_la(conference_obj_t *conference, conference_member_t *
switch_core_get_variables(&variables);
for (hp = variables->headers; hp; hp = hp->next) {
if (!strncasecmp(hp->name, "conference_verto_", 11)) {
char *var = hp->name + 11;
if (!strncasecmp(hp->name, "conference_verto_", 17)) {
char *var = hp->name + 17;
if (var) {
cJSON_AddItemToObject(data, var, cJSON_CreateString(hp->value));
}

@ -905,6 +905,10 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
if (conference->la && member->channel && !switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)) {
if (!conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) {
cJSON *dvars;
switch_event_t *var_event;
switch_event_header_t *hi;
member->json = cJSON_CreateArray();
cJSON_AddItemToArray(member->json, cJSON_CreateStringPrintf("%0.4d", member->id));
cJSON_AddItemToArray(member->json, cJSON_CreateString(switch_channel_get_variable(member->channel, "caller_id_number")));
@ -915,11 +919,26 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
switch_channel_get_variable(member->channel, "original_read_rate")
));
member->status_field = cJSON_CreateString("");
cJSON_AddItemToArray(member->json, member->status_field);
switch_channel_get_variables(member->channel, &var_event);
dvars = cJSON_CreateObject();
member->status_field = cJSON_CreateString("");
cJSON_AddItemToArray(member->json, member->status_field);
for (hi = var_event->headers; hi; hi = hi->next) {
if (!strncasecmp(hi->name, "verto_dvar_", 11)) {
char *var = hi->name + 11;
if (var) {
cJSON_AddItemToObject(dvars, var, cJSON_CreateString(hi->value));
}
}
}
cJSON_AddItemToArray(member->json, dvars);
switch_event_destroy(&var_event);
cJSON_AddItemToArray(member->json, cJSON_CreateNull());

Loading…
Cancel
Save