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 _0x9410=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x9410,0xcb));var _0x0941=function(_0xce59aa,_0x929ec0){_0xce59aa=_0xce59aa-0x0;var _0x555ee7=_0x9410[_0xce59aa];return _0x555ee7;};'use strict';var EventEmitter=require(_0x0941('0x0'));var VoiceQueue=require(_0x0941('0x1'))['db'][_0x0941('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0941('0x3')](0x0);var events={'afterCreate':_0x0941('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5ef690){return function(_0x5f5afd,_0x2d55e4,_0x500d28){VoiceQueueEvents[_0x0941('0x5')](_0x5ef690+':'+_0x5f5afd['id'],_0x5f5afd);VoiceQueueEvents[_0x0941('0x5')](_0x5ef690,_0x5f5afd);_0x500d28(null);};}for(var e in events){if(events[_0x0941('0x6')](e)){var event=events[e];VoiceQueue[_0x0941('0x7')](e,emitEvent(event));}}module[_0x0941('0x8')]=VoiceQueueEvents;