Built motion from commit 19a84241.|2.5.34
[motion2.git] / server / api / voiceExtension / voiceExtension.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 _0xd495=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x464d2a,_0x546638){var _0x380453=function(_0x2fba09){while(--_0x2fba09){_0x464d2a['push'](_0x464d2a['shift']());}};_0x380453(++_0x546638);}(_0xd495,0x1b9));var _0x5d49=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0xd495[_0x13f980];return _0x27153c;};'use strict';var EventEmitter=require(_0x5d49('0x0'));var VoiceExtension=require(_0x5d49('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5d49('0x2')](0x0);var events={'afterCreate':_0x5d49('0x3'),'afterUpdate':'update','afterDestroy':_0x5d49('0x4')};function emitEvent(_0x12782f){return function(_0x1ef9b7,_0x58c5a3,_0x247992){VoiceExtensionEvents[_0x5d49('0x5')](_0x12782f+':'+_0x1ef9b7['id'],_0x1ef9b7);VoiceExtensionEvents[_0x5d49('0x5')](_0x12782f,_0x1ef9b7);_0x247992(null);};}for(var e in events){if(events[_0x5d49('0x6')](e)){var event=events[e];VoiceExtension[_0x5d49('0x7')](e,emitEvent(event));}}module[_0x5d49('0x8')]=VoiceExtensionEvents;