]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9143 [avmd] #fix event headers
authorPiotr Gregor <piotrek.gregor@gmail.com>
Fri, 24 Jun 2016 17:36:55 +0000 (18:36 +0100)
committerPiotr Gregor <piotrek.gregor@gmail.com>
Mon, 22 Aug 2016 08:32:09 +0000 (09:32 +0100)
Make all headers starting from capital letter.

17 files changed:
src/mod/applications/mod_avmd/avmd_amplitude.c
src/mod/applications/mod_avmd/avmd_amplitude.h
src/mod/applications/mod_avmd/avmd_buffer.c
src/mod/applications/mod_avmd/avmd_buffer.h
src/mod/applications/mod_avmd/avmd_desa2.c
src/mod/applications/mod_avmd/avmd_desa2.h
src/mod/applications/mod_avmd/avmd_desa2_tweaked.c
src/mod/applications/mod_avmd/avmd_desa2_tweaked.h
src/mod/applications/mod_avmd/avmd_fast_acosf.c
src/mod/applications/mod_avmd/avmd_fast_acosf.h
src/mod/applications/mod_avmd/avmd_fir.h
src/mod/applications/mod_avmd/avmd_goertzel.c
src/mod/applications/mod_avmd/avmd_goertzel.h
src/mod/applications/mod_avmd/avmd_options.h
src/mod/applications/mod_avmd/avmd_psi.h
src/mod/applications/mod_avmd/avmd_sma_buf.h
src/mod/applications/mod_avmd/mod_avmd.c

index 16f1312d04de7ce0ae7d0423d5891c0234ca538d..86523fad4b3d76793a4e09f6731e2267d201d6aa 100644 (file)
@@ -1,4 +1,9 @@
-#ifndef __AVMD_AMPLITUDE_H__
+/*
+ * Contributor(s):
+ *
+ * Eric des Courtis <eric.des.courtis@benbria.com>
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
+ */
 
 
 #include <math.h>
@@ -11,7 +16,3 @@ double avmd_amplitude(circ_buffer_t *b, size_t i, double f) {
     result = sqrt(PSI(b, i) / sin(f * f));
     return result;
 }
-
-
-#endif /* __AVMD_AMPLITUDE_H__ */
-
index 0878390935ee02cb82c3b38c914aca9b97bf8ce6..da98d083e5861bf3cca8e08c7ad7cf3132b826c5 100644 (file)
@@ -4,7 +4,7 @@
  * Contributor(s):
  *
  * Eric des Courtis <eric.des.courtis@benbria.com>
- * Piotr Gregor <piotrek.gregor gmail.com>:
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
  */
 
 
index a1fe28fd672e207a75f44051fe4ec6dfb7b11e7d..f05f0deb4c01b691063cbf02e2db3668899041c8 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Contributor(s):
+ *
+ * Eric des Courtis <eric.des.courtis@benbria.com>
+ */
+
+
 #ifndef __BUFFER_H__
 #include "avmd_buffer.h"
 #endif
index 345a624ed6278806879d04677edafe3c04834df9..b7a6cbb23369b92eb458f8c37245b5836ccb8ef6 100644 (file)
@@ -1,8 +1,10 @@
 /*
  * @brief   Circular buffer.
  *
- * @author Eric des Courtis
- * @par    Modifications: Piotr Gregor < piotrek.gregor gmail.com >
+ * Contributor(s):
+ *
+ * Eric des Courtis <eric.des.courtis@benbria.com>
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
  */
 
 
index 2f35d3beb56207c82f3403613a393950209156bc..c71ded6d0694d84b649be8507cd8bc615255a476 100644 (file)
@@ -1,5 +1,9 @@
-#ifndef __AVMD_DESA2_H__
-
+/*
+ * Contributor(s):
+ *
+ * Eric des Courtis <eric.des.courtis@benbria.com>
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
+ */
 
 #include <stdio.h>
 #ifdef WIN32
@@ -63,5 +67,3 @@ double avmd_desa2(circ_buffer_t *b, size_t i, double *amplitude) {
     return result;
 
 }
-
-#endif /* __AVMD_DESA2_H__ */
index d555df448e2111973db0433c4c27c770fe99e65c..6e8f6e58a7f2106f67fd1d6c26087709034c2ab0 100644 (file)
@@ -4,7 +4,7 @@
  * Contributor(s):
  *
  * Eric des Courtis <eric.des.courtis@benbria.com>
