[Asterisk-Dev] Manager proposal
Andrew Kohlsmith
akohlsmith-asterisk at benshaw.com
Sat May 7 11:09:36 MST 2005
On May 7, 2005 10:33 am, C. Maj wrote:
> I'm fairly ignorant about XMLRPC, but how do you push data
> to clients -- ie. manager Events ?
No, but you can do what I tend to do in "push" cases... Either have the
request able to time out (think poll()) or do something where if nothing
interesting came back, wait.
e.g.
while(!done) {
s=getstatus();
switch(s) {
case one: dosomething; break;
case two: dosomething; break;
case three: dosomething; break;
default: sleep(5);
}
}
Basically if something interesting came from the status request, deal with it
and immediately ask for more. If nothing intersting came up, sleep for a
bit.
Works through NAT, doesn't break the client/server model and scales relatively
well, especially if you have that sleep do 5s+some random number of hundred
milliseconds.
-A.
More information about the asterisk-dev
mailing list