3 var crypto = require('crypto');
4 var md5 = require('md5');
5 var _ = require('lodash');
7 module.exports = function(sequelize, DataTypes) {
8 var Trunk = sequelize.define('Trunk', {
10 type: DataTypes.STRING,
14 type: DataTypes.ENUM('friend', 'user', 'peer'),
16 defaultValue: 'friend'
19 type: DataTypes.STRING,
21 defaultValue: 'from-sip'
24 type: DataTypes.ENUM('ALLOWED_NOT_SCREENED',
25 'ALLOWED_PASSED_SCREEN', 'ALLOWED_FAILED_SCREEN', 'ALLOWED',
26 'PROHIB_NOT_SCREENED', 'PROHIB_PASSED_SCREEN',
27 'PROHIB_FAILED_SCREEN', 'PROHIB'),
31 type: DataTypes.STRING,
35 type: DataTypes.STRING,
39 type: DataTypes.STRING,
43 type: DataTypes.STRING,
47 type: DataTypes.STRING,
51 type: DataTypes.STRING,
56 type: DataTypes.ENUM('rfc2833', 'info', 'shortinfo', 'inband',
59 defaultValue: 'rfc2833'
62 type: DataTypes.ENUM('yes', 'no', 'nonat', 'update', 'outgoing'),
67 type: DataTypes.ENUM('yes', 'no'),
72 type: DataTypes.STRING,
76 type: DataTypes.STRING,
80 type: DataTypes.STRING,
82 defaultValue: 'force_rport,comedia'
85 type: DataTypes.STRING,
88 namedcallgroup: { //We are in named call groups engineering,sales,netgroup,protgroup
89 type: DataTypes.STRING,
93 type: DataTypes.STRING,
96 namedpickupgroup: { //We can do call pick-p for named call group sales
97 type: DataTypes.STRING,
101 type: DataTypes.STRING,
106 type: DataTypes.STRING,
110 type: DataTypes.STRING,
115 type: DataTypes.STRING,
117 defaultValue: 'alaw;ulaw;gsm'
120 type: DataTypes.ENUM('yes', 'no'),
124 type: DataTypes.STRING,
126 defaultValue: 'port,invite'
129 type: DataTypes.ENUM('yes', 'no'),
134 type: DataTypes.ENUM('yes', 'no'),
139 type: DataTypes.ENUM('yes', 'no', 'never'),
143 type: DataTypes.ENUM('yes', 'no'),
147 type: DataTypes.ENUM('yes', 'no'),
151 type: DataTypes.INTEGER(11),
155 type: DataTypes.STRING,
159 type: DataTypes.STRING,
161 defaultValue: '"" <>'
164 type: DataTypes.STRING,
168 type: DataTypes.ENUM('yes', 'no'),
173 type: DataTypes.INTEGER(11),
177 type: DataTypes.ENUM('yes', 'no'),
181 type: DataTypes.ENUM('yes', 'no'),
185 type: DataTypes.ENUM('yes', 'no'),
189 type: DataTypes.ENUM('yes', 'no'),
193 type: DataTypes.STRING,
197 type: DataTypes.STRING,
201 type: DataTypes.ENUM('yes', 'no', 'always'),
206 type: DataTypes.INTEGER(11),
210 type: DataTypes.ENUM('yes', 'no'),
214 type: DataTypes.STRING,
218 type: DataTypes.ENUM('accept', 'refuse', 'originate'),
222 type: DataTypes.INTEGER(11),
226 type: DataTypes.INTEGER(11),
230 type: DataTypes.ENUM('uac', 'uas'),
234 t38pt_usertpsource: {
235 type: DataTypes.STRING,
239 type: DataTypes.STRING,
243 type: DataTypes.STRING,
247 type: DataTypes.STRING,
251 type: DataTypes.STRING,
253 defaultValue: 'dynamic'
256 type: DataTypes.INTEGER(5),
260 type: DataTypes.ENUM('yes', 'no'),
265 type: DataTypes.INTEGER(11),
269 type: DataTypes.STRING,
273 type: DataTypes.STRING,
276 rtptimeout: { // Terminate call if 60 seconds of no RTP or RTCP activity on the audio channel when we're not on hold.
277 type: DataTypes.INTEGER(11),
280 rtpholdtimeout: { // Terminate call if 300 seconds of no RTP or RTCP activity on the audio channel when we're on hold (must be > rtptimeout)
281 type: DataTypes.INTEGER(11),
284 rtpkeepalive: { // Send keepalives in the RTP stream to keep NAT open (default is off - zero)
285 type: DataTypes.INTEGER(11),
289 type: DataTypes.ENUM('yes', 'no'),
294 type: DataTypes.STRING,
298 type: DataTypes.STRING,
302 type: DataTypes.INTEGER(11),
306 type: DataTypes.INTEGER(11),
310 type: DataTypes.INTEGER(11),
314 type: DataTypes.STRING,
318 type: DataTypes.STRING,
322 type: DataTypes.STRING,
325 unsolicited_mailbox: {
326 type: DataTypes.STRING,
330 type: DataTypes.STRING,
334 type: DataTypes.INTEGER(11),
338 type: DataTypes.ENUM('yes', 'no'),
343 type: DataTypes.ENUM('yes', 'no'),
347 type: DataTypes.ENUM('yes', 'no'),
351 type: DataTypes.ENUM('yes', 'no'),
355 type: DataTypes.ENUM('yes', 'no'),
359 type: DataTypes.ENUM('yes', 'no', 'fingerprint', 'certificate'),
363 type: DataTypes.INTEGER(11),
367 type: DataTypes.STRING,
371 type: DataTypes.STRING,
375 type: DataTypes.STRING,
379 type: DataTypes.STRING,
383 type: DataTypes.STRING,
387 type: DataTypes.ENUM('active', 'passive', 'actpass'),
391 type: DataTypes.STRING,
394 usereqphone: { //This provider requires ";user=phone" on URI
395 type: DataTypes.ENUM('yes', 'no'),
399 recordonfeature: { //Feature to use when INFO with Record: on is received.
400 type: DataTypes.STRING,
403 recordofffeature: { //Feature to use when INFO with Record: off is received.
404 type: DataTypes.STRING,
408 type: DataTypes.INTEGER(11),
412 registertrying: { //Send a 100 Trying when the device registers.
413 type: DataTypes.ENUM('yes', 'no'),
416 subscribemwi: { //Only send notifications if this phone subscribes for mailbox notification
417 type: DataTypes.ENUM('yes', 'no'),
420 vmexten: { // dialplan extension to reach mailbox. defaults to global vmexten which defaults to "asterisk"
421 type: DataTypes.STRING,
424 mohinterpret: { // This option specifies a preference for which music on hold class this channel should listen to when put on hold
425 type: DataTypes.STRING,
428 mohsuggest: { // This option specifies which music on hold class to suggest to the peer channel when this channel places the peer on hold.
429 type: DataTypes.STRING,
433 type: DataTypes.STRING,
437 type: DataTypes.STRING,
441 type: DataTypes.ENUM('yes', 'no', 'nonat', 'update', 'update,nonat'),
446 type: DataTypes.STRING,
450 type: DataTypes.STRING,
454 tableName: 'tools_trunks'