- * Piotr Gregor <piotrek.gregor gmail.com>:
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
  */
 
 
index f1ad5243d6a4c4b9dfec51ffc49032d8bac6186c..6bf0b4134823cbfb951d23684e8dd6ccc0502305 100644 (file)
@@ -1,22 +1,32 @@
+/* 
+ * Contributor(s):
+ *
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
+ */
+
 #ifndef __AVMD_DESA2_TWEAKED_H__
+    #include "avmd_desa2_tweaked.h"
+#endif
 
 #include <switch.h>
 #include <stdio.h>
+
 #ifdef WIN32
-#include <float.h>
-#define ISNAN(x) (!!(_isnan(x)))
-#define ISINF(x) (isinf(x))
+    #include <float.h>
+    #define ISNAN(x) (!!(_isnan(x)))
+    #define ISINF(x) (isinf(x))
 #else
-int __isnan(double);
-#define ISNAN(x) (__isnan(x))
-#define ISINF(x) (__isinf(x))
+    int __isnan(double);
+    #define ISNAN(x) (__isnan(x))
+    #define ISINF(x) (__isinf(x))
 #endif
+
 #include "avmd_buffer.h"
 #include "avmd_desa2_tweaked.h"
 #include "avmd_options.h"
 
-#ifdef AVMD_FAST_MATH
-#include "avmd_fast_acosf.h"
+#ifndef AVMD_FAST_MATH
+    #include "avmd_fast_acosf.h"
 #endif
 
 
@@ -64,5 +74,3 @@ avmd_desa2_tweaked(circ_buffer_t *b, size_t i, double *amplitude) {
     *amplitude = 2.0 * PSI_Xn / sqrt(PSI_Yn);
     return result;
 }
-
-#endif  /* __AVMD_DESA2_TWEAKED_H__ */
index 2d16ca2972d9d8a0dff3c6a73e7724ef9d56e837..ac6d6fc4d886cdd01a2c10cca122b4608c339c2a 100644 (file)
@@ -7,7 +7,11 @@
  *          be checked for convergence in the same time.
  *          If the partial results converge then frequency
  *          converges too.
- * @author  Piotr Gregor < piotrek.gregor gmail.com >
+ *
+ * Contributor(s):
+ *
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
+ *
  * @date    20 Mar 2016
  */
 
index cb0500b31556b57d75802662e08f08fa3cb9ce5b..cd728bd5773a14a0086d2fb18590f20670aa94c9 100644 (file)
@@ -1,25 +1,39 @@
+/* 
+ * Contributor(s):
+ *
+ * Eric des Courtis <eric.des.courtis@benbria.com>
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
+ */
+
+
 #ifndef WIN32   /* currently we support fast acosf computation only on UNIX/Linux */
 
 
 #include <switch.h>
 #include <stdio.h>
 #include <stdlib.h>
+
 #ifndef _MSC_VER
-#include <stdint.h>
+    #include <stdint.h>
 #endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+
 #ifndef _MSC_VER
-#include <sys/mman.h>
+    #include <sys/mman.h>
 #endif
+
 #include <assert.h>
 #include <errno.h>
 #include <math.h>
 #include <string.h>
+
 #ifndef _MSC_VER
-#include <unistd.h>
+    #include <unistd.h>
 #endif
+
 #include "avmd_fast_acosf.h"
 #include "avmd_options.h"
 
index 0b9752713fae95c83fcaae28a4216d8f1ddbbcb0..8de7954def8396a62c6c14dc8ffda93402593bb2 100644 (file)
@@ -1,10 +1,11 @@
 #ifndef WIN32   /* currently we support fast acosf computation only on UNIX/Linux */
 /*
  * @brief   Fast arithmetic using precomputed arc cosine table.
+ *
  * Contributor(s):
  *
  * Eric des Courtis <eric.des.courtis@benbria.com>
- * Piotr Gregor <piotrek.gregor gmail.com>
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
  */
 
 
index 76888a7ab28c62268f6566503fa52d5857eef57d..23860f5887624dff831b965e60772dbe0718b611 100644 (file)
@@ -1,6 +1,10 @@
 /*
  * @brief   Filters.
- * @author  Piotr Gregor < piotrek.gregor gmail.com >
+ *
+ * Contributor(s):
+ *
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
+ *
  * @date    23 Mar 2016
  */
 
