Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / services / ami / preview / action.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 _0xa7f0=['calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','number','exports','util','moment','isNil','string','uniqueid','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active'];(function(_0x839516,_0x40b33a){var _0x24c5d6=function(_0xb87803){while(--_0xb87803){_0x839516['push'](_0x839516['shift']());}};_0x24c5d6(++_0x40b33a);}(_0xa7f0,0x1cf));var _0x0a7f=function(_0x3676fb,_0x2adf5f){_0x3676fb=_0x3676fb-0x0;var _0x26e59c=_0xa7f0[_0x3676fb];return _0x26e59c;};'use strict';var util=require(_0x0a7f('0x0'));var _=require('lodash');var moment=require(_0x0a7f('0x1'));function checkNameSurname(_0x24684c,_0x421dc6,_0xa9cf53){var _0x480b56='';if(!_[_0x0a7f('0x2')](_0x421dc6)&&_0x0a7f('0x3')===typeof _0x421dc6){_0x480b56+=_0x421dc6;}if(!_['isNil'](_0xa9cf53)&&'string'===typeof _0xa9cf53){_0x480b56+='\x20'+_0xa9cf53;}if(_0x480b56!==''){return _0x480b56;}return _0x24684c;}function Action(_0x4fa3b6,_0x15465f,_0x164108,_0x205edf,_0x3e27d1){this[_0x0a7f('0x4')]=_0x164108||undefined;this['idContact']=_0x4fa3b6['id'];this['queue']=_0x15465f[_0x0a7f('0x5')];this[_0x0a7f('0x6')]=_0x15465f[_0x0a7f('0x6')];this[_0x0a7f('0x7')]=_0x0a7f('0x8');this[_0x0a7f('0x9')]=![];this[_0x0a7f('0xa')]=_[_0x0a7f('0x2')](_0x4fa3b6[_0x0a7f('0xb')])?undefined:_0x4fa3b6[_0x0a7f('0xb')][_0x0a7f('0x5')];this[_0x0a7f('0xc')]=this[_0x0a7f('0xa')]?util[_0x0a7f('0xd')](_0x0a7f('0xe'),this[_0x0a7f('0xa')]):_0x205edf||undefined;this[_0x0a7f('0xf')]=checkNameSurname(_0x4fa3b6[_0x0a7f('0x10')][_0x0a7f('0x11')],_0x4fa3b6['Contact'][_0x0a7f('0x12')],_0x4fa3b6[_0x0a7f('0x10')][_0x0a7f('0x13')]);this[_0x0a7f('0x14')]=_0x4fa3b6[_0x0a7f('0x14')]||![];this[_0x0a7f('0x15')]=_0x4fa3b6[_0x0a7f('0x10')][_0x0a7f('0x11')];this['scheduledat']=_0x4fa3b6[_0x0a7f('0x16')];this['countbusyretry']=_0x4fa3b6[_0x0a7f('0x17')]||0x0;this['countcongestionretry']=_0x4fa3b6[_0x0a7f('0x18')]||0x0;this[_0x0a7f('0x19')]=_0x4fa3b6[_0x0a7f('0x19')]||0x0;this[_0x0a7f('0x1a')]=(_0x4fa3b6[_0x0a7f('0x17')]||0x0)+(_0x4fa3b6[_0x0a7f('0x18')]||0x0)+(_0x4fa3b6[_0x0a7f('0x19')]||0x0)+(_0x4fa3b6[_0x0a7f('0x1b')]||0x0)+(_0x4fa3b6[_0x0a7f('0x1c')]||0x0)+(_0x4fa3b6['countabandonedretry']||0x0)+(_0x4fa3b6[_0x0a7f('0x1d')]||0x0)+(_0x4fa3b6[_0x0a7f('0x1e')]||0x0);this[_0x0a7f('0x1b')]=_0x4fa3b6['countnosuchnumberretry']||0x0;this['countdropretry']=_0x4fa3b6['countdropretry']||0x0;this[_0x0a7f('0x1f')]=_0x4fa3b6['countabandonedretry']||0x0;this[_0x0a7f('0x1d')]=_0x4fa3b6[_0x0a7f('0x1d')]||0x0;this[_0x0a7f('0x1e')]=_0x4fa3b6[_0x0a7f('0x1e')]||0x0;this['callback']=_0x4fa3b6[_0x0a7f('0x20')];this[_0x0a7f('0x21')]=_0x4fa3b6[_0x0a7f('0x21')];this[_0x0a7f('0x22')]=_0x4fa3b6['callbackat'];this['recallme']=_0x4fa3b6['recallme'];this[_0x0a7f('0x23')]=_0x4fa3b6[_0x0a7f('0x23')];this[_0x0a7f('0x24')]=_0x4fa3b6[_0x0a7f('0x24')];this[_0x0a7f('0x25')]=_[_0x0a7f('0x2')](_0x4fa3b6[_0x0a7f('0xb')])?_0x4fa3b6['UserId']:_0x4fa3b6[_0x0a7f('0xb')]['id'];this[_0x0a7f('0x26')]=_0x4fa3b6['VoiceQueueId'];this['originatecalleridnum']='';this[_0x0a7f('0x27')]='';}Action[_0x0a7f('0x28')][_0x0a7f('0x29')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x0a7f('0x2a')]);};module[_0x0a7f('0x2b')]=Action;