c6cbdcc61602ac4ae89df158216c10eac0c256b4
[motion2.git] / server / services / ami / dialer / agentComplete.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 _0x89fd=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','statedesc','Answer'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x89fd,0x113));var _0xd89f=function(_0x2ddd8f,_0x3a05cf){_0x2ddd8f=_0x2ddd8f-0x0;var _0x405d6f=_0x89fd[_0x2ddd8f];return _0x405d6f;};'use strict';var util=require('util');var _=require(_0xd89f('0x0'));var moment=require(_0xd89f('0x1'));function getSeconds(_0xb20231,_0x7e9848){var _0x376539=moment(_0xb20231)[_0xd89f('0x2')](0x0);var _0x2c77d6=moment(_0x7e9848)[_0xd89f('0x2')](0x0);return _0x376539[_0xd89f('0x3')](_0x2c77d6,_0xd89f('0x4'));}function AgentComplete(_0x3a0350,_0x25481d){this['state']=0x4;this[_0xd89f('0x5')]=_0xd89f('0x6');this['scheduledat']=_0x3a0350[_0xd89f('0x7')];this['type']=_0x3a0350[_0xd89f('0x8')];this[_0xd89f('0x9')]=_0x3a0350[_0xd89f('0x8')]===_0xd89f('0xa')?_0xd89f('0xb'):_0x3a0350[_0xd89f('0x8')];this[_0xd89f('0xc')]=_0x3a0350[_0xd89f('0xc')];this[_0xd89f('0xd')]=_0x3a0350['countcongestionretry'];this['countnoanswerretry']=_0x3a0350[_0xd89f('0xe')];this[_0xd89f('0xf')]=_0x3a0350[_0xd89f('0xc')]+_0x3a0350[_0xd89f('0xd')]+_0x3a0350[_0xd89f('0xe')]+_0x3a0350[_0xd89f('0x10')]+_0x3a0350[_0xd89f('0x11')]+_0x3a0350[_0xd89f('0x12')]+_0x3a0350['countmachineretry']+_0x3a0350['countagentrejectretry'];this['countnosuchnumberretry']=_0x3a0350[_0xd89f('0x10')];this['countdropretry']=_0x3a0350[_0xd89f('0x11')];this[_0xd89f('0x12')]=_0x3a0350[_0xd89f('0x12')];this[_0xd89f('0x13')]=_0x3a0350[_0xd89f('0x13')];this[_0xd89f('0x14')]=_0x3a0350[_0xd89f('0x14')];this[_0xd89f('0x15')]=_0x25481d[_0xd89f('0x15')];this[_0xd89f('0x16')]=_0x3a0350[_0xd89f('0x17')];this['calleridnum']=_0x3a0350[_0xd89f('0x18')];this['starttime']=_0x3a0350[_0xd89f('0x19')];this[_0xd89f('0x1a')]=_0x3a0350[_0xd89f('0x1a')];this[_0xd89f('0x1b')]=_0x3a0350[_0xd89f('0x1b')];this[_0xd89f('0x1c')]=moment()[_0xd89f('0x1d')](_0xd89f('0x1e'));this[_0xd89f('0x1f')]=getSeconds(_0x3a0350['responsetime'],_0x3a0350['starttime']);this[_0xd89f('0x20')]=getSeconds(_0x3a0350[_0xd89f('0x1b')],_0x3a0350['responsetime']);this['talktime']=getSeconds(this[_0xd89f('0x1c')],_0x3a0350[_0xd89f('0x1b')]);this[_0xd89f('0xb')]=_0x25481d[_0xd89f('0xb')];this[_0xd89f('0x21')]=_0x25481d[_0xd89f('0x21')];this[_0xd89f('0x22')]=_0x25481d[_0xd89f('0x22')];this[_0xd89f('0x23')]=_0x3a0350[_0xd89f('0x23')];this[_0xd89f('0x24')]=_0x3a0350[_0xd89f('0x24')];this['callbackat']=_0x3a0350[_0xd89f('0x25')];this[_0xd89f('0x26')]=_0x3a0350['recallme'];this[_0xd89f('0x27')]=_0x3a0350['ContactId'];this[_0xd89f('0x28')]=_0x3a0350['ListId'];this['UserId']=_0x3a0350[_0xd89f('0x29')];this[_0xd89f('0x2a')]=_0x3a0350[_0xd89f('0x2a')];this[_0xd89f('0x2b')]=_0x3a0350[_0xd89f('0x2b')];this[_0xd89f('0x2c')]=_0x3a0350[_0xd89f('0x2c')]||'';this['originatecalleridname']=_0x3a0350[_0xd89f('0x2d')]||'';}module[_0xd89f('0x2e')]=AgentComplete;