Built motion from commit 7ab0e143.|2.5.49
[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 _0xd3e7=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countnosuchnumberretry','countabandonedretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid'];(function(_0x3fd204,_0x524c9c){var _0x34be3e=function(_0x5a22b8){while(--_0x5a22b8){_0x3fd204['push'](_0x3fd204['shift']());}};_0x34be3e(++_0x524c9c);}(_0xd3e7,0xb9));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x7d3e('0x0'));var _=require('lodash');var moment=require(_0x7d3e('0x1'));function getSeconds(_0x50f44d,_0x53df11){var _0x1d8d2b=moment(_0x50f44d)[_0x7d3e('0x2')](0x0);var _0x9a7155=moment(_0x53df11)[_0x7d3e('0x2')](0x0);return _0x1d8d2b['diff'](_0x9a7155,_0x7d3e('0x3'));}function AgentComplete(_0x272db9,_0x54d5cc){this[_0x7d3e('0x4')]=0x4;this[_0x7d3e('0x5')]='Answer';this[_0x7d3e('0x6')]=_0x272db9[_0x7d3e('0x6')];this[_0x7d3e('0x7')]=_0x272db9['type'];this[_0x7d3e('0x8')]=_0x272db9['type']===_0x7d3e('0x9')?_0x7d3e('0xa'):_0x272db9[_0x7d3e('0x7')];this['countbusyretry']=_0x272db9['countbusyretry'];this['countcongestionretry']=_0x272db9[_0x7d3e('0xb')];this[_0x7d3e('0xc')]=_0x272db9['countnoanswerretry'];this[_0x7d3e('0xd')]=_0x272db9[_0x7d3e('0xe')]+_0x272db9[_0x7d3e('0xb')]+_0x272db9[_0x7d3e('0xc')]+_0x272db9['countnosuchnumberretry']+_0x272db9[_0x7d3e('0xf')]+_0x272db9['countabandonedretry']+_0x272db9['countmachineretry']+_0x272db9['countagentrejectretry'];this['countnosuchnumberretry']=_0x272db9[_0x7d3e('0x10')];this['countdropretry']=_0x272db9[_0x7d3e('0xf')];this[_0x7d3e('0x11')]=_0x272db9[_0x7d3e('0x11')];this[_0x7d3e('0x12')]=_0x272db9[_0x7d3e('0x12')];this['countagentrejectretry']=_0x272db9['countagentrejectretry'];this[_0x7d3e('0x13')]=_0x54d5cc[_0x7d3e('0x13')];this['calleridname']=_0x272db9[_0x7d3e('0x14')];this[_0x7d3e('0x15')]=_0x272db9[_0x7d3e('0x16')];this[_0x7d3e('0x17')]=_0x272db9[_0x7d3e('0x17')];this[_0x7d3e('0x18')]=_0x272db9[_0x7d3e('0x18')];this[_0x7d3e('0x19')]=_0x272db9['answertime'];this[_0x7d3e('0x1a')]=moment()[_0x7d3e('0x1b')](_0x7d3e('0x1c'));this[_0x7d3e('0x1d')]=getSeconds(_0x272db9[_0x7d3e('0x18')],_0x272db9[_0x7d3e('0x17')]);this['holdtime']=getSeconds(_0x272db9[_0x7d3e('0x19')],_0x272db9[_0x7d3e('0x18')]);this[_0x7d3e('0x1e')]=getSeconds(this['endtime'],_0x272db9[_0x7d3e('0x19')]);this[_0x7d3e('0xa')]=_0x54d5cc[_0x7d3e('0xa')];this['membername']=_0x54d5cc[_0x7d3e('0x1f')];this['reason']=_0x54d5cc[_0x7d3e('0x20')];this[_0x7d3e('0x21')]=_0x272db9[_0x7d3e('0x21')];this[_0x7d3e('0x22')]=_0x272db9['callbackuniqueid'];this['callbackat']=_0x272db9[_0x7d3e('0x23')];this[_0x7d3e('0x24')]=_0x272db9[_0x7d3e('0x24')];this[_0x7d3e('0x25')]=_0x272db9['ContactId'];this[_0x7d3e('0x26')]=_0x272db9['ListId'];this[_0x7d3e('0x27')]=_0x272db9[_0x7d3e('0x27')];this[_0x7d3e('0x28')]=_0x272db9['VoiceQueueId'];this[_0x7d3e('0x29')]=_0x272db9[_0x7d3e('0x29')];this[_0x7d3e('0x2a')]=_0x272db9[_0x7d3e('0x2a')]||'';this[_0x7d3e('0x2b')]=_0x272db9[_0x7d3e('0x2b')]||'';}module['exports']=AgentComplete;