]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-359
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 30 Apr 2009 13:53:29 +0000 (13:53 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 30 Apr 2009 13:53:29 +0000 (13:53 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13209 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index 8d28c79bc7e718c60b0fa590ffbfe9193bd7b260..c2a4c18eb8446fc2b1cc9f920f44683715895338 100644 (file)
@@ -918,6 +918,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
        uint32_t progress_timelimit_sec = 0;
        const char *cid_tmp;
        originate_global_t oglobals = { 0 };
+       int cdr_total = 0;
 
        oglobals.idx = IDX_NADA;
        oglobals.early_ok = 1;
@@ -1007,8 +1008,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
 
        if (oglobals.session) {
                switch_event_header_t *hi;
+               const char *cdr_total_var;
+
                caller_channel = switch_core_session_get_channel(oglobals.session);
 
+               if ((cdr_total_var = switch_channel_get_variable(caller_channel, "failed_xml_cdr_total"))) {
+                       int tmp = atoi(cdr_total_var);
+                       if (tmp > 0) {
+                               cdr_total = tmp;
+                       }
+               }
+               
+
                /* Copy all the applicable channel variables into the event */
                if ((hi = switch_channel_variable_first(caller_channel))) {
                        for (; hi; hi = hi->next) {
@@ -2018,7 +2029,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
 
                        } else {
                                const char *cdr_var = NULL;
-                               int cdr_total = 0;
                                switch_xml_t cdr;
                                char *xml_text;
                                char buf[128] = "", buf2[128] = "";