Fix silly typo (and make order slightly easier to read) bug #2054
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
957782627c
commit
05d3d9c25f
|
@ -910,6 +910,7 @@ static int send_request(struct sip_pvt *p, struct sip_request *req, int reliable
|
|||
return res;
|
||||
}
|
||||
|
||||
/*--- url_decode: Decode SIP URL ---*/
|
||||
static void url_decode(char *s)
|
||||
{
|
||||
char *o = s;
|
||||
|
@ -2452,7 +2453,7 @@ static int sip_register(char *value, int lineno)
|
|||
reg->expire = -1;
|
||||
reg->timeout = -1;
|
||||
reg->refresh = default_expiry;
|
||||
reg->portno = porta ? htons(atoi(porta)) : 0;
|
||||
reg->portno = porta ? atoi(porta) : 0;
|
||||
reg->callid_valid = 0;
|
||||
reg->ocseq = 101;
|
||||
ast_mutex_lock(®l.lock);
|
||||
|
@ -3954,7 +3955,7 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth, char
|
|||
return 0;
|
||||
}
|
||||
if (r->portno)
|
||||
p->sa.sin_port = r->portno;
|
||||
p->sa.sin_port = htons(r->portno);
|
||||
p->outgoing = 1;
|
||||
r->call=p;
|
||||
p->registry=r;
|
||||
|
@ -5142,6 +5143,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, char *cmd
|
|||
return 0;
|
||||
ast_mutex_lock(&userl.lock);
|
||||
user = find_user(of);
|
||||
/* Find user based on user name in the from header */
|
||||
if (user && ast_apply_ha(user->ha, sin)) {
|
||||
p->nat = user->nat;
|
||||
#ifdef OSP_SUPPORT
|
||||
|
@ -5610,8 +5612,8 @@ static int sip_show_peer(int fd, int argc, char *argv[])
|
|||
/*--- sip_show_registry: Show SIP Registry (registrations with other SIP proxies ---*/
|
||||
static int sip_show_registry(int fd, int argc, char *argv[])
|
||||
{
|
||||
#define FORMAT2 "%-20.20s %-12.12s %8.8s %-20.20s\n"
|
||||
#define FORMAT "%-20.20s %-12.12s %8d %-20.20s\n"
|
||||
#define FORMAT2 "%-30.30s %-12.12s %8.8s %-20.20s\n"
|
||||
#define FORMAT "%-30.30s %-12.12s %8d %-20.20s\n"
|
||||
struct sip_registry *reg;
|
||||
char host[80];
|
||||
if (argc != 3)
|
||||
|
@ -5619,7 +5621,7 @@ static int sip_show_registry(int fd, int argc, char *argv[])
|
|||
ast_mutex_lock(®l.lock);
|
||||
ast_cli(fd, FORMAT2, "Host", "Username", "Refresh", "State");
|
||||
for (reg = regl.registrations;reg;reg = reg->next) {
|
||||
snprintf(host, sizeof(host), "%s:%d", reg->hostname, ntohs(reg->portno ? reg->portno : DEFAULT_SIP_PORT));
|
||||
snprintf(host, sizeof(host), "%s:%d", reg->hostname, reg->portno ? reg->portno : DEFAULT_SIP_PORT);
|
||||
ast_cli(fd, FORMAT, host,
|
||||
reg->username, reg->refresh, regstate2str(reg->regstate));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue