Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple SSL #2930

Closed
emretufekci opened this issue Dec 24, 2021 · 25 comments · Fixed by #3034
Closed

Apple SSL #2930

emretufekci opened this issue Dec 24, 2021 · 25 comments · Fixed by #3034

Comments

@emretufekci
Copy link
Contributor

Describe the bug

Assertion failed in registering to stun server

16:01:07.080 pjsua_acc.c ..Acc 0: Registration sent registering... 16:01:07.145 stunresolve .STUN mapped address found/changed: XX.XXX.11.166:19158 16:01:07.146 pjsua_core.c .STUN resolution success, using 193.140.74.144:3478, address is <STUN_IP>:<STUN_PORT> Assertion failed: (ssock->send_buf.max_len == 0), function ssock_on_connect_complete, file ../src/pj/ssl_sock_imp_common.c, line 1134.

Steps to reproduce

void PJSua2::createLib() {
    try {
        ep->libCreate();
    } catch (Error& err){
        std::cout << "Startup error: " << err.info() << std::endl;
    }
    
    //LibInit
    try {
        ep->libInit( *ep_cfg );
    } catch(Error& err) {
        std::cout << "Initialization error: " << err.info() << std::endl;
    }
    
    // Create SIP transport. Error handling sample is shown
    try {
    TransportConfig tcfg;
    
    //TLS
    pjsip_cfg();
    tcfg.tlsConfig.method = PJSIP_TLSV1_3_METHOD;
    tcfg.port = 0; //-> Check w/zero
    ep->transportCreate(PJSIP_TRANSPORT_TLS, tcfg);
    ep->transportCreate(PJSIP_TRANSPORT_UDP, tcfg);

    } catch(Error& err) {
    std::cout << "Transport creation error:" << err.info() << std::endl;
    }

    // Start the library (worker threads etc)
    try { ep->libStart();
    } catch(Error& err) {
    std::cout << "Startup error: " << err.info() << std::endl;
    }
}

Then create acc:

