As far as I know fs_ivrd listens on a specific port, and then forks another process (script) when something connects there, so only the forked process should be stopped when the script ends, but the main daemon should continue to run.

 

/Peter

 

 

Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Jeferson Rodrigo Almeida
Skickat: den 17 oktober 2012 16:39
Till: freeswitch-users@lists.freeswitch.org
Kopia: Daniel Romaniuk
Ämne: Re: [Freeswitch-users] FreeSWITCH-users Digest, Vol 76, Issue 108

 

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@gmail.com
!DSPAM:507ec04a32769025299678!