<!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][15622] </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=15622">15622</a></dd>
<dt>Author</dt> <dd>mikej</dd>
<dt>Date</dt> <dd>2009-11-23 11:27:22 -0600 (Mon, 23 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>add mod_say_hu to trunk from csecket branch</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkbuildmodulesconfin">freeswitch/trunk/build/modules.conf.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>freeswitch/trunk/src/mod/say/mod_say_hu/</li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_huMakefile">freeswitch/trunk/src/mod/say/mod_say_hu/Makefile</a></li>
<li><a href="#freeswitchtrunksrcmodsaymod_say_humod_say_hu2008vcproj">freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.2008.vcproj</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_humod_say_huvcproj">freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.vcproj</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkbuildmodulesconfin"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/build/modules.conf.in (15621 => 15622)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/build/modules.conf.in        2009-11-23 16:50:46 UTC (rev 15621)
+++ freeswitch/trunk/build/modules.conf.in        2009-11-23 17:27:22 UTC (rev 15622)
</span><span class="lines">@@ -88,9 +88,9 @@
</span><span class="cx"> #say/mod_say_nl
</span><span class="cx"> say/mod_say_ru
</span><span class="cx"> #say/mod_say_zh
</span><ins>+#say/mod_say_hu
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> ## Experimental Modules (don't cry if they're broken)
</span><span class="cx"> #../../contrib/mod/endpoints/mod_khomp
</span><span class="cx"> #../../contrib/mod/xml_int/mod_xml_odbc
</span></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_huMakefile"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/say/mod_say_hu/Makefile (0 => 15622)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_hu/Makefile                                (rev 0)
+++ freeswitch/trunk/src/mod/say/mod_say_hu/Makefile        2009-11-23 17:27:22 UTC (rev 15622)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+BASE=../../../..
+include $(BASE)/build/modmake.rules
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_humod_say_hu2008vcproj"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.2008.vcproj (0 => 15622)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.2008.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.2008.vcproj        2009-11-23 17:27:22 UTC (rev 15622)
</span><span class="lines">@@ -0,0 +1,283 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;9.00&quot;
+        Name=&quot;mod_say_hu&quot;
+        ProjectGUID=&quot;{988CACF7-3FCB-4992-BE69-77872AE67DC8}&quot;
+        RootNamespace=&quot;mod_say_hu&quot;
+        Keyword=&quot;Win32Proj&quot;
+        TargetFrameworkVersion=&quot;131072&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+                &lt;Platform
+                        Name=&quot;x64&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\module_debug.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\module_debug.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\module_release.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\module_release.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_say_hu.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_humod_say_huc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.c (0 => 15622)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.c                                (rev 0)
+++ freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.c        2009-11-23 17:27:22 UTC (rev 15622)
</span><span class="lines">@@ -0,0 +1,537 @@
</span><ins>+/*
+ * Copyright (c) 2007, Anthony Minessale II
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ * 
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ * Michael B. Murdock &lt;mike@mmurdock.org&gt;
+ *
+ * mod_say_hu.c -- Say for Hungarian
+ *
+ */
+
+#include &lt;switch.h&gt;
+#include &lt;math.h&gt;
+#include &lt;ctype.h&gt;
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_say_hu_load);
+SWITCH_MODULE_DEFINITION(mod_say_hu, mod_say_hu_load, NULL, NULL);
+
+#define say_num(num, t) {                                                        \
+                char tmp[80];\
+                switch_status_t tstatus;\
+                switch_snprintf(tmp, sizeof(tmp), &quot;%u&quot;, (unsigned)num);                                \
+        if ((tstatus = hu_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\
+                return tstatus;\
+        }}\
+
+#define say_file(...) {\
+                char tmp[80];\
+                switch_status_t tstatus;\
+                switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
+                if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \
+                        return tstatus;\
+                }\
+                if (!switch_channel_ready(switch_core_session_get_channel(session))) {\
+                        return SWITCH_STATUS_FALSE;\
+                }}\
+
+
+static switch_status_t hu_spell(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
+{
+        char *p;
+
+        for (p = tosay; p &amp;&amp; *p; p++) {
+                int a = tolower((int) *p);
+                if (a &gt;= 48 &amp;&amp; a &lt;= 57) {
+                        say_file(&quot;digits/%d.wav&quot;, a - 48);
+                } else {
+                        if (type == SST_NAME_SPELLED) {
+                                say_file(&quot;ascii/%d.wav&quot;, a);
+                        } else if (type == SST_NAME_PHONETIC) {
+                                say_file(&quot;phonetic-ascii/%d.wav&quot;, a);
+                        }
+                }
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t play_group(switch_say_method_t method, int a, int b, int c, char *what, int tosay, switch_core_session_t *session, switch_input_args_t *args)
+{
+        if (a) {
+                say_file(&quot;digits/%d.wav&quot;, a);
+                say_file(&quot;digits/hundred.wav&quot;);
+        }
+
+        if (b) {
+                if (b &gt; 2) {
+                   if ((c==0) &amp;&amp; (method == SSM_COUNTED)) {
+                     say_file(&quot;digits/h-%d0.wav&quot;, b);
+                   } else {
+                     say_file(&quot;digits/%d0.wav&quot;, b);
+                   }
+                } else {
+                        say_file(&quot;digits/%d%d.wav&quot;, b, c);
+                        c = 0;
+                }
+        }
+
+        if (c) {
+                if (method == SSM_COUNTED) {
+                        say_file(&quot;digits/h-%d.wav&quot;, c);
+                } else {
+                        say_file(&quot;digits/%d.wav&quot;, c);
+                }
+        }
+
+        if (what &amp;&amp; (a || b || c)) {
+                say_file(what);
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+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 &amp;&amp; *p; p++) {
+                if ((*p &gt; 47 &amp;&amp; *p &lt; 58)) {
+                        *q++ = *p;
+                } else if (*p != ',') {
+                        ret = NULL;
+                        break;
+                }
+
+                if (++x &gt; 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 &amp;&amp; *p; p++) {
+                if ((*p &gt; 47 &amp;&amp; *p &lt; 58) || *p == '.' || *p == '-' || *p == '+') {
+                        *q++ = *p;
+                }
+
+                if (++x &gt; len) {
+                        ret = NULL;
+                        break;
+                }
+        }
+
+        return ret;
+}
+
+static switch_status_t hu_say_general_count(switch_core_session_t *session,
+                                                                                        char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
+{
+        int in;
+        int x = 0;
+        int places[9] = { 0 };
+        char sbuf[13] = &quot;&quot;;
+        int number;
+        switch_status_t status;
+
+        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) &gt; 9) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Parse Error!\n&quot;);
+                return SWITCH_STATUS_GENERR;
+        }
+
+        in = atoi(tosay);
+        number = in;
+
+        if (in != 0) {
+                for (x = 8; x &gt;= 0; x--) {
+                        int num = (int) pow(10, x);
+                        if ((places[(uint32_t) x] = in / num)) {
+                                in -= places[(uint32_t) x] * num;
+                        }
+                }
+
+                switch (method) {
+                case SSM_COUNTED:
+                case SSM_PRONOUNCED:
+                        if ((status = play_group(SSM_PRONOUNCED, places[8], places[7], places[6], &quot;digits/million.wav&quot;, number, session, args)) != SWITCH_STATUS_SUCCESS) {
+                                return status;
+                        }
+                        if ((status = play_group(SSM_PRONOUNCED, places[5], places[4], places[3], &quot;digits/thousand.wav&quot;, number, session, args)) != SWITCH_STATUS_SUCCESS) {
+                                return status;
+                        }
+                        if ((status = play_group(method, places[2], places[1], places[0], NULL, number, session, args)) != SWITCH_STATUS_SUCCESS) {
+                                return status;
+                        }
+                        break;
+                case SSM_ITERATED:
+                        {
+                                char *p;
+                                for (p = tosay; p &amp;&amp; *p; p++) {
+                                        say_file(&quot;digits/%c.wav&quot;, *p);
+                                }
+                        }
+                        break;
+                default:
+                        break;
+                }
+        } else {
+                say_file(&quot;digits/0.wav&quot;);
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+static switch_status_t hu_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
+{
+        char *a, *b, *c, *d;
+        if (!(a = switch_core_session_strdup(session, tosay))) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        if (!(b = strchr(a, '.'))) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        *b++ = '\0';
+
+        if (!(c = strchr(b, '.'))) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        *c++ = '\0';
+
+        if (!(d = strchr(c, '.'))) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        *d++ = '\0';
+
+        say_num(atoi(a), method);
+        say_file(&quot;digits/dot.wav&quot;);
+        say_num(atoi(b), method);
+        say_file(&quot;digits/dot.wav&quot;);
+        say_num(atoi(c), method);
+        say_file(&quot;digits/dot.wav&quot;);
+        say_num(atoi(d), method);
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+static switch_status_t hu_say_time(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method,
+                                                                   switch_input_args_t *args)
+{
+        int32_t t;
+        switch_time_t target = 0, target_now = 0;
+        switch_time_exp_t tm, tm_now;
+        uint8_t say_date = 0, say_time = 0, say_year = 0, say_month = 0, say_dow = 0, say_day = 0, say_yesterday = 0, say_today = 0;
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        const char *tz = switch_channel_get_variable(channel, &quot;timezone&quot;);
+        
+        if (type == SST_TIME_MEASUREMENT) {
+                int64_t hours = 0;
+                int64_t minutes = 0;
+                int64_t seconds = 0;
+                int64_t r = 0;
+
+                if (strchr(tosay, ':')) {
+                        char *tme = switch_core_session_strdup(session, tosay);
+                        char *p;
+
+                        if ((p = strrchr(tme, ':'))) {
+                                *p++ = '\0';
+                                seconds = atoi(p);
+                                if ((p = strchr(tme, ':'))) {
+                                        *p++ = '\0';
+                                        minutes = atoi(p);
+                                        if (tme) {
+                                                hours = atoi(tme);
+                                        }
+                                } else {
+                                        minutes = atoi(tme);
+                                }
+                        }
+                } else {
+                        if ((seconds = atol(tosay)) &lt;= 0) {
+                                seconds = (int64_t) switch_epoch_time_now(NULL);
+                        }
+
+                        if (seconds &gt;= 60) {
+                                minutes = seconds / 60;
+                                r = seconds % 60;
+                                seconds = r;
+                        }
+
+                        if (minutes &gt;= 60) {
+                                hours = minutes / 60;
+                                r = minutes % 60;
+                                minutes = r;
+                        }
+                }
+
+                if (hours) {
+                        say_num(hours, SSM_PRONOUNCED);
+                        say_file(&quot;time/hour.wav&quot;);
+                } else {
+                        say_file(&quot;digits/0.wav&quot;);
+                        say_file(&quot;time/hour.wav&quot;);
+                }
+
+                if (minutes) {
+                        say_num(minutes, SSM_PRONOUNCED);
+                        say_file(&quot;time/minute.wav&quot;);
+                } else {
+                        say_file(&quot;digits/0.wav&quot;);
+                        say_file(&quot;time/minute.wav&quot;);
+                }
+
+                if (seconds) {
+                        say_num(seconds, SSM_PRONOUNCED);
+                        say_file(&quot;time/second.wav&quot;);
+                } else {
+                        say_file(&quot;digits/0.wav&quot;);
+                        say_file(&quot;time/second.wav&quot;);
+                }
+
+                return SWITCH_STATUS_SUCCESS;
+        }
+
+        if ((t = atol(tosay)) &gt; 0) {
+                target = switch_time_make(t, 0);
+                target_now = switch_micro_time_now();
+        } else {
+                target = switch_micro_time_now();
+                target_now = switch_micro_time_now();
+        }
+        
+        if (tz) {
+                int check = atoi(tz);
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;Timezone is [%s]\n&quot;, tz);
+                if (check) {
+                        switch_time_exp_tz(&amp;tm, target, check);
+                        switch_time_exp_tz(&amp;tm_now, target_now, check);
+                } else {
+                        switch_time_exp_tz_name(tz, &amp;tm, target);
+                        switch_time_exp_tz_name(tz, &amp;tm_now, target_now);
+                }
+        } else {
+                switch_time_exp_lt(&amp;tm, target);
+                switch_time_exp_lt(&amp;tm_now, target_now);
+        }
+
+        switch (type) {
+        case SST_CURRENT_DATE_TIME:
+                say_date = say_time = 1;
+                break;
+        case SST_CURRENT_DATE:
+                say_date = 1;
+                break;
+        case SST_CURRENT_TIME:
+                say_time = 1;
+                break;
+        case SST_SHORT_DATE_TIME:
+                say_time = 1;
+                if (tm.tm_year != tm_now.tm_year) {
+                        say_date = 1;
+                        break;
+                }
+                if (tm.tm_yday == tm_now.tm_yday) {
+                        say_today = 1;
+                        break;
+                }
+                if (tm.tm_yday == tm_now.tm_yday - 1) {
+                        say_yesterday = 1;
+                        break;
+                }
+                if (tm.tm_yday &gt;= tm_now.tm_yday - 5) {
+                        say_dow = 1;
+                        break;
+                }
+                if (tm.tm_mon != tm_now.tm_mon) {
+                        say_month = say_day = say_dow = 1;
+                        break;
+                }
+
+                say_month = say_day = say_dow = 1;
+                
+                break;
+        default:
+                break;
+        }
+
+        if (say_today) {
+                say_file(&quot;time/today.wav&quot;);
+        }
+        if (say_yesterday) {
+                say_file(&quot;time/yesterday.wav&quot;);
+        }
+        if (say_dow) {
+                say_file(&quot;time/day-%d.wav&quot;, tm.tm_wday);
+        }
+
+        if (say_date) {
+                say_year = say_month = say_day = say_dow = 1;
+                say_today = say_yesterday = 0;
+        }
+
+        if (say_month) {
+                say_file(&quot;time/mon-%d.wav&quot;, tm.tm_mon);
+        }
+        if (say_day) {
+                say_num(tm.tm_mday, SSM_COUNTED);
+        }
+        if (say_year) {
+                say_num(tm.tm_year + 1900, SSM_PRONOUNCED);
+        }
+
+        if (say_time) {
+                say_num(tm.tm_hour, SSM_PRONOUNCED);
+                say_file(&quot;time/hour.wav&quot;);
+                say_num(tm.tm_min, SSM_PRONOUNCED);
+
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+static switch_status_t hu_say_money(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method,
+                                                                        switch_input_args_t *args)
+{
+        char sbuf[16] = &quot;&quot;;
+        char *forint;
+
+        if (strlen(tosay) &gt; 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Parse Error!\n&quot;);
+                return SWITCH_STATUS_GENERR;
+        }
+
+        forint = sbuf;
+
+        if (sbuf[0] == '+') {
+                forint++;
+        }
+
+        if (sbuf[0] == '-') {
+                say_file(&quot;currency/negative.wav&quot;);
+                forint++;
+        }
+
+        hu_say_general_count(session, forint, type, method, args);
+        say_file(&quot;currency/forint.wav&quot;);
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+
+static switch_status_t hu_say(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
+{
+
+        switch_say_callback_t say_cb = NULL;
+
+        switch (type) {
+        case SST_NUMBER:
+        case SST_ITEMS:
+        case SST_PERSONS:
+        case SST_MESSAGES:
+                say_cb = hu_say_general_count;
+                break;
+        case SST_TIME_MEASUREMENT:
+        case SST_CURRENT_DATE:
+        case SST_CURRENT_TIME:
+        case SST_CURRENT_DATE_TIME:
+        case SST_SHORT_DATE_TIME:
+                say_cb = hu_say_time;
+                break;
+        case SST_IP_ADDRESS:
+                say_cb = hu_ip;
+                break;
+        case SST_NAME_SPELLED:
+        case SST_NAME_PHONETIC:
+                say_cb = hu_spell;
+                break;
+        case SST_CURRENCY:
+                say_cb = hu_say_money;
+                break;
+        default:
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Unknown Say type=[%d]\n&quot;, type);
+                break;
+        }
+
+        if (say_cb) {
+                return say_cb(session, tosay, type, method, args);
+        }
+
+        return SWITCH_STATUS_FALSE;
+}
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_say_hu_load)
+{
+        switch_say_interface_t *say_interface;
+        /* connect my internal structure to the blank pointer passed to me */
+        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+        say_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_SAY_INTERFACE);
+        say_interface-&gt;interface_name = &quot;hu&quot;;
+        say_interface-&gt;say_function = hu_say;
+
+        /* indicate that the module should continue to be loaded */
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodsaymod_say_humod_say_huvcproj"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.vcproj (0 => 15622)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/say/mod_say_hu/mod_say_hu.vcproj        2009-11-23 17:27:22 UTC (rev 15622)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;8.00&quot;
+        Name=&quot;mod_say_hu&quot;
+        ProjectGUID=&quot;{988CACF7-3FCB-4992-BE69-77872AE67DC8}&quot;
+        RootNamespace=&quot;mod_say_hu&quot;
+        Keyword=&quot;Win32Proj&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\module_debug.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\module_release.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_say_hu.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>