52#define AEAP_TRANSACTION_BUCKETS 11
179 aeap_error(tsx->
aeap,
"transaction",
"unable to schedule timeout for '%s'", tsx->
id);
243 aeap_error(tsx->
aeap,
"transaction",
"unable to add '%s' to container",
id);
277 aeap_transaction_hash_fn,
NULL, aeap_transaction_cmp_fn);
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_unlink(container, obj)
Remove an object from a container.
#define ao2_find(container, arg, flags)
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
void * ao2_object_get_lockaddr(void *obj)
Return the mutex lock address of an object.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
@ OBJ_SEARCH_KEY
The arg parameter is a search key, but is not an object.
#define ao2_alloc(data_size, destructor_fn)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
struct ast_sched_context * aeap_sched_context(void)
Retrieve the scheduling context.
#define ast_cond_destroy(cond)
#define ast_cond_wait(cond, mutex)
#define ast_cond_init(cond, attr)
pthread_cond_t ast_cond_t
#define ast_cond_signal(cond)
#define aeap_error(obj, name, fmt,...)
Log an Asterisk external application error.
Asterisk External Application Protocol API.
Asterisk External Application Protocol Message API.
const char * ast_aeap_message_name(const struct ast_aeap_message *message)
Retrieve a message name.
Scheduler Routines (derived from cheops)
#define AST_SCHED_DEL_UNREF(sched, id, refcall)
schedule task to get deleted and call unref function
int ast_sched_add(struct ast_sched_context *con, int when, ast_sched_cb callback, const void *data) attribute_warn_unused_result
Adds a scheduled event.
struct ao2_container * container
struct ast_aeap_tsx_params params
Parameters to be used when sending a transaction based message.
struct ast_aeap_message * msg
ast_aeap_user_obj_cleanup obj_cleanup
ast_aeap_on_timeout on_timeout
static void transaction_end(struct aeap_transaction *tsx, int timed_out, int result)
static int transaction_sched_timer(struct aeap_transaction *tsx)
void * aeap_transaction_user_obj(struct aeap_transaction *tsx)
Retrieve the user object associated with the transaction.
static struct aeap_transaction * transaction_create(const char *id, struct ast_aeap_tsx_params *params, struct ast_aeap *aeap)
int aeap_transaction_cancel_timer(struct aeap_transaction *tsx)
Cancel the transaction timer.
AO2_STRING_FIELD_CMP_FN(aeap_transaction, id)
#define AEAP_TRANSACTION_BUCKETS
Number of transaction buckets.
int aeap_transaction_result(struct aeap_transaction *tsx)
Get a transaction's result.
AO2_STRING_FIELD_HASH_FN(aeap_transaction, id)
struct ao2_container * aeap_transactions_create(void)
Create an Asterisk external application transactions container.
static void transaction_destructor(void *obj)
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.
static int transaction_raise_timeout(const void *data)
void aeap_transaction_end(struct aeap_transaction *tsx, int result)
End a transaction, and remove it from the given container.
struct aeap_transaction * aeap_transaction_get(struct ao2_container *transactions, const char *id)
Retrieve a transaction for the id from the container.
int aeap_transaction_start(struct aeap_transaction *tsx)
Start the transaction.
static void transaction_wait(struct aeap_transaction *tsx)
void aeap_transaction_params_cleanup(struct ast_aeap_tsx_params *params)
Clean up parameter references, and possibly call optional user object cleanup.