mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
start adding mms to a lot of places, no tests, not done
This commit is contained in:
parent
b8e587a59e
commit
ff6b3e79df
24 changed files with 1174 additions and 788 deletions
|
@ -176,19 +176,22 @@ class TwilioVirtualNumberAdapter implements AdapterInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Method called to send a SMS to a number.
|
||||
*
|
||||
* @param string $destination : Phone number to send the sms to
|
||||
* @param string $text : Text of the SMS to send
|
||||
* @param bool $flash : Is the SMS a Flash SMS
|
||||
*
|
||||
* @return array : [
|
||||
* bool 'error' => false if no error, true else
|
||||
* ?string 'error_message' => null if no error, else error message
|
||||
* array 'uid' => Uid of the sms created on success
|
||||
* ]
|
||||
* Does the implemented service support mms reception
|
||||
*/
|
||||
public function send(string $destination, string $text, bool $flash = false)
|
||||
public static function meta_support_mms_reception(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the implemented service support mms sending
|
||||
*/
|
||||
public static function meta_support_mms_sending(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function send(string $destination, string $text, bool $flash = false, bool $mms = false, array $medias = []) : array
|
||||
{
|
||||
$response = [
|
||||
'error' => false,
|
||||
|
@ -228,15 +231,6 @@ class TwilioVirtualNumberAdapter implements AdapterInterface
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to read SMSs of the number.
|
||||
*
|
||||
* @return array : [
|
||||
* bool 'error' => false if no error, true else
|
||||
* ?string 'error_message' => null if no error, else error message
|
||||
* array 'sms' => Array of the sms reads
|
||||
* ]
|
||||
*/
|
||||
public function read(): array
|
||||
{
|
||||
$response = [
|
||||
|
@ -282,12 +276,6 @@ class TwilioVirtualNumberAdapter implements AdapterInterface
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to verify if the adapter is working correctly
|
||||
* should be use for exemple to verify that credentials and number are both valid.
|
||||
*
|
||||
* @return bool : False on error, true else
|
||||
*/
|
||||
public function test(): bool
|
||||
{
|
||||
try
|
||||
|
@ -313,11 +301,6 @@ class TwilioVirtualNumberAdapter implements AdapterInterface
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called on reception of a status update notification for a SMS.
|
||||
*
|
||||
* @return mixed : False on error, else array ['uid' => uid of the sms, 'status' => New status of the sms (\models\Sended::STATUS_UNKNOWN, \models\Sended::STATUS_DELIVERED, \models\Sended::STATUS_FAILED)]
|
||||
*/
|
||||
public static function status_change_callback()
|
||||
{
|
||||
$sid = $_REQUEST['MessageSid'] ?? false;
|
||||
|
@ -349,20 +332,6 @@ class TwilioVirtualNumberAdapter implements AdapterInterface
|
|||
return ['uid' => $sid, 'status' => $status];
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called on reception of a sms notification.
|
||||
*
|
||||
* @return array : [
|
||||
* bool 'error' => false on success, true on error
|
||||
* ?string 'error_message' => null on success, error message else
|
||||
* array 'sms' => array [
|
||||
* string 'at' : Recepetion date format Y-m-d H:i:s,
|
||||
* string 'text' : SMS body,
|
||||
* string 'origin' : SMS sender,
|
||||
* ]
|
||||
*
|
||||
* ]
|
||||
*/
|
||||
public static function reception_callback(): array
|
||||
{
|
||||
return [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue