dcde2e8404c8c2d13443ffd1dd3f6ec6bc425948
[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 _0xd4c0=['hook','exports','events','../../mysqldb','save','emit','hasOwnProperty'];(function(_0x120fb5,_0x4a0971){var _0x544022=function(_0x28da92){while(--_0x28da92){_0x120fb5['push'](_0x120fb5['shift']());}};_0x544022(++_0x4a0971);}(_0xd4c0,0x12f));var _0x0d4c=function(_0x2dac34,_0x250d35){_0x2dac34=_0x2dac34-0x0;var _0x4bb79f=_0xd4c0[_0x2dac34];return _0x4bb79f;};'use strict';var EventEmitter=require(_0x0d4c('0x0'));var VoiceQueue=require(_0x0d4c('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0d4c('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x114bb7){return function(_0x4f951f,_0x48069a,_0x1bf144){VoiceQueueEvents[_0x0d4c('0x3')](_0x114bb7+':'+_0x4f951f['id'],_0x4f951f);VoiceQueueEvents[_0x0d4c('0x3')](_0x114bb7,_0x4f951f);_0x1bf144(null);};}for(var e in events){if(events[_0x0d4c('0x4')](e)){var event=events[e];VoiceQueue[_0x0d4c('0x5')](e,emitEvent(event));}}module[_0x0d4c('0x6')]=VoiceQueueEvents;