<div><br></div><div>Hi,</div><div><br></div><div>i park the call and then execute the speak command as but execute is not working any idea ?</div><div><br></div><div><div> $cmd = "api originate {origination_uuid=$uuid}user/$user &park()";</div>
<div> $text = "Hi, we have a meeting on Monday at 9, are you joining us, if yes then press, 1. and if not press, 2.";</div><div><br></div><div> $e = $esl->sendRecv($cmd);</div><div> $esl->execute('speak',"(cepstral|callie|$text)",$uuid);</div>
<div><br></div></div><div><br></div><div><br></div><div>my complete code is </div><div><br></div><div><span style><?php</span><br style><br style><span style> require_once('ESL.php');</span><br style><br style>
<span style> $host_name = 'localhost';</span><br style><span style> $port = '8021';</span><br style><span style> $password = 'ClueCon';</span><br style><br style>
<span style> $esl = new ESLconnection($host_name,$</span><span style>port,$password);</span><br style><br style><span style> $e = $esl->sendRecv("api create_uuid");</span><br style><span style> $uuid = $e->getBody();</span><br style>
<span style> $user = '1500';</span><br style><br style><div> $cmd = "bgapi originate {origination_uuid=$uuid}user/$user &park()";</div><div> $text = "Hi, we have a meeting on Monday at 9, are you joining us, if yes then press, 1. and if not press, 2.";</div>
<div><br></div><div> $e = $esl->sendRecv($cmd);</div><div> $esl->execute('speak',"(cepstral|callie|$text)",$uuid);</div><br class="Apple-interchange-newline"><span style><br></span></div><div><span style> $e = $esl->sendRecv("events plain all");</span><br style>
<span style> $e = $esl->filter("Unique-ID",$</span><span style>uuid);</span><br style><br style><span style> while ($esl->connected())</span><br style><span style> {</span><br style><span style> $e = $esl->recvEvent();</span><br style>
<span style> $result = $e->getType();</span><br style><span style> if($result=='CHANNEL_EXECUTE_</span><span style>COMPLETE')</span><br style><span style> {</span><br style><span style> // what i do here...!</span><br style>
<span style> $esl->execute("&sleep",10000);</span><br style><span style> }</span><br style><span style> $digit = $e->getHeader("DTMF-Digit");</span><br style>
<span style> $state_no = $e->getHeader("Channel-State-</span><span style>Number");</span><br style><span style> $curr_uuid = $e->getHeader("Channel-Call-</span><span style>UUID");</span><br style>
<br style><span style> /*</span><br style><span style> $ans_state = $e->getHeader("Answer-State");</span><br style><span style> $state_no = $e->getHeader("Channel-State-</span><span style>Number");</span><br style>
<span style> $core_id = $e->getHeader("Core-UUID");</span><br style><span style>*/</span><br style><span style> if($curr_uuid==$uuid && $digit!=NULL)</span><br style><span style> {</span><br style>
<span style> print "input number is " . $digit . "\n";</span><br style><span style> }</span><br style><span style> $state = $e->getHeader("Channel-Call-</span><span style>State");</span><br style>
<span style> if ($state == 'HANGUP') {</span><br style><span style> print "\n\nHangup Cause Number: " . $state_no;</span><br style><span style> $esl->disconnect();</span><br style><span style> }</span><br style>
<span style> }</span><br style><br style><span style>?></span>
</div><div><br></div><div><br></div><div>Regards</div><div><br></div><div>Shahzad Bhatti</div><div><br></div><div><br></div><div><span style>---------- Forwarded message ----------</span><br style><span style>From: Peter Olsson <<a href="mailto:peter.olsson@visionutveckling.se">peter.olsson@visionutveckling.se</a>></span><br style>
<span style>To: FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>></span><br style><span style>Cc: </span><br style><span style>Date: Fri, 2 Mar 2012 05:31:35 +0000</span><br style>
<span style>Subject: Re: [Freeswitch-users] Use of ESL and PHP for Call</span><br style><span style>You should pass the originate command to &park() instead.</span><br style><br style><span style>Right now you originate the call and then execute the application speak. After this (when speak is finished) FS has no more instructions so it will hangup the call.</span><br style>
<br style><span style>If you execute &park() instead, the call will be "parked" and wait for furter instructions. Then you will also need to execute the speak from ESL instead - and afther that you continue to do whatever you want to do with the call.</span><br style>
<br style><span style>/Peter</span>
</div>