[libpri-commits] rmudgett: branch 1.4 r1261 - in /branches/1.4: pri_q931.h q931.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Tue Nov 3 11:19:27 CST 2009


Author: rmudgett
Date: Tue Nov  3 11:19:20 2009
New Revision: 1261

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1261
Log:
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

Modified:
    branches/1.4/pri_q931.h
    branches/1.4/q931.c

Modified: branches/1.4/pri_q931.h
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pri_q931.h?view=diff&rev=1261&r1=1260&r2=1261
==============================================================================
--- branches/1.4/pri_q931.h (original)
+++ branches/1.4/pri_q931.h Tue Nov  3 11:19:20 2009
@@ -146,6 +146,7 @@
 #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

Modified: branches/1.4/q931.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/q931.c?view=diff&rev=1261&r1=1260&r2=1261
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Tue Nov  3 11:19:20 2009
@@ -1510,6 +1510,30 @@
 	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[] = {
@@ -1654,6 +1678,12 @@
 static void dump_calling_party_subaddr(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
 {
 	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)
@@ -3177,6 +3207,8 @@
 	{ 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 },




More information about the libpri-commits mailing list