Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Module for managing send to voicemail requests in SIP REFER messages against PJSIP channels. More...
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_ua.h>
#include "asterisk/pbx.h"
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
#include "asterisk/module.h"
Go to the source code of this file.
Macros | |
#define | DATASTORE_NAME "call_feature_send_to_vm_datastore" |
#define | SEND_TO_VM_HEADER "PJSIP_HEADER(add,X-Digium-Call-Feature)" |
#define | SEND_TO_VM_HEADER_VALUE "feature_send_to_vm" |
#define | SEND_TO_VM_REDIRECT "REDIRECTING(reason)" |
#define | SEND_TO_VM_REDIRECT_QUOTED_VALUE "\"" SEND_TO_VM_REDIRECT_VALUE "\"" |
#define | SEND_TO_VM_REDIRECT_VALUE "send_to_vm" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void | channel_cleanup_wrapper (void *data) |
static pjsip_fromto_hdr * | get_diversion_header (pjsip_rx_data *rdata) |
static pjsip_param * | get_diversion_reason (pjsip_fromto_hdr *hdr) |
static int | handle_incoming_request (struct ast_sip_session *session, struct pjsip_rx_data *rdata) |
static void | handle_outgoing_response (struct ast_sip_session *session, struct pjsip_tx_data *tdata) |
static int | has_call_feature (pjsip_rx_data *rdata) |
static int | has_diversion_reason (pjsip_rx_data *rdata) |
static int | load_module (void) |
static void | send_response (struct ast_sip_session *session, int code, struct pjsip_rx_data *rdata) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP REFER Send to Voicemail 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 = AST_BUILDOPT_SUM, .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_datastore_info | call_feature_info |
static struct ast_sip_session_supplement | refer_supplement |
Module for managing send to voicemail requests in SIP REFER messages against PJSIP channels.
Definition in file res_pjsip_send_to_voicemail.c.
#define DATASTORE_NAME "call_feature_send_to_vm_datastore" |
Definition at line 44 of file res_pjsip_send_to_voicemail.c.
#define SEND_TO_VM_HEADER "PJSIP_HEADER(add,X-Digium-Call-Feature)" |
Definition at line 46 of file res_pjsip_send_to_voicemail.c.
#define SEND_TO_VM_HEADER_VALUE "feature_send_to_vm" |
Definition at line 47 of file res_pjsip_send_to_voicemail.c.
#define SEND_TO_VM_REDIRECT "REDIRECTING(reason)" |
Definition at line 49 of file res_pjsip_send_to_voicemail.c.
#define SEND_TO_VM_REDIRECT_QUOTED_VALUE "\"" SEND_TO_VM_REDIRECT_VALUE "\"" |
Definition at line 51 of file res_pjsip_send_to_voicemail.c.
#define SEND_TO_VM_REDIRECT_VALUE "send_to_vm" |
Definition at line 50 of file res_pjsip_send_to_voicemail.c.
|
static |
Definition at line 235 of file res_pjsip_send_to_voicemail.c.
|
static |
Definition at line 235 of file res_pjsip_send_to_voicemail.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 235 of file res_pjsip_send_to_voicemail.c.
|
static |
Definition at line 64 of file res_pjsip_send_to_voicemail.c.
References ast_channel_cleanup, and ast_channel::data.
|
static |
Definition at line 81 of file res_pjsip_send_to_voicemail.c.
Referenced by has_diversion_reason().
|
static |
Definition at line 75 of file res_pjsip_send_to_voicemail.c.
Referenced by has_diversion_reason().
|
static |
Definition at line 125 of file res_pjsip_send_to_voicemail.c.
References ao2_ref, ast_channel_bridge_peer(), ast_channel_name(), ast_channel_unref, ast_log, ast_sip_session_add_datastore(), ast_sip_session_alloc_datastore(), ast_sorcery_object_get_id(), call_feature_info, ast_datastore::data, DATASTORE_NAME, has_call_feature(), has_diversion_reason(), LOG_WARNING, pbx_builtin_setvar_helper(), send_response(), SEND_TO_VM_HEADER, SEND_TO_VM_HEADER_VALUE, SEND_TO_VM_REDIRECT, SEND_TO_VM_REDIRECT_VALUE, and session.
|
static |
Definition at line 187 of file res_pjsip_send_to_voicemail.c.
References ao2_ref, ast_sip_session_get_datastore(), ast_sip_session_remove_datastore(), ast_datastore::data, DATASTORE_NAME, NULL, pbx_builtin_setvar_helper(), SEND_TO_VM_HEADER, SEND_TO_VM_REDIRECT, session, and status.
|
static |
Definition at line 115 of file res_pjsip_send_to_voicemail.c.
References NULL, and SEND_TO_VM_HEADER_VALUE.
Referenced by handle_incoming_request().
|
static |
Definition at line 101 of file res_pjsip_send_to_voicemail.c.
References get_diversion_header(), get_diversion_reason(), SEND_TO_VM_REDIRECT_QUOTED_VALUE, and SEND_TO_VM_REDIRECT_VALUE.
Referenced by handle_incoming_request().
|
static |
Definition at line 216 of file res_pjsip_send_to_voicemail.c.
References AST_MODULE_LOAD_SUCCESS, ast_sip_session_register_supplement, and refer_supplement.
|
static |
Definition at line 53 of file res_pjsip_send_to_voicemail.c.
Referenced by handle_incoming_request().
|
static |
Definition at line 223 of file res_pjsip_send_to_voicemail.c.
References ast_sip_session_unregister_supplement(), and refer_supplement.
|
static |
Definition at line 235 of file res_pjsip_send_to_voicemail.c.
|
static |
Definition at line 235 of file res_pjsip_send_to_voicemail.c.
|
static |
Definition at line 70 of file res_pjsip_send_to_voicemail.c.
Referenced by handle_incoming_request().
|
static |
Definition at line 210 of file res_pjsip_send_to_voicemail.c.
Referenced by load_module(), and unload_module().