void PJSua2::createAccount(std::string username, std::string password, std::string ip, std::string port, std::string stun_ip, std::string stun_port, std::string turn_ip, std::string turn_port, std::string turn_username, std::string turn_password, bool ice_enabled, bool turn_enabled, bool tls_enabled, bool stun_enabled) {
    
    
    // Configure an AccountConfig
    AccountConfig acfg;

    ep_cfg->uaConfig.userAgent = "IPHONE";

    
    //NAT CONFIGs
    acfg.natConfig.iceEnabled = PJ_TRUE;
    
    //Set Turn
    if(turn_enabled){
        std::string turnIp = turn_ip;
        std::string turnUsername = turn_username;
        std::string turnPassword = turn_password;
        std::string turnPort = turn_port;
    }
    
    //Set Stun
    if(stun_enabled){
        ep_cfg->uaConfig.stunServer.push_back(stun_ip + ":" + stun_port);
    }
    
    //TLS CONFIG
    if(tls_enabled){
        acfg.sipConfig.proxies.clear();
        acfg.sipConfig.proxies.push_back("sip:" + ip + ";hide;transport=tls");
    }
    
    // Ice Configs
    if(ice_enabled){
        
        
        //ICE
        acfg.natConfig.iceMaxHostCands = -1;
        
        //STUN
        acfg.natConfig.sipStunUse = PJSUA_STUN_USE_DEFAULT;
        acfg.natConfig.mediaStunUse = PJSUA_STUN_RETRY_ON_FAILURE;
        ep->natUpdateStunServers(ep_cfg->uaConfig.stunServer, PJ_FALSE);
        
        //TURN
        acfg.natConfig.turnEnabled = PJ_TRUE;
        acfg.natConfig.turnServer = turn_ip + ":" + turn_port;
        acfg.natConfig.turnUserName = turn_username;
        acfg.natConfig.turnPassword = turn_password;
    }
    
    else if (turn_enabled){
        acfg.natConfig.sipStunUse = PJSUA_STUN_USE_DISABLED;
        acfg.natConfig.mediaStunUse = PJSUA_STUN_USE_DISABLED;
        acfg.natConfig.iceMaxHostCands = 0; 
        acfg.natConfig.turnEnabled = PJ_TRUE;
        acfg.natConfig.turnServer = turn_ip+":"+turn_port;
        acfg.natConfig.turnUserName = turn_username;
        acfg.natConfig.turnPassword = turn_password;
    }
    else if (stun_enabled){
        acfg.natConfig.sipStunUse = PJSUA_STUN_USE_DEFAULT;
        acfg.natConfig.mediaStunUse = PJSUA_STUN_RETRY_ON_FAILURE;
        acfg.natConfig.iceMaxHostCands = -1;
        
        //bj_bzero -> std::fill
        std::fill(EpConfig().uaConfig.stunServer.begin(), EpConfig().uaConfig.stunServer.end(), 0);
        ep->natUpdateStunServers(EpConfig().uaConfig.stunServer, PJ_FALSE);
    
    } else {
        acfg.natConfig.iceEnabled = PJ_FALSE;
        acfg.natConfig.turnEnabled = PJ_FALSE;
        acfg.natConfig.sipStunUse = PJSUA_STUN_USE_DISABLED;
        acfg.natConfig.mediaStunUse = PJSUA_STUN_USE_DISABLED;
    }
    
    // Configure an AccountConfig
    acfg.idUri = "sip:" + username + "@" + ip + ":" + port;
    acfg.regConfig.registrarUri = "sip:" + ip + ":" + port;
    AuthCredInfo cred("digest", "*", username, 0, password);
    acfg.sipConfig.authCreds.push_back(cred);


    acfg.sipConfig.contactUriParams=";app-id="+appId+";pn-type=1"+";pn-tok="+apnToken; //PUSH NOTIFICATION SUPPORT //according to linphone standart
    
    //acfg.regConfig.registrarUri = "sip:" + ip + ":" + port + ";transport=tcp"; // TCP SUPPORT
    

    if(acc->getId() == -1){
        // Create the account
        try {
            acc->create(acfg);
        } catch(Error& err) {
            std::cout << "Account creation error: " << err.info() << std::endl;
        }
    }else {
        // Modify the account
        try {
            //Update the registration
            acc->modify(acfg);
            acc->setRegistration(true);
        } catch(Error& err) {
            std::cout << "Account modify error:  " << err.info() << std::endl;
        }
    }
}

PJSIP version

2.11

Context

The issue happens iphone 12 w/configure-iphone parameter w/third-party-media-stack and i'm using APPLE SSL

Log, call stack, etc

pjsua_core.c  Trying STUN server <IP:PORT> IPv4 (1 of 1)..
16:01:07.077            pjsua_acc.c  Adding account: id=sip:<SIPID>@<IP:PORT>
16:01:07.077            pjsua_acc.c  .Account sip:ID@<IP:PORT> added with id 0
16:01:07.077            pjsua_acc.c  .Acc 0: setting registration..
16:01:07.079        tlsc0x10a817228  ..TLS client transport created
16:01:07.079        tlsc0x10a817228  ..TLS transport <IP:PORT> is connecting to <IP:PORT>
16:01:07.079            pjsua_acc.c  ..Contact for acc 0 updated: <sip:<IP:PORT>;transport=TLS;app-id=;pn-type=1;ob>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00008340d0fa>"
16:01:07.080           pjsua_core.c  ...TX 743 bytes Request msg REGISTER/cseq=50721 (tdta0x10a81a8a8) to TLS <IP:PORT>
REGISTER sip:<IP:PORT> SIP/2.0

Via: SIP/2.0/TLS <IP:PORT>;rport;branch=;alias

Max-Forwards: 70

From: <sip:@>;tag=1saYM2e3YOCvnWPxKGfRHKswBKN8zURJ

To: <sip:@>

Call-ID:

CSeq: 50721 REGISTER

Supported: outbound, path

