[Freeswitch-users] FreeSWITCH-users Digest, Vol 76, Issue 108
Jeferson Rodrigo Almeida
jefersonparanaense at gmail.com
Wed Oct 17 18:38:59 MSD 2012
Hi guys,
I'm trying to use the fs_ivrd daemon, to execute a php script, that is
called by the dialplan. It works like a charm, if not for the fact that the
daemon (fs_ivrd) ends once the script (php) ends. In a system, I'll have to
execute this script many times, and the daemon have to stay up.
I think that it is wrong, right?
I've already tryed to connect direct to a nc, simulating the deamon, and
worked fine.
I've already executed the script direct from de shell, and there's no
sintax errors.
*Here is my dialplan extension:*
<extension name="outbound-socket">
<condition field="destination_number" expression="^55(522)$">
<action application="set"
data="ivr_path=/usr/local/eox/programas/freeswitch/scripts/teste.php"/>
<action application="socket" data="127.0.0.1:9099 async full"/>
</condition>
</extension>
*Here is how I call the deamon:*
(from the freeswitch bin dir)
./fs_ivrd -h 127.0.0.1 -p 9099
*Here is my PHP script:*
#!/usr/local/eox/programas/php/bin/php -q
<?php
// set a couple of things so we dont kill the system
ob_implicit_flush(true);
set_time_limit(30);
// Open stdin so we can read the data in
$in = fopen("php://stdin", "r");
// Connect
echo "connect\n\n";
// Answer
echo "sendmsg\n";
echo "call-command: execute\n";
echo "execute-app-name: answer\n\n";
// Play a prompt
echo "sendmsg\n";
echo "call-command: execute\n";
echo "execute-app-name: log\n";
echo "execute-app-arg: CRIT Testing text...\n\n";
// Wait
sleep(2);
// Hangup
echo "sendmsg\n";
echo "call-command: hangup\n\n";
fclose($in);
?>
I'll be grateful for any help.
Thanks, and sorry for any error in my english.
--
Jeferson Rodrigo Almeida
Engenheiro de Computação
jefersonparanaense at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20121017/16911ffc/attachment.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list