diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2010-04-14 08:12:08 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2010-04-14 08:12:08 +0000 |
commit | e89fb5f1b411692949a080105402d38ab1b3d57c (patch) | |
tree | 84b7655c8972173b276c3cfe050a8cd4842a1edb /pjsip/src/pjsua-lib/pjsua_acc.c | |
parent | 3e4dd6d305b65dcd7db9a1d8f36d7f5dcc1b6938 (diff) |
Minor fix #1044:
- Moved the code of disconnecting calls (after first re-reg attempt failure) to schedule_reregistration(), so it will be executed earlier (right after the failure of re-reg attempt).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3139 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_acc.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_acc.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c index 8c2b942e..e1bfc404 100644 --- a/pjsip/src/pjsua-lib/pjsua_acc.c +++ b/pjsip/src/pjsua-lib/pjsua_acc.c @@ -1985,10 +1985,25 @@ static void auto_rereg_timer_cb(pj_timer_heap_t *th, pj_timer_entry *te) if (status != PJ_SUCCESS) schedule_reregistration(acc); +on_return: + PJSUA_UNLOCK(); +} + + +/* Schedule reregistration for specified account. Note that the first + * re-registration after a registration failure will be done immediately. + * Also note that this function should be called within PJSUA mutex. + */ +static void schedule_reregistration(pjsua_acc *acc) +{ + pj_time_val delay; + + pj_assert(acc && acc->valid && acc->cfg.reg_retry_interval); + /* If configured, disconnect calls of this account after the first * reregistration attempt failed. */ - if (acc->cfg.drop_calls_on_reg_fail && acc->auto_rereg.attempt_cnt > 1) + if (acc->cfg.drop_calls_on_reg_fail && acc->auto_rereg.attempt_cnt >= 1) { unsigned i, cnt; @@ -2006,22 +2021,6 @@ static void auto_rereg_timer_cb(pj_timer_heap_t *th, pj_timer_entry *te) } } -on_return: - - PJSUA_UNLOCK(); -} - - -/* Schedule reregistration for specified account. Note that the first - * re-registration after a registration failure will be done immediately. - * Also note that this function should be called within PJSUA mutex. - */ -static void schedule_reregistration(pjsua_acc *acc) -{ - pj_time_val delay; - - pj_assert(acc && acc->valid && acc->cfg.reg_retry_interval); - /* Cancel any re-registration timer */ pjsua_cancel_timer(&acc->auto_rereg.timer); |