Contact: <sip:<id>@<IP:PORT>;transport=TLS;pn-type=1;pn-tok=;ob>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00008340d0fa>"

Expires: 300

Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS

Content-Length:  0




--end msg--
16:01:07.080            pjsua_acc.c  ..Acc 0: Registration sent
registering...
16:01:07.145            stunresolve  .STUN mapped address found/changed: <IP:PORT>
16:01:07.146           pjsua_core.c  .STUN resolution success, using <IP:PORT>, address is <IP:PORT>
Assertion failed: (ssock->send_buf.max_len == 0), function ssock_on_connect_complete, file ../src/pj/ssl_sock_imp_common.c, line 1134.
@sauwming
Copy link
Member

Please check if #2825 solves this issue.

@emretufekci
Copy link
Contributor Author

I've compiled with #2825, seems the issue solved.

09:08:50.943        tlsc0x10c835628  TLS connection closed
09:08:50.943            pjsua_acc.c  Disconnected notification for transport tlsc0x10c835628
09:08:50.943        sip_transport.c  .Transport tlsc0x10c835628 shutting down, force=0
09:08:50.943            pjsua_acc.c  .Scheduling re-registration retry for acc 0 in 7 seconds..
09:08:50.943        tlsc0x10c835628  TLS connect() error: [code=120053] peer: 193.140.74.144: Software caused connection abort
09:08:50.954        tlsc0x10c835628  TLS transport destroyed with reason 70016: End of file (PJ_EEOF)

&

2021-12-27 08:59:15.520814+0300 APP[1250:838097] Connection 7: received ECONNRESET with incomplete TLS handshake - generating errSSLClosedNoNotify

After even these situation, didn't crash.

Since you've mentioned it is race condition, it might be happen again. I'll update the issue please keep it open.

But anyway normally it was crashing with same logs, we can assume that the issue solved. Thank you.

@emretufekci
Copy link
Contributor Author

emretufekci commented Dec 27, 2021

It is reduced the percentage of assertion failed for sure but anyway no luck.

Address sanitizer on:

--end msg--
16:08:56.289            pjsua_acc.c  ..Acc 0: Registration sent
registering...
16:08:56.383            stunresolve  .STUN mapped address found/changed: xxx
16:08:56.384           pjsua_core.c  .STUN resolution success, using xxx, address is xxx
Assertion failed: (ssock->send_buf.max_len == 0), function ssock_on_connect_complete, file ../src/pj/ssl_sock_imp_common.c, line 1134.
(lldb) 

If i get same thing w/sanitizer on i'll update it again.

@sauwming
Copy link
Member

I would recommend to turn on SSL_DEBUG (define it as 1 in ssl_sock_apple.m). Then when the issue happens again, please provide us the complete log (as text attachment).

@emretufekci
Copy link
Contributor Author

I've changed like this:

#define SSL_SOCK_IMP_USE_CIRC_BUF
#define SSL_SOCK_IMP_USE_OWN_NETWORK
#define SSL_DEBUG 1
#include "ssl_sock_imp_common.h"
#include "ssl_sock_imp_common.c"

nothing changed:


