Index: channels/chan_h323.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v retrieving revision 1.93 diff -u -r1.93 chan_h323.c --- channels/chan_h323.c 16 Nov 2004 15:37:56 -0000 1.93 +++ channels/chan_h323.c 1 Dec 2004 04:39:31 -0000 @@ -681,6 +681,11 @@ /* Don't hold a oh323_pvt lock while we allocate a chanel */ ast_mutex_unlock(&pvt->lock); ch = ast_channel_alloc(1); + /* Update usage counter */ + ast_mutex_lock(&usecnt_lock); + usecnt++; + ast_mutex_unlock(&usecnt_lock); + ast_update_use_count(); ast_mutex_lock(&pvt->lock); if (ch) { snprintf(ch->name, sizeof(ch->name), "H323/%s", host); @@ -720,12 +725,6 @@ /* Set the owner of this channel */ pvt->owner = ch; - /* Update usage counter */ - ast_mutex_lock(&usecnt_lock); - usecnt++; - ast_mutex_unlock(&usecnt_lock); - ast_update_use_count(); - strncpy(ch->context, pvt->context, sizeof(ch->context) - 1); strncpy(ch->exten, pvt->exten, sizeof(ch->exten) - 1); ch->priority = 1; @@ -950,7 +949,7 @@ return 0; } } -static struct ast_channel *oh323_request(const char *type, int format, void *data) +static struct ast_channel *oh323_request(const char *type, int format, void *data, int *cause) { int oldformat; struct oh323_pvt *pvt; @@ -1261,7 +1260,9 @@ return 0; } /* allocate a channel and tell asterisk about it */ + ast_mutex_lock(&pvt->lock); c = oh323_new(pvt, AST_STATE_RINGING, pvt->cd.call_token); + ast_mutex_unlock(&pvt->lock); if (!c) { ast_log(LOG_ERROR, "Couldn't create channel. This is bad\n"); return 0;