Built motion from commit 20b39a97.|2.6.29
[motion2.git] / server / api / voiceQueue / voiceQueue.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x3a73=['emit','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x4d35f3,_0x19ba66){var _0x382fea=function(_0x2c2390){while(--_0x2c2390){_0x4d35f3['push'](_0x4d35f3['shift']());}};_0x382fea(++_0x19ba66);}(_0x3a73,0x14b));var _0x33a7=function(_0x1a2db5,_0x785212){_0x1a2db5=_0x1a2db5-0x0;var _0xf6401b=_0x3a73[_0x1a2db5];return _0xf6401b;};'use strict';var EventEmitter=require(_0x33a7('0x0'));var VoiceQueue=require(_0x33a7('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x33a7('0x2'),'afterUpdate':_0x33a7('0x3'),'afterDestroy':_0x33a7('0x4')};function emitEvent(_0x14b377){return function(_0x297382,_0x1a5779,_0x2b3667){VoiceQueueEvents[_0x33a7('0x5')](_0x14b377+':'+_0x297382['id'],_0x297382);VoiceQueueEvents['emit'](_0x14b377,_0x297382);_0x2b3667(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x33a7('0x6')](e,emitEvent(event));}}module[_0x33a7('0x7')]=VoiceQueueEvents;