[Freeswitch-users] I am using outbound to ivrd. My Call gets answered however why do I not get events with $conn->events("plain", "ALL");

jaflong jaflong jaflong at yandex.com
Mon Jul 20 19:14:54 MSD 2015




<include>
        <extension name="demo">
                <condition field="destination_number" expression="^(\d+)$">
					<action application="set" data="ivr_path=/usr/local/freeswitch/scripts/ivr_test.php"/>
					<action application="socket" data="127.0.0.1:8004" async full/>
                </condition>
        </extension>
</include>



ivr_test.php
--------------

#!/usr/bin/php
<?php
require_once('ESL.php');

$conn = new ESLconnection(0);

$music = "/usr/local/freeswitch/sounds/demo.wav";

$conn->execute("answer");
$conn->execute("playback", $music);


while ($conn->connected() == 1) {

	$conn->events("plain", "ALL");

	$e = $conn->recvEvent();
	if ($e) {
		$name = $e->getHeader('event-name');
		//echo "Got event $name\n";
		$out = fopen('php://stderr', 'w+');
		fwrite($out, "Got event $name\n");

	} else {

		//echo "Event empty\n";
		$out = fopen('php://stderr', 'w+');
		fwrite($out, "Event empty\n");
	}

	
}

I am using outbound to ivrd. My Call gets answered however why do I not get events with $conn->events("plain", "ALL");



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list