29#include <pjsip_simple.h>
257#define DEFAULT_PUBLISHER_BUCKETS 119
262#define MAX_UNLOAD_TIMEOUT_TIME 35
268#define DEFAULT_STATE_BUCKETS 31
299 const char *right_key = arg;
304 right_key = object_right->
id;
307 cmp = strcmp(object_left->
id, right_key);
366 &publisher->
timer, 0)) {
376 pj_time_val delay = { .sec = 0, };
381 delay.sec =
expiration - PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH;
383 if (
publish->expiration && ((delay.sec >
publish->expiration) || !delay.sec)) {
384 delay.sec =
publish->expiration;
386 if (delay.sec < PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH) {
387 delay.sec = PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH;
430 pjsip_tpselector selector = { .type = PJSIP_TPSELECTOR_NONE, };
434 pjsip_tx_data_set_transport(tdata, &selector);
443 pjsip_tx_data *tdata;
445 if (pjsip_publishc_unpublish(publisher->
client, &tdata) == PJ_SUCCESS) {
447 pjsip_publishc_send(publisher->
client, tdata);
491 if (!
state->client->started) {
494 ast_debug(2,
"Could not find handler for event '%s' for outbound publish client '%s'\n",
497 ast_log(
LOG_ERROR,
"Failed to start outbound publish with event '%s' for client '%s'\n",
500 state->client->started = 1;
505 state->client->started = 0;
538 return state->client;
576 char *uri,
size_t size)
599 char *uri,
size_t size)
620 ast_log(
LOG_ERROR,
"Handler does not implement required callbacks. Cannot register\n");
623 ast_log(
LOG_ERROR,
"No event package specified for event publisher handler. Cannot register\n");
629 ast_log(
LOG_ERROR,
"Unable to register event publisher handler for event %s. "
630 "A handler is already registered\n",
handler->event_name);
697 const char *uid_ptr =
uid;
709 datastore->info =
info;
716 if (!datastore->uid) {
754 pjsip_tx_data *tdata;
761 if (pjsip_publishc_publish(publisher->client, PJ_FALSE, &tdata) != PJ_SUCCESS) {
767 pjsip_tx_data_dec_ref(tdata);
773 status = pjsip_publishc_send(publisher->client, tdata);
777 }
else if (
status != PJ_SUCCESS) {
801 size_t type_len = 0, subtype_len = 0, body_text_len = 0;
823 char *dst =
message->body_contents;
854 pj_pool_t *pool,
const char *uri,
const char *
user, pj_str_t *res_uri)
858 pjsip_sip_uri *parsed_uri;
861 pj_strdup2_with_null(pool, &
tmp, uri);
862 if (!(parsed = pjsip_parse_uri(pool,
tmp.ptr,
tmp.slen, 0))) {
866 if (!(parsed_uri = pjsip_uri_get_uri(parsed))) {
871 pj_strdup2(pool, &parsed_uri->user,
user);
879 if ((size = pjsip_uri_print(PJSIP_URI_IN_OTHER, parsed_uri, res_uri->ptr,
883 res_uri->ptr[size] =
'\0';
884 res_uri->slen = size;
891 pj_str_t *
server_uri, pj_str_t *to_uri, pj_str_t *from_uri)
896 ast_log(
LOG_ERROR,
"Invalid server URI '%s' specified on outbound publish '%s'\n",
905 ast_log(
LOG_ERROR,
"Invalid to URI '%s' specified on outbound publish '%s'\n",
919 ast_log(
LOG_ERROR,
"Invalid from URI '%s' specified on outbound publish '%s'\n",
939 pjsip_publishc_opt opt = {
940 .queue_request = PJ_FALSE,
951 &publisher->
client) != PJ_SUCCESS) {
959 pjsip_route_hdr route_set, *route;
960 static const pj_str_t ROUTE_HNAME = {
"Route", 5 };
962 pj_list_init(&route_set);
964 if (!(route = pjsip_parse_hdr(pjsip_publishc_get_pool(publisher->
client), &ROUTE_HNAME,
966 pjsip_publishc_destroy(publisher->
client);
969 pj_list_insert_nodes_before(&route_set, route);
971 pjsip_publishc_set_route_set(publisher->
client, &route_set);
977 ast_log(
LOG_ERROR,
"Could not create pool for URI validation on outbound publish '%s'\n",
979 pjsip_publishc_destroy(publisher->
client);
985 pjsip_publishc_destroy(publisher->
client);
991 publish->expiration) != PJ_SUCCESS) {
992 ast_log(
LOG_ERROR,
"Failed to initialize publishing client on outbound publish '%s'\n",
995 pjsip_publishc_destroy(publisher->
client);
1057 publisher->
timer.user_data = publisher;
1062 *publisher->
user =
'\0';
1076 ast_log(
LOG_ERROR,
"Unable to create publisher for outbound publish '%s'\n",
1142 pjsip_publishc_destroy(publisher->
client);
1225 state->client->started = 0;
1262#define DESTROY_CLIENT() do { \
1263 pjsip_publishc_destroy(publisher->client); \
1264 publisher->client = NULL; \
1265 ao2_ref(publisher, -1); } while (0)
1270 pjsip_tx_data *tdata;
1272 if (publisher->destroy) {
1273 if (publisher->sending) {
1274 publisher->sending =
NULL;
1288 if (param->code == 401 || param->code == 407) {
1289 pjsip_transaction *tsx = pjsip_rdata_get_tsx(param->rdata);
1292 param->rdata, tsx->last_tx, &tdata)) {
1294 pjsip_publishc_send(publisher->client, tdata);
1296 publisher->auth_attempts++;
1298 if (publisher->auth_attempts ==
publish->max_auth_attempts) {
1300 ast_log(
LOG_ERROR,
"Reached maximum number of PUBLISH authentication attempts on outbound publish '%s'\n",
1308 publisher->auth_attempts = 0;
1310 if (param->code == 412) {
1313 ast_log(
LOG_ERROR,
"Failed to create a new outbound publish client for '%s' on 412 response\n",
1319 publisher->sending =
NULL;
1320 }
else if (param->code == 423) {
1322 pjsip_expires_hdr *expires;
1324 expires = pjsip_msg_find_hdr(param->rdata->msg_info.msg, PJSIP_H_MIN_EXPIRES,
NULL);
1325 if (!expires || !expires->ivalue) {
1327 ast_log(
LOG_ERROR,
"Received 423 response on outbound publish '%s' without a Min-Expires header\n",
1332 pjsip_publishc_update_expires(publisher->client, expires->ivalue);
1333 publisher->sending =
NULL;
1334 }
else if (publisher->sending) {
1338 publisher->sending =
NULL;
1339 if (!param->rdata) {
1350 if (!publisher->client) {
1363#define DATASTORE_BUCKETS 53
1391 const char *right_key = arg;
1396 right_key = object_right->
uid;
1399 cmp = strcmp(object_left->
uid, right_key);
1402 cmp = strncmp(object_left->
uid, right_key, strlen(right_key));
1435 if (!
state->client) {
1442 if (!
state->client->datastores) {
1449 sip_outbound_publisher_hash_fn,
NULL, sip_outbound_publisher_cmp_fn);
1450 if (!
state->client->publishers) {
1457 strcpy(
state->id,
id);
1468 ast_log(
LOG_ERROR,
"Server URI or hostname length exceeds pjproject limit or is not a sip(s) uri: '%s' on outbound publish '%s'\n",
1478 ast_log(
LOG_ERROR,
"From URI or hostname length exceeds pjproject limit or is not a sip(s) uri: '%s' on outbound publish '%s'\n",
1484 ast_log(
LOG_ERROR,
"To URI or hostname length exceeds pjproject limit or is not a sip(s) uri: '%s' on outbound publish '%s'\n",
1528 ast_log(
LOG_ERROR,
"Unable to reinitialize client(s) for outbound publish '%s'\n",
1547#define ADD_TO_NEW_STATES(__obj) \
1549 ao2_link(new_states, __obj); \
1550 ao2_ref(__obj, -1); } } while (0)
1586 return res == 1 ? 0 : -1;
1631 ast_debug(2,
"Waiting for publication to complete for unload.\n");
1634 ast_log(
LOG_WARNING,
"Unload incomplete. Could not stop %d outbound publications. Try again later.\n",
1662 ast_log(
LOG_ERROR,
"Unable to register 'outbound-publish' type with sorcery\n");
1706 .
requires =
"res_pjproject,res_pjsip",
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_calloc(num, len)
A wrapper for calloc()
#define ao2_iterator_next(iter)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_NOLOCK
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_global_obj_replace_unref(holder, obj)
Replace an ao2 object in the global holder, throwing away any old object.
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
#define ao2_callback_data(container, flags, cb_fn, arg, data)
#define ao2_global_obj_ref(holder)
Get a reference to the object stored in the global holder.
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_global_obj_release(holder)
Release the ao2 object held in the global holder.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
@ OBJ_SEARCH_PARTIAL_KEY
The arg parameter is a partial search key similar to OBJ_SEARCH_KEY.
@ OBJ_SEARCH_OBJECT
The arg parameter is an object of the same type.
@ OBJ_SEARCH_MASK
Search option field mask.
@ 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.
enum ast_cc_service_type service
#define STRFLDSET(type,...)
Convert a struct and a list of stringfield fields to an argument list of field offsets.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
@ OPT_UINT_T
Type for default option handler for unsigned integers.
@ OPT_NOOP_T
Type for a default handler that should do nothing.
@ OPT_BOOL_T
Type for default option handler for bools (ast_true/ast_false)
@ OPT_STRINGFIELD_T
Type for default option handler for stringfields.
Asterisk datastore objects.
int ast_sip_push_task(struct ast_taskprocessor *serializer, int(*sip_task)(void *), void *task_data)
Pushes a task to SIP servants.
struct ast_taskprocessor * ast_sip_create_serializer_group(const char *name, struct ast_serializer_shutdown_group *shutdown_group)
Create a new serializer for SIP tasks.
int ast_sip_push_task_wait_servant(struct ast_taskprocessor *serializer, int(*sip_task)(void *), void *task_data)
Push a task to SIP servants and wait for it to complete.
#define ast_debug(level,...)
Log a DEBUG message.
#define AST_RWLIST_REMOVE_CURRENT
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_RWLIST_TRAVERSE_SAFE_BEGIN
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_RWLIST_TRAVERSE_SAFE_END
#define AST_RWLIST_TRAVERSE
#define AST_RWLIST_INSERT_TAIL
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
#define ast_rwlock_wrlock(a)
#define SCOPED_AO2LOCK(varname, obj)
scoped lock specialization for ao2 mutexes.
#define AST_RWLOCK_DEFINE_STATIC(rwlock)
#define SCOPED_WRLOCK(varname, lock)
scoped lock specialization for write locks
#define SCOPED_LOCK(varname, lock, lockfunc, unlockfunc)
Scoped Locks.
#define ast_rwlock_unlock(a)
Asterisk module definitions.
@ AST_MODFLAG_GLOBAL_SYMBOLS
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODPRI_CHANNEL_DEPEND
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
struct ao2_container * container
int ast_pjproject_get_buildopt(char *option, char *format_string,...)
Retrieve a pjproject build option.
int ast_sip_create_request_with_auth(const struct ast_sip_auth_vector *auths, pjsip_rx_data *challenge, pjsip_tx_data *tdata, pjsip_tx_data **new_request)
Create a response to an authentication challenge.
pjsip_endpoint * ast_sip_get_pjsip_endpoint(void)
Get a pointer to the PJSIP endpoint.
int ast_sip_add_body(pjsip_tx_data *tdata, const struct ast_sip_body *body)
Add a body to an outbound SIP message.
void ast_sip_tpselector_unref(pjsip_tpselector *selector)
Unreference a pjsip_tpselector.
void ast_sip_auth_vector_destroy(struct ast_sip_auth_vector *vector)
Free contents of an auth vector.
int ast_sip_set_tpselector_from_transport_name(const char *transport_name, pjsip_tpselector *selector)
Sets pjsip_tpselector from ast_sip_transport.
struct ast_sorcery * ast_sip_get_sorcery(void)
Get a pointer to the SIP sorcery structure.
int ast_sip_auth_vector_init(struct ast_sip_auth_vector *vector, const char *auth_names)
Initialize an auth vector with the configured values.
int ast_sip_publish_client_add_datastore(struct ast_sip_outbound_publish_client *client, struct ast_datastore *datastore)
Add a datastore to a SIP event publisher.
static struct ast_sip_event_publisher_handler * find_publisher_handler_for_event_name(const char *event_name)
const char * ast_sip_publish_client_get_user_to_uri(struct ast_sip_outbound_publish_client *client, const char *user, char *uri, size_t size)
Get the To URI the client will use for a specific user.
void ast_sip_publish_client_remove_datastore(struct ast_sip_outbound_publish_client *client, const char *name)
Remove a publication datastore from an event publisher.
const char * ast_sip_publish_client_get_user_from_uri(struct ast_sip_outbound_publish_client *client, const char *user, char *uri, size_t size)
Get the From URI the client will use for a specific user.
static int can_reuse_publish(struct ast_sip_outbound_publish *existing, struct ast_sip_outbound_publish *applied)
void ast_sip_unregister_event_publisher_handler(struct ast_sip_event_publisher_handler *handler)
Unregister a publish handler.
static void sub_add_handler(struct ast_sip_event_publisher_handler *handler)
static int current_state_reusable(struct ast_sip_outbound_publish *publish, struct ast_sip_outbound_publish_state *current_state)
static void stop_publishing(struct ast_sip_outbound_publish_client *client, struct ast_sip_event_publisher_handler *handler)
static ast_rwlock_t load_lock
Used for locking while loading/reloading.
static void sip_outbound_publish_synchronize(struct ast_sip_event_publisher_handler *removed)
Helper function which starts or stops publish clients when applicable.
static struct ast_serializer_shutdown_group * shutdown_group
AO2_STRING_FIELD_CMP_FN(sip_outbound_publisher, user)
static struct ast_sip_outbound_publish_state * sip_publish_state_get(const char *id)
static int sip_outbound_publisher_set_uris(pj_pool_t *pool, struct sip_outbound_publisher *publisher, pj_str_t *server_uri, pj_str_t *to_uri, pj_str_t *from_uri)
static int outbound_publish_state_hash(const void *obj, const int flags)
hashing function for state objects
static void sip_outbound_publish_destroy(void *obj)
Destructor function for publish information.
#define DATASTORE_BUCKETS
static void sip_outbound_publish_callback(struct pjsip_publishc_cbparam *param)
Callback function for publish client responses.
static int sip_outbound_publisher_reinit_all(void *data)
static void sip_outbound_publish_datastore_destroy(void *obj)
#define DEFAULT_STATE_BUCKETS
Default number of client state container buckets.
struct ast_datastore * ast_sip_publish_client_alloc_datastore(const struct ast_datastore_info *info, const char *uid)
Alternative for ast_datastore_alloc()
static AO2_GLOBAL_OBJ_STATIC(current_states)
int ast_sip_publish_client_send(struct ast_sip_outbound_publish_client *client, const struct ast_sip_body *body)
Send an outgoing PUBLISH message using a client.
static int outbound_auth_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
#define MAX_UNLOAD_TIMEOUT_TIME
static struct sip_outbound_publisher * sip_outbound_publisher_alloc(struct ast_sip_outbound_publish_client *client, const char *user)
static int pjsip_max_url_size
static int outbound_publish_state_cmp(void *obj, void *arg, int flags)
comparator function for client objects
static int cancel_refresh_timer_task(void *data)
Task for cancelling a refresh timer.
AO2_STRING_FIELD_HASH_FN(sip_outbound_publisher, user)
static int reload_module(void)
static int explicit_publish_destroy(void *data)
static void schedule_publish_refresh(struct sip_outbound_publisher *publisher, int expiration)
Helper function which sets up the timer to send publication.
int ast_sip_register_event_publisher_handler(struct ast_sip_event_publisher_handler *handler)
Register an event publisher handler.
static int validate_publish_config(struct ast_sip_outbound_publish *publish)
static int sip_publisher_service_queue(void *data)
static int sip_outbound_publish_apply(const struct ast_sorcery *sorcery, void *obj)
Apply function which finds or allocates a state structure.
const char * ast_sip_publish_client_get_from_uri(struct ast_sip_outbound_publish_client *client)
Get the From URI the client will use.
void ast_sip_publish_client_remove(struct ast_sip_outbound_publish_client *client, const char *user)
Remove the user from the client (stopping it from publishing)
static void sip_outbound_publisher_destroy(void *obj)
Destructor function for publish client.
int ast_sip_publish_client_user_send(struct ast_sip_outbound_publish_client *client, const char *user, const struct ast_sip_body *body)
Send an outgoing PUBLISH message based on the user.
struct ast_sip_outbound_publish_client * ast_sip_publish_client_get(const char *name)
Find a publish client using its name.
static struct ast_sip_outbound_publish_state * sip_outbound_publish_state_alloc(struct ast_sip_outbound_publish *publish)
Allocator function for publish client.
static void sip_outbound_publish_client_destroy(void *obj)
Destructor function for publish client.
static void sip_outbound_publish_state_destroy(void *obj)
Destructor function for publish state.
static int sip_outbound_publisher_reinit(void *obj, void *arg, int flags)
static void * sip_outbound_publish_alloc(const char *name)
Allocator function for publish information.
static void cancel_publish_refresh(struct sip_outbound_publisher *publisher)
Helper function which cancels the refresh timer on a publisher.
static struct sip_outbound_publisher * sip_outbound_publish_client_get_publisher(struct ast_sip_outbound_publish_client *client, const char *user)
static struct ao2_container * new_states
Used on [re]loads to hold new state data.
static struct sip_outbound_publisher * sip_outbound_publish_client_add_publisher(struct ast_sip_outbound_publish_client *client, const char *user)
static int load_module(void)
static int datastore_cmp(void *obj, void *arg, int flags)
const char * ast_sip_publish_client_get_to_uri(struct ast_sip_outbound_publish_client *client)
Get the To URI the client will use.
static void sip_outbound_publish_timer_cb(pj_timer_heap_t *timer_heap, struct pj_timer_entry *entry)
Publish client timer callback function.
struct ast_datastore * ast_sip_publish_client_get_datastore(struct ast_sip_outbound_publish_client *client, const char *name)
Retrieve an event publisher datastore.
static int sip_outbound_publisher_set_uri(pj_pool_t *pool, const char *uri, const char *user, pj_str_t *res_uri)
static int unload_module(void)
#define ADD_TO_NEW_STATES(__obj)
static int datastore_hash(const void *obj, int flags)
static int send_unpublish_task(void *data)
Task for sending an unpublish.
static void set_transport(struct sip_outbound_publisher *publisher, pjsip_tx_data *tdata)
static int publisher_client_send(void *obj, void *arg, void *data, int flags)
static struct ao2_container * get_publishes_and_update_state(void)
static int sip_outbound_publisher_init(void *data)
Helper function that allocates a pjsip publish client and configures it.
static int cancel_and_unpublish(void *obj, void *arg, int flags)
Helper function which cancels and un-publishes a no longer used client.
static struct ast_sorcery * sorcery
int ast_sip_validate_uri_length(const char *uri)
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
@ AST_RETRIEVE_FLAG_MULTIPLE
Return all matching objects.
@ AST_RETRIEVE_FLAG_ALL
Perform no matching, return all objects.
#define ast_sorcery_object_register(sorcery, type, alloc, transform, apply)
Register an object type.
#define ast_sorcery_object_field_register_custom(sorcery, type, name, default_val, config_handler, sorcery_handler, multiple_handler, flags,...)
Register a field within an object with custom handlers.
void * ast_sorcery_generic_alloc(size_t size, ao2_destructor_fn destructor)
Allocate a generic sorcery capable object.
int ast_sorcery_object_unregister(struct ast_sorcery *sorcery, const char *type)
Unregister an object type.
#define ast_sorcery_apply_config(sorcery, name)
#define ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object.
#define ast_sorcery_apply_default(sorcery, type, name, data)
void ast_sorcery_reload_object(const struct ast_sorcery *sorcery, const char *type)
Inform any wizards of a specific object type to reload persistent objects.
void * ast_sorcery_retrieve_by_fields(const struct ast_sorcery *sorcery, const char *type, unsigned int flags, struct ast_variable *fields)
Retrieve an object or multiple objects using specific fields.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define AST_STRING_FIELD(name)
Declare a string field.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Structure for a data store type.
void(* destroy)(void *data)
Structure for a data store object.
const struct ast_datastore_info * info
Callbacks that event publisher handlers will define.
struct ast_sip_event_publisher_handler * next
const char * event_name
The name of the event this handler deals with.
Outbound publish client state information (persists for lifetime of a publish)
struct ao2_container * datastores
Publisher datastores set up by handlers.
unsigned int started
Publishing has been fully started and event type informed.
struct ast_sip_outbound_publish * publish
Outbound publish information.
struct ao2_container * publishers
Container of all the client publishing objects.
Outbound publish state information (persists for lifetime of a publish)
struct ast_sip_outbound_publish_client * client
Outbound publish client.
Outbound publish information.
struct ast_sip_auth_vector outbound_auths
Configured authentication credentials.
SORCERY_OBJECT(details)
Sorcery object details.
unsigned int expiration
Requested expiration time.
const ast_string_field transport
const ast_string_field outbound_proxy
const ast_string_field server_uri
unsigned int multi_user
The publishing client is used for multiple users when true.
const ast_string_field from_uri
const ast_string_field event
const ast_string_field to_uri
unsigned int max_auth_attempts
Maximum number of auth attempts before stopping the publish client.
Full structure for sorcery.
A ast_taskprocessor structure is a singleton by name.
Structure for variables, used for configurations and for channel variables.
Queued outbound publish message.
struct ast_sip_body body
Optional body.
char body_contents[0]
Extra space for body contents.
struct sip_outbound_publish_message::@460 entry
Linked list information.
char * from_uri
The From URI for this specific publisher.
char user[0]
User, if any, associated with the publisher.
pjsip_publishc * client
Underlying publish client.
struct ast_sip_outbound_publish_client * owner
The client object that 'owns' this client.
unsigned int auth_attempts
The number of auth attempts done.
struct sip_outbound_publish_message * sending
The message currently being sent.
unsigned int destroy
Publish client should be destroyed.
struct ast_taskprocessor * serializer
Serializer for stuff and things.
char * to_uri
The To URI for this specific publisher.
pj_timer_entry timer
Timer entry for refreshing publish.
struct sip_outbound_publisher::@461 queue
Queue of outgoing publish messages to send.
structure to hold users read from users.conf
An API for managing task processing threads that can be shared across modules.
void * ast_taskprocessor_unreference(struct ast_taskprocessor *tps)
Unreference the specified taskprocessor and its reference count will decrement.
void ast_taskprocessor_build_name(char *buf, unsigned int size, const char *format,...)
Build a taskprocessor name with a sequence number on the end.
#define AST_TASKPROCESSOR_MAX_NAME
Suggested maximum taskprocessor name length (less null terminator).
static void handler(const char *name, int response_code, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
int ast_serializer_shutdown_group_join(struct ast_serializer_shutdown_group *shutdown_group, int timeout)
Wait for the serializers in the group to shutdown with timeout.
struct ast_serializer_shutdown_group * ast_serializer_shutdown_group_alloc(void)
Create a serializer group shutdown control object.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
char * ast_uuid_generate_str(char *buf, size_t size)
Generate a UUID string.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.