Built motion from commit 994c64e1.|2.6.1
[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 _0x7b3b=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x4cd14a,_0x3c08b4){var _0x59ac6a=function(_0x5d95ec){while(--_0x5d95ec){_0x4cd14a['push'](_0x4cd14a['shift']());}};_0x59ac6a(++_0x3c08b4);}(_0x7b3b,0x79));var _0xb7b3=function(_0xc6d847,_0x3e2269){_0xc6d847=_0xc6d847-0x0;var _0x1e0d3c=_0x7b3b[_0xc6d847];return _0x1e0d3c;};'use strict';var EventEmitter=require(_0xb7b3('0x0'));var VoiceExtension=require(_0xb7b3('0x1'))['db'][_0xb7b3('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb7b3('0x3')](0x0);var events={'afterCreate':_0xb7b3('0x4'),'afterUpdate':'update','afterDestroy':_0xb7b3('0x5')};function emitEvent(_0x5a8a18){return function(_0x30632f,_0x4f31f9,_0x3bc91d){VoiceExtensionEvents[_0xb7b3('0x6')](_0x5a8a18+':'+_0x30632f['id'],_0x30632f);VoiceExtensionEvents[_0xb7b3('0x6')](_0x5a8a18,_0x30632f);_0x3bc91d(null);};}for(var e in events){if(events[_0xb7b3('0x7')](e)){var event=events[e];VoiceExtension[_0xb7b3('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;