9803eb094af354433541683e667b38a6072520eb
[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 _0x057f=['callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x057f,0x1d7));var _0xf057=function(_0x2bd6a9,_0x4df0ff){_0x2bd6a9=_0x2bd6a9-0x0;var _0x2d7c73=_0x057f[_0x2bd6a9];return _0x2d7c73;};'use strict';var util=require(_0xf057('0x0'));var _=require('lodash');var moment=require(_0xf057('0x1'));function checkNameSurname(_0x12e6e0,_0x39647e,_0x55a972){var _0x9d106f='';if(!_[_0xf057('0x2')](_0x39647e)&&_0xf057('0x3')===typeof _0x39647e){_0x9d106f+=_0x39647e;}if(!_[_0xf057('0x2')](_0x55a972)&&_0xf057('0x3')===typeof _0x55a972){_0x9d106f+='\x20'+_0x55a972;}if(_0x9d106f!==''){return _0x9d106f;}return _0x12e6e0;}function Action(_0x3f1bde,_0x42f720,_0x1b099b){this[_0xf057('0x4')]=_0x3f1bde;this[_0xf057('0x5')]=_0x1b099b||undefined;this[_0xf057('0x6')]=checkNameSurname(_0x42f720[_0xf057('0x7')]['phone'],_0x42f720['Contact'][_0xf057('0x8')],_0x42f720[_0xf057('0x7')]['lastName']);this[_0xf057('0x9')]=_0x42f720['Contact'][_0xf057('0xa')];this[_0xf057('0xb')]=_0x3f1bde[_0xf057('0x6')];this[_0xf057('0xc')]=_0x42f720['active']||![];this[_0xf057('0xd')]=_0x3f1bde[_0xf057('0xd')];this[_0xf057('0xe')]=_0x3f1bde[_0xf057('0xe')]||0x3;this['scheduledat']=_0x42f720[_0xf057('0xf')];this['countbusyretry']=_0x42f720[_0xf057('0x10')];this['countcongestionretry']=_0x42f720[_0xf057('0x11')];this[_0xf057('0x12')]=_0x42f720[_0xf057('0x12')];this[_0xf057('0x13')]=_0x42f720[_0xf057('0x13')];this[_0xf057('0x14')]=_0x42f720[_0xf057('0x14')];this[_0xf057('0x15')]=_0x42f720['countabandonedretry'];this[_0xf057('0x16')]=_0x42f720['countmachineretry'];this[_0xf057('0x17')]=_0x42f720[_0xf057('0x17')];this['ContactId']=_0x42f720[_0xf057('0x18')];this[_0xf057('0x19')]=_0x42f720[_0xf057('0x19')];this[_0xf057('0x1a')]=_0x42f720[_0xf057('0x1a')];this[_0xf057('0x1b')]=_0x42f720['VoiceQueueId'];this[_0xf057('0x1c')]=_0x42f720['CampaignId'];this[_0xf057('0x1d')]=_0x42f720['id'];this[_0xf057('0x1e')]=_0x42f720[_0xf057('0x7')]['firstName']||'';this[_0xf057('0x1f')]=moment()[_0xf057('0x20')](_0xf057('0x21'));this[_0xf057('0x22')]=_0x42f720[_0xf057('0x22')];this['callbackuniqueid']=_0x42f720[_0xf057('0x23')];this[_0xf057('0x24')]=_0x42f720[_0xf057('0x24')];this[_0xf057('0x25')]=_0x42f720[_0xf057('0x25')];this[_0xf057('0x26')]='';this[_0xf057('0x27')]='';}Action[_0xf057('0x28')][_0xf057('0x29')]=function(){return util[_0xf057('0x20')](_0xf057('0x2a'),this[_0xf057('0x6')],this[_0xf057('0x4')][_0xf057('0x2b')]>0x0?this[_0xf057('0x9')][_0xf057('0x2c')](this[_0xf057('0x4')][_0xf057('0x2b')]):this[_0xf057('0x9')]);};Action['prototype'][_0xf057('0x2d')]=function(){return this[_0xf057('0xb')];};module['exports']=Action;