Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP RFC3326 Support" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND, .requires = "res_pjsip,res_pjsip_session", } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static struct ast_sip_session_supplement | rfc3326_supplement |
|
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ AST_MODULE_SELF_SYM()
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
◆ rfc3326_add_reason_header()
static void rfc3326_add_reason_header |
( |
struct ast_sip_session * |
session, |
|
|
struct pjsip_tx_data * |
tdata |
|
) |
| |
|
static |
Definition at line 94 of file res_pjsip_rfc3326.c.
References ast_cause2str(), AST_CAUSE_ANSWERED_ELSEWHERE, ast_channel_hangupcause(), ast_debug, ast_sip_add_header(), ast_sorcery_object_get_id(), buf, ast_sip_session::channel, ast_sip_session::endpoint, and ast_sip_endpoint::suppress_q850_reason_headers.
Referenced by rfc3326_outgoing_request(), and rfc3326_outgoing_response().
99 ast_sip_add_header(tdata,
"Reason",
"SIP;cause=200;text=\"Call completed elsewhere\"");
103 ast_debug(1,
"A Q.850 '%s'(%i) Reason header was suppresed for endpoint '%s'\n",
struct ast_sip_endpoint * endpoint
int ast_sip_add_header(pjsip_tx_data *tdata, const char *name, const char *value)
Add a header to an outbound SIP message.
#define ast_debug(level,...)
Log a DEBUG message.
#define AST_CAUSE_ANSWERED_ELSEWHERE
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
struct ast_channel * channel
const char * ast_cause2str(int state) attribute_pure
Gives the string form of a given cause code.
int ast_channel_hangupcause(const struct ast_channel *chan)
unsigned int suppress_q850_reason_headers
◆ rfc3326_incoming_request()
static int rfc3326_incoming_request |
( |
struct ast_sip_session * |
session, |
|
|
struct pjsip_rx_data * |
rdata |
|
) |
| |
|
static |
Definition at line 70 of file res_pjsip_rfc3326.c.
References ast_sip_session::channel, and rfc3326_use_reason_header().
72 if ((pjsip_method_cmp(&rdata->msg_info.msg->line.req.method, &pjsip_bye_method) &&
73 pjsip_method_cmp(&rdata->msg_info.msg->line.req.method, &pjsip_cancel_method)) ||
struct ast_channel * channel
static void rfc3326_use_reason_header(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
◆ rfc3326_incoming_response()
static void rfc3326_incoming_response |
( |
struct ast_sip_session * |
session, |
|
|
struct pjsip_rx_data * |
rdata |
|
) |
| |
|
static |
◆ rfc3326_outgoing_request()
static void rfc3326_outgoing_request |
( |
struct ast_sip_session * |
session, |
|
|
struct pjsip_tx_data * |
tdata |
|
) |
| |
|
static |
◆ rfc3326_outgoing_response()
static void rfc3326_outgoing_response |
( |
struct ast_sip_session * |
session, |
|
|
struct pjsip_tx_data * |
tdata |
|
) |
| |
|
static |
◆ rfc3326_use_reason_header()
static void rfc3326_use_reason_header |
( |
struct ast_sip_session * |
session, |
|
|
struct pjsip_rx_data * |
rdata |
|
) |
| |
|
static |
Definition at line 37 of file res_pjsip_rfc3326.c.
References ast_channel_hangupcause_set(), ast_copy_pj_str(), ast_skip_blanks(), buf, ast_sip_session::channel, NULL, and text.
Referenced by rfc3326_incoming_request(), and rfc3326_incoming_response().
39 static const pj_str_t str_reason = {
"Reason", 6 };
40 pjsip_generic_string_hdr *
header;
46 header = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_reason,
NULL);
48 header = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_reason, header->next)) {
52 if (strncasecmp(cause,
"Q.850", 5) || !(cause = strstr(cause,
"cause="))) {
57 if ((text = strstr(cause,
";"))) {
61 if (sscanf(cause,
"cause=%30d", &code) != 1) {
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
void ast_copy_pj_str(char *dest, const pj_str_t *src, size_t size)
Copy a pj_str_t into a standard character buffer.
struct ast_channel * channel
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __mod_info
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP RFC3326 Support" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND, .requires = "res_pjsip,res_pjsip_session", } |
|
static |
◆ ast_module_info
◆ rfc3326_supplement