Built motion from commit e0fa946e.|2.6.5
[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 _0xd5f8=['CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','substring','getQueue','util','lodash','moment','isNil','string','uniqueid','name','Contact','firstName','lastName','number','queue','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x25d048,_0x28af5b){var _0x33c9ff=function(_0x1a2084){while(--_0x1a2084){_0x25d048['push'](_0x25d048['shift']());}};_0x33c9ff(++_0x28af5b);}(_0xd5f8,0x1be));var _0x8d5f=function(_0x1e8d66,_0x42581e){_0x1e8d66=_0x1e8d66-0x0;var _0x385fc5=_0xd5f8[_0x1e8d66];return _0x385fc5;};'use strict';var util=require(_0x8d5f('0x0'));var _=require(_0x8d5f('0x1'));var moment=require(_0x8d5f('0x2'));function checkNameSurname(_0x4fa2dd,_0x2af6e9,_0x1d58ba){var _0x30ce79='';if(!_[_0x8d5f('0x3')](_0x2af6e9)&&_0x8d5f('0x4')===typeof _0x2af6e9){_0x30ce79+=_0x2af6e9;}if(!_[_0x8d5f('0x3')](_0x1d58ba)&&_0x8d5f('0x4')===typeof _0x1d58ba){_0x30ce79+='\x20'+_0x1d58ba;}if(_0x30ce79!==''){return _0x30ce79;}return _0x4fa2dd;}function Action(_0x4c2756,_0x22f28c,_0x14bf32){this['voiceQueue']=_0x4c2756;this[_0x8d5f('0x5')]=_0x14bf32||undefined;this[_0x8d5f('0x6')]=checkNameSurname(_0x22f28c[_0x8d5f('0x7')]['phone'],_0x22f28c[_0x8d5f('0x7')][_0x8d5f('0x8')],_0x22f28c['Contact'][_0x8d5f('0x9')]);this[_0x8d5f('0xa')]=_0x22f28c['phone'];this[_0x8d5f('0xb')]=_0x4c2756[_0x8d5f('0x6')];this[_0x8d5f('0xc')]=_0x22f28c['active']||![];this['type']=_0x4c2756['type'];this['dialQueueTimeout']=_0x4c2756[_0x8d5f('0xd')]||0x3;this[_0x8d5f('0xe')]=_0x22f28c[_0x8d5f('0xe')];this[_0x8d5f('0xf')]=_0x22f28c[_0x8d5f('0xf')];this[_0x8d5f('0x10')]=_0x22f28c[_0x8d5f('0x10')];this[_0x8d5f('0x11')]=_0x22f28c[_0x8d5f('0x11')];this[_0x8d5f('0x12')]=_0x22f28c[_0x8d5f('0x12')];this[_0x8d5f('0x13')]=_0x22f28c[_0x8d5f('0x13')];this['countabandonedretry']=_0x22f28c[_0x8d5f('0x14')];this['countmachineretry']=_0x22f28c[_0x8d5f('0x15')];this[_0x8d5f('0x16')]=_0x22f28c['countagentrejectretry'];this['ContactId']=_0x22f28c[_0x8d5f('0x17')];this[_0x8d5f('0x18')]=_0x22f28c[_0x8d5f('0x18')];this['UserId']=_0x22f28c[_0x8d5f('0x19')];this[_0x8d5f('0x1a')]=_0x22f28c[_0x8d5f('0x1a')];this[_0x8d5f('0x1b')]=_0x22f28c['CampaignId'];this[_0x8d5f('0x1c')]=_0x22f28c['id'];this[_0x8d5f('0x1d')]=_0x22f28c['Contact'][_0x8d5f('0x8')]||'';this['starttime']=moment()[_0x8d5f('0x1e')](_0x8d5f('0x1f'));this[_0x8d5f('0x20')]=_0x22f28c[_0x8d5f('0x20')];this[_0x8d5f('0x21')]=_0x22f28c['callbackuniqueid'];this[_0x8d5f('0x22')]=_0x22f28c[_0x8d5f('0x22')];this['recallme']=_0x22f28c['recallme'];this[_0x8d5f('0x23')]='';this[_0x8d5f('0x24')]='';}Action[_0x8d5f('0x25')][_0x8d5f('0x26')]=function(){return util[_0x8d5f('0x1e')](_0x8d5f('0x27'),this[_0x8d5f('0x6')],this[_0x8d5f('0x28')]['dialCutDigit']>0x0?this[_0x8d5f('0xa')][_0x8d5f('0x29')](this[_0x8d5f('0x28')]['dialCutDigit']):this[_0x8d5f('0xa')]);};Action[_0x8d5f('0x25')][_0x8d5f('0x2a')]=function(){return this[_0x8d5f('0xb')];};module['exports']=Action;