-- https://www.phpmyadmin.net
--
-- Generato il: Lug 11, 2018 alle 11:44
-- Versione del server: 5.7.22-log
-- Versione PHP: 5.5.38




--
-- Database: `asterisk`
--

-- --------------------------------------------------------

--
-- Struttura della tabella `ac_autocharges`
--

CREATE TABLE IF NOT EXISTS `ac_autocharges` (
  `ac_id` int(11) NOT NULL AUTO_INCREMENT,
  `ac_te_id` int(11) NOT NULL,
  `ac_cr_id` int(11) NOT NULL,
  `ac_amount` decimal(11,5) NOT NULL,
  PRIMARY KEY (`ac_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ag_agiscripts`
--

CREATE TABLE IF NOT EXISTS `ag_agiscripts` (
  `ag_id` int(11) NOT NULL AUTO_INCREMENT,
  `ag_te_id` int(11) NOT NULL,
  `ag_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ag_path` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ag_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ag_numparams` int(11) NOT NULL,
  `ag_admparam1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ag_allowuser1` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ag_admparam2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ag_allowuser2` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ag_admparam3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ag_allowuser3` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ag_admparam4` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ag_allowuser4` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ag_admparam5` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ag_allowuser5` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ag_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=116 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `al_alarms`
--

CREATE TABLE IF NOT EXISTS `al_alarms` (
  `al_id` int(11) NOT NULL AUTO_INCREMENT,
  `al_te_id` int(11) NOT NULL,
  `al_alarm_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `al_param1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `al_param2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `al_param3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `al_param4` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `al_param5` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `al_param6` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`al_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `al_autoprovisionlabels`
--

CREATE TABLE IF NOT EXISTS `al_autoprovisionlabels` (
  `al_id` int(11) NOT NULL AUTO_INCREMENT,
  `al_label` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `al_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `al_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `al_order` int(11) NOT NULL,
  PRIMARY KEY (`al_id`),
  UNIQUE KEY `al_value` (`al_value`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=739 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `aq_allowed_queue_member`
--

CREATE TABLE IF NOT EXISTS `aq_allowed_queue_member` (
  `aq_uniqueid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `aq_membername` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `aq_queue_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `aq_interface` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `aq_state_interface` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `aq_penalty` int(11) DEFAULT NULL,
  `aq_paused` int(11) DEFAULT NULL,
  `aq_member_device` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`aq_uniqueid`),
  UNIQUE KEY `aq_queue_interface` (`aq_queue_name`,`aq_interface`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4723 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ar_autorefills`
--

CREATE TABLE IF NOT EXISTS `ar_autorefills` (
  `ar_id` int(11) NOT NULL AUTO_INCREMENT,
  `ar_te_id` int(11) NOT NULL,
  `ar_cr_id` int(11) NOT NULL,
  `ar_amount` decimal(11,5) NOT NULL,
  PRIMARY KEY (`ar_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=43 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ast_config`
--

CREATE TABLE IF NOT EXISTS `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) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `category` varchar(128) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'default',
  `var_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `var_val` varchar(128) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `filename_comment` (`filename`,`commented`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `av_autoprovisionvalues`
--

CREATE TABLE IF NOT EXISTS `av_autoprovisionvalues` (
  `av_id` int(11) NOT NULL AUTO_INCREMENT,
  `av_te_id` int(11) NOT NULL,
  `av_ph_id` int(11) NOT NULL,
  `av_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `av_order` int(11) NOT NULL,
  `av_al_id` int(11) NOT NULL,
  `av_value` varchar(511) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`av_id`),
  KEY `av_ph_id_av_al_id` (`av_ph_id`,`av_al_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=75699 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ba_backups`
--

CREATE TABLE IF NOT EXISTS `ba_backups` (
  `ba_id` int(11) NOT NULL AUTO_INCREMENT,
  `ba_cr_id` int(11) NOT NULL,
  `ba_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_host` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_user` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_directory` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_ftphost` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_ftpuser` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_ftppassword` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_ftpdirectory` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_ftprate` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ba_dirasteriskfiles` int(11) NOT NULL,
  `ba_ftpasteriskfiles` int(11) NOT NULL,
  `ba_dircdrdbfiles` int(11) NOT NULL,
  `ba_ftpcdrdbfiles` int(11) NOT NULL,
  `ba_dirrecfiles` int(11) NOT NULL,
  `ba_ftprecfiles` int(11) NOT NULL,
  `ba_ftppassive` varchar(4) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'on',
  UNIQUE KEY `ba_id` (`ba_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `bi_billings`
--

CREATE TABLE IF NOT EXISTS `bi_billings` (
  `bi_id` int(11) NOT NULL AUTO_INCREMENT,
  `bi_te_id` int(11) NOT NULL,
  `bi_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `bi_date` datetime NOT NULL,
  `bi_amount` decimal(20,5) NOT NULL,
  PRIMARY KEY (`bi_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11443 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `bl_blacklists`
--

CREATE TABLE IF NOT EXISTS `bl_blacklists` (
  `bl_id` int(11) NOT NULL AUTO_INCREMENT,
  `bl_te_id` int(11) NOT NULL,
  `bl_callerid` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `bl_inserted` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `bl_reason` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`bl_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `bl_buttonlayouts`
--

CREATE TABLE IF NOT EXISTS `bl_buttonlayouts` (
  `bl_id` int(11) NOT NULL AUTO_INCREMENT,
  `bl_te_id` int(11) NOT NULL,
  `bl_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `bl_code` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `bl_start` int(11) NOT NULL,
  `bl_end` int(11) NOT NULL,
  `bl_bt_id` int(11) NOT NULL DEFAULT '0',
  `bl_pb_id` int(11) NOT NULL DEFAULT '0',
  `bl_usephonebook` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `bl_phonebookorderid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`bl_id`),
  KEY `bl_te_id` (`bl_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=259 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `bt_buttonlayouttemplates`
--

CREATE TABLE IF NOT EXISTS `bt_buttonlayouttemplates` (
  `bt_id` int(11) NOT NULL AUTO_INCREMENT,
  `bt_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `bt_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `bt_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `bt_start` int(11) NOT NULL DEFAULT '0',
  `bt_end` int(11) NOT NULL DEFAULT '0',
  `bt_template` blob NOT NULL,
  `bt_lock` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `bt_lockpassword` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`bt_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=83 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ca_calleridmods`
--

CREATE TABLE IF NOT EXISTS `ca_calleridmods` (
  `ca_id` int(11) NOT NULL AUTO_INCREMENT,
  `ca_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ca_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ca_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=15 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ca_campaigns`
--

CREATE TABLE IF NOT EXISTS `ca_campaigns` (
  `ca_id` int(11) NOT NULL AUTO_INCREMENT,
  `ca_te_id` int(11) NOT NULL,
  `ca_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ca_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'SCHEDULED',
  `ca_datestart` date NOT NULL,
  `ca_dateend` date NOT NULL,
  `ca_co_id` int(11) NOT NULL,
  `ca_maxchannels` int(11) NOT NULL,
  `ca_maxattempts` int(11) NOT NULL,
  `ca_callerid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ca_calldelay` int(11) NOT NULL,
  `ca_state` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ca_lastrun` datetime NOT NULL,
  `ca_dialtimeout` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ca_hosted` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ca_tech` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'VOICE',
  `ca_message` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ca_recording` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`ca_id`),
  KEY `ca_te_id` (`ca_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=65 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ca_cdranalyze`
--

CREATE TABLE IF NOT EXISTS `ca_cdranalyze` (
  `ca_id` int(11) NOT NULL AUTO_INCREMENT,
  `ca_session` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ca_start` datetime NOT NULL,
  `ca_answer` datetime NOT NULL,
  `ca_end` datetime NOT NULL,
  `ca_realsrc` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `ca_firstdst` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `ca_lastdst` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `ca_disposition` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `ca_direction` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `ca_callstart` datetime NOT NULL,
  `ca_callend` datetime NOT NULL,
  `ca_callerip` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `ca_calledip` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `ca_a_lost` int(11) NOT NULL,
  `ca_b_lost` int(11) NOT NULL,
  `ca_a_avgjitter_mult10` int(11) NOT NULL,
  `ca_b_avgjitter_mult10` int(11) NOT NULL,
  `ca_a_maxjitter` int(11) NOT NULL,
  `ca_b_maxjitter` int(11) NOT NULL,
  `ca_a_mos_f1_mult10` int(11) NOT NULL,
  `ca_a_mos_f2_mult10` int(11) NOT NULL,
  `ca_a_mos_adapt_mult10` int(11) NOT NULL,
  `ca_b_mos_f1_mult10` int(11) NOT NULL,
  `ca_b_mos_f2_mult10` int(11) NOT NULL,
  `ca_b_mos_adapt_mult10` int(11) NOT NULL,
  `ca_packet_loss_perc_mult1000` int(11) NOT NULL,
  `ca_mos_min_mult10` int(11) NOT NULL,
  `ca_a_mos_min_mult10` int(11) NOT NULL,
  `ca_b_mos_min_mult10` int(11) NOT NULL,
  `ca_processtime` int(11) NOT NULL,
  `ca_duration` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`ca_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=16835 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cc_callcosts`
--

CREATE TABLE IF NOT EXISTS `cc_callcosts` (
  `cc_id` int(11) NOT NULL AUTO_INCREMENT,
  `cc_te_id` int(11) NOT NULL,
  `cc_uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cc_cost` decimal(10,5) NOT NULL,
  `cc_bi_id` int(11) NOT NULL,
  `cc_cdr_sequence` int(11) NOT NULL,
  `cc_pr_id` int(11) NOT NULL,
  `cc_buy` decimal(10,5) NOT NULL,
  `cc_peername` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cc_date` date DEFAULT NULL,
  `cc_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'OUTBOUND',
  `cc_type_id` int(11) DEFAULT NULL,
  `cc_country` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cc_network` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cc_international` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`cc_id`),
  KEY `cc_te_id` (`cc_te_id`,`cc_bi_id`),
  KEY `cc_uniqueid` (`cc_uniqueid`),
  KEY `cc_date` (`cc_date`,`cc_peername`),
  KEY `cc_te_id_2` (`cc_te_id`,`cc_date`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1783475 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cc_cnamecache`
--

CREATE TABLE IF NOT EXISTS `cc_cnamecache` (
  `cc_id` int(11) NOT NULL AUTO_INCREMENT,
  `cc_number` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `cc_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `cc_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `cc_manual` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `cc_te_id` int(11) NOT NULL DEFAULT '-1',
  PRIMARY KEY (`cc_id`),
  UNIQUE KEY `cc_number` (`cc_te_id`,`cc_number`),
  KEY `cc_datetime` (`cc_te_id`,`cc_datetime`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=35 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cd_codecs`
--

CREATE TABLE IF NOT EXISTS `cd_codecs` (
  `cd_id` int(11) NOT NULL AUTO_INCREMENT,
  `cd_name` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `cd_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cd_ptime` int(11) NOT NULL DEFAULT '20',
  `cd_type` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`cd_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=36 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ce_conditions_extended`
--

CREATE TABLE IF NOT EXISTS `ce_conditions_extended` (
  `ce_id` int(11) NOT NULL AUTO_INCREMENT,
  `ce_te_id` int(11) NOT NULL,
  `ce_co_id` int(11) NOT NULL,
  `ce_param1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ce_param2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ce_param3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ce_id`),
  KEY `ce_co_id` (`ce_co_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=912867 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ce_customextensions`
--

CREATE TABLE IF NOT EXISTS `ce_customextensions` (
  `ce_id` int(11) NOT NULL AUTO_INCREMENT,
  `ce_te_id` int(11) NOT NULL,
  `ce_dialoption` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ce_auth_type` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ce_pr_id` int(11) NOT NULL DEFAULT '0',
  `ce_auth_parameter` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ce_peername` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`ce_id`),
  KEY `ce_te_id` (`ce_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=100 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ce_customs_extended`
--

CREATE TABLE IF NOT EXISTS `ce_customs_extended` (
  `ce_id` int(11) NOT NULL AUTO_INCREMENT,
  `ce_te_id` int(11) NOT NULL,
  `ce_cu_id` int(11) NOT NULL,
  `ce_param1` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ce_param2` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ce_param3` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`ce_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=150 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cf_customfiles`
--

CREATE TABLE IF NOT EXISTS `cf_customfiles` (
  `cf_id` int(11) NOT NULL AUTO_INCREMENT,
  `cf_te_id` int(11) NOT NULL,
  `cf_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cf_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cf_data` longblob NOT NULL,
  `cf_size` int(11) NOT NULL,
  `cf_md5` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cf_useragentregex` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`cf_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=163 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cg_callgroups`
--

CREATE TABLE IF NOT EXISTS `cg_callgroups` (
  `cg_id` int(11) NOT NULL AUTO_INCREMENT,
  `cg_te_id` int(11) NOT NULL,
  `cg_ex_id` int(11) NOT NULL,
  `cg_value` int(11) NOT NULL,
  PRIMARY KEY (`cg_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6259 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cl_clientrates`
--

CREATE TABLE IF NOT EXISTS `cl_clientrates` (
  `cl_id` int(11) NOT NULL AUTO_INCREMENT,
  `cl_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `cl_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cl_customratescript` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cl_ratescripttech` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'AGI',
  PRIMARY KEY (`cl_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=97 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cl_conferenceroomlogs`
--

CREATE TABLE IF NOT EXISTS `cl_conferenceroomlogs` (
  `cl_id` int(11) NOT NULL AUTO_INCREMENT,
  `cl_te_id` int(11) NOT NULL,
  `cl_start` datetime NOT NULL,
  `cl_end` datetime DEFAULT NULL,
  `cl_cr_id` int(11) NOT NULL,
  `cl_pinused` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `cl_calleridname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cl_calleridnum` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cl_uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cl_meetmesecs` int(11) DEFAULT NULL,
  `cl_reportsent` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`cl_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1091 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cn_campaignnumbers`
--

CREATE TABLE IF NOT EXISTS `cn_campaignnumbers` (
  `cn_id` int(11) NOT NULL AUTO_INCREMENT,
  `cn_te_id` int(11) NOT NULL,
  `cn_ca_id` int(11) NOT NULL,
  `cn_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cn_disposition` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cn_attempts` int(11) NOT NULL,
  `cn_lastattempt` datetime NOT NULL,
  `cn_description` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
  `cn_billsec` int(11) NOT NULL,
  `cn_field1` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cn_field2` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cn_field3` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cn_field4` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cn_field5` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cn_field6` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cn_field7` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cn_field8` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cn_field9` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cn_field10` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`cn_id`),
  KEY `cn_te_id` (`cn_te_id`),
  KEY `cn_ca_id` (`cn_ca_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1447763 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `co_conditions`
--

CREATE TABLE IF NOT EXISTS `co_conditions` (
  `co_id` int(11) NOT NULL AUTO_INCREMENT,
  `co_te_id` int(11) NOT NULL,
  `co_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `co_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `co_timezone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `co_param1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param3` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param4` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param5` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param6` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param7` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param8` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param9` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param10` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param11` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `co_param12` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`co_id`),
  KEY `co_te_id` (`co_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9427 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `co_countries`
--

CREATE TABLE IF NOT EXISTS `co_countries` (
  `co_code` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `co_country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`co_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `cp_clustersportal`
--

CREATE TABLE IF NOT EXISTS `cp_clustersportal` (
  `cp_id` int(11) NOT NULL AUTO_INCREMENT,
  `cp_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cp_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cp_apikey` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cp_th_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`cp_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cp_customextensionproviders`
--

CREATE TABLE IF NOT EXISTS `cp_customextensionproviders` (
  `cp_id` int(11) NOT NULL AUTO_INCREMENT,
  `cp_te_id` int(11) NOT NULL,
  `cp_ex_id` int(11) NOT NULL,
  `cp_pr_id` int(11) NOT NULL,
  PRIMARY KEY (`cp_id`),
  KEY `cp_te_id` (`cp_te_id`),
  KEY `cp_ex_id` (`cp_ex_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=228 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cr_calleridmodrules`
--

CREATE TABLE IF NOT EXISTS `cr_calleridmodrules` (
  `cr_id` int(11) NOT NULL AUTO_INCREMENT,
  `cr_ca_id` int(11) NOT NULL,
  `cr_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_regex` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_adddigits` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_deldigits` int(11) NOT NULL,
  PRIMARY KEY (`cr_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=35 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cr_calleridregexs`
--

CREATE TABLE IF NOT EXISTS `cr_calleridregexs` (
  `cr_id` int(11) NOT NULL AUTO_INCREMENT,
  `cr_te_id` int(11) NOT NULL,
  `cr_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`cr_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=163 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cr_callreservations`
--

CREATE TABLE IF NOT EXISTS `cr_callreservations` (
  `cr_id` int(11) NOT NULL AUTO_INCREMENT,
  `cr_te_id` int(11) NOT NULL,
  `cr_caller` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_called` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_datetime` datetime NOT NULL,
  PRIMARY KEY (`cr_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=20 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cr_conferencerooms`
--

CREATE TABLE IF NOT EXISTS `cr_conferencerooms` (
  `cr_id` int(11) NOT NULL AUTO_INCREMENT,
  `cr_te_id` int(11) NOT NULL,
  `cr_number` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `cr_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_hosted` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_bookid` int(11) NOT NULL,
  `cr_rrid` int(11) NOT NULL DEFAULT '0',
  `cr_sendreport` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `cr_sendreportemail` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_sendreportemailfromdate` datetime DEFAULT NULL,
  `cr_requestpinmeid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`cr_id`),
  KEY `cr_te_id` (`cr_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1843 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cr_cronjobs`
--

CREATE TABLE IF NOT EXISTS `cr_cronjobs` (
  `cr_id` int(11) NOT NULL AUTO_INCREMENT,
  `cr_te_id` int(11) NOT NULL,
  `cr_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cr_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_no_id` int(11) NOT NULL,
  `cr_active` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `cr_minute` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
  `cr_hour` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
  `cr_day` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_month` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_weekday` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cr_laststarted` datetime NOT NULL,
  `cr_lastended` datetime NOT NULL,
  `cr_run` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cr_once` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cr_lastping` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `cr_pid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`cr_id`),
  KEY `cr_te_id` (`cr_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3427 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `csv_importer`
--

CREATE TABLE IF NOT EXISTS `csv_importer` (
  `csv_id` int(11) NOT NULL AUTO_INCREMENT,
  `csv_session` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `csv_rownum` int(11) NOT NULL,
  `csv_date` date NOT NULL,
  `csv_data` varchar(4096) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`csv_id`),
  KEY `csv_session` (`csv_session`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=643 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ct_customtypes`
--

CREATE TABLE IF NOT EXISTS `ct_customtypes` (
  `ct_id` int(11) NOT NULL AUTO_INCREMENT,
  `ct_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ct_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ct_id`),
  KEY `ct_name` (`ct_name`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2804 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `cu_customs`
--

CREATE TABLE IF NOT EXISTS `cu_customs` (
  `cu_id` int(11) NOT NULL AUTO_INCREMENT,
  `cu_te_id` int(11) NOT NULL,
  `cu_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cu_ct_id` int(11) NOT NULL,
  `cu_param1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cu_param2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cu_param3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cu_param4` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cu_param5` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cu_param6` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cu_param7` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cu_param8` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cu_param9` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cu_param10` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`cu_id`),
  KEY `cu_te_id` (`cu_te_id`),
  KEY `cu_param1` (`cu_param1`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11699 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `dc_donotcalls`
--

CREATE TABLE IF NOT EXISTS `dc_donotcalls` (
  `dc_id` int(11) NOT NULL AUTO_INCREMENT,
  `dc_te_id` int(11) NOT NULL,
  `dc_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dc_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  UNIQUE KEY `dc_id` (`dc_id`),
  KEY `dc_te_id` (`dc_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=35 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `de_destinations`
--

CREATE TABLE IF NOT EXISTS `de_destinations` (
  `de_id` int(11) NOT NULL AUTO_INCREMENT,
  `de_te_id` int(11) NOT NULL,
  `de_type_src` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `de_type_id_src` int(11) NOT NULL,
  `de_type_dst` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `de_type_id_dst` int(11) NOT NULL,
  `de_ord` int(11) NOT NULL,
  PRIMARY KEY (`de_id`),
  KEY `de_type_src` (`de_type_src`,`de_type_id_src`),
  KEY `de_type_dst` (`de_type_dst`,`de_type_id_dst`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=120819 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `df_default_fields`
--

CREATE TABLE IF NOT EXISTS `df_default_fields` (
  `df_id` int(11) NOT NULL AUTO_INCREMENT,
  `df_section` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `df_table` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `df_column` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `df_formfield` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `df_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`df_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=724 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `di_dids`
--

CREATE TABLE IF NOT EXISTS `di_dids` (
  `di_id` int(11) NOT NULL AUTO_INCREMENT,
  `di_te_id` int(11) NOT NULL,
  `di_country` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `di_area` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `di_number` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `di_comment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_recording` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `di_didprefix` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_fax` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `di_faxstationid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_faxheaderinfo` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_faxprotocol` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `di_fax_email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_fax_store` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `di_didnameprefix` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_unconditionalstatus` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
  `di_maxchannels` int(11) NOT NULL DEFAULT '-1',
  `di_cnam` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
  `di_allowemergency` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `di_emergencynotes` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
  `di_ibid` int(11) NOT NULL,
  `di_emailrecording` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_admincomment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_notifyunassigned` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'on',
  `di_minemailrecording` int(11) NOT NULL,
  `di_dp_id` int(11) NOT NULL DEFAULT '0',
  `di_provider_info` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `di_provider_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `di_smsprotocol` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `di_smsfromfield` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `di_smstofield` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `di_smsbodyfield` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `di_sms_store` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `di_smsemail` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `di_branch` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_department` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `di_storeandforwardnumber` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `di_notifymaxchannels` varchar(4) COLLATE utf8_unicode_ci NOT NULL,
  `di_faxprinturl` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `di_smsanswer` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`di_id`),
  UNIQUE KEY `di_country` (`di_country`,`di_area`,`di_number`),
  KEY `di_te_id` (`di_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=27363 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `dl_dialingrules`
--

CREATE TABLE IF NOT EXISTS `dl_dialingrules` (
  `dl_id` int(11) NOT NULL AUTO_INCREMENT,
  `dl_rp_id` int(11) NOT NULL,
  `dl_no_id` int(11) NOT NULL,
  `dl_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dl_regex` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dl_masklen` int(11) NOT NULL,
  `dl_pr_id` int(11) NOT NULL,
  `dl_adddigits` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dl_deldigits` int(11) NOT NULL,
  `dl_uselcr` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `dl_priority` int(11) NOT NULL,
  `dl_order` int(11) NOT NULL,
  `dl_weight` int(11) NOT NULL,
  `dl_emergencyroute` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `dl_usepin` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `dl_paused` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  UNIQUE KEY `dl_id` (`dl_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=371 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `dl_dnc_numbers`
--

CREATE TABLE IF NOT EXISTS `dl_dnc_numbers` (
  `dl_id` int(11) NOT NULL AUTO_INCREMENT,
  `dl_te_id` int(11) NOT NULL,
  `dl_dc_id` int(11) NOT NULL,
  `dl_number` char(20) COLLATE utf8_unicode_ci NOT NULL,
  `dl_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`dl_id`),
  KEY `dl_te_id` (`dl_te_id`,`dl_dc_id`,`dl_number`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8877651 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `dn_dialbyname`
--

CREATE TABLE IF NOT EXISTS `dn_dialbyname` (
  `dn_id` int(11) NOT NULL AUTO_INCREMENT,
  `dn_te_id` int(11) NOT NULL,
  `dn_type_id` int(11) NOT NULL DEFAULT '0',
  `dn_number` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
  `dn_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'EXT',
  PRIMARY KEY (`dn_id`),
  KEY `dn_te_id` (`dn_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=43971 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `dp_didproviders`
--

CREATE TABLE IF NOT EXISTS `dp_didproviders` (
  `dp_id` int(11) NOT NULL AUTO_INCREMENT,
  `dp_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dp_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dp_host` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dp_port` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dp_username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dp_password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dp_account` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`dp_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ds_disas`
--

CREATE TABLE IF NOT EXISTS `ds_disas` (
  `ds_id` int(11) NOT NULL AUTO_INCREMENT,
  `ds_te_id` int(11) NOT NULL,
  `ds_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ds_me_id` int(11) NOT NULL,
  `ds_pin` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ds_outbound` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ds_blockcid` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ds_calleridnum` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ds_calleridname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ds_id`),
  KEY `ds_te_id` (`ds_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `dt_datetimeformats`
--

CREATE TABLE IF NOT EXISTS `dt_datetimeformats` (
  `dt_id` int(11) NOT NULL AUTO_INCREMENT,
  `dt_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dt_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`dt_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=12 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `dv_default_values`
--

CREATE TABLE IF NOT EXISTS `dv_default_values` (
  `dv_id` int(11) NOT NULL AUTO_INCREMENT,
  `dv_df_id` int(11) NOT NULL,
  `dv_te_id` int(11) NOT NULL,
  `dv_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dv_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `dv_show` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`dv_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1779 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ea_externalagents`
--

CREATE TABLE IF NOT EXISTS `ea_externalagents` (
  `ea_id` int(11) NOT NULL AUTO_INCREMENT,
  `ea_te_id` int(11) NOT NULL,
  `ea_number` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ea_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`ea_id`),
  KEY `ea_te_id` (`ea_te_id`),
  KEY `ea_number` (`ea_number`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=36 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ee_extensionevents`
--

CREATE TABLE IF NOT EXISTS `ee_extensionevents` (
  `ee_id` int(11) NOT NULL AUTO_INCREMENT,
  `ee_extension` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ee_event` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ee_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ee_ip` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ee_id`),
  KEY `ee_extension` (`ee_extension`),
  KEY `ee_datetime` (`ee_datetime`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=69562419 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `es_phonebookexternalsources`
--

CREATE TABLE IF NOT EXISTS `es_phonebookexternalsources` (
  `es_id` int(11) NOT NULL AUTO_INCREMENT,
  `es_te_id` int(11) NOT NULL,
  `es_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param4` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param5` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param6` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param7` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param8` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param9` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `es_param10` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`es_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `et_emailtemplates`
--

CREATE TABLE IF NOT EXISTS `et_emailtemplates` (
  `et_id` int(11) NOT NULL AUTO_INCREMENT,
  `et_te_id` int(11) NOT NULL,
  `et_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `et_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `et_active` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `et_sendername` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `et_senderemail` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `et_subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `et_text` longblob NOT NULL,
  `et_language` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`et_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=403 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ex_extensions`
--

CREATE TABLE IF NOT EXISTS `ex_extensions` (
  `ex_id` int(11) NOT NULL AUTO_INCREMENT,
  `ex_te_id` int(11) NOT NULL,
  `ex_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_tech` enum('SIP','IAX2','VIRTUAL','PJSIP','CUSTOM') COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_number` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `ex_trunk` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_tech_id` int(11) NOT NULL,
  `ex_cidnum` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `ex_cidname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_cidusage` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `ex_blockcid` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ex_prefix` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ex_mindigitprefix` int(11) NOT NULL,
  `ex_maxdigitprefix` int(11) NOT NULL,
  `ex_fmfmstatus` char(2) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_fmfmnumber` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ex_fmfmdialtimeout` int(11) NOT NULL,
  `ex_fmfmdialmethod` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ex_fmfmcallerid` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_fmfmnumprefix` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_fmfmnameprefix` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_recording` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_dialtimeout` int(11) NOT NULL,
  `ex_callgroup` int(11) NOT NULL,
  `ex_pickupgroup` int(11) NOT NULL,
  `ex_unconditionalstatus` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_onbusystatus` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_onofflinestatus` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_onnoanswerstatus` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_callallowed` varchar(40) COLLATE utf8_unicode_ci DEFAULT 'all',
  `ex_destallowregex` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  `ex_rp_id` int(11) NOT NULL,
  `ex_dnd` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `ex_emergencycidnum` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `ex_webpassword` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_up_id` int(11) NOT NULL,
  `ex_userpanel` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ex_datecreation` datetime DEFAULT NULL,
  `ex_emailrecording` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_fmfmconfirm` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_fmfmconfirmmessage_id` int(11) NOT NULL,
  `ex_minemailrecording` int(11) NOT NULL,
  `ex_branch` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_department` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_autocallerid` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'on',
  `ex_trunkcidoverride` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_trunkemergencycidoverride` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_cr_id` int(11) NOT NULL,
  `ex_trunkcidsource` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ex_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_fmfmholdmessage_id` int(11) NOT NULL,
  `ex_notifymissingemail` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ex_webuseldap` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `ex_webuser` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_txvolume` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_rxvolume` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_mu_id` int(11) DEFAULT '0',
  `ex_faxgateway` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_faxalert` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_trunkdid` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_fmfmdelay` int(11) NOT NULL DEFAULT '0',
  `ex_includeindbn` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'yes',
  `ex_abusedetection` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_referenceid` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_notes` longblob,
  `ex_callwaiting` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_costlimits` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_dailycostlimit` decimal(10,5) DEFAULT '0.00000',
  `ex_dailycostlimitdom` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `ex_dailycostlimitint` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `ex_routecostlimit` decimal(10,5) DEFAULT '0.00000',
  `ex_dailycostwarning` decimal(10,5) DEFAULT '0.00000',
  `ex_dailycostwarningdom` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `ex_dailycostwarningint` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `ex_lastcostalert` datetime DEFAULT NULL,
  `ex_cl_id` int(11) NOT NULL DEFAULT '0',
  `ex_alertemail` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_includeinpb` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  `ex_onconditionstatus` varchar(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_oncondition_id` int(11) NOT NULL DEFAULT '0',
  `ex_autoanswer` varchar(20) COLLATE utf8_unicode_ci DEFAULT '',
  `ex_autocidname` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_regexprefix` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_fromfilterregex` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_ignoreemptyemergcallerid` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_overridesippermit` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ex_webrtcsupport` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  `ex_blockanonymous` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  UNIQUE KEY `ex_id` (`ex_id`),
  KEY `ex_tech_id` (`ex_tech_id`),
  KEY `ex_te_id` (`ex_te_id`,`ex_number`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=23651 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `fa_faxes`
--

CREATE TABLE IF NOT EXISTS `fa_faxes` (
  `fa_id` int(11) NOT NULL AUTO_INCREMENT,
  `fa_te_id` int(11) NOT NULL,
  `fa_source_num` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fa_source_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fa_dest_num` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fa_remoteid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fa_direction` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `fa_file` longblob NOT NULL,
  `fa_date` datetime NOT NULL,
  `fa_pages` int(11) NOT NULL,
  `fa_status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fa_error` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fa_attempt` int(11) NOT NULL,
  `fa_rescheduled_as` int(11) NOT NULL,
  `fa_size` int(11) NOT NULL,
  `fa_statusemail` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fa_language` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `fa_sublanguage` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `fa_schedule` datetime NOT NULL,
  `fa_delete_after_send` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`fa_id`),
  KEY `fa_status` (`fa_status`),
  KEY `fa_te_id` (`fa_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=57747 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `fe_features`
--

CREATE TABLE IF NOT EXISTS `fe_features` (
  `fe_id` int(11) NOT NULL AUTO_INCREMENT,
  `fe_te_id` int(11) NOT NULL,
  `fe_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fe_comment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`fe_id`),
  KEY `fe_te_id` (`fe_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=22355 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `fl_flows`
--

CREATE TABLE IF NOT EXISTS `fl_flows` (
  `fl_id` int(11) NOT NULL AUTO_INCREMENT,
  `fl_te_id` int(11) NOT NULL,
  `fl_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fl_comment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fl_number` varchar(40) COLLATE utf8_unicode_ci DEFAULT '',
  `fl_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fl_value_for_unavailable` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fl_value_for_inuse` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fl_value_for_notinuse` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fl_value_for_ringing` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fl_variable_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fl_monitor_type` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `fl_monitor_type_id` int(11) NOT NULL DEFAULT '0',
  `fl_monitor_parameter` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`fl_id`),
  KEY `fl_te_id` (`fl_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1939 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `followme`
--

CREATE TABLE IF NOT EXISTS `followme` (
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `musiconhold` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `context` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `takecall` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `declinecall` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `call_from_prompt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `norecording_prompt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `options_prompt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pls_hold_prompt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `status_prompt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sorry_prompt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `followme_numbers`
--

CREATE TABLE IF NOT EXISTS `followme_numbers` (
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ordinal` int(11) NOT NULL,
  `phonenumber` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `timeout` int(11) NOT NULL,
  UNIQUE KEY `name` (`name`,`ordinal`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `fs_fail2banstatus`
--

CREATE TABLE IF NOT EXISTS `fs_fail2banstatus` (
  `fs_no_id` int(11) NOT NULL,
  `fs_jail` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `fs_status` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`fs_no_id`,`fs_jail`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ft_faxattempts`
--

CREATE TABLE IF NOT EXISTS `ft_faxattempts` (
  `ft_id` int(11) NOT NULL AUTO_INCREMENT,
  `ft_te_id` int(11) NOT NULL,
  `ft_fa_id` int(11) unsigned NOT NULL,
  `ft_remoteid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ft_date` datetime NOT NULL,
  `ft_status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ft_dialstatus` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `ft_error` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ft_attempt` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `ft_ecm` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ft_rate` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ft_modem` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`ft_id`),
  KEY `ft_te_id` (`ft_te_id`),
  KEY `ft_fa_id` (`ft_fa_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=22275 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ge_geoip`
--

CREATE TABLE IF NOT EXISTS `ge_geoip` (
  `ge_allowed` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  KEY `ge_allowed` (`ge_allowed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `gn_groupnames`
--

CREATE TABLE IF NOT EXISTS `gn_groupnames` (
  `gn_id` int(11) NOT NULL AUTO_INCREMENT,
  `gn_te_id` int(11) NOT NULL,
  `gn_number` int(11) NOT NULL,
  `gn_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`gn_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `gr_groupcounts`
--

CREATE TABLE IF NOT EXISTS `gr_groupcounts` (
  `gr_id` int(11) NOT NULL AUTO_INCREMENT,
  `gr_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `gr_server` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `gr_count` int(11) NOT NULL,
  PRIMARY KEY (`gr_id`),
  UNIQUE KEY `gr_name` (`gr_name`,`gr_server`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=154003 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `hu_huntlists`
--

CREATE TABLE IF NOT EXISTS `hu_huntlists` (
  `hu_id` int(11) NOT NULL AUTO_INCREMENT,
  `hu_number` varchar(40) COLLATE utf8_unicode_ci DEFAULT '',
  `hu_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `hu_te_id` int(11) NOT NULL,
  `hu_type` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `hu_ringtime` int(11) DEFAULT NULL,
  `hu_checkinuse` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
  `hu_checkoffline` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
  `hu_requestconfirm` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
  `hu_confirmmessage_id` int(11) DEFAULT NULL,
  `hu_usemoh` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
  `hu_allowredirect` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `hu_allowadditionaldestinations` varchar(10) COLLATE utf8_unicode_ci DEFAULT '',
  `hu_allowfmfm` varchar(10) COLLATE utf8_unicode_ci DEFAULT '',
  `hu_dialtimeout` int(11) NOT NULL DEFAULT '3600',
  `hu_fastdialing` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'on',
  PRIMARY KEY (`hu_id`),
  KEY `hu_te_id` (`hu_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2131 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `iaxfriends`
--

CREATE TABLE IF NOT EXISTS `iaxfriends` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `te_id` int(11) NOT NULL,
  `name` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `type` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'friend',
  `username` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailbox` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `secret` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dbsecret` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `context` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `regcontext` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `host` varchar(40) COLLATE utf8_unicode_ci DEFAULT 'dynamic',
  `ipaddr` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `port` int(5) DEFAULT NULL,
  `defaultip` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sourceaddress` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mask` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `regexten` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `regserver` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `regseconds` int(11) DEFAULT NULL,
  `accountcode` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mohinterpret` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mohsuggest` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `inkeys` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `outkey` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `language` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `callerid` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cid_number` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sendani` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `fullname` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `trunk` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `auth` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `maxauthreq` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
  `requirecalltoken` varchar(4) COLLATE utf8_unicode_ci DEFAULT NULL,
  `encryption` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `transfer` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `jitterbuffer` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `forcejitterbuffer` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `disallow` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `allow` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `codecpriority` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `qualify` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `qualifysmoothing` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `qualifyfreqok` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `qualifyfreqnotok` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `timezone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `adsi` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `amaflags` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `setvar` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `parkinglot` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`name`),
  UNIQUE KEY `id` (`id`),
  KEY `name` (`name`,`host`),
  KEY `name2` (`name`,`ipaddr`,`port`),
  KEY `ipaddr` (`ipaddr`,`port`),
  KEY `host` (`host`,`port`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ib_inboundrates`
--

CREATE TABLE IF NOT EXISTS `ib_inboundrates` (
  `ib_id` int(11) NOT NULL AUTO_INCREMENT,
  `ib_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ib_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ib_setup` decimal(10,5) NOT NULL,
  `ib_cost` decimal(10,5) NOT NULL,
  `ib_roundingtime` int(11) NOT NULL DEFAULT '1',
  `ib_minimumcost` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `ib_roundingcost` int(11) NOT NULL DEFAULT '5',
  PRIMARY KEY (`ib_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=13 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `id_ipdatabase`
--

CREATE TABLE IF NOT EXISTS `id_ipdatabase` (
  `id_id` int(11) NOT NULL AUTO_INCREMENT,
  `id_startip` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `id_endip` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `id_startnum` bigint(11) DEFAULT NULL,
  `id_endnum` bigint(11) DEFAULT NULL,
  `id_countrycode` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `id_country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_id`),
  KEY `id_startnum` (`id_startnum`,`id_endnum`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=30383924 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `il_ivr_logs`
--

CREATE TABLE IF NOT EXISTS `il_ivr_logs` (
  `il_id` int(11) NOT NULL AUTO_INCREMENT,
  `il_te_id` int(11) NOT NULL,
  `il_iv_id` int(11) NOT NULL,
  `il_cdr_start` datetime NOT NULL,
  `il_cdr_uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `il_start` datetime NOT NULL,
  `il_end` datetime NOT NULL,
  `il_action` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `il_option` char(10) COLLATE utf8_unicode_ci NOT NULL,
  `il_disa` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `il_clid` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `il_firstdst` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`il_id`),
  KEY `il_te_id_start` (`il_te_id`,`il_cdr_start`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2339 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `iv_ivrs`
--

CREATE TABLE IF NOT EXISTS `iv_ivrs` (
  `iv_id` int(11) NOT NULL AUTO_INCREMENT,
  `iv_te_id` int(11) NOT NULL,
  `iv_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `iv_me_id` int(11) NOT NULL,
  `iv_timeout` int(11) NOT NULL,
  `iv_loopontimeout` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `iv_looponwrongkeypress` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `iv_allowdisa` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `iv_allowfeatures` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `iv_digittimeout` int(11) NOT NULL,
  `iv_allowcustom` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `iv_maxloops` int(11) NOT NULL DEFAULT '5',
  PRIMARY KEY (`iv_id`),
  KEY `iv_te_id` (`iv_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3044 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `la_languages`
--

CREATE TABLE IF NOT EXISTS `la_languages` (
  `la_id` int(11) NOT NULL AUTO_INCREMENT,
  `la_directory` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `la_languagecode` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `la_sublanguagecode` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `la_locale` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `la_flag` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `la_language` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `la_enabled` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `la_tonezone` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`la_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=30 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ld_lastnumbersdialed`
--

CREATE TABLE IF NOT EXISTS `ld_lastnumbersdialed` (
  `ld_id` int(11) NOT NULL AUTO_INCREMENT,
  `ld_peername` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ld_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ld_number` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ld_id`),
  KEY `ld_peername` (`ld_peername`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `meetme`
--

CREATE TABLE IF NOT EXISTS `meetme` (
  `bookid` int(11) NOT NULL AUTO_INCREMENT,
  `confno` char(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
  `starttime` datetime DEFAULT '1900-01-01 12:00:00',
  `endtime` datetime DEFAULT '2038-01-01 12:00:00',
  `pin` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `adminpin` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `opts` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `adminopts` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `recordingfilename` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `recordingformat` char(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `maxusers` int(11) DEFAULT NULL,
  `members` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`bookid`),
  KEY `confno` (`confno`,`starttime`,`endtime`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1844 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `me_mediafiles`
--

CREATE TABLE IF NOT EXISTS `me_mediafiles` (
  `me_id` int(11) NOT NULL AUTO_INCREMENT,
  `me_te_id` int(11) NOT NULL,
  `me_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `me_format` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `me_size` int(11) NOT NULL,
  `me_md5` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `me_data` longblob NOT NULL,
  `me_moh` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
  `me_description` varchar(2999) COLLATE utf8_unicode_ci NOT NULL,
  `me_type` varchar(10) COLLATE utf8_unicode_ci DEFAULT 'STATIC',
  `me_text` varchar(5000) COLLATE utf8_unicode_ci DEFAULT '',
  `me_engine` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  `me_language` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  `me_voiceapiusername` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  `me_voiceapipassword` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  `me_volume` decimal(10,5) DEFAULT '1.00000',
  `me_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `me_voiceapihost` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`me_id`),
  KEY `me_te_id` (`me_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=14259 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `mf_mailtofaxes`
--

CREATE TABLE IF NOT EXISTS `mf_mailtofaxes` (
  `mf_id` int(11) NOT NULL AUTO_INCREMENT,
  `mf_te_id` int(11) NOT NULL,
  `mf_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_protocol` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_host` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_port` int(11) NOT NULL,
  `mf_transport` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_folder` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_cidnum` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_faxquality` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_authtype` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_authdata` text COLLATE utf8_unicode_ci NOT NULL,
  `mf_disabled` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `mf_language` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mf_cidname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `mf_pagesize` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'auto',
  `mf_unauthenticated` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'DELETE',
  PRIMARY KEY (`mf_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `mm_messages`
--

CREATE TABLE IF NOT EXISTS `mm_messages` (
  `mm_id` int(11) NOT NULL AUTO_INCREMENT,
  `mm_te_id` int(11) NOT NULL,
  `mm_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `mm_message` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mm_read` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `mm_hosted` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `mm_severity` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`mm_id`),
  KEY `mm_te_id` (`mm_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2483 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `musiconhold`
--

CREATE TABLE IF NOT EXISTS `musiconhold` (
  `name` char(80) COLLATE utf8_unicode_ci NOT NULL,
  `mode` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `directory` char(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `application` char(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `digit` char(1) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sort` char(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `format` char(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `mu_managerusers`
--

CREATE TABLE IF NOT EXISTS `mu_managerusers` (
  `mu_id` int(11) NOT NULL AUTO_INCREMENT,
  `mu_te_id` int(11) NOT NULL,
  `mu_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mu_password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mu_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`mu_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=19 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `mu_musiconholds`
--

CREATE TABLE IF NOT EXISTS `mu_musiconholds` (
  `mu_id` int(11) NOT NULL AUTO_INCREMENT,
  `mu_te_id` int(11) NOT NULL,
  `mu_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mu_custom` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mu_default` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `mu_volume` int(11) NOT NULL DEFAULT '1024',
  `mu_randomizeorder` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`mu_id`),
  KEY `mu_te_id` (`mu_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2115 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `no_nodes`
--

CREATE TABLE IF NOT EXISTS `no_nodes` (
  `no_id` int(11) NOT NULL AUTO_INCREMENT,
  `no_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `no_peername` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `no_ipaddress` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `no_manageruser` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `no_managerpassword` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `no_firewallhash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `no_croncheck` datetime DEFAULT NULL,
  `no_geoipstatus` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `no_devstatecheck` datetime DEFAULT NULL,
  `no_devstate_ping` datetime DEFAULT NULL,
  `no_devstate_pong` datetime DEFAULT NULL,
  `no_f2biphash` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `no_devstateversion` int(11) NOT NULL DEFAULT '0',
  `no_dahdistatus` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `no_geoipdata` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `no_autorestart` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `no_lastautorestartdate` datetime DEFAULT NULL,
  `no_autorestartdelay` int(11) NOT NULL DEFAULT '5',
  `no_healthcheckcount` int(11) NOT NULL DEFAULT '0',
  `no_healthcheckstatus` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`no_id`),
  KEY `no_peername` (`no_peername`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=67 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `od_outbounddids`
--

CREATE TABLE IF NOT EXISTS `od_outbounddids` (
  `od_id` int(11) NOT NULL AUTO_INCREMENT,
  `od_te_id` int(11) NOT NULL,
  `od_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `od_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `od_status` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `od_secret` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `od_emergency` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  PRIMARY KEY (`od_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=36 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pa_paginggroups`
--

CREATE TABLE IF NOT EXISTS `pa_paginggroups` (
  `pa_id` int(11) NOT NULL AUTO_INCREMENT,
  `pa_te_id` int(11) NOT NULL,
  `pa_number` varchar(40) COLLATE utf8_unicode_ci DEFAULT '',
  `pa_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pa_pin` int(11) DEFAULT NULL,
  `pa_bidirectional` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `pa_checkinuse` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `pa_me_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`pa_id`),
  KEY `pa_te_id` (`pa_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=531 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pb_phonebooks`
--

CREATE TABLE IF NOT EXISTS `pb_phonebooks` (
  `pb_id` int(11) NOT NULL AUTO_INCREMENT,
  `pb_te_id` int(11) NOT NULL,
  `pb_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pb_includeext` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  PRIMARY KEY (`pb_id`),
  KEY `pb_te_id` (`pb_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=275 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pc_pincodes`
--

CREATE TABLE IF NOT EXISTS `pc_pincodes` (
  `pc_id` int(11) NOT NULL AUTO_INCREMENT,
  `pc_te_id` int(11) NOT NULL,
  `pc_pin` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `pc_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`pc_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=19 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pc_providercosts`
--

CREATE TABLE IF NOT EXISTS `pc_providercosts` (
  `pc_id` int(11) NOT NULL AUTO_INCREMENT,
  `pc_pr_id` int(11) NOT NULL,
  `pc_prefix` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pc_country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pc_network` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pc_cost` decimal(10,5) NOT NULL,
  `pc_code` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `pc_parent_id` int(11) NOT NULL DEFAULT '0',
  `pc_roundingtime` int(11) NOT NULL DEFAULT '1',
  `pc_minimumcost` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `pc_roundingcost` int(11) NOT NULL DEFAULT '5',
  `pc_setup` decimal(10,5) NOT NULL DEFAULT '0.00000',
  PRIMARY KEY (`pc_id`),
  KEY `pc_pr_id` (`pc_pr_id`),
  KEY `pc_code_pr_id` (`pc_code`,`pc_pr_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5083523 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pd_phonebookdetails`
--

CREATE TABLE IF NOT EXISTS `pd_phonebookdetails` (
  `pd_id` int(11) NOT NULL AUTO_INCREMENT,
  `pd_te_id` int(11) NOT NULL,
  `pd_pe_id` int(11) NOT NULL,
  `pd_pi_id` int(11) NOT NULL,
  `pd_pi_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`pd_id`),
  KEY `pd_te_id` (`pd_te_id`,`pd_pi_value`),
  KEY `pd_te_id_pd_pe_id` (`pd_te_id`,`pd_pe_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=346435 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pe_phonebookentries`
--

CREATE TABLE IF NOT EXISTS `pe_phonebookentries` (
  `pe_id` int(11) NOT NULL AUTO_INCREMENT,
  `pe_te_id` int(11) NOT NULL,
  `pe_pb_id` int(11) NOT NULL,
  PRIMARY KEY (`pe_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=150419 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pfb_phonefeedbacks_binary`
--

CREATE TABLE IF NOT EXISTS `pfb_phonefeedbacks_binary` (
  `pfb_id` int(11) NOT NULL AUTO_INCREMENT,
  `pfb_binary` longblob NOT NULL,
  PRIMARY KEY (`pfb_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pf_phonefeedbacks`
--

CREATE TABLE IF NOT EXISTS `pf_phonefeedbacks` (
  `pf_id` int(11) NOT NULL AUTO_INCREMENT,
  `pf_te_id` int(11) NOT NULL,
  `pf_ph_id` int(11) NOT NULL,
  `pf_datetime` datetime NOT NULL,
  `pf_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pf_pfb_id` int(11) NOT NULL,
  `pf_size` int(11) NOT NULL,
  PRIMARY KEY (`pf_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pg_pickupgroups`
--

CREATE TABLE IF NOT EXISTS `pg_pickupgroups` (
  `pg_id` int(11) NOT NULL AUTO_INCREMENT,
  `pg_te_id` int(11) NOT NULL,
  `pg_ex_id` int(11) NOT NULL,
  `pg_value` int(11) NOT NULL,
  PRIMARY KEY (`pg_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=14147 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ph_phones`
--

CREATE TABLE IF NOT EXISTS `ph_phones` (
  `ph_id` int(11) NOT NULL AUTO_INCREMENT,
  `ph_name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `ph_te_id` int(11) NOT NULL,
  `ph_pm_id` int(11) NOT NULL,
  `ph_mac` varchar(24) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ph_password` varchar(24) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ph_line0_ex_id` int(11) DEFAULT NULL,
  `ph_line1_ex_id` int(11) DEFAULT NULL,
  `ph_line2_ex_id` int(11) DEFAULT NULL,
  `ph_line3_ex_id` int(11) DEFAULT NULL,
  `ph_line4_ex_id` int(11) DEFAULT NULL,
  `ph_line5_ex_id` int(11) DEFAULT NULL,
  `ph_line6_ex_id` int(11) DEFAULT NULL,
  `ph_line7_ex_id` int(11) DEFAULT NULL,
  `ph_line8_ex_id` int(11) DEFAULT NULL,
  `ph_line9_ex_id` int(11) DEFAULT NULL,
  `ph_line10_ex_id` int(11) DEFAULT NULL,
  `ph_line11_ex_id` int(11) DEFAULT NULL,
  `ph_line12_ex_id` int(11) DEFAULT NULL,
  `ph_line13_ex_id` int(11) DEFAULT NULL,
  `ph_line14_ex_id` int(11) DEFAULT NULL,
  `ph_line15_ex_id` int(11) DEFAULT NULL,
  `ph_line16_ex_id` int(11) DEFAULT NULL,
  `ph_line17_ex_id` int(11) DEFAULT NULL,
  `ph_line18_ex_id` int(11) DEFAULT NULL,
  `ph_line19_ex_id` int(11) DEFAULT NULL,
  `ph_line20_ex_id` int(11) DEFAULT NULL,
  `ph_filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ph_acceptdata` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ph_line21_ex_id` int(11) DEFAULT NULL,
  `ph_line22_ex_id` int(11) DEFAULT NULL,
  `ph_line23_ex_id` int(11) DEFAULT NULL,
  `ph_line24_ex_id` int(11) DEFAULT NULL,
  `ph_line25_ex_id` int(11) DEFAULT NULL,
  `ph_line26_ex_id` int(11) DEFAULT NULL,
  `ph_line27_ex_id` int(11) DEFAULT NULL,
  `ph_line28_ex_id` int(11) DEFAULT NULL,
  `ph_line29_ex_id` int(11) DEFAULT NULL,
  `ph_line30_ex_id` int(11) DEFAULT NULL,
  `ph_line31_ex_id` int(11) DEFAULT NULL,
  `ph_line32_ex_id` int(11) DEFAULT NULL,
  `ph_line33_ex_id` int(11) DEFAULT NULL,
  `ph_line34_ex_id` int(11) DEFAULT NULL,
  `ph_line35_ex_id` int(11) DEFAULT NULL,
  `ph_line36_ex_id` int(11) DEFAULT NULL,
  `ph_line37_ex_id` int(11) DEFAULT NULL,
  `ph_line38_ex_id` int(11) DEFAULT NULL,
  `ph_line39_ex_id` int(11) DEFAULT NULL,
  `ph_line40_ex_id` int(11) DEFAULT NULL,
  `ph_line41_ex_id` int(11) DEFAULT NULL,
  `ph_line42_ex_id` int(11) DEFAULT NULL,
  `ph_line43_ex_id` int(11) DEFAULT NULL,
  `ph_line44_ex_id` int(11) DEFAULT NULL,
  `ph_line45_ex_id` int(11) DEFAULT NULL,
  `ph_line46_ex_id` int(11) DEFAULT NULL,
  `ph_line47_ex_id` int(11) DEFAULT NULL,
  `ph_line48_ex_id` int(11) DEFAULT NULL,
  `ph_line49_ex_id` int(11) DEFAULT NULL,
  `ph_line50_ex_id` int(11) DEFAULT NULL,
  `ph_http_user` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ph_http_password` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`ph_id`),
  KEY `passwordmac` (`ph_password`,`ph_mac`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=787 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pi_phonebookitems`
--

CREATE TABLE IF NOT EXISTS `pi_phonebookitems` (
  `pi_id` int(11) NOT NULL AUTO_INCREMENT,
  `pi_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pi_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`pi_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=18 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pk_parkinglots`
--

CREATE TABLE IF NOT EXISTS `pk_parkinglots` (
  `pk_id` int(11) NOT NULL AUTO_INCREMENT,
  `pk_te_id` int(11) NOT NULL,
  `pk_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pk_start` int(11) NOT NULL,
  `pk_end` int(11) NOT NULL,
  `pk_hosted` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`pk_id`),
  KEY `pk_te_id` (`pk_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1427 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pl_phonebooklayouts`
--

CREATE TABLE IF NOT EXISTS `pl_phonebooklayouts` (
  `pl_id` int(11) NOT NULL AUTO_INCREMENT,
  `pl_te_id` int(11) NOT NULL,
  `pl_pb_id` int(11) NOT NULL,
  `pl_pi_id` int(11) NOT NULL,
  `pl_order` int(11) NOT NULL,
  PRIMARY KEY (`pl_id`),
  KEY `pl_te_id` (`pl_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1811 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pl_phonebuttonlayouts`
--

CREATE TABLE IF NOT EXISTS `pl_phonebuttonlayouts` (
  `pl_id` int(11) NOT NULL AUTO_INCREMENT,
  `pl_te_id` int(11) NOT NULL,
  `pl_ph_id` int(11) NOT NULL,
  `pl_bl_id` int(11) NOT NULL,
  `pl_order` int(11) NOT NULL,
  PRIMARY KEY (`pl_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=947 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pl_provisioninglogs`
--

CREATE TABLE IF NOT EXISTS `pl_provisioninglogs` (
  `pl_id` int(11) NOT NULL AUTO_INCREMENT,
  `pl_te_id` int(11) NOT NULL,
  `pl_key` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `pl_mac` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `pl_datetime` datetime NOT NULL,
  `pl_file` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `pl_result` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `pl_ip` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `pl_useragent` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pl_https` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`pl_id`),
  KEY `pl_te_id` (`pl_te_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pm_phonemodels`
--

CREATE TABLE IF NOT EXISTS `pm_phonemodels` (
  `pm_id` int(11) NOT NULL AUTO_INCREMENT,
  `pm_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pm_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pm_mac` longblob NOT NULL,
  `pm_startline` int(11) NOT NULL,
  `pm_endline` int(11) NOT NULL,
  `pm_directory` longblob NOT NULL,
  `pm_locked` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `pm_lockpassword` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pm_remotepost` longblob NOT NULL,
  `pm_remoteposturl` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pm_remotepostuser` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pm_remotepostpassword` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pm_provisioningsuffix` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`pm_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=307 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pp_panelpositions`
--

CREATE TABLE IF NOT EXISTS `pp_panelpositions` (
  `pp_id` int(11) NOT NULL AUTO_INCREMENT,
  `pp_us_id` int(11) NOT NULL,
  `pp_te_id` int(11) NOT NULL,
  `pp_obj_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `pp_obj_id` int(11) NOT NULL,
  `pp_pos_x` int(11) NOT NULL,
  `pp_pos_y` int(11) NOT NULL,
  PRIMARY KEY (`pp_id`),
  UNIQUE KEY `pp_us_id` (`pp_us_id`,`pp_te_id`,`pp_obj_type`,`pp_obj_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pp_phonephonebooks`
--

CREATE TABLE IF NOT EXISTS `pp_phonephonebooks` (
  `pp_id` int(11) NOT NULL AUTO_INCREMENT,
  `pp_te_id` int(11) NOT NULL,
  `pp_ph_id` int(11) NOT NULL,
  `pp_pb_id` int(11) NOT NULL,
  `pp_order` int(11) NOT NULL,
  PRIMARY KEY (`pp_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1043 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pp_profileprivileges`
--

CREATE TABLE IF NOT EXISTS `pp_profileprivileges` (
  `pp_id` int(11) NOT NULL AUTO_INCREMENT,
  `pp_up_id` int(11) NOT NULL,
  `pp_ug_id` int(11) NOT NULL,
  `pp_param1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pp_param2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pp_param3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pp_param4` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pp_param5` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`pp_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=13795 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pr_parkinglotsreturns`
--

CREATE TABLE IF NOT EXISTS `pr_parkinglotsreturns` (
  `pr_id` int(11) NOT NULL AUTO_INCREMENT,
  `pr_te_id` int(11) NOT NULL,
  `pr_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_dialback` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_comment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`pr_id`),
  KEY `pr_te_id` (`pr_te_id`,`pr_number`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=420 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pr_privacy`
--

CREATE TABLE IF NOT EXISTS `pr_privacy` (
  `pr_id` int(11) NOT NULL AUTO_INCREMENT,
  `pr_te_id` int(11) NOT NULL,
  `pr_callerid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_action` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_media` longblob NOT NULL,
  `pr_datetime` datetime NOT NULL,
  PRIMARY KEY (`pr_id`),
  UNIQUE KEY `pr_teid_callerid` (`pr_te_id`,`pr_callerid`),
  KEY `pr_te_id` (`pr_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=84 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `pr_providers`
--

CREATE TABLE IF NOT EXISTS `pr_providers` (
  `pr_id` int(11) NOT NULL AUTO_INCREMENT,
  `pr_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_peername` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_tech` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `pr_penalty` bigint(20) NOT NULL,
  `pr_header1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_header2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_header3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_disabled` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `pr_uselcr` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `pr_ca_id` int(11) NOT NULL,
  `pr_tech_id` int(11) NOT NULL,
  `pr_userealtime` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `pr_adddigits` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_deldigits` int(11) NOT NULL,
  `pr_callerpres` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pr_smsurl` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_smspost` text COLLATE utf8_unicode_ci,
  `pr_smsuser` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_smspassword` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_calleridregex` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_smsprotocol` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_smsprovider` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_header4` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_header5` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_header6` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_inboundadddigits` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_inbounddeldigits` int(11) NOT NULL DEFAULT '0',
  `pr_allowcustomext` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `pr_httpcontenttype` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`pr_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=387 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_aors`
--

CREATE TABLE IF NOT EXISTS `ps_aors` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `contact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `default_expiration` int(11) DEFAULT NULL,
  `mailboxes` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `max_contacts` int(11) DEFAULT NULL,
  `minimum_expiration` int(11) DEFAULT NULL,
  `remove_existing` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `qualify_frequency` int(11) DEFAULT NULL,
  `authenticate_qualify` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `maximum_expiration` int(11) DEFAULT NULL,
  `outbound_proxy` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `support_path` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `qualify_timeout` float DEFAULT NULL,
  `voicemail_extension` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_aors_id` (`id`),
  KEY `ps_aors_qualifyfreq_contact` (`qualify_frequency`,`contact`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_asterisk_publications`
--

CREATE TABLE IF NOT EXISTS `ps_asterisk_publications` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `devicestate_publish` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailboxstate_publish` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `device_state` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `device_state_filter` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailbox_state` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailbox_state_filter` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_asterisk_publications_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_auths`
--

CREATE TABLE IF NOT EXISTS `ps_auths` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `auth_type` enum('md5','userpass') COLLATE utf8_unicode_ci DEFAULT NULL,
  `nonce_lifetime` int(11) DEFAULT NULL,
  `md5_cred` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `password` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `realm` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `username` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_auths_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_contacts`
--

CREATE TABLE IF NOT EXISTS `ps_contacts` (
  `id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `uri` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `expiration_time` bigint(20) DEFAULT NULL,
  `qualify_frequency` int(11) DEFAULT NULL,
  `outbound_proxy` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `path` text COLLATE utf8_unicode_ci,
  `user_agent` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `qualify_timeout` float DEFAULT NULL,
  `reg_server` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `authenticate_qualify` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `via_addr` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `via_port` int(11) DEFAULT NULL,
  `call_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `endpoint` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `prune_on_boot` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  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 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura stand-in per le viste `ps_contacts_portal`
--
CREATE TABLE IF NOT EXISTS `ps_contacts_portal` (
`id` varchar(255)
,`uri` varchar(255)
,`expiration_time` bigint(20)
,`qualify_frequency` int(11)
,`outbound_proxy` varchar(40)
,`path` text
,`user_agent` varchar(255)
,`qualify_timeout` float
,`reg_server` varchar(20)
,`authenticate_qualify` enum('yes','no')
,`via_addr` varchar(40)
,`via_port` int(11)
,`call_id` varchar(255)
,`endpoint` varchar(40)
,`prune_on_boot` enum('yes','no')
);
-- --------------------------------------------------------

--
-- Struttura stand-in per le viste `ps_contacts_srv02`
--
CREATE TABLE IF NOT EXISTS `ps_contacts_srv02` (
`id` varchar(255)
,`uri` varchar(255)
,`expiration_time` bigint(20)
,`qualify_frequency` int(11)
,`outbound_proxy` varchar(40)
,`path` text
,`user_agent` varchar(255)
,`qualify_timeout` float
,`reg_server` varchar(20)
,`authenticate_qualify` enum('yes','no')
,`via_addr` varchar(40)
,`via_port` int(11)
,`call_id` varchar(255)
,`endpoint` varchar(40)
,`prune_on_boot` enum('yes','no')
);
-- --------------------------------------------------------

--
-- Struttura stand-in per le viste `ps_contacts_test`
--
CREATE TABLE IF NOT EXISTS `ps_contacts_test` (
`id` varchar(255)
,`uri` varchar(255)
,`expiration_time` bigint(20)
,`qualify_frequency` int(11)
,`outbound_proxy` varchar(40)
,`path` text
,`user_agent` varchar(255)
,`qualify_timeout` float
,`reg_server` varchar(20)
,`authenticate_qualify` enum('yes','no')
,`via_addr` varchar(40)
,`via_port` int(11)
,`call_id` varchar(255)
,`endpoint` varchar(40)
,`prune_on_boot` enum('yes','no')
);
-- --------------------------------------------------------

--
-- Struttura della tabella `ps_domain_aliases`
--

CREATE TABLE IF NOT EXISTS `ps_domain_aliases` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `domain` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_domain_aliases_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_endpoints`
--

CREATE TABLE IF NOT EXISTS `ps_endpoints` (
  `tech_id` int(11) NOT NULL AUTO_INCREMENT,
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `te_id` int(11) NOT NULL,
  `transport` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `aors` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `auth` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `context` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `disallow` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `allow` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `direct_media` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `connected_line_method` enum('invite','reinvite','update') COLLATE utf8_unicode_ci DEFAULT NULL,
  `direct_media_method` enum('invite','reinvite','update') COLLATE utf8_unicode_ci DEFAULT NULL,
  `direct_media_glare_mitigation` enum('none','outgoing','incoming') COLLATE utf8_unicode_ci DEFAULT NULL,
  `disable_direct_media_on_nat` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtmf_mode` enum('rfc4733','inband','info','auto') COLLATE utf8_unicode_ci DEFAULT NULL,
  `external_media_address` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `force_rport` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `ice_support` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `identify_by` enum('username','auth_username') COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailboxes` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `moh_suggest` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `outbound_auth` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `outbound_proxy` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `rewrite_contact` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `rtp_ipv6` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `rtp_symmetric` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `send_diversion` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `send_pai` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `send_rpid` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `timers_min_se` int(11) DEFAULT NULL,
  `timers` enum('forced','no','required','yes') COLLATE utf8_unicode_ci DEFAULT NULL,
  `timers_sess_expires` int(11) DEFAULT NULL,
  `callerid` varchar(40) COLLATE utf8_unicode_ci 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') COLLATE utf8_unicode_ci DEFAULT NULL,
  `callerid_tag` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `100rel` enum('no','required','yes') COLLATE utf8_unicode_ci DEFAULT NULL,
  `aggregate_mwi` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `trust_id_inbound` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `trust_id_outbound` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `use_ptime` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `use_avpf` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `media_encryption` enum('no','sdes','dtls') COLLATE utf8_unicode_ci DEFAULT NULL,
  `inband_progress` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `call_group` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `pickup_group` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `named_call_group` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `named_pickup_group` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `device_state_busy_at` int(11) DEFAULT NULL,
  `fax_detect` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `t38_udptl` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `t38_udptl_ec` enum('none','fec','redundancy') COLLATE utf8_unicode_ci DEFAULT NULL,
  `t38_udptl_maxdatagram` int(11) DEFAULT NULL,
  `t38_udptl_nat` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `t38_udptl_ipv6` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `tone_zone` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `language` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `one_touch_recording` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `record_on_feature` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `record_off_feature` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `rtp_engine` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `allow_transfer` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `allow_subscribe` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT 'yes',
  `sdp_owner` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sdp_session` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `tos_audio` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `tos_video` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sub_min_expiry` int(11) DEFAULT NULL,
  `from_domain` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `from_user` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mwi_from_user` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtls_verify` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtls_rekey` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtls_cert_file` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtls_private_key` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtls_cipher` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtls_ca_file` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtls_ca_path` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtls_setup` enum('active','passive','actpass') COLLATE utf8_unicode_ci DEFAULT NULL,
  `srtp_tag_32` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `media_address` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `redirect_method` enum('user','uri_core','uri_pjsip') COLLATE utf8_unicode_ci DEFAULT NULL,
  `set_var` text COLLATE utf8_unicode_ci,
  `message_context` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `force_avp` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `media_use_received_transport` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `accountcode` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `media_encryption_optimistic` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `user_eq_phone` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `rpid_immediate` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `g726_non_standard` enum('yes','no') COLLATE utf8_unicode_ci 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') COLLATE utf8_unicode_ci DEFAULT NULL,
  `cos_audio` int(11) DEFAULT NULL,
  `cos_video` int(11) DEFAULT NULL,
  `deny` varchar(95) COLLATE utf8_unicode_ci DEFAULT NULL,
  `permit` varchar(95) COLLATE utf8_unicode_ci DEFAULT NULL,
  `acl` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_deny` varchar(95) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_permit` varchar(95) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_acl` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `voicemail_extension` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mwi_subscribe_replaces_unsolicited` int(11) DEFAULT NULL,
  `subscribe_context` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `fax_detect_timeout` int(11) DEFAULT NULL,
  `contact_user` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `asymmetric_rtp_codec` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`tech_id`),
  UNIQUE KEY `id` (`id`),
  KEY `ps_endpoints_id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=179 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_endpoint_id_ips`
--

CREATE TABLE IF NOT EXISTS `ps_endpoint_id_ips` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `endpoint` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `match` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_endpoint_id_ips_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_globals`
--

CREATE TABLE IF NOT EXISTS `ps_globals` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `max_forwards` int(11) DEFAULT NULL,
  `user_agent` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `default_outbound_endpoint` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `debug` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `endpoint_identifier_order` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `max_initial_qualify_time` int(11) DEFAULT NULL,
  `default_from_user` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `keep_alive_interval` int(11) DEFAULT NULL,
  `regcontext` varchar(80) COLLATE utf8_unicode_ci 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) COLLATE utf8_unicode_ci DEFAULT NULL,
  `disable_multi_domain` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `default_voicemail_extension` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_expiration_check_interval` int(11) 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') COLLATE utf8_unicode_ci DEFAULT NULL,
  `ignore_uri_user_options` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_globals_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_inbound_publications`
--

CREATE TABLE IF NOT EXISTS `ps_inbound_publications` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `endpoint` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `event_asterisk-devicestate` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `event_asterisk-mwi` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_inbound_publications_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_outbound_publishes`
--

CREATE TABLE IF NOT EXISTS `ps_outbound_publishes` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `expiration` int(11) DEFAULT NULL,
  `outbound_auth` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `outbound_proxy` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `server_uri` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `from_uri` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `to_uri` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `event` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `max_auth_attempts` int(11) DEFAULT NULL,
  `transport` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `multi_user` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `@body` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `@context` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `@exten` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_outbound_publishes_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_registrations`
--

CREATE TABLE IF NOT EXISTS `ps_registrations` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `auth_rejection_permanent` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `client_uri` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_user` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `expiration` int(11) DEFAULT NULL,
  `max_retries` int(11) DEFAULT NULL,
  `outbound_auth` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `outbound_proxy` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `retry_interval` int(11) DEFAULT NULL,
  `forbidden_retry_interval` int(11) DEFAULT NULL,
  `server_uri` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `transport` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `support_path` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `fatal_retry_interval` int(11) DEFAULT NULL,
  `line` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `endpoint` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_registrations_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_resource_list`
--

CREATE TABLE IF NOT EXISTS `ps_resource_list` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `list_item` varchar(2048) COLLATE utf8_unicode_ci DEFAULT NULL,
  `event` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `full_state` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `notification_batch_interval` int(11) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_resource_list_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_subscription_persistence`
--

CREATE TABLE IF NOT EXISTS `ps_subscription_persistence` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `packet` varchar(2048) COLLATE utf8_unicode_ci DEFAULT NULL,
  `src_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `src_port` int(11) DEFAULT NULL,
  `transport_key` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
  `local_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `local_port` int(11) DEFAULT NULL,
  `cseq` int(11) DEFAULT NULL,
  `tag` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `endpoint` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `expires` int(11) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_subscription_persistence_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_systems`
--

CREATE TABLE IF NOT EXISTS `ps_systems` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `timer_t1` int(11) DEFAULT NULL,
  `timer_b` int(11) DEFAULT NULL,
  `compact_headers` enum('yes','no') COLLATE utf8_unicode_ci 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') COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_systems_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ps_transports`
--

CREATE TABLE IF NOT EXISTS `ps_transports` (
  `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `async_operations` int(11) DEFAULT NULL,
  `bind` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ca_list_file` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cert_file` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cipher` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `domain` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `external_media_address` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `external_signaling_address` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `external_signaling_port` int(11) DEFAULT NULL,
  `method` enum('default','unspecified','tlsv1','sslv2','sslv3','sslv23') COLLATE utf8_unicode_ci DEFAULT NULL,
  `local_net` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `password` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `priv_key_file` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `protocol` enum('udp','tcp','tls','ws','wss') COLLATE utf8_unicode_ci DEFAULT NULL,
  `require_client_cert` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `verify_client` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `verify_server` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `tos` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `allow_reload` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `cos` int(11) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `ps_transports_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `qa_queueabandonednotified`
--

CREATE TABLE IF NOT EXISTS `qa_queueabandonednotified` (
  `qa_id` int(11) NOT NULL AUTO_INCREMENT,
  `qa_te_id` int(11) NOT NULL,
  `qa_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `qa_qu_id` int(11) NOT NULL,
  `qa_uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `qa_status` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`qa_id`),
  KEY `qa_uniqueid` (`qa_uniqueid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `qc_queuecallbacks`
--

CREATE TABLE IF NOT EXISTS `qc_queuecallbacks` (
  `qc_id` int(11) NOT NULL AUTO_INCREMENT,
  `qc_te_id` int(11) NOT NULL,
  `qc_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `qc_qu_id` int(11) NOT NULL,
  `qc_uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `qc_status` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `qc_times` int(11) NOT NULL DEFAULT '0',
  `qc_callsource` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  PRIMARY KEY (`qc_id`),
  KEY `qc_uniqueid` (`qc_uniqueid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=131 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `queue`
--

CREATE TABLE IF NOT EXISTS `queue` (
  `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `musiconhold` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `announce` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `context` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `timeout` int(11) DEFAULT NULL,
  `monitor_join` tinyint(1) DEFAULT NULL,
  `monitor_format` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_youarenext` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_thereare` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_callswaiting` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_holdtime` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_minutes` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_seconds` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_lessthan` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_thankyou` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_reporthold` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `announce_frequency` int(11) DEFAULT NULL,
  `announce_round_seconds` int(11) DEFAULT NULL,
  `announce_holdtime` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `retry` int(11) DEFAULT NULL,
  `wrapuptime` int(11) DEFAULT NULL,
  `maxlen` int(11) DEFAULT NULL,
  `servicelevel` int(11) DEFAULT NULL,
  `strategy` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `joinempty` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `leavewhenempty` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `eventmemberstatus` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `eventwhencalled` tinyint(1) DEFAULT NULL,
  `reportholdtime` tinyint(1) DEFAULT NULL,
  `memberdelay` int(11) DEFAULT NULL,
  `weight` int(11) DEFAULT NULL,
  `timeoutrestart` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `periodic_announce` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  `periodic_announce_frequency` int(11) DEFAULT NULL,
  `ringinuse` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `setinterfacevar` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `announce_position` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `announce_position_limit` int(11) NOT NULL,
  `setqueueentryvar` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `setqueuevar` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `autofill` varchar(10) COLLATE utf8_unicode_ci DEFAULT 'no',
  `autopause` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `relative_periodic_announce` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `queue_log`
--

CREATE TABLE IF NOT EXISTS `queue_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `time` datetime DEFAULT NULL,
  `callid` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queuename` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `agent` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `event` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `data1` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `data2` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `data3` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `data4` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `data5` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `bydate` (`time`),
  KEY `qname` (`queuename`,`time`),
  KEY `callid` (`callid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10969203 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `queue_member`
--

CREATE TABLE IF NOT EXISTS `queue_member` (
  `uniqueid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `membername` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `queue_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `interface` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state_interface` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `penalty` int(11) DEFAULT NULL,
  `paused` int(11) DEFAULT NULL,
  `member_device` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`uniqueid`),
  UNIQUE KEY `queue_interface` (`queue_name`,`interface`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=37507 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `qu_queues`
--

CREATE TABLE IF NOT EXISTS `qu_queues` (
  `qu_id` int(11) NOT NULL AUTO_INCREMENT,
  `qu_te_id` int(11) NOT NULL,
  `qu_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `qu_hosted` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `qu_alwaysrecord` varchar(16) COLLATE utf8_unicode_ci DEFAULT 'no',
  `qu_timeout` int(11) NOT NULL,
  `qu_parameters` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `qu_youarenext_me_id` int(11) NOT NULL,
  `qu_thereare_me_id` int(11) NOT NULL,
  `qu_callswaiting_me_id` int(11) NOT NULL,
  `qu_thankyou_me_id` int(11) NOT NULL,
  `qu_periodic_announce_me_id` int(11) NOT NULL,
  `qu_nobodyhome` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `qu_ringinuse` varchar(40) COLLATE utf8_unicode_ci DEFAULT '',
  `qu_calltimeout` int(11) NOT NULL DEFAULT '7200',
  `qu_agent_announce_me_id` int(11) NOT NULL,
  `qu_id_text` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `qu_number` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `qu_callbackabandoned` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `qu_callbackwhenfree` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `qu_callbackabandonedstart` datetime DEFAULT NULL,
  `qu_callbackcalleridname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `qu_callbackcalleridnum` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `qu_callbackmaxattempts` int(11) NOT NULL DEFAULT '1',
  `qu_nofreemember` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  `qu_ivr_id` int(11) NOT NULL DEFAULT '0',
  `qu_agent_ag_id` int(11) NOT NULL DEFAULT '0',
  `qu_notifyabandoned` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `qu_notifyabandonedemail` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `qu_notifyabandonedstart` datetime DEFAULT NULL,
  `qu_holdtime_me_id` int(11) NOT NULL DEFAULT '0',
  `qu_callback` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `qu_agent_confirmmessage_me_id` int(11) NOT NULL DEFAULT '0',
  `qu_agentname` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'EXTENSION',
  `qu_allowoptimization` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`qu_id`),
  KEY `qu_te_id` (`qu_te_id`),
  KEY `qu_notifyabandoned` (`qu_notifyabandoned`,`qu_hosted`),
  KEY `qu_callbackabandoned` (`qu_callbackabandoned`,`qu_hosted`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3716 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ra_rates`
--

CREATE TABLE IF NOT EXISTS `ra_rates` (
  `ra_id` int(11) NOT NULL AUTO_INCREMENT,
  `ra_cl_id` int(11) NOT NULL,
  `ra_prefix` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ra_country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ra_network` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ra_setup` decimal(10,5) NOT NULL,
  `ra_cost` decimal(10,5) NOT NULL,
  `ra_roundingtime` int(11) NOT NULL DEFAULT '1',
  `ra_minimumcost` decimal(10,5) NOT NULL,
  `ra_roundingcost` int(11) NOT NULL DEFAULT '5',
  PRIMARY KEY (`ra_id`),
  KEY `ra_cl_id` (`ra_cl_id`),
  KEY `ra_cl_id_2` (`ra_cl_id`,`ra_country`),
  KEY `ra_cl_id_3` (`ra_cl_id`,`ra_network`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=675415 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `rd_reportsdata`
--

CREATE TABLE IF NOT EXISTS `rd_reportsdata` (
  `rd_id` int(11) NOT NULL AUTO_INCREMENT,
  `rd_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `rd_te_id` int(11) NOT NULL,
  `rd_re_id` int(11) NOT NULL,
  `rd_size` int(11) NOT NULL,
  `rd_datestart` datetime NOT NULL,
  `rd_dateend` datetime NOT NULL,
  `rd_expires` datetime NOT NULL,
  `rd_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rd_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `rd_format` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'pdf',
  PRIMARY KEY (`rd_id`),
  KEY `rd_te_id` (`rd_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=30371 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `rd_reportsdata_bin`
--

CREATE TABLE IF NOT EXISTS `rd_reportsdata_bin` (
  `rd_bin_id` int(11) NOT NULL,
  `rd_bin` longblob NOT NULL,
  PRIMARY KEY (`rd_bin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `re_recordings`
--

CREATE TABLE IF NOT EXISTS `re_recordings` (
  `re_id` int(11) NOT NULL AUTO_INCREMENT,
  `re_te_id` int(11) NOT NULL,
  `re_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `re_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `re_format` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `re_uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `re_size` int(11) NOT NULL,
  `re_data` longblob NOT NULL,
  PRIMARY KEY (`re_id`),
  KEY `re_te_id` (`re_te_id`,`re_uniqueid`),
  KEY `re_te_id_2` (`re_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=18867 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `re_regions`
--

CREATE TABLE IF NOT EXISTS `re_regions` (
  `re_id` int(11) NOT NULL AUTO_INCREMENT,
  `re_protocol` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `re_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `re_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`re_id`),
  KEY `re_protocol` (`re_protocol`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=26 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `re_reports`
--

CREATE TABLE IF NOT EXISTS `re_reports` (
  `re_id` int(11) NOT NULL AUTO_INCREMENT,
  `re_te_id` int(11) NOT NULL,
  `re_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `re_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `re_parameters` longblob NOT NULL,
  `re_holding` int(11) NOT NULL,
  `re_cr_id` int(11) NOT NULL DEFAULT '0',
  `re_et_id` int(11) NOT NULL DEFAULT '0',
  `re_email` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`re_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=115 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `re_rtpanelextensions`
--

CREATE TABLE IF NOT EXISTS `re_rtpanelextensions` (
  `re_id` int(11) NOT NULL AUTO_INCREMENT,
  `re_te_id` int(11) NOT NULL,
  `re_rp_id` int(11) NOT NULL,
  `re_ex_id` int(11) NOT NULL,
  PRIMARY KEY (`re_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=227 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ri_rings`
--

CREATE TABLE IF NOT EXISTS `ri_rings` (
  `ri_id` int(11) NOT NULL AUTO_INCREMENT,
  `ri_code` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ri_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ri_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `rp_realtimepanels`
--

CREATE TABLE IF NOT EXISTS `rp_realtimepanels` (
  `rp_id` int(11) NOT NULL AUTO_INCREMENT,
  `rp_te_id` int(11) NOT NULL,
  `rp_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rp_description` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`rp_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=227 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `rp_responsepaths`
--

CREATE TABLE IF NOT EXISTS `rp_responsepaths` (
  `rp_id` int(11) NOT NULL AUTO_INCREMENT,
  `rp_te_id` int(11) NOT NULL,
  `rp_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rp_holddays` int(11) NOT NULL DEFAULT '0',
  `rp_xmldata` longblob,
  PRIMARY KEY (`rp_id`),
  KEY `rp_te_id` (`rp_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=36 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `rp_routingprofiles`
--

CREATE TABLE IF NOT EXISTS `rp_routingprofiles` (
  `rp_id` int(11) NOT NULL AUTO_INCREMENT,
  `rp_name` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `rp_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rp_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'VOICE',
  PRIMARY KEY (`rp_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=99 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `rr_calleridregex_rules`
--

CREATE TABLE IF NOT EXISTS `rr_calleridregex_rules` (
  `rr_id` int(11) NOT NULL AUTO_INCREMENT,
  `rr_te_id` int(11) NOT NULL,
  `rr_cr_id` int(11) NOT NULL,
  `rr_regex` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rr_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rr_comment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`rr_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=22 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `rr_conferenceroomsrates`
--

CREATE TABLE IF NOT EXISTS `rr_conferenceroomsrates` (
  `rr_id` int(11) NOT NULL AUTO_INCREMENT,
  `rr_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rr_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rr_setup` decimal(10,5) NOT NULL,
  `rr_cost` decimal(10,5) NOT NULL,
  `rr_rounding` int(11) NOT NULL,
  PRIMARY KEY (`rr_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `rr_responsepathresponses`
--

CREATE TABLE IF NOT EXISTS `rr_responsepathresponses` (
  `rr_id` int(11) NOT NULL AUTO_INCREMENT,
  `rr_te_id` int(11) NOT NULL,
  `rr_rp_id` int(11) NOT NULL,
  `rr_uniqueid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rr_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rr_type_id` int(11) NOT NULL,
  `rr_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rr_type_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rr_value_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`rr_id`),
  KEY `rr_rp_id` (`rr_rp_id`),
  KEY `rr_te_id` (`rr_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4115 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `rt_rtpanelpositions`
--

CREATE TABLE IF NOT EXISTS `rt_rtpanelpositions` (
  `rt_id` int(11) NOT NULL AUTO_INCREMENT,
  `rt_rp_id` int(11) NOT NULL,
  `rt_te_id` int(11) NOT NULL,
  `rt_obj_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `rt_obj_id` int(11) NOT NULL,
  `rt_pos_x` decimal(20,17) NOT NULL,
  `rt_pos_y` decimal(20,17) NOT NULL,
  `rt_size` int(11) NOT NULL DEFAULT '100',
  PRIMARY KEY (`rt_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4819 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `sessions2`
--

CREATE TABLE IF NOT EXISTS `sessions2` (
  `sesskey` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `expiry` datetime NOT NULL,
  `expireref` varchar(250) COLLATE utf8_unicode_ci DEFAULT '',
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  `sessdata` longtext COLLATE utf8_unicode_ci,
  PRIMARY KEY (`sesskey`),
  KEY `sess2_expiry` (`expiry`),
  KEY `sess2_expireref` (`expireref`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `se_settings`
--

CREATE TABLE IF NOT EXISTS `se_settings` (
  `se_id` int(11) NOT NULL AUTO_INCREMENT,
  `se_te_id` int(11) NOT NULL,
  `se_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `se_value` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`se_id`),
  UNIQUE KEY `se_te_id` (`se_te_id`,`se_code`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=433331 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `se_settings_max`
--

CREATE TABLE IF NOT EXISTS `se_settings_max` (
  `se_id` int(11) NOT NULL AUTO_INCREMENT,
  `se_te_id` int(11) NOT NULL,
  `se_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `se_value` longblob NOT NULL,
  PRIMARY KEY (`se_id`),
  UNIQUE KEY `se_te_id` (`se_te_id`,`se_code`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=78819 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `sipfriends`
--

CREATE TABLE IF NOT EXISTS `sipfriends` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `te_id` int(11) NOT NULL,
  `name` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ipaddr` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `regseconds` int(11) DEFAULT NULL,
  `defaultuser` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `fullcontact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `regserver` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `useragent` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `lastms` int(11) DEFAULT NULL,
  `host` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `type` enum('friend','user','peer') COLLATE utf8_unicode_ci DEFAULT NULL,
  `context` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `deny` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `permit` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
  `secret` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `md5secret` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `remotesecret` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `transport` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dtmfmode` enum('rfc2833','info','shortinfo','inband','auto') COLLATE utf8_unicode_ci DEFAULT NULL,
  `directmedia` enum('yes','no','nonat','update') COLLATE utf8_unicode_ci DEFAULT NULL,
  `nat` enum('yes','no','never','route','force_rport,comedia','auto_force_rport,auto_comedia') COLLATE utf8_unicode_ci DEFAULT NULL,
  `canreinvite` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `callgroup` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `pickupgroup` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `language` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `disallow` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `allow` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `insecure` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `trustrpid` enum('yes','no','rpid','pai') COLLATE utf8_unicode_ci DEFAULT NULL,
  `progressinband` enum('yes','no','never') COLLATE utf8_unicode_ci DEFAULT NULL,
  `promiscredir` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `useclientcode` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `accountcode` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `setvar` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `callerid` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `amaflags` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `callcounter` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `busylevel` int(11) DEFAULT NULL,
  `allowoverlap` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `allowsubscribe` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `videosupport` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `maxcallbitrate` int(11) DEFAULT NULL,
  `rfc2833compensate` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailbox` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `session-timers` enum('accept','refuse','originate') COLLATE utf8_unicode_ci DEFAULT NULL,
  `session-expires` int(11) DEFAULT NULL,
  `session-minse` int(11) DEFAULT NULL,
  `session-refresher` enum('uac','uas') COLLATE utf8_unicode_ci DEFAULT NULL,
  `t38pt_usertpsource` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `regexten` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `fromdomain` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `fromuser` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `qualify` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `defaultip` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `rtptimeout` int(11) DEFAULT NULL,
  `rtpholdtimeout` int(11) DEFAULT NULL,
  `sendrpid` enum('yes','no','rpid','pai') COLLATE utf8_unicode_ci DEFAULT NULL,
  `outboundproxy` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `callbackextension` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `registertrying` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `timert1` int(11) DEFAULT NULL,
  `timerb` int(11) DEFAULT NULL,
  `qualifyfreq` int(11) DEFAULT NULL,
  `constantssrc` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `contactpermit` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contactdeny` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `usereqphone` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `textsupport` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `faxdetect` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `buggymwi` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `auth` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `fullname` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `trunkname` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cid_number` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `callingpres` enum('allowed_not_screened','allowed_passed_screen','allowed_failed_screen','allowed','prohib_no\r\nt_screened','prohib_passed_screen','prohib_failed_screen','prohib') COLLATE utf8_unicode_ci DEFAULT NULL,
  `mohinterpret` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mohsuggest` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `parkinglot` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `hasvoicemail` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `subscribemwi` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `vmexten` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `autoframing` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `rtpkeepalive` int(11) DEFAULT NULL,
  `call-limit` int(11) DEFAULT NULL,
  `g726nonstandard` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `ignoresdpversion` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `allowtransfer` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `dynamic` enum('yes','no') COLLATE utf8_unicode_ci DEFAULT NULL,
  `encryption` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `notifyringing` enum('yes','no') COLLATE utf8_unicode_ci NOT NULL,
  `keepalive` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `directrtpsetup` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  `trust_id_outbound` enum('legacy','no','yes') COLLATE utf8_unicode_ci DEFAULT 'legacy',
  `cisco_usecallmanager` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `subscribe` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `register` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `avpf` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `icesupport` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `force_avp` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dtlsenable` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dtlsverify` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dtlscertfile` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dtlsprivatekey` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `dtlssetup` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `dtlscafile` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rtcp_mux` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  KEY `ipaddr` (`ipaddr`,`port`),
  KEY `host` (`host`,`port`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=23251 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `sipregs`
--

CREATE TABLE IF NOT EXISTS `sipregs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `server` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `te_id` int(11) NOT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ipaddr` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `port` smallint(5) unsigned DEFAULT NULL,
  `regseconds` int(10) DEFAULT NULL,
  `defaultuser` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `fullcontact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `regserver` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `useragent` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `lastms` int(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `server` (`server`,`name`),
  KEY `name` (`name`),
  KEY `te_id` (`te_id`),
  KEY `ipaddrport` (`ipaddr`,`port`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=155619 ;

-- --------------------------------------------------------

--
-- Struttura stand-in per le viste `sipregs_portal`
--
CREATE TABLE IF NOT EXISTS `sipregs_portal` (
`id` int(11)
,`server` varchar(100)
,`te_id` int(11)
,`name` varchar(100)
,`ipaddr` varchar(45)
,`port` smallint(5) unsigned
,`regseconds` int(10)
,`defaultuser` varchar(255)
,`fullcontact` varchar(255)
,`regserver` varchar(255)
,`useragent` varchar(255)
,`lastms` int(10)
);
-- --------------------------------------------------------

--
-- Struttura stand-in per le viste `sipregs_srv02`
--
CREATE TABLE IF NOT EXISTS `sipregs_srv02` (
`id` int(11)
,`server` varchar(100)
,`te_id` int(11)
,`name` varchar(100)
,`ipaddr` varchar(45)
,`port` smallint(5) unsigned
,`regseconds` int(10)
,`defaultuser` varchar(255)
,`fullcontact` varchar(255)
,`regserver` varchar(255)
,`useragent` varchar(255)
,`lastms` int(10)
);
-- --------------------------------------------------------

--
-- Struttura della tabella `sl_serverlogs`
--

CREATE TABLE IF NOT EXISTS `sl_serverlogs` (
  `sl_id` int(11) NOT NULL AUTO_INCREMENT,
  `sl_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `sl_peername` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `sl_processname` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `sl_pid` int(11) NOT NULL,
  `sl_severity` int(11) NOT NULL,
  `sl_message` varchar(3000) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`sl_id`),
  KEY `peerprocess` (`sl_peername`,`sl_processname`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=101414371 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `sm_smslogs`
--

CREATE TABLE IF NOT EXISTS `sm_smslogs` (
  `sm_id` int(11) NOT NULL AUTO_INCREMENT,
  `sm_te_id` int(11) NOT NULL,
  `sm_date` datetime NOT NULL,
  `sm_direction` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `sm_sourceraw` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sm_destraw` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sm_from` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sm_to` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sm_body` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sm_response` varchar(512) COLLATE utf8_unicode_ci NOT NULL,
  `sm_fullresult` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`sm_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3011 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `sn_shortnumbers`
--

CREATE TABLE IF NOT EXISTS `sn_shortnumbers` (
  `sn_id` int(11) NOT NULL AUTO_INCREMENT,
  `sn_te_id` int(11) NOT NULL,
  `sn_number` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `sn_destnumber` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sn_comment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`sn_id`),
  KEY `sn_te_id` (`sn_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2004 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `sp_specials`
--

CREATE TABLE IF NOT EXISTS `sp_specials` (
  `sp_id` int(11) NOT NULL AUTO_INCREMENT,
  `sp_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sp_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`sp_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=451 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `sr_sipratestatus`
--

CREATE TABLE IF NOT EXISTS `sr_sipratestatus` (
  `sr_no_id` int(11) NOT NULL,
  `sr_status` longblob NOT NULL,
  PRIMARY KEY (`sr_no_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `ss_smstobesent`
--

CREATE TABLE IF NOT EXISTS `ss_smstobesent` (
  `ss_id` int(11) NOT NULL AUTO_INCREMENT,
  `ss_te_id` int(11) NOT NULL,
  `ss_submitted` datetime NOT NULL,
  `ss_name` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
  `ss_messagefrom` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ss_messagebody` longblob NOT NULL,
  PRIMARY KEY (`ss_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=355 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `st_speechtotexts`
--

CREATE TABLE IF NOT EXISTS `st_speechtotexts` (
  `st_id` int(11) NOT NULL AUTO_INCREMENT,
  `st_speech` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `st_language` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `st_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`st_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=34 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `st_states`
--

CREATE TABLE IF NOT EXISTS `st_states` (
  `st_extension` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `st_state` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `st_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`st_extension`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `st_stats`
--

CREATE TABLE IF NOT EXISTS `st_stats` (
  `st_id` int(11) NOT NULL AUTO_INCREMENT,
  `st_te_id` int(11) NOT NULL,
  `st_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `st_date` datetime NOT NULL,
  `st_stat` longblob,
  PRIMARY KEY (`st_id`),
  KEY `st_te_id` (`st_te_id`,`st_code`,`st_date`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6851 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `tc_tenantconduits`
--

CREATE TABLE IF NOT EXISTS `tc_tenantconduits` (
  `tc_id` int(11) NOT NULL AUTO_INCREMENT,
  `tc_te_id` int(11) NOT NULL,
  `tc_dst_te_id` int(11) NOT NULL,
  `tc_prefix` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `tc_autocallerid` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'on',
  `tc_switchtenant` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  PRIMARY KEY (`tc_id`),
  KEY `tc_te_id` (`tc_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=84 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `te_tenants`
--

CREATE TABLE IF NOT EXISTS `te_tenants` (
  `te_id` int(11) NOT NULL AUTO_INCREMENT,
  `te_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_alertemail` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_timezone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_cl_id` int(11) NOT NULL,
  `te_payment_type` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `te_rp_id` int(11) DEFAULT NULL,
  `te_billingcode` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_maxextensions` int(11) NOT NULL DEFAULT '-1',
  `te_maxivrs` int(11) NOT NULL DEFAULT '-1',
  `te_maxhunts` int(11) NOT NULL DEFAULT '-1',
  `te_maxconferences` int(11) NOT NULL DEFAULT '-1',
  `te_maxqueues` int(11) NOT NULL DEFAULT '-1',
  `te_maxdisas` int(11) NOT NULL DEFAULT '-1',
  `te_maxvoicemails` int(11) NOT NULL DEFAULT '-1',
  `te_maxchannels` int(11) NOT NULL,
  `te_maxcampaigns` int(11) NOT NULL DEFAULT '-1',
  `te_disabled` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `te_maxdids` int(11) NOT NULL DEFAULT '-1',
  `te_maxmediafiles` int(11) NOT NULL DEFAULT '-1',
  `te_maxconditions` int(11) NOT NULL DEFAULT '-1',
  `te_maxpagings` int(11) NOT NULL DEFAULT '-1',
  `te_maxflows` int(11) NOT NULL DEFAULT '-1',
  `te_maxcustoms` int(11) NOT NULL DEFAULT '-1',
  `te_maxfeatures` int(11) NOT NULL DEFAULT '-1',
  `te_maxshortnumbers` int(11) NOT NULL DEFAULT '-1',
  `te_maxcalleridblacklist` int(11) NOT NULL DEFAULT '-1',
  `te_maxagiscripts` int(11) NOT NULL DEFAULT '-1',
  `te_maxconduits` int(11) NOT NULL DEFAULT '-1',
  `te_maxphonebooks` int(11) NOT NULL DEFAULT '-1',
  `te_maxprovisioning` int(11) NOT NULL DEFAULT '-1',
  `te_prefixbillingcode` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `te_allowonnet` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'on',
  `te_allowanycalleridusage` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'on',
  `te_allowinonnet` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'on',
  `te_provisioningdir` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_billonnet` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'on',
  `te_onnetdigitstoadd` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `te_onnetdigitstoremove` int(11) NOT NULL DEFAULT '0',
  `te_recordingstorage` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_passiveftp` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `te_recordinghost` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_recordinguser` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_recordingpassword` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_recordingdirectory` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `te_ca_rp_id` int(11) DEFAULT NULL,
  `te_defaultrrid` int(11) NOT NULL,
  `te_sms_rp_id` int(11) DEFAULT NULL,
  `te_ca_cl_id` int(11) DEFAULT '0',
  `te_costlimits` varchar(10) COLLATE utf8_unicode_ci DEFAULT '',
  `te_dailycostlimit` decimal(10,5) DEFAULT '0.00000',
  `te_dailytenantcostlimit` decimal(10,5) DEFAULT '0.00000',
  `te_monthlytenantcostlimit` decimal(10,5) DEFAULT '0.00000',
  `te_routecostlimit` decimal(10,5) DEFAULT '0.00000',
  `te_cr_no_id` int(11) NOT NULL DEFAULT '0',
  `te_ca_no_id` int(11) NOT NULL DEFAULT '0',
  `te_allowanycalleridforemerg` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `te_abusedetection` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `te_expirationdate` date DEFAULT NULL,
  `te_alertamount` int(11) DEFAULT NULL,
  `te_dailycostlimitdom` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_dailycostlimitint` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_dailytenantcostlimitdom` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_dailytenantcostlimitint` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_monthlytenantcostlimitdom` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_monthlytenantcostlimitint` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_dailycostwarningdom` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_dailycostwarningint` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_dailytenantcostwarningdom` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_dailytenantcostwarningint` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_monthlytenantcostwarningdom` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_monthlytenantcostwarningint` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_lastcostalert` datetime DEFAULT NULL,
  `te_uploadrecordingatcallend` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `te_dailytenantcostwarning` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_monthlytenantcostwarning` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_dailycostwarning` decimal(10,5) NOT NULL DEFAULT '0.00000',
  `te_recordemergency` varchar(5) COLLATE utf8_unicode_ci DEFAULT '',
  `te_recordemergency_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  `te_provisioninghostname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `te_note` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `te_billingtype` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'CDR',
  `te_maxanychannels` int(11) NOT NULL DEFAULT '-1',
  `te_fa_no_id` int(11) NOT NULL DEFAULT '0',
  `te_recordingremovefiles` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`te_id`),
  KEY `te_code` (`te_code`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1443 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `te_texts`
--

CREATE TABLE IF NOT EXISTS `te_texts` (
  `te_id` int(11) NOT NULL AUTO_INCREMENT,
  `te_text` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
  `te_file` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `te_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`te_id`),
  UNIQUE KEY `te_text` (`te_text`,`te_file`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=33203 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `th_themes`
--

CREATE TABLE IF NOT EXISTS `th_themes` (
  `th_id` int(11) NOT NULL AUTO_INCREMENT,
  `th_servernameregex` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_theme` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_toptitle` text COLLATE utf8_unicode_ci NOT NULL,
  `th_company` text COLLATE utf8_unicode_ci NOT NULL,
  `th_logopath` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_companymessage` text COLLATE utf8_unicode_ci NOT NULL,
  `th_companysubmessage` text COLLATE utf8_unicode_ci NOT NULL,
  `th_faviconpath` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_bodyclasses` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_customcss` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_customlogin` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_maxmenuitems` int(11) NOT NULL DEFAULT '30',
  `th_copyright` text COLLATE utf8_unicode_ci NOT NULL,
  `th_maxdestinationitems` int(11) NOT NULL DEFAULT '50',
  `th_maxdatatableitems` int(11) NOT NULL DEFAULT '99',
  `th_customjs` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `th_clustersportal` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
  `th_provisioninghostname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `th_nomenu` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `th_noheader` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `th_additionalmenu` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`th_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=148 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `th_themes_old`
--

CREATE TABLE IF NOT EXISTS `th_themes_old` (
  `th_id` int(11) NOT NULL AUTO_INCREMENT,
  `th_servernameregex` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_theme` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_toptitle` varchar(2000) COLLATE utf8_unicode_ci NOT NULL,
  `th_company` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  `th_logopath` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_companymessage` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  `th_companysubmessage` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  `th_faviconpath` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_bodyclasses` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_customcss` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_customlogin` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `th_maxmenuitems` int(11) NOT NULL DEFAULT '30',
  `th_copyright` varchar(2000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `th_maxdestinationitems` int(11) NOT NULL DEFAULT '50',
  `th_maxdatatableitems` int(11) NOT NULL DEFAULT '99',
  `th_customjs` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `th_clustersportal` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
  `th_provisioninghostname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `th_nomenu` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `th_noheader` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`th_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=148 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `tr_translations`
--

CREATE TABLE IF NOT EXISTS `tr_translations` (
  `tr_id` int(11) NOT NULL AUTO_INCREMENT,
  `tr_language` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `tr_sublanguage` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `tr_translation` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `tr_te_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`tr_id`),
  UNIQUE KEY `language` (`tr_language`,`tr_sublanguage`,`tr_te_hash`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=901571 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `tt_testit_ip`
--

CREATE TABLE IF NOT EXISTS `tt_testit_ip` (
  `tt_id` int(11) NOT NULL AUTO_INCREMENT,
  `tt_ip` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `tt_note` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`tt_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `tv_tenantvariables`
--

CREATE TABLE IF NOT EXISTS `tv_tenantvariables` (
  `tv_id` int(11) NOT NULL AUTO_INCREMENT,
  `tv_te_id` int(11) NOT NULL,
  `tv_al_id` int(11) NOT NULL,
  `tv_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `tv_comment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `tv_locked` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`tv_id`),
  KEY `tv_te_id` (`tv_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=83 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `tz_timezones`
--

CREATE TABLE IF NOT EXISTS `tz_timezones` (
  `tz_id` int(11) NOT NULL AUTO_INCREMENT,
  `tz_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `tz_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `tz_shift` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`tz_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=838 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `uc_userclientrates`
--

CREATE TABLE IF NOT EXISTS `uc_userclientrates` (
  `uc_id` int(11) NOT NULL AUTO_INCREMENT,
  `uc_us_id` int(11) NOT NULL,
  `uc_cl_id` int(11) NOT NULL,
  PRIMARY KEY (`uc_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=355 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ug_userprivileges`
--

CREATE TABLE IF NOT EXISTS `ug_userprivileges` (
  `ug_id` int(11) NOT NULL AUTO_INCREMENT,
  `ug_code` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `ug_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ug_numparams` int(11) NOT NULL,
  PRIMARY KEY (`ug_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=356 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ul_userlogs`
--

CREATE TABLE IF NOT EXISTS `ul_userlogs` (
  `ul_id` int(11) NOT NULL AUTO_INCREMENT,
  `ul_te_id` int(11) NOT NULL,
  `ul_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ul_action` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ul_user` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ul_host` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ul_table` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ul_table_id` int(11) NOT NULL DEFAULT '0',
  `ul_objecttype` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ul_objectvalue` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ul_oldvalues` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  `ul_newvalues` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  `ul_changedvalues` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  `ul_numhost` int(11) NOT NULL,
  `ul_countrycode` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ul_country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ul_table_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ul_useragent` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`ul_id`),
  KEY `hostaction` (`ul_host`,`ul_action`),
  KEY `ul_datetime` (`ul_datetime`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=370499 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `up_userprofiles`
--

CREATE TABLE IF NOT EXISTS `up_userprofiles` (
  `up_id` int(11) NOT NULL AUTO_INCREMENT,
  `up_name` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `up_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `up_reserved` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `up_userpanel` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`up_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=115 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ur_userroutingprofiles`
--

CREATE TABLE IF NOT EXISTS `ur_userroutingprofiles` (
  `ur_id` int(11) NOT NULL AUTO_INCREMENT,
  `ur_us_id` int(11) NOT NULL,
  `ur_rp_id` int(11) NOT NULL,
  PRIMARY KEY (`ur_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1555 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `us_users`
--

CREATE TABLE IF NOT EXISTS `us_users` (
  `us_id` int(11) NOT NULL AUTO_INCREMENT,
  `us_username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `us_password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `us_up_id` int(11) NOT NULL,
  `us_useldap` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `us_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `us_email` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`us_id`),
  KEY `us_username` (`us_username`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1795 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ut_usertenants`
--

CREATE TABLE IF NOT EXISTS `ut_usertenants` (
  `ut_id` int(11) NOT NULL AUTO_INCREMENT,
  `ut_us_id` int(11) NOT NULL,
  `ut_te_id` int(11) NOT NULL,
  UNIQUE KEY `ut_id` (`ut_id`),
  KEY `ut_us_id` (`ut_us_id`,`ut_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=12435 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `uu_useruserprofiles`
--

CREATE TABLE IF NOT EXISTS `uu_useruserprofiles` (
  `uu_id` int(11) NOT NULL AUTO_INCREMENT,
  `uu_us_id` int(11) NOT NULL,
  `uu_up_id` int(11) NOT NULL,
  PRIMARY KEY (`uu_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=243 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ve_versions`
--

CREATE TABLE IF NOT EXISTS `ve_versions` (
  `ve_id` int(11) NOT NULL AUTO_INCREMENT,
  `ve_main` int(11) NOT NULL,
  `ve_release` int(11) NOT NULL,
  `ve_patch` int(11) NOT NULL,
  `ve_message` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  `ve_timestamp` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ve_available` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`ve_id`),
  KEY `ve_main` (`ve_main`,`ve_release`,`ve_patch`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5732771 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ve_virtualextensions`
--

CREATE TABLE IF NOT EXISTS `ve_virtualextensions` (
  `ve_id` int(11) NOT NULL AUTO_INCREMENT,
  `ve_te_id` int(11) NOT NULL,
  `ve_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ve_callerid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ve_securitypin` varchar(25) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`ve_id`),
  KEY `ve_te_id` (`ve_te_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=46372 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ve_voiceengines`
--

CREATE TABLE IF NOT EXISTS `ve_voiceengines` (
  `ve_id` int(11) NOT NULL AUTO_INCREMENT,
  `ve_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ve_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `vi_virtualextensionitems`
--

CREATE TABLE IF NOT EXISTS `vi_virtualextensionitems` (
  `vi_id` int(11) NOT NULL AUTO_INCREMENT,
  `vi_te_id` int(11) NOT NULL,
  `vi_ve_id` int(11) NOT NULL,
  `vi_ex_id` int(11) NOT NULL,
  `vi_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`vi_id`),
  KEY `name` (`vi_name`),
  KEY `vi_ex_id` (`vi_ex_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2900 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `vl_voicemaillog`
--

CREATE TABLE IF NOT EXISTS `vl_voicemaillog` (
  `vl_id` int(11) NOT NULL AUTO_INCREMENT,
  `vl_message_id` int(11) NOT NULL,
  `vl_te_id` int(11) NOT NULL,
  `vl_datetime` datetime NOT NULL,
  `vl_action` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `vl_response` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `vl_action_parameter` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `vl_response_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`vl_id`),
  KEY `vl_te_id` (`vl_te_id`),
  KEY `vl_message_id` (`vl_message_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2867 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `voicemail`
--

CREATE TABLE IF NOT EXISTS `voicemail` (
  `uniqueid` int(11) NOT NULL AUTO_INCREMENT,
  `te_id` int(11) NOT NULL,
  `context` char(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'default',
  `mailbox` char(80) COLLATE utf8_unicode_ci NOT NULL,
  `password` char(80) COLLATE utf8_unicode_ci NOT NULL,
  `fullname` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `pager` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `attach` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `attachfmt` char(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `serveremail` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `language` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `tz` char(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `tzbytenant` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `deletevoicemail` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `saycid` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sendvoicemail` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `review` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `tempgreetwarn` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `operator` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `envelope` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sayduration` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `saydurationm` int(3) DEFAULT NULL,
  `forcename` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `forcegreetings` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `callback` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dialout` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `exitcontext` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `maxmsg` int(5) DEFAULT NULL,
  `volgain` decimal(5,2) DEFAULT NULL,
  `imapuser` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `imappassword` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `welcomeoption` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `category` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fromstring` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `minsecs` int(11) NOT NULL,
  `maxsecs` int(11) NOT NULL DEFAULT '3600',
  `transcript_store` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  `onnewmessage` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `onnewmessageparam2` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ivr_id` int(11) NOT NULL,
  `nextaftercmd` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `onnewmessageparam4` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam5` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam6` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam7` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam8` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam9` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam10` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam11` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam12` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam13` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam14` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `onnewmessageparam15` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `includeindbn` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  PRIMARY KEY (`uniqueid`),
  KEY `te_id` (`te_id`),
  KEY `contextmailbox` (`context`,`mailbox`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10451 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `voicemail_data`
--

CREATE TABLE IF NOT EXISTS `voicemail_data` (
  `filename` char(255) COLLATE utf8_unicode_ci NOT NULL,
  `origmailbox` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `context` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `macrocontext` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `exten` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `priority` int(5) DEFAULT NULL,
  `callerchan` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `callerid` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `origdate` char(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `origtime` int(11) DEFAULT NULL,
  `category` char(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `duration` int(11) DEFAULT NULL,
  PRIMARY KEY (`filename`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Struttura della tabella `voicemail_messages`
--

CREATE TABLE IF NOT EXISTS `voicemail_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dir` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `msgnum` int(11) NOT NULL DEFAULT '0',
  `context` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `macrocontext` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `callerid` char(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `origtime` int(11) DEFAULT NULL,
  `duration` int(11) DEFAULT NULL,
  `recording` longblob,
  `flag` char(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `category` char(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailboxuser` char(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailboxcontext` char(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `msg_id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `transcript` longblob,
  PRIMARY KEY (`id`),
  UNIQUE KEY `dirmsgnum` (`dir`,`msgnum`),
  KEY `voicemail_messages_dir` (`dir`),
  KEY `mailboxcontext` (`mailboxcontext`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2787 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `vo_voices`
--

CREATE TABLE IF NOT EXISTS `vo_voices` (
  `vo_id` int(11) NOT NULL AUTO_INCREMENT,
  `vo_ve_id` int(11) NOT NULL DEFAULT '1',
  `vo_language` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `vo_sublanguage` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `vo_dialect` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `vo_sex` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `vo_index` int(11) NOT NULL,
  `vo_voice` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `vo_voicedescription` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `vo_tts` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`vo_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3731 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `wb_wallboards`
--

CREATE TABLE IF NOT EXISTS `wb_wallboards` (
  `wb_id` int(11) NOT NULL AUTO_INCREMENT,
  `wb_te_id` int(11) NOT NULL,
  `wb_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `wb_description` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
  `wb_timeout` int(11) NOT NULL,
  `wb_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'queues',
  `wb_up_id` int(11) NOT NULL DEFAULT '0',
  `wb_extshow` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'NUMBERS',
  PRIMARY KEY (`wb_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=355 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `wc_ip`
--

CREATE TABLE IF NOT EXISTS `wc_ip` (
  `wc_id` int(11) NOT NULL AUTO_INCREMENT,
  `wc_te_id` int(11) NOT NULL,
  `wc_ip` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `wc_note` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`wc_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `we_wallboardelements`
--

CREATE TABLE IF NOT EXISTS `we_wallboardelements` (
  `we_id` int(11) NOT NULL AUTO_INCREMENT,
  `we_te_id` int(11) DEFAULT NULL,
  `we_wb_id` int(11) DEFAULT NULL,
  `we_xx_id` int(11) DEFAULT NULL,
  `we_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'queues',
  PRIMARY KEY (`we_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1011 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `wi_wallboarditems`
--

CREATE TABLE IF NOT EXISTS `wi_wallboarditems` (
  `wi_id` int(11) NOT NULL AUTO_INCREMENT,
  `wi_code` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `wi_description` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `wi_default_title` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `wi_default_color` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `wi_default_bgcolor` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `wi_default_position` int(11) NOT NULL,
  `wi_default_size` int(11) NOT NULL,
  `wi_default_text_size` int(11) NOT NULL,
  `wi_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `wi_default_title_text_size` int(11) NOT NULL DEFAULT '24',
  `wi_default_color2` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  `wi_default_color3` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  `wi_default_bgcolor2` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  `wi_default_bgcolor3` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  `wi_help` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  PRIMARY KEY (`wi_id`),
  UNIQUE KEY `wi_code` (`wi_code`),
  UNIQUE KEY `wi_code_2` (`wi_code`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=100 ;

-- --------------------------------------------------------

--
-- Struttura della tabella `ws_wallboardstructures`
--

CREATE TABLE IF NOT EXISTS `ws_wallboardstructures` (
  `ws_id` int(11) NOT NULL AUTO_INCREMENT,
  `ws_te_id` int(11) NOT NULL,
  `ws_wb_id` int(11) NOT NULL,
  `ws_wi_id` int(11) NOT NULL,
  `ws_title` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ws_color` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ws_bgcolor` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `ws_position` int(11) NOT NULL,
  `ws_size` int(11) NOT NULL,
  `ws_text_size` int(11) NOT NULL,
  `ws_title_text_size` int(11) NOT NULL DEFAULT '24',
  `ws_color2` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  `ws_color3` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  `ws_bgcolor2` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  `ws_bgcolor3` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  PRIMARY KEY (`ws_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=22435 ;

-- --------------------------------------------------------

--
-- Struttura per la vista `ps_contacts_portal`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`asterisk`@`localhost` SQL SECURITY DEFINER VIEW `ps_contacts_portal` AS select `ps_contacts`.`id` AS `id`,`ps_contacts`.`uri` AS `uri`,`ps_contacts`.`expiration_time` AS `expiration_time`,`ps_contacts`.`qualify_frequency` AS `qualify_frequency`,`ps_contacts`.`outbound_proxy` AS `outbound_proxy`,`ps_contacts`.`path` AS `path`,`ps_contacts`.`user_agent` AS `user_agent`,`ps_contacts`.`qualify_timeout` AS `qualify_timeout`,`ps_contacts`.`reg_server` AS `reg_server`,`ps_contacts`.`authenticate_qualify` AS `authenticate_qualify`,`ps_contacts`.`via_addr` AS `via_addr`,`ps_contacts`.`via_port` AS `via_port`,`ps_contacts`.`call_id` AS `call_id`,`ps_contacts`.`endpoint` AS `endpoint`,`ps_contacts`.`prune_on_boot` AS `prune_on_boot` from `ps_contacts` where (`ps_contacts`.`reg_server` = 'portal.mirtapbx.com');

-- --------------------------------------------------------

--
-- Struttura per la vista `ps_contacts_srv02`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`asterisk`@`localhost` SQL SECURITY DEFINER VIEW `ps_contacts_srv02` AS select `ps_contacts`.`id` AS `id`,`ps_contacts`.`uri` AS `uri`,`ps_contacts`.`expiration_time` AS `expiration_time`,`ps_contacts`.`qualify_frequency` AS `qualify_frequency`,`ps_contacts`.`outbound_proxy` AS `outbound_proxy`,`ps_contacts`.`path` AS `path`,`ps_contacts`.`user_agent` AS `user_agent`,`ps_contacts`.`qualify_timeout` AS `qualify_timeout`,`ps_contacts`.`reg_server` AS `reg_server`,`ps_contacts`.`authenticate_qualify` AS `authenticate_qualify`,`ps_contacts`.`via_addr` AS `via_addr`,`ps_contacts`.`via_port` AS `via_port`,`ps_contacts`.`call_id` AS `call_id`,`ps_contacts`.`endpoint` AS `endpoint`,`ps_contacts`.`prune_on_boot` AS `prune_on_boot` from `ps_contacts` where (`ps_contacts`.`reg_server` = 'srv02');

-- --------------------------------------------------------

--
-- Struttura per la vista `ps_contacts_test`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`asterisk`@`localhost` SQL SECURITY DEFINER VIEW `ps_contacts_test` AS select `ps_contacts`.`id` AS `id`,`ps_contacts`.`uri` AS `uri`,`ps_contacts`.`expiration_time` AS `expiration_time`,`ps_contacts`.`qualify_frequency` AS `qualify_frequency`,`ps_contacts`.`outbound_proxy` AS `outbound_proxy`,`ps_contacts`.`path` AS `path`,`ps_contacts`.`user_agent` AS `user_agent`,`ps_contacts`.`qualify_timeout` AS `qualify_timeout`,`ps_contacts`.`reg_server` AS `reg_server`,`ps_contacts`.`authenticate_qualify` AS `authenticate_qualify`,`ps_contacts`.`via_addr` AS `via_addr`,`ps_contacts`.`via_port` AS `via_port`,`ps_contacts`.`call_id` AS `call_id`,`ps_contacts`.`endpoint` AS `endpoint`,`ps_contacts`.`prune_on_boot` AS `prune_on_boot` from `ps_contacts` where (`ps_contacts`.`reg_server` = 'test');

-- --------------------------------------------------------

--
-- Struttura per la vista `sipregs_portal`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`asterisk`@`localhost` SQL SECURITY DEFINER VIEW `sipregs_portal` AS select `sipregs`.`id` AS `id`,`sipregs`.`server` AS `server`,`sipregs`.`te_id` AS `te_id`,`sipregs`.`name` AS `name`,`sipregs`.`ipaddr` AS `ipaddr`,`sipregs`.`port` AS `port`,`sipregs`.`regseconds` AS `regseconds`,`sipregs`.`defaultuser` AS `defaultuser`,`sipregs`.`fullcontact` AS `fullcontact`,`sipregs`.`regserver` AS `regserver`,`sipregs`.`useragent` AS `useragent`,`sipregs`.`lastms` AS `lastms` from `sipregs` where (`sipregs`.`server` = 'portal.mirtapbx.com');

-- --------------------------------------------------------

--
-- Struttura per la vista `sipregs_srv02`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`asterisk`@`localhost` SQL SECURITY DEFINER VIEW `sipregs_srv02` AS select `sipregs`.`id` AS `id`,`sipregs`.`server` AS `server`,`sipregs`.`te_id` AS `te_id`,`sipregs`.`name` AS `name`,`sipregs`.`ipaddr` AS `ipaddr`,`sipregs`.`port` AS `port`,`sipregs`.`regseconds` AS `regseconds`,`sipregs`.`defaultuser` AS `defaultuser`,`sipregs`.`fullcontact` AS `fullcontact`,`sipregs`.`regserver` AS `regserver`,`sipregs`.`useragent` AS `useragent`,`sipregs`.`lastms` AS `lastms` from `sipregs` where (`sipregs`.`server` = 'srv02');

