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 _0xb4c3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','VoiceQueue'];(function(_0x219c8c,_0x407e2e){var _0x3e57d1=function(_0x204f36){while(--_0x204f36){_0x219c8c['push'](_0x219c8c['shift']());}};_0x3e57d1(++_0x407e2e);}(_0xb4c3,0x115));var _0x3b4c=function(_0x5248dd,_0x1860c3){_0x5248dd=_0x5248dd-0x0;var _0x25e0e7=_0xb4c3[_0x5248dd];return _0x25e0e7;};'use strict';var EventEmitter=require(_0x3b4c('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x3b4c('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3b4c('0x2')](0x0);var events={'afterCreate':_0x3b4c('0x3'),'afterUpdate':_0x3b4c('0x4'),'afterDestroy':_0x3b4c('0x5')};function emitEvent(_0x3bac7b){return function(_0x2d9e07,_0x51a881,_0xc903d){VoiceQueueEvents['emit'](_0x3bac7b+':'+_0x2d9e07['id'],_0x2d9e07);VoiceQueueEvents[_0x3b4c('0x6')](_0x3bac7b,_0x2d9e07);_0xc903d(null);};}for(var e in events){if(events[_0x3b4c('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x3b4c('0x8')]=VoiceQueueEvents;