9f0e7225426b209786380727df4537749ff1c1e5
[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 _0x80fc=['countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','substring','dialCutDigit','getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','firstName','lastName','number','phone','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x80fc,0x197));var _0xc80f=function(_0x25e358,_0x183b2f){_0x25e358=_0x25e358-0x0;var _0x3c1c66=_0x80fc[_0x25e358];return _0x3c1c66;};'use strict';var util=require('util');var _=require(_0xc80f('0x0'));var moment=require(_0xc80f('0x1'));function checkNameSurname(_0x47434b,_0x2c8b06,_0x581cf9){var _0x134ad1='';if(!_[_0xc80f('0x2')](_0x2c8b06)&&_0xc80f('0x3')===typeof _0x2c8b06){_0x134ad1+=_0x2c8b06;}if(!_[_0xc80f('0x2')](_0x581cf9)&&'string'===typeof _0x581cf9){_0x134ad1+='\x20'+_0x581cf9;}if(_0x134ad1!==''){return _0x134ad1;}return _0x47434b;}function Action(_0xd8de61,_0x27aa2f,_0x2e2a42){this[_0xc80f('0x4')]=_0xd8de61;this[_0xc80f('0x5')]=_0x2e2a42||undefined;this['name']=checkNameSurname(_0x27aa2f[_0xc80f('0x6')]['phone'],_0x27aa2f['Contact'][_0xc80f('0x7')],_0x27aa2f['Contact'][_0xc80f('0x8')]);this[_0xc80f('0x9')]=_0x27aa2f[_0xc80f('0xa')];this[_0xc80f('0xb')]=_0xd8de61[_0xc80f('0xc')];this[_0xc80f('0xd')]=_0x27aa2f[_0xc80f('0xd')]||![];this[_0xc80f('0xe')]=_0xd8de61[_0xc80f('0xe')];this['dialQueueTimeout']=_0xd8de61[_0xc80f('0xf')]||0x3;this[_0xc80f('0x10')]=_0x27aa2f[_0xc80f('0x10')];this[_0xc80f('0x11')]=_0x27aa2f[_0xc80f('0x11')];this[_0xc80f('0x12')]=_0x27aa2f['countcongestionretry'];this[_0xc80f('0x13')]=_0x27aa2f[_0xc80f('0x13')];this[_0xc80f('0x14')]=_0x27aa2f[_0xc80f('0x14')];this[_0xc80f('0x15')]=_0x27aa2f[_0xc80f('0x15')];this['countabandonedretry']=_0x27aa2f[_0xc80f('0x16')];this[_0xc80f('0x17')]=_0x27aa2f[_0xc80f('0x17')];this['countagentrejectretry']=_0x27aa2f['countagentrejectretry'];this[_0xc80f('0x18')]=_0x27aa2f[_0xc80f('0x18')];this[_0xc80f('0x19')]=_0x27aa2f[_0xc80f('0x19')];this[_0xc80f('0x1a')]=_0x27aa2f['UserId'];this[_0xc80f('0x1b')]=_0x27aa2f[_0xc80f('0x1b')];this[_0xc80f('0x1c')]=_0x27aa2f[_0xc80f('0x1c')];this['idHopper']=_0x27aa2f['id'];this[_0xc80f('0x1d')]=_0x27aa2f[_0xc80f('0x6')][_0xc80f('0x7')]||'';this[_0xc80f('0x1e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xc80f('0x1f')]=_0x27aa2f[_0xc80f('0x1f')];this[_0xc80f('0x20')]=_0x27aa2f[_0xc80f('0x20')];this['callbackat']=_0x27aa2f[_0xc80f('0x21')];this[_0xc80f('0x22')]=_0x27aa2f[_0xc80f('0x22')];this[_0xc80f('0x23')]='';this[_0xc80f('0x24')]='';}Action[_0xc80f('0x25')][_0xc80f('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xc80f('0xc')],this[_0xc80f('0x4')]['dialCutDigit']>0x0?this['number'][_0xc80f('0x27')](this[_0xc80f('0x4')][_0xc80f('0x28')]):this[_0xc80f('0x9')]);};Action['prototype'][_0xc80f('0x29')]=function(){return this['queue'];};module[_0xc80f('0x2a')]=Action;