[Home]

Summary:ASTERISK-13309: sip show users does not exist
Reporter:Benny Amorsen (amorsen)Labels:
Date Opened:2009-01-06 08:12:19.000-0600Date Closed:2009-01-22 12:37:56.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) sip_show_users_161.diff
( 1) sip_show_users_161v2.diff
( 2) sip_show_users_161v3.diff
Description:vpbx03*CLI> core show version
Asterisk 1.6.1-beta4 built by amorsen @ ursa.amorsen.dk on a x86_64 running Linux on 2009-01-06 13:24:23 UTC
vpbx03*CLI> sip show users
No such command 'sip show users' (type 'help sip show users' for other possible commands)
vpbx03*CLI> help sip show users
No such command 'sip show users'.

The example sip.conf contains this:
; Useful CLI commands to check peers/users:
;   sip show peers               Show all SIP peers (including friends)
;   sip show users               Show all SIP users (including friends)
Comments:By: Leif Madsen (lmadsen) 2009-01-06 08:18:05.000-0600

I'm pretty certain you don't have chan_sip.so loaded.

By: Leif Madsen (lmadsen) 2009-01-06 08:20:24.000-0600

Do something like this:

*CLI> module show like chan

And you'll get output similar to the following, make sure 'chan_sip.so' is loaded. If it is not loaded, then please refer to the asterisk-users list for support. If you still believe this to be an issue, please find a bug marshall on irc.freenode.net in the #asterisk-bugs room. Thanks!


Module                         Description                              Use Count
func_channel.so                Channel information dialplan functions   0        
chan_iax2.so                   Inter Asterisk eXchange (Ver 2)          0        
app_chanisavail.so             Check channel availability               0        
app_dumpchan.so                Dump Info About The Calling Channel      0        
chan_gtalk.so                  Gtalk Channel Driver                     0        
app_chanspy.so                 Listen to the audio of an active channel 0        
chan_phone.so                  Linux Telephony API Support              0        
chan_oss.so                    OSS Console Channel Driver               0        
chan_sip.so                    Session Initiation Protocol (SIP)        0

By: Leif Madsen (lmadsen) 2009-01-06 09:38:12.000-0600

Actually I was a bit quick on closing this. I have also noticed that command is missing. It may have something to do with the 'Kill The User' stuff, but until I get a definitive answer, I will assign this to myself.

By: Leif Madsen (lmadsen) 2009-01-07 10:04:18.000-0600

Assigned to putnopvut after discussing on IRC.

By: Mark Michelson (mmichelson) 2009-01-07 11:04:32.000-0600

I uploaded a patch called sip_show_users_161.diff

This adds the missing CLI commands "sip show users" and "sip show user" back to the code. As far as the content produced by these, I simply copied the logic from Asterisk 1.6.0 into here.

I haven't done extensive testing of this, so it would be appreciated if someone could verify that this works as expected. Thanks

By: pj (pj) 2009-01-08 02:21:45.000-0600

why to have 'sip show users', when 'type=user' is deprecated/removed from trunk? Personally, I use always type=peer without issues.

By: Benny Amorsen (amorsen) 2009-01-08 02:40:13.000-0600

type=peer is a problem in this case:

