0b899f3657496d45825a1d6519eae54a0181c2c8
[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 _0xe890=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','queue','active','type','dialQueueTimeout'];(function(_0x5f502a,_0x2dc524){var _0x418bb3=function(_0x5f393d){while(--_0x5f393d){_0x5f502a['push'](_0x5f502a['shift']());}};_0x418bb3(++_0x2dc524);}(_0xe890,0xbe));var _0x0e89=function(_0x48df6e,_0x2c8ba3){_0x48df6e=_0x48df6e-0x0;var _0x43f43a=_0xe890[_0x48df6e];return _0x43f43a;};'use strict';var util=require(_0x0e89('0x0'));var _=require('lodash');var moment=require(_0x0e89('0x1'));function checkNameSurname(_0x54fd5e,_0x50abf9,_0x51cc4a){var _0x2a3392='';if(!_[_0x0e89('0x2')](_0x50abf9)&&'string'===typeof _0x50abf9){_0x2a3392+=_0x50abf9;}if(!_[_0x0e89('0x2')](_0x51cc4a)&&_0x0e89('0x3')===typeof _0x51cc4a){_0x2a3392+='\x20'+_0x51cc4a;}if(_0x2a3392!==''){return _0x2a3392;}return _0x54fd5e;}function Action(_0x3e3c17,_0xdd33c7,_0x19ba6e){this[_0x0e89('0x4')]=_0x3e3c17;this[_0x0e89('0x5')]=_0x19ba6e||undefined;this[_0x0e89('0x6')]=checkNameSurname(_0xdd33c7[_0x0e89('0x7')][_0x0e89('0x8')],_0xdd33c7[_0x0e89('0x7')][_0x0e89('0x9')],_0xdd33c7[_0x0e89('0x7')]['lastName']);this[_0x0e89('0xa')]=_0xdd33c7[_0x0e89('0x7')][_0x0e89('0x8')];this[_0x0e89('0xb')]=_0x3e3c17[_0x0e89('0x6')];this[_0x0e89('0xc')]=_0xdd33c7[_0x0e89('0xc')]||![];this[_0x0e89('0xd')]=_0x3e3c17[_0x0e89('0xd')];this['dialQueueTimeout']=_0x3e3c17[_0x0e89('0xe')]||0x3;this['scheduledat']=_0xdd33c7[_0x0e89('0xf')];this[_0x0e89('0x10')]=_0xdd33c7[_0x0e89('0x10')];this[_0x0e89('0x11')]=_0xdd33c7[_0x0e89('0x11')];this[_0x0e89('0x12')]=_0xdd33c7[_0x0e89('0x12')];this[_0x0e89('0x13')]=_0xdd33c7['countnosuchnumberretry'];this[_0x0e89('0x14')]=_0xdd33c7[_0x0e89('0x14')];this[_0x0e89('0x15')]=_0xdd33c7[_0x0e89('0x15')];this[_0x0e89('0x16')]=_0xdd33c7[_0x0e89('0x16')];this[_0x0e89('0x17')]=_0xdd33c7[_0x0e89('0x17')];this[_0x0e89('0x18')]=_0xdd33c7[_0x0e89('0x18')];this[_0x0e89('0x19')]=_0xdd33c7[_0x0e89('0x19')];this[_0x0e89('0x1a')]=_0xdd33c7[_0x0e89('0x1a')];this['VoiceQueueId']=_0xdd33c7['VoiceQueueId'];this['CampaignId']=_0xdd33c7['CampaignId'];this['idHopper']=_0xdd33c7['id'];this[_0x0e89('0x1b')]=_0xdd33c7[_0x0e89('0x7')][_0x0e89('0x9')]||'';this[_0x0e89('0x1c')]=moment()[_0x0e89('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0e89('0x1e')]=_0xdd33c7['callback'];this[_0x0e89('0x1f')]=_0xdd33c7['callbackuniqueid'];this[_0x0e89('0x20')]=_0xdd33c7['callbackat'];this[_0x0e89('0x21')]=_0xdd33c7['recallme'];this[_0x0e89('0x22')]='';this[_0x0e89('0x23')]='';}Action['prototype'][_0x0e89('0x24')]=function(){return util[_0x0e89('0x1d')](_0x0e89('0x25'),this[_0x0e89('0x6')],this['voiceQueue'][_0x0e89('0x26')]>0x0?this[_0x0e89('0xa')][_0x0e89('0x27')](this[_0x0e89('0x4')]['dialCutDigit']):this['number']);};Action['prototype']['getQueue']=function(){return this[_0x0e89('0xb')];};module[_0x0e89('0x28')]=Action;