Built motion from commit 47436d59.|2.6.7
[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 _0x28aa=['lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','\x22%s\x22\x20<%s>','name','substring','dialCutDigit','getQueue','queue','exports','util'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x28aa,0x141));var _0xa28a=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x28aa[_0x1ae5ab];return _0x1ce001;};'use strict';var util=require(_0xa28a('0x0'));var _=require(_0xa28a('0x1'));var moment=require(_0xa28a('0x2'));function checkNameSurname(_0x336e29,_0x47b7c8,_0x47e3e3){var _0x3400a9='';if(!_[_0xa28a('0x3')](_0x47b7c8)&&_0xa28a('0x4')===typeof _0x47b7c8){_0x3400a9+=_0x47b7c8;}if(!_[_0xa28a('0x3')](_0x47e3e3)&&_0xa28a('0x4')===typeof _0x47e3e3){_0x3400a9+='\x20'+_0x47e3e3;}if(_0x3400a9!==''){return _0x3400a9;}return _0x336e29;}function Action(_0x5b3579,_0x325121,_0x244d81){this[_0xa28a('0x5')]=_0x5b3579;this[_0xa28a('0x6')]=_0x244d81||undefined;this['name']=checkNameSurname(_0x325121[_0xa28a('0x7')][_0xa28a('0x8')],_0x325121[_0xa28a('0x7')][_0xa28a('0x9')],_0x325121['Contact'][_0xa28a('0xa')]);this[_0xa28a('0xb')]=_0x325121[_0xa28a('0x8')];this['queue']=_0x5b3579['name'];this[_0xa28a('0xc')]=_0x325121[_0xa28a('0xc')]||![];this[_0xa28a('0xd')]=_0x5b3579[_0xa28a('0xd')];this[_0xa28a('0xe')]=_0x5b3579['dialQueueTimeout']||0x3;this['scheduledat']=_0x325121[_0xa28a('0xf')];this[_0xa28a('0x10')]=_0x325121[_0xa28a('0x10')];this[_0xa28a('0x11')]=_0x325121['countcongestionretry'];this[_0xa28a('0x12')]=_0x325121['countnoanswerretry'];this[_0xa28a('0x13')]=_0x325121[_0xa28a('0x13')];this['countdropretry']=_0x325121[_0xa28a('0x14')];this[_0xa28a('0x15')]=_0x325121[_0xa28a('0x15')];this[_0xa28a('0x16')]=_0x325121['countmachineretry'];this[_0xa28a('0x17')]=_0x325121['countagentrejectretry'];this[_0xa28a('0x18')]=_0x325121['ContactId'];this[_0xa28a('0x19')]=_0x325121[_0xa28a('0x19')];this[_0xa28a('0x1a')]=_0x325121[_0xa28a('0x1a')];this[_0xa28a('0x1b')]=_0x325121['VoiceQueueId'];this[_0xa28a('0x1c')]=_0x325121[_0xa28a('0x1c')];this[_0xa28a('0x1d')]=_0x325121['id'];this['ContactFirstName']=_0x325121[_0xa28a('0x7')]['firstName']||'';this[_0xa28a('0x1e')]=moment()[_0xa28a('0x1f')](_0xa28a('0x20'));this[_0xa28a('0x21')]=_0x325121[_0xa28a('0x21')];this['callbackuniqueid']=_0x325121[_0xa28a('0x22')];this[_0xa28a('0x23')]=_0x325121[_0xa28a('0x23')];this['recallme']=_0x325121[_0xa28a('0x24')];this['originatecalleridnum']='';this[_0xa28a('0x25')]='';}Action[_0xa28a('0x26')]['getCaller']=function(){return util[_0xa28a('0x1f')](_0xa28a('0x27'),this[_0xa28a('0x28')],this[_0xa28a('0x5')]['dialCutDigit']>0x0?this[_0xa28a('0xb')][_0xa28a('0x29')](this[_0xa28a('0x5')][_0xa28a('0x2a')]):this[_0xa28a('0xb')]);};Action[_0xa28a('0x26')][_0xa28a('0x2b')]=function(){return this[_0xa28a('0x2c')];};module[_0xa28a('0x2d')]=Action;