index 6fdfafc0c85e43e5de837d6a8025c3c0643352b5..3c58ffbe51ab45a990132dea7d16f18d3a8dc4ef 100644 (file)
@@ -1,9 +1,19 @@
-#ifndef __AVMD_GOERTZEL_H__
+/* 
+ * Contributor(s):
+ *
+ * Eric des Courtis <eric.des.courtis@benbria.com>
+ */
 
 
 #include <math.h>
-#include "avmd_goertzel.h"
-#include "avmd_buffer.h"
+
+#ifndef __AVMD_GOERTZEL_H__
+    #include "avmd_goertzel.h"
+#endif
+
+#ifndef __AVMD_BUFFER_H__
+    #include "avmd_buffer.h"
+#endif
 
 
 extern double avmd_goertzel(circ_buffer_t *b, size_t pos, double f, size_t num)
@@ -25,6 +35,3 @@ extern double avmd_goertzel(circ_buffer_t *b, size_t pos, double f, size_t num)
 
     return (p2 * p2) + (p * p) - (coeff * p2 * p);
 }
-
-
-#endif /* __AVMD_GOERTZEL_H__ */
index fefb74271b8c85f513d1a244993b2c22c6e1d65e..21ba3f51541870573d40f9f38ff97e8d5c21a6e5 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * @brief   Goertzel algorithm.
- * @author  Eric des Courtis
+ *
+ * Contributor(s):
+ *
+ * Eric des Courtis <eric.des.courtis@benbria.com>
  */
 
 
 
 
 #ifndef _MSC_VER
-#include <stdint.h>
+    #include <stdint.h>
 #endif
+
 #include "avmd_buffer.h"
 
 #if !defined(M_PI)
-/* C99 systems may not define M_PI */
-#define M_PI 3.14159265358979323846264338327
+    /* C99 systems may not define M_PI */
+    #define M_PI 3.14159265358979323846264338327
 #endif
 
 
index d5c39368d5b9ad860b54f38d03ee469437448761..a580af811ef28e36a8d11a579917f4316849e906 100644 (file)
@@ -5,8 +5,7 @@
  *
  * Contributor(s):
  *
- * Piotr Gregor <piotrek.gregor gmail.com>:
- * Eric des Courtis <eric.des.courtis@benbria.com>
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
  */
 
 
index db6d83a60e271739540787be49aba4ab1d1266ef..dbbf401282b63c63031e608d20d7fb0ef3845a33 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Contributor(s):
+ *
+ * Eric des Courtis <eric.des.courtis@benbria.com>
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
+ */
+
+
 #ifndef __AVMD_PSI_H__
 #define __AVMD_PSI_H__
 
index b514b95bea5c8e5a3b8ae551f0d47f3d278e32b6..5c5c6a108a29ff30b2af45e0b6c3af2a29a141f1 100644 (file)
@@ -4,7 +4,7 @@
  * Contributor(s):
  *
  * Eric des Courtis <eric.des.courtis@benbria.com>
- * Piotr Gregor <piotrek.gregor gmail.com>
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
  */
 
 
index d7035d40b60baa5cf3dfea31dbc640b0f0efd1aa..1f1f1aceb92ca45f4597b8a042ae4f906d90e06c 100644 (file)
@@ -20,7 +20,7 @@
  * Contributor(s):
  *
  * Eric des Courtis <eric.des.courtis@benbria.com>
- * Piotr Gregor <piotrek.gregor gmail.com>:
+ * Piotr Gregor     <piotrgregor@rsyncme.org>
  *
  * mod_avmd.c -- Advanced Voicemail Detection Module
  *
@@ -221,12 +221,10 @@ static switch_status_t avmd_load_xml_inbound_configuration(switch_mutex_t *mutex
 static switch_status_t avmd_load_xml_outbound_configuration(switch_mutex_t *mutex);
 
 /* bind reloadxml callback */
-static void
-avmd_reloadxml_event_handler(switch_event_t *event);
+static void avmd_reloadxml_event_handler(switch_event_t *event);
 
 /* API command */
-static void
-avmd_show(switch_stream_handle_t *stream, switch_mutex_t *mutex);
+static void avmd_show(switch_stream_handle_t *stream, switch_mutex_t *mutex);
 
 
 /*! \brief  The avmd session data initialization function.
@@ -371,8 +369,7 @@ avmd_callback(switch_media_bug_t * bug, void *user_data, switch_abc_type_t type)
             }
         }
                avmd_session->start_time = switch_micro_time_now();
-               /* avmd_session->vmd_codec.channels = 
-         *                  read_codec->implementation->number_of_channels; */
+               /* avmd_session->vmd_codec.channels =  read_codec->implementation->number_of_channels; */
         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session),SWITCH_LOG_INFO, "Avmd session initialized, [%u] samples/s\n", avmd_session->rate);
                break;
 
