Built motion from commit (unavailable).|2.4.4
[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 _0x4071=['idHopper','ContactFirstName','firstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','dialCutDigit','number','substring','getQueue','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','VoiceQueueId','CampaignId'];(function(_0x429c2c,_0x14876b){var _0x2d7ba6=function(_0x4df572){while(--_0x4df572){_0x429c2c['push'](_0x429c2c['shift']());}};_0x2d7ba6(++_0x14876b);}(_0x4071,0x1c0));var _0x1407=function(_0x2f573a,_0x2290f3){_0x2f573a=_0x2f573a-0x0;var _0x4816a5=_0x4071[_0x2f573a];return _0x4816a5;};'use strict';var util=require('util');var _=require(_0x1407('0x0'));var moment=require(_0x1407('0x1'));function checkNameSurname(_0x5c2a98,_0x3baf6b,_0x220a19){var _0x2331dc='';if(!_[_0x1407('0x2')](_0x3baf6b)&&_0x1407('0x3')===typeof _0x3baf6b){_0x2331dc+=_0x3baf6b;}if(!_[_0x1407('0x2')](_0x220a19)&&_0x1407('0x3')===typeof _0x220a19){_0x2331dc+='\x20'+_0x220a19;}if(_0x2331dc!==''){return _0x2331dc;}return _0x5c2a98;}function Action(_0x14d4d5,_0x34617e,_0x40be7b){this[_0x1407('0x4')]=_0x14d4d5;this[_0x1407('0x5')]=_0x40be7b||undefined;this[_0x1407('0x6')]=checkNameSurname(_0x34617e[_0x1407('0x7')][_0x1407('0x8')],_0x34617e[_0x1407('0x7')]['firstName'],_0x34617e['Contact']['lastName']);this['number']=_0x34617e[_0x1407('0x7')][_0x1407('0x8')];this[_0x1407('0x9')]=_0x14d4d5['name'];this[_0x1407('0xa')]=_0x34617e[_0x1407('0xa')]||![];this[_0x1407('0xb')]=_0x14d4d5['type'];this['dialQueueTimeout']=_0x14d4d5[_0x1407('0xc')]||0x3;this[_0x1407('0xd')]=_0x34617e[_0x1407('0xd')];this[_0x1407('0xe')]=_0x34617e[_0x1407('0xe')];this[_0x1407('0xf')]=_0x34617e[_0x1407('0xf')];this[_0x1407('0x10')]=_0x34617e['countnoanswerretry'];this['ContactId']=_0x34617e[_0x1407('0x11')];this['ListId']=_0x34617e['ListId'];this['UserId']=_0x34617e['UserId'];this[_0x1407('0x12')]=_0x34617e[_0x1407('0x12')];this[_0x1407('0x13')]=_0x34617e['CampaignId'];this[_0x1407('0x14')]=_0x34617e['id'];this[_0x1407('0x15')]=_0x34617e[_0x1407('0x7')][_0x1407('0x16')]||'';this[_0x1407('0x17')]=moment()[_0x1407('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1407('0x19')]=_0x34617e[_0x1407('0x19')];this[_0x1407('0x1a')]=_0x34617e[_0x1407('0x1a')];this['callbackat']=_0x34617e[_0x1407('0x1b')];this['recallme']=_0x34617e[_0x1407('0x1c')];this[_0x1407('0x1d')]='';this[_0x1407('0x1e')]='';}Action[_0x1407('0x1f')]['getCaller']=function(){return util[_0x1407('0x18')]('\x22%s\x22\x20<%s>',this['name'],this[_0x1407('0x4')][_0x1407('0x20')]>0x0?this[_0x1407('0x21')][_0x1407('0x22')](this[_0x1407('0x4')]['dialCutDigit']):this[_0x1407('0x21')]);};Action[_0x1407('0x1f')][_0x1407('0x23')]=function(){return this[_0x1407('0x9')];};module['exports']=Action;