@@ -3689,6 +3689,10 @@ pj_status_t pjsua_acc_get_uac_addr(pjsua_acc_id acc_id,
36893689 addr -> host = tfla2_prm .ret_addr ;
36903690 addr -> port = tfla2_prm .ret_port ;
36913691
3692+ if (pj_strchr (& addr -> host , ':' )) {
3693+ tp_type |= PJSIP_TRANSPORT_IPV6 ;
3694+ }
3695+
36923696 /* If we are behind NAT64, use the Contact and Via address from
36933697 * the UDP6 transport, which should be obtained from STUN.
36943698 */
@@ -3703,6 +3707,9 @@ pj_status_t pjsua_acc_get_uac_addr(pjsua_acc_id acc_id,
37033707 if (status == PJ_SUCCESS ) {
37043708 update_addr = PJ_FALSE ;
37053709 addr -> host = tfla2_prm2 .ret_addr ;
3710+ if (pj_strchr (& addr -> host , ':' )) {
3711+ tp_type |= PJSIP_TRANSPORT_IPV6 ;
3712+ }
37063713 pj_strdup (acc -> pool , & acc -> via_addr .host , & addr -> host );
37073714 acc -> via_addr .port = addr -> port ;
37083715 acc -> via_tp = (pjsip_transport * )tfla2_prm .ret_tp ;
@@ -3723,6 +3730,9 @@ pj_status_t pjsua_acc_get_uac_addr(pjsua_acc_id acc_id,
37233730 & pjsua_var .tpdata [i ].data .tp -> local_name .host );
37243731 addr -> port = (pj_uint16_t )
37253732 pjsua_var .tpdata [i ].data .tp -> local_name .port ;
3733+ if (pj_strchr (& addr -> host , ':' )) {
3734+ tp_type |= PJSIP_TRANSPORT_IPV6 ;
3735+ }
37263736 }
37273737 break ;
37283738 }
@@ -3873,8 +3883,15 @@ pj_status_t pjsua_acc_get_uac_addr(pjsua_acc_id acc_id,
38733883 * we are on NAT64 and already obtained the address
38743884 * from STUN above.
38753885 */
3876- if (update_addr )
3886+
3887+ if (update_addr ) {
38773888 pj_strdup (pool , & addr -> host , & tp -> local_name .host );
3889+ tp_type = tp -> key .type ;
3890+
3891+ if (pj_strchr (& addr -> host , ':' )) {
3892+ tp_type |= PJSIP_TRANSPORT_IPV6 ;
3893+ }
3894+ }
38783895 addr -> port = tp -> local_name .port ;
38793896 }
38803897
0 commit comments