Skip to content

Commit

Permalink
Update for API version 2010-04-01
Browse files Browse the repository at this point in the history
  • Loading branch information
chadsmith committed Feb 17, 2011
1 parent 32b9d10 commit 98e39ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions applets/call/twiml.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
$id = AppletInstance::getValue('flow');
$recipient = normalize_phone_to_E164(str_replace('%sender%', $_REQUEST['From'], AppletInstance::getValue('recipient')));

require_once(APPPATH . 'libraries/twilio.php');
$ci->twilio = new TwilioRestClient($ci->twilio_sid, $ci->twilio_token, $ci->twilio_endpoint);
if(($flow = OpenVBX::getFlows(array('id' => $id, 'tenant_id' => $ci->tenant->id)))&&$flow[0]->values['data'])
$ci->twilio->request("Accounts/{$ci->twilio_sid}/Calls", 'POST', array('From' => $number, 'To' => $recipient, 'Url' => site_url('twiml/start/voice/'.$id)));
Expand Down
3 changes: 2 additions & 1 deletion applets/text/twiml.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
else
$message = str_replace(array('%sender%', '%number%', '%body%'), array($from, $to, $_REQUEST['Body']), $message);

require_once(APPPATH . 'libraries/twilio.php');
$ci->twilio = new TwilioRestClient($ci->twilio_sid, $ci->twilio_token, $ci->twilio_endpoint);
$ci->twilio->request("Accounts/{$ci->twilio_sid}/SMS/Messages", 'POST', array('To' => $recipient, 'From' => $number, 'Body' => $message));
$ci->twilio->request("Accounts/{$ci->twilio_sid}/SMS/Messages", 'POST', array('From' => $number, 'To' => $recipient, 'Body' => $message));

$response = new Response();

Expand Down

0 comments on commit 98e39ba

Please sign in to comment.