Built motion from commit f7863d46.|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 _0x9568=['talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','answertime'];(function(_0x578291,_0x108c14){var _0x3910b0=function(_0x1072cb){while(--_0x1072cb){_0x578291['push'](_0x578291['shift']());}};_0x3910b0(++_0x108c14);}(_0x9568,0xc7));var _0x8956=function(_0x40e83f,_0x4f467a){_0x40e83f=_0x40e83f-0x0;var _0x17207f=_0x9568[_0x40e83f];return _0x17207f;};'use strict';var util=require(_0x8956('0x0'));var _=require(_0x8956('0x1'));var moment=require(_0x8956('0x2'));function getSeconds(_0x366f18,_0x31185d){var _0x5c43e7=moment(_0x366f18)['milliseconds'](0x0);var _0xb79c63=moment(_0x31185d)[_0x8956('0x3')](0x0);return _0x5c43e7['diff'](_0xb79c63,_0x8956('0x4'));}function AgentComplete(_0x506067,_0x3bc61b){this[_0x8956('0x5')]=0x4;this[_0x8956('0x6')]='Answer';this[_0x8956('0x7')]=_0x506067['scheduledat'];this[_0x8956('0x8')]=_0x506067[_0x8956('0x8')];this[_0x8956('0x9')]=_0x506067[_0x8956('0x8')]==='outbound'?_0x8956('0xa'):_0x506067[_0x8956('0x8')];this[_0x8956('0xb')]=_0x506067['countbusyretry'];this['countcongestionretry']=_0x506067[_0x8956('0xc')];this['countnoanswerretry']=_0x506067[_0x8956('0xd')];this[_0x8956('0xe')]=_0x506067['countbusyretry']+_0x506067[_0x8956('0xc')]+_0x506067[_0x8956('0xd')]+_0x506067[_0x8956('0xf')]+_0x506067[_0x8956('0x10')]+_0x506067[_0x8956('0x11')]+_0x506067[_0x8956('0x12')]+_0x506067[_0x8956('0x13')];this[_0x8956('0xf')]=_0x506067[_0x8956('0xf')];this[_0x8956('0x10')]=_0x506067[_0x8956('0x10')];this[_0x8956('0x11')]=_0x506067['countabandonedretry'];this[_0x8956('0x12')]=_0x506067[_0x8956('0x12')];this['countagentrejectretry']=_0x506067[_0x8956('0x13')];this['uniqueid']=_0x3bc61b[_0x8956('0x14')];this['calleridname']=_0x506067['name'];this[_0x8956('0x15')]=_0x506067[_0x8956('0x16')];this[_0x8956('0x17')]=_0x506067[_0x8956('0x17')];this[_0x8956('0x18')]=_0x506067[_0x8956('0x18')];this['answertime']=_0x506067['answertime'];this[_0x8956('0x19')]=moment()[_0x8956('0x1a')](_0x8956('0x1b'));this[_0x8956('0x1c')]=getSeconds(_0x506067['responsetime'],_0x506067[_0x8956('0x17')]);this[_0x8956('0x1d')]=getSeconds(_0x506067[_0x8956('0x1e')],_0x506067[_0x8956('0x18')]);this[_0x8956('0x1f')]=getSeconds(this[_0x8956('0x19')],_0x506067['answertime']);this[_0x8956('0xa')]=_0x3bc61b['queue'];this[_0x8956('0x20')]=_0x3bc61b[_0x8956('0x20')];this['reason']=_0x3bc61b[_0x8956('0x21')];this['callback']=_0x506067[_0x8956('0x22')];this[_0x8956('0x23')]=_0x506067[_0x8956('0x23')];this[_0x8956('0x24')]=_0x506067[_0x8956('0x24')];this[_0x8956('0x25')]=_0x506067[_0x8956('0x25')];this[_0x8956('0x26')]=_0x506067[_0x8956('0x26')];this['ListId']=_0x506067[_0x8956('0x27')];this[_0x8956('0x28')]=_0x506067[_0x8956('0x28')];this[_0x8956('0x29')]=_0x506067[_0x8956('0x29')];this[_0x8956('0x2a')]=_0x506067['CampaignId'];this[_0x8956('0x2b')]=_0x506067[_0x8956('0x2b')]||'';this[_0x8956('0x2c')]=_0x506067[_0x8956('0x2c')]||'';}module[_0x8956('0x2d')]=AgentComplete;