Set sender's phone number to max 15 characters

E.164 standard.
Fixes #866.
This commit is contained in:
TimZ99 2020-02-11 20:07:59 +01:00
parent 098a552774
commit 02f8484b3b
No known key found for this signature in database
GPG Key ID: 4D8268DC68E8339D
8 changed files with 9 additions and 9 deletions

View File

@ -131,7 +131,7 @@ class CMBulkSMS extends Core
), ),
'msg' => array( 'msg' => array(
array( array(
'from' => substr($this->originator, 0, 11), 'from' => substr($this->originator, 0, 15),
'to' => $recipients, 'to' => $recipients,
'body' => array( 'body' => array(
'content' => $message 'content' => $message
@ -172,7 +172,7 @@ class CMBulkSMS extends Core
$msg = $xml->addChild('MSG'); $msg = $xml->addChild('MSG');
// From // From
$msg->addChild('FROM', substr($this->originator, 0, 11)); $msg->addChild('FROM', substr($this->originator, 0, 15));
// Recipients // Recipients
foreach ($this->recipients as $recipient) { foreach ($this->recipients as $recipient) {

View File

@ -64,7 +64,7 @@ class ClickSend extends Core
foreach ($this->recipients as $recipient) { foreach ($this->recipients as $recipient) {
$data['messages'][] = array( $data['messages'][] = array(
'source' => 'phpservermon', 'source' => 'phpservermon',
'from' => substr($this->originator, 0, 11), 'from' => substr($this->originator, 0, 15),
'to' => $recipient, 'to' => $recipient,
'body' => $message, 'body' => $message,
); );

View File

@ -63,7 +63,7 @@ class FreeVoipDeal extends Core
array( array(
"username" => $this->username, "username" => $this->username,
"password" => $this->password, "password" => $this->password,
"from" => substr($this->originator, 0, 11), "from" => substr($this->originator, 0, 15),
"to" => $recipient, "to" => $recipient,
"text" => $message, "text" => $message,
) )

View File

@ -63,7 +63,7 @@ class Mosms extends Core
array( array(
"username" => $this->username, "username" => $this->username,
"password" => $this->password, "password" => $this->password,
"customsender" => substr($this->originator, 0, 11), "customsender" => substr($this->originator, 0, 15),
"nr" => $recipient, "nr" => $recipient,
"type" => "text", "type" => "text",
"data" => $message, "data" => $message,

View File

@ -72,7 +72,7 @@ class Octopush extends Core
"api_key" => $this->password, "api_key" => $this->password,
"sms_recipients" => $recipients, "sms_recipients" => $recipients,
"sms_type" => $smsType, "sms_type" => $smsType,
"sms_sender" => substr($this->originator, 0, 11), "sms_sender" => substr($this->originator, 0, 15),
"sms_text" => $message, "sms_text" => $message,
) )
)); ));

View File

@ -58,7 +58,7 @@ class Smsglobal extends Core
$recipients = join(',', $this->recipients); $recipients = join(',', $this->recipients);
$from = substr($this->originator, 0, 11); // Max 11 Characters $from = substr($this->originator, 0, 15); // Max 15 Characters
$message = substr(rawurlencode($message), 0, 153); $message = substr(rawurlencode($message), 0, 153);
$curl = curl_init(); $curl = curl_init();

View File

@ -64,7 +64,7 @@ class Smsit extends Core
"apiKey" => $this->password, "apiKey" => $this->password,
"mobile" => $recipient, "mobile" => $recipient,
"message" => urlencode($message), "message" => urlencode($message),
"senderId" => substr($this->originator, 0, 11), "senderId" => substr($this->originator, 0, 15),
) )
)); ));

View File

@ -66,7 +66,7 @@ class SolutionsInfini extends Core
"api_key" => $this->password, "api_key" => $this->password,
"method" => "sms", "method" => "sms",
"to" => $recipients, "to" => $recipients,
"sender" => substr($this->originator, 0, 11), "sender" => substr($this->originator, 0, 15),
"message" => $message, "message" => $message,
) )
)); ));