From 9f9a5f19845e38b8829fdff94837b9b760692404 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 16 Aug 2006 03:43:47 +0000 Subject: move the calls to ast_jb_configure() to before the PBX thread is started on the channel to remove the theoretical race condition that the channel could get bridged before the channel's jitterbuffer gets configured. This was pointed out by PCadach on IRC. Thanks! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39964 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_mgcp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'channels/chan_mgcp.c') diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 7b56b8c98..07da3a75d 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -1425,6 +1425,8 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state) if (!i->adsi) tmp->adsicpe = AST_ADSI_UNAVAILABLE; tmp->priority = 1; + if (sub->rtp) + ast_jb_configure(tmp, &global_jbconf); if (state != AST_STATE_DOWN) { if (ast_pbx_start(tmp)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name); @@ -1437,10 +1439,6 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state) ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_new(%s) created in state: %s\n", tmp->name, ast_state2str(state)); } - - /* Configure the new channel jb */ - if (tmp && sub && sub->rtp) - ast_jb_configure(tmp, &global_jbconf); } else { ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); } -- cgit v1.2.3