badbbe72a00f093e01a1bcff7bf612df72a0ec20
[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 _0x54f0=['phone','firstName','lastName','number','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','queue','util','lodash','moment','isNil','voiceQueue','uniqueid','Contact'];(function(_0x2729b0,_0x4fd119){var _0x176a9c=function(_0x4c47e4){while(--_0x4c47e4){_0x2729b0['push'](_0x2729b0['shift']());}};_0x176a9c(++_0x4fd119);}(_0x54f0,0x1a0));var _0x054f=function(_0x1ad0b1,_0x1fb76e){_0x1ad0b1=_0x1ad0b1-0x0;var _0x32811c=_0x54f0[_0x1ad0b1];return _0x32811c;};'use strict';var util=require(_0x054f('0x0'));var _=require(_0x054f('0x1'));var moment=require(_0x054f('0x2'));function checkNameSurname(_0x2beaa7,_0x453a16,_0x658175){var _0x523590='';if(!_[_0x054f('0x3')](_0x453a16)&&'string'===typeof _0x453a16){_0x523590+=_0x453a16;}if(!_['isNil'](_0x658175)&&'string'===typeof _0x658175){_0x523590+='\x20'+_0x658175;}if(_0x523590!==''){return _0x523590;}return _0x2beaa7;}function Action(_0x85918b,_0x1b73fe,_0x2030fd){this[_0x054f('0x4')]=_0x85918b;this[_0x054f('0x5')]=_0x2030fd||undefined;this['name']=checkNameSurname(_0x1b73fe[_0x054f('0x6')][_0x054f('0x7')],_0x1b73fe[_0x054f('0x6')][_0x054f('0x8')],_0x1b73fe[_0x054f('0x6')][_0x054f('0x9')]);this[_0x054f('0xa')]=_0x1b73fe[_0x054f('0x7')];this['queue']=_0x85918b[_0x054f('0xb')];this[_0x054f('0xc')]=_0x1b73fe['active']||![];this[_0x054f('0xd')]=_0x85918b['type'];this[_0x054f('0xe')]=_0x85918b[_0x054f('0xe')]||0x3;this[_0x054f('0xf')]=_0x1b73fe[_0x054f('0xf')];this[_0x054f('0x10')]=_0x1b73fe['countbusyretry'];this[_0x054f('0x11')]=_0x1b73fe[_0x054f('0x11')];this[_0x054f('0x12')]=_0x1b73fe['countnoanswerretry'];this[_0x054f('0x13')]=_0x1b73fe['countnosuchnumberretry'];this[_0x054f('0x14')]=_0x1b73fe[_0x054f('0x14')];this['countabandonedretry']=_0x1b73fe[_0x054f('0x15')];this[_0x054f('0x16')]=_0x1b73fe[_0x054f('0x16')];this[_0x054f('0x17')]=_0x1b73fe['countagentrejectretry'];this[_0x054f('0x18')]=_0x1b73fe[_0x054f('0x18')];this[_0x054f('0x19')]=_0x1b73fe['ListId'];this[_0x054f('0x1a')]=_0x1b73fe[_0x054f('0x1a')];this[_0x054f('0x1b')]=_0x1b73fe[_0x054f('0x1b')];this[_0x054f('0x1c')]=_0x1b73fe['CampaignId'];this[_0x054f('0x1d')]=_0x1b73fe['id'];this[_0x054f('0x1e')]=_0x1b73fe[_0x054f('0x6')]['firstName']||'';this[_0x054f('0x1f')]=moment()[_0x054f('0x20')](_0x054f('0x21'));this['callback']=_0x1b73fe[_0x054f('0x22')];this[_0x054f('0x23')]=_0x1b73fe[_0x054f('0x23')];this[_0x054f('0x24')]=_0x1b73fe['callbackat'];this['recallme']=_0x1b73fe[_0x054f('0x25')];this[_0x054f('0x26')]='';this[_0x054f('0x27')]='';}Action['prototype'][_0x054f('0x28')]=function(){return util[_0x054f('0x20')](_0x054f('0x29'),this[_0x054f('0xb')],this[_0x054f('0x4')][_0x054f('0x2a')]>0x0?this['number'][_0x054f('0x2b')](this['voiceQueue'][_0x054f('0x2a')]):this[_0x054f('0xa')]);};Action[_0x054f('0x2c')][_0x054f('0x2d')]=function(){return this[_0x054f('0x2e')];};module['exports']=Action;