With the apple's new requirement that all iOS apps should work in IPV6 network, I have a VOIP client app based on PJSIP that is completely broken. I'm trying to solve the issues step by step. The problem i want to fix first is the SRV resolution.
I do srv resolution like this in my app and it fails ( timeout/no result ). I could use dig command on my mac that is in same ipv6 network and it correctly resolves the SRV record that i try to do from pjsip. Any input on correct API's to use for IPV6 here is welcome.
pj_dns_resolver* m_pDnsResolver = NULL;
::pj_dns_resolver_create(
&( m_cachingPool.Get( ).factory ), // pf (pool factory)
NULL, // name
0, // options - must be 0
NULL, // timer - unused
NULL, // ioqueue - unused
&m_pDnsResolver ) ); // p_resolver
// Set the name server to be used ( nameServer is 8.8.8.8 )
const std::string localNameServer = nameServer;
pj_str_t servers[] = { ::pj_str( const_cast< char* >( localNameServer.c_str( ) ) ) };
::pj_dns_resolver_set_ns(
m_pDnsResolver,
1, // count
servers,
NULL ) ); // ports
// Resolver start query method ( DomainName cannot be mentioned here. SRV resolution works fine in IPV4 network )
void StartQuery( const std::string& domainName )
{
PJString name( domainName );
::pj_dns_resolver_start_query(
m_pDnsResolver, // resolver
&( name.Get( ) ), // name
PJ_DNS_TYPE_SRV, // type
0, // options - must be 0
&ResolverCallback,
this, // user_data
&m_pAsyncQuery )
}