mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 17:36:29 +02:00
Add api key to user, add status update support, add other things i dont remember at 2am...
This commit is contained in:
parent
193dd00c1e
commit
fb6abb4d91
14 changed files with 323 additions and 8 deletions
|
@ -36,6 +36,11 @@
|
|||
* Does the implemented service support flash smss
|
||||
*/
|
||||
public static function meta_support_flash() : bool;
|
||||
|
||||
/**
|
||||
* Does the implemented service support status change
|
||||
*/
|
||||
public static function meta_support_status_change() : bool;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -61,4 +66,11 @@
|
|||
* @return array : Array of the sms reads
|
||||
*/
|
||||
public function read () : array;
|
||||
|
||||
|
||||
/**
|
||||
* 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 ('unknown', 'delivered', 'failed')]
|
||||
*/
|
||||
public static function status_change_callback ();
|
||||
}
|
||||
|
|
|
@ -36,6 +36,11 @@
|
|||
* Does the implemented service support flash smss
|
||||
*/
|
||||
public static function meta_support_flash() : bool { return false ; }
|
||||
|
||||
/**
|
||||
* Does the implemented service support status change
|
||||
*/
|
||||
public static function meta_support_status_change() : bool { return true; }
|
||||
|
||||
|
||||
/**
|
||||
|
@ -82,4 +87,14 @@
|
|||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 ('unknown', 'delivered', 'failed')]
|
||||
*/
|
||||
public static function status_change_callback ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,11 @@
|
|||
* Does the implemented service support flash smss
|
||||
*/
|
||||
public static function meta_support_flash() : bool { return true ; }
|
||||
|
||||
/**
|
||||
* Does the implemented service support status change
|
||||
*/
|
||||
public static function meta_support_status_change() : bool { return true; }
|
||||
|
||||
|
||||
/**
|
||||
|
@ -118,4 +123,42 @@
|
|||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 ('unknown', 'delivered', 'failed')]
|
||||
*/
|
||||
public static function status_change_callback ()
|
||||
{
|
||||
$uid = $_GET['uid'] ?? false;
|
||||
$status = $_GET['status'] ?? false;
|
||||
|
||||
if (!$uid || !$status)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$return = [
|
||||
'uid' => $uid,
|
||||
'status' => 'unknown',
|
||||
];
|
||||
|
||||
switch ($status)
|
||||
{
|
||||
case 'delivered' :
|
||||
$return['status'] = 'delivered';
|
||||
break;
|
||||
|
||||
case 'failed' :
|
||||
$return['status'] = 'failed';
|
||||
break;
|
||||
|
||||
default :
|
||||
$return['status'] = 'unknown';
|
||||
break;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue