Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / services / ami / preview / 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 _0x6ea6=['Agent','channelAgent','membername','format','SIP/%s','phone','firstName','Contact','lastName','active','calleridnum','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','util','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype'];(function(_0x281959,_0x3a32f5){var _0x811bd=function(_0x4efc3b){while(--_0x4efc3b){_0x281959['push'](_0x281959['shift']());}};_0x811bd(++_0x3a32f5);}(_0x6ea6,0x186));var _0x66ea=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0x6ea6[_0x3124f8];return _0x5bab5f;};'use strict';var util=require(_0x66ea('0x0'));var _=require(_0x66ea('0x1'));var moment=require('moment');function checkNameSurname(_0x41ae8b,_0x28ee91,_0x1ed9db){var _0x3ff5f6='';if(!_[_0x66ea('0x2')](_0x28ee91)&&_0x66ea('0x3')===typeof _0x28ee91){_0x3ff5f6+=_0x28ee91;}if(!_[_0x66ea('0x2')](_0x1ed9db)&&_0x66ea('0x3')===typeof _0x1ed9db){_0x3ff5f6+='\x20'+_0x1ed9db;}if(_0x3ff5f6!==''){return _0x3ff5f6;}return _0x41ae8b;}function Action(_0x4788d3,_0x27c6e9,_0x75d3fb,_0x8393ec,_0x2d643a){this[_0x66ea('0x4')]=_0x75d3fb||undefined;this[_0x66ea('0x5')]=_0x4788d3['id'];this[_0x66ea('0x6')]=_0x27c6e9[_0x66ea('0x7')];this[_0x66ea('0x8')]=_0x27c6e9[_0x66ea('0x8')];this[_0x66ea('0x9')]=_0x66ea('0x6');this['dialAnswer']=![];this['membername']=_[_0x66ea('0x2')](_0x4788d3['Agent'])?undefined:_0x4788d3[_0x66ea('0xa')]['name'];this[_0x66ea('0xb')]=this[_0x66ea('0xc')]?util[_0x66ea('0xd')](_0x66ea('0xe'),this[_0x66ea('0xc')]):_0x8393ec||undefined;this['calleridname']=checkNameSurname(_0x4788d3['Contact'][_0x66ea('0xf')],_0x4788d3['Contact'][_0x66ea('0x10')],_0x4788d3[_0x66ea('0x11')][_0x66ea('0x12')]);this[_0x66ea('0x13')]=_0x4788d3[_0x66ea('0x13')]||![];this[_0x66ea('0x14')]=_0x4788d3[_0x66ea('0x11')]['phone'];this['scheduledat']=_0x4788d3['scheduledat'];this['countbusyretry']=_0x4788d3[_0x66ea('0x15')]||0x0;this['countcongestionretry']=_0x4788d3['countcongestionretry']||0x0;this[_0x66ea('0x16')]=_0x4788d3[_0x66ea('0x16')]||0x0;this[_0x66ea('0x17')]=(_0x4788d3[_0x66ea('0x15')]||0x0)+(_0x4788d3[_0x66ea('0x18')]||0x0)+(_0x4788d3[_0x66ea('0x16')]||0x0)+(_0x4788d3[_0x66ea('0x19')]||0x0)+(_0x4788d3[_0x66ea('0x1a')]||0x0)+(_0x4788d3[_0x66ea('0x1b')]||0x0)+(_0x4788d3[_0x66ea('0x1c')]||0x0)+(_0x4788d3[_0x66ea('0x1d')]||0x0);this[_0x66ea('0x19')]=_0x4788d3[_0x66ea('0x19')]||0x0;this[_0x66ea('0x1a')]=_0x4788d3[_0x66ea('0x1a')]||0x0;this[_0x66ea('0x1b')]=_0x4788d3[_0x66ea('0x1b')]||0x0;this[_0x66ea('0x1c')]=_0x4788d3[_0x66ea('0x1c')]||0x0;this[_0x66ea('0x1d')]=_0x4788d3[_0x66ea('0x1d')]||0x0;this['callback']=_0x4788d3[_0x66ea('0x1e')];this[_0x66ea('0x1f')]=_0x4788d3[_0x66ea('0x1f')];this['callbackat']=_0x4788d3['callbackat'];this[_0x66ea('0x20')]=_0x4788d3[_0x66ea('0x20')];this[_0x66ea('0x21')]=_0x4788d3[_0x66ea('0x21')];this['ListId']=_0x4788d3[_0x66ea('0x22')];this['UserId']=_['isNil'](_0x4788d3['Agent'])?_0x4788d3['UserId']:_0x4788d3[_0x66ea('0xa')]['id'];this[_0x66ea('0x23')]=_0x4788d3['VoiceQueueId'];this[_0x66ea('0x24')]='';this[_0x66ea('0x25')]='';}Action['prototype'][_0x66ea('0x26')]=function(){return util[_0x66ea('0xd')](_0x66ea('0x27'),this['calleridname'],this['number']);};module['exports']=Action;