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 _0xb1f7=['update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x202686,_0x5c3908){var _0x35ade5=function(_0x4b8ed0){while(--_0x4b8ed0){_0x202686['push'](_0x202686['shift']());}};_0x35ade5(++_0x5c3908);}(_0xb1f7,0x134));var _0x7b1f=function(_0x363085,_0x4374a7){_0x363085=_0x363085-0x0;var _0x2377d1=_0xb1f7[_0x363085];return _0x2377d1;};'use strict';var EventEmitter=require(_0x7b1f('0x0'));var VoiceQueue=require(_0x7b1f('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7b1f('0x2')](0x0);var events={'afterCreate':_0x7b1f('0x3'),'afterUpdate':_0x7b1f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ede06){return function(_0x23076f,_0x15a9c9,_0x46f5c9){VoiceQueueEvents[_0x7b1f('0x5')](_0x3ede06+':'+_0x23076f['id'],_0x23076f);VoiceQueueEvents[_0x7b1f('0x5')](_0x3ede06,_0x23076f);_0x46f5c9(null);};}for(var e in events){if(events[_0x7b1f('0x6')](e)){var event=events[e];VoiceQueue[_0x7b1f('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;