[asterisk-commits] dvossel: branch 1.6.0 r199301 - in /branches/1.6.0: ./ main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 5 16:37:06 CDT 2009


Author: dvossel
Date: Fri Jun  5 16:37:01 2009
New Revision: 199301

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199301
Log:
Merged revisions 199298 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r199298 | dvossel | 2009-06-05 16:21:22 -0500 (Fri, 05 Jun 2009) | 21 lines
  
  Merged revisions 199297 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r199297 | dvossel | 2009-06-05 16:19:56 -0500 (Fri, 05 Jun 2009) | 14 lines
    
    Fixes issue with hints giving unexpected results.
    
    Hints with two or more devices that include ONHOLD gave unexpected results.
    
    (closes issue #15057)
    Reported by: p_lindheimer
    Patches:
          onhold_trunk.diff uploaded by dvossel (license 671)
          pbx.c.1.4.patch uploaded by p (license 558)
          devicestate.c.trunk.patch uploaded by p (license 671)
    Tested by: p_lindheimer, dvossel
    
    Review: https://reviewboard.asterisk.org/r/254/
  ........
................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/pbx.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/pbx.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.0/main/pbx.c?view=diff&rev=199301&r1=199300&r2=199301
==============================================================================
--- branches/1.6.0/main/pbx.c (original)
+++ branches/1.6.0/main/pbx.c Fri Jun  5 16:37:01 2009
@@ -3177,8 +3177,8 @@
 {
 	char hint[AST_MAX_EXTENSION];
 	char *cur, *rest;
-	int allunavailable = 1, allbusy = 1, allfree = 1, allonhold = 1;
-	int busy = 0, inuse = 0, ring = 0;
+	int allunavailable = 1, allbusy = 1, allfree = 1;
+	int busy = 0, inuse = 0, ring = 0, onhold = 0;
 
 	if (!e)
 		return -1;
@@ -3192,67 +3192,60 @@
 		case AST_DEVICE_NOT_INUSE:
 			allunavailable = 0;
 			allbusy = 0;
-			allonhold = 0;
 			break;
 		case AST_DEVICE_INUSE:
 			inuse = 1;
 			allunavailable = 0;
 			allfree = 0;
-			allonhold = 0;
 			break;
 		case AST_DEVICE_RINGING:
 			ring = 1;
 			allunavailable = 0;
 			allfree = 0;
-			allonhold = 0;
 			break;
 		case AST_DEVICE_RINGINUSE:
 			inuse = 1;
 			ring = 1;
 			allunavailable = 0;
 			allfree = 0;
-			allonhold = 0;
 			break;
 		case AST_DEVICE_ONHOLD:
 			allunavailable = 0;
 			allfree = 0;
+			onhold = 1;
 			break;
 		case AST_DEVICE_BUSY:
 			allunavailable = 0;
 			allfree = 0;
-			allonhold = 0;
 			busy = 1;
+			inuse = 1;
 			break;
 		case AST_DEVICE_UNAVAILABLE:
 		case AST_DEVICE_INVALID:
 			allbusy = 0;
 			allfree = 0;
-			allonhold = 0;
 			break;
 		default:
 			allunavailable = 0;
 			allbusy = 0;
 			allfree = 0;
-			allonhold = 0;
-		}
-	}
-
-	if (!inuse && ring)
-		return AST_EXTENSION_RINGING;
-	if (inuse && ring)
+		}
+	}
+
+	if (allfree)
+		return AST_EXTENSION_NOT_INUSE;
+	if ((inuse || onhold) && ring)
 		return (AST_EXTENSION_INUSE | AST_EXTENSION_RINGING);
+	if (allbusy)
+		return AST_EXTENSION_BUSY;
 	if (inuse)
 		return AST_EXTENSION_INUSE;
-	if (allfree)
-		return AST_EXTENSION_NOT_INUSE;
-	if (allonhold)
+	if (ring)
+		return AST_EXTENSION_RINGING;
+	if (onhold)
 		return AST_EXTENSION_ONHOLD;
-	if (allbusy)
-		return AST_EXTENSION_BUSY;
 	if (allunavailable)
 		return AST_EXTENSION_UNAVAILABLE;
-	if (busy)
-		return AST_EXTENSION_INUSE;
 
 	return AST_EXTENSION_NOT_INUSE;
 }




More information about the asterisk-commits mailing list