Built motion from commit 26159a51.|2.5.44
[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 _0x7cfc=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0x7cfc,0x8e));var _0xc7cf=function(_0x11dd70,_0x7fcb27){_0x11dd70=_0x11dd70-0x0;var _0x4fb490=_0x7cfc[_0x11dd70];return _0x4fb490;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xc7cf('0x0'))['db'][_0xc7cf('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc7cf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc7cf('0x3'),'afterDestroy':_0xc7cf('0x4')};function emitEvent(_0x214b40){return function(_0x45015b,_0x3117cb,_0x57ad17){VoiceExtensionEvents['emit'](_0x214b40+':'+_0x45015b['id'],_0x45015b);VoiceExtensionEvents[_0xc7cf('0x5')](_0x214b40,_0x45015b);_0x57ad17(null);};}for(var e in events){if(events[_0xc7cf('0x6')](e)){var event=events[e];VoiceExtension[_0xc7cf('0x7')](e,emitEvent(event));}}module[_0xc7cf('0x8')]=VoiceExtensionEvents;