Built motion from commit (unavailable).|2.4.18
[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 _0xaef7=['recallme','ContactId','ListId','UserId','VoiceQueueId','getCaller','number','exports','util','lodash','moment','string','isNil','uniqueid','idContact','queue','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat'];(function(_0x3c3b8b,_0x84aac8){var _0x1d3296=function(_0x3e826e){while(--_0x3e826e){_0x3c3b8b['push'](_0x3c3b8b['shift']());}};_0x1d3296(++_0x84aac8);}(_0xaef7,0x130));var _0x7aef=function(_0x5d1c9d,_0x8bb82d){_0x5d1c9d=_0x5d1c9d-0x0;var _0x8edfe4=_0xaef7[_0x5d1c9d];return _0x8edfe4;};'use strict';var util=require(_0x7aef('0x0'));var _=require(_0x7aef('0x1'));var moment=require(_0x7aef('0x2'));function checkNameSurname(_0x5d233e,_0x2116ef,_0x4a61b5){var _0xb386ea='';if(!_['isNil'](_0x2116ef)&&_0x7aef('0x3')===typeof _0x2116ef){_0xb386ea+=_0x2116ef;}if(!_[_0x7aef('0x4')](_0x4a61b5)&&'string'===typeof _0x4a61b5){_0xb386ea+='\x20'+_0x4a61b5;}if(_0xb386ea!==''){return _0xb386ea;}return _0x5d233e;}function Action(_0x11d6a0,_0x447314,_0x5b0a52,_0x5e6f4f,_0x3a2942){this[_0x7aef('0x5')]=_0x5b0a52||undefined;this[_0x7aef('0x6')]=_0x11d6a0['id'];this[_0x7aef('0x7')]=_0x447314['name'];this[_0x7aef('0x8')]=_0x447314[_0x7aef('0x8')];this[_0x7aef('0x9')]=_0x7aef('0x7');this['dialAnswer']=![];this[_0x7aef('0xa')]=_[_0x7aef('0x4')](_0x11d6a0['Agent'])?undefined:_0x11d6a0[_0x7aef('0xb')]['name'];this[_0x7aef('0xc')]=this['membername']?util[_0x7aef('0xd')](_0x7aef('0xe'),this[_0x7aef('0xa')]):_0x5e6f4f||undefined;this[_0x7aef('0xf')]=checkNameSurname(_0x11d6a0[_0x7aef('0x10')][_0x7aef('0x11')],_0x11d6a0['Contact']['firstName'],_0x11d6a0[_0x7aef('0x10')][_0x7aef('0x12')]);this[_0x7aef('0x13')]=_0x11d6a0[_0x7aef('0x13')]||![];this[_0x7aef('0x14')]=_0x11d6a0[_0x7aef('0x10')][_0x7aef('0x11')];this[_0x7aef('0x15')]=_0x11d6a0[_0x7aef('0x15')];this[_0x7aef('0x16')]=_0x11d6a0[_0x7aef('0x16')]||0x0;this[_0x7aef('0x17')]=_0x11d6a0[_0x7aef('0x17')]||0x0;this[_0x7aef('0x18')]=_0x11d6a0['countnoanswerretry']||0x0;this[_0x7aef('0x19')]=(_0x11d6a0[_0x7aef('0x16')]||0x0)+(_0x11d6a0[_0x7aef('0x17')]||0x0)+(_0x11d6a0[_0x7aef('0x18')]||0x0);this[_0x7aef('0x1a')]=_0x11d6a0[_0x7aef('0x1a')];this[_0x7aef('0x1b')]=_0x11d6a0['callbackuniqueid'];this[_0x7aef('0x1c')]=_0x11d6a0['callbackat'];this[_0x7aef('0x1d')]=_0x11d6a0[_0x7aef('0x1d')];this[_0x7aef('0x1e')]=_0x11d6a0[_0x7aef('0x1e')];this[_0x7aef('0x1f')]=_0x11d6a0[_0x7aef('0x1f')];this[_0x7aef('0x20')]=_[_0x7aef('0x4')](_0x11d6a0[_0x7aef('0xb')])?_0x11d6a0[_0x7aef('0x20')]:_0x11d6a0[_0x7aef('0xb')]['id'];this[_0x7aef('0x21')]=_0x11d6a0[_0x7aef('0x21')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype'][_0x7aef('0x22')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x7aef('0xf')],this[_0x7aef('0x23')]);};module[_0x7aef('0x24')]=Action;