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 _0xab2b=['setMaxListeners','emit','hasOwnProperty','exports','events','VoiceQueue'];(function(_0x40f980,_0x2397d5){var _0x513223=function(_0x563640){while(--_0x563640){_0x40f980['push'](_0x40f980['shift']());}};_0x513223(++_0x2397d5);}(_0xab2b,0xc4));var _0xbab2=function(_0x47ff0a,_0x362445){_0x47ff0a=_0x47ff0a-0x0;var _0x1a96a2=_0xab2b[_0x47ff0a];return _0x1a96a2;};'use strict';var EventEmitter=require(_0xbab2('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xbab2('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xbab2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x43c0cd){return function(_0x20218c,_0xd28e81,_0x34711e){VoiceQueueEvents[_0xbab2('0x3')](_0x43c0cd+':'+_0x20218c['id'],_0x20218c);VoiceQueueEvents[_0xbab2('0x3')](_0x43c0cd,_0x20218c);_0x34711e(null);};}for(var e in events){if(events[_0xbab2('0x4')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xbab2('0x5')]=VoiceQueueEvents;