asterisk-java-users Mailing List for Asterisk-Java Library (Page 12)
Brought to you by:
srt
You can subscribe to this list here.
2005 |
Jan
|
Feb
(8) |
Mar
(33) |
Apr
(36) |
May
(19) |
Jun
(21) |
Jul
(53) |
Aug
(30) |
Sep
(36) |
Oct
(34) |
Nov
(43) |
Dec
(72) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(123) |
Feb
(75) |
Mar
(86) |
Apr
(46) |
May
(41) |
Jun
(29) |
Jul
(76) |
Aug
(38) |
Sep
(39) |
Oct
(68) |
Nov
(16) |
Dec
(17) |
2007 |
Jan
(34) |
Feb
(18) |
Mar
(39) |
Apr
(30) |
May
(20) |
Jun
(10) |
Jul
(59) |
Aug
(54) |
Sep
(60) |
Oct
(22) |
Nov
(14) |
Dec
(10) |
2008 |
Jan
(34) |
Feb
(67) |
Mar
(65) |
Apr
(67) |
May
(60) |
Jun
(51) |
Jul
(88) |
Aug
(75) |
Sep
(47) |
Oct
(143) |
Nov
(54) |
Dec
(42) |
2009 |
Jan
(46) |
Feb
(80) |
Mar
(162) |
Apr
(159) |
May
(200) |
Jun
(34) |
Jul
(46) |
Aug
(59) |
Sep
(5) |
Oct
(35) |
Nov
(73) |
Dec
(30) |
2010 |
Jan
(23) |
Feb
(50) |
Mar
(8) |
Apr
(24) |
May
(19) |
Jun
(49) |
Jul
(56) |
Aug
(35) |
Sep
(26) |
Oct
(79) |
Nov
(39) |
Dec
(34) |
2011 |
Jan
(27) |
Feb
(22) |
Mar
(28) |
Apr
(12) |
May
(16) |
Jun
(19) |
Jul
(1) |
Aug
(64) |
Sep
(19) |
Oct
(11) |
Nov
(17) |
Dec
(12) |
2012 |
Jan
(6) |
Feb
(8) |
Mar
(15) |
Apr
(43) |
May
(41) |
Jun
(14) |
Jul
(32) |
Aug
(3) |
Sep
(4) |
Oct
(7) |
Nov
(11) |
Dec
(11) |
2013 |
Jan
(35) |
Feb
(11) |
Mar
(23) |
Apr
(25) |
May
(37) |
Jun
(47) |
Jul
(25) |
Aug
(21) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
|
2014 |
Jan
(26) |
Feb
(2) |
Mar
(18) |
Apr
(41) |
May
(7) |
Jun
(7) |
Jul
(24) |
Aug
(5) |
Sep
(6) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(7) |
Feb
(15) |
Mar
(8) |
Apr
(12) |
May
(7) |
Jun
|
Jul
|
Aug
(5) |
Sep
(1) |
Oct
(3) |
Nov
(30) |
Dec
(3) |
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
(4) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Yves A. <yv...@gm...> - 2014-01-11 19:15:00
|
Hi, I think it may not be a good idea to fire non-asynchronous actions from within a captured event... you should try to fire those events in an own thread so that there won´t be any blocking problems. I did not check this out, but it may be, that MonitorAction does not return before recording is complete... this would also be no problem if the monitoraction was fired in an own thread... yves Am 11.01.2014 18:02, schrieb ?????? ??????: > Hi! it's very strange. I use the one Manager connection for listen the > events and send some actions. > > > 2014/1/9 Jose Baez <pe...@gm... <mailto:pe...@gm...>> > > OK. I found the problem. > > If I use "managerconnection" as Eventlistener I cannot sendAction > with it. > > I had to create a second "managerconnection without EventListener > > > ManagerConnectionFactory factory = new ManagerConnectionFactory(...) > this.managerConnection = factory.createManagerConnection(); > ManagerConnectionFactory factory_2 = new > ManagerConnectionFactory(...) > this.managerConnection_2 = factory_2.createManagerConnection(); > > > Should I create a second 'factory' as well or would it be enough with: > > ManagerConnectionFactory factory = new ManagerConnectionFactory(...) > > this.managerConnection = factory.createManagerConnection(); > this.managerConnection_2 = factory.createManagerConnection(); > > > On 3 January 2014 11:05, Jose Baez <pe...@gm... > <mailto:pe...@gm...>> wrote: > > Oops! I receive "timeout exceed" exception for every Action. :((( > > Maybe my code is not properly written to handle Actions and > their responsess..... > > When I receive a specfic event I want to send an Action, but > everytime I "sendAction" it is a "timeout" exception. > > I'm running my program as: > > public void run() throws IOException, > AuthenticationFailedException, > TimeoutException, InterruptedException { > > managerConnection.addEventListener(this); > managerConnection.login(); > > while (running) { > Thread.sleep(5000); > } > > managerConnection.logoff(); > } > > @Override > public void *onManagerEvent(ManagerEvent event)* { > > // If event is NewExtenEvent... > if (event.getClass() == NewExtenEvent.class) { > handleEvent((NewExtenEvent) event); > } > // If event is NewChannel... > else if ((event.getClass() == NewChannelEvent.class)) { > handleEvent((NewChannelEvent) event); > } > } > > Sometimes I "sendAction" in NewExtenEvent (with the code sent > in the previous email). > > > > > On 2 January 2014 17:01, Jose Baez <pe...@gm... > <mailto:pe...@gm...>> wrote: > > Hi! > > I've been struggling a bit with > asterisk-java-1.0.0.CI-20140101.jar (January 1st, 2014) > and Asterisk v11.5 > > Whenever I run *"MonitorAction"* Asterisk-java replies > with "TimeOut Exceed" exception, but Asterisk is recording OK. > Same exception happens with "StopMonitor". > > try { > managerConnection.sendAction(*new MonitorAction*(channel, > filename, "WAV", true)); > > // Forcing a timeout still pops exception. > //managerConnection.sendAction(*new > MonitorAction*(channel, filename, "WAV", true), 1000); > > } catch (IOException ex) { > System.out.println(ex); > } catch (TimeoutException ex) { > System.out.println(ex); > } catch (IllegalArgumentException ex) { > System.out.println(ex); > } catch (IllegalStateException ex) { > System.out.println(ex); > } > > > Any idea? > > > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Максим Б. <bui...@gm...> - 2014-01-11 17:02:48
|
Hi! it's very strange. I use the one Manager connection for listen the events and send some actions. 2014/1/9 Jose Baez <pe...@gm...> > OK. I found the problem. > > If I use "managerconnection" as Eventlistener I cannot sendAction with it. > > I had to create a second "managerconnection without EventListener > > > ManagerConnectionFactory factory = new > ManagerConnectionFactory(...) > this.managerConnection = factory.createManagerConnection(); > > ManagerConnectionFactory factory_2 = new > ManagerConnectionFactory(...) > this.managerConnection_2 = factory_2.createManagerConnection(); > > > Should I create a second 'factory' as well or would it be enough with: > > ManagerConnectionFactory factory = new ManagerConnectionFactory(...) > > this.managerConnection = factory.createManagerConnection(); > this.managerConnection_2 = factory.createManagerConnection(); > > > On 3 January 2014 11:05, Jose Baez <pe...@gm...> wrote: > >> Oops! I receive "timeout exceed" exception for every Action. :((( >> >> Maybe my code is not properly written to handle Actions and their >> responsess..... >> >> When I receive a specfic event I want to send an Action, but everytime I >> "sendAction" it is a "timeout" exception. >> >> I'm running my program as: >> >> public void run() throws IOException, AuthenticationFailedException, >> TimeoutException, InterruptedException { >> >> managerConnection.addEventListener(this); >> managerConnection.login(); >> >> while (running) { >> Thread.sleep(5000); >> } >> >> managerConnection.logoff(); >> } >> >> @Override >> public void *onManagerEvent(ManagerEvent event)* { >> >> // If event is NewExtenEvent... >> if (event.getClass() == NewExtenEvent.class) { >> handleEvent((NewExtenEvent) event); >> } >> // If event is NewChannel... >> else if ((event.getClass() == NewChannelEvent.class)) { >> handleEvent((NewChannelEvent) event); >> } >> } >> >> Sometimes I "sendAction" in NewExtenEvent (with the code sent in the >> previous email). >> >> >> >> >> On 2 January 2014 17:01, Jose Baez <pe...@gm...> wrote: >> >>> Hi! >>> >>> I've been struggling a bit with >>> asterisk-java-1.0.0.CI-20140101.jar (January 1st, 2014) and Asterisk v11.5 >>> >>> Whenever I run *"MonitorAction"* Asterisk-java replies with "TimeOut >>> Exceed" exception, but Asterisk is recording OK. >>> Same exception happens with "StopMonitor". >>> >>> try { >>> managerConnection.sendAction(*new MonitorAction*(channel, >>> filename, "WAV", true)); >>> >>> // Forcing a timeout still pops exception. >>> //managerConnection.sendAction(*new MonitorAction*(channel, >>> filename, "WAV", true), 1000); >>> >>> } catch (IOException ex) { >>> System.out.println(ex); >>> } catch (TimeoutException ex) { >>> System.out.println(ex); >>> } catch (IllegalArgumentException ex) { >>> System.out.println(ex); >>> } catch (IllegalStateException ex) { >>> System.out.println(ex); >>> } >>> >>> >>> Any idea? >>> >> >> > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: Jose B. <pe...@gm...> - 2014-01-09 18:16:39
|
OK. I found the problem. If I use "managerconnection" as Eventlistener I cannot sendAction with it. I had to create a second "managerconnection without EventListener ManagerConnectionFactory factory = new ManagerConnectionFactory(...) this.managerConnection = factory.createManagerConnection(); ManagerConnectionFactory factory_2 = new ManagerConnectionFactory(...) this.managerConnection_2 = factory_2.createManagerConnection(); Should I create a second 'factory' as well or would it be enough with: ManagerConnectionFactory factory = new ManagerConnectionFactory(...) this.managerConnection = factory.createManagerConnection(); this.managerConnection_2 = factory.createManagerConnection(); On 3 January 2014 11:05, Jose Baez <pe...@gm...> wrote: > Oops! I receive "timeout exceed" exception for every Action. :((( > > Maybe my code is not properly written to handle Actions and their > responsess..... > > When I receive a specfic event I want to send an Action, but everytime I > "sendAction" it is a "timeout" exception. > > I'm running my program as: > > public void run() throws IOException, AuthenticationFailedException, > TimeoutException, InterruptedException { > > managerConnection.addEventListener(this); > managerConnection.login(); > > while (running) { > Thread.sleep(5000); > } > > managerConnection.logoff(); > } > > @Override > public void *onManagerEvent(ManagerEvent event)* { > > // If event is NewExtenEvent... > if (event.getClass() == NewExtenEvent.class) { > handleEvent((NewExtenEvent) event); > } > // If event is NewChannel... > else if ((event.getClass() == NewChannelEvent.class)) { > handleEvent((NewChannelEvent) event); > } > } > > Sometimes I "sendAction" in NewExtenEvent (with the code sent in the > previous email). > > > > > On 2 January 2014 17:01, Jose Baez <pe...@gm...> wrote: > >> Hi! >> >> I've been struggling a bit with >> asterisk-java-1.0.0.CI-20140101.jar (January 1st, 2014) and Asterisk v11.5 >> >> Whenever I run *"MonitorAction"* Asterisk-java replies with "TimeOut >> Exceed" exception, but Asterisk is recording OK. >> Same exception happens with "StopMonitor". >> >> try { >> managerConnection.sendAction(*new MonitorAction*(channel, >> filename, "WAV", true)); >> >> // Forcing a timeout still pops exception. >> //managerConnection.sendAction(*new MonitorAction*(channel, >> filename, "WAV", true), 1000); >> >> } catch (IOException ex) { >> System.out.println(ex); >> } catch (TimeoutException ex) { >> System.out.println(ex); >> } catch (IllegalArgumentException ex) { >> System.out.println(ex); >> } catch (IllegalStateException ex) { >> System.out.println(ex); >> } >> >> >> Any idea? >> > > |
From: Jose B. <pe...@gm...> - 2014-01-03 11:05:33
|
Oops! I receive "timeout exceed" exception for every Action. :((( Maybe my code is not properly written to handle Actions and their responsess..... When I receive a specfic event I want to send an Action, but everytime I "sendAction" it is a "timeout" exception. I'm running my program as: public void run() throws IOException, AuthenticationFailedException, TimeoutException, InterruptedException { managerConnection.addEventListener(this); managerConnection.login(); while (running) { Thread.sleep(5000); } managerConnection.logoff(); } @Override public void *onManagerEvent(ManagerEvent event)* { // If event is NewExtenEvent... if (event.getClass() == NewExtenEvent.class) { handleEvent((NewExtenEvent) event); } // If event is NewChannel... else if ((event.getClass() == NewChannelEvent.class)) { handleEvent((NewChannelEvent) event); } } Sometimes I "sendAction" in NewExtenEvent (with the code sent in the previous email). On 2 January 2014 17:01, Jose Baez <pe...@gm...> wrote: > Hi! > > I've been struggling a bit with > asterisk-java-1.0.0.CI-20140101.jar (January 1st, 2014) and Asterisk v11.5 > > Whenever I run *"MonitorAction"* Asterisk-java replies with "TimeOut > Exceed" exception, but Asterisk is recording OK. > Same exception happens with "StopMonitor". > > try { > managerConnection.sendAction(*new MonitorAction*(channel, filename, > "WAV", true)); > > // Forcing a timeout still pops exception. > //managerConnection.sendAction(*new MonitorAction*(channel, > filename, "WAV", true), 1000); > > } catch (IOException ex) { > System.out.println(ex); > } catch (TimeoutException ex) { > System.out.println(ex); > } catch (IllegalArgumentException ex) { > System.out.println(ex); > } catch (IllegalStateException ex) { > System.out.println(ex); > } > > > Any idea? > |
From: Jose B. <pe...@gm...> - 2014-01-02 17:01:15
|
Hi! I've been struggling a bit with asterisk-java-1.0.0.CI-20140101.jar (January 1st, 2014) and Asterisk v11.5 Whenever I run *"MonitorAction"* Asterisk-java replies with "TimeOut Exceed" exception, but Asterisk is recording OK. Same exception happens with "StopMonitor". try { managerConnection.sendAction(*new MonitorAction*(channel, filename, "WAV", true)); // Forcing a timeout still pops exception. //managerConnection.sendAction(*new MonitorAction*(channel, filename, "WAV", true), 1000); } catch (IOException ex) { System.out.println(ex); } catch (TimeoutException ex) { System.out.println(ex); } catch (IllegalArgumentException ex) { System.out.println(ex); } catch (IllegalStateException ex) { System.out.println(ex); } Any idea? |
From: Neelam S. <sin...@gm...> - 2013-11-19 13:07:33
|
Hello All I have installed libpri 1.4 , dahdi-linux-complete-current, Asterisk-10 installation on centos 6 successfully. But while installation of appKconference-2.4 I'm getting some message and its not getting installed. Here is the screenshot of commands I had run for appkconference installation [root@dtp220@galaxy konference]# make install if [ -f app_konference.so ]; then install -m 755 app_konference.so /usr/lib/asterisk/modules; fi [root@dtp220@galaxy konference]# Please help what i need to do -- Neelam Singh 9579954694 |
From: Neelam S. <sin...@gm...> - 2013-11-19 05:38:02
|
Hello Asterisk-java-usera Team, Thanks for adding me into users list !!!! Right Now I'm using Asterisk 11 on centos 6 operating system and using asterisk-java-1.0.0.m3.jar to establish communication between my java application and Asterisk 11. I'm able to connect my java program with Asterisk Issues I'm facing are 1.always at console message coming "Unsupported Version Asterisk Use at your own risk" 2.Unable to set property 'stateinterface' to 'SIP/0010' on org.asteriskjava.manager.event.QueueMemberStatusEvent:no setter found.Please report at http://jira.reucon.org/browse/AJ I'm able to establish P2P call,but getting issue as while making other type of calls eg global,zone calls,Please suggest what I need to do -- Neelam Singh 9579954694 |
From: Stephen M. <ste...@gm...> - 2013-11-14 01:06:47
|
It appears there is a config setting which allows which subnets are allowed to connect. vi /etc/asterisk/manager.conf permit=192.168.1.0/255.255.255.0 /usr/sbin/amportal restart Now I can get a connection. On Wed, Nov 13, 2013 at 6:07 PM, Stephen More <ste...@gm...> wrote: > I am currently running Elastix 2.4.0 r2 ( asterisk 11.6.0 0 ) > > I created a new test user. > > Simple code: > > org.asteriskjava.manager.ManagerConnectionFactory factory = new > org.asteriskjava.manager.ManagerConnectionFactory( "192.168.1.75", > "test", "test"); > org.asteriskjava.manager.ManagerConnection connection = > factory.createManagerConnection(); > connection.login(); > connection.logoff(); > > Always returns: > > org.asteriskjava.manager.AuthenticationFailedException: Authentication failed > at org.asteriskjava.manager.internal.ManagerConnectionImpl.doLogin(ManagerConnectionImpl.java:578) > at org.asteriskjava.manager.internal.ManagerConnectionImpl.login(ManagerConnectionImpl.java:438) > at org.asteriskjava.manager.internal.ManagerConnectionImpl.login(ManagerConnectionImpl.java:423) > at org.asteriskjava.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:294) > > I tried each Group ( Extension, Operator, Administrator ) > > > How can I get a connection using Elastix ? > > -Thanks |
From: Stephen M. <ste...@gm...> - 2013-11-13 23:07:56
|
I am currently running Elastix 2.4.0 r2 ( asterisk 11.6.0 0 ) I created a new test user. Simple code: org.asteriskjava.manager.ManagerConnectionFactory factory = new org.asteriskjava.manager.ManagerConnectionFactory( "192.168.1.75", "test", "test"); org.asteriskjava.manager.ManagerConnection connection = factory.createManagerConnection(); connection.login(); connection.logoff(); Always returns: org.asteriskjava.manager.AuthenticationFailedException: Authentication failed at org.asteriskjava.manager.internal.ManagerConnectionImpl.doLogin(ManagerConnectionImpl.java:578) at org.asteriskjava.manager.internal.ManagerConnectionImpl.login(ManagerConnectionImpl.java:438) at org.asteriskjava.manager.internal.ManagerConnectionImpl.login(ManagerConnectionImpl.java:423) at org.asteriskjava.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:294) I tried each Group ( Extension, Operator, Administrator ) How can I get a connection using Elastix ? -Thanks |
From: Miguel S. <m.s...@gm...> - 2013-11-06 18:49:58
|
The example should work. Try introducing some messages into your java-code (System.out.Println) or use jog4j jnstead El 06/11/2013 13:02, "Chandramouli P" <mou...@gm...> escribió: > Hi, > > I am completely new to Asterisk-Java and following *http://www.asterisk-java.org/development/tutorial.html > <http://www.asterisk-java.org/development/tutorial.html>* link. I am able > to execute basic "Hello AGI" example. > > Now, I am trying to execute "Hello Manager" example. But, nothing is > happening. > > I have two extensions (121, 115) and connected to my Asterisk server > through two soft phones (Xlite). I am able to make call between two > extensions directly. Now, I want to initiate a call from 121 to extension > 115 using Asterisk-Java program. > > *Please find my below configuration step by step:* > > 1) /etc/asterisk/manager.conf > [general] > enabled = yes > port = 5038 > bindaddr = 0.0.0.0 > > [manager] > secret=password > permit=0.0.0.0/0.0.0.0 > read=all > write=all > > 2) /etc/asterisk/sip.conf > > [121] > type=friend > username=121 > secret=cmp1 > callerid="cmp121" > host=dynamic > context=abcd > > [115] > type=friend > username=115 > secret=cmp2 > callerid="cmp115" > host=dynamic > context=abcd > > 3) /etc/asterisk/extensions.conf > > [abcd] > exten => 121,1,Dial(SIP/121,15) > exten => 121,2,Hangup > > exten => 115,1,Dial(SIP/115,15) > exten => 115,2,Hangup > > 4) HelloManager.java > > import java.io.IOException; > > import org.asteriskjava.manager.AuthenticationFailedException; > import org.asteriskjava.manager.ManagerConnection; > import org.asteriskjava.manager.ManagerConnectionFactory; > import org.asteriskjava.manager.TimeoutException; > import org.asteriskjava.manager.action.OriginateAction; > import org.asteriskjava.manager.response.ManagerResponse; > > public class HelloManager > { > private ManagerConnection managerConnection; > > public HelloManager() throws IOException > { > ManagerConnectionFactory factory = new ManagerConnectionFactory( > "localhost", "manager", "password"); > this.managerConnection = factory.createManagerConnection(); > } > > public void run() throws IOException, AuthenticationFailedException, > TimeoutException > { > OriginateAction originateAction; > ManagerResponse originateResponse; > > originateAction = new OriginateAction(); > originateAction.setChannel("SIP/121"); > originateAction.setContext("abcd"); > originateAction.setExten("115"); > originateAction.setPriority(new Integer(1)); > //originateAction.setTimeout(new Integer(30000)); > > managerConnection.login(); > originateResponse = managerConnection.sendAction(originateAction, > 30000); > > // print out whether the originate succeeded or not > System.out.println(originateResponse.getResponse()); > > managerConnection.logoff(); > } > > public static void main(String[] args) throws Exception > { > HelloManager helloManager; > > helloManager = new HelloManager(); > helloManager.run(); > } > } > > 5) Connected to Asterisk server (asterisk -rvvvvv) > 6) Start Asterisk-Java ( java -jar asterisk-java.jar) > 7) Compiled the program (javac -cp asterisk-java.jar HelloManager.java) > 8) HelloManager.class file is created. > > I executed the above 8 steps and not seeing any messages on Asterisk-Java > server console (on *:4573) and also not seeing any messages on Asterisk > server console. Call is also not forming between the extensions. After Step > 8 (I mean after creating the .class file), Do I need to execute any command? > > I tested AMI through Telnet and it connected successfully. Please find the > below output: > > # telnet 127.0.0.1 5038 > Trying 127.0.0.1... > Connected to 127.0.0.1. > Escape character is '^]'. > Asterisk Call Manager/1.3 > > Action: Login > UserName: manager > Secret: password > > I pressed "Enter" key two times and got the below output: > > Response: Success > Message: Authentication accepted > > What I need to do in addition? Any update would be appreciated. > > Thanks in advance. > > Regards, > Chandra. > > > ------------------------------------------------------------------------------ > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. > Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and > register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: Murthy G. <mga...@nt...> - 2013-11-06 17:52:01
|
What is in fastagi-mapping.properties? |
From: Yves A. <yv...@gm...> - 2013-11-06 16:55:10
|
after step 8... you have to execute your hellomanager class... this class connects to asterisk via ami and initiates an originateaction... yves Am 06.11.2013 13:01, schrieb Chandramouli P: > Hi, > > I am completely new to Asterisk-Java and following > *http://www.asterisk-java.org/development/tutorial.html* link. I am > able to execute basic "Hello AGI" example. > > Now, I am trying to execute "Hello Manager" example. But, nothing is > happening. > > I have two extensions (121, 115) and connected to my Asterisk server > through two soft phones (Xlite). I am able to make call between two > extensions directly. Now, I want to initiate a call from 121 to > extension 115 using Asterisk-Java program. > > *Please find my below configuration step by step:* > > 1) /etc/asterisk/manager.conf > [general] > enabled = yes > port = 5038 > bindaddr = 0.0.0.0 > > [manager] > secret=password > permit=0.0.0.0/0.0.0.0 > read=all > write=all > > 2) /etc/asterisk/sip.conf > > [121] > type=friend > username=121 > secret=cmp1 > callerid="cmp121" > host=dynamic > context=abcd > > [115] > type=friend > username=115 > secret=cmp2 > callerid="cmp115" > host=dynamic > context=abcd > > 3) /etc/asterisk/extensions.conf > > [abcd] > exten => 121,1,Dial(SIP/121,15) > exten => 121,2,Hangup > > exten => 115,1,Dial(SIP/115,15) > exten => 115,2,Hangup > > 4) HelloManager.java > > import java.io.IOException; > > import org.asteriskjava.manager.AuthenticationFailedException; > import org.asteriskjava.manager.ManagerConnection; > import org.asteriskjava.manager.ManagerConnectionFactory; > import org.asteriskjava.manager.TimeoutException; > import org.asteriskjava.manager.action.OriginateAction; > import org.asteriskjava.manager.response.ManagerResponse; > > public class HelloManager > { > private ManagerConnection managerConnection; > > public HelloManager() throws IOException > { > ManagerConnectionFactory factory = new ManagerConnectionFactory( > "localhost", "manager", "password"); > this.managerConnection = factory.createManagerConnection(); > } > > public void run() throws IOException, AuthenticationFailedException, > TimeoutException > { > OriginateAction originateAction; > ManagerResponse originateResponse; > > originateAction = new OriginateAction(); > originateAction.setChannel("SIP/121"); > originateAction.setContext("abcd"); > originateAction.setExten("115"); > originateAction.setPriority(new Integer(1)); > //originateAction.setTimeout(new Integer(30000)); > > managerConnection.login(); > originateResponse = > managerConnection.sendAction(originateAction, 30000); > > // print out whether the originate succeeded or not > System.out.println(originateResponse.getResponse()); > > managerConnection.logoff(); > } > > public static void main(String[] args) throws Exception > { > HelloManager helloManager; > > helloManager = new HelloManager(); > helloManager.run(); > } > } > > 5) Connected to Asterisk server (asterisk -rvvvvv) > 6) Start Asterisk-Java ( java -jar asterisk-java.jar) > 7) Compiled the program (javac -cp asterisk-java.jar HelloManager.java) > 8) HelloManager.class file is created. > > I executed the above 8 steps and not seeing any messages on > Asterisk-Java server console (on *:4573) and also not seeing any > messages on Asterisk server console. Call is also not forming between > the extensions. After Step 8 (I mean after creating the .class file), > Do I need to execute any command? > > I tested AMI through Telnet and it connected successfully. Please find > the below output: > > # telnet 127.0.0.1 5038 > Trying 127.0.0.1... > Connected to 127.0.0.1. > Escape character is '^]'. > Asterisk Call Manager/1.3 > > Action: Login > UserName: manager > Secret: password > > I pressed "Enter" key two times and got the below output: > > Response: Success > Message: Authentication accepted > > What I need to do in addition? Any update would be appreciated. > > Thanks in advance. > > Regards, > Chandra. > > > ------------------------------------------------------------------------------ > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users --- Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv. http://www.avast.com |
From: Wayne M. <way...@th...> - 2013-11-06 14:42:55
|
Hi, It doesn't look like you're running your hellomanager program at all. It might be worth setting up an eclipse or other ide project and running it through that so that you can deal with the library dependencies and debug much more easily. Regards, Wayne Merricks The Voice Asia On 06/11/13 12:01, Chandramouli P wrote: > Hi, > > I am completely new to Asterisk-Java and following > *http://www.asterisk-java.org/development/tutorial.html* link. I am > able to execute basic "Hello AGI" example. > > Now, I am trying to execute "Hello Manager" example. But, nothing is > happening. > > I have two extensions (121, 115) and connected to my Asterisk server > through two soft phones (Xlite). I am able to make call between two > extensions directly. Now, I want to initiate a call from 121 to > extension 115 using Asterisk-Java program. > > *Please find my below configuration step by step:* > > 1) /etc/asterisk/manager.conf > [general] > enabled = yes > port = 5038 > bindaddr = 0.0.0.0 > > [manager] > secret=password > permit=0.0.0.0/0.0.0.0 > read=all > write=all > > 2) /etc/asterisk/sip.conf > > [121] > type=friend > username=121 > secret=cmp1 > callerid="cmp121" > host=dynamic > context=abcd > > [115] > type=friend > username=115 > secret=cmp2 > callerid="cmp115" > host=dynamic > context=abcd > > 3) /etc/asterisk/extensions.conf > > [abcd] > exten => 121,1,Dial(SIP/121,15) > exten => 121,2,Hangup > > exten => 115,1,Dial(SIP/115,15) > exten => 115,2,Hangup > > 4) HelloManager.java > > import java.io.IOException; > > import org.asteriskjava.manager.AuthenticationFailedException; > import org.asteriskjava.manager.ManagerConnection; > import org.asteriskjava.manager.ManagerConnectionFactory; > import org.asteriskjava.manager.TimeoutException; > import org.asteriskjava.manager.action.OriginateAction; > import org.asteriskjava.manager.response.ManagerResponse; > > public class HelloManager > { > private ManagerConnection managerConnection; > > public HelloManager() throws IOException > { > ManagerConnectionFactory factory = new ManagerConnectionFactory( > "localhost", "manager", "password"); > this.managerConnection = factory.createManagerConnection(); > } > > public void run() throws IOException, AuthenticationFailedException, > TimeoutException > { > OriginateAction originateAction; > ManagerResponse originateResponse; > > originateAction = new OriginateAction(); > originateAction.setChannel("SIP/121"); > originateAction.setContext("abcd"); > originateAction.setExten("115"); > originateAction.setPriority(new Integer(1)); > //originateAction.setTimeout(new Integer(30000)); > > managerConnection.login(); > originateResponse = > managerConnection.sendAction(originateAction, 30000); > > // print out whether the originate succeeded or not > System.out.println(originateResponse.getResponse()); > > managerConnection.logoff(); > } > > public static void main(String[] args) throws Exception > { > HelloManager helloManager; > > helloManager = new HelloManager(); > helloManager.run(); > } > } > > 5) Connected to Asterisk server (asterisk -rvvvvv) > 6) Start Asterisk-Java ( java -jar asterisk-java.jar) > 7) Compiled the program (javac -cp asterisk-java.jar HelloManager.java) > 8) HelloManager.class file is created. > > I executed the above 8 steps and not seeing any messages on > Asterisk-Java server console (on *:4573) and also not seeing any > messages on Asterisk server console. Call is also not forming between > the extensions. After Step 8 (I mean after creating the .class file), > Do I need to execute any command? > > I tested AMI through Telnet and it connected successfully. Please find > the below output: > > # telnet 127.0.0.1 5038 > Trying 127.0.0.1... > Connected to 127.0.0.1. > Escape character is '^]'. > Asterisk Call Manager/1.3 > > Action: Login > UserName: manager > Secret: password > > I pressed "Enter" key two times and got the below output: > > Response: Success > Message: Authentication accepted > > What I need to do in addition? Any update would be appreciated. > > Thanks in advance. > > Regards, > Chandra. > > > ------------------------------------------------------------------------------ > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Chandramouli P <mou...@gm...> - 2013-11-06 12:01:56
|
Hi, I am completely new to Asterisk-Java and following *http://www.asterisk-java.org/development/tutorial.html* link. I am able to execute basic "Hello AGI" example. Now, I am trying to execute "Hello Manager" example. But, nothing is happening. I have two extensions (121, 115) and connected to my Asterisk server through two soft phones (Xlite). I am able to make call between two extensions directly. Now, I want to initiate a call from 121 to extension 115 using Asterisk-Java program. *Please find my below configuration step by step:* 1) /etc/asterisk/manager.conf [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 [manager] secret=password permit=0.0.0.0/0.0.0.0 read=all write=all 2) /etc/asterisk/sip.conf [121] type=friend username=121 secret=cmp1 callerid="cmp121" host=dynamic context=abcd [115] type=friend username=115 secret=cmp2 callerid="cmp115" host=dynamic context=abcd 3) /etc/asterisk/extensions.conf [abcd] exten => 121,1,Dial(SIP/121,15) exten => 121,2,Hangup exten => 115,1,Dial(SIP/115,15) exten => 115,2,Hangup 4) HelloManager.java import java.io.IOException; import org.asteriskjava.manager.AuthenticationFailedException; import org.asteriskjava.manager.ManagerConnection; import org.asteriskjava.manager.ManagerConnectionFactory; import org.asteriskjava.manager.TimeoutException; import org.asteriskjava.manager.action.OriginateAction; import org.asteriskjava.manager.response.ManagerResponse; public class HelloManager { private ManagerConnection managerConnection; public HelloManager() throws IOException { ManagerConnectionFactory factory = new ManagerConnectionFactory( "localhost", "manager", "password"); this.managerConnection = factory.createManagerConnection(); } public void run() throws IOException, AuthenticationFailedException, TimeoutException { OriginateAction originateAction; ManagerResponse originateResponse; originateAction = new OriginateAction(); originateAction.setChannel("SIP/121"); originateAction.setContext("abcd"); originateAction.setExten("115"); originateAction.setPriority(new Integer(1)); //originateAction.setTimeout(new Integer(30000)); managerConnection.login(); originateResponse = managerConnection.sendAction(originateAction, 30000); // print out whether the originate succeeded or not System.out.println(originateResponse.getResponse()); managerConnection.logoff(); } public static void main(String[] args) throws Exception { HelloManager helloManager; helloManager = new HelloManager(); helloManager.run(); } } 5) Connected to Asterisk server (asterisk -rvvvvv) 6) Start Asterisk-Java ( java -jar asterisk-java.jar) 7) Compiled the program (javac -cp asterisk-java.jar HelloManager.java) 8) HelloManager.class file is created. I executed the above 8 steps and not seeing any messages on Asterisk-Java server console (on *:4573) and also not seeing any messages on Asterisk server console. Call is also not forming between the extensions. After Step 8 (I mean after creating the .class file), Do I need to execute any command? I tested AMI through Telnet and it connected successfully. Please find the below output: # telnet 127.0.0.1 5038 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Asterisk Call Manager/1.3 Action: Login UserName: manager Secret: password I pressed "Enter" key two times and got the below output: Response: Success Message: Authentication accepted What I need to do in addition? Any update would be appreciated. Thanks in advance. Regards, Chandra. |
From: Miguel S. <m.s...@gm...> - 2013-10-25 13:52:55
|
Hello, We are a company in Barcelona specialized in Voip solutions based on asterisk. We are looking for technicians to join our team. Actually our customer list is increasing quickly and need someone encouraged with our project. Please visit our web site www.innovatalk.com If some of you is interested, please insert your curriculum and experience as a response to jt...@in... -- Miguel Santiago |
From: Mordechay K. <mka...@gm...> - 2013-08-25 12:17:15
|
B.H. Hello, all! When trying to connect AJ 1.0.0 to asterisk 11 i get the following warning: org.asteriskjava.manager.internal.ManagerConnectionImpl: Unsupported protocol version 'Asterisk Call Manager/1.3'. Use at your own risk. Besides this, things seam to work properly, as far as i can see. Are there any known issues with using AJ against asterisk 11? Thanks -- כתיבה וחתימה טובה לשנה טובה ומתוקה בגשמיות וברוחניות! משיח NOW! Moshiach is coming very soon, prepare yourself! יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! |
From: Mordechay K. <mka...@gm...> - 2013-08-22 21:13:32
|
B.H. Hi, Rounak! On Tue, Jul 16, 2013 at 11:47 AM, Rounak Saha <rou...@gm...>wrote: > Hii I am making a call from Manager AMI and in my dialPlan the caller will > be connected to AGI.I want to send a variable var from AMI to AGI through > channel variables > > > originateAction.setChannel("SIP/1000abc"); > originateAction.setContext("outgoing-call"); > originateAction.setExten("100"); > originateAction.setVariable("var", " foo baar"); > > I tried all possible combination of outbound call but none of them working > > [outgoing-call] > exten=>100,1,AGI(agi://127.0.0.1/hello.agi?user=${var}<http://127.0.0.1/hello.agi?user=$%7Bvar%7D> > ) > > [outgoing-call] > exten=>100,1,AGI(agi://127.0.0.1/hello.agi?var=${var}<http://127.0.0.1/hello.agi?var=$%7Bvar%7D> > ) > I don't understand what is different, but both are OK... > > [outgoing-call] > exten=>100,1,AGI(agi://127.0.0.1/hello.agi,${var}<http://127.0.0.1/hello.agi,$%7Bvar%7D> > ) > This won't work AFAIK > > > **AGI** > > public void service(AgiRequest request, AgiChannel channel) > throws AgiException > { > answer(); > System.out.println("Inside"); > String a=request.getParameter("var"); > // String b=request.getParameter("user"); > String c=channel.getVariable("var"); > // String d=channel.getVariable("user"); > System.out.println(a+"\n"+b+"\n"+c+"\n"+d+"\n"); > hangup(); > } > > Output is null all the time. > This is very strange. Works fine for me. When you call request.getParameter() you read from AGI call URI's parametes, when you call channel.getVariable() you access channel's variables directly. What versions of Asterisk and Asterisk-Java are you using? > > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- כתיבה וחתימה טובה לשנה טובה ומתוקה בגשמיות וברוחניות! משיח NOW! Moshiach is coming very soon, prepare yourself! יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! |
From: MT <moh...@gm...> - 2013-08-13 05:34:53
|
Hi, I can see this event when I telnet to 5038, but I can't see it in asterisk java listener. I Use Asterisk-Java 1.0.0.M3. In my code I use following method: protected void handleEvent(TransferEvent event) { } without any error but this function never execute on transfer. I also check all events in following method: public void onManagerEvent(ManagerEvent event) { } but when I transfer a call (attended or blind) never show TransferEvent On Sun, Aug 11, 2013 at 8:43 PM, Mordechay Kaganer <mka...@gm...>wrote: > B.H. > > > On Wed, Aug 7, 2013 at 5:00 PM, MT <moh...@gm...> wrote: > >> Hi everyone, >> >> I can't get TransferEvent but when I telnet to 5038 I can see >> TransferEvent generated by asterisk. >> I can get another events >> like: HangupEvent,NewStateEvent,PeerStatusEvent,QueueMemberPausedEvent,... >> but can't get TransferEvent. >> >> I don't know what to do, please help me :( >> > > Hi, do you get warnings in your log about unregistered events? What > version of AJ are you using? > > >> >> mohsen >> >> >> >> ------------------------------------------------------------------------------ >> Get 100% visibility into Java/.NET code with AppDynamics Lite! >> It's a free troubleshooting tool designed for production. >> Get down to code-level detail for bottlenecks, with <2% overhead. >> Download for free and get started troubleshooting in minutes. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > > -- > משיח NOW! > Moshiach is coming very soon, prepare yourself! > יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: Mordechay K. <mka...@gm...> - 2013-08-11 16:13:32
|
B.H. On Wed, Aug 7, 2013 at 5:00 PM, MT <moh...@gm...> wrote: > Hi everyone, > > I can't get TransferEvent but when I telnet to 5038 I can see > TransferEvent generated by asterisk. > I can get another events > like: HangupEvent,NewStateEvent,PeerStatusEvent,QueueMemberPausedEvent,... > but can't get TransferEvent. > > I don't know what to do, please help me :( > Hi, do you get warnings in your log about unregistered events? What version of AJ are you using? > > mohsen > > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- משיח NOW! Moshiach is coming very soon, prepare yourself! יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! |
From: Wayne M. <way...@th...> - 2013-08-08 15:21:34
|
Apologies, was using the wrong reference to the channel variable. For anyone who is interested, assuming you have an auto answer context set up (and a phone that supports it), simply using Local/extension as the channel instead of SIP/extension will sort out the problem. Wayne Merricks The Voice Asia On 08/08/13 14:08, Wayne Merricks wrote: > Hi all, > > I amended my dial plan so that the SIP auto-answer header is added to > each call to specific extensions (50XX). Testing works fine between > between phones however I get slightly unexpected behaviour if I use: > > AsteriskServer.originateToExtensionAsync("SIP/5001", "from-internal", "5002", 1, 30000L, this); > > The phone 5001 rings which I didn't want to happen. Once I pick up 5002 > auto answers and everything is fine. > > I've tried adding vars to the same line such as: > > vars.put("ALERTINFO", "Alert-Info: Ring Answer"); > vars.put("CALLINFO", "Call-Info: \\;answer-after=0"); > > > Then calling originateToExtensionAsync with the vars and CallerId > objects too but that made no difference. > > As far as I can tell no events are generated until the initial pickup so > I'm not sure what to track/change to make this happen. > > What do I have to do to get the initial ring to auto answer as well? > Any ideas or hints would be appreciated. > > Cheers, > |
From: Wayne M. <way...@th...> - 2013-08-08 13:25:13
|
Hi all, I amended my dial plan so that the SIP auto-answer header is added to each call to specific extensions (50XX). Testing works fine between between phones however I get slightly unexpected behaviour if I use: AsteriskServer.originateToExtensionAsync("SIP/5001", "from-internal", "5002", 1, 30000L, this); The phone 5001 rings which I didn't want to happen. Once I pick up 5002 auto answers and everything is fine. I've tried adding vars to the same line such as: vars.put("ALERTINFO", "Alert-Info: Ring Answer"); vars.put("CALLINFO", "Call-Info: \\;answer-after=0"); Then calling originateToExtensionAsync with the vars and CallerId objects too but that made no difference. As far as I can tell no events are generated until the initial pickup so I'm not sure what to track/change to make this happen. What do I have to do to get the initial ring to auto answer as well? Any ideas or hints would be appreciated. Cheers, -- Wayne Merricks The Voice Asia |
From: MT <moh...@gm...> - 2013-08-07 14:01:23
|
Hi everyone, I can't get TransferEvent but when I telnet to 5038 I can see TransferEvent generated by asterisk. I can get another events like: HangupEvent,NewStateEvent,PeerStatusEvent,QueueMemberPausedEvent,... but can't get TransferEvent. I don't know what to do, please help me :( mohsen |
From: Yves A. <yv...@gm...> - 2013-08-07 09:10:58
|
good to know... thanks for sharing, yves Am 07.08.2013 09:31, schrieb Daniele Renda: > Hi Yves, > at the end I reused the PropertyChangeListener. So I check the event > in this manner: > > if (evt != null && > evt.getPropertyName().equalsIgnoreCase("currentExtension")) { > if (evt.getNewValue() instanceof Extension) { > if (e.getApplication().equalsIgnoreCase("Set")) { > if (e.getAppData() != null && > !e.getAppData().isEmpty()) { > > So I can know when in the dialplan is set a Variable. Not sure if this > is the best way but in this manner I don't use a new listener. > > Thanks for your support. > > > 2013/8/5 Daniele Renda <dan...@gm... > <mailto:dan...@gm...>> > > Sure, every time I remove the listener before adding new one. > > In effect my system should manage many calls, about 1500/2500 at day. > > On the other hand, using an Agiscript I have the problem that in > my method I should update the db but doing so I update the db > either in agiscript and then in the code of originateAsync and may > be not simple manage locking of record because can happen that > modification can be concurrent. > > Thanks > > > > > 2013/8/5 Yves A. <yv...@gm... <mailto:yv...@gm...>> > > hi, > > this looks ok for me... as long as you dont forget to remove > the listener. > I also would check the impact to the whole system / > performance / memory usage depending on the amount of calls > your code has to handle... i could imagine that this is not > healthy for high traffic... if you have a high call volume you > maybe should go another way.... but try it out and give feedback, > > yves > > > Am 05.08.2013 16:33, schrieb Daniele Renda: >> Ah ok, >> the problem is that I need to know the value of the variable >> inside "private class MyOriginateCallback implements >> OriginateCallback" because I need the reference of my "Call" >> object that is inside this class. >> So every time I should add and remove listener from >> managerconnection is this way: >> >> channel.getServer().getManagerConnection().addEventListener(new >> ManagerEventListener() { >> >> @Override >> public void onManagerEvent(ManagerEvent event) { >> if (event instanceof VarSetEvent) { >> VarSetEvent varEvent = (VarSetEvent) >> event; >> String variabile = >> varEvent.getVariable(); >> log.debug("Impostata variabile: " + variabile + " su >> telefonata " + telefonata.getId()); >> String valore = varEvent.getValue(); >> log.debug("Valore : " + valore + " su telefonata " + >> telefonata.getId()); >> } >> >> } >> }); >> >> What do you think? >> >> Thanks >> >> >> >> >> 2013/8/5 Yves A. <yv...@gm... <mailto:yv...@gm...>> >> >> no... >> >> i don´t think that the propertychangeeventlistener will >> receive varsetevents.... >> you´ll have to open a managerconnection and add an >> eventlistener to it.. >> >> y. >> >> >> Am 05.08.2013 16:03, schrieb Daniele Renda: >>> Hi Yves, >>> thanks for your suggestion. >>> >>> You mean that in ; >>> >>> channel.addPropertyChangeListener(new >>> PropertyChangeListener() { >>> >>> @Override >>> public void >>> propertyChange(PropertyChangeEvent evt) { >>> >>> I need to test: >>> >>> if (evt.getSource() instanceof VarSetEvent) >>> >>> Right? >>> >>> Thanks >>> >>> >>> >>> 2013/8/5 Yves A. <yv...@gm... <mailto:yv...@gm...>> >>> >>> Have you tried to "listen" to the VarSetEvent ? >>> >>> yves >>> >>> Am 05.08.2013 14:29, schrieb Daniele Renda: >>>> Hi yves, >>>> sorry for the lack of details. >>>> >>>> I do this: >>>> >>>> OriginateAction action = createAction(telefonata); >>>> try { >>>> telefonata.onCreate(); >>>> asteriskServer.originateAsync(action, new >>>> MyOriginateCallback(telefonata)); >>>> } catch (ManagerCommunicationException e) { >>>> log.error(telefonata.getId() + " ha generato un >>>> errore", e); >>>> telefonata.onFailure(); >>>> } >>>> >>>> private class MyOriginateCallback implements >>>> OriginateCallback { >>>> >>>> private final TelefonataInterface telefonata; >>>> >>>> private MyOriginateCallback(TelefonataInterface >>>> telefonata) { >>>> this.telefonata = telefonata; >>>> } >>>> >>>> @Override >>>> public void onDialing(final AsteriskChannel >>>> channel) { >>>> log.debug("On dialing comunicazione " + >>>> telefonata.getId()); >>>> telefonata.onDialing(); >>>> channel.addPropertyChangeListener(new >>>> PropertyChangeListener() { >>>> >>>> @Override >>>> public void propertyChange(PropertyChangeEvent >>>> evt) { >>>> if (evt.getSource() instanceof AsteriskChannel) { >>>> >>>> // EVENTO DI HANGUP >>>> if (channel.getState() == >>>> ChannelState.HUNGUP) { >>>> String hangupCauseText = ""; >>>> if (channel.getHangupCauseText() != null) >>>> hangupCauseText = channel.getHangupCauseText(); >>>> telefonata.onHangupEvent(channel); >>>> } >>>> >>>> } >>>> }); >>>> } >>>> >>>> @Override >>>> public void onSuccess(AsteriskChannel >>>> channel) { >>>> log.debug("Success " + telefonata.getId() + " " + >>>> channel); >>>> log.debug("La comunicazione è iniziata alle " + >>>> channel.getDateOfCreation()); >>>> telefonata.onSuccess(); >>>> } >>>> >>>> @Override >>>> public void onNoAnswer(AsteriskChannel >>>> channel) { >>>> log.debug("NoAnswer " + telefonata.getId() + " " + >>>> channel); >>>> telefonata.onNoAnswer(); >>>> } >>>> >>>> @Override >>>> public void onBusy(AsteriskChannel channel) { >>>> log.debug("Busy " + telefonata.getId() + " " + >>>> channel); >>>> telefonata.onBusy(); >>>> } >>>> >>>> @Override >>>> public void onFailure(LiveException cause) { >>>> log.debug("OnFailure(...)' - " + telefonata.getId()); >>>> telefonata.onFailure(); >>>> } >>>> >>>> } >>>> >>>> My dialplan: >>>> >>>> [test] >>>> exten => s,1,Answer() >>>> exten => s,1,Playback(smt) >>>> exten => 3,n,Set(variable=This is the value of the >>>> variable) >>>> exten => s,n,Hangup() >>>> >>>> I've a PropertyChangeListener so I can know when >>>> the call hangup. I'd like to get the value of the >>>> variable into Javacode in my method >>>> onHangupEvent(), so when the call end I need to >>>> read that variable. >>>> I know that I can create a class that extends >>>> BaseAgiScript to get the variable, but there is >>>> another way to do this? Would be more convenient to >>>> have the variable in the method onHangupEvent() for >>>> my case. >>>> >>>> Thanks >>>> >>>> >>>> 2013/8/5 Yves A. <yv...@gm... >>>> <mailto:yv...@gm...>> >>>> >>>> why do most people always think, one could >>>> "guess" their code, settings and environment >>>> that causes trouble? >>>> >>>> every access to a channel lead to an exception, >>>> if the channel is already hung up. >>>> if you need access to your channelvariables >>>> after hangup, you have to go another way... >>>> varsetevent and a local static map may be your >>>> friends here. >>>> >>>> of course there exists the h extensions which >>>> you could use to call another agi after hangup, >>>> but as i wrote before... i have no >>>> idea what your objective is, nor do i have any >>>> code to comment on... >>>> >>>> yves >>>> >>>> >>>> Am 05.08.2013 13:00, schrieb Daniele Renda: >>>>> Hi, >>>>> I need to read a variable that I set from >>>>> dialplan after i receive the onHangupEvent() >>>>> on OriginateAsync. >>>>> But I've an exception because Asterisk Java >>>>> don't find anymore the channels because is >>>>> hanged up I guess. >>>>> >>>>> So, there is another way to get the variable >>>>> in Java before the call ends? >>>>> >>>>> Thanks very much! >>>>> >>>>> -- >>>>> Daniele Renda >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Get your SQL database under version control now! >>>>> Version control is standard for application code, but databases havent >>>>> caught up. So what steps can you take to put your SQL databases under >>>>> version control? Why should you start doing it? Read more to find out. >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>>> >>>>> >>>>> _______________________________________________ >>>>> Asterisk-java-users mailing list >>>>> Ast...@li... <mailto:Ast...@li...> >>>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Get your SQL database under version control now! >>>> Version control is standard for application >>>> code, but databases havent >>>> caught up. So what steps can you take to put >>>> your SQL databases under >>>> version control? Why should you start doing it? >>>> Read more to find out. >>>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... >>>> <mailto:Ast...@li...> >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>>> >>>> >>>> -- >>>> Daniele Renda >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Get your SQL database under version control now! >>>> Version control is standard for application code, but databases havent >>>> caught up. So what steps can you take to put your SQL databases under >>>> version control? Why should you start doing it? Read more to find out. >>>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>> >>>> >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... <mailto:Ast...@li...> >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, >>> but databases havent >>> caught up. So what steps can you take to put your >>> SQL databases under >>> version control? Why should you start doing it? Read >>> more to find out. >>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> <mailto:Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> >>> -- >>> Daniele Renda >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but databases havent >>> caught up. So what steps can you take to put your SQL databases under >>> version control? Why should you start doing it? Read more to find out. >>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> >>> >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... <mailto:Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but >> databases havent >> caught up. So what steps can you take to put your SQL >> databases under >> version control? Why should you start doing it? Read more >> to find out. >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> -- >> Daniele Renda >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out. >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> >> >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but > databases havent > caught up. So what steps can you take to put your SQL > databases under > version control? Why should you start doing it? Read more to > find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > -- > Daniele Renda > > > > > -- > Daniele Renda > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Daniele R. <dan...@gm...> - 2013-08-07 07:31:21
|
Hi Yves, at the end I reused the PropertyChangeListener. So I check the event in this manner: if (evt != null && evt.getPropertyName().equalsIgnoreCase("currentExtension")) { if (evt.getNewValue() instanceof Extension) { if (e.getApplication().equalsIgnoreCase("Set")) { if (e.getAppData() != null && !e.getAppData().isEmpty()) { So I can know when in the dialplan is set a Variable. Not sure if this is the best way but in this manner I don't use a new listener. Thanks for your support. 2013/8/5 Daniele Renda <dan...@gm...> > Sure, every time I remove the listener before adding new one. > > In effect my system should manage many calls, about 1500/2500 at day. > > On the other hand, using an Agiscript I have the problem that in my method > I should update the db but doing so I update the db either in agiscript and > then in the code of originateAsync and may be not simple manage locking of > record because can happen that modification can be concurrent. > > Thanks > > > > > 2013/8/5 Yves A. <yv...@gm...> > >> hi, >> >> this looks ok for me... as long as you dont forget to remove the listener. >> I also would check the impact to the whole system / performance / memory >> usage depending on the amount of calls >> your code has to handle... i could imagine that this is not healthy for >> high traffic... if you have a high call volume you >> maybe should go another way.... but try it out and give feedback, >> >> yves >> >> >> Am 05.08.2013 16:33, schrieb Daniele Renda: >> >> Ah ok, >> the problem is that I need to know the value of the variable inside >> "private class MyOriginateCallback implements OriginateCallback" because I >> need the reference of my "Call" object that is inside this class. >> So every time I should add and remove listener from managerconnection >> is this way: >> >> channel.getServer().getManagerConnection().addEventListener(new >> ManagerEventListener() { >> >> @Override >> public void onManagerEvent(ManagerEvent event) { >> if (event instanceof VarSetEvent) { >> VarSetEvent varEvent = (VarSetEvent) event; >> String variabile = varEvent.getVariable(); >> log.debug("Impostata variabile: " + variabile + " >> su telefonata " + telefonata.getId()); >> String valore = varEvent.getValue(); >> log.debug("Valore : " + valore + " su telefonata >> " + telefonata.getId()); >> } >> >> } >> }); >> >> What do you think? >> >> Thanks >> >> >> >> >> 2013/8/5 Yves A. <yv...@gm...> >> >>> no... >>> >>> i don´t think that the propertychangeeventlistener will receive >>> varsetevents.... >>> you´ll have to open a managerconnection and add an eventlistener to it.. >>> >>> y. >>> >>> >>> Am 05.08.2013 16:03, schrieb Daniele Renda: >>> >>> Hi Yves, >>> thanks for your suggestion. >>> >>> You mean that in ; >>> >>> channel.addPropertyChangeListener(new PropertyChangeListener() { >>> >>> @Override >>> public void propertyChange(PropertyChangeEvent evt) { >>> >>> I need to test: >>> >>> if (evt.getSource() instanceof VarSetEvent) >>> >>> Right? >>> >>> Thanks >>> >>> >>> >>> 2013/8/5 Yves A. <yv...@gm...> >>> >>>> Have you tried to "listen" to the VarSetEvent ? >>>> >>>> yves >>>> >>>> Am 05.08.2013 14:29, schrieb Daniele Renda: >>>> >>>> Hi yves, >>>> sorry for the lack of details. >>>> >>>> I do this: >>>> >>>> OriginateAction action = createAction(telefonata); >>>> try { >>>> telefonata.onCreate(); >>>> asteriskServer.originateAsync(action, new >>>> MyOriginateCallback(telefonata)); >>>> } catch (ManagerCommunicationException e) { >>>> log.error(telefonata.getId() + " ha generato un >>>> errore", e); >>>> telefonata.onFailure(); >>>> } >>>> >>>> private class MyOriginateCallback implements OriginateCallback { >>>> >>>> private final TelefonataInterface telefonata; >>>> >>>> private MyOriginateCallback(TelefonataInterface telefonata) { >>>> this.telefonata = telefonata; >>>> } >>>> >>>> @Override >>>> public void onDialing(final AsteriskChannel channel) { >>>> log.debug("On dialing comunicazione " + telefonata.getId()); >>>> telefonata.onDialing(); >>>> channel.addPropertyChangeListener(new >>>> PropertyChangeListener() { >>>> >>>> @Override >>>> public void propertyChange(PropertyChangeEvent evt) { >>>> if (evt.getSource() instanceof AsteriskChannel) { >>>> >>>> // EVENTO DI HANGUP >>>> if (channel.getState() == ChannelState.HUNGUP) >>>> { >>>> String hangupCauseText = ""; >>>> if (channel.getHangupCauseText() != null) >>>> hangupCauseText = >>>> channel.getHangupCauseText(); >>>> telefonata.onHangupEvent(channel); >>>> } >>>> >>>> } >>>> }); >>>> } >>>> >>>> @Override >>>> public void onSuccess(AsteriskChannel channel) { >>>> log.debug("Success " + telefonata.getId() + " " + channel); >>>> log.debug("La comunicazione è iniziata alle " + >>>> channel.getDateOfCreation()); >>>> telefonata.onSuccess(); >>>> } >>>> >>>> @Override >>>> public void onNoAnswer(AsteriskChannel channel) { >>>> log.debug("NoAnswer " + telefonata.getId() + " " + channel); >>>> telefonata.onNoAnswer(); >>>> } >>>> >>>> @Override >>>> public void onBusy(AsteriskChannel channel) { >>>> log.debug("Busy " + telefonata.getId() + " " + channel); >>>> telefonata.onBusy(); >>>> } >>>> >>>> @Override >>>> public void onFailure(LiveException cause) { >>>> log.debug("OnFailure(...)' - " + telefonata.getId()); >>>> telefonata.onFailure(); >>>> } >>>> >>>> } >>>> >>>> My dialplan: >>>> >>>> [test] >>>> exten => s,1,Answer() >>>> exten => s,1,Playback(smt) >>>> exten => 3,n,Set(variable=This is the value of the variable) >>>> exten => s,n,Hangup() >>>> >>>> I've a PropertyChangeListener so I can know when the call hangup. I'd >>>> like to get the value of the variable into Javacode in my method >>>> onHangupEvent(), so when the call end I need to read that variable. >>>> I know that I can create a class that extends BaseAgiScript to get >>>> the variable, but there is another way to do this? Would be more >>>> convenient to have the variable in the method onHangupEvent() for my >>>> case. >>>> >>>> Thanks >>>> >>>> >>>> 2013/8/5 Yves A. <yv...@gm...> >>>> >>>>> why do most people always think, one could "guess" their code, >>>>> settings and environment that causes trouble? >>>>> >>>>> every access to a channel lead to an exception, if the channel is >>>>> already hung up. >>>>> if you need access to your channelvariables after hangup, you have to >>>>> go another way... >>>>> varsetevent and a local static map may be your friends here. >>>>> >>>>> of course there exists the h extensions which you could use to call >>>>> another agi after hangup, but as i wrote before... i have no >>>>> idea what your objective is, nor do i have any code to comment on... >>>>> >>>>> yves >>>>> >>>>> >>>>> Am 05.08.2013 13:00, schrieb Daniele Renda: >>>>> >>>>> Hi, >>>>> I need to read a variable that I set from dialplan after i receive >>>>> the onHangupEvent() on OriginateAsync. >>>>> But I've an exception because Asterisk Java don't find anymore the >>>>> channels because is hanged up I guess. >>>>> >>>>> So, there is another way to get the variable in Java before the call >>>>> ends? >>>>> >>>>> Thanks very much! >>>>> >>>>> -- >>>>> Daniele Renda >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Get your SQL database under version control now! >>>>> Version control is standard for application code, but databases havent >>>>> caught up. So what steps can you take to put your SQL databases under >>>>> version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Get your SQL database under version control now! >>>>> Version control is standard for application code, but databases havent >>>>> caught up. So what steps can you take to put your SQL databases under >>>>> version control? Why should you start doing it? Read more to find out. >>>>> >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>>> _______________________________________________ >>>>> Asterisk-java-users mailing list >>>>> Ast...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>>> >>>>> >>>> >>>> >>>> -- >>>> Daniele Renda >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Get your SQL database under version control now! >>>> Version control is standard for application code, but databases havent >>>> caught up. So what steps can you take to put your SQL databases under >>>> version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>> >>>> >>>> >>>> _______________________________________________ >>>> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Get your SQL database under version control now! >>>> Version control is standard for application code, but databases havent >>>> caught up. So what steps can you take to put your SQL databases under >>>> version control? Why should you start doing it? Read more to find out. >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>> >>> >>> -- >>> Daniele Renda >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but databases havent >>> caught up. So what steps can you take to put your SQL databases under >>> version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> >>> >>> >>> _______________________________________________ >>> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but databases havent >>> caught up. So what steps can you take to put your SQL databases under >>> version control? Why should you start doing it? Read more to find out. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >> >> >> -- >> Daniele Renda >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> >> >> >> _______________________________________________ >> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > > -- > Daniele Renda > -- Daniele Renda |
From: Daniele R. <dan...@gm...> - 2013-08-05 16:28:45
|
Sure, every time I remove the listener before adding new one. In effect my system should manage many calls, about 1500/2500 at day. On the other hand, using an Agiscript I have the problem that in my method I should update the db but doing so I update the db either in agiscript and then in the code of originateAsync and may be not simple manage locking of record because can happen that modification can be concurrent. Thanks 2013/8/5 Yves A. <yv...@gm...> > hi, > > this looks ok for me... as long as you dont forget to remove the listener. > I also would check the impact to the whole system / performance / memory > usage depending on the amount of calls > your code has to handle... i could imagine that this is not healthy for > high traffic... if you have a high call volume you > maybe should go another way.... but try it out and give feedback, > > yves > > > Am 05.08.2013 16:33, schrieb Daniele Renda: > > Ah ok, > the problem is that I need to know the value of the variable inside > "private class MyOriginateCallback implements OriginateCallback" because I > need the reference of my "Call" object that is inside this class. > So every time I should add and remove listener from managerconnection is > this way: > > channel.getServer().getManagerConnection().addEventListener(new > ManagerEventListener() { > > @Override > public void onManagerEvent(ManagerEvent event) { > if (event instanceof VarSetEvent) { > VarSetEvent varEvent = (VarSetEvent) event; > String variabile = varEvent.getVariable(); > log.debug("Impostata variabile: " + variabile + " > su telefonata " + telefonata.getId()); > String valore = varEvent.getValue(); > log.debug("Valore : " + valore + " su telefonata " > + telefonata.getId()); > } > > } > }); > > What do you think? > > Thanks > > > > > 2013/8/5 Yves A. <yv...@gm...> > >> no... >> >> i don´t think that the propertychangeeventlistener will receive >> varsetevents.... >> you´ll have to open a managerconnection and add an eventlistener to it.. >> >> y. >> >> >> Am 05.08.2013 16:03, schrieb Daniele Renda: >> >> Hi Yves, >> thanks for your suggestion. >> >> You mean that in ; >> >> channel.addPropertyChangeListener(new PropertyChangeListener() { >> >> @Override >> public void propertyChange(PropertyChangeEvent evt) { >> >> I need to test: >> >> if (evt.getSource() instanceof VarSetEvent) >> >> Right? >> >> Thanks >> >> >> >> 2013/8/5 Yves A. <yv...@gm...> >> >>> Have you tried to "listen" to the VarSetEvent ? >>> >>> yves >>> >>> Am 05.08.2013 14:29, schrieb Daniele Renda: >>> >>> Hi yves, >>> sorry for the lack of details. >>> >>> I do this: >>> >>> OriginateAction action = createAction(telefonata); >>> try { >>> telefonata.onCreate(); >>> asteriskServer.originateAsync(action, new >>> MyOriginateCallback(telefonata)); >>> } catch (ManagerCommunicationException e) { >>> log.error(telefonata.getId() + " ha generato un >>> errore", e); >>> telefonata.onFailure(); >>> } >>> >>> private class MyOriginateCallback implements OriginateCallback { >>> >>> private final TelefonataInterface telefonata; >>> >>> private MyOriginateCallback(TelefonataInterface telefonata) { >>> this.telefonata = telefonata; >>> } >>> >>> @Override >>> public void onDialing(final AsteriskChannel channel) { >>> log.debug("On dialing comunicazione " + telefonata.getId()); >>> telefonata.onDialing(); >>> channel.addPropertyChangeListener(new >>> PropertyChangeListener() { >>> >>> @Override >>> public void propertyChange(PropertyChangeEvent evt) { >>> if (evt.getSource() instanceof AsteriskChannel) { >>> >>> // EVENTO DI HANGUP >>> if (channel.getState() == ChannelState.HUNGUP) >>> { >>> String hangupCauseText = ""; >>> if (channel.getHangupCauseText() != null) >>> hangupCauseText = >>> channel.getHangupCauseText(); >>> telefonata.onHangupEvent(channel); >>> } >>> >>> } >>> }); >>> } >>> >>> @Override >>> public void onSuccess(AsteriskChannel channel) { >>> log.debug("Success " + telefonata.getId() + " " + channel); >>> log.debug("La comunicazione è iniziata alle " + >>> channel.getDateOfCreation()); >>> telefonata.onSuccess(); >>> } >>> >>> @Override >>> public void onNoAnswer(AsteriskChannel channel) { >>> log.debug("NoAnswer " + telefonata.getId() + " " + channel); >>> telefonata.onNoAnswer(); >>> } >>> >>> @Override >>> public void onBusy(AsteriskChannel channel) { >>> log.debug("Busy " + telefonata.getId() + " " + channel); >>> telefonata.onBusy(); >>> } >>> >>> @Override >>> public void onFailure(LiveException cause) { >>> log.debug("OnFailure(...)' - " + telefonata.getId()); >>> telefonata.onFailure(); >>> } >>> >>> } >>> >>> My dialplan: >>> >>> [test] >>> exten => s,1,Answer() >>> exten => s,1,Playback(smt) >>> exten => 3,n,Set(variable=This is the value of the variable) >>> exten => s,n,Hangup() >>> >>> I've a PropertyChangeListener so I can know when the call hangup. I'd >>> like to get the value of the variable into Javacode in my method >>> onHangupEvent(), so when the call end I need to read that variable. >>> I know that I can create a class that extends BaseAgiScript to get the >>> variable, but there is another way to do this? Would be more convenient >>> to have the variable in the method onHangupEvent() for my case. >>> >>> Thanks >>> >>> >>> 2013/8/5 Yves A. <yv...@gm...> >>> >>>> why do most people always think, one could "guess" their code, >>>> settings and environment that causes trouble? >>>> >>>> every access to a channel lead to an exception, if the channel is >>>> already hung up. >>>> if you need access to your channelvariables after hangup, you have to >>>> go another way... >>>> varsetevent and a local static map may be your friends here. >>>> >>>> of course there exists the h extensions which you could use to call >>>> another agi after hangup, but as i wrote before... i have no >>>> idea what your objective is, nor do i have any code to comment on... >>>> >>>> yves >>>> >>>> >>>> Am 05.08.2013 13:00, schrieb Daniele Renda: >>>> >>>> Hi, >>>> I need to read a variable that I set from dialplan after i receive the >>>> onHangupEvent() on OriginateAsync. >>>> But I've an exception because Asterisk Java don't find anymore the >>>> channels because is hanged up I guess. >>>> >>>> So, there is another way to get the variable in Java before the call >>>> ends? >>>> >>>> Thanks very much! >>>> >>>> -- >>>> Daniele Renda >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Get your SQL database under version control now! >>>> Version control is standard for application code, but databases havent >>>> caught up. So what steps can you take to put your SQL databases under >>>> version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>> >>>> >>>> >>>> _______________________________________________ >>>> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Get your SQL database under version control now! >>>> Version control is standard for application code, but databases havent >>>> caught up. So what steps can you take to put your SQL databases under >>>> version control? Why should you start doing it? Read more to find out. >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>> >>> >>> -- >>> Daniele Renda >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but databases havent >>> caught up. So what steps can you take to put your SQL databases under >>> version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> >>> >>> >>> _______________________________________________ >>> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your SQL database under version control now! >>> Version control is standard for application code, but databases havent >>> caught up. So what steps can you take to put your SQL databases under >>> version control? Why should you start doing it? Read more to find out. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >> >> >> -- >> Daniele Renda >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> >> >> >> _______________________________________________ >> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > > -- > Daniele Renda > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- Daniele Renda |