#include <stdlib.h>
#include "script_cb.h"
#include "dprint.h"
#include "error.h"
#include "mem/mem.h"

Go to the source code of this file.
Functions | |
| static int | add_callback (struct script_cb **list, cb_function f, void *param) |
| Add a callback to the list. | |
| static void | destroy_cb_list (struct script_cb **list) |
| Destroy callback list, free memory. | |
| void | destroy_script_cb (void) |
| Destroy all callbacks. | |
| static int | exec_post_cb (struct sip_msg *msg, struct script_cb *cb) |
| Execute post-script callbacks, don't stop on error. | |
| int | exec_post_req_cb (struct sip_msg *msg) |
| Execute post-request callbacks. | |
| int | exec_post_rpl_cb (struct sip_msg *msg) |
| Execute post-reply callbacks. | |
| static int | exec_pre_cb (struct sip_msg *msg, struct script_cb *cb) |
| Execute pre-script callbacks, stop on error. | |
| int | exec_pre_req_cb (struct sip_msg *msg) |
| Execute pre-request callbacks. | |
| int | exec_pre_rpl_cb (struct sip_msg *msg) |
| Execute pre-reply callbacks. | |
| int | register_script_cb (cb_function f, int type, void *param) |
| Register a script callback function. | |
Variables | |
| static unsigned int | cb_id = 0 |
| static struct script_cb * | post_req_cb = 0 |
| static struct script_cb * | post_rpl_cb = 0 |
| static struct script_cb * | pre_req_cb = 0 |
| static struct script_cb * | pre_rpl_cb = 0 |
Definition in file script_cb.c.
| static int add_callback | ( | struct script_cb ** | list, | |
| cb_function | f, | |||
| void * | param | |||
| ) | [inline, static] |
Add a callback to the list.
Definition at line 62 of file script_cb.c.
References cb_id, script_cb::cbf, script_cb::id, LM_ERR, script_cb::next, script_cb::param, and pkg_malloc.
Referenced by register_script_cb().
| static void destroy_cb_list | ( | struct script_cb ** | list | ) | [inline, static] |
Destroy callback list, free memory.
Definition at line 134 of file script_cb.c.
References script_cb::next, and pkg_free.
Referenced by destroy_script_cb().
| void destroy_script_cb | ( | void | ) |
Destroy all callbacks.
Definition at line 149 of file script_cb.c.
References destroy_cb_list().
Referenced by cleanup().
Execute post-script callbacks, don't stop on error.
| msg | SIP message | |
| cb | callback list |
Definition at line 181 of file script_cb.c.
References script_cb::cbf, script_cb::next, and script_cb::param.
Referenced by exec_post_req_cb(), and exec_post_rpl_cb().
| int exec_post_req_cb | ( | struct sip_msg * | msg | ) |
Execute post-request callbacks.
| msg | SIP message |
Definition at line 217 of file script_cb.c.
References exec_post_cb().
Referenced by dlg_ontimeout(), and receive_msg().
| int exec_post_rpl_cb | ( | struct sip_msg * | msg | ) |
Execute post-reply callbacks.
| msg | SIP message |
Definition at line 228 of file script_cb.c.
References exec_post_cb().
Referenced by receive_msg().
Execute pre-script callbacks, stop on error.
| msg | SIP message | |
| cb | callback list |
Definition at line 164 of file script_cb.c.
References script_cb::cbf, script_cb::next, and script_cb::param.
Referenced by exec_pre_req_cb(), and exec_pre_rpl_cb().
| int exec_pre_req_cb | ( | struct sip_msg * | msg | ) |
Execute pre-request callbacks.
| msg | SIP message |
Definition at line 195 of file script_cb.c.
References exec_pre_cb().
Referenced by dlg_ontimeout(), and receive_msg().
| int exec_pre_rpl_cb | ( | struct sip_msg * | msg | ) |
Execute pre-reply callbacks.
| msg | SIP message |
Definition at line 206 of file script_cb.c.
References exec_pre_cb().
Referenced by receive_msg().
| int register_script_cb | ( | cb_function | f, | |
| int | type, | |||
| void * | param | |||
| ) |
Register a script callback function.
| f | callback function | |
| type | callback type | |
| param | callback parameter |
Definition at line 89 of file script_cb.c.
References add_callback(), LM_CRIT, LM_ERR, POST_SCRIPT_CB, PRE_SCRIPT_CB, REQ_TYPE_CB, and RPL_TYPE_CB.
Referenced by mod_init().
unsigned int cb_id = 0 [static] |
struct script_cb* post_req_cb = 0 [static] |
list of post-request callbacks
Definition at line 44 of file script_cb.c.
struct script_cb* post_rpl_cb = 0 [static] |
list of post-reply callbacks
Definition at line 49 of file script_cb.c.
struct script_cb* pre_req_cb = 0 [static] |
list of pre-request callbacks
Definition at line 42 of file script_cb.c.
struct script_cb* pre_rpl_cb = 0 [static] |
list of pre-reply callbacks
Definition at line 47 of file script_cb.c.
1.5.6