Built motion from commit 43538d75.|2.5.35
[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 _0x74c2=['../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2f71ce,_0x1499dc){var _0x5c6e40=function(_0x508275){while(--_0x508275){_0x2f71ce['push'](_0x2f71ce['shift']());}};_0x5c6e40(++_0x1499dc);}(_0x74c2,0x120));var _0x274c=function(_0x3624d9,_0x3d608c){_0x3624d9=_0x3624d9-0x0;var _0x16cb1d=_0x74c2[_0x3624d9];return _0x16cb1d;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x274c('0x0'))['db'][_0x274c('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x274c('0x2')](0x0);var events={'afterCreate':_0x274c('0x3'),'afterUpdate':_0x274c('0x4'),'afterDestroy':_0x274c('0x5')};function emitEvent(_0x2adf06){return function(_0x1eb622,_0x2d6319,_0x26742b){VoiceExtensionEvents[_0x274c('0x6')](_0x2adf06+':'+_0x1eb622['id'],_0x1eb622);VoiceExtensionEvents[_0x274c('0x6')](_0x2adf06,_0x1eb622);_0x26742b(null);};}for(var e in events){if(events[_0x274c('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;