[asterisk-commits] rmudgett: trunk r387182 - /trunk/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 1 15:00:55 CDT 2013


Author: rmudgett
Date: Wed May  1 15:00:53 2013
New Revision: 387182

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387182
Log:
Remove some unnecessary calls to ast_bridged_channel() in chan_iax2.c

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=387182&r1=387181&r2=387182
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Wed May  1 15:00:53 2013
@@ -10426,21 +10426,21 @@
 
 					ast_set_flag64(iaxs[fr->callno], IAX_QUELCH);
 					if (ies.musiconhold) {
+						const char *moh_suggest;
+
 						iax2_lock_owner(fr->callno);
 						if (!iaxs[fr->callno] || !iaxs[fr->callno]->owner) {
 							break;
 						}
-						if (ast_bridged_channel(iaxs[fr->callno]->owner)) {
-							const char *moh_suggest = iaxs[fr->callno]->mohsuggest;
-
-							/*
-							 * We already hold the owner lock so we do not
-							 * need to check iaxs[fr->callno] after it returns.
-							 */
-							iax2_queue_control_data(fr->callno, AST_CONTROL_HOLD, 
-								S_OR(moh_suggest, NULL),
-								!ast_strlen_zero(moh_suggest) ? strlen(moh_suggest) + 1 : 0);
-						}
+
+						/*
+						 * We already hold the owner lock so we do not
+						 * need to check iaxs[fr->callno] after it returns.
+						 */
+						moh_suggest = iaxs[fr->callno]->mohsuggest;
+						iax2_queue_control_data(fr->callno, AST_CONTROL_HOLD,
+							S_OR(moh_suggest, NULL),
+							!ast_strlen_zero(moh_suggest) ? strlen(moh_suggest) + 1 : 0);
 						ast_channel_unlock(iaxs[fr->callno]->owner);
 					}
 				}
@@ -10465,13 +10465,12 @@
 					if (!iaxs[fr->callno]->owner) {
 						break;
 					}
-					if (ast_bridged_channel(iaxs[fr->callno]->owner)) {
-						/*
-						 * We already hold the owner lock so we do not
-						 * need to check iaxs[fr->callno] after it returns.
-						 */
-						iax2_queue_control_data(fr->callno, AST_CONTROL_UNHOLD, NULL, 0);
-					}
+
+					/*
+					 * We already hold the owner lock so we do not
+					 * need to check iaxs[fr->callno] after it returns.
+					 */
+					iax2_queue_control_data(fr->callno, AST_CONTROL_UNHOLD, NULL, 0);
 					ast_channel_unlock(iaxs[fr->callno]->owner);
 				}
 				break;




More information about the asterisk-commits mailing list