Commit f0213cc6 authored by Jirka Hlavacek's avatar Jirka Hlavacek

2428 Remove outcalls and dialpattern tables

parent 0084ed06
......@@ -41,7 +41,6 @@ from xivo_dao.alchemy.ctisheetevents import CtiSheetEvents
from xivo_dao.alchemy.ctistatus import CtiStatus
from xivo_dao.alchemy.dhcp import Dhcp
from xivo_dao.alchemy.dialaction import Dialaction
from xivo_dao.alchemy.dialpattern import DialPattern
from xivo_dao.alchemy.directories import Directories
from xivo_dao.alchemy.entity import Entity
from xivo_dao.alchemy.extension import Extension
......@@ -76,8 +75,6 @@ from xivo_dao.alchemy.meetmefeatures import MeetmeFeatures
from xivo_dao.alchemy.monitoring import Monitoring
from xivo_dao.alchemy.musiconhold import MusicOnHold
from xivo_dao.alchemy.netiface import Netiface
from xivo_dao.alchemy.outcall import Outcall
from xivo_dao.alchemy.outcalltrunk import OutcallTrunk
from xivo_dao.alchemy.paging import Paging
from xivo_dao.alchemy.paginguser import PagingUser
from xivo_dao.alchemy.phonebook import Phonebook
......
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
from sqlalchemy.schema import Column, PrimaryKeyConstraint
from sqlalchemy.types import Integer, String
from xivo_dao.helpers.db_manager import Base
class DialPattern(Base):
__tablename__ = 'dialpattern'
__table_args__ = (
PrimaryKeyConstraint('id'),
)
id = Column(Integer)
type = Column(String(32), nullable=False)
typeid = Column(Integer, nullable=False)
externprefix = Column(String(64))
prefix = Column(String(32))
exten = Column(String(40), nullable=False)
stripnum = Column(Integer)
callerid = Column(String(80))
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
from sqlalchemy.schema import Column, PrimaryKeyConstraint, UniqueConstraint
from sqlalchemy.types import Integer, String, Text
from xivo_dao.helpers.db_manager import Base
class Outcall(Base):
__tablename__ = 'outcall'
__table_args__ = (
PrimaryKeyConstraint('id'),
UniqueConstraint('name'),
)
id = Column(Integer, nullable=False)
name = Column(String(128), nullable=False)
context = Column(String(39), nullable=False)
useenum = Column(Integer, nullable=False, server_default='0')
internal = Column(Integer, nullable=False, server_default='0')
preprocess_subroutine = Column(String(39))
hangupringtime = Column(Integer, nullable=False, server_default='0')
commented = Column(Integer, nullable=False, server_default='0')
description = Column(Text)
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
from sqlalchemy.schema import Column, PrimaryKeyConstraint, Index
from sqlalchemy.types import Integer
from xivo_dao.helpers.db_manager import Base
class OutcallTrunk(Base):
__tablename__ = 'outcalltrunk'
__table_args__ = (
PrimaryKeyConstraint('outcallid', 'trunkfeaturesid'),
Index('outcalltrunk__idx__priority', 'priority'),
)
outcallid = Column(Integer, nullable=False, server_default='0')
trunkfeaturesid = Column(Integer, nullable=False, server_default='0')
priority = Column(Integer, nullable=False, server_default='0')
......@@ -37,7 +37,6 @@ from xivo_dao.alchemy.contextnumbers import ContextNumbers
from xivo_dao.alchemy.ctidirectories import CtiDirectories
from xivo_dao.alchemy.cti_contexts import CtiContexts
from xivo_dao.alchemy.dialaction import Dialaction
from xivo_dao.alchemy.dialpattern import DialPattern
from xivo_dao.alchemy.directories import Directories
from xivo_dao.alchemy.entity import Entity as EntitySchema
from xivo_dao.alchemy.extension import Extension
......@@ -65,7 +64,6 @@ from xivo_dao.alchemy.queueinfo import QueueInfo
from xivo_dao.alchemy.queuemember import QueueMember
from xivo_dao.alchemy.queueskill import QueueSkill
from xivo_dao.alchemy.queueskillrule import QueueSkillRule
from xivo_dao.alchemy.outcall import Outcall
from xivo_dao.alchemy.rightcall import RightCall as CallPermission
from xivo_dao.alchemy.rightcallmember import RightCallMember as UserCallPermission
from xivo_dao.alchemy.sccpdevice import SCCPDevice as SCCPDeviceSchema
......@@ -405,14 +403,6 @@ class DAOTestCase(unittest.TestCase):
self.add_me(incall)
return incall
def add_outcall(self, **kwargs):
kwargs.setdefault('name', 'outcall_name')
kwargs.setdefault('context', 'to-extern')
outcall = Outcall(**kwargs)
self.add_me(outcall)
return outcall
def add_user(self, **kwargs):
if 'func_key_private_template_id' not in kwargs:
func_key_template = self.add_func_key_template(private=True)
......@@ -550,15 +540,6 @@ class DAOTestCase(unittest.TestCase):
self.add_me(pickup_member)
return pickup_member
def add_dialpattern(self, **kwargs):
kwargs.setdefault('id', self._generate_int())
kwargs.setdefault('type', 'outcall')
kwargs.setdefault('typeid', self._generate_int())
kwargs.setdefault('exten', ''.join(random.choice('0123456789_*X.') for _ in range(6)))
dialpattern = DialPattern(**kwargs)
self.add_me(dialpattern)
return dialpattern
def add_dialaction(self, **kwargs):
dialaction = Dialaction(**kwargs)
self.add_me(dialaction)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment