464027401@qq.com
2021-12-15 2e150f4bb015d843dae94a9c1281a062fca5162b
HDLLinPhoneSDK£¨OC£©/HDLLinPhoneSDK/HDLLinphoneManager.m
@@ -2132,11 +2132,21 @@
   linphone_core_cbs_set_version_update_check_result_received(cbs, linphone_iphone_version_update_check_result_received);
   linphone_core_cbs_set_qrcode_found(cbs, linphone_iphone_qr_code_found);
   linphone_core_cbs_set_user_data(cbs, (__bridge void *)(self));
//    NSLog(@"Creating linphonecore1:%@",_configDb);
    lp_config_set_int(_configDb, [@"app" UTF8String], [@"random_port_preference" UTF8String], 1);
   theLinphoneCore = linphone_factory_create_core_with_config_3(factory, _configDb, NULL);
   linphone_core_add_callbacks(theLinphoneCore, cbs);
   linphone_core_start(theLinphoneCore);
    //设置为随机端口
    LinphoneSipTransports transportValue = {-1, -1, -1, -1};
    // will also update the sip_*_port section of the config
    if (linphone_core_set_sip_transports(theLinphoneCore, &transportValue)) {
        LOGE(@"cannot set transport");
    }
    [self removeAllAccounts];
   // Let the core handle cbs
   linphone_core_cbs_unref(cbs);