54f89494d059603039d764814d6f00b3a2456a0c
[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 _0x9f67=['util','lodash','moment','string','isNil','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','number'];(function(_0x43bb06,_0x2f904d){var _0xd1c829=function(_0x1fec8a){while(--_0x1fec8a){_0x43bb06['push'](_0x43bb06['shift']());}};_0xd1c829(++_0x2f904d);}(_0x9f67,0x19a));var _0x79f6=function(_0x550be7,_0x58d911){_0x550be7=_0x550be7-0x0;var _0x1d0b08=_0x9f67[_0x550be7];return _0x1d0b08;};'use strict';var util=require(_0x79f6('0x0'));var _=require(_0x79f6('0x1'));var moment=require(_0x79f6('0x2'));function checkNameSurname(_0x39992f,_0x5d2638,_0x5a07ba){var _0x4f4cd6='';if(!_['isNil'](_0x5d2638)&&_0x79f6('0x3')===typeof _0x5d2638){_0x4f4cd6+=_0x5d2638;}if(!_[_0x79f6('0x4')](_0x5a07ba)&&_0x79f6('0x3')===typeof _0x5a07ba){_0x4f4cd6+='\x20'+_0x5a07ba;}if(_0x4f4cd6!==''){return _0x4f4cd6;}return _0x39992f;}function Action(_0x3eaafe,_0x502cc7,_0x534cba,_0x2eb854,_0x66d93){this['uniqueid']=_0x534cba||undefined;this[_0x79f6('0x5')]=_0x3eaafe['id'];this['queue']=_0x502cc7[_0x79f6('0x6')];this[_0x79f6('0x7')]=_0x502cc7[_0x79f6('0x7')];this[_0x79f6('0x8')]=_0x79f6('0x9');this[_0x79f6('0xa')]=![];this[_0x79f6('0xb')]=_[_0x79f6('0x4')](_0x3eaafe[_0x79f6('0xc')])?undefined:_0x3eaafe[_0x79f6('0xc')]['name'];this[_0x79f6('0xd')]=this[_0x79f6('0xb')]?util[_0x79f6('0xe')]('SIP/%s',this['membername']):_0x2eb854||undefined;this[_0x79f6('0xf')]=checkNameSurname(_0x3eaafe[_0x79f6('0x10')][_0x79f6('0x11')],_0x3eaafe[_0x79f6('0x10')]['firstName'],_0x3eaafe[_0x79f6('0x10')][_0x79f6('0x12')]);this[_0x79f6('0x13')]=_0x3eaafe[_0x79f6('0x13')]||![];this[_0x79f6('0x14')]=_0x3eaafe['Contact'][_0x79f6('0x11')];this['scheduledat']=_0x3eaafe['scheduledat'];this[_0x79f6('0x15')]=_0x3eaafe[_0x79f6('0x15')]||0x0;this[_0x79f6('0x16')]=_0x3eaafe[_0x79f6('0x16')]||0x0;this['countnoanswerretry']=_0x3eaafe[_0x79f6('0x17')]||0x0;this[_0x79f6('0x18')]=(_0x3eaafe['countbusyretry']||0x0)+(_0x3eaafe[_0x79f6('0x16')]||0x0)+(_0x3eaafe[_0x79f6('0x17')]||0x0)+(_0x3eaafe[_0x79f6('0x19')]||0x0)+(_0x3eaafe[_0x79f6('0x1a')]||0x0)+(_0x3eaafe[_0x79f6('0x1b')]||0x0)+(_0x3eaafe[_0x79f6('0x1c')]||0x0)+(_0x3eaafe[_0x79f6('0x1d')]||0x0);this['countnosuchnumberretry']=_0x3eaafe[_0x79f6('0x19')]||0x0;this[_0x79f6('0x1a')]=_0x3eaafe[_0x79f6('0x1a')]||0x0;this['countabandonedretry']=_0x3eaafe[_0x79f6('0x1b')]||0x0;this['countmachineretry']=_0x3eaafe[_0x79f6('0x1c')]||0x0;this['countagentrejectretry']=_0x3eaafe[_0x79f6('0x1d')]||0x0;this[_0x79f6('0x1e')]=_0x3eaafe[_0x79f6('0x1e')];this[_0x79f6('0x1f')]=_0x3eaafe[_0x79f6('0x1f')];this[_0x79f6('0x20')]=_0x3eaafe[_0x79f6('0x20')];this[_0x79f6('0x21')]=_0x3eaafe['recallme'];this[_0x79f6('0x22')]=_0x3eaafe[_0x79f6('0x22')];this[_0x79f6('0x23')]=_0x3eaafe[_0x79f6('0x23')];this[_0x79f6('0x24')]=_['isNil'](_0x3eaafe[_0x79f6('0xc')])?_0x3eaafe[_0x79f6('0x24')]:_0x3eaafe[_0x79f6('0xc')]['id'];this[_0x79f6('0x25')]=_0x3eaafe['VoiceQueueId'];this[_0x79f6('0x26')]='';this[_0x79f6('0x27')]='';}Action['prototype']['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x79f6('0x28')]);};module['exports']=Action;