[asterisk-commits] jrose: trunk r317334 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 5 14:33:19 CDT 2011


Author: jrose
Date: Thu May  5 14:33:11 2011
New Revision: 317334

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=317334
Log:
Merged revisions 317283 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r317283 | jrose | 2011-05-05 14:09:13 -0500 (Thu, 05 May 2011) | 10 lines
  
  Resolves a deadlock that occurs during sip_new
  
  This is based on an uncommitted patch by jpeeler for the issue.  Instead of
  relocking and then unlocking the channel though, we keep the lock on the channel
  until we are finished doing what we need to the channel.
  
  (closes issue #18441)
  Reported by: Alric
........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=317334&r1=317333&r2=317334
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu May  5 14:33:11 2011
@@ -6722,7 +6722,6 @@
 	sip_pvt_lock(i);
 	ast_channel_cc_params_init(tmp, i->cc_params);
 	tmp->caller.id.tag = ast_strdup(i->cid_tag);
-	ast_channel_unlock(tmp);
 
 	tmp->tech = ( ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_INFO || ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_SHORTINFO) ?  &sip_tech_info : &sip_tech;
 
@@ -6887,6 +6886,8 @@
 		char valuebuf[1024];
 		pbx_builtin_setvar_helper(tmp, v->name, ast_get_encoded_str(v->value, valuebuf, sizeof(valuebuf)));
 	}
+
+	ast_channel_unlock(tmp); /* ast_hangup requires the channel to be unlocked */
 
 	if (state != AST_STATE_DOWN && ast_pbx_start(tmp)) {
 		ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);




More information about the asterisk-commits mailing list