[asterisk-users] Controlling calls

Adil Zaaraoui adilzeaaraoui at yahoo.fr
Sat Jun 5 18:41:21 CDT 2010


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


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100605/f14dc573/attachment.htm 


More information about the asterisk-users mailing list