diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2013-05-23 07:41:17 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2013-05-23 07:41:17 +0000 |
commit | 9e0fe8fa59243d8aa937982931aa5e1be7e944de (patch) | |
tree | 133da16ebde700a7ad9072080a5a23a1c85309da /pjsip | |
parent | eb8fada05663c62a344aa2ce62db5e82eb59cdf0 (diff) |
Fix #1669: When (account/global) proxy setting is changed, unregister and reset registration internal state (acc->regc) before performing re-registration. The same mechanism is also applied for any account config changes on transport, credential info, or auth preference.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4523 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_acc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c index 70a59eeb..f9230def 100644 --- a/pjsip/src/pjsua-lib/pjsua_acc.c +++ b/pjsip/src/pjsua-lib/pjsua_acc.c @@ -924,6 +924,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id, if (acc->cfg.transport_id != cfg->transport_id) { acc->cfg.transport_id = cfg->transport_id; update_reg = PJ_TRUE; + unreg_first = PJ_TRUE; } /* Update keep-alive */ @@ -991,6 +992,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id, if (acc->cfg.reg_use_proxy != cfg->reg_use_proxy) { acc->cfg.reg_use_proxy = cfg->reg_use_proxy; update_reg = PJ_TRUE; + unreg_first = PJ_TRUE; } /* Global outbound proxy */ @@ -1011,6 +1013,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id, acc->global_route_crc = global_route_crc; update_reg = PJ_TRUE; + unreg_first = PJ_TRUE; } /* Account proxy */ @@ -1035,6 +1038,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id, acc->local_route_crc = local_route_crc; update_reg = PJ_TRUE; + unreg_first = PJ_TRUE; } /* Credential info */ @@ -1088,13 +1092,19 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id, { acc->cred[acc->cred_cnt++] = pjsua_var.ua_cfg.cred_info[i]; } + + update_reg = PJ_TRUE; + unreg_first = PJ_TRUE; } /* Authentication preference */ acc->cfg.auth_pref.initial_auth = cfg->auth_pref.initial_auth; - if (pj_strcmp(&acc->cfg.auth_pref.algorithm, &cfg->auth_pref.algorithm)) + if (pj_strcmp(&acc->cfg.auth_pref.algorithm, &cfg->auth_pref.algorithm)) { pj_strdup_with_null(acc->pool, &acc->cfg.auth_pref.algorithm, &cfg->auth_pref.algorithm); + update_reg = PJ_TRUE; + unreg_first = PJ_TRUE; + } /* Registration */ if (acc->cfg.reg_timeout != cfg->reg_timeout) { |