385c0cd2c319542fb1c54d0671856f1489dac8dc
[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 _0x52c1=['callback','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','lodash','moment','isNil','voiceQueue','name','Contact','phone','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1c8255,_0x1ee6b){var _0x13d0e1=function(_0x323623){while(--_0x323623){_0x1c8255['push'](_0x1c8255['shift']());}};_0x13d0e1(++_0x1ee6b);}(_0x52c1,0x1ce));var _0x152c=function(_0x3a2bd4,_0xe533d8){_0x3a2bd4=_0x3a2bd4-0x0;var _0x28f4a8=_0x52c1[_0x3a2bd4];return _0x28f4a8;};'use strict';var util=require(_0x152c('0x0'));var _=require(_0x152c('0x1'));var moment=require(_0x152c('0x2'));function checkNameSurname(_0x11ca60,_0x46fa33,_0x22092b){var _0x521699='';if(!_[_0x152c('0x3')](_0x46fa33)&&'string'===typeof _0x46fa33){_0x521699+=_0x46fa33;}if(!_[_0x152c('0x3')](_0x22092b)&&'string'===typeof _0x22092b){_0x521699+='\x20'+_0x22092b;}if(_0x521699!==''){return _0x521699;}return _0x11ca60;}function Action(_0x17c5f5,_0x56b4d0,_0x58fb2e){this[_0x152c('0x4')]=_0x17c5f5;this['uniqueid']=_0x58fb2e||undefined;this[_0x152c('0x5')]=checkNameSurname(_0x56b4d0[_0x152c('0x6')][_0x152c('0x7')],_0x56b4d0[_0x152c('0x6')]['firstName'],_0x56b4d0[_0x152c('0x6')][_0x152c('0x8')]);this['number']=_0x56b4d0[_0x152c('0x6')][_0x152c('0x7')];this[_0x152c('0x9')]=_0x17c5f5[_0x152c('0x5')];this[_0x152c('0xa')]=_0x56b4d0[_0x152c('0xa')]||![];this[_0x152c('0xb')]=_0x17c5f5[_0x152c('0xb')];this[_0x152c('0xc')]=_0x17c5f5[_0x152c('0xc')]||0x3;this[_0x152c('0xd')]=_0x56b4d0['scheduledat'];this[_0x152c('0xe')]=_0x56b4d0[_0x152c('0xe')];this[_0x152c('0xf')]=_0x56b4d0[_0x152c('0xf')];this[_0x152c('0x10')]=_0x56b4d0[_0x152c('0x10')];this[_0x152c('0x11')]=_0x56b4d0[_0x152c('0x11')];this['countdropretry']=_0x56b4d0[_0x152c('0x12')];this[_0x152c('0x13')]=_0x56b4d0[_0x152c('0x13')];this[_0x152c('0x14')]=_0x56b4d0['countmachineretry'];this[_0x152c('0x15')]=_0x56b4d0[_0x152c('0x15')];this[_0x152c('0x16')]=_0x56b4d0[_0x152c('0x16')];this[_0x152c('0x17')]=_0x56b4d0['ListId'];this[_0x152c('0x18')]=_0x56b4d0[_0x152c('0x18')];this[_0x152c('0x19')]=_0x56b4d0[_0x152c('0x19')];this[_0x152c('0x1a')]=_0x56b4d0[_0x152c('0x1a')];this[_0x152c('0x1b')]=_0x56b4d0['id'];this[_0x152c('0x1c')]=_0x56b4d0[_0x152c('0x6')][_0x152c('0x1d')]||'';this[_0x152c('0x1e')]=moment()[_0x152c('0x1f')](_0x152c('0x20'));this['callback']=_0x56b4d0[_0x152c('0x21')];this['callbackuniqueid']=_0x56b4d0['callbackuniqueid'];this['callbackat']=_0x56b4d0['callbackat'];this[_0x152c('0x22')]=_0x56b4d0[_0x152c('0x22')];this[_0x152c('0x23')]='';this[_0x152c('0x24')]='';}Action[_0x152c('0x25')][_0x152c('0x26')]=function(){return util[_0x152c('0x1f')](_0x152c('0x27'),this['name'],this['voiceQueue'][_0x152c('0x28')]>0x0?this[_0x152c('0x29')][_0x152c('0x2a')](this[_0x152c('0x4')][_0x152c('0x28')]):this[_0x152c('0x29')]);};Action[_0x152c('0x25')][_0x152c('0x2b')]=function(){return this['queue'];};module[_0x152c('0x2c')]=Action;