From 21347757ef3ca2c2b0d082d1b96c4cc84bf1c046 Mon Sep 17 00:00:00 2001
From: "Kevin P. Fleming" <kpfleming@digium.com>
Date: Tue, 17 Jan 2006 05:15:33 +0000
Subject: [PATCH] don't generate any message for native bridge attempts unless
 all the basic checks have passed and we're actually going to try it

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channel.c             | 6 +++---
 channels/chan_misdn.c | 3 +++
 channels/chan_vpb.c   | 3 +++
 channels/chan_zap.c   | 3 +++
 rtp.c                 | 3 +++
 5 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/channel.c b/channel.c
index 928776cdd2..2209483f80 100644
--- a/channel.c
+++ b/channel.c
@@ -3460,8 +3460,6 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
 		    !nativefailed && !c0->monitor && !c1->monitor &&
 		    !c0->spies && !c1->spies) {
 			/* Looks like they share a bridge method and nothing else is in the way */
-			if (option_verbose > 2) 
-				ast_verbose(VERBOSE_PREFIX_3 "Attempting native bridge of %s and %s\n", c0->name, c1->name);
 			ast_set_flag(c0, AST_FLAG_NBRIDGE);
 			ast_set_flag(c1, AST_FLAG_NBRIDGE);
 			if ((res = c0->tech->bridge(c0, c1, config->flags, fo, rc, to)) == AST_BRIDGE_COMPLETE) {
@@ -3493,7 +3491,9 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
 			case AST_BRIDGE_RETRY:
 				continue;
 			default:
-				ast_log(LOG_WARNING, "Private bridge between %s and %s failed\n", c0->name, c1->name);
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3, "Native bridging %s and %s ended\n",
+						    c0->name, c1->name);
 				/* fallthrough */
 			case AST_BRIDGE_FAILED_NOWARN:
 				nativefailed++;
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 9d3b0c0046..0823310bd8 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -2023,6 +2023,9 @@ enum ast_bridge_result  misdn_bridge (struct ast_channel *c0,
 		misdn_lib_bridge(ch1->bc,ch2->bc);
 	}
 	
+	if (option_verbose > 2) 
+		ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+
 	chan_misdn_log(1, ch1->bc->port, "* Makeing Native Bridge between %s and %s\n", ch1->bc->oad, ch2->bc->oad);
   
 	while(1) {
diff --git a/channels/chan_vpb.c b/channels/chan_vpb.c
index f735e3d16e..0c069adce6 100644
--- a/channels/chan_vpb.c
+++ b/channels/chan_vpb.c
@@ -476,6 +476,9 @@ static enum ast_bridge_result vpb_bridge(struct ast_channel *c0, struct ast_chan
 			ast_verbose(VERBOSE_PREFIX_2 "%s: vpb_bridge: Bridging call entered with [%s, %s]\n",p0->dev, c0->name, c1->name);
 	}
 
+	if (option_verbose > 2) 
+		ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+
 	#ifdef HALF_DUPLEX_BRIDGE
 
 	if (option_verbose>1) 
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index f416b19ae3..dbf7ca0daf 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -3207,6 +3207,9 @@ static enum ast_bridge_result zt_bridge(struct ast_channel *c0, struct ast_chann
 		return AST_BRIDGE_FAILED;
 	}
 	
+	if (option_verbose > 2) 
+		ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+
 	if (!(flags & AST_BRIDGE_DTMF_CHANNEL_0) && (oi0 == SUB_REAL))
 		disable_dtmf_detect(op0);
 
diff --git a/rtp.c b/rtp.c
index b88dfacbd3..c933039fe8 100644
--- a/rtp.c
+++ b/rtp.c
@@ -1655,6 +1655,9 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel
 		}
 	}
 
+	if (option_verbose > 2) 
+		ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+
 	/* Ok, we should be able to redirect the media. Start with one channel */
 	if (pr0->set_rtp_peer(c0, p1, vp1, codec1, ast_test_flag(p1, FLAG_NAT_ACTIVE))) 
 		ast_log(LOG_WARNING, "Channel '%s' failed to talk to '%s'\n", c0->name, c1->name);
-- 
GitLab