Review Board 1.7.16


use ie2str(full_ie) where possible in q931.c

Review Request #1633 - Created Dec. 18, 2011 and submitted

Alec Davis
1.4
Reviewers
asterisk-dev
rmudgett
LibPRI
compiles

Only 'dump_channel_id' left is.
basic calls.
adjust some output formatting as suggested.

Diff revision 3 (Latest)

1 2 3
1 2 3

  1. branches/1.4/q931.c: Loading...
branches/1.4/q931.c
Revision 2279 New Change
[20] 1502 lines
[+20] [+] static void dump_channel_id(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
1503
		"No channel selected", "B1 channel", "B2 channel", "Any channel selected",
1503
		"No channel selected", "B1 channel", "B2 channel", "Any channel selected",
1504
		"No channel selected", "As indicated in following octets", "Reserved", "Any channel selected"
1504
		"No channel selected", "As indicated in following octets", "Reserved", "Any channel selected"
1505
	};
1505
	};
1506

    
   
1506

   
1507
	pri_message(ctrl,
1507
	pri_message(ctrl,
1508
		"%c Channel ID (len=%2d) [ Ext: %d  IntID: %s  %s  Spare: %d  %s  Dchan: %d\n",
1508
		"%c %s (len=%2d) [ Ext: %d  IntID: %s  %s  Spare: %d  %s  Dchan: %d\n",
1509
		prefix, len,
1509
		prefix, ie2str(full_ie), len,
1510
		(ie->data[0] & 0x80) ? 1 : 0,
1510
		(ie->data[0] & 0x80) ? 1 : 0,
1511
		(ie->data[0] & 0x40) ? "Explicit" : "Implicit",
1511
		(ie->data[0] & 0x40) ? "Explicit" : "Implicit",
1512
		(ie->data[0] & 0x20) ? "Other(PRI)" : "BRI",
1512
		(ie->data[0] & 0x20) ? "Other(PRI)" : "BRI",
1513
		(ie->data[0] & 0x10) ? 1 : 0,
1513
		(ie->data[0] & 0x10) ? 1 : 0,
1514
		(ie->data[0] & 0x08) ? "Exclusive" : "Preferred",
1514
		(ie->data[0] & 0x08) ? "Exclusive" : "Preferred",
[+20] [20] 58 lines
[+20] [+] static char *ri2str(int ri)
1573
	return code2str(ri, ris, sizeof(ris) / sizeof(ris[0]));
1573
	return code2str(ri, ris, sizeof(ris) / sizeof(ris[0]));
1574
}
1574
}
1575

    
   
