Built motion from commit 9d1906d1.|2.5.40
[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 _0xf6fc=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit'];(function(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0xf6fc,0x142));var _0xcf6f=function(_0x1b0ede,_0x3d46ae){_0x1b0ede=_0x1b0ede-0x0;var _0x9a17a3=_0xf6fc[_0x1b0ede];return _0x9a17a3;};'use strict';var EventEmitter=require(_0xcf6f('0x0'));var VoiceQueue=require(_0xcf6f('0x1'))['db'][_0xcf6f('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xcf6f('0x3')](0x0);var events={'afterCreate':_0xcf6f('0x4'),'afterUpdate':_0xcf6f('0x5'),'afterDestroy':_0xcf6f('0x6')};function emitEvent(_0x110f46){return function(_0x42ff94,_0x306973,_0x2ffaf0){VoiceQueueEvents[_0xcf6f('0x7')](_0x110f46+':'+_0x42ff94['id'],_0x42ff94);VoiceQueueEvents[_0xcf6f('0x7')](_0x110f46,_0x42ff94);_0x2ffaf0(null);};}for(var e in events){if(events[_0xcf6f('0x8')](e)){var event=events[e];VoiceQueue[_0xcf6f('0x9')](e,emitEvent(event));}}module[_0xcf6f('0xa')]=VoiceQueueEvents;