[Asterisk-Dev] Re: Asterisk-Dev Digest, Vol 10, Issue 111
saad
saad at palmchip.com
Sun May 22 22:32:09 MST 2005
hello,
strace is cool. heres the relevant part of the trace...
write(2, "java.lang.NoClassDefFoundError: "...,
347java.lang.NoClassDefFoundError: /var/lib/asterisk/agi-bin/TestAGI
this is when i give the full path, and
access("./TestAGI.class", F_OK) = -1 ENOENT (No such file or
directory)
write(2, "java.lang.NoClassDefFoundError: "...,
321java.lang.NoClassDefFoundError: TestAGI
without the full path.
interestingly enough, when i run the script from bash it executes correctly
but not when i invoke it from asterisk. the path is ok in astersik.conf.
i tried using asterisk-java but it seems to get confused when i do agi://.
asterisk-java isnt really that useful for me anyway.
--saad
> try running it with strace, so you can see what it's getting/receiving.
>
> I.e. change gij voo.class to strace gij foo.class 2>/tmp/strace.out
>
> It should help you uncover what's happening.
>
> -SteveK
>
> On May 20, 2005, at 7:50 AM, saad wrote:
>
> > hello,
> >
> > i have been trying to get agi's working with java. the code is:
> >
> > import java.io.*;
> > class TestAGI {
> > public static void main( String[] args ) {
> > try {
> > String linea;
> > LineNumberReader in = new LineNumberReader( new
> > InputStreamReader( System.in ) );
> > do { //read AGI environmet
> > linea = in.readLine();
> > } while ( linea.length() > 0 );
> > System.out.println( "SAY NUMBER 123 \"*#\"" );
> > linea = in.readLine();
> > System.err.println("Received "+linea);
> > System.exit( 0 );
> > } catch( Exception ex ) {
> > System.err.println("Error: "+ex.getMessage());
> > }
> > }
> > }
> >
> > this is the only example code for java i could find on the net and
> > this wont work. i get the following output:
> >
> > AGI("SIP/222-ca1b", "test-java.agi") in new stack
> > -- Launched AGI Script /var/lib/asterisk/agi-bin/test-java.agi
> > AGI Tx >> agi_request: test-java.agi
> > AGI Tx >> agi_channel: SIP/222-ca1b
> > AGI Tx >> agi_language: en
> > AGI Tx >> agi_type: SIP
> > AGI Tx >> agi_uniqueid: 1116586348.1
> > AGI Tx >> agi_callerid: 222
> > AGI Tx >> agi_calleridname: saad
> > AGI Tx >> agi_dnid: 7300
> > AGI Tx >> agi_rdnis: unknown
> > AGI Tx >> agi_context: sipcall
> > AGI Tx >> agi_extension: 7300
> > AGI Tx >> agi_priority: 1
> > AGI Tx >> agi_enhanced: 0.0
> > AGI Tx >> agi_accountcode:
> > AGI Tx >> CLI>
> > -- AGI Script test-java.agi completed, returning 0
> >
> > the agi is a bash script that makes a simple gij TestAGI but
> > apparently that doesnt get called. however the perl script gets
> > executed perfectly and i hear the sounds etc. somebody mentioned
> > that it works with changing the println to print, but that didnt
> > work either.if anybody has any idea please help me out. also if
> > anybody has some more sample codes i would really appreciate it if
> > i can take a look at it.
> >
> > --saad
More information about the asterisk-dev
mailing list