1575

   
1576
static void dump_restart_indicator(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
1576
static void dump_restart_indicator(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
1577
{
1577
{
1578
	pri_message(ctrl, "%c Restart Indentifier (len=%2d) [ Ext: %d  Spare: %d  Resetting %s (%d) ]\n", 
1578
	pri_message(ctrl,
1579
		prefix, len, (ie->data[0] & 0x80) >> 7, (ie->data[0] & 0x78) >> 3, ri2str(ie->data[0] & 0x7), ie->data[0] & 0x7);
1579
		"%c %s (len=%2d) [ Ext: %d  Spare: %d  Resetting %s (%d) ]\n",

    
   
1580
		prefix, ie2str(full_ie), len, (ie->data[0] & 0x80) >> 7,

    
   
1581
		(ie->data[0] & 0x78) >> 3, ri2str(ie->data[0] & 0x7), ie->data[0] & 0x7);
1580
}
1582
}
1581

    
   
1583

   
1582
static int receive_restart_indicator(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
1584
static int receive_restart_indicator(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
1583
{
1585
{
1584
	/* Pretty simple */
1586
	/* Pretty simple */
[+20] [20] 114 lines
[+20] [+] static char *int_rate2str(int proto)
1699
}
1701
}
1700

    
   
1702

   
1701
static void dump_bearer_capability(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
1703
static void dump_bearer_capability(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
1702
{
1704
{
1703
	int pos=2;
1705
	int pos=2;
1704
	pri_message(ctrl, "%c Bearer Capability (len=%2d) [ Ext: %d  Coding-Std: %d  Info transfer capability: %s (%d)\n",
1706
	pri_message(ctrl,
1705
		prefix, len, (ie->data[0] & 0x80 ) >> 7, (ie->data[0] & 0x60) >> 5, cap2str(ie->data[0] & 0x1f), (ie->data[0] & 0x1f));
1707
		"%c %s (len=%2d) [ Ext: %d  Coding-Std: %d  Info transfer capability: %s (%d)\n",

    
   
1708
		prefix, ie2str(full_ie), len, (ie->data[0] & 0x80 ) >> 7,

    
   
1709
		(ie->data[0] & 0x60) >> 5, cap2str(ie->data[0] & 0x1f),

    
   
1710
		(ie->data[0] & 0x1f));
1706
	pri_message(ctrl, "%c                              Ext: %d  Trans mode/rate: %s (%d)\n", prefix, (ie->data[1] & 0x80) >> 7, mode2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f);
1711
	pri_message(ctrl, "%c                              Ext: %d  Trans mode/rate: %s (%d)\n", prefix, (ie->data[1] & 0x80) >> 7, mode2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f);
1707

    
   
1712

   
1708
	/* octet 4.1 exists iff mode/rate is multirate */
1713
	/* octet 4.1 exists if mode/rate is multirate */
1709
	if ((ie->data[1] & 0x7f) == 0x18) {
1714
	if ((ie->data[1] & 0x7f) == 0x18) {
1710
	    pri_message(ctrl, "%c                              Ext: %d  Transfer rate multiplier: %d x 64\n", prefix, (ie->data[2] & 0x80) >> 7, ie->data[2] & 0x7f);
1715
		pri_message(ctrl, "%c                              Ext: %d  Transfer rate multiplier: %d x 64\n", prefix, (ie->data[2] & 0x80) >> 7, ie->data[2] & 0x7f);
1711
		pos++;
1716
		pos++;
1712
	}
1717
	}
1713

    
   
1718

   
[+20] [20] 122 lines
[+20] [+] static int receive_bearer_capability(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
1836
	switch (ie->data[0] & 0x60) {
1841
	switch (ie->data[0] & 0x60) {
1837
	case 0x00:/* ITU-T standardized coding */
1842
	case 0x00:/* ITU-T standardized coding */
1838
		call->bc.transcapability = ie->data[0] & 0x1f;
1843
		call->bc.transcapability = ie->data[0] & 0x1f;
1839
		call->bc.transmoderate = ie->data[1] & 0x7f;
1844
		call->bc.transmoderate = ie->data[1] & 0x7f;
1840

    
   
1845

   
1841
		/* octet 4.1 exists iff mode/rate is multirate */
1846
		/* octet 4.1 exists if mode/rate is multirate */
1842
		if (call->bc.transmoderate == TRANS_MODE_MULTIRATE) {
1847
		if (call->bc.transmoderate == TRANS_MODE_MULTIRATE) {
1843
			call->bc.transmultiple = ie->data[pos++] & 0x7f;
1848
			call->bc.transmultiple = ie->data[pos++] & 0x7f;
1844
		}
1849
		}
1845

    
   
1850

   
1846
		/* Look for octet 5; this is identified by bits 5,6 == 01 */
1851
		/* Look for octet 5; this is identified by bits 5,6 == 01 */
[+20] [20] 70 lines
[+20] [+] static int transmit_bearer_capability(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order)
1917
	tc = call->bc.transcapability;
1922
	tc = call->bc.transcapability;
1918
	ie->data[0] = 0x80 | tc;
1923
	ie->data[0] = 0x80 | tc;
1919
	ie->data[1] = call->bc.transmoderate | 0x80;
1924
	ie->data[1] = call->bc.transmoderate | 0x80;
1920

    
   
1925

   
1921
 	pos = 2;
1926
	pos = 2;
1922
 	/* octet 4.1 exists iff mode/rate is multirate */
1927
	/* octet 4.1 exists if mode/rate is multirate */
1923
 	if (call->bc.transmoderate == TRANS_MODE_MULTIRATE ) {
1928
	if (call->bc.transmoderate == TRANS_MODE_MULTIRATE ) {
1924
 		ie->data[pos++] = call->bc.transmultiple | 0x80;
1929
		ie->data[pos++] = call->bc.transmultiple | 0x80;
1925
	}
1930
	}
1926

    
   
1931

   
1927
	if ((tc & PRI_TRANS_CAP_DIGITAL) && (ctrl->switchtype == PRI_SWITCH_EUROISDN_E1) &&
1932
	if ((tc & PRI_TRANS_CAP_DIGITAL) && (ctrl->switchtype == PRI_SWITCH_EUROISDN_E1) &&
[+20] [20] 214 lines
[+20] [+] static void dump_subaddr_helper(int full_ie, struct pri *ctrl, q931_ie *ie, int offset, int len, int datalen, char prefix)
2142
static void dump_called_party_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2147
static void dump_called_party_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2143
{
2148
{
2144
	unsigned char cnum[256];
2149
	unsigned char cnum[256];
2145

    
   
2150

   
2146
	q931_strget(cnum, sizeof(cnum), ie->data + 1, len - 3);
2151
	q931_strget(cnum, sizeof(cnum), ie->data + 1, len - 3);
2147
	pri_message(ctrl, "%c Called Number (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)  '%s' ]\n",
2152
	pri_message(ctrl,
2148
		prefix, len, ie->data[0] >> 7, ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07, npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f, cnum);
2153
		"%c %s (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)  '%s' ]\n",

    
   
2154
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,

    
   
2155

   

    
   
2156
		ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,

    
   
2157
		npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f, cnum);
2149
}
2158
}
2150

    
   
2159

   
2151
static void dump_called_party_subaddr(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2160
static void dump_called_party_subaddr(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2152
{
2161
{
2153
	dump_subaddr_helper(full_ie, ctrl, ie, 1, len, len - 3, prefix);
2162
	dump_subaddr_helper(full_ie, ctrl, ie, 1, len, len - 3, prefix);
[+20] [20] 6 lines
[+20] [+] static void dump_calling_party_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2160
	if (ie->data[0] & 0x80) {
2169
	if (ie->data[0] & 0x80) {
2161
		q931_strget(cnum, sizeof(cnum), ie->data + 1, len - 3);
2170
		q931_strget(cnum, sizeof(cnum), ie->data + 1, len - 3);
2162
	} else {
2171
	} else {
2163
		q931_strget(cnum, sizeof(cnum), ie->data + 2, len - 4);
2172
		q931_strget(cnum, sizeof(cnum), ie->data + 2, len - 4);
2164
	}
2173
	}
2165
	pri_message(ctrl, "%c Calling Number (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)\n", prefix, len, ie->data[0] >> 7, ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07, npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);
2174
	pri_message(ctrl,
2166
	if (ie->data[0] & 0x80)
2175
		"%c %s (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)\n",
2167
		pri_message(ctrl, "%c                           Presentation: %s (%d)  '%s' ]\n", prefix, pri_pres2str(0), 0, cnum);
2176
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,
2168
	else
2177
		ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,
2169
		pri_message(ctrl, "%c                           Presentation: %s (%d)  '%s' ]\n", prefix, pri_pres2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f, cnum);
2178
		npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);

    
   
2179
	if (ie->data[0] & 0x80) {

    
   
2180
		pri_message(ctrl, "%c                                 Presentation: %s (%d)  '%s' ]\n",

    
   
2181
			prefix, pri_pres2str(0), 0, cnum);

    
   
2182
	} else {

    
   
2183
		pri_message(ctrl, "%c                                 Presentation: %s (%d)  '%s' ]\n",

    
   
2184
			prefix, pri_pres2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f, cnum);

    
   
2185
	}
2170
}
2186
}
2171

    
   
2187

   
2172
static void dump_calling_party_subaddr(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2188
static void dump_calling_party_subaddr(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2173
{
2189
{
2174
	dump_subaddr_helper(full_ie, ctrl, ie, 1, len, len - 3, prefix);
2190
	dump_subaddr_helper(full_ie, ctrl, ie, 1, len, len - 3, prefix);
2175
}
2191
}
2176

    
   
2192

   
2177
static void dump_calling_party_category(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2193
static void dump_calling_party_category(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2178
{
2194
{
2179
	pri_message(ctrl, "%c Calling Party Category (len=%2d) [ Ext: %d  Cat: %s (%d) ]\n",
2195
	pri_message(ctrl,
2180
		prefix, len, ie->data[0] >> 7, cpc2str(ie->data[0] & 0x0F), ie->data[0] & 0x0F);
2196
		"%c %s (len=%2d) [ Ext: %d  Cat: %s (%d) ]\n",

    
   
2197
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,

    
   
2198
		cpc2str(ie->data[0] & 0x0F), ie->data[0] & 0x0F);
2181
}
2199
}
2182

    
   
2200

   
2183
static void dump_redirecting_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2201
static void dump_redirecting_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2184
{
2202
{
2185
	unsigned char cnum[256];
2203
	unsigned char cnum[256];
2186
	int i = 0;
2204
	int i = 0;

    
   
2205

   

    
   
2206
	char *ie_str;

    
   
2207
	int indent;

    
   
2208

   

    
   
2209
	ie_str = ie2str(full_ie);

    
   
2210
	indent = strlen(ie_str) + 13; /* indentation including: prefix, ie.length etc: 13 = '> (len= 2) [ ') */

    
   
2211

   
2187
	/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
2212
	/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
2188
	   walking through all bytes until one with ext bit (8) set to 1 */
2213
	   walking through all bytes until one with ext bit (8) set to 1 */
2189
	do {
2214
	do {
2190
		switch(i) {
2215
		switch(i) {
2191
		case 0:	/* Octet 3 */
2216
		case 0:	/* Octet 3 */
2192
			pri_message(ctrl, "%c Redirecting Number (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)",
2217
			pri_message(ctrl,
2193
				prefix, len, ie->data[0] >> 7, ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07, npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);
2218
				"%c %s (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)",

    
   
2219
				prefix, ie_str, len, ie->data[0] >> 7,

    
   
2220
				ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,

    
   
2221
				npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);
2194
			break;
2222
			break;
2195
		case 1: /* Octet 3a */
2223
		case 1: /* Octet 3a */
2196
			pri_message(ctrl, "\n");
2224
			pri_message(ctrl, "\n");
2197
			pri_message(ctrl, "%c                               Ext: %d  Presentation: %s (%d)",
2225
			pri_message(ctrl, "%-*c Ext: %d  Presentation: %s (%d)",
2198
				prefix, ie->data[1] >> 7, pri_pres2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f);
2226
				 indent, prefix, ie->data[1] >> 7, pri_pres2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f);
2199
			break;
2227
			break;
2200
		case 2: /* Octet 3b */
2228
		case 2: /* Octet 3b */
2201
			pri_message(ctrl, "\n");
2229
			pri_message(ctrl, "\n");
2202
			pri_message(ctrl, "%c                               Ext: %d  Reason: %s (%d)",
2230
			pri_message(ctrl, "%-*c Ext: %d  Reason: %s (%d)",
2203
				prefix, ie->data[2] >> 7, redirection_reason2str(ie->data[2] & 0x7f), ie->data[2] & 0x7f);
2231
				 indent, prefix, ie->data[2] >> 7, redirection_reason2str(ie->data[2] & 0x7f), ie->data[2] & 0x7f);
2204
			break;
2232
			break;
2205
		}
2233
		}
2206
	} while(!(ie->data[i++]& 0x80));
2234
	} while (!(ie->data[i++] & 0x80));
2207
	q931_strget(cnum, sizeof(cnum), ie->data + i, ie->len - i);
2235
	q931_strget(cnum, sizeof(cnum), ie->data + i, ie->len - i);
2208
	pri_message(ctrl, "  '%s' ]\n", cnum);
2236
	pri_message(ctrl, "  '%s' ]\n", cnum);
2209
}
2237
}
2210

    
   
2238

   
2211
static void dump_redirection_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2239
static void dump_redirection_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
[+20] [20] 4 lines
[+20] static void dump_redirecting_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2216
	   walking through all bytes until one with ext bit (8) set to 1 */
2244
	   walking through all bytes until one with ext bit (8) set to 1 */
2217
	do {
2245
	do {
2218
		switch (i) {
2246
		switch (i) {
2219
		case 0:	/* Octet 3 */
2247
		case 0:	/* Octet 3 */
2220
			pri_message(ctrl,
2248
			pri_message(ctrl,
2221
				"%c Redirection Number (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)",
2249
				"%c %s (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)",
2222
				prefix, len, ie->data[0] >> 7,
2250
				prefix, ie2str(full_ie), len, ie->data[0] >> 7,
2223
				ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,
2251
				ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,
2224
				npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);
2252
				npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);
2225
			break;
2253
			break;
2226
		case 1: /* Octet 3a */
2254
		case 1: /* Octet 3a */
2227
			pri_message(ctrl, "\n");
2255
			pri_message(ctrl, "\n");
[+20] [20] 373 lines
[+20] [+] static int transmit_calling_party_number(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order)
2601
}
2629
}
2602

    
   
2630

   
2603
static void dump_user_user(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2631
static void dump_user_user(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2604
{
2632
{
2605
	int x;
2633
	int x;
2606
	pri_message(ctrl, "%c User-User Information (len=%2d) [", prefix, len);
2634
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2607
	for (x=0;x<ie->len;x++)
2635
	for (x = 0; x < ie->len; x++) {
2608
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
2636
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);

    
   
2637
	}
2609
	pri_message(ctrl, " ]\n");
2638
	pri_message(ctrl, " ]\n");
2610
}
2639
}
2611

    
   
2640

   
2612

    
   
2641

   
2613
static int receive_user_user(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
2642
static int receive_user_user(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
[+20] [20] 27 lines
[+20] [+] static int transmit_user_user(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order)
2641
}
2670
}
2642

    
   
2671

   
2643
static void dump_change_status(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2672
static void dump_change_status(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2644
{
2673
{
2645
	int x;
2674
	int x;
2646
	
2675

   
2647
	pri_message(ctrl, "%c Change Status Information (len=%2d) [", prefix, len);
2676
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2648
	for (x=0; x<ie->len; x++) {
2677
	for (x = 0; x < ie->len; x++) {
2649
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
2678
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
2650
	}
2679
	}
2651
	pri_message(ctrl, " ]\n");
2680
	pri_message(ctrl, " ]\n");
2652
}
2681
}
2653

    
   
2682

   
[+20] [20] 51 lines
[+20] [+] static char *loc2str(int loc)
2705
	return code2str(loc, locs, sizeof(locs) / sizeof(locs[0]));
2734
	return code2str(loc, locs, sizeof(locs) / sizeof(locs[0]));
2706
}
2735
}
2707

    
   
2736

   
2708
static void dump_progress_indicator(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2737
static void dump_progress_indicator(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2709
{
2738
{
2710
	pri_message(ctrl, "%c Progress Indicator (len=%2d) [ Ext: %d  Coding: %s (%d)  0: %d  Location: %s (%d)\n",
2739
	pri_message(ctrl,
2711
		prefix, len, ie->data[0] >> 7, coding2str((ie->data[0] & 0x60) >> 5), (ie->data[0] & 0x60) >> 5,
2740
		"%c %s (len=%2d) [ Ext: %d  Coding: %s (%d)  0: %d  Location: %s (%d)\n",
2712
		(ie->data[0] & 0x10) >> 4, loc2str(ie->data[0] & 0xf), ie->data[0] & 0xf);
2741
		prefix, ie2str(full_ie), len, ie->data[0] >> 7, coding2str((ie->data[0] & 0x60) >> 5),

    
   
2742
		(ie->data[0] & 0x60) >> 5, (ie->data[0] & 0x10) >> 4,

    
   
2743
		loc2str(ie->data[0] & 0xf), ie->data[0] & 0xf);
2713
	pri_message(ctrl, "%c                               Ext: %d  Progress Description: %s (%d) ]\n",
2744
	pri_message(ctrl, "%c                               Ext: %d  Progress Description: %s (%d) ]\n",
2714
		prefix, ie->data[1] >> 7, prog2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f);
2745
		prefix, ie->data[1] >> 7, prog2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f);
2715
}
2746
}
2716

    
   
2747

   
2717
static int receive_display(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
2748
static int receive_display(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
[+20] [20] 467 lines
[+20] [+] static const char *q931_hold_state_str(enum Q931_HOLD_STATE state)
3185
	return code2str(state, hold_states, ARRAY_LEN(hold_states));
3216
	return code2str(state, hold_states, ARRAY_LEN(hold_states));
3186
}
3217
}
3187

    
   
3218

   
3188
static void dump_call_state(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3219
static void dump_call_state(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3189
{
3220
{
3190
	pri_message(ctrl, "%c Call State (len=%2d) [ Ext: %d  Coding: %s (%d)  Call state: %s (%d)\n",
3221
	pri_message(ctrl,
3191
		prefix, len, ie->data[0] >> 7, coding2str((ie->data[0] & 0xC0) >> 6), (ie->data[0] & 0xC0) >> 6,
3222
		"%c %s (len=%2d) [ Ext: %d  Coding: %s (%d)  Call state: %s (%d)\n",

    
   
3223
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,

    
   
3224
		coding2str((ie->data[0] & 0xC0) >> 6), (ie->data[0] & 0xC0) >> 6,
3192
		q931_call_state_str(ie->data[0] & 0x3f), ie->data[0] & 0x3f);
3225
		q931_call_state_str(ie->data[0] & 0x3f), ie->data[0] & 0x3f);
3193
}
3226
}
3194

    
   
3227

   
3195
static void dump_call_identity(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3228
static void dump_call_identity(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3196
{
3229
{
3197
	int x;
3230
	int x;
3198
	pri_message(ctrl, "%c Call Identity (len=%2d) [ ", prefix, len);
3231
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), len);
3199
	for (x=0;x<ie->len;x++) 
3232
	for (x = 0; x < ie->len; x++) {
3200
		pri_message(ctrl, "0x%02X ", ie->data[x]);
3233
		pri_message(ctrl, "0x%02X ", ie->data[x]);

    
   
3234
	}
3201
	pri_message(ctrl, " ]\n");
3235
	pri_message(ctrl, " ]\n");
3202
}
3236
}
3203

    
   
3237

   
3204
static void dump_time_date(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3238
static void dump_time_date(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3205
{
3239
{
3206
	pri_message(ctrl, "%c Time Date (len=%2d) [ ", prefix, len);
3240
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), len);
3207
	if (ie->len > 0)
3241
	if (ie->len > 0)
3208
		pri_message(ctrl, "%02d", ie->data[0]);
3242
		pri_message(ctrl, "%02d", ie->data[0]);
3209
	if (ie->len > 1)
3243
	if (ie->len > 1)
3210
		pri_message(ctrl, "-%02d", ie->data[1]);
3244
		pri_message(ctrl, "-%02d", ie->data[1]);
3211
	if (ie->len > 2)
3245
	if (ie->len > 2)
[+20] [20] 60 lines
[+20] [+] static int transmit_time_date(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order)
3272
static void dump_keypad_facility(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3306
static void dump_keypad_facility(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3273
{
3307
{
3274
	unsigned char tmp[64];
3308
	unsigned char tmp[64];
3275

    
   
3309

   
3276
	q931_strget(tmp, sizeof(tmp), ie->data, ie->len);
3310
	q931_strget(tmp, sizeof(tmp), ie->data, ie->len);
3277
	pri_message(ctrl, "%c Keypad Facility (len=%2d) [ %s ]\n", prefix, ie->len, tmp);
3311
	pri_message(ctrl,

    
   
3312
		"%c %s (len=%2d) [ %s ]\n", prefix, ie2str(full_ie), ie->len, tmp);
3278
}
3313
}
3279

    
   
3314

   
3280
static int receive_keypad_facility(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3315
static int receive_keypad_facility(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3281
{
3316
{
3282
	if (ie->len == 0)
3317
	if (ie->len == 0)
[+20] [20] 29 lines
[+20] [+] static void dump_display(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3312
		++x;
3347
		++x;
3313
	} else {
3348
	} else {
3314
		tmp[0] = '\0';
3349
		tmp[0] = '\0';
3315
	}
3350
	}
3316
	q931_strget(buf, sizeof(buf), &ie->data[x], ie->len - x);
3351
	q931_strget(buf, sizeof(buf), &ie->data[x], ie->len - x);
3317
	pri_message(ctrl, "%c Display (len=%2d) %s[ %s ]\n", prefix, ie->len, tmp, buf);
3352
	pri_message(ctrl,

    
   
3353
		"%c %s (len=%2d) %s[ %s ]\n", prefix, ie2str(full_ie), ie->len, tmp, buf);
3318
}
3354
}
3319

    
   
3355

   
3320
#define CHECK_OVERFLOW(limit) \
3356
#define CHECK_OVERFLOW(limit) \
3321
	if (tmpptr - tmp + limit >= sizeof(tmp)) { \
3357
	if (tmpptr - tmp + limit >= sizeof(tmp)) { \
3322
		*tmpptr = '\0'; \
3358
		*tmpptr = '\0'; \
[+20] [20] 39 lines
[+20] [+] static void dump_ie_data(struct pri *ctrl, unsigned char *c, int len)
3362
	pri_message(ctrl, "%s", tmp);
3398
	pri_message(ctrl, "%s", tmp);
3363
}
3399
}
3364

    
   
3400

   
3365
static void dump_facility(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3401
static void dump_facility(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3366
{
3402
{
3367
	pri_message(ctrl, "%c Facility (len=%2d, codeset=%d) [ ", prefix, len, Q931_IE_CODESET(full_ie));
3403
	pri_message(ctrl, "%c %s (len=%2d, codeset=%d) [ ",

    
   
3404
		prefix, ie2str(full_ie), len, Q931_IE_CODESET(full_ie));
3368
	dump_ie_data(ctrl, ie->data, ie->len);
3405
	dump_ie_data(ctrl, ie->data, ie->len);
3369
	pri_message(ctrl, " ]\n");
3406
	pri_message(ctrl, " ]\n");
3370
#if 0	/* Lets not dump parse of facility contents here anymore. */
3407
#if 0	/* Lets not dump parse of facility contents here anymore. */
3371
	/*
3408
	/*
3372
	 * The ASN.1 decode dump has already been done when the facility ie was added to the outgoing
3409
	 * The ASN.1 decode dump has already been done when the facility ie was added to the outgoing
[+20] [20] 9 lines
[+20] static void dump_facility(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3382
#endif	/* Lets not dump parse of facility contents here anymore. */
3419
#endif	/* Lets not dump parse of facility contents here anymore. */
3383
}
3420
}
3384

    
   
3421

   
3385
static void dump_network_spec_fac(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3422
static void dump_network_spec_fac(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3386
{
3423
{
3387
	pri_message(ctrl, "%c Network-Specific Facilities (len=%2d) [ ", prefix, ie->len);
3424
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), ie->len);
3388
	if (ie->data[0] == 0x00) {
3425
	if (ie->data[0] == 0x00) {
3389
 		pri_message(ctrl, "%s", code2str(ie->data[1], facilities, ARRAY_LEN(facilities)));
3426
		pri_message(ctrl, "%s", code2str(ie->data[1], facilities, ARRAY_LEN(facilities)));
3390
	}
3427
	} else {
3391
	else

   
3392
 		dump_ie_data(ctrl, ie->data, ie->len);
3428
		dump_ie_data(ctrl, ie->data, ie->len);

    
   
3429
	}
3393
	pri_message(ctrl, " ]\n");
3430
	pri_message(ctrl, " ]\n");
3394
}
3431
}
3395

    
   
3432

   
3396
static int receive_network_spec_fac(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3433
static int receive_network_spec_fac(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3397
{
3434
{
[+20] [20] 36 lines
[+20] [+] static char *pri_causeclass2str(int cause)
3434
}
3471
}
3435

    
   
3472

   
3436
static void dump_cause(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3473
static void dump_cause(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3437
{
3474
{
3438
	int x;
3475
	int x;
3439
	pri_message(ctrl, "%c Cause (len=%2d) [ Ext: %d  Coding: %s (%d)  Spare: %d  Location: %s (%d)\n",
3476
	pri_message(ctrl, "%c %s (len=%2d) [ Ext: %d  Coding: %s (%d)  Spare: %d  Location: %s (%d)\n",
3440
		prefix, len, ie->data[0] >> 7, coding2str((ie->data[0] & 0x60) >> 5), (ie->data[0] & 0x60) >> 5,
3477
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,

    
   
3478
		coding2str((ie->data[0] & 0x60) >> 5), (ie->data[0] & 0x60) >> 5,
3441
		(ie->data[0] & 0x10) >> 4, loc2str(ie->data[0] & 0xf), ie->data[0] & 0xf);
3479
		(ie->data[0] & 0x10) >> 4, loc2str(ie->data[0] & 0xf), ie->data[0] & 0xf);
3442
	pri_message(ctrl, "%c                  Ext: %d  Cause: %s (%d), class = %s (%d) ]\n",
3480
	pri_message(ctrl, "%c                  Ext: %d  Cause: %s (%d), class = %s (%d) ]\n",
3443
		prefix, (ie->data[1] >> 7), pri_cause2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f, 
3481
		prefix, (ie->data[1] >> 7), pri_cause2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f,
3444
			pri_causeclass2str((ie->data[1] & 0x7f) >> 4), (ie->data[1] & 0x7f) >> 4);
3482
		pri_causeclass2str((ie->data[1] & 0x7f) >> 4), (ie->data[1] & 0x7f) >> 4);
3445
	if (ie->len < 3)
3483
	if (ie->len < 3)
3446
		return;
3484
		return;
3447
	/* Dump cause data in readable form */
3485
	/* Dump cause data in readable form */
3448
	switch(ie->data[1] & 0x7f) {
3486
	switch(ie->data[1] & 0x7f) {
[+20] [20] 45 lines
[+20] [+] static int transmit_cause(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order)
3494
	}
3532
	}
3495
}
3533
}
3496

    
   
3534

   
3497
static void dump_sending_complete(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3535
static void dump_sending_complete(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3498
{
3536
{
3499
	pri_message(ctrl, "%c Sending Complete (len=%2d)\n", prefix, len);
3537
	pri_message(ctrl, "%c %s (len=%2d)\n", prefix, ie2str(full_ie), len);
3500
}
3538
}
3501

    
   
3539

   
3502
static int receive_sending_complete(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3540
static int receive_sending_complete(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3503
{
3541
{
3504
	/* We've got a "Complete" message: Exect no further digits. */
3542
	/* We've got a "Complete" message: Exect no further digits. */
[+20] [20] 42 lines
[+20] [+] static char *notify2str(int info)
3547
	return code2str(info, notifies, sizeof(notifies) / sizeof(notifies[0]));
3585
	return code2str(info, notifies, sizeof(notifies) / sizeof(notifies[0]));
3548
}
3586
}
3549

    
   
3587

   
3550
static void dump_notify(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3588
static void dump_notify(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3551
{
3589
{
3552
	pri_message(ctrl, "%c Notification indicator (len=%2d): Ext: %d  %s (%d)\n", prefix, len, ie->data[0] >> 7, notify2str(ie->data[0] & 0x7f), ie->data[0] & 0x7f);
3590
	pri_message(ctrl, "%c %s (len=%2d): Ext: %d  %s (%d)\n",

    
   
3591
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,

    
   
3592
		notify2str(ie->data[0] & 0x7f), ie->data[0] & 0x7f);
3553
}
3593
}
3554

    
   
3594

   
3555
static int receive_notify(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3595
static int receive_notify(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3556
{
3596
{
3557
	call->notify = ie->data[0] & 0x7F;
3597
	call->notify = ie->data[0] & 0x7F;
[+20] [20] 9 lines
[+20] [+] static int transmit_notify(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order)
3567
	return 0;
3607
	return 0;
3568
}
3608
}
3569

    
   
3609

   
3570
static void dump_shift(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3610
static void dump_shift(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3571
{
3611
{
3572
	pri_message(ctrl, "%c %sLocking Shift (len=%02d): Requested codeset %d\n", prefix, (full_ie & 8) ? "Non-" : "", len, full_ie & 7);
3612
	pri_message(ctrl, "%c %sLocking Shift (len=%02d): Requested codeset %d\n",

    
   
3613
		prefix, (full_ie & 8) ? "Non-" : "", len, full_ie & 7);
3573
}
3614
}
3574

    
   
3615

   
3575
static char *lineinfo2str(int info)
3616
static char *lineinfo2str(int info)
3576
{
3617
{
3577
	/* NAPNA ANI II digits */
3618
	/* NAPNA ANI II digits */
[+20] [20] 26 lines
[+20] static char *lineinfo2str(int info)
3604
	return code2str(info, lineinfo, sizeof(lineinfo) / sizeof(lineinfo[0]));
3645
	return code2str(info, lineinfo, sizeof(lineinfo) / sizeof(lineinfo[0]));
3605
}
3646
}
3606

    
   
3647

   
3607
static void dump_line_information(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3648
static void dump_line_information(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3608
{
3649
{
3609
	pri_message(ctrl, "%c Originating Line Information (len=%02d): %s (%d)\n", prefix, len, lineinfo2str(ie->data[0]), ie->data[0]);
3650
	pri_message(ctrl, "%c %s (len=%02d): %s (%d)\n",

    
   
3651
		prefix, ie2str(full_ie), len, lineinfo2str(ie->data[0]), ie->data[0]);
3610
}
3652
}
3611

    
   
3653

   
3612
static int receive_line_information(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3654
static int receive_line_information(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3613
{
3655
{
3614
	call->ani2 = ie->data[0];
3656
	call->ani2 = ie->data[0];
[+20] [20] 44 lines
[+20] [+] static void dump_generic_digits(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3659
	int encoding;
3701
	int encoding;
3660
	int type;
3702
	int type;
3661
	int idx;
3703
	int idx;
3662
	int value;
3704
	int value;
3663
	if (len < 3) {
3705
	if (len < 3) {
3664
		pri_message(ctrl, "%c Generic Digits (len=%02d): Invalid length\n", prefix, len);
3706
		pri_message(ctrl, "%c %s (len=%02d): Invalid length\n",

    
   
3707
			prefix, ie2str(full_ie), len);
3665
		return;
3708
		return;
3666
	}
3709
	}
3667
	encoding = (ie->data[0] >> 5) & 7;
3710
	encoding = (ie->data[0] >> 5) & 7;
3668
	type = ie->data[0] & 0x1F;
3711
	type = ie->data[0] & 0x1F;
3669
	pri_message(ctrl, "%c Generic Digits (len=%02d): Encoding %s  Type %s\n", prefix, len, gdencoding2str(encoding), gdtype2str(type));
3712
	pri_message(ctrl, "%c %s (len=%02d): Encoding %s  Type %s\n",

    
   
3713
		prefix, ie2str(full_ie), len, gdencoding2str(encoding), gdtype2str(type));
3670
	if (encoding == 3) {	/* Binary */
3714
	if (encoding == 3) {	/* Binary */
3671
		pri_message(ctrl, "%c                            Don't know how to handle binary encoding\n",
3715
		pri_message(ctrl, "%c                            Don't know how to handle binary encoding\n",
3672
			prefix);
3716
			prefix);
3673
		return;
3717
		return;
3674
	}
3718
	}
[+20] [20] 149 lines
[+20] [+] static char *signal2str(int signal)
3824
}
3868
}
3825

    
   
3869

   
3826

    
   
3870

   
3827
static void dump_signal(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3871
static void dump_signal(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3828
{
3872
{
3829
	pri_message(ctrl, "%c Signal (len=%02d): ", prefix, len);
3873
	pri_message(ctrl, "%c %s (len=%02d): ", prefix, ie2str(full_ie), len);
3830
	if (len < 3) {
3874
	if (len < 3) {
3831
		pri_message(ctrl, "Invalid length\n");
3875
		pri_message(ctrl, "Invalid length\n");
3832
		return;
3876
		return;
3833
	}
3877
	}
3834
	pri_message(ctrl, "Signal %s (%d)\n", signal2str(ie->data[0]), ie->data[0]);
3878
	pri_message(ctrl, "Signal %s (%d)\n", signal2str(ie->data[0]), ie->data[0]);
3835
}
3879
}
3836

    
   
3880

   
3837
static void dump_transit_count(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3881
static void dump_transit_count(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3838
{
3882
{
3839
	/* Defined in ECMA-225 */
3883
	/* Defined in ECMA-225 */
3840
	pri_message(ctrl, "%c Transit Count (len=%02d): ", prefix, len);
3884
	pri_message(ctrl, "%c %s (len=%02d): ", prefix, ie2str(full_ie), len);
3841
	if (len < 3) {
3885
	if (len < 3) {
3842
		pri_message(ctrl, "Invalid length\n");
3886
		pri_message(ctrl, "Invalid length\n");
3843
		return;
3887
		return;
3844
	}
3888
	}
3845
	pri_message(ctrl, "Count=%d (0x%02x)\n", ie->data[0] & 0x1f, ie->data[0] & 0x1f);
3889
	pri_message(ctrl, "Count=%d (0x%02x)\n", ie->data[0] & 0x1f, ie->data[0] & 0x1f);
3846
}
3890
}
3847

    
   
3891

   
3848
static void dump_reverse_charging_indication(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3892
static void dump_reverse_charging_indication(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3849
{
3893
{
3850
	pri_message(ctrl, "%c Reverse Charging Indication (len=%02d): %d\n", prefix, len, ie->data[0] & 0x7);
3894
	pri_message(ctrl, "%c %s (len=%02d): %d\n", prefix, ie2str(full_ie), len, ie->data[0] & 0x7);
3851
}
3895
}
3852

    
   
3896

   
3853
static int receive_reverse_charging_indication(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3897
static int receive_reverse_charging_indication(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3854
{
3898
{
3855
	call->reversecharge = ie->data[0] & 0x7;
3899
	call->reversecharge = ie->data[0] & 0x7;
[+20] [20] 9 lines
[+20] [+] static int transmit_reverse_charging_indication(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order)
3865
	return 0;
3909
	return 0;
3866
}
3910
}
3867

    
   
3911

   
3868
static struct ie ies[] = {
3912
static struct ie ies[] = {
3869
	/* Codeset 0 - Common */
3913
	/* Codeset 0 - Common */
3870
	{ 1, NATIONAL_CHANGE_STATUS, "Change Status", dump_change_status, receive_change_status, transmit_change_status },
3914
	{ 1, NATIONAL_CHANGE_STATUS, "Change Status Information", dump_change_status, receive_change_status, transmit_change_status },
3871
	{ 0, Q931_LOCKING_SHIFT, "Locking Shift", dump_shift },
3915
	{ 0, Q931_LOCKING_SHIFT, "Locking Shift", dump_shift },
3872
	{ 0, Q931_BEARER_CAPABILITY, "Bearer Capability", dump_bearer_capability, receive_bearer_capability, transmit_bearer_capability },
3916
	{ 0, Q931_BEARER_CAPABILITY, "Bearer Capability", dump_bearer_capability, receive_bearer_capability, transmit_bearer_capability },
3873
	{ 0, Q931_CAUSE, "Cause", dump_cause, receive_cause, transmit_cause },
3917
	{ 0, Q931_CAUSE, "Cause", dump_cause, receive_cause, transmit_cause },
3874
	{ 1, Q931_IE_CALL_STATE, "Call State", dump_call_state, receive_call_state, transmit_call_state },
3918
	{ 1, Q931_IE_CALL_STATE, "Call State", dump_call_state, receive_call_state, transmit_call_state },
3875
	{ 0, Q931_CHANNEL_IDENT, "Channel Identification", dump_channel_id, receive_channel_id, transmit_channel_id },
3919
	{ 0, Q931_CHANNEL_IDENT, "Channel ID", dump_channel_id, receive_channel_id, transmit_channel_id },
3876
	{ 0, Q931_PROGRESS_INDICATOR, "Progress Indicator", dump_progress_indicator, receive_progress_indicator, transmit_progress_indicator },
3920
	{ 0, Q931_PROGRESS_INDICATOR, "Progress Indicator", dump_progress_indicator, receive_progress_indicator, transmit_progress_indicator },
3877
	{ 0, Q931_NETWORK_SPEC_FAC, "Network-Specific Facilities", dump_network_spec_fac, receive_network_spec_fac, transmit_network_spec_fac },
3921
	{ 0, Q931_NETWORK_SPEC_FAC, "Network-Specific Facilities", dump_network_spec_fac, receive_network_spec_fac, transmit_network_spec_fac },
3878
	{ 1, Q931_INFORMATION_RATE, "Information Rate" },
3922
	{ 1, Q931_INFORMATION_RATE, "Information Rate" },
3879
	{ 1, Q931_TRANSIT_DELAY, "End-to-End Transit Delay" },
3923
	{ 1, Q931_TRANSIT_DELAY, "End-to-End Transit Delay" },
3880
	{ 1, Q931_TRANS_DELAY_SELECT, "Transmit Delay Selection and Indication" },
3924
	{ 1, Q931_TRANS_DELAY_SELECT, "Transmit Delay Selection and Indication" },
[+20] [20] 25 lines
[+20] static struct ie ies[] = {
3906
	{ 1, Q931_DISPLAY, "Display", dump_display, receive_display, transmit_display },
3950
	{ 1, Q931_DISPLAY, "Display", dump_display, receive_display, transmit_display },
3907
	{ 1, Q931_IE_TIME_DATE, "Date/Time", dump_time_date, receive_time_date, transmit_time_date },
3951
	{ 1, Q931_IE_TIME_DATE, "Date/Time", dump_time_date, receive_time_date, transmit_time_date },
3908
	{ 1, Q931_IE_KEYPAD_FACILITY, "Keypad Facility", dump_keypad_facility, receive_keypad_facility, transmit_keypad_facility },
3952
	{ 1, Q931_IE_KEYPAD_FACILITY, "Keypad Facility", dump_keypad_facility, receive_keypad_facility, transmit_keypad_facility },
3909
	{ 0, Q931_IE_SIGNAL, "Signal", dump_signal },
3953
	{ 0, Q931_IE_SIGNAL, "Signal", dump_signal },
3910
	{ 1, Q931_IE_SWITCHHOOK, "Switch-hook" },
3954
	{ 1, Q931_IE_SWITCHHOOK, "Switch-hook" },
3911
	{ 1, Q931_IE_USER_USER, "User-User", dump_user_user, receive_user_user, transmit_user_user },
3955
	{ 1, Q931_IE_USER_USER, "User-User Information", dump_user_user, receive_user_user, transmit_user_user },
3912
	{ 1, Q931_IE_ESCAPE_FOR_EXT, "Escape for Extension" },
3956
	{ 1, Q931_IE_ESCAPE_FOR_EXT, "Escape for Extension" },
3913
	{ 1, Q931_IE_CALL_STATUS, "Call Status" },
3957
	{ 1, Q931_IE_CALL_STATUS, "Call Status" },
3914
	{ 1, Q931_IE_CHANGE_STATUS, "Change Status", dump_change_status, receive_change_status, transmit_change_status },
3958
	{ 1, Q931_IE_CHANGE_STATUS, "Change Status Information", dump_change_status, receive_change_status, transmit_change_status },
3915
	{ 1, Q931_IE_CONNECTED_ADDR, "Connected Address", dump_connected_number, receive_connected_number, transmit_connected_number },
3959
	{ 1, Q931_IE_CONNECTED_ADDR, "Connected Address", dump_connected_number, receive_connected_number, transmit_connected_number },
3916
	{ 1, Q931_IE_CONNECTED_NUM, "Connected Number", dump_connected_number, receive_connected_number, transmit_connected_number },
3960
	{ 1, Q931_IE_CONNECTED_NUM, "Connected Number", dump_connected_number, receive_connected_number, transmit_connected_number },
3917
	{ 1, Q931_IE_CONNECTED_SUBADDR, "Connected Subaddress", dump_connected_subaddr, receive_connected_subaddr, transmit_connected_subaddr },
3961
	{ 1, Q931_IE_CONNECTED_SUBADDR, "Connected Subaddress", dump_connected_subaddr, receive_connected_subaddr, transmit_connected_subaddr },
3918
	{ 1, Q931_IE_ORIGINAL_CALLED_NUMBER, "Original Called Number", dump_redirecting_number, receive_redirecting_number, transmit_redirecting_number },
3962
	{ 1, Q931_IE_ORIGINAL_CALLED_NUMBER, "Original Called Number", dump_redirecting_number, receive_redirecting_number, transmit_redirecting_number },
3919
	{ 1, Q931_IE_USER_USER_FACILITY, "User-User Facility" },
3963
	{ 1, Q931_IE_USER_USER_FACILITY, "User-User Facility" },
[+20] [20] 5869 lines
  1. branches/1.4/q931.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.