Must call spanstat before checking number of channels (bug #1796)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-06-06 22:22:48 +00:00
parent 9c42fa75a4
commit 469c7d6de9

View File

@@ -5687,12 +5687,6 @@ static struct zt_pvt *mkintf(int channel, int signalling, int radio, struct zt_p
int offset;
int myswitchtype;
offset = 0;
pri_resolve_span(&span, channel, (channel - p.chanpos), &si);
if (span < 0) {
ast_log(LOG_WARNING, "Channel %d: Unable to find locate channel/trunk group!\n", channel);
free(tmp);
return NULL;
}
if ((signalling == SIG_PRI) && ioctl(tmp->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &offset)) {
ast_log(LOG_ERROR, "Unable to set clear mode on clear channel %d of span %d: %s\n", channel, p.spanno, strerror(errno));
free(tmp);
@@ -5709,6 +5703,12 @@ static struct zt_pvt *mkintf(int channel, int signalling, int radio, struct zt_p
free(tmp);
return NULL;
}
pri_resolve_span(&span, channel, (channel - p.chanpos), &si);
if (span < 0) {
ast_log(LOG_WARNING, "Channel %d: Unable to find locate channel/trunk group!\n", channel);
free(tmp);
return NULL;
}
if (signalling == SIG_PRI)
myswitchtype = switchtype;
else