[Home]

Summary:ASTERISK-15805: [regression] Manager Events Exit Early
Reporter:Nicholas Blasgen (nblasgen)Labels:
Date Opened:2010-03-13 15:17:01.000-0600Date Closed:2010-04-13 14:51:30
Priority:BlockerRegression?Yes
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I'm having a hard time getting any useful logs for this board on this, but on Asterisk 1.4.30 I can't get any listings of any Asterisk events.

Works fine on Asterisk 1.4.29.1 and every previous version I've ever used.  This is exactly the reason why I stopped using SVN code.  I have not tested SVN Trunk.

I run my script (or any number of them) and instead of my program never making it to the disconnect() line, it makes it to that line and quits.  All in all, you can't monitor any Asterisk Events on 1.4.30.

****** ADDITIONAL INFORMATION ******

require ('inc/phpagi-asmanager.php');
function eDefault($e, $arg, $server, $port) {
       print_r($arg);
}

$asm = new AGI_AsteriskManager ( );
if ( $asm->connect () ) {
       $asm->add_event_handler ( '*', 'eDefault' );
       $d = $asm->events ( "ON" );
       print_r ( $d );

       $asm->disconnect ();
}
Comments:By: Nicholas Blasgen (nblasgen) 2010-03-13 15:27:35.000-0600

Just tested against Asterisk SVN-branch-1.4-r252175.  The issue is there as well.  Should be very easy to reproduce on your end as well.

By: Nicholas Blasgen (nblasgen) 2010-03-13 15:35:36.000-0600

http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Events

I know the above URL is not related to current development or even considered proper documentation, but it is what a lot of AMI libraries are written on.  The line to note, "EventMask ON does not return any immediate response" ... until the Event logger is unregistered.  In 1.4.30 and beyond, you now provide an immediate response which changes the expected response and causes my app to close.  Will take me a long time to re-write the library.

Pre 1.4.30:

Action: Events
EventMask: ON

::no response::

Event: Newchannel
Privilege: call,all
Channel: SIP/00000000
State: Down
CallerIDNum: <unknown>
CallerIDName: <unknown>
Uniqueid: 1268515920.0


Asterisk 1.4.30 and above:

Action: Events
EventMask: ON

Response: Events On

Event: Newchannel
Privilege: call,all
Channel: SIP/00000000
State: Down
CallerIDNum: <unknown>
CallerIDName: <unknown>
Uniqueid: 1268515920.0

========

So is this the new expected result?  Is Asterisk now going to be returning a result immediately upon EventMask: On?  Or is this something of an unexpected change and is to be corrected back to the way it was prior to 1.4.30.



By: Leif Madsen (lmadsen) 2010-03-15 10:49:34

I consider this a regression and is not expected behaviour. The issue has been marked as such and will be resolved as soon as time and resources permit. I'm marking this as a blocker for the next release.

By: Russell Bryant (russell) 2010-03-15 11:01:04

Can you identify a specific version of Asterisk that demonstrated the previous behavior that you expect?  The behavior you see now is what I would expect, actually.

By: Russell Bryant (russell) 2010-03-15 11:02:52

I see that you already answered my question.  I missed it, sorry.

By: Leif Madsen (lmadsen) 2010-03-15 11:07:20

Assigned to myself to reproduce the issue per russell.

By: Vincent Sweeney (vince) 2010-03-15 21:44:35

I seem to be using the same PHP Manager class as the reporter and I got hit by this change too. However there is a simple code fix to continue with the libraries message loop:

...
$asm->events ( "ON" );
$d = $asm->wait_response ( FALSE );
print_r ( $d );
...



By: Leif Madsen (lmadsen) 2010-03-18 14:38:38

The discussion has essentially come down to, "This was a bug, as this is how it SHOULD have worked all along", however, as this is somewhat of a regression simply because it breaks existing peoples applications, we're going to add an option that will allow you to put it back to the "broken" (previous) method so that it works as it did prior to the bug fix.

