Fix options 'm' and 's'. They were swapped in the code. Also document the fact that...
[asterisk/asterisk.git] / apps / app_confbridge.c
index 058f581..2389e9b 100644 (file)
@@ -97,6 +97,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
                 <description>
                         <para>Enters the user into a specified conference bridge. The user can exit the conference by hangup only.</para>
                         <para>The join sound can be set using the <literal>CONFBRIDGE_JOIN_SOUND</literal> variable and the leave sound can be set using the <literal>CONFBRIDGE_LEAVE_SOUND</literal> variable. These can be unique to the caller.</para>
                 <description>
                         <para>Enters the user into a specified conference bridge. The user can exit the conference by hangup only.</para>
                         <para>The join sound can be set using the <literal>CONFBRIDGE_JOIN_SOUND</literal> variable and the leave sound can be set using the <literal>CONFBRIDGE_LEAVE_SOUND</literal> variable. These can be unique to the caller.</para>
+                       <note>This application will not automatically answer the channel.</note>
                 </description>
         </application>
 ***/
                 </description>
         </application>
 ***/
@@ -111,7 +112,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  * bridge lock if it is important.
  */
 
  * bridge lock if it is important.
  */
 
-static const char *app = "ConfBridge";
+static const char app[] = "ConfBridge";
 
 enum {
        OPTION_ADMIN = (1 << 0),             /*!< Set if the caller is an administrator */
 
 enum {
        OPTION_ADMIN = (1 << 0),             /*!< Set if the caller is an administrator */
@@ -135,10 +136,10 @@ AST_APP_OPTIONS(app_opts,{
        AST_APP_OPTION('A', OPTION_MARKEDUSER),
        AST_APP_OPTION('a', OPTION_ADMIN),
        AST_APP_OPTION('c', OPTION_ANNOUNCEUSERCOUNT),
        AST_APP_OPTION('A', OPTION_MARKEDUSER),
        AST_APP_OPTION('a', OPTION_ADMIN),
        AST_APP_OPTION('c', OPTION_ANNOUNCEUSERCOUNT),
-       AST_APP_OPTION('m', OPTION_MENU),
+       AST_APP_OPTION('m', OPTION_STARTMUTED),
        AST_APP_OPTION_ARG('M', OPTION_MUSICONHOLD, OPTION_MUSICONHOLD_CLASS),
        AST_APP_OPTION('1', OPTION_NOONLYPERSON),
        AST_APP_OPTION_ARG('M', OPTION_MUSICONHOLD, OPTION_MUSICONHOLD_CLASS),
        AST_APP_OPTION('1', OPTION_NOONLYPERSON),
-       AST_APP_OPTION('s', OPTION_STARTMUTED),
+       AST_APP_OPTION('s', OPTION_MENU),
        AST_APP_OPTION('w', OPTION_WAITMARKED),
        AST_APP_OPTION('q', OPTION_QUIET),
 });
        AST_APP_OPTION('w', OPTION_WAITMARKED),
        AST_APP_OPTION('q', OPTION_QUIET),
 });
@@ -271,11 +272,13 @@ static void post_join_marked(struct conference_bridge *conference_bridge, struct
                }
 
                /* Next play the audio file stating they are going to be placed into the conference */
                }
 
                /* Next play the audio file stating they are going to be placed into the conference */
-               ao2_unlock(conference_bridge);
-               ast_autoservice_start(conference_bridge_user->chan);
-               play_sound_file(conference_bridge, "conf-placeintoconf");
-               ast_autoservice_stop(conference_bridge_user->chan);
-               ao2_lock(conference_bridge);
+               if (!ast_test_flag(&conference_bridge_user->flags, OPTION_QUIET)) {
+                       ao2_unlock(conference_bridge);
+                       ast_autoservice_start(conference_bridge_user->chan);
+                       play_sound_file(conference_bridge, "conf-placeintoconf");
+                       ast_autoservice_stop(conference_bridge_user->chan);
+                       ao2_lock(conference_bridge);
+               }
 
                /* Finally iterate through and unmute them all */
                AST_LIST_TRAVERSE(&conference_bridge->users_list, other_conference_bridge_user, list) {
 
                /* Finally iterate through and unmute them all */
                AST_LIST_TRAVERSE(&conference_bridge->users_list, other_conference_bridge_user, list) {
@@ -505,11 +508,13 @@ static void  leave_conference_bridge(struct conference_bridge *conference_bridge
                        }
 
                        /* Play back the audio prompt saying the leader has left the conference */
                        }
 
                        /* Play back the audio prompt saying the leader has left the conference */
-                       ao2_unlock(conference_bridge);
-                       ast_autoservice_start(conference_bridge_user->chan);
-                       play_sound_file(conference_bridge, "conf-leaderhasleft");
-                       ast_autoservice_stop(conference_bridge_user->chan);
-                       ao2_lock(conference_bridge);
+                       if (!ast_test_flag(&conference_bridge_user->flags, OPTION_QUIET)) {
+                               ao2_unlock(conference_bridge);
+                               ast_autoservice_start(conference_bridge_user->chan);
+                               play_sound_file(conference_bridge, "conf-leaderhasleft");
+                               ast_autoservice_stop(conference_bridge_user->chan);
+                               ao2_lock(conference_bridge);
+                       }
 
                        /* Now on to starting MOH if needed */
                        AST_LIST_TRAVERSE(&conference_bridge->users_list, other_participant, list) {
 
                        /* Now on to starting MOH if needed */
                        AST_LIST_TRAVERSE(&conference_bridge->users_list, other_participant, list) {
@@ -555,7 +560,7 @@ static int play_sound_file(struct conference_bridge *conference_bridge, const ch
        if (!(conference_bridge->playback_chan)) {
                int cause;
 
        if (!(conference_bridge->playback_chan)) {
                int cause;
 
-               if (!(conference_bridge->playback_chan = ast_request("Bridge", AST_FORMAT_SLINEAR, "", &cause))) {
+               if (!(conference_bridge->playback_chan = ast_request("Bridge", AST_FORMAT_SLINEAR, NULL, "", &cause))) {
                        ast_mutex_unlock(&conference_bridge->playback_lock);
                        return -1;
                }
                        ast_mutex_unlock(&conference_bridge->playback_lock);
                        return -1;
                }
@@ -679,7 +684,7 @@ static int menu_callback(struct ast_bridge *bridge, struct ast_bridge_channel *b
 }
 
 /*! \brief The ConfBridge application */
 }
 
 /*! \brief The ConfBridge application */
-static int confbridge_exec(struct ast_channel *chan, void *data)
+static int confbridge_exec(struct ast_channel *chan, const char *data)
 {
        int res = 0, volume_adjustments[2];
        char *parse;
 {
        int res = 0, volume_adjustments[2];
        char *parse;