32#define DEFAULT_MAX_FORWARDS 70
33#define DEFAULT_KEEPALIVE_INTERVAL 90
34#define DEFAULT_USERAGENT_PREFIX "Asterisk PBX"
35#define DEFAULT_OUTBOUND_ENDPOINT "default_outbound_endpoint"
36#define DEFAULT_DEBUG "no"
37#define DEFAULT_ENDPOINT_IDENTIFIER_ORDER "ip,username,anonymous"
38#define DEFAULT_MAX_INITIAL_QUALIFY_TIME 0
39#define DEFAULT_FROM_USER "asterisk"
40#define DEFAULT_REALM "asterisk"
41#define DEFAULT_REGCONTEXT ""
42#define DEFAULT_CONTACT_EXPIRATION_CHECK_INTERVAL 30
43#define DEFAULT_DISABLE_MULTI_DOMAIN 0
44#define DEFAULT_VOICEMAIL_EXTENSION ""
45#define DEFAULT_UNIDENTIFIED_REQUEST_COUNT 5
46#define DEFAULT_UNIDENTIFIED_REQUEST_PERIOD 5
47#define DEFAULT_UNIDENTIFIED_REQUEST_PRUNE_INTERVAL 30
48#define DEFAULT_MWI_TPS_QUEUE_HIGH AST_TASKPROCESSOR_HIGH_WATER_LEVEL
49#define DEFAULT_MWI_TPS_QUEUE_LOW -1
50#define DEFAULT_MWI_DISABLE_INITIAL_UNSOLICITED 0
51#define DEFAULT_ALLOW_SENDING_180_AFTER_183 0
52#define DEFAULT_IGNORE_URI_USER_OPTIONS 0
53#define DEFAULT_USE_CALLERID_CONTACT 0
54#define DEFAULT_SEND_CONTACT_STATUS_ON_UPDATE_REGISTRATION 0
55#define DEFAULT_TASKPROCESSOR_OVERLOAD_TRIGGER TASKPROCESSOR_OVERLOAD_TRIGGER_GLOBAL
56#define DEFAULT_NOREFERSUB 1
57#define DEFAULT_ALL_CODECS_ON_EMPTY_REINVITE 0
194 "Global option 'debug' can't be empty. Set it to a valid value or remove the entry to accept 'no' as the default\n");
200 "Global option 'default_from_user' can't be empty. Set it to a valid value or remove the entry to accept 'asterisk' as the default\n");
302 unsigned int interval;
317 unsigned int interval;
361 unsigned int *prune_interval)
562 if (!strcasecmp(
var->value,
"none")) {
564 }
else if (!strcasecmp(
var->value,
"global")) {
566 }
else if (!strcasecmp(
var->value,
"pjsip_only")) {
609 if (strcmp(object_type,
"global")) {
624 "At most one pjsip.conf type=global object can be defined. You have %d defined.\n",
633 ast_debug(1,
"No pjsip.conf type=global object exists so applying defaults.\n");
Asterisk version information.
const char * ast_get_version(void)
Retrieve the Asterisk version string.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
#define ao2_t_global_obj_replace_unref(holder, obj, tag)
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define ao2_global_obj_ref(holder)
Get a reference to the object stored in the global holder.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_t_global_obj_release(holder, tag)
static struct console_pvt globals
static char regcontext[AST_MAX_CONTEXT]
unsigned int ast_sip_get_norefersub(void)
Retrieve the global setting 'norefersub'.
unsigned int ast_sip_get_max_initial_qualify_time(void)
Retrieve the system max initial qualify time.
unsigned int ast_sip_get_keep_alive_interval(void)
Retrieve the system keep alive interval setting.
#define DEFAULT_FROM_USER
static void global_loaded_observer(const char *name, const struct ast_sorcery *sorcery, const char *object_type, int reloaded)
unsigned int ast_sip_get_allow_sending_180_after_183(void)
Retrieve the global setting 'allow_sending_180_after_183'.
static void global_destructor(void *obj)
char * ast_sip_get_endpoint_identifier_order(void)
Retrieve the global endpoint_identifier_order setting.
static int overload_trigger_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
#define DEFAULT_NOREFERSUB
static void * global_alloc(const char *name)
static AO2_GLOBAL_OBJ_STATIC(global_cfg)
Cached global config object.
static char default_useragent[256]
int ast_sip_destroy_sorcery_global(void)
#define DEFAULT_UNIDENTIFIED_REQUEST_COUNT
#define DEFAULT_USERAGENT_PREFIX
#define DEFAULT_CONTACT_EXPIRATION_CHECK_INTERVAL
static const char * overload_trigger_map[]
static int check_regcontext(const struct global_config *cfg)
int ast_sip_initialize_sorcery_global(void)
char * ast_sip_global_default_outbound_endpoint(void)
enum ast_sip_taskprocessor_overload_trigger ast_sip_get_taskprocessor_overload_trigger(void)
#define DEFAULT_SEND_CONTACT_STATUS_ON_UPDATE_REGISTRATION
#define DEFAULT_MAX_FORWARDS
#define DEFAULT_MAX_INITIAL_QUALIFY_TIME
#define DEFAULT_VOICEMAIL_EXTENSION
static const struct ast_sorcery_instance_observer observer_callbacks_global
unsigned int ast_sip_get_send_contact_status_on_update_registration(void)
Retrieve the global setting 'send_contact_status_on_update_registration'.
static struct global_config * get_global_cfg(void)
static char * previous_regcontext
#define DEFAULT_DISABLE_MULTI_DOMAIN
unsigned int ast_sip_get_use_callerid_contact(void)
Retrieve the global setting 'use_callerid_contact'.
char * ast_sip_get_default_voicemail_extension(void)
Retrieve the default voicemail extension.
unsigned int ast_sip_get_contact_expiration_check_interval(void)
Retrieve the system contact expiration check interval setting.
#define DEFAULT_MWI_DISABLE_INITIAL_UNSOLICITED
#define DEFAULT_UNIDENTIFIED_REQUEST_PRUNE_INTERVAL
void ast_sip_get_default_realm(char *realm, size_t size)
Retrieve the global default realm.
unsigned int ast_sip_get_disable_multi_domain(void)
Retrieve the system setting 'disable multi domain'.
static int overload_trigger_to_str(const void *obj, const intptr_t *args, char **buf)
unsigned int ast_sip_get_ignore_uri_user_options(void)
Retrieve the global setting 'ignore_uri_user_options'.
#define DEFAULT_ALL_CODECS_ON_EMPTY_REINVITE
const char * ast_sip_overload_trigger_to_str(enum ast_sip_taskprocessor_overload_trigger trigger)
#define DEFAULT_ALLOW_SENDING_180_AFTER_183
#define DEFAULT_TASKPROCESSOR_OVERLOAD_TRIGGER
#define DEFAULT_ENDPOINT_IDENTIFIER_ORDER
#define DEFAULT_REGCONTEXT
unsigned int ast_sip_get_mwi_disable_initial_unsolicited(void)
Retrieve the global setting 'disable sending unsolicited mwi on startup'.
int ast_sip_get_mwi_tps_queue_low(void)
Retrieve the global MWI taskprocessor low water clear alert level.
#define DEFAULT_USE_CALLERID_CONTACT
#define DEFAULT_OUTBOUND_ENDPOINT
#define DEFAULT_IGNORE_URI_USER_OPTIONS
char * ast_sip_get_regcontext(void)
Retrieve the global regcontext setting.
#define DEFAULT_MWI_TPS_QUEUE_HIGH
#define DEFAULT_UNIDENTIFIED_REQUEST_PERIOD
void ast_sip_get_default_from_user(char *from_user, size_t size)
Retrieve the global default from user.
unsigned int ast_sip_get_mwi_tps_queue_high(void)
Retrieve the global MWI taskprocessor high water alert trigger level.
unsigned int ast_sip_get_all_codecs_on_empty_reinvite(void)
Retrieve the system setting 'all_codecs_on_empty_reinvite'.
#define DEFAULT_KEEPALIVE_INTERVAL
static int global_apply(const struct ast_sorcery *sorcery, void *obj)
int sip_cli_print_global(struct ast_sip_cli_context *context)
void ast_sip_get_unidentified_request_thresholds(unsigned int *count, unsigned int *period, unsigned int *prune_interval)
Retrieve the unidentified request security event thresholds.
char * ast_sip_get_debug(void)
Retrieve the system debug setting (yes|no|host).
#define DEFAULT_MWI_TPS_QUEUE_LOW
#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_YESNO_T
Type for default option handler for bools (ast_true/ast_false)
@ OPT_INT_T
Type for default option handler for signed integers.
@ OPT_STRINGFIELD_T
Type for default option handler for stringfields.
#define ast_debug(level,...)
Log a DEBUG message.
Core PBX routines and definitions.
int ast_context_destroy_by_name(const char *context, const char *registrar)
Destroy a context by name.
int ast_sip_add_global_request_header(const char *name, const char *value, int replace)
int ast_sip_add_global_response_header(const char *name, const char *value, int replace)
struct ast_sorcery * ast_sip_get_sorcery(void)
Get a pointer to the SIP sorcery structure.
static char default_realm[AST_SIP_AUTH_MAX_REALM_LENGTH+1]
int ast_sip_cli_print_sorcery_objectset(void *obj, void *arg, int flags)
Prints a sorcery object's ast_variable list.
static char * default_voicemail_extension
static struct ast_sorcery * sorcery
ast_sip_taskprocessor_overload_trigger
@ TASKPROCESSOR_OVERLOAD_TRIGGER_GLOBAL
@ TASKPROCESSOR_OVERLOAD_TRIGGER_PJSIP_ONLY
@ TASKPROCESSOR_OVERLOAD_TRIGGER_NONE
int ast_sip_persistent_endpoint_add_to_regcontext(const char *regcontext)
static int debug
Global debug status.
Sorcery Data Access Layer API.
void ast_sorcery_instance_observer_remove(struct ast_sorcery *sorcery, const struct ast_sorcery_instance_observer *callbacks)
Remove an observer from a sorcery instance.
@ 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.
#define ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object.
void * ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, const char *id)
Allocate an object.
#define ast_sorcery_apply_default(sorcery, type, name, data)
int ast_sorcery_instance_observer_add(struct ast_sorcery *sorcery, const struct ast_sorcery_instance_observer *callbacks)
Add an observer to a sorcery instance.
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
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic 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.
CLI Formatter Context passed to all formatters.
Interface for the sorcery instance observer.
void(* object_type_loaded)(const char *name, const struct ast_sorcery *sorcery, const char *object_type, int reloaded)
Callback after any object_type is loaded/reloaded.
Full structure for sorcery.
Structure for variables, used for configurations and for channel variables.
const ast_string_field default_outbound_endpoint
unsigned int tps_queue_high
unsigned int send_contact_status_on_update_registration
unsigned int max_initial_qualify_time
unsigned int keep_alive_interval
enum ast_sip_taskprocessor_overload_trigger overload_trigger
const ast_string_field regcontext
unsigned int unidentified_request_prune_interval
const ast_string_field useragent
const ast_string_field default_from_user
unsigned int use_callerid_contact
unsigned int max_forwards
unsigned int disable_multi_domain
unsigned int disable_initial_unsolicited
const ast_string_field default_voicemail_extension
unsigned int ignore_uri_user_options
unsigned int all_codecs_on_empty_reinvite
unsigned int contact_expiration_check_interval
unsigned int allow_sending_180_after_183
unsigned int unidentified_request_count
const ast_string_field endpoint_identifier_order
struct global_config::@451 mwi
const ast_string_field default_realm
const ast_string_field debug
unsigned int unidentified_request_period
Channel datastore data for max forwards.
An API for managing task processing threads that can be shared across modules.
#define ARRAY_IN_BOUNDS(v, a)
Checks to see if value is within the bounds of the given array.