summaryrefslogtreecommitdiff
path: root/main/sorcery.c
diff options
context:
space:
mode:
authorScott Griepentrog <sgriepentrog@digium.com>2014-03-07 21:11:49 +0000
committerScott Griepentrog <sgriepentrog@digium.com>2014-03-07 21:11:49 +0000
commitfeae552139d2617117d1c5c5a80d36b60e6e86fc (patch)
treee10920e7a6e8878cb54b6b95223b9d9930653bfb /main/sorcery.c
parent4ad1245cb5fd9ea0f54c866448ad5c18bcb84fa5 (diff)
pjsip: allow and disallow show same codecs
In order to prevent confusion over the allow and disallow list of codecs being the same an option for registering a field as an alias is added. The alias field will be read from the configuration file, but afterwards is not listed as a known field. With disallow set as an alias, the CLI command pjsip show endpoint # will list the allow= field, but not the disallow field. (closes issue ASTERISK-23092) Review: https://reviewboard.asterisk.org/r/3193/ ........ Merged revisions 410190 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/sorcery.c')
-rw-r--r--main/sorcery.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/sorcery.c b/main/sorcery.c
index cb24cae30..1d0aec757 100644
--- a/main/sorcery.c
+++ b/main/sorcery.c
@@ -811,7 +811,7 @@ int ast_sorcery_object_fields_register(struct ast_sorcery *sorcery, const char *
}
int __ast_sorcery_object_field_register(struct ast_sorcery *sorcery, const char *type, const char *name, const char *default_val, enum aco_option_type opt_type,
- aco_option_handler config_handler, sorcery_field_handler sorcery_handler, sorcery_fields_handler multiple_handler, unsigned int flags, unsigned int no_doc, size_t argc, ...)
+ aco_option_handler config_handler, sorcery_field_handler sorcery_handler, sorcery_fields_handler multiple_handler, unsigned int flags, unsigned int no_doc, unsigned int alias, size_t argc, ...)
{
RAII_VAR(struct ast_sorcery_object_type *, object_type, ao2_find(sorcery->types, type, OBJ_KEY), ao2_cleanup);
RAII_VAR(struct ast_sorcery_object_field *, object_field, NULL, ao2_cleanup);
@@ -840,7 +840,9 @@ int __ast_sorcery_object_field_register(struct ast_sorcery *sorcery, const char
}
va_end(args);
- ao2_link(object_type->fields, object_field);
+ if (!alias) {
+ ao2_link(object_type->fields, object_field);
+ }
/* TODO: Improve this hack */
if (!argc) {