b5fbc831e2ee6f91a660eadfb5963fc9b9c45070
[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 _0x668f=['queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','calleridname','Contact','firstName','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','format','number','exports','util','lodash','isNil','string','uniqueid','idContact'];(function(_0x52991d,_0x429d72){var _0x5b9004=function(_0x4bfe0d){while(--_0x4bfe0d){_0x52991d['push'](_0x52991d['shift']());}};_0x5b9004(++_0x429d72);}(_0x668f,0x1d3));var _0xf668=function(_0x17843e,_0x51c9a2){_0x17843e=_0x17843e-0x0;var _0x1797aa=_0x668f[_0x17843e];return _0x1797aa;};'use strict';var util=require(_0xf668('0x0'));var _=require(_0xf668('0x1'));var moment=require('moment');function checkNameSurname(_0x2cc4b8,_0x1e88fd,_0x519ebe){var _0x379d95='';if(!_[_0xf668('0x2')](_0x1e88fd)&&_0xf668('0x3')===typeof _0x1e88fd){_0x379d95+=_0x1e88fd;}if(!_[_0xf668('0x2')](_0x519ebe)&&_0xf668('0x3')===typeof _0x519ebe){_0x379d95+='\x20'+_0x519ebe;}if(_0x379d95!==''){return _0x379d95;}return _0x2cc4b8;}function Action(_0x5579cd,_0x201079,_0x47b3d3,_0x295eca,_0x1d5592){this[_0xf668('0x4')]=_0x47b3d3||undefined;this[_0xf668('0x5')]=_0x5579cd['id'];this[_0xf668('0x6')]=_0x201079[_0xf668('0x7')];this[_0xf668('0x8')]=_0x201079[_0xf668('0x8')];this[_0xf668('0x9')]='queue';this[_0xf668('0xa')]=![];this[_0xf668('0xb')]=_[_0xf668('0x2')](_0x5579cd[_0xf668('0xc')])?undefined:_0x5579cd[_0xf668('0xc')]['name'];this[_0xf668('0xd')]=this[_0xf668('0xb')]?util['format']('SIP/%s',this[_0xf668('0xb')]):_0x295eca||undefined;this[_0xf668('0xe')]=checkNameSurname(_0x5579cd[_0xf668('0xf')]['phone'],_0x5579cd[_0xf668('0xf')][_0xf668('0x10')],_0x5579cd[_0xf668('0xf')][_0xf668('0x11')]);this[_0xf668('0x12')]=_0x5579cd['active']||![];this['calleridnum']=_0x5579cd[_0xf668('0xf')][_0xf668('0x13')];this[_0xf668('0x14')]=_0x5579cd[_0xf668('0x14')];this[_0xf668('0x15')]=_0x5579cd[_0xf668('0x15')]||0x0;this[_0xf668('0x16')]=_0x5579cd[_0xf668('0x16')]||0x0;this[_0xf668('0x17')]=_0x5579cd[_0xf668('0x17')]||0x0;this[_0xf668('0x18')]=(_0x5579cd[_0xf668('0x15')]||0x0)+(_0x5579cd[_0xf668('0x16')]||0x0)+(_0x5579cd[_0xf668('0x17')]||0x0)+(_0x5579cd['countnosuchnumberretry']||0x0)+(_0x5579cd['countdropretry']||0x0)+(_0x5579cd[_0xf668('0x19')]||0x0)+(_0x5579cd[_0xf668('0x1a')]||0x0)+(_0x5579cd[_0xf668('0x1b')]||0x0);this[_0xf668('0x1c')]=_0x5579cd[_0xf668('0x1c')]||0x0;this[_0xf668('0x1d')]=_0x5579cd[_0xf668('0x1d')]||0x0;this['countabandonedretry']=_0x5579cd[_0xf668('0x19')]||0x0;this[_0xf668('0x1a')]=_0x5579cd['countmachineretry']||0x0;this['countagentrejectretry']=_0x5579cd[_0xf668('0x1b')]||0x0;this['callback']=_0x5579cd['callback'];this['callbackuniqueid']=_0x5579cd[_0xf668('0x1e')];this[_0xf668('0x1f')]=_0x5579cd[_0xf668('0x1f')];this[_0xf668('0x20')]=_0x5579cd[_0xf668('0x20')];this[_0xf668('0x21')]=_0x5579cd['ContactId'];this[_0xf668('0x22')]=_0x5579cd[_0xf668('0x22')];this[_0xf668('0x23')]=_[_0xf668('0x2')](_0x5579cd['Agent'])?_0x5579cd[_0xf668('0x23')]:_0x5579cd[_0xf668('0xc')]['id'];this[_0xf668('0x24')]=_0x5579cd[_0xf668('0x24')];this[_0xf668('0x25')]='';this[_0xf668('0x26')]='';}Action[_0xf668('0x27')]['getCaller']=function(){return util[_0xf668('0x28')]('\x22%s\x22\x20<%s>',this[_0xf668('0xe')],this[_0xf668('0x29')]);};module[_0xf668('0x2a')]=Action;