Unknown IE 50 (cs5, Unknown Information Element)

Add code to recognize the code set 5 ie 50 (calling party category) to
suppress the unknown IE message.

(closes issue #13828)
Reported by: fdecher
Patches:
      libpri_ie50_cs5-trunk.diff3.txt uploaded by alecdavis (license 585)
Tested by: alecdavis


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1261 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Richard Mudgett 2009-11-03 17:19:20 +00:00
parent 9f39144986
commit 618acf9d53
2 changed files with 33 additions and 0 deletions

View File

@ -146,6 +146,7 @@ typedef struct q931_ie {
#define Q931_CHANNEL_IDENT 0x18
#define Q931_PROGRESS_INDICATOR 0x1e
#define Q931_NETWORK_SPEC_FAC 0x20
#define Q931_CALLING_PARTY_CATEGORY (0x32 | Q931_CODESET(5))
#define Q931_INFORMATION_RATE 0x40
#define Q931_TRANSIT_DELAY 0x42
#define Q931_TRANS_DELAY_SELECT 0x43

32
q931.c
View File

@ -1510,6 +1510,30 @@ static char *subaddrtype2str(int plan)
return code2str(plan, plans, sizeof(plans) / sizeof(plans[0]));
}
/* Calling Party Category (Definitions from Q.763) */
static char *cpc2str(int plan)
{
static struct msgtype plans[] = {
{ 0, "Unknown Source" },
{ 1, "Operator French" },
{ 2, "Operator English" },
{ 3, "Operator German" },
{ 4, "Operator Russian" },
{ 5, "Operator Spanish" },
{ 6, "Mut Agree Chinese" },
{ 7, "Mut Agreement" },
{ 8, "Mut Agree Japanese" },
{ 9, "National Operator" },
{ 10, "Ordinary Toll Caller" },
{ 11, "Priority Toll Caller" },
{ 12, "Data Call" },
{ 13, "Test Call" },
{ 14, "Spare" },
{ 15, "Pay Phone" },
};
return code2str(plan, plans, ARRAY_LEN(plans));
}
char *pri_pres2str(int pres)
{
static struct msgtype press[] = {
@ -1656,6 +1680,12 @@ static void dump_calling_party_subaddr(int full_ie, struct pri *ctrl, q931_ie *i
dump_subaddr_helper(full_ie, ctrl, ie, 1 , len, len - 3, prefix, "Calling");
}
static void dump_calling_party_category(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
{
pri_message(ctrl, "%c Calling Party Category (len=%2d) [ Ext: %d Cat: %s (%d) ]\n",
prefix, len, ie->data[0] >> 7, cpc2str(ie->data[0] & 0x0F), ie->data[0] & 0x0F);
}
static void dump_redirecting_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
{
unsigned char cnum[256];
@ -3177,6 +3207,8 @@ static struct ie ies[] = {
{ 1, Q931_SENDING_COMPLETE, "Sending Complete", dump_sending_complete, receive_sending_complete, transmit_sending_complete },
/* Codeset 4 - Q.SIG specific */
{ 1, QSIG_IE_TRANSIT_COUNT | Q931_CODESET(4), "Transit Count", dump_transit_count },
/* Codeset 5 - National specific (ETSI PISN specific) */
{ 1, Q931_CALLING_PARTY_CATEGORY, "Calling Party Category", dump_calling_party_category },
/* Codeset 6 - Network specific */
{ 1, Q931_IE_ORIGINATING_LINE_INFO, "Originating Line Information", dump_line_information, receive_line_information, transmit_line_information },
{ 1, Q931_IE_FACILITY | Q931_CODESET(6), "Facility", dump_facility, receive_facility, transmit_facility },