Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_ua.h>
#include <pjlib.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
#include "include/res_pjsip_private.h"
#include "asterisk/linkedlists.h"
#include "asterisk/lock.h"
#include "asterisk/module.h"
Go to the source code of this file.
Data Structures | |
struct | session_supplements |
Functions | |
int | ast_sip_session_add_supplements (struct ast_sip_session *session) |
Add supplements to a SIP session. More... | |
void | ast_sip_session_register_supplement_with_module (struct ast_module *module, struct ast_sip_session_supplement *supplement) |
Register a supplement to SIP session processing. More... | |
void | ast_sip_session_remove_supplements (struct ast_sip_session *session) |
Remove supplements from a SIP session. More... | |
void | ast_sip_session_unregister_supplement (struct ast_sip_session_supplement *supplement) |
Unregister a an supplement to SIP session processing. More... | |
static struct ast_sip_session_supplement * | supplement_dup (const struct ast_sip_session_supplement *src) |
Variables | |
struct session_supplements | session_supplements = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
int ast_sip_session_add_supplements | ( | struct ast_sip_session * | session | ) |
Add supplements to a SIP session.
session | The session to initialize |
Definition at line 90 of file pjsip_session.c.
References AST_LIST_INSERT_TAIL, ast_module_ref, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, copy(), lock, ast_sip_session_supplement::next, SCOPED_LOCK, session, and supplement_dup().
Referenced by ast_sip_session_alloc().
void ast_sip_session_register_supplement_with_module | ( | struct ast_module * | module, |
struct ast_sip_session_supplement * | supplement | ||
) |
Register a supplement to SIP session processing.
This allows for someone to insert themselves in the processing of SIP requests and responses. This, for example could allow for a module to set channel data based on headers in an incoming message. Similarly, a module could reject an incoming request if desired.
module | Referenced module(NULL safe) |
supplement | The supplement to register |
Definition at line 35 of file pjsip_session.c.
References ast_assert, AST_RWLIST_INSERT_BEFORE_CURRENT, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, AST_SIP_SESSION_BEFORE_MEDIA, lock, ast_sip_session_supplement::module, ast_sip_session_supplement::next, NULL, ast_sip_session_supplement::priority, ast_sip_session_supplement::response_priority, and SCOPED_LOCK.
void ast_sip_session_remove_supplements | ( | struct ast_sip_session * | session | ) |
Remove supplements from a SIP session.
session | The session to remove |
Definition at line 111 of file pjsip_session.c.
References ast_free, AST_LIST_REMOVE_HEAD, ast_module_unref, ast_sip_session_supplement::module, ast_sip_session_supplement::next, and session.
Referenced by session_destructor().
void ast_sip_session_unregister_supplement | ( | struct ast_sip_session_supplement * | supplement | ) |
Unregister a an supplement to SIP session processing.
supplement | The supplement to unregister |
Definition at line 63 of file pjsip_session.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, ast_sip_session_supplement::next, and SCOPED_LOCK.
Referenced by ast_res_pjsip_cleanup_message_filter(), load_module(), pjsip_reason_header_unload(), and unload_module().
|
static |
Definition at line 77 of file pjsip_session.c.
References ast_calloc, and NULL.
Referenced by ast_sip_session_add_supplements().
struct session_supplements session_supplements = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |