? ast_setstate.patch ? ast_setstate.path Index: chan_h323.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v retrieving revision 1.45 diff -u -r1.45 chan_h323.c --- chan_h323.c 22 Apr 2004 00:20:33 -0000 1.45 +++ chan_h323.c 28 Apr 2004 20:49:48 -0000 @@ -656,7 +656,7 @@ 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 +700,7 @@ 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); Index: chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.345 diff -u -r1.345 chan_sip.c --- chan_sip.c 27 Apr 2004 22:32:57 -0000 1.345 +++ chan_sip.c 28 Apr 2004 20:50:01 -0000 @@ -1557,7 +1557,7 @@ 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; @@ -1602,6 +1602,7 @@ if (strlen(i->exten) && strcmp(i->exten, "s")) tmp->dnid = strdup(i->exten); tmp->priority = 1; + ast_setstate(tmp, state); if (strlen(i->domain)) { pbx_builtin_setvar_helper(tmp, "SIPDOMAIN", i->domain); } Index: chan_zap.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v retrieving revision 1.216 diff -u -r1.216 chan_zap.c --- chan_zap.c 28 Apr 2004 04:26:26 -0000 1.216 +++ chan_zap.c 28 Apr 2004 20:50:17 -0000 @@ -4087,7 +4087,7 @@ ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]); } i->subs[index].owner = tmp; - ast_setstate(tmp, state); + ast_mutex_lock(&usecnt_lock); usecnt++; ast_mutex_unlock(&usecnt_lock); @@ -4110,6 +4110,7 @@ } tmp->restrictcid = i->restrictcid; tmp->callingpres = i->callingpres; + ast_setstate(tmp, state); #ifdef ZAPATA_PRI set_calltype(tmp, ctype); /* Assume calls are not idle calls unless we're told differently */