aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-19 21:21:56 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-19 21:21:56 +0000
commit674601fe125b7d809f2773b1f52e95e8c1381904 (patch)
treed5629ec6f49837f6bc3deb6e8ab4f16530b465df
parentc152699c833119c8ee48a7d91ad1dec5ddb0b813 (diff)
DTMF transfer plays the wrong sounds for wrong number or other call failure.
* Set the default for features.conf.sample xferfailsound option to "beeperr" as documented instead of "pbx-invalid" and corrected the use of it in DTMF blind transfer (#1). * Improved DTMF blind transfer handling of wrong numbers. Most of the concerns in this issue were taken care of by the patch for issue 17999: Issues with DTMF triggered attended transfers. (closes issue #18379) Reported by: gincantalupo Tested by: rmudgett git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@302671 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_features.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/res/res_features.c b/res/res_features.c
index e62339405..54744be51 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -979,15 +979,27 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
ast_stopstream(transferer);
res = ast_app_dtget(transferer, transferer_real_context, xferto, sizeof(xferto), 100, transferdigittimeout);
- if (res < 0) { /* hangup, would be 0 for invalid and 1 for valid */
+ if (res < 0) { /* hangup or error, (would be 0 for invalid and 1 for valid) */
finishup(transferee);
- return res;
+ return -1;
}
+ if (res == 0) {
+ if (xferto[0]) {
+ ast_log(LOG_WARNING, "Extension '%s' does not exist in context '%s'\n",
+ xferto, transferer_real_context);
+ } else {
+ /* Does anyone care about this case? */
+ ast_log(LOG_WARNING, "No digits dialed.\n");
+ }
+ ast_stream_and_wait(transferer, "pbx-invalid", transferer->language, "");
+ finishup(transferee);
+ return FEATURE_RETURN_SUCCESS;
+ }
+
if (!strcmp(xferto, ast_parking_ext())) {
res = finishup(transferee);
- if (res)
- res = -1;
- else if (!(parkstatus = masq_park_call_announce(transferee, transferer, 0, NULL, orig_chan_name))) { /* success */
+ if (res) {
+ } else if (!(parkstatus = masq_park_call_announce(transferee, transferer, 0, NULL, orig_chan_name))) { /* success */
/* We return non-zero, but tell the PBX not to hang the channel when
the thread dies -- We have to be careful now though. We are responsible for
hanging up the channel, else it will never be hung up! */
@@ -995,8 +1007,8 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
} else {
ast_log(LOG_WARNING, "Unable to park call %s, parkstatus=%d\n", transferee->name, parkstatus);
}
- /*! \todo XXX Maybe we should have another message here instead of invalid extension XXX */
- } else if (ast_exists_extension(transferee, transferer_real_context, xferto, 1, transferer->cid.cid_num)) {
+ ast_autoservice_start(transferee);
+ } else {
pbx_builtin_setvar_helper(transferer, "BLINDTRANSFER", transferee->name);
pbx_builtin_setvar_helper(transferee, "BLINDTRANSFER", transferer->name);
res=finishup(transferee);
@@ -1028,11 +1040,9 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
}
check_goto_on_transfer(transferer);
return res;
- } else {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Unable to find extension '%s' in context '%s'\n", xferto, transferer_real_context);
}
- if (parkstatus != FEATURE_RETURN_PARKFAILED && ast_stream_and_wait(transferer, xferfailsound, transferer->language, AST_DIGIT_ANY) < 0 ) {
+ if (parkstatus != FEATURE_RETURN_PARKFAILED
+ && ast_stream_and_wait(transferer, xferfailsound, transferer->language, "")) {
finishup(transferee);
return -1;
}
@@ -3342,7 +3352,7 @@ static int load_config(void)
strcpy(parkmohclass, "default");
courtesytone[0] = '\0';
strcpy(xfersound, "beep");
- strcpy(xferfailsound, "pbx-invalid");
+ strcpy(xferfailsound, "beeperr");
parking_start = 701;
parking_stop = 750;
parkfindnext = 0;