199 | | 2. If 1) is not possible (no IPv6 server or not desirable to use TURN), application needs to replace all IPv6 occurences with IPv4 in the SIP messages and SDP. To do this, you need to be able to synthesize IPv4 from IPv6 address. Apple provides the API getaddrindo() for this, however this is only specific to Apple, so may not be able to work on other platforms. |
| 199 | 2. If 1) is not possible (no IPv6 server or not desirable to use TURN), we will need to replace all IPv6 occurences with IPv4 in the SIP messages and SDP. This feature is available in release 2.7. |
| 200 | a. You need a STUN server which resides in an IPv4 network. Then set your {{{pjsua_config}}} to try IPv6 resolution of the STUN servers. |
| 201 | b. Create UDP6 transport to get an IPv4-mapped address from the above STUN server. |
| 202 | c. Bind account to a specific IPv6 transport, and enable IPv6 in media transport. |
| 203 | d. Set account's NAT64 option to PJSUA_NAT64_ENABLED. |
| 204 | {{{ |
| 205 | cfg->stun_try_ipv6 = PJ_TRUE; |
| 206 | |
| 207 | tp_type = PJSIP_TRANSPORT_UDP6; |
| 208 | status = pjsua_transport_create(tp_type, &tp_cfg, &udp6_tp_id); |
| 209 | |
| 210 | acc_cfg.transport_id = udp6_tp_id; // or tcp6_tp_id or tls6_tp_id |
| 211 | acc_cfg.ipv6_media_use = PJSUA_IPV6_ENABLED; |
| 212 | |
| 213 | acc_cfg.nat64_opt = PJSUA_NAT64_ENABLED; |
| 214 | }}} |