3d34356a19e61ebba4e2e1d1559c7b3a7a3147da
[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 _0xf880=['save','update','emit','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xf880,0x115));var _0x0f88=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0xf880[_0xcfeda9];return _0x4826c7;};'use strict';var EventEmitter=require(_0x0f88('0x0'));var VoiceExtension=require(_0x0f88('0x1'))['db'][_0x0f88('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0f88('0x3'),'afterUpdate':_0x0f88('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2605e6){return function(_0x3513aa,_0x5b70f6,_0x1a2e91){VoiceExtensionEvents['emit'](_0x2605e6+':'+_0x3513aa['id'],_0x3513aa);VoiceExtensionEvents[_0x0f88('0x5')](_0x2605e6,_0x3513aa);_0x1a2e91(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x0f88('0x6')](e,emitEvent(event));}}module[_0x0f88('0x7')]=VoiceExtensionEvents;