By: Nicholas Blasgen (nblasgen) 2010-03-18 16:06:41

That meets my needs.  Thanks.

By: Leif Madsen (lmadsen) 2010-03-18 18:07:31

Also, I suggest this only go into the existing branches and not into trunk.

By: Digium Subversion (svnbot) 2010-04-13 11:46:31

Repository: asterisk
Revision: 257070

U   branches/1.4/configs/manager.conf.sample
U   branches/1.4/main/manager.c

------------------------------------------------------------------------
r257070 | mnicholson | 2010-04-13 11:46:31 -0500 (Tue, 13 Apr 2010) | 9 lines

Add an option to restore past broken behavor of the Events manager action

Before r238915, certain values for the EventMask parameter of the Events action would result in no response being returned.  This patch adds an option to restore that broken behavior.  Also while fixing this bug I discovered that passing an empty EventMasks parameter would also result in no response being returned, this has been fixed as well while being preserved when the broken behavior is requested.

(closes issue ASTERISK-15805)
Reported by: nblasgen

Review: https://reviewboard.asterisk.org/r/602/

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=257070

By: Digium Subversion (svnbot) 2010-04-13 13:10:31

Repository: asterisk
Revision: 257146

_U  trunk/
U   trunk/configs/manager.conf.sample
U   trunk/main/manager.c

------------------------------------------------------------------------
r257146 | mnicholson | 2010-04-13 13:10:30 -0500 (Tue, 13 Apr 2010) | 16 lines

Merged revisions 257070 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r257070 | mnicholson | 2010-04-13 11:46:30 -0500 (Tue, 13 Apr 2010) | 9 lines
 
 Add an option to restore past broken behavor of the Events manager action
 
 Before r238915, certain values for the EventMask parameter of the Events action would result in no response being returned.  This patch adds an option to restore that broken behavior.  Also while fixing this bug I discovered that passing an empty EventMasks parameter would also result in no response being returned, this has been fixed as well while being preserved when the broken behavior is requested.
 
 (closes issue ASTERISK-15805)
 Reported by: nblasgen
 
 Review: https://reviewboard.asterisk.org/r/602/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=257146

By: Digium Subversion (svnbot) 2010-04-13 13:43:14

Repository: asterisk
Revision: 257184

_U  branches/1.6.2/
U   branches/1.6.2/configs/manager.conf.sample
U   branches/1.6.2/main/manager.c

------------------------------------------------------------------------
r257184 | mnicholson | 2010-04-13 13:43:13 -0500 (Tue, 13 Apr 2010) | 23 lines

Merged revisions 257146 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r257146 | mnicholson | 2010-04-13 13:10:30 -0500 (Tue, 13 Apr 2010) | 16 lines
 
 Merged revisions 257070 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r257070 | mnicholson | 2010-04-13 11:46:30 -0500 (Tue, 13 Apr 2010) | 9 lines
   
   Add an option to restore past broken behavor of the Events manager action
   
   Before r238915, certain values for the EventMask parameter of the Events action would result in no response being returned.  This patch adds an option to restore that broken behavior.  Also while fixing this bug I discovered that passing an empty EventMasks parameter would also result in no response being returned, this has been fixed as well while being preserved when the broken behavior is requested.
   
   (closes issue ASTERISK-15805)
   Reported by: nblasgen
   
   Review: https://reviewboard.asterisk.org/r/602/
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=257184

By: Digium Subversion (svnbot) 2010-04-13 14:30:49

Repository: asterisk
Revision: 257214

_U  branches/1.6.1/
U   branches/1.6.1/configs/manager.conf.sample
U   branches/1.6.1/main/manager.c

------------------------------------------------------------------------
r257214 | mnicholson | 2010-04-13 14:30:48 -0500 (Tue, 13 Apr 2010) | 23 lines

