Asterisk 15 installation on Centos 7 and basic configuration of realtime

Preparation of the system.

Disabled SELinux

sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config

Dependencies

 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
 yum install -y kernel-devel kernel-headers
yum install -y e2fsprogs-devel  keyutils-libs-devel krb5-devel libogg \
libselinux-devel libsepol-devel libxml2-devel libtiff-devel gmp php-pear \
php php-gd php-mysql php-pdo php-mbstring ncurses-devel \
mysql-connector-odbc unixODBC unixODBC-devel \
audiofile-devel libogg-devel openssl-devel zlib-devel  \
perl-DateManip sox git wget net-tools psmisc
yum install -y gcc gcc-c++ make gnutls-devel \
libxml2-devel ncurses-devel subversion doxygen \
texinfo curl-devel net-snmp-devel neon-devel  \
uuid-devel libuuid-devel sqlite-devel sqlite \
speex-devel gsm-devel libtool libtool-ltdl libtool-ltdl-devel \
libsrtp libsrtp-devel xmlstarlet
Update
yum update -y
Reboot
 reboot

Installing MySQL (mariadb)

1: Install Mariadb (MySQL)

yum -y install mariadb-server mariadb mariadb-devel

2: Start and enable Mariadb (MySQL)

 systemctl start mariadb.service
 systemctl enable mariadb.service

3: Optional. Run the interactive configurator (You will be prompted for a root password and other)

mysql_secure_installation

Installing Asterisk

 cd /usr/src
 wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-15-current.tar.gz
 tar zxvf asterisk-15-current.tar.gz
 cd asterisk*
 contrib/scripts/get_mp3_source.sh
 contrib/scripts/install_prereq install
 ./configure --with-pjproject-bundled --with-crypto --with-ssl=ssl --with-srtp
 make menuselect

Set options as you need

In the screenshots, shown, the minimum installation of add-ons, codecs and channel drivers


Install

 make && make install && make config && ldconfig

At the end of the installation, install the required set of configs

 make basic-pbx

Нажмите, чтобы отобразить

Нажмите, чтобы скрыть

 +---- Asterisk Installation Complete -------+
 +                                           +
 +    YOU MUST READ THE SECURITY DOCUMENT    +
 +                                           +
 + Asterisk has successfully been installed. +
 + If you would like to install the sample   +
 + configuration files (overwriting any      +
 + existing config files), run:              +
 +                                           +
 + For generic reference documentation:      +
 +    make samples                           +
 +                                           +
 + For a sample basic PBX:                   +
 +    make basic-pbx                         +
 +                                           +
 +                                           +
 +-----------------  or ---------------------+
 +                                           +
 + You can go ahead and install the asterisk +
 + program documentation now or later run:   +
 +                                           +
 +               make progdocs               +
 +                                           +
 + **Note** This requires that you have      +
 + doxygen installed on your local system    +
 +-------------------------------------------+

Run an Asterisk on behalf of the same user

 sed -i 's/ASTARGS=""/ASTARGS="-U asterisk"/g'  /usr/sbin/safe_asterisk

Create an Asterisk user and change own

useradd -m asterisk &&
chown asterisk.asterisk /var/run/asterisk &&
chown -R asterisk.asterisk /etc/asterisk &&
chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk &&
chown -R asterisk.asterisk /usr/lib/asterisk

Let's check Asterisk

/etc/init.d/asterisk start
Starting asterisk (via systemctl):                         [  OK  ]
ps aux | grep asterisk
root       872  0.0  0.0 115300   780 ?        S    12:12   0:00 /bin/sh /usr/sbin/safe_asterisk
asterisk   881  2.4  0.9 1314384 36532 ?       Sl   12:12   0:01 /usr/sbin/asterisk -f -U asterisk -vvvg -c

If the prompt is:

 Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

just restart the sever and:

 asterisk -vvvr

Нажмите, чтобы отобразить

Нажмите, чтобы скрыть

# asterisk -vvvr
Asterisk 15.4.1, Copyright (C) 1999 - 2016, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 15.4.1 currently running on 4tototam (pid = 881)
asterisk*CLI>

Configuring ODBC

   yum install -y mysql-connector-odbc unixODBC unixODBC-devel

*for reference, was established during the preparation of the system.

Create a required databases and grant privileges

asteriskcdrdb
 mysqladmin -p create asteriskcdrdb
 mysql -p -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* to CDR_DB_USER@localhost identified by 'CDR_DB_PASSWORD';"
 mysql -p -e "FLUSH PRIVILEGES;"

asteriskcdrdb.cdr schema

asteriskcdrdb.cdr schema

