Built motion from commit c116dc8b.|2.6.30
[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 _0x955f=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','exports','util','lodash','moment','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','format','membername','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry'];(function(_0x13d130,_0x5c9dc1){var _0x52df35=function(_0x3806a0){while(--_0x3806a0){_0x13d130['push'](_0x13d130['shift']());}};_0x52df35(++_0x5c9dc1);}(_0x955f,0x1eb));var _0xf955=function(_0x4d5408,_0x284bd2){_0x4d5408=_0x4d5408-0x0;var _0x3df6d6=_0x955f[_0x4d5408];return _0x3df6d6;};'use strict';var util=require(_0xf955('0x0'));var _=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));function checkNameSurname(_0x382225,_0x2834f7,_0x585f6e){var _0xd75c8f='';if(!_['isNil'](_0x2834f7)&&'string'===typeof _0x2834f7){_0xd75c8f+=_0x2834f7;}if(!_[_0xf955('0x3')](_0x585f6e)&&'string'===typeof _0x585f6e){_0xd75c8f+='\x20'+_0x585f6e;}if(_0xd75c8f!==''){return _0xd75c8f;}return _0x382225;}function Action(_0x13b796,_0x2caff2,_0x3fdac2,_0x59d5b3,_0x18432f){this[_0xf955('0x4')]=_0x3fdac2||undefined;this['idContact']=_0x13b796['id'];this[_0xf955('0x5')]=_0x2caff2[_0xf955('0x6')];this[_0xf955('0x7')]=_0x2caff2[_0xf955('0x7')];this[_0xf955('0x8')]=_0xf955('0x5');this[_0xf955('0x9')]=![];this['membername']=_[_0xf955('0x3')](_0x13b796['Agent'])?undefined:_0x13b796[_0xf955('0xa')][_0xf955('0x6')];this[_0xf955('0xb')]=this['membername']?util[_0xf955('0xc')]('SIP/%s',this[_0xf955('0xd')]):_0x59d5b3||undefined;this['calleridname']=checkNameSurname(_0x13b796[_0xf955('0xe')][_0xf955('0xf')],_0x13b796[_0xf955('0xe')][_0xf955('0x10')],_0x13b796[_0xf955('0xe')][_0xf955('0x11')]);this[_0xf955('0x12')]=_0x13b796[_0xf955('0x12')]||![];this[_0xf955('0x13')]=_0x13b796[_0xf955('0xf')];this['scheduledat']=_0x13b796[_0xf955('0x14')];this['countbusyretry']=_0x13b796[_0xf955('0x15')]||0x0;this[_0xf955('0x16')]=_0x13b796[_0xf955('0x16')]||0x0;this[_0xf955('0x17')]=_0x13b796['countnoanswerretry']||0x0;this['countglobal']=(_0x13b796[_0xf955('0x15')]||0x0)+(_0x13b796[_0xf955('0x16')]||0x0)+(_0x13b796[_0xf955('0x17')]||0x0)+(_0x13b796['countnosuchnumberretry']||0x0)+(_0x13b796[_0xf955('0x18')]||0x0)+(_0x13b796[_0xf955('0x19')]||0x0)+(_0x13b796[_0xf955('0x1a')]||0x0)+(_0x13b796[_0xf955('0x1b')]||0x0);this[_0xf955('0x1c')]=_0x13b796['countnosuchnumberretry']||0x0;this[_0xf955('0x18')]=_0x13b796[_0xf955('0x18')]||0x0;this[_0xf955('0x19')]=_0x13b796['countabandonedretry']||0x0;this[_0xf955('0x1a')]=_0x13b796['countmachineretry']||0x0;this[_0xf955('0x1b')]=_0x13b796[_0xf955('0x1b')]||0x0;this[_0xf955('0x1d')]=_0x13b796[_0xf955('0x1d')];this[_0xf955('0x1e')]=_0x13b796['callbackuniqueid'];this[_0xf955('0x1f')]=_0x13b796[_0xf955('0x1f')];this[_0xf955('0x20')]=_0x13b796[_0xf955('0x20')];this[_0xf955('0x21')]=_0x13b796[_0xf955('0x21')];this[_0xf955('0x22')]=_0x13b796['ListId'];this[_0xf955('0x23')]=_[_0xf955('0x3')](_0x13b796[_0xf955('0xa')])?_0x13b796[_0xf955('0x23')]:_0x13b796[_0xf955('0xa')]['id'];this[_0xf955('0x24')]=_0x13b796[_0xf955('0x24')];this['originatecalleridnum']='';this[_0xf955('0x25')]='';}Action[_0xf955('0x26')][_0xf955('0x27')]=function(){return util[_0xf955('0xc')](_0xf955('0x28'),this[_0xf955('0x29')],this['number']);};module[_0xf955('0x2a')]=Action;