22a73451ed2317b881e534d141c06996ff2a4843
[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 _0x0424=['exports','VoiceExtension','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5dbd80,_0x3e6717){var _0x133599=function(_0x3fc71a){while(--_0x3fc71a){_0x5dbd80['push'](_0x5dbd80['shift']());}};_0x133599(++_0x3e6717);}(_0x0424,0x159));var _0x4042=function(_0x36d703,_0x55b354){_0x36d703=_0x36d703-0x0;var _0x12c909=_0x0424[_0x36d703];return _0x12c909;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x4042('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4042('0x1')](0x0);var events={'afterCreate':_0x4042('0x2'),'afterUpdate':_0x4042('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cd879){return function(_0x519987,_0x491eae,_0x20d8df){VoiceExtensionEvents[_0x4042('0x4')](_0x3cd879+':'+_0x519987['id'],_0x519987);VoiceExtensionEvents[_0x4042('0x4')](_0x3cd879,_0x519987);_0x20d8df(null);};}for(var e in events){if(events[_0x4042('0x5')](e)){var event=events[e];VoiceExtension[_0x4042('0x6')](e,emitEvent(event));}}module[_0x4042('0x7')]=VoiceExtensionEvents;