Index: q931.c =================================================================== --- q931.c (revision 1254) +++ q931.c (working copy) @@ -1510,6 +1510,30 @@ return code2str(plan, plans, sizeof(plans) / sizeof(plans[0])); } +/* Calling Party Category */ +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, sizeof(plans) / sizeof(plans[0])); +} + char *pri_pres2str(int pres) { static struct msgtype press[] = { @@ -1656,6 +1680,12 @@ 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 @@ { 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 - 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 }, @@ -4412,6 +4444,7 @@ Q931_REVERSE_CHARGE_INDIC, Q931_CALLING_PARTY_NUMBER, Q931_CALLING_PARTY_SUBADDR, +/* Q931_CALLING_PARTY_CATEGORY, */ Q931_CALLED_PARTY_NUMBER, Q931_CALLED_PARTY_SUBADDR, Q931_REDIRECTING_NUMBER, @@ -4436,6 +4469,7 @@ Q931_IE_KEYPAD_FACILITY, Q931_CALLING_PARTY_NUMBER, Q931_CALLING_PARTY_SUBADDR, +/* Q931_CALLING_PARTY_CATEGORY, */ Q931_CALLED_PARTY_NUMBER, Q931_CALLED_PARTY_SUBADDR, Q931_SENDING_COMPLETE, Index: pri_q931.h =================================================================== --- pri_q931.h (revision 1254) +++ pri_q931.h (working copy) @@ -156,6 +156,7 @@ #define Q931_REVERSE_CHARGE_INDIC 0x4a #define Q931_CALLING_PARTY_NUMBER 0x6c #define Q931_CALLING_PARTY_SUBADDR 0x6d +#define Q931_CALLING_PARTY_CATEGORY (0x32 | Q931_CODESET(5)) #define Q931_CALLED_PARTY_NUMBER 0x70 #define Q931_CALLED_PARTY_SUBADDR 0x71 #define Q931_REDIRECTING_NUMBER 0x74