b6151b181e22cda6992c2da1cac60678bce42f1c
[motion2.git] / server / api / voiceQueue / voiceQueue.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xe16d=['remove','emit','exports','../../mysqldb','setMaxListeners','update'];(function(_0x36c96d,_0x2111e2){var _0x458a40=function(_0x43d524){while(--_0x43d524){_0x36c96d['push'](_0x36c96d['shift']());}};_0x458a40(++_0x2111e2);}(_0xe16d,0x1e9));var _0xde16=function(_0x50cc54,_0x3785e1){_0x50cc54=_0x50cc54-0x0;var _0x536f3f=_0xe16d[_0x50cc54];return _0x536f3f;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xde16('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xde16('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde16('0x2'),'afterDestroy':_0xde16('0x3')};function emitEvent(_0x23cc19){return function(_0x13248,_0x404c6c,_0x3188c5){VoiceQueueEvents['emit'](_0x23cc19+':'+_0x13248['id'],_0x13248);VoiceQueueEvents[_0xde16('0x4')](_0x23cc19,_0x13248);_0x3188c5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xde16('0x5')]=VoiceQueueEvents;