1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x7121=['hook','exports','events','../../mysqldb','VoiceQueue','save','emit','hasOwnProperty'];(function(_0x5bdb83,_0x3605de){var _0x1986bb=function(_0x2d6e94){while(--_0x2d6e94){_0x5bdb83['push'](_0x5bdb83['shift']());}};_0x1986bb(++_0x3605de);}(_0x7121,0xf2));var _0x1712=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7121[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0x1712('0x0'));var VoiceQueue=require(_0x1712('0x1'))['db'][_0x1712('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1712('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1a50b0){return function(_0x1ce6df,_0x56b786,_0x1a320e){VoiceQueueEvents[_0x1712('0x4')](_0x1a50b0+':'+_0x1ce6df['id'],_0x1ce6df);VoiceQueueEvents[_0x1712('0x4')](_0x1a50b0,_0x1ce6df);_0x1a320e(null);};}for(var e in events){if(events[_0x1712('0x5')](e)){var event=events[e];VoiceQueue[_0x1712('0x6')](e,emitEvent(event));}}module[_0x1712('0x7')]=VoiceQueueEvents;