mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
Merge "config: fix flags in uint option handler" into 13
This commit is contained in:
@@ -739,7 +739,7 @@ static int load_module(void)
|
||||
|
||||
/* Level options */
|
||||
aco_option_register(&cfg_info, "max_number", ACO_EXACT, level_options, NULL, OPT_UINT_T, 0, FLDSET(struct skel_level, max_num));
|
||||
aco_option_register(&cfg_info, "max_guesses", ACO_EXACT, level_options, NULL, OPT_UINT_T, 1, FLDSET(struct skel_level, max_guesses));
|
||||
aco_option_register(&cfg_info, "max_guesses", ACO_EXACT, level_options, NULL, OPT_UINT_T, 0, FLDSET(struct skel_level, max_guesses));
|
||||
|
||||
if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
|
||||
goto error;
|
||||
|
@@ -1346,7 +1346,7 @@ static int int_handler_fn(const struct aco_option *opt, struct ast_variable *var
|
||||
*/
|
||||
static int uint_handler_fn(const struct aco_option *opt, struct ast_variable *var, void *obj) {
|
||||
unsigned int *field = (unsigned int *)(obj + opt->args[0]);
|
||||
unsigned int flags = PARSE_INT32 | opt->flags;
|
||||
unsigned int flags = PARSE_UINT32 | opt->flags;
|
||||
int res = 0;
|
||||
if (opt->flags & PARSE_IN_RANGE) {
|
||||
res = opt->flags & PARSE_DEFAULT ?
|
||||
|
@@ -1038,14 +1038,14 @@ int ast_sip_initialize_sorcery_qualify(void)
|
||||
|
||||
snprintf(status_value_unknown, sizeof(status_value_unknown), "%u", UNKNOWN);
|
||||
ast_sorcery_object_field_register_nodoc(sorcery, CONTACT_STATUS, "last_status",
|
||||
status_value_unknown, OPT_UINT_T, 1, FLDSET(struct ast_sip_contact_status, last_status));
|
||||
status_value_unknown, OPT_UINT_T, 0, FLDSET(struct ast_sip_contact_status, last_status));
|
||||
snprintf(status_value_created, sizeof(status_value_created), "%u", CREATED);
|
||||
ast_sorcery_object_field_register_nodoc(sorcery, CONTACT_STATUS, "status",
|
||||
status_value_created, OPT_UINT_T, 1, FLDSET(struct ast_sip_contact_status, status));
|
||||
status_value_created, OPT_UINT_T, 0, FLDSET(struct ast_sip_contact_status, status));
|
||||
ast_sorcery_object_field_register_custom_nodoc(sorcery, CONTACT_STATUS, "rtt_start",
|
||||
"0.0", rtt_start_handler, rtt_start_to_str, NULL, 0, 0);
|
||||
ast_sorcery_object_field_register_nodoc(sorcery, CONTACT_STATUS, "rtt",
|
||||
"0", OPT_UINT_T, 1, FLDSET(struct ast_sip_contact_status, rtt));
|
||||
"0", OPT_UINT_T, 0, FLDSET(struct ast_sip_contact_status, rtt));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user