简体   繁体   English

如何将TLS支持应用于iOS的PJSIP

[英]How to apply TLS support to PJSIP for ios

I am creating a VoIP application for IOS. 我正在为IOS创建VoIP应用程序。 i am using the pjsip open source libraries for this . 我正在为此使用pjsip开源库。 I am able to connect when i configure the pjsip to UDP . 当我将pjsip配置为UDP时,我能够连接。 But i always get error code 171060 [Error creating transport: Unsupported transport (PJSIP_EUNSUPTRANSPORT) [status=171060]] 但是我总是收到错误代码171060 [创建传输时出错:不支持的传输(PJSIP_EUNSUPTRANSPORT)[状态= 171060]]

I get it that somewhere I am making mistake while configuring the file settings for TLS. 我发现在配置TLS的文件设置时我犯了一个错误。 This is what i am doing. 这就是我在做什么。

pjsua_transport_config cfg;
    pjsua_transport_config_default(&cfg);
    cfg.port = 5061;
    cfg.tls_setting.ca_list_file = pj_str((char*)[[[NSBundle mainBundle] pathForResource:@"ca_list" ofType:@"pem"] cStringUsingEncoding:NSUTF8StringEncoding]); // location of cacert.pem

    cfg.tls_setting.cert_file = pj_str((char*)[[[NSBundle mainBundle] pathForResource:@"certificate" ofType:@"pem"] cStringUsingEncoding:NSUTF8StringEncoding]); // location of cacert.pem

    cfg.tls_setting.privkey_file = pj_str((char*)[[[NSBundle mainBundle] pathForResource:@"pvkey" ofType:@"pem"] cStringUsingEncoding:NSUTF8StringEncoding]); //

    cfg.tls_setting.password = pj_str("myPassword");
    cfg.tls_setting.verify_client = PJ_TRUE;
    cfg.tls_setting.verify_server = PJ_TRUE;
    cfg.tls_setting.method = PJSIP_TLSV1_METHOD;

    //
    NSLog(@"******TLS********");
    //pjsua_transport_id  transport_id = 1;
    status = pjsua_transport_create(PJSIP_TRANSPORT_TLS , &cfg, NULL);

    if (status != PJ_SUCCESS) error_exit("Error creating transport", status);

I have searched up and down on google on how to resolve this issue but i haven't come across any concrete solution thus far. 我已经在Google上搜索了如何解决此问题的方法,但是到目前为止,我还没有遇到任何具体的解决方案。 Please if anyone knows can you help me?? 请如果有人知道你能帮我吗?

Solved it. 解决了。 The newly created frameworks were not getting added. 新创建的框架未添加。 And were not FAT libs so the problem rose. 而且不是FAT库,因此问题上升了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM