b9e5cf172a97191ea98be643e6837bc1b3a0e6e9
[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 _0x7e1a=['name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','number','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid'];(function(_0x31e79e,_0x5b45a9){var _0x1a3b24=function(_0x289a59){while(--_0x289a59){_0x31e79e['push'](_0x31e79e['shift']());}};_0x1a3b24(++_0x5b45a9);}(_0x7e1a,0x1c5));var _0xa7e1=function(_0x32c3d0,_0x2ca631){_0x32c3d0=_0x32c3d0-0x0;var _0x5c9b86=_0x7e1a[_0x32c3d0];return _0x5c9b86;};'use strict';var util=require(_0xa7e1('0x0'));var _=require(_0xa7e1('0x1'));var moment=require(_0xa7e1('0x2'));function checkNameSurname(_0xc277f7,_0x44e5bb,_0x2fdf4f){var _0x1f56a4='';if(!_[_0xa7e1('0x3')](_0x44e5bb)&&'string'===typeof _0x44e5bb){_0x1f56a4+=_0x44e5bb;}if(!_[_0xa7e1('0x3')](_0x2fdf4f)&&_0xa7e1('0x4')===typeof _0x2fdf4f){_0x1f56a4+='\x20'+_0x2fdf4f;}if(_0x1f56a4!==''){return _0x1f56a4;}return _0xc277f7;}function Action(_0x2cc9c3,_0x170590,_0x5f20e5){this[_0xa7e1('0x5')]=_0x2cc9c3;this[_0xa7e1('0x6')]=_0x5f20e5||undefined;this[_0xa7e1('0x7')]=checkNameSurname(_0x170590[_0xa7e1('0x8')][_0xa7e1('0x9')],_0x170590[_0xa7e1('0x8')][_0xa7e1('0xa')],_0x170590['Contact'][_0xa7e1('0xb')]);this['number']=_0x170590['Contact'][_0xa7e1('0x9')];this[_0xa7e1('0xc')]=_0x2cc9c3[_0xa7e1('0x7')];this[_0xa7e1('0xd')]=_0x170590['active']||![];this[_0xa7e1('0xe')]=_0x2cc9c3[_0xa7e1('0xe')];this[_0xa7e1('0xf')]=_0x2cc9c3[_0xa7e1('0xf')]||0x3;this[_0xa7e1('0x10')]=_0x170590['scheduledat'];this['countbusyretry']=_0x170590[_0xa7e1('0x11')];this[_0xa7e1('0x12')]=_0x170590[_0xa7e1('0x12')];this[_0xa7e1('0x13')]=_0x170590[_0xa7e1('0x13')];this[_0xa7e1('0x14')]=_0x170590[_0xa7e1('0x14')];this[_0xa7e1('0x15')]=_0x170590[_0xa7e1('0x15')];this['countabandonedretry']=_0x170590[_0xa7e1('0x16')];this[_0xa7e1('0x17')]=_0x170590[_0xa7e1('0x17')];this[_0xa7e1('0x18')]=_0x170590[_0xa7e1('0x18')];this[_0xa7e1('0x19')]=_0x170590[_0xa7e1('0x19')];this[_0xa7e1('0x1a')]=_0x170590[_0xa7e1('0x1a')];this[_0xa7e1('0x1b')]=_0x170590['UserId'];this[_0xa7e1('0x1c')]=_0x170590['VoiceQueueId'];this[_0xa7e1('0x1d')]=_0x170590[_0xa7e1('0x1d')];this[_0xa7e1('0x1e')]=_0x170590['id'];this[_0xa7e1('0x1f')]=_0x170590[_0xa7e1('0x8')][_0xa7e1('0xa')]||'';this[_0xa7e1('0x20')]=moment()[_0xa7e1('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x170590[_0xa7e1('0x22')];this[_0xa7e1('0x23')]=_0x170590['callbackuniqueid'];this[_0xa7e1('0x24')]=_0x170590[_0xa7e1('0x24')];this['recallme']=_0x170590[_0xa7e1('0x25')];this[_0xa7e1('0x26')]='';this[_0xa7e1('0x27')]='';}Action[_0xa7e1('0x28')][_0xa7e1('0x29')]=function(){return util[_0xa7e1('0x21')]('\x22%s\x22\x20<%s>',this[_0xa7e1('0x7')],this[_0xa7e1('0x5')][_0xa7e1('0x2a')]>0x0?this[_0xa7e1('0x2b')][_0xa7e1('0x2c')](this[_0xa7e1('0x5')][_0xa7e1('0x2a')]):this[_0xa7e1('0x2b')]);};Action[_0xa7e1('0x28')][_0xa7e1('0x2d')]=function(){return this[_0xa7e1('0xc')];};module['exports']=Action;