0953e8f14e59a055f1c8e15a9db627a3542b0247
[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 _0xb067=['hasOwnProperty','exports','events','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x241eb9,_0x5ccc3f){var _0x4f916b=function(_0x412d98){while(--_0x412d98){_0x241eb9['push'](_0x241eb9['shift']());}};_0x4f916b(++_0x5ccc3f);}(_0xb067,0x13d));var _0x7b06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb067[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x7b06('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x7b06('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7b06('0x2')](0x0);var events={'afterCreate':_0x7b06('0x3'),'afterUpdate':_0x7b06('0x4'),'afterDestroy':_0x7b06('0x5')};function emitEvent(_0x178cc4){return function(_0x24603f,_0x85516e,_0x3a2353){VoiceExtensionEvents[_0x7b06('0x6')](_0x178cc4+':'+_0x24603f['id'],_0x24603f);VoiceExtensionEvents[_0x7b06('0x6')](_0x178cc4,_0x24603f);_0x3a2353(null);};}for(var e in events){if(events[_0x7b06('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x7b06('0x8')]=VoiceExtensionEvents;