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.

Changes between revision 1 and 3

1 2 3
1 2 3

  1. branches/1.4/q931.c: Loading...
branches/1.4/q931.c
Diff Revision 1 Diff Revision 3
[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] 59 lines
[+20] [+] static char *ri2str(int ri)
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,
1578
	pri_message(ctrl,
1579
		"%c %s (len=%2d) [ Ext: %d  Spare: %d  Resetting %s (%d) ]\n", 
1579
		"%c %s (len=%2d) [ Ext: %d  Spare: %d  Resetting %s (%d) ]\n",
1580
		prefix, ie2str(full_ie), len, (ie->data[0] & 0x80) >> 7,
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);
1581
		(ie->data[0] & 0x78) >> 3, ri2str(ie->data[0] & 0x7), ie->data[0] & 0x7);
1582
}
1582
}
1583

    
   
1583

   
1584
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)
[+20] [20] 123 lines
[+20] [+] static void dump_bearer_capability(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
1708
		prefix, ie2str(full_ie), len, (ie->data[0] & 0x80 ) >> 7,
1708
		prefix, ie2str(full_ie), len, (ie->data[0] & 0x80 ) >> 7,
1709
		(ie->data[0] & 0x60) >> 5, cap2str(ie->data[0] & 0x1f),
1709
		(ie->data[0] & 0x60) >> 5, cap2str(ie->data[0] & 0x1f),
1710
		(ie->data[0] & 0x1f));
1710
		(ie->data[0] & 0x1f));
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);
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);
1712

    
   
1712

   
1713
	/* octet 4.1 exists iff mode/rate is multirate */
1713
	/* octet 4.1 exists if mode/rate is multirate */
1714
	if ((ie->data[1] & 0x7f) == 0x18) {
1714
	if ((ie->data[1] & 0x7f) == 0x18) {
1715
	    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);
1716
		pos++;
1716
		pos++;
1717
	}
1717
	}
