5 var crypto = require('crypto');
7 module.exports = function(sequelize, DataTypes) {
9 var FaxAccount = sequelize.define('FaxAccount', {
11 type: DataTypes.STRING,
16 description: DataTypes.STRING,
18 type: DataTypes.ENUM('yes', 'no'),
22 type: DataTypes.STRING,
23 defaultValue: 'xCALLY Motion Fax'
26 type: DataTypes.STRING,
30 type: DataTypes.ENUM('2400', '4800', '7200', '9600', '12000', '14400'),
34 type: DataTypes.ENUM('2400', '4800', '7200', '9600', '12000', '14400'),
38 type: DataTypes.STRING,
39 defaultValue: 'v17,v27,v29'
42 type: DataTypes.STRING,
45 is: /^(?:yes|no|[0-9]+)$/
49 type: DataTypes.STRING,
52 is: /^(?:yes|no|t38|cng|[0-9]+)$/
56 type: DataTypes.INTEGER,
63 type: DataTypes.ENUM('SIP', 'IAX', 'DADHI', 'KHOMP'),
67 type: DataTypes.BOOLEAN,
71 type: DataTypes.INTEGER,
75 tableName: 'fax_accounts',
76 associate: function(models) {
77 FaxAccount.belongsTo(models.Trunk);
78 FaxAccount.hasMany(models.FaxRoom);
79 FaxAccount.hasMany(models.FaxApplication);
80 FaxAccount.hasMany(models.VoiceExtension, {
84 FaxAccount.belongsTo(models.List);
85 FaxAccount.hasMany(models.FaxDisposition);
88 FaxAccount.addScope('default', {
90 model: models.FaxApplication,
100 model: models.FaxQueue