34f33788a55e5af6d54e11f599e3ef7007302db1
[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 _0xa8ca=['originatecalleridname','exports','util','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','responsetime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x34a86b,_0x1b99a5){var _0x2602d0=function(_0x13b479){while(--_0x13b479){_0x34a86b['push'](_0x34a86b['shift']());}};_0x2602d0(++_0x1b99a5);}(_0xa8ca,0x12b));var _0xaa8c=function(_0xe5cdca,_0x361fd5){_0xe5cdca=_0xe5cdca-0x0;var _0x49a08a=_0xa8ca[_0xe5cdca];return _0x49a08a;};'use strict';var util=require(_0xaa8c('0x0'));var _=require('lodash');var moment=require(_0xaa8c('0x1'));function getSeconds(_0x53c7aa,_0x45c417){var _0x4278c6=moment(_0x53c7aa)[_0xaa8c('0x2')](0x0);var _0x1f965d=moment(_0x45c417)[_0xaa8c('0x2')](0x0);return _0x4278c6[_0xaa8c('0x3')](_0x1f965d,'seconds');}function History(_0x36fdef){this[_0xaa8c('0x4')]=_0x36fdef['uniqueid'];this['scheduledat']=_0x36fdef[_0xaa8c('0x5')]||undefined;this[_0xaa8c('0x6')]=_0x36fdef['type'];this['campaigntype']=_0x36fdef['type']===_0xaa8c('0x7')?_0xaa8c('0x8'):_0x36fdef[_0xaa8c('0x6')];this[_0xaa8c('0x9')]=_0x36fdef[_0xaa8c('0x9')];this[_0xaa8c('0xa')]=_0x36fdef[_0xaa8c('0xa')];this[_0xaa8c('0xb')]=_0x36fdef[_0xaa8c('0xb')];this[_0xaa8c('0xc')]=_0x36fdef[_0xaa8c('0x9')]+_0x36fdef[_0xaa8c('0xa')]+_0x36fdef[_0xaa8c('0xb')]+_0x36fdef['countnosuchnumberretry']+_0x36fdef[_0xaa8c('0xd')]+_0x36fdef['countabandonedretry']+_0x36fdef[_0xaa8c('0xe')]+_0x36fdef[_0xaa8c('0xf')];this[_0xaa8c('0x10')]=_0x36fdef['countnosuchnumberretry'];this[_0xaa8c('0xd')]=_0x36fdef[_0xaa8c('0xd')];this['countabandonedretry']=_0x36fdef['countabandonedretry'];this[_0xaa8c('0xe')]=_0x36fdef[_0xaa8c('0xe')];this[_0xaa8c('0xf')]=_0x36fdef[_0xaa8c('0xf')];this[_0xaa8c('0x8')]=_0x36fdef['queue'];this[_0xaa8c('0x11')]=_0x36fdef[_0xaa8c('0x12')];this['calleridnum']=_0x36fdef['number'];this['starttime']=_0x36fdef['starttime'];this[_0xaa8c('0x13')]=_0x36fdef[_0xaa8c('0x13')];this['endtime']=_0x36fdef[_0xaa8c('0x13')];this[_0xaa8c('0x14')]=getSeconds(_0x36fdef[_0xaa8c('0x13')],_0x36fdef['starttime']);this['holdtime']=0x0;this['talktime']=0x0;this[_0xaa8c('0x15')]=_0x36fdef[_0xaa8c('0x15')];this[_0xaa8c('0x16')]=_0x36fdef[_0xaa8c('0x16')];this[_0xaa8c('0x17')]=_0x36fdef[_0xaa8c('0x17')];this['recallme']=_0x36fdef[_0xaa8c('0x18')];this[_0xaa8c('0x19')]=_0x36fdef[_0xaa8c('0x19')];this['ListId']=_0x36fdef[_0xaa8c('0x1a')];this[_0xaa8c('0x1b')]=_0x36fdef[_0xaa8c('0x1b')];this[_0xaa8c('0x1c')]=_0x36fdef['VoiceQueueId'];this[_0xaa8c('0x1d')]=_0x36fdef[_0xaa8c('0x1d')];this[_0xaa8c('0x1e')]=_0x36fdef[_0xaa8c('0x1e')]||'';this[_0xaa8c('0x1f')]=_0x36fdef['originatecalleridname']||'';}module[_0xaa8c('0x20')]=History;