Built motion from commit 9d1906d1.|2.5.40
[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 _0xa4b4=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','substring','getQueue','exports','util','lodash','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry'];(function(_0x41b45d,_0x16a2a4){var _0x1ff59f=function(_0x485217){while(--_0x485217){_0x41b45d['push'](_0x41b45d['shift']());}};_0x1ff59f(++_0x16a2a4);}(_0xa4b4,0x171));var _0x4a4b=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa4b4[_0x102e37];return _0x35a07c;};'use strict';var util=require(_0x4a4b('0x0'));var _=require(_0x4a4b('0x1'));var moment=require('moment');function checkNameSurname(_0x27eb49,_0x54dc9a,_0x3f0768){var _0x1445ef='';if(!_['isNil'](_0x54dc9a)&&_0x4a4b('0x2')===typeof _0x54dc9a){_0x1445ef+=_0x54dc9a;}if(!_['isNil'](_0x3f0768)&&'string'===typeof _0x3f0768){_0x1445ef+='\x20'+_0x3f0768;}if(_0x1445ef!==''){return _0x1445ef;}return _0x27eb49;}function Action(_0x3632ce,_0x1afc83,_0x4af18b){this[_0x4a4b('0x3')]=_0x3632ce;this[_0x4a4b('0x4')]=_0x4af18b||undefined;this[_0x4a4b('0x5')]=checkNameSurname(_0x1afc83['Contact'][_0x4a4b('0x6')],_0x1afc83[_0x4a4b('0x7')][_0x4a4b('0x8')],_0x1afc83[_0x4a4b('0x7')][_0x4a4b('0x9')]);this[_0x4a4b('0xa')]=_0x1afc83[_0x4a4b('0x7')]['phone'];this[_0x4a4b('0xb')]=_0x3632ce['name'];this[_0x4a4b('0xc')]=_0x1afc83[_0x4a4b('0xc')]||![];this[_0x4a4b('0xd')]=_0x3632ce['type'];this['dialQueueTimeout']=_0x3632ce[_0x4a4b('0xe')]||0x3;this[_0x4a4b('0xf')]=_0x1afc83[_0x4a4b('0xf')];this['countbusyretry']=_0x1afc83['countbusyretry'];this[_0x4a4b('0x10')]=_0x1afc83[_0x4a4b('0x10')];this[_0x4a4b('0x11')]=_0x1afc83[_0x4a4b('0x11')];this[_0x4a4b('0x12')]=_0x1afc83['countnosuchnumberretry'];this[_0x4a4b('0x13')]=_0x1afc83[_0x4a4b('0x13')];this[_0x4a4b('0x14')]=_0x1afc83[_0x4a4b('0x14')];this[_0x4a4b('0x15')]=_0x1afc83[_0x4a4b('0x15')];this[_0x4a4b('0x16')]=_0x1afc83[_0x4a4b('0x16')];this[_0x4a4b('0x17')]=_0x1afc83[_0x4a4b('0x17')];this[_0x4a4b('0x18')]=_0x1afc83[_0x4a4b('0x18')];this[_0x4a4b('0x19')]=_0x1afc83[_0x4a4b('0x19')];this['VoiceQueueId']=_0x1afc83[_0x4a4b('0x1a')];this[_0x4a4b('0x1b')]=_0x1afc83[_0x4a4b('0x1b')];this[_0x4a4b('0x1c')]=_0x1afc83['id'];this['ContactFirstName']=_0x1afc83[_0x4a4b('0x7')]['firstName']||'';this['starttime']=moment()[_0x4a4b('0x1d')](_0x4a4b('0x1e'));this['callback']=_0x1afc83[_0x4a4b('0x1f')];this[_0x4a4b('0x20')]=_0x1afc83[_0x4a4b('0x20')];this[_0x4a4b('0x21')]=_0x1afc83[_0x4a4b('0x21')];this[_0x4a4b('0x22')]=_0x1afc83['recallme'];this[_0x4a4b('0x23')]='';this[_0x4a4b('0x24')]='';}Action[_0x4a4b('0x25')][_0x4a4b('0x26')]=function(){return util[_0x4a4b('0x1d')]('\x22%s\x22\x20<%s>',this[_0x4a4b('0x5')],this[_0x4a4b('0x3')][_0x4a4b('0x27')]>0x0?this['number'][_0x4a4b('0x28')](this[_0x4a4b('0x3')][_0x4a4b('0x27')]):this[_0x4a4b('0xa')]);};Action['prototype'][_0x4a4b('0x29')]=function(){return this[_0x4a4b('0xb')];};module[_0x4a4b('0x2a')]=Action;