public function playAudio($callId, $audioUrl) { $Message360 = Message360::getInstance(); $Message360->setOptions(['account_sid' => Configure::read('Message360.accountSid'), 'auth_token' => Configure::read('Message360.authToken'), 'response_to_array' => true]); try { $response = $Message360->post('Calls', 'playAudios', array('callsid' => $callId, 'AudioUrl' => $audioUrl)); return $response->getResponse(); } catch (Message360_Exception $ex) { return $ex->getMessage(); } }
public function sendCall($toNumber, $uniqueId, $toCountryCode = 1) { $Message360 = Message360::getInstance(); $Message360->setOptions(['account_sid' => Configure::read('Message360.accountSid'), 'auth_token' => Configure::read('Message360.authToken'), 'response_to_array' => true]); try { // Fetch Send SMS $sendSMS = $Message360->create('calls', 'makeCall', ['FromCountryCode' => 1, 'From' => Configure::read('Message360.fromNumber'), 'ToCountryCode' => $toCountryCode, 'To' => $toNumber, 'Method' => 'POST', 'Url' => 'https://' . Configure::read('Message360.systemResponseDomain') . '/Call/ajaxResponseCall/' . $uniqueId . '.xml', 'FallbackUrl' => 'https://' . Configure::read('Message360.systemResponseDomain') . '/Call/ajaxResponseCallFallback/' . $uniqueId . '.json', 'StatusCallback' => 'https://' . Configure::read('Message360.systemResponseDomain') . '/Call/ajaxResponseStatusCallback/' . $uniqueId . '.json']); return $sendSMS->getResponse(); } catch (Message360_Exception $ex) { return $ex->getMessage(); } }