Thread: [Asterisk-java-users] synchronized OriginateAction
Brought to you by:
srt
From: Vedran Z. <ved...@gm...> - 2008-05-15 14:52:09
Attachments:
SmsRecievedManager.java
|
hello, i'm having trouble with getting synchronized OriginateAction to work. I've tried to use "managerConnection.sendEventGeneratingAction(originateAction,originateAction.getTimeout()+2000);" but it throws EventTimeoutException with timeout set to 100000. I don't know if i'm doing something wrong or there is a bug in asterisk-java? here is a snipplet of the exception --------- Exception in thread "main" org.asteriskjava.manager.EventTimeoutException: Timeout waiting for response or response events to Originate at org.asteriskjava.manager.internal.ManagerConnectionImpl.sendEventGeneratingAction(ManagerConnectionImpl.java:944) at org.asteriskjava.manager.DefaultManagerConnection.sendEventGeneratingAction(DefaultManagerConnection.java:307) at net.skvid.sphonemanager.asterisk.manager.SmsRecievedManager.run(SmsRecievedManager.java:74) at net.skvid.sphonemanager.asterisk.manager.SmsRecievedManager.main(SmsRecievedManager.java:139) --------- the code is in the attachment. I'm using the latest stable relase (0.3.1) of asterisk-java with Asterisk 1.4.19.1-BRIstuffed-0.4.0-RC1. -- regards, Vedran Zeljeznak |
From: Martin S. <ma...@be...> - 2008-05-16 14:31:50
|
Hello Vedran, I don't see anything overtly wrong with that code. You aren't violating a thread rule or anything, though you could try adding a proxy reader just to be sure, as discussed here: http://asterisk-java.org/development/apidocs/org/asteriskjava/manager/Ma nagerEventListenerProxy.html But I don't think you'd need one unless there's more code you aren't showing us. Perhaps some of the other folks will be able to shed some more light on it. I do know 1.4.19 is relatively new, and we don't know about a lot of bugs in it yet -- but Mantis already has a deadlock on Manager originate bug filed just today (http://bugs.digium.com/view.php?id=12269). Cheers, Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 > -----Original Message----- > From: ast...@li... > [mailto:ast...@li...] On > Behalf Of Vedran Zeljeznak > Sent: Thursday, May 15, 2008 10:52 AM > To: ast...@li... > Subject: [Asterisk-java-users] synchronized OriginateAction > > > hello, > > i'm having trouble with getting synchronized OriginateAction to work. > > I've tried to use > "managerConnection.sendEventGeneratingAction(originateAction,o > riginateAction.getTimeout()+2000);" > but it throws EventTimeoutException with timeout set to 100000. > > I don't know if i'm doing something wrong or there is a bug in > asterisk-java? > > here is a snipplet of the exception > --------- > Exception in thread "main" > org.asteriskjava.manager.EventTimeoutException: > Timeout waiting for response or response events to Originate > at > org.asteriskjava.manager.internal.ManagerConnectionImpl.sendEv > entGeneratingAction(ManagerConnectionImpl.java:944) > at > org.asteriskjava.manager.DefaultManagerConnection.sendEventGen > eratingAction(DefaultManagerConnection.java:307) > at > net.skvid.sphonemanager.asterisk.manager.SmsRecievedManager.ru > n(SmsRecievedManager.java:74) > at > net.skvid.sphonemanager.asterisk.manager.SmsRecievedManager.ma > in(SmsRecievedManager.java:139) > --------- > > the code is in the attachment. > > I'm using the latest stable relase (0.3.1) of asterisk-java > with Asterisk > 1.4.19.1-BRIstuffed-0.4.0-RC1. > > -- > regards, > Vedran Zeljeznak > |
From: Vedran Z. <ved...@gm...> - 2008-05-16 15:26:48
|
thanks Martin for your reply. i've upgraded my asterisk-java to 1.0.0 version (version from yesterday) and the same problem still exists. Here is what i have to do: 1. send originateAction between a channel and a local context/extension 2. wait for an outbound channel to be created, answered 3. wait for a hangup on outbound channel. All of this has to synchronized (between two threads, one method). Think I'll do thread synchronization with semaphores and (hopefully) get a fully synchronized outbound call. (only main thread will be blocked, and daemon thread (Asterisk-Java ManagerConnection-0-Reader-0) will release it accordingly). -- regards, Vedran Zeljeznak On Fri, 16 May 2008 10:31:35 -0400, "Martin Smith" <ma...@be...> wrote: > Hello Vedran, > > I don't see anything overtly wrong with that code. You aren't violating > a thread rule or anything, though you could try adding a proxy reader > just to be sure, as discussed here: > http://asterisk-java.org/development/apidocs/org/asteriskjava/manager/Ma > nagerEventListenerProxy.html > > But I don't think you'd need one unless there's more code you aren't > showing us. Perhaps some of the other folks will be able to shed some > more light on it. I do know 1.4.19 is relatively new, and we don't know > about a lot of bugs in it yet -- but Mantis already has a deadlock on > Manager originate bug filed just today > (http://bugs.digium.com/view.php?id=12269). > > Cheers, > > Martin Smith, Systems Developer > ma...@be... > Bureau of Economic and Business Research > University of Florida > (352) 392-0171 Ext. 221 > > > >> -----Original Message----- >> From: ast...@li... >> [mailto:ast...@li...] On >> Behalf Of Vedran Zeljeznak >> Sent: Thursday, May 15, 2008 10:52 AM >> To: ast...@li... >> Subject: [Asterisk-java-users] synchronized OriginateAction >> >> >> hello, >> >> i'm having trouble with getting synchronized OriginateAction to work. >> >> I've tried to use >> "managerConnection.sendEventGeneratingAction(originateAction,o >> riginateAction.getTimeout()+2000);" >> but it throws EventTimeoutException with timeout set to 100000. >> >> I don't know if i'm doing something wrong or there is a bug in >> asterisk-java? >> >> here is a snipplet of the exception >> --------- >> Exception in thread "main" >> org.asteriskjava.manager.EventTimeoutException: >> Timeout waiting for response or response events to Originate >> at >> org.asteriskjava.manager.internal.ManagerConnectionImpl.sendEv >> entGeneratingAction(ManagerConnectionImpl.java:944) >> at >> org.asteriskjava.manager.DefaultManagerConnection.sendEventGen >> eratingAction(DefaultManagerConnection.java:307) >> at >> net.skvid.sphonemanager.asterisk.manager.SmsRecievedManager.ru >> n(SmsRecievedManager.java:74) >> at >> net.skvid.sphonemanager.asterisk.manager.SmsRecievedManager.ma >> in(SmsRecievedManager.java:139) >> --------- >> >> the code is in the attachment. >> >> I'm using the latest stable relase (0.3.1) of asterisk-java >> with Asterisk >> 1.4.19.1-BRIstuffed-0.4.0-RC1. >> >> -- >> regards, >> Vedran Zeljeznak >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Vedran Z. <ved...@gm...> - 2008-05-16 15:35:08
|
I've also found that ManagerResponse object from OriginateAction callback gets its uniqueId set to "asterisk-18189-1210951637.96" and all events generated from this action get its uniqueId set to "asterisk-1210951637.97". Is this normal behavior? -- regards, Vedran Zeljeznak On Fri, 16 May 2008 10:31:35 -0400, "Martin Smith" <ma...@be...> wrote: > Hello Vedran, > > I don't see anything overtly wrong with that code. You aren't violating > a thread rule or anything, though you could try adding a proxy reader > just to be sure, as discussed here: > http://asterisk-java.org/development/apidocs/org/asteriskjava/manager/Ma > nagerEventListenerProxy.html > > But I don't think you'd need one unless there's more code you aren't > showing us. Perhaps some of the other folks will be able to shed some > more light on it. I do know 1.4.19 is relatively new, and we don't know > about a lot of bugs in it yet -- but Mantis already has a deadlock on > Manager originate bug filed just today > (http://bugs.digium.com/view.php?id=12269). > > Cheers, > > Martin Smith, Systems Developer > ma...@be... > Bureau of Economic and Business Research > University of Florida > (352) 392-0171 Ext. 221 > > > >> -----Original Message----- >> From: ast...@li... >> [mailto:ast...@li...] On >> Behalf Of Vedran Zeljeznak >> Sent: Thursday, May 15, 2008 10:52 AM >> To: ast...@li... >> Subject: [Asterisk-java-users] synchronized OriginateAction >> >> >> hello, >> >> i'm having trouble with getting synchronized OriginateAction to work. >> >> I've tried to use >> "managerConnection.sendEventGeneratingAction(originateAction,o >> riginateAction.getTimeout()+2000);" >> but it throws EventTimeoutException with timeout set to 100000. >> >> I don't know if i'm doing something wrong or there is a bug in >> asterisk-java? >> >> here is a snipplet of the exception >> --------- >> Exception in thread "main" >> org.asteriskjava.manager.EventTimeoutException: >> Timeout waiting for response or response events to Originate >> at >> org.asteriskjava.manager.internal.ManagerConnectionImpl.sendEv >> entGeneratingAction(ManagerConnectionImpl.java:944) >> at >> org.asteriskjava.manager.DefaultManagerConnection.sendEventGen >> eratingAction(DefaultManagerConnection.java:307) >> at >> net.skvid.sphonemanager.asterisk.manager.SmsRecievedManager.ru >> n(SmsRecievedManager.java:74) >> at >> net.skvid.sphonemanager.asterisk.manager.SmsRecievedManager.ma >> in(SmsRecievedManager.java:139) >> --------- >> >> the code is in the attachment. >> >> I'm using the latest stable relase (0.3.1) of asterisk-java >> with Asterisk >> 1.4.19.1-BRIstuffed-0.4.0-RC1. >> >> -- >> regards, >> Vedran Zeljeznak >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |