[Home]

Summary:ASTERISK-09609: [patch] for debug output for ss7
Reporter:Mike Anikienko (mike anikienko)Labels:
Date Opened:2007-06-06 13:23:35Date Closed:2007-06-18 14:47:17
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) ss7.c.2.diff
( 1) ss7.c.3.diff
( 2) ss7.c.4.diff
( 3) ss7.c.diff
Description:When we set debug ss7, we can see horrible output at console:
[1] Len = 22 [ [1] fc [1] ef [1] 11 [1] c1 [1] 18 [1] 37 [1] c5 [1] 0d [1] 11 [1] a0 [1] c4 [1] c4 [1] c4 [1] c4 [1] c4 [1] c4 [1] c4 [1] c4 [1] c4 [1] c4 [1] bb [1] 5c [1] ]
[1] FSN: 111 FIB 1
[1] BSN: 124 BIB 1
[1] <[0] MSU

Why here there are a lot of [1]? - This is side effect!

This patch solve this problem:
[1] Len = 22 [ 84 85 11 c1 18 37 c5 0d 11 a0 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c5 ca ]
[1] FSN: 5 FIB 1
[1] BSN: 4 BIB 1
[1] <[0] MSU

****** ADDITIONAL INFORMATION ******

Before patch in full log this horrible output is more horrible than at console:
[Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] Len = 22 [ [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] 90 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] 83 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] 11 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c1 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] 18 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] 37 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c5 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] 0d [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] 11 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] a0 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] c4 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] 96 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] 41 [Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] ]
[Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] FSN: 3 FIB 1
[Jun  6 21:41:14] VERBOSE[5108] logger.c: [1] BSN: 16 BIB 1

After patch:
[1] Len = 22 [ 84 85 11 c1 18 37 c5 0d 11 a0 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c5 ca ]
[1] FSN: 5 FIB 1
[1] BSN: 4 BIB 1
[1] <[0] MSU
Comments:By: Mike Anikienko (mike anikienko) 2007-06-06 13:27:56

Off topic
Why mantis reject with error report for libss7, when I set field SVN Revision?

By: Jason Parker (jparker) 2007-06-06 13:31:01

I agree with the idea behind this patch, but the way this is written, very bad things can happen if len is too large...

By: Mike Anikienko (mike anikienko) 2007-06-06 13:31:48

Sorry, small correction:
At Additional Informarion last paragraph must be:

After patch:
[Jun  6 21:47:40] VERBOSE[6313] logger.c: [1] Len = 22 [ 88 88 11 c1 14 37 c6 0d 21 a0 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 00 00 ]
[Jun  6 21:47:40] VERBOSE[6313] logger.c: [1] FSN: 8 FIB 1
[Jun  6 21:47:40] VERBOSE[6313] logger.c: [1] BSN: 8 BIB 1
[Jun  6 21:47:40] VERBOSE[6313] logger.c: [1] >[0] MSU

By: Mike Anikienko (mike anikienko) 2007-06-06 13:36:43

About char tmp[1024]?

As far as I know max len of MTP message 272 byte.
3 symbols * 272 < 1024

I think it not a problem.

By: Jason Parker (jparker) 2007-06-06 13:44:20

At the very least, you should probably change it to a snprintf call that can't be bigger than sizeof(tmp)

By: Mike Anikienko (mike anikienko) 2007-06-06 13:53:45

Like this?

By: Jason Parker (jparker) 2007-06-06 14:01:46

Yes, that looks safer, thanks.

By: Mike Anikienko (mike anikienko) 2007-06-09 07:11:47

New patch, because new rev 85 commied by mattf.

[1] [ [1] 86 [1] 86 [1] 0d [1] ]
[1] FSN: 6 FIB 1
[1] BSN: 6 BIB 1
[1] <[0] MSU
[1]     [1] [ [1] c5 [1] ]
[1]     Network Indicator: 3 Priority: 0 User Part: ISUP
[1]     [1] [ [1] 18 [1] 37 [1] c5 [1] cd [1] ]
[1]     OPC 14100 DPC 14104 SLS 12
[1]     [1]     [1] [ [1] 1c [1] 00 [1] ]
[1]             CIC: 28
[1]     [1]     [1] [ [1] 0c [1] ]
[1]             Message Type: REL

Is it readable?

With my new patch this debug:

[1] Len = 16 [ 87 8a 0d c5 14 37 c6 cd 0c 00 0c 02 00 02 81 90 ]
[1] [ 87 8a 0d ]
[1] FSN: 10 FIB 1
[1] BSN: 7 BIB 1
[1] >[0] MSU
[1]     [ c5 ]
[1]     Network Indicator: 3 Priority: 0 User Part: ISUP
[1]     [ 14 37 c6 cd ]
[1]     OPC 14104 DPC 14100 SLS 12
[1]             [ 0c 00 ]
[1]             CIC: 12
[1]             [ 0c ]
[1]             Message Type: REL

By: Mike Anikienko (mike anikienko) 2007-06-09 07:15:37

Oh, Mantis remove tabs.
But with patch better.

By: Mike Anikienko (mike anikienko) 2007-06-18 08:39:17

file, can assign this patch to mattf

By: Matthew Fredrickson (mattf) 2007-06-18 11:26:47

The only issue I see with it is that it appears that you're not following the existing coding style (tabs, not white spaces), and keeping indentations the same.  Otherwise, it looks pretty good.

By: Mike Anikienko (mike anikienko) 2007-06-18 13:21:52

Formating changed. ss7.c.4.diff

By: Matthew Fredrickson (mattf) 2007-06-18 14:47:16

Thanks, applied to trunk :-)