Built motion from commit 2b9af5da.|2.6.26
[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 _0x6aef=['emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xee0701,_0x52c1c3){var _0x16c290=function(_0x7a6594){while(--_0x7a6594){_0xee0701['push'](_0xee0701['shift']());}};_0x16c290(++_0x52c1c3);}(_0x6aef,0x8a));var _0xf6ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aef[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf6ae('0x0'));var VoiceQueue=require(_0xf6ae('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf6ae('0x2')](0x0);var events={'afterCreate':_0xf6ae('0x3'),'afterUpdate':_0xf6ae('0x4'),'afterDestroy':_0xf6ae('0x5')};function emitEvent(_0x8ba534){return function(_0x9bc479,_0xef6895,_0x50c88f){VoiceQueueEvents[_0xf6ae('0x6')](_0x8ba534+':'+_0x9bc479['id'],_0x9bc479);VoiceQueueEvents['emit'](_0x8ba534,_0x9bc479);_0x50c88f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xf6ae('0x7')](e,emitEvent(event));}}module[_0xf6ae('0x8')]=VoiceQueueEvents;