php - Making call on two different numbers using Twilio -
i wish call customer through user interface using api, have 3 parameters 1st: customer number, 2nd: twilio number,3rd: actual mobile number both of me , customer should see twilio number caller id. can me through this? current code below:
$client = new services_twilio($accountsid,$authtoken); $from = $from_ctn_code.$ctc->from; $to = $to_ctn_code.$ctc->to; try { $call = $client->account->calls->create($from,$to,$url.'callback.php?number='.$from); $ctc->sid = $call->sid; $ctc->call_logs(); } catch (exception $e) { }
twilio evangelist here.
we call 'anonymous calling', , it's pretty easy started. want make call using code posted above , twilio number $from parameter. url provide needs link twiml document cause twilio connect customer. need php script following twiml (xml)
<response> <dial callerid="<?php echo $twilio_number ?>"> <?php echo $customer_number ?> </dial> </response>
this way, twilio call showing twilio number, call customer showing twilio number (hence callerid=
attribute).
there's walkthrough on making calls on twilio.com. key thing here use twilio number from
/callerid
in both cases, give anonymous calling.
hope helps.
Comments
Post a Comment