d64564492165c498e0557d0237e5308bd73b656c
[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 _0xebcc=['exports','../../mysqldb','VoiceQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x19f137,_0x69a6c5){var _0x13021f=function(_0x53e2c5){while(--_0x53e2c5){_0x19f137['push'](_0x19f137['shift']());}};_0x13021f(++_0x69a6c5);}(_0xebcc,0x139));var _0xcebc=function(_0x569585,_0x3ab16b){_0x569585=_0x569585-0x0;var _0x34e62c=_0xebcc[_0x569585];return _0x34e62c;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xcebc('0x0'))['db'][_0xcebc('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xcebc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcebc('0x3'),'afterDestroy':_0xcebc('0x4')};function emitEvent(_0x4400e6){return function(_0x1b493e,_0x1b6166,_0x30dc01){VoiceQueueEvents[_0xcebc('0x5')](_0x4400e6+':'+_0x1b493e['id'],_0x1b493e);VoiceQueueEvents['emit'](_0x4400e6,_0x1b493e);_0x30dc01(null);};}for(var e in events){if(events[_0xcebc('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xcebc('0x7')]=VoiceQueueEvents;