f4f4dfe1a6ffc0c5f6f33194ed1034e866117013
[motion2.git] / server / services / ami / dialer / 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 _0x7566=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime'];(function(_0x5cbc92,_0x56f7ff){var _0x3dcd54=function(_0x4032ce){while(--_0x4032ce){_0x5cbc92['push'](_0x5cbc92['shift']());}};_0x3dcd54(++_0x56f7ff);}(_0x7566,0x1bb));var _0x6756=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7566[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x6756('0x0'));var _=require(_0x6756('0x1'));var moment=require(_0x6756('0x2'));function checkNameSurname(_0xb235db,_0x515d22,_0x37526c){var _0x16b03b='';if(!_[_0x6756('0x3')](_0x515d22)&&_0x6756('0x4')===typeof _0x515d22){_0x16b03b+=_0x515d22;}if(!_[_0x6756('0x3')](_0x37526c)&&_0x6756('0x4')===typeof _0x37526c){_0x16b03b+='\x20'+_0x37526c;}if(_0x16b03b!==''){return _0x16b03b;}return _0xb235db;}function Action(_0x4ba8d2,_0x454d6d,_0x259f96){this[_0x6756('0x5')]=_0x4ba8d2;this[_0x6756('0x6')]=_0x259f96||undefined;this[_0x6756('0x7')]=checkNameSurname(_0x454d6d['Contact'][_0x6756('0x8')],_0x454d6d[_0x6756('0x9')][_0x6756('0xa')],_0x454d6d[_0x6756('0x9')][_0x6756('0xb')]);this[_0x6756('0xc')]=_0x454d6d[_0x6756('0x8')];this[_0x6756('0xd')]=_0x4ba8d2[_0x6756('0x7')];this['active']=_0x454d6d['active']||![];this['type']=_0x4ba8d2['type'];this['dialQueueTimeout']=_0x4ba8d2[_0x6756('0xe')]||0x3;this['scheduledat']=_0x454d6d[_0x6756('0xf')];this[_0x6756('0x10')]=_0x454d6d['countbusyretry'];this[_0x6756('0x11')]=_0x454d6d[_0x6756('0x11')];this[_0x6756('0x12')]=_0x454d6d[_0x6756('0x12')];this[_0x6756('0x13')]=_0x454d6d[_0x6756('0x13')];this['countdropretry']=_0x454d6d[_0x6756('0x14')];this[_0x6756('0x15')]=_0x454d6d[_0x6756('0x15')];this[_0x6756('0x16')]=_0x454d6d[_0x6756('0x16')];this[_0x6756('0x17')]=_0x454d6d[_0x6756('0x17')];this['ContactId']=_0x454d6d['ContactId'];this['ListId']=_0x454d6d[_0x6756('0x18')];this[_0x6756('0x19')]=_0x454d6d[_0x6756('0x19')];this['VoiceQueueId']=_0x454d6d[_0x6756('0x1a')];this[_0x6756('0x1b')]=_0x454d6d[_0x6756('0x1b')];this['idHopper']=_0x454d6d['id'];this[_0x6756('0x1c')]=_0x454d6d[_0x6756('0x9')][_0x6756('0xa')]||'';this[_0x6756('0x1d')]=moment()['format'](_0x6756('0x1e'));this['callback']=_0x454d6d[_0x6756('0x1f')];this[_0x6756('0x20')]=_0x454d6d[_0x6756('0x20')];this[_0x6756('0x21')]=_0x454d6d['callbackat'];this[_0x6756('0x22')]=_0x454d6d[_0x6756('0x22')];this[_0x6756('0x23')]='';this[_0x6756('0x24')]='';}Action[_0x6756('0x25')][_0x6756('0x26')]=function(){return util[_0x6756('0x27')](_0x6756('0x28'),this[_0x6756('0x7')],this[_0x6756('0x5')]['dialCutDigit']>0x0?this[_0x6756('0xc')]['substring'](this[_0x6756('0x5')][_0x6756('0x29')]):this[_0x6756('0xc')]);};Action['prototype'][_0x6756('0x2a')]=function(){return this['queue'];};module['exports']=Action;