1718

    
   
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)
1841
	switch (ie->data[0] & 0x60) {
1841
	switch (ie->data[0] & 0x60) {
1842
	case 0x00:/* ITU-T standardized coding */
1842
	case 0x00:/* ITU-T standardized coding */
1843
		call->bc.transcapability = ie->data[0] & 0x1f;
1843
		call->bc.transcapability = ie->data[0] & 0x1f;
1844
		call->bc.transmoderate = ie->data[1] & 0x7f;
1844
		call->bc.transmoderate = ie->data[1] & 0x7f;
1845

    
   
1845

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

    
   
1850

   
1851
		/* 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)
1922
	tc = call->bc.transcapability;
1922
	tc = call->bc.transcapability;
1923
	ie->data[0] = 0x80 | tc;
1923
	ie->data[0] = 0x80 | tc;
1924
	ie->data[1] = call->bc.transmoderate | 0x80;
1924
	ie->data[1] = call->bc.transmoderate | 0x80;
1925

    
   
1925

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

    
   
1931

   
1932
	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] 217 lines
[+20] [+] static void dump_called_party_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2150

    
   
2150

   
2151
	q931_strget(cnum, sizeof(cnum), ie->data + 1, len - 3);
2151
	q931_strget(cnum, sizeof(cnum), ie->data + 1, len - 3);
2152
	pri_message(ctrl,
2152
	pri_message(ctrl,
2153
		"%c %s (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)  '%s' ]\n",
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,
2154
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,

    
   
2155

   
2155
		ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,
2156
		ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,
2156
		npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f, cnum);
2157
		npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f, cnum);
2157
}
2158
}
2158

    
   
2159

   
2159
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)
[+20] [20] 13 lines
[+20] [+] static void dump_calling_party_number(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2173
	pri_message(ctrl,
2174
	pri_message(ctrl,
2174
		"%c %s (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)\n",
2175
		"%c %s (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)\n",
2175
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,
2176
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,
2176
		ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,
2177
		ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,
2177
		npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);
2178
		npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);
2178
	if (ie->data[0] & 0x80)
2179
	if (ie->data[0] & 0x80) {
2179
		pri_message(ctrl, "%c                           Presentation: %s (%d)  '%s' ]\n", prefix, pri_pres2str(0), 0, cnum);
2180
		pri_message(ctrl, "%c                                 Presentation: %s (%d)  '%s' ]\n",
2180
	else
2181
			prefix, pri_pres2str(0), 0, cnum);
2181
		pri_message(ctrl, "%c                           Presentation: %s (%d)  '%s' ]\n", prefix, pri_pres2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f, 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
	}
2182
}
2186
}
2183

    
   
2187

   
2184
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)
2185
{
2189
{
2186
	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);
[+20] [20] 9 lines
[+20] [+] static void dump_calling_party_category(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2196

    
   
2200

   
2197
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)
2198
{
2202
{
2199
	unsigned char cnum[256];
2203
	unsigned char cnum[256];
2200
	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

   
2201
	/* 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
2202
	   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 */
2203
	do {
2214
	do {
2204
		switch(i) {
2215
		switch(i) {
2205
		case 0:	/* Octet 3 */
2216
		case 0:	/* Octet 3 */
2206
			pri_message(ctrl,
2217
			pri_message(ctrl,
2207
				"%c %s (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)",
2218
				"%c %s (len=%2d) [ Ext: %d  TON: %s (%d)  NPI: %s (%d)",
2208
				prefix, ie2str(full_ie), len, ie->data[0] >> 7,
2219
				prefix, ie_str, len, ie->data[0] >> 7,
2209
				ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,
2220
				ton2str((ie->data[0] >> 4) & 0x07), (ie->data[0] >> 4) & 0x07,
2210
				npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);
2221
				npi2str(ie->data[0] & 0x0f), ie->data[0] & 0x0f);
2211
			break;
2222
			break;
2212
		case 1: /* Octet 3a */
2223
		case 1: /* Octet 3a */
2213
			pri_message(ctrl, "\n");
2224
			pri_message(ctrl, "\n");
2214
			pri_message(ctrl, "%c                               Ext: %d  Presentation: %s (%d)",
2225
			pri_message(ctrl, "%-*c Ext: %d  Presentation: %s (%d)",
2215
				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);
2216
			break;
2227
			break;
2217
		case 2: /* Octet 3b */
2228
		case 2: /* Octet 3b */
2218
			pri_message(ctrl, "\n");
2229
			pri_message(ctrl, "\n");
2219
			pri_message(ctrl, "%c                               Ext: %d  Reason: %s (%d)",
2230
			pri_message(ctrl, "%-*c Ext: %d  Reason: %s (%d)",
2220
				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);
2221
			break;
2232
			break;
2222
		}
2233
		}
2223
	} while(!(ie->data[i++]& 0x80));
2234
	} while (!(ie->data[i++] & 0x80));
2224
	q931_strget(cnum, sizeof(cnum), ie->data + i, ie->len - i);
2235
	q931_strget(cnum, sizeof(cnum), ie->data + i, ie->len - i);
2225
	pri_message(ctrl, "  '%s' ]\n", cnum);
2236
	pri_message(ctrl, "  '%s' ]\n", cnum);
2226
}
2237
}
2227

    
   
2238

   
2228
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] 390 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)
2619

    
   
2630

   
2620
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)
2621
{
2632
{
2622
	int x;
2633
	int x;
2623
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2634
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2624
	for (x = 0; x < ie->len; x++)
2635
	for (x = 0; x < ie->len; x++) {
2625
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
2636
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);

    
   
2637
	}
2626
	pri_message(ctrl, " ]\n");
2638
	pri_message(ctrl, " ]\n");
2627
}
2639
}
2628

    
   
2640

   
2629

    
   
2641

   
2630
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)
2658
}
2670
}
2659

    
   
2671

   
2660
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)
2661
{
2673
{
2662
	int x;
2674
	int x;
2663
	
2675

   
2664
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2676
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2665
	for (x = 0; x < ie->len; x++) {
2677
	for (x = 0; x < ie->len; x++) {
2666
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
2678
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
2667
	}
2679
	}
2668
	pri_message(ctrl, " ]\n");
2680
	pri_message(ctrl, " ]\n");
[+20] [20] 546 lines
[+20] [+] static void dump_call_state(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3215

    
   
3227

   
3216
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)
3217
{
3229
{
3218
	int x;
3230
	int x;
3219
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), len);
3231
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), len);
3220
	for (x = 0; x < ie->len; x++) 
