[asterisk-commits] jpeeler: branch jpeeler/sip-dnsmgr r111441 - in /team/jpeeler/sip-dnsmgr: cha...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Mar 27 12:58:18 CDT 2008
Author: jpeeler
Date: Thu Mar 27 12:58:17 2008
New Revision: 111441
URL: http://svn.digium.com/view/asterisk?view=rev&rev=111441
Log:
checkpoint, port getting set correctly now. now on to dnsmgr_refresh
Modified:
team/jpeeler/sip-dnsmgr/channels/chan_sip.c
team/jpeeler/sip-dnsmgr/main/dnsmgr.c
Modified: team/jpeeler/sip-dnsmgr/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/channels/chan_sip.c?view=diff&rev=111441&r1=111440&r2=111441
==============================================================================
--- team/jpeeler/sip-dnsmgr/channels/chan_sip.c (original)
+++ team/jpeeler/sip-dnsmgr/channels/chan_sip.c Thu Mar 27 12:58:17 2008
@@ -9222,7 +9222,7 @@
snprintf(service, sizeof(service), "_sip._%s.%s", get_transport(r->transport), r->hostname); /* have to use static get_transport function */
ast_log(LOG_DEBUG, "hostname: %s portno:%d sin_family:%d\n", r->hostname, r->portno, r->us.sin_family);
ast_dnsmgr_lookup_srv(r->hostname, &r->us.sin_addr, &r->us.sin_port, &r->dnsmgr, service);
- ast_log(LOG_DEBUG, "after dnsmgr lookup port=%d\n", r->us.sin_port);
+ ast_log(LOG_DEBUG, "after dnsmgr lookup port=%d\n", htons(r->us.sin_port));
}
if (r->call) { /* We have a registration */
@@ -9266,13 +9266,21 @@
r->regattempts++;
return 0;
}
+
+ ast_log(LOG_DEBUG, "******************* sip_registry port set to %d\n", ntohs(r->us.sin_port));
+ ast_log(LOG_DEBUG, "******************* p->sa.sin_port=%d\n", ntohs(p->sa.sin_port));
+
+
/* Copy back Call-ID in case create_addr changed it */
ast_string_field_set(r, callid, p->callid);
- if (r->portno) {
+ if (!r->dnsmgr && r->portno) { /* TODO: this might could just be removed since dnsmgr will be present? */
+ ast_log(LOG_DEBUG, "port from sip_registry (%d) is setting stuff in sip_pvt\n", r->portno);
p->sa.sin_port = htons(r->portno);
p->recv.sin_port = htons(r->portno);
- } else /* Set registry port to the port set from the peer definition/srv or default */
+ } else { /* Set registry port to the port set from the peer definition/srv or default */
+ ast_log(LOG_DEBUG, "port from sip_pvt (%d) is setting stuff in sip_registry\n", ntohs(p->sa.sin_port));
r->portno = ntohs(p->sa.sin_port);
+ }
ast_set_flag(&p->flags[0], SIP_OUTGOING); /* Registration is outgoing call */
r->call = dialog_ref(p); /* Save pointer to SIP dialog */
p->registry = registry_addref(r); /* Add pointer to registry in packet */
Modified: team/jpeeler/sip-dnsmgr/main/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/main/dnsmgr.c?view=diff&rev=111441&r1=111440&r2=111441
==============================================================================
--- team/jpeeler/sip-dnsmgr/main/dnsmgr.c (original)
+++ team/jpeeler/sip-dnsmgr/main/dnsmgr.c Thu Mar 27 12:58:17 2008
@@ -193,7 +193,7 @@
if (srv_ret > 0) {
char buf[INET_ADDRSTRLEN];
hp = ast_gethostbyname(realhostname, &ahp);
- *result_portno = (unsigned int)real_portno;
+ *result_portno = htons((unsigned int)real_portno);
ast_log(LOG_DEBUG, "name=%s realhostname=%s result_portno=%d hp->h_addr=%s\n", name, realhostname, *result_portno, inet_ntop(AF_INET, hp->h_addr, buf, sizeof(buf)));
//result_addr->sin_port = *result_portno;
} else {
More information about the asterisk-commits
mailing list