Hello,<br><br>I am trying to create PHP application that will be receiving information about each call from freeswitch and send commands to control freeswitch.<br><br>I found an example at <a href="https://wiki.freeswitch.org/wiki/PHP_ESL#ivrd">https://wiki.freeswitch.org/wiki/PHP_ESL#ivrd</a>  BUT unfortunately they do not explain how I can retrieve information from freeswitch (so I can do the routing in PHP).<br>
<br>I guess I should use PHP ESL but the documentation is pretty bad so if someone has some working example, I&#39;d appreciate it.<br><br>I tried to read from stdin this way:<br><br><br><i>#!/usr/bin/php -q<br><br>&lt;?php<br>
<br>// set a couple of things so we dont kill the system<br>ob_implicit_flush(true);<br>set_time_limit(30);<br><br>// Open stdin so we can read the data in<br>$in = fopen(&quot;php://stdin&quot;, &quot;r&quot;);<br><br>// Connect<br>
echo &quot;connect\n\n&quot;;<br><br>// READ DATA<br>$text = fgets($in);<br>file_put_contents(&#39;/usr/local/freeswitch/scripts/socketlog.txt&#39; ,$text, FILE_APPEND);<br><br>// Answer<br>echo &quot;sendmsg\n&quot;;<br>
echo &quot;call-command: execute\n&quot;;<br>echo &quot;execute-app-name: answer\n\n&quot;;<br><br>// Play a prompt<br>echo &quot;sendmsg\n&quot;;<br>echo &quot;call-command: execute\n&quot;;<br>echo &quot;execute-app-name: playback\n&quot;;<br>
echo &quot;execute-app-arg: /usr/local/freeswitch/sounds/en/us/callie/ivr/8000/ivr-welcome_to_freeswitch.wav\n\n&quot;;<br><br>// Wait<br>sleep(5);<br><br>// Hangup<br>echo &quot;sendmsg\n&quot;;<br>echo &quot;call-command: hangup\n\n&quot;;<br>
<br>fclose($in);<br><br>?&gt;</i><br><br><b>Unfortunately, everything I get as a result in my log file is:</b><br><br><i>Event-Name: CHANNEL_DATA</i><br><br>