Thank you for the reply. 1- yes i need to call my agi script; because i have to process some tasks with my DBMS on the caller. 2- yes it is my first script, "While very simple, the AGI protocol is easy to violate" i did not get your meaning. 5-yes i agree with you, is there an other solution? So do you have a perfect solution to handle this? I am new to agi for this i need the help from you Best regards
________________________________ De : Steve Edwards <asterisk....@sedwards.com> À : Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users@lists.digium.com> Envoyé le : Dim 6 juin 2010, 4h 47min 59s Objet : Re: [asterisk-users] Controlling calls On Sat, 5 Jun 2010, Adil Zaaraoui wrote: > 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. 0) Please post requests with a more meaningful subject. There are lots of ways to control calls. 1) Do you need to call an AGI? Can you use an absolute timeout of 1 minute? 2) Is this your first AGI? While very simple, the AGI protocol is easy to violate. 3) You are executing "FastAGI." Is this required by the Java package you are using? 4) I'm just a 1.2 weenie and I've never used "G," but won't the "G" option transfer the calling party to "myscript" and the called party to "myscript+1?" 5) Not related to your issue, but "spinning" on the channel status doesn't look like a good idea. Adding a "wait(x)" to your while loop may help with CPU resource consumption. 6) More detail like what version of Asterisk and some console output with AGI debugging enabled may help. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _____________________________________________________________________ -- 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
-- _____________________________________________________________________ -- 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