Built motion from commit 497d3d92.|2.5.43
[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 _0x9ee1=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','queue','membername','reason','callback'];(function(_0x2abc92,_0x366783){var _0x4ab169=function(_0x13ccb4){while(--_0x13ccb4){_0x2abc92['push'](_0x2abc92['shift']());}};_0x4ab169(++_0x366783);}(_0x9ee1,0x69));var _0x19ee=function(_0x10e78e,_0x3fed3b){_0x10e78e=_0x10e78e-0x0;var _0x208f0f=_0x9ee1[_0x10e78e];return _0x208f0f;};'use strict';var util=require(_0x19ee('0x0'));var _=require(_0x19ee('0x1'));var moment=require(_0x19ee('0x2'));function getSeconds(_0x3ff747,_0x1fc4e8){var _0x4b1368=moment(_0x3ff747)['milliseconds'](0x0);var _0x3abcd2=moment(_0x1fc4e8)[_0x19ee('0x3')](0x0);return _0x4b1368[_0x19ee('0x4')](_0x3abcd2,_0x19ee('0x5'));}function AgentComplete(_0x233362,_0x366e9a){this[_0x19ee('0x6')]=0x4;this[_0x19ee('0x7')]='Answer';this[_0x19ee('0x8')]=_0x233362[_0x19ee('0x8')];this[_0x19ee('0x9')]=_0x233362[_0x19ee('0x9')];this[_0x19ee('0xa')]=_0x233362[_0x19ee('0x9')]===_0x19ee('0xb')?'queue':_0x233362[_0x19ee('0x9')];this[_0x19ee('0xc')]=_0x233362['countbusyretry'];this['countcongestionretry']=_0x233362[_0x19ee('0xd')];this[_0x19ee('0xe')]=_0x233362[_0x19ee('0xe')];this[_0x19ee('0xf')]=_0x233362[_0x19ee('0xc')]+_0x233362['countcongestionretry']+_0x233362['countnoanswerretry']+_0x233362[_0x19ee('0x10')]+_0x233362[_0x19ee('0x11')]+_0x233362['countabandonedretry']+_0x233362[_0x19ee('0x12')]+_0x233362[_0x19ee('0x13')];this[_0x19ee('0x10')]=_0x233362[_0x19ee('0x10')];this[_0x19ee('0x11')]=_0x233362[_0x19ee('0x11')];this[_0x19ee('0x14')]=_0x233362[_0x19ee('0x14')];this[_0x19ee('0x12')]=_0x233362[_0x19ee('0x12')];this[_0x19ee('0x13')]=_0x233362[_0x19ee('0x13')];this[_0x19ee('0x15')]=_0x366e9a[_0x19ee('0x15')];this[_0x19ee('0x16')]=_0x233362[_0x19ee('0x17')];this[_0x19ee('0x18')]=_0x233362[_0x19ee('0x19')];this[_0x19ee('0x1a')]=_0x233362['starttime'];this[_0x19ee('0x1b')]=_0x233362[_0x19ee('0x1b')];this[_0x19ee('0x1c')]=_0x233362[_0x19ee('0x1c')];this[_0x19ee('0x1d')]=moment()['format'](_0x19ee('0x1e'));this[_0x19ee('0x1f')]=getSeconds(_0x233362[_0x19ee('0x1b')],_0x233362[_0x19ee('0x1a')]);this['holdtime']=getSeconds(_0x233362['answertime'],_0x233362[_0x19ee('0x1b')]);this['talktime']=getSeconds(this[_0x19ee('0x1d')],_0x233362[_0x19ee('0x1c')]);this[_0x19ee('0x20')]=_0x366e9a[_0x19ee('0x20')];this[_0x19ee('0x21')]=_0x366e9a[_0x19ee('0x21')];this['reason']=_0x366e9a[_0x19ee('0x22')];this[_0x19ee('0x23')]=_0x233362[_0x19ee('0x23')];this[_0x19ee('0x24')]=_0x233362['callbackuniqueid'];this[_0x19ee('0x25')]=_0x233362[_0x19ee('0x25')];this[_0x19ee('0x26')]=_0x233362[_0x19ee('0x26')];this[_0x19ee('0x27')]=_0x233362[_0x19ee('0x27')];this[_0x19ee('0x28')]=_0x233362[_0x19ee('0x28')];this[_0x19ee('0x29')]=_0x233362[_0x19ee('0x29')];this[_0x19ee('0x2a')]=_0x233362['VoiceQueueId'];this[_0x19ee('0x2b')]=_0x233362[_0x19ee('0x2b')];this[_0x19ee('0x2c')]=_0x233362[_0x19ee('0x2c')]||'';this[_0x19ee('0x2d')]=_0x233362[_0x19ee('0x2d')]||'';}module[_0x19ee('0x2e')]=AgentComplete;