<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">try running it with strace, so you can see what it's getting/receiving.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I.e. change gij voo.class to strace gij foo.class 2>/tmp/strace.out</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>It should help you uncover what's happening.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-SteveK</DIV><DIV><BR><DIV><DIV>On May 20, 2005, at 7:50 AM, saad wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV><FONT face="Arial" size="2"><DIV><FONT face="Arial" size="2">hello,</FONT></DIV> <DIV><FONT face="Arial" size="2"></FONT> </DIV> <DIV><FONT face="Arial" size="2">i have been trying to get agi's working with java. the code is:</FONT></DIV> <DIV><FONT face="Arial" size="2"></FONT> </DIV> <DIV><FONT face="Arial" size="2">import java.io.*;</FONT></DIV> <DIV><FONT face="Arial" size="2">class TestAGI {</FONT></DIV> <DIV><FONT face="Arial" size="2"> public static void main( String[] args ) {</FONT></DIV> <DIV><FONT face="Arial" size="2"> try {</FONT></DIV> <DIV><FONT face="Arial" size="2"> String linea;</FONT></DIV> <DIV><FONT face="Arial" size="2"> LineNumberReader in = new LineNumberReader( new InputStreamReader( System.in ) );</FONT></DIV> <DIV><FONT face="Arial" size="2"> do { //read AGI environmet</FONT></DIV> <DIV><FONT face="Arial" size="2"> linea = in.readLine();</FONT></DIV> <DIV><FONT face="Arial" size="2"> } while ( linea.length() > 0 );</FONT></DIV> <DIV><FONT face="Arial" size="2"> System.out.println( "SAY NUMBER 123 \"*#\"" );</FONT></DIV> <DIV><FONT face="Arial" size="2"> linea = in.readLine();</FONT></DIV> <DIV><FONT face="Arial" size="2"> System.err.println("Received "+linea);</FONT></DIV> <DIV><FONT face="Arial" size="2"> System.exit( 0 );</FONT></DIV> <DIV><FONT face="Arial" size="2"> } catch( Exception ex ) {</FONT></DIV> <DIV><FONT face="Arial" size="2"> System.err.println("Error: "+ex.getMessage());</FONT></DIV> <DIV><FONT face="Arial" size="2"> }</FONT></DIV> <DIV><FONT face="Arial" size="2"> }</FONT></DIV> <DIV><FONT face="Arial" size="2">}</FONT></DIV> <DIV><FONT face="Arial" size="2"></FONT> </DIV> <DIV><FONT face="Arial" size="2">this is the only example code for java i could find on the net and this wont work. i get the following output:</FONT></DIV> <DIV><FONT size="2"><FONT face="Arial" size="2"></FONT></FONT> </DIV> <DIV><FONT size="2"><FONT face="Arial" size="2">AGI("SIP/222-ca1b", "test-java.agi") in new stack<BR>-- Launched AGI Script /var/lib/asterisk/agi-bin/test-java.agi<BR>AGI Tx >> agi_request: test-java.agi<BR>AGI Tx >> agi_channel: SIP/222-ca1b<BR>AGI Tx >> agi_language: en<BR>AGI Tx >> agi_type: SIP<BR>AGI Tx >> agi_uniqueid: 1116586348.1<BR>AGI Tx >> agi_callerid: 222<BR>AGI Tx >> agi_calleridname: saad<BR>AGI Tx >> agi_dnid: 7300<BR>AGI Tx >> agi_rdnis: unknown<BR>AGI Tx >> agi_context: sipcall<BR>AGI Tx >> agi_extension: 7300<BR>AGI Tx >> agi_priority: 1<BR>AGI Tx >> agi_enhanced: 0.0<BR>AGI Tx >> agi_accountcode:<BR>AGI Tx >> CLI><BR>-- AGI Script test-java.agi completed, returning 0</FONT></FONT></DIV> <DIV><FONT size="2"><FONT face="Arial" size="2"></FONT></FONT> </DIV> <DIV><FONT size="2"><FONT face="Arial" size="2">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.</FONT></FONT></DIV> <DIV><FONT size="2"><FONT face="Arial" size="2"></FONT></FONT> </DIV> <DIV><FONT size="2"><FONT size="2"><FONT face="Arial">--saad</FONT></FONT></FONT></DIV><FONT size="2"><FONT size="2"></FONT></FONT></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Asterisk-Dev mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Asterisk-Dev@lists.digium.com">Asterisk-Dev@lists.digium.com</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">To UNSUBSCRIBE or update options visit:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN><A href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>