[Freeswitch-users] Freeswitch php scripts

Nduwayezu, Joselyne 35633 at heb.be
Thu Apr 28 11:40:03 MSD 2016


Hello,

I would like to invoke php script in the dial plan.
I defined the dialplan as follos:


<include>
 <extension name="outbound-socket">
  <condition field="${sip_to_user}" expression="(972550428)$">
   <action application="set"
data="ivr_path=/usr/local/freeswitch/scripts/ivrd-demo.php"/>
   <action application="socket" data="10.0.0.6:8021 async full"/>-->
  </condition>
 </extension>
</include>

And my php script is:


<?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: playback\n";
 echo "execute-app-arg: \
 /usr/local/freeswitch/sounds/en/us/callie/ivr/8000/ivr-welcome_to_freeswitch.wav\n\n
\
 ";
 // Wait
 sleep(5);
 // Hangup
 echo "sendmsg\n";
 echo "call-command: hangup\n\n";
 fclose($in);
 ?>

When i dial the DID number, the call state is "call setup" for a while, and
after i'm asked to leave a message because the number is busy or
unreachable.

I tried different sockets in the dialplan (5060, 5080, 8040) with no results

Any adeas of what is happening?

Thanks


NDUWAYEZU Joselyne

-- 
Haute École de Bruxelles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160428/3c6b79e4/attachment.html 


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