Merged revisions 378063-378064 via svnmerge from
authorAutomerge script <automerge@asterisk.org>
Fri, 14 Dec 2012 23:17:59 +0000 (23:17 +0000)
committerAutomerge script <automerge@asterisk.org>
Fri, 14 Dec 2012 23:17:59 +0000 (23:17 +0000)
file:///srv/subversion/repos/asterisk/trunk

........
  r378063 | jrose | 2012-12-14 16:34:18 -0600 (Fri, 14 Dec 2012) | 8 lines

  Features: BRIDGE_FEATURES variable automixmonitor support and use proper party

  BRIDGE_FEATURES did not previously support the automixmonitor feature. Now it
  does. In addition, the BRIDGE_FEATURES variable would not apply features to
  the proper party based on whether the feature option letter was in caps or
  in lowercase (both ways would apply it to the caller). Now uppercase applies
  to the caller while lowercase applies to the callee (like with the dial option)
........
  r378064 | rmudgett | 2012-12-14 16:45:03 -0600 (Fri, 14 Dec 2012) | 4 lines

  chan_agent: Remove some duplicated code.

  No need to check for an agent twice.  Santa does that.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378066 65c4cc65-6c06-0410-ace0-fbb531ad65f3

CHANGES
UPGRADE.txt
channels/chan_agent.c
main/features.c

diff --git a/CHANGES b/CHANGES
index 4da4fd9..6a8322a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -31,6 +31,16 @@ AMI (Asterisk Manager Interface)
    'Manager Show Command' now displays the privileges needed for using a given
    manager command instead.
 
+Features
+-------------------
+ * The BRIDGE_FEATURES channel variable would previously only set features for
+   the calling party and would set this feature regardless of whether the
+   feature was in caps or in lowercase. Use of a caps feature for a letter
+   will now apply the feature to the calling party while use of a lowercase
+   letter will apply that feature to the called party.
+
+ * Add support for automixmonitor to the BRIDGE_FEATURES channel variable.
+
 Logging
 -------------------
  * When performing queue pause/unpause on an interface without specifying an
index 66eb5aa..2c1a155 100644 (file)
@@ -64,6 +64,9 @@ Dialplan:
  - Asterisk has always had code to ignore dash '-' characters that are not
    part of a character set in the dialplan extensions.  The code now
    consistently ignores these characters when matching dialplan extensions.
+ - BRIDGE_FEATURES channel variable is now casesensitive for feature letter codes.
+   Uppercase variants apply them to the calling party while lowercase variants
+   apply them to the called party.
 
 From 10 to 11:
 
index 0f0c4d2..42492f4 100644 (file)
@@ -1442,8 +1442,9 @@ static struct ast_channel *agent_request(const char *type, struct ast_format_cap
        AST_LIST_TRAVERSE(&agents, p, list) {
                ast_mutex_lock(&p->lock);
                if (!p->pending && ((groupmatch && (p->group & groupmatch)) || !strcmp(data, p->agent))) {
-                       if (p->chan)
+                       if (p->chan) {
                                hasagent++;
+                       }
                        now = ast_tvnow();
                        if (!p->lastdisc.tv_sec || (now.tv_sec >= p->lastdisc.tv_sec)) {
                                p->lastdisc = ast_tv(0, 0);
@@ -1460,30 +1461,6 @@ static struct ast_channel *agent_request(const char *type, struct ast_format_cap
                }
                ast_mutex_unlock(&p->lock);
        }
-       if (!p) {
-               AST_LIST_TRAVERSE(&agents, p, list) {
-                       ast_mutex_lock(&p->lock);
-                       if (!p->pending && ((groupmatch && (p->group & groupmatch)) || !strcmp(data, p->agent))) {
-                               if (p->chan) {
-                                       hasagent++;
-                               }
-                               now = ast_tvnow();
-                               if (!p->lastdisc.tv_sec || (now.tv_sec >= p->lastdisc.tv_sec)) {
-                                       p->lastdisc = ast_tv(0, 0);
-                                       /* Agent must be registered, but not have any active call, and not be in a waiting state */
-                                       if (!p->owner && p->chan) {
-                                               /* Could still get a fixed agent */
-                                               chan = agent_new(p, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL, callid);
-                                       }
-                                       if (chan) {
-                                               ast_mutex_unlock(&p->lock);
-                                               break;
-                                       }
-                               }
-                       }
-                       ast_mutex_unlock(&p->lock);
-               }
-       }
 
        if (!chan && waitforagent) {
                /* No agent available -- but we're requesting to wait for one.
index a4977f2..5e544cc 100644 (file)
@@ -4227,22 +4227,32 @@ static void set_bridge_features_on_config(struct ast_bridge_config *config, cons
        }
 
        for (feature = features; *feature; feature++) {
-               switch (*feature) {
-               case 'T' :
+               struct ast_flags *party;
+               char this_feature;
+
+               if (isupper(*feature)) {
+                       party = &(config->features_caller);
+               } else {
+                       party = &(config->features_callee);
+               }
+
+               this_feature = tolower(*feature);
+
+               switch (this_feature) {
                case 't' :
-                       ast_set_flag(&(config->features_caller), AST_FEATURE_REDIRECT);
+                       ast_set_flag(party, AST_FEATURE_REDIRECT);
                        break;
-               case 'K' :
                case 'k' :
-                       ast_set_flag(&(config->features_caller), AST_FEATURE_PARKCALL);
+                       ast_set_flag(party, AST_FEATURE_PARKCALL);
                        break;
-               case 'H' :
                case 'h' :
-                       ast_set_flag(&(config->features_caller), AST_FEATURE_DISCONNECT);
+                       ast_set_flag(party, AST_FEATURE_DISCONNECT);
                        break;
-               case 'W' :
                case 'w' :
-                       ast_set_flag(&(config->features_caller), AST_FEATURE_AUTOMON);
+                       ast_set_flag(party, AST_FEATURE_AUTOMON);
+                       break;
+               case 'x' :
+                       ast_set_flag(party, AST_FEATURE_AUTOMIXMON);
                        break;
                default :
                        ast_log(LOG_WARNING, "Skipping unknown feature code '%c'\n", *feature);