[Home]

Summary:ASTERISK-16837: [patch] Duplicated event on AMI interface
Reporter:feyfre (feyfre)Labels:
Date Opened:2010-10-19 17:57:22Date Closed:2011-02-24 11:59:34.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bug0018168.patch
( 1) manager.c.patch
Description:Steps to reproduce:
1. Enable AMI in manager.conf (and configure network)
2. Start Asterisk
3. Connect to Asterisk
4. Login into AMI. We will receive FullyBooted event.
5. Do not close first connection. Connect to Asterisk again.
6. Login into AMI. We will receive FullyBooted event here also.
ISSUE: FullyBooted event in step 6 will be sent to first AMI connection also. Such behaviour is unacceptable. Software which controls Asterisk over AMI can misunderstood this event and broke whole system.(No good for Asterisk either)

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

Suggesting to fix it at line 2929 of file main/manager.c
(probably will attach patch later)
Comments:By: Paul Belanger (pabelanger) 2010-10-19 18:20:24

If you don't want the event, create an event filter for your manager user:
eventfilter=!Event: FullyBooted
---
Thanks for your comments. This does not appear to be a bug report and we are closing it. We appreciate the difficulties you are facing, but it would make more sense to raise your question in the support tracker, http://www.asterisk.org/support

By: feyfre (feyfre) 2010-10-20 04:21:39

But I require this event. Without it software connected to Asterisk via AMI will be unusable. But I require it once, not thousands times per connection(which is guaranteed because I will connect dozens of clients to Asterisk simultaneously). Filter will no help it.

By: Stefan Reuter (srt) 2010-10-23 08:08:40

Yes this seems indeed like a bug. The event is sent to *all* existing manager connections each time a new connection to ami is established. Expected behavior is that it is only sent to the new connection.

By: Leif Madsen (lmadsen) 2010-11-01 14:29:39

Since the reporter suggests he has a patch for this issue, I'm setting this to feedback for now. Upon the patch being attached we can triage this issue further to help move it forward to completion.

By: feyfre (feyfre) 2010-11-02 06:45:53

Attached patch fixing issue (for revision #291227)
NOTE: event will be fired even if session configured not to fire events. I do not think somebody will be object this behaviour.

By: feyfre (feyfre) 2010-11-05 18:48:48

Sanitized patch: svn diff over svn tags/1.8.0

By: Leonardo Cardozo Vargas (lcvleo) 2010-11-08 09:51:38.000-0600

In my case, the problem persists.
Asterisk 1.8.0, CentOS 5.5 64-bit.

By: feyfre (feyfre) 2010-11-08 10:16:14.000-0600

lcvleo, did you used my patch?

By: Leonardo Cardozo Vargas (lcvleo) 2010-11-08 10:23:33.000-0600

Yes, of course ;)
I applied today morning.

By: feyfre (feyfre) 2010-11-08 11:16:31.000-0600

There is no other places which can illegally broadcast event for all AMI connections. I will review source again, but I do not think I missed something.

By: Leonardo Cardozo Vargas (lcvleo) 2010-11-08 11:21:52.000-0600

No problem guy, I believe in you.
Lets see if something new appears. :)
Thank you so much!

By: Terry Wilson (twilson) 2011-02-24 11:00:50.000-0600

This was by design. Each new connection *should* get the FullyBooted event upon connection so that it knows that the Asterisk server is ready to accept commands. If you have multiple servers connecting simultaneously, you don't want only some of them to know that it is safe to send AMI events.

By: Terry Wilson (twilson) 2011-02-24 11:09:36.000-0600

Just read srt's comment. If it sends it to all each time, that is indeed bad.



By: Terry Wilson (twilson) 2011-02-24 11:32:14.000-0600

This patch is correct. I am going to ninja-commit it.

By: Terry Wilson (twilson) 2011-02-24 11:35:50.000-0600

To be clear, every new connection will still get a FullyBooted event. This is correct and should be planned for. Basically, new AMI connections should listen for the FullyBooted command before doing anything else. Then continue on with what they intend to do. This patch just ensures that we don't send a FullyBooted event to *everyone* every time someone connects.

