Built motion from commit (unavailable).|2.5.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 _0xebe6=['lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','firstName','Contact','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','queue','exports','util'];(function(_0x28889c,_0xfff211){var _0x326188=function(_0x4c69b5){while(--_0x4c69b5){_0x28889c['push'](_0x28889c['shift']());}};_0x326188(++_0xfff211);}(_0xebe6,0x13a));var _0x6ebe=function(_0x5abc1e,_0x8715e7){_0x5abc1e=_0x5abc1e-0x0;var _0x3423d1=_0xebe6[_0x5abc1e];return _0x3423d1;};'use strict';var util=require(_0x6ebe('0x0'));var _=require(_0x6ebe('0x1'));var moment=require(_0x6ebe('0x2'));function checkNameSurname(_0x3ed4da,_0x229b70,_0x12699e){var _0x80db7b='';if(!_[_0x6ebe('0x3')](_0x229b70)&&_0x6ebe('0x4')===typeof _0x229b70){_0x80db7b+=_0x229b70;}if(!_[_0x6ebe('0x3')](_0x12699e)&&'string'===typeof _0x12699e){_0x80db7b+='\x20'+_0x12699e;}if(_0x80db7b!==''){return _0x80db7b;}return _0x3ed4da;}function Action(_0x59ebe9,_0x1c3c2c,_0x2a63a5){this[_0x6ebe('0x5')]=_0x59ebe9;this[_0x6ebe('0x6')]=_0x2a63a5||undefined;this[_0x6ebe('0x7')]=checkNameSurname(_0x1c3c2c['Contact'][_0x6ebe('0x8')],_0x1c3c2c['Contact'][_0x6ebe('0x9')],_0x1c3c2c[_0x6ebe('0xa')][_0x6ebe('0xb')]);this[_0x6ebe('0xc')]=_0x1c3c2c[_0x6ebe('0xa')][_0x6ebe('0x8')];this['queue']=_0x59ebe9[_0x6ebe('0x7')];this[_0x6ebe('0xd')]=_0x1c3c2c[_0x6ebe('0xd')]||![];this[_0x6ebe('0xe')]=_0x59ebe9[_0x6ebe('0xe')];this[_0x6ebe('0xf')]=_0x59ebe9[_0x6ebe('0xf')]||0x3;this[_0x6ebe('0x10')]=_0x1c3c2c['scheduledat'];this[_0x6ebe('0x11')]=_0x1c3c2c['countbusyretry'];this[_0x6ebe('0x12')]=_0x1c3c2c[_0x6ebe('0x12')];this['countnoanswerretry']=_0x1c3c2c[_0x6ebe('0x13')];this[_0x6ebe('0x14')]=_0x1c3c2c[_0x6ebe('0x14')];this[_0x6ebe('0x15')]=_0x1c3c2c[_0x6ebe('0x15')];this[_0x6ebe('0x16')]=_0x1c3c2c[_0x6ebe('0x16')];this[_0x6ebe('0x17')]=_0x1c3c2c[_0x6ebe('0x17')];this['countagentrejectretry']=_0x1c3c2c['countagentrejectretry'];this[_0x6ebe('0x18')]=_0x1c3c2c['ContactId'];this['ListId']=_0x1c3c2c[_0x6ebe('0x19')];this[_0x6ebe('0x1a')]=_0x1c3c2c[_0x6ebe('0x1a')];this['VoiceQueueId']=_0x1c3c2c[_0x6ebe('0x1b')];this[_0x6ebe('0x1c')]=_0x1c3c2c['CampaignId'];this[_0x6ebe('0x1d')]=_0x1c3c2c['id'];this[_0x6ebe('0x1e')]=_0x1c3c2c[_0x6ebe('0xa')][_0x6ebe('0x9')]||'';this['starttime']=moment()[_0x6ebe('0x1f')](_0x6ebe('0x20'));this[_0x6ebe('0x21')]=_0x1c3c2c[_0x6ebe('0x21')];this[_0x6ebe('0x22')]=_0x1c3c2c[_0x6ebe('0x22')];this[_0x6ebe('0x23')]=_0x1c3c2c[_0x6ebe('0x23')];this[_0x6ebe('0x24')]=_0x1c3c2c['recallme'];this[_0x6ebe('0x25')]='';this['originatecalleridname']='';}Action[_0x6ebe('0x26')][_0x6ebe('0x27')]=function(){return util['format'](_0x6ebe('0x28'),this[_0x6ebe('0x7')],this['voiceQueue'][_0x6ebe('0x29')]>0x0?this[_0x6ebe('0xc')][_0x6ebe('0x2a')](this['voiceQueue'][_0x6ebe('0x29')]):this['number']);};Action[_0x6ebe('0x26')]['getQueue']=function(){return this[_0x6ebe('0x2b')];};module[_0x6ebe('0x2c')]=Action;