Merge "bridge_softmix.c: Restored softmix_bridge_leave() shortcut exit."
authorJenkins2 <jenkins2@gerrit.asterisk.org>
Wed, 23 Aug 2017 17:21:47 +0000 (12:21 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Wed, 23 Aug 2017 17:21:47 +0000 (12:21 -0500)
apps/app_queue.c
apps/confbridge/include/confbridge.h
bridges/bridge_softmix.c

index 004d93a..b139ef7 100644 (file)
@@ -4072,8 +4072,12 @@ static void recalc_holdtime(struct queue_ent *qe, int newholdtime)
        /* 2^2 (4) is the filter coefficient; a higher exponent would give old entries more weight */
 
        ao2_lock(qe->parent);
-       oldvalue = qe->parent->holdtime;
-       qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newholdtime) >> 2;
+       if ((qe->parent->callscompleted + qe->parent->callsabandoned) == 0) {
+               qe->parent->holdtime = newholdtime;
+       } else {
+               oldvalue = qe->parent->holdtime;
+               qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newholdtime) >> 2;
+       }
        ao2_unlock(qe->parent);
 }
 
@@ -5651,7 +5655,7 @@ static int update_queue(struct call_queue *q, struct member *member, int callcom
        if (callcompletedinsl) {
                q->callscompletedinsl++;
        }
-       if (q->callscompletedinsl == 1) {
+       if (q->callscompleted == 1) {
                q->talktime = newtalktime;
        } else {
                /* Calculate talktime using the same exponential average as holdtime code */
index adf9b86..162ff22 100644 (file)
 #include "asterisk/bridge_features.h"
 #include "conf_state.h"
 
-/* Maximum length of a conference bridge name */
+/*! Maximum length of a conference bridge name */
 #define MAX_CONF_NAME AST_MAX_EXTENSION
-/* Maximum length of a conference pin */
+/*! Maximum length of a conference pin */
 #define MAX_PIN     80
-/* Maximum length of bridge/user/menu profile names */
+/*! Maximum length of bridge/user/menu profile names */
 #define MAX_PROFILE_NAME 128
 
 #define DEFAULT_USER_PROFILE "default_user"
@@ -70,9 +70,9 @@ enum bridge_profile_flags {
        BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED = (1 << 2), /*!< Set if conference should feed video of first marked user to all participants. */
        BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER = (1 << 3), /*!< Set if conference set the video feed to follow the loudest talker.  */
        BRIDGE_OPT_RECORD_FILE_APPEND = (1 << 4), /*!< Set if the record file should be appended to between start/stops.  */
-       BRIDGE_OPT_RECORD_FILE_TIMESTAMP = (1 << 5), /*< Set if the record file should have a timestamp appended */
-       BRIDGE_OPT_BINAURAL_ACTIVE = (1 << 6), /*< Set if binaural convolution is activated */
-       BRIDGE_OPT_VIDEO_SRC_SFU = (1 << 7), /*< Selective forwarding unit */
+       BRIDGE_OPT_RECORD_FILE_TIMESTAMP = (1 << 5), /*!< Set if the record file should have a timestamp appended */
+       BRIDGE_OPT_BINAURAL_ACTIVE = (1 << 6), /*!< Set if binaural convolution is activated */
+       BRIDGE_OPT_VIDEO_SRC_SFU = (1 << 7), /*!< Selective forwarding unit */
 };
 
 enum conf_menu_action_id {
index f11de6d..2d71fc3 100644 (file)
@@ -1060,14 +1060,10 @@ static int softmix_bridge_write(struct ast_bridge *bridge, struct ast_bridge_cha
                res = ast_bridge_queue_everyone_else(bridge, bridge_channel, frame);
                break;
        case AST_FRAME_VOICE:
-               if (bridge_channel) {
-                       softmix_bridge_write_voice(bridge, bridge_channel, frame);
-               }
+               softmix_bridge_write_voice(bridge, bridge_channel, frame);
                break;
        case AST_FRAME_VIDEO:
-               if (bridge_channel) {
-                       softmix_bridge_write_video(bridge, bridge_channel, frame);
-               }
+               softmix_bridge_write_video(bridge, bridge_channel, frame);
                break;
        case AST_FRAME_CONTROL:
                res = softmix_bridge_write_control(bridge, bridge_channel, frame);