Summary:ASTERISK-03300: sip show peers output sometimes truncates first character on peer/user name
Date Opened:2005-01-18 10:13:31.000-0600Date Closed:2011-06-07 14:09:59
Versions:Frequency of
Description:Using Asterisk 1.0.3 stable, performing a sip show peers about 2-3 seconds after another sip show peers will sometimes truncate the first character on the listing. In addtional information, I've shown a copy/paste of the incorrect output. Not too critical, but just annoying :)


3050340023       (Unspecified)    D   N  0        UNKNOWN  
3050340022       (Unspecified)    D   N  0        UNKNOWN  
3050340021       (Unspecified)    D   N  0        UNKNOWN  
3050340020       (Unspecified)    D   N  0        UNKNOWN  
3050340019       (Unspecified)    D   N  0        UNKNOWN  
3050340018       (Unspecified)    D   N  0        UNKNOWN  
3050340017       (Unspecified)    D   N  0        UNKNOWN  
3050340016       (Unspecified)    D   N  0        UNKNOWN  
3050340015       (Unspecified)    D   N  0        UNKNOWN  
3050340014       (Unspecified)    D   N  0        UNKNOWN  
3050340013       (Unspecified)    D   N  0        UNKNOWN  
3050340012       (Unspecified)    D   N  0        UNKNOWN  
3050340011       (Unspecified)    D   N  0        UNKNOWN  
3050340010       (Unspecified)    D   N  0        UNKNOWN  
3050340009       (Unspecified)    D   N  0        UNKNOWN  
3050340008       (Unspecified)    D   N  0        UNKNOWN  
3050340007       (Unspecified)    D   N  0        UNKNOWN  
3050340006       (Unspecified)    D   N  0        UNKNOWN  
050340005/3050  (Unspecified)    D   N  0        UNKNOWN  
3050340004/3050  (Unspecified)    D   N  0        UNKNOWN  
3050340003       (Unspecified)    D   N  0        UNKNOWN  
3050340002       (Unspecified)    D   N  0        UNKNOWN  
3050340001       (Unspecified)    D   N  0        UNKNOWN  
3050340000       (Unspecified)    D   N  0        UNKNOWN  
3213084004/3213  xxx.xxx.xxx.xxx   D   N  1029     OK (29 ms)
3213084003/3213  xxx.xxx.xxx.xxx   D   N  1029     OK (48 ms)
3213085000       xxx.xxx.xxx.xxx     5060     OK (17 ms)
3213084999       xxx.xxx.xxx.xxx      5060     OK (3 ms)
5556/5556        xxx.xxx.xxx.xxx   D   N  5060     OK (113 ms)
5555/5555        xxx.xxx.xxx.xxx   D   N  5060     OK (117 ms)
2000             (Unspecified)    D  0        UNKNOWN
Comments:By: () 2005-01-18 10:14:35.000-0600

Disclaimer on file.

By: twisted (twisted) 2005-01-18 10:26:59.000-0600

It's really hard to see the problem when you can't tell what the full peer name was supposed to be in the first place.

By: () 2005-01-18 10:32:20.000-0600

050340005/3050 (Unspecified) D N 0 UNKNOWN

is the problem line

it should be

3050340005/3050 ... ... ..

By: () 2005-01-18 10:32:43.000-0600

it happens randomly, to different peer names

By: Mark Spencer (markster) 2005-01-18 10:38:51.000-0600

Only on asterisk -r?

By: () 2005-01-18 10:44:12.000-0600

When manager logged in and asterisk -r

By: Mark Spencer (markster) 2005-01-18 16:05:55.000-0600

But not on the main console right?

By: Kevin P. Fleming (kpfleming) 2005-01-18 19:36:17.000-0600

My business partner has reported this problem as well, on CVS HEAD, using "asterisk -r", but I have never seen it myself.

By: () 2005-01-18 22:48:34.000-0600

I apologize, but I don't know what you mean by main console. I log into asterisk via CLI using asterisk -r. Then if I do a sip show peers, then it causes the irregularity. I have tried it on three different terminals, including actually putting a KVM cable on the * machine and checking it from there, SSH for Windows, PuTTY, and Eterm. Same problem. This occurs when also doing a sip show peers from the manager interface.

By: Brian West (bkw918) 2005-01-18 23:21:49.000-0600

start asterisk with "asterisk -gcv"

then at that -c console try it again.


By: Mark Spencer (markster) 2005-01-18 23:58:45.000-0600

Does the problem not occur on CVS head?

By: () 2005-01-19 08:20:47.000-0600

With asterisk -gcv then doing sip show peers, exhibits same behavior... very odd

By: Kevin P. Fleming (kpfleming) 2005-01-19 08:49:01.000-0600

Looking at the CVS HEAD code, I can only see a couple of possibilities where this could be happening... It could be a printf bug, where we are using "-25.25s" to format the name string. I would try to changing that to just "25s" to see if you can still reproduce the problem (although the output format could change slightly).

There is also a small possibility the ast_careful write might have a problem, but that's very unlikely.

(I also noticed that the function for "sip show peers" is building the entire output string into a "srch" buffer then never using it... this could be removed).

By: () 2005-01-19 13:50:27.000-0600

Ok, I'm running HEAD on another server. I'll try to reproduce the error on that machine later.

By: () 2005-01-20 07:19:42.000-0600

Ok, problem occurs on HEAD also. Also, it appears that the truncation is totally random, but usually only occurring near the last 10 or so peer listings.

By: () 2005-01-20 08:27:21.000-0600

Working on patch... standby

edited on: 01-20-05 08:29

By: () 2005-01-20 12:44:50.000-0600

Ok, after looking at 1.0.3 code it seems that it has already been changed to 25s instead of -25.25s. So I don't know what the problem is ??????

By: Mark Spencer (markster) 2005-01-20 21:55:33.000-0600

I seem entirely unable to duplicate this problem even with about 50 peers in my list...

By: () 2005-01-21 06:14:05.000-0600

I have about 150 on my list

By: Olle Johansson (oej) 2005-01-25 12:00:30.000-0600

Which operating system/distro are you running?

By: Olle Johansson (oej) 2005-02-14 01:40:13.000-0600

No communication for more than two weeks, seems like we can't replicate the bug or that we have lost interest in it. Reopen if you have new information.