Hello, Using AGI script to accept the input from caller but input value is not getting stored in variable. Extract from AGI Script: $agi = new AGI(); $agi-> exec('Background','press_one0&press_two0&press_zero0'); $agi-> exec('Read','NUMBER,,1,3'); $agi-> verbose ("You have entered".$NUMBER); Console Output: AGI Script Executing Application: (Background) Options: (press_one0&press_two0&press_zero0) -- <DAHDI/21-1> Playing 'press_one0.gsm' (language 'en') -- <DAHDI/21-1> Playing 'press_two0.gsm' (language 'en') -- <DAHDI/21-1> Playing 'press_zero0.gsm' (language 'en') -- AGI Script Executing Application: (Read) Options: (NUMBER,,1,3) -- Accepting a maximum of 1 digits. -- User entered '1' pridid.php: You have entered [Mar 2 16:56:37] ERROR[20454]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe -- <DAHDI/21-1>AGI Script pridid.php completed, returning 0 Thanks, Kamlesh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120302/0d492d3c/attachment-0001.htm>
On 2 Mar 2012, at 11:35, Kamlesh Kumar wrote:> $agi = new AGI(); > $agi-> exec('Background','press_one0&press_two0&press_zero0'); > $agi-> exec('Read','NUMBER,,1,3'); > $agi-> verbose ("You have entered".$NUMBER);You need to use AGI to read the Asterisk variable.. Asterisk variables don't magically become PHP ones.. Or you get Asterisk to process it instead using ${NUMBER}. S -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120302/bb85ae41/attachment.htm>
Luis Alejandro Beltran CastaƱeda
2012-Mar-02 13:56 UTC
[asterisk-users] use of Read cmd with AGI
Hi, try some like this: in SOME_AGI.agi: $agi = new AGI(); $agi->answer(); $_result = $agi->get_data('beep', 3000, 20); $keys = $_result['result']; $agi->set_variable("TECLA", $keys); ... In the Dialplan: exten => s,1,Agi(SOME_AGI.agi) exten => s,n,NoOp(You have entered: ${TECLA}) .... That way you export the variable "TECLA" to Asterisk dialplan.... Regards! Atentamente, -- Luis Alejandro Beltr?n Casta?eda. Gerente General. SetColombia SAS. Bogota - Colombia. Tel/Fax: (571) 4756296 Movil: (57) 300-2721370 www.setcolombia.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120302/2a483b63/attachment.htm>
On Fri, 2 Mar 2012, Kamlesh Kumar wrote:> Using AGI script to accept the input from caller but input value is not getting stored in variable.> [Mar? 2 16:56:37] ERROR[20454]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe > ??? -- <DAHDI/21-1>AGI Script pridid.php completed, returning 0A broken pipe means you are violating the AGI protocol. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000