From feae552139d2617117d1c5c5a80d36b60e6e86fc Mon Sep 17 00:00:00 2001 From: Scott Griepentrog Date: Fri, 7 Mar 2014 21:11:49 +0000 Subject: 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 --- main/sorcery.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main/sorcery.c') 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) { -- cgit v1.2.3