Twilio Client Call Out Implementation -


i developing mobile app twilio client , have implementation question. app needs dial number , when call answered play message. using twiml verb can play message person answers call? or need create conference accomplish?

i have tried use action url of dial respond twiml when call answered doesn't seem work. callback when call has ended sporadic.

here php code calling out:

<?php include('../twilio/autoload.php'); include('./config.php');  use twilio\twiml;  $response = new twiml;  if (isset($_request['to']) && strlen($_request['to']) > 0) {     $number = htmlspecialchars($_request['to']);     $dial = $response->dial(array('callerid' => $twilio_caller_id,          'action' => 'http://www.example.com/ios/status.php'));      if (preg_match("/^[\d\+\-\(\) ]+$/", $number)) {         $dial->number($number);     } else {         $dial->client($number);     } } else {     $response->say("thanks calling!"); }  header('content-type: text/xml'); echo $response; ?> 

thanks

have tried this example twilio? looks need initiate call, set on answered response define <say> or <play>. see step 6 link.

hope helps!


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -