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