Ignore:
Timestamp:
Oct 8, 2015 8:55:52 AM (9 years ago)
Author:
ming
Message:

Fixed #1873: iOS application getting killed after pjsua fail to release a disconnected transport

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r5170 r5188  
    22002200 
    22012201            /* Reset pointer to registration transport */ 
    2202             acc->auto_rereg.reg_tp = NULL; 
     2202            //acc->auto_rereg.reg_tp = NULL; 
    22032203 
    22042204            /* Stop keep-alive timer if any. */ 
     
    25922592    /* Update pointer to registration transport */ 
    25932593    if (status == PJ_SUCCESS) { 
    2594         pjsip_regc_info reg_info; 
    2595  
    2596         pjsip_regc_get_info(pjsua_var.acc[acc_id].regc, &reg_info); 
    2597         pjsua_var.acc[acc_id].auto_rereg.reg_tp = reg_info.transport; 
     2594        /* Variable auto_rereg.reg_tp is currently unused since it may differ 
     2595         * with the transport used by regc (for example, when a resolver is 
     2596         * employed). A more reliable way is to query the regc directly 
     2597         * when needed. 
     2598         */ 
     2599        //pjsip_regc_info reg_info; 
     2600 
     2601        //pjsip_regc_get_info(pjsua_var.acc[acc_id].regc, &reg_info); 
     2602        //pjsua_var.acc[acc_id].auto_rereg.reg_tp = reg_info.transport; 
    25982603         
    25992604        if (pjsua_var.ua_cfg.cb.on_reg_started) { 
     
    36313636        pjsua_acc *acc = &pjsua_var.acc[i]; 
    36323637 
    3633         /* Skip if this account is not valid OR auto re-registration 
    3634          * feature is disabled OR this transport is not used by this account. 
    3635          */ 
    3636         if (!acc->valid || !acc->cfg.reg_retry_interval ||  
    3637             tp != acc->auto_rereg.reg_tp) 
    3638         { 
     3638        /* Skip if this account is not valid. */ 
     3639        if (!acc->valid) 
    36393640            continue; 
    3640         } 
    3641  
    3642         /* Release regc transport immediately 
     3641 
     3642        /* Release transport immediately if regc is using it 
    36433643         * See https://trac.pjsip.org/repos/ticket/1481 
    36443644         */ 
    3645         if (pjsua_var.acc[i].regc) { 
     3645        if (acc->regc) { 
     3646            pjsip_regc_info reg_info; 
     3647 
     3648            pjsip_regc_get_info(acc->regc, &reg_info); 
     3649            if (reg_info.transport != tp) 
     3650                continue; 
     3651 
    36463652            pjsip_regc_release_transport(pjsua_var.acc[i].regc); 
    3647         } 
    3648  
    3649         /* Schedule reregistration for this account */ 
    3650         schedule_reregistration(acc); 
     3653 
     3654            /* Schedule reregistration for this account */ 
     3655            if (acc->cfg.reg_retry_interval) { 
     3656                schedule_reregistration(acc); 
     3657            } 
     3658        } 
    36513659    } 
    36523660 
Note: See TracChangeset for help on using the changeset viewer.