diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c index ffb24a53cf..41cc6c5c49 100644 --- a/apps/confbridge/conf_config_parser.c +++ b/apps/confbridge/conf_config_parser.c @@ -2312,7 +2312,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; @@ -2336,6 +2336,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; } @@ -2357,7 +2358,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); } } } @@ -2375,7 +2376,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) diff --git a/apps/confbridge/include/confbridge.h b/apps/confbridge/include/confbridge.h index 3b62ea1d87..5488065ca8 100644 --- a/apps/confbridge/include/confbridge.h +++ b/apps/confbridge/include/confbridge.h @@ -34,6 +34,8 @@ #define MAX_CONF_NAME AST_MAX_EXTENSION /* Maximum length of a conference pin */ #define MAX_PIN 80 +/* Maximum length of bridge/user/menu profile names */ +#define MAX_PROFILE_NAME 128 #define DEFAULT_USER_PROFILE "default_user" #define DEFAULT_BRIDGE_PROFILE "default_bridge" @@ -124,12 +126,12 @@ struct conf_menu_entry { * of DTMF sequences coupled with the actions those * sequences invoke.*/ struct conf_menu { - char name[128]; + char name[MAX_PROFILE_NAME]; AST_LIST_HEAD_NOLOCK(, conf_menu_entry) entries; }; struct user_profile { - char name[128]; + char name[MAX_PROFILE_NAME]; char pin[MAX_PIN]; char moh_class[128]; char announcement[PATH_MAX]; @@ -196,7 +198,7 @@ struct bridge_profile_sounds { }; struct bridge_profile { - char name[64]; + char name[MAX_PROFILE_NAME]; char language[MAX_LANGUAGE]; /*!< Language used for playback_chan */ char rec_file[PATH_MAX]; char rec_options[128]; @@ -242,7 +244,7 @@ struct confbridge_user { struct confbridge_conference *conference; /*!< Conference bridge they are participating in */ struct bridge_profile b_profile; /*!< The Bridge Configuration Profile */ struct user_profile u_profile; /*!< The User Configuration Profile */ - char menu_name[64]; /*!< The name of the DTMF menu assigned to this user */ + char menu_name[MAX_PROFILE_NAME]; /*!< The name of the DTMF menu assigned to this user */ char name_rec_location[PATH_MAX]; /*!< Location of the User's name recorded file if it exists */ struct ast_channel *chan; /*!< Asterisk channel participating */ struct ast_bridge_features features; /*!< Bridge features structure */