[asterisk-commits] dvossel: trunk r199298 - in /trunk: ./ include/asterisk/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jun 5 16:21:26 CDT 2009
Author: dvossel
Date: Fri Jun 5 16:21:22 2009
New Revision: 199298
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199298
Log:
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:
trunk/ (props changed)
trunk/include/asterisk/devicestate.h
trunk/main/devicestate.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/include/asterisk/devicestate.h
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/include/asterisk/devicestate.h?view=diff&rev=199298&r1=199297&r2=199298
==============================================================================
--- trunk/include/asterisk/devicestate.h (original)
+++ trunk/include/asterisk/devicestate.h Fri Jun 5 16:21:22 2009
@@ -256,7 +256,7 @@
unsigned int all_unavail:1;
unsigned int all_busy:1;
unsigned int all_free:1;
- unsigned int all_on_hold:1;
+ unsigned int on_hold:1;
unsigned int busy:1;
unsigned int in_use:1;
unsigned int ring:1;
Modified: trunk/main/devicestate.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/devicestate.c?view=diff&rev=199298&r1=199297&r2=199298
==============================================================================
--- trunk/main/devicestate.c (original)
+++ trunk/main/devicestate.c Fri Jun 5 16:21:22 2009
@@ -736,7 +736,6 @@
agg->all_unavail = 1;
agg->all_busy = 1;
agg->all_free = 1;
- agg->all_on_hold = 1;
}
void ast_devstate_aggregate_add(struct ast_devstate_aggregate *agg, enum ast_device_state state)
@@ -745,21 +744,18 @@
case AST_DEVICE_NOT_INUSE:
agg->all_unavail = 0;
agg->all_busy = 0;
- agg->all_on_hold = 0;
break;
case AST_DEVICE_INUSE:
agg->in_use = 1;
agg->all_busy = 0;
agg->all_unavail = 0;
agg->all_free = 0;
- agg->all_on_hold = 0;
break;
case AST_DEVICE_RINGING:
agg->ring = 1;
agg->all_busy = 0;
agg->all_unavail = 0;
agg->all_free = 0;
- agg->all_on_hold = 0;
break;
case AST_DEVICE_RINGINUSE:
agg->in_use = 1;
@@ -767,23 +763,22 @@
agg->all_busy = 0;
agg->all_unavail = 0;
agg->all_free = 0;
- agg->all_on_hold = 0;
break;
case AST_DEVICE_ONHOLD:
agg->all_unavail = 0;
agg->all_free = 0;
+ agg->on_hold = 1;
break;
case AST_DEVICE_BUSY:
agg->all_unavail = 0;
agg->all_free = 0;
- agg->all_on_hold = 0;
agg->busy = 1;
+ agg->in_use = 1;
break;
case AST_DEVICE_UNAVAILABLE:
case AST_DEVICE_INVALID:
agg->all_busy = 0;
agg->all_free = 0;
- agg->all_on_hold = 0;
break;
case AST_DEVICE_UNKNOWN:
break;
@@ -794,25 +789,25 @@
{
if (agg->all_free)
return AST_DEVICE_NOT_INUSE;
-
- if (agg->all_on_hold)
- return AST_DEVICE_ONHOLD;
-
+
+ if ((agg->in_use || agg->on_hold) && agg->ring)
+ return AST_DEVICE_RINGINUSE;
+
if (agg->all_busy)
return AST_DEVICE_BUSY;
+ if (agg->in_use)
+ return AST_DEVICE_INUSE;
+
+ if (agg->ring)
+ return AST_DEVICE_RINGING;
+
+ if (agg->on_hold)
+ return AST_DEVICE_ONHOLD;
+
if (agg->all_unavail)
return AST_DEVICE_UNAVAILABLE;
-
- if (agg->ring)
- return agg->in_use ? AST_DEVICE_RINGINUSE : AST_DEVICE_RINGING;
-
- if (agg->in_use)
- return AST_DEVICE_INUSE;
-
- if (agg->busy)
- return AST_DEVICE_BUSY;
-
+
return AST_DEVICE_NOT_INUSE;
}
More information about the asterisk-commits
mailing list