mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
This update fulfils the request of bug 7109, which claimed the language arg to ast_stream_and_wait() was redundant. Almost all calls just used chan->language, and seeing how chan is the first argument, this certainly seems redundant. A change of language could just as easily be done by simply changing the channel language before calling.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
14
main/app.c
14
main/app.c
@@ -541,7 +541,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
|
||||
if (!beep)
|
||||
d = ast_play_and_wait(chan, playfile);
|
||||
if (d > -1)
|
||||
d = ast_stream_and_wait(chan, "beep", chan->language, "");
|
||||
d = ast_stream_and_wait(chan, "beep", "");
|
||||
if (d < 0)
|
||||
return -1;
|
||||
}
|
||||
@@ -757,7 +757,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
|
||||
ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
|
||||
}
|
||||
if (outmsg == 2) {
|
||||
ast_stream_and_wait(chan, "auth-thankyou", chan->language, "");
|
||||
ast_stream_and_wait(chan, "auth-thankyou", "");
|
||||
}
|
||||
if (sildet)
|
||||
ast_dsp_free(sildet);
|
||||
@@ -1015,14 +1015,14 @@ int ast_record_review(struct ast_channel *chan, const char *playfile, const char
|
||||
cmd = '3';
|
||||
break;
|
||||
} else {
|
||||
ast_stream_and_wait(chan, "vm-msgsaved", chan->language, "");
|
||||
ast_stream_and_wait(chan, "vm-msgsaved", "");
|
||||
cmd = 't';
|
||||
return res;
|
||||
}
|
||||
case '2':
|
||||
/* Review */
|
||||
ast_verbose(VERBOSE_PREFIX_3 "Reviewing the recording\n");
|
||||
cmd = ast_stream_and_wait(chan, recordfile, chan->language, AST_DIGIT_ANY);
|
||||
cmd = ast_stream_and_wait(chan, recordfile, AST_DIGIT_ANY);
|
||||
break;
|
||||
case '3':
|
||||
message_exists = 0;
|
||||
@@ -1109,14 +1109,14 @@ static int ivr_dispatch(struct ast_channel *chan, struct ast_ivr_option *option,
|
||||
case AST_ACTION_NOOP:
|
||||
return 0;
|
||||
case AST_ACTION_BACKGROUND:
|
||||
res = ast_stream_and_wait(chan, (char *)option->adata, chan->language, AST_DIGIT_ANY);
|
||||
res = ast_stream_and_wait(chan, (char *)option->adata, AST_DIGIT_ANY);
|
||||
if (res < 0) {
|
||||
ast_log(LOG_NOTICE, "Unable to find file '%s'!\n", (char *)option->adata);
|
||||
res = 0;
|
||||
}
|
||||
return res;
|
||||
case AST_ACTION_PLAYBACK:
|
||||
res = ast_stream_and_wait(chan, (char *)option->adata, chan->language, "");
|
||||
res = ast_stream_and_wait(chan, (char *)option->adata, "");
|
||||
if (res < 0) {
|
||||
ast_log(LOG_NOTICE, "Unable to find file '%s'!\n", (char *)option->adata);
|
||||
res = 0;
|
||||
@@ -1145,7 +1145,7 @@ static int ivr_dispatch(struct ast_channel *chan, struct ast_ivr_option *option,
|
||||
res = 0;
|
||||
c = ast_strdupa(option->adata);
|
||||
while ((n = strsep(&c, ";"))) {
|
||||
if ((res = ast_stream_and_wait(chan, n, chan->language,
|
||||
if ((res = ast_stream_and_wait(chan, n,
|
||||
(option->action == AST_ACTION_BACKLIST) ? AST_DIGIT_ANY : "")))
|
||||
break;
|
||||
}
|
||||
|
@@ -3599,17 +3599,17 @@ static void bridge_playfile(struct ast_channel *chan, struct ast_channel *peer,
|
||||
}
|
||||
|
||||
if (!strcmp(sound,"timeleft")) { /* Queue support */
|
||||
ast_stream_and_wait(chan, "vm-youhave", chan->language, "");
|
||||
ast_stream_and_wait(chan, "vm-youhave", "");
|
||||
if (min) {
|
||||
ast_say_number(chan, min, AST_DIGIT_ANY, chan->language, NULL);
|
||||
ast_stream_and_wait(chan, "queue-minutes", chan->language, "");
|
||||
ast_stream_and_wait(chan, "queue-minutes", "");
|
||||
}
|
||||
if (sec) {
|
||||
ast_say_number(chan, sec, AST_DIGIT_ANY, chan->language, NULL);
|
||||
ast_stream_and_wait(chan, "queue-seconds", chan->language, "");
|
||||
ast_stream_and_wait(chan, "queue-seconds", "");
|
||||
}
|
||||
} else {
|
||||
ast_stream_and_wait(chan, sound, chan->language, "");
|
||||
ast_stream_and_wait(chan, sound, "");
|
||||
}
|
||||
|
||||
ast_autoservice_stop(peer);
|
||||
|
@@ -1118,12 +1118,11 @@ int ast_waitstream_exten(struct ast_channel *c, const char *context)
|
||||
* Return 0 if success, -1 if error, digit if interrupted by a digit.
|
||||
* If digits == "" then we can simply check for non-zero.
|
||||
*/
|
||||
int ast_stream_and_wait(struct ast_channel *chan, const char *file,
|
||||
const char *language, const char *digits)
|
||||
int ast_stream_and_wait(struct ast_channel *chan, const char *file, const char *digits)
|
||||
{
|
||||
int res = 0;
|
||||
if (!ast_strlen_zero(file)) {
|
||||
res = ast_streamfile(chan, file, language);
|
||||
res = ast_streamfile(chan, file, chan->language);
|
||||
if (!res)
|
||||
res = ast_waitstream(chan, digits);
|
||||
}
|
||||
|
Reference in New Issue
Block a user