diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-21 22:45:16 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-21 22:45:16 +0000 |
commit | 094c48143af1816948aebff9d7be0ead3509cae6 (patch) | |
tree | 5c240e79718acc358679fad13f57fa7ef712f770 /channels/chan_dahdi.c | |
parent | 427d1fd237900198d33902c4709d05bac210ee90 (diff) |
teach chan_dahdi how to find the D-channel on BRI spans, and don't attempt to use channel 24 as a D-channel on spans of unexpected sizes
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@132571 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r-- | channels/chan_dahdi.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 8eb8fd474..c1c75da64 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -7089,10 +7089,19 @@ static int pri_resolve_span(int *span, int channel, int offset, DAHDI_SPANINFO * ast_log(LOG_WARNING, "Unable to use span %d implicitly since it is already part of trunk group %d\n", *span, pris[*span].mastertrunkgroup); *span = -1; } else { - if (si->totalchans == 31) { /* if it's an E1 */ + if (si->totalchans == 31) { + /* E1 */ pris[*span].dchannels[0] = 16 + offset; - } else { + } else if (si->totalchans == 24) { + /* T1 or J1 */ pris[*span].dchannels[0] = 24 + offset; + } else if (si->totalchans == 3) { + /* BRI */ + pris[*span].dchannels[0] = 3 + offset; + } else { + ast_log(LOG_WARNING, "Unable to use span %d, since the D-channel cannot be located (unexpected span size of %d channels)\n", *span, si->totalchans); + *span = -1; + return 0; } pris[*span].dchanavail[0] |= DCHAN_PROVISIONED; pris[*span].offset = offset; |