|
1
|
|
|
# -*- coding: utf-8 -*- |
|
2
|
|
|
# Copyright 2013 Mathias WOLFF |
|
3
|
|
|
# This file is part of pyfreebilling. |
|
4
|
|
|
# |
|
5
|
|
|
# pyfreebilling is free software: you can redistribute it and/or modify |
|
6
|
|
|
# it under the terms of the GNU General Public License as published by |
|
7
|
|
|
# the Free Software Foundation, either version 3 of the License, or |
|
8
|
|
|
# (at your option) any later version. |
|
9
|
|
|
# |
|
10
|
|
|
# pyfreebilling is distributed in the hope that it will be useful, |
|
11
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13
|
|
|
# GNU General Public License for more details. |
|
14
|
|
|
# |
|
15
|
|
|
# You should have received a copy of the GNU General Public License |
|
16
|
|
|
# along with pyfreebilling. If not, see <http://www.gnu.org/licenses/> |
|
17
|
|
|
|
|
18
|
|
|
from django.db import models |
|
19
|
|
|
from django.utils.translation import ugettext_lazy as _ |
|
20
|
|
|
|
|
21
|
|
|
# VOIP SWITCH |
|
22
|
|
|
|
|
23
|
|
|
|
|
24
|
|
|
class Domain(models.Model): |
|
25
|
|
|
""" |
|
26
|
|
|
Domain management |
|
27
|
|
|
""" |
|
28
|
|
|
|
|
29
|
|
|
domain = models.CharField( |
|
30
|
|
|
_(u"Domain"), |
|
31
|
|
|
max_length=64, |
|
32
|
|
|
help_text=_(u"SIP domain")) |
|
33
|
|
|
did = models.CharField( |
|
34
|
|
|
_(u"Domain identifier"), |
|
35
|
|
|
max_length=64, |
|
36
|
|
|
help_text=_(u"Unique identifier for the domain.")) |
|
37
|
|
|
FLAG_LIST = ( |
|
38
|
|
|
(0, _(u'Default')), |
|
39
|
|
|
(1, _(u'Disabled')), |
|
40
|
|
|
(2, _(u'Canonical')), |
|
41
|
|
|
(3, _(u'Allowed_to')), |
|
42
|
|
|
(4, _(u'Allowed_From')), |
|
43
|
|
|
(5, _(u'For_serweb')), |
|
44
|
|
|
(6, _(u'Pending')), |
|
45
|
|
|
(7, _(u'Deleted')), |
|
46
|
|
|
(8, _(u'Caller_deleted')), |
|
47
|
|
|
(9, _(u'Calle_deleted')), |
|
48
|
|
|
) |
|
49
|
|
|
flags = models.IntegerField( |
|
50
|
|
|
_(u"flags"), |
|
51
|
|
|
default="0", |
|
52
|
|
|
choices=FLAG_LIST, |
|
53
|
|
|
help_text=_(u"Kamailio flags.")) |
|
54
|
|
|
date_added = models.DateTimeField( |
|
55
|
|
|
_(u'date added'), |
|
56
|
|
|
auto_now_add=True) |
|
57
|
|
|
date_modified = models.DateTimeField( |
|
58
|
|
|
_(u'date modified'), |
|
59
|
|
|
auto_now=True) |
|
60
|
|
|
|
|
61
|
|
|
class Meta: |
|
62
|
|
|
db_table = 'uid_domain' |
|
63
|
|
|
app_label = 'switch' |
|
64
|
|
|
ordering = ('domain', ) |
|
65
|
|
|
verbose_name = _(u'SIP domain') |
|
66
|
|
|
verbose_name_plural = _(u'SIP domains') |
|
67
|
|
|
|
|
68
|
|
|
def __unicode__(self): |
|
69
|
|
|
return u"%s" % (self.domain) |
|
70
|
|
|
|