call_limit: {
type: DataTypes.INTEGER(11),
allowNull: true,
- defaultValue: null
+ defaultValue: 1000
},
registertrying: { //Send a 100 Trying when the device registers.
type: DataTypes.ENUM('yes', 'no'),
otherFields: {
type: DataTypes.STRING,
allowNull: true,
+ },
+ active: {
+ type: DataTypes.BOOLEAN,
+ defaultValue: true
+ },
+ status: {
+ type: DataTypes.STRING
+ },
+ peerstatus: {
+ type: DataTypes.STRING
}
}, {
tableName: 'tools_trunks'
});
+ Trunk.beforeUpdate(function(doc) {
+ if (doc.changed('name')) {
+ throw new Error("You can't modify a trunk name");
+ }
+ });
+
return Trunk;
}