Built motion from commit 25580385.|2.6.2
[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 _0xdcb2=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x16e804,_0x5a27a2){var _0x41247f=function(_0x1e71d6){while(--_0x1e71d6){_0x16e804['push'](_0x16e804['shift']());}};_0x41247f(++_0x5a27a2);}(_0xdcb2,0xb3));var _0x2dcb=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xdcb2[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0x2dcb('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x2dcb('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2dcb('0x2')](0x0);var events={'afterCreate':_0x2dcb('0x3'),'afterUpdate':_0x2dcb('0x4'),'afterDestroy':_0x2dcb('0x5')};function emitEvent(_0x7fb8e6){return function(_0x37a736,_0x1b5642,_0x48cb2d){VoiceExtensionEvents['emit'](_0x7fb8e6+':'+_0x37a736['id'],_0x37a736);VoiceExtensionEvents[_0x2dcb('0x6')](_0x7fb8e6,_0x37a736);_0x48cb2d(null);};}for(var e in events){if(events[_0x2dcb('0x7')](e)){var event=events[e];VoiceExtension[_0x2dcb('0x8')](e,emitEvent(event));}}module[_0x2dcb('0x9')]=VoiceExtensionEvents;