Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjlib.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/linkedlists.h"
#include "include/res_pjsip_private.h"
Go to the source code of this file.
Data Structures | |
struct | header |
struct | header_list |
Functions | |
static int | add_header (struct header_list *headers, const char *name, const char *value, int replace) |
static void | add_headers_to_message (struct header_list *headers, pjsip_tx_data *tdata) |
static pj_status_t | add_request_headers (pjsip_tx_data *tdata) |
static pj_status_t | add_response_headers (pjsip_tx_data *tdata) |
static struct header * | alloc_header (const char *name, const char *value) |
int | ast_sip_add_global_request_header (const char *name, const char *value, int replace) |
int | ast_sip_add_global_response_header (const char *name, const char *value, int replace) |
void | ast_sip_destroy_global_headers (void) |
void | ast_sip_initialize_global_headers (void) |
static void | destroy_header (struct header *to_destroy) |
static void | destroy_headers (struct header_list *headers) |
static void | remove_header (struct header_list *headers, const char *to_remove) |
Variables | |
static pjsip_module | global_header_mod |
static unsigned int | handled_id = 0xCA115785 |
Indicator we've already handled a specific request/response. More... | |
static struct header_list | request_headers |
static struct header_list | response_headers |
|
static |
Definition at line 130 of file pjsip_global_headers.c.
References alloc_header(), AST_LIST_INSERT_TAIL, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_strlen_zero, header::next, NULL, and remove_header().
Referenced by ast_sip_add_global_request_header(), and ast_sip_add_global_response_header().
|
static |
Definition at line 82 of file pjsip_global_headers.c.
References AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_sip_add_header(), global_header_mod, handled_id, lock, header::name, header::next, NULL, SCOPED_LOCK, and header::value.
Referenced by add_request_headers(), and add_response_headers().
|
static |
Definition at line 103 of file pjsip_global_headers.c.
References add_headers_to_message(), and request_headers.
|
static |
Definition at line 110 of file pjsip_global_headers.c.
References add_headers_to_message(), and response_headers.
|
static |
Definition at line 55 of file pjsip_global_headers.c.
References ast_calloc_with_stringfields, ast_string_field_set, and NULL.
Referenced by add_header().
int ast_sip_add_global_request_header | ( | const char * | name, |
const char * | value, | ||
int | replace | ||
) |
Definition at line 153 of file pjsip_global_headers.c.
References add_header(), and request_headers.
Referenced by global_apply().
int ast_sip_add_global_response_header | ( | const char * | name, |
const char * | value, | ||
int | replace | ||
) |
Definition at line 158 of file pjsip_global_headers.c.
References add_header(), and response_headers.
Referenced by global_apply().
void ast_sip_destroy_global_headers | ( | void | ) |
Definition at line 181 of file pjsip_global_headers.c.
References ast_sip_unregister_service(), destroy_headers(), global_header_mod, request_headers, and response_headers.
Referenced by unload_pjsip().
void ast_sip_initialize_global_headers | ( | void | ) |
Definition at line 163 of file pjsip_global_headers.c.
References AST_RWLIST_HEAD_INIT, ast_sip_register_service(), global_header_mod, request_headers, and response_headers.
Referenced by load_module().
|
static |
Definition at line 71 of file pjsip_global_headers.c.
References ast_free, and ast_string_field_free_memory.
Referenced by destroy_headers(), and remove_header().
|
static |
Definition at line 171 of file pjsip_global_headers.c.
References AST_RWLIST_HEAD_DESTROY, AST_RWLIST_REMOVE_HEAD, destroy_header(), and header::next.
Referenced by ast_sip_destroy_global_headers().
|
static |
Definition at line 117 of file pjsip_global_headers.c.
References AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, destroy_header(), header::name, and header::next.
Referenced by add_header().
|
static |
Definition at line 40 of file pjsip_global_headers.c.
Referenced by add_headers_to_message(), ast_sip_destroy_global_headers(), and ast_sip_initialize_global_headers().
|
static |
Indicator we've already handled a specific request/response.
PJSIP tends to reuse requests and responses. If we already have added headers to a request or response, we mark the message with this value so that we know not to re-add the headers again.
Definition at line 38 of file pjsip_global_headers.c.
Referenced by add_headers_to_message().
|
static |
Definition at line 79 of file pjsip_global_headers.c.
Referenced by add_request_headers(), ast_sip_add_global_request_header(), ast_sip_destroy_global_headers(), ast_sip_initialize_global_headers(), and remove_request_headers().
|
static |
Definition at line 80 of file pjsip_global_headers.c.
Referenced by add_response_headers(), ast_sip_add_global_response_header(), ast_sip_destroy_global_headers(), and ast_sip_initialize_global_headers().