18ef13ca88d294deaf600e9521ec6885eaacb49f
[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 _0x7d25=['ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','uniqueid','name','type','campaigntype','queue','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x2193ca,_0x35c872){var _0x1c005b=function(_0x3c7b0e){while(--_0x3c7b0e){_0x2193ca['push'](_0x2193ca['shift']());}};_0x1c005b(++_0x35c872);}(_0x7d25,0x8a));var _0x57d2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7d25[_0x4565bf];return _0x5610ba;};'use strict';var util=require('util');var _=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));function checkNameSurname(_0x35bca8,_0x286bd3,_0x34bad5){var _0x56e08b='';if(!_[_0x57d2('0x2')](_0x286bd3)&&'string'===typeof _0x286bd3){_0x56e08b+=_0x286bd3;}if(!_['isNil'](_0x34bad5)&&'string'===typeof _0x34bad5){_0x56e08b+='\x20'+_0x34bad5;}if(_0x56e08b!==''){return _0x56e08b;}return _0x35bca8;}function Action(_0x5dea84,_0x3c5511,_0x49cc5f,_0x1f43b2,_0x263d35){this[_0x57d2('0x3')]=_0x49cc5f||undefined;this['idContact']=_0x5dea84['id'];this['queue']=_0x3c5511[_0x57d2('0x4')];this['type']=_0x3c5511[_0x57d2('0x5')];this[_0x57d2('0x6')]=_0x57d2('0x7');this['dialAnswer']=![];this[_0x57d2('0x8')]=_[_0x57d2('0x2')](_0x5dea84[_0x57d2('0x9')])?undefined:_0x5dea84[_0x57d2('0x9')][_0x57d2('0x4')];this[_0x57d2('0xa')]=this[_0x57d2('0x8')]?util[_0x57d2('0xb')](_0x57d2('0xc'),this[_0x57d2('0x8')]):_0x1f43b2||undefined;this[_0x57d2('0xd')]=checkNameSurname(_0x5dea84[_0x57d2('0xe')][_0x57d2('0xf')],_0x5dea84[_0x57d2('0xe')][_0x57d2('0x10')],_0x5dea84[_0x57d2('0xe')]['lastName']);this['active']=_0x5dea84[_0x57d2('0x11')]||![];this[_0x57d2('0x12')]=_0x5dea84['phone'];this[_0x57d2('0x13')]=_0x5dea84[_0x57d2('0x13')];this['countbusyretry']=_0x5dea84[_0x57d2('0x14')]||0x0;this['countcongestionretry']=_0x5dea84[_0x57d2('0x15')]||0x0;this['countnoanswerretry']=_0x5dea84[_0x57d2('0x16')]||0x0;this[_0x57d2('0x17')]=(_0x5dea84[_0x57d2('0x14')]||0x0)+(_0x5dea84['countcongestionretry']||0x0)+(_0x5dea84['countnoanswerretry']||0x0)+(_0x5dea84[_0x57d2('0x18')]||0x0)+(_0x5dea84[_0x57d2('0x19')]||0x0)+(_0x5dea84[_0x57d2('0x1a')]||0x0)+(_0x5dea84[_0x57d2('0x1b')]||0x0)+(_0x5dea84['countagentrejectretry']||0x0);this[_0x57d2('0x18')]=_0x5dea84[_0x57d2('0x18')]||0x0;this['countdropretry']=_0x5dea84['countdropretry']||0x0;this[_0x57d2('0x1a')]=_0x5dea84[_0x57d2('0x1a')]||0x0;this[_0x57d2('0x1b')]=_0x5dea84[_0x57d2('0x1b')]||0x0;this[_0x57d2('0x1c')]=_0x5dea84[_0x57d2('0x1c')]||0x0;this[_0x57d2('0x1d')]=_0x5dea84[_0x57d2('0x1d')];this[_0x57d2('0x1e')]=_0x5dea84[_0x57d2('0x1e')];this[_0x57d2('0x1f')]=_0x5dea84[_0x57d2('0x1f')];this[_0x57d2('0x20')]=_0x5dea84[_0x57d2('0x20')];this['ContactId']=_0x5dea84[_0x57d2('0x21')];this[_0x57d2('0x22')]=_0x5dea84[_0x57d2('0x22')];this[_0x57d2('0x23')]=_[_0x57d2('0x2')](_0x5dea84['Agent'])?_0x5dea84[_0x57d2('0x23')]:_0x5dea84[_0x57d2('0x9')]['id'];this[_0x57d2('0x24')]=_0x5dea84[_0x57d2('0x24')];this[_0x57d2('0x25')]='';this[_0x57d2('0x26')]='';}Action[_0x57d2('0x27')]['getCaller']=function(){return util[_0x57d2('0xb')](_0x57d2('0x28'),this[_0x57d2('0xd')],this[_0x57d2('0x29')]);};module[_0x57d2('0x2a')]=Action;