Hello folks,

I want to write an AGI script doing this:

1-user call a number.
2-asterisk call the agi script
3-the script dial the peer
4-if the call is answered, let the call up for 1min
5-then the script hangs up the channel.

I tried either in php or in java but no success.

In java i did this:

//////////////
exec("Dial", "IAX2/400"); 
 boolean t=true;
while(t){
     if(getChannel().getChannelStatus()==6)t=false;
  }
wait(60000);
hangup(); 
//////////
in my extension.conf:
exten =>777,1,AGI(agi://localhost/sc.agi)
the script is running but it does not hangup.

Second solution,i tried this :
exten => 777,1,Dial(IAX2/400,G(myscript))
exten =>777,n(myscript),AGI(agi://localhost/sc.agi)

in sc.agi in this time i do not call exec("Dial","IAX2/400") statment; but the 
audio stops, no ringing.

Do you have any solution.

thanks for your help


      
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to