<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16808] </title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16808">16808</a></dd>
<dt>Author</dt> <dd>cseket</dd>
<dt>Date</dt> <dd>2010-02-25 04:04:27 -0600 (Thu, 25 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>remove xml code</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchbranchescseketsrcmodevent_handlersmod_json_cdrmod_json_cdrc">freeswitch/branches/cseket/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchbranchescseketsrcmodevent_handlersmod_json_cdrmod_json_cdrc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/cseket/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c (16807 => 16808)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/cseket/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c        2010-02-25 08:13:42 UTC (rev 16807)
+++ freeswitch/branches/cseket/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c        2010-02-25 10:04:27 UTC (rev 16808)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> * Bret McDanel <trixter AT 0xdecafbad.com>
</span><span class="cx"> * Justin Cassidy <xachenant@hotmail.com>
</span><span class="cx"> *
</span><del>- * mod_xml_cdr.c -- XML CDR Module to files or curl
</del><ins>+ * mod_json_cdr.c -- JSON CDR Module to files or curl
</ins><span class="cx"> *
</span><span class="cx"> */
</span><span class="cx"> #include <sys/stat.h>
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> #define ENCODING_NONE 0
</span><span class="cx"> #define ENCODING_DEFAULT 1
</span><span class="cx"> #define ENCODING_BASE64 2
</span><del>-#define ENCODING_TEXTXML 2
</del><span class="cx">
</span><span class="cx"> static struct {
</span><span class="cx">         char *cred;
</span><span class="lines">@@ -69,13 +68,12 @@
</span><span class="cx">         int disable100continue;
</span><span class="cx">         int rotate;
</span><span class="cx">         int auth_scheme;
</span><del>-        int json;
</del><span class="cx">         switch_memory_pool_t *pool;
</span><span class="cx"> } globals;
</span><span class="cx">
</span><del>-SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load);
-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_cdr_shutdown);
-SWITCH_MODULE_DEFINITION(mod_xml_cdr, mod_xml_cdr_load, mod_xml_cdr_shutdown, NULL);
</del><ins>+SWITCH_MODULE_LOAD_FUNCTION(mod_json_cdr_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_json_cdr_shutdown);
+SWITCH_MODULE_DEFINITION(mod_json_cdr, mod_json_cdr_load, mod_json_cdr_shutdown, NULL);
</ins><span class="cx">
</span><span class="cx"> /* this function would have access to the HTML returned by the webserver, we don't need it
</span><span class="cx"> * and the default curl activity is to print to stdout, something not as desirable
</span><span class="lines">@@ -86,7 +84,7 @@
</span><span class="cx">         return size * nitems;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static switch_status_t set_xml_cdr_log_dirs()
</del><ins>+static switch_status_t set_json_cdr_log_dirs()
</ins><span class="cx"> {
</span><span class="cx">         switch_time_exp_t tm;
</span><span class="cx">         char *path = NULL;
</span><span class="lines">@@ -115,12 +113,12 @@
</span><span class="cx">                                         globals.log_dir = path;
</span><span class="cx">                                         switch_thread_rwlock_unlock(globals.log_path_lock);
</span><span class="cx">                                 } else {
</span><del>-                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create new mod_xml_cdr log_dir path\n");
</del><ins>+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create new mod_json_cdr log_dir path\n");
</ins><span class="cx">                                         switch_safe_free(path);
</span><span class="cx">                                         status = SWITCH_STATUS_FALSE;
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><del>-                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to generate new mod_xml_cdr log_dir path\n");
</del><ins>+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to generate new mod_json_cdr log_dir path\n");
</ins><span class="cx">                                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                         }
</span><span class="cx">                 } else {
</span><span class="lines">@@ -153,12 +151,12 @@
</span><span class="cx">                                         globals.err_log_dir = path;
</span><span class="cx">                                         switch_thread_rwlock_unlock(globals.log_path_lock);
</span><span class="cx">                                 } else {
</span><del>-                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create new mod_xml_cdr err_log_dir path\n");
</del><ins>+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create new mod_json_cdr err_log_dir path\n");
</ins><span class="cx">                                         switch_safe_free(path);
</span><span class="cx">                                         status = SWITCH_STATUS_FALSE;
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><del>-                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to generate new mod_xml_cdr err_log_dir path\n");
</del><ins>+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to generate new mod_json_cdr err_log_dir path\n");
</ins><span class="cx">                                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                         }
</span><span class="cx">                 } else {
</span><span class="lines">@@ -598,12 +596,12 @@
</span><span class="cx">
</span><span class="cx"> static switch_status_t my_on_reporting(switch_core_session_t *session)
</span><span class="cx"> {
</span><del>-        switch_xml_t cdr = NULL;
-        char *xml_text = NULL;
</del><ins>+        struct json_object *json_cdr = NULL;
+        char *json_text = NULL;
</ins><span class="cx">         char *path = NULL;
</span><del>-        char *curl_xml_text = NULL;
</del><ins>+        char *curl_json_text = NULL;
</ins><span class="cx">         const char *logdir = NULL;
</span><del>-        char *xml_text_escaped = NULL;
</del><ins>+        char *json_text_escaped = NULL;
</ins><span class="cx">         int fd = -1;
</span><span class="cx">         uint32_t cur_try;
</span><span class="cx">         long httpRes;
</span><span class="lines">@@ -614,7 +612,6 @@
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="cx">         int is_b;
</span><span class="cx">         const char *a_prefix = "";
</span><del>-        struct json_object *json_cdr = NULL;
</del><span class="cx">
</span><span class="cx">         if (globals.shutdown) {
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="lines">@@ -627,36 +624,27 @@
</span><span class="cx">         if (!is_b && globals.prefix_a)
</span><span class="cx">                 a_prefix = "a_";
</span><span class="cx">
</span><del>-        if (globals.json) {
-                if (generate_json_cdr(session, &json_cdr) != SWITCH_STATUS_SUCCESS) {
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Generating Data!\n");
-                        return SWITCH_STATUS_FALSE;
-                }
</del><span class="cx">
</span><del>-                xml_text = json_object_to_json_string(json_cdr);
</del><ins>+        if (generate_json_cdr(session, &json_cdr) != SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Generating Data!\n");
+                return SWITCH_STATUS_FALSE;
</ins><span class="cx">         }
</span><del>-        else {
-                if (switch_ivr_generate_xml_cdr(session, &cdr) != SWITCH_STATUS_SUCCESS) {
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Generating Data!\n");
-                        return SWITCH_STATUS_FALSE;
-                }
</del><ins>+        
+        json_text = json_object_to_json_string(json_cdr);
</ins><span class="cx">
</span><del>-                /* build the XML */
-                xml_text = switch_xml_toxml(cdr, SWITCH_TRUE);
-        }
-        if (!xml_text) {
</del><ins>+        if (!json_text) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
</span><span class="cx">                 goto error;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         switch_thread_rwlock_rdlock(globals.log_path_lock);
</span><span class="cx">
</span><del>-        if (!(logdir = switch_channel_get_variable(channel, "xml_cdr_base"))) {
</del><ins>+        if (!(logdir = switch_channel_get_variable(channel, "json_cdr_base"))) {
</ins><span class="cx">                 logdir = globals.log_dir;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if (!zstr(logdir) && (globals.log_http_and_disk || !globals.url_count)) {
</span><del>-                path = switch_mprintf("%s%s%s%s.cdr.xml", logdir, SWITCH_PATH_SEPARATOR, a_prefix, switch_core_session_get_uuid(session));
</del><ins>+                path = switch_mprintf("%s%s%s%s.cdr.json", logdir, SWITCH_PATH_SEPARATOR, a_prefix, switch_core_session_get_uuid(session));
</ins><span class="cx">                 switch_thread_rwlock_unlock(globals.log_path_lock);
</span><span class="cx">                 if (path) {
</span><span class="cx"> #ifdef _MSC_VER
</span><span class="lines">@@ -665,7 +653,7 @@
</span><span class="cx">                         if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) > -1) {
</span><span class="cx"> #endif
</span><span class="cx">                                 int wrote;
</span><del>-                                wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
</del><ins>+                                wrote = write(fd, json_text, (unsigned) strlen(json_text));
</ins><span class="cx">                                 close(fd);
</span><span class="cx">                                 fd = -1;
</span><span class="cx">                         } else {
</span><span class="lines">@@ -688,36 +676,32 @@
</span><span class="cx">                 char *destUrl = NULL;
</span><span class="cx">                 curl_handle = curl_easy_init();
</span><span class="cx">
</span><del>-                if (globals.encode == ENCODING_TEXTXML) {
-                        headers = curl_slist_append(headers, "Content-Type: text/xml");
-                } else if (globals.encode) {
-                        switch_size_t need_bytes = strlen(xml_text) * 3;
</del><ins>+                if (globals.encode) {
+                        switch_size_t need_bytes = strlen(json_text) * 3;
</ins><span class="cx">
</span><del>-                        xml_text_escaped = malloc(need_bytes);
-                        switch_assert(xml_text_escaped);
-                        memset(xml_text_escaped, 0, need_bytes);
</del><ins>+                        json_text_escaped = malloc(need_bytes);
+                        switch_assert(json_text_escaped);
+                        memset(json_text_escaped, 0, need_bytes);
</ins><span class="cx">                         if (globals.encode == ENCODING_DEFAULT) {
</span><span class="cx">                                 headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
</span><del>-                                switch_url_encode(xml_text, xml_text_escaped, need_bytes);
</del><ins>+                                switch_url_encode(json_text, json_text_escaped, need_bytes);
</ins><span class="cx">                         } else {
</span><span class="cx">                                 headers = curl_slist_append(headers, "Content-Type: application/x-www-form-base64-encoded");
</span><del>-                                switch_b64_encode((unsigned char *) xml_text, need_bytes / 3, (unsigned char *) xml_text_escaped, need_bytes);
</del><ins>+                                switch_b64_encode((unsigned char *) json_text, need_bytes / 3, (unsigned char *) json_text_escaped, need_bytes);
</ins><span class="cx">                         }
</span><del>-                        if (!json_cdr) {
-                                switch_safe_free(xml_text);
</del><ins>+
+                        json_text = json_text_escaped;
+
+                        if (!(curl_json_text = switch_mprintf("cdr=%s", json_text))) {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+                                goto error;
</ins><span class="cx">                         }
</span><span class="cx">
</span><del>-                        xml_text = xml_text_escaped;
</del><span class="cx">                 } else {
</span><span class="cx">                         headers = curl_slist_append(headers, "Content-Type: application/x-www-form-plaintext");
</span><ins>+                        curl_json_text = json_text;
</ins><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (globals.encode == ENCODING_TEXTXML) {
-                        curl_xml_text = xml_text;
-                } else if (!(curl_xml_text = switch_mprintf("cdr=%s", xml_text))) {
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
-                        goto error;
-                }
</del><span class="cx">
</span><span class="cx">                 if (!zstr(globals.cred)) {
</span><span class="cx">                         curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, globals.auth_scheme);
</span><span class="lines">@@ -726,8 +710,8 @@
</span><span class="cx">
</span><span class="cx">                 curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers);
</span><span class="cx">                 curl_easy_setopt(curl_handle, CURLOPT_POST, 1);
</span><del>-                curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, curl_xml_text);
-                curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-xml/1.0");
</del><ins>+                curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, curl_json_text);
+                curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-json/1.0");
</ins><span class="cx">                 curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, httpCallBack);
</span><span class="cx">
</span><span class="cx">                 if (globals.disable100continue) {
</span><span class="lines">@@ -812,7 +796,7 @@
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to post to web server, writing to file\n");
</span><span class="cx">
</span><span class="cx">                 switch_thread_rwlock_rdlock(globals.log_path_lock);
</span><del>-                path = switch_mprintf("%s%s%s%s.cdr.xml", globals.err_log_dir, SWITCH_PATH_SEPARATOR, a_prefix, switch_core_session_get_uuid(session));
</del><ins>+                path = switch_mprintf("%s%s%s%s.cdr.json", globals.err_log_dir, SWITCH_PATH_SEPARATOR, a_prefix, switch_core_session_get_uuid(session));
</ins><span class="cx">                 switch_thread_rwlock_unlock(globals.log_path_lock);
</span><span class="cx">                 if (path) {
</span><span class="cx"> #ifdef _MSC_VER
</span><span class="lines">@@ -821,7 +805,7 @@
</span><span class="cx">                         if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) > -1) {
</span><span class="cx"> #endif
</span><span class="cx">                                 int wrote;
</span><del>-                                wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
</del><ins>+                                wrote = write(fd, json_text, (unsigned) strlen(json_text));
</ins><span class="cx">                                 close(fd);
</span><span class="cx">                                 fd = -1;
</span><span class="cx">                         } else {
</span><span class="lines">@@ -849,19 +833,14 @@
</span><span class="cx">         if (slist) {
</span><span class="cx">                 curl_slist_free_all(slist);
</span><span class="cx">         }
</span><del>-        if (curl_xml_text != xml_text) {
-                switch_safe_free(curl_xml_text);
</del><ins>+        if (curl_json_text != json_text) {
+                switch_safe_free(curl_json_text);
</ins><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (json_cdr) {
-                json_object_put(json_cdr);
-                switch_safe_free(xml_text_escaped);
-        } else {
-                switch_safe_free(xml_text);
-        }
</del><ins>+        json_object_put(json_cdr);
+        switch_safe_free(json_text_escaped);
</ins><span class="cx">
</span><span class="cx">         switch_safe_free(path);
</span><del>-        switch_xml_free(cdr);
</del><span class="cx">
</span><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="lines">@@ -872,7 +851,7 @@
</span><span class="cx">
</span><span class="cx">         if (sig && !strcmp(sig, "HUP")) {
</span><span class="cx">                 if (globals.rotate) {
</span><del>-                        set_xml_cdr_log_dirs();
</del><ins>+                        set_json_cdr_log_dirs();
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -891,9 +870,9 @@
</span><span class="cx">         /*.on_reporting */ my_on_reporting
</span><span class="cx"> };
</span><span class="cx">
</span><del>-SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load)
</del><ins>+SWITCH_MODULE_LOAD_FUNCTION(mod_json_cdr_load)
</ins><span class="cx"> {
</span><del>-        char *cf = "xml_cdr.conf";
</del><ins>+        char *cf = "json_cdr.conf";
</ins><span class="cx">         switch_xml_t cfg, xml, settings, param;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">
</span><span class="lines">@@ -948,8 +927,6 @@
</span><span class="cx">                         } else if (!strcasecmp(var, "encode") && !zstr(val)) {
</span><span class="cx">                                 if (!strcasecmp(val, "base64")) {
</span><span class="cx">                                         globals.encode = ENCODING_BASE64;
</span><del>-                                } else if (!strcasecmp(val, "textxml")) {
-                                        globals.encode = ENCODING_TEXTXML;
</del><span class="cx">                                 } else {
</span><span class="cx">                                         globals.encode = switch_true(val) ? ENCODING_DEFAULT : ENCODING_NONE;
</span><span class="cx">                                 }
</span><span class="lines">@@ -959,7 +936,7 @@
</span><span class="cx">                                 globals.rotate = switch_true(val);
</span><span class="cx">                         } else if (!strcasecmp(var, "log-dir")) {
</span><span class="cx">                                 if (zstr(val)) {
</span><del>-                                        globals.base_log_dir = switch_mprintf("%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
</del><ins>+                                        globals.base_log_dir = switch_mprintf("%s%sjson_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
</ins><span class="cx">                                 } else {
</span><span class="cx">                                         if (switch_is_file_path(val)) {
</span><span class="cx">                                                 globals.base_log_dir = switch_core_strdup(globals.pool, val);
</span><span class="lines">@@ -969,7 +946,7 @@
</span><span class="cx">                                 }
</span><span class="cx">                         } else if (!strcasecmp(var, "err-log-dir")) {
</span><span class="cx">                                 if (zstr(val)) {
</span><del>-                                        globals.base_err_log_dir = switch_mprintf("%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
</del><ins>+                                        globals.base_err_log_dir = switch_mprintf("%s%sjson_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
</ins><span class="cx">                                 } else {
</span><span class="cx">                                         if (switch_is_file_path(val)) {
</span><span class="cx">                                                 globals.base_err_log_dir = switch_core_strdup(globals.pool, val);
</span><span class="lines">@@ -1008,19 +985,18 @@
</span><span class="cx">                                 } else if (!strcasecmp(val, "any")) {
</span><span class="cx">                                         globals.auth_scheme = CURLAUTH_ANY;
</span><span class="cx">                                 }
</span><del>-                        } else if (!strcasecmp(var, "json")) {
-                                globals.json = switch_true(val);
</del><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if (zstr(globals.base_err_log_dir)) {
</span><span class="cx">                                 if (!zstr(globals.base_log_dir)) {
</span><span class="cx">                                         globals.base_err_log_dir = switch_core_strdup(globals.pool, globals.base_log_dir);
</span><span class="cx">                                 } else {
</span><del>-                                        globals.base_err_log_dir = switch_core_sprintf(globals.pool, "%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
</del><ins>+                                        globals.base_err_log_dir = switch_core_sprintf(globals.pool, "%s%sjson_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><ins>+
</ins><span class="cx">         if (globals.retries < 0) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Retries is negative, setting to 0\n");
</span><span class="cx">                 globals.retries = 0;
</span><span class="lines">@@ -1033,13 +1009,13 @@
</span><span class="cx">
</span><span class="cx">         globals.retries++;
</span><span class="cx">
</span><del>-        set_xml_cdr_log_dirs();
</del><ins>+        set_json_cdr_log_dirs();
</ins><span class="cx">
</span><span class="cx">         switch_xml_free(xml);
</span><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_cdr_shutdown)
</del><ins>+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_json_cdr_shutdown)
</ins><span class="cx"> {
</span><span class="cx">
</span><span class="cx">         globals.shutdown = 1;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>