Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP AGI & Asterisk

Status
Not open for further replies.

vacunita

Programmer
Aug 2, 2001
9,166
MX
I've been thrust into a position where I need to learn how this works.

There's a PHP script that manages the Asterisk service through AGI. Its not too complex at this point merely answering the phone and playing back audio files depending on button presses. I have however an issue with the button presses in that AGI sends 4 or 5 inputs to the PHP script prior to the actual data input that not only stop the audio playback, but also mess up the selections as the input is actually valid. Code = 200 and result = 1. So there's no way of telling if the input is the user's or just AGi sending it.

Not sure if this is PHP, AGI or even Asterisk, but I really must find a way to either clear these inputs or ignore them.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
I finally figured it put in case anybody runs in to this issue. The php code that controls the dial plan was inherited. It was terribly designed. As I learned through testing, and Google, you can't send any output the normal way like you would if Php was producing a web page. As anything sent out gets sent to Asterisk as a command. Which can cause major issues. This means no echoes, prints, or anything else that may produce any sort of output .

After searching through the different files I found a few print_r's scattered around causing issues.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top