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("DTMF-Digit"); 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><?php</div><div><br></div><div> require_once('ESL.php');</div><div><br></div><div> $host_name = 'localhost';</div><div> $port = '8021';</div>
<div> $password = 'ClueCon';</div><div><br></div><div> $esl = new ESLconnection($host_name,$port,$password);</div><div><br></div><div> $e = $esl->sendRecv("api create_uuid");</div>
<div> $uuid = $e->getBody();</div><div> $user = '1500';</div><div><br></div><div> $cmd1 = "bgapi originate {origination_uuid=$uuid}user/$user &speak('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')";</div>
<div><br></div><div> $e = $esl->sendRecv($cmd1);</div><div><br></div><div> $e = $esl->sendRecv("events plain all");</div><div> $e = $esl->filter("Unique-ID",$uuid);</div><div><br></div><div> while ($esl->connected())</div>
<div> {</div><div> $e = $esl->recvEvent();</div><div> $result = $e->getType();</div><div> if($result=='CHANNEL_EXECUTE_COMPLETE')</div><div> {</div><div> // what i do here...!</div>
<div> $esl->execute("&sleep",10000);</div><div> }</div><div> $digit = $e->getHeader("DTMF-Digit");</div><div> $state_no = $e->getHeader("Channel-State-Number");</div>
<div> $curr_uuid = $e->getHeader("Channel-Call-UUID");</div><div><br></div><div> /*</div><div> $ans_state = $e->getHeader("Answer-State");</div><div> $state_no = $e->getHeader("Channel-State-Number");</div>
<div> $core_id = $e->getHeader("Core-UUID");</div><div>*/</div><div> if($curr_uuid==$uuid && $digit!=NULL)</div><div> {</div><div> print "input number is " . $digit . "\n";</div>
<div> }</div><div> $state = $e->getHeader("Channel-Call-State");</div><div> if ($state == 'HANGUP') {</div><div> print "\n\nHangup Cause Number: " . $state_no;</div><div>
$esl->disconnect();</div><div> }</div><div> }</div><div><br></div><div>?></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>