Author: oej Date: Thu Aug 21 04:46:28 2014 New Revision: 421665 URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=421665 Log: Small changes and stuff
Modified: team/oej/pgtips-srv-and-outbound-stuff-1.8/README.pgtips-srv-records team/oej/pgtips-srv-and-outbound-stuff-1.8/channels/chan_sip.c Modified: team/oej/pgtips-srv-and-outbound-stuff-1.8/README.pgtips-srv-records URL: http://svnview.digium.com/svn/asterisk/team/oej/pgtips-srv-and-outbound-stuff-1.8/README.pgtips-srv-records?view=diff&rev=421665&r1=421664&r2=421665 ============================================================================== --- team/oej/pgtips-srv-and-outbound-stuff-1.8/README.pgtips-srv-records (original) +++ team/oej/pgtips-srv-and-outbound-stuff-1.8/README.pgtips-srv-records Thu Aug 21 04:46:28 2014 @@ -172,14 +172,18 @@ ===== 1. Expose SRV records to the SIP channel. Remove when response is received (1xx or higher). - The API is changed to support a module accessing SRV records. + - Done. 2. Make sure SIP channel selects right with IPv4/IPv6. - Done for [peers] in the sip.conf file. - Not done for calling a DNS name in the dial string (some code is there though) 3. Provide hooks for happy earballs if server is dual stack and we're dual stack + - Postponed, not part of this project 4. Implement failover to next server in list if transaction fails. - Started 5. Make sure we use the DNS TTL properly + - Needs further work 6. Use SRV for outbound proxys too, with failover + - Needs check 7. Add multiple peers (shadowpeers), one for each SRv entry/IP address - delete existing ones if needed - Done. Modified: team/oej/pgtips-srv-and-outbound-stuff-1.8/channels/chan_sip.c URL: http://svnview.digium.com/svn/asterisk/team/oej/pgtips-srv-and-outbound-stuff-1.8/channels/chan_sip.c?view=diff&rev=421665&r1=421664&r2=421665 ============================================================================== --- team/oej/pgtips-srv-and-outbound-stuff-1.8/channels/chan_sip.c (original) +++ team/oej/pgtips-srv-and-outbound-stuff-1.8/channels/chan_sip.c Thu Aug 21 04:46:28 2014 @@ -4445,6 +4445,7 @@ if (p->outboundproxy) { p->sa = p->outboundproxy->ip; /* We need the SRV context as well */ + } finalize_content(req); @@ -4474,7 +4475,6 @@ unsigned short port, prio, weight; ast_debug(3, "====>> SRV failover. Changing to next SRV record in the list\n"); /* XXX SRV FAILOVER HERE XXX */ - /* Hmm. If this is a peer - should we use the peer srvcontext? */ if(ast_srv_get_next_record(p->srvcontext, &host, &port, &prio, &weight)) { ast_log(LOG_WARNING, "No more hosts: %s\n", p->srvdomain); res = -1; @@ -5794,6 +5794,9 @@ if (addr) { /* This address should be updated using dnsmgr */ ast_sockaddr_copy(&dialog->sa, addr); + if (ast_sockaddr_port(addr)) { + ast_sockaddr_set_port(&dialog->sa, ast_sockaddr_port(addr)); + } } else { /* Let's see if we can find the host in DNS. First try DNS SRV records, @@ -13859,6 +13862,7 @@ /*dnsmgr refresh disabled, no reference added! */ registry_unref(r, "remove reg ref, dnsmgr disabled"); } + ast_debug(3, " --- Address set to %s port %d \n", ast_sockaddr_stringify_host(&r->us), ast_sockaddr_port(&r->us)); } if (peer) { peer = unref_peer(peer, "removing peer ref for dnsmgr_lookup"); @@ -13924,7 +13928,7 @@ p->socket.port = htons(ast_sockaddr_port(&sip_tcp_desc.local_address)); } - if (!r->dnsmgr && r->portno) { + if (!ast_sockaddr_port(&r->us) && !r->dnsmgr && r->portno) { ast_sockaddr_set_port(&p->sa, r->portno); ast_sockaddr_set_port(&p->recv, r->portno); ast_debug(2, "Confusing code set port to %d\n", r->portno); @@ -13949,6 +13953,7 @@ r->regattempts++; return 0; } + ast_debug(3, " --- 2. Address (p->sa) set to %s port %d \n", ast_sockaddr_stringify_host(&p->sa), ast_sockaddr_port(&p->sa)); /* Copy back Call-ID in case create_addr changed it */ ast_string_field_set(r, callid, p->callid); @@ -13994,6 +13999,7 @@ internal network so we can register through nat */ ast_sip_ouraddrfor(&p->sa, &p->ourip, p); + ast_debug(3, " --- 3. Address (p->sa) set to %s port %d \n", ast_sockaddr_stringify_host(&p->sa), ast_sockaddr_port(&p->sa)); build_contact(p); } -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- svn-commits mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/svn-commits