Hi Ashok
Glad the module is more or less doing the job for you. As you can see in the README.md file on GitHub under bullet 2, there is an example on how you can activate this only when connecting to a IPv6 network. Then IPv4 continues to work as it has always done. Just hook it into the on_registration callback from pjsip and I think you will be fine.
Johan
From: pjsip on behalf of Ashok Narvaneni
Reply-To: pjsip list
Date: Tuesday, 4 April 2017 at 16:36
To: pjsip list
Subject: Re: NAT64 ios issue
Hi Colin,
Thanks again for your kind reply.We will make the changes and post our findings.Unfortunately this server is provided by our client which does't have ICE support.
Thanks,Ashok Narvaneni.
On Tue, Apr 4, 2017 at 7:59 PM, Colin Morelli <colin.morelli@xxxxxxxxx> wrote:
Ahsok,
This is one of the reasons I had written my own module (well, that and supporting ICE). The module I linked does not perform any checks about the current connection to the SIP server. Among other things, one of the additional things my modules does is only operate when connected to the signaling server via IPv6. This can be accomplished by a simple check in the on_rx and on_tx methods, before touching the SDP:
(tdata->tp_info.transport->factory->type & PJSIP_TRANSPORT_IPV6) == PJSIP_TRANSPORT_IPV6
With that check at the beginning of the module methods, it should simply ignore anything that happens on an IPv4 transport and leave the SDP in-tact.
As for PJSIP supporting dual stack mode - there's really no sense in trying to do this when ICE is available. PJSIP's ICE implementation can and does support dual stack. If you can enable ICE on your server side as well, that should work for your use case.
Best,Colin
On Tue, Apr 4, 2017 at 10:23 AM, Ashok Narvaneni <ashoknarvaneni7@xxxxxxxxx> wrote:
Hi Colin,
We integrated the module as you suggested and it is working fine.However it breaks when we connect the device with an IPV4 network. We understand that pjsip does't support dual stack mode. So what is the best way to do make the App work with both IPV6 and IPV4 networks.Please suggest...
Thanks,Ashok Narvaneni.
On Fri, Mar 31, 2017 at 8:14 PM, Ashok Narvaneni <ashoknarvaneni7@xxxxxxxxx> wrote:
Hi Colin,
Thank you very much for detailed answer, I will try that patch and post my findings.
Thanks,Ashok.
On Fri, Mar 31, 2017 at 8:08 PM, Colin Morelli <colin.morelli@xxxxxxxxx> wrote:
Ashok,
What's almost certainly happening here is that the SDP returned from your server contains only IPv4 media addresses. When PJSIP goes to compare the SDP to local capabilities, it finds only IPv4 addresses for the remote endpoint, but can't find any local IPv4 interfaces. As a result, it thinks there's no way it can communicate with the remote server and fails.
I have been able to fix this with two steps:
1) Enable ICE negotiation on both your media server and PJSIP client. ICE is helpful here because it allows the two endpoints to communicate multiple candidate media addresses. This step *may* be optional, although I've never really tested without this.2) Write a PJSIP module that intercepts incoming/outgoing SDPs to work around the NAT64 issue. There's an example of one of these on github, and I've written my own for my app (unfortunately can't share at this time). The general steps that need to be followed here are:
- Intercept on_tx and on_rx PJSIP events- When sending an outgoing SDP, if signaling is connected over IPv6, then add an IPv4 address to the ICE candidates in the SDP (this step is optional, and depends on whether or not your server will explicitly reject an SDP that only contains IPv6 addresses)- When receiving an incoming SDP, if signaling is connected over IPv6, then iterate the ICE candidates in the SDP, find all IPv4 addresses, synthesize IPv6 addresses for them (by passing the IPv4 addresses to pj_getaddrinfo, iOS will return a synthesized IPv6 address if connected to a NAT64 network), and add the synthesized IPv6 addresses to the ICE candidates list
As long as this module is registered with a higher priority than the PJSIP transports module, the SDP will be rewritten before pjmedia actually parses the SDP. By the time it gets to the media stack, it will see your synthesized IPv6 addresses, which it can support, and should be able to establish a media connection.
Couple of tips here: don't underestimate the nuances of this issue. It's not necessarily a hard problem, but there are a lot of cases to consider. Once you solve the first issue, you then have the issue of what happens when the user changes networks during a call (i.e. their phone switches wifi networks, or off of wifi entirely). Additionally, if you're working on Android, you probably have this issue on Android as well, but Google as far as I know does not test apps on a NAT64 network like Apple does.
Apologies I can't be more specific at this time but I hope this points you in the right direction. I think it'd be great for PJSIP to include this in the core. NAT64 networks are likely to become more prevalent, and it would be considerably less work to simply add to the core than it would be to maintain a separate module.
Best,Colin
On Fri, Mar 31, 2017 at 10:14 AM, Ashok Narvaneni <ashoknarvaneni7@xxxxxxxxx> wrote:
______________________________Hi,
We are trying to connect to IPV4 server from our pjsip ios app with NAT64.We can able to register with the server successfully But when we make calls their is no audio and call disconnects.Below is the error.19:39:43.256 pjsua_media.c .....Call 1: updating media..
19:39:43.256 pjsua_media.c ......pjmedia_stream_info_from
_sdp() failed for call_id 1 media 0: Unsupported address family (PJ_EAFNOTSUP) 19:39:43.257 pjsua_media.c ......Error updating media call01:0: Unsupported address family (PJ_EAFNOTSUP)
19:39:43.257 pjsua_media.c ......pjmedia_vid_stream_info_
from_sdp() failed for call_id 1 media 1: Unsupported address family (PJ_EAFNOTSUP) 19:39:43.257 pjsua_media.c ......Error updating media call01:1: Unsupported address family (PJ_EAFNOTSUP)
19:39:43.257 pjsua_call.c .....Unable to create media session: No active media stream after negotiation (PJMEDIA_SDPNEG_ENOMEDIA) [status=220048]
19:39:43.257 pjsua_core.c ........TX 389 bytes Request msg CANCEL/cseq=17639 (tdta0x1021ce200) to TCP 2001:2:0:1baa::4225:2ca6:5060:
What could be wrong? Can someone please help me on this.
Thanks,
Ashok Narvaneni.
_________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.or g
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.or g
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.or g
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip. org
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists. pjsip.org
_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org