Saturday, 15 March 2014

php - How to handle twilio outgoing call if no answer -



php - How to handle twilio outgoing call if no answer -

i implementing twilio outgoing phone call wordpress woocommerce. order placed site owner receive call. couldn't find way handle if person didn't reply phone call reason. documentation going above head.

what want create twilio recall if phone call isn't answered. or open suggestion how else way handle. please note have not created application @ twilio yet. using php sdk business relationship id , token provided default.

here code

function send_order_call($order_id) { seek { $file = plugin_dir_path(__file__) . "order.xml"; $twiml = simplexml_load_file($file); $twiml->say = "hello, have received new order. order id {$order_id}. kindly check fax details"; file_put_contents($file, $twiml->asxml()); require_once 'twilio.php'; //initializing twilio rest $sid = "accbd06f8e73asdfsdaf1"; $token = "32ccf4bdcasdfsafc"; $client = new services_twilio($sid, $token); $call = $client->account->calls->create("+12asfsaf", "+1ssd8777asfsf7", site_url()."/wp-content/plugins/woocommerce-twilio/order.xml", array()); // echo $call->sid; } grab (exception $e){ $error = $e->getmessage(); die($error); } }

tl;dr; need set statuscallback parameter options array.

please see http://stackoverflow.com/a/24482140/1751451

php wordpress twilio

No comments:

Post a Comment