<div>Hi guys,</div><div><br></div><div>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.</div>
<div><br></div><div>I think that it is wrong, right?</div><div><br></div><div>I've already tryed to connect direct to a nc, simulating the deamon, and worked fine.</div><div><br></div><div>I've already executed the script direct from de shell, and there's no sintax errors.</div>
<div><br></div><div><br></div><div><b>Here is my dialplan extension:</b></div><div><extension name="outbound-socket"></div><div><div> <condition field="destination_number" expression="^55(522)$"></div>
<div> <action application="set" data="ivr_path=/usr/local/eox/programas/freeswitch/scripts/teste.php"/></div><div> <action application="socket" data="<a href="http://127.0.0.1:9099">127.0.0.1:9099</a> async full"/></div>
<div> </condition></div><div> </extension></div></div><div><br></div><div><br></div><div><b>Here is how I call the deamon:</b></div><div>(from the freeswitch bin dir)</div><div>./fs_ivrd -h 127.0.0.1 -p 9099</div>
<div><br></div><div><br></div><div><b>Here is my PHP script:</b></div><div><div>#!/usr/local/eox/programas/php/bin/php -q</div><div><?php</div><div>// set a couple of things so we dont kill the system</div><div>ob_implicit_flush(true);</div>
<div>set_time_limit(30);</div><div><br></div><div>// Open stdin so we can read the data in</div><div>$in = fopen("php://stdin", "r");</div><div><br></div><div>// Connect</div><div>echo "connect\n\n";</div>
<div><br></div><div>// Answer</div><div>echo "sendmsg\n";</div><div>echo "call-command: execute\n";</div><div>echo "execute-app-name: answer\n\n";</div><div><br></div><div>// Play a prompt</div>
<div>echo "sendmsg\n";</div><div>echo "call-command: execute\n";</div><div>echo "execute-app-name: log\n";</div><div>echo "execute-app-arg: CRIT Testing text...\n\n";</div><div><br>
</div><div>// Wait</div><div>sleep(2);</div><div><br></div><div>// Hangup</div><div>echo "sendmsg\n";</div><div>echo "call-command: hangup\n\n";</div><div><br></div><div>fclose($in);</div><div><br></div>
<div>?></div></div><div><br></div><div><br></div><div>I'll be grateful for any help.</div><div><br></div><div>Thanks, and sorry for any error in my english.</div><div><br></div><div>-- </div>Jeferson Rodrigo Almeida<br>
Engenheiro de Computação<br><a href="mailto:jefersonparanaense@gmail.com">jefersonparanaense@gmail.com</a><br>