[asterisk-commits] jpeeler: branch jpeeler/bug13494 r171439 - /team/jpeeler/bug13494/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 26 12:21:29 CST 2009


Author: jpeeler
Date: Mon Jan 26 12:21:28 2009
New Revision: 171439

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=171439
Log:
Make blind transfer and one touch parking give the same feedback (beeperr) when an attempted park fails.


Modified:
    team/jpeeler/bug13494/res/res_features.c

Modified: team/jpeeler/bug13494/res/res_features.c
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug13494/res/res_features.c?view=diff&rev=171439&r1=171438&r2=171439
==============================================================================
--- team/jpeeler/bug13494/res/res_features.c (original)
+++ team/jpeeler/bug13494/res/res_features.c Mon Jan 26 12:21:28 2009
@@ -514,8 +514,10 @@
 	int x;
 	int park_status;
 
-	if ((x = park_slot_reserve(rchan)) < 0)
+	if ((x = park_slot_reserve(rchan)) < 0) {
+		ast_stream_and_wait(peer, "beeperr", peer->language, "");
 		return FEATURE_RETURN_PARKFAILED;
+	}
 
 	/* Make a new, fake channel that we'll use to masquerade in the real one */
 	if (!(chan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, rchan->accountcode, rchan->exten, rchan->context, rchan->amaflags, "Parked/%s",rchan->name))) {
@@ -737,6 +739,7 @@
 	char xferto[256];
 	int res;
 	const char *orig_chan_name;
+	int parkstatus = 0;
 
 	set_peers(&transferer, &transferee, peer, chan, sense);
 	orig_chan_name = ast_strdupa(transferer->name);
@@ -766,13 +769,13 @@
 		res = finishup(transferee);
 		if (res)
 			res = -1;
-		else if (!masq_park_call_announce(transferee, transferer, 0, NULL, orig_chan_name)) {	/* success */
+		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! */
 			return 0;
 		} else {
-			ast_log(LOG_WARNING, "Unable to park call %s\n", transferee->name);
+			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)) {
@@ -808,7 +811,7 @@
 		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 (parkstatus != FEATURE_RETURN_PARKFAILED && ast_stream_and_wait(transferer, xferfailsound, transferer->language, AST_DIGIT_ANY) < 0 ) {
 		finishup(transferee);
 		return -1;
 	}




More information about the asterisk-commits mailing list