mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 06:53:41 +00:00
Code formatting
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@29665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2304,32 +2304,31 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer)
|
|||||||
int res = create_addr_from_peer(dialog, p);
|
int res = create_addr_from_peer(dialog, p);
|
||||||
ASTOBJ_UNREF(p, sip_destroy_peer);
|
ASTOBJ_UNREF(p, sip_destroy_peer);
|
||||||
return res;
|
return res;
|
||||||
} else {
|
}
|
||||||
hostn = peer;
|
hostn = peer;
|
||||||
portno = port ? atoi(port) : DEFAULT_SIP_PORT;
|
portno = port ? atoi(port) : DEFAULT_SIP_PORT;
|
||||||
if (srvlookup) {
|
if (srvlookup) {
|
||||||
char service[MAXHOSTNAMELEN];
|
char service[MAXHOSTNAMELEN];
|
||||||
int tportno;
|
int tportno;
|
||||||
int ret;
|
int ret;
|
||||||
snprintf(service, sizeof(service), "_sip._udp.%s", peer);
|
|
||||||
ret = ast_get_srv(NULL, host, sizeof(host), &tportno, service);
|
snprintf(service, sizeof(service), "_sip._udp.%s", peer);
|
||||||
if (ret > 0) {
|
ret = ast_get_srv(NULL, host, sizeof(host), &tportno, service);
|
||||||
hostn = host;
|
if (ret > 0) {
|
||||||
portno = tportno;
|
hostn = host;
|
||||||
}
|
portno = tportno;
|
||||||
}
|
|
||||||
hp = ast_gethostbyname(hostn, &ahp);
|
|
||||||
if (hp) {
|
|
||||||
ast_string_field_set(dialog, tohost, peer);
|
|
||||||
memcpy(&dialog->sa.sin_addr, hp->h_addr, sizeof(dialog->sa.sin_addr));
|
|
||||||
dialog->sa.sin_port = htons(portno);
|
|
||||||
dialog->recv = dialog->sa;
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
ast_log(LOG_WARNING, "No such host: %s\n", peer);
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hp = ast_gethostbyname(hostn, &ahp);
|
||||||
|
if (!hp) {
|
||||||
|
ast_log(LOG_WARNING, "No such host: %s\n", peer);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
ast_string_field_set(dialog, tohost, peer);
|
||||||
|
memcpy(&dialog->sa.sin_addr, hp->h_addr, sizeof(dialog->sa.sin_addr));
|
||||||
|
dialog->sa.sin_port = htons(portno);
|
||||||
|
dialog->recv = dialog->sa;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Scheduled congestion on a call */
|
/*! \brief Scheduled congestion on a call */
|
||||||
|
Reference in New Issue
Block a user