7ddc2255f54f1ae47be6e4f1391535e4d637602d
[motion.git] / server / models / autodialer_process.js
1 'use strict';
2
3 module.exports = function(sequelize, DataTypes) {
4
5   var AutodialerProcess = sequelize.define('AutodialerProcess', {
6     name: {
7       type: DataTypes.STRING,
8       unique: true
9     },
10     description: {
11       type: DataTypes.STRING,
12     },
13     context: {
14         type: DataTypes.STRING,
15     },
16     extension: {
17         type: DataTypes.STRING,
18     },
19     priority: {
20         type: DataTypes.INTEGER,
21     },
22     callerid: {
23         type: DataTypes.STRING,
24     },
25     waittime: {
26         type: DataTypes.INTEGER,
27     },
28     maxretry: {
29         type: DataTypes.INTEGER,
30     },
31     retrytime: {
32         type: DataTypes.INTEGER,
33     },
34     prefix: {
35         type: DataTypes.STRING,
36     },
37     maxcall: {
38         type: DataTypes.INTEGER,
39     },
40     enable: {
41     type: DataTypes.BOOLEAN,
42     defaultValue: true
43     }
44   }, {
45     tableName: 'autodialer_processes',
46     associate: function(models) {
47         AutodialerProcess.belongsToMany(models.Contact, { through: models.AutodialerContact })
48     }
49   });
50
51   return AutodialerProcess;
52
53 };