summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2012-04-12 08:51:22 +0000
committerNanang Izzuddin <nanang@teluu.com>2012-04-12 08:51:22 +0000
commit6d13915f95e00ccd508b0bd6d2c1a08ecc88f0e9 (patch)
treeffe46fa6d9bf706e072431db5ab525af7629c891
parentbe1df6e8fb26fd4c6b75bfcfb182db260593fc86 (diff)
Fix #1484: apply and send re-register when registration timeout/expire setting is changed in pjsua_modify_acc().
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@4041 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsua-lib/pjsua_acc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index 730aea00..c5ec709b 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -965,7 +965,13 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
&cfg->auth_pref.algorithm);
/* Registration */
- acc->cfg.reg_timeout = cfg->reg_timeout;
+ if (acc->cfg.reg_timeout != cfg->reg_timeout) {
+ acc->cfg.reg_timeout = cfg->reg_timeout;
+ if (acc->regc != NULL)
+ pjsip_regc_update_expires(acc->regc, acc->cfg.reg_timeout);
+
+ update_reg = PJ_TRUE;
+ }
acc->cfg.unreg_timeout = cfg->unreg_timeout;
acc->cfg.allow_contact_rewrite = cfg->allow_contact_rewrite;
acc->cfg.reg_retry_interval = cfg->reg_retry_interval;
@@ -974,8 +980,9 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
acc->cfg.register_on_acc_add = cfg->register_on_acc_add;
if (acc->cfg.reg_delay_before_refresh != cfg->reg_delay_before_refresh) {
acc->cfg.reg_delay_before_refresh = cfg->reg_delay_before_refresh;
- pjsip_regc_set_delay_before_refresh(acc->regc,
- cfg->reg_delay_before_refresh);
+ if (acc->regc != NULL)
+ pjsip_regc_set_delay_before_refresh(acc->regc,
+ cfg->reg_delay_before_refresh);
}
/* Normalize registration timeout and refresh delay */