2dd1b09d9aadeff989b18514bbc00ac05aec82aa
[motion2.git] / server / config / seedDB / chanspy.js
1 'use strict';
2
3 var db = require('../../mysqldb').db;
4 var logger = require('../logger')('app');
5
6 var chanSpy = [{
7     id: 1,
8     name: 'Listen&TalkOne',
9     prefix: 'spy1',
10     options: ['b', 'w'],
11     description: 'Supervisors can listen to the phone call and can just talk to the agent.',
12 }, {
13     id: 2,
14     name: 'OnlyListen',
15     prefix: 'spy2',
16     options: ['b', 'o'],
17     description: 'Supervisors can just listen to the phone call.',
18 }, {
19     id: 3,
20     name: 'Listen&TalkBoth',
21     prefix: 'spy3',
22     options: ['B', 'w'],
23     description: 'Supervisors can listen to the phone call and talk to both the agent and the customer (3-Way Conference).',
24 }];
25
26 exports.create = function() {
27     return db.VoiceChanSpy
28         .bulkCreate(chanSpy, {
29             ignoreDuplicates: true,
30             individualHooks: true
31         })
32         .then(function() {
33             logger.info('ChanSpy have been created');
34         })
35         .catch(function(err) {
36             logger.error('Can\'t create ChanSpy');
37         });
38 };