diff --git a/src/mod/say/mod_say_de/mod_say_de.c b/src/mod/say/mod_say_de/mod_say_de.c index fec6ddb680..7212a5f581 100644 --- a/src/mod/say/mod_say_de/mod_say_de.c +++ b/src/mod/say/mod_say_de/mod_say_de.c @@ -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; } diff --git a/src/mod/say/mod_say_es/mod_say_es.c b/src/mod/say/mod_say_es/mod_say_es.c index 0576e16c6c..91675aa872 100644 --- a/src/mod/say/mod_say_es/mod_say_es.c +++ b/src/mod/say/mod_say_es/mod_say_es.c @@ -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; } diff --git a/src/mod/say/mod_say_fr/mod_say_fr.c b/src/mod/say/mod_say_fr/mod_say_fr.c index 5ddd8fb58e..37e126ecb2 100644 --- a/src/mod/say/mod_say_fr/mod_say_fr.c +++ b/src/mod/say/mod_say_fr/mod_say_fr.c @@ -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; } diff --git a/src/mod/say/mod_say_hr/mod_say_hr.c b/src/mod/say/mod_say_hr/mod_say_hr.c index 4c560db80a..f08a0de0a2 100644 --- a/src/mod/say/mod_say_hr/mod_say_hr.c +++ b/src/mod/say/mod_say_hr/mod_say_hr.c @@ -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; } diff --git a/src/mod/say/mod_say_hu/mod_say_hu.c b/src/mod/say/mod_say_hu/mod_say_hu.c index ca1b90f584..847d6f811d 100644 --- a/src/mod/say/mod_say_hu/mod_say_hu.c +++ b/src/mod/say/mod_say_hu/mod_say_hu.c @@ -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; } diff --git a/src/mod/say/mod_say_it/mod_say_it.c b/src/mod/say/mod_say_it/mod_say_it.c index e3d5131ed1..ef4b3d2bda 100644 --- a/src/mod/say/mod_say_it/mod_say_it.c +++ b/src/mod/say/mod_say_it/mod_say_it.c @@ -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; } diff --git a/src/mod/say/mod_say_ja/mod_say_ja.c b/src/mod/say/mod_say_ja/mod_say_ja.c index f493d8974a..aa11a87ebf 100644 --- a/src/mod/say/mod_say_ja/mod_say_ja.c +++ b/src/mod/say/mod_say_ja/mod_say_ja.c @@ -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; } diff --git a/src/mod/say/mod_say_nl/mod_say_nl.c b/src/mod/say/mod_say_nl/mod_say_nl.c index 116c20ec91..e1e822b2f6 100644 --- a/src/mod/say/mod_say_nl/mod_say_nl.c +++ b/src/mod/say/mod_say_nl/mod_say_nl.c @@ -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; } diff --git a/src/mod/say/mod_say_ru/mod_say_ru.c b/src/mod/say/mod_say_ru/mod_say_ru.c index 771f997f8a..9c8db5732e 100644 --- a/src/mod/say/mod_say_ru/mod_say_ru.c +++ b/src/mod/say/mod_say_ru/mod_say_ru.c @@ -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; diff --git a/src/mod/say/mod_say_th/mod_say_th.c b/src/mod/say/mod_say_th/mod_say_th.c index f61cdbce82..675c1a44e6 100644 --- a/src/mod/say/mod_say_th/mod_say_th.c +++ b/src/mod/say/mod_say_th/mod_say_th.c @@ -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; } diff --git a/src/mod/say/mod_say_zh/mod_say_zh.c b/src/mod/say/mod_say_zh/mod_say_zh.c index 3f4098d856..0dc566289a 100644 --- a/src/mod/say/mod_say_zh/mod_say_zh.c +++ b/src/mod/say/mod_say_zh/mod_say_zh.c @@ -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; }