[asterisk-commits] russell: branch 1.4 r78063 - /branches/1.4/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 3 12:01:07 CDT 2007


Author: russell
Date: Fri Aug  3 12:01:07 2007
New Revision: 78063

URL: http://svn.digium.com/view/asterisk?view=rev&rev=78063
Log:
Only pass through HOLD and UNHOLD control frames when the mohinterpret option
is set to "passthrough".  This was pointed out by Kevin in the middle of a
training session.

Modified:
    branches/1.4/channels/chan_iax2.c

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=78063&r1=78062&r2=78063
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Fri Aug  3 12:01:07 2007
@@ -3277,23 +3277,24 @@
 
 	ast_mutex_lock(&iaxsl[callno]);
 	pvt = iaxs[callno];
-	if (!strcasecmp(pvt->mohinterpret, "passthrough")) {
-		res = send_command(pvt, AST_FRAME_CONTROL, condition, 0, data, datalen, -1);
-		ast_mutex_unlock(&iaxsl[callno]);
-		return res;
-	}
 
 	switch (condition) {
 	case AST_CONTROL_HOLD:
-		ast_moh_start(c, data, pvt->mohinterpret);
+		if (strcasecmp(pvt->mohinterpret, "passthrough")) {
+			ast_moh_start(c, data, pvt->mohinterpret);
+			goto done;
+		}
 		break;
 	case AST_CONTROL_UNHOLD:
-		ast_moh_stop(c);
-		break;
-	default:
-		res = send_command(pvt, AST_FRAME_CONTROL, condition, 0, data, datalen, -1);
-	}
-
+		if (strcasecmp(pvt->mohinterpret, "passthrough")) {
+			ast_moh_stop(c);
+			goto done;
+		}
+	}
+
+	res = send_command(pvt, AST_FRAME_CONTROL, condition, 0, data, datalen, -1);
+
+done:
 	ast_mutex_unlock(&iaxsl[callno]);
 
 	return res;




More information about the asterisk-commits mailing list