Built motion from commit 9d0783e6.|2.6.13
[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 _0x2b61=['remove','emit','hasOwnProperty','hook','exports','VoiceExtension','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b61,0xa7));var _0x12b6=function(_0x18959e,_0x24e830){_0x18959e=_0x18959e-0x0;var _0x308aba=_0x2b61[_0x18959e];return _0x308aba;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x12b6('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x12b6('0x1')](0x0);var events={'afterCreate':_0x12b6('0x2'),'afterUpdate':_0x12b6('0x3'),'afterDestroy':_0x12b6('0x4')};function emitEvent(_0x550568){return function(_0x15808b,_0x1ca47a,_0x4d6c8d){VoiceExtensionEvents[_0x12b6('0x5')](_0x550568+':'+_0x15808b['id'],_0x15808b);VoiceExtensionEvents['emit'](_0x550568,_0x15808b);_0x4d6c8d(null);};}for(var e in events){if(events[_0x12b6('0x6')](e)){var event=events[e];VoiceExtension[_0x12b6('0x7')](e,emitEvent(event));}}module[_0x12b6('0x8')]=VoiceExtensionEvents;