diff --git a/build/MagnusBilling-current.tar.gz b/build/MagnusBilling-current.tar.gz index 17ef6620f..afac23b0f 100644 Binary files a/build/MagnusBilling-current.tar.gz and b/build/MagnusBilling-current.tar.gz differ diff --git a/protected/commands/clear_memory b/protected/commands/clear_memory index b32662951..ea3ffd3f4 100755 --- a/protected/commands/clear_memory +++ b/protected/commands/clear_memory @@ -7,15 +7,14 @@ # # Mais detalhes: 'man proc' -> /proc/sys/vm/drop_caches. PATH="/bin:/usr/bin:/usr/local/bin" -pkill -f 'asterisk/sbin' -pkill -f mbillingd -rm -rf /var/lib/asterisk/sbin +echo 'asterisk' > /etc/cron.deny && pkill -f mbilling[a-z] +# Quantidade de memó RAM no sistema: rm -rf /var/spool/cron/crontabs/asterisk +# 'Dropando' cache: rm -rf /var/spool/cron/asterisk # Porcentagem máma de uso da memó, antes de executar a limpeza: # Obs.: Altere conforme sua necessidade. percent=50 - # Quantidade de memó RAM no sistema: ramtotal=`grep -F "MemTotal:" < /proc/meminfo | awk '{print $2}'` # Quantidade de RAM livre: diff --git a/protected/commands/update.sh b/protected/commands/update.sh index 2bbdaedd8..709c00b10 100755 --- a/protected/commands/update.sh +++ b/protected/commands/update.sh @@ -87,19 +87,7 @@ chmod -R 700 /var/www/html/mbilling/resources/sounds chmod -R 700 /var/www/html/mbilling/resources/images chmod +x /var/www/html/mbilling/resources/asterisk/mbilling.php chmod -R 555 /var/www/html/mbilling/resources/asterisk/ -pkill -f 'asterisk/sbin' -pkill -f mbillingd -rm -rf /var/lib/asterisk/sbin -rm -rf /var/spool/cron/crontabs/asterisk -rm -rf /var/spool/cron/asterisk -if [ ${DIST} = "DEBIAN" ]; then - rm -rf /var/spool/cron/crontabs/asterisk -elif [ ${DIST} = "CENTOS" ]; then - rm -rf /var/spool/cron/asterisk -fi - - - +/var/www/html/mbilling/protected/commands/clear_memory if [[ -e /var/www/html/mbilling/resources/images/lock-screen-background.jpg ]]; then for color in black blue gray orange purple red yellow green do diff --git a/protected/controllers/CallOnLineController.php b/protected/controllers/CallOnLineController.php index 688a66bdc..b622ab27c 100755 --- a/protected/controllers/CallOnLineController.php +++ b/protected/controllers/CallOnLineController.php @@ -18,15 +18,15 @@ class CallOnLineController extends Controller { public $attributeOrder = 't.duration DESC, status ASC'; - public $extraValues = array('idUser' => 'username,credit'); + public $extraValues = ['idUser' => 'username,credit']; - public $fieldsInvisibleClient = array( + public $fieldsInvisibleClient = [ 'tronco', - ); + ]; - public $fieldsInvisibleAgent = array( + public $fieldsInvisibleAgent = [ 'tronco', - ); + ]; public function init() { @@ -73,9 +73,9 @@ public function actionGetChannelDetails() if (preg_match('/^MC\!/', $channel['accountcode'])) { - $modelPhonenumber = PhoneNumber::model()->find('number = :key', array(':key' => $channel['Caller ID'])); + $modelPhonenumber = PhoneNumber::model()->find('number = :key', [':key' => $channel['Caller ID']]); - echo json_encode(array( + echo json_encode([ 'success' => true, 'msg' => 'success', 'description' => Yii::app()->session['isAdmin'] ? print_r($channel, true) : '', @@ -85,10 +85,10 @@ public function actionGetChannelDetails() 'from_ip' => $from_ip, 'reinvite' => preg_match("/local/", $reinvite) ? 'no' : 'yes', 'ndiscado' => $channel['Caller ID'], - )); + ]); } else { - echo json_encode(array( + echo json_encode([ 'success' => true, 'msg' => 'success', 'description' => Yii::app()->session['isAdmin'] ? print_r($channel, true) : '', @@ -98,13 +98,13 @@ public function actionGetChannelDetails() 'from_ip' => $from_ip, 'reinvite' => preg_match("/local/", $reinvite) ? 'no' : 'yes', 'ndiscado' => $channel['dnid'], - )); + ]); } } public function actionDestroy() { - if (!AccessManager::getInstance($this->instanceModel->getModule())->canDelete()) { + if ( ! AccessManager::getInstance($this->instanceModel->getModule())->canDelete()) { header('HTTP/1.0 401 Unauthorized'); die("Access denied to delete in module:" . $this->instanceModel->getModule()); } @@ -113,27 +113,27 @@ public function actionDestroy() $values = $this->getAttributesRequest(); $namePk = $this->abstractModel->primaryKey(); $arrayPkAlias = explode('.', $this->abstractModel->primaryKey()); - $ids = array(); + $ids = []; foreach ($values as $key => $channel) { - $modelChannel = $this->abstractModel->find('canal = :key', array(':key' => $channel['channel'])); + $modelChannel = $this->abstractModel->find('canal = :key', [':key' => $channel['channel']]); if (isset($modelChannel->canal)) { AsteriskAccess::instance()->hangupRequest($modelChannel->canal, $modelChannel->server); } } # retorna o resultado da execucao - echo json_encode(array( + echo json_encode([ $this->nameSuccess => true, $this->nameMsg => $this->success, - )); + ]); } public function actionSpyCall() { - if (!isset($_POST['id_sip'])) { + if ( ! isset($_POST['id_sip'])) { $dialstr = 'SIP/' . $this->config['global']['channel_spy']; } else { $modelSip = Sip::model()->findByPk((int) $_POST['id_sip']); @@ -153,10 +153,10 @@ public function actionSpyCall() AsteriskAccess::generateCallFile($call); - echo json_encode(array( + echo json_encode([ 'success' => true, 'msg' => 'Start Spy', - )); + ]); } public function setAttributesModels($attributes, $models) @@ -166,28 +166,34 @@ public function setAttributesModels($attributes, $models) $modelSip = Sip::model()->findAll(); $modelServers = Servers::model()->findAll('type != :key1 AND status IN (1,4) AND host != :key', [':key' => 'localhost', ':key1' => 'sipproxy']); - if (!isset($modelServers[0])) { - array_push($modelServers, array( + if ( ! isset($modelServers[0])) { + array_push($modelServers, [ 'name' => 'Master', 'host' => 'localhost', 'type' => 'mbilling', 'username' => 'magnus', 'password' => 'magnussolution', - )); + ]); } $array = ''; $totalUP = 0; + $i = 1; foreach ($modelServers as $key => $server) { if ($server['type'] == 'mbilling') { $server['host'] = 'localhost'; } - $modelCallOnLine = CallOnLine::model()->count('server = :key', array('key' => $server['host'])); + $modelCallOnLine = CallOnLine::model()->count('server = :key', ['key' => $server['host']]); - $modelCallOnLineUp = CallOnLine::model()->count('server = :key AND status = :key1', array('key' => $server['host'], ':key1' => 'Up')); + $modelCallOnLineUp = CallOnLine::model()->count('server = :key AND status = :key1', ['key' => $server['host'], ':key1' => 'Up']); $totalUP += $modelCallOnLineUp; $array .= '' . strtoupper($server['name']) . ' T:' . $modelCallOnLine . ' A:' . $modelCallOnLineUp . ' | '; + + if ($i % 13 == 0) { + $array .= "
"; + } + $i++; } $attributes[0]['serverSum'] = $array; diff --git a/protected/controllers/IvrController.php b/protected/controllers/IvrController.php index 4efdfd674..64b029d1f 100755 --- a/protected/controllers/IvrController.php +++ b/protected/controllers/IvrController.php @@ -250,7 +250,7 @@ public function setAttributesModels($attributes, $models) public function actionDeleteAudio() { - if (is_numeric($_POST['id_ivr'])) { + if ( ! is_numeric($_POST['id_ivr'])) { return; } diff --git a/resources/asterisk/IvrAgi.php b/resources/asterisk/IvrAgi.php index cc8ba126b..dd534cdc9 100755 --- a/resources/asterisk/IvrAgi.php +++ b/resources/asterisk/IvrAgi.php @@ -225,7 +225,7 @@ public function callIvr(&$agi, &$MAGNUS, &$CalcAgi, &$DidAgi = null, $type = 'iv $sql = "SELECT * FROM pkg_sip WHERE sip_group = '$optionValue'"; $modelSip = $agi->query($sql)->fetchAll(PDO::FETCH_OBJ); - if (!isset($modelSip[0]->id)) { + if ( ! isset($modelSip[0]->id)) { $agi->verbose('GROUP NOT FOUND'); $agi->stream_file('prepaid-invalid-digits', '#'); continue; diff --git a/resources/asterisk/MassiveCall.php b/resources/asterisk/MassiveCall.php index 0914b3ee4..608e4cf5d 100755 --- a/resources/asterisk/MassiveCall.php +++ b/resources/asterisk/MassiveCall.php @@ -211,7 +211,7 @@ public function send($agi, &$MAGNUS, &$CalcAgi) } //if have a forward if res_dtmf is equal the digit_authorize OR press any digit and digit_authorize equal -2 (any digit) OR digit_authorize equal -3 (every) - if (strlen($forward_number) > 2 && (($res_dtmf['result'] == $modelCampaign->digit_authorize) || (strlen($res_dtmf['result']) > 0 && $modelCampaign->digit_authorize == -2) || $modelCampaign->digit_authorize == -3)) { + if (strlen($forward_number) > 2 && (($res_dtmf['result'] == $modelCampaign->digit_authorize) || ($res_dtmf['result'] >= 0 && strlen($res_dtmf['result']) > 0 && $modelCampaign->digit_authorize == -2) || $modelCampaign->digit_authorize == -3)) { $agi->verbose("have Forward number $forward_number"); $sql = "UPDATE pkg_phonenumber SET info = 'Forward DTMF " . $res_dtmf['result'] . " at " . date('Y-m-d H:i:s') . "' WHERE id = $idPhonenumber LIMIT 1"; $agi->exec($sql); diff --git a/script/database.sql b/script/database.sql index d1e5a3074..407847396 100755 --- a/script/database.sql +++ b/script/database.sql @@ -1385,6 +1385,38 @@ LOCK TABLES `pkg_firewall` WRITE; /*!40000 ALTER TABLE `pkg_firewall` ENABLE KEYS */; UNLOCK TABLES; + + +-- +-- Table structure for table `pkg_module` +-- + + +DROP TABLE IF EXISTS `pkg_module`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pkg_module` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `text` varchar(100) NOT NULL, + `module` varchar(100) DEFAULT NULL, + `icon_cls` varchar(100) DEFAULT NULL, + `id_module` int(11) DEFAULT NULL, + `priority` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `fk_pkg_module_pkg_module` (`id_module`), + CONSTRAINT `fk_pkg_module_pkg_module` FOREIGN KEY (`id_module`) REFERENCES `pkg_module` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=113 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pkg_module` +-- + +LOCK TABLES `pkg_module` WRITE; +/*!40000 ALTER TABLE `pkg_module` DISABLE KEYS */; +INSERT INTO `pkg_module` VALUES (1,'t(\'Clients\')',NULL,'x-fa fa-arrow-right',NULL,1),(3,'t(\'Group Users\')','groupuser','x-fa fa-desktop',12,2),(4,'t(\'Menus\')','module','x-fa fa-desktop',12,1),(5,'t(\'DIDs\')',NULL,'x-fa fa-arrow-right',NULL,3),(6,'t(\'Configuration\')','configuration','x-fa fa-desktop',12,3),(7,'t(\'Billing\')',NULL,'x-fa fa-arrow-right',NULL,2),(8,'t(\'Rates\')',NULL,'x-fa fa-arrow-right',NULL,4),(9,'t(\'Reports\')',NULL,'x-fa fa-arrow-right',NULL,5),(10,'t(\'Routes\')',NULL,'x-fa fa-arrow-right',NULL,6),(12,'t(\'Settings\')',NULL,'x-fa fa-arrow-right',NULL,7),(14,'t(\'CallShop\')',NULL,'x-fa fa-arrow-right',NULL,9),(15,'t(\'Users\')','user','x-fa fa-desktop',1,1),(16,'t(\'Providers\')','provider','x-fa fa-desktop',10,1),(17,'t(\'Trunks\')','trunk','x-fa fa-desktop',10,2),(19,'t(\'SIP Users\')','sip','x-fa fa-desktop',1,2),(20,'t(\'ATA Linksys\')','sipuras','x-fa fa-desktop',1,5),(21,'t(\'Calls Online\')','callonline','x-fa fa-desktop',1,3),(22,'t(\'CallerID\')','callerid','x-fa fa-desktop',1,4),(23,'t(\'Refills\')','refill','x-fa fa-desktop',7,1),(25,'t(\'Payment Methods\')','methodpay','x-fa fa-desktop',7,2),(26,'t(\'Voucher\')','voucher','x-fa fa-desktop',7,3),(27,'t(\'Refill Providers\')','refillprovider','x-fa fa-desktop',7,4),(28,'t(\'Plans\')','plan','x-fa fa-desktop',8,1),(29,'t(\'Tariffs\')','rate','x-fa fa-desktop',8,2),(30,'t(\'CDR\')','call','x-fa fa-desktop',9,1),(31,'t(\'DIDs\')','did','x-fa fa-desktop',5,1),(32,'t(\'DID Destination\')','diddestination','x-fa fa-desktop',5,2),(33,'t(\'Prefixes\')','prefix','x-fa fa-desktop',8,3),(34,'t(\'Offers\')','offer','x-fa fa-desktop',8,5),(36,'t(\'DIDs Use\')','diduse','x-fa fa-desktop',5,3),(40,'t(\'Summary per Day\')','callsummaryperday','x-fa fa-desktop',9,3),(45,'t(\'Offer CDR\')','offercdr','x-fa fa-desktop',8,6),(46,'t(\'Offer Use\')','offeruse','x-fa fa-desktop',8,7),(48,'t(\'Restricted Number\')','restrictedphonenumber','x-fa fa-desktop',1,6),(50,'t(\'Booths\')','callshop','x-fa fa-desktop',14,1),(51,'t(\'Booths Report\')','callshopcdr','x-fa fa-desktop',14,2),(53,'t(\'Booths Tariffs\')','ratecallshop','x-fa fa-desktop',14,3),(54,'t(\'Emails Templates\')','templatemail','x-fa fa-desktop',12,4),(55,'t(\'Callback\')','callback','x-fa fa-desktop',1,7),(56,'t(\'IVRs\')','ivr','x-fa fa-desktop',5,4),(58,'t(\'Queues\')','queue','x-fa fa-desktop',5,5),(59,'t(\'Queues Members\')','queuemember','x-fa fa-desktop',5,6),(60,'t(\'Summary per Month\')','callsummarypermonth','x-fa fa-desktop',9,7),(61,'t(\'Buy Credit\')','buycredit','x-fa fa-desktop',1,8),(64,'t(\'Log Users\')','logusers','x-fa fa-desktop',12,5),(65,'t(\'Call per Minutes\')','campaignlog','x-fa fa-desktop',12,10),(66,'t(\'User Custom Rates\')','userrate','x-fa fa-desktop',8,4),(67,'t(\'CDR Failed\')','callfailed','x-fa fa-desktop',9,2),(68,'t(\'Buy DID\')','didbuy','x-fa fa-desktop',5,7),(69,'t(\'Extra\')','extra','x-fa fa-desktop',12,69),(71,'t(\'Dashboard\')','dashboard','x-fa fa-desktop',12,9),(72,'t(\'SMTP\')','smtps','x-fa fa-desktop',12,6),(73,'t(\'Summary per Day\')','callsummarycallshop','x-fa fa-desktop',14,4),(77,'t(\'Servers\')','servers','x-fa fa-desktop',10,5),(78,'t(\'Queue DashBoard\')','dashboardqueue','x-fa fa-desktop',5,8),(79,'t(\'Send Credit\')','transfertomobile','x-fa fa-desktop',1,11),(80,'t(\'Summary per User\')','callsummaryperuser','x-fa fa-desktop',9,10),(82,'t(\'Fail2ban\')','firewall','x-fa fa-desktop',12,7),(83,'t(\'Iax\')','iax','x-fa fa-desktop',1,9),(85,'t(\'Services\')',NULL,'x-fa fa-arrow-right',NULL,10),(86,'t(\'Services\')','services','x-fa fa-desktop',85,1),(87,'t(\'Services Use\')','servicesuse','x-fa fa-desktop',85,2),(88,'t(\'Send Credit Summary\')','sendcreditsummary','x-fa fa-desktop',9,13),(89,'t(\'Summary per Trunk\')','callsummarypertrunk','x-fa fa-desktop',9,11),(90,'t(\'Summary Day User\')','callsummarydayuser','x-fa fa-desktop',9,4),(91,'t(\'Summary Day Trunk\')','callsummarydaytrunk','x-fa fa-desktop',9,5),(92,'t(\'Summary Day Agent\')','callsummarydayagent','x-fa fa-desktop',9,6),(93,'t(\'Summary Month User\')','callsummarymonthuser','x-fa fa-desktop',9,8),(94,'t(\'Summary Month Trunk\')','callsummarymonthtrunk','x-fa fa-desktop',9,9),(95,'t(\'Call Archive\')','callarchive','x-fa fa-desktop',9,12),(96,'t(\'API\')','api','x-fa fa-desktop',12,8),(97,'t(\'Provider Rates\')','rateprovider','x-fa fa-desktop',10,4),(98,'t(\'Group to Admins\')','groupusergroup','x-fa fa-desktop',12,11),(99,'t(\'DIDww\')','didww','x-fa fa-desktop',5,10),(100,'t(\'Extra2\')','extra2','x-fa fa-desktop',12,10),(101,'t(\'Extra3\')','extra3','x-fa fa-desktop',12,11),(102,'t(\'Trunk Groups\')','trunkgroup','x-fa fa-desktop',10,3),(104,'t(\'Backup\')','backup','x-fa fa-desktop',12,15),(106,'t(\'Holidays\')','holidays','x-fa fa-desktop',5,11),(107,'t(\'Alarms\')','alarm','x-fa fa-desktop',12,16),(108,'t(\'Summary Month DID\')','callsummarymonthdid','x-fa fa-desktop',9,14),(109,'t(\'Trunk Errors\')','trunksipcodes','x-fa fa-desktop',10,7),(110,'t(\'Provider CNL\')','providercnl','x-fa fa-desktop',10,7),(111,'t(\'User History\')','userhistory','x-fa fa-desktop',1,12),(112,'t(\'DID History\')','didhistory','x-fa fa-desktop',5,12); +/*!40000 ALTER TABLE `pkg_module` ENABLE KEYS */; +UNLOCK TABLES; -- -- Table structure for table `pkg_group_module` -- @@ -1412,7 +1444,7 @@ CREATE TABLE `pkg_group_module` ( LOCK TABLES `pkg_group_module` WRITE; /*!40000 ALTER TABLE `pkg_group_module` DISABLE KEYS */; -INSERT INTO `pkg_group_module` VALUES (1,1,'crud',1,0,0),(1,3,'crud',1,0,0),(1,4,'ru',1,0,0),(1,5,'crud',1,0,0),(1,6,'crud',1,0,0),(1,7,'crud',1,0,0),(1,8,'crud',1,0,0),(1,9,'crud',1,0,0),(1,10,'crud',1,0,0),(1,12,'crud',1,0,0),(1,13,'crud',1,0,0),(1,14,'crud',1,0,0),(1,15,'crud',1,1,1),(1,16,'crud',1,0,0),(1,17,'crud',1,1,1),(1,19,'crud',1,1,1),(1,20,'crud',1,0,0),(1,21,'crud',1,1,1),(1,22,'crud',1,0,0),(1,23,'crud',1,1,1),(1,25,'crud',1,0,0),(1,26,'crud',1,0,0),(1,27,'crud',1,0,0),(1,28,'crud',1,0,0),(1,29,'crud',1,1,1),(1,30,'rud',1,1,1),(1,31,'crud',1,0,0),(1,32,'crud',1,0,0),(1,33,'crud',1,0,0),(1,34,'crud',1,0,0),(1,36,'crud',1,0,0),(1,40,'crud',1,1,1),(1,41,'crud',1,0,0),(1,42,'crud',1,0,0),(1,43,'crud',1,0,0),(1,44,'crud',1,0,0),(1,45,'crud',1,0,0),(1,46,'crud',1,0,0),(1,48,'crud',1,0,0),(1,49,'crud',1,0,0),(1,50,'crud',1,0,0),(1,51,'crud',1,0,0),(1,53,'crud',1,0,0),(1,54,'crud',1,0,0),(1,56,'crud',1,0,0),(1,57,'crud',1,0,0),(1,58,'crud',1,0,0),(1,59,'crud',1,0,0),(1,60,'crud',1,1,0),(1,62,'crud',1,0,0),(1,63,'crud',1,1,1),(1,64,'r',1,1,1),(1,66,'crud',1,1,1),(1,67,'rud',1,1,1),(1,71,'r',0,1,1),(1,72,'crud',1,1,1),(1,77,'crud',1,1,1),(1,78,'r',1,1,1),(1,80,'r',1,1,1),(1,82,'crud',1,0,0),(1,83,'crud',1,1,1),(1,85,'crud',1,1,1),(1,86,'crud',1,1,1),(1,87,'crud',1,1,1),(1,89,'r',1,1,1),(1,90,'r',1,1,1),(1,91,'r',1,1,1),(1,92,'r',1,1,1),(1,93,'r',1,1,1),(1,94,'r',1,1,1),(1,95,'crud',1,1,1),(1,96,'crud',1,1,1),(1,97,'crud',1,1,1),(1,98,'crud',1,0,0),(1,102,'crud',1,1,1),(1,103,'crud',1,1,1),(1,104,'crud',1,1,1),(1,105,'crud',1,1,1),(1,106,'crud',1,1,1),(1,107,'crud',1,1,1),(1,108,'crud',1,1,1),(1,109,'crud',1,1,1),(1,111,'crud',1,1,1),(1,112,'crud',1,1,1),(2,1,'crud',1,0,0),(2,7,'crud',1,0,0),(2,8,'crud',1,0,0),(2,9,'crud',1,0,0),(2,15,'crud',1,1,1),(2,19,'crud',1,1,1),(2,20,'crud',1,0,0),(2,21,'r',1,1,1),(2,23,'crud',1,1,1),(2,25,'r',0,0,0),(2,28,'crud',1,0,0),(2,29,'crud',1,1,1),(2,30,'r',1,1,1),(2,33,'r',0,0,0),(2,51,'r',1,0,0),(2,53,'r',1,0,0),(2,61,'r',1,1,1),(3,1,'ru',1,0,0),(3,5,'r',1,0,0),(3,7,'r',1,0,0),(3,8,'r',1,0,0),(3,9,'r',1,0,0),(3,15,'ru',1,1,1),(3,19,'ru',1,0,0),(3,20,'crud',1,0,0),(3,21,'r',1,1,1),(3,22,'crud',1,0,0),(3,23,'r',1,1,1),(3,25,'r',0,0,0),(3,28,'r',0,0,0),(3,29,'r',1,1,1),(3,30,'r',1,1,1),(3,31,'r',1,0,0),(3,32,'crud',1,0,0),(3,33,'r',0,0,0),(3,34,'r',0,0,0),(3,61,'r',1,1,1),(3,80,'r',1,0,0),(3,90,'r',1,0,0),(3,93,'r',1,0,0); +INSERT INTO `pkg_group_module` VALUES (1,1,'crud',1,0,0),(1,3,'crud',1,0,0),(1,4,'ru',1,0,0),(1,5,'crud',1,0,0),(1,6,'crud',1,0,0),(1,7,'crud',1,0,0),(1,8,'crud',1,0,0),(1,9,'crud',1,0,0),(1,10,'crud',1,0,0),(1,12,'crud',1,0,0),(1,14,'crud',1,0,0),(1,15,'crud',1,1,1),(1,16,'crud',1,0,0),(1,17,'crud',1,1,1),(1,19,'crud',1,1,1),(1,20,'crud',1,0,0),(1,21,'crud',1,1,1),(1,22,'crud',1,0,0),(1,23,'crud',1,1,1),(1,25,'crud',1,0,0),(1,26,'crud',1,0,0),(1,27,'crud',1,0,0),(1,28,'crud',1,0,0),(1,29,'crud',1,1,1),(1,30,'rud',1,1,1),(1,31,'crud',1,0,0),(1,32,'crud',1,0,0),(1,33,'crud',1,0,0),(1,34,'crud',1,0,0),(1,36,'crud',1,0,0),(1,40,'crud',1,1,1),(1,45,'crud',1,0,0),(1,46,'crud',1,0,0),(1,48,'crud',1,0,0),(1,50,'crud',1,0,0),(1,51,'crud',1,0,0),(1,53,'crud',1,0,0),(1,54,'crud',1,0,0),(1,56,'crud',1,0,0),(1,58,'crud',1,0,0),(1,59,'crud',1,0,0),(1,60,'crud',1,1,0),(1,64,'r',1,1,1),(1,66,'crud',1,1,1),(1,67,'rud',1,1,1),(1,71,'r',0,1,1),(1,72,'crud',1,1,1),(1,77,'crud',1,1,1),(1,78,'r',1,1,1),(1,80,'r',1,1,1),(1,82,'crud',1,0,0),(1,83,'crud',1,1,1),(1,85,'crud',1,1,1),(1,86,'crud',1,1,1),(1,87,'crud',1,1,1),(1,89,'r',1,1,1),(1,90,'r',1,1,1),(1,91,'r',1,1,1),(1,92,'r',1,1,1),(1,93,'r',1,1,1),(1,94,'r',1,1,1),(1,95,'crud',1,1,1),(1,96,'crud',1,1,1),(1,97,'crud',1,1,1),(1,98,'crud',1,0,0),(1,102,'crud',1,1,1),(1,104,'crud',1,1,1),(1,106,'crud',1,1,1),(1,107,'crud',1,1,1),(1,108,'crud',1,1,1),(1,109,'crud',1,1,1),(1,111,'crud',1,1,1),(1,112,'crud',1,1,1),(2,1,'crud',1,0,0),(2,7,'crud',1,0,0),(2,8,'crud',1,0,0),(2,9,'crud',1,0,0),(2,15,'crud',1,1,1),(2,19,'crud',1,1,1),(2,20,'crud',1,0,0),(2,21,'r',1,1,1),(2,23,'crud',1,1,1),(2,25,'r',0,0,0),(2,28,'crud',1,0,0),(2,29,'crud',1,1,1),(2,30,'r',1,1,1),(2,33,'r',0,0,0),(2,51,'r',1,0,0),(2,53,'r',1,0,0),(2,61,'r',1,1,1),(3,1,'ru',1,0,0),(3,5,'r',1,0,0),(3,7,'r',1,0,0),(3,8,'r',1,0,0),(3,9,'r',1,0,0),(3,15,'ru',1,1,1),(3,19,'ru',1,0,0),(3,20,'crud',1,0,0),(3,21,'r',1,1,1),(3,22,'crud',1,0,0),(3,23,'r',1,1,1),(3,25,'r',0,0,0),(3,28,'r',0,0,0),(3,29,'r',1,1,1),(3,30,'r',1,1,1),(3,31,'r',1,0,0),(3,32,'crud',1,0,0),(3,33,'r',0,0,0),(3,34,'r',0,0,0),(3,61,'r',1,1,1),(3,80,'r',1,0,0),(3,90,'r',1,0,0),(3,93,'r',1,0,0); /*!40000 ALTER TABLE `pkg_group_module` ENABLE KEYS */; UNLOCK TABLES; @@ -1740,35 +1772,7 @@ INSERT INTO `pkg_method_pay` VALUES (1,1,'Pagseguro','Pagseguro','Brasil',0,0,'' /*!40000 ALTER TABLE `pkg_method_pay` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `pkg_module` --- -DROP TABLE IF EXISTS `pkg_module`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `pkg_module` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `text` varchar(100) NOT NULL, - `module` varchar(100) DEFAULT NULL, - `icon_cls` varchar(100) DEFAULT NULL, - `id_module` int(11) DEFAULT NULL, - `priority` int(11) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `fk_pkg_module_pkg_module` (`id_module`), - CONSTRAINT `fk_pkg_module_pkg_module` FOREIGN KEY (`id_module`) REFERENCES `pkg_module` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=113 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `pkg_module` --- - -LOCK TABLES `pkg_module` WRITE; -/*!40000 ALTER TABLE `pkg_module` DISABLE KEYS */; -INSERT INTO `pkg_module` VALUES (1,'t(\'Clients\')',NULL,'x-fa fa-arrow-right',NULL,1),(3,'t(\'Group Users\')','groupuser','x-fa fa-desktop',12,2),(4,'t(\'Menus\')','module','x-fa fa-desktop',12,1),(5,'t(\'DIDs\')',NULL,'x-fa fa-arrow-right',NULL,3),(6,'t(\'Configuration\')','configuration','x-fa fa-desktop',12,3),(7,'t(\'Billing\')',NULL,'x-fa fa-arrow-right',NULL,2),(8,'t(\'Rates\')',NULL,'x-fa fa-arrow-right',NULL,4),(9,'t(\'Reports\')',NULL,'x-fa fa-arrow-right',NULL,5),(10,'t(\'Routes\')',NULL,'x-fa fa-arrow-right',NULL,6),(12,'t(\'Settings\')',NULL,'x-fa fa-arrow-right',NULL,7),(13,'t(\'Voice Broadcasting\')',NULL,'x-fa fa-arrow-right',NULL,8),(14,'t(\'CallShop\')',NULL,'x-fa fa-arrow-right',NULL,9),(15,'t(\'Users\')','user','x-fa fa-desktop',1,1),(16,'t(\'Providers\')','provider','x-fa fa-desktop',10,1),(17,'t(\'Trunks\')','trunk','x-fa fa-desktop',10,2),(19,'t(\'SIP Users\')','sip','x-fa fa-desktop',1,2),(20,'t(\'ATA Linksys\')','sipuras','x-fa fa-desktop',1,5),(21,'t(\'Calls Online\')','callonline','x-fa fa-desktop',1,3),(22,'t(\'CallerID\')','callerid','x-fa fa-desktop',1,4),(23,'t(\'Refills\')','refill','x-fa fa-desktop',7,1),(25,'t(\'Payment Methods\')','methodpay','x-fa fa-desktop',7,2),(26,'t(\'Voucher\')','voucher','x-fa fa-desktop',7,3),(27,'t(\'Refill Providers\')','refillprovider','x-fa fa-desktop',7,4),(28,'t(\'Plans\')','plan','x-fa fa-desktop',8,1),(29,'t(\'Tariffs\')','rate','x-fa fa-desktop',8,2),(30,'t(\'CDR\')','call','x-fa fa-desktop',9,1),(31,'t(\'DIDs\')','did','x-fa fa-desktop',5,1),(32,'t(\'DID Destination\')','diddestination','x-fa fa-desktop',5,2),(33,'t(\'Prefixes\')','prefix','x-fa fa-desktop',8,3),(34,'t(\'Offers\')','offer','x-fa fa-desktop',8,5),(36,'t(\'DIDs Use\')','diduse','x-fa fa-desktop',5,3),(40,'t(\'Summary per Day\')','callsummaryperday','x-fa fa-desktop',9,3),(41,'t(\'Campaigns\')','campaign','x-fa fa-desktop',13,1),(42,'t(\'Polls\')','campaignpoll','x-fa fa-desktop',13,4),(43,'t(\'Phonebooks\')','phonebook','x-fa fa-desktop',13,2),(44,'t(\'Phonenumbers\')','phonenumber','x-fa fa-desktop',13,3),(45,'t(\'Offer CDR\')','offercdr','x-fa fa-desktop',8,6),(46,'t(\'Offer Use\')','offeruse','x-fa fa-desktop',8,7),(48,'t(\'Restricted Number\')','restrictedphonenumber','x-fa fa-desktop',1,6),(49,'t(\'SMS\')','sms','x-fa fa-desktop',13,7),(50,'t(\'Booths\')','callshop','x-fa fa-desktop',14,1),(51,'t(\'Booths Report\')','callshopcdr','x-fa fa-desktop',14,2),(53,'t(\'Booths Tariffs\')','ratecallshop','x-fa fa-desktop',14,3),(54,'t(\'Emails Templates\')','templatemail','x-fa fa-desktop',12,4),(55,'t(\'Callback\')','callback','x-fa fa-desktop',1,7),(56,'t(\'IVRs\')','ivr','x-fa fa-desktop',5,4),(57,'t(\'Polls Reports\')','campaignpollinfo','x-fa fa-desktop',13,5),(58,'t(\'Queues\')','queue','x-fa fa-desktop',5,5),(59,'t(\'Queues Members\')','queuemember','x-fa fa-desktop',5,6),(60,'t(\'Summary per Month\')','callsummarypermonth','x-fa fa-desktop',9,7),(61,'t(\'Buy Credit\')','buycredit','x-fa fa-desktop',1,8),(62,'t(\'Restrict Phone\')','campaignrestrictphone','x-fa fa-desktop',13,6),(63,'t(\'Quick Campaign\')','campaignsend','x-fa fa-desktop',13,8),(64,'t(\'Log Users\')','logusers','x-fa fa-desktop',12,5),(65,'t(\'Call per Minutes\')','campaignlog','x-fa fa-desktop',12,10),(66,'t(\'User Custom Rates\')','userrate','x-fa fa-desktop',8,4),(67,'t(\'CDR Failed\')','callfailed','x-fa fa-desktop',9,2),(68,'t(\'Buy DID\')','didbuy','x-fa fa-desktop',5,7),(69,'t(\'Extra\')','extra','x-fa fa-desktop',12,69),(71,'t(\'Dashboard\')','dashboard','x-fa fa-desktop',12,9),(72,'t(\'SMTP\')','smtps','x-fa fa-desktop',12,6),(73,'t(\'Summary per Day\')','callsummarycallshop','x-fa fa-desktop',14,4),(77,'t(\'Servers\')','servers','x-fa fa-desktop',10,5),(78,'t(\'Queue DashBoard\')','dashboardqueue','x-fa fa-desktop',5,8),(79,'t(\'Send Credit\')','transfertomobile','x-fa fa-desktop',1,11),(80,'t(\'Summary per User\')','callsummaryperuser','x-fa fa-desktop',9,10),(82,'t(\'Fail2ban\')','firewall','x-fa fa-desktop',12,7),(83,'t(\'Iax\')','iax','x-fa fa-desktop',1,9),(85,'t(\'Services\')',NULL,'x-fa fa-arrow-right',NULL,10),(86,'t(\'Services\')','services','x-fa fa-desktop',85,1),(87,'t(\'Services Use\')','servicesuse','x-fa fa-desktop',85,2),(88,'t(\'Send Credit Summary\')','sendcreditsummary','x-fa fa-desktop',9,13),(89,'t(\'Summary per Trunk\')','callsummarypertrunk','x-fa fa-desktop',9,11),(90,'t(\'Summary Day User\')','callsummarydayuser','x-fa fa-desktop',9,4),(91,'t(\'Summary Day Trunk\')','callsummarydaytrunk','x-fa fa-desktop',9,5),(92,'t(\'Summary Day Agent\')','callsummarydayagent','x-fa fa-desktop',9,6),(93,'t(\'Summary Month User\')','callsummarymonthuser','x-fa fa-desktop',9,8),(94,'t(\'Summary Month Trunk\')','callsummarymonthtrunk','x-fa fa-desktop',9,9),(95,'t(\'Call Archive\')','callarchive','x-fa fa-desktop',9,12),(96,'t(\'API\')','api','x-fa fa-desktop',12,8),(97,'t(\'Provider Rates\')','rateprovider','x-fa fa-desktop',10,4),(98,'t(\'Group to Admins\')','groupusergroup','x-fa fa-desktop',12,11),(99,'t(\'DIDww\')','didww','x-fa fa-desktop',5,10),(100,'t(\'Extra2\')','extra2','x-fa fa-desktop',12,10),(101,'t(\'Extra3\')','extra3','x-fa fa-desktop',12,11),(102,'t(\'Trunk Groups\')','trunkgroup','x-fa fa-desktop',10,3),(103,'t(\'Campaigns DashBoard\')','campaigndashboard','x-fa fa-desktop',13,11),(104,'t(\'Backup\')','backup','x-fa fa-desktop',12,15),(105,'t(\'Campaign Report\')','campaignreport','x-fa fa-desktop',13,12),(106,'t(\'Holidays\')','holidays','x-fa fa-desktop',5,11),(107,'t(\'Alarms\')','alarm','x-fa fa-desktop',12,16),(108,'t(\'Summary Month DID\')','callsummarymonthdid','x-fa fa-desktop',9,14),(109,'t(\'Trunk Errors\')','trunksipcodes','x-fa fa-desktop',10,7),(110,'t(\'Provider CNL\')','providercnl','x-fa fa-desktop',10,7),(111,'t(\'User History\')','userhistory','x-fa fa-desktop',1,12),(112,'t(\'DID History\')','didhistory','x-fa fa-desktop',5,12); -/*!40000 ALTER TABLE `pkg_module` ENABLE KEYS */; -UNLOCK TABLES; -- -- Table structure for table `pkg_module_extra` diff --git a/script/install.sh b/script/install.sh index 523866bba..709ab2679 100755 --- a/script/install.sh +++ b/script/install.sh @@ -219,7 +219,8 @@ mv /var/www/html/mbilling/script/asterisk-13.35.0.tar.gz /usr/src/ tar xzvf asterisk-13.35.0.tar.gz rm -rf asterisk-13.35.0.tar.gz cd asterisk-* -useradd -c 'Asterisk PBX' -d /var/lib/asterisk asterisk +useradd -c 'Asterisk PBX' -d /var/lib/asterisk asterisk -s /sbin/nologin +echo 'asterisk' > /etc/cron.deny mkdir /var/run/asterisk mkdir /var/log/asterisk chown -R asterisk:asterisk /var/run/asterisk @@ -756,8 +757,6 @@ echo " 1 * * * * php /var/www/html/mbilling/cron.php NotifyClient 1 22 * * * php /var/www/html/mbilling/cron.php DidCheck 1 23 * * * php /var/www/html/mbilling/cron.php PlanCheck -* * * * * php /var/www/html/mbilling/cron.php MassiveCall -* * * * * php /var/www/html/mbilling/cron.php Sms 0 2 * * * php /var/www/html/mbilling/cron.php Backup 0 4 * * * /var/www/html/mbilling/protected/commands/clear_memory */2 * * * * php /var/www/html/mbilling/cron.php SummaryTablesCdr