Asterisk - The Open Source Telephony Project GIT-master-3dae2cf
|
Generic Advice of Charge encode and decode routines. More...
#include "asterisk/channel.h"
Go to the source code of this file.
Data Structures | |
struct | ast_aoc_charging_association |
struct | ast_aoc_charging_association_number |
struct | ast_aoc_duration_rate |
struct | ast_aoc_flat_rate |
struct | ast_aoc_s_entry |
struct | ast_aoc_time |
struct | ast_aoc_unit_entry |
struct | ast_aoc_volume_rate |
Macros | |
#define | AOC_CURRENCY_NAME_SIZE (10 + 1) |
Functions | |
int | ast_aoc_add_unit_entry (struct ast_aoc_decoded *decoded, const unsigned int amount_is_present, const unsigned int amount, const unsigned int type_is_present, const unsigned int type) |
Adds a unit entry into the list of units. More... | |
int | ast_aoc_cli_init (void) |
enable aoc cli options More... | |
struct ast_aoc_decoded * | ast_aoc_create (const enum ast_aoc_type msg_type, const enum ast_aoc_charge_type charge_type, const enum ast_aoc_request requests) |
creates a ast_aoc_decode object of a specific message type More... | |
struct ast_aoc_decoded * | ast_aoc_decode (struct ast_aoc_encoded *encoded, size_t size, struct ast_channel *chan) |
decodes an encoded aoc payload. More... | |
int | ast_aoc_decoded2str (const struct ast_aoc_decoded *decoded, struct ast_str **msg) |
Convert decoded aoc msg to string representation. More... | |
void * | ast_aoc_destroy_decoded (struct ast_aoc_decoded *decoded) |
free an ast_aoc_decoded object More... | |
void * | ast_aoc_destroy_encoded (struct ast_aoc_encoded *encoded) |
free an ast_aoc_encoded object More... | |
struct ast_aoc_encoded * | ast_aoc_encode (struct ast_aoc_decoded *decoded, size_t *out_size, struct ast_channel *chan) |
encodes a decoded aoc structure so it can be passed on the wire More... | |
const struct ast_aoc_charging_association * | ast_aoc_get_association_info (struct ast_aoc_decoded *decoded) |
get the charging association info for AOC-E messages More... | |
enum ast_aoc_billing_id | ast_aoc_get_billing_id (struct ast_aoc_decoded *decoded) |
get the billing id for AOC-D and AOC-E messages More... | |
enum ast_aoc_charge_type | ast_aoc_get_charge_type (struct ast_aoc_decoded *decoded) |
get the charging type for an AOC-D or AOC-E message More... | |
unsigned int | ast_aoc_get_currency_amount (struct ast_aoc_decoded *decoded) |
get the currency amount for AOC-D and AOC-E messages More... | |
enum ast_aoc_currency_multiplier | ast_aoc_get_currency_multiplier (struct ast_aoc_decoded *decoded) |
get the currency multiplier for AOC-D and AOC-E messages More... | |
const char * | ast_aoc_get_currency_multiplier_decimal (struct ast_aoc_decoded *decoded) |
get the currency multiplier for AOC-D and AOC-E messages in decimal format More... | |
const char * | ast_aoc_get_currency_name (struct ast_aoc_decoded *decoded) |
get the currency name for AOC-D and AOC-E messages More... | |
enum ast_aoc_type | ast_aoc_get_msg_type (struct ast_aoc_decoded *decoded) |
get the message type, AOC-D, AOC-E, or AOC Request More... | |
enum ast_aoc_request | ast_aoc_get_request (struct ast_aoc_decoded *decoded) |
get the types of AOC requested for when message type is AOC Request More... | |
int | ast_aoc_get_termination_request (struct ast_aoc_decoded *decoded) |
get whether or not the AST_AOC_REQUEST message as a termination request. More... | |
enum ast_aoc_total_type | ast_aoc_get_total_type (struct ast_aoc_decoded *decoded) |
get the type of total for a AOC-D message More... | |
unsigned int | ast_aoc_get_unit_count (struct ast_aoc_decoded *decoded) |
get the number of unit entries for AOC-D and AOC-E messages More... | |
const struct ast_aoc_unit_entry * | ast_aoc_get_unit_info (struct ast_aoc_decoded *decoded, unsigned int entry_number) |
get a specific unit entry. More... | |
int | ast_aoc_manager_event (const struct ast_aoc_decoded *decoded, struct ast_channel *chan) |
generate AOC manager event for an AOC-S, AOC-D, or AOC-E msg More... | |
int | ast_aoc_s_add_rate_duration (struct ast_aoc_decoded *decoded, enum ast_aoc_s_charged_item charged_item, unsigned int amount, enum ast_aoc_currency_multiplier multiplier, const char *currency_name, unsigned long time, enum ast_aoc_time_scale time_scale, unsigned long granularity_time, enum ast_aoc_time_scale granularity_time_scale, int step_function) |
Add AOC-S duration rate entry. More... | |
int | ast_aoc_s_add_rate_flat (struct ast_aoc_decoded *decoded, enum ast_aoc_s_charged_item charged_item, unsigned int amount, enum ast_aoc_currency_multiplier multiplier, const char *currency_name) |
Add AOC-S flat rate entry. More... | |
int | ast_aoc_s_add_rate_free (struct ast_aoc_decoded *decoded, enum ast_aoc_s_charged_item charged_item, int from_beginning) |
Add AOC-S indicating charge item is free. More... | |
int | ast_aoc_s_add_rate_na (struct ast_aoc_decoded *decoded, enum ast_aoc_s_charged_item charged_item) |
Add AOC-S entry indicating charge item is not available. More... | |
int | ast_aoc_s_add_rate_special_charge_code (struct ast_aoc_decoded *decoded, enum ast_aoc_s_charged_item charged_item, unsigned int code) |
Add AOC-S special rate entry. More... | |
int | ast_aoc_s_add_rate_volume (struct ast_aoc_decoded *decoded, enum ast_aoc_s_charged_item charged_item, enum ast_aoc_volume_unit volume_unit, unsigned int amount, enum ast_aoc_currency_multiplier multiplier, const char *currency_name) |
Add AOC-S volume rate entry. More... | |
int | ast_aoc_s_add_special_arrangement (struct ast_aoc_decoded *decoded, unsigned int code) |
Add AOC-S special arrangement entry. More... | |
unsigned int | ast_aoc_s_get_count (struct ast_aoc_decoded *decoded) |
get the number rates associated with an AOC-S message More... | |
const struct ast_aoc_s_entry * | ast_aoc_s_get_rate_info (struct ast_aoc_decoded *decoded, unsigned int entry_number) |
get a specific AOC-S rate entry. More... | |
int | ast_aoc_set_association_id (struct ast_aoc_decoded *decoded, const int id) |
set the charging association id for an AST_AOC_E message More... | |
int | ast_aoc_set_association_number (struct ast_aoc_decoded *decoded, const char *num, uint8_t plan) |
set the charging association number for an AOC-E message More... | |
int | ast_aoc_set_billing_id (struct ast_aoc_decoded *decoded, const enum ast_aoc_billing_id id) |
set the billing id for a AOC-D or AST_AOC_E message More... | |
int | ast_aoc_set_currency_info (struct ast_aoc_decoded *decoded, const unsigned int amount, const enum ast_aoc_currency_multiplier multiplier, const char *name) |
Sets the currency values for a AOC-D or AOC-E message. More... | |
int | ast_aoc_set_termination_request (struct ast_aoc_decoded *decoded) |
Mark the AST_AOC_REQUEST message as a termination request. More... | |
int | ast_aoc_set_total_type (struct ast_aoc_decoded *decoded, const enum ast_aoc_total_type type) |
Sets the type of total for a AOC-D message. More... | |
int | ast_aoc_test_encode_decode_match (struct ast_aoc_decoded *decoded) |
test aoc encode decode routines. More... | |
Generic Advice of Charge encode and decode routines.
Definition in file aoc.h.
enum ast_aoc_billing_id |
Defines the billing id options for an aoc message.
enum ast_aoc_charge_type |
Enumerator | |
---|---|
AST_AOC_CHARGE_NA | |
AST_AOC_CHARGE_FREE | |
AST_AOC_CHARGE_CURRENCY | |
AST_AOC_CHARGE_UNIT |
Defines the currency multiplier for an aoc message.
Enumerator | |
---|---|
AST_AOC_MULT_ONETHOUSANDTH | |
AST_AOC_MULT_ONEHUNDREDTH | |
AST_AOC_MULT_ONETENTH | |
AST_AOC_MULT_ONE | |
AST_AOC_MULT_TEN | |
AST_AOC_MULT_HUNDRED | |
AST_AOC_MULT_THOUSAND | |
AST_AOC_MULT_NUM_ENTRIES |
enum ast_aoc_request |
Enumerator | |
---|---|
AST_AOC_REQUEST_S | |
AST_AOC_REQUEST_D | |
AST_AOC_REQUEST_E |
Definition at line 76 of file aoc.h.
enum ast_aoc_s_rate_type |
Enumerator | |
---|---|
AST_AOC_RATE_TYPE_NA | |
AST_AOC_RATE_TYPE_FREE | |
AST_AOC_RATE_TYPE_FREE_FROM_BEGINNING | |
AST_AOC_RATE_TYPE_DURATION | |
AST_AOC_RATE_TYPE_FLAT | |
AST_AOC_RATE_TYPE_VOLUME | |
AST_AOC_RATE_TYPE_SPECIAL_CODE |
enum ast_aoc_time_scale |
enum ast_aoc_total_type |
Enumerator | |
---|---|
AST_AOC_TOTAL | |
AST_AOC_SUBTOTAL |
enum ast_aoc_type |
Enumerator | |
---|---|
AST_AOC_REQUEST | |
AST_AOC_S | |
AST_AOC_D | |
AST_AOC_E |
enum ast_aoc_volume_unit |
int ast_aoc_add_unit_entry | ( | struct ast_aoc_decoded * | decoded, |
const unsigned int | amount_is_present, | ||
const unsigned int | amount, | ||
const unsigned int | type_is_present, | ||
const unsigned int | type | ||
) |
Adds a unit entry into the list of units.
decoded | ast_aoc_decoded struct to set values on |
amount_is_present | set this if the number of units is actually present. |
amount | number of units |
type_is_present | set this if the type value is present |
type | unit type |
0 | success |
Definition at line 977 of file aoc.c.
References ast_aoc_unit_entry::amount, ARRAY_LEN, AST_AOC_REQUEST, ast_aoc_decoded::msg_type, type, ast_aoc_unit_entry::type, ast_aoc_decoded::unit_count, ast_aoc_decoded::unit_list, ast_aoc_unit_entry::valid_amount, and ast_aoc_unit_entry::valid_type.
Referenced by action_aoc_de_message(), aoc_parse_ie(), and AST_TEST_DEFINE().
int ast_aoc_cli_init | ( | void | ) |
enable aoc cli options
Definition at line 2020 of file aoc.c.
References aoc_cli, aoc_d_type(), aoc_e_type(), aoc_s_type(), aoc_shutdown(), ARRAY_LEN, ast_cli_register_multiple, ast_register_cleanup(), and STASIS_MESSAGE_TYPE_INIT.
Referenced by asterisk_daemon().
struct ast_aoc_decoded * ast_aoc_create | ( | const enum ast_aoc_type | msg_type, |
const enum ast_aoc_charge_type | charge_type, | ||
const enum ast_aoc_request | requests | ||
) |
creates a ast_aoc_decode object of a specific message type
msg_type | AOC-D, AOC-E, or AOC Request |
charge_type | this is ignored if message type is not AOC-D or AOC-E. |
requests | flags. This defines the types of AOC requested. This field should only be set when the message type is AOC Request, the value is ignored otherwise. |
heap | allocated ast_aoc_decoded object ptr on success |
NULL | failure |
Definition at line 276 of file aoc.c.
References AST_AOC_CHARGE_UNIT, AST_AOC_D, AST_AOC_E, AST_AOC_REQUEST, ast_calloc, ast_log, ast_aoc_decoded::charge_type, LOG_WARNING, ast_aoc_decoded::msg_type, NULL, ast_aoc_decoded::request_flag, and requests.
Referenced by action_aoc_de_message(), action_aoc_s_message(), and AST_TEST_DEFINE().
struct ast_aoc_decoded * ast_aoc_decode | ( | struct ast_aoc_encoded * | encoded, |
size_t | size, | ||
struct ast_channel * | chan | ||
) |
decodes an encoded aoc payload.
encoded | the encoded payload to decode. |
size | total size of encoded payload |
chan | ast channel, Optional for DEBUG output purposes |
heap | allocated ast_aoc_decoded object ptr on success |
NULL | failure |
Definition at line 449 of file aoc.c.
References aoc_debug_enabled, aoc_display_decoded_debug(), aoc_parse_ie(), AST_AOC_CHARGE_CURRENCY, AST_AOC_CHARGE_FREE, AST_AOC_CHARGE_NA, AST_AOC_CHARGE_UNIT, AST_AOC_D, AST_AOC_E, AST_AOC_ENCODED_CHARGE_CURRENCY, AST_AOC_ENCODED_CHARGE_FREE, AST_AOC_ENCODED_CHARGE_SUBTOTAL, AST_AOC_ENCODED_CHARGE_UNIT, AST_AOC_ENCODED_REQUEST_D, AST_AOC_ENCODED_REQUEST_E, AST_AOC_ENCODED_REQUEST_S, AST_AOC_ENCODED_TYPE_D, AST_AOC_ENCODED_TYPE_E, AST_AOC_ENCODED_TYPE_S, AST_AOC_REQUEST, AST_AOC_REQUEST_D, AST_AOC_REQUEST_E, AST_AOC_REQUEST_S, AST_AOC_S, AST_AOC_SUBTOTAL, ast_calloc, ast_log, ast_aoc_decoded::charge_type, ast_aoc_encoded::data, ast_aoc_encoded::datalen, ast_aoc_encoded::flags, LOG_WARNING, ast_aoc_decoded::msg_type, NULL, ast_aoc_decoded::request_flag, and ast_aoc_decoded::total_type.
Referenced by aoc_framehook(), ast_aoc_test_encode_decode_match(), and wait_for_answer().
int ast_aoc_decoded2str | ( | const struct ast_aoc_decoded * | decoded, |
struct ast_str ** | msg | ||
) |
Convert decoded aoc msg to string representation.
decoded | ast_aoc_decoded struct to convert to string |
msg | dynamic heap allocated ast_str object to store string representation in |
0 | success |
-1 | failure |
Definition at line 1954 of file aoc.c.
References aoc_d_event(), aoc_e_event(), aoc_request_event(), aoc_s_event(), AST_AOC_D, AST_AOC_E, AST_AOC_REQUEST, AST_AOC_S, ast_str_append(), and ast_aoc_decoded::msg_type.
Referenced by aoc_display_decoded_debug(), and AST_TEST_DEFINE().
void * ast_aoc_destroy_decoded | ( | struct ast_aoc_decoded * | decoded | ) |
free an ast_aoc_decoded object
Definition at line 307 of file aoc.c.
References ast_free, and NULL.
Referenced by action_aoc_de_message(), action_aoc_s_message(), action_aocmessage(), aoc_data_destroy(), ast_aoc_test_encode_decode_match(), AST_TEST_DEFINE(), chanlist_free(), hangupcalls(), and wait_for_answer().
void * ast_aoc_destroy_encoded | ( | struct ast_aoc_encoded * | encoded | ) |
free an ast_aoc_encoded object
Definition at line 313 of file aoc.c.
References ast_free, and NULL.
Referenced by action_aocmessage(), ast_aoc_test_encode_decode_match(), and wait_for_answer().
struct ast_aoc_encoded * ast_aoc_encode | ( | struct ast_aoc_decoded * | decoded, |
size_t * | out_size, | ||
struct ast_channel * | chan | ||
) |
encodes a decoded aoc structure so it can be passed on the wire
decoded | the decoded struct to be encoded |
out_size | output parameter representing size of encoded data |
chan | ast channel, Optional for DEBUG output purposes |
pointer | to encoded data |
NULL | failure |
Definition at line 650 of file aoc.c.
References aoc_create_ie_data(), aoc_debug_enabled, aoc_display_decoded_debug(), AST_AOC_CHARGE_CURRENCY, AST_AOC_CHARGE_FREE, AST_AOC_CHARGE_NA, AST_AOC_CHARGE_UNIT, AST_AOC_D, AST_AOC_E, AST_AOC_ENCODE_VERSION, AST_AOC_ENCODED_CHARGE_CURRENCY, AST_AOC_ENCODED_CHARGE_FREE, AST_AOC_ENCODED_CHARGE_NA, AST_AOC_ENCODED_CHARGE_SUBTOTAL, AST_AOC_ENCODED_CHARGE_UNIT, AST_AOC_ENCODED_REQUEST_D, AST_AOC_ENCODED_REQUEST_E, AST_AOC_ENCODED_REQUEST_S, AST_AOC_ENCODED_TYPE_D, AST_AOC_ENCODED_TYPE_E, AST_AOC_ENCODED_TYPE_REQUEST, AST_AOC_ENCODED_TYPE_S, AST_AOC_REQUEST, AST_AOC_REQUEST_D, AST_AOC_REQUEST_E, AST_AOC_REQUEST_S, AST_AOC_S, AST_AOC_SUBTOTAL, ast_calloc, ast_log, aoc_ie_data::buf, ast_aoc_decoded::charge_type, ast_aoc_encoded::data, ast_aoc_encoded::datalen, ast_aoc_encoded::flags, LOG_WARNING, ast_aoc_decoded::msg_type, NULL, aoc_ie_data::pos, ast_aoc_decoded::request_flag, ast_aoc_decoded::total_type, and ast_aoc_encoded::version.
Referenced by action_aocmessage(), ast_aoc_test_encode_decode_match(), and wait_for_answer().
const struct ast_aoc_charging_association * ast_aoc_get_association_info | ( | struct ast_aoc_decoded * | decoded | ) |
get the charging association info for AOC-E messages
Definition at line 1051 of file aoc.c.
References ast_aoc_decoded::charging_association.
Referenced by AST_TEST_DEFINE().
enum ast_aoc_billing_id ast_aoc_get_billing_id | ( | struct ast_aoc_decoded * | decoded | ) |
get the billing id for AOC-D and AOC-E messages
Definition at line 1035 of file aoc.c.
References ast_aoc_decoded::billing_id.
Referenced by AST_TEST_DEFINE().
enum ast_aoc_charge_type ast_aoc_get_charge_type | ( | struct ast_aoc_decoded * | decoded | ) |
get the charging type for an AOC-D or AOC-E message
Definition at line 897 of file aoc.c.
References ast_aoc_decoded::charge_type.
Referenced by aoc_send_as_xml(), and AST_TEST_DEFINE().
unsigned int ast_aoc_get_currency_amount | ( | struct ast_aoc_decoded * | decoded | ) |
get the currency amount for AOC-D and AOC-E messages
Definition at line 940 of file aoc.c.
References ast_aoc_decoded::currency_amount.
Referenced by aoc_send_as_xml(), and AST_TEST_DEFINE().
enum ast_aoc_currency_multiplier ast_aoc_get_currency_multiplier | ( | struct ast_aoc_decoded * | decoded | ) |
get the currency multiplier for AOC-D and AOC-E messages
Definition at line 945 of file aoc.c.
References ast_aoc_decoded::multiplier.
Referenced by aoc_send_as_xml(), and AST_TEST_DEFINE().
const char * ast_aoc_get_currency_multiplier_decimal | ( | struct ast_aoc_decoded * | decoded | ) |
get the currency multiplier for AOC-D and AOC-E messages in decimal format
Definition at line 950 of file 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, AST_AOC_MULT_THOUSAND, and ast_aoc_decoded::multiplier.
const char * ast_aoc_get_currency_name | ( | struct ast_aoc_decoded * | decoded | ) |
get the currency name for AOC-D and AOC-E messages
Definition at line 972 of file aoc.c.
References ast_aoc_decoded::currency_name.
Referenced by aoc_send_as_xml(), and AST_TEST_DEFINE().
enum ast_aoc_type ast_aoc_get_msg_type | ( | struct ast_aoc_decoded * | decoded | ) |
get the message type, AOC-D, AOC-E, or AOC Request
Definition at line 892 of file aoc.c.
References ast_aoc_decoded::msg_type.
Referenced by aoc_send_as_xml(), AST_TEST_DEFINE(), and wait_for_answer().
enum ast_aoc_request ast_aoc_get_request | ( | struct ast_aoc_decoded * | decoded | ) |
get the types of AOC requested for when message type is AOC Request
Definition at line 902 of file aoc.c.
References ast_aoc_decoded::request_flag.
Referenced by AST_TEST_DEFINE().
int ast_aoc_get_termination_request | ( | struct ast_aoc_decoded * | decoded | ) |
get whether or not the AST_AOC_REQUEST message as a termination request.
decoded | ast_aoc_decoded struct to get values on |
0 | not a termination request |
1 | is a termination request |
Definition at line 1079 of file aoc.c.
References ast_aoc_decoded::termination_request.
Referenced by AST_TEST_DEFINE().
enum ast_aoc_total_type ast_aoc_get_total_type | ( | struct ast_aoc_decoded * | decoded | ) |
get the type of total for a AOC-D message
Definition at line 914 of file aoc.c.
References ast_aoc_decoded::total_type.
Referenced by aoc_send_as_xml(), and AST_TEST_DEFINE().
unsigned int ast_aoc_get_unit_count | ( | struct ast_aoc_decoded * | decoded | ) |
get the number of unit entries for AOC-D and AOC-E messages
Definition at line 1019 of file aoc.c.
References ast_aoc_decoded::unit_count.
Referenced by AST_TEST_DEFINE().
const struct ast_aoc_unit_entry * ast_aoc_get_unit_info | ( | struct ast_aoc_decoded * | decoded, |
unsigned int | entry_number | ||
) |
get a specific unit entry.
Definition at line 1010 of file aoc.c.
References NULL, ast_aoc_decoded::unit_count, and ast_aoc_decoded::unit_list.
Referenced by aoc_send_as_xml(), and AST_TEST_DEFINE().
int ast_aoc_manager_event | ( | const struct ast_aoc_decoded * | decoded, |
struct ast_channel * | chan | ||
) |
generate AOC manager event for an AOC-S, AOC-D, or AOC-E msg
Definition at line 1922 of file aoc.c.
References aoc_d_type(), aoc_e_type(), aoc_publish_blob(), aoc_s_type(), AST_AOC_D, AST_AOC_E, AST_AOC_S, ast_json_unref(), d_to_json(), e_to_json(), ast_aoc_decoded::msg_type, and s_to_json().
int ast_aoc_s_add_rate_duration | ( | struct ast_aoc_decoded * | decoded, |
enum ast_aoc_s_charged_item | charged_item, | ||
unsigned int | amount, | ||
enum ast_aoc_currency_multiplier | multiplier, | ||
const char * | currency_name, | ||
unsigned long | time, | ||
enum ast_aoc_time_scale | time_scale, | ||
unsigned long | granularity_time, | ||
enum ast_aoc_time_scale | granularity_time_scale, | ||
int | step_function | ||
) |
Add AOC-S duration rate entry.
decoded | aoc decoded object to add entry to |
charged_item | ast_aoc_s_charged_item |
amount | currency amount |
multiplier | currency multiplier |
currency_name | truncated after 10 characters |
time | |
time_scale | from ast_aoc_time_scale enum |
granularity_time | (optional, set to 0 if not present); |
granularity_time_scale | (optional, set to 0 if not present); |
step_function | set to 1 if this is to use a step function, 0 if continuious |
0 | success |
-1 | failure |
Definition at line 770 of file aoc.c.
References aoc_s_add_entry(), AST_AOC_RATE_TYPE_DURATION, ast_copy_string(), ast_strlen_zero(), and ast_aoc_s_entry::charged_item.
Referenced by action_aoc_s_submessage(), and AST_TEST_DEFINE().
int ast_aoc_s_add_rate_flat | ( | struct ast_aoc_decoded * | decoded, |
enum ast_aoc_s_charged_item | charged_item, | ||
unsigned int | amount, | ||
enum ast_aoc_currency_multiplier | multiplier, | ||
const char * | currency_name | ||
) |
Add AOC-S flat rate entry.
decoded | aoc decoded object to add entry to |
charged_item | ast_aoc_s_charged_item |
amount | currency amount |
multiplier | currency multiplier |
currency_name | truncated after 10 characters |
0 | success |
-1 | failure |
Definition at line 801 of file aoc.c.
References aoc_s_add_entry(), AST_AOC_RATE_TYPE_FLAT, ast_copy_string(), ast_strlen_zero(), and ast_aoc_s_entry::charged_item.
Referenced by action_aoc_s_submessage(), and AST_TEST_DEFINE().
int ast_aoc_s_add_rate_free | ( | struct ast_aoc_decoded * | decoded, |
enum ast_aoc_s_charged_item | charged_item, | ||
int | from_beginning | ||
) |
Add AOC-S indicating charge item is free.
decoded | aoc decoded object to add entry to |
charged_item | ast_aoc_s_charged_item |
from_beginning | TRUE if the rate is free from beginning. |
0 | success |
-1 | failure |
Definition at line 857 of file aoc.c.
References aoc_s_add_entry(), AST_AOC_RATE_TYPE_FREE, AST_AOC_RATE_TYPE_FREE_FROM_BEGINNING, and ast_aoc_s_entry::charged_item.
Referenced by action_aoc_s_submessage(), and AST_TEST_DEFINE().
int ast_aoc_s_add_rate_na | ( | struct ast_aoc_decoded * | decoded, |
enum ast_aoc_s_charged_item | charged_item | ||
) |
Add AOC-S entry indicating charge item is not available.
decoded | aoc decoded object to add entry to |
charged_item | ast_aoc_s_charged_item |
0 | success |
-1 | failure |
Definition at line 869 of file aoc.c.
References aoc_s_add_entry(), AST_AOC_RATE_TYPE_NA, and ast_aoc_s_entry::charged_item.
Referenced by action_aoc_s_submessage(), and AST_TEST_DEFINE().
int ast_aoc_s_add_rate_special_charge_code | ( | struct ast_aoc_decoded * | decoded, |
enum ast_aoc_s_charged_item | charged_item, | ||
unsigned int | code | ||
) |
Add AOC-S special rate entry.
decoded | aoc decoded object to add entry to |
charged_item | ast_aoc_s_charged_item |
code | special charging code |
0 | success |
-1 | failure |
Definition at line 844 of file aoc.c.
References aoc_s_add_entry(), AST_AOC_RATE_TYPE_SPECIAL_CODE, and ast_aoc_s_entry::charged_item.
Referenced by action_aoc_s_submessage().
int ast_aoc_s_add_rate_volume | ( | struct ast_aoc_decoded * | decoded, |
enum ast_aoc_s_charged_item | charged_item, | ||
enum ast_aoc_volume_unit | volume_unit, | ||
unsigned int | amount, | ||
enum ast_aoc_currency_multiplier | multiplier, | ||
const char * | currency_name | ||
) |
Add AOC-S volume rate entry.
decoded | aoc decoded object to add entry to |
charged_item | ast_aoc_s_charged_item |
volume_unit | from ast_aoc_volume_unit enum |
amount | currency amount |
multiplier | currency multiplier |
currency_name | truncated after 10 characters |
0 | success |
-1 | failure |
Definition at line 822 of file aoc.c.
References aoc_s_add_entry(), AST_AOC_RATE_TYPE_VOLUME, ast_copy_string(), ast_strlen_zero(), and ast_aoc_s_entry::charged_item.
Referenced by action_aoc_s_submessage(), and AST_TEST_DEFINE().
int ast_aoc_s_add_special_arrangement | ( | struct ast_aoc_decoded * | decoded, |
unsigned int | code | ||
) |
Add AOC-S special arrangement entry.
decoded | aoc decoded object to add entry to |
code | special arrangement code |
0 | success |
-1 | failure |
Definition at line 880 of file aoc.c.
References aoc_s_add_entry(), AST_AOC_CHARGED_ITEM_SPECIAL_ARRANGEMENT, and AST_AOC_RATE_TYPE_SPECIAL_CODE.
Referenced by action_aoc_s_submessage().
unsigned int ast_aoc_s_get_count | ( | struct ast_aoc_decoded * | decoded | ) |
get the number rates associated with an AOC-S message
Definition at line 756 of file aoc.c.
References ast_aoc_decoded::aoc_s_count.
Referenced by action_aoc_s_message(), and aoc_send_as_xml().
const struct ast_aoc_s_entry * ast_aoc_s_get_rate_info | ( | struct ast_aoc_decoded * | decoded, |
unsigned int | entry_number | ||
) |
get a specific AOC-S rate entry.
Definition at line 761 of file aoc.c.
References ast_aoc_decoded::aoc_s_count, ast_aoc_decoded::aoc_s_entries, and NULL.
Referenced by aoc_send_as_xml().
int ast_aoc_set_association_id | ( | struct ast_aoc_decoded * | decoded, |
const int | id | ||
) |
set the charging association id for an AST_AOC_E message
decoded | ast_aoc_decoded struct to set values on |
id | charging association identifier |
0 | success |
Definition at line 1040 of file aoc.c.
References AST_AOC_CHARGING_ASSOCIATION_ID, AST_AOC_E, ast_aoc_charging_association::charge, ast_aoc_decoded::charging_association, ast_aoc_charging_association::charging_type, id, ast_aoc_charging_association::id, and ast_aoc_decoded::msg_type.
Referenced by action_aoc_de_message(), and AST_TEST_DEFINE().
int ast_aoc_set_association_number | ( | struct ast_aoc_decoded * | decoded, |
const char * | num, | ||
uint8_t | plan | ||
) |
set the charging association number for an AOC-E message
decoded | ast_aoc_decoded struct to set values on |
num | charging association number |
plan | charging association number plan and type-of-number fields |
0 | success |
Definition at line 1056 of file aoc.c.
References AST_AOC_CHARGING_ASSOCIATION_NUMBER, AST_AOC_E, ast_copy_string(), ast_strlen_zero(), ast_aoc_charging_association::charge, ast_aoc_decoded::charging_association, ast_aoc_charging_association::charging_type, ast_aoc_decoded::msg_type, ast_aoc_charging_association_number::number, ast_aoc_charging_association::number, and ast_aoc_charging_association_number::plan.
Referenced by action_aoc_de_message(), and AST_TEST_DEFINE().
int ast_aoc_set_billing_id | ( | struct ast_aoc_decoded * | decoded, |
const enum ast_aoc_billing_id | id | ||
) |
set the billing id for a AOC-D or AST_AOC_E message
decoded | ast_aoc_decoded struct to set values on |
id | billing id |
0 | success |
Definition at line 1024 of file aoc.c.
References AST_AOC_BILLING_NA, AST_AOC_BILLING_NUM_ENTRIES, ast_aoc_decoded::billing_id, and id.
Referenced by action_aoc_de_message(), and AST_TEST_DEFINE().
int ast_aoc_set_currency_info | ( | struct ast_aoc_decoded * | decoded, |
const unsigned int | amount, | ||
const enum ast_aoc_currency_multiplier | multiplier, | ||
const char * | name | ||
) |
Sets the currency values for a AOC-D or AOC-E message.
decoded | ast_aoc_decoded struct to set values on |
amount | currency amount REQUIRED |
multiplier | currency multiplier REQUIRED, 0 or undefined value defaults to AST_AOC_MULT_ONE. |
name | currency name OPTIONAL |
0 | success |
Definition at line 919 of file aoc.c.
References AST_AOC_MULT_NUM_ENTRIES, AST_AOC_MULT_ONE, ast_copy_string(), ast_strlen_zero(), ast_aoc_decoded::currency_amount, ast_aoc_decoded::currency_name, ast_aoc_decoded::multiplier, and name.
Referenced by action_aoc_de_message(), and AST_TEST_DEFINE().
int ast_aoc_set_termination_request | ( | struct ast_aoc_decoded * | decoded | ) |
Mark the AST_AOC_REQUEST message as a termination request.
decoded | ast_aoc_decoded struct to set values on |
0 | success |
-1 | failure |
Definition at line 1069 of file aoc.c.
References AST_AOC_REQUEST, ast_aoc_decoded::msg_type, and ast_aoc_decoded::termination_request.
Referenced by AST_TEST_DEFINE().
int ast_aoc_set_total_type | ( | struct ast_aoc_decoded * | decoded, |
const enum ast_aoc_total_type | type | ||
) |
Sets the type of total for a AOC-D message.
decoded | ast_aoc_decoded struct to set values on |
type | total type: TOTAL or SUBTOTAL |
0 | success |
Definition at line 907 of file aoc.c.
References ast_aoc_decoded::total_type, and type.
Referenced by action_aoc_de_message(), and AST_TEST_DEFINE().
int ast_aoc_test_encode_decode_match | ( | struct ast_aoc_decoded * | decoded | ) |
test aoc encode decode routines.
Definition at line 1330 of file aoc.c.
References ast_aoc_decode(), ast_aoc_destroy_decoded(), ast_aoc_destroy_encoded(), ast_aoc_encode(), ast_free, and NULL.
Referenced by AST_TEST_DEFINE().