]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3201 make changes similar to en support
authorJeff Lenk <jeff@jefflenk.com>
Wed, 30 Mar 2011 19:55:06 +0000 (14:55 -0500)
committerJeff Lenk <jeff@jefflenk.com>
Wed, 30 Mar 2011 19:55:06 +0000 (14:55 -0500)
src/mod/say/mod_say_de/mod_say_de.c
src/mod/say/mod_say_es/mod_say_es.c
src/mod/say/mod_say_fr/mod_say_fr.c
src/mod/say/mod_say_hr/mod_say_hr.c
src/mod/say/mod_say_hu/mod_say_hu.c
src/mod/say/mod_say_it/mod_say_it.c
src/mod/say/mod_say_ja/mod_say_ja.c
src/mod/say/mod_say_nl/mod_say_nl.c
src/mod/say/mod_say_ru/mod_say_ru.c
src/mod/say/mod_say_th/mod_say_th.c
src/mod/say/mod_say_zh/mod_say_zh.c

index fec6ddb6806e64083d6538fa9d937a92de4af514..7212a5f58174d6174732d4b22a411c485578da85 100644 (file)
@@ -127,9 +127,22 @@ static switch_status_t de_say_general_count(switch_core_session_t *session, char
        int in;
        int x = 0;
        int places[9] = { 0 };
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        switch_status_t status;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               say_file("digits/%c.wav", *p);
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1)) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -158,14 +171,6 @@ static switch_status_t de_say_general_count(switch_core_session_t *session, char
                                return status;
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-                               for (p = tosay; p && *p; p++) {
-                                       say_file("digits/%c.wav", *p);
-                               }
-                       }
-                       break;
                default:
                        break;
                }
index 0576e16c6c027197a51f1801f4e5f3d47a1b6cde..91675aa87282121c7636d90b37c6111bb97860f1 100644 (file)
@@ -155,9 +155,22 @@ static switch_status_t es_say_general_count(switch_core_session_t *session, char
        int in;
        int x = 0;
        int places[9] = { 0 };
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        switch_status_t status;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               say_file("digits/%c.wav", *p);
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1)) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -191,14 +204,6 @@ static switch_status_t es_say_general_count(switch_core_session_t *session, char
                                return status;
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-                               for (p = tosay; p && *p; p++) {
-                                       say_file("digits/%c.wav", *p);
-                               }
-                       }
-                       break;
                default:
                        break;
                }
index 5ddd8fb58ebe7ecf073511ae8aecf225de81332e..37e126ecb2794e950aa68c3e8173c56a32f06b93 100644 (file)
@@ -144,9 +144,26 @@ static switch_status_t fr_say_general_count(switch_core_session_t *session, char
        int in;
        int x = 0;
        int places[9] = { 0 };
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        switch_status_t status;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               if (*p == '1' && say_args->gender == SSG_FEMININE) {
+                                       say_file("digits/%c_f.wav", *p);
+                               } else {
+                                       say_file("digits/%c.wav", *p);
+                               }
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1)) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -175,18 +192,6 @@ static switch_status_t fr_say_general_count(switch_core_session_t *session, char
                                return status;
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-                               for (p = tosay; p && *p; p++) {
-                                       if (*p == '1' && say_args->gender == SSG_FEMININE) {
-                                               say_file("digits/%c_f.wav", *p);
-                                       } else {
-                                               say_file("digits/%c.wav", *p);
-                                       }
-                               }
-                       }
-                       break;
                default:
                        break;
                }
index 4c560db80a2cb6e2a80711ce82638c826eaa80aa..f08a0de0a2a2830e15a7a5139cc9e5c34b4439be 100644 (file)
@@ -356,10 +356,23 @@ static switch_status_t hr_say_general_count(switch_core_session_t *session,       char
        int in;
        int x = 0;
        int places[9] = { 0 };
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        int number;
        switch_status_t status;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               say_file("digits/%c.wav", *p);
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -391,14 +404,6 @@ static switch_status_t hr_say_general_count(switch_core_session_t *session,        char
                                return status;
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-                               for (p = tosay; p && *p; p++) {
-                                       say_file("digits/%c.wav", *p);
-                               }
-                       }
-                       break;
                default:
                        break;
                }
index ca1b90f584da4c603a29aa70fdacb1026357a308..847d6f811de0402ecf195306774787b262c4065a 100644 (file)
@@ -122,10 +122,23 @@ static switch_status_t hu_say_general_count(switch_core_session_t *session, char
        int in;
        int x = 0;
        int places[9] = { 0 };
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        int number;
        switch_status_t status;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               say_file("digits/%c.wav", *p);
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1)) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -157,14 +170,6 @@ static switch_status_t hu_say_general_count(switch_core_session_t *session, char
                                return status;
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-                               for (p = tosay; p && *p; p++) {
-                                       say_file("digits/%c.wav", *p);
-                               }
-                       }
-                       break;
                default:
                        break;
                }
