]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10623 [mod_conference] emit conference vars in events and allow
authorlazedo <luis.azedo@factorlusitano.com>
Tue, 29 Aug 2017 21:41:55 +0000 (22:41 +0100)
committerlazedo <luis.azedo@factorlusitano.com>
Fri, 8 Sep 2017 22:11:43 +0000 (23:11 +0100)
setting them in profiles

src/mod/applications/mod_conference/conference_event.c
src/mod/applications/mod_conference/mod_conference.c

index cd9b5c2b818c628e9724430e4d923b737d5a8f64..d966a7310b8aa54cae59c2c045735c504ff25567 100644 (file)
@@ -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;
 }
index 02eb2542c79dae848877bc211290bcef943d49fe..f9834df60f8bec7cd3492245b39bcdc1455ec2db 100644 (file)
@@ -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);