Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / services / ami / dialer / models / 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 _0x73c5=['countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','substring','getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x498b7c,_0x580cb4){var _0x1601a4=function(_0x31ef92){while(--_0x31ef92){_0x498b7c['push'](_0x498b7c['shift']());}};_0x1601a4(++_0x580cb4);}(_0x73c5,0xe7));var _0x573c=function(_0xc775ea,_0x5e5895){_0xc775ea=_0xc775ea-0x0;var _0x5b5e4b=_0x73c5[_0xc775ea];return _0x5b5e4b;};'use strict';var util=require(_0x573c('0x0'));var _=require('lodash');var moment=require(_0x573c('0x1'));function checkNameSurname(_0x37c835,_0x4ca085,_0x39a13a){var _0x5567fe='';if(!_[_0x573c('0x2')](_0x4ca085)&&_0x573c('0x3')===typeof _0x4ca085){_0x5567fe+=_0x4ca085;}if(!_['isNil'](_0x39a13a)&&_0x573c('0x3')===typeof _0x39a13a){_0x5567fe+='\x20'+_0x39a13a;}if(_0x5567fe!==''){return _0x5567fe;}return _0x37c835;}function Action(_0x206ed8,_0x34c301,_0x58c029){this[_0x573c('0x4')]=_0x206ed8;this[_0x573c('0x5')]=_0x58c029||undefined;this[_0x573c('0x6')]=checkNameSurname(_0x34c301['Contact'][_0x573c('0x7')],_0x34c301[_0x573c('0x8')][_0x573c('0x9')],_0x34c301['Contact']['lastName']);this[_0x573c('0xa')]=_0x34c301[_0x573c('0x7')];this[_0x573c('0xb')]=_0x206ed8[_0x573c('0x6')];this[_0x573c('0xc')]=_0x34c301['active']||![];this[_0x573c('0xd')]=_0x206ed8[_0x573c('0xd')];this['dialQueueTimeout']=_0x206ed8[_0x573c('0xe')]||0x3;this['scheduledat']=_0x34c301[_0x573c('0xf')];this[_0x573c('0x10')]=_0x34c301['countbusyretry'];this['countcongestionretry']=_0x34c301['countcongestionretry'];this[_0x573c('0x11')]=_0x34c301['countnoanswerretry'];this[_0x573c('0x12')]=_0x34c301['countnosuchnumberretry'];this[_0x573c('0x13')]=_0x34c301[_0x573c('0x13')];this['countabandonedretry']=_0x34c301[_0x573c('0x14')];this[_0x573c('0x15')]=_0x34c301[_0x573c('0x15')];this['countagentrejectretry']=_0x34c301[_0x573c('0x16')];this['ContactId']=_0x34c301[_0x573c('0x17')];this['ListId']=_0x34c301[_0x573c('0x18')];this[_0x573c('0x19')]=_0x34c301[_0x573c('0x19')];this[_0x573c('0x1a')]=_0x34c301[_0x573c('0x1a')];this[_0x573c('0x1b')]=_0x34c301['CampaignId'];this['idHopper']=_0x34c301['id'];this['ContactFirstName']=_0x34c301[_0x573c('0x8')]['firstName']||'';this[_0x573c('0x1c')]=moment()[_0x573c('0x1d')](_0x573c('0x1e'));this[_0x573c('0x1f')]=_0x34c301['callback'];this['callbackuniqueid']=_0x34c301[_0x573c('0x20')];this[_0x573c('0x21')]=_0x34c301[_0x573c('0x21')];this['recallme']=_0x34c301[_0x573c('0x22')];this[_0x573c('0x23')]='';this['originatecalleridname']='';}Action[_0x573c('0x24')][_0x573c('0x25')]=function(){return util[_0x573c('0x1d')](_0x573c('0x26'),this[_0x573c('0x6')],this[_0x573c('0x4')]['dialCutDigit']>0x0?this[_0x573c('0xa')][_0x573c('0x27')](this[_0x573c('0x4')]['dialCutDigit']):this[_0x573c('0xa')]);};Action[_0x573c('0x24')][_0x573c('0x28')]=function(){return this[_0x573c('0xb')];};module[_0x573c('0x29')]=Action;