Module: sems Branch: master Commit: 339582ba25c7e7e5dfc5253d8ed575faed8d5a46 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=339582ba25c7e7e5dfc5253d8ed575faed8d5a46
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Wed Apr 3 12:21:26 2013 +0200 b/f: reg-cache: fixed UA-side timer --- apps/sbc/RegisterCache.cpp | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/sbc/RegisterCache.cpp b/apps/sbc/RegisterCache.cpp index e01f15c..8beda03 100644 --- a/apps/sbc/RegisterCache.cpp +++ b/apps/sbc/RegisterCache.cpp @@ -289,11 +289,18 @@ AliasBucket* _RegisterCache::getAliasBucket(const string& alias) void _RegisterCache::setAliasUATimer(AliasEntry* alias_e) { + if(!alias_e->ua_expire) + return; + AmAppTimer* app_timer = AmAppTimer::instance(); - double timeout = alias_e->ua_expire - app_timer->unix_clock.get(); - if(timeout > 0.0) { + time_t timeout = alias_e->ua_expire - app_timer->unix_clock.get(); + if(timeout > 0) { app_timer->setTimer(alias_e,timeout); } + else { + // already expired at the UA side, just fire the timer handler + alias_e->fire(); + } } void _RegisterCache::removeAliasUATimer(AliasEntry* alias_e) _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
