diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-23 16:49:12 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-23 16:49:12 +0000 |
commit | 604972725d6443e145cc1344d5b91a94f3a6874d (patch) | |
tree | 9df57ec67d82e432a214c23cd83cc42f9889c78f /channels/chan_h323.c | |
parent | 782273ca463cc47bf63cb11429ce97e49fcac58f (diff) |
revert my changes that converted the jb on the channel to be dynamically
allocated. These changes caused crashes when using a channel type that did
not support the jitterbuffer. Instead of fixing why it's crashing, I'm going
to implement this in a better way next week. The way I did it caused a
jitterbuffer to be allocated on every channel where the channel type supported
jitterbuffers, even if they were disabled.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35746 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_h323.c')
-rw-r--r-- | channels/chan_h323.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 42c9b6101..36c0582b8 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -746,6 +746,9 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c /* 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_atomic_fetchadd_int(&__mod_desc->usecnt, +1); + ast_update_use_count(); ast_mutex_lock(&pvt->lock); if (ch) { ch->tech = &oh323_tech; @@ -800,25 +803,17 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c ch->cid.cid_dnid = strdup(pvt->exten); } ast_setstate(ch, state); - /* Configure the new channel jb */ - if (pvt->rtp) { - if (ast_jb_configure(ch, &global_jbconf)) { - ast_hangup(ch); - pvt->owner = NULL; - return NULL; - } - } if (state != AST_STATE_DOWN) { if (ast_pbx_start(ch)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ch->name); ast_hangup(ch); - pvt->owner = NULL; - return NULL; + ch = NULL; } } - /* Update usage counter */ - ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1); - ast_update_use_count(); + + /* Configure the new channel jb */ + if (ch && pvt && pvt->rtp) + ast_jb_configure(ch, &global_jbconf); } else { ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); } |