f61fafe569db9c5c587545acafccab4b40125aa9
[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 _0x53c2=['originatecalleridname','prototype','getCaller','format','dialCutDigit','queue','exports','util','lodash','moment','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum'];(function(_0x45c7c5,_0x43520e){var _0x596a3e=function(_0x3158c4){while(--_0x3158c4){_0x45c7c5['push'](_0x45c7c5['shift']());}};_0x596a3e(++_0x43520e);}(_0x53c2,0x15f));var _0x253c=function(_0x2ecc30,_0x1b0547){_0x2ecc30=_0x2ecc30-0x0;var _0x2ffa7e=_0x53c2[_0x2ecc30];return _0x2ffa7e;};'use strict';var util=require(_0x253c('0x0'));var _=require(_0x253c('0x1'));var moment=require(_0x253c('0x2'));function checkNameSurname(_0x11ff81,_0x1ae5bb,_0x2fcc7d){var _0x47a0e8='';if(!_['isNil'](_0x1ae5bb)&&'string'===typeof _0x1ae5bb){_0x47a0e8+=_0x1ae5bb;}if(!_['isNil'](_0x2fcc7d)&&_0x253c('0x3')===typeof _0x2fcc7d){_0x47a0e8+='\x20'+_0x2fcc7d;}if(_0x47a0e8!==''){return _0x47a0e8;}return _0x11ff81;}function Action(_0xee2d4,_0x411cf1,_0x49b368){this[_0x253c('0x4')]=_0xee2d4;this[_0x253c('0x5')]=_0x49b368||undefined;this[_0x253c('0x6')]=checkNameSurname(_0x411cf1[_0x253c('0x7')][_0x253c('0x8')],_0x411cf1[_0x253c('0x7')][_0x253c('0x9')],_0x411cf1[_0x253c('0x7')][_0x253c('0xa')]);this[_0x253c('0xb')]=_0x411cf1[_0x253c('0x8')];this['queue']=_0xee2d4[_0x253c('0x6')];this[_0x253c('0xc')]=_0x411cf1[_0x253c('0xc')]||![];this[_0x253c('0xd')]=_0xee2d4[_0x253c('0xd')];this[_0x253c('0xe')]=_0xee2d4[_0x253c('0xe')]||0x3;this[_0x253c('0xf')]=_0x411cf1[_0x253c('0xf')];this[_0x253c('0x10')]=_0x411cf1[_0x253c('0x10')];this[_0x253c('0x11')]=_0x411cf1['countcongestionretry'];this[_0x253c('0x12')]=_0x411cf1[_0x253c('0x12')];this[_0x253c('0x13')]=_0x411cf1[_0x253c('0x13')];this[_0x253c('0x14')]=_0x411cf1[_0x253c('0x14')];this[_0x253c('0x15')]=_0x411cf1['countabandonedretry'];this[_0x253c('0x16')]=_0x411cf1[_0x253c('0x16')];this[_0x253c('0x17')]=_0x411cf1[_0x253c('0x17')];this[_0x253c('0x18')]=_0x411cf1['ContactId'];this[_0x253c('0x19')]=_0x411cf1['ListId'];this[_0x253c('0x1a')]=_0x411cf1[_0x253c('0x1a')];this[_0x253c('0x1b')]=_0x411cf1[_0x253c('0x1b')];this[_0x253c('0x1c')]=_0x411cf1[_0x253c('0x1c')];this['idHopper']=_0x411cf1['id'];this['ContactFirstName']=_0x411cf1[_0x253c('0x7')][_0x253c('0x9')]||'';this[_0x253c('0x1d')]=moment()['format'](_0x253c('0x1e'));this[_0x253c('0x1f')]=_0x411cf1[_0x253c('0x1f')];this[_0x253c('0x20')]=_0x411cf1[_0x253c('0x20')];this[_0x253c('0x21')]=_0x411cf1['callbackat'];this[_0x253c('0x22')]=_0x411cf1[_0x253c('0x22')];this[_0x253c('0x23')]='';this[_0x253c('0x24')]='';}Action[_0x253c('0x25')][_0x253c('0x26')]=function(){return util[_0x253c('0x27')]('\x22%s\x22\x20<%s>',this[_0x253c('0x6')],this[_0x253c('0x4')][_0x253c('0x28')]>0x0?this[_0x253c('0xb')]['substring'](this[_0x253c('0x4')][_0x253c('0x28')]):this[_0x253c('0xb')]);};Action[_0x253c('0x25')]['getQueue']=function(){return this[_0x253c('0x29')];};module[_0x253c('0x2a')]=Action;