Built motion from commit d6d69adf.|2.6.33
[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 _0x627e=['SIP/%s','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','campaigntype','queue','Agent','channelAgent','membername','format'];(function(_0x103498,_0x3df764){var _0x192b3e=function(_0x4d3e25){while(--_0x4d3e25){_0x103498['push'](_0x103498['shift']());}};_0x192b3e(++_0x3df764);}(_0x627e,0x14a));var _0xe627=function(_0x127b92,_0x2bc850){_0x127b92=_0x127b92-0x0;var _0x5889ee=_0x627e[_0x127b92];return _0x5889ee;};'use strict';var util=require(_0xe627('0x0'));var _=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));function checkNameSurname(_0x18dba3,_0x3afa80,_0x48b97a){var _0x2b7158='';if(!_[_0xe627('0x3')](_0x3afa80)&&_0xe627('0x4')===typeof _0x3afa80){_0x2b7158+=_0x3afa80;}if(!_['isNil'](_0x48b97a)&&'string'===typeof _0x48b97a){_0x2b7158+='\x20'+_0x48b97a;}if(_0x2b7158!==''){return _0x2b7158;}return _0x18dba3;}function Action(_0x4efcad,_0x1a1a3d,_0x3f2791,_0x45e49a,_0x2d4f63){this[_0xe627('0x5')]=_0x3f2791||undefined;this[_0xe627('0x6')]=_0x4efcad['id'];this['queue']=_0x1a1a3d[_0xe627('0x7')];this['type']=_0x1a1a3d['type'];this[_0xe627('0x8')]=_0xe627('0x9');this['dialAnswer']=![];this['membername']=_[_0xe627('0x3')](_0x4efcad[_0xe627('0xa')])?undefined:_0x4efcad[_0xe627('0xa')][_0xe627('0x7')];this[_0xe627('0xb')]=this[_0xe627('0xc')]?util[_0xe627('0xd')](_0xe627('0xe'),this[_0xe627('0xc')]):_0x45e49a||undefined;this['calleridname']=checkNameSurname(_0x4efcad[_0xe627('0xf')][_0xe627('0x10')],_0x4efcad[_0xe627('0xf')]['firstName'],_0x4efcad[_0xe627('0xf')][_0xe627('0x11')]);this[_0xe627('0x12')]=_0x4efcad[_0xe627('0x12')]||![];this[_0xe627('0x13')]=_0x4efcad[_0xe627('0x10')];this[_0xe627('0x14')]=_0x4efcad['scheduledat'];this[_0xe627('0x15')]=_0x4efcad[_0xe627('0x15')]||0x0;this[_0xe627('0x16')]=_0x4efcad[_0xe627('0x16')]||0x0;this[_0xe627('0x17')]=_0x4efcad[_0xe627('0x17')]||0x0;this[_0xe627('0x18')]=(_0x4efcad[_0xe627('0x15')]||0x0)+(_0x4efcad['countcongestionretry']||0x0)+(_0x4efcad[_0xe627('0x17')]||0x0)+(_0x4efcad['countnosuchnumberretry']||0x0)+(_0x4efcad[_0xe627('0x19')]||0x0)+(_0x4efcad['countabandonedretry']||0x0)+(_0x4efcad['countmachineretry']||0x0)+(_0x4efcad[_0xe627('0x1a')]||0x0);this['countnosuchnumberretry']=_0x4efcad[_0xe627('0x1b')]||0x0;this[_0xe627('0x19')]=_0x4efcad['countdropretry']||0x0;this['countabandonedretry']=_0x4efcad['countabandonedretry']||0x0;this[_0xe627('0x1c')]=_0x4efcad[_0xe627('0x1c')]||0x0;this['countagentrejectretry']=_0x4efcad[_0xe627('0x1a')]||0x0;this[_0xe627('0x1d')]=_0x4efcad['callback'];this[_0xe627('0x1e')]=_0x4efcad[_0xe627('0x1e')];this['callbackat']=_0x4efcad[_0xe627('0x1f')];this[_0xe627('0x20')]=_0x4efcad[_0xe627('0x20')];this['ContactId']=_0x4efcad[_0xe627('0x21')];this[_0xe627('0x22')]=_0x4efcad[_0xe627('0x22')];this[_0xe627('0x23')]=_['isNil'](_0x4efcad[_0xe627('0xa')])?_0x4efcad[_0xe627('0x23')]:_0x4efcad[_0xe627('0xa')]['id'];this[_0xe627('0x24')]=_0x4efcad[_0xe627('0x24')];this[_0xe627('0x25')]='';this[_0xe627('0x26')]='';}Action[_0xe627('0x27')][_0xe627('0x28')]=function(){return util['format'](_0xe627('0x29'),this['calleridname'],this['number']);};module[_0xe627('0x2a')]=Action;