-var _0x7f22=["\x65\x78\x70\x6F\x72\x74\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x53\x54\x52\x49\x4E\x47","\x64\x65\x66\x61\x75\x6C\x74","","\x72\x69\x6E\x67\x61\x6C\x6C","\x6C\x65\x61\x73\x74\x72\x65\x63\x65\x6E\x74","\x66\x65\x77\x65\x73\x74\x63\x61\x6C\x6C\x73","\x72\x61\x6E\x64\x6F\x6D","\x72\x72\x6D\x65\x6D\x6F\x72\x79","\x6C\x69\x6E\x65\x61\x72","\x77\x72\x61\x6E\x64\x6F\x6D","\x72\x72\x6F\x72\x64\x65\x72\x65\x64","\x79\x65\x73","\x6E\x6F","\x61\x6C\x6C","\x6F\x6E\x63\x65","\x30","\x35","\x31\x30","\x31\x35","\x32\x30","\x33\x30","\x42\x4F\x4F\x4C\x45\x41\x4E","\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x73","\x55\x73\x65\x72\x48\x61\x73\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x71\x75\x65\x75\x65","\x62\x65\x6C\x6F\x6E\x67\x73\x54\x6F\x4D\x61\x6E\x79","\x64\x65\x66\x69\x6E\x65","\x6E\x61\x6D\x65","\x63\x68\x61\x6E\x67\x65\x64","\x59\x6F\x75\x20\x63\x61\x6E\x27\x74\x20\x6D\x6F\x64\x69\x66\x79\x20\x61\x20\x71\x75\x65\x75\x65\x20\x6E\x61\x6D\x65","\x62\x65\x66\x6F\x72\x65\x55\x70\x64\x61\x74\x65"];module[_0x7f22[0]]=function(_0xc84fx1,_0xc84fx2){var _0xc84fx3=_0xc84fx1[_0x7f22[28]](_0x7f22[1],{name:{type:_0xc84fx2[_0x7f22[2]],primaryKey:true,unique:true,validate:{notEmpty:true,is:/^[A-Za-z0-9\.\_]+$/i}},musiconhold:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:_0x7f22[3]},announce:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:_0x7f22[4]},strategy:{type:_0xc84fx2.ENUM(_0x7f22[5],_0x7f22[6],_0x7f22[7],_0x7f22[8],_0x7f22[9],_0x7f22[10],_0x7f22[11],_0x7f22[12]),allowNull:false,defaultValue:_0x7f22[5]},servicelevel:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},context:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:null},penaltymemberslimit:{type:_0xc84fx2.INTEGER(11),allowNull:true},timeout:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},retry:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},timeoutpriority:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},weight:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},wrapuptime:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},autofill:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[13]},autopause:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14],_0x7f22[15]),allowNull:true,defaultValue:_0x7f22[14]},autopausedelay:{type:_0xc84fx2.INTEGER(11),allowNull:true},autopausebusy:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[14]},autopauseunavail:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[14]},maxlen:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},setinterfacevar:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[14]},setqueueentryvar:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defautValue:_0x7f22[14]},setqueuevar:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[14]},membermacro:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},membergosub:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},announce_frequency:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},min_announce_frequency:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},periodic_announce_frequency:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},random_periodic_announce:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[14]},relative_periodic_announce:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[13]},announce_holdtime:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14],_0x7f22[16]),allowNull:true,defaultValue:_0x7f22[14]},announce_position:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:_0x7f22[14]},announce_to_first_user:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true},announce_position_limit:{type:_0xc84fx2.INTEGER(11),allowNull:true},announce_round_seconds:{type:_0xc84fx2.ENUM(_0x7f22[17],_0x7f22[18],_0x7f22[19],_0x7f22[20],_0x7f22[21],_0x7f22[22]),allowNull:true,defaultValue:_0x7f22[17]},monitor_format:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:_0x7f22[4]},monitor_type:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},queue_youarenext:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:null},queue_thereare:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:null},queue_callswaiting:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:null},queue_holdtime:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:null},queue_minute:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:null},queue_minutes:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:null},queue_seconds:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:null},queue_thankyou:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:null},queue_reporthold:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},queue_quantity1:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},queue_quantity2:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},queue_periodic_announce:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},queue_less_than:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},periodic_announce:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:_0x7f22[4]},joinempty:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:_0x7f22[13]},leavewhenempty:{type:_0xc84fx2[_0x7f22[2]],allowNull:true,defaultValue:_0x7f22[14]},reportholdtime:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[14]},ringinuse:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[14]},memberdelay:{type:_0xc84fx2.INTEGER(11),allowNull:true,defaultValue:0},timeoutrestart:{type:_0xc84fx2.ENUM(_0x7f22[13],_0x7f22[14]),allowNull:true,defaultValue:_0x7f22[14]},defaultrule:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},description:{type:_0xc84fx2[_0x7f22[2]],allowNull:true},acw:{type:_0xc84fx2[_0x7f22[23]],defaultValue:0},acwTimeout:{type:_0xc84fx2.INTEGER(11),defaultValue:10}},{tableName:_0x7f22[24],associate:function(_0xc84fx4){_0xc84fx3[_0x7f22[27]](_0xc84fx4.User,{through:_0xc84fx4[_0x7f22[25]],foreignKey:_0x7f22[26],required:false})}});_0xc84fx3[_0x7f22[32]](function(_0xc84fx5){if(_0xc84fx5[_0x7f22[30]](_0x7f22[29])){throw new Error(_0x7f22[31])}});return _0xc84fx3}
\ No newline at end of file
+/* jshint indent: 2 */
+
+module.exports = function(sequelize, DataTypes) {
+ var VoiceQueue = sequelize.define('VoiceQueue', {
+ name: {
+ type: DataTypes.STRING,
+ primaryKey: true,
+ unique: true,
+ validate: {
+ notEmpty: true,
+ is: /^[A-Za-z0-9\.\_]+$/i
+ },
+ },
+ musiconhold: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: 'default'
+ },
+ announce: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: ''
+ },
+ strategy: {
+ type: DataTypes.ENUM('ringall', 'leastrecent', 'fewestcalls', 'random', 'rrmemory', 'linear', 'wrandom', 'rrordered'),
+ allowNull: false,
+ defaultValue: 'ringall'
+ },
+ servicelevel: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 0
+ },
+ context: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null
+ },
+ penaltymemberslimit: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ },
+ timeout: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 15
+ },
+ retry: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 2
+ },
+ timeoutpriority: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ },
+ weight: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 0
+ },
+ wrapuptime: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 0
+ },
+ autofill: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'yes'
+ },
+ autopause: {
+ type: DataTypes.ENUM('yes', 'no', 'all'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ autopausedelay: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ },
+ autopausebusy: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ autopauseunavail: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ maxlen: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 0
+ },
+ setinterfacevar: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ setqueueentryvar: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defautValue: 'no'
+ },
+ setqueuevar: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ membermacro: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ },
+ membergosub: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ },
+ announce_frequency: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 0
+ },
+ min_announce_frequency: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 0
+ },
+ periodic_announce_frequency: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 0
+ },
+ random_periodic_announce: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ relative_periodic_announce: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'yes'
+ },
+ announce_holdtime: {
+ type: DataTypes.ENUM('yes', 'no', 'once'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ announce_position: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ announce_to_first_user: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ },
+ announce_position_limit: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ },
+ announce_round_seconds: {
+ type: DataTypes.ENUM('0', '5', '10', '15', '20', '30'),
+ allowNull: true,
+ defaultValue: '0'
+ },
+ monitor_format: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: ''
+ },
+ monitor_type: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ },
+ queue_youarenext: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null
+ },
+ queue_thereare: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null
+ },
+ queue_callswaiting: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null
+ },
+ queue_holdtime: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null
+ },
+ queue_minute: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null
+ },
+ queue_minutes: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null
+ },
+ queue_seconds: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null
+ },
+ queue_thankyou: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null
+ },
+ queue_reporthold: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ },
+ queue_quantity1: {
+ type: DataTypes.STRING,
+ allowNull: true
+ },
+ queue_quantity2: {
+ type: DataTypes.STRING,
+ allowNull: true
+ },
+ queue_periodic_announce: {
+ type: DataTypes.STRING,
+ allowNull: true
+ },
+ queue_less_than: {
+ type: DataTypes.STRING,
+ allowNull: true
+ },
+ periodic_announce: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: ''
+ },
+ joinempty: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: 'yes'
+ },
+ leavewhenempty: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ reportholdtime: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ ringinuse: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ memberdelay: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: 0
+ },
+ timeoutrestart: {
+ type: DataTypes.ENUM('yes', 'no'),
+ allowNull: true,
+ defaultValue: 'no'
+ },
+ defaultrule: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ },
+ description: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ },
+ acw: {
+ type: DataTypes.BOOLEAN,
+ defaultValue: 0
+ },
+ acwTimeout: {
+ type: DataTypes.INTEGER(11),
+ defaultValue: 10
+ }
+ }, {
+ tableName: 'voice_queues',
+ associate: function(models) {
+ VoiceQueue.belongsToMany(models.User, {
+ through: models.UserHasVoiceQueue,
+ foreignKey: 'queue',
+ required: false
+ });
+ VoiceQueue.belongsToMany(models.User, {
+ through: models.UserHasVoiceQueuePermit,
+ as: 'PVoiceQueues'
+ });
+ }
+ });
+
+ VoiceQueue.beforeUpdate(function(updatedQueue) {
+ if (updatedQueue.changed('name')) {
+ throw new Error("You can't modify a queue name");
+ }
+ });
+
+ return VoiceQueue;
+};