Built motion from commit 47436d59.|2.6.7
[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 _0xd423=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x170ba1,_0x2f6b76){var _0x5844dd=function(_0x3c71e1){while(--_0x3c71e1){_0x170ba1['push'](_0x170ba1['shift']());}};_0x5844dd(++_0x2f6b76);}(_0xd423,0xeb));var _0x3d42=function(_0x2ec905,_0x442fb6){_0x2ec905=_0x2ec905-0x0;var _0xc98bd=_0xd423[_0x2ec905];return _0xc98bd;};'use strict';var EventEmitter=require(_0x3d42('0x0'));var VoiceExtension=require(_0x3d42('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3d42('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d42('0x3'),'afterDestroy':'remove'};function emitEvent(_0x537182){return function(_0x3a4926,_0x49e4aa,_0xcd95f2){VoiceExtensionEvents[_0x3d42('0x4')](_0x537182+':'+_0x3a4926['id'],_0x3a4926);VoiceExtensionEvents[_0x3d42('0x4')](_0x537182,_0x3a4926);_0xcd95f2(null);};}for(var e in events){if(events[_0x3d42('0x5')](e)){var event=events[e];VoiceExtension[_0x3d42('0x6')](e,emitEvent(event));}}module[_0x3d42('0x7')]=VoiceExtensionEvents;