From fd9d8ca43bef5cc1f4af32f55fd54d3aabb68769 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Wed, 28 Apr 2004 14:35:20 +0000 Subject: [PATCH] Run setstate after setting all appropriate variables including callerid git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2797 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_h323.c | 2 +- channels/chan_sip.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/channels/chan_h323.c b/channels/chan_h323.c index dc8b0ce6da..166d6b2ea5 100755 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -656,7 +656,6 @@ static struct ast_channel *oh323_new(struct oh323_pvt *i, int state, const char fmt = ast_best_codec(ch->nativeformats); ch->type = type; ch->fds[0] = ast_rtp_fd(i->rtp); - ast_setstate(ch, state); if (state == AST_STATE_RING) ch->rings = 1; @@ -700,6 +699,7 @@ static struct ast_channel *oh323_new(struct oh323_pvt *i, int state, const char strncpy(ch->accountcode, i->accountcode, sizeof(ch->accountcode)-1); if (i->amaflags) ch->amaflags = i->amaflags; + ast_setstate(ch, state); if (state != AST_STATE_DOWN) { if (ast_pbx_start(ch)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ch->name); diff --git a/channels/chan_sip.c b/channels/chan_sip.c index e5cd96d908..2fd2f675ff 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1557,7 +1557,6 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title) tmp->fds[2] = ast_rtp_fd(i->vrtp); tmp->fds[3] = ast_rtcp_fd(i->vrtp); } - ast_setstate(tmp, state); if (state == AST_STATE_RING) tmp->rings = 1; tmp->adsicpe = AST_ADSI_UNAVAILABLE; @@ -1605,7 +1604,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title) if (strlen(i->domain)) { pbx_builtin_setvar_helper(tmp, "SIPDOMAIN", i->domain); } - + ast_setstate(tmp, state); if (state != AST_STATE_DOWN) { if (ast_pbx_start(tmp)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);