d8324012c7d2a818039422db40f86de1f295fc2b
[motion2.git] / server / services / ami / dialer / history.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 _0x49d7=['number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','queue','name'];(function(_0x2ed53d,_0xbdf342){var _0x5ad3be=function(_0x32e0c){while(--_0x32e0c){_0x2ed53d['push'](_0x2ed53d['shift']());}};_0x5ad3be(++_0xbdf342);}(_0x49d7,0x133));var _0x749d=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x49d7[_0x425716];return _0x2d39af;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x749d('0x0'));function getSeconds(_0x4c58db,_0x40c222){var _0x1ebdda=moment(_0x4c58db)[_0x749d('0x1')](0x0);var _0xd20713=moment(_0x40c222)['milliseconds'](0x0);return _0x1ebdda['diff'](_0xd20713,'seconds');}function History(_0x9f2015){this[_0x749d('0x2')]=_0x9f2015[_0x749d('0x2')];this[_0x749d('0x3')]=_0x9f2015[_0x749d('0x3')]||undefined;this[_0x749d('0x4')]=_0x9f2015[_0x749d('0x4')];this[_0x749d('0x5')]=_0x9f2015['type']==='outbound'?'queue':_0x9f2015['type'];this[_0x749d('0x6')]=_0x9f2015[_0x749d('0x6')];this[_0x749d('0x7')]=_0x9f2015['countcongestionretry'];this[_0x749d('0x8')]=_0x9f2015[_0x749d('0x8')];this[_0x749d('0x9')]=_0x9f2015['countbusyretry']+_0x9f2015[_0x749d('0x7')]+_0x9f2015[_0x749d('0x8')]+_0x9f2015[_0x749d('0xa')]+_0x9f2015[_0x749d('0xb')]+_0x9f2015[_0x749d('0xc')]+_0x9f2015['countmachineretry']+_0x9f2015[_0x749d('0xd')];this[_0x749d('0xa')]=_0x9f2015[_0x749d('0xa')];this[_0x749d('0xb')]=_0x9f2015[_0x749d('0xb')];this[_0x749d('0xc')]=_0x9f2015[_0x749d('0xc')];this[_0x749d('0xe')]=_0x9f2015['countmachineretry'];this[_0x749d('0xd')]=_0x9f2015[_0x749d('0xd')];this['queue']=_0x9f2015[_0x749d('0xf')];this['calleridname']=_0x9f2015[_0x749d('0x10')];this['calleridnum']=_0x9f2015[_0x749d('0x11')];this[_0x749d('0x12')]=_0x9f2015['starttime'];this[_0x749d('0x13')]=_0x9f2015[_0x749d('0x13')];this[_0x749d('0x14')]=_0x9f2015['responsetime'];this[_0x749d('0x15')]=getSeconds(_0x9f2015['responsetime'],_0x9f2015['starttime']);this[_0x749d('0x16')]=0x0;this[_0x749d('0x17')]=0x0;this[_0x749d('0x18')]=_0x9f2015[_0x749d('0x18')];this['callbackuniqueid']=_0x9f2015[_0x749d('0x19')];this[_0x749d('0x1a')]=_0x9f2015[_0x749d('0x1a')];this[_0x749d('0x1b')]=_0x9f2015['recallme'];this[_0x749d('0x1c')]=_0x9f2015[_0x749d('0x1c')];this[_0x749d('0x1d')]=_0x9f2015[_0x749d('0x1d')];this[_0x749d('0x1e')]=_0x9f2015[_0x749d('0x1e')];this['VoiceQueueId']=_0x9f2015[_0x749d('0x1f')];this[_0x749d('0x20')]=_0x9f2015['CampaignId'];this[_0x749d('0x21')]=_0x9f2015[_0x749d('0x21')]||'';this[_0x749d('0x22')]=_0x9f2015['originatecalleridname']||'';}module[_0x749d('0x23')]=History;