f814f4be1c22519d0c20cf9d3d15d1a4da74cc96
[motion.git] / server / models / voice_voicemail.js
1 /* jshint indent: 2 */
2
3 module.exports = function(sequelize, DataTypes) {
4   var VoiceVoicemail = sequelize.define('VoiceVoicemail', {
5     uniqueid: {
6       type: DataTypes.INTEGER(4),
7       primaryKey: true,
8       allowNull: false,
9       autoIncrement: true
10     },
11     customer_id: {
12       type: DataTypes.STRING,
13     },
14     context: {
15       type: DataTypes.STRING,
16       defaultValue: 'from-voicemail',
17       unique: 'contest_mailbox'
18     },
19     mailbox: {
20       type: DataTypes.STRING,
21       defaultValue: '',
22       allowNull: false,
23       unique: 'contest_mailbox'
24     },
25     password: {
26       type: DataTypes.STRING,
27     },
28     fullname: {
29       type: DataTypes.STRING,
30     },
31     email: {
32       type: DataTypes.STRING,
33     },
34     pager: {
35       type: DataTypes.STRING,
36     },
37     tz: {
38       type: DataTypes.STRING,
39       defaultValue: 'central'
40     },
41     attach: {
42       type: DataTypes.ENUM('yes', 'no'),
43       defaultValue: 'yes',
44       allowNull: false
45     },
46     saycid: {
47       type: DataTypes.ENUM('yes', 'no'),
48       defaultValue: 'yes',
49       allowNull: false
50     },
51     dialout: {
52       type: DataTypes.STRING,
53     },
54     callback: {
55       type: DataTypes.STRING,
56     },
57     review: {
58       type: DataTypes.ENUM('yes', 'no'),
59       defaultValue: 'no',
60       allowNull: false
61     },
62     operator: {
63       type: DataTypes.ENUM('yes', 'no'),
64       defaultValue: 'no',
65       allowNull: false
66     },
67     envelope: {
68       type: DataTypes.ENUM('yes', 'no'),
69       defaultValue: 'no',
70       allowNull: false
71     },
72     sayduration: {
73       type: DataTypes.ENUM('yes', 'no'),
74       defaultValue: 'no',
75       allowNull: false
76     },
77     saydurationm: {
78       type: 'TINYINT(4)',
79       defaultValue: 1,
80       allowNull: false
81     },
82     sendvoicemail: {
83       type: DataTypes.ENUM('yes', 'no'),
84       defaultValue: 'no',
85       allowNull: false
86     },
87     'delete': {
88       type: DataTypes.ENUM('yes', 'no'),
89       defaultValue: 'no',
90       allowNull: false
91     },
92     nextaftercmd: {
93       type: DataTypes.ENUM('yes', 'no'),
94       defaultValue: 'yes',
95       allowNull: false
96     },
97     forcename: {
98       type: DataTypes.ENUM('yes', 'no'),
99       defaultValue: 'no',
100       allowNull: false
101     },
102     forcegreetings: {
103       type: DataTypes.ENUM('yes', 'no'),
104       defaultValue: 'no',
105       allowNull: false
106     },
107     hidefromdir: {
108       type: DataTypes.ENUM('yes', 'no'),
109       defaultValue: 'yes',
110       allowNull: false
111     },
112     stamp: {
113       type: 'TIMESTAMP'
114     },
115     emailsubject: {
116       type: DataTypes.STRING,
117     },
118     emailbody: {
119       type: DataTypes.STRING,
120     },
121     name: {
122       type: DataTypes.STRING,
123     },
124     maxsecs: {
125       type: DataTypes.INTEGER(255),
126       defaultValue: 180,
127       allowNull: false
128     },
129     maxmsg: {
130       type: DataTypes.INTEGER(255),
131       defaultValue: 100,
132       allowNull: false
133     }
134
135   }, {
136     tableName: 'voice_voicemail',
137     indexes: [{
138       name: 'mailbox_context',
139       fields: ['mailbox', 'context']
140     }]
141   });
142
143   return VoiceVoicemail;
144 };