Built motion from commit d5e4af8c.|2.6.23
[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 _0xb768=['emit','hasOwnProperty','VoiceExtension','setMaxListeners','save','update','remove'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xb768,0x1c2));var _0x8b76=function(_0x50752a,_0x16d9ae){_0x50752a=_0x50752a-0x0;var _0x5460aa=_0xb768[_0x50752a];return _0x5460aa;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x8b76('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8b76('0x1')](0x0);var events={'afterCreate':_0x8b76('0x2'),'afterUpdate':_0x8b76('0x3'),'afterDestroy':_0x8b76('0x4')};function emitEvent(_0x4ce971){return function(_0x13e763,_0x3c18b4,_0x452f10){VoiceExtensionEvents['emit'](_0x4ce971+':'+_0x13e763['id'],_0x13e763);VoiceExtensionEvents[_0x8b76('0x5')](_0x4ce971,_0x13e763);_0x452f10(null);};}for(var e in events){if(events[_0x8b76('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;