Built motion from commit (unavailable).|2.5.4
[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 _0xe4b5=['VoiceQueueId','originatecalleridnum','\x22%s\x22\x20<%s>','exports','lodash','moment','isNil','string','queue','type','campaigntype','membername','Agent','name','channelAgent','format','SIP/%s','Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ListId'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xe4b5,0x13f));var _0x5e4b=function(_0x54871a,_0x11ccee){_0x54871a=_0x54871a-0x0;var _0x29d2bb=_0xe4b5[_0x54871a];return _0x29d2bb;};'use strict';var util=require('util');var _=require(_0x5e4b('0x0'));var moment=require(_0x5e4b('0x1'));function checkNameSurname(_0x450846,_0x1722be,_0x46b0d0){var _0x1d97f9='';if(!_[_0x5e4b('0x2')](_0x1722be)&&_0x5e4b('0x3')===typeof _0x1722be){_0x1d97f9+=_0x1722be;}if(!_[_0x5e4b('0x2')](_0x46b0d0)&&_0x5e4b('0x3')===typeof _0x46b0d0){_0x1d97f9+='\x20'+_0x46b0d0;}if(_0x1d97f9!==''){return _0x1d97f9;}return _0x450846;}function Action(_0x193957,_0x3f91d3,_0x3eb13c,_0x353079,_0x37b96b){this['uniqueid']=_0x3eb13c||undefined;this['idContact']=_0x193957['id'];this[_0x5e4b('0x4')]=_0x3f91d3['name'];this[_0x5e4b('0x5')]=_0x3f91d3[_0x5e4b('0x5')];this[_0x5e4b('0x6')]=_0x5e4b('0x4');this['dialAnswer']=![];this[_0x5e4b('0x7')]=_[_0x5e4b('0x2')](_0x193957[_0x5e4b('0x8')])?undefined:_0x193957['Agent'][_0x5e4b('0x9')];this[_0x5e4b('0xa')]=this['membername']?util[_0x5e4b('0xb')](_0x5e4b('0xc'),this[_0x5e4b('0x7')]):_0x353079||undefined;this['calleridname']=checkNameSurname(_0x193957['Contact']['phone'],_0x193957[_0x5e4b('0xd')][_0x5e4b('0xe')],_0x193957[_0x5e4b('0xd')][_0x5e4b('0xf')]);this[_0x5e4b('0x10')]=_0x193957[_0x5e4b('0x10')]||![];this['calleridnum']=_0x193957['Contact']['phone'];this[_0x5e4b('0x11')]=_0x193957[_0x5e4b('0x11')];this[_0x5e4b('0x12')]=_0x193957[_0x5e4b('0x12')]||0x0;this[_0x5e4b('0x13')]=_0x193957[_0x5e4b('0x13')]||0x0;this[_0x5e4b('0x14')]=_0x193957[_0x5e4b('0x14')]||0x0;this['countglobal']=(_0x193957['countbusyretry']||0x0)+(_0x193957[_0x5e4b('0x13')]||0x0)+(_0x193957[_0x5e4b('0x14')]||0x0)+(_0x193957[_0x5e4b('0x15')]||0x0)+(_0x193957['countdropretry']||0x0)+(_0x193957[_0x5e4b('0x16')]||0x0)+(_0x193957[_0x5e4b('0x17')]||0x0)+(_0x193957[_0x5e4b('0x18')]||0x0);this[_0x5e4b('0x15')]=_0x193957[_0x5e4b('0x15')]||0x0;this[_0x5e4b('0x19')]=_0x193957[_0x5e4b('0x19')]||0x0;this['countabandonedretry']=_0x193957[_0x5e4b('0x16')]||0x0;this[_0x5e4b('0x17')]=_0x193957[_0x5e4b('0x17')]||0x0;this[_0x5e4b('0x18')]=_0x193957[_0x5e4b('0x18')]||0x0;this[_0x5e4b('0x1a')]=_0x193957[_0x5e4b('0x1a')];this[_0x5e4b('0x1b')]=_0x193957['callbackuniqueid'];this['callbackat']=_0x193957[_0x5e4b('0x1c')];this[_0x5e4b('0x1d')]=_0x193957['recallme'];this['ContactId']=_0x193957['ContactId'];this[_0x5e4b('0x1e')]=_0x193957['ListId'];this['UserId']=_[_0x5e4b('0x2')](_0x193957[_0x5e4b('0x8')])?_0x193957['UserId']:_0x193957[_0x5e4b('0x8')]['id'];this[_0x5e4b('0x1f')]=_0x193957[_0x5e4b('0x1f')];this[_0x5e4b('0x20')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x5e4b('0xb')](_0x5e4b('0x21'),this['calleridname'],this['number']);};module[_0x5e4b('0x22')]=Action;