Summary:ASTERISK-01094: [patch] manager event flow control and write patch
Reporter:Anthony Minessale (anthm)Labels:
Date Opened:2004-02-24 20:37:40.000-0600Date Closed:2008-01-15 14:45:11.000-0600
Versions:Frequency of
Environment:Attachments:( 0) manager_event_onoff_diff.txt
( 1) manager_event_onoff_diff.txt
( 2) manager_event_onoff_diff.txt
( 3) manager_event_onoff.diff
Description:This allows the manager interface to
send an Events: on|off header along with the auth
info as well as implemetes 2 Actions
Action: EventsOn
Action: EventsOff

It also adresses a write issue where if the data takes too long to write it hangs.
Comments:By: James Golovich (jamesgolovich) 2004-02-25 01:21:28.000-0600

This looks like a great idea.  One thing to add though.  We might want to keep this open to enable/disable certain types of events.  and in this case we would have to duplicate code because of the seperate EventsOn and EventsOff actions.  Perhaps changing the name to SetEvents and adding another variable to set on/off would be better.

By: Mark Spencer (markster) 2004-02-27 02:24:24.000-0600

Can you attach the newer version?

By: Mark Spencer (markster) 2004-02-27 02:24:52.000-0600

How about "EventMask" rather than "SetEvents"?

By: James Golovich (jamesgolovich) 2004-02-27 02:33:51.000-0600

I can fix the patch up and get it in.  Should this go in -stable as well, since it does fix a bug?  A pretty serious one based on what I've heard from people

By: Anthony Minessale (anthm) 2004-02-27 11:37:12.000-0600

The EventsOn and EventsOff is just a way to optionally turn them on and off.
Selective Events are not necessary cos that burden can be put on the client
to decide to react to certian events or not.

The main reason for this Event control is the ability to choose to never get any events, because they always get in the way of a simple Q and A transaction.
When you plan to simply send commands and get a response you
use an "Eventless" session and when you are listening for events you
leave them on and don't do much talking. A forkable or threaded application
may choose to open 1 eventless channel for comm and another for events.  
The on and off are just extra  bonus in case you feel like starting and stopping and work simply either way as 1 command or 2.

I personally have encountered an issue where paticular output is very
long and I don't get the entire reply.  This is related directly to
the socket being blocking or not.  So this new patch also implents
a block-sockets = yes config option in the [general] area that
will allow you to choose to have the socket block for the whole reply
this makes mine work perfectly and it can easily be an "undocumented" option.

The above mentioned patch is now uploaded as the newest file attachment.

By: Mark Spencer (markster) 2004-02-27 11:50:38.000-0600

You should probably check the result of the variable_retrieve to be sure it's not NULL, then i think it's ready for addition.  I'd rather it be a documented option actually, but default to "0" if unspecified.  Thanks!

By: Anthony Minessale (anthm) 2004-02-27 13:17:53.000-0600

Ok variable_retrieve result Checked (although null seems ok arg to ast true as a false val) also, yes,  the default is 0/no for 'block-sockets'

Also the above request is fullfiled for

Action: Event
EventMask: <true or false value>

instead of Eventson and EventsOff
btw I learned that ast_true doesn't think "on" is true, dunno if it should.

By: Mark Spencer (markster) 2004-03-01 16:31:18.000-0600

Added to CVS

By: Digium Subversion (svnbot) 2008-01-15 14:45:10.000-0600

Repository: asterisk
Revision: 2287

U   trunk/include/asterisk/manager.h
U   trunk/manager.c

r2287 | markster | 2008-01-15 14:45:10 -0600 (Tue, 15 Jan 2008) | 2 lines

Allow semi-blocking fd's on manager (bug ASTERISK-1094)



By: Digium Subversion (svnbot) 2008-01-15 14:45:11.000-0600

Repository: asterisk
Revision: 2288

U   branches/v1-0_stable/include/asterisk/manager.h
U   branches/v1-0_stable/manager.c

r2288 | markster | 2008-01-15 14:45:11 -0600 (Tue, 15 Jan 2008) | 2 lines

Allow semi-blocking mode (bug ASTERISK-1094)