FS-10623 [mod_conference] emit conference vars in events and allow
setting them in profiles
This commit is contained in:
parent
fd3c2fd3bf
commit
51b96c33cb
|
@ -741,10 +741,12 @@ switch_status_t conference_event_add_data(conference_obj_t *conference, switch_e
|
|||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Domain", conference->domain);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Size", "%u", conference->count);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Ghosts", "%u", conference->count_ghosts);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Profile-Name", conference->profile_name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Unique-ID", conference->uuid_str);
|
||||
switch_event_merge(event, conference->variables);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -3682,6 +3682,18 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
|
|||
}
|
||||
}
|
||||
|
||||
if(cfg.profile) {
|
||||
switch_xml_t xml_profile_variables;
|
||||
if((xml_profile_variables = switch_xml_child(cfg.profile, "variables")) != NULL) {
|
||||
for (xml_kvp = switch_xml_child(xml_profile_variables, "variable"); xml_kvp; xml_kvp = xml_kvp->next) {
|
||||
char *var = (char *) switch_xml_attr_soft(xml_kvp, "name");
|
||||
char *val = (char *) switch_xml_attr_soft(xml_kvp, "value");
|
||||
if(var && val) {
|
||||
conference_set_variable(conference, var, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
conference_event_add_data(conference, event);
|
||||
|
|
Loading…
Reference in New Issue