Built motion from commit a61a4a20.|2.5.46
[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 _0x9944=['prototype','getQueue','queue','exports','util','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','name','dialCutDigit'];(function(_0x4ab6c6,_0x11a9f6){var _0x35b044=function(_0x5aa7f8){while(--_0x5aa7f8){_0x4ab6c6['push'](_0x4ab6c6['shift']());}};_0x35b044(++_0x11a9f6);}(_0x9944,0x187));var _0x4994=function(_0x39cf2b,_0x1d1485){_0x39cf2b=_0x39cf2b-0x0;var _0x4074fe=_0x9944[_0x39cf2b];return _0x4074fe;};'use strict';var util=require(_0x4994('0x0'));var _=require('lodash');var moment=require(_0x4994('0x1'));function checkNameSurname(_0xbb856,_0x40bcc3,_0x44d40b){var _0x4d0ff6='';if(!_[_0x4994('0x2')](_0x40bcc3)&&_0x4994('0x3')===typeof _0x40bcc3){_0x4d0ff6+=_0x40bcc3;}if(!_[_0x4994('0x2')](_0x44d40b)&&_0x4994('0x3')===typeof _0x44d40b){_0x4d0ff6+='\x20'+_0x44d40b;}if(_0x4d0ff6!==''){return _0x4d0ff6;}return _0xbb856;}function Action(_0x187cac,_0x5bb229,_0x1d14f1){this[_0x4994('0x4')]=_0x187cac;this[_0x4994('0x5')]=_0x1d14f1||undefined;this['name']=checkNameSurname(_0x5bb229[_0x4994('0x6')][_0x4994('0x7')],_0x5bb229[_0x4994('0x6')][_0x4994('0x8')],_0x5bb229[_0x4994('0x6')]['lastName']);this[_0x4994('0x9')]=_0x5bb229[_0x4994('0x6')][_0x4994('0x7')];this['queue']=_0x187cac['name'];this[_0x4994('0xa')]=_0x5bb229[_0x4994('0xa')]||![];this[_0x4994('0xb')]=_0x187cac[_0x4994('0xb')];this[_0x4994('0xc')]=_0x187cac[_0x4994('0xc')]||0x3;this['scheduledat']=_0x5bb229[_0x4994('0xd')];this[_0x4994('0xe')]=_0x5bb229['countbusyretry'];this[_0x4994('0xf')]=_0x5bb229[_0x4994('0xf')];this['countnoanswerretry']=_0x5bb229[_0x4994('0x10')];this['countnosuchnumberretry']=_0x5bb229['countnosuchnumberretry'];this[_0x4994('0x11')]=_0x5bb229['countdropretry'];this[_0x4994('0x12')]=_0x5bb229['countabandonedretry'];this[_0x4994('0x13')]=_0x5bb229[_0x4994('0x13')];this[_0x4994('0x14')]=_0x5bb229[_0x4994('0x14')];this[_0x4994('0x15')]=_0x5bb229[_0x4994('0x15')];this[_0x4994('0x16')]=_0x5bb229['ListId'];this[_0x4994('0x17')]=_0x5bb229[_0x4994('0x17')];this[_0x4994('0x18')]=_0x5bb229[_0x4994('0x18')];this[_0x4994('0x19')]=_0x5bb229[_0x4994('0x19')];this[_0x4994('0x1a')]=_0x5bb229['id'];this[_0x4994('0x1b')]=_0x5bb229[_0x4994('0x6')][_0x4994('0x8')]||'';this['starttime']=moment()[_0x4994('0x1c')](_0x4994('0x1d'));this[_0x4994('0x1e')]=_0x5bb229[_0x4994('0x1e')];this[_0x4994('0x1f')]=_0x5bb229[_0x4994('0x1f')];this['callbackat']=_0x5bb229[_0x4994('0x20')];this['recallme']=_0x5bb229[_0x4994('0x21')];this[_0x4994('0x22')]='';this['originatecalleridname']='';}Action['prototype'][_0x4994('0x23')]=function(){return util[_0x4994('0x1c')](_0x4994('0x24'),this[_0x4994('0x25')],this[_0x4994('0x4')][_0x4994('0x26')]>0x0?this['number']['substring'](this[_0x4994('0x4')]['dialCutDigit']):this[_0x4994('0x9')]);};Action[_0x4994('0x27')][_0x4994('0x28')]=function(){return this[_0x4994('0x29')];};module[_0x4994('0x2a')]=Action;