]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6565
authorBrian West <brian@freeswitch.org>
Wed, 9 Jul 2014 12:45:55 +0000 (07:45 -0500)
committerBrian West <brian@freeswitch.org>
Wed, 9 Jul 2014 12:45:55 +0000 (07:45 -0500)
src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c

index 60e1f34e97eae70a54fa6c3a3d5f6f6b4c6935ef..ff6b6431d1d33f9f931f325c20eb601c074f4c90 100644 (file)
@@ -362,14 +362,14 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
                        var = tmp;
                }
 
-               if (cdr_field->quote) {
-                       if ((cdr_field->not_null == SWITCH_FALSE) && zstr(var)) {
-                               pq_var = switch_mprintf("null,", var);
-                       } else {
+               if ((cdr_field->not_null == SWITCH_FALSE) && zstr(var)) {
+                       pq_var = switch_mprintf("null,", var);
+               } else {
+                       if (cdr_field->quote) {
                                pq_var = switch_mprintf("'%s',", var);
+                       } else {
+                               pq_var = switch_mprintf("%s,", var);
                        }
-               } else {
-                       pq_var = switch_mprintf("%s,", var);
                }
 
                /* Resize values buffer to accomodate next var */