[svn-commits] irroot: branch irroot/distrotech-customers-10 r335977 - /team/irroot/distrote...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 15 02:06:41 CDT 2011


Author: irroot
Date: Thu Sep 15 02:06:39 2011
New Revision: 335977

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=335977
Log:
Proposed fix for ASTERISK-18092 lock p->owner while calling ast_bridged_channel

Modified:
    team/irroot/distrotech-customers-10/channels/chan_agent.c

Modified: team/irroot/distrotech-customers-10/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/channels/chan_agent.c?view=diff&rev=335977&r1=335976&r2=335977
==============================================================================
--- team/irroot/distrotech-customers-10/channels/chan_agent.c (original)
+++ team/irroot/distrotech-customers-10/channels/chan_agent.c Thu Sep 15 02:06:39 2011
@@ -1507,6 +1507,7 @@
 	char *talkingto = NULL;
 	char *talkingtoChan = NULL;
 	char *status = NULL;
+	struct ast_channel *bridge;
 
 	if (!ast_strlen_zero(id))
 		snprintf(idText, sizeof(idText) ,"ActionID: %s\r\n", id);
@@ -1531,10 +1532,13 @@
 			if (p->owner && p->owner->_bridge) {
 				talkingto = S_COR(p->chan->caller.id.number.valid,
 					p->chan->caller.id.number.str, "n/a");
-				if (ast_bridged_channel(p->owner))
-					talkingtoChan = ast_strdupa(ast_bridged_channel(p->owner)->name);
-				else
+				ast_channel_lock(p->owner);
+				if ((bridge = ast_bridged_channel(p->owner))) {
+					talkingtoChan = ast_strdupa(bridge->name);
+				} else {
 					talkingtoChan = "n/a";
+				}
+				ast_channel_unlock(p->owner);
 				status = "AGENT_ONCALL";
 			} else {
 				talkingto = "n/a";




More information about the svn-commits mailing list