Make sure linkset is locked exiting ss7_start_call
authorMatthew Fredrickson <creslin@digium.com>
Sat, 12 Apr 2008 16:21:29 +0000 (16:21 +0000)
committerMatthew Fredrickson <creslin@digium.com>
Sat, 12 Apr 2008 16:21:29 +0000 (16:21 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114093 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 84d4b96..5465990 100644 (file)
@@ -9140,6 +9140,7 @@ static void ss7_start_call(struct zt_pvt *p, struct zt_ss7 *linkset)
 
        ast_mutex_unlock(&linkset->lock);
        c = zt_new(p, AST_STATE_RING, 1, SUB_REAL, law, 0);
+       ast_mutex_lock(&linkset->lock);
 
        if (!c) {
                ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic);
@@ -9147,8 +9148,6 @@ static void ss7_start_call(struct zt_pvt *p, struct zt_ss7 *linkset)
        } else
                ast_verb(3, "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
 
-       ast_mutex_lock(&linkset->lock);
-
        zt_enable_ec(p);
 
        if (!ast_strlen_zero(p->charge_number)) {