mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 09:12:25 +00:00
check for say errors in say_money functions
This commit is contained in:
parent
2459e710f7
commit
02f6269cf1
@ -401,6 +401,7 @@ static switch_status_t fr_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
||||||
char *dollars = NULL;
|
char *dollars = NULL;
|
||||||
char *cents = NULL;
|
char *cents = NULL;
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
||||||
@ -428,7 +429,9 @@ static switch_status_t fr_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Say dollar amount */
|
/* Say dollar amount */
|
||||||
fr_say_general_count(session, dollars, say_args, args);
|
if (( status = fr_say_general_count(session, dollars, say_args, args)) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
if (atoi(dollars) == 1) {
|
if (atoi(dollars) == 1) {
|
||||||
say_file("currency/dollar.wav");
|
say_file("currency/dollar.wav");
|
||||||
} else {
|
} else {
|
||||||
@ -440,7 +443,9 @@ static switch_status_t fr_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
|
|
||||||
/* Say cents */
|
/* Say cents */
|
||||||
if (cents) {
|
if (cents) {
|
||||||
fr_say_general_count(session, cents, say_args, args);
|
if (( status = fr_say_general_count(session, cents, say_args, args)) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
if (atoi(cents) == 1) {
|
if (atoi(cents) == 1) {
|
||||||
say_file("currency/cent.wav");
|
say_file("currency/cent.wav");
|
||||||
} else {
|
} else {
|
||||||
|
@ -357,6 +357,7 @@ static switch_status_t hu_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
{
|
{
|
||||||
char sbuf[16] = "";
|
char sbuf[16] = "";
|
||||||
char *forint;
|
char *forint;
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
||||||
@ -374,7 +375,9 @@ static switch_status_t hu_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
forint++;
|
forint++;
|
||||||
}
|
}
|
||||||
|
|
||||||
hu_say_general_count(session, forint, say_args, args);
|
if (( status = hu_say_general_count(session, forint, say_args, args)) != SWITCH_STATUS_SUCCESS ) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
say_file("currency/forint.wav");
|
say_file("currency/forint.wav");
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -440,6 +440,7 @@ static switch_status_t it_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
||||||
char *dollars = NULL;
|
char *dollars = NULL;
|
||||||
char *cents = NULL;
|
char *cents = NULL;
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
||||||
@ -467,7 +468,10 @@ static switch_status_t it_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Say dollar amount */
|
/* Say dollar amount */
|
||||||
it_say_general_count(session, dollars, say_args, args);
|
if (( status = it_say_general_count(session, dollars, say_args, args) ) != SWITCH_STATUS_SUCCESS ) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (atoi(dollars) == 1) {
|
if (atoi(dollars) == 1) {
|
||||||
say_file("currency/dollar.wav");
|
say_file("currency/dollar.wav");
|
||||||
} else {
|
} else {
|
||||||
@ -479,7 +483,9 @@ static switch_status_t it_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
|
|
||||||
/* Say cents */
|
/* Say cents */
|
||||||
if (cents) {
|
if (cents) {
|
||||||
it_say_general_count(session, cents, say_args, args);
|
if (( status = it_say_general_count(session, cents, say_args, args) ) != SWITCH_STATUS_SUCCESS ) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
if (atoi(cents) == 1) {
|
if (atoi(cents) == 1) {
|
||||||
say_file("currency/cent.wav");
|
say_file("currency/cent.wav");
|
||||||
} else {
|
} else {
|
||||||
|
@ -321,6 +321,7 @@ static switch_status_t nl_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
||||||
char *dollars = NULL;
|
char *dollars = NULL;
|
||||||
char *cents = NULL;
|
char *cents = NULL;
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
||||||
@ -348,7 +349,10 @@ static switch_status_t nl_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Say dollar amount */
|
/* Say dollar amount */
|
||||||
nl_say_general_count(session, dollars, say_args, args);
|
if (( status = nl_say_general_count(session, dollars, say_args, args)) != SWITCH_STATUS_SUCCESS ) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (atoi(dollars) == 1) {
|
if (atoi(dollars) == 1) {
|
||||||
say_file("currency/dollar.wav");
|
say_file("currency/dollar.wav");
|
||||||
} else {
|
} else {
|
||||||
@ -360,7 +364,9 @@ static switch_status_t nl_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
|
|
||||||
/* Say cents */
|
/* Say cents */
|
||||||
if (cents) {
|
if (cents) {
|
||||||
nl_say_general_count(session, cents, say_args, args);
|
if (( status = nl_say_general_count(session, cents, say_args, args)) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
if (atoi(cents) == 1) {
|
if (atoi(cents) == 1) {
|
||||||
say_file("currency/cent.wav");
|
say_file("currency/cent.wav");
|
||||||
} else {
|
} else {
|
||||||
|
@ -423,6 +423,7 @@ static switch_status_t th_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
||||||
char *dollars = NULL;
|
char *dollars = NULL;
|
||||||
char *cents = NULL;
|
char *cents = NULL;
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
||||||
@ -450,12 +451,17 @@ static switch_status_t th_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Say dollar amount */
|
/* Say dollar amount */
|
||||||
th_say_general_count(session, dollars, say_args, args);
|
if (( status = th_say_general_count(session, dollars, say_args, args)) != SWITCH_STATUS_SUCCESS ) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
say_file("currency/dollar.wav");
|
say_file("currency/dollar.wav");
|
||||||
|
|
||||||
/* Say cents */
|
/* Say cents */
|
||||||
if (cents) {
|
if (cents) {
|
||||||
th_say_general_count(session, cents, say_args, args);
|
if (( status = th_say_general_count(session, cents, say_args, args)) != SWITCH_STATUS_SUCCESS ) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
say_file("digits/0.wav");
|
say_file("digits/0.wav");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user