]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODAPP-317
authorMathieu Rene <mrene@avgs.ca>
Wed, 11 Nov 2009 04:29:05 +0000 (04:29 +0000)
committerMathieu Rene <mrene@avgs.ca>
Wed, 11 Nov 2009 04:29:05 +0000 (04:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15424 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/say/mod_say_es/mod_say_es.c

index 0f488100ab4dfc299a770524333482230a711e8f..946e477336f32f89572ab08c496dc6f4445c0898 100644 (file)
@@ -91,37 +91,67 @@ static switch_status_t es_spell(switch_core_session_t *session, char *tosay, swi
        return SWITCH_STATUS_SUCCESS;
 }
 
-static switch_status_t play_group(switch_say_method_t method, int a, int b, int c, char *what, switch_core_session_t *session, switch_input_args_t *args)
-{
-
-       if (a) {
-               say_file("digits/%d.wav", a);
-               say_file("digits/hundred.wav");
-       }
-
-       if (b) {
-               if (b > 1) {
-                       say_file("digits/%d0.wav", b);
-               } else {
-                       say_file("digits/%d%d.wav", b, c);
-                       c = 0;
-               }
-       }
-
-       if (c) {
-               if (method == SSM_COUNTED) {
-                       say_file("digits/h-%d.wav", c);
-               } else {
-                       say_file("digits/%d.wav", c);
-               }
-       }
-
-       if (what && (a || b || c)) {
-               say_file(what);
-       }
-
-       return SWITCH_STATUS_SUCCESS;
-}
+static switch_status_t play_group(switch_say_method_t method, int a, int b, int c, char *what, switch_core_session_t *session,switch_input_args_t *args) 
+{ 
+       if (a) { 
+               switch(a) { 
+                       case 1: 
+                               if (b || c) { 
+                                       say_file("digits/hundred.wav"); 
+                               } else { 
+                                       say_file("digits/100.wav"); 
+                               } 
+                               break; 
+                       case 5: 
+                               say_file("digits/500.wav"); 
+                               break; 
+                       case 7: 
+                               say_file("digits/700.wav"); 
+                               break; 
+                       case 9: 
+                               say_file("digits/900.wav"); 
+                               break; 
+                       default: 
+                               say_file("digits/%d.wav", a); 
+                               say_file("digits/hundred.wav"); 
+                               break; 
+               } 
+       } 
+
+       if (b) { 
+               if (b > 1) { 
+                       switch (b) { 
+                                               case 2: if (c) { 
+                                                       say_file("digits/veinti.wav"); 
+                                                                                                               } else { 
+                                                                                                                       say_file("digits/20.wav"); 
+                                                                                                               } 
+                                                                                                               break; 
+                                               default: 
+                                                       say_file("digits/%d0.wav", b); 
+                                                       if (c) 
+                                                       { 
+                                                               say_file("currency/and.wav"); 
+                                                       } 
+                                                       break; 
+                       } 
+               } else { 
+                       say_file("digits/%d%d.wav", b, c); 
+                       c = 0; 
+               } 
+       } 
+       if (c) { 
+               if (method == SSM_COUNTED) { 
+                       say_file("digits/h-%d.wav", c); 
+               } else { 
+                       say_file("digits/%d.wav", c); 
+               } 
+       } 
+       if (what && (a || b || c)) { 
+               say_file(what); 
+       } 
+       return SWITCH_STATUS_SUCCESS; 
+} 
 
 static char *strip_commas(char *in, char *out, switch_size_t len)
 {