Summary:ASTERISK-13374: [patch] Add new cli "sip show registry xxx"
Reporter:nick_lewis (nick_lewis)Labels:
Date Opened:2009-01-15 04:15:13.000-0600Date Closed:2011-06-07 14:03:19
Versions:Frequency of
Environment:Attachments:( 0) bug14248.diff
( 1) chan_sip.c-regcli.patch
( 2) chan_sip.c-showreg.patch
Description:Currently the contact field is not shown on the registry display. It would be useful if it were included in the response to the sip show registry cli command. It is often more readily informative than the username or host.

The contact field is also known as r->callback and is derived from the /contact portion of the registration string.
Comments:By: Olle Johansson (oej) 2009-01-15 07:15:49.000-0600

This is really not the system to use for feature requests, Nick.

You mean what is commonly refered to as the "extension" at the end of the register= string I guess.

By: Olle Johansson (oej) 2009-01-15 07:23:03.000-0600

Please try this patch. Couldn't try it on my mac, since trunk generates a bus error... Looking forward to your feedback!

By: nick_lewis (nick_lewis) 2009-01-15 08:06:11.000-0600

Many thanks oej I will give it a go.

(I see that my robot needs to be a bit brighter when getting the registration status. At the moment it assumes the column number so it was broken by dnsmgr and now by Exten)

Since it affects the same lines of code is there any chance issue 14247 could be rolled up too?

By: Olle Johansson (oej) 2009-01-15 08:16:12.000-0600

Well, you can change to anything you want in the patch when you're testing...
The CLI commands will always be trunkating somewhere, since they're ment to run on single lines in a normal console. AMI is meant for parsing and we never trunkate anything there.

By: nick_lewis (nick_lewis) 2009-01-15 08:31:09.000-0600

Unfortunately the robot needs to work with asterisk back to 1.2 which did not contain mandescr_show_registry.

By: Olle Johansson (oej) 2009-01-15 08:35:13.000-0600

Well, we won't change 1.4 or 1.2 for new features, so you will be stuck with that. And since you have a solution for later versions, I will go ahead and close this bug.


By: Olle Johansson (oej) 2009-01-15 08:35:34.000-0600

Sorry - the other bug :-)

By: nick_lewis (nick_lewis) 2009-01-15 09:47:03.000-0600

Successfully tested a patch attached which is a slight variant of the oej patch. This patch also addresses 14247 by allowing 15 chars for username (and exten)

By: nick_lewis (nick_lewis) 2009-01-15 09:50:15.000-0600

If we are going to call this registration string parameter "exten" then perhaps it should be called this in the log message too

ast_log(LOG_WARNING, "Format for registration is [transport://]user[:secret[:authuser]]@host[:port][/exten][~expiry] at line %d\n", lineno);

but I will let this one go

By: Olle Johansson (oej) 2009-01-15 10:55:32.000-0600

Absolutely, thanks for spotting that. Contact: is just the name used in SIP signalling. For an Asterisk user, it's the extension we get the call back on.

By: Olle Johansson (oej) 2009-01-23 02:26:59.000-0600

Fixed the documentation for that log entry and updated sip.conf in the 1.6.x series and trunk earlier this month.

By: nick_lewis (nick_lewis) 2009-01-23 06:57:46.000-0600

In view of comments received in the associated issue ASTERISK-13373 , I have produced a patch that includes a sip show registration <id> cli command. It also adds the Exten field to the manager

By: nick_lewis (nick_lewis) 2009-01-23 06:59:40.000-0600

Please find attached patch against 1.6.1

By: Olle Johansson (oej) 2009-01-29 04:40:28.000-0600

New features is only added to trunk - and you know it :-)

By: Olle Johansson (oej) 2009-01-29 04:45:27.000-0600

I like this CLI command, but would suggest another approach. Instead of implementing a new identifier, use the username@domain as the unique identifier.

If we for some reason have multiple registrations to the same account, I would suggest adding a unique string to the end of the domain, like .1, .2, .3.

The AOR is the unique identifier, use it :-)


By: nick_lewis (nick_lewis) 2009-01-29 05:18:56.000-0600

I did think about using the AOR as the unique identifier but concluded that it was quicker to type an id. The id should be the order in which the registration strings appear in sip.conf but reload does confuse matters a bit.

I will rework the patch to use the AOR instead.

Regarding "multiple registrations" I do not think forking should be encouraged especially to different interfaces on the same asterisk pbx. I suggest that any such registrations are merged with a log message such as
"A registration to AOR '%s' already exists - Ignoring registration string at line '%d'\n"
"A registration to AOR '%s' already exists - Ignoring register=yes for peer '%s' at line '%d'\n"

By: Olle Johansson (oej) 2009-01-29 05:21:07.000-0600

Hear, hear... ;-)

I agree.

By: Leif Madsen (lmadsen) 2009-06-16 12:38:32

Just thought I'd ping this issue and see if Nick had a chance to update this patch to use the method he mentioned above. Thanks!

By: Leif Madsen (lmadsen) 2009-06-16 12:39:27

Changed the target for since this is a new feature and can't go into an existing branch. Additionally, change the version and branch to 'SVN' and 'trunk' respectively. Thanks!

By: nick_lewis (nick_lewis) 2009-08-03 04:11:59

Re ping - Sorry not yet and probably not imminently i'm afraid

By: Leif Madsen (lmadsen) 2009-08-05 12:49:24

Should I just close this issue for now, and you can reopen it when you have a chance to look into it further?

By: nick_lewis (nick_lewis) 2009-08-07 08:57:30

yes ok

By: Leif Madsen (lmadsen) 2009-08-07 09:25:07

Just closing and suspending this issue for now as it doesn't look like Nick will have a chance to get to this any time soon. If someone else wishes to pick this up and finish it off, I'm sure we'd all appreciate it!

Thanks for the contribution Nick. Hopefully you'll have a chance to finish it up sometime in the future.