Built motion from commit (unavailable).|2.5.3
[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 _0x47c7=['idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','prototype','getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x2726ce,_0x57c360){var _0x8465db=function(_0x2e27af){while(--_0x2e27af){_0x2726ce['push'](_0x2726ce['shift']());}};_0x8465db(++_0x57c360);}(_0x47c7,0x1f3));var _0x747c=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0x47c7[_0x4fdcc0];return _0xc0ce94;};'use strict';var util=require('util');var _=require(_0x747c('0x0'));var moment=require(_0x747c('0x1'));function checkNameSurname(_0x3df892,_0x5d8956,_0x552a0f){var _0x2cf1a3='';if(!_[_0x747c('0x2')](_0x5d8956)&&_0x747c('0x3')===typeof _0x5d8956){_0x2cf1a3+=_0x5d8956;}if(!_[_0x747c('0x2')](_0x552a0f)&&'string'===typeof _0x552a0f){_0x2cf1a3+='\x20'+_0x552a0f;}if(_0x2cf1a3!==''){return _0x2cf1a3;}return _0x3df892;}function Action(_0x24cbab,_0x5c9a0b,_0xf4d0b2){this[_0x747c('0x4')]=_0x24cbab;this[_0x747c('0x5')]=_0xf4d0b2||undefined;this[_0x747c('0x6')]=checkNameSurname(_0x5c9a0b[_0x747c('0x7')][_0x747c('0x8')],_0x5c9a0b[_0x747c('0x7')][_0x747c('0x9')],_0x5c9a0b[_0x747c('0x7')][_0x747c('0xa')]);this[_0x747c('0xb')]=_0x5c9a0b[_0x747c('0x7')][_0x747c('0x8')];this[_0x747c('0xc')]=_0x24cbab['name'];this['active']=_0x5c9a0b[_0x747c('0xd')]||![];this[_0x747c('0xe')]=_0x24cbab[_0x747c('0xe')];this[_0x747c('0xf')]=_0x24cbab['dialQueueTimeout']||0x3;this['scheduledat']=_0x5c9a0b[_0x747c('0x10')];this[_0x747c('0x11')]=_0x5c9a0b[_0x747c('0x11')];this[_0x747c('0x12')]=_0x5c9a0b[_0x747c('0x12')];this[_0x747c('0x13')]=_0x5c9a0b[_0x747c('0x13')];this[_0x747c('0x14')]=_0x5c9a0b['countnosuchnumberretry'];this[_0x747c('0x15')]=_0x5c9a0b[_0x747c('0x15')];this[_0x747c('0x16')]=_0x5c9a0b[_0x747c('0x16')];this['countmachineretry']=_0x5c9a0b[_0x747c('0x17')];this[_0x747c('0x18')]=_0x5c9a0b['countagentrejectretry'];this['ContactId']=_0x5c9a0b['ContactId'];this[_0x747c('0x19')]=_0x5c9a0b['ListId'];this[_0x747c('0x1a')]=_0x5c9a0b[_0x747c('0x1a')];this[_0x747c('0x1b')]=_0x5c9a0b[_0x747c('0x1b')];this[_0x747c('0x1c')]=_0x5c9a0b['CampaignId'];this[_0x747c('0x1d')]=_0x5c9a0b['id'];this['ContactFirstName']=_0x5c9a0b[_0x747c('0x7')]['firstName']||'';this[_0x747c('0x1e')]=moment()[_0x747c('0x1f')](_0x747c('0x20'));this['callback']=_0x5c9a0b[_0x747c('0x21')];this[_0x747c('0x22')]=_0x5c9a0b['callbackuniqueid'];this[_0x747c('0x23')]=_0x5c9a0b[_0x747c('0x23')];this[_0x747c('0x24')]=_0x5c9a0b[_0x747c('0x24')];this[_0x747c('0x25')]='';this['originatecalleridname']='';}Action['prototype'][_0x747c('0x26')]=function(){return util['format'](_0x747c('0x27'),this['name'],this['voiceQueue'][_0x747c('0x28')]>0x0?this['number']['substring'](this[_0x747c('0x4')]['dialCutDigit']):this['number']);};Action[_0x747c('0x29')][_0x747c('0x2a')]=function(){return this[_0x747c('0xc')];};module[_0x747c('0x2b')]=Action;