Built motion from commit 3c2ce842.|2.6.31
[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 _0x6343=['format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','number','moment','string','isNil','queue','name','type','campaigntype','Agent','channelAgent','membername'];(function(_0x3c896c,_0x1cba86){var _0x44af1c=function(_0x252c14){while(--_0x252c14){_0x3c896c['push'](_0x3c896c['shift']());}};_0x44af1c(++_0x1cba86);}(_0x6343,0x168));var _0x3634=function(_0xfc254a,_0x569cc7){_0xfc254a=_0xfc254a-0x0;var _0x3bfbe3=_0x6343[_0xfc254a];return _0x3bfbe3;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3634('0x0'));function checkNameSurname(_0x26d852,_0x53a78f,_0x518246){var _0x5a4621='';if(!_['isNil'](_0x53a78f)&&_0x3634('0x1')===typeof _0x53a78f){_0x5a4621+=_0x53a78f;}if(!_[_0x3634('0x2')](_0x518246)&&'string'===typeof _0x518246){_0x5a4621+='\x20'+_0x518246;}if(_0x5a4621!==''){return _0x5a4621;}return _0x26d852;}function Action(_0x247964,_0x388c18,_0x4bb496,_0x302828,_0xd40513){this['uniqueid']=_0x4bb496||undefined;this['idContact']=_0x247964['id'];this[_0x3634('0x3')]=_0x388c18[_0x3634('0x4')];this[_0x3634('0x5')]=_0x388c18[_0x3634('0x5')];this[_0x3634('0x6')]=_0x3634('0x3');this['dialAnswer']=![];this['membername']=_[_0x3634('0x2')](_0x247964[_0x3634('0x7')])?undefined:_0x247964['Agent'][_0x3634('0x4')];this[_0x3634('0x8')]=this[_0x3634('0x9')]?util[_0x3634('0xa')](_0x3634('0xb'),this[_0x3634('0x9')]):_0x302828||undefined;this[_0x3634('0xc')]=checkNameSurname(_0x247964[_0x3634('0xd')][_0x3634('0xe')],_0x247964[_0x3634('0xd')][_0x3634('0xf')],_0x247964[_0x3634('0xd')][_0x3634('0x10')]);this[_0x3634('0x11')]=_0x247964['active']||![];this[_0x3634('0x12')]=_0x247964['phone'];this[_0x3634('0x13')]=_0x247964[_0x3634('0x13')];this[_0x3634('0x14')]=_0x247964[_0x3634('0x14')]||0x0;this[_0x3634('0x15')]=_0x247964['countcongestionretry']||0x0;this[_0x3634('0x16')]=_0x247964['countnoanswerretry']||0x0;this['countglobal']=(_0x247964[_0x3634('0x14')]||0x0)+(_0x247964['countcongestionretry']||0x0)+(_0x247964[_0x3634('0x16')]||0x0)+(_0x247964[_0x3634('0x17')]||0x0)+(_0x247964[_0x3634('0x18')]||0x0)+(_0x247964['countabandonedretry']||0x0)+(_0x247964[_0x3634('0x19')]||0x0)+(_0x247964[_0x3634('0x1a')]||0x0);this['countnosuchnumberretry']=_0x247964[_0x3634('0x17')]||0x0;this['countdropretry']=_0x247964[_0x3634('0x18')]||0x0;this[_0x3634('0x1b')]=_0x247964['countabandonedretry']||0x0;this[_0x3634('0x19')]=_0x247964[_0x3634('0x19')]||0x0;this[_0x3634('0x1a')]=_0x247964['countagentrejectretry']||0x0;this[_0x3634('0x1c')]=_0x247964[_0x3634('0x1c')];this['callbackuniqueid']=_0x247964[_0x3634('0x1d')];this['callbackat']=_0x247964['callbackat'];this[_0x3634('0x1e')]=_0x247964[_0x3634('0x1e')];this['ContactId']=_0x247964[_0x3634('0x1f')];this[_0x3634('0x20')]=_0x247964[_0x3634('0x20')];this[_0x3634('0x21')]=_[_0x3634('0x2')](_0x247964[_0x3634('0x7')])?_0x247964[_0x3634('0x21')]:_0x247964[_0x3634('0x7')]['id'];this[_0x3634('0x22')]=_0x247964['VoiceQueueId'];this[_0x3634('0x23')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x3634('0xa')]('\x22%s\x22\x20<%s>',this[_0x3634('0xc')],this[_0x3634('0x24')]);};module['exports']=Action;