0c3c1314751cd9589408109db7897490ae06dbfd
[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 _0x2a68=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension'];(function(_0x1fd4a1,_0x5ca88a){var _0x4197c8=function(_0x1ee820){while(--_0x1ee820){_0x1fd4a1['push'](_0x1fd4a1['shift']());}};_0x4197c8(++_0x5ca88a);}(_0x2a68,0x11e));var _0x82a6=function(_0x251999,_0x101e56){_0x251999=_0x251999-0x0;var _0x14b385=_0x2a68[_0x251999];return _0x14b385;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x82a6('0x0'))['db'][_0x82a6('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x82a6('0x2'),'afterUpdate':_0x82a6('0x3'),'afterDestroy':_0x82a6('0x4')};function emitEvent(_0x4e8c4d){return function(_0x840501,_0x5f58df,_0x386bb8){VoiceExtensionEvents['emit'](_0x4e8c4d+':'+_0x840501['id'],_0x840501);VoiceExtensionEvents[_0x82a6('0x5')](_0x4e8c4d,_0x840501);_0x386bb8(null);};}for(var e in events){if(events[_0x82a6('0x6')](e)){var event=events[e];VoiceExtension[_0x82a6('0x7')](e,emitEvent(event));}}module[_0x82a6('0x8')]=VoiceExtensionEvents;