From 97a78b6234f60ccc829fea2f587a432995c3532b Mon Sep 17 00:00:00 2001
From: Alexandr Anikin <may@telecom-service.ru>
Date: Sat, 22 Oct 2011 12:03:23 +0000
Subject: [PATCH] Merged revisions 341313 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/10

................
  r341313 | may | 2011-10-19 03:33:49 +0400 (Wed, 19 Oct 2011) | 10 lines

  Merged revisions 341312 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.8

  ........
    r341312 | may | 2011-10-19 03:20:53 +0400 (Wed, 19 Oct 2011) | 3 lines

    fix issue on channel numbering (calls could have same channel number
    on heavy loaded system)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 addons/chan_ooh323.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c
index 621459a919..1592c1a4da 100644
--- a/addons/chan_ooh323.c
+++ b/addons/chan_ooh323.c
@@ -367,10 +367,10 @@ static struct ast_channel *ooh323_new(struct ooh323_pvt *i, int state,
 	ast_format_clear(&tmpfmt);
 	/* Don't hold a h323 pvt lock while we allocate a channel */
 	ast_mutex_unlock(&i->lock);
+   	ast_mutex_lock(&ooh323c_cn_lock);
    	ch = ast_channel_alloc(1, state, i->callerid_num, i->callerid_name, 
 				i->accountcode, i->exten, i->context, linkedid, i->amaflags,
 				"OOH323/%s-%ld", host, callnumber);
-   	ast_mutex_lock(&ooh323c_cn_lock);
    	callnumber++;
    	ast_mutex_unlock(&ooh323c_cn_lock);
    
-- 
GitLab