cat ./contrib/realtime/mysql/mysql_cdr.sql
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 107
Server version: 5.7.16-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| dialer |
| mysql |
| performance_schema |
| phpmyadmin |
| sys |
+--------------------+
6 rows in set (0.00 sec)
mysql> create database asterisk;
Query OK, 1 row affected (0.00 sec)
mysql> use asterisk;
Database changed
mysql> CREATE TABLE cdr (
-> accountcode VARCHAR(20),
-> src VARCHAR(80),
-> dst VARCHAR(80),
-> dcontext VARCHAR(80),
-> clid VARCHAR(80),
-> channel VARCHAR(80),
-> dstchannel VARCHAR(80),
-> lastapp VARCHAR(80),
-> lastdata VARCHAR(80),
-> start DATETIME,
-> answer DATETIME,
-> end DATETIME,
-> duration INTEGER,
-> billsec INTEGER,
-> disposition VARCHAR(45),
-> amaflags VARCHAR(45),
-> userfield VARCHAR(256),
-> uniqueid VARCHAR(150),
-> linkedid VARCHAR(150),
-> peeraccount VARCHAR(20),
-> sequence INTEGER
-> );
Query OK, 0 rows affected (0.02 sec)
mysql> show tables;
+--------------------+
| Tables_in_asterisk |
+--------------------+
| cdr |
+--------------------+
1 row in set (0.00 sec)
mysql> describe cdr;
+-------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+-------+
| accountcode | varchar(20) | YES | | NULL | |
| src | varchar(80) | YES | | NULL | |
| dst | varchar(80) | YES | | NULL | |
| dcontext | varchar(80) | YES | | NULL | |
| clid | varchar(80) | YES | | NULL | |
| channel | varchar(80) | YES | | NULL | |
| dstchannel | varchar(80) | YES | | NULL | |
| lastapp | varchar(80) | YES | | NULL | |
| lastdata | varchar(80) | YES | | NULL | |
| start | datetime | YES | | NULL | |
| answer | datetime | YES | | NULL | |
| end | datetime | YES | | NULL | |
| duration | int(11) | YES | | NULL | |
| billsec | int(11) | YES | | NULL | |
| disposition | varchar(45) | YES | | NULL | |
| amaflags | varchar(45) | YES | | NULL | |
| userfield | varchar(256) | YES | | NULL | |
| uniqueid | varchar(150) | YES | | NULL | |
| linkedid | varchar(150) | YES | | NULL | |
| peeraccount | varchar(20) | YES | | NULL | |
| sequence | int(11) | YES | | NULL | |
+-------------+--------------+------+-----+---------+-------+
21 rows in set (0.00 sec)
mysql>
No hay comentarios:
Publicar un comentario