]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-529
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 19 Jan 2010 15:32:30 +0000 (15:32 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 19 Jan 2010 15:32:30 +0000 (15:32 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16401 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index 936e86397bc6ade43dd7b7b172e307f67405d8fc..12e6fb8ca6f237cefeddb978014d6db2c870f3ed 100644 (file)
@@ -1887,11 +1887,16 @@ 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;
+               const char *cdr_var;
 
-               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;
+               if (cdr_var = switch_channel_get_variable(caller_channel, "failed_xml_cdr_prefix")) {
+                       char buf[128] = "";
+                       switch_snprintf(buf, sizeof(buf), "%s_total", cdr_var);
+                       if ((cdr_total_var = switch_channel_get_variable(caller_channel, buf))) {
+                               int tmp = atoi(cdr_total_var);
+                               if (tmp > 0) {
+                                       cdr_total = tmp;
+                               }
                        }
                }