4132850576b769f4597f026e813fff682cd504aa
[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 _0x9f0e=['UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x4deff1,_0x5421fc){var _0x559271=function(_0x2a2e34){while(--_0x2a2e34){_0x4deff1['push'](_0x4deff1['shift']());}};_0x559271(++_0x5421fc);}(_0x9f0e,0x116));var _0xe9f0=function(_0x2fbcdd,_0x5b619b){_0x2fbcdd=_0x2fbcdd-0x0;var _0x1088dc=_0x9f0e[_0x2fbcdd];return _0x1088dc;};'use strict';var util=require(_0xe9f0('0x0'));var _=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));function checkNameSurname(_0x1a7796,_0x146ad8,_0x4a1a30){var _0x5856dc='';if(!_[_0xe9f0('0x3')](_0x146ad8)&&_0xe9f0('0x4')===typeof _0x146ad8){_0x5856dc+=_0x146ad8;}if(!_[_0xe9f0('0x3')](_0x4a1a30)&&_0xe9f0('0x4')===typeof _0x4a1a30){_0x5856dc+='\x20'+_0x4a1a30;}if(_0x5856dc!==''){return _0x5856dc;}return _0x1a7796;}function Action(_0x1eed45,_0x50313d,_0x5b87c1,_0x3a17b3,_0x167198){this[_0xe9f0('0x5')]=_0x5b87c1||undefined;this['idContact']=_0x1eed45['id'];this[_0xe9f0('0x6')]=_0x50313d[_0xe9f0('0x7')];this[_0xe9f0('0x8')]=_0x50313d[_0xe9f0('0x8')];this[_0xe9f0('0x9')]=_0xe9f0('0x6');this[_0xe9f0('0xa')]=![];this[_0xe9f0('0xb')]=_[_0xe9f0('0x3')](_0x1eed45['Agent'])?undefined:_0x1eed45[_0xe9f0('0xc')][_0xe9f0('0x7')];this[_0xe9f0('0xd')]=this['membername']?util[_0xe9f0('0xe')]('SIP/%s',this[_0xe9f0('0xb')]):_0x3a17b3||undefined;this[_0xe9f0('0xf')]=checkNameSurname(_0x1eed45[_0xe9f0('0x10')][_0xe9f0('0x11')],_0x1eed45['Contact'][_0xe9f0('0x12')],_0x1eed45['Contact'][_0xe9f0('0x13')]);this[_0xe9f0('0x14')]=_0x1eed45[_0xe9f0('0x14')]||![];this['calleridnum']=_0x1eed45[_0xe9f0('0x11')];this[_0xe9f0('0x15')]=_0x1eed45[_0xe9f0('0x15')];this['countbusyretry']=_0x1eed45[_0xe9f0('0x16')]||0x0;this[_0xe9f0('0x17')]=_0x1eed45[_0xe9f0('0x17')]||0x0;this[_0xe9f0('0x18')]=_0x1eed45[_0xe9f0('0x18')]||0x0;this[_0xe9f0('0x19')]=(_0x1eed45[_0xe9f0('0x16')]||0x0)+(_0x1eed45['countcongestionretry']||0x0)+(_0x1eed45[_0xe9f0('0x18')]||0x0)+(_0x1eed45[_0xe9f0('0x1a')]||0x0)+(_0x1eed45[_0xe9f0('0x1b')]||0x0)+(_0x1eed45['countabandonedretry']||0x0)+(_0x1eed45[_0xe9f0('0x1c')]||0x0)+(_0x1eed45[_0xe9f0('0x1d')]||0x0);this[_0xe9f0('0x1a')]=_0x1eed45[_0xe9f0('0x1a')]||0x0;this['countdropretry']=_0x1eed45[_0xe9f0('0x1b')]||0x0;this[_0xe9f0('0x1e')]=_0x1eed45['countabandonedretry']||0x0;this['countmachineretry']=_0x1eed45['countmachineretry']||0x0;this[_0xe9f0('0x1d')]=_0x1eed45[_0xe9f0('0x1d')]||0x0;this[_0xe9f0('0x1f')]=_0x1eed45[_0xe9f0('0x1f')];this[_0xe9f0('0x20')]=_0x1eed45['callbackuniqueid'];this[_0xe9f0('0x21')]=_0x1eed45[_0xe9f0('0x21')];this[_0xe9f0('0x22')]=_0x1eed45[_0xe9f0('0x22')];this[_0xe9f0('0x23')]=_0x1eed45[_0xe9f0('0x23')];this[_0xe9f0('0x24')]=_0x1eed45[_0xe9f0('0x24')];this[_0xe9f0('0x25')]=_[_0xe9f0('0x3')](_0x1eed45['Agent'])?_0x1eed45[_0xe9f0('0x25')]:_0x1eed45[_0xe9f0('0xc')]['id'];this[_0xe9f0('0x26')]=_0x1eed45[_0xe9f0('0x26')];this['originatecalleridnum']='';this[_0xe9f0('0x27')]='';}Action[_0xe9f0('0x28')][_0xe9f0('0x29')]=function(){return util[_0xe9f0('0xe')](_0xe9f0('0x2a'),this['calleridname'],this[_0xe9f0('0x2b')]);};module[_0xe9f0('0x2c')]=Action;