Added django application and a sample project for running in web server
[ipypbx] / src / ipypbx / models.py
1 # Copyright (c) Stas Shtin, 2010
2
3 # This file is part of IPyPBX.
4
5 # IPyPBX 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 # IPyPBX 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 IPyPBX.  If not, see <http://www.gnu.org/licenses/>.
17
18
19 # THIS FILE WILL BE DELETED SOON
20
21 from axiom.item import Item
22 from axiom.attributes import boolean, integer, reference, text
23
24
25 class Connection(Item):
26     name = text()
27     local_ip_address = text()
28     local_port = integer()
29     freeswitch_ip_address = text()
30     freeswitch_port = integer()
31
32
33 class SipProfile(Item):
34     connection = reference()
35     name = text()
36     external_rtp_ip = text()
37     external_sip_ip = text()
38     rtp_ip = text()
39     sip_ip = text()
40     sip_port = integer()
41     accept_blind_registration = boolean()
42     authenticate_calls = boolean()
43     is_active = boolean()
44
45
46 class Domain(Item):
47     sip_profile = reference()
48     host_name = text()
49     is_active = boolean()
50
51
52 class Gateway(Item):
53     sip_profile = reference()
54     name = text()
55     username = text()
56     password = text()
57     realm = text()
58     from_domain = text()
59     expire_in_seconds = integer()
60     retry_in_seconds = integer()
61     caller_id_in_from_field = boolean()
62     is_active = boolean()
63
64
65 class Endpoint(Item):
66     user_id = text()
67     password = text()
68     domain = text()
69     is_active = boolean()
70
71
72 class Extension(Item):
73     destination_match = text()
74     xml_dialplan = text()
75     domain = text()
76     endpoint = reference()
77     authenticate_calls = boolean()
78     is_active = boolean()
79