Built motion from commit (unavailable).|2.5.0
[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 _0x0590=['lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','queue','calleridname','name','starttime','endtime','responsetime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x53b7d2,_0x334640){var _0x38d64a=function(_0x22db72){while(--_0x22db72){_0x53b7d2['push'](_0x53b7d2['shift']());}};_0x38d64a(++_0x334640);}(_0x0590,0x1d3));var _0x0059=function(_0x1a3326,_0x26c35a){_0x1a3326=_0x1a3326-0x0;var _0x1895a3=_0x0590[_0x1a3326];return _0x1895a3;};'use strict';var util=require(_0x0059('0x0'));var _=require(_0x0059('0x1'));var moment=require('moment');function getSeconds(_0x2fbd91,_0x909e1f){var _0x63464d=moment(_0x2fbd91)[_0x0059('0x2')](0x0);var _0x5b1297=moment(_0x909e1f)['milliseconds'](0x0);return _0x63464d['diff'](_0x5b1297,_0x0059('0x3'));}function History(_0x3ca87d){this[_0x0059('0x4')]=_0x3ca87d['uniqueid'];this[_0x0059('0x5')]=_0x3ca87d[_0x0059('0x5')]||undefined;this[_0x0059('0x6')]=_0x3ca87d[_0x0059('0x6')];this[_0x0059('0x7')]=_0x3ca87d[_0x0059('0x6')]==='outbound'?'queue':_0x3ca87d[_0x0059('0x6')];this[_0x0059('0x8')]=_0x3ca87d['countbusyretry'];this[_0x0059('0x9')]=_0x3ca87d[_0x0059('0x9')];this[_0x0059('0xa')]=_0x3ca87d[_0x0059('0xa')];this[_0x0059('0xb')]=_0x3ca87d['countbusyretry']+_0x3ca87d['countcongestionretry']+_0x3ca87d[_0x0059('0xa')]+_0x3ca87d['countnosuchnumberretry']+_0x3ca87d[_0x0059('0xc')]+_0x3ca87d[_0x0059('0xd')]+_0x3ca87d[_0x0059('0xe')]+_0x3ca87d['countagentrejectretry'];this['countnosuchnumberretry']=_0x3ca87d[_0x0059('0xf')];this[_0x0059('0xc')]=_0x3ca87d[_0x0059('0xc')];this['countabandonedretry']=_0x3ca87d[_0x0059('0xd')];this[_0x0059('0xe')]=_0x3ca87d[_0x0059('0xe')];this[_0x0059('0x10')]=_0x3ca87d[_0x0059('0x10')];this[_0x0059('0x11')]=_0x3ca87d[_0x0059('0x11')];this[_0x0059('0x12')]=_0x3ca87d[_0x0059('0x13')];this['calleridnum']=_0x3ca87d['number'];this[_0x0059('0x14')]=_0x3ca87d[_0x0059('0x14')];this['responsetime']=_0x3ca87d['responsetime'];this[_0x0059('0x15')]=_0x3ca87d[_0x0059('0x16')];this['ringtime']=getSeconds(_0x3ca87d[_0x0059('0x16')],_0x3ca87d[_0x0059('0x14')]);this['holdtime']=0x0;this[_0x0059('0x17')]=0x0;this[_0x0059('0x18')]=_0x3ca87d[_0x0059('0x18')];this['callbackuniqueid']=_0x3ca87d[_0x0059('0x19')];this['callbackat']=_0x3ca87d[_0x0059('0x1a')];this[_0x0059('0x1b')]=_0x3ca87d[_0x0059('0x1b')];this[_0x0059('0x1c')]=_0x3ca87d['ContactId'];this[_0x0059('0x1d')]=_0x3ca87d[_0x0059('0x1d')];this[_0x0059('0x1e')]=_0x3ca87d['UserId'];this[_0x0059('0x1f')]=_0x3ca87d[_0x0059('0x1f')];this[_0x0059('0x20')]=_0x3ca87d['CampaignId'];this[_0x0059('0x21')]=_0x3ca87d[_0x0059('0x21')]||'';this['originatecalleridname']=_0x3ca87d[_0x0059('0x22')]||'';}module[_0x0059('0x23')]=History;