Built motion from commit 1fa89557.|2.6.10
[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 _0x51f9=['answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countglobal','countbusyretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51f9,0x1eb));var _0x951f=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x51f9[_0x295314];return _0x584b0c;};'use strict';var util=require(_0x951f('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x128087,_0x5bb784){var _0x554fab=moment(_0x128087)[_0x951f('0x1')](0x0);var _0x3a8340=moment(_0x5bb784)['milliseconds'](0x0);return _0x554fab['diff'](_0x3a8340,_0x951f('0x2'));}function AgentComplete(_0x1fe563,_0x13afb9){this[_0x951f('0x3')]=0x4;this[_0x951f('0x4')]='Answer';this[_0x951f('0x5')]=_0x1fe563[_0x951f('0x5')];this[_0x951f('0x6')]=_0x1fe563['type'];this[_0x951f('0x7')]=_0x1fe563['type']===_0x951f('0x8')?_0x951f('0x9'):_0x1fe563['type'];this['countbusyretry']=_0x1fe563['countbusyretry'];this[_0x951f('0xa')]=_0x1fe563['countcongestionretry'];this['countnoanswerretry']=_0x1fe563['countnoanswerretry'];this[_0x951f('0xb')]=_0x1fe563[_0x951f('0xc')]+_0x1fe563[_0x951f('0xa')]+_0x1fe563['countnoanswerretry']+_0x1fe563['countnosuchnumberretry']+_0x1fe563[_0x951f('0xd')]+_0x1fe563['countabandonedretry']+_0x1fe563[_0x951f('0xe')]+_0x1fe563[_0x951f('0xf')];this['countnosuchnumberretry']=_0x1fe563[_0x951f('0x10')];this[_0x951f('0xd')]=_0x1fe563['countdropretry'];this[_0x951f('0x11')]=_0x1fe563[_0x951f('0x11')];this['countmachineretry']=_0x1fe563[_0x951f('0xe')];this['countagentrejectretry']=_0x1fe563['countagentrejectretry'];this[_0x951f('0x12')]=_0x13afb9[_0x951f('0x12')];this[_0x951f('0x13')]=_0x1fe563[_0x951f('0x14')];this[_0x951f('0x15')]=_0x1fe563[_0x951f('0x16')];this[_0x951f('0x17')]=_0x1fe563[_0x951f('0x17')];this[_0x951f('0x18')]=_0x1fe563['responsetime'];this['answertime']=_0x1fe563[_0x951f('0x19')];this[_0x951f('0x1a')]=moment()['format'](_0x951f('0x1b'));this[_0x951f('0x1c')]=getSeconds(_0x1fe563[_0x951f('0x18')],_0x1fe563[_0x951f('0x17')]);this[_0x951f('0x1d')]=getSeconds(_0x1fe563[_0x951f('0x19')],_0x1fe563['responsetime']);this['talktime']=getSeconds(this['endtime'],_0x1fe563[_0x951f('0x19')]);this['queue']=_0x13afb9[_0x951f('0x9')];this[_0x951f('0x1e')]=_0x13afb9[_0x951f('0x1e')];this[_0x951f('0x1f')]=_0x13afb9[_0x951f('0x1f')];this[_0x951f('0x20')]=_0x1fe563[_0x951f('0x20')];this[_0x951f('0x21')]=_0x1fe563[_0x951f('0x21')];this[_0x951f('0x22')]=_0x1fe563[_0x951f('0x22')];this[_0x951f('0x23')]=_0x1fe563[_0x951f('0x23')];this[_0x951f('0x24')]=_0x1fe563['ContactId'];this['ListId']=_0x1fe563[_0x951f('0x25')];this[_0x951f('0x26')]=_0x1fe563[_0x951f('0x26')];this[_0x951f('0x27')]=_0x1fe563[_0x951f('0x27')];this[_0x951f('0x28')]=_0x1fe563[_0x951f('0x28')];this['originatecalleridnum']=_0x1fe563['originatecalleridnum']||'';this[_0x951f('0x29')]=_0x1fe563[_0x951f('0x29')]||'';}module[_0x951f('0x2a')]=AgentComplete;