16:08:15.712         os_core_unix.c !pjlib 2.10-dev for POSIX initialized
16:08:15.713         sip_endpoint.c  .Creating endpoint instance...
16:08:15.713                  pjlib  .select() I/O Queue created (0x10ce470d8)
16:08:15.713         sip_endpoint.c  .Module "mod-msg-print" registered
16:08:15.713        sip_transport.c  .Transport manager created.
16:08:15.713           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
16:08:15.713         sip_endpoint.c  .Module "mod-pjsua-log" registered
16:08:15.713         sip_endpoint.c  .Module "mod-tsx-layer" registered
16:08:15.713         sip_endpoint.c  .Module "mod-stateful-util" registered
16:08:15.713         sip_endpoint.c  .Module "mod-ua" registered
16:08:15.713         sip_endpoint.c  .Module "mod-100rel" registered
16:08:15.713         sip_endpoint.c  .Module "mod-pjsua" registered
16:08:15.713         sip_endpoint.c  .Module "mod-invite" registered
16:08:15.713                  pjlib  ..select() I/O Queue created (0x10b0c4a28)
16:08:15.715         sip_endpoint.c  .Module "mod-evsub" registered
16:08:15.715         sip_endpoint.c  .Module "mod-presence" registered
16:08:15.715         sip_endpoint.c  .Module "mod-mwi" registered
16:08:15.715         sip_endpoint.c  .Module "mod-refer" registered
16:08:15.715         sip_endpoint.c  .Module "mod-pjsua-pres" registered
16:08:15.715         sip_endpoint.c  .Module "mod-pjsua-im" registered
16:08:15.715         sip_endpoint.c  .Module "mod-pjsua-options" registered
16:08:15.715           pjsua_core.c  .1 SIP worker threads created
16:08:15.715           pjsua_core.c  .pjsua version 2.10-dev for iOS-14.6/arm-iPhone13,2/iOS-SDK initialized
16:08:15.715           pjsua_core.c  .PJSUA state changed: CREATED --> INIT
16:08:15.716            tlstp:58658  SIP TLS listener is ready for incoming connections at xxx
16:08:15.716           pjsua_core.c  SIP UDP socket reachable at xxx
16:08:15.716         udp0x10aa5b3a0  SIP UDP transport started, published address is xxx
16:08:15.716           pjsua_core.c  PJSUA state changed: INIT --> STARTING
16:08:15.716         sip_endpoint.c  .Module "mod-unsolicited-mwi" registered
16:08:15.716           pjsua_core.c  .PJSUA state changed: STARTING --> RUNNING

16:08:56.286            pjsua_acc.c  Adding account: id=sip:XXX@XXX
16:08:56.286            pjsua_acc.c  .Account sip:XXX@XXX added with id 0
16:08:56.286            pjsua_acc.c  .Acc 0: setting registration..
16:08:56.288        tlsc0x10d008828  ..TLS client transport created
16:08:56.288        tlsc0x10d008828  ..TLS transport xxx is connecting to xxxx
16:08:56.289            pjsua_acc.c  ..Contact for acc 0 updated: 
16:08:56.289           pjsua_core.c  ...TX 745 bytes Request msg REGISTER/cseq=29775 (tdta0x10d00e2a8) to TLS 1xx
REGISTER sip:xx SIP/2.0

Via: SIP/2.0/TLS xxx;rport;branch=z9hG4bKPjrS2IcPvJTSG.9xwhrlUJmFUmcIKbIyPL;alias

Max-Forwards: 70

From: <sip:xxx>;tag=Dbt6oUDavjElLfTiwXtbyLiMAGruaRi7

To: <sip:xxx>

Call-ID: lJV21LvZ09l4-LhBJF2VDKxhNAXiqQp8

CSeq: 29775 REGISTER

Supported: outbound, path

Contact: <sip:xxx:58658;transport=TLS;xxx;ob>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00008340d0fa>"

Expires: 300

Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS

Content-Length:  0




--end msg--
16:08:56.289            pjsua_acc.c  ..Acc 0: Registration sent
registering...
16:08:56.383            stunresolve  .STUN mapped address found/changed: xxx
16:08:56.384           pjsua_core.c  .STUN resolution success, using xxx, address is xxx
Assertion failed: (ssock->send_buf.max_len == 0), function ssock_on_connect_complete, file ../src/pj/ssl_sock_imp_common.c, line 1134.
(lldb) 

@emretufekci
Copy link
Contributor Author

Idk idea behind this but, while i'm testing with this merge, iphone 12 (iosv: 14.6-18F72) always crashed. However iphone 7 (iosv: 13.3 17C54) didn't crash. Probably i'm going to use openSSL if something goes wrong i'll update the issue.

@emretufekci
Copy link
Contributor Author

Same thing happens w/openSSL as well.
err.txt

@sauwming
Copy link
Member

Okay, it seems to mean that this is a generic SSL issue and not related to a particular backend.

