63d86ea8705011c8f0ba63c378062af69e2c3bc0
[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 _0xc7c6=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x126b1f,_0x34eacf){var _0x1facf5=function(_0x578b04){while(--_0x578b04){_0x126b1f['push'](_0x126b1f['shift']());}};_0x1facf5(++_0x34eacf);}(_0xc7c6,0x85));var _0x6c7c=function(_0x5a910a,_0x578117){_0x5a910a=_0x5a910a-0x0;var _0x389e26=_0xc7c6[_0x5a910a];return _0x389e26;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x6c7c('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6c7c('0x1')](0x0);var events={'afterCreate':_0x6c7c('0x2'),'afterUpdate':_0x6c7c('0x3'),'afterDestroy':_0x6c7c('0x4')};function emitEvent(_0x39afb8){return function(_0x45d673,_0x168a15,_0x66b4){VoiceExtensionEvents[_0x6c7c('0x5')](_0x39afb8+':'+_0x45d673['id'],_0x45d673);VoiceExtensionEvents[_0x6c7c('0x5')](_0x39afb8,_0x45d673);_0x66b4(null);};}for(var e in events){if(events[_0x6c7c('0x6')](e)){var event=events[e];VoiceExtension[_0x6c7c('0x7')](e,emitEvent(event));}}module[_0x6c7c('0x8')]=VoiceExtensionEvents;