Built motion from commit (unavailable).|2.4.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 _0xc2e4=['seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff'];(function(_0x2315c2,_0x42a052){var _0x5ead85=function(_0x49639e){while(--_0x49639e){_0x2315c2['push'](_0x2315c2['shift']());}};_0x5ead85(++_0x42a052);}(_0xc2e4,0x1be));var _0x4c2e=function(_0x88001a,_0x3b22c7){_0x88001a=_0x88001a-0x0;var _0xe14b7e=_0xc2e4[_0x88001a];return _0xe14b7e;};'use strict';var util=require(_0x4c2e('0x0'));var _=require(_0x4c2e('0x1'));var moment=require(_0x4c2e('0x2'));function getSeconds(_0x2a7a8e,_0x18f764){var _0x1f017e=moment(_0x2a7a8e)[_0x4c2e('0x3')](0x0);var _0x76f015=moment(_0x18f764)[_0x4c2e('0x3')](0x0);return _0x1f017e[_0x4c2e('0x4')](_0x76f015,_0x4c2e('0x5'));}function AgentComplete(_0x4ea02c,_0x298138){this[_0x4c2e('0x6')]=0x4;this[_0x4c2e('0x7')]=_0x4c2e('0x8');this['scheduledat']=_0x4ea02c[_0x4c2e('0x9')];this[_0x4c2e('0xa')]=_0x4ea02c[_0x4c2e('0xa')];this['campaigntype']=_0x4ea02c['type']===_0x4c2e('0xb')?_0x4c2e('0xc'):_0x4ea02c[_0x4c2e('0xa')];this['countbusyretry']=_0x4ea02c[_0x4c2e('0xd')];this['countcongestionretry']=_0x4ea02c[_0x4c2e('0xe')];this[_0x4c2e('0xf')]=_0x4ea02c['countnoanswerretry'];this[_0x4c2e('0x10')]=_0x4ea02c[_0x4c2e('0xd')]+_0x4ea02c[_0x4c2e('0xe')]+_0x4ea02c[_0x4c2e('0xf')];this[_0x4c2e('0x11')]=_0x298138[_0x4c2e('0x11')];this[_0x4c2e('0x12')]=_0x4ea02c['name'];this[_0x4c2e('0x13')]=_0x4ea02c[_0x4c2e('0x14')];this[_0x4c2e('0x15')]=_0x4ea02c[_0x4c2e('0x15')];this['responsetime']=_0x4ea02c[_0x4c2e('0x16')];this[_0x4c2e('0x17')]=_0x4ea02c[_0x4c2e('0x17')];this['endtime']=moment()['format'](_0x4c2e('0x18'));this[_0x4c2e('0x19')]=getSeconds(_0x4ea02c[_0x4c2e('0x16')],_0x4ea02c[_0x4c2e('0x15')]);this[_0x4c2e('0x1a')]=getSeconds(_0x4ea02c[_0x4c2e('0x17')],_0x4ea02c[_0x4c2e('0x16')]);this[_0x4c2e('0x1b')]=getSeconds(this[_0x4c2e('0x1c')],_0x4ea02c[_0x4c2e('0x17')]);this['queue']=_0x298138[_0x4c2e('0xc')];this[_0x4c2e('0x1d')]=_0x298138[_0x4c2e('0x1d')];this[_0x4c2e('0x1e')]=_0x298138[_0x4c2e('0x1e')];this[_0x4c2e('0x1f')]=_0x4ea02c[_0x4c2e('0x1f')];this[_0x4c2e('0x20')]=_0x4ea02c[_0x4c2e('0x20')];this['callbackat']=_0x4ea02c[_0x4c2e('0x21')];this[_0x4c2e('0x22')]=_0x4ea02c[_0x4c2e('0x22')];this[_0x4c2e('0x23')]=_0x4ea02c['ContactId'];this[_0x4c2e('0x24')]=_0x4ea02c[_0x4c2e('0x24')];this['UserId']=_0x4ea02c['UserId'];this[_0x4c2e('0x25')]=_0x4ea02c['VoiceQueueId'];this['CampaignId']=_0x4ea02c['CampaignId'];this[_0x4c2e('0x26')]=_0x4ea02c[_0x4c2e('0x26')]||'';this[_0x4c2e('0x27')]=_0x4ea02c['originatecalleridname']||'';}module[_0x4c2e('0x28')]=AgentComplete;