97ca032e0edb9e0cd8b852c9653359fc749647f0
[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 _0xcf66=['membername','calleridname','Contact','phone','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','dialAnswer','Agent','SIP/%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf66,0x71));var _0x6cf6=function(_0x1c3db6,_0xba999e){_0x1c3db6=_0x1c3db6-0x0;var _0x477e17=_0xcf66[_0x1c3db6];return _0x477e17;};'use strict';var util=require(_0x6cf6('0x0'));var _=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));function checkNameSurname(_0x56f1fd,_0x7ed4c0,_0x1af283){var _0x49ce88='';if(!_['isNil'](_0x7ed4c0)&&_0x6cf6('0x3')===typeof _0x7ed4c0){_0x49ce88+=_0x7ed4c0;}if(!_[_0x6cf6('0x4')](_0x1af283)&&'string'===typeof _0x1af283){_0x49ce88+='\x20'+_0x1af283;}if(_0x49ce88!==''){return _0x49ce88;}return _0x56f1fd;}function Action(_0x39f1d6,_0x1fbedd,_0x2a573e,_0x5eb082,_0x94c6a9){this[_0x6cf6('0x5')]=_0x2a573e||undefined;this[_0x6cf6('0x6')]=_0x39f1d6['id'];this[_0x6cf6('0x7')]=_0x1fbedd[_0x6cf6('0x8')];this[_0x6cf6('0x9')]=_0x1fbedd['type'];this['campaigntype']='queue';this[_0x6cf6('0xa')]=![];this['membername']=_[_0x6cf6('0x4')](_0x39f1d6[_0x6cf6('0xb')])?undefined:_0x39f1d6[_0x6cf6('0xb')][_0x6cf6('0x8')];this['channelAgent']=this['membername']?util['format'](_0x6cf6('0xc'),this[_0x6cf6('0xd')]):_0x5eb082||undefined;this[_0x6cf6('0xe')]=checkNameSurname(_0x39f1d6[_0x6cf6('0xf')][_0x6cf6('0x10')],_0x39f1d6[_0x6cf6('0xf')]['firstName'],_0x39f1d6[_0x6cf6('0xf')]['lastName']);this[_0x6cf6('0x11')]=_0x39f1d6[_0x6cf6('0x11')]||![];this['calleridnum']=_0x39f1d6[_0x6cf6('0x10')];this[_0x6cf6('0x12')]=_0x39f1d6[_0x6cf6('0x12')];this[_0x6cf6('0x13')]=_0x39f1d6[_0x6cf6('0x13')]||0x0;this[_0x6cf6('0x14')]=_0x39f1d6[_0x6cf6('0x14')]||0x0;this[_0x6cf6('0x15')]=_0x39f1d6[_0x6cf6('0x15')]||0x0;this[_0x6cf6('0x16')]=(_0x39f1d6['countbusyretry']||0x0)+(_0x39f1d6[_0x6cf6('0x14')]||0x0)+(_0x39f1d6[_0x6cf6('0x15')]||0x0)+(_0x39f1d6[_0x6cf6('0x17')]||0x0)+(_0x39f1d6['countdropretry']||0x0)+(_0x39f1d6[_0x6cf6('0x18')]||0x0)+(_0x39f1d6[_0x6cf6('0x19')]||0x0)+(_0x39f1d6[_0x6cf6('0x1a')]||0x0);this[_0x6cf6('0x17')]=_0x39f1d6[_0x6cf6('0x17')]||0x0;this[_0x6cf6('0x1b')]=_0x39f1d6[_0x6cf6('0x1b')]||0x0;this['countabandonedretry']=_0x39f1d6[_0x6cf6('0x18')]||0x0;this[_0x6cf6('0x19')]=_0x39f1d6[_0x6cf6('0x19')]||0x0;this[_0x6cf6('0x1a')]=_0x39f1d6[_0x6cf6('0x1a')]||0x0;this[_0x6cf6('0x1c')]=_0x39f1d6[_0x6cf6('0x1c')];this[_0x6cf6('0x1d')]=_0x39f1d6['callbackuniqueid'];this['callbackat']=_0x39f1d6[_0x6cf6('0x1e')];this['recallme']=_0x39f1d6[_0x6cf6('0x1f')];this[_0x6cf6('0x20')]=_0x39f1d6[_0x6cf6('0x20')];this[_0x6cf6('0x21')]=_0x39f1d6[_0x6cf6('0x21')];this[_0x6cf6('0x22')]=_[_0x6cf6('0x4')](_0x39f1d6['Agent'])?_0x39f1d6[_0x6cf6('0x22')]:_0x39f1d6[_0x6cf6('0xb')]['id'];this[_0x6cf6('0x23')]=_0x39f1d6['VoiceQueueId'];this[_0x6cf6('0x24')]='';this[_0x6cf6('0x25')]='';}Action[_0x6cf6('0x26')][_0x6cf6('0x27')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x6cf6('0xe')],this[_0x6cf6('0x28')]);};module[_0x6cf6('0x29')]=Action;