Author: mjordan
Date: Tue Jan 27 11:18:46 2015
New Revision: 431140

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=431140
Log:
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
........

Merged revisions 431134 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    certified/branches/13.1/   (props changed)
    certified/branches/13.1/apps/confbridge/conf_config_parser.c
    certified/branches/13.1/apps/confbridge/include/confbridge.h

Propchange: certified/branches/13.1/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: certified/branches/13.1/apps/confbridge/conf_config_parser.c
URL: 
http://svnview.digium.com/svn/asterisk/certified/branches/13.1/apps/confbridge/conf_config_parser.c?view=diff&rev=431140&r1=431139&r2=431140
==============================================================================
--- certified/branches/13.1/apps/confbridge/conf_config_parser.c (original)
+++ certified/branches/13.1/apps/confbridge/conf_config_parser.c Tue Jan 27 
11:18:46 2015
@@ -2277,7 +2277,7 @@
        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 @@
                        menu_hook_destroy(pvt);
                }
        }
+       strcpy(user->menu_name, menu->name); /* Safe */
 
        return 0;
 }
@@ -2322,7 +2323,7 @@
                        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 @@
                return -1;
        }
 
-       return apply_menu_hooks(user, menu);
+       return apply_menu_to_user(user, menu);
 }
 
 void conf_destroy_config(void)

Modified: certified/branches/13.1/apps/confbridge/include/confbridge.h
URL: 
http://svnview.digium.com/svn/asterisk/certified/branches/13.1/apps/confbridge/include/confbridge.h?view=diff&rev=431140&r1=431139&r2=431140
==============================================================================
--- certified/branches/13.1/apps/confbridge/include/confbridge.h (original)
+++ certified/branches/13.1/apps/confbridge/include/confbridge.h Tue Jan 27 
11:18:46 2015
@@ -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"
@@ -123,12 +125,12 @@
  * 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];
@@ -195,7 +197,7 @@
 };
 
 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];
        unsigned int flags;
@@ -239,7 +241,7 @@
        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 */


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to