464027401@qq.com
2021-12-14 548b4e645a638faa462b97f6ae9e2c7a38df8154
设置为随机端口
2个文件已修改
16 ■■■■■ 已修改文件
HDLLinPhoneSDK(OC)/HDLLinPhoneSDK/HDLLinPhoneSDK.m 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDLLinPhoneSDK(OC)/HDLLinPhoneSDK/HDLLinphoneManager.m 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDLLinPhoneSDK£¨OC£©/HDLLinPhoneSDK/HDLLinPhoneSDK.m
@@ -43,6 +43,7 @@
}
-(void)login:(NSString*)username password:(NSString*)pwd domain:(NSString*) domain{
    NSLog(@"sipDomain:%@",domain);
    [HDLLinphoneManager.instance login:username password:pwd domain:domain];
}
HDLLinPhoneSDK£¨OC£©/HDLLinPhoneSDK/HDLLinphoneManager.m
@@ -1991,10 +1991,12 @@
    signal(SIGPIPE, SIG_IGN);
    NSLog(@"willCreateLinphoneCore");
    // create linphone core
    [self createLinphoneCore];
    [self.providerDelegate config];
//    _iapManager = [[InAppProductsManager alloc] init];
    NSLog(@"CreatedLinphoneCore");
    // - Security fix - remove multi transport migration, because it enables tcp or udp, if by factoring settings only
    // tls is enabled.     This is a problem for new installations.
@@ -2096,6 +2098,7 @@
        return;
    }
    NSLog(@"Creating linphonecore");
    // Set audio assets
    NSString *ring =
@@ -2132,11 +2135,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);