Built motion from commit (unavailable).|2.3.95
[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 _0x0c58=['recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','queue','dialAnswer','Agent','channelAgent','format','SIP/%s','membername','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat'];(function(_0x5b3e28,_0x2ad693){var _0x21a6f4=function(_0xea4216){while(--_0xea4216){_0x5b3e28['push'](_0x5b3e28['shift']());}};_0x21a6f4(++_0x2ad693);}(_0x0c58,0x152));var _0x80c5=function(_0x111f6c,_0xe54486){_0x111f6c=_0x111f6c-0x0;var _0x4c51af=_0x0c58[_0x111f6c];return _0x4c51af;};'use strict';var util=require(_0x80c5('0x0'));var _=require(_0x80c5('0x1'));var moment=require(_0x80c5('0x2'));function checkNameSurname(_0x196d2c,_0x50595a,_0x400b95){var _0x1d2703='';if(!_[_0x80c5('0x3')](_0x50595a)&&_0x80c5('0x4')===typeof _0x50595a){_0x1d2703+=_0x50595a;}if(!_[_0x80c5('0x3')](_0x400b95)&&_0x80c5('0x4')===typeof _0x400b95){_0x1d2703+='\x20'+_0x400b95;}if(_0x1d2703!==''){return _0x1d2703;}return _0x196d2c;}function Action(_0x5b5da9,_0x5d5919,_0x17dd09,_0x1685e3,_0x313fbd){this[_0x80c5('0x5')]=_0x17dd09||undefined;this[_0x80c5('0x6')]=_0x5b5da9['id'];this['queue']=_0x5d5919[_0x80c5('0x7')];this[_0x80c5('0x8')]=_0x5d5919[_0x80c5('0x8')];this['campaigntype']=_0x80c5('0x9');this[_0x80c5('0xa')]=![];this['membername']=_['isNil'](_0x5b5da9[_0x80c5('0xb')])?undefined:_0x5b5da9['Agent'][_0x80c5('0x7')];this[_0x80c5('0xc')]=this['membername']?util[_0x80c5('0xd')](_0x80c5('0xe'),this[_0x80c5('0xf')]):_0x1685e3||undefined;this[_0x80c5('0x10')]=checkNameSurname(_0x5b5da9[_0x80c5('0x11')]['phone'],_0x5b5da9[_0x80c5('0x11')][_0x80c5('0x12')],_0x5b5da9[_0x80c5('0x11')][_0x80c5('0x13')]);this[_0x80c5('0x14')]=_0x5b5da9['active']||![];this[_0x80c5('0x15')]=_0x5b5da9[_0x80c5('0x11')][_0x80c5('0x16')];this[_0x80c5('0x17')]=_0x5b5da9['scheduledat'];this[_0x80c5('0x18')]=_0x5b5da9[_0x80c5('0x18')]||0x0;this[_0x80c5('0x19')]=_0x5b5da9['countcongestionretry']||0x0;this[_0x80c5('0x1a')]=_0x5b5da9['countnoanswerretry']||0x0;this[_0x80c5('0x1b')]=(_0x5b5da9[_0x80c5('0x18')]||0x0)+(_0x5b5da9['countcongestionretry']||0x0)+(_0x5b5da9[_0x80c5('0x1a')]||0x0);this[_0x80c5('0x1c')]=_0x5b5da9[_0x80c5('0x1c')];this[_0x80c5('0x1d')]=_0x5b5da9[_0x80c5('0x1d')];this[_0x80c5('0x1e')]=_0x5b5da9[_0x80c5('0x1e')];this[_0x80c5('0x1f')]=_0x5b5da9[_0x80c5('0x1f')];this['ContactId']=_0x5b5da9[_0x80c5('0x20')];this[_0x80c5('0x21')]=_0x5b5da9[_0x80c5('0x21')];this['UserId']=_[_0x80c5('0x3')](_0x5b5da9[_0x80c5('0xb')])?_0x5b5da9[_0x80c5('0x22')]:_0x5b5da9['Agent']['id'];this[_0x80c5('0x23')]=_0x5b5da9[_0x80c5('0x23')];this[_0x80c5('0x24')]='';this[_0x80c5('0x25')]='';}Action['prototype'][_0x80c5('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x80c5('0x27')]);};module[_0x80c5('0x28')]=Action;