Thread: Re: [Asterisk-java-users] Termination Status
Brought to you by:
srt
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: 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: 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: <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: Stefan R. <ste...@re...> - 2007-08-16 21:57:31
Attachments:
signature.asc
|
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 |