Built motion from commit (unavailable).|2.5.10
[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 _0xfa14=['emit','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','remove'];(function(_0x7ff59f,_0x580d80){var _0x1063e5=function(_0x33964c){while(--_0x33964c){_0x7ff59f['push'](_0x7ff59f['shift']());}};_0x1063e5(++_0x580d80);}(_0xfa14,0x103));var _0x4fa1=function(_0x2b63a0,_0x14fc48){_0x2b63a0=_0x2b63a0-0x0;var _0x4f0434=_0xfa14[_0x2b63a0];return _0x4f0434;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x4fa1('0x0'))['db'][_0x4fa1('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4fa1('0x2')](0x0);var events={'afterCreate':_0x4fa1('0x3'),'afterUpdate':'update','afterDestroy':_0x4fa1('0x4')};function emitEvent(_0x3f6c75){return function(_0x2beefc,_0x1ebc79,_0x2762d6){VoiceExtensionEvents[_0x4fa1('0x5')](_0x3f6c75+':'+_0x2beefc['id'],_0x2beefc);VoiceExtensionEvents[_0x4fa1('0x5')](_0x3f6c75,_0x2beefc);_0x2762d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x4fa1('0x6')](e,emitEvent(event));}}module[_0x4fa1('0x7')]=VoiceExtensionEvents;