Re: [Asterisk-java-users] Asterisk Live package
Brought to you by:
srt
From: Thameem A. <tha...@ya...> - 2006-05-21 04:55:45
|
Hi Stefan, I would like to know where can I find the ManagerConnectionPool. I am looking into the SNAPSHOT 3.0 version javadocs and I don't find any class. I am also having some thread issues with manager connection. Here is my problem details. I am using a agi to authenticate/originate a call and this agi is called from asterisk extensions. This agi also fires an Timer task, and this timer task will set the timeout every 3 minutes after checking the balance of the user who is already in the call. I am following reserve and capture mechanism to do the calculation. So, if there are 10 calls initiated by agi, there are 10 timer tasks running in 10 threads. I am creating one single manager connection and pass them to TimerTask. Each TimerTask's run() method will do the login everytime we need to send the Timeout action. My finally class has the logout() method for the connection. Whenever the channel hangup, i will check the response from asterisk to determine whether I continue run the timertask or cancel. This works without any problem for sometime. I noticed atleast after 2-3 hours i m getting lots of errors in the application server logs. Here are some samples. 2006-05-20 22:01:30,350 [SIP/9000-1811] ERROR com.somepackage.gateway.manager.TimeoutMonitorTask - ERROR: - java.lang.ClassCastException: net.sf.asterisk.manager.response.ManagerError java.lang.ClassCastException: net.sf.asterisk.manager.response.ManagerError at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:442) at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:377) at com.somepackage.gateway.manager.TimeoutMonitorTask.run(Unknown Source) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) 2006-05-20 22:01:31,269 [SIP/9000-0bff] ERROR com.somepackage.gateway.manager.TimeoutMonitorTask - ERROR: - java.lang.ClassCastException: net.sf.asterisk.manager.response.ManagerResponse java.lang.ClassCastException: net.sf.asterisk.manager.response.ManagerResponse at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:442) at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:377) at com.somepackage.gateway.manager.TimeoutMonitorTask.run(Unknown Source) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) 2006-05-20 22:01:31,269 [SIP/9000-0bff] ERROR com.somepackage.gateway.manager.TimeoutMonitorTask - ERROR: - java.lang.ClassCastException: net.sf.asterisk.manager.response.ManagerResponse java.lang.ClassCastException: net.sf.asterisk.manager.response.ManagerResponse at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:442) at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:377) at com.somepackage.gateway.manager.TimeoutMonitorTask.run(Unknown Source) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) 2006-05-20 22:01:31,782 [SIP/9000-ee4b] DEBUG com.somepackage.gateway.manager.TimeoutMonitorTask - [run] - Thread started for Timeout Monitor Task - Sat May 20 22:01:31 EDT 2006 I don;t know why I am getting this ClassCastException error. If I restart the server its fine. Please help me eliminate this errors. Thanks and sorry for the long email, Thameem Stefan Reuter <sr...@re...> wrote: Hi Paul, yes the ManagerConnectionPool is there but it is only used with one connection right now and that works well even with high traffic servers. The idea behind this is using one connection for receiving events and multiple connections with eventMask set to off for sending actions. I am not sure if this design is superior to using only one connections are there are rumors that Asterisk has synchronisation issues when using multiple concurrent connections. So if you did not experience any problems up to now you are probably fine with just one connection. =Stefan -- reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: sr...@re... Jabber: sr...@ja... --------------------------------- Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice. |