A few suggestions:

  • I see from your log that you are using 2.10-dev, so test with the latest branch instead.
  • Try with our sample app. If not, attach your small sample app you use to reproduce the issue so we can test it ourselves locally.

@emretufekci
Copy link
Contributor Author

emretufekci commented Dec 30, 2021

log30-12-2021.log

It's not related with 2.10-dev actually I've already merged with 2.11 and some 2.12 pr, but no way.

The interesting things is that: this is happens only my iPhone 12 iOS 14.6 phone, others are okay. But anyway something goes wrong for sure.

Currently I cannot provide the sample app because of I'm using third party media stack, instead of the phone audio, but above in my first comment I've provided the source code of pjsua2 level. Pjsip is same with 2.11 just using third party media stack.

I don't have the issue with sample apps you provided or pjsua2 swift sample app which is provided by me before. It might be related with media stack, or idk for now. I'll keep the update this issue.

[UPDATE]
This is the log which includes more details:
30.12.2020log-detail.log

@emretufekci
Copy link
Contributor Author

emretufekci commented Dec 31, 2021

The issue solved, it is because of my side.

I'm creating the timer like that
   let timer = Timer.scheduledTimer(withTimeInterval: 10, repeats: true) { timer in
CPPWrapper().register(//configs);
}

without fire it.

I've added following part and issue resolved.

        DispatchQueue.global().asyncAfter(deadline: DispatchTime.now()) {
                if(!timer.isValid){
                    timer.fire()
                }
            }

I'm closing this one, thank you for your collaboration.

@emretufekci
Copy link
Contributor Author

This isn't resolved for iPhone 12 - iOS 14.6

Tested with iPhone 7, iPhone XR they're all okay.

I've merged with the 14.02.2022's commits so this is latest one.

@sauwming

error.log

@emretufekci emretufekci reopened this Feb 14, 2022
@emretufekci
Copy link
Contributor Author

One of the normal case, logs are like that:

...

--end msg--
16:13:38.607         tsx0x10c85e4a8  .Incoming Request msg ACK/cseq=4908 (rdata0x10c854118) in state Completed
16:13:38.607         tsx0x10c85e4a8  ..State changed from Completed to Confirmed, event=RX_MSG
16:13:38.607         dlg0x10c80c8a8  ...Transaction tsx0x10c85e4a8 state changed to Confirmed
16:13:38.620         tsx0x10c85e4a8  Timeout timer event
16:13:38.620         tsx0x10c85e4a8  .State changed from Confirmed to Terminated, event=TIMER
16:13:38.620         dlg0x10c80c8a8  ..Transaction tsx0x10c85e4a8 state changed to Terminated
16:13:38.620         dlg0x10c80c8a8  ...Dialog destroyed!
16:13:38.620         tsx0x10c85e4a8  Timeout timer event
16:13:38.620         tsx0x10c85e4a8  .State changed from Terminated to Destroyed, event=TIMER
16:13:38.620        tdta0x1108398a8  ..Destroying txdata Response msg 487/INVITE/cseq=4908 (tdta0x1108398a8)
16:13:38.620         tsx0x10c85e4a8  Transaction destroyed!
Requested transaction successfully

@sauwming
Copy link
Member

Just like previous suggestions:

  • Test with OpenSSL backend. You mentioned that the assertion happened when using OpenSSL as well, is this still the case?
  • When using Apple SSL backend, turn on SSL_DEBUG (change the definition to 1 in ssl_sock_apple.m)
  • Test with the sample app. You mentioned that using sample app triggered no assertion. If this is so, modify the sample app in order to incorporate what you do in your app until the assertion is triggered. From the log, it shouldn't be related to third party media since the assertion occurred only after a simple registration request.

@emretufekci
Copy link
Contributor Author

Screen Shot 2022-02-15 at 14 01 53

@emretufekci
Copy link
Contributor Author

This is log enabled one for AppleSSL
apple-ssl-log-enabled.log

@emretufekci
Copy link
Contributor Author

@sauwming
This is success case with iPhone 7 -> 13.3
apple-ssl-success-case.log

@sauwming
Copy link
Member

sauwming commented Feb 16, 2022

The double event posts for every event seems weird, and it also happened on the success case.

14:53:17.746       ssl_sock_apple.m !Posting event 0x11804c828 1
14:53:17.746       ssl_sock_apple.m  Post event success 0x11804c828 1
14:53:17.746       ssl_sock_apple.m  Posting event 0x11804c828 1
14:53:17.746       ssl_sock_apple.m  Post event success 0x11804c828 1

My suggestion is to try with ipjsua, instead of pjsua2 swift, since you can immediately use the former for testing without much modification. All you need to do is pass the parameters, such as in ipjsuaAppDelegate.m:

    const char *argv[] = { "pjsua",
        "--use-cli",
        "--no-cli-console",
        "--cli-telnet-port=0",
        "--id=xxx<sip:[email protected]>",
        "--realm=*",
        "--username=xxx",
        "--password=xxxx",
        "--registrar=sip:sip.xxx.org;transport=tls",
        "--use-tls",
        NULL };
    int argc = PJ_ARRAY_SIZE(argv) -1;

Also test with ipjsua and OpenSSL. I tried it here on iPhone 12 with iOS 15.2.1 running OpenSSL 1.1.1m, and it worked fine.

If ipjsua and OpenSSL works fine (this is to rule out app and generic SSL issue/bug), AND ipjsua with Apple SSL still shows the same problem (double events), please provide us with your test server credentials so we can test it here. You can encrypt the information using the key that can be found in https://github.com/pjsip/pjproject/security/policy and attach the text file here.

@emretufekci
Copy link
Contributor Author

DICTIONARY:
TP: THIRD PARTY
SP: SOFT PHONE (DEFAULT APPS) (pjsua2 app is same with the waiting pr)
OPENSSL VER: 1.1.1M
LAST UPDATE PJSIP VER: 09/03/2022 09:10 (GMT +3)
(+) -> BUILD SUCCESS
(-) -> BUILD FAILED

IPHONE SE2 - IOS 15.3.1 RESULTS:

AS AS AS OS OS OS
PJSUA2-SWIFT PJSUA-SWIFT IPJSUA PJSUA2-SWIFT PJSUA-SWIFT IPJSUA
TP-LTE
TP-WIFI
SP-LTE (+) https://file.io/RsdpBV48t57a Undefined symbol: _pjsua_vid_win_get_info (+) https://easyupload.io/2wtpi1 (+) https://file.io/OVgd8EzYkxOf Undefined symbol: _pjsua_vid_win_get_info (+) https://file.io/GOq8WQnHvJfb
SP-WIFI (+) https://file.io/gebnclTRcpGm Undefined symbol: _pjsua_vid_win_get_info (+) https://easyupload.io/9blvaw (+) https://file.io/2245ApQS18RA Undefined symbol: _pjsua_vid_win_get_info (+) https://file.io/AARR9rmH4AyJ

IPHONE 12 - IOS 14.6:

AS AS AS OS OS OS
PJSUA2-SWIFT PJSUA-SWIFT IPJSUA PJSUA2-SWIFT PJSUA-SWIFT IPJSUA
TP-LTE
TP-WIFI
SP-LTE (-) https://file.io/gdieEadhMUvW Undefined symbol: _pjsua_vid_win_get_info (-)https://file.io/revNL8PDVDj3 (+) https://file.io/yPPkwsOhPkAN Undefined symbol: _pjsua_vid_win_get_info (+) https://file.io/NJgDHf4VoEkN
SP-WIFI (+) https://file.io/kIp41DNV2Rrv Undefined symbol: _pjsua_vid_win_get_info (+)https://file.io/7JXc1NC5otwh (-)https://file.io/Z0mbtHgfjNcT (+) https://file.io/LVVQLH389hUe Undefined symbol: _pjsua_vid_win_get_info (+) https://file.io/OgNekbimOsst

@emretufekci
Copy link
Contributor Author

Seems working with the OpenSSL. But unfortunately cannot build for Third Party Library.

First it gives
"error: implicit declaration of function 'check_srtp_roc' is invalid in c99 [-werror,-wimplicit-function-declaration]"
Configure logs:
config.log

Then I declared it as to line 34 in pjsua_media.c

void check_srtp_roc(pjsua_call *call,
			   unsigned med_idx,
			   const pjsua_stream_info *new_si_,
    			   const pjmedia_sdp_media *local_sdp,
    			   const pjmedia_sdp_media *remote_sdp);
    			   

This is solved PJSIP build issue but after that when I'm building for samples it gives me:
After solved the issue build log is:
iphone-build.log

And PJSIP apps build log is this:
pjsipapps-build.log

@emretufekci
Copy link
Contributor Author

emretufekci commented Mar 9, 2022

@sauwming Sorry for late response, it takes time. Could you check and reply it?

All logs are encrypted with your public key as gpg format.

@sauwming
Copy link
Member

Please try the attached patch.
apple_ssl_patch.txt

It should prevent the assertion from happening. What I'm not sure is if this will eventually lead to a successful registration.

@emretufekci
Copy link
Contributor Author

https://file.io/rOAp6V2pkkGe

Seems it is solved. But there is no exact way to handle this error. Sometimes i cannot reproduce the error. I've build without patch then with patch. When i compared both it seems solved but as i said i'll check it by time.

For now it can be hotfix. Thank you.

@sauwming
Copy link
Member

Okay, update us if the issue is completely solved after more extended testing with the patch.

@emretufekci
Copy link
Contributor Author

Still i haven't face with the same issue. We can assume that, the issue is solved. I'm leaving the comment it's up to you close or leave the issue like that. @sauwming

@emretufekci
Copy link
Contributor Author

After a month usage i can say that the issue still persist. I'll send logs when i handle next time. But the issue is now:

Above problem is resolved it's okay but when using pjsua2-swift with AppleSSL sometimes (Especially during the call state) getting invalid turn server settings log. And this is seems crash (actually behavior is same with pressing home button w/ iphone) it goes to background like pressing homebutton and callstop but app is not crashing.

This logs coming with openSSL also but there is no such behavior. It can continue to working.

Something like:
19:33:30.575 pjsua_call.c Making call with acc #0 to sip:<MYNUMBER>@<MYIP>:<MYPORT> 19:33:30.576 alt_pjsua_aud.c .*** Call to unimplemented function pjsua_set_snd_dev *** 19:33:30.576 dlg0x144033ca8 .UAC dialog created 19:33:30.576 dlg0x144033ca8 ..Session count inc to 2 by mod-pjsua 19:33:30.576 pjsua_media.c .Call 1: initializing media.. 19:33:30.576 pjsua_media.c ..Invalid TURN server setting 19:33:30.576 pjsua_media.c ..Error creating media transport: Invalid value or argument (PJ_EINVAL) [status=70004] 19:33:30.576 pjsua_media.c ..Call 1: cleaning up provisional media, prov_med_cnt=1, med_cnt=0 19:33:30.576 pjsua_call.c .Error initializing media channel: Invalid value or argument (PJ_EINVAL) [status=70004] 19:33:30.576 dlg0x144033ca8 ..Session count dec to 1 by mod-pjsua 19:33:30.576 dlg0x144033ca8 .Dialog destroyed! 19:33:30.576 pjsua_media.c .Call 1: deinitializing media.. 19:33:30.576 call.cpp pjsua_call_make_call(acc.getId(), &pj_dst_uri, param.p_opt, this, param.p_msg_data, &id) error: Invalid value or argument (PJ_EINVAL) (status=70004) [../src/pjsua2/call.cpp:698] <MYAPP-CPP>pjsua_call_make_call(acc.getId(), &pj_dst_uri, param.p_opt, this, param.p_msg_data, &id) error: Invalid value or argument (PJ_EINVAL) (status=70004) [../src/pjsua2/call.cpp:698]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants