summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2009-08-17 14:42:33 +0000
committerNanang Izzuddin <nanang@teluu.com>2009-08-17 14:42:33 +0000
commit59033a91eca00c35e83f2ca2e12441b58c4ba5ff (patch)
tree98bfa0ca0fd6527e3bc384bbb73e564ba69687c5 /pjsip
parent02a717192abbd056e7ec6e754c9b42ddb972b755 (diff)
Ticket #833: Updated previous fix for Session Timer (timer callback gets pending INVITE is in progress), instead of just quitting the callback, it may be better to reschedule the timer (for five seconds).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2890 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip-ua/sip_timer.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/pjsip/src/pjsip-ua/sip_timer.c b/pjsip/src/pjsip-ua/sip_timer.c
index 2c86c207..ad96933b 100644
--- a/pjsip/src/pjsip-ua/sip_timer.c
+++ b/pjsip/src/pjsip-ua/sip_timer.c
@@ -332,9 +332,18 @@ void timer_cb(pj_timer_heap_t *timer_heap, struct pj_timer_entry *entry)
PJ_UNUSED_ARG(timer_heap);
- /* Must NOT have a pending INVITE transaction */
- if (inv->invite_tsx != NULL)
+ /* When there is a pending INVITE transaction, delay/reschedule this timer
+ * for five seconds to cover the case that pending INVITE fails and the
+ * previous session is still active. If the pending INVITE is successful,
+ * timer state will be updated, i.e: restarted or stopped.
+ */
+ if (inv->invite_tsx != NULL) {
+ pj_time_val delay = {5};
+
+ inv->timer->timer.id = 1;
+ pjsip_endpt_schedule_timer(inv->dlg->endpt, &inv->timer->timer, &delay);
return;
+ }
/* Lock dialog. */
pjsip_dlg_inc_lock(inv->dlg);