CREATE TABLE cdr (
   calldate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
   clid VARCHAR(80) NOT NULL DEFAULT '',
   src VARCHAR(80) NOT NULL DEFAULT '',
   dst VARCHAR(80) NOT NULL DEFAULT '',
   dcontext VARCHAR(80) NOT NULL DEFAULT '',
   channel VARCHAR(80) NOT NULL DEFAULT '',
   dstchannel VARCHAR(80) NOT NULL DEFAULT '',
   lastapp VARCHAR(80) NOT NULL DEFAULT '',
   lastdata VARCHAR(80) NOT NULL DEFAULT '',
   duration INT(11) NOT NULL DEFAULT '0',
   billsec INT(11) NOT NULL DEFAULT '0',
   disposition VARCHAR(45) NOT NULL DEFAULT '',
   amaflags INT(11) NOT NULL DEFAULT '0',
   accountcode VARCHAR(20) NOT NULL DEFAULT '',
   uniqueid VARCHAR(32) NOT NULL DEFAULT '',
   userfield VARCHAR(255) NOT NULL DEFAULT '',
   did VARCHAR(50) NOT NULL DEFAULT '',
   recordingfile VARCHAR(255) NOT NULL DEFAULT '',
   KEY `calldate` (`calldate`),
   KEY `dst` (`dst`),
   KEY `accountcode` (`accountcode`),
   KEY `uniqueid` (`uniqueid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

If you have datetime error, visit pls: https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html

Problem keywords: sql-mode, NO_ZERO_DATE


realtimedb
 mysqladmin -p create realtimedb
 mysql -p -e "GRANT ALL PRIVILEGES ON realtimedb.* to RT_DB_USER@localhost identified by 'RT_DB_PASSWORD';"
 mysql -p -e "FLUSH PRIVILEGES;"

realtimedb SQL schema

realtimedb SQL schema

--
-- Table structure for table `admin`
--
 
CREATE TABLE `admin` (
  `user` VARCHAR(255) NOT NULL,
  `password_sha1` VARCHAR(64) NOT NULL,
  PRIMARY KEY (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `confbridge_ast_config`
--
 
CREATE TABLE `confbridge_ast_config` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `cat_metric` INT(11) NOT NULL DEFAULT '0',
  `var_metric` INT(11) NOT NULL DEFAULT '0',
  `commented` INT(11) NOT NULL DEFAULT '0',
  `filename` VARCHAR(128) NOT NULL DEFAULT '',
  `category` VARCHAR(128) NOT NULL DEFAULT 'default',
  `var_name` VARCHAR(128) NOT NULL DEFAULT '',
  `var_val` VARCHAR(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `filename_comment` (`filename`,`commented`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `dp_agents`
--
 
CREATE TABLE `dp_agents` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `context` VARCHAR(40) NOT NULL,
  `exten` VARCHAR(40) NOT NULL,
  `priority` INT(11) NOT NULL,
  `app` VARCHAR(40) NOT NULL,
  `appdata` VARCHAR(256) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `context` (`context`,`exten`,`priority`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `dp_external`
--
 
CREATE TABLE `dp_external` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `context` VARCHAR(40) NOT NULL,
  `exten` VARCHAR(40) NOT NULL,
  `priority` INT(11) NOT NULL,
  `app` VARCHAR(40) NOT NULL,
  `appdata` VARCHAR(256) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `context` (`context`,`exten`,`priority`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `dp_internal`
--
 
CREATE TABLE `dp_internal` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `context` VARCHAR(40) NOT NULL,
  `exten` VARCHAR(40) NOT NULL,
  `priority` INT(11) NOT NULL,
  `app` VARCHAR(40) NOT NULL,
  `appdata` VARCHAR(256) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `context` (`context`,`exten`,`priority`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `dp_living`
--
 
CREATE TABLE `ext_ast_config` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `cat_metric` INT(11) NOT NULL DEFAULT '0',
  `var_metric` INT(11) NOT NULL DEFAULT '0',
  `commented` INT(11) NOT NULL DEFAULT '0',
  `filename` VARCHAR(128) NOT NULL DEFAULT '',
  `category` VARCHAR(128) NOT NULL DEFAULT 'default',
  `var_name` VARCHAR(128) NOT NULL DEFAULT '',
  `var_val` VARCHAR(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `filename_comment` (`filename`,`commented`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `feat_ast_config`
--
 
CREATE TABLE `feat_ast_config` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `cat_metric` INT(11) NOT NULL DEFAULT '0',
  `var_metric` INT(11) NOT NULL DEFAULT '0',
  `commented` INT(11) NOT NULL DEFAULT '0',
  `filename` VARCHAR(128) NOT NULL DEFAULT '',
  `category` VARCHAR(128) NOT NULL DEFAULT 'default',
  `var_name` VARCHAR(128) NOT NULL DEFAULT '',
  `var_val` VARCHAR(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `filename_comment` (`filename`,`commented`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `follow_ast_config`
--
 
CREATE TABLE `follow_ast_config` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `cat_metric` INT(11) NOT NULL DEFAULT '0',
  `var_metric` INT(11) NOT NULL DEFAULT '0',
  `commented` INT(11) NOT NULL DEFAULT '0',
  `filename` VARCHAR(128) NOT NULL DEFAULT '',
  `category` VARCHAR(128) NOT NULL DEFAULT 'default',
  `var_name` VARCHAR(128) NOT NULL DEFAULT '',
  `var_val` VARCHAR(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `filename_comment` (`filename`,`commented`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `iaxfriends`
--
 
CREATE TABLE `iaxfriends` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(40) NOT NULL,
  `type` enum('friend','user','peer') DEFAULT NULL,
  `username` VARCHAR(40) DEFAULT NULL,
  `mailbox` VARCHAR(40) DEFAULT NULL,
  `secret` VARCHAR(40) DEFAULT NULL,
  `dbsecret` VARCHAR(40) DEFAULT NULL,
  `context` VARCHAR(40) DEFAULT NULL,
  `regcontext` VARCHAR(40) DEFAULT NULL,
  `host` VARCHAR(40) DEFAULT NULL,
  `ipaddr` VARCHAR(40) DEFAULT NULL,
  `port` INT(11) DEFAULT NULL,
  `defaultip` VARCHAR(20) DEFAULT NULL,
  `sourceaddress` VARCHAR(20) DEFAULT NULL,
  `mask` VARCHAR(20) DEFAULT NULL,
  `regexten` VARCHAR(40) DEFAULT NULL,
  `regseconds` INT(11) DEFAULT NULL,
  `accountcode` VARCHAR(80) DEFAULT NULL,
  `mohinterpret` VARCHAR(20) DEFAULT NULL,
  `mohsuggest` VARCHAR(20) DEFAULT NULL,
  `inkeys` VARCHAR(40) DEFAULT NULL,
  `outkeys` VARCHAR(40) DEFAULT NULL,
  `language` VARCHAR(10) DEFAULT NULL,
  `callerid` VARCHAR(100) DEFAULT NULL,
  `cid_number` VARCHAR(40) DEFAULT NULL,
  `sendani` enum('yes','no') DEFAULT NULL,
  `fullname` VARCHAR(40) DEFAULT NULL,
  `trunk` enum('yes','no') DEFAULT NULL,
  `auth` VARCHAR(20) DEFAULT NULL,
  `maxauthreq` INT(11) DEFAULT NULL,
  `requirecalltoken` enum('yes','no','auto') DEFAULT NULL,
  `encryption` enum('yes','no','aes128') DEFAULT NULL,
  `transfer` enum('yes','no','mediaonly') DEFAULT NULL,
  `jitterbuffer` enum('yes','no') DEFAULT NULL,
  `forcejitterbuffer` enum('yes','no') DEFAULT NULL,
  `disallow` VARCHAR(200) DEFAULT NULL,
  `allow` VARCHAR(200) DEFAULT NULL,
  `codecpriority` VARCHAR(40) DEFAULT NULL,
  `qualify` VARCHAR(10) DEFAULT NULL,
  `qualifysmoothing` enum('yes','no') DEFAULT NULL,
  `qualifyfreqok` VARCHAR(10) DEFAULT NULL,
  `qualifyfreqnotok` VARCHAR(10) DEFAULT NULL,
  `timezone` VARCHAR(20) DEFAULT NULL,
  `adsi` enum('yes','no') DEFAULT NULL,
  `amaflags` VARCHAR(20) DEFAULT NULL,
  `setvar` VARCHAR(200) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  KEY `iaxfriends_name` (`name`),
  KEY `iaxfriends_name_host` (`name`,`host`),
  KEY `iaxfriends_name_ipaddr_port` (`name`,`ipaddr`,`port`),
  KEY `iaxfriends_ipaddr_port` (`ipaddr`,`port`),
  KEY `iaxfriends_host_port` (`host`,`port`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `meetme`
--
 
CREATE TABLE `meetme` (
  `bookid` INT(11) NOT NULL AUTO_INCREMENT,
  `confno` VARCHAR(80) NOT NULL,
  `starttime` datetime DEFAULT NULL,
  `endtime` datetime DEFAULT NULL,
  `pin` VARCHAR(20) DEFAULT NULL,
  `adminpin` VARCHAR(20) DEFAULT NULL,
  `opts` VARCHAR(20) DEFAULT NULL,
  `adminopts` VARCHAR(20) DEFAULT NULL,
  `recordingfilename` VARCHAR(80) DEFAULT NULL,
  `recordingformat` VARCHAR(10) DEFAULT NULL,
  `maxusers` INT(11) DEFAULT NULL,
  `members` INT(11) NOT NULL,
  PRIMARY KEY (`bookid`),
  KEY `meetme_confno_start_end` (`confno`,`starttime`,`endtime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `musiconhold`
--
 
CREATE TABLE `musiconhold` (
  `name` VARCHAR(80) NOT NULL,
  `mode` enum('custom','files','mp3nb','quietmp3nb','quietmp3') DEFAULT NULL,
  `directory` VARCHAR(255) DEFAULT NULL,
  `application` VARCHAR(255) DEFAULT NULL,
  `digit` VARCHAR(1) DEFAULT NULL,
  `sort` VARCHAR(10) DEFAULT NULL,
  `format` VARCHAR(10) DEFAULT NULL,
  `stamp` datetime DEFAULT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_aors`
--
 
CREATE TABLE `ps_aors` (
  `id` VARCHAR(40) NOT NULL,
  `contact` VARCHAR(255) DEFAULT NULL,
  `default_expiration` INT(11) DEFAULT NULL,
  `mailboxes` VARCHAR(80) DEFAULT NULL,
  `max_contacts` INT(11) DEFAULT NULL,
  `minimum_expiration` INT(11) DEFAULT NULL,
  `remove_existing` enum('yes','no') DEFAULT NULL,
  `qualify_frequency` INT(11) DEFAULT NULL,
  `authenticate_qualify` enum('yes','no') DEFAULT NULL,
  `maximum_expiration` INT(11) DEFAULT NULL,
  `outbound_proxy` VARCHAR(40) DEFAULT NULL,
  `support_path` enum('yes','no') DEFAULT NULL,
  `qualify_timeout` FLOAT DEFAULT NULL,
  `voicemail_extension` VARCHAR(40) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_aors_id` (`id`),
  KEY `ps_aors_qualifyfreq_contact` (`qualify_frequency`,`contact`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_auths`
--
 
CREATE TABLE `ps_auths` (
  `id` VARCHAR(40) NOT NULL,
  `auth_type` enum('md5','userpass') DEFAULT NULL,
  `nonce_lifetime` INT(11) DEFAULT NULL,
  `md5_cred` VARCHAR(40) DEFAULT NULL,
  `password` VARCHAR(80) DEFAULT NULL,
  `realm` VARCHAR(40) DEFAULT NULL,
  `username` VARCHAR(40) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_auths_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_contacts`
--
 
CREATE TABLE `ps_contacts` (
  `id` VARCHAR(255) DEFAULT NULL,
  `uri` VARCHAR(255) DEFAULT NULL,
  `expiration_time` BIGINT(20) DEFAULT NULL,
  `qualify_frequency` INT(11) DEFAULT NULL,
  `outbound_proxy` VARCHAR(40) DEFAULT NULL,
  `path` text,
  `user_agent` VARCHAR(255) DEFAULT NULL,
  `qualify_timeout` FLOAT DEFAULT NULL,
  `reg_server` VARCHAR(20) DEFAULT NULL,
  `authenticate_qualify` enum('yes','no') DEFAULT NULL,
  `via_addr` VARCHAR(40) DEFAULT NULL,
  `via_port` INT(11) DEFAULT NULL,
  `call_id` VARCHAR(255) DEFAULT NULL,
  `endpoint` VARCHAR(40) DEFAULT NULL,
  `prune_on_boot` enum('yes','no') DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `ps_contacts_uq` (`id`,`reg_server`),
  KEY `ps_contacts_id` (`id`),
  KEY `ps_contacts_qualifyfreq_exp` (`qualify_frequency`,`expiration_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_domain_aliases`
--
 
CREATE TABLE `ps_domain_aliases` (
  `id` VARCHAR(40) NOT NULL,
  `domain` VARCHAR(80) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_domain_aliases_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_endpoint_id_ips`
--
 
CREATE TABLE `ps_endpoint_id_ips` (
  `id` VARCHAR(40) NOT NULL,
  `endpoint` VARCHAR(40) DEFAULT NULL,
  `match` VARCHAR(80) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_endpoint_id_ips_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_endpoints`
--
 
CREATE TABLE `ps_endpoints` (
  `id` VARCHAR(40) NOT NULL,
  `transport` VARCHAR(40) DEFAULT NULL,
  `aors` VARCHAR(200) DEFAULT NULL,
  `auth` VARCHAR(40) DEFAULT NULL,
  `context` VARCHAR(40) DEFAULT NULL,
  `disallow` VARCHAR(200) DEFAULT NULL,
  `allow` VARCHAR(200) DEFAULT NULL,
  `direct_media` enum('yes','no') DEFAULT NULL,
  `connected_line_method` enum('invite','reinvite','update') DEFAULT NULL,
  `direct_media_method` enum('invite','reinvite','update') DEFAULT NULL,
  `direct_media_glare_mitigation` enum('none','outgoing','incoming') DEFAULT NULL,
  `disable_direct_media_on_nat` enum('yes','no') DEFAULT NULL,
  `dtmf_mode` enum('rfc4733','inband','info','auto') DEFAULT NULL,
  `external_media_address` VARCHAR(40) DEFAULT NULL,
  `force_rport` enum('yes','no') DEFAULT NULL,
  `ice_support` enum('yes','no') DEFAULT NULL,
  `identify_by` enum('username','auth_username') DEFAULT NULL,
  `mailboxes` VARCHAR(40) DEFAULT NULL,
  `moh_suggest` VARCHAR(40) DEFAULT NULL,
  `outbound_auth` VARCHAR(40) DEFAULT NULL,
  `outbound_proxy` VARCHAR(40) DEFAULT NULL,
  `rewrite_contact` enum('yes','no') DEFAULT NULL,
  `rtp_ipv6` enum('yes','no') DEFAULT NULL,
  `rtp_symmetric` enum('yes','no') DEFAULT NULL,
  `send_diversion` enum('yes','no') DEFAULT NULL,
  `send_pai` enum('yes','no') DEFAULT NULL,
  `send_rpid` enum('yes','no') DEFAULT NULL,
  `timers_min_se` INT(11) DEFAULT NULL,
  `timers` enum('forced','no','required','yes') DEFAULT NULL,
  `timers_sess_expires` INT(11) DEFAULT NULL,
  `callerid` VARCHAR(40) DEFAULT NULL,
  `callerid_privacy` enum('allowed_not_screened','allowed_passed_screened','allowed_failed_screened','allowed','prohib_not_screened','prohib_passed_screened','prohib_failed_screened','prohib','unavailable') DEFAULT NULL,
  `callerid_tag` VARCHAR(40) DEFAULT NULL,
  `100rel` enum('no','required','yes') DEFAULT NULL,
  `aggregate_mwi` enum('yes','no') DEFAULT NULL,
  `trust_id_inbound` enum('yes','no') DEFAULT NULL,
  `trust_id_outbound` enum('yes','no') DEFAULT NULL,
  `use_ptime` enum('yes','no') DEFAULT NULL,
  `use_avpf` enum('yes','no') DEFAULT NULL,
  `media_encryption` enum('no','sdes','dtls') DEFAULT NULL,
  `inband_progress` enum('yes','no') DEFAULT NULL,
  `call_group` VARCHAR(40) DEFAULT NULL,
  `pickup_group` VARCHAR(40) DEFAULT NULL,
  `named_call_group` VARCHAR(40) DEFAULT NULL,
  `named_pickup_group` VARCHAR(40) DEFAULT NULL,
  `device_state_busy_at` INT(11) DEFAULT NULL,
  `fax_detect` enum('yes','no') DEFAULT NULL,
  `t38_udptl` enum('yes','no') DEFAULT NULL,
  `t38_udptl_ec` enum('none','fec','redundancy') DEFAULT NULL,
  `t38_udptl_maxdatagram` INT(11) DEFAULT NULL,
  `t38_udptl_nat` enum('yes','no') DEFAULT NULL,
  `t38_udptl_ipv6` enum('yes','no') DEFAULT NULL,
  `tone_zone` VARCHAR(40) DEFAULT NULL,
  `language` VARCHAR(40) DEFAULT NULL,
  `one_touch_recording` enum('yes','no') DEFAULT NULL,
  `record_on_feature` VARCHAR(40) DEFAULT NULL,
  `record_off_feature` VARCHAR(40) DEFAULT NULL,
  `rtp_engine` VARCHAR(40) DEFAULT NULL,
  `allow_transfer` enum('yes','no') DEFAULT NULL,
  `allow_subscribe` enum('yes','no') DEFAULT NULL,
  `sdp_owner` VARCHAR(40) DEFAULT NULL,
  `sdp_session` VARCHAR(40) DEFAULT NULL,
  `tos_audio` VARCHAR(10) DEFAULT NULL,
  `tos_video` VARCHAR(10) DEFAULT NULL,
  `sub_min_expiry` INT(11) DEFAULT NULL,
  `from_domain` VARCHAR(40) DEFAULT NULL,
  `from_user` VARCHAR(40) DEFAULT NULL,
  `mwi_from_user` VARCHAR(40) DEFAULT NULL,
  `dtls_verify` VARCHAR(40) DEFAULT NULL,
  `dtls_rekey` VARCHAR(40) DEFAULT NULL,
  `dtls_cert_file` VARCHAR(200) DEFAULT NULL,
  `dtls_private_key` VARCHAR(200) DEFAULT NULL,
  `dtls_cipher` VARCHAR(200) DEFAULT NULL,
  `dtls_ca_file` VARCHAR(200) DEFAULT NULL,
  `dtls_ca_path` VARCHAR(200) DEFAULT NULL,
  `dtls_setup` enum('active','passive','actpass') DEFAULT NULL,
  `srtp_tag_32` enum('yes','no') DEFAULT NULL,
  `media_address` VARCHAR(40) DEFAULT NULL,
  `redirect_method` enum('user','uri_core','uri_pjsip') DEFAULT NULL,
  `set_var` text,
  `cos_audio` INT(11) DEFAULT NULL,
  `cos_video` INT(11) DEFAULT NULL,
  `message_context` VARCHAR(40) DEFAULT NULL,
  `force_avp` enum('yes','no') DEFAULT NULL,
  `media_use_received_transport` enum('yes','no') DEFAULT NULL,
  `accountcode` VARCHAR(80) DEFAULT NULL,
  `user_eq_phone` enum('yes','no') DEFAULT NULL,
  `moh_passthrough` enum('yes','no') DEFAULT NULL,
  `media_encryption_optimistic` enum('yes','no') DEFAULT NULL,
  `rpid_immediate` enum('yes','no') DEFAULT NULL,
  `g726_non_standard` enum('yes','no') DEFAULT NULL,
  `rtp_keepalive` INT(11) DEFAULT NULL,
  `rtp_timeout` INT(11) DEFAULT NULL,
  `rtp_timeout_hold` INT(11) DEFAULT NULL,
  `bind_rtp_to_media_address` enum('yes','no') DEFAULT NULL,
  `voicemail_extension` VARCHAR(40) DEFAULT NULL,
  `mwi_subscribe_replaces_unsolicited` INT(11) DEFAULT NULL,
  `deny` VARCHAR(95) DEFAULT NULL,
  `permit` VARCHAR(95) DEFAULT NULL,
  `acl` VARCHAR(40) DEFAULT NULL,
  `contact_deny` VARCHAR(95) DEFAULT NULL,
  `contact_permit` VARCHAR(95) DEFAULT NULL,
  `contact_acl` VARCHAR(40) DEFAULT NULL,
  `subscribe_context` VARCHAR(40) DEFAULT NULL,
  `fax_detect_timeout` INT(11) DEFAULT NULL,
  `contact_user` VARCHAR(80) DEFAULT NULL,
  `asymmetric_rtp_codec` enum('yes','no') DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_endpoints_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_globals`
--
 
CREATE TABLE `ps_globals` (
  `id` VARCHAR(40) NOT NULL,
  `max_forwards` INT(11) DEFAULT NULL,
  `user_agent` VARCHAR(255) DEFAULT NULL,
  `default_outbound_endpoint` VARCHAR(40) DEFAULT NULL,
  `debug` VARCHAR(40) DEFAULT NULL,
  `endpoint_identifier_order` VARCHAR(40) DEFAULT NULL,
  `max_initial_qualify_time` INT(11) DEFAULT NULL,
  `default_from_user` VARCHAR(80) DEFAULT NULL,
  `keep_alive_interval` INT(11) DEFAULT NULL,
  `regcontext` VARCHAR(80) DEFAULT NULL,
  `contact_expiration_check_interval` INT(11) DEFAULT NULL,
  `default_voicemail_extension` VARCHAR(40) DEFAULT NULL,
  `disable_multi_domain` enum('yes','no') DEFAULT NULL,
  `unidentified_request_count` INT(11) DEFAULT NULL,
  `unidentified_request_period` INT(11) DEFAULT NULL,
  `unidentified_request_prune_interval` INT(11) DEFAULT NULL,
  `default_realm` VARCHAR(40) DEFAULT NULL,
  `mwi_tps_queue_high` INT(11) DEFAULT NULL,
  `mwi_tps_queue_low` INT(11) DEFAULT NULL,
  `mwi_disable_initial_unsolicited` enum('yes','no') DEFAULT NULL,
  `ignore_uri_user_options` enum('yes','no') DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_globals_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_registrations`
--
 
CREATE TABLE `ps_registrations` (
  `id` VARCHAR(40) NOT NULL,
  `auth_rejection_permanent` enum('yes','no') DEFAULT NULL,
  `client_uri` VARCHAR(255) DEFAULT NULL,
  `contact_user` VARCHAR(40) DEFAULT NULL,
  `expiration` INT(11) DEFAULT NULL,
  `max_retries` INT(11) DEFAULT NULL,
  `outbound_auth` VARCHAR(40) DEFAULT NULL,
  `outbound_proxy` VARCHAR(40) DEFAULT NULL,
  `retry_interval` INT(11) DEFAULT NULL,
  `forbidden_retry_interval` INT(11) DEFAULT NULL,
  `server_uri` VARCHAR(255) DEFAULT NULL,
  `transport` VARCHAR(40) DEFAULT NULL,
  `support_path` enum('yes','no') DEFAULT NULL,
  `fatal_retry_interval` INT(11) DEFAULT NULL,
  `line` enum('yes','no') DEFAULT NULL,
  `endpoint` VARCHAR(40) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_registrations_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_subscription_persistence`
--
 
CREATE TABLE `ps_subscription_persistence` (
  `id` VARCHAR(40) NOT NULL,
  `packet` VARCHAR(2048) DEFAULT NULL,
  `src_name` VARCHAR(128) DEFAULT NULL,
  `src_port` INT(11) DEFAULT NULL,
  `transport_key` VARCHAR(64) DEFAULT NULL,
  `local_name` VARCHAR(128) DEFAULT NULL,
  `local_port` INT(11) DEFAULT NULL,
  `cseq` INT(11) DEFAULT NULL,
  `tag` VARCHAR(128) DEFAULT NULL,
  `endpoint` VARCHAR(40) DEFAULT NULL,
  `expires` INT(11) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_subscription_persistence_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_systems`
--
 
CREATE TABLE `ps_systems` (
  `id` VARCHAR(40) NOT NULL,
  `timer_t1` INT(11) DEFAULT NULL,
  `timer_b` INT(11) DEFAULT NULL,
  `compact_headers` enum('yes','no') DEFAULT NULL,
  `threadpool_initial_size` INT(11) DEFAULT NULL,
  `threadpool_auto_increment` INT(11) DEFAULT NULL,
  `threadpool_idle_timeout` INT(11) DEFAULT NULL,
  `threadpool_max_size` INT(11) DEFAULT NULL,
  `disable_tcp_switch` enum('yes','no') DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_systems_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `ps_transports`
--
 
CREATE TABLE `ps_transports` (
  `id` VARCHAR(40) NOT NULL,
  `async_operations` INT(11) DEFAULT NULL,
  `bind` VARCHAR(40) DEFAULT NULL,
  `ca_list_file` VARCHAR(200) DEFAULT NULL,
  `cert_file` VARCHAR(200) DEFAULT NULL,
  `cipher` VARCHAR(200) DEFAULT NULL,
  `domain` VARCHAR(40) DEFAULT NULL,
  `external_media_address` VARCHAR(40) DEFAULT NULL,
  `external_signaling_address` VARCHAR(40) DEFAULT NULL,
  `external_signaling_port` INT(11) DEFAULT NULL,
  `method` enum('default','unspecified','tlsv1','sslv2','sslv3','sslv23') DEFAULT NULL,
  `local_net` VARCHAR(40) DEFAULT NULL,
  `password` VARCHAR(40) DEFAULT NULL,
  `priv_key_file` VARCHAR(200) DEFAULT NULL,
  `protocol` enum('udp','tcp','tls','ws','wss') DEFAULT NULL,
  `require_client_cert` enum('yes','no') DEFAULT NULL,
  `verify_client` enum('yes','no') DEFAULT NULL,
  `verify_server` enum('yes','no') DEFAULT NULL,
  `tos` VARCHAR(10) DEFAULT NULL,
  `cos` INT(11) DEFAULT NULL,
  `allow_reload` enum('yes','no') DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_transports_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `queue_members`
--
 
CREATE TABLE `queue_members` (
  `queue_name` VARCHAR(80) NOT NULL,
  `interface` VARCHAR(80) NOT NULL,
  `membername` VARCHAR(80) DEFAULT NULL,
  `state_interface` VARCHAR(80) DEFAULT NULL,
  `penalty` INT(11) DEFAULT NULL,
  `paused` INT(11) DEFAULT NULL,
  `uniqueid` INT(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`queue_name`,`interface`),
  UNIQUE KEY `uniqueid` (`uniqueid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `queue_rules`
--
 
CREATE TABLE `queue_rules` (
  `rule_name` VARCHAR(80) NOT NULL,
  `time` VARCHAR(32) NOT NULL,
  `min_penalty` VARCHAR(32) NOT NULL,
  `max_penalty` VARCHAR(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `queues`
--
 
CREATE TABLE `queues` (
  `name` VARCHAR(128) NOT NULL,
  `musiconhold` VARCHAR(128) DEFAULT NULL,
  `announce` VARCHAR(128) DEFAULT NULL,
  `context` VARCHAR(128) DEFAULT NULL,
  `timeout` INT(11) DEFAULT NULL,
  `ringinuse` enum('yes','no') DEFAULT NULL,
  `setinterfacevar` enum('yes','no') DEFAULT NULL,
  `setqueuevar` enum('yes','no') DEFAULT NULL,
  `setqueueentryvar` enum('yes','no') DEFAULT NULL,
  `monitor_format` VARCHAR(8) DEFAULT NULL,
  `membermacro` VARCHAR(512) DEFAULT NULL,
  `membergosub` VARCHAR(512) DEFAULT NULL,
  `queue_youarenext` VARCHAR(128) DEFAULT NULL,
  `queue_thereare` VARCHAR(128) DEFAULT NULL,
  `queue_callswaiting` VARCHAR(128) DEFAULT NULL,
  `queue_quantity1` VARCHAR(128) DEFAULT NULL,
  `queue_quantity2` VARCHAR(128) DEFAULT NULL,
  `queue_holdtime` VARCHAR(128) DEFAULT NULL,
  `queue_minutes` VARCHAR(128) DEFAULT NULL,
  `queue_minute` VARCHAR(128) DEFAULT NULL,
  `queue_seconds` VARCHAR(128) DEFAULT NULL,
  `queue_thankyou` VARCHAR(128) DEFAULT NULL,
  `queue_callerannounce` VARCHAR(128) DEFAULT NULL,
  `queue_reporthold` VARCHAR(128) DEFAULT NULL,
  `announce_frequency` INT(11) DEFAULT NULL,
  `announce_to_first_user` enum('yes','no') DEFAULT NULL,
  `min_announce_frequency` INT(11) DEFAULT NULL,
  `announce_round_seconds` INT(11) DEFAULT NULL,
  `announce_holdtime` VARCHAR(128) DEFAULT NULL,
  `announce_position` VARCHAR(128) DEFAULT NULL,
  `announce_position_limit` INT(11) DEFAULT NULL,
  `periodic_announce` VARCHAR(50) DEFAULT NULL,
  `periodic_announce_frequency` INT(11) DEFAULT NULL,
  `relative_periodic_announce` enum('yes','no') DEFAULT NULL,
  `random_periodic_announce` enum('yes','no') DEFAULT NULL,
  `retry` INT(11) DEFAULT NULL,
  `wrapuptime` INT(11) DEFAULT NULL,
  `penaltymemberslimit` INT(11) DEFAULT NULL,
  `autofill` enum('yes','no') DEFAULT NULL,
  `monitor_type` VARCHAR(128) DEFAULT NULL,
  `autopause` enum('yes','no','all') DEFAULT NULL,
  `autopausedelay` INT(11) DEFAULT NULL,
  `autopausebusy` enum('yes','no') DEFAULT NULL,
  `autopauseunavail` enum('yes','no') DEFAULT NULL,
  `maxlen` INT(11) DEFAULT NULL,
  `servicelevel` INT(11) DEFAULT NULL,
  `strategy` enum('ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered') DEFAULT NULL,
  `joinempty` VARCHAR(128) DEFAULT NULL,
  `leavewhenempty` VARCHAR(128) DEFAULT NULL,
  `reportholdtime` enum('yes','no') DEFAULT NULL,
  `memberdelay` INT(11) DEFAULT NULL,
  `weight` INT(11) DEFAULT NULL,
  `timeoutrestart` enum('yes','no') DEFAULT NULL,
  `defaultrule` VARCHAR(128) DEFAULT NULL,
  `timeoutpriority` VARCHAR(128) DEFAULT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `sip_ast_config`
--
 
CREATE TABLE `sip_ast_config` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `cat_metric` INT(11) NOT NULL DEFAULT '0',
  `var_metric` INT(11) NOT NULL DEFAULT '0',
  `commented` INT(11) NOT NULL DEFAULT '0',
  `filename` VARCHAR(128) NOT NULL DEFAULT '',
  `category` VARCHAR(128) NOT NULL DEFAULT 'default',
  `var_name` VARCHAR(128) NOT NULL DEFAULT '',
  `var_val` VARCHAR(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `filename_comment` (`filename`,`commented`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `sippeers`
--
 
CREATE TABLE `sippeers` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(40) NOT NULL,
  `ipaddr` VARCHAR(45) DEFAULT NULL,
  `port` INT(11) DEFAULT NULL,
  `regseconds` INT(11) DEFAULT NULL,
  `defaultuser` VARCHAR(40) DEFAULT NULL,
  `fullcontact` VARCHAR(80) DEFAULT NULL,
  `regserver` VARCHAR(20) DEFAULT NULL,
  `useragent` VARCHAR(255) DEFAULT NULL,
  `lastms` INT(11) DEFAULT NULL,
  `host` VARCHAR(40) DEFAULT NULL,
  `type` enum('friend','user','peer') DEFAULT NULL,
  `context` VARCHAR(40) DEFAULT NULL,
  `permit` VARCHAR(95) DEFAULT NULL,
  `deny` VARCHAR(95) DEFAULT NULL,
  `secret` VARCHAR(40) DEFAULT NULL,
  `md5secret` VARCHAR(40) DEFAULT NULL,
  `remotesecret` VARCHAR(40) DEFAULT NULL,
  `transport` enum('udp','tcp','tls','ws','wss','udp,tcp','tcp,udp') DEFAULT NULL,
  `encryption` VARCHAR(128) DEFAULT NULL,
  `dtmfmode` enum('rfc2833','info','shortinfo','inband','auto') DEFAULT NULL,
  `directmedia` enum('yes','no','nonat','update','outgoing') DEFAULT NULL,
  `nat` VARCHAR(29) DEFAULT NULL,
  `callgroup` VARCHAR(40) DEFAULT NULL,
  `pickupgroup` VARCHAR(40) DEFAULT NULL,
  `language` VARCHAR(40) DEFAULT NULL,
  `disallow` VARCHAR(200) DEFAULT NULL,
  `allow` VARCHAR(200) DEFAULT NULL,
  `insecure` VARCHAR(40) DEFAULT NULL,
  `trustrpid` enum('yes','no') DEFAULT NULL,
  `progressinband` enum('yes','no','never') DEFAULT NULL,
  `promiscredir` enum('yes','no') DEFAULT NULL,
  `useclientcode` enum('yes','no') DEFAULT NULL,
  `accountcode` VARCHAR(80) DEFAULT NULL,
  `setvar` VARCHAR(200) DEFAULT NULL,
  `callerid` VARCHAR(40) DEFAULT NULL,
  `amaflags` VARCHAR(40) DEFAULT NULL,
  `callcounter` enum('yes','no') DEFAULT NULL,
  `busylevel` INT(11) DEFAULT NULL,
  `allowoverlap` enum('yes','no') DEFAULT NULL,
  `allowsubscribe` enum('yes','no') DEFAULT NULL,
  `videosupport` enum('yes','no') DEFAULT NULL,
  `maxcallbitrate` INT(11) DEFAULT NULL,
  `rfc2833compensate` enum('yes','no') DEFAULT NULL,
  `mailbox` VARCHAR(40) DEFAULT NULL,
  `session-timers` enum('accept','refuse','originate') DEFAULT NULL,
  `session-expires` INT(11) DEFAULT NULL,
  `session-minse` INT(11) DEFAULT NULL,
  `session-refresher` enum('uac','uas') DEFAULT NULL,
  `t38pt_usertpsource` VARCHAR(40) DEFAULT NULL,
  `regexten` VARCHAR(40) DEFAULT NULL,
  `fromdomain` VARCHAR(40) DEFAULT NULL,
  `fromuser` VARCHAR(40) DEFAULT NULL,
  `qualify` VARCHAR(40) DEFAULT NULL,
  `defaultip` VARCHAR(45) DEFAULT NULL,
  `rtptimeout` INT(11) DEFAULT NULL,
  `rtpholdtimeout` INT(11) DEFAULT NULL,
  `sendrpid` enum('yes','no') DEFAULT NULL,
  `outboundproxy` VARCHAR(40) DEFAULT NULL,
  `callbackextension` VARCHAR(40) DEFAULT NULL,
  `timert1` INT(11) DEFAULT NULL,
  `timerb` INT(11) DEFAULT NULL,
  `qualifyfreq` INT(11) DEFAULT NULL,
  `constantssrc` enum('yes','no') DEFAULT NULL,
  `contactpermit` VARCHAR(95) DEFAULT NULL,
  `contactdeny` VARCHAR(95) DEFAULT NULL,
  `usereqphone` enum('yes','no') DEFAULT NULL,
  `textsupport` enum('yes','no') DEFAULT NULL,
  `faxdetect` enum('yes','no') DEFAULT NULL,
  `buggymwi` enum('yes','no') DEFAULT NULL,
  `auth` VARCHAR(40) DEFAULT NULL,
  `fullname` VARCHAR(40) DEFAULT NULL,
  `trunkname` VARCHAR(40) DEFAULT NULL,
  `cid_number` VARCHAR(40) DEFAULT NULL,
  `callingpres` enum('allowed_not_screened','allowed_passed_screen','allowed_failed_screen','allowed','prohib_not_screened','prohib_passed_screen','prohib_failed_screen','prohib') DEFAULT NULL,
  `canreinvite` VARCHAR(15) DEFAULT NULL,
  `mohinterpret` VARCHAR(40) DEFAULT NULL,
  `mohsuggest` VARCHAR(40) DEFAULT NULL,
  `parkinglot` VARCHAR(40) DEFAULT NULL,
  `hasvoicemail` enum('yes','no') DEFAULT NULL,
  `subscribemwi` enum('yes','no') DEFAULT NULL,
  `vmexten` VARCHAR(40) DEFAULT NULL,
  `autoframing` enum('yes','no') DEFAULT NULL,
  `rtpkeepalive` INT(11) DEFAULT NULL,
  `call-limit` INT(11) DEFAULT NULL,
  `g726nonstandard` enum('yes','no') DEFAULT NULL,
  `ignoresdpversion` enum('yes','no') DEFAULT NULL,
  `allowtransfer` enum('yes','no') DEFAULT NULL,
  `dynamic` enum('yes','no') DEFAULT NULL,
  `path` VARCHAR(256) DEFAULT NULL,
  `supportpath` enum('yes','no') DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  KEY `sippeers_name` (`name`),
  KEY `sippeers_name_host` (`name`,`host`),
  KEY `sippeers_ipaddr_port` (`ipaddr`,`port`),
  KEY `sippeers_host_port` (`host`,`port`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `vm_ast_config`
--
 
CREATE TABLE `vm_ast_config` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `cat_metric` INT(11) NOT NULL DEFAULT '0',
  `var_metric` INT(11) NOT NULL DEFAULT '0',
  `commented` INT(11) NOT NULL DEFAULT '0',
  `filename` VARCHAR(128) NOT NULL DEFAULT '',
  `category` VARCHAR(128) NOT NULL DEFAULT 'default',
  `var_name` VARCHAR(128) NOT NULL DEFAULT '',
  `var_val` VARCHAR(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `filename_comment` (`filename`,`commented`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
--
-- Table structure for table `voicemail`
--
 
CREATE TABLE `voicemail` (
  `uniqueid` INT(11) NOT NULL AUTO_INCREMENT,
  `context` VARCHAR(80) NOT NULL,
  `mailbox` VARCHAR(80) NOT NULL,
  `password` VARCHAR(80) NOT NULL,
  `fullname` VARCHAR(80) DEFAULT NULL,
  `alias` VARCHAR(80) DEFAULT NULL,
  `email` VARCHAR(80) DEFAULT NULL,
  `pager` VARCHAR(80) DEFAULT NULL,
  `attach` enum('yes','no') DEFAULT NULL,
  `attachfmt` VARCHAR(10) DEFAULT NULL,
  `serveremail` VARCHAR(80) DEFAULT NULL,
  `language` VARCHAR(20) DEFAULT NULL,
  `tz` VARCHAR(30) DEFAULT NULL,
  `deletevoicemail` enum('yes','no') DEFAULT NULL,
  `saycid` enum('yes','no') DEFAULT NULL,
  `sendvoicemail` enum('yes','no') DEFAULT NULL,
  `review` enum('yes','no') DEFAULT NULL,
  `tempgreetwarn` enum('yes','no') DEFAULT NULL,
  `operator` enum('yes','no') DEFAULT NULL,
  `envelope` enum('yes','no') DEFAULT NULL,
  `sayduration` INT(11) DEFAULT NULL,
  `forcename` enum('yes','no') DEFAULT NULL,
  `forcegreetings` enum('yes','no') DEFAULT NULL,
  `callback` VARCHAR(80) DEFAULT NULL,
  `dialout` VARCHAR(80) DEFAULT NULL,
  `exitcontext` VARCHAR(80) DEFAULT NULL,
  `maxmsg` INT(11) DEFAULT NULL,
  `volgain` DECIMAL(5,2) DEFAULT NULL,
  `imapuser` VARCHAR(80) DEFAULT NULL,
  `imappassword` VARCHAR(80) DEFAULT NULL,
  `imapserver` VARCHAR(80) DEFAULT NULL,
  `imapport` VARCHAR(8) DEFAULT NULL,
  `imapflags` VARCHAR(80) DEFAULT NULL,
  `stamp` datetime DEFAULT NULL,
  PRIMARY KEY (`uniqueid`),
  KEY `voicemail_mailbox` (`mailbox`),
  KEY `voicemail_context` (`context`),
  KEY `voicemail_mailbox_context` (`mailbox`,`context`),
  KEY `voicemail_imapuser` (`imapuser`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Where CDR_DB_USER, RT_DB_USER and CDR_DB_PASSWORD, RT_DB_PASSWORD It's YOUR data.

insert into the odbc.ini file (create, if it does not exist)

cat >> /etc/odbc.ini << EOF
[MySQL-asteriskcdrdb]
Description=MySQL connection to 'asteriskcdrdb' database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/lib/mysql/mysql.sock
option=3
 
EOF

and

cat >> /etc/odbc.ini << EOF
[MySQL-realtimedb]
Description=MySQL connection to 'realtimedb' database
driver=MySQL
server=localhost
database=realtimedb
Port=3306
Socket=/var/lib/mysql/mysql.sock
option=3
 
EOF

Reference. What is the correct location of mysql.sock file on linux?

# mysql -e -p "show variables like 'socket';"
+---------------+---------------------------+
| Variable_name | VALUE                     |
+---------------+---------------------------+
| socket        | /var/lib/mysql/mysql.sock |
+---------------+---------------------------+

Asterisk Realtime Configuration

Enabled autoload modules

Hidden because of the length, please read. Important

Hidden because of the length, please read. Important

cat >> /etc/asterisk/modules.conf << EOF
[modules]
autoload = yes
 
preload => res_odbc.so
preload => res_config_odbc.so
preload => res_odbc_transaction.so
 
load => cdr_adaptive_odbc.so
 
; Applications
 
load = app_bridgewait.so
load = app_dial.so
load = app_playback.so
load = app_stack.so
load = app_verbose.so
load = app_voicemail.so
load = app_directory.so
load = app_confbridge.so
load = app_queue.so
load = app_amd.so
load = app_originate.so
load = app_waitforsilence.so
load = app_echo.so
load = app_mysql.so
load = app_system.so
load = app_db.so
load = app_channelredirect.so
load = app_mixmonitor.so
 
; Bridging
 
load = bridge_builtin_features.so
load = bridge_builtin_interval_features.so
load = bridge_holding.so
load = bridge_native_rtp.so
load = bridge_simple.so
load = bridge_softmix.so
 
; Call Detail Records
 
load = cdr_custom.so
 
; Channel Drivers
 
load = chan_bridge_media.so
load = chan_pjsip.so
load = chan_sip.so
 
; Codecs
 
load = codec_gsm.so
load = codec_resample.so
load = codec_ulaw.so
load = codec_alaw.so
load = codec_g722.so
load = codec_opus.so
 
; Formats
 
load = format_gsm.so
load = format_pcm.so
load = format_wav_gsm.so
load = format_wav.so
 
; Functions
 
load = func_callerid.so
load = func_cdr.so
load = func_pjsip_endpoint.so
load = func_sorcery.so
load = func_devstate.so
load = func_strings.so
load = func_db.so
load = func_channel.so
load = func_cut.so
load = func_odbc.so
 
; Core/PBX
load = func_realtime.so
load = pbx_config.so
load = pbx_functions.so
load = pbx_spool.so
 
; Resources
 
load = res_hep_pjsip.so
load = res_musiconhold.so
load = res_pjproject.so
load = res_pjsip_acl.so
load = res_pjsip_authenticator_digest.so
load = res_pjsip_caller_id.so
load = res_pjsip_dialog_info_body_generator.so
load = res_pjsip_diversion.so
load = res_pjsip_dtmf_info.so
load = res_pjsip_endpoint_identifier_anonymous.so
load = res_pjsip_endpoint_identifier_ip.so
load = res_pjsip_endpoint_identifier_user.so
load = res_pjsip_exten_state.so
load = res_pjsip_header_funcs.so
load = res_pjsip_log_forwarder.so
load = res_pjsip_logger.so
load = res_pjsip_messaging.so
load = res_pjsip_multihomed.so
load = res_pjsip_mwi_body_generator.so
load = res_pjsip_mwi.so
load = res_pjsip_nat.so
load = res_pjsip_notify.so
load = res_pjsip_one_touch_record_info.so
load = res_pjsip_outbound_authenticator_digest.so
load = res_pjsip_outbound_publish.so
load = res_pjsip_outbound_registration.so
load = res_pjsip_path.so
load = res_pjsip_phoneprov_provider.so
load = res_pjsip_pidf_body_generator.so
load = res_pjsip_pidf_digium_body_supplement.so
load = res_pjsip_pidf_eyebeam_body_supplement.so
load = res_pjsip_publish_asterisk.so
load = res_pjsip_pubsub.so
load = res_pjsip_refer.so
load = res_pjsip_registrar_expire.so
load = res_pjsip_registrar.so
load = res_pjsip_rfc3326.so
load = res_pjsip_sdp_rtp.so
load = res_pjsip_send_to_voicemail.so
load = res_pjsip_session.so
load = res_pjsip.so
load = res_pjsip_t38.so
load = res_pjsip_transport_websocket.so
load = res_pjsip_xpidf_body_generator.so
load = res_pjsip_multihomed.so
load = res_rtp_asterisk.so
load = res_sorcery_astdb.so
load = res_sorcery_config.so
load = res_sorcery_memory.so
load = res_sorcery_realtime.so
load = res_timing_timerfd.so
load = res_srtp.so
load = res_clioriginate.so
 
EOF

Restart Asterisk

 asterisk -rx 'core restart now'

Create Asterisk res_odbc config

 touch /etc/asterisk/res_odbc.conf &&
 chown asterisk. /etc/asterisk/res_odbc.conf
cat >> /etc/asterisk/res_odbc.conf << EOF
[realtimedb]
enabled => yes
dsn => MySQL-realtimedb
username => RT_DB_USER
password => RT_DB_PASSWORD
pre-connect => yes
 
[asteriskcdrdb]
enabled => yes
dsn => MySQL-asteriskcdrdb
username => CDR_DB_USER
password => CDR_DB_PASSWORD
pre-connect => yes
 
EOF
Check ODBC Connections
 asterisk -rx 'odbc show'

It's so good:

ODBC DSN Settings
-----------------
 
  Name:   realtimedb
  DSN:    MySQL-realtimedb
    Number of active connections: 1 (out of 1)
 
  Name:   asteriskcdrdb
  DSN:    MySQL-asteriskcdrdb
    Number of active connections: 1 (out of 1)
 

create /etc/asterisk/sorcery.conf

 touch /etc/asterisk/sorcery.conf &&
 chown asterisk. /etc/asterisk/sorcery.conf
cat >> /etc/asterisk/sorcery.conf << EOF
[res_pjsip] ; Realtime PJSIP configuration wizard
endpoint=realtime,ps_endpoints
auth=realtime,ps_auths
aor=realtime,ps_aors
domain_alias=realtime,ps_domain_aliases
contact=realtime,ps_contacts
 
[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips
 
EOF

Create /etc/asterisk/extconfig.conf

 touch /etc/asterisk/extconfig.conf &&
 chown asterisk. /etc/asterisk/extconfig.conf
cat >> /etc/asterisk/extconfig.conf << EOF
[settings]
sipusers => odbc,realtimedb,sippeers
sippeers => odbc,realtimedb,sippeers
 
dp_internal => odbc,realtimedb,dp_internal
dp_external => odbc,realtimedb,dp_external
dp_agents  => odbc,realtimedb,dp_agents
 
confbridge_static.conf => odbc,realtimedb,confbridge_ast_config
followme_static.conf => odbc,realtimedb,follow_ast_config
features_static.conf => odbc,realtimedb,feat_ast_config
 
ps_endpoints => odbc,realtimedb
ps_auths => odbc,realtimedb
ps_aors => odbc,realtimedb
ps_domain_aliases => odbc,realtimedb
ps_endpoint_id_ips => odbc,realtimedb
ps_contacts => odbc,realtimedb
 
queues => odbc,realtimedb
queue_members => odbc,realtimedb
queue_rules => odbc,realtimedb
 
EOF

Edit /etc/asterisk/extensions.conf

Enabled static storage configuration.
Include file 'extensions_rt.conf'

cat >> /etc/asterisk/extensions.conf << EOF
[general]
static=yes
 
#include extensions_rt.conf
 
EOF

Create /etc/asterisk/extensions_rt.conf

 touch /etc/asterisk/extensions_rt.conf &&
 chown asterisk. /etc/asterisk/extensions_rt.conf
cat >> /etc/asterisk/extensions_rt.conf << EOF
[from-internal]
switch => Realtime/internal@dp_internal
 
[from-external]
switch => Realtime/external@dp_external
 
[from-agents] 
switch => Realtime/agents@dp_agents
 
EOF

Create /etc/asterisk/sip.conf

 touch /etc/asterisk/sip.conf &&
 chown asterisk. /etc/asterisk/sip.conf

Add general sip settings. Edit example as you need it/

cat >> /etc/asterisk/sip.conf << EOF
[general]
udpbindaddr = 0.0.0.0:5060
localnet=LOCAL NETWORK/MASK
transport => udp
externaddr => EXTERN IP ADDR
nat => force_rport,comedia
srvlookup => yes
directmedia => nonat
prematuremedia => no
allowguest => no
alwaysauthreject = no
useragent => Aster15Realtime
sdpsession => Aster15Realtime
disallow => all
allow => alaw
allow = ulaw
allow => opus
 
regextenonqualify=yes
 
rtptimeout => 30
rtpholdtimeout => 300
rtpkeepalive => 5
 
ignoreregexpire = yes
 
rtcachefriends => yes
rtupdate => yes
rtautoclear => no
rtsavesysname = no
EOF

Thus, you have received Asterisk with the support of realtime and static storages in MySQL.
In addition, to add other static configs. For example, followme.conf, make include in the required config:

 #include followme_static.conf

as indicated in /etc/asterisk/exconfig.conf:

 followme_static.conf => odbc,realtimedb,follow_ast_config

Other for realtime configuration:

  • asterisk_install/asterisk-15_centos-7_realtime.txt
  • Последние изменения: 2018/09/28