Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / services / ami / dialer / hangup.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 _0xd0ac=['exports','util','lodash','milliseconds','diff','state','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','starttime','responsetime','endtime','format','ringtime','holdtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x54ac59,_0x4e140e){var _0x43a462=function(_0x2503a5){while(--_0x2503a5){_0x54ac59['push'](_0x54ac59['shift']());}};_0x43a462(++_0x4e140e);}(_0xd0ac,0x1d5));var _0xcd0a=function(_0x7da909,_0x296635){_0x7da909=_0x7da909-0x0;var _0x14e260=_0xd0ac[_0x7da909];return _0x14e260;};'use strict';var util=require(_0xcd0a('0x0'));var _=require(_0xcd0a('0x1'));var moment=require('moment');function getSeconds(_0x28bf65,_0x103ffe){var _0xb51f89=moment(_0x28bf65)['milliseconds'](0x0);var _0x7603ca=moment(_0x103ffe)[_0xcd0a('0x2')](0x0);return _0xb51f89[_0xcd0a('0x3')](_0x7603ca,'seconds');}function Hangup(_0x341f85,_0x1fe510){this[_0xcd0a('0x4')]=0x4;this['statedesc']='Answer';this[_0xcd0a('0x5')]=_0x341f85[_0xcd0a('0x5')];this[_0xcd0a('0x6')]=_0x341f85[_0xcd0a('0x6')];this['campaigntype']=_0x341f85[_0xcd0a('0x6')]===_0xcd0a('0x7')?_0xcd0a('0x8'):_0x341f85[_0xcd0a('0x6')];this[_0xcd0a('0x9')]=_0x341f85[_0xcd0a('0x9')];this[_0xcd0a('0xa')]=_0x341f85[_0xcd0a('0xa')];this[_0xcd0a('0xb')]=_0x341f85[_0xcd0a('0xb')];this[_0xcd0a('0xc')]=_0x341f85['countbusyretry']+_0x341f85['countcongestionretry']+_0x341f85[_0xcd0a('0xb')]+_0x341f85[_0xcd0a('0xd')]+_0x341f85[_0xcd0a('0xe')]+_0x341f85[_0xcd0a('0xf')]+_0x341f85[_0xcd0a('0x10')]+_0x341f85[_0xcd0a('0x11')];this[_0xcd0a('0xd')]=_0x341f85[_0xcd0a('0xd')];this['countdropretry']=_0x341f85[_0xcd0a('0xe')];this[_0xcd0a('0xf')]=_0x341f85[_0xcd0a('0xf')];this['countmachineretry']=_0x341f85[_0xcd0a('0x10')];this[_0xcd0a('0x11')]=_0x341f85[_0xcd0a('0x11')];this[_0xcd0a('0x12')]=_0x1fe510[_0xcd0a('0x12')];this['calleridname']=_0x341f85['name'];this['calleridnum']=_0x341f85['number'];this[_0xcd0a('0x13')]=_0x341f85[_0xcd0a('0x13')];this[_0xcd0a('0x14')]=_0x341f85[_0xcd0a('0x14')];this[_0xcd0a('0x15')]=moment()[_0xcd0a('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcd0a('0x17')]=getSeconds(_0x341f85[_0xcd0a('0x14')],_0x341f85[_0xcd0a('0x13')]);this[_0xcd0a('0x18')]=0x0;this['talktime']=getSeconds(this[_0xcd0a('0x15')],_0x341f85['responsetime']);this[_0xcd0a('0x8')]=_0x341f85[_0xcd0a('0x8')];this[_0xcd0a('0x19')]=_0xcd0a('0x1a');this[_0xcd0a('0x1b')]=_0x1fe510[_0xcd0a('0x1c')];this['callback']=_0x341f85[_0xcd0a('0x1d')];this[_0xcd0a('0x1e')]=_0x341f85[_0xcd0a('0x1e')];this['callbackat']=_0x341f85[_0xcd0a('0x1f')];this[_0xcd0a('0x20')]=_0x341f85[_0xcd0a('0x20')];this['ContactId']=_0x341f85[_0xcd0a('0x21')];this[_0xcd0a('0x22')]=_0x341f85['ListId'];this[_0xcd0a('0x23')]=_0x341f85[_0xcd0a('0x23')];this[_0xcd0a('0x24')]=_0x341f85['VoiceQueueId'];this['CampaignId']=_0x341f85[_0xcd0a('0x25')];}module[_0xcd0a('0x26')]=Hangup;