asterisk-java-users Mailing List for Asterisk-Java Library (Page 128)
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: Martin S. <ma...@be...> - 2007-08-21 13:48:11
|
Hello Timothy, When you say there's a timeout, does Asterisk-Java log an exception, or just take a while? What version of Asterisk? What version of Asterisk-Java? You aren't using a manager proxy, I don't think. If you connect to the manager interface with telnet, and paste the action in, does it take awhile? Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of Timothy Creswick > Sent: Sunday, August 19, 2007 3:30 PM > To: ast...@li... > Subject: [Asterisk-java-users] ExtensionStateAction on Asterisk 1.4 >=20 > Dear All, >=20 > I'm having trouble with the ExtensionStateAction,=20 > specifically that I'm > getting timeouts. >=20 > I've watched the data on the port and the Asterisk server is=20 > responding > correctly, but it looks like asterisk-java is not parsing the response > (malformed by Asterisk perhaps?). >=20 > Here's a sample of what the Asterisk server is sending back: >=20 > Response: Success > ActionID: 13754931_22# > Message: Extension Status > Exten: 7001100 > Context: sip-phones > Hint: SIP/7001100 > Status: 0 >=20 > Is there a patch available for either Asterisk or asterisk-java? What > *should* the response be looking like? >=20 > Thanks, >=20 >=20 > Timothy Creswick >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >=20 |
From: Martin S. <ma...@be...> - 2007-08-21 13:42:56
|
Hello Jan, =20 I couldn't find a good way to ask Asterisk what channels are being MixMonito'd except by patching app_mixmonitor.c in Asterisk itself (I looked at the CLI and AMI). My intuition and current Asterisk experience tells me that the MixMonitor application rarely "fails" -- may I ask what has happened for you to cause failure to record? It wouldn't surprise me if there was an easier problem to solve, like avoiding recording failure in the first place. In a single day, our call center is sometimes recording 60+ calls at once, and we never fail, AFAIK. =20 Also, I'd suggest asking on Asterisk-Uiser too. =20 Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Jan Du Toit Sent: Monday, August 20, 2007 6:38 AM To: ast...@li... Subject: [Asterisk-java-users] Making sure meetme records. =09 =09 Hi. =09 This question is probably not appropriate for this list, sorry, but was hoping somebody could give some insight. We have a commercial application that uses the Asterisk meetme module. The conferences held, must be recorded and we use the 'r' option for that. In the past we have encountered some technical problems which caused the conferences not to be recorded. As a result the client has asked to provide them with a mechanism that checks whether its actually recording and keeps on recording correctly - in the event of failure the user, conducting the conference via our software, must be alerted immediately. How will one go about this? Any ideas?=20 =09 Thanks you. Regards, Jan. =09 |
From: Wirsansky, E. <eya...@ve...> - 2007-08-20 18:28:35
|
Perhaps you can launch a separate thread to monitor the size of the file(s) that hold the active recording, and alert if there is no change in the size of the file over a certain period. =20 Eyal =20 ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Jan Du Toit Sent: Monday, August 20, 2007 6:38 AM To: ast...@li... Subject: [Asterisk-java-users] Making sure meetme records. =20 Hi. This question is probably not appropriate for this list, sorry, but was hoping somebody could give some insight. We have a commercial application that uses the Asterisk meetme module. The conferences held, must be recorded and we use the 'r' option for that. In the past we have encountered some technical problems which caused the conferences not to be recorded. As a result the client has asked to provide them with a mechanism that checks whether its actually recording and keeps on recording correctly - in the event of failure the user, conducting the conference via our software, must be alerted immediately. How will one go about this? Any ideas?=20 Thanks you. Regards, Jan. |
From: Jan Du T. <jan...@de...> - 2007-08-20 10:37:31
|
Hi. This question is probably not appropriate for this list, sorry, but was hoping somebody could give some insight. We have a commercial application that uses the Asterisk meetme module. The conferences held, must be recorded and we use the 'r' option for that. In the past we have encountered some technical problems which caused the conferences not to be recorded. As a result the client has asked to provide them with a mechanism that checks whether its actually recording and keeps on recording correctly - in the event of failure the user, conducting the conference via our software, must be alerted immediately. How will one go about this? Any ideas? Thanks you. Regards, Jan. |
From: Timothy C. <ti...@th...> - 2007-08-19 19:30:30
|
Dear All, I'm having trouble with the ExtensionStateAction, specifically that I'm getting timeouts. I've watched the data on the port and the Asterisk server is responding correctly, but it looks like asterisk-java is not parsing the response (malformed by Asterisk perhaps?). Here's a sample of what the Asterisk server is sending back: Response: Success ActionID: 13754931_22# Message: Extension Status Exten: 7001100 Context: sip-phones Hint: SIP/7001100 Status: 0 Is there a patch available for either Asterisk or asterisk-java? What *should* the response be looking like? Thanks, Timothy Creswick |
From: Stefan R. <ste...@re...> - 2007-08-16 21:57:31
|
Hey, > I think there's an issue with thread synchronization in Asterisk-Java a= t > the moment. could you provide some kind of isolated test case to reproduce this? If it's really a sync issue within A-J we should fix it rather quickly :-= ) =3DStefan |
From: Stefan R. <ste...@re...> - 2007-08-16 21:42:46
|
Hi Pedro, first, please ask for support on the asterisk-users mailing list so others can benefit from your question, too. http://asterisk-java.org/development/mail-lists.html Regarding your question: You are sending actions from the manager event thread which causes a deadlock that's why you get the TimeoutException. You must either send the action from a different thread or just use the live API (look for DefaultAsteriskServer) that also allows watching for events and reading variables at a higher level that takes care of the low level threading issues. =3DStefan Pedro J. Romero wrote: > Dear Stefan: >=20 > =20 >=20 > First of all, thank you very much for your great job. I=E2=80=99m Pedro= Romero > from Iten, S.L. in Spain. We are a little company of software developer= s > and asterisk integrators, and we are using asterisk-java to make a > little interface to asterisk. >=20 > =20 >=20 > Perhaps you can help us with a little problem we have encountered: we > want to read a variable from a channel, and when we try to do it, Java > throws a TimeOutException. We have no look so deep, I=E2=80=99ve though= t the > best would be to write to you first. >=20 > =20 >=20 > The code is this: >=20 > =20 >=20 > *public* *void* onManagerEvent(ManagerEvent event){ >=20 > String cliente=3D""; >=20 > ManagerResponse response=3D*new* ManagerResponse(); >=20 > *if*(event.getClass().getSimpleName().equals("JoinEvent")){= >=20 > JoinEvent ev=3D(JoinEvent)event; >=20 > *try*{ >=20 > GetVarAction getVarAction =3D *new* GetVarActio= n(); >=20 > getVarAction.setChannel(ev.getChannel()); >=20 > getVarAction.setVariable("CLIENTE"); >=20 > response =3D > parent.getManager().sendAction(getVarAction); =C3=9F parent is the inst= ance > where inside which the managerConnection is declared. >=20 > cliente =3D response.getAttribute("Value"); >=20 > } >=20 > *catch*(TimeoutException exc){System./out/.println("Tiempo > de espera agotado");} >=20 > *catch*(IOException exc){System./out/.println("Error de I/O= ");} >=20 > ... >=20 > ... >=20 > } >=20 > =20 >=20 > We have tried to increase the timeout (with a second argument to the > method sendAction) without success. I think I=E2=80=99ve read somewhere= that > there was a problem with timeout and responses coming to fast, solved i= n > 0.3-m1. We are trying 0.3-m2. >=20 > =20 >=20 > If you tell me that the code is the good one, we will going into deep t= o > look for any bug, and we will inform you if we find something. >=20 > =20 >=20 > Advanced thanks, and congratulations again for your work. >=20 > =20 >=20 > Pedro J. Romero. >=20 > Iten, S.L. >=20 --=20 reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: <gl...@gm...> - 2007-08-16 18:41:42
|
Look up the DefaultAsteriskServer Class, it has an originateToExtension method, or something like that. Which is a sync method. On 8/16/07, Martin Smith <ma...@be...> wrote: > Hello Chuck, > > I think there's an issue with thread synchronization in Asterisk-Java at > the moment. The Live API keeps track of a channel by unique ID, and AJ > gets the failure event before the live API has recorded the unique of > the channel -- the failure event ends up triggering a lookup by unique > id, and can't find the channel yet. > > Hopefully that's a good explanation of the problem. > > I recall that you can use an OriginateAction with > .setAsync(Boolean.FALSE) if you are using the core part of the library, > but I don't think there is an option for that in the live API yet. > > I hope I've explained that correctly, though I don't have a solution. > Perhaps Stefan can comment more. > > 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 CHUCK SYPERSKI > > Sent: Wednesday, August 15, 2007 3:02 PM > > To: ast...@li... > > Subject: Re: [Asterisk-java-users] Termination Status > > > > Is there a way to detect if the line you just called is busy. > > When I dial a busy number I keep getting: > > > > org.asteriskjava.live.NoSuchChannelException: Channel > > 'SIP/1xxxxxxxxxx@gafachi' is not available > > > > Here is part of the code, its a bite ugly: > > > > public void run() > > { > > fireEvent( D88CCEvent.CCTHREAD_BORN ); > > try > > { > > if ( login() ) > > { > > DefaultAsteriskServer server =3D > > new DefaultAsteriskServer( managerConnection ); > > fireEvent( > > D88CCEvent.CCTHREAD_RINGING ); > > String sp =3D ""; > > if ( > > task.getAsteriskServiceProvider() !=3D null && > > task.getAsteriskServiceProvider().length() > 0 ) > > sp =3D "@" + > > task.getAsteriskServiceProvider(); > > > > channel =3D > > server.originateToExtension(task.getAsteriskTrunk() + "/" + > > task.getPhone() + sp, task.getAsteriskContext(), > > task.getExtension()+"", 1, task.getTimeOut() * 1000 ); > > > > if ( channel !=3D null ) > > { > > handleStateChange( channel ); > > ChannelState oldState =3D null; > > if ( channel.getState() > > =3D=3D ChannelState.UP || channel.getState() =3D=3D > > ChannelState.RINGING || channel.getState() =3D=3D ChannelState.RING ) > > { > > while( > > channel.getState() =3D=3D ChannelState.UP || channel.getState() > > =3D=3D ChannelState.RINGING || channel.getState() =3D=3D ChannelState.R= ING ) > > { > > sleep( > > 100 ); > > } > > > > if ( oldState > > !=3D channel.getState() ) > > { > > > > handleStateChange( channel ); > > > > oldState =3D channel.getState(); > > } > > } > > else > > { > > fireEvent( > > D88CCEvent.CCTHREAD_GENERAL_ERROR ); > > lg( > > channel.toString() ); > > System.exit( 1 ); > > } > > > > handleStateChange( channel ); > > finalizeCall( channel ); > > } > > managerConnection.logoff(); > > } > > > > } > > catch( Exception e ) > > { > > blComplete =3D true; > > > > if ( e instanceof NoSuchChannelException ) > > { > > fireEvent( > > D88CCEvent.CCTHREAD_INVALIDNUMBER ); > > System.err.println( e.toString() ); > > e.printStackTrace(); > > > > if ( channel !=3D null && > > channel.wasBusy() ) > > { > > System.out.println( > > "Was Busy" ); > > } > > else > > { > > System.out.println( > > "Was NOT Busy" ); > > } > > > > System.out.println( e.getCause() ); > > System.out.println( e.getMessage() ); > > > > System.exit( 1 ); > > } > > else > > { > > intCompletionCode =3D > > D88CCEvent.CCTHREAD_DIED; > > System.err.println( e.getMessage() ); > > e.printStackTrace(); > > //fireEvent( intCompletionCode ); > > System.exit( 1 ); > > } > > } > > > > } > > > > >>> ma...@be... 08/15/07 11:52AM >>> > > Hi Chuck, > > > > I wish I had an answer to that question myself. I'm not sure there's a > > way that is completely error-free, especially given an older > > generation > > of answering machine that may do any number of things. > > > > Is your project open source? > > > > 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 CHUCK SYPERSKI > > > Sent: Wednesday, August 15, 2007 12:02 PM > > > To: ast...@li... > > > Subject: [Asterisk-java-users] Termination Status > > > > > > I am in the process of testing a autodialer I wrote for a > > > school district. Basically what I do is make an outgoing > > > call via a gafachi sip trunk and connect the user to an > > > internal extension that plays a message and hangs up. > > > Everything works great, but I wanted to know if there is > > > anyway that I can tell if I have called a fax machine, or > > > voicemail. Right now I am using the live package and I am > > > using the AsteriskChannel.getState() and using the > > > HangupCause enumeration. Thanks so much for any help that > > > can be provided and thanks for writting a great api. > > > > > > Thanks, > > > Chuck Syperski > > > DuPage High School District 88 > > > > > > > > > -------------------------------------------------------------- > > > ----------- > > > This SF.net email is sponsored by: Splunk Inc. > > > Still grepping through log files to find problems? Stop. > > > Now Search log events and configuration files using AJAX and > > > a browser. > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > _______________________________________________ > > > Asterisk-java-users mailing list > > > Ast...@li... > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > -------------------------------------------------------------- > > ----------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and > > a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > -------------------------------------------------------------- > > ----------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and > > a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > --=20 Guilherme Loch G=F3es MSN:gl...@gm... (48) 99115299 |
From: Martin S. <ma...@be...> - 2007-08-16 18:33:02
|
Hello Chuck, I think there's an issue with thread synchronization in Asterisk-Java at the moment. The Live API keeps track of a channel by unique ID, and AJ gets the failure event before the live API has recorded the unique of the channel -- the failure event ends up triggering a lookup by unique id, and can't find the channel yet. Hopefully that's a good explanation of the problem.=20 I recall that you can use an OriginateAction with .setAsync(Boolean.FALSE) if you are using the core part of the library, but I don't think there is an option for that in the live API yet. I hope I've explained that correctly, though I don't have a solution. Perhaps Stefan can comment more. Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of CHUCK SYPERSKI > Sent: Wednesday, August 15, 2007 3:02 PM > To: ast...@li... > Subject: Re: [Asterisk-java-users] Termination Status >=20 > Is there a way to detect if the line you just called is busy.=20 > When I dial a busy number I keep getting: >=20 > org.asteriskjava.live.NoSuchChannelException: Channel=20 > 'SIP/1xxxxxxxxxx@gafachi' is not available >=20 > Here is part of the code, its a bite ugly: >=20 > public void run() > { > fireEvent( D88CCEvent.CCTHREAD_BORN ); > try > { =09 > if ( login() ) > { > DefaultAsteriskServer server =3D=20 > new DefaultAsteriskServer( managerConnection ); > fireEvent(=20 > D88CCEvent.CCTHREAD_RINGING ); > String sp =3D ""; > if (=20 > task.getAsteriskServiceProvider() !=3D null &&=20 > task.getAsteriskServiceProvider().length() > 0 ) > sp =3D "@" +=20 > task.getAsteriskServiceProvider(); > =09 > channel =3D=20 > server.originateToExtension(task.getAsteriskTrunk() + "/" +=20 > task.getPhone() + sp, task.getAsteriskContext(),=20 > task.getExtension()+"", 1, task.getTimeOut() * 1000 ); >=20 > if ( channel !=3D null ) > { =09 > handleStateChange( channel ); > ChannelState oldState =3D null; > if ( channel.getState()=20 > =3D=3D ChannelState.UP || channel.getState() =3D=3D=20 > ChannelState.RINGING || channel.getState() =3D=3D ChannelState.RING ) > { > while(=20 > channel.getState() =3D=3D ChannelState.UP || channel.getState()=20 > =3D=3D ChannelState.RINGING || channel.getState() =3D=3D = ChannelState.RING ) > { > sleep(=20 > 100 ); =09 > } > =09 > if ( oldState=20 > !=3D channel.getState() ) > { > =09 > handleStateChange( channel );=09 > =09 > oldState =3D channel.getState(); > } > } > else > { > fireEvent(=20 > D88CCEvent.CCTHREAD_GENERAL_ERROR ); > lg(=20 > channel.toString() ); > System.exit( 1 ); > } > =09 > handleStateChange( channel );=09 > finalizeCall( channel ); > } > managerConnection.logoff(); > }=09 > =09 > } > catch( Exception e ) > {=09 > blComplete =3D true; >=20 > if ( e instanceof NoSuchChannelException ) > { > fireEvent(=20 > D88CCEvent.CCTHREAD_INVALIDNUMBER ); > System.err.println( e.toString() ); > e.printStackTrace(); > =09 > if ( channel !=3D null &&=20 > channel.wasBusy() ) > { > System.out.println(=20 > "Was Busy" ); > } > else > { > System.out.println(=20 > "Was NOT Busy" ); =09 > } =09 > =09 > System.out.println( e.getCause() ); > System.out.println( e.getMessage() ); > =09 > System.exit( 1 ); > } > else > { > intCompletionCode =3D=20 > D88CCEvent.CCTHREAD_DIED; > System.err.println( e.getMessage() ); > e.printStackTrace(); > //fireEvent( intCompletionCode );=09 > System.exit( 1 );=09 > } > } > =09 > } >=20 > >>> ma...@be... 08/15/07 11:52AM >>> > Hi Chuck, >=20 > I wish I had an answer to that question myself. I'm not sure there's a > way that is completely error-free, especially given an older=20 > generation > of answering machine that may do any number of things. >=20 > Is your project open source? >=20 > Martin Smith, Systems Developer > ma...@be...=20 > Bureau of Economic and Business Research > University of Florida > (352) 392-0171 Ext. 221=20 >=20 > =20 >=20 > > -----Original Message----- > > From: ast...@li...=20 > > [mailto:ast...@li...] On=20 > > Behalf Of CHUCK SYPERSKI > > Sent: Wednesday, August 15, 2007 12:02 PM > > To: ast...@li...=20 > > Subject: [Asterisk-java-users] Termination Status > >=20 > > I am in the process of testing a autodialer I wrote for a=20 > > school district. Basically what I do is make an outgoing=20 > > call via a gafachi sip trunk and connect the user to an=20 > > internal extension that plays a message and hangs up. =20 > > Everything works great, but I wanted to know if there is=20 > > anyway that I can tell if I have called a fax machine, or=20 > > voicemail. Right now I am using the live package and I am=20 > > using the AsteriskChannel.getState() and using the=20 > > HangupCause enumeration. Thanks so much for any help that=20 > > can be provided and thanks for writting a great api. > >=20 > > Thanks, > > Chuck Syperski > > DuPage High School District 88 > >=20 > >=20 > > -------------------------------------------------------------- > > ----------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and=20 > > a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/=20 > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li...=20 > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users=20 > >=20 >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/=20 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li...=20 > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >=20 |
From: CHUCK S. <CSY...@DU...> - 2007-08-15 19:02:42
|
Is there a way to detect if the line you just called is busy. When I dial = a busy number I keep getting: org.asteriskjava.live.NoSuchChannelException: Channel 'SIP/1xxxxxxxxxx@gafa= chi' is not available Here is part of the code, its a bite ugly: public void run() { fireEvent( D88CCEvent.CCTHREAD_BORN ); try { =09 if ( login() ) { DefaultAsteriskServer server =3D new = DefaultAsteriskServer( managerConnection ); fireEvent( D88CCEvent.CCTHREAD_RINGING ); String sp =3D ""; if ( task.getAsteriskServiceProvider() = !=3D null && task.getAsteriskServiceProvider().length() > 0 ) sp =3D "@" + task.getAsteriskServic= eProvider(); =09 channel =3D server.originateToExtension(tas= k.getAsteriskTrunk() + "/" + task.getPhone() + sp, task.getAsteriskContext(= ), task.getExtension()+"", 1, task.getTimeOut() * 1000 ); if ( channel !=3D null ) { =09 handleStateChange( channel ); ChannelState oldState =3D null; if ( channel.getState() =3D=3D = ChannelState.UP || channel.getState() =3D=3D ChannelState.RINGING || = channel.getState() =3D=3D ChannelState.RING ) { while( channel.getState() = =3D=3D ChannelState.UP || channel.getState() =3D=3D ChannelState.RINGING = || channel.getState() =3D=3D ChannelState.RING ) { sleep( 100 ); = =09 } =09 if ( oldState !=3D = channel.getState() ) { handleStateChange( = channel );=09 oldState =3D = channel.getState(); } } else { fireEvent( D88CCEvent.CCTHR= EAD_GENERAL_ERROR ); lg( channel.toString() ); System.exit( 1 ); } =09 handleStateChange( channel );=09 finalizeCall( channel ); } managerConnection.logoff(); }=09 =09 } catch( Exception e ) {=09 blComplete =3D true; if ( e instanceof NoSuchChannelException ) { fireEvent( D88CCEvent.CCTHREAD_INVALIDNUMBE= R ); System.err.println( e.toString() ); e.printStackTrace(); =09 if ( channel !=3D null && channel.wasBusy()= ) { System.out.println( "Was Busy" ); } else { System.out.println( "Was NOT Busy" = ); =09 } =09 =09 System.out.println( e.getCause() ); System.out.println( e.getMessage() ); =09 System.exit( 1 ); } else { intCompletionCode =3D D88CCEvent.CCTHREAD_D= IED; System.err.println( e.getMessage() ); e.printStackTrace(); //fireEvent( intCompletionCode );=09 System.exit( 1 );=09 } } =09 } >>> ma...@be... 08/15/07 11:52AM >>> Hi Chuck, I wish I had an answer to that question myself. I'm not sure there's a way that is completely error-free, especially given an older generation of answering machine that may do any number of things. Is your project open source? Martin Smith, Systems Developer ma...@be...=20 Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of CHUCK SYPERSKI > Sent: Wednesday, August 15, 2007 12:02 PM > To: ast...@li...=20 > Subject: [Asterisk-java-users] Termination Status >=20 > I am in the process of testing a autodialer I wrote for a=20 > school district. Basically what I do is make an outgoing=20 > call via a gafachi sip trunk and connect the user to an=20 > internal extension that plays a message and hangs up. =20 > Everything works great, but I wanted to know if there is=20 > anyway that I can tell if I have called a fax machine, or=20 > voicemail. Right now I am using the live package and I am=20 > using the AsteriskChannel.getState() and using the=20 > HangupCause enumeration. Thanks so much for any help that=20 > can be provided and thanks for writting a great api. >=20 > Thanks, > Chuck Syperski > DuPage High School District 88 >=20 >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/=20 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li...=20 > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users=20 >=20 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/=20 _______________________________________________ Asterisk-java-users mailing list Ast...@li...=20 https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: CHUCK S. <CSY...@DU...> - 2007-08-15 17:47:03
|
Right now it isn't released at all to the public, as soon as it is = complete and functional I was going to release it under GPL v2. >>> ma...@be... 08/15/07 11:52AM >>> Hi Chuck, I wish I had an answer to that question myself. I'm not sure there's a way that is completely error-free, especially given an older generation of answering machine that may do any number of things. Is your project open source? Martin Smith, Systems Developer ma...@be...=20 Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of CHUCK SYPERSKI > Sent: Wednesday, August 15, 2007 12:02 PM > To: ast...@li...=20 > Subject: [Asterisk-java-users] Termination Status >=20 > I am in the process of testing a autodialer I wrote for a=20 > school district. Basically what I do is make an outgoing=20 > call via a gafachi sip trunk and connect the user to an=20 > internal extension that plays a message and hangs up. =20 > Everything works great, but I wanted to know if there is=20 > anyway that I can tell if I have called a fax machine, or=20 > voicemail. Right now I am using the live package and I am=20 > using the AsteriskChannel.getState() and using the=20 > HangupCause enumeration. Thanks so much for any help that=20 > can be provided and thanks for writting a great api. >=20 > Thanks, > Chuck Syperski > DuPage High School District 88 >=20 >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/=20 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li...=20 > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users=20 >=20 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/=20 _______________________________________________ Asterisk-java-users mailing list Ast...@li...=20 https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Robert P. <ro...@ro...> - 2007-08-15 17:33:26
|
Hey Martin, No worries about timing :) I've been thinking a bit about what might help ... while my first inclination is to say "of course a response should be specific (i.e., class/type) to the event it's a response to", that would mean a new hierarchy/set of subclasses, and could raise the learning curve that much more for beginners. It might just be unnecessarily clutter in the response package. One alternative is an (abstract?) default ManagerResponse subclass that provides a bunch of empty methods that can be ignored if you're not interested in that data/it's not that kind of response, but you can override those that do have the data you're interested in. The methods would ideally cover everything possible from any AMI response ... Also not so pretty. In terms of documentation, it says in the method comment for ManagerResponse.getAttributes(): "Returns a Map with all attributes of this response." I read that but didn't really get it. Maybe a paragraph or two explaining what the attributes Map is and that it's a catch-all for all the data from the AMI in the class comments/javadoc would help make that more explicit. I hope this helps - thanks! Cheers, Robert On 8/15/07, Martin Smith <ma...@be...> wrote: > Hi Robert, > > I'm sorry I didn't answer sooner -- with most responses, the response > subclasses (command response, getconfig response, etc) have setters that > are called when traversing the attributes map. This means anything that > isn't an actual data member of the class is always still sitting in the > Map. > > For good measure, here's the documentation as it stands regarding the > ManagerResponse and the getAttributes method: > http://asterisk-java.org/development/apidocs/org/asteriskjava/manager/re > sponse/ManagerResponse.html > > Would you suggest we make it more explicit in the class summary that the > attributes are what most users would want? We'd welcome that suggestion > and other ones for improving the javadocs :) > > Martin Smith, Systems Developer > ma...@be... > Bureau of Economic and Business Research > University of Florida > (352) 392-0171 Ext. 221 |
From: Martin S. <ma...@be...> - 2007-08-15 17:16:00
|
Hi Chuck, I wish I had an answer to that question myself. I'm not sure there's a way that is completely error-free, especially given an older generation of answering machine that may do any number of things. Is your project open source? Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of CHUCK SYPERSKI > Sent: Wednesday, August 15, 2007 12:02 PM > To: ast...@li... > Subject: [Asterisk-java-users] Termination Status >=20 > I am in the process of testing a autodialer I wrote for a=20 > school district. Basically what I do is make an outgoing=20 > call via a gafachi sip trunk and connect the user to an=20 > internal extension that plays a message and hangs up. =20 > Everything works great, but I wanted to know if there is=20 > anyway that I can tell if I have called a fax machine, or=20 > voicemail. Right now I am using the live package and I am=20 > using the AsteriskChannel.getState() and using the=20 > HangupCause enumeration. Thanks so much for any help that=20 > can be provided and thanks for writting a great api. >=20 > Thanks, > Chuck Syperski > DuPage High School District 88 >=20 >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >=20 |
From: Martin S. <ma...@be...> - 2007-08-15 17:15:57
|
Hi Robert, I'm sorry I didn't answer sooner -- with most responses, the response subclasses (command response, getconfig response, etc) have setters that are called when traversing the attributes map. This means anything that isn't an actual data member of the class is always still sitting in the Map. For good measure, here's the documentation as it stands regarding the ManagerResponse and the getAttributes method: http://asterisk-java.org/development/apidocs/org/asteriskjava/manager/re sponse/ManagerResponse.html Would you suggest we make it more explicit in the class summary that the attributes are what most users would want? We'd welcome that suggestion and other ones for improving the javadocs :) Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of Robert Prince > Sent: Wednesday, August 15, 2007 12:17 PM > To: ast...@li... > Subject: [Asterisk-java-users] resolution: question about=20 > getting peersusing SipShowPeerAction (AMI) >=20 > Folks, >=20 > Well, I feel rather foolish. It turns out the ManagerResponse already > held all the information I was after, in its HashMap 'attributes' - > accessible via getAttributes(). In this case, the information I'm > after is the same that is returned at the Asterisk console by the > command 'sip show peer [peer name]'. So while it may have been > unnecessary effort, at least all my fumbling around exposed me to more > of the API and functionality, and I also learned a bit more about > Asterisk in the process. >=20 > So, while perhaps the API could be documented in a bit more detail, or > maybe there could be more explicit (or just more) tutorials/docs, hats > off for a great app. >=20 >=20 > Cheers, >=20 > Robert >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >=20 |
From: Robert P. <ro...@ro...> - 2007-08-15 16:17:24
|
Folks, Well, I feel rather foolish. It turns out the ManagerResponse already held all the information I was after, in its HashMap 'attributes' - accessible via getAttributes(). In this case, the information I'm after is the same that is returned at the Asterisk console by the command 'sip show peer [peer name]'. So while it may have been unnecessary effort, at least all my fumbling around exposed me to more of the API and functionality, and I also learned a bit more about Asterisk in the process. So, while perhaps the API could be documented in a bit more detail, or maybe there could be more explicit (or just more) tutorials/docs, hats off for a great app. Cheers, Robert |
From: CHUCK S. <CSY...@DU...> - 2007-08-15 16:03:45
|
I am in the process of testing a autodialer I wrote for a school district. = Basically what I do is make an outgoing call via a gafachi sip trunk and = connect the user to an internal extension that plays a message and hangs = up. Everything works great, but I wanted to know if there is anyway that = I can tell if I have called a fax machine, or voicemail. Right now I am = using the live package and I am using the AsteriskChannel.getState() and = using the HangupCause enumeration. Thanks so much for any help that can = be provided and thanks for writting a great api. Thanks, Chuck Syperski DuPage High School District 88 |
From: Robert P. <ro...@ro...> - 2007-08-11 00:25:09
|
Well ... I still haven't had much success. Here's the scenario that I'm using: First, all is set up as stated in the start of this thread. 1) I pull the plug on my ATA, causing my two peers (test1 and test2) to time out eventually. 2) I see the unreachable events in the Asterisk console: *CLI> [Aug 10 19:59:58] NOTICE[9540]: chan_sip.c:15360 sip_poke_noanswer: Peer 'test1' is now UNREACHABLE! Last qualify: 94 [Aug 10 20:00:05] NOTICE[9540]: chan_sip.c:15360 sip_poke_noanswer: Peer 'test2' is now UNREACHABLE! Last qualify: 93 3) I see the PeerStatusEvents from the code (forgive my **** and &&&&, it's to help me identify specific debugging statements): **** PeerStatusEvent: org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Fri Aug 10 20:09:46 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test2',time='-1',cause='null',peerstatus='Unreachable',systemHashcode=7359402] **** peer name: test2 &&&&&&&&& SipShowPeerAction action complete event class: class org.asteriskjava.manager.event.PeerlistCompleteEvent *** Manager Response: org.asteriskjava.manager.response.ManagerResponse: actionId='actionIdtest2'; message='null'; response='Success'; uniqueId='null'; systemHashcode=12577309 **** PeerStatusEvent: org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Fri Aug 10 20:09:47 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test1',time='-1',cause='null',peerstatus='Unreachable',systemHashcode=27475272] **** peer name: test1 &&&&&&&&& SipShowPeerAction action complete event class: class org.asteriskjava.manager.event.PeerlistCompleteEvent *** Manager Response: org.asteriskjava.manager.response.ManagerResponse: actionId='actionIdtest1'; message='null'; response='Success'; uniqueId='null'; systemHashcode=813251 But, I don't see PeerlistCompleteEvents, or PeerEntryEvents. What I expect from reading the javadoc is that when I send a SipShowPeerAction to the AMI, it should result in the AMI sending me back a PeerEntryEvent, and possibly also a PeerlistCompleteEvent (?not sure about that). But, I don't seem to get either. I've posted the (very simple) code I'm using on Google docs to see if it will help point out where I'm going wrong - please, feel free to take a look and if there's anything, let me know! http://docs.google.com/Doc?id=dcpvc479_33gqzn2s Cheers, Robert On 8/10/07, Robert Prince <ro...@ro...> wrote: > Hello Stefan, > > Thanks very much for your help - I'll give that a try! > > > Cheers, > > Robert > > On 8/9/07, Stefan Reuter <ste...@re...> wrote: > > Hi Robert, > > > > first thanks for your very well prepared question, it's a pleasure to > > reply to it :) > > > > > **** PeerStatusEvent: > > > org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Thu Aug 09 > > > 20:16:31 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test2',time='97',cause='null',peerstatus='Reachable',systemHashcode=22618484] > > > ** Manager Response: org.asteriskjava.manager.response.ManagerError: > > > actionId='null'; message='Peer SIP/test2 not found.'; > > > response='Error'; uniqueId='null'; systemHashcode=10703525 > > > > The problem is that SipShowPeer requires only the name of the peer > > without the channel prefix ("SIP/"). Unfortunately the PeerStatus event > > returns the name with the channel prefix and Asterisk calls both > > attributes just "peer". I will have a look at the javadocs to make this > > more clear. > > For you this means you just have to strip the channel prefix before > > passing the peer name to the SipShowPeerAction. > > > > Hope that helps, > > > > Stefan > > > > -- > > reuter network consulting > > Neusser Str. 110 > > 50760 Koeln > > Germany > > Telefon: +49 221 1305699-0 > > Telefax: +49 221 1305699-90 > > E-Mail: ste...@re... > > Jabber: ste...@re... > > > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > |
From: Mike <mi...@si...> - 2007-08-10 23:19:31
|
-Greetings- Any thoughts about bandwidth or server utilization as it would apply = to an increasing number of clients which queried events from an Asterisk = Server? I personally do not see potential loading issues ...However, = just in case I am overlooking something -any words of cautions? -Mike- |
From: Robert P. <ro...@ro...> - 2007-08-10 16:10:43
|
Hello Stefan, Thanks very much for your help - I'll give that a try! Cheers, Robert On 8/9/07, Stefan Reuter <ste...@re...> wrote: > Hi Robert, > > first thanks for your very well prepared question, it's a pleasure to > reply to it :) > > > **** PeerStatusEvent: > > org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Thu Aug 09 > > 20:16:31 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test2',time='97',cause='null',peerstatus='Reachable',systemHashcode=22618484] > > ** Manager Response: org.asteriskjava.manager.response.ManagerError: > > actionId='null'; message='Peer SIP/test2 not found.'; > > response='Error'; uniqueId='null'; systemHashcode=10703525 > > The problem is that SipShowPeer requires only the name of the peer > without the channel prefix ("SIP/"). Unfortunately the PeerStatus event > returns the name with the channel prefix and Asterisk calls both > attributes just "peer". I will have a look at the javadocs to make this > more clear. > For you this means you just have to strip the channel prefix before > passing the peer name to the SipShowPeerAction. > > Hope that helps, > > Stefan > > -- > reuter network consulting > Neusser Str. 110 > 50760 Koeln > Germany > Telefon: +49 221 1305699-0 > Telefax: +49 221 1305699-90 > E-Mail: ste...@re... > Jabber: ste...@re... > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > |
From: Miked <mi...@si...> - 2007-08-10 03:05:05
|
OK ... I know you were all waiting for me to 'get it' on my own... stupid syntax crap :-) This works! if (event instanceof MeetMeJoinEvent) { System.out.println(((MeetMeJoinEvent)event).getMeetMe()); } THANKS!!! ----- Original Message ----- From: "Miked" <mi...@si...> To: "Carlos G Mendioroz" <tr...@ac...>; <ast...@li...> Sent: Thursday, August 09, 2007 9:09 PM Subject: Re: [Asterisk-java-users] MeetMeJoinEvent > OK Java casting got that ...google is my friend ;-) after thinking I > understood and applying the suggested code ... Eclipse flags error on the > last line 'event.getMeetMe()' "The Method getMeetMe() is undefined for > the > type ManagerEvent" However what does work is as follows: > > This works: > if (event.getClass().equals(MeetMeJoinEvent.class)) { > > MeetMeJoinEvent mmje=(MeetMeJoinEvent)event; > > System.out.println(mmje.getMeetMe()); > > } > > > > Code flaged with error "undefined for type ManagerEvent": > > if (event instanceof MeetMeJoinEvent) { > System.out.println((MeetMeJoinEvent)event.getMeetMe()); } > > > > Not sure why??? Maybe this is Java 101 stuff, but just trying to > understand > ..it would seems these bits of code are the same???.... Help is GREATLY > APPRECIATED! > > ----- Original Message ----- > From: "Carlos G Mendioroz" <tr...@ac...> > To: <ast...@li...> > Cc: <mi...@si...> > Sent: Thursday, August 09, 2007 5:40 AM > Subject: Re: [Asterisk-java-users] MeetMeJoinEvent > > >> Oops, typo :) >> This should go into a FAQ. >> >> Events returned via onManagerEvent come with a common type of Event. >> Depending on the current event, more functionality is available via >> subclasses (of which the actual event "is a"). >> >> Usually you access subclass functionality by casting to the subclass, >> guarded by a type check like: >> >> public void onManagerEvent(ManagerEvent event) >> { >> // just print received events >> System.out.println(event); >> >> if (event.getClass().equals(MeetMeJoinEvent.class)) { >> System.out.println((MeetMeJoinEvent)event.getMeetMe()); >> ... >> >> HTH. >> >> Stefan Reuter @ 09/08/2007 05:18 -0300 dixit: >>> try this: (and take a look at some java introduction ;) >>> >>> public void onManagerEvent(ManagerEvent event) >>> { >>> // just print received events >>> System.out.println(event); >>> >>> System.out.println((MeetMeJoinEvent) mmje.getMeetMe()); >>> } >>> >>> >>> >>> ------------------------------------------------------------------------ >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> -- >> Carlos G Mendioroz <tr...@ac...> >> >> >> -- >> No virus found in this incoming message. >> Checked by AVG Free Edition. >> Version: 7.5.476 / Virus Database: 269.11.10/943 - Release Date: 8/8/2007 >> 5:38 PM >> >> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.11.10/943 - Release Date: 8/8/2007 > 5:38 PM > > |
From: Miked <mi...@si...> - 2007-08-10 01:09:27
|
OK Java casting got that ...google is my friend ;-) after thinking I understood and applying the suggested code ... Eclipse flags error on the last line 'event.getMeetMe()' "The Method getMeetMe() is undefined for the type ManagerEvent" However what does work is as follows: This works: if (event.getClass().equals(MeetMeJoinEvent.class)) { MeetMeJoinEvent mmje=(MeetMeJoinEvent)event; System.out.println(mmje.getMeetMe()); } Code flaged with error "undefined for type ManagerEvent": if (event instanceof MeetMeJoinEvent) { System.out.println((MeetMeJoinEvent)event.getMeetMe()); } Not sure why??? Maybe this is Java 101 stuff, but just trying to understand ..it would seems these bits of code are the same???.... Help is GREATLY APPRECIATED! ----- Original Message ----- From: "Carlos G Mendioroz" <tr...@ac...> To: <ast...@li...> Cc: <mi...@si...> Sent: Thursday, August 09, 2007 5:40 AM Subject: Re: [Asterisk-java-users] MeetMeJoinEvent > Oops, typo :) > This should go into a FAQ. > > Events returned via onManagerEvent come with a common type of Event. > Depending on the current event, more functionality is available via > subclasses (of which the actual event "is a"). > > Usually you access subclass functionality by casting to the subclass, > guarded by a type check like: > > public void onManagerEvent(ManagerEvent event) > { > // just print received events > System.out.println(event); > > if (event.getClass().equals(MeetMeJoinEvent.class)) { > System.out.println((MeetMeJoinEvent)event.getMeetMe()); > ... > > HTH. > > Stefan Reuter @ 09/08/2007 05:18 -0300 dixit: >> try this: (and take a look at some java introduction ;) >> >> public void onManagerEvent(ManagerEvent event) >> { >> // just print received events >> System.out.println(event); >> >> System.out.println((MeetMeJoinEvent) mmje.getMeetMe()); >> } >> >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- > Carlos G Mendioroz <tr...@ac...> > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.11.10/943 - Release Date: 8/8/2007 > 5:38 PM > > |
From: Carlos G M. <tr...@hu...> - 2007-08-10 00:55:00
|
Hmm, your peer is "SIP/test1" or just "test1" ? Asterisk is not all that clean in naming things here and there. A bit of parsing here and there might help. I'm fighting right now with agents and all things that are taken for granted. Like Agent/XXXX being an agent callback channel, which is sometimes referred to by the context/extension used to reach it, sometimes by the channel being used by it... HTH Robert Prince @ 09/08/2007 21:38 -0300 dixit: > Hello asterisk-java folks, > > I've read the tutorial, and the javadoc, and browsed the mailing > lists, but so far I can't find why what I'm trying to do does not > work. > > I have an asterisk server (1.49), and two peers configured (called > 'test1' and 'test2'). The peers connect and register properly and all > that good stuff (using Linksys SPA2102). > > I'm trying to use asterisk-java to detect peer state changes - > specifically, reachable and unreachable events. The following seems > to be basic code for how to do that: > > ... (assume ManagerConnection works, we've logged in to the AMI > successfully, etc) ... > > public void onManagerEvent(ManagerEvent event) { > String peerName = ""; > if (event instanceof PeerStatusEvent) { > peerName = ((PeerStatusEvent) event).getPeer(); > System.out.println("**** PeerStatusEvent: "+event); > SipShowPeerAction showPeer = new SipShowPeerAction(peerName); > managerConnection.sendAction(showPeer, new > SendActionCallback() { > public void onResponse(ManagerResponse response) { > System.out.println("** Manager > Response: " + response); > } > }); > } > if (event instanceof PeerEntryEvent) { > System.out.println("** peer entry event - IP address: > "+((PeerEntryEvent) event).getIpAddress()); > System.out.println("** peer entry event - port: > "+((PeerEntryEvent) event).getIpPort()); > } > > What I hope this should do for me, if I'm reading the javadocs > correctly, is poke the asterisk server into giving me (through > asterisk-java) a PeerEntryEvent, so I can get the IP address and port. > However, what I get is the following: > > **** PeerStatusEvent: > org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Thu Aug 09 > 20:16:31 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test2',time='97',cause='null',peerstatus='Reachable',systemHashcode=22618484] > ** Manager Response: org.asteriskjava.manager.response.ManagerError: > actionId='null'; message='Peer SIP/test2 not found.'; > response='Error'; uniqueId='null'; systemHashcode=10703525 > **** PeerStatusEvent: > org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Thu Aug 09 > 20:16:33 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test1',time='100',cause='null',peerstatus='Reachable',systemHashcode=8846886] > ** Manager Response: org.asteriskjava.manager.response.ManagerError: > actionId='null'; message='Peer SIP/test1 not found.'; > response='Error'; uniqueId='null'; systemHashcode=9938272 > > I'm a bit confused ... I see the peer names in the PeerStatusEvents, > but then the ManagerError says they don't exist. Is there something > in manager.conf I need to do? I've configured it thus: > > [general] > enabled = yes > port = 5038 > bindaddr = 0.0.0.0 > > [manager] > secret=xxxxxxxx > permit=0.0.0.0/0.0.0.0 > read=all,event,system,call,log,verbose,agent,command,user > write=all,event,system,call,log,verbose,agent,command,user > > Honestly I don't even know if 'all,event' are proper syntax or really > do anything, but I have been trying lots of things to see if it's e.g. > a configuration problem. > > Anyone have ideas? Much appreciated! > > > Cheers, > > Robert > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > -- Carlos G Mendioroz <tr...@hu...> LW7 EQI Argentina |
From: Stefan R. <ste...@re...> - 2007-08-10 00:52:48
|
Hi Robert, first thanks for your very well prepared question, it's a pleasure to reply to it :) > **** PeerStatusEvent: > org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=3DThu Aug 0= 9 > 20:16:31 EDT 2007,privilege=3D'system,all',timestamp=3D'null',peer=3D'S= IP/test2',time=3D'97',cause=3D'null',peerstatus=3D'Reachable',systemHashc= ode=3D22618484] > ** Manager Response: org.asteriskjava.manager.response.ManagerError: > actionId=3D'null'; message=3D'Peer SIP/test2 not found.'; > response=3D'Error'; uniqueId=3D'null'; systemHashcode=3D10703525 The problem is that SipShowPeer requires only the name of the peer without the channel prefix ("SIP/"). Unfortunately the PeerStatus event returns the name with the channel prefix and Asterisk calls both attributes just "peer". I will have a look at the javadocs to make this more clear. For you this means you just have to strip the channel prefix before passing the peer name to the SipShowPeerAction. Hope that helps, Stefan --=20 reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Robert P. <ro...@ro...> - 2007-08-10 00:38:04
|
Hello asterisk-java folks, I've read the tutorial, and the javadoc, and browsed the mailing lists, but so far I can't find why what I'm trying to do does not work. I have an asterisk server (1.49), and two peers configured (called 'test1' and 'test2'). The peers connect and register properly and all that good stuff (using Linksys SPA2102). I'm trying to use asterisk-java to detect peer state changes - specifically, reachable and unreachable events. The following seems to be basic code for how to do that: ... (assume ManagerConnection works, we've logged in to the AMI successfully, etc) ... public void onManagerEvent(ManagerEvent event) { String peerName = ""; if (event instanceof PeerStatusEvent) { peerName = ((PeerStatusEvent) event).getPeer(); System.out.println("**** PeerStatusEvent: "+event); SipShowPeerAction showPeer = new SipShowPeerAction(peerName); managerConnection.sendAction(showPeer, new SendActionCallback() { public void onResponse(ManagerResponse response) { System.out.println("** Manager Response: " + response); } }); } if (event instanceof PeerEntryEvent) { System.out.println("** peer entry event - IP address: "+((PeerEntryEvent) event).getIpAddress()); System.out.println("** peer entry event - port: "+((PeerEntryEvent) event).getIpPort()); } What I hope this should do for me, if I'm reading the javadocs correctly, is poke the asterisk server into giving me (through asterisk-java) a PeerEntryEvent, so I can get the IP address and port. However, what I get is the following: **** PeerStatusEvent: org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Thu Aug 09 20:16:31 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test2',time='97',cause='null',peerstatus='Reachable',systemHashcode=22618484] ** Manager Response: org.asteriskjava.manager.response.ManagerError: actionId='null'; message='Peer SIP/test2 not found.'; response='Error'; uniqueId='null'; systemHashcode=10703525 **** PeerStatusEvent: org.asteriskjava.manager.event.PeerStatusEvent[dateReceived=Thu Aug 09 20:16:33 EDT 2007,privilege='system,all',timestamp='null',peer='SIP/test1',time='100',cause='null',peerstatus='Reachable',systemHashcode=8846886] ** Manager Response: org.asteriskjava.manager.response.ManagerError: actionId='null'; message='Peer SIP/test1 not found.'; response='Error'; uniqueId='null'; systemHashcode=9938272 I'm a bit confused ... I see the peer names in the PeerStatusEvents, but then the ManagerError says they don't exist. Is there something in manager.conf I need to do? I've configured it thus: [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 [manager] secret=xxxxxxxx permit=0.0.0.0/0.0.0.0 read=all,event,system,call,log,verbose,agent,command,user write=all,event,system,call,log,verbose,agent,command,user Honestly I don't even know if 'all,event' are proper syntax or really do anything, but I have been trying lots of things to see if it's e.g. a configuration problem. Anyone have ideas? Much appreciated! Cheers, Robert |
From: David R. <dr...@in...> - 2007-08-09 09:50:51
|
On Thu, 2007-08-09 at 06:40 -0300, Carlos G Mendioroz wrote: > Usually you access subclass functionality by casting to the subclass, > guarded by a type check like: >=20 > public void onManagerEvent(ManagerEvent event) > { > // just print received events > System.out.println(event); > =09 > if (event.getClass().equals(MeetMeJoinEvent.class)) { if (event instanceof MeetMeJoinEvent) { > System.out.println((MeetMeJoinEvent)event.getMeetMe()); This might be much more common. :) Nitpicking, David --=20 INA Service GmbH Papenreye 63 22453 Hamburg Germany Mail: in...@in... Phone: +49 (0)40 557 07-07 Fax: +49 (0)40 557 07-100 Gesch=C3=A4ftsf=C3=BChrer: Ines M. Hoerner Amtsgericht Hamburg HRB 96470 Ust-IdNr. DE248754961 |