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
This commit is contained in:
Scott Griepentrog
2014-03-07 21:11:49 +00:00
parent 4ad1245cb5
commit feae552139
3 changed files with 46 additions and 8 deletions

View File

@@ -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) {