adsun
adsun

Reputation: 803

PJSIP iOS unable to resolve SRV record in IPV6 network

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 )
}

Upvotes: 4

Views: 1125

Answers (1)

thorax
thorax

Reputation: 591

I am working on the same.

Apple asked all iOS developers to test their apps using a Mac's Network Share. That network share uses NAT64 : enter image description here

Based on multiple threads, and PJSIP's own documentation, IPv6 is not supported yet by PJSIP in NAT environment.

Ref1.: https://trac.pjsip.org/repos/wiki/IPv6

IPv6 Support in pjnath (STUN and ICE)

To be done.

The work for adding IPv6 support in pjnath is documented by ticket #422.

Ref2.: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2016-February/018965.html

On 29 Jan 2016, at 04:49, Riza Sulistyo wrote:

Hi Nick,

We have open ticket for ipv6 in (#419) and (#422). We are thinking about bumping the priority of one of the ticket to 2.6, however it's not decided yet at the moment.

+

Hi Nick,

Unfortunately, support for DNS (ipv6) is currently not on our roadmap since we have a workaround. However if you are interested in implementing it, we are open to the patch.

+

But it seems that there is a workaround for this :

Thanks Riza,

By resolving the server's ipv6 address and specifying that as the proxy, I have been able to get pjsip to connect over ipv6.

I try to use the exact same version of the PJSIP library (2.4.5), but I am running into an assert when I try to connect to my server this way.

Are you able to connect this way?

Thanks!

Upvotes: 3

Related Questions