Thanks a lot! That worked like a charm. But why? It seems more intuitive =
to use the event generating method in this case, but hey... I'm just =
glad it worked... =3D)
The questions never seem to end...
Are there any (easy?) way to get the same information as I can get from =
the getQueueMemberStatus() method in Asterisk 1.0.7? I earlier explained =
my problems with migrating to 1.2, so sadly, that is not an option right =
now.
Thank you for all assistance!
// Mattias Malmquist
-----Ursprungligt meddelande-----
Fr=E5n: ast...@li... =
[mailto:ast...@li...] F=F6r Stefan =
Reuter
Skickat: den 29 januari 2006 19:23
Till: ast...@li...
=C4mne: Re: [Asterisk-java-users] Lot of timeouts when sending =
actionsrepetedly
Try to replace=20
manager.sendEventGeneratingAction(action, 5000);
by
manager.sendAction(action, null);
=3DStefan
On Wed, 2006-01-25 at 18:02 +0100, Mattias Malmquist wrote:
> Hi all!
>=20
> =20
>=20
> I am currently using this simple class to monitor the queue. One
> instance of this class is created once every one second (and hopefully
> deleted after reaching end).
>=20
> =20
>=20
> I am actually quite new at Java and thread programming so I realize
> that there must be some better way to do this, but I hope this is
> sufficient for the time being.
>=20
> =20
>=20
> The problem (if it is a problem) I am experiencing at the moment is
> that I receive one timeout every second, but it seems like I get all
> the events generated by this action.
>=20
> =20
>=20
> My question is this: Do I actually lose any information as I get these
> timeouts or are there any other reasons for receiving them?
>=20
> =20
>=20
> Never mind the horrors of my code. I just created this to get around
> the deadlock I experienced when trying to send an action from the
> event dispatching thread. =3D)
>=20
> =20
>=20
> Thanks in advance!
>=20
> =20
>=20
> // Mattias Malmquist
>=20
> =20
>=20
>=20
> =20
>=20
> =20
>=20
> public class QueueStatusChecker extends Thread {
>=20
> ManagerConnection manager;
>=20
> EventGeneratingAction action;
>=20
> =20
>=20
> public QueueStatusChecker(ManagerConnection
> manager, ManagerAction action) {
>=20
> this.manager =3D manager;
>=20
> this.action =3D
> (EventGeneratingAction)action;
>=20
> }
>=20
> public void run() {
>=20
> try {
>=20
>=20
> manager.sendEventGeneratingAction(action, 5000);
>=20
> } catch (Exception e) {
>=20
>=20
> if(e.getClass().getSimpleName().equals("EventTimeoutException")) {
>=20
>=20
> System.out.println("Timeout");
>=20
> }
>=20
> }
>=20
> }
>=20
> }
>=20
>=20
|