mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-27 22:50:42 +00:00
Use ast_sockaddr_stringify_fmt wrappers for various functions in chan_sip
There are a number of cleaner looking wrappers for ast_sockaddr_stringify_fmt available which are slightly more readable than using a direct call to ast_sockaddr_stringify_fmt. This patch switches a number of those calls in chan_sip to use those wrappers and is generally harmless. (Closes issue ASTERISK-16930) Reported by: Michael L. Young Patches: chan_sip-broken-registration-1.8.diff uploaded by Michael L. Young (license 5026) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@353720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -16631,7 +16631,7 @@ static char *_sip_show_peers(int fd, int *total, struct mansession *s, const str
|
||||
|
||||
/* the last argument is left-aligned, so we don't need a size anyways */
|
||||
#define FORMAT2 "%-25.25s %-39.39s %-3.3s %-10.10s %-3.3s %-8s %-10s %s\n"
|
||||
#define FORMAT "%-25.25s %-39.39s %-3.3s %-3.3s %-3.3s %-8d %-10s %s\n"
|
||||
#define FORMAT "%-25.25s %-39.39s %-3.3s %-3.3s %-3.3s %-8s %-10s %s\n"
|
||||
|
||||
char name[256];
|
||||
int total_peers = 0;
|
||||
@@ -16735,7 +16735,7 @@ static char *_sip_show_peers(int fd, int *total, struct mansession *s, const str
|
||||
peer->host_dynamic ? " D " : " ", /* Dynamic or not? */
|
||||
ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT) ? " N " : " ", /* NAT=yes? */
|
||||
peer->ha ? " A " : " ", /* permit/deny */
|
||||
ast_sockaddr_isnull(&peer->addr) ? 0 : ast_sockaddr_port(&peer->addr), status,
|
||||
ast_sockaddr_isnull(&peer->addr) ? 0 : ast_sockaddr_stringify_port(&peer->addr), status,
|
||||
realtimepeers ? (peer->is_realtime ? "Cached RT":"") : "");
|
||||
|
||||
if (!s) {/* Normal CLI list */
|
||||
@@ -16744,7 +16744,7 @@ static char *_sip_show_peers(int fd, int *total, struct mansession *s, const str
|
||||
peer->host_dynamic ? " D " : " ", /* Dynamic or not? */
|
||||
ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT) ? " N " : " ", /* NAT=yes? */
|
||||
peer->ha ? " A " : " ", /* permit/deny */
|
||||
ast_sockaddr_isnull(&peer->addr) ? 0 : ast_sockaddr_port(&peer->addr), status,
|
||||
ast_sockaddr_isnull(&peer->addr) ? 0 : ast_sockaddr_stringify_port(&peer->addr), status,
|
||||
realtimepeers ? (peer->is_realtime ? "Cached RT":"") : "");
|
||||
} else { /* Manager format */
|
||||
/* The names here need to be the same as other channels */
|
||||
@@ -16754,7 +16754,7 @@ static char *_sip_show_peers(int fd, int *total, struct mansession *s, const str
|
||||
"ObjectName: %s\r\n"
|
||||
"ChanObjectType: peer\r\n" /* "peer" or "user" */
|
||||
"IPaddress: %s\r\n"
|
||||
"IPport: %d\r\n"
|
||||
"IPport: %s\r\n"
|
||||
"Dynamic: %s\r\n"
|
||||
"Forcerport: %s\r\n"
|
||||
"VideoSupport: %s\r\n"
|
||||
@@ -16764,8 +16764,8 @@ static char *_sip_show_peers(int fd, int *total, struct mansession *s, const str
|
||||
"RealtimeDevice: %s\r\n\r\n",
|
||||
idtext,
|
||||
peer->name,
|
||||
ast_sockaddr_isnull(&peer->addr) ? "-none-" : ast_sockaddr_stringify_fmt(&peer->addr, AST_SOCKADDR_STR_HOST),
|
||||
ast_sockaddr_isnull(&peer->addr) ? 0 : ast_sockaddr_port(&peer->addr),
|
||||
ast_sockaddr_isnull(&peer->addr) ? "-none-" : ast_sockaddr_stringify_addr(&peer->addr),
|
||||
ast_sockaddr_isnull(&peer->addr) ? 0 : ast_sockaddr_stringify_port(&peer->addr),
|
||||
peer->host_dynamic ? "yes" : "no", /* Dynamic or not? */
|
||||
ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT) ? "yes" : "no", /* NAT=yes? */
|
||||
ast_test_flag(&peer->flags[1], SIP_PAGE2_VIDEOSUPPORT) ? "yes" : "no", /* VIDEOSUPPORT=yes? */
|
||||
|
||||
Reference in New Issue
Block a user