53eb3bcd612a98cadc1164eff14ac98a7375c8c2
[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 _0xdf29=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x5a1cc9,_0x28f54d){var _0x471761=function(_0xda51c0){while(--_0xda51c0){_0x5a1cc9['push'](_0x5a1cc9['shift']());}};_0x471761(++_0x28f54d);}(_0xdf29,0x1ad));var _0x9df2=function(_0x57d098,_0x34ab6d){_0x57d098=_0x57d098-0x0;var _0x116d64=_0xdf29[_0x57d098];return _0x116d64;};'use strict';var EventEmitter=require(_0x9df2('0x0'));var VoiceExtension=require(_0x9df2('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9df2('0x2'),'afterUpdate':'update','afterDestroy':_0x9df2('0x3')};function emitEvent(_0x45aa30){return function(_0x34c53b,_0x4f6382,_0x1757a2){VoiceExtensionEvents[_0x9df2('0x4')](_0x45aa30+':'+_0x34c53b['id'],_0x34c53b);VoiceExtensionEvents[_0x9df2('0x4')](_0x45aa30,_0x34c53b);_0x1757a2(null);};}for(var e in events){if(events[_0x9df2('0x5')](e)){var event=events[e];VoiceExtension[_0x9df2('0x6')](e,emitEvent(event));}}module[_0x9df2('0x7')]=VoiceExtensionEvents;