#endif
if (ast_fileexists(fn, NULL, chan->language) > 0) {
- res = ast_stream_and_wait(chan, fn, chan->language, AST_DIGIT_ANY);
+ res = ast_stream_and_wait(chan, fn, AST_DIGIT_ANY);
ast_stopstream(chan);
/* If Option 'e' was specified, also read the extension number with the name */
if (readext) {
- ast_stream_and_wait(chan, "vm-extension", chan->language, AST_DIGIT_ANY);
+ ast_stream_and_wait(chan, "vm-extension", AST_DIGIT_ANY);
res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
}
} else {
res = ast_say_character_str(chan, S_OR(name, ext), AST_DIGIT_ANY, chan->language);
if (!ast_strlen_zero(name) && readext) {
- ast_stream_and_wait(chan, "vm-extension", chan->language, AST_DIGIT_ANY);
+ ast_stream_and_wait(chan, "vm-extension", AST_DIGIT_ANY);
res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
}
}
for (loop = 3 ; loop > 0; loop--) {
if (!res)
- res = ast_stream_and_wait(chan, "dir-instr", chan->language, AST_DIGIT_ANY);
+ res = ast_stream_and_wait(chan, "dir-instr", AST_DIGIT_ANY);
if (!res)
res = ast_waitfordigit(chan, 3000);
ast_stopstream(chan);
for (;;) {
if (!res)
- res = ast_stream_and_wait(chan, dirintro, chan->language, AST_DIGIT_ANY);
+ res = ast_stream_and_wait(chan, dirintro, AST_DIGIT_ANY);
ast_stopstream(chan);
if (!res)
res = ast_waitfordigit(chan, 5000);
ast_mutex_unlock(&f->lock);
if (targs.followmeflags.flags & FOLLOWMEFLAG_STATUSMSG)
- ast_stream_and_wait(chan, targs.statusprompt, chan->language, "");
+ ast_stream_and_wait(chan, targs.statusprompt, "");
snprintf(namerecloc,sizeof(namerecloc),"%s/followme.%s",ast_config_AST_SPOOL_DIR,chan->uniqueid);
duration = 5;
if (targs.status != 100) {
ast_moh_stop(chan);
if (targs.followmeflags.flags & FOLLOWMEFLAG_UNREACHABLEMSG)
- ast_stream_and_wait(chan, targs.sorryprompt, chan->language, "");
+ ast_stream_and_wait(chan, targs.sorryprompt, "");
res = 0;
} else {
caller = chan;
snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, context, ext);
RETRIEVE(fn, -1);
if (ast_fileexists(fn, NULL, NULL) > 0) {
- res = ast_stream_and_wait(chan, fn, chan->language, ecodes);
+ res = ast_stream_and_wait(chan, fn, ecodes);
if (res) {
DISPOSE(fn, -1);
return res;
} else {
/* Dispose just in case */
DISPOSE(fn, -1);
- res = ast_stream_and_wait(chan, "vm-theperson", chan->language, ecodes);
+ res = ast_stream_and_wait(chan, "vm-theperson", ecodes);
if (res)
return res;
res = ast_say_digit_str(chan, ext, ecodes, chan->language);
if (res)
return res;
}
- res = ast_stream_and_wait(chan, busy ? "vm-isonphone" : "vm-isunavail", chan->language, ecodes);
+ res = ast_stream_and_wait(chan, busy ? "vm-isonphone" : "vm-isunavail", ecodes);
return res;
}
res = 0;
}
if (!res && !ast_test_flag(options, OPT_SILENT)) {
- res = ast_stream_and_wait(chan, INTRO, chan->language, ecodes);
+ res = ast_stream_and_wait(chan, INTRO, ecodes);
if (res == '#') {
ast_set_flag(options, OPT_SILENT);
res = 0;
/* Now play the beep once we have the message number for our next message. */
if (res >= 0) {
/* Unless we're *really* silent, try to send the beep */
- res = ast_stream_and_wait(chan, "beep", chan->language, "");
+ res = ast_stream_and_wait(chan, "beep", "");
}
/* Store information */
static int wait_file2(struct ast_channel *chan, struct vm_state *vms, char *file)
{
int res;
- if ((res = ast_stream_and_wait(chan, file, chan->language, AST_DIGIT_ANY)) < 0)
+ if ((res = ast_stream_and_wait(chan, file, AST_DIGIT_ANY)) < 0)
ast_log(LOG_WARNING, "Unable to play message %s\n", file);
return res;
}
ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
if (!callback)
res = wait_file2(chan, vms, "vm-from");
- res = ast_stream_and_wait(chan, prefile, chan->language, "");
+ res = ast_stream_and_wait(chan, prefile, "");
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
/* Otherwise 1 is to save the existing message */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Saving message as is\n");
- ast_stream_and_wait(chan, "vm-msgsaved", chan->language, "");
+ ast_stream_and_wait(chan, "vm-msgsaved", "");
cmd = 't';
return res;
}
/* Review */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Reviewing the message\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;
* 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);
/*! Stops a stream */
/*!
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;
}
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);
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;
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;
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;
}
}
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);
* 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);
}
if (!ast_strlen_zero(courtesytone)) {
if (ast_autoservice_start(callee_chan))
return -1;
- if (ast_stream_and_wait(caller_chan, courtesytone, caller_chan->language, "")) {
+ if (ast_stream_and_wait(caller_chan, courtesytone, "")) {
ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
ast_autoservice_stop(callee_chan);
return -1;
memset(xferto, 0, sizeof(xferto));
/* Transfer */
- res = ast_stream_and_wait(transferer, "pbx-transfer", transferer->language, AST_DIGIT_ANY);
+ res = ast_stream_and_wait(transferer, "pbx-transfer", AST_DIGIT_ANY);
if (res < 0) {
finishup(transferee);
return -1; /* error ? */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Unable to find extension '%s' in context '%s'\n", xferto, transferer_real_context);
}
- if (ast_stream_and_wait(transferer, xferfailsound, transferer->language, AST_DIGIT_ANY) < 0 ) {
+ if (ast_stream_and_wait(transferer, xferfailsound, AST_DIGIT_ANY) < 0 ) {
finishup(transferee);
return -1;
}
ast_indicate(transferee, AST_CONTROL_HOLD);
/* Transfer */
- res = ast_stream_and_wait(transferer, "pbx-transfer", transferer->language, AST_DIGIT_ANY);
+ res = ast_stream_and_wait(transferer, "pbx-transfer", AST_DIGIT_ANY);
if (res < 0) {
finishup(transferee);
return res;
if (res == 0) {
ast_log(LOG_WARNING, "Did not read data.\n");
finishup(transferee);
- if (ast_stream_and_wait(transferer, "beeperr", transferer->language, ""))
+ if (ast_stream_and_wait(transferer, "beeperr", ""))
return -1;
return FEATURE_RETURN_SUCCESS;
}
if (!ast_exists_extension(transferer, transferer_real_context, xferto, 1, transferer->cid.cid_num)) {
ast_log(LOG_WARNING, "Extension %s does not exist in context %s\n",xferto,transferer_real_context);
finishup(transferee);
- if (ast_stream_and_wait(transferer, "beeperr", transferer->language, ""))
+ if (ast_stream_and_wait(transferer, "beeperr", ""))
return -1;
return FEATURE_RETURN_SUCCESS;
}
finishup(transferee);
/* any reason besides user requested cancel and busy triggers the failed sound */
if (outstate != AST_CONTROL_UNHOLD && outstate != AST_CONTROL_BUSY &&
- ast_stream_and_wait(transferer, xferfailsound, transferer->language, ""))
+ ast_stream_and_wait(transferer, xferfailsound, ""))
return -1;
return FEATURE_RETURN_SUCCESS;
}
res = ast_bridge_call(transferer, newchan, &bconfig);
if (newchan->_softhangup || newchan->_state != AST_STATE_UP || !transferer->_softhangup) {
ast_hangup(newchan);
- if (ast_stream_and_wait(transferer, xfersound, transferer->language, ""))
+ if (ast_stream_and_wait(transferer, xfersound, ""))
ast_log(LOG_WARNING, "Failed to play transfer sound!\n");
finishup(transferee);
transferer->_softhangup = 0;
tobj->peer = newchan;
tobj->bconfig = *config;
- if (ast_stream_and_wait(newchan, xfersound, newchan->language, ""))
+ if (ast_stream_and_wait(newchan, xfersound, ""))
ast_log(LOG_WARNING, "Failed to play transfer sound!\n");
ast_bridge_call_thread_launch(tobj);
return -1; /* XXX meaning the channel is bridged ? */
int error = 0;
ast_indicate(peer, AST_CONTROL_UNHOLD);
if (parkedplay == 0) {
- error = ast_stream_and_wait(chan, courtesytone, chan->language, "");
+ error = ast_stream_and_wait(chan, courtesytone, "");
} else if (parkedplay == 1) {
- error = ast_stream_and_wait(peer, courtesytone, chan->language, "");
+ error = ast_stream_and_wait(peer, courtesytone, "");
} else if (parkedplay == 2) {
if (!ast_streamfile(chan, courtesytone, chan->language) &&
!ast_streamfile(peer, courtesytone, chan->language)) {
return res;
} else {
/*! \todo XXX Play a message XXX */
- if (ast_stream_and_wait(chan, "pbx-invalidpark", chan->language, ""))
+ if (ast_stream_and_wait(chan, "pbx-invalidpark", ""))
ast_log(LOG_WARNING, "ast_streamfile of %s failed on %s\n", "pbx-invalidpark", chan->name);
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Channel %s tried to talk to nonexistent parked call %d\n", chan->name, park);