aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-19 21:29:22 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-19 21:29:22 +0000
commit28edaee8ae5be28a7713bf670e86eeb341f250ad (patch)
tree317fcbc15578b66353ced43f9cd37b79746019be /main
parent65b166c48275485212cdd9b01ef7b319d1d4a233 (diff)
Merged revisions 302693 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r302693 | rmudgett | 2011-01-19 15:25:41 -0600 (Wed, 19 Jan 2011) | 22 lines Merged revisions 302671 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r302671 | rmudgett | 2011-01-19 15:21:56 -0600 (Wed, 19 Jan 2011) | 15 lines 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.8@302713 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/features.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/main/features.c b/main/features.c
index 3c7b50734..7bd01d43e 100644
--- a/main/features.c
+++ b/main/features.c
@@ -1872,9 +1872,21 @@ 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", "");
+ finishup(transferee);
+ return AST_FEATURE_RETURN_SUCCESS;
}
found_lot = ao2_callback(parkinglots, 0, find_parkinglot_by_exten_cb, &xferto);
@@ -1883,9 +1895,8 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
.parkinglot = found_lot,
};
res = finishup(transferee);
- if (res)
- res = -1;
- else if (!(parkstatus = masq_park_call_announce(transferee, transferer, &args))) { /* success */
+ if (res) {
+ } else if (!(parkstatus = masq_park_call_announce(transferee, transferer, &args))) { /* 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! */
@@ -1894,9 +1905,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,
- S_COR(transferer->caller.id.number.valid, transferer->caller.id.number.str, NULL))) {
+ ast_autoservice_start(transferee);
+ } else {
ast_cel_report_event(transferer, AST_CEL_BLINDTRANSFER, NULL, xferto, transferee);
pbx_builtin_setvar_helper(transferer, "BLINDTRANSFER", transferee->name);
pbx_builtin_setvar_helper(transferee, "BLINDTRANSFER", transferer->name);
@@ -1937,10 +1947,9 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
}
check_goto_on_transfer(transferer);
return res;
- } else {
- ast_verb(3, "Unable to find extension '%s' in context '%s'\n", xferto, transferer_real_context);
}
- if (parkstatus != AST_FEATURE_RETURN_PARKFAILED && ast_stream_and_wait(transferer, xferfailsound, AST_DIGIT_ANY) < 0) { /* Play 'extension does not exist' */
+ if (parkstatus != AST_FEATURE_RETURN_PARKFAILED
+ && ast_stream_and_wait(transferer, xferfailsound, "")) {
finishup(transferee);
return -1;
}
@@ -4782,7 +4791,7 @@ static int load_config(void)
strcpy(pickup_ext, "*8");
courtesytone[0] = '\0';
strcpy(xfersound, "beep");
- strcpy(xferfailsound, "pbx-invalid");
+ strcpy(xferfailsound, "beeperr");
pickupsound[0] = '\0';
pickupfailsound[0] = '\0';
adsipark = 0;