<!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][16936] </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=16936">16936</a></dd>
<dt>Author</dt> <dd>mikej</dd>
<dt>Date</dt> <dd>2010-03-08 02:12:12 -0600 (Mon, 08 Mar 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>move functions to strip commas and non-numeric chars to switch_utils</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcincludeswitch_utilsh">freeswitch/trunk/src/include/switch_utils.h</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_demod_say_dec">freeswitch/trunk/src/mod/say/mod_say_de/mod_say_de.c</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_enmod_say_enc">freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_esmod_say_esc">freeswitch/trunk/src/mod/say/mod_say_es/mod_say_es.c</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_frmod_say_frc">freeswitch/trunk/src/mod/say/mod_say_fr/mod_say_fr.c</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_humod_say_huc">freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.c</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_itmod_say_itc">freeswitch/trunk/src/mod/say/mod_say_it/mod_say_it.c</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_nlmod_say_nlc">freeswitch/trunk/src/mod/say/mod_say_nl/mod_say_nl.c</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_rumod_say_ruc">freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_thmod_say_thc">freeswitch/trunk/src/mod/say/mod_say_th/mod_say_th.c</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_zhmod_say_zhc">freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_utilsc">freeswitch/trunk/src/switch_utils.c</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcincludeswitch_utilsh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_utils.h (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_utils.h        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/include/switch_utils.h        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -545,6 +545,8 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str);
</span><span class="cx"> SWITCH_DECLARE(char *) switch_strip_spaces(const char *str);
</span><ins>+SWITCH_DECLARE(char *) switch_strip_commas(char *in, char *out, switch_size_t len);
+SWITCH_DECLARE(char *) switch_strip_nonnumerics(char *in, char *out, switch_size_t len);
</ins><span class="cx"> SWITCH_DECLARE(char *) switch_separate_paren_args(char *str);
</span><span class="cx"> SWITCH_DECLARE(const char *) switch_stristr(const char *instr, const char *str);
</span><span class="cx"> SWITCH_DECLARE(switch_bool_t) switch_is_lan_addr(const char *ip);
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_demod_say_dec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_de/mod_say_de.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_de/mod_say_de.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_de/mod_say_de.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -122,49 +122,6 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58)) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-        // valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t de_say_general_count(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="cx">         int in;
</span><span class="lines">@@ -173,7 +130,7 @@
</span><span class="cx">         char sbuf[13] = "";
</span><span class="cx">         switch_status_t status;
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -408,7 +365,7 @@
</span><span class="cx">         char *dollars = NULL;
</span><span class="cx">         char *cents = NULL;
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_enmod_say_enc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -117,49 +117,6 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58)) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-        // valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t en_say_general_count(switch_core_session_t *session,        char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="cx">         int in;
</span><span class="lines">@@ -169,7 +126,7 @@
</span><span class="cx">         switch_status_t status;
</span><span class="cx">
</span><span class="cx">         if (say_args->method == SSM_ITERATED) {
</span><del>-                if ((tosay = strip_commas(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+                if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                         char *p;
</span><span class="cx">                         for (p = tosay; p && *p; p++) {
</span><span class="cx">                                 say_file("digits/%c.wav", *p);
</span><span class="lines">@@ -181,7 +138,7 @@
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -475,7 +432,7 @@
</span><span class="cx">         char *dollars = NULL;
</span><span class="cx">         char *cents = NULL;
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_esmod_say_esc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_es/mod_say_es.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_es/mod_say_es.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_es/mod_say_es.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -142,49 +142,6 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58)) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-        // valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t es_say_general_count(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="cx">         int in;
</span><span class="lines">@@ -193,7 +150,7 @@
</span><span class="cx">         char sbuf[13] = "";
</span><span class="cx">         switch_status_t status;
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -429,7 +386,7 @@
</span><span class="cx">         char *dollars = NULL;
</span><span class="cx">         char *cents = NULL;
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_frmod_say_frc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_fr/mod_say_fr.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_fr/mod_say_fr.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_fr/mod_say_fr.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -139,49 +139,6 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58)) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-        /* valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others */
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t fr_say_general_count(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="cx">         int in;
</span><span class="lines">@@ -190,7 +147,7 @@
</span><span class="cx">         char sbuf[13] = "";
</span><span class="cx">         switch_status_t status;
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -480,7 +437,7 @@
</span><span class="cx">         char *dollars = NULL;
</span><span class="cx">         char *cents = NULL;
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_humod_say_huc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -117,49 +117,6 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58)) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-        // valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t hu_say_general_count(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="cx">         int in;
</span><span class="lines">@@ -169,7 +126,7 @@
</span><span class="cx">         int number;
</span><span class="cx">         switch_status_t status;
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -437,7 +394,7 @@
</span><span class="cx">         char sbuf[16] = "";
</span><span class="cx">         char *forint;
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_itmod_say_itc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_it/mod_say_it.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_it/mod_say_it.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_it/mod_say_it.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -126,49 +126,6 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58)) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-        /* valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others */
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t it_say_general_count(switch_core_session_t *session,        char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="cx">         int in;
</span><span class="lines">@@ -177,7 +134,7 @@
</span><span class="cx">         char sbuf[13] = "";
</span><span class="cx">         switch_status_t status;
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -436,7 +393,7 @@
</span><span class="cx">         char *dollars = NULL;
</span><span class="cx">         char *cents = NULL;
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_nlmod_say_nlc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_nl/mod_say_nl.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_nl/mod_say_nl.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_nl/mod_say_nl.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -113,49 +113,6 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58)) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-        // valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t nl_say_general_count(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="cx">         int in;
</span><span class="lines">@@ -164,7 +121,7 @@
</span><span class="cx">         char sbuf[13] = "";
</span><span class="cx">         switch_status_t status;
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -400,7 +357,7 @@
</span><span class="cx">         char *dollars = NULL;
</span><span class="cx">         char *cents = NULL;
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_rumod_say_ruc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -72,45 +72,6 @@
</span><span class="cx">                         return SWITCH_STATUS_FALSE;\
</span><span class="cx">                 }}
</span><span class="cx">
</span><del>-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58)) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in, *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-        /* valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others */
-        for (; p && *p; p++) {
-                if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t play_group(say_type_t say_type, casus_t casus, int a, int b, int c,
</span><span class="cx">                                                                  unit_t what, switch_core_session_t *session, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="lines">@@ -203,7 +164,7 @@
</span><span class="cx">
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "ru_say_count %s!\n", tosay);
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -300,7 +261,7 @@
</span><span class="cx">
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_money %s\n", tosay);
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_thmod_say_thc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_th/mod_say_th.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_th/mod_say_th.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_th/mod_say_th.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -87,52 +87,6 @@
</span><span class="cx">                         return SWITCH_STATUS_FALSE;                                                                        \
</span><span class="cx">                 }}                                                                                                                                \
</span><span class="cx">
</span><del>-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in;
-        char *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p >= '0' && *p <= '9')) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in;
-        char *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        /* valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others */
-        for (; p && *p; p++) {
-                if ((*p >= '0' && *p <= '9') || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t th_say_general_count(switch_core_session_t *session,        char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="cx">         int in;
</span><span class="lines">@@ -140,7 +94,7 @@
</span><span class="cx">         char digits[11];
</span><span class="cx">         int i;
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -505,7 +459,7 @@
</span><span class="cx">         char *dollars = NULL;
</span><span class="cx">         char *cents = NULL;
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_zhmod_say_zhc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -86,53 +86,6 @@
</span><span class="cx">                         return SWITCH_STATUS_FALSE;                                                                        \
</span><span class="cx">                 }}                                                                                                                                \
</span><span class="cx">
</span><del>-
-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
-        char *p = in;
-        char *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        for (; p && *p; p++) {
-                if ((*p >= '0' && *p <= '9')) {
-                        *q++ = *p;
-                } else if (*p != ',') {
-                        ret = NULL;
-                        break;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
-        char *p = in;
-        char *q = out;
-        char *ret = out;
-        switch_size_t x = 0;
-
-        /* valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others */
-        for (; p && *p; p++) {
-                if ((*p >= '0' && *p <= '9') || *p == '.' || *p == '-' || *p == '+') {
-                        *q++ = *p;
-                }
-
-                if (++x > len) {
-                        ret = NULL;
-                        break;
-                }
-        }
-
-        return ret;
-}
-
</del><span class="cx"> static switch_status_t zh_say_general_count(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
</span><span class="cx"> {
</span><span class="cx">         int in;
</span><span class="lines">@@ -140,7 +93,7 @@
</span><span class="cx">         char digits[11];
</span><span class="cx">         int i;
</span><span class="cx">
</span><del>-        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</del><ins>+        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -485,7 +438,7 @@
</span><span class="cx">         char *dollars = NULL;
</span><span class="cx">         char *cents = NULL;
</span><span class="cx">
</span><del>-        if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</del><ins>+        if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_utilsc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_utils.c (16935 => 16936)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_utils.c        2010-03-08 07:55:57 UTC (rev 16935)
+++ freeswitch/trunk/src/switch_utils.c        2010-03-08 08:12:12 UTC (rev 16936)
</span><span class="lines">@@ -742,6 +742,49 @@
</span><span class="cx">         return s;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(char *) switch_strip_commas(char *in, char *out, switch_size_t len)
+{
+        char *p = in, *q = out;
+        char *ret = out;
+        switch_size_t x = 0;
+
+        for (; p && *p; p++) {
+                if ((*p > 47 && *p < 58)) {
+                        *q++ = *p;
+                } else if (*p != ',') {
+                        ret = NULL;
+                        break;
+                }
+
+                if (++x > len) {
+                        ret = NULL;
+                        break;
+                }
+        }
+
+        return ret;
+}
+
+SWITCH_DECLARE(char *) switch_strip_nonnumerics(char *in, char *out, switch_size_t len)
+{
+        char *p = in, *q = out;
+        char *ret = out;
+        switch_size_t x = 0;
+        /* valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others */
+        for (; p && *p; p++) {
+                if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
+                        *q++ = *p;
+                }
+
+                if (++x > len) {
+                        ret = NULL;
+                        break;
+                }
+        }
+
+        return ret;
+}
+
</ins><span class="cx"> SWITCH_DECLARE(char *) switch_separate_paren_args(char *str)
</span><span class="cx"> {
</span><span class="cx">         char *e, *args;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>