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 _0xd2fa=['hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit'];(function(_0x1c8fcc,_0x2fcf9a){var _0x28f01b=function(_0x2aa684){while(--_0x2aa684){_0x1c8fcc['push'](_0x1c8fcc['shift']());}};_0x28f01b(++_0x2fcf9a);}(_0xd2fa,0x134));var _0xad2f=function(_0x99af26,_0x88d335){_0x99af26=_0x99af26-0x0;var _0x555d41=_0xd2fa[_0x99af26];return _0x555d41;};'use strict';var EventEmitter=require(_0xad2f('0x0'));var VoiceQueue=require(_0xad2f('0x1'))['db'][_0xad2f('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xad2f('0x3')](0x0);var events={'afterCreate':_0xad2f('0x4'),'afterUpdate':'update','afterDestroy':_0xad2f('0x5')};function emitEvent(_0x4f8757){return function(_0x36d418,_0x1fa378,_0x5f37a9){VoiceQueueEvents['emit'](_0x4f8757+':'+_0x36d418['id'],_0x36d418);VoiceQueueEvents[_0xad2f('0x6')](_0x4f8757,_0x36d418);_0x5f37a9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xad2f('0x7')](e,emitEvent(event));}}module[_0xad2f('0x8')]=VoiceQueueEvents;