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 _0x94bc=['save','remove','emit','hasOwnProperty','hook','events','VoiceQueue','setMaxListeners'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x94bc,0x7d));var _0xc94b=function(_0x21dc70,_0x287214){_0x21dc70=_0x21dc70-0x0;var _0x47e638=_0x94bc[_0x21dc70];return _0x47e638;};'use strict';var EventEmitter=require(_0xc94b('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xc94b('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc94b('0x2')](0x0);var events={'afterCreate':_0xc94b('0x3'),'afterUpdate':'update','afterDestroy':_0xc94b('0x4')};function emitEvent(_0x1ffbb2){return function(_0x5e9906,_0x331e5d,_0x44c6e5){VoiceQueueEvents[_0xc94b('0x5')](_0x1ffbb2+':'+_0x5e9906['id'],_0x5e9906);VoiceQueueEvents[_0xc94b('0x5')](_0x1ffbb2,_0x5e9906);_0x44c6e5(null);};}for(var e in events){if(events[_0xc94b('0x6')](e)){var event=events[e];VoiceQueue[_0xc94b('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;