Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjlib.h>
#include "asterisk/aoc.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
Go to the source code of this file.
Data Structures | |
struct | aoc_data |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | aoc_attach_framehook (struct ast_sip_session *session) |
static void | aoc_bye_outgoing_request (struct ast_sip_session *session, struct pjsip_tx_data *tdata) |
static void | aoc_bye_outgoing_response (struct ast_sip_session *session, struct pjsip_tx_data *tdata) |
static int | aoc_consume (void *data, enum ast_frame_type type) |
static void | aoc_data_destroy (void *data) |
static void | aoc_datastore_destroy (void *obj) |
static char * | aoc_format_amount (pj_pool_t *pool, unsigned int amount, enum ast_aoc_currency_multiplier multiplier) |
static struct ast_frame * | aoc_framehook (struct ast_channel *ast, struct ast_frame *f, enum ast_framehook_event event, void *data) |
static int | aoc_incoming_invite_request (struct ast_sip_session *session, struct pjsip_rx_data *rdata) |
static void | aoc_invite_outgoing_response (struct ast_sip_session *session, struct pjsip_tx_data *tdata) |
static void | aoc_outgoing_invite_request (struct ast_sip_session *session, struct pjsip_tx_data *tdata) |
static void | aoc_release_pool (void *data) |
static int | aoc_send_as_xml (void *data) |
static const char * | aoc_time_scale_str (enum ast_aoc_time_scale value) |
static pj_xml_attr * | aoc_xml_create_attr (pj_pool_t *pool, pj_xml_node *node, const char *name, const char *value) |
static pj_xml_node * | aoc_xml_create_node (pj_pool_t *pool, pj_xml_node *parent, const char *name) |
static void | aoc_xml_set_node_content (pj_pool_t *pool, pj_xml_node *node, const char *content) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP AOC 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_EXTENDED, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, .requires = "res_pjsip", } |
static struct ast_sip_session_supplement | aoc_bye_supplement |
static const struct ast_datastore_info | aoc_d_datastore |
static const struct ast_datastore_info | aoc_e_datastore |
static struct ast_sip_session_supplement | aoc_invite_supplement |
static const struct ast_datastore_info | aoc_s_datastore |
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static |
Definition at line 698 of file res_pjsip_aoc.c.
|
static |
Definition at line 698 of file res_pjsip_aoc.c.
|
static |
Definition at line 522 of file res_pjsip_aoc.c.
References aoc_consume(), aoc_framehook(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_framehook_attach(), AST_FRAMEHOOK_INTERFACE_VERSION, ast_log, LOG_WARNING, session, and ast_framehook_interface::version.
Referenced by aoc_incoming_invite_request(), and aoc_outgoing_invite_request().
|
static |
Definition at line 585 of file res_pjsip_aoc.c.
References ao2_cleanup, aoc_d_datastore, aoc_e_datastore, ast_log, ast_sip_add_body(), ast_sip_session_get_datastore(), ast_sip_body::body_text, LOG_ERROR, RAII_VAR, session, ast_datastore_info::type, and ast_sip_body::type.
|
static |
Definition at line 559 of file res_pjsip_aoc.c.
References ao2_cleanup, aoc_d_datastore, aoc_e_datastore, ast_log, ast_sip_add_body(), ast_sip_session_get_datastore(), ast_sip_body::body_text, LOG_ERROR, RAII_VAR, session, ast_datastore_info::type, and ast_sip_body::type.
|
static |
Definition at line 517 of file res_pjsip_aoc.c.
References AST_FRAME_CONTROL, and type.
Referenced by aoc_attach_framehook().
|
static |
Definition at line 474 of file res_pjsip_aoc.c.
References ao2_cleanup, ast_aoc_destroy_decoded(), aoc_data::decoded, and aoc_data::session.
Referenced by aoc_framehook().
|
static |
Definition at line 143 of file res_pjsip_aoc.c.
References ast_free.
|
static |
Definition at line 75 of file res_pjsip_aoc.c.
References AST_AOC_MULT_HUNDRED, AST_AOC_MULT_ONE, AST_AOC_MULT_ONEHUNDREDTH, AST_AOC_MULT_ONETENTH, AST_AOC_MULT_ONETHOUSANDTH, AST_AOC_MULT_TEN, and AST_AOC_MULT_THOUSAND.
Referenced by aoc_send_as_xml().
|
static |
Definition at line 482 of file res_pjsip_aoc.c.
References ao2_alloc, ao2_bump, ao2_ref, aoc_data_destroy(), aoc_send_as_xml(), ast_aoc_decode(), ast_channel_name(), ast_channel_tech_pvt(), AST_CONTROL_AOC, AST_FRAME_CONTROL, AST_FRAMEHOOK_EVENT_WRITE, ast_log, ast_null_frame, ast_sip_push_task(), aoc_data::channel_state, ast_frame::data, ast_frame::datalen, aoc_data::decoded, ast_frame::frametype, ast_frame_subclass::integer, LOG_ERROR, ast_frame::ptr, ast_sip_session::serializer, ast_sip_channel_pvt::session, aoc_data::session, and ast_frame::subclass.
Referenced by aoc_attach_framehook().
|
static |
Definition at line 546 of file res_pjsip_aoc.c.
References aoc_attach_framehook(), and session.
|
static |
Definition at line 611 of file res_pjsip_aoc.c.
References ao2_cleanup, aoc_s_datastore, ast_log, ast_sip_session_get_datastore(), ast_sip_body::body_text, LOG_ERROR, NULL, pjsip_media_type_multipart_mixed, RAII_VAR, session, ast_sip_body::subtype, type, and ast_datastore_info::type.
|
static |
Definition at line 553 of file res_pjsip_aoc.c.
References aoc_attach_framehook(), and session.
|
static |
Definition at line 170 of file res_pjsip_aoc.c.
References ast_sip_get_pjsip_endpoint().
Referenced by aoc_send_as_xml().
|
static |
Definition at line 176 of file res_pjsip_aoc.c.
References ast_aoc_unit_entry::amount, ao2_cleanup, aoc_d_datastore, aoc_e_datastore, aoc_format_amount(), aoc_release_pool(), aoc_s_datastore, aoc_time_scale_str(), aoc_xml_create_attr(), aoc_xml_create_node(), aoc_xml_set_node_content(), AST_AOC_CHARGE_CURRENCY, AST_AOC_CHARGE_FREE, AST_AOC_CHARGE_UNIT, AST_AOC_CHARGED_ITEM_BASIC_COMMUNICATION, AST_AOC_CHARGED_ITEM_CALL_ATTEMPT, AST_AOC_CHARGED_ITEM_CALL_SETUP, AST_AOC_D, AST_AOC_E, ast_aoc_get_charge_type(), ast_aoc_get_currency_amount(), ast_aoc_get_currency_multiplier(), ast_aoc_get_currency_name(), ast_aoc_get_msg_type(), ast_aoc_get_total_type(), ast_aoc_get_unit_info(), AST_AOC_MULT_ONE, AST_AOC_RATE_TYPE_DURATION, AST_AOC_RATE_TYPE_FLAT, AST_AOC_RATE_TYPE_FREE, AST_AOC_S, ast_aoc_s_get_count(), ast_aoc_s_get_rate_info(), AST_AOC_SUBTOTAL, ast_free, ast_log, ast_sip_add_body(), ast_sip_create_request(), ast_sip_get_pjsip_endpoint(), ast_sip_session_add_datastore(), ast_sip_session_alloc_datastore(), ast_sip_session_get_datastore(), AST_SIP_SESSION_OUTGOING_CALL, ast_sip_session_send_request(), AST_STATE_UP, ast_strdup, ast_strlen_zero(), ast_aoc_s_entry::charged_item, LOG_ERROR, NULL, RAII_VAR, ast_datastore_info::type, and ast_sip_body::type.
Referenced by aoc_framehook().
|
static |
Definition at line 112 of file res_pjsip_aoc.c.
References AST_AOC_TIME_SCALE_DAY, AST_AOC_TIME_SCALE_HOUR, AST_AOC_TIME_SCALE_HUNDREDTH_SECOND, AST_AOC_TIME_SCALE_MINUTE, AST_AOC_TIME_SCALE_SECOND, AST_AOC_TIME_SCALE_TEN_SECOND, AST_AOC_TIME_SCALE_TENTH_SECOND, str, and value.
Referenced by aoc_send_as_xml().
|
static |
Definition at line 36 of file res_pjsip_aoc.c.
Referenced by aoc_send_as_xml().
|
static |
Definition at line 50 of file res_pjsip_aoc.c.
References name.
Referenced by aoc_send_as_xml().
|
static |
Definition at line 69 of file res_pjsip_aoc.c.
Referenced by aoc_send_as_xml().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 698 of file res_pjsip_aoc.c.
|
static |
Definition at line 678 of file res_pjsip_aoc.c.
References aoc_bye_supplement, aoc_invite_supplement, AST_MODULE_LOAD_SUCCESS, and ast_sip_session_register_supplement.
|
static |
Definition at line 685 of file res_pjsip_aoc.c.
References aoc_bye_supplement, aoc_invite_supplement, and ast_sip_session_unregister_supplement().
|
static |
Definition at line 698 of file res_pjsip_aoc.c.
|
static |
Definition at line 663 of file res_pjsip_aoc.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 154 of file res_pjsip_aoc.c.
Referenced by aoc_bye_outgoing_request(), aoc_bye_outgoing_response(), and aoc_send_as_xml().
|
static |
Definition at line 159 of file res_pjsip_aoc.c.
Referenced by aoc_bye_outgoing_request(), aoc_bye_outgoing_response(), and aoc_send_as_xml().
|
static |
Definition at line 670 of file res_pjsip_aoc.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 149 of file res_pjsip_aoc.c.
Referenced by aoc_invite_outgoing_response(), and aoc_send_as_xml().
|
static |
Definition at line 698 of file res_pjsip_aoc.c.