IP Address Change

IN
Igor Nazarov
Mon, Nov 20, 2017 3:45 PM

Hello.

I am trying to implement IP address change on iOS platform following this
guide https://trac.pjsip.org/repos/wiki/IPAddressChange. It works fine
except when I change connection from IPv6 WiFi to IPv4 3G network.

I am using TLS transport. After network change I call
"pjsua_acc_set_registration" method, PJSIP invokes "pjsip_resolve" and
detects address family as an IPv6 (because for some reason PJSIP decides
that transport type is TLS6). Since server address is a hostname PJSIP
calls "pj_getaddrinfo" and puts address family IPv6 to it. "pj_getaddrinfo"
gets an array of addresses using "CFHostGetAddressing", receives one
address where address is a sockaddr structure and compares address families
from this structure and received from "pjsip_resolve". Since they are not
equal "pj_getaddrinfo" ignores unwanted address families and returns
PJ_ERESOLVE error.

As a result PJSIP is not able to re-register and send a re-invite message
and call hangs up after a while.

Can anyone help me with this issue? Thanks in advance.

With Best Regards,
Igor Nazarov

Hello. I am trying to implement IP address change on iOS platform following this guide https://trac.pjsip.org/repos/wiki/IPAddressChange. It works fine except when I change connection from IPv6 WiFi to IPv4 3G network. I am using TLS transport. After network change I call "pjsua_acc_set_registration" method, PJSIP invokes "pjsip_resolve" and detects address family as an IPv6 (because for some reason PJSIP decides that transport type is TLS6). Since server address is a hostname PJSIP calls "pj_getaddrinfo" and puts address family IPv6 to it. "pj_getaddrinfo" gets an array of addresses using "CFHostGetAddressing", receives one address where address is a sockaddr structure and compares address families from this structure and received from "pjsip_resolve". Since they are not equal "pj_getaddrinfo" ignores unwanted address families and returns PJ_ERESOLVE error. As a result PJSIP is not able to re-register and send a re-invite message and call hangs up after a while. Can anyone help me with this issue? Thanks in advance. *With Best Regards,* *Igor Nazarov*