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_IGNORE_URI_USER_OPTIONS 0 52 #define DEFAULT_USE_CALLERID_CONTACT 0 53 #define DEFAULT_SEND_CONTACT_STATUS_ON_UPDATE_REGISTRATION 0 54 #define DEFAULT_TASKPROCESSOR_OVERLOAD_TRIGGER TASKPROCESSOR_OVERLOAD_TRIGGER_GLOBAL 55 #define DEFAULT_NOREFERSUB 1 149 char *current =
NULL;
188 "Global option 'debug' can't be empty. Set it to a valid value or remove the entry to accept 'no' as the default\n");
194 "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");
198 snprintf(max_forwards,
sizeof(max_forwards),
"%u", cfg->
max_forwards);
296 unsigned int interval;
311 unsigned int interval;
355 unsigned int *prune_interval)
526 if (!strcasecmp(var->
value,
"none")) {
528 }
else if (!strcasecmp(var->
value,
"global")) {
530 }
else if (!strcasecmp(var->
value,
"pjsip_only")) {
575 if (strcmp(object_type,
"global")) {
590 "At most one pjsip.conf type=global object can be defined. You have %d defined.\n",
599 ast_debug(1,
"No pjsip.conf type=global object exists so applying defaults.\n");
654 ast_sorcery_apply_default(sorcery,
"global",
"config",
"pjsip.conf,criteria=type=global,single_object=yes,explicit_name=global");
struct ast_str * output_buffer
char * ast_sip_get_endpoint_identifier_order(void)
Retrieve the global endpoint_identifier_order setting.
unsigned int send_contact_status_on_update_registration
int sip_cli_print_global(struct ast_sip_cli_context *context)
#define ARRAY_IN_BOUNDS(v, a)
Checks to see if value is within the bounds of the given array.
static char * previous_regcontext
Asterisk main include file. File version handling, generic pbx functions.
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define DEFAULT_MWI_TPS_QUEUE_HIGH
unsigned int contact_expiration_check_interval
static AO2_GLOBAL_OBJ_STATIC(global_cfg)
Cached global config object.
#define DEFAULT_UNIDENTIFIED_REQUEST_PRUNE_INTERVAL
Asterisk version information.
int ast_sip_get_mwi_tps_queue_low(void)
Retrieve the global MWI taskprocessor low water clear alert level.
int ast_sorcery_instance_observer_add(struct ast_sorcery *sorcery, const struct ast_sorcery_instance_observer *callbacks)
Add an observer to a sorcery instance.
#define DEFAULT_ENDPOINT_IDENTIFIER_ORDER
char * ast_sip_get_debug(void)
Retrieve the system debug setting (yes|no|host).
void ast_sip_get_unidentified_request_thresholds(unsigned int *count, unsigned int *period, unsigned int *prune_interval)
Retrieve the unidentified request security event thresholds.
unsigned int disable_multi_domain
const char * ast_get_version(void)
Retrieve the Asterisk version string.
#define ao2_t_global_obj_replace_unref(holder, obj, tag)
Replace an ao2 object in the global holder, throwing away any old object.
#define DEFAULT_CONTACT_EXPIRATION_CHECK_INTERVAL
enum ast_sip_taskprocessor_overload_trigger ast_sip_get_taskprocessor_overload_trigger(void)
#define DEFAULT_MWI_TPS_QUEUE_LOW
Structure for variables, used for configurations and for channel variables.
unsigned int keep_alive_interval
Perform no matching, return all objects.
static const struct ast_sorcery_instance_observer observer_callbacks_global
unsigned int ast_sip_get_mwi_tps_queue_high(void)
Retrieve the global MWI taskprocessor high water alert trigger level.
Full structure for sorcery.
Type for a default handler that should do nothing.
#define ao2_t_global_obj_release(holder, tag)
Release the ao2 object held in the global holder.
static int overload_trigger_to_str(const void *obj, const intptr_t *args, char **buf)
#define DEFAULT_NOREFERSUB
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define DEFAULT_MAX_INITIAL_QUALIFY_TIME
#define ao2_global_obj_ref(holder)
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
Return all matching objects.
const ast_string_field endpoint_identifier_order
unsigned int unidentified_request_prune_interval
#define ast_strdup(str)
A wrapper for strdup()
static int check_regcontext(const struct global_config *cfg)
int ast_sip_add_global_request_header(const char *name, const char *value, int replace)
enum ast_sip_taskprocessor_overload_trigger overload_trigger
static void global_loaded_observer(const char *name, const struct ast_sorcery *sorcery, const char *object_type, int reloaded)
unsigned int ast_sip_get_use_callerid_contact(void)
Retrieve the global setting 'use_callerid_contact'.
const ast_string_field useragent
const ast_string_field debug
unsigned int ast_sip_get_contact_expiration_check_interval(void)
Retrieve the system contact expiration check interval setting.
const ast_string_field default_realm
int ast_context_destroy_by_name(const char *context, const char *registrar)
Destroy a context by name.
#define ast_strlen_zero(foo)
unsigned int unidentified_request_count
Type for default option handler for bools (ast_true/ast_false)
unsigned int ast_sip_get_norefersub(void)
Retrieve the global setting 'norefersub'.
const ast_string_field default_voicemail_extension
unsigned int ast_sip_get_keep_alive_interval(void)
Retrieve the system keep alive interval setting.
unsigned int ast_sip_get_max_initial_qualify_time(void)
Retrieve the system max initial qualify time.
#define ast_debug(level,...)
Log a DEBUG message.
#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.
#define DEFAULT_KEEPALIVE_INTERVAL
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
#define DEFAULT_REGCONTEXT
static void * global_alloc(const char *name)
struct global_config::@477 mwi
Type for default option handler for unsigned integers.
#define DEFAULT_UNIDENTIFIED_REQUEST_COUNT
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
Interface for the sorcery instance observer.
#define DEFAULT_VOICEMAIL_EXTENSION
#define AST_STRING_FIELD(name)
Declare a string field.
#define ao2_ref(o, delta)
char * ast_sip_global_default_outbound_endpoint(void)
static struct console_pvt globals
#define ast_sorcery_object_register(sorcery, type, alloc, transform, apply)
Register an object type.
Core PBX routines and definitions.
void ast_sorcery_instance_observer_remove(struct ast_sorcery *sorcery, const struct ast_sorcery_instance_observer *callbacks)
Remove an observer from a sorcery instance.
int ast_sip_add_global_response_header(const char *name, const char *value, int replace)
#define DEFAULT_USE_CALLERID_CONTACT
unsigned int max_forwards
static char default_useragent[256]
void ast_sip_get_default_realm(char *realm, size_t size)
Retrieve the global default realm.
static const char * overload_trigger_map[]
unsigned int ast_sip_get_mwi_disable_initial_unsolicited(void)
Retrieve the global setting 'disable sending unsolicited mwi on startup'.
Type for default option handler for bools (ast_true/ast_false)
Channel datastore data for max forwards.
#define ast_sorcery_apply_default(sorcery, type, name, data)
#define DEFAULT_FROM_USER
static int overload_trigger_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
const ast_string_field regcontext
char * ast_sip_get_default_voicemail_extension(void)
Retrieve the default voicemail extension.
void * ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, const char *id)
Allocate an object.
unsigned int use_callerid_contact
int ast_sip_destroy_sorcery_global(void)
#define DEFAULT_DISABLE_MULTI_DOMAIN
char * ast_sip_get_regcontext(void)
Retrieve the global regcontext setting.
#define DEFAULT_USERAGENT_PREFIX
#define STRFLDSET(type,...)
Convert a struct and a list of stringfield fields to an argument list of field offsets.
An API for managing task processing threads that can be shared across modules.
unsigned int ast_sip_get_disable_multi_domain(void)
Retrieve the system setting 'disable multi domain'.
void ast_sip_get_default_from_user(char *from_user, size_t size)
Retrieve the global default from user.
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_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object.
unsigned int ast_sip_get_ignore_uri_user_options(void)
Retrieve the global setting 'ignore_uri_user_options'.
#define DEFAULT_MWI_DISABLE_INITIAL_UNSOLICITED
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.
#define DEFAULT_IGNORE_URI_USER_OPTIONS
const char * ast_sip_overload_trigger_to_str(enum ast_sip_taskprocessor_overload_trigger trigger)
unsigned int ignore_uri_user_options
static struct ast_sorcery * sorcery
#define DEFAULT_MAX_FORWARDS
unsigned int disable_initial_unsolicited
struct ast_sorcery * ast_sip_get_sorcery(void)
Get a pointer to the SIP sorcery structure.
#define DEFAULT_UNIDENTIFIED_REQUEST_PERIOD
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static struct global_config * get_global_cfg(void)
static int global_apply(const struct ast_sorcery *sorcery, void *obj)
unsigned int ast_sip_get_send_contact_status_on_update_registration(void)
Retrieve the global setting 'send_contact_status_on_update_registration'.
int ast_sip_initialize_sorcery_global(void)
Type for default option handler for stringfields.
unsigned int unidentified_request_period
#define DEFAULT_SEND_CONTACT_STATUS_ON_UPDATE_REGISTRATION
unsigned int max_initial_qualify_time
const ast_string_field default_from_user
static char context[AST_MAX_CONTEXT]
void * ast_sorcery_generic_alloc(size_t size, ao2_destructor_fn destructor)
Allocate a generic sorcery capable object.
int ast_sip_persistent_endpoint_add_to_regcontext(const char *regcontext)
#define DEFAULT_TASKPROCESSOR_OVERLOAD_TRIGGER
Type for default option handler for signed integers.
int ast_sip_cli_print_sorcery_objectset(void *obj, void *arg, int flags)
Prints a sorcery object's ast_variable list.
const ast_string_field default_outbound_endpoint
#define DEFAULT_OUTBOUND_ENDPOINT
ast_sip_taskprocessor_overload_trigger
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
unsigned int tps_queue_high
static void global_destructor(void *obj)
Sorcery Data Access Layer API.