Add "CM Telecom" Bulk SMS Gateway
With support for multipart messages, JSON or XML gateway and debug output. Sends a batch message with one request to multiple recipients. Uses the SMS gateway password field as API-Token. - Add gateway class "CMBulkSMS" for handling SMS notifications - Add required translation strings to the language files - Add "cmbulksms" option to the sms gateway select field - Add "CM Telecom" to list of SMS gateways in README file - Sort the sms gateway select options ascending by title (Usability)pull/545/head
parent
50ab06640e
commit
1ddfbd9bc5
|
@ -55,6 +55,7 @@ The following SMS gateways are currently available:
|
||||||
* Nexmo - <https://www.nexmo.com/>
|
* Nexmo - <https://www.nexmo.com/>
|
||||||
* OctoPush - <http://www.octopush.com/>
|
* OctoPush - <http://www.octopush.com/>
|
||||||
* FreeMobile (FR) - <http://mobile.free.fr/>
|
* FreeMobile (FR) - <http://mobile.free.fr/>
|
||||||
|
* CM Telecom - <https://www.cm.com/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -545,6 +545,9 @@ function psm_build_sms() {
|
||||||
case 'smsgw':
|
case 'smsgw':
|
||||||
$sms = new \psm\Txtmsg\Smsgw();
|
$sms = new \psm\Txtmsg\Smsgw();
|
||||||
break;
|
break;
|
||||||
|
case 'cmbulksms':
|
||||||
|
$sms = new \psm\Txtmsg\CMBulkSMS();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy login information from the config file
|
// copy login information from the config file
|
||||||
|
|
|
@ -200,6 +200,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||||
'sms_gateway_octopush' => 'Octopush',
|
'sms_gateway_octopush' => 'Octopush',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Потребител',
|
'sms_gateway_username' => 'Потребител',
|
||||||
'sms_gateway_password' => 'Парола',
|
'sms_gateway_password' => 'Парола',
|
||||||
'sms_from' => 'Номер на изпращача',
|
'sms_from' => 'Номер на изпращача',
|
||||||
|
|
|
@ -215,6 +215,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_freemobilesms' => 'FreeMobileSMS',
|
'sms_gateway_freemobilesms' => 'FreeMobileSMS',
|
||||||
'sms_gateway_clicksend' => 'ClickSend',
|
'sms_gateway_clicksend' => 'ClickSend',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Uživatelské jméno brány',
|
'sms_gateway_username' => 'Uživatelské jméno brány',
|
||||||
'sms_gateway_password' => 'Heslo brány',
|
'sms_gateway_password' => 'Heslo brány',
|
||||||
'sms_from' => 'Telefonní číslo odesilatele',
|
'sms_from' => 'Telefonní číslo odesilatele',
|
||||||
|
|
|
@ -197,6 +197,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_octopush' => 'Octopush',
|
'sms_gateway_octopush' => 'Octopush',
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Gateway brugernavn/apikey',
|
'sms_gateway_username' => 'Gateway brugernavn/apikey',
|
||||||
'sms_gateway_password' => 'Gateway adgangskode',
|
'sms_gateway_password' => 'Gateway adgangskode',
|
||||||
'sms_from' => 'Afsenderens navn.',
|
'sms_from' => 'Afsenderens navn.',
|
||||||
|
|
|
@ -201,6 +201,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Gateway Benutzername',
|
'sms_gateway_username' => 'Gateway Benutzername',
|
||||||
'sms_gateway_password' => 'Gateway Passwort',
|
'sms_gateway_password' => 'Gateway Passwort',
|
||||||
'sms_from' => 'SMS-Sendernummer',
|
'sms_from' => 'SMS-Sendernummer',
|
||||||
|
|
|
@ -223,6 +223,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_clicksend' => 'ClickSend',
|
'sms_gateway_clicksend' => 'ClickSend',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
'sms_gateway_smsgw' => 'SMSgw',
|
'sms_gateway_smsgw' => 'SMSgw',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Gateway username',
|
'sms_gateway_username' => 'Gateway username',
|
||||||
'sms_gateway_password' => 'Gateway password',
|
'sms_gateway_password' => 'Gateway password',
|
||||||
'sms_from' => 'Sender\'s phone number',
|
'sms_from' => 'Sender\'s phone number',
|
||||||
|
|
|
@ -204,6 +204,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_username' => 'Usuario',
|
'sms_gateway_username' => 'Usuario',
|
||||||
'sms_gateway_password' => 'Contraseña',
|
'sms_gateway_password' => 'Contraseña',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Gateway username',
|
'sms_gateway_username' => 'Gateway username',
|
||||||
'sms_gateway_password' => 'Gateway password',
|
'sms_gateway_password' => 'Gateway password',
|
||||||
'sms_from' => 'Número origen del SMS',
|
'sms_from' => 'Número origen del SMS',
|
||||||
|
|
|
@ -198,6 +198,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Värava kasutajanimi',
|
'sms_gateway_username' => 'Värava kasutajanimi',
|
||||||
'sms_gateway_password' => 'Värava parool',
|
'sms_gateway_password' => 'Värava parool',
|
||||||
'sms_from' => 'Saatja telefoni number',
|
'sms_from' => 'Saatja telefoni number',
|
||||||
|
|
|
@ -198,6 +198,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'نام کاربری Gateway',
|
'sms_gateway_username' => 'نام کاربری Gateway',
|
||||||
'sms_gateway_password' => 'کلمه عبور Gateway',
|
'sms_gateway_password' => 'کلمه عبور Gateway',
|
||||||
'sms_from' => 'شماره تلفن ارسال کننده',
|
'sms_from' => 'شماره تلفن ارسال کننده',
|
||||||
|
|
|
@ -198,6 +198,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Palvelun käyttäjänimi',
|
'sms_gateway_username' => 'Palvelun käyttäjänimi',
|
||||||
'sms_gateway_password' => 'Palvelun salasana',
|
'sms_gateway_password' => 'Palvelun salasana',
|
||||||
'sms_from' => 'Lähettäjän puhelinnumero',
|
'sms_from' => 'Lähettäjän puhelinnumero',
|
||||||
|
|
|
@ -202,6 +202,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
'sms_gateway_freemobilesms' => 'FreeMobileSMS',
|
'sms_gateway_freemobilesms' => 'FreeMobileSMS',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Nom utilisateur de la passerelle',
|
'sms_gateway_username' => 'Nom utilisateur de la passerelle',
|
||||||
'sms_gateway_password' => 'Mot de passe de la passerelle',
|
'sms_gateway_password' => 'Mot de passe de la passerelle',
|
||||||
'sms_from' => 'SMS de l\'expéditeur',
|
'sms_from' => 'SMS de l\'expéditeur',
|
||||||
|
|
|
@ -200,6 +200,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Nome Utente Gateway',
|
'sms_gateway_username' => 'Nome Utente Gateway',
|
||||||
'sms_gateway_password' => 'Password Gateway',
|
'sms_gateway_password' => 'Password Gateway',
|
||||||
'sms_from' => 'Numero di telefono del mittente',
|
'sms_from' => 'Numero di telefono del mittente',
|
||||||
|
|
|
@ -220,6 +220,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_clicksend' => 'ClickSend',
|
'sms_gateway_clicksend' => 'ClickSend',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
'sms_gateway_smsgw' => 'SMSgw',
|
'sms_gateway_smsgw' => 'SMSgw',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'ゲートウェイのユーザー名',
|
'sms_gateway_username' => 'ゲートウェイのユーザー名',
|
||||||
'sms_gateway_password' => 'ゲートウェイのパスワード',
|
'sms_gateway_password' => 'ゲートウェイのパスワード',
|
||||||
'sms_from' => '送信者の電話番号:',
|
'sms_from' => '送信者の電話番号:',
|
||||||
|
|
|
@ -200,6 +200,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_octopush' => 'Octopush',
|
'sms_gateway_octopush' => 'Octopush',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Gateway username',
|
'sms_gateway_username' => 'Gateway username',
|
||||||
'sms_gateway_password' => 'Gateway password',
|
'sms_gateway_password' => 'Gateway password',
|
||||||
'sms_from' => 'Sender\'s phone number',
|
'sms_from' => 'Sender\'s phone number',
|
||||||
|
|
|
@ -200,6 +200,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Gateway gebruikersnaam',
|
'sms_gateway_username' => 'Gateway gebruikersnaam',
|
||||||
'sms_gateway_password' => 'Gateway wachtwoord',
|
'sms_gateway_password' => 'Gateway wachtwoord',
|
||||||
'sms_from' => 'Telefoonnummer afzender',
|
'sms_from' => 'Telefoonnummer afzender',
|
||||||
|
|
|
@ -200,6 +200,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Login do bramki',
|
'sms_gateway_username' => 'Login do bramki',
|
||||||
'sms_gateway_password' => 'Hasło do bramki',
|
'sms_gateway_password' => 'Hasło do bramki',
|
||||||
'sms_from' => 'Numer nadawcy',
|
'sms_from' => 'Numer nadawcy',
|
||||||
|
|
|
@ -203,6 +203,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_password' => 'Senha do Gateway',
|
'sms_gateway_password' => 'Senha do Gateway',
|
||||||
'sms_from' => 'Número de telefone de envio',
|
'sms_from' => 'Número de telefone de envio',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Usuário do Gateway',
|
'sms_gateway_username' => 'Usuário do Gateway',
|
||||||
'sms_gateway_password' => 'Senha do Gateway',
|
'sms_gateway_password' => 'Senha do Gateway',
|
||||||
'sms_from' => 'Número de telefone de envio',
|
'sms_from' => 'Número de telefone de envio',
|
||||||
|
|
|
@ -200,6 +200,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Пользователь',
|
'sms_gateway_username' => 'Пользователь',
|
||||||
'sms_gateway_password' => 'Пароль',
|
'sms_gateway_password' => 'Пароль',
|
||||||
'sms_from' => 'Номер отправителя',
|
'sms_from' => 'Номер отправителя',
|
||||||
|
|
|
@ -214,6 +214,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_freemobilesms' => 'FreeMobileSMS',
|
'sms_gateway_freemobilesms' => 'FreeMobileSMS',
|
||||||
'sms_gateway_clicksend' => 'ClickSend',
|
'sms_gateway_clicksend' => 'ClickSend',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Užívateľské meno brány',
|
'sms_gateway_username' => 'Užívateľské meno brány',
|
||||||
'sms_gateway_password' => 'Heslo brány',
|
'sms_gateway_password' => 'Heslo brány',
|
||||||
'sms_from' => 'Telefónne číslo odosielateľa',
|
'sms_from' => 'Telefónne číslo odosielateľa',
|
||||||
|
|
|
@ -195,6 +195,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Uporabniško ime SMS prehoda',
|
'sms_gateway_username' => 'Uporabniško ime SMS prehoda',
|
||||||
'sms_gateway_password' => 'Geslo SMS prehoda',
|
'sms_gateway_password' => 'Geslo SMS prehoda',
|
||||||
'sms_from' => 'Telefonska številka pošiljatelja',
|
'sms_from' => 'Telefonska številka pošiljatelja',
|
||||||
|
|
|
@ -199,6 +199,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Gateway användarnamn',
|
'sms_gateway_username' => 'Gateway användarnamn',
|
||||||
'sms_gateway_password' => 'Gateway lösenord',
|
'sms_gateway_password' => 'Gateway lösenord',
|
||||||
'sms_from' => 'Avsändarens telefonnummer',
|
'sms_from' => 'Avsändarens telefonnummer',
|
||||||
|
|
|
@ -199,7 +199,8 @@ $sm_lang = array(
|
||||||
'sms_gateway_octopush' => 'Octopush',
|
'sms_gateway_octopush' => 'Octopush',
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Servis kullanıcı adı',
|
'sms_gateway_username' => 'Servis kullanıcı adı',
|
||||||
'sms_gateway_password' => 'Servis şifresi',
|
'sms_gateway_password' => 'Servis şifresi',
|
||||||
'sms_from' => 'Gönderen numarası',
|
'sms_from' => 'Gönderen numarası',
|
||||||
|
|
|
@ -195,6 +195,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'Gateway username',
|
'sms_gateway_username' => 'Gateway username',
|
||||||
'sms_gateway_password' => 'Gateway password',
|
'sms_gateway_password' => 'Gateway password',
|
||||||
'sms_from' => 'Số điện thoại của người gửi',
|
'sms_from' => 'Số điện thoại của người gửi',
|
||||||
|
|
|
@ -216,6 +216,7 @@ $sm_lang = array(
|
||||||
'sms_gateway_smsit' => 'Smsit',
|
'sms_gateway_smsit' => 'Smsit',
|
||||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||||
'sms_gateway_nexmo' => 'Nexmo',
|
'sms_gateway_nexmo' => 'Nexmo',
|
||||||
|
'sms_gateway_cmbulksms' => 'CM Telecom',
|
||||||
'sms_gateway_username' => 'SMS网关用户名',
|
'sms_gateway_username' => 'SMS网关用户名',
|
||||||
'sms_gateway_password' => 'SMS网关密码',
|
'sms_gateway_password' => 'SMS网关密码',
|
||||||
'sms_from' => '发信人电话号',
|
'sms_from' => '发信人电话号',
|
||||||
|
|
|
@ -325,6 +325,7 @@ class ConfigController extends AbstractController {
|
||||||
'label_sms_gateway_spryng' => psm_get_lang('config', 'sms_gateway_spryng'),
|
'label_sms_gateway_spryng' => psm_get_lang('config', 'sms_gateway_spryng'),
|
||||||
'label_sms_gateway_inetworx' => psm_get_lang('config', 'sms_gateway_inetworx'),
|
'label_sms_gateway_inetworx' => psm_get_lang('config', 'sms_gateway_inetworx'),
|
||||||
'label_sms_gateway_clickatell' => psm_get_lang('config', 'sms_gateway_clickatell'),
|
'label_sms_gateway_clickatell' => psm_get_lang('config', 'sms_gateway_clickatell'),
|
||||||
|
'label_sms_gateway_cmbulksms' => psm_get_lang('config', 'sms_gateway_cmbulksms'),
|
||||||
'label_sms_gateway_textmarketer' => psm_get_lang('config', 'sms_gateway_textmarketer'),
|
'label_sms_gateway_textmarketer' => psm_get_lang('config', 'sms_gateway_textmarketer'),
|
||||||
'label_sms_gateway_smsit' => psm_get_lang('config', 'sms_gateway_smsit'),
|
'label_sms_gateway_smsit' => psm_get_lang('config', 'sms_gateway_smsit'),
|
||||||
'label_sms_gateway_freevoipdeal' => psm_get_lang('config', 'sms_gateway_freevoipdeal'),
|
'label_sms_gateway_freevoipdeal' => psm_get_lang('config', 'sms_gateway_freevoipdeal'),
|
||||||
|
|
|
@ -0,0 +1,234 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Server Monitor
|
||||||
|
* Monitor your servers and websites.
|
||||||
|
*
|
||||||
|
* This file is part of PHP Server Monitor.
|
||||||
|
* PHP Server Monitor is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* PHP Server Monitor is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @package phpservermon
|
||||||
|
* @author Axel Wehner <mail@axelwehner.de>
|
||||||
|
* @copyright Copyright (c) 2008-2017 Pepijn Over <pep@mailbox.org>
|
||||||
|
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
|
||||||
|
* @version Release: @package_version@
|
||||||
|
* @link http://www.phpservermonitor.org/
|
||||||
|
* @since phpservermon 3.2.1
|
||||||
|
**/
|
||||||
|
|
||||||
|
namespace psm\Txtmsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CMBulkSMS - Class for CM Telecom's Bulk SMS Gateway API
|
||||||
|
*
|
||||||
|
* Sending SMS notifications via the CM Telecom Bulk SMS Gateway
|
||||||
|
* Please use the gateway password field in your configuration for the CM API-Token
|
||||||
|
*
|
||||||
|
* Requirements: cURL v7.18.1+ and OpenSSL 0.9.8j+
|
||||||
|
*/
|
||||||
|
class CMBulkSMS extends Core {
|
||||||
|
/** @var bool|null True when cURL request succeeded */
|
||||||
|
public $result;
|
||||||
|
|
||||||
|
/** @var string|null Contains error message if cURL request failed */
|
||||||
|
public $error;
|
||||||
|
|
||||||
|
/** @var bool Set to true for debug output/logging */
|
||||||
|
protected $debug = false;
|
||||||
|
|
||||||
|
/** @var bool Set to false if your operator isn't able to handle multipart messages */
|
||||||
|
protected $multipartMessage = true;
|
||||||
|
|
||||||
|
/** @var string|null Gateway API URL uses const GATEWAY_URL_XML or GATEWAY_URL_JSON */
|
||||||
|
protected $apiUrl;
|
||||||
|
|
||||||
|
/** @var string Gateway API Type: Use 'json' (default) or 'xml' */
|
||||||
|
protected $apiType = 'json';
|
||||||
|
|
||||||
|
/** @var string|null JSON or XML message for cURL request */
|
||||||
|
protected $request;
|
||||||
|
|
||||||
|
/** @var string|null HTTP Content-Type for cURL request */
|
||||||
|
protected $contentType;
|
||||||
|
|
||||||
|
/** @var string|null Raw sms text message */
|
||||||
|
protected $messageBody;
|
||||||
|
|
||||||
|
/** @var string JSON Gateway API URL */
|
||||||
|
const GATEWAY_URL_JSON = "https://gw.cmtelecom.com/v1.0/message";
|
||||||
|
|
||||||
|
/** @var string XML Gateway API URL */
|
||||||
|
const GATEWAY_URL_XML = "https://sgw01.cm.nl/gateway.ashx";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the message and send cURL request to the sms gateway
|
||||||
|
*
|
||||||
|
* @see https://docs.cmtelecom.com/bulk-sms/v1.0#/send_a_message%7Csample_requests
|
||||||
|
* @param string $message Your text message
|
||||||
|
* @return boolean True when cURL request was successful
|
||||||
|
*/
|
||||||
|
public function sendSMS($message) {
|
||||||
|
// Check if recipient and text message are available
|
||||||
|
if(count($this->recipients) < 1 || empty($message)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set message text
|
||||||
|
$this->messageBody = $message;
|
||||||
|
|
||||||
|
// Prepare the message in CM's XML or JSON format
|
||||||
|
switch($this->apiType) {
|
||||||
|
case 'xml':
|
||||||
|
$this->request = $this->buildMessageXml();
|
||||||
|
$this->contentType = 'Content-Type: application/xml';
|
||||||
|
$this->apiUrl = self::GATEWAY_URL_XML;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'json':
|
||||||
|
default:
|
||||||
|
$this->request = $this->buildMessageJson();
|
||||||
|
$this->contentType = 'Content-Type: application/json';
|
||||||
|
$this->apiUrl = self::GATEWAY_URL_JSON;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$request = $this->executeCurlRequest();
|
||||||
|
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a JSON batch sms message using CM's format
|
||||||
|
*
|
||||||
|
* @see https://docs.cmtelecom.com/bulk-sms/v1.0#/send_a_message%7Cbatch_messages
|
||||||
|
* @see https://docs.cmtelecom.com/bulk-sms/v1.0#/send_a_message%7Csample_requests
|
||||||
|
* @see https://docs.cmtelecom.com/bulk-sms/v1.0#/send_a_message%7Cmultipart
|
||||||
|
* @return string JSON message object
|
||||||
|
*/
|
||||||
|
protected function buildMessageJson() {
|
||||||
|
// Prepare recipient array for batch message
|
||||||
|
$recipients = array();
|
||||||
|
foreach($this->recipients as $recipient) {
|
||||||
|
$recipients[] = array('number' => $recipient);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build message array in CM's Bulk SMS format
|
||||||
|
$msgArray = array(
|
||||||
|
'messages' => array(
|
||||||
|
'authentication' => array(
|
||||||
|
'producttoken' => $this->password
|
||||||
|
),
|
||||||
|
'msg' => array(
|
||||||
|
array(
|
||||||
|
'from' => substr($this->originator, 0, 11),
|
||||||
|
'to' => $recipients,
|
||||||
|
'body' => array(
|
||||||
|
'content' => $this->messageBody
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Multipart message
|
||||||
|
if($this->multipartMessage) {
|
||||||
|
$msgArray['messages']['msg'][0]['minimumNumberOfMessageParts'] = 1;
|
||||||
|
$msgArray['messages']['msg'][0]['maximumNumberOfMessageParts'] = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert array in JSON object
|
||||||
|
return json_encode($msgArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a XML batch sms message in CM's format
|
||||||
|
*
|
||||||
|
* @see https://docs.cmtelecom.com/bulk-sms/v1.0#/send_a_message%7Cbatch_messages
|
||||||
|
* @see https://docs.cmtelecom.com/bulk-sms/v1.0#/send_a_message%7Csample_requests
|
||||||
|
* @see https://docs.cmtelecom.com/bulk-sms/v1.0#/send_a_message%7Cmultipart
|
||||||
|
* @return string XML message
|
||||||
|
*/
|
||||||
|
protected function buildMessageXml() {
|
||||||
|
// Create XML string
|
||||||
|
$xml = new \SimpleXMLElement('<MESSAGES/>');
|
||||||
|
|
||||||
|
// API-Token
|
||||||
|
$auth = $xml->addChild('AUTHENTICATION');
|
||||||
|
$auth->addChild('PRODUCTTOKEN', $this->password);
|
||||||
|
|
||||||
|
// Message
|
||||||
|
$msg = $xml->addChild('MSG');
|
||||||
|
|
||||||
|
// From
|
||||||
|
$msg->addChild('FROM', substr($this->originator, 0, 11));
|
||||||
|
|
||||||
|
// Recipients
|
||||||
|
foreach($this->recipients as $recipient) {
|
||||||
|
$msg->addChild('TO', $recipient);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multipart message
|
||||||
|
if($this->multipartMessage) {
|
||||||
|
$msg->addChild('MINIMUMNUMBEROFMESSAGEPARTS', 1);
|
||||||
|
$msg->addChild('MAXIMUMNUMBEROFMESSAGEPARTS', 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add body text
|
||||||
|
$msg->addChild('BODY', $this->messageBody);
|
||||||
|
|
||||||
|
return $xml->asXML();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create and execute the curl request
|
||||||
|
*
|
||||||
|
* @return boolean True if message is sent
|
||||||
|
*/
|
||||||
|
protected function executeCurlRequest() {
|
||||||
|
$cr = curl_init();
|
||||||
|
curl_setopt_array($cr, array(
|
||||||
|
CURLOPT_URL => $this->apiUrl,
|
||||||
|
CURLOPT_HTTPHEADER => array($this->contentType),
|
||||||
|
CURLOPT_POST => true,
|
||||||
|
CURLOPT_POSTFIELDS => $this->request,
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
CURLOPT_FAILONERROR => true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// execute curl request and fetch the response/error
|
||||||
|
$cResponse = curl_exec($cr);
|
||||||
|
$cError = curl_error($cr);
|
||||||
|
$cErrorCode = curl_errno($cr);
|
||||||
|
curl_close($cr);
|
||||||
|
|
||||||
|
// set result and log error if needed
|
||||||
|
if($cError) {
|
||||||
|
$this->error = 'Response: CM SMS API:' . $cResponse . ' cURL Error Code: ' . $cErrorCode . '"' . $cError . '"';
|
||||||
|
error_log($this->error, E_USER_ERROR);
|
||||||
|
$this->result = false;
|
||||||
|
} else {
|
||||||
|
$this->result = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Debug output
|
||||||
|
// Note: CM's XML gateway gives no response when message is sent successfully :/
|
||||||
|
if($this->debug || PSM_DEBUG) {
|
||||||
|
$debug = '<pre>Request: '. $this->request . '<br>Response: ' . $cResponse.'</pre>';
|
||||||
|
error_log("Request: $this->request\r\nResponse: $cResponse", E_USER_NOTICE);
|
||||||
|
echo $debug;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->result;
|
||||||
|
}
|
||||||
|
}
|
|
@ -187,21 +187,22 @@
|
||||||
<label class="control-label" for="sms_gateway">{{ label_sms_gateway }}</label>
|
<label class="control-label" for="sms_gateway">{{ label_sms_gateway }}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select id="sms_gateway" name="sms_gateway">
|
<select id="sms_gateway" name="sms_gateway">
|
||||||
<option value="mosms" {{ sms_selected_mosms|raw }}>{{ label_sms_gateway_mosms }}</option>
|
|
||||||
<option value="mollie" {{ sms_selected_mollie|raw }}>{{ label_sms_gateway_mollie }}</option>
|
|
||||||
<option value="spryng" {{ sms_selected_spryng|raw }}>{{ label_sms_gateway_spryng }}</option>
|
|
||||||
<option value="inetworx" {{ sms_selected_inetworx|raw }}>{{ label_sms_gateway_inetworx }}</option>
|
|
||||||
<option value="clickatell" {{ sms_selected_clickatell|raw }}>{{ label_sms_gateway_clickatell }}</option>
|
<option value="clickatell" {{ sms_selected_clickatell|raw }}>{{ label_sms_gateway_clickatell }}</option>
|
||||||
|
<option value="clicksend" {{ sms_selected_clicksend|raw }}>{{ label_sms_gateway_clicksend }}</option>
|
||||||
|
<option value="cmbulksms" {{ sms_selected_cmbulksms|raw }}>{{ label_sms_gateway_cmbulksms }}</option>
|
||||||
|
<option value="freemobilesms" {{ sms_selected_freemobilesms|raw }}>{{ label_sms_gateway_freemobilesms }}</option>
|
||||||
|
<option value="freevoipdeal" {{ sms_selected_freevoipdeal|raw }}>{{ label_sms_gateway_freevoipdeal }}</option>
|
||||||
|
<option value="inetworx" {{ sms_selected_inetworx|raw }}>{{ label_sms_gateway_inetworx }}</option>
|
||||||
|
<option value="mollie" {{ sms_selected_mollie|raw }}>{{ label_sms_gateway_mollie }}</option>
|
||||||
|
<option value="mosms" {{ sms_selected_mosms|raw }}>{{ label_sms_gateway_mosms }}</option>
|
||||||
|
<option value="nexmo" {{ sms_selected_nexmo|raw }}>{{ label_sms_gateway_nexmo }}</option>
|
||||||
|
<option value="octopush" {{ sms_selected_octopush|raw }}>{{ label_sms_gateway_octopush }}</option>
|
||||||
|
<option value="smsglobal" {{ sms_selected_smsglobal|raw }}>{{ label_sms_gateway_smsglobal }}</option>
|
||||||
|
<option value="smsgw" {{ sms_selected_smsgw|raw }}>{{ label_sms_gateway_smsgw }}</option>
|
||||||
|
<option value="smsit" {{ sms_selected_smsit|raw }}>{{ label_sms_gateway_smsit }}</option>
|
||||||
|
<option value="spryng" {{ sms_selected_spryng|raw }}>{{ label_sms_gateway_spryng }}</option>
|
||||||
<option value="textmarketer" {{ sms_selected_textmarketer|raw }}>{{ label_sms_gateway_textmarketer }}</option>
|
<option value="textmarketer" {{ sms_selected_textmarketer|raw }}>{{ label_sms_gateway_textmarketer }}</option>
|
||||||
<option value="smsglobal" {{ sms_selected_smsglobal|raw }}>{{ label_sms_gateway_smsglobal }}</option>
|
</select>
|
||||||
<option value="smsit" {{ sms_selected_smsit|raw }}>{{ label_sms_gateway_smsit }}</option>
|
|
||||||
<option value="freevoipdeal" {{ sms_selected_freevoipdeal|raw }}>{{ label_sms_gateway_freevoipdeal }}</option>
|
|
||||||
<option value="octopush" {{ sms_selected_octopush|raw }}>{{ label_sms_gateway_octopush }}</option>
|
|
||||||
<option value="freemobilesms" {{ sms_selected_freemobilesms|raw }}>{{ label_sms_gateway_freemobilesms }}</option>
|
|
||||||
<option value="clicksend" {{ sms_selected_clicksend|raw }}>{{ label_sms_gateway_clicksend }}</option>
|
|
||||||
<option value="smsgw" {{ sms_selected_smsgw|raw }}>{{ label_sms_gateway_smsgw }}</option>
|
|
||||||
<option value="nexmo" {{ sms_selected_nexmo|raw }}>{{ label_sms_gateway_nexmo }}</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
|
Loading…
Reference in New Issue