diff options
author | Russell Bryant <russell@russellbryant.com> | 2006-06-23 16:49:12 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2006-06-23 16:49:12 +0000 |
commit | c8ceb92a4fe74ff05fc26b9da80ab2c17af5a931 (patch) | |
tree | 9df57ec67d82e432a214c23cd83cc42f9889c78f /channels/chan_sip.c | |
parent | b8518110da185cd5655983811705ca6b420a883b (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: https://origsvn.digium.com/svn/asterisk/trunk@35746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2dbf6ddd0..498087cdc 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3648,6 +3648,9 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit if (!ast_strlen_zero(i->musicclass)) ast_string_field_set(tmp, musicclass, i->musicclass); i->owner = tmp; + ast_mutex_lock(&usecnt_lock); + usecnt++; + ast_mutex_unlock(&usecnt_lock); ast_copy_string(tmp->context, i->context, sizeof(tmp->context)); ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten)); if (!ast_strlen_zero(i->cid_num)) @@ -3668,20 +3671,11 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit if (!ast_strlen_zero(i->callid)) pbx_builtin_setvar_helper(tmp, "SIPCALLID", i->callid); ast_setstate(tmp, state); - /* Configure the new channel jb */ - if (i->rtp) { - if (ast_jb_configure(tmp, &global_jbconf)) { - ast_hangup(tmp); - i->owner = NULL; - return NULL; - } - } if (state != AST_STATE_DOWN && ast_pbx_start(tmp)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name); tmp->hangupcause = AST_CAUSE_SWITCH_CONGESTION; ast_hangup(tmp); - i->owner = NULL; - return NULL; + tmp = NULL; } /* Set channel variables for this call from configuration */ for (v = i->chanvars ; v ; v = v->next) @@ -3690,9 +3684,9 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit if (recordhistory) append_history(i, "NewChan", "Channel %s - from %s", tmp->name, i->callid); - ast_mutex_lock(&usecnt_lock); - usecnt++; - ast_mutex_unlock(&usecnt_lock); + /* Configure the new channel jb */ + if (tmp && i && i->rtp) + ast_jb_configure(tmp, &global_jbconf); return tmp; } |