@@ -442,8 +439,9 @@ avmd_fire_event(enum avmd_event type, switch_core_session_t *fs_s, double freq,
         return;
     }
     switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(fs_s));
-    switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "avmd");
-    switch (type) {
+    switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-command", "avmd");
+    switch (type)
+    {
         case AVMD_EVENT_BEEP:
             switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Beep-Status", "DETECTED");
             res = snprintf(buf, AVMD_CHAR_BUF_LEN, "%f", freq);
@@ -496,7 +494,7 @@ avmd_fire_event(enum avmd_event type, switch_core_session_t *fs_s, double freq,
             switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Beep-Status", beep_status == BEEP_DETECTED ? "DETECTED" : "NOTDETECTED");
             if (info == 0) {
                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_s), SWITCH_LOG_ERROR, "Error, avmd session object not found in media bug!\n");
-                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "stop-status", "ERROR (AVMD SESSION OBJECT NOT FOUND IN MEDIA BUG)");
+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Stop-status", "ERROR (AVMD SESSION OBJECT NOT FOUND IN MEDIA BUG)");
             }
             total_time = stop_time - start_time;
             res = snprintf(buf, AVMD_CHAR_BUF_LEN, "%" PRId64 "", total_time);
@@ -642,16 +640,12 @@ avmd_load_xml_configuration(switch_mutex_t *mutex)
                                } else if (!strcmp(name, "require_continuous_streak")) {
                                                avmd_globals.settings.require_continuous_streak = switch_true(value) ? 1 : 0;
                                } else if (!strcmp(name, "sample_n_continuous_streak")) {
-                    if(avmd_parse_u16_user_input(value,
-                                &avmd_globals.settings.sample_n_continuous_streak, 0, UINT16_MAX) == -1)
-                    {
+                    if(avmd_parse_u16_user_input(value, &avmd_globals.settings.sample_n_continuous_streak, 0, UINT16_MAX) == -1) {
                         status = SWITCH_STATUS_TERM;
                         goto done;
                     }
                                } else if (!strcmp(name, "sample_n_to_skip")) {
-                    if(avmd_parse_u16_user_input(value,
-                                &avmd_globals.settings.sample_n_to_skip, 0, UINT16_MAX) == -1)
-                    {
+                    if(avmd_parse_u16_user_input(value, &avmd_globals.settings.sample_n_to_skip, 0, UINT16_MAX) == -1) {
                         status = SWITCH_STATUS_TERM;
                         goto done;
                     }
@@ -1074,7 +1068,7 @@ SWITCH_STANDARD_APP(avmd_start_app)
             goto end;
     }
 
-    if (avmd_session->settings.report_status == 1) { /* report dynamic parameters */
+    if (avmd_session->settings.report_status == 1) { /* dump dynamic parameters */
         avmd_config_dump(avmd_session);
     }
     if (avmd_session->settings.outbound_channnel == 1) {
@@ -1259,9 +1253,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_avmd_shutdown)
 }
 
 /*! \brief FreeSWITCH API handler function.
- *  This function handles API calls such as the ones
- *  from mod_event_socket and in some cases
- *  scripts such as LUA scripts.
+ *  This function handles API calls from mod_event_socket and LUA scripts.
  */
 SWITCH_STANDARD_API(avmd_api_main)
 {
@@ -1280,8 +1272,7 @@ SWITCH_STANDARD_API(avmd_api_main)
 
        /* No command? Display usage */
        if (zstr(cmd)) {
-               stream->write_function(stream, "-ERR, bad command!\n"
-                "-USAGE: %s\n\n", AVMD_SYNTAX);
+               stream->write_function(stream, "-ERR, bad command!\n-USAGE: %s\n\n", AVMD_SYNTAX);
                goto end;
        }
 
@@ -1301,23 +1292,21 @@ SWITCH_STANDARD_API(avmd_api_main)
 
     command = argv[0];
     if (strcasecmp(command, "reload") == 0) {
-        if (avmd_load_xml_configuration(NULL) != SWITCH_STATUS_SUCCESS)
-        {
-            stream->write_function(stream, "-ERR, couldn't reload XML configuration\n");
-            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                "Couldn't reload XML configuration\n");
-        }
+        status = avmd_load_xml_configuration(NULL);
         if (avmd_globals.settings.report_status == 1) {
-            stream->write_function(stream, "+OK\n XML reloaded\n\n");
-            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-                    "XML reloaded\n");
+            if (status != SWITCH_STATUS_SUCCESS) {
+                stream->write_function(stream, "-ERR, couldn't reload XML configuration\n");
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't reload XML configuration\n");
+            } else {
+                stream->write_function(stream, "+OK\n XML reloaded\n\n");
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "XML reloaded\n");
+            }
+            goto end;
         }
-        goto end;
     }
     if (strcasecmp(command, "load") == 0) {
         if (argc != 2) {
-            stream->write_function(stream, "-ERR, load command takes 1 parameter!\n"
-                "-USAGE: %s\n\n", AVMD_SYNTAX);
+            stream->write_function(stream, "-ERR, load command takes 1 parameter!\n-USAGE: %s\n\n", AVMD_SYNTAX);
             goto end;
         }
         command = argv[1];
@@ -1326,13 +1315,10 @@ SWITCH_STANDARD_API(avmd_api_main)
             if (avmd_globals.settings.report_status == 1) {
                 if (status != SWITCH_STATUS_SUCCESS) {
                     stream->write_function(stream, "-ERR, couldn't load XML configuration\n");
-                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                        "Couldn't load XML configuration\n");
+                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't load XML configuration\n");
                 } else {
-                    stream->write_function(stream, "+OK\n inbound "
-                            "XML configuration loaded\n\n");
-                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-                            "Inbound XML configuration loaded\n");
+                    stream->write_function(stream, "+OK\n inbound XML configuration loaded\n\n");
+                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Inbound XML configuration loaded\n");
                 }
                 goto end;
             }
