7b64f162eaea7b07dcb2453733d811a0a0b97d86
[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 _0x2da6=['queue','type','campaigntype','membername','Agent','name','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact'];(function(_0x2eedb5,_0x2e1801){var _0x534cd6=function(_0x17100c){while(--_0x17100c){_0x2eedb5['push'](_0x2eedb5['shift']());}};_0x534cd6(++_0x2e1801);}(_0x2da6,0x1dd));var _0x62da=function(_0x129dc8,_0x430348){_0x129dc8=_0x129dc8-0x0;var _0x11cd64=_0x2da6[_0x129dc8];return _0x11cd64;};'use strict';var util=require(_0x62da('0x0'));var _=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));function checkNameSurname(_0xbbb39b,_0xd62c5c,_0x12b8ad){var _0x19081e='';if(!_[_0x62da('0x3')](_0xd62c5c)&&'string'===typeof _0xd62c5c){_0x19081e+=_0xd62c5c;}if(!_['isNil'](_0x12b8ad)&&_0x62da('0x4')===typeof _0x12b8ad){_0x19081e+='\x20'+_0x12b8ad;}if(_0x19081e!==''){return _0x19081e;}return _0xbbb39b;}function Action(_0x3163df,_0x3a59f8,_0x30437f,_0x100e73,_0x9d9139){this[_0x62da('0x5')]=_0x30437f||undefined;this[_0x62da('0x6')]=_0x3163df['id'];this[_0x62da('0x7')]=_0x3a59f8['name'];this[_0x62da('0x8')]=_0x3a59f8[_0x62da('0x8')];this[_0x62da('0x9')]=_0x62da('0x7');this['dialAnswer']=![];this[_0x62da('0xa')]=_[_0x62da('0x3')](_0x3163df[_0x62da('0xb')])?undefined:_0x3163df[_0x62da('0xb')][_0x62da('0xc')];this['channelAgent']=this[_0x62da('0xa')]?util[_0x62da('0xd')](_0x62da('0xe'),this[_0x62da('0xa')]):_0x100e73||undefined;this[_0x62da('0xf')]=checkNameSurname(_0x3163df['Contact']['phone'],_0x3163df[_0x62da('0x10')][_0x62da('0x11')],_0x3163df[_0x62da('0x10')][_0x62da('0x12')]);this[_0x62da('0x13')]=_0x3163df[_0x62da('0x13')]||![];this[_0x62da('0x14')]=_0x3163df[_0x62da('0x15')];this[_0x62da('0x16')]=_0x3163df[_0x62da('0x16')];this[_0x62da('0x17')]=_0x3163df[_0x62da('0x17')]||0x0;this[_0x62da('0x18')]=_0x3163df[_0x62da('0x18')]||0x0;this['countnoanswerretry']=_0x3163df['countnoanswerretry']||0x0;this[_0x62da('0x19')]=(_0x3163df['countbusyretry']||0x0)+(_0x3163df[_0x62da('0x18')]||0x0)+(_0x3163df[_0x62da('0x1a')]||0x0)+(_0x3163df[_0x62da('0x1b')]||0x0)+(_0x3163df['countdropretry']||0x0)+(_0x3163df[_0x62da('0x1c')]||0x0)+(_0x3163df['countmachineretry']||0x0)+(_0x3163df[_0x62da('0x1d')]||0x0);this[_0x62da('0x1b')]=_0x3163df[_0x62da('0x1b')]||0x0;this[_0x62da('0x1e')]=_0x3163df[_0x62da('0x1e')]||0x0;this[_0x62da('0x1c')]=_0x3163df[_0x62da('0x1c')]||0x0;this[_0x62da('0x1f')]=_0x3163df[_0x62da('0x1f')]||0x0;this['countagentrejectretry']=_0x3163df[_0x62da('0x1d')]||0x0;this[_0x62da('0x20')]=_0x3163df[_0x62da('0x20')];this[_0x62da('0x21')]=_0x3163df[_0x62da('0x21')];this[_0x62da('0x22')]=_0x3163df[_0x62da('0x22')];this['recallme']=_0x3163df['recallme'];this['ContactId']=_0x3163df[_0x62da('0x23')];this[_0x62da('0x24')]=_0x3163df[_0x62da('0x24')];this[_0x62da('0x25')]=_['isNil'](_0x3163df[_0x62da('0xb')])?_0x3163df[_0x62da('0x25')]:_0x3163df['Agent']['id'];this[_0x62da('0x26')]=_0x3163df[_0x62da('0x26')];this[_0x62da('0x27')]='';this['originatecalleridname']='';}Action[_0x62da('0x28')][_0x62da('0x29')]=function(){return util[_0x62da('0xd')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x62da('0x2a')]);};module[_0x62da('0x2b')]=Action;