dlg_timer.h File Reference

Timer related functions for the dialog module

Module: dialog. More...

#include "../../locking.h"

Include dependency graph for dlg_timer.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dlg_timer
struct  dlg_tl

Typedefs

typedef void(* dlg_timer_handler )(struct dlg_tl *)

Functions

void destroy_dlg_timer (void)
 Destroy global dialog timer.
void dlg_timer_routine (unsigned int ticks, void *attr)
 Timer routine for expiration of dialogs Timer handler for expiration of dialogs, runs the global timer handler on them.
int init_dlg_timer (dlg_timer_handler)
 Initialize the dialog timer handler Initialize the dialog timer handler, allocate the lock and a global timer in shared memory. The global timer handler will be set on success.
int insert_dlg_timer (struct dlg_tl *tl, int interval)
 Insert a dialog timer to the list.
int remove_dialog_timer (struct dlg_tl *tl)
 Remove a dialog timer from the list.
int update_dlg_timer (struct dlg_tl *tl, int timeout)
 Update a dialog timer on the list.


Detailed Description

Timer related functions for the dialog module

Module: dialog.

Definition in file dlg_timer.h.


Typedef Documentation

typedef void(* dlg_timer_handler)(struct dlg_tl *)

dialog timer handler

Definition at line 59 of file dlg_timer.h.


Function Documentation

void destroy_dlg_timer ( void   ) 

Destroy global dialog timer.

Definition at line 89 of file dlg_timer.c.

References dlg_timer::lock, and shm_free.

Referenced by mod_destroy().

void dlg_timer_routine ( unsigned int  ticks,
void *  attr 
)

Timer routine for expiration of dialogs Timer handler for expiration of dialogs, runs the global timer handler on them.

Parameters:
time for expiration checks
attr unused

Definition at line 275 of file dlg_timer.c.

References get_expired_dlgs(), LM_DBG, dlg_tl::next, NULL, and timer_hdl.

Referenced by mod_init().

int init_dlg_timer ( dlg_timer_handler  hdl  ) 

Initialize the dialog timer handler Initialize the dialog timer handler, allocate the lock and a global timer in shared memory. The global timer handler will be set on success.

Parameters:
hdl dialog timer handler
Returns:
0 on success, -1 on failure

Definition at line 53 of file dlg_timer.c.

References dlg_timer::first, LM_ERR, dlg_timer::lock, dlg_tl::next, dlg_tl::prev, shm_free, shm_malloc(), and timer_hdl.

Referenced by mod_init().

int insert_dlg_timer ( struct dlg_tl tl,
int  interval 
)

Insert a dialog timer to the list.

Parameters:
tl dialog timer list
interval timeout value in seconds
Returns:
0 on success, -1 when the input timer list is invalid

Definition at line 131 of file dlg_timer.c.

References get_ticks(), insert_dialog_timer_unsafe(), LM_CRIT, dlg_timer::lock, dlg_tl::next, dlg_tl::prev, and dlg_tl::timeout.

Referenced by dlg_onreply(), and load_dialog_info_from_db().

int remove_dialog_timer ( struct dlg_tl tl  ) 

Remove a dialog timer from the list.

Parameters:
tl dialog timer that should be removed
Returns:
1 when the input timer is empty, 0 when the timer was removed, -1 when the input timer list is invalid

Definition at line 168 of file dlg_timer.c.

References LM_CRIT, dlg_timer::lock, dlg_tl::next, NULL, dlg_tl::prev, remove_dialog_timer_unsafe(), and dlg_tl::timeout.

Referenced by bye_reply_cb(), destroy_dlg(), and dlg_onroute().

int update_dlg_timer ( struct dlg_tl tl,
int  timeout 
)

Update a dialog timer on the list.

Parameters:
tl dialog timer
timeout new timeout value in seconds
Returns:
0 on success, -1 when the input list is invalid
Note:
the update is implemented as a remove, insert

Definition at line 201 of file dlg_timer.c.

References get_ticks(), insert_dialog_timer_unsafe(), dlg_timer::lock, dlg_tl::next, dlg_tl::prev, remove_dialog_timer_unsafe(), and dlg_tl::timeout.

Referenced by dlg_onroute().


Generated on Tue May 22 16:00:39 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6