3232
	for (x = 0; x < ie->len; x++) {
3221
		pri_message(ctrl, "0x%02X ", ie->data[x]);
3233
		pri_message(ctrl, "0x%02X ", ie->data[x]);

    
   
3234
	}
3222
	pri_message(ctrl, " ]\n");
3235
	pri_message(ctrl, " ]\n");
3223
}
3236
}
3224

    
   
3237

   
3225
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)
3226
{
3239
{
[+20] [20] 182 lines
[+20] [+] static void dump_facility(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3409
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)
3410
{
3423
{
3411
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), ie->len);
3424
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), ie->len);
3412
	if (ie->data[0] == 0x00) {
3425
	if (ie->data[0] == 0x00) {
3413
 		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)));
3414
	}
3427
	} else {
3415
	else

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

    
   
3429
	}
3417
	pri_message(ctrl, " ]\n");
3430
	pri_message(ctrl, " ]\n");
3418
}
3431
}
3419

    
   
3432

   
3420
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)
3421
{
3434
{
[+20] [20] 41 lines
[+20] [+] static void dump_cause(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3463
	pri_message(ctrl, "%c %s (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",
3464
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,
3477
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,
3465
		coding2str((ie->data[0] & 0x60) >> 5), (ie->data[0] & 0x60) >> 5,
3478
		coding2str((ie->data[0] & 0x60) >> 5), (ie->data[0] & 0x60) >> 5,
3466
		(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);
3467
	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",
3468
		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,
3469
			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);
3470
	if (ie->len < 3)
3483
	if (ie->len < 3)
3471
		return;
3484
		return;
3472
	/* Dump cause data in readable form */
3485
	/* Dump cause data in readable form */
3473
	switch(ie->data[1] & 0x7f) {
3486
	switch(ie->data[1] & 0x7f) {
[+20] [20] 120 lines
[+20] [+] static int transmit_notify(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order)
3594
	return 0;
3607
	return 0;
3595
}
3608
}
3596

    
   
3609

   
3597
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)
3598
{
3611
{
3599
	pri_message(ctrl, "%c %s%s (len=%02d): Requested codeset %d\n",
3612
	pri_message(ctrl, "%c %sLocking Shift (len=%02d): Requested codeset %d\n",
3600
		prefix, (full_ie & 8) ? "Non-" : "", ie2str(full_ie), len, full_ie & 7);
3613
		prefix, (full_ie & 8) ? "Non-" : "", len, full_ie & 7);
3601
}
3614
}
3602

    
   
3615

   
3603
static char *lineinfo2str(int info)
3616
static char *lineinfo2str(int info)
3604
{
3617
{
3605
	/* NAPNA ANI II digits */
3618
	/* NAPNA ANI II digits */
[+20] [20] 295 lines
[+20] [+] static struct ie ies[] = {
3901
	{ 1, NATIONAL_CHANGE_STATUS, "Change Status Information", 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 },
3902
	{ 0, Q931_LOCKING_SHIFT, "Locking Shift", dump_shift },
3915
	{ 0, Q931_LOCKING_SHIFT, "Locking Shift", dump_shift },
3903
	{ 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 },
3904
	{ 0, Q931_CAUSE, "Cause", dump_cause, receive_cause, transmit_cause },
3917
	{ 0, Q931_CAUSE, "Cause", dump_cause, receive_cause, transmit_cause },
3905
	{ 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 },
3906
	{ 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 },
3907
	{ 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 },
3908
	{ 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 },
3909
	{ 1, Q931_INFORMATION_RATE, "Information Rate" },
3922
	{ 1, Q931_INFORMATION_RATE, "Information Rate" },
3910
	{ 1, Q931_TRANSIT_DELAY, "End-to-End Transit Delay" },
3923
	{ 1, Q931_TRANSIT_DELAY, "End-to-End Transit Delay" },
3911
	{ 1, Q931_TRANS_DELAY_SELECT, "Transmit Delay Selection and Indication" },
3924
	{ 1, Q931_TRANS_DELAY_SELECT, "Transmit Delay Selection and Indication" },
[+20] [20] 5908 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.