Fix sending of interface identifier unconditionally in sig_pri

The wrong logic was being used in chan_dahdi to convert a sig_pri_chan
to the proper libpri channel number. The most significant bit must only
be set only when trunk groups are being used.

(closes issue #15452)
Reported by: alecdavis
Patches:
      bug15452.patch uploaded by jpeeler (license 325)
Tested by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jeff Peeler
2009-07-23 15:59:44 +00:00
parent 98b4bdc1b9
commit 980db1601a
3 changed files with 13 additions and 14 deletions

View File

@@ -78,14 +78,11 @@ static inline void pri_rel(struct sig_pri_pri *pri)
static unsigned int PVT_TO_CHANNEL(struct sig_pri_chan *p)
{
int explicit;
int res = (((p)->prioffset) | ((p)->logicalspan << 8) | (p->mastertrunkgroup ? 0x10000 : 0));
ast_debug(5, "prioffset: %d mastertrunkgroup: %d logicalspan: %d result: %d\n",
p->prioffset, p->mastertrunkgroup, p->logicalspan, res);
if (p->pri->dchan_logical_span[pri_active_dchan_index(p->pri)] == p->logicalspan)
explicit = 1;
else
explicit = 0;
return (((p)->prioffset) | ((p)->logicalspan << 8) | (explicit ? 0x10000 : 0));
return res;
}
static void sig_pri_handle_dchan_exception(struct sig_pri_pri *pri, int index)
@@ -202,14 +199,15 @@ static char *pri_order(int level)
/* Returns index of the active dchan */
static int pri_active_dchan_index(struct sig_pri_pri *pri)
{
int x = -1;
int x;
for (x = 0; x < NUM_DCHANS; x++) {
if ((pri->dchans[x] == pri->pri))
break;
return x;
}
return x;
ast_log(LOG_WARNING, "No active dchan found!\n");
return -1;
}
static int pri_find_dchan(struct sig_pri_pri *pri)
@@ -2330,7 +2328,7 @@ void sig_pri_chan_alarm_notify(struct sig_pri_chan *p, int noalarm)
}
}
struct sig_pri_chan *sig_pri_chan_new(void *pvt_data, struct sig_pri_callback *callback, struct sig_pri_pri *pri, int logicalspan, int channo)
struct sig_pri_chan *sig_pri_chan_new(void *pvt_data, struct sig_pri_callback *callback, struct sig_pri_pri *pri, int logicalspan, int channo, int trunkgroup)
{
struct sig_pri_chan *p;
@@ -2341,6 +2339,7 @@ struct sig_pri_chan *sig_pri_chan_new(void *pvt_data, struct sig_pri_callback *c
p->logicalspan = logicalspan;
p->prioffset = channo;
p->mastertrunkgroup = trunkgroup;
p->calls = callback;
p->chan_pvt = pvt_data;