One client tries to register several times to Asterisk with different accounts, using the same source SIP port and IP address. This works fine. When the client tries to place calls, Asterisk authenticates the invite, but only matches the provided credentials against the LAST entry in sip.conf which has the right IP-address and port (in 1.6.1 it seems to be the FIRST entry, but that doesn't help). Therefore the client can only send calls from one account.

type=user has the great advantage that it doesn't try to match on IP address and port, it just lets the client authenticate.

By: Mark Michelson (mmichelson) 2009-01-08 10:35:00.000-0600

pj, I think you are mistaken. type=user is not deprecated in trunk. The "kill the user" changes that were made were supposedly just internal changes so that there was only one structure used for SIP endpoints instead of two. Using "type=user" is still valid (or should be) in trunk and 1.6.1, and anything that people were accustomed to using with SIP "users" should appear to be unchanged.

By: Leif Madsen (lmadsen) 2009-01-08 14:53:59.000-0600

putnopvut: correct -- from my understanding, the kill the user changes were simply internal, and should have had no effect on the interface (interface being anything user side).

I think 'kill the user' was a poor choice of words in this case.

By: Leif Madsen (lmadsen) 2009-01-08 20:55:11.000-0600

In my case all I have is peers defined (type=peer), but they still show up as users. Is this your expected behaviour?

By: Mark Michelson (mmichelson) 2009-01-08 21:07:28.000-0600

A far as I know, this is not expected.

The if (user->onlymatchonip == FALSE) condition is supposed to "filter" the results to only include those SIP endpoints defined as "type=user". I'll take a closer look at work tomorrow to see why this would be false for a peer as well.

By: Leif Madsen (lmadsen) 2009-01-09 07:30:44.000-0600

btw, you'll need to add back into the sip.conf.sample file the usage instructions for 'sip show users'.

i.e.

; CLI Commands; -------------------------------------------------------------
; Useful CLI commands to check peers/users:
;   sip show peers               Show all SIP peers (including friends)
+;   sip show users               Show all SIP users (including friends)
;   sip show registry            Show status of hosts we register with
;;   sip set debug                Show all SIP messages
;;   module reload chan_sip.so    Reload configuration file
;

tsk tsk... functionality removed, but nothing mentioned in UPGRADE-1.6.txt or CHANGES.

By: Mark Michelson (mmichelson) 2009-01-09 14:31:11.000-0600

Ah, I see what I did. It looks like a simple case of reversed logic. I'll upload a new patch in a sec.

By: Mark Michelson (mmichelson) 2009-01-09 14:32:32.000-0600

I have uploaded sip_show_users_161v2.diff for testing.

By: Mark Michelson (mmichelson) 2009-01-09 15:29:43.000-0600

Uploaded sip_show_users_161v3.diff after blitzrage reported to me that the "sip show peers" command was also showing sip users.

By: Leif Madsen (lmadsen) 2009-01-09 22:09:49.000-0600

Just to make a note here, this appears to be working fine for me based on my simple tests.

By: Olle Johansson (oej) 2009-01-12 09:11:58.000-0600

I think removing "sip show users" was my mistake. And it wen't into release far too quickly.

By: Mark Michelson (mmichelson) 2009-01-12 16:06:04.000-0600

I'm changing this to ready for testing. If someone besides blitzrage can confirm that this is working for him, then that'll be good enough to get this merged in. It's not that I don't trust blitzrage, but I just would like to get some more testing.

By: Benny Amorsen (amorsen) 2009-01-13 03:39:06.000-0600

It works great! Thank you

By: Mark Michelson (mmichelson) 2009-01-13 15:41:11.000-0600

Excellent. I'll get this merged into trunk and 1.6.1.

By: Leif Madsen (lmadsen) 2009-01-14 13:37:53.000-0600

putnopvut: no no... I see how it is.

You have made blitzrage a saaaaaaaaaaaaaaaaaaaaad panda :(

By: Digium Subversion (svnbot) 2009-01-14 14:13:49.000-0600

Repository: asterisk
Revision: 168610

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r168610 | mmichelson | 2009-01-14 14:13:48 -0600 (Wed, 14 Jan 2009) | 9 lines

Restore the "sip show users" and "sip show user" CLI commands

(closes issue ASTERISK-13309)
Reported by: amorsen
Patches:
     sip_show_users_161v3.diff uploaded by putnopvut (license 60)
Tested by: blitzrage, amorsen


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=168610

By: Digium Subversion (svnbot) 2009-01-14 14:18:56.000-0600

Repository: asterisk
Revision: 168611

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_sip.c

------------------------------------------------------------------------
r168611 | mmichelson | 2009-01-14 14:18:56 -0600 (Wed, 14 Jan 2009) | 17 lines

Merged revisions 168610 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r168610 | mmichelson | 2009-01-14 14:13:48 -0600 (Wed, 14 Jan 2009) | 9 lines

Restore the "sip show users" and "sip show user" CLI commands

(closes issue ASTERISK-13309)
Reported by: amorsen
Patches:
     sip_show_users_161v3.diff uploaded by putnopvut (license 60)
Tested by: blitzrage, amorsen


........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=168611

By: Benny Amorsen (amorsen) 2009-01-21 02:22:22.000-0600

I'm really sorry. The patch breaks sip show peers when type=friend. Suddenly type=friend only shows up as user, not as peer.

By: Mark Michelson (mmichelson) 2009-01-22 12:37:56.000-0600

I fixed this behavior in revision 169791 of Asterisk trunk and revision 169792 of Asterisk 1.6.1. I am re-closing since I have fixed the problem.