Built motion from commit 9d0783e6.|2.6.13
[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 _0x9531=['type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','dialCutDigit','number','queue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','active'];(function(_0x16228c,_0x14423b){var _0x5a326c=function(_0x432606){while(--_0x432606){_0x16228c['push'](_0x16228c['shift']());}};_0x5a326c(++_0x14423b);}(_0x9531,0x185));var _0x1953=function(_0x3e9ae2,_0x527270){_0x3e9ae2=_0x3e9ae2-0x0;var _0x49341f=_0x9531[_0x3e9ae2];return _0x49341f;};'use strict';var util=require('util');var _=require(_0x1953('0x0'));var moment=require(_0x1953('0x1'));function checkNameSurname(_0x332195,_0x19324f,_0x49cdcf){var _0x2a5fd2='';if(!_[_0x1953('0x2')](_0x19324f)&&_0x1953('0x3')===typeof _0x19324f){_0x2a5fd2+=_0x19324f;}if(!_[_0x1953('0x2')](_0x49cdcf)&&_0x1953('0x3')===typeof _0x49cdcf){_0x2a5fd2+='\x20'+_0x49cdcf;}if(_0x2a5fd2!==''){return _0x2a5fd2;}return _0x332195;}function Action(_0x3b4dd8,_0x4e73f7,_0x1839c6){this[_0x1953('0x4')]=_0x3b4dd8;this[_0x1953('0x5')]=_0x1839c6||undefined;this[_0x1953('0x6')]=checkNameSurname(_0x4e73f7[_0x1953('0x7')][_0x1953('0x8')],_0x4e73f7[_0x1953('0x7')]['firstName'],_0x4e73f7[_0x1953('0x7')][_0x1953('0x9')]);this['number']=_0x4e73f7[_0x1953('0x8')];this['queue']=_0x3b4dd8[_0x1953('0x6')];this[_0x1953('0xa')]=_0x4e73f7['active']||![];this['type']=_0x3b4dd8[_0x1953('0xb')];this[_0x1953('0xc')]=_0x3b4dd8['dialQueueTimeout']||0x3;this['scheduledat']=_0x4e73f7['scheduledat'];this[_0x1953('0xd')]=_0x4e73f7[_0x1953('0xd')];this['countcongestionretry']=_0x4e73f7[_0x1953('0xe')];this[_0x1953('0xf')]=_0x4e73f7[_0x1953('0xf')];this[_0x1953('0x10')]=_0x4e73f7[_0x1953('0x10')];this[_0x1953('0x11')]=_0x4e73f7[_0x1953('0x11')];this[_0x1953('0x12')]=_0x4e73f7[_0x1953('0x12')];this[_0x1953('0x13')]=_0x4e73f7[_0x1953('0x13')];this['countagentrejectretry']=_0x4e73f7['countagentrejectretry'];this[_0x1953('0x14')]=_0x4e73f7[_0x1953('0x14')];this[_0x1953('0x15')]=_0x4e73f7[_0x1953('0x15')];this[_0x1953('0x16')]=_0x4e73f7['UserId'];this[_0x1953('0x17')]=_0x4e73f7[_0x1953('0x17')];this['CampaignId']=_0x4e73f7['CampaignId'];this['idHopper']=_0x4e73f7['id'];this[_0x1953('0x18')]=_0x4e73f7[_0x1953('0x7')][_0x1953('0x19')]||'';this[_0x1953('0x1a')]=moment()[_0x1953('0x1b')](_0x1953('0x1c'));this[_0x1953('0x1d')]=_0x4e73f7[_0x1953('0x1d')];this['callbackuniqueid']=_0x4e73f7[_0x1953('0x1e')];this[_0x1953('0x1f')]=_0x4e73f7['callbackat'];this[_0x1953('0x20')]=_0x4e73f7[_0x1953('0x20')];this[_0x1953('0x21')]='';this[_0x1953('0x22')]='';}Action[_0x1953('0x23')]['getCaller']=function(){return util[_0x1953('0x1b')]('\x22%s\x22\x20<%s>',this[_0x1953('0x6')],this[_0x1953('0x4')][_0x1953('0x24')]>0x0?this[_0x1953('0x25')]['substring'](this[_0x1953('0x4')]['dialCutDigit']):this[_0x1953('0x25')]);};Action[_0x1953('0x23')]['getQueue']=function(){return this[_0x1953('0x26')];};module[_0x1953('0x27')]=Action;