By: Digium Subversion (svnbot) 2011-02-24 11:42:18.000-0600

Repository: asterisk
Revision: 308813

U   branches/1.4/main/manager.c

------------------------------------------------------------------------
r308813 | twilson | 2011-02-24 11:42:17 -0600 (Thu, 24 Feb 2011) | 12 lines

Don't broadcast FullyBooted to every AMI connection

The FullyBooted event should not be sent to every AMI connection every
time someone connects via AMI. It should only be sent to the user who
just connected.

(closes issue ASTERISK-16837)
Reported by: FeyFre
Patches:
     bug0018168.patch uploaded by FeyFre (license 1142)
Tested by: FeyFre, twilson

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

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

By: Digium Subversion (svnbot) 2011-02-24 11:54:52.000-0600

Repository: asterisk
Revision: 308814

_U  branches/1.6.2/
U   branches/1.6.2/main/manager.c

------------------------------------------------------------------------
r308814 | twilson | 2011-02-24 11:54:52 -0600 (Thu, 24 Feb 2011) | 19 lines

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

........
 r308813 | twilson | 2011-02-24 11:42:16 -0600 (Thu, 24 Feb 2011) | 12 lines
 
 Don't broadcast FullyBooted to every AMI connection
 
 The FullyBooted event should not be sent to every AMI connection every
 time someone connects via AMI. It should only be sent to the user who
 just connected.
 
 (closes issue ASTERISK-16837)
 Reported by: FeyFre
 Patches:
       bug0018168.patch uploaded by FeyFre (license 1142)
 Tested by: FeyFre, twilson
........

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

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

By: Digium Subversion (svnbot) 2011-02-24 11:57:20.000-0600

Repository: asterisk
Revision: 308815

_U  branches/1.8/
U   branches/1.8/main/manager.c

------------------------------------------------------------------------
r308815 | twilson | 2011-02-24 11:57:19 -0600 (Thu, 24 Feb 2011) | 26 lines

Merged revisions 308814 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
 r308814 | twilson | 2011-02-24 11:54:49 -0600 (Thu, 24 Feb 2011) | 19 lines
 
 Merged revisions 308813 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r308813 | twilson | 2011-02-24 11:42:16 -0600 (Thu, 24 Feb 2011) | 12 lines
   
   Don't broadcast FullyBooted to every AMI connection
   
   The FullyBooted event should not be sent to every AMI connection every
   time someone connects via AMI. It should only be sent to the user who
   just connected.
   
   (closes issue ASTERISK-16837)
   Reported by: FeyFre
   Patches:
         bug0018168.patch uploaded by FeyFre (license 1142)
   Tested by: FeyFre, twilson
 ........
................

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

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

By: Digium Subversion (svnbot) 2011-02-24 11:59:33.000-0600

Repository: asterisk
Revision: 308816

_U  trunk/
U   trunk/main/manager.c

------------------------------------------------------------------------
r308816 | twilson | 2011-02-24 11:59:33 -0600 (Thu, 24 Feb 2011) | 33 lines

Merged revisions 308815 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
 r308815 | twilson | 2011-02-24 11:57:18 -0600 (Thu, 24 Feb 2011) | 26 lines
 
 Merged revisions 308814 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.6.2
 
 ................
   r308814 | twilson | 2011-02-24 11:54:49 -0600 (Thu, 24 Feb 2011) | 19 lines
   
   Merged revisions 308813 via svnmerge from
   https://origsvn.digium.com/svn/asterisk/branches/1.4
   
   ........
     r308813 | twilson | 2011-02-24 11:42:16 -0600 (Thu, 24 Feb 2011) | 12 lines
     
     Don't broadcast FullyBooted to every AMI connection
     
     The FullyBooted event should not be sent to every AMI connection every
     time someone connects via AMI. It should only be sent to the user who
     just connected.
     
     (closes issue ASTERISK-16837)
     Reported by: FeyFre
     Patches:
           bug0018168.patch uploaded by FeyFre (license 1142)
     Tested by: FeyFre, twilson
   ........
 ................
................

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

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