Hi,<div><br></div><div>I am a new user and want to create an application to play a message using mod_tts (cepstral) like we have a meeting on Monday at 9 are you available, if yes press 1 and no then press 2 then record the key pressed in a variable or store it in the database.</div>
<div><br></div><div>but when i originate call the call hangup after speak, but i need to make call continue so the caller press the key and then call hangup.</div><div>now what i do, can i make it simple or make an IVR for it. i searched alot but not manage to get the solution.</div>
<div><br></div><div>so far i get the digit pressed using $digit = getHeader(&quot;DTMF-Digit&quot;); but i need to control the call to park it after playing the message till called press the digit.</div><div><br></div><div>
my code is as:</div><div><br></div><div><div>&lt;?php</div><div><br></div><div> require_once(&#39;ESL.php&#39;);</div><div><br></div><div> $host_name      =       &#39;localhost&#39;;</div><div> $port           =       &#39;8021&#39;;</div>
<div> $password       =       &#39;ClueCon&#39;;</div><div><br></div><div> $esl           =       new ESLconnection($host_name,$port,$password);</div><div><br></div><div> $e = $esl-&gt;sendRecv(&quot;api create_uuid&quot;);</div>
<div> $uuid = $e-&gt;getBody();</div><div> $user = &#39;1500&#39;;</div><div><br></div><div> $cmd1 = &quot;bgapi originate {origination_uuid=$uuid}user/$user &amp;speak(&#39;cepstral|william|Hi, we have a meeting on Monday at nine, are you joining us, if yes then press one and if not press two&#39;)&quot;;</div>
<div><br></div><div> $e = $esl-&gt;sendRecv($cmd1);</div><div><br></div><div> $e = $esl-&gt;sendRecv(&quot;events plain all&quot;);</div><div> $e = $esl-&gt;filter(&quot;Unique-ID&quot;,$uuid);</div><div><br></div><div>  while ($esl-&gt;connected())</div>
<div> {</div><div>    $e = $esl-&gt;recvEvent();</div><div>    $result = $e-&gt;getType();</div><div>        if($result==&#39;CHANNEL_EXECUTE_COMPLETE&#39;)</div><div>        {</div><div>                        //      what i do here...!</div>
<div>                $esl-&gt;execute(&quot;&amp;sleep&quot;,10000);</div><div>        }</div><div>        $digit          = $e-&gt;getHeader(&quot;DTMF-Digit&quot;);</div><div>        $state_no       = $e-&gt;getHeader(&quot;Channel-State-Number&quot;);</div>
<div>        $curr_uuid      = $e-&gt;getHeader(&quot;Channel-Call-UUID&quot;);</div><div><br></div><div> /*</div><div>        $ans_state      = $e-&gt;getHeader(&quot;Answer-State&quot;);</div><div>        $state_no       = $e-&gt;getHeader(&quot;Channel-State-Number&quot;);</div>
<div>        $core_id        = $e-&gt;getHeader(&quot;Core-UUID&quot;);</div><div>*/</div><div>        if($curr_uuid==$uuid &amp;&amp; $digit!=NULL)</div><div>        {</div><div>                print &quot;input number is &quot; . $digit . &quot;\n&quot;;</div>
<div>        }</div><div>    $state = $e-&gt;getHeader(&quot;Channel-Call-State&quot;);</div><div>    if ($state == &#39;HANGUP&#39;) {</div><div>        print &quot;\n\nHangup Cause Number: &quot; . $state_no;</div><div>
        $esl-&gt;disconnect();</div><div>    }</div><div> }</div><div><br></div><div>?&gt;</div></div><div><br></div><div><br></div><div>please help me to solve the problem</div><div><br></div><div><br></div><div>Regards</div>
<div><br></div><div>Shahzad Bhatti</div><div><br></div>