Built motion from commit (unavailable).|2.5.30
[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 _0x0889=['active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','lodash','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName'];(function(_0x23bff0,_0xeaaf27){var _0xe484aa=function(_0x2ee147){while(--_0x2ee147){_0x23bff0['push'](_0x23bff0['shift']());}};_0xe484aa(++_0xeaaf27);}(_0x0889,0x9e));var _0x9088=function(_0x4c5efa,_0x2ff22e){_0x4c5efa=_0x4c5efa-0x0;var _0x1df1e4=_0x0889[_0x4c5efa];return _0x1df1e4;};'use strict';var util=require('util');var _=require(_0x9088('0x0'));var moment=require('moment');function checkNameSurname(_0x40c1d2,_0x467e6c,_0x19111f){var _0x41f2a3='';if(!_[_0x9088('0x1')](_0x467e6c)&&_0x9088('0x2')===typeof _0x467e6c){_0x41f2a3+=_0x467e6c;}if(!_[_0x9088('0x1')](_0x19111f)&&_0x9088('0x2')===typeof _0x19111f){_0x41f2a3+='\x20'+_0x19111f;}if(_0x41f2a3!==''){return _0x41f2a3;}return _0x40c1d2;}function Action(_0x2dd24e,_0x4295b7,_0x43a89e,_0x5d77bd,_0x58080d){this[_0x9088('0x3')]=_0x43a89e||undefined;this['idContact']=_0x2dd24e['id'];this[_0x9088('0x4')]=_0x4295b7[_0x9088('0x5')];this['type']=_0x4295b7[_0x9088('0x6')];this[_0x9088('0x7')]='queue';this[_0x9088('0x8')]=![];this[_0x9088('0x9')]=_[_0x9088('0x1')](_0x2dd24e[_0x9088('0xa')])?undefined:_0x2dd24e[_0x9088('0xa')][_0x9088('0x5')];this[_0x9088('0xb')]=this['membername']?util[_0x9088('0xc')](_0x9088('0xd'),this[_0x9088('0x9')]):_0x5d77bd||undefined;this[_0x9088('0xe')]=checkNameSurname(_0x2dd24e[_0x9088('0xf')][_0x9088('0x10')],_0x2dd24e[_0x9088('0xf')][_0x9088('0x11')],_0x2dd24e[_0x9088('0xf')]['lastName']);this[_0x9088('0x12')]=_0x2dd24e[_0x9088('0x12')]||![];this[_0x9088('0x13')]=_0x2dd24e[_0x9088('0xf')][_0x9088('0x10')];this[_0x9088('0x14')]=_0x2dd24e[_0x9088('0x14')];this['countbusyretry']=_0x2dd24e[_0x9088('0x15')]||0x0;this[_0x9088('0x16')]=_0x2dd24e[_0x9088('0x16')]||0x0;this[_0x9088('0x17')]=_0x2dd24e[_0x9088('0x17')]||0x0;this[_0x9088('0x18')]=(_0x2dd24e[_0x9088('0x15')]||0x0)+(_0x2dd24e[_0x9088('0x16')]||0x0)+(_0x2dd24e[_0x9088('0x17')]||0x0)+(_0x2dd24e[_0x9088('0x19')]||0x0)+(_0x2dd24e[_0x9088('0x1a')]||0x0)+(_0x2dd24e[_0x9088('0x1b')]||0x0)+(_0x2dd24e[_0x9088('0x1c')]||0x0)+(_0x2dd24e[_0x9088('0x1d')]||0x0);this[_0x9088('0x19')]=_0x2dd24e[_0x9088('0x19')]||0x0;this[_0x9088('0x1a')]=_0x2dd24e['countdropretry']||0x0;this[_0x9088('0x1b')]=_0x2dd24e[_0x9088('0x1b')]||0x0;this[_0x9088('0x1c')]=_0x2dd24e['countmachineretry']||0x0;this['countagentrejectretry']=_0x2dd24e[_0x9088('0x1d')]||0x0;this[_0x9088('0x1e')]=_0x2dd24e[_0x9088('0x1e')];this['callbackuniqueid']=_0x2dd24e[_0x9088('0x1f')];this[_0x9088('0x20')]=_0x2dd24e['callbackat'];this[_0x9088('0x21')]=_0x2dd24e[_0x9088('0x21')];this[_0x9088('0x22')]=_0x2dd24e[_0x9088('0x22')];this['ListId']=_0x2dd24e[_0x9088('0x23')];this[_0x9088('0x24')]=_[_0x9088('0x1')](_0x2dd24e[_0x9088('0xa')])?_0x2dd24e[_0x9088('0x24')]:_0x2dd24e[_0x9088('0xa')]['id'];this[_0x9088('0x25')]=_0x2dd24e[_0x9088('0x25')];this[_0x9088('0x26')]='';this[_0x9088('0x27')]='';}Action[_0x9088('0x28')][_0x9088('0x29')]=function(){return util[_0x9088('0xc')](_0x9088('0x2a'),this[_0x9088('0xe')],this['number']);};module[_0x9088('0x2b')]=Action;