[Asterisk-Dev] java agi. Help me!

SteveK stevek at stevek.com
Fri May 20 04:59:27 MST 2005


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
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20050520/0bcba4ea/attachment.htm


More information about the asterisk-dev mailing list