[Asterisk-java-users] A bug I think or even two.
Brought to you by:
srt
From: Brett S. <bs...@no...> - 2006-02-09 02:25:23
|
I've come across a problem. I have a thread which is using a blocking queue. The queue contains the next action to pass to the manager api. I call sendAction which fails with a timeout (this is as expected). I then call logout which also fails with a timeout (not excepected) finally I loop back to get the next action from the blocking queue only to find that the queue throws an interrupted exception (not expected). Problem 1. The first problem appears to be that you can't log off if an action is in progress! Problem 2. The Default ManagerConnection class seems to be the source of the second problem. The method DefaultResponseHandler.handleResponse(1172) calls thread.interrupt. This appears to happen after the sendAction and logout have timedout. The trigger appears to be that asterisk decides that it can process the original logout request (based on watching the asterisk logs) So I'm assuming the problem is that the handleResponse method assumes that the thread will be in one of the manager api's such as sendAction or logoff in which case presumably the interrupted exception is caught there. The problem in my case is that my thread is asleep waiting for the next action to be queued and the manager api rudely wakes it up to inform it that it has logged off. Regards, Brett |