[asterisk-commits] file: branch group/dns_pjsip r434214 - /team/group/dns_pjsip/res/res_pjsip/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 7 08:37:27 CDT 2015


Author: file
Date: Tue Apr  7 08:37:24 2015
New Revision: 434214

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=434214
Log:
Fix a bug where the fallback AAAA result would not contain the correct transport selection.

Modified:
    team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c

Modified: team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c
URL: http://svnview.digium.com/svn/asterisk/team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c?view=diff&rev=434214&r1=434213&r2=434214
==============================================================================
--- team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c (original)
+++ team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c Tue Apr  7 08:37:24 2015
@@ -429,11 +429,13 @@
 		}
 	}
 
-	if (sip_available_transports[PJSIP_TRANSPORT_UDP6]) {
-		res |= sip_resolve_add(resolve, host, ns_t_aaaa, ns_c_in, (type == PJSIP_TRANSPORT_UNSPECIFIED ? PJSIP_TRANSPORT_UDP6 : type), target->addr.port);
-	}
-
-	if (sip_available_transports[PJSIP_TRANSPORT_UDP]) {
+	if ((type == PJSIP_TRANSPORT_UNSPECIFIED && sip_available_transports[PJSIP_TRANSPORT_UDP6]) ||
+		sip_available_transports[type + PJSIP_TRANSPORT_IPV6]) {
+		res |= sip_resolve_add(resolve, host, ns_t_aaaa, ns_c_in, (type == PJSIP_TRANSPORT_UNSPECIFIED ? PJSIP_TRANSPORT_UDP6 : type + PJSIP_TRANSPORT_IPV6), target->addr.port);
+	}
+
+	if ((type == PJSIP_TRANSPORT_UNSPECIFIED && sip_available_transports[PJSIP_TRANSPORT_UDP]) ||
+		sip_available_transports[type]) {
 		res |= sip_resolve_add(resolve, host, ns_t_a, ns_c_in, (type == PJSIP_TRANSPORT_UNSPECIFIED ? PJSIP_TRANSPORT_UDP : type), target->addr.port);
 	}
 
@@ -496,4 +498,4 @@
 {
 	/* Replace the existing PJSIP resolver with our own implementation */
 	ast_sip_push_task_synchronous(NULL, sip_replace_resolver, NULL);
-}
+}




More information about the asterisk-commits mailing list