@@ -1341,56 +1327,44 @@ SWITCH_STANDARD_API(avmd_api_main)
             if (avmd_globals.settings.report_status == 1) {
                 if (status != SWITCH_STATUS_SUCCESS) {
                     stream->write_function(stream, "-ERR, couldn't load XML configuration\n");
-                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                        "Couldn't load XML configuration\n");
+                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't load XML configuration\n");
                 } else {
-                    stream->write_function(stream, "+OK\n outbound "
-                            "XML configuration loaded\n\n");
-                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-                            "Outbound XML configuration loaded\n");
+                    stream->write_function(stream, "+OK\n outbound XML configuration loaded\n\n");
+                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Outbound XML configuration loaded\n");
                 }
                 goto end;
             }
         } else {
-            stream->write_function(stream, "-ERR, load command: bad syntax!\n"
-                "-USAGE: %s\n\n", AVMD_SYNTAX);
+            stream->write_function(stream, "-ERR, load command: bad syntax!\n-USAGE: %s\n\n", AVMD_SYNTAX);
         }
         goto end;
     }
     if (strcasecmp(command, "set") == 0) {
         if (argc != 2) {
-            stream->write_function(stream, "-ERR, set command takes 1 parameter!\n"
-                "-USAGE: %s\n\n", AVMD_SYNTAX);
+            stream->write_function(stream, "-ERR, set command takes 1 parameter!\n-USAGE: %s\n\n", AVMD_SYNTAX);
             goto end;
         }
         command = argv[1];
         if (strcasecmp(command, "inbound") == 0) {
             avmd_set_xml_inbound_configuration(NULL);
             if (avmd_globals.settings.report_status == 1) {
-                stream->write_function(stream, "+OK\n inbound "
-                        "XML configuration loaded\n\n");
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-                        "Inbound XML configuration loaded\n");
+                stream->write_function(stream, "+OK\n inbound XML configuration loaded\n\n");
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Inbound XML configuration loaded\n");
             }
         } else if (strcasecmp(command, "outbound") == 0) {
             avmd_set_xml_outbound_configuration(NULL);
             if (avmd_globals.settings.report_status == 1) {
-                stream->write_function(stream, "+OK\n outbound "
-                        "XML configuration loaded\n\n");
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-                        "Outbound XML configuration loaded\n");
+                stream->write_function(stream, "+OK\n outbound XML configuration loaded\n\n");
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Outbound XML configuration loaded\n");
             }
         } else if (strcasecmp(command, "default") == 0) {
             avmd_set_xml_default_configuration(NULL);
             if (avmd_globals.settings.report_status == 1) {
-                stream->write_function(stream, "+OK\n reset "
-                        "to factory settings\n\n");
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-                        "Reset to factory settings\n");
+                stream->write_function(stream, "+OK\n reset to factory settings\n\n");
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Reset to factory settings\n");
             }
         } else {
-            stream->write_function(stream, "-ERR, set command: bad syntax!\n"
-                "-USAGE: %s\n\n", AVMD_SYNTAX);
+            stream->write_function(stream, "-ERR, set command: bad syntax!\n-USAGE: %s\n\n", AVMD_SYNTAX);
         }
         goto end;
     }