Merged revisions 257146 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r257146 | mnicholson | 2010-04-13 13:10:30 -0500 (Tue, 13 Apr 2010) | 16 lines
 
 Merged revisions 257070 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r257070 | mnicholson | 2010-04-13 11:46:30 -0500 (Tue, 13 Apr 2010) | 9 lines
   
   Add an option to restore past broken behavor of the Events manager action
   
   Before r238915, certain values for the EventMask parameter of the Events action would result in no response being returned.  This patch adds an option to restore that broken behavior.  Also while fixing this bug I discovered that passing an empty EventMasks parameter would also result in no response being returned, this has been fixed as well while being preserved when the broken behavior is requested.
   
   (closes issue ASTERISK-15805)
   Reported by: nblasgen
   
   Review: https://reviewboard.asterisk.org/r/602/
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=257214

By: Digium Subversion (svnbot) 2010-04-13 14:44:50

Repository: asterisk
Revision: 257218

_U  branches/1.6.0/
U   branches/1.6.0/configs/manager.conf.sample
U   branches/1.6.0/main/manager.c

------------------------------------------------------------------------
r257218 | mnicholson | 2010-04-13 14:44:49 -0500 (Tue, 13 Apr 2010) | 23 lines

Merged revisions 257146 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r257146 | mnicholson | 2010-04-13 13:10:30 -0500 (Tue, 13 Apr 2010) | 16 lines
 
 Merged revisions 257070 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r257070 | mnicholson | 2010-04-13 11:46:30 -0500 (Tue, 13 Apr 2010) | 9 lines
   
   Add an option to restore past broken behavor of the Events manager action
   
   Before r238915, certain values for the EventMask parameter of the Events action would result in no response being returned.  This patch adds an option to restore that broken behavior.  Also while fixing this bug I discovered that passing an empty EventMasks parameter would also result in no response being returned, this has been fixed as well while being preserved when the broken behavior is requested.
   
   (closes issue ASTERISK-15805)
   Reported by: nblasgen
   
   Review: https://reviewboard.asterisk.org/r/602/
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=257218

By: Digium Subversion (svnbot) 2010-04-13 14:46:47

Repository: testsuite
Revision: 222

A   asterisk/trunk/tests/manager-action-events-response/
A   asterisk/trunk/tests/manager-action-events-response/run-test
A   asterisk/trunk/tests/manager-action-events-response/test-config.yaml
A   asterisk/trunk/tests/manager-action-events-response/test.lua
U   asterisk/trunk/tests/tests.yaml

------------------------------------------------------------------------
r222 | mnicholson | 2010-04-13 14:46:47 -0500 (Tue, 13 Apr 2010) | 7 lines

Test an option to restore past broken behavor of the Events manager action

This tests a new feature to restore old broken behavior of the Events manager action by sending the action and checking the presence or absense of a response.

(related to issue ASTERISK-15805)


------------------------------------------------------------------------

http://svn.digium.com/view/testsuite?view=rev&revision=222

By: Digium Subversion (svnbot) 2010-04-13 14:51:30

Repository: testsuite
Revision: 222

A   asterisk/trunk/tests/manager-action-events-response/
A   asterisk/trunk/tests/manager-action-events-response/run-test
A   asterisk/trunk/tests/manager-action-events-response/test-config.yaml
A   asterisk/trunk/tests/manager-action-events-response/test.lua
U   asterisk/trunk/tests/tests.yaml

------------------------------------------------------------------------
r222 | mnicholson | 2010-04-13 14:46:46 -0500 (Tue, 13 Apr 2010) | 9 lines

Test an option to restore past broken behavor of the Events manager action

This tests a new feature to restore old broken behavior of the Events manager action by sending the action and checking the presence or absense of a response.

(related to issue ASTERISK-15805)

Review: https://reviewboard.asterisk.org/r/603/


------------------------------------------------------------------------

http://svn.digium.com/view/testsuite?view=rev&revision=222