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 2

1 2 3
1 2 3

  1. branches/1.4/q931.c: Loading...
branches/1.4/q931.c
Diff Revision 1 Diff Revision 2
[20] 1573 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] 1034 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

    
   
2619

   
2620
static void dump_user_user(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2620
static void dump_user_user(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2621
{
2621
{
2622
	int x;
2622
	int x;
2623
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2623
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2624
	for (x = 0; x < ie->len; x++)
2624
	for (x = 0; x < ie->len; x++) {
2625
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
2625
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);

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

    
   
2629

   
2629

    
   
2630

   
2630
static int receive_user_user(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
2631
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
}
2659
}
2659

    
   
2660

   
2660
static void dump_change_status(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2661
static void dump_change_status(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
2661
{
2662
{
2662
	int x;
2663
	int x;
2663
	
2664

   
2664
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2665
	pri_message(ctrl, "%c %s (len=%2d) [", prefix, ie2str(full_ie), len);
2665
	for (x = 0; x < ie->len; x++) {
2666
	for (x = 0; x < ie->len; x++) {
2666
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
2667
		pri_message(ctrl, " %02x", ie->data[x] & 0x7f);
2667
	}
2668
	}
2668
	pri_message(ctrl, " ]\n");
2669
	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

    
   
3216

   
3216
static void dump_call_identity(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3217
static void dump_call_identity(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3217
{
3218
{
3218
	int x;
3219
	int x;
3219
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), len);
3220
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), len);
3220
	for (x = 0; x < ie->len; x++) 
3221
	for (x = 0; x < ie->len; x++) {
3221
		pri_message(ctrl, "0x%02X ", ie->data[x]);
3222
		pri_message(ctrl, "0x%02X ", ie->data[x]);

    
   
3223
	}
3222
	pri_message(ctrl, " ]\n");
3224
	pri_message(ctrl, " ]\n");
3223
}
3225
}
3224

    
   
3226

   
3225
static void dump_time_date(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3227
static void dump_time_date(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3226
{
3228
{
[+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)
3411
static void dump_network_spec_fac(int full_ie, struct pri *ctrl, q931_ie *ie, int len, char prefix)
3410
{
3412
{
3411
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), ie->len);
3413
	pri_message(ctrl, "%c %s (len=%2d) [ ", prefix, ie2str(full_ie), ie->len);
3412
	if (ie->data[0] == 0x00) {
3414
	if (ie->data[0] == 0x00) {
3413
 		pri_message(ctrl, "%s", code2str(ie->data[1], facilities, ARRAY_LEN(facilities)));
3415
		pri_message(ctrl, "%s", code2str(ie->data[1], facilities, ARRAY_LEN(facilities)));
3414
	}
3416
	} else {
3415
	else

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

    
   
3418
	}
3417
	pri_message(ctrl, " ]\n");
3419
	pri_message(ctrl, " ]\n");
3418
}
3420
}
3419

    
   
3421

   
3420
static int receive_network_spec_fac(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3422
static int receive_network_spec_fac(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
3421
{
3423
{
[+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",
3465
	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,
3466
		prefix, ie2str(full_ie), len, ie->data[0] >> 7,
3465
		coding2str((ie->data[0] & 0x60) >> 5), (ie->data[0] & 0x60) >> 5,
3467
		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);
3468
		(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",
3469
	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, 
3470
		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);
3471
		pri_causeclass2str((ie->data[1] & 0x7f) >> 4), (ie->data[1] & 0x7f) >> 4);
3470
	if (ie->len < 3)
3472
	if (ie->len < 3)
3471
		return;
3473
		return;
3472
	/* Dump cause data in readable form */
3474
	/* Dump cause data in readable form */
3473
	switch(ie->data[1] & 0x7f) {
3475
	switch(ie->data[1] & 0x7f) {
[+20] [20] 6346 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.