@@ -1410,8 +1384,7 @@ SWITCH_STANDARD_API(avmd_api_main)
 
        /* If the session was not found exit */
        if (fs_session == NULL) {
-               stream->write_function(stream, "-ERR, no FreeSWITCH session for uuid [%s]!"
-                "\n-USAGE: %s\n\n", uuid, AVMD_SYNTAX);
+               stream->write_function(stream, "-ERR, no FreeSWITCH session for uuid [%s]!\n-USAGE: %s\n\n", uuid, AVMD_SYNTAX);
                goto end;
        }
 
@@ -1450,10 +1423,8 @@ SWITCH_STANDARD_API(avmd_api_main)
                }
         if (avmd_globals.settings.report_status == 1) {
                    /* We have already started */
-                   switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session),
-                    SWITCH_LOG_ERROR, "Avmd already started!\n");
-                   stream->write_function(stream, "-ERR, avmd for FreeSWITCH session [%s]"
-                    "\n already started\n\n", uuid);
+                   switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR, "Avmd already started!\n");
+                   stream->write_function(stream, "-ERR, avmd for FreeSWITCH session [%s]\n already started\n\n", uuid);
         }
                goto end;
        }
@@ -1463,16 +1434,14 @@ SWITCH_STANDARD_API(avmd_api_main)
         stream->write_function(stream, "+ERR, avmd has not yet been started on\n"
                 " [%s] [%s]\n\n", uuid_dup, switch_channel_get_name(channel));
         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR,
-                "Stop failed - avmd has not yet been started on channel [%s]!\n",
-                switch_channel_get_name(channel));
+                "Stop failed - avmd has not yet been started on channel [%s]!\n", switch_channel_get_name(channel));
         goto end;
     }
     if (avmd_globals.settings.outbound_channnel == 1) {
         if (SWITCH_CALL_DIRECTION_OUTBOUND != switch_channel_direction(channel)) {
                    stream->write_function(stream, "-ERR, channel for FreeSWITCH session [%s]"
                     "\n is not outbound\n\n", uuid);
-                   switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR,
-                           "Channel [%s] is not outbound!\n", switch_channel_get_name(channel));
+                   switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR, "Channel [%s] is not outbound!\n", switch_channel_get_name(channel));
             goto end;
         } else {
             flags |= SMBF_READ_REPLACE;
@@ -1482,8 +1451,7 @@ SWITCH_STANDARD_API(avmd_api_main)
         if (SWITCH_CALL_DIRECTION_INBOUND != switch_channel_direction(channel)) {
                    stream->write_function(stream, "-ERR, channel for FreeSWITCH session [%s]"
                     "\n is not inbound\n\n", uuid);
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR,
-                           "Channel [%s] is not inbound!\n", switch_channel_get_name(channel));
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR, "Channel [%s] is not inbound!\n", switch_channel_get_name(channel));
             goto end;
         } else {
             flags |= SMBF_WRITE_REPLACE;
@@ -1500,11 +1468,9 @@ SWITCH_STANDARD_API(avmd_api_main)
     if (avmd_globals.settings.outbound_channnel == 1) {
         if (switch_channel_test_flag(channel, CF_MEDIA_SET) == 0) {
                    stream->write_function(stream, "-ERR, channel [%s] for FreeSWITCH session [%s]"
-                    "\n has no read codec assigned yet. Please try again.\n\n",
-                    switch_channel_get_name(channel), uuid);
+                    "\n has no read codec assigned yet. Please try again.\n\n", switch_channel_get_name(channel), uuid);
                    switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR,
-                           "Failed to start session. Channel [%s] has no codec assigned yet."
-                " Please try again\n", switch_channel_get_name(channel));
+                           "Failed to start session. Channel [%s] has no codec assigned yet. Please try again\n", switch_channel_get_name(channel));
             goto end;
         }
     }
