asterisk-java-devel Mailing List for Asterisk-Java Library (Page 6)
Brought to you by:
srt
You can subscribe to this list here.
2005 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
(8) |
Jul
(3) |
Aug
(6) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(8) |
Feb
(6) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
(17) |
Aug
(21) |
Sep
(2) |
Oct
(7) |
Nov
(8) |
Dec
(12) |
2007 |
Jan
(10) |
Feb
(19) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(5) |
Oct
(6) |
Nov
(1) |
Dec
(5) |
2008 |
Jan
(12) |
Feb
(15) |
Mar
(18) |
Apr
(34) |
May
(3) |
Jun
(34) |
Jul
(5) |
Aug
(1) |
Sep
(8) |
Oct
|
Nov
(2) |
Dec
(2) |
2009 |
Jan
(8) |
Feb
(2) |
Mar
(35) |
Apr
(16) |
May
(11) |
Jun
(2) |
Jul
(6) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
(4) |
Dec
|
2010 |
Jan
(43) |
Feb
(15) |
Mar
(1) |
Apr
(7) |
May
(3) |
Jun
(7) |
Jul
(1) |
Aug
(3) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(2) |
Mar
(9) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2012 |
Jan
(9) |
Feb
(2) |
Mar
(4) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(10) |
Nov
(10) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(10) |
Dec
|
2014 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(11) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(2) |
Mar
(7) |
Apr
(39) |
May
(18) |
Jun
(6) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
(9) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Videanu A. <vid...@ya...> - 2012-11-08 14:38:50
|
thanks for hint and quick responses Jacob, indeed i try to build an liveMonitor application that will display in an ajax based webpage all the activity inside asteriskServer. Regards, Adrian Videanu --- On Thu, 11/8/12, Jac...@L-... <Jac...@L-...> wrote: From: Jac...@L-... <Jac...@L-...> Subject: Re: [Asterisk-java-devel] Queue refresh To: ast...@li... Date: Thursday, November 8, 2012, 4:10 PM I guess that all depends on what your application is doing! I do not actually use Queues so not sure what you are doing with the queues once you have them. I would keep a local ArrayList of each Queue that contains the members of the queue. This approach would be useful for a Real-time system, if you are just getting the info and displaying it to a static web-page interface keeping an ArrayList of each queue would be a little bit of an over kill. Although you could still listen for the onNewQueueEntry and then get a static list if members for that queue and then update the simi-static page if that is what you are going for. Jacob From: Videanu Adrian [mailto:vid...@ya...] Sent: Thursday, November 08, 2012 7:59 AM To: ast...@li... Subject: Re: [Asterisk-java-devel] Queue refresh ... fair enough, but in this case you should somehow maintain an "artificial and parallel" list of queues in your application. Am I right? Regards, Adrian Videanu --- On Thu, 11/8/12, Jac...@L-... <Jac...@L-...> wrote: From: Jac...@L-... <Jac...@L-...> Subject: Re: [Asterisk-java-devel] Queue refresh To: ast...@li... Date: Thursday, November 8, 2012, 3:46 PMWhy are you doing a second getQueues() command? If you create a class that implements AsteriskServerListner interface and creates your DefaultAsteriskServer object it will automatically notify you when a new queue is add; onNewQueue method is called. Jacob From: Videanu Adrian [mailto:vid...@ya...] Sent: Thursday, November 08, 2012 5:56 AM To: ast...@li... Subject: [Asterisk-java-devel] Queue refresh Hi all, i have this scenario : 1- I do a login in asterisk 2 -get the queues (asteriskServer.getQueues()) 3 -add a new queue in asterisk/ restart asterisk server 4- get the queues (asteriskServer.getQueues()) this is not refreshed :( How can i refresh the asteriskServer.getQueues()? Regards, Adrian Videanu -----Inline Attachment Follows----------------------------------------------------------------------------------- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov -----Inline Attachment Follows-----_______________________________________________ Asterisk-java-devel mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov -----Inline Attachment Follows----- _______________________________________________ Asterisk-java-devel mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: <Jac...@L-...> - 2012-11-08 14:12:00
|
I guess that all depends on what your application is doing! I do not actually use Queues so not sure what you are doing with the queues once you have them. I would keep a local ArrayList of each Queue that contains the members of the queue. This approach would be useful for a Real-time system, if you are just getting the info and displaying it to a static web-page interface keeping an ArrayList of each queue would be a little bit of an over kill. Although you could still listen for the onNewQueueEntry and then get a static list if members for that queue and then update the simi-static page if that is what you are going for. Jacob From: Videanu Adrian [mailto:vid...@ya...] Sent: Thursday, November 08, 2012 7:59 AM To: ast...@li... Subject: Re: [Asterisk-java-devel] Queue refresh ... fair enough, but in this case you should somehow maintain an "artificial and parallel" list of queues in your application. Am I right? Regards, Adrian Videanu --- On Thu, 11/8/12, Jac...@L-... <Jac...@L-...> wrote: From: Jac...@L-... <Jac...@L-...> Subject: Re: [Asterisk-java-devel] Queue refresh To: ast...@li... Date: Thursday, November 8, 2012, 3:46 PM Why are you doing a second getQueues() command? If you create a class that implements AsteriskServerListner interface and creates your DefaultAsteriskServer object it will automatically notify you when a new queue is add; onNewQueue method is called. Jacob From: Videanu Adrian [mailto:vid...@ya...] Sent: Thursday, November 08, 2012 5:56 AM To: ast...@li... Subject: [Asterisk-java-devel] Queue refresh Hi all, i have this scenario : 1- I do a login in asterisk 2 -get the queues (asteriskServer.getQueues()) 3 -add a new queue in asterisk/ restart asterisk server 4- get the queues (asteriskServer.getQueues()) this is not refreshed :( How can i refresh the asteriskServer.getQueues()? Regards, Adrian Videanu -----Inline Attachment Follows----- ------------------------------------------------------------------------ ------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov -----Inline Attachment Follows----- _______________________________________________ Asterisk-java-devel mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: Videanu A. <vid...@ya...> - 2012-11-08 13:59:04
|
... fair enough, but in this case you should somehow maintain an "artificial and parallel" list of queues in your application. Am I right? Regards, Adrian Videanu --- On Thu, 11/8/12, Jac...@L-... <Jac...@L-...> wrote: From: Jac...@L-... <Jac...@L-...> Subject: Re: [Asterisk-java-devel] Queue refresh To: ast...@li... Date: Thursday, November 8, 2012, 3:46 PM Why are you doing a second getQueues() command? If you create a class that implements AsteriskServerListner interface and creates your DefaultAsteriskServer object it will automatically notify you when a new queue is add; onNewQueue method is called. Jacob From: Videanu Adrian [mailto:vid...@ya...] Sent: Thursday, November 08, 2012 5:56 AM To: ast...@li... Subject: [Asterisk-java-devel] Queue refresh Hi all, i have this scenario : 1- I do a login in asterisk 2 -get the queues (asteriskServer.getQueues()) 3 -add a new queue in asterisk/ restart asterisk server 4- get the queues (asteriskServer.getQueues()) this is not refreshed :( How can i refresh the asteriskServer.getQueues()? Regards, Adrian Videanu -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov -----Inline Attachment Follows----- _______________________________________________ Asterisk-java-devel mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: <Jac...@L-...> - 2012-11-08 13:54:10
|
Why are you doing a second getQueues() command? If you create a class that implements AsteriskServerListner interface and creates your DefaultAsteriskServer object it will automatically notify you when a new queue is add; onNewQueue method is called. Jacob From: Videanu Adrian [mailto:vid...@ya...] Sent: Thursday, November 08, 2012 5:56 AM To: ast...@li... Subject: [Asterisk-java-devel] Queue refresh Hi all, i have this scenario : 1- I do a login in asterisk 2 -get the queues (asteriskServer.getQueues()) 3 -add a new queue in asterisk/ restart asterisk server 4- get the queues (asteriskServer.getQueues()) this is not refreshed :( How can i refresh the asteriskServer.getQueues()? Regards, Adrian Videanu |
From: Videanu A. <vid...@ya...> - 2012-11-08 11:56:21
|
Hi all, i have this scenario : 1- I do a login in asterisk 2 -get the queues (asteriskServer.getQueues()) 3 -add a new queue in asterisk/ restart asterisk server 4- get the queues (asteriskServer.getQueues()) this is not refreshed :( How can i refresh the asteriskServer.getQueues()? Regards, Adrian Videanu |
From: Yves A. <yv...@gm...> - 2012-10-17 10:48:45
|
Hi, the code is not complete and I therefore cannot understand dependencies, what is called when and so on. help stucks here... but, as far as I can see... your code seems "overloaded"... or "very complicated"... meaning that the things you are trying to achive could be done "easier" and therefor even cleaner... but that reflects just my opinion after seeing the codefragments, without knowing exactly what your objective is... maybe you could clear that and I can further assist you. regards, yves Am 16.10.2012 19:13, schrieb Jeryes .: > Thank you for the quick reply! > > I've just migrated to AsyncAgi, and I only changed the way the > application connects to Asterisk, and how the application gets the > channelName and uniqueID from AgiRequest, on service event. Is there > other alterations that impacts on the migration from Sync to Async. Do > I need to change the way that I invoke the commands on channel, like > answer, streamFile, rec, playMusicOnHold ? > The main idea to migrate to AsyncAgi, in a first step, is to process > some events on AMI, like stoped MusicOnHold, which is not delivered to > AMI Listener when using Sync connection. > > Brett, > > I reduced the pool to 5 threads and I couldn't reproduce that > situation, maybe it is occurring in some exclusive types of call > processing, so I gotta do more tests... > Thanks! > > AgiScript: > > > public class AsteriskServer extends BaseAgiScript > { > > private CallEventListener callEventListener; > > public void service(AgiRequest request, AgiChannel channel) throws > AgiException > { > * // I didn't find a better way the get those values...* > *String[] paramList = ((String) > request.getRequest().get("request")).split("\n"); > String channelName = paramList[1].split(":")[1].trim(); > String uniqueID = paramList[4].split(":")[1].trim();* > String fromAddress = channel.getVariable("SIP_HEADER(FROM)"); > String toAddress = channel.getVariable("SIP_HEADER(TO)"); > > // The event is added into a queue and treated by another > threadpool, to release the current thread. > callEventListener.callCreated(request, channel, fromAddress, > toAddress, channelName, uniqueID); > > *// keep channel stuck while process the call, that will be released > on disconnect command* > waitProcessing(channel); > } > > * //Command executed by CallEventListener to release the channel.* > public void disconnect(AgiChannel channel) > { > processingDone(channel); > } > > public void *waitProcessing*(AgiChannel channel) throws > InterruptedException > { > System.out.println("wait until call get released..."); > synchronized (channel) > { > channel.wait(); > } > } > > public void *processingDone*(AgiChannel channel) > { > System.out.println("releasing call..."); > synchronized (channel) > { > channel.notify(); > } > } > > public void addCallEventListener(CallEventListener callEventListener) > { > this.callEventListener = callEventListener; > } > > public void startup() > { > new AsyncAsteriskServerConnector(this, "192.168.192.32", > "dev", "dev").connect(); > } > > class *AsyncAsteriskServerConnector* implements Runnable > { > private BaseAgiScript agiScript; > private ManagerConnection connection; > > public AsyncAsteriskServerConnector(BaseAgiScript agiScript, > String ip, String username, String passwd) > { > this.agiScript = agiScript; > connection = new DefaultManagerConnection(ip, username, > passwd); > } > > public ManagerConnection connect() > { > new Thread(this).start(); > return connection; > } > > public void run() > { > AsyncAgiServer agiServer = new AsyncAgiServer(agiScript); > connection.addEventListener(agiServer); > > try > { > connection.login(); > synchronized (this.agiScript) > { > agiScript.wait(); > } > } catch (Throwable e) {e.printStackTrace();} > } > } > } > > > 2012/10/15 Brett Sutton <bs...@no... > <mailto:bs...@no...>> > > I would suggest that you get something like Visual VM which will > give you and good idea of what your application is doing. > Of course any decent dev environment like eclipse will tell you > what threads a running and you can then pause them to see if and > where they are stuck. > > Also reduce the pool to a really small number (10) and see if it > gets stuck sooner. > > Brett > > > On 16/10/12 09:18, Jeryes . wrote: >> Hi All! >> >> I'm working with asterisk 1.6.3 and asterisk-java 1.0.0.M3, and I >> have an implementation of BaseAgiScript, that connects to >> Asterisk with AsyncAgiServer. After some calls, between 100 ou >> 200 , the agiscript stops to receive the */service/* events, this >> error log is thrown instead: >> >> 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] 137706502 [Asterisk-Java ManagerConnection-1-Reader-0] >> WARN org.asteriskjava.fastagi.AsyncAgiServer - Unable to execute >> org.asteriskjava.fastagi.internal.AsyncAgiConnectionHandler >> 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] java.util.concurrent.RejectedExecutionException >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1768) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.fastagi.AbstractAgiServer.execute(AbstractAgiServer.java:137) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.fastagi.AsyncAgiServer.handleAsyncAgiEvent(AsyncAgiServer.java:89) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.fastagi.AsyncAgiServer.onManagerEvent(AsyncAgiServer.java:68) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.manager.internal.ManagerConnectionImpl.fireEvent(ManagerConnectionImpl.java:1245) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.manager.internal.ManagerConnectionImpl.dispatchEvent(ManagerConnectionImpl.java:1229) >> >> 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.manager.internal.ManagerReaderImpl.run(ManagerReaderImpl.java:220) >> >> 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at java.lang.Thread.run(Thread.java:619) >> >> >> The pool size is 1000, configured on file fastagi.properties: >> poolSize=1000 >> >> Can it be stuck threads, that should be released? Is there any >> way to check how many threads of the pool are in use? >> >> Thanks in advance! >> >> Regards >> Jeryes >> >> >> >> ------------------------------------------------------------------------------ >> Don't let slow site performance ruin your business. Deploy New Relic APM >> Deploy New Relic app performance management and know exactly >> what is happening inside your Ruby, Python, PHP, Java, and .NET app >> Try New Relic at no cost today and get our sweet Data Nerd shirt too! >> http://p.sf.net/sfu/newrelic-dev2dev >> >> >> _______________________________________________ >> Asterisk-java-devel mailing list >> Ast...@li... <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New > Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: Brett S. <bs...@no...> - 2012-10-17 01:05:42
|
I don't have enough info to provide a coherent answer. One thing to watch with async is that channel variables don't always appear immediately and so you some times need to poll for the channel vars. You should also investigate CountDownLatch as a replacement with wait notify as these don't do quite what you expect in all cases. e.g. wait can wake even when not notified. Brett On 17/10/12 04:13, Jeryes . wrote: > Thank you for the quick reply! > > I've just migrated to AsyncAgi, and I only changed the way the > application connects to Asterisk, and how the application gets the > channelName and uniqueID from AgiRequest, on service event. Is there > other alterations that impacts on the migration from Sync to Async. Do > I need to change the way that I invoke the commands on channel, like > answer, streamFile, rec, playMusicOnHold ? > The main idea to migrate to AsyncAgi, in a first step, is to process > some events on AMI, like stoped MusicOnHold, which is not delivered to > AMI Listener when using Sync connection. > > Brett, > > I reduced the pool to 5 threads and I couldn't reproduce that > situation, maybe it is occurring in some exclusive types of call > processing, so I gotta do more tests... > Thanks! > > AgiScript: > > > public class AsteriskServer extends BaseAgiScript > { > > private CallEventListener callEventListener; > > public void service(AgiRequest request, AgiChannel channel) throws > AgiException > { > * // I didn't find a better way the get those values...* > *String[] paramList = ((String) > request.getRequest().get("request")).split("\n"); > String channelName = paramList[1].split(":")[1].trim(); > String uniqueID = paramList[4].split(":")[1].trim();* > String fromAddress = channel.getVariable("SIP_HEADER(FROM)"); > String toAddress = channel.getVariable("SIP_HEADER(TO)"); > > // The event is added into a queue and treated by another > threadpool, to release the current thread. > callEventListener.callCreated(request, channel, fromAddress, > toAddress, channelName, uniqueID); > > *// keep channel stuck while process the call, that will be released > on disconnect command* > waitProcessing(channel); > } > > * //Command executed by CallEventListener to release the channel.* > public void disconnect(AgiChannel channel) > { > processingDone(channel); > } > > public void *waitProcessing*(AgiChannel channel) throws > InterruptedException > { > System.out.println("wait until call get released..."); > synchronized (channel) > { > channel.wait(); > } > } > > public void *processingDone*(AgiChannel channel) > { > System.out.println("releasing call..."); > synchronized (channel) > { > channel.notify(); > } > } > > public void addCallEventListener(CallEventListener callEventListener) > { > this.callEventListener = callEventListener; > } > > public void startup() > { > new AsyncAsteriskServerConnector(this, "192.168.192.32", > "dev", "dev").connect(); > } > > class *AsyncAsteriskServerConnector* implements Runnable > { > private BaseAgiScript agiScript; > private ManagerConnection connection; > > public AsyncAsteriskServerConnector(BaseAgiScript agiScript, > String ip, String username, String passwd) > { > this.agiScript = agiScript; > connection = new DefaultManagerConnection(ip, username, > passwd); > } > > public ManagerConnection connect() > { > new Thread(this).start(); > return connection; > } > > public void run() > { > AsyncAgiServer agiServer = new AsyncAgiServer(agiScript); > connection.addEventListener(agiServer); > > try > { > connection.login(); > synchronized (this.agiScript) > { > agiScript.wait(); > } > } catch (Throwable e) {e.printStackTrace();} > } > } > } > > > 2012/10/15 Brett Sutton <bs...@no... > <mailto:bs...@no...>> > > I would suggest that you get something like Visual VM which will > give you and good idea of what your application is doing. > Of course any decent dev environment like eclipse will tell you > what threads a running and you can then pause them to see if and > where they are stuck. > > Also reduce the pool to a really small number (10) and see if it > gets stuck sooner. > > Brett > > > On 16/10/12 09:18, Jeryes . wrote: >> Hi All! >> >> I'm working with asterisk 1.6.3 and asterisk-java 1.0.0.M3, and I >> have an implementation of BaseAgiScript, that connects to >> Asterisk with AsyncAgiServer. After some calls, between 100 ou >> 200 , the agiscript stops to receive the */service/* events, this >> error log is thrown instead: >> >> 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] 137706502 [Asterisk-Java ManagerConnection-1-Reader-0] >> WARN org.asteriskjava.fastagi.AsyncAgiServer - Unable to execute >> org.asteriskjava.fastagi.internal.AsyncAgiConnectionHandler >> 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] java.util.concurrent.RejectedExecutionException >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1768) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.fastagi.AbstractAgiServer.execute(AbstractAgiServer.java:137) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.fastagi.AsyncAgiServer.handleAsyncAgiEvent(AsyncAgiServer.java:89) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.fastagi.AsyncAgiServer.onManagerEvent(AsyncAgiServer.java:68) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.manager.internal.ManagerConnectionImpl.fireEvent(ManagerConnectionImpl.java:1245) >> >> 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.manager.internal.ManagerConnectionImpl.dispatchEvent(ManagerConnectionImpl.java:1229) >> >> 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at >> org.asteriskjava.manager.internal.ManagerReaderImpl.run(ManagerReaderImpl.java:220) >> >> 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) >> [STDERR] at java.lang.Thread.run(Thread.java:619) >> >> >> The pool size is 1000, configured on file fastagi.properties: >> poolSize=1000 >> >> Can it be stuck threads, that should be released? Is there any >> way to check how many threads of the pool are in use? >> >> Thanks in advance! >> >> Regards >> Jeryes >> >> >> >> ------------------------------------------------------------------------------ >> Don't let slow site performance ruin your business. Deploy New Relic APM >> Deploy New Relic app performance management and know exactly >> what is happening inside your Ruby, Python, PHP, Java, and .NET app >> Try New Relic at no cost today and get our sweet Data Nerd shirt too! >> http://p.sf.net/sfu/newrelic-dev2dev >> >> >> _______________________________________________ >> Asterisk-java-devel mailing list >> Ast...@li... <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New > Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: Jeryes . <je...@vo...> - 2012-10-16 17:14:03
|
Thank you for the quick reply! I've just migrated to AsyncAgi, and I only changed the way the application connects to Asterisk, and how the application gets the channelName and uniqueID from AgiRequest, on service event. Is there other alterations that impacts on the migration from Sync to Async. Do I need to change the way that I invoke the commands on channel, like answer, streamFile, rec, playMusicOnHold ? The main idea to migrate to AsyncAgi, in a first step, is to process some events on AMI, like stoped MusicOnHold, which is not delivered to AMI Listener when using Sync connection. Brett, I reduced the pool to 5 threads and I couldn't reproduce that situation, maybe it is occurring in some exclusive types of call processing, so I gotta do more tests... Thanks! AgiScript: public class AsteriskServer extends BaseAgiScript { private CallEventListener callEventListener; public void service(AgiRequest request, AgiChannel channel) throws AgiException { * // I didn't find a better way the get those values...* *String[] paramList = ((String) request.getRequest().get("request")).split("\n"); String channelName = paramList[1].split(":")[1].trim(); String uniqueID = paramList[4].split(":")[1].trim();* String fromAddress = channel.getVariable("SIP_HEADER(FROM)"); String toAddress = channel.getVariable("SIP_HEADER(TO)"); // The event is added into a queue and treated by another threadpool, to release the current thread. callEventListener.callCreated(request, channel, fromAddress, toAddress, channelName, uniqueID); *// keep channel stuck while process the call, that will be released on disconnect command* waitProcessing(channel); } * //Command executed by CallEventListener to release the channel.* public void disconnect(AgiChannel channel) { processingDone(channel); } public void *waitProcessing*(AgiChannel channel) throws InterruptedException { System.out.println("wait until call get released..."); synchronized (channel) { channel.wait(); } } public void *processingDone*(AgiChannel channel) { System.out.println("releasing call..."); synchronized (channel) { channel.notify(); } } public void addCallEventListener(CallEventListener callEventListener) { this.callEventListener = callEventListener; } public void startup() { new AsyncAsteriskServerConnector(this, "192.168.192.32", "dev", "dev").connect(); } class *AsyncAsteriskServerConnector* implements Runnable { private BaseAgiScript agiScript; private ManagerConnection connection; public AsyncAsteriskServerConnector(BaseAgiScript agiScript, String ip, String username, String passwd) { this.agiScript = agiScript; connection = new DefaultManagerConnection(ip, username, passwd); } public ManagerConnection connect() { new Thread(this).start(); return connection; } public void run() { AsyncAgiServer agiServer = new AsyncAgiServer(agiScript); connection.addEventListener(agiServer); try { connection.login(); synchronized (this.agiScript) { agiScript.wait(); } } catch (Throwable e) {e.printStackTrace();} } } } 2012/10/15 Brett Sutton <bs...@no...> > I would suggest that you get something like Visual VM which will give you > and good idea of what your application is doing. > Of course any decent dev environment like eclipse will tell you what > threads a running and you can then pause them to see if and where they are > stuck. > > Also reduce the pool to a really small number (10) and see if it gets > stuck sooner. > > Brett > > > On 16/10/12 09:18, Jeryes . wrote: > > Hi All! > > I'm working with asterisk 1.6.3 and asterisk-java 1.0.0.M3, and I have an > implementation of BaseAgiScript, that connects to Asterisk with > AsyncAgiServer. After some calls, between 100 ou 200 , the agiscript stops > to receive the *service* events, this error log is thrown instead: > > 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > 137706502 [Asterisk-Java ManagerConnection-1-Reader-0] WARN > org.asteriskjava.fastagi.AsyncAgiServer - Unable to execute > org.asteriskjava.fastagi.internal.AsyncAgiConnectionHandler > 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > java.util.concurrent.RejectedExecutionException > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1768) > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767) > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658) > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at > org.asteriskjava.fastagi.AbstractAgiServer.execute(AbstractAgiServer.java:137) > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at > org.asteriskjava.fastagi.AsyncAgiServer.handleAsyncAgiEvent(AsyncAgiServer.java:89) > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at > org.asteriskjava.fastagi.AsyncAgiServer.onManagerEvent(AsyncAgiServer.java:68) > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at > org.asteriskjava.manager.internal.ManagerConnectionImpl.fireEvent(ManagerConnectionImpl.java:1245) > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at > org.asteriskjava.manager.internal.ManagerConnectionImpl.dispatchEvent(ManagerConnectionImpl.java:1229) > 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at > org.asteriskjava.manager.internal.ManagerReaderImpl.run(ManagerReaderImpl.java:220) > 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] > at java.lang.Thread.run(Thread.java:619) > > > The pool size is 1000, configured on file fastagi.properties: > poolSize=1000 > > Can it be stuck threads, that should be released? Is there any way to > check how many threads of the pool are in use? > > Thanks in advance! > > Regards > Jeryes > > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too!http://p.sf.net/sfu/newrelic-dev2dev > > > > _______________________________________________ > Asterisk-java-devel mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > |
From: Brett S. <bs...@no...> - 2012-10-15 23:10:28
|
I would suggest that you get something like Visual VM which will give you and good idea of what your application is doing. Of course any decent dev environment like eclipse will tell you what threads a running and you can then pause them to see if and where they are stuck. Also reduce the pool to a really small number (10) and see if it gets stuck sooner. Brett On 16/10/12 09:18, Jeryes . wrote: > Hi All! > > I'm working with asterisk 1.6.3 and asterisk-java 1.0.0.M3, and I have > an implementation of BaseAgiScript, that connects to Asterisk with > AsyncAgiServer. After some calls, between 100 ou 200 , the agiscript > stops to receive the */service/* events, this error log is thrown instead: > > 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] 137706502 [Asterisk-Java ManagerConnection-1-Reader-0] WARN > org.asteriskjava.fastagi.AsyncAgiServer - Unable to execute > org.asteriskjava.fastagi.internal.AsyncAgiConnectionHandler > 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] java.util.concurrent.RejectedExecutionException > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1768) > > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767) > > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658) > > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at > org.asteriskjava.fastagi.AbstractAgiServer.execute(AbstractAgiServer.java:137) > > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at > org.asteriskjava.fastagi.AsyncAgiServer.handleAsyncAgiEvent(AsyncAgiServer.java:89) > > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at > org.asteriskjava.fastagi.AsyncAgiServer.onManagerEvent(AsyncAgiServer.java:68) > > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at > org.asteriskjava.manager.internal.ManagerConnectionImpl.fireEvent(ManagerConnectionImpl.java:1245) > > 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at > org.asteriskjava.manager.internal.ManagerConnectionImpl.dispatchEvent(ManagerConnectionImpl.java:1229) > > 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at > org.asteriskjava.manager.internal.ManagerReaderImpl.run(ManagerReaderImpl.java:220) > > 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) > [STDERR] at java.lang.Thread.run(Thread.java:619) > > > The pool size is 1000, configured on file fastagi.properties: > poolSize=1000 > > Can it be stuck threads, that should be released? Is there any way to > check how many threads of the pool are in use? > > Thanks in advance! > > Regards > Jeryes > > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: Jeryes . <je...@vo...> - 2012-10-15 22:18:40
|
Hi All! I'm working with asterisk 1.6.3 and asterisk-java 1.0.0.M3, and I have an implementation of BaseAgiScript, that connects to Asterisk with AsyncAgiServer. After some calls, between 100 ou 200 , the agiscript stops to receive the *service* events, this error log is thrown instead: 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] 137706502 [Asterisk-Java ManagerConnection-1-Reader-0] WARN org.asteriskjava.fastagi.AsyncAgiServer - Unable to execute org.asteriskjava.fastagi.internal.AsyncAgiConnectionHandler 16:19:33,040 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] java.util.concurrent.RejectedExecutionException 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1768) 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767) 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658) 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at org.asteriskjava.fastagi.AbstractAgiServer.execute(AbstractAgiServer.java:137) 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at org.asteriskjava.fastagi.AsyncAgiServer.handleAsyncAgiEvent(AsyncAgiServer.java:89) 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at org.asteriskjava.fastagi.AsyncAgiServer.onManagerEvent(AsyncAgiServer.java:68) 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at org.asteriskjava.manager.internal.ManagerConnectionImpl.fireEvent(ManagerConnectionImpl.java:1245) 16:19:33,041 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at org.asteriskjava.manager.internal.ManagerConnectionImpl.dispatchEvent(ManagerConnectionImpl.java:1229) 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at org.asteriskjava.manager.internal.ManagerReaderImpl.run(ManagerReaderImpl.java:220) 16:19:33,042 ERROR (Asterisk-Java ManagerConnection-1-Reader-0) [STDERR] at java.lang.Thread.run(Thread.java:619) The pool size is 1000, configured on file fastagi.properties: poolSize=1000 Can it be stuck threads, that should be released? Is there any way to check how many threads of the pool are in use? Thanks in advance! Regards Jeryes |
From: Brett S. <bs...@no...> - 2012-10-11 12:54:23
|
I wouldn't panic about the threads unless the number grows over time or they start thrashing the CPU. Jac...@L-... wrote: >Adrian, > >You should be able to handle this with only one connection to asterisk. >You do not need to open/close your connection to Asterisk every time >you >need to run a different job. I use asterisk-java in a glassfish server >as well. I open one connection at start of day (Start of Server) and >maintain that one connection until the server is stopped. This way you >can post as many Actions to the server and receive all Events coming >back with one connection. Although I do not use queues at all so I do >not see this generation of numerous threads, it does open a few. I am >processing several hundred calls daily so the number of calls should >not >matter. > > >Jacob > >-----Original Message----- >From: Videanu Adrian [mailto:vid...@ya...] >Sent: Thursday, October 11, 2012 1:03 AM >To: ast...@li... >Subject: Re: [Asterisk-java-devel] ServiceLevelTimer problem > > >Hi Brett, >yes indeed, ideally is to open one connection and then use that one, >only that i have different jobs to do on asterisk server when i receive >some webservice calls. I have 40-50 calls (asterisk connects) daily, >but >every connect generates a lot of threads because i have a lot of queues >:( > >regards, >Adrian Videanu > > >--- On Thu, 10/11/12, Brett Sutton <bs...@no...> wrote: > >> From: Brett Sutton <bs...@no...> >> Subject: Re: [Asterisk-java-devel] ServiceLevelTimer problem >> To: ast...@li... >> Date: Thursday, October 11, 2012, 8:22 AM Not certain about the >> threads with asteriskjava live but just a note of caution. You want >to > >> minimise the number of connections to asterisk. >> Generally you should just have a single connection (which actually >> results in two open sockets (reader and a writer)) which you keep >open > >> (you need to handle disconnects). >> >> Brett >> >> >> >> On 11/10/12 16:17, Videanu Adrian wrote: >> > Hi all, >> > I develop a application using asteriskJava, running on >> glassfish and i encountered some issues related to the >> number of threads opened every time i connect to asterisk >> server. >> > So, my setup is as follows: >> > 1. i connect to the asterisk server using the live >> class AsteriskServer asteriskServer = new >> DefaultAsteriskServer(user,pass....) >> > 2. after the connection is done I observed a number of >> threads equal to the number of my queues (from asterisk) >> opened, with names like ServiceLevelTimer-QueueName >> > >> > I thought that when i access asteriskServer.shutdown() >> these threads will be closed automatically, but this is not >> happening. >> > Is this the expected behavior or this a bug ? >> > >> > I have to mention that i do not have any class that >> implements AsteriskQueueListener. >> > >> > PS. my situation is even more complicated because i >> perform a lot of connect/disconnect cycles and i end up with >> a lot of threads with status waiting. >> > >> > Regards, >> > Adrian Videanu >> > >> > >> >------------------------------------------------------------------------ >------ >> > Don't let slow site performance ruin your business. >> Deploy New Relic APM >> > Deploy New Relic app performance management and know >> exactly >> > what is happening inside your Ruby, Python, PHP, Java, >> and .NET app >> > Try New Relic at no cost today and get our sweet Data >> Nerd shirt too! >> > http://p.sf.net/sfu/newrelic-dev2dev >> > _______________________________________________ >> > Asterisk-java-devel mailing list >> > Ast...@li... >> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel >> >> >> >------------------------------------------------------------------------ >------ >> Don't let slow site performance ruin your business. Deploy >> New Relic APM >> Deploy New Relic app performance management and know >> exactly >> what is happening inside your Ruby, Python, PHP, Java, and >> .NET app >> Try New Relic at no cost today and get our sweet Data Nerd >> shirt too! >> http://p.sf.net/sfu/newrelic-dev2dev >> _______________________________________________ >> Asterisk-java-devel mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel >> > >------------------------------------------------------------------------ >------ >Don't let slow site performance ruin your business. Deploy New Relic >APM >Deploy New Relic app performance management and know exactly >what is happening inside your Ruby, Python, PHP, Java, and .NET app >Try New Relic at no cost today and get our sweet Data Nerd shirt too! >http://p.sf.net/sfu/newrelic-dev2dev >_______________________________________________ >Asterisk-java-devel mailing list >Ast...@li... >https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > >------------------------------------------------------------------------------ >Don't let slow site performance ruin your business. Deploy New Relic >APM >Deploy New Relic app performance management and know exactly >what is happening inside your Ruby, Python, PHP, Java, and .NET app >Try New Relic at no cost today and get our sweet Data Nerd shirt too! >http://p.sf.net/sfu/newrelic-dev2dev >_______________________________________________ >Asterisk-java-devel mailing list >Ast...@li... >https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. |
From: <Jac...@L-...> - 2012-10-11 12:10:53
|
Adrian, You should be able to handle this with only one connection to asterisk. You do not need to open/close your connection to Asterisk every time you need to run a different job. I use asterisk-java in a glassfish server as well. I open one connection at start of day (Start of Server) and maintain that one connection until the server is stopped. This way you can post as many Actions to the server and receive all Events coming back with one connection. Although I do not use queues at all so I do not see this generation of numerous threads, it does open a few. I am processing several hundred calls daily so the number of calls should not matter. Jacob -----Original Message----- From: Videanu Adrian [mailto:vid...@ya...] Sent: Thursday, October 11, 2012 1:03 AM To: ast...@li... Subject: Re: [Asterisk-java-devel] ServiceLevelTimer problem Hi Brett, yes indeed, ideally is to open one connection and then use that one, only that i have different jobs to do on asterisk server when i receive some webservice calls. I have 40-50 calls (asterisk connects) daily, but every connect generates a lot of threads because i have a lot of queues :( regards, Adrian Videanu --- On Thu, 10/11/12, Brett Sutton <bs...@no...> wrote: > From: Brett Sutton <bs...@no...> > Subject: Re: [Asterisk-java-devel] ServiceLevelTimer problem > To: ast...@li... > Date: Thursday, October 11, 2012, 8:22 AM Not certain about the > threads with asteriskjava live but just a note of caution. You want to > minimise the number of connections to asterisk. > Generally you should just have a single connection (which actually > results in two open sockets (reader and a writer)) which you keep open > (you need to handle disconnects). > > Brett > > > > On 11/10/12 16:17, Videanu Adrian wrote: > > Hi all, > > I develop a application using asteriskJava, running on > glassfish and i encountered some issues related to the > number of threads opened every time i connect to asterisk > server. > > So, my setup is as follows: > > 1. i connect to the asterisk server using the live > class AsteriskServer asteriskServer = new > DefaultAsteriskServer(user,pass....) > > 2. after the connection is done I observed a number of > threads equal to the number of my queues (from asterisk) > opened, with names like ServiceLevelTimer-QueueName > > > > I thought that when i access asteriskServer.shutdown() > these threads will be closed automatically, but this is not > happening. > > Is this the expected behavior or this a bug ? > > > > I have to mention that i do not have any class that > implements AsteriskQueueListener. > > > > PS. my situation is even more complicated because i > perform a lot of connect/disconnect cycles and i end up with > a lot of threads with status waiting. > > > > Regards, > > Adrian Videanu > > > > > ------------------------------------------------------------------------ ------ > > Don't let slow site performance ruin your business. > Deploy New Relic APM > > Deploy New Relic app performance management and know > exactly > > what is happening inside your Ruby, Python, PHP, Java, > and .NET app > > Try New Relic at no cost today and get our sweet Data > Nerd shirt too! > > http://p.sf.net/sfu/newrelic-dev2dev > > _______________________________________________ > > Asterisk-java-devel mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > ------------------------------------------------------------------------ ------ > Don't let slow site performance ruin your business. Deploy > New Relic APM > Deploy New Relic app performance management and know > exactly > what is happening inside your Ruby, Python, PHP, Java, and > .NET app > Try New Relic at no cost today and get our sweet Data Nerd > shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > ------------------------------------------------------------------------ ------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ Asterisk-java-devel mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: Videanu A. <vid...@ya...> - 2012-10-11 06:02:46
|
Hi Brett, yes indeed, ideally is to open one connection and then use that one, only that i have different jobs to do on asterisk server when i receive some webservice calls. I have 40-50 calls (asterisk connects) daily, but every connect generates a lot of threads because i have a lot of queues :( regards, Adrian Videanu --- On Thu, 10/11/12, Brett Sutton <bs...@no...> wrote: > From: Brett Sutton <bs...@no...> > Subject: Re: [Asterisk-java-devel] ServiceLevelTimer problem > To: ast...@li... > Date: Thursday, October 11, 2012, 8:22 AM > Not certain about the threads with > asteriskjava live but just a note of > caution. You want to minimise the number of connections to > asterisk. > Generally you should just have a single connection (which > actually > results in two open sockets (reader and a writer)) which you > keep open > (you need to handle disconnects). > > Brett > > > > On 11/10/12 16:17, Videanu Adrian wrote: > > Hi all, > > I develop a application using asteriskJava, running on > glassfish and i encountered some issues related to the > number of threads opened every time i connect to asterisk > server. > > So, my setup is as follows: > > 1. i connect to the asterisk server using the live > class AsteriskServer asteriskServer = new > DefaultAsteriskServer(user,pass....) > > 2. after the connection is done I observed a number of > threads equal to the number of my queues (from asterisk) > opened, with names like ServiceLevelTimer-QueueName > > > > I thought that when i access asteriskServer.shutdown() > these threads will be closed automatically, but this is not > happening. > > Is this the expected behavior or this a bug ? > > > > I have to mention that i do not have any class that > implements AsteriskQueueListener. > > > > PS. my situation is even more complicated because i > perform a lot of connect/disconnect cycles and i end up with > a lot of threads with status waiting. > > > > Regards, > > Adrian Videanu > > > > > ------------------------------------------------------------------------------ > > Don't let slow site performance ruin your business. > Deploy New Relic APM > > Deploy New Relic app performance management and know > exactly > > what is happening inside your Ruby, Python, PHP, Java, > and .NET app > > Try New Relic at no cost today and get our sweet Data > Nerd shirt too! > > http://p.sf.net/sfu/newrelic-dev2dev > > _______________________________________________ > > Asterisk-java-devel mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy > New Relic APM > Deploy New Relic app performance management and know > exactly > what is happening inside your Ruby, Python, PHP, Java, and > .NET app > Try New Relic at no cost today and get our sweet Data Nerd > shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > |
From: Brett S. <bs...@no...> - 2012-10-11 05:54:51
|
Not certain about the threads with asteriskjava live but just a note of caution. You want to minimise the number of connections to asterisk. Generally you should just have a single connection (which actually results in two open sockets (reader and a writer)) which you keep open (you need to handle disconnects). Brett On 11/10/12 16:17, Videanu Adrian wrote: > Hi all, > I develop a application using asteriskJava, running on glassfish and i encountered some issues related to the number of threads opened every time i connect to asterisk server. > So, my setup is as follows: > 1. i connect to the asterisk server using the live class AsteriskServer asteriskServer = new DefaultAsteriskServer(user,pass....) > 2. after the connection is done I observed a number of threads equal to the number of my queues (from asterisk) opened, with names like ServiceLevelTimer-QueueName > > I thought that when i access asteriskServer.shutdown() these threads will be closed automatically, but this is not happening. > Is this the expected behavior or this a bug ? > > I have to mention that i do not have any class that implements AsteriskQueueListener. > > PS. my situation is even more complicated because i perform a lot of connect/disconnect cycles and i end up with a lot of threads with status waiting. > > Regards, > Adrian Videanu > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: Videanu A. <vid...@ya...> - 2012-10-11 05:17:22
|
Hi all, I develop a application using asteriskJava, running on glassfish and i encountered some issues related to the number of threads opened every time i connect to asterisk server. So, my setup is as follows: 1. i connect to the asterisk server using the live class AsteriskServer asteriskServer = new DefaultAsteriskServer(user,pass....) 2. after the connection is done I observed a number of threads equal to the number of my queues (from asterisk) opened, with names like ServiceLevelTimer-QueueName I thought that when i access asteriskServer.shutdown() these threads will be closed automatically, but this is not happening. Is this the expected behavior or this a bug ? I have to mention that i do not have any class that implements AsteriskQueueListener. PS. my situation is even more complicated because i perform a lot of connect/disconnect cycles and i end up with a lot of threads with status waiting. Regards, Adrian Videanu |
From: Jeryes . <je...@vo...> - 2012-09-20 21:25:59
|
Hi there, I'm working with FastAGI and Manager API on asterisk 1.8.11-cert7, and I am facing a problem to interrupt the streamFile. I've tried some ways to fix the problem: Using playMusicOnHold instead of streamFile worked, it was possible to interrupt the play, but if the caller releases de call while playing, the Manager API doesn't show the Hangup or stopMusicOnHold Event, is that the right behave? Using streamFile to play and RedirectAction (AsyncAgi) to interrupt didn't work, the channel is released when the Redirect is executed. Do anyone have faced the same problem? Thanks in advance! |
From: Kaan Ç. <cal...@gm...> - 2012-07-03 04:46:59
|
Hi All, I want to ask some questions about asterisk jtapi connections. First of all i am trying to use asterisk-java-0.2.jar library to use jtapi implementation, but i can't connect to asterisk server via DefaultManagerConnection login method; DefaultManagerConnection con = new DefaultManagerConnection("172.20.165.82", 5038, "admin", "root01"); //con.setDefaultResponseTimeout(10000); con.login(); I am getting "Timeout waiting for response to Challenge" error message on console, and getting "2012-07-02 16:07:55,756 ERROR [DefaultManagerConnection] Unable to retrieve internalActionId from response: actionId 'null': net.sf.asterisk.manager.response.ChallengeResponse: actionId='null'; message='null'; response='Success'; uniqueId='null'; systemHashcode=8694729" error message on client side. I analyze the communication between the server and client via WireShark and all things are same with jars. On the other hand i can login to asterisk server via asterisk-java-0.3.jar properly. I am trying to find differences between the jar files, but i can't find anything which is important. So i need your help to use jtapi. My asterisk server version is --> 1.8.7 Best regards. |
From: Timothy R. <tim...@gm...> - 2012-06-05 14:20:23
|
I'm not a project contributor. But I think it makes sense that asterisk-java would invoke the listener for each distinct press. If it doesn't, wouldn't a better approach be to write a patch for it instead of using reflection? On Jun 5, 2012, at 9:24 AM, Hoai-Anh Ngo-Vi <ho...@gm...> wrote: > Answer to myself, > > Using reflection has worked out. But this seems to me a bit dirty. Is > there any more asterisk-java native way? > > +++++ > @Override > public void propertyChange(PropertyChangeEvent arg0) { > > AsteriskChannel asteriskChannel = (AsteriskChannel) > arg0.getSource(); > String chanId = asteriskChannel.getId(); > > > logger.info(chanId+"::"+arg0.getPropertyName()+"::"+arg0.getOldValue()); > > logger.info(chanId+"::"+arg0.getPropertyName()+"::"+arg0.getNewValue()); > > // workaround to reset invisible field by default > try { > String fieldName = arg0.getPropertyName(); > if(fieldName.startsWith("dtmf")) { > Class<?> c = asteriskChannel.getClass(); > java.lang.reflect.Field field = > c.getDeclaredField(fieldName); > field.setAccessible(true); > field.set(asteriskChannel, null); > } > > } catch (SecurityException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (NoSuchFieldException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (IllegalArgumentException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (IllegalAccessException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > } > +++++ > > Am 05.06.12 15:16, schrieb Hoai-Anh Ngo-Vi: >> Dear developers, >> >> I add a PropertyChangeListener to AsteriskChannel. In method >> propertyChange() I read the propertiy dtmfReceived. When a single digit, >> let's say '#' is pressed several times the method is called only one >> time. But I want the method to be called everytime so I came to the idea >> of reseting dimfReceived to null. But due to the visibility of >> AsteriskChannelImpl this is not possible. Is there any way to do that? I >> do not want to modify the original Code? >> >> Thank you for your supports >> > > > -- > Ngô Vi Hoài Anh > Biedenkopfer Weg 13 > 60489 Frankfurt am Main > > 069 74 22 36 63 > 0172 53 97 0 82 > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: Hoai-Anh Ngo-Vi <ho...@gm...> - 2012-06-05 13:24:22
|
Answer to myself, Using reflection has worked out. But this seems to me a bit dirty. Is there any more asterisk-java native way? +++++ @Override public void propertyChange(PropertyChangeEvent arg0) { AsteriskChannel asteriskChannel = (AsteriskChannel) arg0.getSource(); String chanId = asteriskChannel.getId(); logger.info(chanId+"::"+arg0.getPropertyName()+"::"+arg0.getOldValue()); logger.info(chanId+"::"+arg0.getPropertyName()+"::"+arg0.getNewValue()); // workaround to reset invisible field by default try { String fieldName = arg0.getPropertyName(); if(fieldName.startsWith("dtmf")) { Class<?> c = asteriskChannel.getClass(); java.lang.reflect.Field field = c.getDeclaredField(fieldName); field.setAccessible(true); field.set(asteriskChannel, null); } } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NoSuchFieldException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } } +++++ Am 05.06.12 15:16, schrieb Hoai-Anh Ngo-Vi: > Dear developers, > > I add a PropertyChangeListener to AsteriskChannel. In method > propertyChange() I read the propertiy dtmfReceived. When a single digit, > let's say '#' is pressed several times the method is called only one > time. But I want the method to be called everytime so I came to the idea > of reseting dimfReceived to null. But due to the visibility of > AsteriskChannelImpl this is not possible. Is there any way to do that? I > do not want to modify the original Code? > > Thank you for your supports > -- Ngô Vi Hoài Anh Biedenkopfer Weg 13 60489 Frankfurt am Main 069 74 22 36 63 0172 53 97 0 82 |
From: Hoai-Anh Ngo-Vi <ho...@gm...> - 2012-06-05 13:16:59
|
Dear developers, I add a PropertyChangeListener to AsteriskChannel. In method propertyChange() I read the propertiy dtmfReceived. When a single digit, let's say '#' is pressed several times the method is called only one time. But I want the method to be called everytime so I came to the idea of reseting dimfReceived to null. But due to the visibility of AsteriskChannelImpl this is not possible. Is there any way to do that? I do not want to modify the original Code? Thank you for your supports -- Ngô Vi Hoài Anh Biedenkopfer Weg 13 60489 Frankfurt am Main 069 74 22 36 63 0172 53 97 0 82 |
From: Rafael M. <med...@gm...> - 2012-05-10 14:53:51
|
Hola! I need to show call in parked, but dont view ! ParkedCallsAction p = new ParkedCallsAction(); ResponseEvents calls = managerConnection.sendEventGeneratingAction(p); Collection<ResponseEvent> events = calls.getEvents(); for (ResponseEvent responseEvent : events) { ParkedCallsCompleteEvent e = (ParkedCallsCompleteEvent) responseEvent; ParkedCallEvent ???? } how to cast response event in object ParkedCallEvent ? hugs and thanks Atenciosamente, Rafael Nunes I'm free - Linux http://www.linkedin.com/in/mederafael |
From: Rafael M. <med...@gm...> - 2012-04-27 14:41:14
|
Team, I need to login agents in a queue! How to implement AgentLogin with asterisk-java? https://wiki.asterisk.org/wiki/display/AST/Application_AgentLogin Tried to use AgentCallbackLoginAction (deprecated) but failed! I logged with soft phone and logged off using AgentLogoffAction. Atenciosamente, Rafael Nunes I'm free - Linux http://www.linkedin.com/in/mederafael |
From: Wolfgang P. <wpi...@yo...> - 2012-03-08 07:50:08
|
Hi Robin, i have already developed such an application with asterisk-java - it does generate traffic for stress testing... Contact me offlist if you want to have further information best regards, Wolfgang Pichler Am 7. März 2012 16:27 schrieb Robin Solala <lei...@gm...>: > I would like to use asterisk-java into my project. But i have several > questions since i am new using asterisk-java. > My project is making a traffic generator (written in java) and make a > connections to asterisk. > So this traffic generator will be generate calls and asterisk will answer > it. So is this possible to do? > What supposed im going to know if i can make this project? > Thank you for your help and i would like to hearing from you as soon as > possible. > > Sincerely, > > > > Robin > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > |
From: Lukas R. <ry...@ma...> - 2012-03-07 16:01:13
|
Hi Robin, Can you be more specific why you want to use the asterisk-java? Maybe sipp (http://sipp.sourceforge.net/) will suit your requirement for traffic generator better. Hope it helps, Lukas On 03/07/2012 10:27 PM, Robin Solala wrote: > I would like to use asterisk-java into my project. But i have several > questions since i am new using asterisk-java. > My project is making a traffic generator (written in java) and make a > connections to asterisk. > So this traffic generator will be generate calls and asterisk will > answer it. So is this possible to do? > What supposed im going to know if i can make this project? > Thank you for your help and i would like to hearing from you as soon as > possible. > > Sincerely, > > > > Robin > > > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > > > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |
From: <Jac...@L-...> - 2012-03-07 15:46:25
|
Not sure what you mean by a traffic generator, but the asterisk-java library can originate calls, but it requires both legs of the call to be present on the asterisk box. Meaning if you have 100 SIP phone registered to the PBX it can originate calls between those 100 phones. It does not implement any of the actual phone logic, so cannot simulate actual phone calls on the PBX. Jacob From: Robin Solala [mailto:lei...@gm...] Sent: Wednesday, March 07, 2012 9:27 AM To: ast...@li... Subject: [Asterisk-java-devel] [HELP] I would like to use asterisk-java into my project. But i have several questions since i am new using asterisk-java. My project is making a traffic generator (written in java) and make a connections to asterisk. So this traffic generator will be generate calls and asterisk will answer it. So is this possible to do? What supposed im going to know if i can make this project? Thank you for your help and i would like to hearing from you as soon as possible. Sincerely, Robin |