[asterisk-commits] trunk r29665 - /trunk/channels/chan_sip.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue May 23 05:14:35 MST 2006
Author: oej
Date: Tue May 23 07:14:35 2006
New Revision: 29665
URL: http://svn.digium.com/view/asterisk?rev=29665&view=rev
Log:
Code formatting
Modified:
trunk/channels/chan_sip.c
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=29665&r1=29664&r2=29665&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue May 23 07:14:35 2006
@@ -2304,32 +2304,31 @@
int res = create_addr_from_peer(dialog, p);
ASTOBJ_UNREF(p, sip_destroy_peer);
return res;
- } else {
- hostn = peer;
- portno = port ? atoi(port) : DEFAULT_SIP_PORT;
- if (srvlookup) {
- char service[MAXHOSTNAMELEN];
- int tportno;
- int ret;
- snprintf(service, sizeof(service), "_sip._udp.%s", peer);
- ret = ast_get_srv(NULL, host, sizeof(host), &tportno, service);
- if (ret > 0) {
- 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;
- }
- }
+ }
+ hostn = peer;
+ portno = port ? atoi(port) : DEFAULT_SIP_PORT;
+ if (srvlookup) {
+ char service[MAXHOSTNAMELEN];
+ int tportno;
+ int ret;
+
+ snprintf(service, sizeof(service), "_sip._udp.%s", peer);
+ ret = ast_get_srv(NULL, host, sizeof(host), &tportno, service);
+ if (ret > 0) {
+ hostn = host;
+ portno = tportno;
+ }
+ }
+ 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 */
More information about the asterisk-commits
mailing list