Built motion from commit (unavailable).|2.5.30
[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 _0x0194=['name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','dialCutDigit','substring','getQueue','exports','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','queue'];(function(_0x343065,_0x169907){var _0x1d208b=function(_0x5fd86a){while(--_0x5fd86a){_0x343065['push'](_0x343065['shift']());}};_0x1d208b(++_0x169907);}(_0x0194,0xf1));var _0x4019=function(_0x194a66,_0xce388f){_0x194a66=_0x194a66-0x0;var _0x2e817a=_0x0194[_0x194a66];return _0x2e817a;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4019('0x0'));function checkNameSurname(_0x337750,_0x3c1686,_0x5333a5){var _0x4422b2='';if(!_[_0x4019('0x1')](_0x3c1686)&&_0x4019('0x2')===typeof _0x3c1686){_0x4422b2+=_0x3c1686;}if(!_[_0x4019('0x1')](_0x5333a5)&&_0x4019('0x2')===typeof _0x5333a5){_0x4422b2+='\x20'+_0x5333a5;}if(_0x4422b2!==''){return _0x4422b2;}return _0x337750;}function Action(_0x5530a0,_0x17ab91,_0x2803a5){this[_0x4019('0x3')]=_0x5530a0;this[_0x4019('0x4')]=_0x2803a5||undefined;this['name']=checkNameSurname(_0x17ab91[_0x4019('0x5')][_0x4019('0x6')],_0x17ab91[_0x4019('0x5')][_0x4019('0x7')],_0x17ab91[_0x4019('0x5')][_0x4019('0x8')]);this[_0x4019('0x9')]=_0x17ab91['Contact']['phone'];this[_0x4019('0xa')]=_0x5530a0[_0x4019('0xb')];this[_0x4019('0xc')]=_0x17ab91['active']||![];this['type']=_0x5530a0[_0x4019('0xd')];this[_0x4019('0xe')]=_0x5530a0[_0x4019('0xe')]||0x3;this['scheduledat']=_0x17ab91[_0x4019('0xf')];this[_0x4019('0x10')]=_0x17ab91['countbusyretry'];this['countcongestionretry']=_0x17ab91['countcongestionretry'];this[_0x4019('0x11')]=_0x17ab91[_0x4019('0x11')];this[_0x4019('0x12')]=_0x17ab91['countnosuchnumberretry'];this[_0x4019('0x13')]=_0x17ab91['countdropretry'];this[_0x4019('0x14')]=_0x17ab91['countabandonedretry'];this['countmachineretry']=_0x17ab91['countmachineretry'];this['countagentrejectretry']=_0x17ab91[_0x4019('0x15')];this[_0x4019('0x16')]=_0x17ab91[_0x4019('0x16')];this['ListId']=_0x17ab91[_0x4019('0x17')];this['UserId']=_0x17ab91[_0x4019('0x18')];this[_0x4019('0x19')]=_0x17ab91[_0x4019('0x19')];this[_0x4019('0x1a')]=_0x17ab91[_0x4019('0x1a')];this[_0x4019('0x1b')]=_0x17ab91['id'];this[_0x4019('0x1c')]=_0x17ab91[_0x4019('0x5')][_0x4019('0x7')]||'';this[_0x4019('0x1d')]=moment()[_0x4019('0x1e')](_0x4019('0x1f'));this[_0x4019('0x20')]=_0x17ab91[_0x4019('0x20')];this[_0x4019('0x21')]=_0x17ab91[_0x4019('0x21')];this[_0x4019('0x22')]=_0x17ab91['callbackat'];this[_0x4019('0x23')]=_0x17ab91['recallme'];this[_0x4019('0x24')]='';this[_0x4019('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0x4019('0x1e')]('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue'][_0x4019('0x26')]>0x0?this[_0x4019('0x9')][_0x4019('0x27')](this[_0x4019('0x3')][_0x4019('0x26')]):this[_0x4019('0x9')]);};Action['prototype'][_0x4019('0x28')]=function(){return this[_0x4019('0xa')];};module[_0x4019('0x29')]=Action;