Index: channels/chan_zap.c =================================================================== --- channels/chan_zap.c (revision 106393) +++ channels/chan_zap.c (working copy) @@ -8139,6 +8139,14 @@ destroy_zt_pvt(&tmp); return NULL; } +#if defined(HAVE_ZAPTEL_CHANALARMS) + if (p.chan_alarms != 0) { + tmp->inalarm = 1; + ast_log(LOG_NOTICE, "Channel %d started with %s alarm\n", channel, alarm2str(p.chan_alarms)); + } else { + tmp->inalarm = 0; + } +#endif tmp->law = p.curlaw; tmp->span = p.spanno; span = p.spanno - 1; @@ -8523,8 +8531,6 @@ /* the dchannel is down so put the channel in alarm */ if (tmp->pri && !pri_is_up(tmp->pri)) tmp->inalarm = 1; - else - tmp->inalarm = 0; #endif memset(&si, 0, sizeof(si)); if (ioctl(tmp->subs[SUB_REAL].zfd,ZT_SPANSTAT,&si) == -1) {