Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk/res_aeap.h"
Go to the source code of this file.
Functions | |
int | aeap_transaction_cancel_timer (struct aeap_transaction *tsx) |
Cancel the transaction timer. More... | |
struct aeap_transaction * | aeap_transaction_create_and_add (struct ao2_container *transactions, const char *id, struct ast_aeap_tsx_params *params, struct ast_aeap *aeap) |
Create a transaction object, and add it to the given container. More... | |
void | aeap_transaction_end (struct aeap_transaction *tsx, int result) |
End a transaction, and remove it from the given container. More... | |
struct aeap_transaction * | aeap_transaction_get (struct ao2_container *transactions, const char *id) |
Retrieve a transaction for the id from the container. More... | |
void | aeap_transaction_params_cleanup (struct ast_aeap_tsx_params *params) |
Clean up parameter references, and possibly call optional user object cleanup. More... | |
int | aeap_transaction_result (struct aeap_transaction *tsx) |
Get a transaction's result. More... | |
int | aeap_transaction_start (struct aeap_transaction *tsx) |
Start the transaction. More... | |
void * | aeap_transaction_user_obj (struct aeap_transaction *tsx) |
Retrieve the user object associated with the transaction. More... | |
struct ao2_container * | aeap_transactions_create (void) |
Create an Asterisk external application transactions container. More... | |
int aeap_transaction_cancel_timer | ( | struct aeap_transaction * | tsx | ) |
Cancel the transaction timer.
Stops the transaction timer, but does not end/stop the transaction itself
tsx | A transaction to cancel the timer on |
Definition at line 57 of file transaction.c.
References aeap_sched_context(), ao2_ref, AST_SCHED_DEL_UNREF, and aeap_transaction::sched_id.
Referenced by raise_msg(), transaction_destructor(), and transaction_end().
struct aeap_transaction * aeap_transaction_create_and_add | ( | struct ao2_container * | transactions, |
const char * | id, | ||
struct ast_aeap_tsx_params * | params, | ||
struct ast_aeap * | aeap | ||
) |
Create a transaction object, and add it to the given container.
transactions | A transactions container |
id | An id to use for the transaction |
params | Transaction parameters |
aeap | The aeap object that "owns" this transaction |
Definition at line 232 of file transaction.c.
References aeap_transaction::aeap, aeap_error, ao2_link, ao2_ref, aeap_transaction::container, NULL, aeap_transaction::params, and transaction_create().
Referenced by ast_aeap_send_msg_tsx(), and exec().
void aeap_transaction_end | ( | struct aeap_transaction * | tsx, |
int | result | ||
) |
End a transaction, and remove it from the given container.
The "result" parameter is a value representing the state (success/failure, perhaps even something else) of transactional processing upon ending.
tsx | A transaction to end |
result | A result to give to the transaction |
Definition at line 217 of file transaction.c.
References result, and transaction_end().
Referenced by ast_aeap_send_msg_tsx(), end_transaction(), exec(), raise_msg(), and tsx_end().
struct aeap_transaction * aeap_transaction_get | ( | struct ao2_container * | transactions, |
const char * | id | ||
) |
Retrieve a transaction for the id from the container.
transactions | A transactions container |
id | A transaction id |
Definition at line 212 of file transaction.c.
References ao2_find, and OBJ_SEARCH_KEY.
Referenced by raise_msg().
void aeap_transaction_params_cleanup | ( | struct ast_aeap_tsx_params * | params | ) |
Clean up parameter references, and possibly call optional user object cleanup.
params | Transaction parameters |
Definition at line 67 of file transaction.c.
References ao2_cleanup, ast_aeap_tsx_params::msg, ast_aeap_tsx_params::obj, and ast_aeap_tsx_params::obj_cleanup.
Referenced by ast_aeap_send_msg_tsx(), transaction_create(), and transaction_destructor().
int aeap_transaction_result | ( | struct aeap_transaction * | tsx | ) |
Get a transaction's result.
A transaction's result is a value that represents the relative success (0), or failure (-1) of a transaction. For example, a timeout is considered a failure and will elicit a -1.
This value though is also dependent upon the result of the message handler associated with the transaction. Meaning if an associated message is handled, then its result is stored as the transaction result and returned here.
tsx | A transaction object |
Definition at line 222 of file transaction.c.
References aeap_transaction::result.
Referenced by ast_aeap_send_msg_tsx().
int aeap_transaction_start | ( | struct aeap_transaction * | tsx | ) |
Start the transaction.
tsx | The transaction to initiate |
Definition at line 198 of file transaction.c.
References aeap_transaction::params, transaction_sched_timer(), transaction_wait(), and ast_aeap_tsx_params::wait.
Referenced by ast_aeap_send_msg_tsx(), and exec().
void * aeap_transaction_user_obj | ( | struct aeap_transaction * | tsx | ) |
Retrieve the user object associated with the transaction.
tsx | A transaction object |
Definition at line 227 of file transaction.c.
References ast_aeap_tsx_params::obj, and aeap_transaction::params.
Referenced by end_transaction(), and raise_msg().
struct ao2_container * aeap_transactions_create | ( | void | ) |
Create an Asterisk external application transactions container.
Definition at line 272 of file transaction.c.
References AEAP_TRANSACTION_BUCKETS, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ast_log, LOG_ERROR, and NULL.
Referenced by ast_aeap_create(), and exec().