MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / update_dlg_timer

Function update_dlg_timer

modules/dialog/dlg_timer.c:552–580  ·  view source on GitHub ↗

returns : 0 - dialog was inserted in timer list with the new timeout 1 - dialog was inserted in timer list with the new timeout -1 - failure (dialog is expired, so it cannot be added again) */

Source from the content-addressed store, hash-verified

550 1 - dialog was inserted in timer list with the new timeout
551 -1 - failure (dialog is expired, so it cannot be added again) */
552int update_dlg_timer( struct dlg_tl *tl, int timeout )
553{
554 int ret;
555
556 lock_get( d_timer->lock);
557
558 if ( tl->next == FAKE_DIALOG_TL ) {
559 /* previously removed from timer list - we will not add it again */
560 lock_release( d_timer->lock);
561 return 0;
562 }
563
564 if ( tl->next ) {
565 if (tl->prev==0) {
566 lock_release( d_timer->lock);
567 return -1;
568 }
569 remove_dlg_timer_unsafe(tl);
570 ret = 0;
571 } else {
572 ret = 1;
573 }
574
575 tl->timeout = get_ticks()+timeout;
576 insert_gen_timer_unsafe( d_timer, tl );
577
578 lock_release( d_timer->lock);
579 return ret;
580}
581
582static inline struct dlg_tl* _get_gen_expired_dlgs(struct dlg_timer *timer, unsigned int time)
583{

Callers 4

dlg_onreplyFunction · 0.85
dlg_onrouteFunction · 0.85
pv_set_dlg_timeoutFunction · 0.85
dlg_replicated_updateFunction · 0.85

Calls 5

lock_getFunction · 0.85
lock_releaseFunction · 0.85
remove_dlg_timer_unsafeFunction · 0.85
get_ticksFunction · 0.85
insert_gen_timer_unsafeFunction · 0.85

Tested by

no test coverage detected