466612c1948475d3088a5ec4cb8cbbb17b26e88b
[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 _0xb44a=['recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','calleridname','number','exports','moment','isNil','string','uniqueid','idContact','queue','name','type','membername','Agent','channelAgent','format','SIP/%s','Contact','lastName','active','calleridnum','phone','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat'];(function(_0x71b765,_0x3053f8){var _0x34cb24=function(_0x2dd237){while(--_0x2dd237){_0x71b765['push'](_0x71b765['shift']());}};_0x34cb24(++_0x3053f8);}(_0xb44a,0x1c2));var _0xab44=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0xb44a[_0x1dfa63];return _0x26f2a9;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xab44('0x0'));function checkNameSurname(_0x492c1a,_0x186fec,_0x5c825d){var _0x50cb3c='';if(!_[_0xab44('0x1')](_0x186fec)&&'string'===typeof _0x186fec){_0x50cb3c+=_0x186fec;}if(!_[_0xab44('0x1')](_0x5c825d)&&_0xab44('0x2')===typeof _0x5c825d){_0x50cb3c+='\x20'+_0x5c825d;}if(_0x50cb3c!==''){return _0x50cb3c;}return _0x492c1a;}function Action(_0x2e3662,_0x28681a,_0x2f3948,_0x3303b1,_0x3ead8d){this[_0xab44('0x3')]=_0x2f3948||undefined;this[_0xab44('0x4')]=_0x2e3662['id'];this[_0xab44('0x5')]=_0x28681a[_0xab44('0x6')];this[_0xab44('0x7')]=_0x28681a[_0xab44('0x7')];this['campaigntype']=_0xab44('0x5');this['dialAnswer']=![];this[_0xab44('0x8')]=_['isNil'](_0x2e3662['Agent'])?undefined:_0x2e3662[_0xab44('0x9')][_0xab44('0x6')];this[_0xab44('0xa')]=this[_0xab44('0x8')]?util[_0xab44('0xb')](_0xab44('0xc'),this['membername']):_0x3303b1||undefined;this['calleridname']=checkNameSurname(_0x2e3662[_0xab44('0xd')]['phone'],_0x2e3662[_0xab44('0xd')]['firstName'],_0x2e3662[_0xab44('0xd')][_0xab44('0xe')]);this[_0xab44('0xf')]=_0x2e3662[_0xab44('0xf')]||![];this[_0xab44('0x10')]=_0x2e3662[_0xab44('0x11')];this['scheduledat']=_0x2e3662['scheduledat'];this[_0xab44('0x12')]=_0x2e3662[_0xab44('0x12')]||0x0;this[_0xab44('0x13')]=_0x2e3662[_0xab44('0x13')]||0x0;this[_0xab44('0x14')]=_0x2e3662[_0xab44('0x14')]||0x0;this[_0xab44('0x15')]=(_0x2e3662[_0xab44('0x12')]||0x0)+(_0x2e3662[_0xab44('0x13')]||0x0)+(_0x2e3662[_0xab44('0x14')]||0x0)+(_0x2e3662[_0xab44('0x16')]||0x0)+(_0x2e3662['countdropretry']||0x0)+(_0x2e3662[_0xab44('0x17')]||0x0)+(_0x2e3662[_0xab44('0x18')]||0x0)+(_0x2e3662[_0xab44('0x19')]||0x0);this[_0xab44('0x16')]=_0x2e3662[_0xab44('0x16')]||0x0;this['countdropretry']=_0x2e3662[_0xab44('0x1a')]||0x0;this['countabandonedretry']=_0x2e3662[_0xab44('0x17')]||0x0;this[_0xab44('0x18')]=_0x2e3662[_0xab44('0x18')]||0x0;this[_0xab44('0x19')]=_0x2e3662['countagentrejectretry']||0x0;this[_0xab44('0x1b')]=_0x2e3662[_0xab44('0x1b')];this[_0xab44('0x1c')]=_0x2e3662[_0xab44('0x1c')];this[_0xab44('0x1d')]=_0x2e3662[_0xab44('0x1d')];this[_0xab44('0x1e')]=_0x2e3662['recallme'];this['ContactId']=_0x2e3662[_0xab44('0x1f')];this['ListId']=_0x2e3662[_0xab44('0x20')];this['UserId']=_[_0xab44('0x1')](_0x2e3662['Agent'])?_0x2e3662['UserId']:_0x2e3662[_0xab44('0x9')]['id'];this[_0xab44('0x21')]=_0x2e3662[_0xab44('0x21')];this[_0xab44('0x22')]='';this[_0xab44('0x23')]='';}Action['prototype'][_0xab44('0x24')]=function(){return util[_0xab44('0xb')]('\x22%s\x22\x20<%s>',this[_0xab44('0x25')],this[_0xab44('0x26')]);};module[_0xab44('0x27')]=Action;