5d57fbef82218c3fad3146fac5ef1eff3a410154
[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 _0xfb67=['\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','lodash','string','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller'];(function(_0x5bfa59,_0x362ace){var _0x5e8c6d=function(_0x231a0c){while(--_0x231a0c){_0x5bfa59['push'](_0x5bfa59['shift']());}};_0x5e8c6d(++_0x362ace);}(_0xfb67,0x10d));var _0x7fb6=function(_0x2390a8,_0x2cbd3){_0x2390a8=_0x2390a8-0x0;var _0x48cd67=_0xfb67[_0x2390a8];return _0x48cd67;};'use strict';var util=require('util');var _=require(_0x7fb6('0x0'));var moment=require('moment');function checkNameSurname(_0x44cf49,_0xd91cd6,_0x5ced5d){var _0x11573b='';if(!_['isNil'](_0xd91cd6)&&_0x7fb6('0x1')===typeof _0xd91cd6){_0x11573b+=_0xd91cd6;}if(!_[_0x7fb6('0x2')](_0x5ced5d)&&'string'===typeof _0x5ced5d){_0x11573b+='\x20'+_0x5ced5d;}if(_0x11573b!==''){return _0x11573b;}return _0x44cf49;}function Action(_0xbcbab3,_0x2efd82,_0x4f72be){this[_0x7fb6('0x3')]=_0xbcbab3;this[_0x7fb6('0x4')]=_0x4f72be||undefined;this[_0x7fb6('0x5')]=checkNameSurname(_0x2efd82[_0x7fb6('0x6')][_0x7fb6('0x7')],_0x2efd82['Contact'][_0x7fb6('0x8')],_0x2efd82[_0x7fb6('0x6')]['lastName']);this[_0x7fb6('0x9')]=_0x2efd82[_0x7fb6('0x7')];this[_0x7fb6('0xa')]=_0xbcbab3[_0x7fb6('0x5')];this[_0x7fb6('0xb')]=_0x2efd82[_0x7fb6('0xb')]||![];this[_0x7fb6('0xc')]=_0xbcbab3['type'];this[_0x7fb6('0xd')]=_0xbcbab3[_0x7fb6('0xd')]||0x3;this[_0x7fb6('0xe')]=_0x2efd82['scheduledat'];this[_0x7fb6('0xf')]=_0x2efd82[_0x7fb6('0xf')];this[_0x7fb6('0x10')]=_0x2efd82[_0x7fb6('0x10')];this[_0x7fb6('0x11')]=_0x2efd82[_0x7fb6('0x11')];this[_0x7fb6('0x12')]=_0x2efd82[_0x7fb6('0x12')];this[_0x7fb6('0x13')]=_0x2efd82[_0x7fb6('0x13')];this[_0x7fb6('0x14')]=_0x2efd82[_0x7fb6('0x14')];this[_0x7fb6('0x15')]=_0x2efd82['countmachineretry'];this[_0x7fb6('0x16')]=_0x2efd82[_0x7fb6('0x16')];this[_0x7fb6('0x17')]=_0x2efd82[_0x7fb6('0x17')];this[_0x7fb6('0x18')]=_0x2efd82[_0x7fb6('0x18')];this[_0x7fb6('0x19')]=_0x2efd82[_0x7fb6('0x19')];this[_0x7fb6('0x1a')]=_0x2efd82[_0x7fb6('0x1a')];this[_0x7fb6('0x1b')]=_0x2efd82['CampaignId'];this[_0x7fb6('0x1c')]=_0x2efd82['id'];this['ContactFirstName']=_0x2efd82[_0x7fb6('0x6')][_0x7fb6('0x8')]||'';this[_0x7fb6('0x1d')]=moment()[_0x7fb6('0x1e')](_0x7fb6('0x1f'));this['callback']=_0x2efd82[_0x7fb6('0x20')];this['callbackuniqueid']=_0x2efd82[_0x7fb6('0x21')];this[_0x7fb6('0x22')]=_0x2efd82['callbackat'];this[_0x7fb6('0x23')]=_0x2efd82['recallme'];this[_0x7fb6('0x24')]='';this['originatecalleridname']='';}Action[_0x7fb6('0x25')][_0x7fb6('0x26')]=function(){return util[_0x7fb6('0x1e')](_0x7fb6('0x27'),this['name'],this[_0x7fb6('0x3')][_0x7fb6('0x28')]>0x0?this[_0x7fb6('0x9')][_0x7fb6('0x29')](this[_0x7fb6('0x3')]['dialCutDigit']):this[_0x7fb6('0x9')]);};Action[_0x7fb6('0x25')][_0x7fb6('0x2a')]=function(){return this[_0x7fb6('0xa')];};module[_0x7fb6('0x2b')]=Action;