fix paramater checking on switch_ivr_phrase_macro and it's consumers.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4187 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2007-02-09 22:55:48 +00:00
parent d41b3e14dc
commit 712976653d
3 changed files with 18 additions and 3 deletions

View File

@@ -4617,6 +4617,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
if (!macro_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No phrase macro specified.\n");
return status;
}
if (!lang) {
lang = "en";
}
if (!data) {
data = "";
}
switch_url_encode(data, enc_hint, sizeof(enc_hint));
snprintf(hint_data, sizeof(hint_data), "macro_name=%s&lang=%s&data=%s", macro_name, lang, enc_hint);