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