Built motion from commit cf5ff673.|2.5.41
[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 _0x25a9=['uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','ringtime','holdtime','answertime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','state','statedesc','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x25a9,0xf1));var _0x925a=function(_0x5a6da9,_0x32df4d){_0x5a6da9=_0x5a6da9-0x0;var _0x29d30f=_0x25a9[_0x5a6da9];return _0x29d30f;};'use strict';var util=require('util');var _=require(_0x925a('0x0'));var moment=require(_0x925a('0x1'));function getSeconds(_0x345707,_0x3052f3){var _0x6114d9=moment(_0x345707)['milliseconds'](0x0);var _0x240e80=moment(_0x3052f3)[_0x925a('0x2')](0x0);return _0x6114d9['diff'](_0x240e80,'seconds');}function AgentComplete(_0x9f96e2,_0x5271bc){this[_0x925a('0x3')]=0x4;this[_0x925a('0x4')]=_0x925a('0x5');this[_0x925a('0x6')]=_0x9f96e2[_0x925a('0x6')];this[_0x925a('0x7')]=_0x9f96e2[_0x925a('0x7')];this['campaigntype']=_0x9f96e2[_0x925a('0x7')]==='outbound'?'queue':_0x9f96e2['type'];this[_0x925a('0x8')]=_0x9f96e2['countbusyretry'];this[_0x925a('0x9')]=_0x9f96e2[_0x925a('0x9')];this[_0x925a('0xa')]=_0x9f96e2[_0x925a('0xa')];this[_0x925a('0xb')]=_0x9f96e2[_0x925a('0x8')]+_0x9f96e2['countcongestionretry']+_0x9f96e2[_0x925a('0xa')]+_0x9f96e2[_0x925a('0xc')]+_0x9f96e2[_0x925a('0xd')]+_0x9f96e2[_0x925a('0xe')]+_0x9f96e2[_0x925a('0xf')]+_0x9f96e2[_0x925a('0x10')];this[_0x925a('0xc')]=_0x9f96e2['countnosuchnumberretry'];this[_0x925a('0xd')]=_0x9f96e2[_0x925a('0xd')];this[_0x925a('0xe')]=_0x9f96e2[_0x925a('0xe')];this['countmachineretry']=_0x9f96e2[_0x925a('0xf')];this[_0x925a('0x10')]=_0x9f96e2['countagentrejectretry'];this[_0x925a('0x11')]=_0x5271bc[_0x925a('0x11')];this[_0x925a('0x12')]=_0x9f96e2[_0x925a('0x13')];this['calleridnum']=_0x9f96e2[_0x925a('0x14')];this[_0x925a('0x15')]=_0x9f96e2[_0x925a('0x15')];this[_0x925a('0x16')]=_0x9f96e2[_0x925a('0x16')];this['answertime']=_0x9f96e2['answertime'];this[_0x925a('0x17')]=moment()[_0x925a('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x925a('0x19')]=getSeconds(_0x9f96e2[_0x925a('0x16')],_0x9f96e2[_0x925a('0x15')]);this[_0x925a('0x1a')]=getSeconds(_0x9f96e2[_0x925a('0x1b')],_0x9f96e2[_0x925a('0x16')]);this[_0x925a('0x1c')]=getSeconds(this[_0x925a('0x17')],_0x9f96e2['answertime']);this[_0x925a('0x1d')]=_0x5271bc[_0x925a('0x1d')];this[_0x925a('0x1e')]=_0x5271bc['membername'];this[_0x925a('0x1f')]=_0x5271bc[_0x925a('0x1f')];this['callback']=_0x9f96e2[_0x925a('0x20')];this['callbackuniqueid']=_0x9f96e2[_0x925a('0x21')];this[_0x925a('0x22')]=_0x9f96e2[_0x925a('0x22')];this[_0x925a('0x23')]=_0x9f96e2[_0x925a('0x23')];this[_0x925a('0x24')]=_0x9f96e2[_0x925a('0x24')];this[_0x925a('0x25')]=_0x9f96e2[_0x925a('0x25')];this[_0x925a('0x26')]=_0x9f96e2['UserId'];this[_0x925a('0x27')]=_0x9f96e2[_0x925a('0x27')];this[_0x925a('0x28')]=_0x9f96e2[_0x925a('0x28')];this['originatecalleridnum']=_0x9f96e2[_0x925a('0x29')]||'';this['originatecalleridname']=_0x9f96e2[_0x925a('0x2a')]||'';}module['exports']=AgentComplete;