--
-- Host: localhost    Database: tel
-- ------------------------------------------------------


--
-- Table structure for table `admin_status`
--

CREATE TABLE `admin_status` (
  `admin_status_id` int NOT NULL AUTO_INCREMENT,
  `value` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`admin_status_id`),
  UNIQUE KEY `action_status_id` (`admin_status_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `admin_status`
--

INSERT INTO `admin_status` VALUES (1,'Включен','light-green-5'),(2,'Выключен','red-5');

--
-- Table structure for table `calls`
--

CREATE TABLE `calls` (
  `call_id` int NOT NULL AUTO_INCREMENT,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `phone` varchar(50) NOT NULL,
  `sip` varchar(1000) DEFAULT NULL,
  `line` varchar(50) DEFAULT NULL,
  `billsec` int NOT NULL DEFAULT '0',
  `type` int NOT NULL DEFAULT '1',
  `uniqueid` varchar(50) DEFAULT NULL,
  `record` int NOT NULL DEFAULT '0',
  `comment` text,
  `company` int NOT NULL DEFAULT '0',
  `group` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`call_id`),
  UNIQUE KEY `call_id` (`call_id`),
  KEY `phone` (`phone`),
  KEY `uniqueid` (`uniqueid`),
  KEY `type` (`type`),
  KEY `bilsec` (`billsec`)
) ENGINE=InnoDB AUTO_INCREMENT=282 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `calls`
--

INSERT INTO `calls` VALUES (95,'2023-01-13 15:27:39','1001',NULL,NULL,0,1,'1673623659.287',1,NULL,1,0),(96,'2023-01-13 15:28:29','1001','1859c481571','302',8,3,'1673623709.290',1,NULL,1,0),(97,'2023-01-13 15:29:15','87054420080','1859c481571','302',0,2,'1673623755.293',1,NULL,1,0),(98,'2023-01-13 15:59:17','1001',NULL,NULL,0,1,'1673625557.296',1,NULL,1,0),(99,'2023-01-13 15:59:28','1001','1859c481571','302',10,3,'1673625568.299',1,NULL,1,0),(100,'2023-01-16 08:26:58','1001',NULL,NULL,16,1,'1673857618.302',1,'',1,0),(101,'2023-01-16 08:33:34','1001','1859c481571','302',7,3,'1673858013.304',1,NULL,1,0),(102,'2023-01-16 09:05:22','1001','1859c481571','302',6,3,'1673859922.307',1,NULL,1,2),(103,'2023-01-16 09:16:30','87054420080','1859c481571','302',0,2,'1673860590.310',1,NULL,1,0),(104,'2023-01-16 09:19:39','+77054420080','1859c481571','302',0,2,'1673860779.313',1,NULL,1,0),(105,'2023-01-16 09:20:43','1001','1859c481571','302',18,3,'1673860843.316',1,NULL,1,2),(106,'2023-02-06 08:27:07','+79831172843','18625a2b995','201',0,2,'1675672027.319',1,NULL,44,0),(107,'2023-02-06 08:34:06','+79831172843','18625a2b995','201',0,2,'1675672446.322',1,NULL,44,0),(108,'2023-02-06 08:34:12','+79831172843','18625a2b995','201',0,2,'1675672452.325',1,NULL,44,0),(109,'2023-02-06 08:36:21','+79831172843','18625a2b995','201',0,2,'1675672581.328',1,NULL,44,0),(110,'2023-02-06 08:46:44','+79831172843','18625a2b995','201',0,2,'1675673204.331',1,NULL,44,0),(111,'2023-02-06 08:46:59','+77776445747','18625db4bc3','206',0,2,'1675673219.334',1,NULL,44,0),(112,'2023-02-06 08:58:42','+77776445747','18625a2b995','201',0,2,'1675673922.337',1,NULL,44,0),(113,'2023-02-06 08:58:47','+79831172843','18625a2b995','201',0,2,'1675673927.338',1,NULL,44,0),(114,'2023-02-06 09:00:41','+79831172843','18625a2b995','201',0,2,'1675674041.341',1,NULL,44,0),(115,'2023-02-06 09:00:50','+79831172843','18625a2b995','201',0,2,'1675674050.344',1,NULL,44,0),(116,'2023-02-06 09:02:37','201','186259ecb59','210',0,2,'1675674157.347',1,NULL,44,0),(117,'2023-02-06 09:07:14','186259ecb59','18625a2b995','201',0,2,'1675674434.350',1,NULL,44,0),(118,'2023-02-06 09:07:20','+79831172843','18625a2b995','201',0,2,'1675674440.351',1,NULL,44,0),(119,'2023-02-06 09:32:18','+79831172843','186260f403f','255',0,2,'1675675938.354',1,NULL,44,0),(120,'2023-02-06 09:33:05','+79831172843','186260f403f','255',0,2,'1675675985.355',1,NULL,44,0),(121,'2023-02-06 09:35:11','+79831172843','186260f403f','255',0,2,'1675676111.358',1,NULL,44,0),(122,'2023-02-06 09:35:36','+79831172843','186260f403f','255',0,2,'1675676136.361',1,NULL,44,0),(123,'2023-02-06 09:36:18','+79831172843','186260f403f','255',0,2,'1675676178.364',1,NULL,44,0),(124,'2023-02-06 09:36:43','+79831172843','186260f403f','255',0,2,'1675676203.367',1,NULL,44,0),(125,'2023-02-06 09:37:14','+79831172843','186260f403f','255',0,2,'1675676234.370',1,NULL,44,0),(126,'2023-02-06 09:38:45','+79831172843','186260f403f','255',0,2,'1675676325.373',1,NULL,44,0),(127,'2023-02-06 09:39:34','+79831172843','186260f403f','255',0,2,'1675676373.376',1,NULL,44,0),(128,'2023-02-06 09:47:37','+79831172843','186260f403f','255',16,4,'1675676857.379',1,NULL,44,0),(129,'2023-02-06 09:48:30','+79831172843','186259ecb59','210',0,3,'1675676910.382',1,NULL,44,4),(130,'2023-02-06 09:58:19','210','18625a2b995','201',0,2,'1675677499.387',1,NULL,44,0),(131,'2023-02-06 11:19:46','+79831172843','186260f403f','255',0,2,'1675682386.390',1,NULL,44,0),(132,'2023-02-07 04:11:14','+79585529237','186259ecb59','210',25,3,'1675743074.393',1,NULL,44,4),(133,'2023-02-07 08:58:57','+79585529237','186259ecb59','210',110,3,'1675760336.398',1,NULL,44,4),(134,'2023-02-07 14:59:59','+79236724248','186260f403f','255',0,2,'1675781999.0',1,NULL,44,0),(135,'2023-02-08 13:05:09','+79831172843',NULL,NULL,2,1,'1675861509.3',0,NULL,44,4),(136,'2023-02-09 11:39:41','+77776445747','18625db4bc3','206',0,2,'1675942780.5',1,NULL,44,0),(137,'2023-02-09 11:39:47','201','18625db4bc3','206',0,2,'1675942787.6',1,NULL,44,0),(138,'2023-02-09 12:04:50','+77776445747','18625db4bc3','206',0,2,'1675944290.9',1,NULL,44,0),(139,'2023-02-11 19:58:57','+79236724248','186260f403f','207',0,2,'1676145537.10',1,NULL,44,0),(140,'2023-02-13 05:45:58','+79661489905',NULL,NULL,0,1,'1676267158.13',1,NULL,44,4),(141,'2023-02-13 08:01:55','+79251591321',NULL,NULL,0,1,'1676275315.16',1,NULL,44,4),(142,'2023-02-13 13:17:45','+79221240124',NULL,NULL,4,1,'1676294265.19',0,NULL,44,4),(143,'2023-02-14 07:33:29','+79697776404',NULL,NULL,0,1,'1676360009.21',0,NULL,44,4),(144,'2023-02-15 05:57:25','+79139389676',NULL,NULL,0,1,'1676440645.23',1,NULL,44,4),(145,'2023-02-16 08:16:38','+73512183555','18625a2b995','201',21,3,'1676535398.26',1,NULL,44,4),(146,'2023-02-22 12:33:31','+79218847193',NULL,NULL,0,1,'1677069211.33',1,NULL,44,4),(147,'2023-02-27 07:12:56','+79218847081',NULL,NULL,0,1,'1677481976.40',1,NULL,44,4),(148,'2023-02-27 12:28:21','+79651360406',NULL,NULL,5,1,'1677500901.53',0,NULL,44,4),(149,'2023-02-27 12:38:37','+74957973552',NULL,NULL,5,1,'1677501517.55',0,NULL,44,4),(150,'2023-02-27 12:40:50','+74957973552',NULL,NULL,0,1,'1677501650.57',1,NULL,44,4),(151,'2023-02-28 05:18:06','+79651360410',NULL,NULL,8,1,'1677561485.62',0,NULL,44,4),(152,'2023-02-28 06:47:12','+79850718806',NULL,NULL,0,1,'1677566831.64',1,NULL,44,4),(153,'2023-03-02 06:08:21','+79221299743',NULL,NULL,3,1,'1677737301.69',0,NULL,44,4),(154,'2023-03-02 09:27:09','+74957973552',NULL,NULL,0,1,'1677749229.71',1,NULL,44,4),(155,'2023-03-06 11:18:36','+78001000800',NULL,NULL,3,1,'1678101516.76',0,NULL,44,4),(156,'2023-03-07 07:45:23','+79857936023',NULL,NULL,2,1,'1678175123.78',0,NULL,44,4),(157,'2023-03-09 03:53:55','+79059408395',NULL,NULL,4,1,'1678334034.80',0,NULL,44,4),(158,'2023-03-09 08:58:05','+74957973552',NULL,NULL,0,1,'1678352285.82',1,NULL,44,4),(159,'2023-03-13 15:56:13','+4757745361',NULL,NULL,4,1,'1678722973.87',0,NULL,44,4),(160,'2023-03-14 06:57:51','+79857931585',NULL,NULL,105,1,'1678777071.89',1,NULL,44,4),(161,'2023-03-14 11:06:09','+74994951625',NULL,NULL,174,1,'1678791969.91',1,NULL,44,4),(162,'2023-03-16 10:01:37','+73513626860',NULL,NULL,79,1,'1678960897.93',1,NULL,44,4),(163,'2023-03-17 06:17:50','+79857925480',NULL,NULL,11,1,'1679033870.95',0,NULL,44,4),(164,'2023-03-21 13:19:25','+78452398185',NULL,NULL,4,1,'1679404765.0',0,NULL,44,4),(165,'2023-03-22 07:28:07','+79857936023',NULL,NULL,2,1,'1679470087.2',0,NULL,44,4),(166,'2023-03-22 12:18:06','+74957973552',NULL,NULL,61,1,'1679487486.4',1,NULL,44,4),(167,'2023-03-23 06:57:50','+79697776404',NULL,NULL,1,1,'1679554670.6',0,NULL,44,4),(168,'2023-03-23 07:05:45','+78126798170',NULL,NULL,10,1,'1679555144.8',0,NULL,44,4),(169,'2023-03-23 08:13:51','+79697776404',NULL,NULL,7,1,'1679559231.10',0,NULL,44,4),(170,'2023-03-23 08:14:21','+79697776404',NULL,NULL,308,1,'1679559261.12',1,NULL,44,4),(171,'2023-03-24 07:30:37','+73833758877',NULL,NULL,107,1,'1679643037.14',1,NULL,44,4),(172,'2023-03-27 13:07:14','+79833092003','18625a2b995','201',331,4,'1679922434.16',1,NULL,44,0),(173,'2023-03-30 08:16:28','+74992152333',NULL,NULL,9,1,'1680164188.19',0,NULL,44,4),(174,'2023-04-03 09:35:48','+79585529237','186259ecb59','210',128,3,'1680514548.0',1,NULL,44,4),(175,'2023-04-05 06:24:48','+79857925480',NULL,NULL,0,1,'1680675888.5',1,NULL,44,4),(176,'2023-04-05 06:27:19','+77055038302',NULL,NULL,0,1,'1680676039.8',0,NULL,44,4),(177,'2023-04-06 10:12:12','+79697776404',NULL,NULL,5,1,'1680775932.10',0,NULL,44,4),(178,'2023-04-06 10:19:33','+78122077204',NULL,NULL,7,1,'1680776373.12',0,NULL,44,4),(179,'2023-04-10 11:18:23','+79185001258',NULL,NULL,3,1,'1681125503.14',0,NULL,44,4),(180,'2023-04-11 08:56:01','+79529000530',NULL,NULL,0,1,'1681203361.16',1,NULL,44,4),(181,'2023-04-12 10:02:59','+79060590873',NULL,NULL,0,1,'1681293779.23',1,NULL,44,4),(182,'2023-04-13 03:36:41','+73513623860',NULL,NULL,0,1,'1681357000.28',1,NULL,44,4),(183,'2023-04-14 08:48:45','+74952216063',NULL,NULL,0,1,'1681462125.31',1,NULL,44,4),(184,'2023-04-19 05:24:16','+79697776404',NULL,NULL,6,1,'1681881856.36',0,NULL,44,4),(185,'2023-04-20 06:41:20','+79585969509',NULL,NULL,0,1,'1681972880.38',1,NULL,44,4),(186,'2023-04-20 07:43:03','+79585529237',NULL,NULL,0,1,'1681976583.41',1,NULL,44,4),(187,'2023-04-26 05:26:13','+79537702197',NULL,NULL,0,1,'1682486773.44',1,NULL,44,4),(188,'2023-04-28 08:25:21','+79585529237',NULL,NULL,0,1,'1682670321.47',1,NULL,44,4),(189,'2023-05-02 13:27:30','+74952122253',NULL,NULL,0,1,'1683034050.50',1,NULL,44,4),(190,'2023-05-02 13:33:34','+74952122253',NULL,NULL,0,1,'1683034414.57',1,NULL,44,4),(191,'2023-05-02 13:44:55','+74952122253',NULL,NULL,0,1,'1683035095.62',1,NULL,44,4),(192,'2023-05-12 09:34:31','+74956655777',NULL,NULL,10,1,'1683884071.0',0,NULL,44,4),(193,'2023-05-15 08:43:51','+79651193749',NULL,NULL,0,1,'1684140231.2',1,NULL,44,4),(194,'2023-05-19 08:29:49','+79697776404',NULL,NULL,5,1,'1684484989.5',0,NULL,44,4),(195,'2023-05-23 08:36:34','+79585529237',NULL,NULL,0,1,'1684830994.7',1,NULL,44,4),(196,'2023-05-25 04:14:52','+74956655777',NULL,NULL,13,1,'1684988092.10',1,NULL,44,4),(197,'2023-05-29 04:57:39','+74956655777',NULL,NULL,13,1,'1685336259.12',1,NULL,44,4),(198,'2023-05-31 05:05:37','+74951699097',NULL,NULL,8,1,'1685509537.14',0,NULL,44,4),(199,'2023-05-31 09:01:53','+79585529237',NULL,NULL,34,1,'1685523713.16',1,NULL,44,4),(200,'2023-06-01 05:45:54','+79146924268',NULL,NULL,5,1,'1685598354.18',0,NULL,44,4),(201,'2023-06-02 06:28:02','+79697776404',NULL,NULL,7,1,'1685687282.20',0,NULL,44,4),(202,'2023-06-05 05:49:32','+79134830939',NULL,NULL,43,1,'1685944172.22',1,NULL,44,4),(203,'2023-06-08 08:19:18','+79857933386',NULL,NULL,17,1,'1686212358.24',1,NULL,44,4),(204,'2023-06-08 10:57:00','+74956655777',NULL,NULL,21,1,'1686221820.26',1,NULL,44,4),(205,'2023-06-09 06:01:47','+79850718759',NULL,NULL,31,1,'1686290507.28',1,NULL,44,4),(206,'2023-06-13 06:51:52','+79857931585',NULL,NULL,0,1,'1686639111.30',1,NULL,44,4),(207,'2023-06-16 08:28:52','+79697776404',NULL,NULL,3,1,'1686904132.33',0,NULL,44,4),(208,'2023-06-16 08:29:06','+79697776404',NULL,NULL,0,1,'1686904146.35',0,'',44,4),(209,'2023-06-19 08:13:26','+79663356663',NULL,NULL,0,1,'1687162406.37',1,NULL,44,4),(210,'2023-06-19 11:31:11','+79663356663',NULL,NULL,0,1,'1687174271.44',1,NULL,44,4),(211,'2023-06-20 04:41:33','+73833832046','188d6ea24fd','501',0,2,'1687236093.47',1,NULL,43,0),(212,'2023-06-20 04:42:07','+73833832046','188d6ea24fd','501',0,2,'1687236127.48',1,NULL,43,0),(213,'2023-06-20 04:42:16','+73833832046','188d6ea24fd','501',0,2,'1687236136.49',1,NULL,43,0),(214,'2023-06-20 04:47:11','+73833832046','188d6ea24fd','501',0,2,'1687236431.50',1,NULL,43,0),(215,'2023-06-20 04:49:37','+73833832046','188d6ea24fd','501',0,2,'1687236577.51',1,NULL,43,0),(216,'2023-06-20 05:04:39','+73833832046','188d6ea24fd','501',0,2,'1687237479.52',1,NULL,43,0),(217,'2023-06-20 05:52:42','+73833832046','188d6ea24fd','501',0,2,'1687240362.53',1,'',43,0),(218,'2023-06-20 07:40:11','+73833832046','188d6ea24fd','501',0,2,'1687246811.54',1,NULL,43,0),(219,'2023-06-20 07:40:35','+73833832046','188d6ea24fd','501',0,2,'1687246835.55',1,NULL,43,0),(220,'2023-06-20 07:40:58','+73833832028','188d6ea24fd','501',0,2,'1687246858.56',1,NULL,43,0),(221,'2023-06-20 07:45:05','+73833832028','188d6ea24fd','501',0,2,'1687247105.57',1,NULL,43,0),(222,'2023-06-20 07:45:51','+73833832028','188d6ea24fd','501',0,2,'1687247151.58',1,NULL,43,0),(223,'2023-06-20 07:51:16','+73833832028','188d6ea24fd','501',0,2,'1687247476.59',1,NULL,43,0),(224,'2023-06-20 07:52:16','+73833832028','188d6ea24fd','501',0,2,'1687247536.60',1,NULL,43,0),(225,'2023-06-20 07:54:04','+73833832028','188d6ea24fd','501',0,2,'1687247644.63',1,NULL,43,0),(226,'2023-06-20 08:02:07','+73833832028','188d6ea24fd','501',0,2,'1687248127.64',1,NULL,43,0),(227,'2023-06-20 08:02:13','+73833832028',NULL,NULL,3,1,'1687248133.65',0,NULL,44,4),(228,'2023-06-20 09:25:57','+79857933386',NULL,NULL,0,1,'1687253157.67',1,NULL,44,4),(229,'2023-06-20 12:05:27','+79663356663',NULL,NULL,0,1,'1687262727.70',1,NULL,44,4),(230,'2023-06-21 04:11:00','+79333326242',NULL,NULL,0,1,'1687320660.73',1,NULL,44,4),(231,'2023-06-23 08:15:53','+79857931585',NULL,NULL,3,1,'1687508153.76',0,NULL,44,4),(232,'2023-06-27 06:32:19','+73833787759',NULL,NULL,0,1,'1687847539.78',1,NULL,44,4),(233,'2023-06-27 07:26:52','+79663356663',NULL,NULL,0,1,'1687850812.85',1,NULL,44,4),(234,'2023-06-29 08:48:48','+74952800110',NULL,NULL,0,1,'1688028528.90',1,NULL,44,4),(235,'2023-07-07 03:13:47','+78632855756',NULL,NULL,0,1,'1688699627.95',1,NULL,44,4),(236,'2023-07-10 04:48:43','+79639570272','18625a2b995','201',40,3,'1688964523.98',1,NULL,44,4),(237,'2023-07-10 04:50:24','+79639570267',NULL,NULL,0,1,'1688964624.101',1,NULL,44,4),(238,'2023-07-10 07:28:52','+79639570267',NULL,NULL,0,1,'1688974132.108',1,NULL,44,4),(239,'2023-07-11 03:21:11','+79639570296',NULL,NULL,0,1,'1689045671.111',1,NULL,44,4),(240,'2023-07-11 07:19:08','+77773163026','188d6ea24fd','501',0,2,'1689059948.120',1,NULL,43,0),(241,'2023-07-11 15:22:22','+79231548508',NULL,NULL,8,1,'1689088941.121',0,NULL,44,4),(242,'2023-07-13 07:23:30','+79059138170',NULL,NULL,8,1,'1689233010.123',0,NULL,44,4),(243,'2023-07-13 08:20:59','+73833787750',NULL,NULL,0,1,'1689236459.125',1,NULL,44,4),(244,'2023-07-17 09:51:28','+78122234428',NULL,NULL,0,1,'1689587488.128',1,NULL,44,4),(245,'2023-07-18 02:59:31','+78122234428',NULL,NULL,0,1,'1689649170.131',1,NULL,44,4),(246,'2023-07-19 08:38:59','+78122234428',NULL,NULL,0,1,'1689755939.138',1,NULL,44,4),(247,'2023-07-20 06:19:06','+78001000800',NULL,NULL,3,1,'1689833946.141',0,NULL,44,4),(248,'2023-08-02 09:19:56','+73833758877',NULL,NULL,0,1,'1690967996.143',1,NULL,44,4),(249,'2023-08-02 09:22:15','+73833758877',NULL,NULL,0,1,'1690968134.148',1,NULL,44,4),(250,'2023-08-03 03:27:24','+79826327078',NULL,NULL,12,1,'1691033244.155',0,NULL,44,4),(251,'2023-08-03 12:57:43','+79272402308','18625a2b995','201',277,3,'1691067463.157',1,NULL,44,4),(252,'2023-08-04 08:37:13','+79537702197',NULL,NULL,0,1,'1691138233.160',1,NULL,44,4),(253,'2023-08-08 07:17:39','+73833832810',NULL,NULL,0,1,'1691479059.163',1,NULL,44,4),(254,'2023-08-08 09:39:49','+79651193979',NULL,NULL,0,1,'1691487589.166',1,NULL,44,4),(255,'2023-08-08 10:57:23','+79272402308',NULL,NULL,0,1,'1691492243.169',1,NULL,44,4),(256,'2023-08-08 11:53:10','+79272402308',NULL,NULL,0,1,'1691495590.176',1,NULL,44,4),(257,'2023-08-08 14:04:19','+79291229466',NULL,NULL,0,1,'1691503459.181',1,NULL,44,4),(258,'2023-08-09 11:40:06','+79272402308',NULL,NULL,103,1,'1691581206.184',1,NULL,44,4),(259,'2023-08-09 12:34:19','+79272402308',NULL,NULL,68,1,'1691584459.186',1,NULL,44,4),(260,'2023-08-10 10:55:36','+79272402308',NULL,NULL,163,1,'1691664936.188',1,NULL,44,4),(261,'2023-08-10 11:43:43','+79272402308',NULL,NULL,116,1,'1691667823.190',1,NULL,44,4),(262,'2023-08-11 07:32:51','+79697776404',NULL,NULL,7,1,'1691739171.192',0,NULL,44,4),(263,'2023-08-11 11:35:31','+79272402308',NULL,NULL,133,1,'1691753731.194',1,NULL,44,4),(264,'2023-08-14 09:24:31','+79300354448',NULL,NULL,123,1,'1692005071.196',1,NULL,44,4),(265,'2023-08-14 11:04:56','+79272402308',NULL,NULL,133,1,'1692011096.198',1,NULL,44,4),(266,'2023-08-15 04:45:07','+79311099257',NULL,NULL,82,1,'1692074707.200',1,NULL,44,4),(267,'2023-08-15 06:31:01','+79272402308',NULL,NULL,178,1,'1692081061.202',1,NULL,44,4),(268,'2023-08-15 06:57:35','+79059138170',NULL,NULL,29,1,'1692082655.204',1,NULL,44,4),(269,'2023-08-16 07:06:38','+79272402308',NULL,NULL,0,1,'1692169598.206',1,NULL,44,4),(270,'2023-08-16 07:11:13','+79272402308',NULL,NULL,0,1,'1692169873.214',1,NULL,44,4),(271,'2023-08-16 08:12:50','+79311099257',NULL,NULL,0,1,'1692173570.234',1,NULL,44,4),(272,'2023-08-17 02:00:20','+79137072575',NULL,NULL,8,1,'1692237620.241',0,NULL,44,4),(273,'2023-08-17 06:17:33','+79311099257',NULL,NULL,0,1,'1692253053.243',1,NULL,44,4),(274,'2023-08-17 07:00:30','+79272402308',NULL,NULL,4,1,'1692255630.250',0,NULL,44,4),(275,'2023-08-17 07:00:35','+79272402308',NULL,NULL,0,1,'1692255635.251',1,NULL,44,4),(276,'2023-08-18 03:45:41','+79134721741',NULL,NULL,0,1,'1692330341.257',1,NULL,44,4),(277,'2023-08-18 05:22:20','+79311099257',NULL,NULL,0,1,'1692336140.260',1,NULL,44,4),(278,'2023-08-21 05:24:35','+79311099257',NULL,NULL,128,1,'1692595475.269',1,NULL,44,4),(279,'2023-08-21 08:01:08','+79272402308',NULL,NULL,97,1,'1692604868.271',1,NULL,44,4),(280,'2023-08-21 09:44:56','+78352243364',NULL,NULL,53,1,'1692611096.273',1,NULL,44,4),(281,'2023-08-21 10:39:05','+79272402308',NULL,NULL,126,1,'1692614345.275',1,NULL,44,4);

--
-- Table structure for table `calls_type`
--

CREATE TABLE `calls_type` (
  `calls_type_id` int NOT NULL,
  `value` varchar(50) DEFAULT NULL,
  `color` varchar(50) DEFAULT NULL,
  `icon` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`calls_type_id`),
  UNIQUE KEY `calls_type_id` (`calls_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `calls_type`
--

INSERT INTO `calls_type` VALUES (1,'Входящий нет ответа','#e97136','phone_missed'),(2,'Исходящий нет ответа','#e9da36','phone_disabled'),(3,'Входящий завершен','#a3d2bc','phone_callback'),(4,'Исходящий завершен','#86b7d2','phone_forwarded'),(5,'Входящий в процессе','#c2e6d5','phone_in_talk'),(6,'Исходящий в процессе','#9eddff','settings_phone');

--
-- Table structure for table `company`
--

CREATE TABLE `company` (
  `company_id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `prefix` int DEFAULT '0',
  `enable` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`company_id`),
  UNIQUE KEY `company_id` (`company_id`),
  UNIQUE KEY `prefix` (`prefix`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `company`
--

INSERT INTO `company` VALUES (43,'ООО \"ИЗЕРИАЛ\"',5,1),(44,'ТОО \"Esil Trade\"',2,1);

--
-- Table structure for table `global_settings`
--

CREATE TABLE `global_settings` (
  `name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  KEY `new_index_2` (`name`(255))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `global_settings`
--

INSERT INTO `global_settings` VALUES ('keepAlive','1800','Админка: время не активности'),('prefix_format','#','Формат префикса компаний'),('number_format','##','Формат внутреннего номера'),('asterisk_restart','0','Флаг обновления конфигурации PBX'),('dataUpdate','3','Период обновления данных звонков, сек');

--
-- Table structure for table `incoming`
--

CREATE TABLE `incoming` (
  `incoming_id` int NOT NULL AUTO_INCREMENT,
  `company` int NOT NULL DEFAULT '0',
  `name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `strategy` int NOT NULL DEFAULT '1',
  `line` text COLLATE utf8mb4_unicode_ci,
  `dial` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`incoming_id`),
  UNIQUE KEY `group_id` (`incoming_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `incoming`
--

INSERT INTO `incoming` VALUES (2,1,'Бухгалтерия',3,'[{\"name\":\"185974d5334\",\"phone\":\"01\"},{\"name\":\"1859c481571\",\"phone\":\"02\"}]',0),(3,1,'Отдел продаж',2,'[{\"name\":\"1859c481571\",\"phone\":\"02\"}]',0),(4,44,'Руководитель',2,'[{\"name\":\"186259ecb59\",\"phone\":\"10\"},{\"name\":\"18625a2b995\",\"phone\":\"01\"}]',1),(5,44,'Бухгалтерия',3,'[{\"name\":\"18625db4bc3\",\"phone\":\"06\"},{\"name\":\"186354de20e\",\"phone\":\"05\"}]',1),(6,44,'Логистика',1,'[{\"name\":\"1863555d134\",\"phone\":\"04\"}]',1),(7,44,'Склад',1,'[{\"name\":\"18635537828\",\"phone\":\"03\"}]',1),(8,43,'Mango-office 83833832028',1,'[{\"name\":\"188d6ea24fd\",\"phone\":\"01\"}]',1),(9,43,'sip.telecom.kz_501510',1,'[{\"name\":\"188d6ea24fd\",\"phone\":\"01\"}]',1);

--
-- Table structure for table `outgoing`
--

CREATE TABLE `outgoing` (
  `outgoing_id` int NOT NULL AUTO_INCREMENT,
  `company` int NOT NULL DEFAULT '0',
  `name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dialplane` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `line` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`outgoing_id`),
  UNIQUE KEY `outgoing_id` (`outgoing_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `outgoing`
--

INSERT INTO `outgoing` VALUES (1,1,'Бухгалтерия','[{\"trunk\":\"2\",\"mask\":\"+\"},{\"mask\":\"+79,+73\",\"trunk\":\"10\"},{\"mask\":\"+77\",\"trunk\":\"2\"}]','[{\"name\":\"1859c481571\",\"phone\":\"02\"},{\"name\":\"185a03e9522\",\"phone\":\"22\"}]'),(2,1,'Отдел продаж','[{\"mask\":\"+\",\"trunk\":\"2\"}]','[{\"name\":\"185974d5334\",\"phone\":\"01\"}]'),(3,44,'Руководитель','[{\"mask\":\"+79,+73,+78\",\"trunk\":\"12\"}]','[{\"name\":\"186259ecb59\",\"phone\":\"10\"},{\"name\":\"18625a2b995\",\"phone\":\"01\"},{\"name\":\"186260f403f\",\"phone\":\"55\"}]'),(4,44,'Бухгалтерия','[{\"mask\":\"+77\",\"trunk\":\"13\"}]','[{\"name\":\"18625db4bc3\",\"phone\":\"06\"},{\"name\":\"186354de20e\",\"phone\":\"05\"}]'),(5,43,'Mahgo-Office 83833832028','[{\"mask\":\"89\",\"trunk\":\"15\"}]','[{\"name\":\"188d6ea24fd\",\"phone\":\"01\"}]'),(6,43,'sip.telecom.kz_501510','[{\"mask\":\"8700,8701,8702,8705,8707,8708,8747,8771,8775,8778\",\"trunk\":\"16\"}]','[{\"name\":\"188d6ea24fd\",\"phone\":\"01\"}]');

--
-- Table structure for table `role`
--

CREATE TABLE `role` (
  `role_id` int NOT NULL AUTO_INCREMENT,
  `value` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`role_id`),
  UNIQUE KEY `role_id` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role`
--

INSERT INTO `role` VALUES (1,'Администратор','red-5'),(2,'Менеджер','light-green-5');

--
-- Table structure for table `strategy`
--

CREATE TABLE `strategy` (
  `strategy_id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`strategy_id`),
  UNIQUE KEY `strategy_id` (`strategy_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `strategy`
--

INSERT INTO `strategy` VALUES (1,'Вызов всех','group'),(2,'Очередь - вызов всех','ringall'),(3,'Очередь - кольцо','leastrecent'),(4,'Очередь - начинать с ленивого','fewestcalls'),(5,'Очередь - случайный абонент','random'),(6,'Очередь - кольцо с памятью','rrmemory');


