Permalink
Browse files

Update for API version 2010-04-01

  • Loading branch information...
1 parent 32b9d10 commit 98e39baa90dc79556a6d9e4df4e6a5d880c2a69a @chadsmith committed Feb 17, 2011
Showing with 3 additions and 1 deletion.
  1. +1 −0 applets/call/twiml.php
  2. +2 −1 applets/text/twiml.php
View
@@ -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)));
View
@@ -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();

0 comments on commit 98e39ba

Please sign in to comment.