]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
only propigate some vars not all
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 11 Dec 2007 00:09:04 +0000 (00:09 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 11 Dec 2007 00:09:04 +0000 (00:09 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6614 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index 9e3090e6fd096fa4fbb2699aa92768fed4b41cd8..a97af6ef45d26baacfab0e7339097b024a51d201 100644 (file)
@@ -325,10 +325,31 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                caller_channel = switch_core_session_get_channel(session);
                assert(caller_channel != NULL);
 
-               /* Copy all the channel variables into the event */
+               /* Copy all the applicable channel variables into the event */
                if ((hi = switch_channel_variable_first(caller_channel))) {
                        for (; hi; hi = hi->next) {
-                               switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, (char *)hi->name, "%s", (char *) hi->value);
+                               int ok = 0;
+                               if (!strcasecmp((char *)hi->name, "group_confirm_key")) {
+                                       ok = 1;
+                               } else if (!strcasecmp((char *)hi->name, "group_confirm_file")) {
+                                       ok = 1;
+                               } else if (!strcasecmp((char *)hi->name, "fail_on_single_reject")) {
+                                       ok = 1;
+                               } else if (!strcasecmp((char *)hi->name, "ignore_early_media")) {
+                                       ok = 1;
+                               } else if (!strcasecmp((char *)hi->name, "originate_retries")) {
+                                       ok = 1;
+                               } else if (!strcasecmp((char *)hi->name, "originate_retry_sleep_ms")) {
+                                       ok = 1;
+                               } else if (!strcasecmp((char *)hi->name, "origination_caller_id_name")) {
+                                       ok = 1;
+                               } else if (!strcasecmp((char *)hi->name, "origination_caller_id_number")) {
+                                       ok = 1;
+                               }
+
+                               if (ok) {
+                                       switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, (char *)hi->name, "%s", (char *) hi->value);
+                               }
                        }
                        switch_channel_variable_last(caller_channel);
                }