index e3d5131ed150921f798b8e60194729e2df0820a7..ef4b3d2bdae9ea3419ac4181d4dab67b12a02ddb 100644 (file)
@@ -131,9 +131,22 @@ static switch_status_t it_say_general_count(switch_core_session_t *session,        char
        int in;
        int places_count = 0;
        int places[9] = { 0 };
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        switch_status_t status;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               say_file("digits/%c.wav", *p);
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1)) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -202,14 +215,6 @@ static switch_status_t it_say_general_count(switch_core_session_t *session,        char
                                return status;
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-                               for (p = tosay; p && *p; p++) {
-                                       say_file("digits/%c.wav", *p);
-                               }
-                       }
-                       break;
                default:
                        break;
                }
index f493d8974a2f2f8b60c4a369d42e3b22526e955e..aa11a87ebf31fd4bc01c0f3c415ccedc95f4b709 100644 (file)
@@ -84,10 +84,23 @@ SWITCH_MODULE_DEFINITION(mod_say_ja, mod_say_ja_load, NULL, NULL);
 static switch_status_t ja_say_general_count(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
 {
        int in;
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        char digits[11];
        int i;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               say_file("digits/%c.wav", *p);
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1)) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -218,13 +231,6 @@ static switch_status_t ja_say_general_count(switch_core_session_t *session, char
                                }
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-                               for (p = tosay; p && *p; p++)
-                                       say_file("digits/%c.wav", *p);
-                       }
-                       break;
                default:
                        break;
                }
index 116c20ec91f1c64b65a999aa3dd91c9776bce937..e1e822b2f671245efdfb9aceed07c2846fce813c 100644 (file)
@@ -118,9 +118,22 @@ static switch_status_t nl_say_general_count(switch_core_session_t *session, char
        int in;
        int x = 0;
        int places[9] = { 0 };
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        switch_status_t status;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               say_file("digits/%c.wav", *p);
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1)) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -149,14 +162,6 @@ static switch_status_t nl_say_general_count(switch_core_session_t *session, char
                                return status;
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-                               for (p = tosay; p && *p; p++) {
-                                       say_file("digits/%c.wav", *p);
-                               }
-                       }
-                       break;
                default:
                        break;
                }
index 771f997f8ae6eae1c50e91889c0307f142a40eca..9c8db5732e5385ccfac28e03bfe4c17d932bc869 100644 (file)
@@ -157,7 +157,7 @@ static switch_status_t ru_say_count(switch_core_session_t *session, char *tosay,
        int in;
        int x = 0;
        int places[9] = { 0 };
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        int in_;
 
        switch_status_t status;
index f61cdbce82d45d0883a679efe1a17eee1ae64912..675c1a44e65b696f49e45601268358daaed5ad0d 100644 (file)
@@ -90,10 +90,23 @@ SWITCH_MODULE_DEFINITION(mod_say_th, mod_say_th_load, NULL, NULL);
 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)
 {
        int in;
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        char digits[11];
        int i;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               say_file("digits/%c.wav", *p);
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1)) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -206,15 +219,6 @@ static switch_status_t th_say_general_count(switch_core_session_t *session,        char
                                }
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-
-                               for (p = tosay; p && *p; p++) {
-                                       say_file("digits/%c.wav", *p);
-                               }
-                       }
-                       break;
                default:
                        break;
                }
index 3f4098d856ae8db051e1bb360c5617a6464228e9..0dc566289a1a1698db9b928f1a91cc1ac8637e97 100644 (file)
@@ -89,10 +89,23 @@ SWITCH_MODULE_DEFINITION(mod_say_zh, mod_say_zh_load, NULL, NULL);
 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)
 {
        int in;
-       char sbuf[13] = "";
+       char sbuf[128] = "";
        char digits[11];
        int i;
 
+       if (say_args->method == SSM_ITERATED) {
+               if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1))) {
+                       char *p;
+                       for (p = tosay; p && *p; p++) {
+                               say_file("digits/%c.wav", *p);
+                       }
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)-1)) || strlen(tosay) > 9) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
                return SWITCH_STATUS_GENERR;
@@ -170,15 +183,6 @@ static switch_status_t zh_say_general_count(switch_core_session_t *session, char
                                }
                        }
                        break;
-               case SSM_ITERATED:
-                       {
-                               char *p;
-
-                               for (p = tosay; p && *p; p++) {
-                                       say_file("digits/%c.wav", *p);
-                               }
-                       }
-                       break;
                default:
                        break;
                }