app_confbridge.c: Replace inlined code with existing function.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 25 Jan 2016 23:34:20 +0000 (17:34 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 27 Jan 2016 22:46:20 +0000 (16:46 -0600)
Change-Id: Ida5594e9f8d7c1fc18eeb733a11f8fb96326da51

apps/app_confbridge.c

index 18e192c..97c73bd 100644 (file)
@@ -1089,6 +1089,31 @@ void conf_update_user_mute(struct confbridge_user *user)
                ast_channel_name(user->chan));
 }
 
+/*
+ * \internal
+ * \brief Mute/unmute a single user.
+ */
+static void generic_mute_unmute_user(struct confbridge_conference *conference, struct confbridge_user *user, int mute)
+{
+       /* Set user level mute request. */
+       user->muted = mute ? 1 : 0;
+
+       conf_update_user_mute(user);
+       ast_test_suite_event_notify("CONF_MUTE",
+               "Message: participant %s %s\r\n"
+               "Conference: %s\r\n"
+               "Channel: %s",
+               ast_channel_name(user->chan),
+               mute ? "muted" : "unmuted",
+               conference->b_profile.name,
+               ast_channel_name(user->chan));
+       if (mute) {
+               send_mute_event(user, conference);
+       } else {
+               send_unmute_event(user, conference);
+       }
+}
+
 void conf_moh_stop(struct confbridge_user *user)
 {
        user->playing_moh = 0;
@@ -1925,22 +1950,7 @@ static int action_toggle_mute(struct confbridge_conference *conference,
 
        /* Toggle user level mute request. */
        mute = !user->muted;
-       user->muted = mute;
-
-       conf_update_user_mute(user);
-       ast_test_suite_event_notify("CONF_MUTE",
-               "Message: participant %s %s\r\n"
-               "Conference: %s\r\n"
-               "Channel: %s",
-               ast_channel_name(user->chan),
-               mute ? "muted" : "unmuted",
-               user->b_profile.name,
-               ast_channel_name(user->chan));
-       if (mute) {
-               send_mute_event(user, conference);
-       } else {
-               send_unmute_event(user, conference);
-       }
+       generic_mute_unmute_user(conference, user, mute);
 
        return play_file(bridge_channel, NULL, (mute ?
                conf_get_sound(CONF_SOUND_MUTED, user->b_profile.sounds) :
@@ -2555,30 +2565,6 @@ static int generic_lock_unlock_helper(int lock, const char *conference_name)
 }
 
 /* \internal
- * \brief Mute/unmute a single user.
- */
-static void generic_mute_unmute_user(struct confbridge_conference *conference, struct confbridge_user *user, int mute)
-{
-       /* Set user level mute request. */
-       user->muted = mute ? 1 : 0;
-
-       conf_update_user_mute(user);
-       ast_test_suite_event_notify("CONF_MUTE",
-               "Message: participant %s %s\r\n"
-               "Conference: %s\r\n"
-               "Channel: %s",
-               ast_channel_name(user->chan),
-               mute ? "muted" : "unmuted",
-               conference->b_profile.name,
-               ast_channel_name(user->chan));
-       if (mute) {
-               send_mute_event(user, conference);
-       } else {
-               send_unmute_event(user, conference);
-       }
-}
-
-/* \internal
  * \brief finds a conference user by channel name and mutes/unmutes them.
  *
  * \retval 0 success