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;
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);
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;
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);