c3bf47e0aa5a9a8dbf55d3b6c199d293898e3858
[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 _0x930a=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','exports','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0xf83277,_0x55487e){var _0x361e0e=function(_0xa2b602){while(--_0xa2b602){_0xf83277['push'](_0xf83277['shift']());}};_0x361e0e(++_0x55487e);}(_0x930a,0x1c0));var _0xa930=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x930a[_0x599f41];return _0x2e4d58;};'use strict';var util=require('util');var _=require(_0xa930('0x0'));var moment=require(_0xa930('0x1'));function checkNameSurname(_0x32250d,_0x1c251f,_0xbb3c9b){var _0x4efc59='';if(!_[_0xa930('0x2')](_0x1c251f)&&_0xa930('0x3')===typeof _0x1c251f){_0x4efc59+=_0x1c251f;}if(!_[_0xa930('0x2')](_0xbb3c9b)&&_0xa930('0x3')===typeof _0xbb3c9b){_0x4efc59+='\x20'+_0xbb3c9b;}if(_0x4efc59!==''){return _0x4efc59;}return _0x32250d;}function Action(_0x17605c,_0x1ad783,_0x422cf5,_0xb31099,_0x3dd042){this[_0xa930('0x4')]=_0x422cf5||undefined;this[_0xa930('0x5')]=_0x17605c['id'];this[_0xa930('0x6')]=_0x1ad783[_0xa930('0x7')];this[_0xa930('0x8')]=_0x1ad783[_0xa930('0x8')];this[_0xa930('0x9')]=_0xa930('0x6');this[_0xa930('0xa')]=![];this[_0xa930('0xb')]=_[_0xa930('0x2')](_0x17605c[_0xa930('0xc')])?undefined:_0x17605c[_0xa930('0xc')]['name'];this[_0xa930('0xd')]=this['membername']?util['format'](_0xa930('0xe'),this['membername']):_0xb31099||undefined;this[_0xa930('0xf')]=checkNameSurname(_0x17605c['Contact']['phone'],_0x17605c[_0xa930('0x10')]['firstName'],_0x17605c['Contact']['lastName']);this[_0xa930('0x11')]=_0x17605c[_0xa930('0x11')]||![];this[_0xa930('0x12')]=_0x17605c['Contact'][_0xa930('0x13')];this[_0xa930('0x14')]=_0x17605c['scheduledat'];this[_0xa930('0x15')]=_0x17605c['countbusyretry']||0x0;this[_0xa930('0x16')]=_0x17605c[_0xa930('0x16')]||0x0;this[_0xa930('0x17')]=_0x17605c[_0xa930('0x17')]||0x0;this['countglobal']=(_0x17605c[_0xa930('0x15')]||0x0)+(_0x17605c[_0xa930('0x16')]||0x0)+(_0x17605c['countnoanswerretry']||0x0);this[_0xa930('0x18')]=_0x17605c[_0xa930('0x18')]||0x0;this[_0xa930('0x19')]=_0x17605c[_0xa930('0x19')]||0x0;this[_0xa930('0x1a')]=_0x17605c[_0xa930('0x1a')]||0x0;this['countmachineretry']=_0x17605c[_0xa930('0x1b')]||0x0;this['countagentrejectretry']=_0x17605c[_0xa930('0x1c')]||0x0;this[_0xa930('0x1d')]=_0x17605c[_0xa930('0x1d')];this[_0xa930('0x1e')]=_0x17605c['callbackuniqueid'];this[_0xa930('0x1f')]=_0x17605c[_0xa930('0x1f')];this['recallme']=_0x17605c[_0xa930('0x20')];this[_0xa930('0x21')]=_0x17605c[_0xa930('0x21')];this['ListId']=_0x17605c[_0xa930('0x22')];this['UserId']=_[_0xa930('0x2')](_0x17605c['Agent'])?_0x17605c[_0xa930('0x23')]:_0x17605c[_0xa930('0xc')]['id'];this[_0xa930('0x24')]=_0x17605c[_0xa930('0x24')];this[_0xa930('0x25')]='';this[_0xa930('0x26')]='';}Action['prototype'][_0xa930('0x27')]=function(){return util[_0xa930('0x28')](_0xa930('0x29'),this['calleridname'],this['number']);};module[_0xa930('0x2a')]=Action;