Summary:ASTERISK-16930: [patch] Use ast_sockaddr_stringify_fmt wrappers for sip show peers
Reporter:Michael L. Young (elguero)Labels:
Date Opened:2010-11-08 12:51:35.000-0600Date Closed:2012-02-01 15:06:01.000-0600
Versions:Frequency of
Environment:Attachments:( 0) chan_sip-broken-registration.diff
( 1) chan_sip-broken-registration-1.8.diff
Description:While trying to track something down in chan_sip and in going through the latest revisions, I saw the patch for issue ASTERISK-16906 adjusted the display of _sip_show_peers by using ast_sockaddr_stringify_fmt.  

I have created a patch which uses the wrappers for ast_sockaddr_stringify_fmt instead of calling the function directly.  The reason for doing this was to make the code a little bit clearer by simplifying it.

At the same time, I saw a couple of other places that would benefit from using the wrappers in netsock2 since it will properly handle IPv4 or IPv6.


According to docs AST_SOCKADDR_STR_HOST is more for a URL which is what was used in the patch in issue ASTERISK-16906.  Should AST_SOCKADDR_STR_ADDR have been used instead?
Comments:By: Leif Madsen (lmadsen) 2010-11-18 14:11:59.000-0600


By: Leif Madsen (lmadsen) 2010-11-18 14:12:21.000-0600

You may want to take a look at this. Perhaps you could review and commit?

By: Michael L. Young (elguero) 2010-11-18 16:17:07.000-0600

No problem... trying to contribute what little bit I can.

One thing I just noticed, please ignore the name of the patch.  I was working on tracking something down and failed to rename those patches before uploading.

By: Jonathan Rose (jrose) 2012-02-02 10:49:52.110-0600

In retrospect, I really should have taken a better look at this before committing it. It doesn't really work (because it uses ast_sockaddr_stringify in a couple different ways and also changes the output for the ami action) and I didn't notice the problem with it until I started working on another related issue.

It'll be fixed pretty soon though.

By: Michael L. Young (elguero) 2012-02-02 16:37:40.545-0600

Yep, sorry about that.  I had forgotten about this patch.  It was from 2010.  At least it didn't make it into any release.