9fb15c123185b400dee82b0ce5da79f5a6ecd1ab
[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 _0x1eba=['channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','name'];(function(_0x130d8d,_0x44467d){var _0x5dbb35=function(_0x10b52a){while(--_0x10b52a){_0x130d8d['push'](_0x130d8d['shift']());}};_0x5dbb35(++_0x44467d);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x1eba[_0x5471ec];return _0x121d4c;};'use strict';var util=require(_0xa1eb('0x0'));var _=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));function checkNameSurname(_0x2158d5,_0x3ef7ee,_0x5865fc){var _0x56c5f2='';if(!_[_0xa1eb('0x3')](_0x3ef7ee)&&_0xa1eb('0x4')===typeof _0x3ef7ee){_0x56c5f2+=_0x3ef7ee;}if(!_[_0xa1eb('0x3')](_0x5865fc)&&_0xa1eb('0x4')===typeof _0x5865fc){_0x56c5f2+='\x20'+_0x5865fc;}if(_0x56c5f2!==''){return _0x56c5f2;}return _0x2158d5;}function Action(_0x138789,_0x2933d0,_0x1d0d67,_0x2bfbb0,_0x39a5a3){this[_0xa1eb('0x5')]=_0x1d0d67||undefined;this[_0xa1eb('0x6')]=_0x138789['id'];this[_0xa1eb('0x7')]=_0x2933d0['name'];this[_0xa1eb('0x8')]=_0x2933d0['type'];this[_0xa1eb('0x9')]='queue';this[_0xa1eb('0xa')]=![];this['membername']=_[_0xa1eb('0x3')](_0x138789['Agent'])?undefined:_0x138789[_0xa1eb('0xb')][_0xa1eb('0xc')];this[_0xa1eb('0xd')]=this['membername']?util[_0xa1eb('0xe')](_0xa1eb('0xf'),this['membername']):_0x2bfbb0||undefined;this[_0xa1eb('0x10')]=checkNameSurname(_0x138789['Contact']['phone'],_0x138789[_0xa1eb('0x11')]['firstName'],_0x138789[_0xa1eb('0x11')][_0xa1eb('0x12')]);this[_0xa1eb('0x13')]=_0x138789[_0xa1eb('0x13')]||![];this[_0xa1eb('0x14')]=_0x138789[_0xa1eb('0x15')];this[_0xa1eb('0x16')]=_0x138789[_0xa1eb('0x16')];this[_0xa1eb('0x17')]=_0x138789['countbusyretry']||0x0;this[_0xa1eb('0x18')]=_0x138789['countcongestionretry']||0x0;this[_0xa1eb('0x19')]=_0x138789[_0xa1eb('0x19')]||0x0;this[_0xa1eb('0x1a')]=(_0x138789[_0xa1eb('0x17')]||0x0)+(_0x138789['countcongestionretry']||0x0)+(_0x138789[_0xa1eb('0x19')]||0x0)+(_0x138789[_0xa1eb('0x1b')]||0x0)+(_0x138789[_0xa1eb('0x1c')]||0x0)+(_0x138789[_0xa1eb('0x1d')]||0x0)+(_0x138789[_0xa1eb('0x1e')]||0x0)+(_0x138789[_0xa1eb('0x1f')]||0x0);this[_0xa1eb('0x1b')]=_0x138789[_0xa1eb('0x1b')]||0x0;this['countdropretry']=_0x138789[_0xa1eb('0x1c')]||0x0;this['countabandonedretry']=_0x138789[_0xa1eb('0x1d')]||0x0;this[_0xa1eb('0x1e')]=_0x138789[_0xa1eb('0x1e')]||0x0;this[_0xa1eb('0x1f')]=_0x138789['countagentrejectretry']||0x0;this['callback']=_0x138789[_0xa1eb('0x20')];this[_0xa1eb('0x21')]=_0x138789['callbackuniqueid'];this[_0xa1eb('0x22')]=_0x138789[_0xa1eb('0x22')];this[_0xa1eb('0x23')]=_0x138789[_0xa1eb('0x23')];this[_0xa1eb('0x24')]=_0x138789[_0xa1eb('0x24')];this[_0xa1eb('0x25')]=_0x138789[_0xa1eb('0x25')];this[_0xa1eb('0x26')]=_[_0xa1eb('0x3')](_0x138789[_0xa1eb('0xb')])?_0x138789[_0xa1eb('0x26')]:_0x138789['Agent']['id'];this[_0xa1eb('0x27')]=_0x138789[_0xa1eb('0x27')];this['originatecalleridnum']='';this[_0xa1eb('0x28')]='';}Action['prototype'][_0xa1eb('0x29')]=function(){return util[_0xa1eb('0xe')]('\x22%s\x22\x20<%s>',this[_0xa1eb('0x10')],this[_0xa1eb('0x2a')]);};module[_0xa1eb('0x2b')]=Action;