From 1a176937898ad54eab130b719f7dc20eb0df5b85 Mon Sep 17 00:00:00 2001 From: Matthew Jordan Date: Tue, 27 Jan 2015 17:10:21 +0000 Subject: app_confbridge: Restore user's menu name to CLI output of 'confbridge list' When issuing a 'confbridge list XXXX' CLI command, the resulting output no longer displays the menu associated with a ConfBridge participant. The issue was caused by ASTERISK-22760. When that patch was done, it removed the copying of the menu name associated with the user from the actual user profile. This patch fixes the issue by copying the menu name over to the user profile when the menu hooks are applied to the user. Since that function now does a little bit more than just apply the hooks, the name of the function has been changed to cover the copying of the menu name over as well. In addition, there is a disparity between the menu name length as it is stored on the conf_menu structure and the confbridge_user structure; this patch makes the lengths match so that a strcpy can be used. Review: https://reviewboard.asterisk.org/r/4372/ ASTERISK-24723 #close Reported by: Steve Pitts git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431134 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/confbridge/conf_config_parser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apps/confbridge/conf_config_parser.c') diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c index 2f6011056..af5dfcea9 100644 --- a/apps/confbridge/conf_config_parser.c +++ b/apps/confbridge/conf_config_parser.c @@ -2277,7 +2277,7 @@ int conf_find_menu_entry_by_sequence(const char *dtmf_sequence, struct conf_menu return 0; } -static int apply_menu_hooks(struct confbridge_user *user, struct conf_menu *menu) +static int apply_menu_to_user(struct confbridge_user *user, struct conf_menu *menu) { struct conf_menu_entry *menu_entry; @@ -2301,6 +2301,7 @@ static int apply_menu_hooks(struct confbridge_user *user, struct conf_menu *menu menu_hook_destroy(pvt); } } + strcpy(user->menu_name, menu->name); /* Safe */ return 0; } @@ -2322,7 +2323,7 @@ int conf_set_menu_to_user(struct ast_channel *chan, struct confbridge_user *user b_data = datastore->data; if (b_data->m_usable) { menu = ao2_bump(b_data->menu); - return apply_menu_hooks(user, menu); + return apply_menu_to_user(user, menu); } } } @@ -2340,7 +2341,7 @@ int conf_set_menu_to_user(struct ast_channel *chan, struct confbridge_user *user return -1; } - return apply_menu_hooks(user, menu); + return apply_menu_to_user(user, menu); } void conf_destroy_config(void) -- cgit v1.2.3