]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add fixes from mmurdock, thanks mike
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 6 Jan 2007 00:57:54 +0000 (00:57 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 6 Jan 2007 00:57:54 +0000 (00:57 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3914 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/say/mod_say_en/mod_say_en.c

index 49215fedb48624299354e18e0625bad99ba94fc2..b47c22d7d849ffdb2e0eccea8f8f97c0b656f6c8 100644 (file)
@@ -420,7 +420,12 @@ static switch_status_t en_say_money(switch_core_session_t *session,
        if ((cents = strchr(sbuf, '.'))) {
                *cents++ = '\0';
        }
-       
+
+    /* If positive sign - skip over" */
+    if (sbuf[0] == '+') {
+        dollars++;
+    }
+
        /* If negative say "negative" */
        if (sbuf[0] == '-') {
                say_file("negative.wav");
@@ -439,14 +444,20 @@ static switch_status_t en_say_money(switch_core_session_t *session,
        /* Say "and" */
        say_file("and.wav");
        
-       /* Say cents */
-       en_say_general_count(session, cents, type, method, args);
-       if (atoi(cents) == 1) {
-               say_file("cent.wav");
-       }
-       else {
-               say_file("cents.wav");
-       }
+    /* Say cents */
+    if (cents) {
+        en_say_general_count(session, cents, type, method, args);
+        if (atoi(cents) == 1) {
+            say_file("cent.wav");
+        }
+        else {
+            say_file("cents.wav");
+        }
+    }
+    else {
+        say_file("digits/0.wav");
+        say_file("cents.wav");
+    }
        
        return SWITCH_STATUS_SUCCESS;
 }