]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_rayo: new configuration parameter, add-variables-to-offer (default=false). When...
authorChris Rienzo <chris.rienzo@grasshopper.com>
Fri, 14 Nov 2014 18:22:53 +0000 (13:22 -0500)
committerChris Rienzo <chris.rienzo@grasshopper.com>
Fri, 14 Nov 2014 18:22:53 +0000 (13:22 -0500)
conf/rayo/autoload_configs/rayo.conf.xml
src/mod/event_handlers/mod_rayo/conf/autoload_configs/rayo.conf.xml
src/mod/event_handlers/mod_rayo/mod_rayo.c

index 47a3a14bc148e05493dae5d8863b0d1e2e1f0a29..a5f8748416ed25615c1deaed736fbe08cbc37d30 100644 (file)
@@ -2,8 +2,14 @@
 
        <!-- rayo params -->
        <settings>
+               <!-- ends idle calls : unbridged calls that have not been controlled by client in some time -->
                <param name="max-idle-sec" value="300"/>
+               <!-- conference profile to use for mixers- sla = shared line appearance / conference /w no audio -->
                <param name="mixer-conf-profile" value="sla"/>
+               <!-- if true, to attribute in offer uses URI instead of name/number -->
+               <param name="offer-uri" value="true"/>
+               <!-- if true, channel variables are added to rayo client offer -->
+               <param name="add-variables-to-offer" value="false"/>
        </settings>
 
        <!-- record component params -->
index 47a3a14bc148e05493dae5d8863b0d1e2e1f0a29..a5f8748416ed25615c1deaed736fbe08cbc37d30 100644 (file)
@@ -2,8 +2,14 @@
 
        <!-- rayo params -->
        <settings>
+               <!-- ends idle calls : unbridged calls that have not been controlled by client in some time -->
                <param name="max-idle-sec" value="300"/>
+               <!-- conference profile to use for mixers- sla = shared line appearance / conference /w no audio -->
                <param name="mixer-conf-profile" value="sla"/>
+               <!-- if true, to attribute in offer uses URI instead of name/number -->
+               <param name="offer-uri" value="true"/>
+               <!-- if true, channel variables are added to rayo client offer -->
+               <param name="add-variables-to-offer" value="false"/>
        </settings>
 
        <!-- record component params -->
index cc7fc65037e34e1b0fb6dafd59669a101495594d..614975ee15a1c807cf6e37465154761ae78724bc 100644 (file)
@@ -229,6 +229,8 @@ static struct {
        int pause_when_offline;
        /** flag to reduce log noise */
        int offline_logged;
+       /** if true, channel variables are added to offer */
+       int add_variables_to_offer;
 } globals;
 
 /**
@@ -3682,18 +3684,23 @@ static iks *rayo_create_offer(struct rayo_call *call, switch_core_session_t *ses
                iks_insert_attrib(offer, "to", profile->destination_number);
        }
 
-       /* add signaling headers */
+       /* add headers to offer */
        {
                switch_event_header_t *var;
                add_header(offer, "from", switch_channel_get_variable(channel, "sip_full_from"));
                add_header(offer, "to", switch_channel_get_variable(channel, "sip_full_to"));
                add_header(offer, "via", switch_channel_get_variable(channel, "sip_full_via"));
 
-               /* get all variables prefixed with sip_h_ */
+               /* add all SIP header variables and (if configured) all other variables */
                for (var = switch_channel_variable_first(channel); var; var = var->next) {
                        if (!strncmp("sip_h_", var->name, 6)) {
                                add_header(offer, var->name + 6, var->value);
                        }
+                       if (globals.add_variables_to_offer) {
+                               char var_name[1024];
+                               snprintf(var_name, 1024, "variable-%s", var->name);
+                               add_header(offer, var_name, var->value);
+                       }
                }
                switch_channel_variable_last(channel);
        }
@@ -4066,6 +4073,7 @@ static switch_status_t do_config(switch_memory_pool_t *pool, const char *config_
        globals.num_message_threads = 8;
        globals.offer_uri = 1;
        globals.pause_when_offline = 0;
+       globals.add_variables_to_offer = 0;
 
        /* get params */
        {
@@ -4102,6 +4110,10 @@ static switch_status_t do_config(switch_memory_pool_t *pool, const char *config_
                                        if (switch_true(val)) {
                                                globals.pause_when_offline = 1;
                                        }
+                               } else if (!strcasecmp(var, "add-variables-to-offer")) {
+                                       if (switch_true(val)) {
+                                               globals.add_variables_to_offer = 1;
+                                       }
                                } else {
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unsupported param: %s\n", var);
                                }