A Dimecres 04 Març 2009, [email protected] va escriure:
> It would be your first scenario, the one that we want a popup or
> notification in the GTK/KDE client whenever a call comes for an operator.
> The operator could be either a fixed phone or a queue member.
>
> In any case, having openERP intervene in the call path (ie. waiting for
> openERP to pickup the call) would be too slow (calls should be served in
> <10sec, GUI operations are typically slower - including the user of
> course).

You might be interested to know that Koo beta 3 includes a Subscription 
mechanism (needs 'ktiny' server module installed, too) that avoids polling 
the server at fixed time intervals and can be used with XML-RPC, Net-RPC or 
Pyro protocols. 

The API in the client side is extremely simple and we're already using it for 
keeping data up to date the whole time: you can see the list view refreshed 
when partners are added, removed or modified without the need of a fixed time 
interval.

So writing a plugin that notifies on incomming calls would be something as 
simple as:

---------
self.subscriber = Rpc.Subscriber(Rpc.session, self)
self.subscriber.subscribe( 'updated_model:asterisk.phone', self.notify )

def notify(self):
    QMessageBox.information( self, _("Phone call"), _("You're being 
called!") )
---------

Well, I think you get the idea. The notify function would be called each time 
a record was added, modified or removed from the "asterisk.phone" model. Of 
course, it could be improved on the server side and use the even smaller 
publishing API provided by 'ktiny' module. Something like this would do:

netsvc.LocalService('subscription').publish( 'new_phone_call' )

And subscribe on the client appropiately.

Note that the method used is not '100%' bug free and some events could be lost 
if the interval between them is very short, but I'd say it works as expected 
99% of the time, and should definitely work for the asterisk case. If it 
would be integrated in OpenERP core server, it could be benefit from other 
optimisations too.

> -------------------- m2f --------------------
>
> --
> http://www.openobject.com/forum/viewtopic.php?p=32738#32738
>
> -------------------- m2f --------------------
>
>
> _______________________________________________
> Tinyerp-users mailing list
> http://tiny.be/mailman/listinfo/tinyerp-users



-- 
Albert Cervera i Areny
http://www.NaN-tic.com
_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman/listinfo/tinyerp-users

Reply via email to