5 module.exports = function(sequelize, DataTypes) {
6 var Trunk = sequelize.define('Trunk', {
8 type: DataTypes.STRING,
12 is: /^[A-Za-z0-9\.\_]+$/i
16 type: DataTypes.ENUM('friend', 'user', 'peer'),
18 defaultValue: 'friend'
21 type: DataTypes.STRING,
22 defaultValue: 'from-voip-provider'
25 type: DataTypes.ENUM('ALLOWED_NOT_SCREENED',
26 'ALLOWED_PASSED_SCREEN', 'ALLOWED_FAILED_SCREEN', 'ALLOWED',
27 'PROHIB_NOT_SCREENED', 'PROHIB_PASSED_SCREEN',
28 'PROHIB_FAILED_SCREEN', 'PROHIB'),
32 type: DataTypes.STRING,
36 type: DataTypes.STRING,
40 type: DataTypes.STRING,
44 type: DataTypes.STRING,
48 type: DataTypes.STRING,
52 type: DataTypes.STRING,
57 type: DataTypes.ENUM('rfc2833', 'info', 'shortinfo', 'inband',
60 defaultValue: 'rfc2833'
63 type: DataTypes.ENUM('yes', 'no', 'nonat', 'update', 'outgoing'),
68 type: DataTypes.ENUM('yes', 'no'),
73 type: DataTypes.STRING,
77 type: DataTypes.STRING,
81 type: DataTypes.STRING,
83 defaultValue: 'force_rport,comedia'
86 type: DataTypes.STRING,
89 namedcallgroup: { //We are in named call groups engineering,sales,netgroup,protgroup
90 type: DataTypes.STRING,
94 type: DataTypes.STRING,
97 namedpickupgroup: { //We can do call pick-p for named call group sales
98 type: DataTypes.STRING,
102 type: DataTypes.STRING,
107 type: DataTypes.STRING,
111 type: DataTypes.STRING,
116 type: DataTypes.STRING,
118 defaultValue: 'alaw;ulaw;gsm'
121 type: DataTypes.ENUM('yes', 'no'),
125 type: DataTypes.STRING,
127 defaultValue: 'port,invite'
130 type: DataTypes.ENUM('yes', 'no'),
135 type: DataTypes.ENUM('yes', 'no'),
140 type: DataTypes.ENUM('yes', 'no', 'never'),
144 type: DataTypes.ENUM('yes', 'no'),
148 type: DataTypes.ENUM('yes', 'no'),
152 type: DataTypes.INTEGER(11),
156 type: DataTypes.STRING,
160 type: DataTypes.STRING,
162 defaultValue: '"" <>'
165 type: DataTypes.STRING,
169 type: DataTypes.ENUM('yes', 'no'),
174 type: DataTypes.INTEGER(11),
178 type: DataTypes.ENUM('yes', 'no'),
182 type: DataTypes.ENUM('yes', 'no'),
186 type: DataTypes.ENUM('yes', 'no'),
190 type: DataTypes.ENUM('yes', 'no'),
194 type: DataTypes.STRING,
198 type: DataTypes.STRING,
202 type: DataTypes.ENUM('yes', 'no', 'always'),
207 type: DataTypes.INTEGER(11),
211 type: DataTypes.ENUM('yes', 'no'),
215 type: DataTypes.STRING,
219 type: DataTypes.ENUM('accept', 'refuse', 'originate'),
223 type: DataTypes.INTEGER(11),
227 type: DataTypes.INTEGER(11),
231 type: DataTypes.ENUM('uac', 'uas'),
235 t38pt_usertpsource: {
236 type: DataTypes.STRING,
240 type: DataTypes.STRING,
244 type: DataTypes.STRING,
248 type: DataTypes.STRING,
252 type: DataTypes.STRING,
254 defaultValue: 'dynamic'
257 type: DataTypes.INTEGER(5),
261 type: DataTypes.ENUM('yes', 'no'),
266 type: DataTypes.INTEGER(11),
270 type: DataTypes.STRING,
274 type: DataTypes.STRING,
277 rtptimeout: { // Terminate call if 60 seconds of no RTP or RTCP activity on the audio channel when we're not on hold.
278 type: DataTypes.INTEGER(11),
281 rtpholdtimeout: { // Terminate call if 300 seconds of no RTP or RTCP activity on the audio channel when we're on hold (must be > rtptimeout)
282 type: DataTypes.INTEGER(11),
285 rtpkeepalive: { // Send keepalives in the RTP stream to keep NAT open (default is off - zero)
286 type: DataTypes.INTEGER(11),
290 type: DataTypes.ENUM('yes', 'no'),
295 type: DataTypes.STRING,
299 type: DataTypes.STRING,
303 type: DataTypes.INTEGER(11),
307 type: DataTypes.INTEGER(11),
311 type: DataTypes.INTEGER(11),
315 type: DataTypes.STRING,
319 type: DataTypes.STRING,
323 type: DataTypes.STRING,
326 unsolicited_mailbox: {
327 type: DataTypes.STRING,
331 type: DataTypes.STRING,
335 type: DataTypes.INTEGER(11),
339 type: DataTypes.ENUM('yes', 'no'),
344 type: DataTypes.ENUM('yes', 'no'),
348 type: DataTypes.ENUM('yes', 'no'),
352 type: DataTypes.ENUM('yes', 'no'),
356 type: DataTypes.ENUM('yes', 'no'),
360 type: DataTypes.ENUM('yes', 'no', 'fingerprint', 'certificate'),
364 type: DataTypes.INTEGER(11),
368 type: DataTypes.STRING,
372 type: DataTypes.STRING,
376 type: DataTypes.STRING,
380 type: DataTypes.STRING,
384 type: DataTypes.STRING,
388 type: DataTypes.ENUM('active', 'passive', 'actpass'),
392 type: DataTypes.STRING,
395 usereqphone: { //This provider requires ";user=phone" on URI
396 type: DataTypes.ENUM('yes', 'no'),
400 recordonfeature: { //Feature to use when INFO with Record: on is received.
401 type: DataTypes.STRING,
404 recordofffeature: { //Feature to use when INFO with Record: off is received.
405 type: DataTypes.STRING,
409 type: DataTypes.INTEGER(11),
413 registertrying: { //Send a 100 Trying when the device registers.
414 type: DataTypes.ENUM('yes', 'no'),
417 subscribemwi: { //Only send notifications if this phone subscribes for mailbox notification
418 type: DataTypes.ENUM('yes', 'no'),
421 vmexten: { // dialplan extension to reach mailbox. defaults to global vmexten which defaults to "asterisk"
422 type: DataTypes.STRING,
425 mohinterpret: { // This option specifies a preference for which music on hold class this channel should listen to when put on hold
426 type: DataTypes.STRING,
429 mohsuggest: { // This option specifies which music on hold class to suggest to the peer channel when this channel places the peer on hold.
430 type: DataTypes.STRING,
434 type: DataTypes.STRING,
438 type: DataTypes.STRING,
442 type: DataTypes.ENUM('yes', 'no', 'nonat', 'update', 'update,nonat'),
447 type: DataTypes.STRING,
451 type: DataTypes.STRING,
455 type: DataTypes.BOOLEAN,
459 type: DataTypes.STRING
462 type: DataTypes.STRING
465 tableName: 'tools_trunks'