75604f5a3771b4fa958115071a958f476547a7b4
[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 _0x4e2e=['countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','number','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','format','SIP/%s','membername','calleridname','phone','Contact','firstName','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x46a60a,_0x50fb7e){_0x46a60a=_0x46a60a-0x0;var _0x13040c=_0x4e2e[_0x46a60a];return _0x13040c;};'use strict';var util=require('util');var _=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));function checkNameSurname(_0x2ae450,_0x1b178f,_0x2041b9){var _0x4284bf='';if(!_['isNil'](_0x1b178f)&&_0xe4e2('0x2')===typeof _0x1b178f){_0x4284bf+=_0x1b178f;}if(!_[_0xe4e2('0x3')](_0x2041b9)&&_0xe4e2('0x2')===typeof _0x2041b9){_0x4284bf+='\x20'+_0x2041b9;}if(_0x4284bf!==''){return _0x4284bf;}return _0x2ae450;}function Action(_0x38c84c,_0x48e83d,_0x322295,_0x36b1c6,_0x1c4e64){this[_0xe4e2('0x4')]=_0x322295||undefined;this[_0xe4e2('0x5')]=_0x38c84c['id'];this[_0xe4e2('0x6')]=_0x48e83d[_0xe4e2('0x7')];this[_0xe4e2('0x8')]=_0x48e83d['type'];this[_0xe4e2('0x9')]=_0xe4e2('0x6');this[_0xe4e2('0xa')]=![];this['membername']=_[_0xe4e2('0x3')](_0x38c84c[_0xe4e2('0xb')])?undefined:_0x38c84c[_0xe4e2('0xb')][_0xe4e2('0x7')];this[_0xe4e2('0xc')]=this['membername']?util[_0xe4e2('0xd')](_0xe4e2('0xe'),this[_0xe4e2('0xf')]):_0x36b1c6||undefined;this[_0xe4e2('0x10')]=checkNameSurname(_0x38c84c['Contact'][_0xe4e2('0x11')],_0x38c84c[_0xe4e2('0x12')][_0xe4e2('0x13')],_0x38c84c[_0xe4e2('0x12')][_0xe4e2('0x14')]);this['active']=_0x38c84c['active']||![];this[_0xe4e2('0x15')]=_0x38c84c[_0xe4e2('0x11')];this[_0xe4e2('0x16')]=_0x38c84c[_0xe4e2('0x16')];this[_0xe4e2('0x17')]=_0x38c84c['countbusyretry']||0x0;this[_0xe4e2('0x18')]=_0x38c84c[_0xe4e2('0x18')]||0x0;this[_0xe4e2('0x19')]=_0x38c84c['countnoanswerretry']||0x0;this[_0xe4e2('0x1a')]=(_0x38c84c['countbusyretry']||0x0)+(_0x38c84c[_0xe4e2('0x18')]||0x0)+(_0x38c84c[_0xe4e2('0x19')]||0x0)+(_0x38c84c[_0xe4e2('0x1b')]||0x0)+(_0x38c84c[_0xe4e2('0x1c')]||0x0)+(_0x38c84c[_0xe4e2('0x1d')]||0x0)+(_0x38c84c[_0xe4e2('0x1e')]||0x0)+(_0x38c84c[_0xe4e2('0x1f')]||0x0);this[_0xe4e2('0x1b')]=_0x38c84c[_0xe4e2('0x1b')]||0x0;this[_0xe4e2('0x1c')]=_0x38c84c['countdropretry']||0x0;this[_0xe4e2('0x1d')]=_0x38c84c[_0xe4e2('0x1d')]||0x0;this[_0xe4e2('0x1e')]=_0x38c84c[_0xe4e2('0x1e')]||0x0;this[_0xe4e2('0x1f')]=_0x38c84c[_0xe4e2('0x1f')]||0x0;this[_0xe4e2('0x20')]=_0x38c84c['callback'];this[_0xe4e2('0x21')]=_0x38c84c[_0xe4e2('0x21')];this[_0xe4e2('0x22')]=_0x38c84c['callbackat'];this[_0xe4e2('0x23')]=_0x38c84c[_0xe4e2('0x23')];this['ContactId']=_0x38c84c[_0xe4e2('0x24')];this[_0xe4e2('0x25')]=_0x38c84c[_0xe4e2('0x25')];this[_0xe4e2('0x26')]=_[_0xe4e2('0x3')](_0x38c84c['Agent'])?_0x38c84c[_0xe4e2('0x26')]:_0x38c84c[_0xe4e2('0xb')]['id'];this[_0xe4e2('0x27')]=_0x38c84c['VoiceQueueId'];this[_0xe4e2('0x28')]='';this[_0xe4e2('0x29')]='';}Action[_0xe4e2('0x2a')]['getCaller']=function(){return util[_0xe4e2('0xd')]('\x22%s\x22\x20<%s>',this[_0xe4e2('0x10')],this[_0xe4e2('0x2b')]);};module['exports']=Action;