Built motion from commit 3c2ce842.|2.6.31
[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 _0xdd29=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1e8934,_0x2f41b3){var _0x4bb2c5=function(_0x4e4944){while(--_0x4e4944){_0x1e8934['push'](_0x1e8934['shift']());}};_0x4bb2c5(++_0x2f41b3);}(_0xdd29,0xd2));var _0x9dd2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdd29[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x9dd2('0x0'))['db'][_0x9dd2('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9dd2('0x2')](0x0);var events={'afterCreate':_0x9dd2('0x3'),'afterUpdate':_0x9dd2('0x4'),'afterDestroy':_0x9dd2('0x5')};function emitEvent(_0x15d330){return function(_0x48215a,_0x55f1f4,_0x2eefb1){VoiceQueueEvents[_0x9dd2('0x6')](_0x15d330+':'+_0x48215a['id'],_0x48215a);VoiceQueueEvents[_0x9dd2('0x6')](_0x15d330,_0x48215a);_0x2eefb1(null);};}for(var e in events){if(events[_0x9dd2('0x7')](e)){var event=events[e];VoiceQueue[_0x9dd2('0x8')](e,emitEvent(event));}}module[_0x9dd2('0x9')]=VoiceQueueEvents;