Built motion from commit c116dc8b.|2.6.30
[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 _0xc888=['hook','exports','events','VoiceExtension','save','update','remove','emit','hasOwnProperty'];(function(_0x4e8beb,_0x427519){var _0x1c05d6=function(_0x4772a7){while(--_0x4772a7){_0x4e8beb['push'](_0x4e8beb['shift']());}};_0x1c05d6(++_0x427519);}(_0xc888,0x89));var _0x8c88=function(_0x500d35,_0x3f5d69){_0x500d35=_0x500d35-0x0;var _0x383af4=_0xc888[_0x500d35];return _0x383af4;};'use strict';var EventEmitter=require(_0x8c88('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x8c88('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c88('0x2'),'afterUpdate':_0x8c88('0x3'),'afterDestroy':_0x8c88('0x4')};function emitEvent(_0x51b4b8){return function(_0x54058a,_0x11ed50,_0x431f9a){VoiceExtensionEvents[_0x8c88('0x5')](_0x51b4b8+':'+_0x54058a['id'],_0x54058a);VoiceExtensionEvents['emit'](_0x51b4b8,_0x54058a);_0x431f9a(null);};}for(var e in events){if(events[_0x8c88('0x6')](e)){var event=events[e];VoiceExtension[_0x8c88('0x7')](e,emitEvent(event));}}module[_0x8c88('0x8')]=VoiceExtensionEvents;