[Home]

Summary:ASTERISK-06450: [patch] improve indication of peer status in "sip show peers"
Reporter:Edwin Groothuis (mavetju)Labels:
Date Opened:2006-03-01 21:30:01.000-0600Date Closed:2006-09-19 10:24:16
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) patch-channels::chan_sip.c
( 1) spacingfix.diff
( 2) spacingfix2.diff
Description:With this output:
Name/username              Host            Dyn Nat ACL Port     Status    
clai                       (Unspecified)    D   N      0        Unmonitored
lpritchard/lpritchard      10.197.5.143     D   N      5060     Unmonitored
jsheahan/jsheahan          10.197.5.198     D   N      5060     Unmonitored
ivox-sip                   202.83.183.33               5060     OK (11 ms)
voiceblue/voiceblue        10.192.13.14                5060     UNREACHABLE

I get:
5 sip peers [4 online , 1 offline]

This must of course be:
5 sip peers [3 online , 1 offline]

Or preferable:
5 sip peers [3 online , 1 offline, 3 unmonitored]

Or to be fully complete in the blink of an eye:
5 sip peers [1+2 online, 1 offline, 1 unmonitored]

This patch...

- Adds a additional commentline to peer_status()
- Outputs the last line specified in the examples above
- Cleans up a little bit of code-rot around line 7653 where it first compares with non-0, then elses and compares it with 0, and then elses again.

The patch will fail on a 1.2 branch on the additional commentline to peer_status(), due to an additional */ in the line before. Manual patching should be obvious.
Comments:By: opsys (opsys) 2006-04-30 00:55:25

I have not been able to reproduce this in any on my machine both lab and prod.

Can you verisfy that you are still having this problem?

I have checked from 1.2.5 - 1.2.7

By: Serge Vecher (serge-v) 2006-05-08 10:58:48

this looks to me more of a feature, than a bug. Current code is oblivious to 'qualify' setting when doing 'sip show peers'. With this patch, it is.

I'm uncomfortable with the term 'monitored' when describing such peers, though. Term 'monitor' is not used anywhere in relation to 'qualify' setting. In fact, it maybe confused with Monitor dialplan command. May I suggest 'unQUALIFYed' or something similar?

By: Serge Vecher (serge-v) 2006-05-19 14:15:37

mavetju: can you please update your patch here to recent trunk? Thank you.

By: Serge Vecher (serge-v) 2006-06-06 12:29:27

Ok, I've tried to apply the patch to trunk r32633 and it actually did apply, albeit with some fuzz (but no rejects). Observed the same output as indicated by mavetju.

+1 to get this in. Thanks.

By: Serge Vecher (serge-v) 2006-06-30 10:55:37

sorry to bug you oej ;)

By: Andrey S Pankov (casper) 2006-06-30 16:32:34

vechers: what about 'if (pstatus==1)' and so on... not 'if (pstatus == 1)'? :)

By: Serge Vecher (serge-v) 2006-07-05 08:41:38

casper: thanks, I've missed those.

By: Serge Vecher (serge-v) 2006-09-01 13:52:17

/me bugs oej again.

By: Anthony LaMantia (alamantia) 2006-09-01 16:33:07

update aginst the latest trunk.. confirmed working.

By: Jason Parker (jparker) 2006-09-01 16:59:02

Can I recommend something more like the following?  "1+2 online" is confusing at best.

Monitored: 1 online, 2 offline\nUnmonitored: 3 online, 12 offline

By: Anthony LaMantia (alamantia) 2006-09-01 17:13:02

updated.

By: Joshua C. Colp (jcolp) 2006-09-19 10:24:15

Put into trunk as of revision 43263. Thanks!