Change logging for p2p rtp bridge mode

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Olle Johansson
2006-11-29 19:44:06 +00:00
parent f51cf94a62
commit 2bee4aba4d

View File

@@ -2990,8 +2990,8 @@ static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast
if ((c0->tech_pvt != pvt0) || if ((c0->tech_pvt != pvt0) ||
(c1->tech_pvt != pvt1) || (c1->tech_pvt != pvt1) ||
(c0->masq || c0->masqr || c1->masq || c1->masqr)) { (c0->masq || c0->masqr || c1->masq || c1->masqr)) {
if (option_debug) if (option_debug > 2)
ast_log(LOG_DEBUG, "Oooh, something is weird, backing out\n"); ast_log(LOG_DEBUG, "p2p-rtp-bridge: Oooh, something is weird, backing out\n");
res = AST_BRIDGE_RETRY; res = AST_BRIDGE_RETRY;
break; break;
} }
@@ -3001,8 +3001,8 @@ static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast
res = AST_BRIDGE_RETRY; res = AST_BRIDGE_RETRY;
break; break;
} }
if (option_debug) if (option_debug > 2)
ast_log(LOG_NOTICE, "Ooh, empty read...\n"); ast_log(LOG_NOTICE, "p2p-rtp-bridge: Ooh, empty read...\n");
if (ast_check_hangup(c0) || ast_check_hangup(c1)) if (ast_check_hangup(c0) || ast_check_hangup(c1))
break; break;
continue; continue;
@@ -3010,15 +3010,15 @@ static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast
/* Read in frame from channel */ /* Read in frame from channel */
fr = ast_read(who); fr = ast_read(who);
other = (who == c0) ? c1 : c0; other = (who == c0) ? c1 : c0;
/* Dependong on the frame we may need to break out of our bridge */ /* Depending on the frame we may need to break out of our bridge */
if (!fr || ((fr->frametype == AST_FRAME_DTMF) && if (!fr || ((fr->frametype == AST_FRAME_DTMF) &&
((who == c0) && (flags & AST_BRIDGE_DTMF_CHANNEL_0)) | ((who == c0) && (flags & AST_BRIDGE_DTMF_CHANNEL_0)) |
((who == c1) && (flags & AST_BRIDGE_DTMF_CHANNEL_1)))) { ((who == c1) && (flags & AST_BRIDGE_DTMF_CHANNEL_1)))) {
/* Record received frame and who */ /* Record received frame and who */
*fo = fr; *fo = fr;
*rc = who; *rc = who;
if (option_debug) if (option_debug > 2)
ast_log(LOG_DEBUG, "Oooh, got a %s\n", fr ? "digit" : "hangup"); ast_log(LOG_DEBUG, "p2p-rtp-bridge: Ooh, got a %s\n", fr ? "digit" : "hangup");
res = AST_BRIDGE_COMPLETE; res = AST_BRIDGE_COMPLETE;
break; break;
} else if ((fr->frametype == AST_FRAME_CONTROL) && !(flags & AST_BRIDGE_IGNORE_SIGS)) { } else if ((fr->frametype == AST_FRAME_CONTROL) && !(flags & AST_BRIDGE_IGNORE_SIGS)) {
@@ -3047,8 +3047,8 @@ static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast
} else { } else {
*fo = fr; *fo = fr;
*rc = who; *rc = who;
if (option_debug) if (option_debug > 2)
ast_log(LOG_DEBUG, "Got a FRAME_CONTROL (%d) frame on channel %s\n", fr->subclass, who->name); ast_log(LOG_DEBUG, "p2p-rtp-bridge: Got a FRAME_CONTROL (%d) frame on channel %s\n", fr->subclass, who->name);
res = AST_BRIDGE_COMPLETE; res = AST_BRIDGE_COMPLETE;
break; break;
} }
@@ -3156,7 +3156,7 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel
codec1 = pr1->get_codec ? pr1->get_codec(c1) : 0; codec1 = pr1->get_codec ? pr1->get_codec(c1) : 0;
if (codec0 && codec1 && !(codec0 & codec1)) { if (codec0 && codec1 && !(codec0 & codec1)) {
/* Hey, we can't do native bridging if both parties speak different codecs */ /* Hey, we can't do native bridging if both parties speak different codecs */
if (option_debug) if (option_debug > 2)
ast_log(LOG_DEBUG, "Channel codec0 = %d is not codec1 = %d, cannot native bridge in RTP.\n", codec0, codec1); ast_log(LOG_DEBUG, "Channel codec0 = %d is not codec1 = %d, cannot native bridge in RTP.\n", codec0, codec1);
ast_channel_unlock(c0); ast_channel_unlock(c0);
ast_channel_unlock(c1); ast_channel_unlock(c1);