@@ -1517,32 +1483,23 @@ SWITCH_STANDARD_API(avmd_api_main)
     avmd_session = (avmd_session_t *) switch_core_session_alloc(fs_session, sizeof(avmd_session_t)); /* Allocate memory attached to this FreeSWITCH session for use in the callback routine and to store state information */
     status = init_avmd_session_data(avmd_session, fs_session, NULL);
     if (status != SWITCH_STATUS_SUCCESS) {
-               stream->write_function(stream, "-ERR, failed to initialize avmd session\n"
-                " for FreeSWITCH session [%s]\n", uuid);
+               stream->write_function(stream, "-ERR, failed to initialize avmd session\n for FreeSWITCH session [%s]\n", uuid);
         switch (status) {
             case SWITCH_STATUS_MEMERR:
                        stream->write_function(stream, "-ERR, buffer error\n\n");
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session),
-                    SWITCH_LOG_ERROR, "Failed to init avmd session."
-                    " Buffer error!\n");
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR, "Failed to init avmd session. Buffer error!\n");
             break;
             case SWITCH_STATUS_MORE_DATA:
                        stream->write_function(stream, "-ERR, SMA buffer size is 0\n\n");
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session),
-                    SWITCH_LOG_ERROR, "Failed to init avmd session."
-                    " SMA buffer size is 0!\n");
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR, "Failed to init avmd session. SMA buffer size is 0!\n");
                 break;
             case SWITCH_STATUS_FALSE:
                        stream->write_function(stream, "-ERR, SMA buffer error\n\n");
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session),
-                    SWITCH_LOG_ERROR, "Failed to init avmd session."
-                    " SMA buffers error\n");
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR, "Failed to init avmd session. SMA buffers error\n");
                 break;
             default:
                        stream->write_function(stream, "-ERR, unknown error\n\n");
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session),
-                    SWITCH_LOG_ERROR, "Failed to init avmd session."
-                    " Unknown error\n");
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR, "Failed to init avmd session. Unknown error\n");
                 break;
         }
                goto end;
@@ -1551,10 +1508,8 @@ SWITCH_STANDARD_API(avmd_api_main)
        status = switch_core_media_bug_add(fs_session, "avmd", NULL, avmd_callback, avmd_session, 0, flags, &bug); /* Add a media bug that allows me to intercept the reading leg of the audio stream */
 
        if (status != SWITCH_STATUS_SUCCESS) { /* If adding a media bug fails exit */
-        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session),
-                       SWITCH_LOG_ERROR, "Failed to add media bug!\n");
-               stream->write_function(stream,
-                "-ERR, [%s] failed to add media bug!\n\n", uuid);
+        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_ERROR, "Failed to add media bug!\n");
+               stream->write_function(stream, "-ERR, [%s] failed to add media bug!\n\n", uuid);
                goto end;
        }
 
@@ -1562,10 +1517,8 @@ SWITCH_STANDARD_API(avmd_api_main)
 
     avmd_fire_event(AVMD_EVENT_SESSION_START, fs_session, 0, 0, 0, 0, 0, 0, 0, 0, avmd_session->start_time, 0);
     if (avmd_globals.settings.report_status == 1) {
-           stream->write_function(stream, "+OK\n [%s] [%s] started!\n\n",
-                uuid, switch_channel_get_name(channel));
-        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_INFO,
-                "Avmd on channel [%s] started!\n", switch_channel_get_name(channel));
+           stream->write_function(stream, "+OK\n [%s] [%s] started!\n\n", uuid, switch_channel_get_name(channel));
+        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_session), SWITCH_LOG_INFO, "Avmd on channel [%s] started!\n", switch_channel_get_name(channel));
         switch_assert(status == SWITCH_STATUS_SUCCESS);
     }
 end:
@@ -1741,9 +1694,7 @@ done:
     return;
 }
 
-static void
-avmd_reloadxml_event_handler(switch_event_t *event)
-{
+static void avmd_reloadxml_event_handler(switch_event_t *event) {
     avmd_load_xml_configuration(avmd_globals.mutex);
 }