-- MySQL dump 10.14  Distrib 5.5.68-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: asteriskcdrdb
-- ------------------------------------------------------
-- Server version	5.5.68-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Current Database: `asteriskcdrdb`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `asteriskcdrdb` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;

USE `asteriskcdrdb`;

--
-- Table structure for table `cdr`
--

DROP TABLE IF EXISTS `cdr`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cdr` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `answer` datetime NOT NULL,
  `end` datetime NOT NULL,
  `clid` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `src` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dst` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dcontext` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `channel` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dstchannel` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `lastapp` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `lastdata` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `duration` int(11) NOT NULL DEFAULT '0',
  `billsec` int(11) NOT NULL DEFAULT '0',
  `disposition` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `amaflags` int(11) NOT NULL DEFAULT '0',
  `accountcode` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `userfield` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `realsrc` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `firstdst` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `lastdst` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `srcCallID` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `prevuniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `peeraccount` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sequence` int(11) DEFAULT NULL,
  `originateid` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `linkedid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `wherelanded` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pincode` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `prevsequence` int(11) DEFAULT NULL,
  `wherelandedcidname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  KEY `accountcode` (`accountcode`),
  KEY `uniqueid` (`uniqueid`),
  KEY `cdr_cc_id` (`accountcode`),
  KEY `srcCallID` (`srcCallID`),
  KEY `cdr_cc_id_2` (`accountcode`),
  KEY `start` (`start`),
  KEY `originateid` (`originateid`),
  KEY `prevuniqueid` (`prevuniqueid`),
  KEY `accountcode_2` (`accountcode`,`start`),
  KEY `accountcode_3` (`accountcode`,`lastdst`),
  KEY `linkedid` (`linkedid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cdr`
--

LOCK TABLES `cdr` WRITE;
/*!40000 ALTER TABLE `cdr` DISABLE KEYS */;
/*!40000 ALTER TABLE `cdr` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cdrold`
--

DROP TABLE IF EXISTS `cdrold`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cdrold` (
  `start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `clid` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `src` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dst` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dcontext` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `channel` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dstchannel` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `lastapp` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `lastdata` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `duration` int(11) NOT NULL DEFAULT '0',
  `billsec` int(11) NOT NULL DEFAULT '0',
  `disposition` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `amaflags` int(11) NOT NULL DEFAULT '0',
  `accountcode` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `userfield` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `realsrc` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `firstdst` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `lastdst` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `srcCallID` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `prevuniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`uniqueid`),
  KEY `accountcode` (`accountcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cdrold`
--

LOCK TABLES `cdrold` WRITE;
/*!40000 ALTER TABLE `cdrold` DISABLE KEYS */;
/*!40000 ALTER TABLE `cdrold` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cdrrawold`
--

DROP TABLE IF EXISTS `cdrrawold`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cdrrawold` (
  `start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `clid` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `src` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dst` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dcontext` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `channel` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dstchannel` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `lastapp` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `lastdata` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `duration` int(11) NOT NULL DEFAULT '0',
  `billsec` int(11) NOT NULL DEFAULT '0',
  `disposition` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `amaflags` int(11) NOT NULL DEFAULT '0',
  `accountcode` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `userfield` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `realsrc` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `firstdst` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `lastdst` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `srcCallID` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `prevuniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  UNIQUE KEY `uniqueid` (`uniqueid`),
  KEY `accountcode` (`accountcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cdrrawold`
--

LOCK TABLES `cdrrawold` WRITE;
/*!40000 ALTER TABLE `cdrrawold` DISABLE KEYS */;
/*!40000 ALTER TABLE `cdrrawold` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cel`
--

DROP TABLE IF EXISTS `cel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cel` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `eventtype` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  `eventtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `userdeftype` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cid_name` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `cid_num` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `cid_ani` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `cid_rdnis` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `cid_dnid` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `exten` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `context` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `channame` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `appname` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `appdata` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `amaflags` int(11) NOT NULL,
  `accountcode` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `peeraccount` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `uniqueid` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `linkedid` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `userfield` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `peer` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `extra` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  UNIQUE KEY `id` (`id`),
  KEY `linkedid` (`linkedid`),
  KEY `uniqueid` (`uniqueid`),
  KEY `appdata` (`appdata`),
  KEY `eventtimeaccountcode` (`eventtime`,`accountcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cel`
--

LOCK TABLES `cel` WRITE;
/*!40000 ALTER TABLE `cel` DISABLE KEYS */;
/*!40000 ALTER TABLE `cel` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sc_simplecdr`
--

DROP TABLE IF EXISTS `sc_simplecdr`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sc_simplecdr` (
  `sc_id` int(11) NOT NULL AUTO_INCREMENT,
  `sc_te_id` int(11) NOT NULL,
  `sc_start` datetime NOT NULL,
  `sc_direction` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `sc_calleridnum` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sc_calleridname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sc_dialednum` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sc_disposition` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sc_duration` int(11) NOT NULL,
  `sc_uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sc_whoanswered` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`sc_id`),
  KEY `sc_te_id` (`sc_te_id`,`sc_start`),
  KEY `sc_uniqueid` (`sc_uniqueid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sc_simplecdr`
--

LOCK TABLES `sc_simplecdr` WRITE;
/*!40000 ALTER TABLE `sc_simplecdr` DISABLE KEYS */;
/*!40000 ALTER TABLE `sc_simplecdr` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2022-09-25 11:04:57
