Ignore:
Timestamp:
May 17, 2012 8:04:58 AM (12 years ago)
Author:
nanang
Message:

Fix #1505: pjsua_acc_modify() performs unregistration first when account id, registrar, or forced contact is modified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_acc.c

    r4095 r4127  
    651651    pj_str_t acc_proxy[PJSUA_ACC_MAX_PROXIES]; 
    652652    pj_bool_t update_reg = PJ_FALSE; 
     653    pj_bool_t unreg_first = PJ_FALSE; 
    653654    pj_status_t status = PJ_SUCCESS; 
    654655 
     
    775776        acc->srv_port = 0; 
    776777        update_reg = PJ_TRUE; 
     778        unreg_first = PJ_TRUE; 
    777779    } 
    778780 
     
    829831                            &cfg->force_contact); 
    830832        update_reg = PJ_TRUE; 
     833        unreg_first = PJ_TRUE; 
    831834    } 
    832835 
     
    10731076        } 
    10741077        update_reg = PJ_TRUE; 
     1078        unreg_first = PJ_TRUE; 
    10751079    } 
    10761080 
     
    10811085    { 
    10821086        update_reg = PJ_TRUE; 
     1087    } 
     1088 
     1089    /* Unregister first */ 
     1090    if (unreg_first) { 
     1091        pjsua_acc_set_registration(acc->index, PJ_FALSE); 
     1092        if (acc->regc != NULL) { 
     1093            pjsip_regc_destroy(acc->regc); 
     1094            acc->regc = NULL; 
     1095            acc->contact.slen = 0; 
     1096        } 
    10831097    } 
    10841098 
Note: See TracChangeset for help on using the changeset viewer.