Add some additional debug for Q.921 MDL messages as well as fix a bug in RESTART messages on BRI

git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@653 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Matthew Fredrickson 2008-12-23 21:38:25 +00:00
parent 2c104c4dbd
commit 40ae2a030a
2 changed files with 40 additions and 1 deletions

39
q921.c
View File

@ -638,6 +638,7 @@ void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx)
direction_tag, direction_tag,
h->h.tei, h->h.tei,
h->h.ea2); h->h.ea2);
switch (h->h.data[0] & Q921_FRAMETYPE_MASK) { switch (h->h.data[0] & Q921_FRAMETYPE_MASK) {
case 0: case 0:
case 2: case 2:
@ -728,6 +729,44 @@ void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx)
len - 3); len - 3);
break; break;
}; };
if ((h->u.ft == 3) && (h->u.m3 == 0) && (h->u.m2 == 0) && (h->u.data[0] == 0x0f)) {
int ri;
int tei;
ri = (h->u.data[1] << 8) | h->u.data[2];
tei = (h->u.data[4] >> 1);
/* TEI assignment related */
switch (h->u.data[3]) {
case Q921_TEI_IDENTITY_REQUEST:
type = "TEI Identity Request";
break;
case Q921_TEI_IDENTITY_ASSIGNED:
type = "TEI Identity Assigned";
break;
case Q921_TEI_IDENTITY_CHECK_REQUEST:
type = "TEI Identity Check Request";
break;
case Q921_TEI_IDENTITY_REMOVE:
type = "TEI Identity Remove";
break;
case Q921_TEI_IDENTITY_DENIED:
type = "TEI Identity Denied";
break;
case Q921_TEI_IDENTITY_CHECK_RESPONSE:
type = "TEI Identity Check Response";
break;
case Q921_TEI_IDENTITY_VERIFY:
type = "TEI Identity Verify";
break;
default:
type = "Unknown";
break;
}
pri_message(pri, "%c MDL Message: %s (%d)\n", direction_tag, type, h->u.data[3]);
pri_message(pri, "%c RI: %d\n", direction_tag, ri);
pri_message(pri, "%c Ai: %d E:%d\n", direction_tag, (h->u.data[4] >> 1) & 0x7f, h->u.data[4] & 1);
}
} }
static pri_event *q921_dchannel_up(struct pri *pri) static pri_event *q921_dchannel_up(struct pri *pri)

2
q931.c
View File

@ -2985,7 +2985,7 @@ static int restart_ies[] = { Q931_CHANNEL_IDENT, Q931_RESTART_INDICATOR, -1 };
int q931_restart(struct pri *pri, int channel) int q931_restart(struct pri *pri, int channel)
{ {
struct q931_call *c; struct q931_call *c;
c = q931_getcall(pri, 0 | 0x8000, 0); c = q931_getcall(pri, 0 | 0x8000, 1);
if (!c) if (!c)
return -1; return -1;
if (!channel) if (!channel)