PJSIP IPv6 registration issue in iOS 11.2.5

245 Views Asked by At
We have integrated PJSIP based SDK in our app and We are doing registration two times at the time of app launch. 

First time with "SIP EndpointId, Pwd" 

    status = pjsua_acc_add(&acc_cfg, PJ_TRUE, &acc_id);
    NSLog(@"Status of registration, %d", status);
    if (status == PJ_SUCCESS) {
         //Registration success
    }

Second with "Apple Token"

    pj_str_t name = pj_str("AppleToken");
    pj_str_t value = pj_str((char*)[hexToken UTF8String]);
    pjsip_generic_string_hdr_init2(&CustomHeader, &name, &value);

    pj_str_t ipv6Key = pj_str("X-IPv6IOSSDK");
    pj_str_t ipv6Value = pj_str("True");
    pjsip_generic_string_hdr_init2(&Ipv6Header, &ipv6Key, &ipv6Value);

    pjsua_acc_get_config(acc_id, app_config.pool,&acc_cfg);

    pj_list_push_back(&acc_cfg.reg_hdr_list, &CustomHeader);

    pj_strcpy2(&contactparam,";app_id=");
    pj_strcat (&contactparam,&value);

    acc_cfg.contact_uri_params = contactparam;

    pj_status_t status = pjsua_acc_modify(acc_id, &acc_cfg);
    if (status != PJ_SUCCESS){

    } 

The issue we are facing here is:

In iOS 10.3 both pjsua_acc_add, pjsua_acc_modify are happening properly when we connected to IPv4 and IPv6 networks.

iOS 10+

IPv4 Wifi -----> Working fine

    a) Registration with (EndpointId, Password) ---> Going on IPv4 Wifi
    b) Modifying account registration with Token ---> Going on IPv4 

IPv6 Wifi -----> Working fine

  a) Registration with (EndpointId, Password) ---> Going on IPv6
  b) Modifying account registration with Token ---> Going on IPv6

However, in iOS 11.2.5 we have observed that pjsua_acc_add is happening on IPv6 and pjsua_acc_modify is happening on IPv4 when we connected to IPv6 wifi.

iOS11+(We have tested on iOS 11.2.5 with 4 different devices. It is happening with all devices )

IPv4 Wifi-----> Working fine

   a) Registration with (EndpointId, Password) ---> Going on IPv4 Network
   b) Modifying account registration with Token ---> Going on IPv4

IPv6 Wifi -----> Not able to Modify account

  a) Registration with (EndpointId, Password) ---> Going on IPv6
  b) Modifying account registration with Token---> Going on IPv4

Eventually, second registration(modifation) generating 'onRegistrationFailed' event.
0

There are 0 best solutions below