Built motion from commit 82bb2304.|2.5.39
[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 _0x4162=['scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','ringtime','holdtime','endtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','exports','lodash','moment','milliseconds','diff','seconds','state'];(function(_0x19cf1b,_0x37c5ae){var _0x2e8bb0=function(_0x4533ed){while(--_0x4533ed){_0x19cf1b['push'](_0x19cf1b['shift']());}};_0x2e8bb0(++_0x37c5ae);}(_0x4162,0x1ce));var _0x2416=function(_0x4b7298,_0x5d8d2e){_0x4b7298=_0x4b7298-0x0;var _0x4450ab=_0x4162[_0x4b7298];return _0x4450ab;};'use strict';var util=require('util');var _=require(_0x2416('0x0'));var moment=require(_0x2416('0x1'));function getSeconds(_0x3e755e,_0x42021f){var _0x423a3d=moment(_0x3e755e)[_0x2416('0x2')](0x0);var _0x51f67f=moment(_0x42021f)[_0x2416('0x2')](0x0);return _0x423a3d[_0x2416('0x3')](_0x51f67f,_0x2416('0x4'));}function Hangup(_0x1d664b,_0x5236f8){this[_0x2416('0x5')]=0x4;this['statedesc']='Answer';this['scheduledat']=_0x1d664b[_0x2416('0x6')];this[_0x2416('0x7')]=_0x1d664b[_0x2416('0x7')];this[_0x2416('0x8')]=_0x1d664b[_0x2416('0x7')]==='outbound'?_0x2416('0x9'):_0x1d664b['type'];this[_0x2416('0xa')]=_0x1d664b[_0x2416('0xa')];this['countcongestionretry']=_0x1d664b['countcongestionretry'];this['countnoanswerretry']=_0x1d664b[_0x2416('0xb')];this[_0x2416('0xc')]=_0x1d664b[_0x2416('0xa')]+_0x1d664b[_0x2416('0xd')]+_0x1d664b['countnoanswerretry']+_0x1d664b[_0x2416('0xe')]+_0x1d664b[_0x2416('0xf')]+_0x1d664b[_0x2416('0x10')]+_0x1d664b['countmachineretry']+_0x1d664b['countagentrejectretry'];this[_0x2416('0xe')]=_0x1d664b[_0x2416('0xe')];this['countdropretry']=_0x1d664b['countdropretry'];this[_0x2416('0x10')]=_0x1d664b[_0x2416('0x10')];this[_0x2416('0x11')]=_0x1d664b[_0x2416('0x11')];this['countagentrejectretry']=_0x1d664b[_0x2416('0x12')];this['uniqueid']=_0x5236f8[_0x2416('0x13')];this[_0x2416('0x14')]=_0x1d664b[_0x2416('0x15')];this[_0x2416('0x16')]=_0x1d664b[_0x2416('0x17')];this[_0x2416('0x18')]=_0x1d664b['starttime'];this[_0x2416('0x19')]=_0x1d664b[_0x2416('0x19')];this['endtime']=moment()[_0x2416('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2416('0x1b')]=getSeconds(_0x1d664b[_0x2416('0x19')],_0x1d664b[_0x2416('0x18')]);this[_0x2416('0x1c')]=0x0;this['talktime']=getSeconds(this[_0x2416('0x1d')],_0x1d664b[_0x2416('0x19')]);this[_0x2416('0x9')]=_0x1d664b[_0x2416('0x9')];this[_0x2416('0x1e')]='IVR';this[_0x2416('0x1f')]=_0x5236f8['cause-txt'];this[_0x2416('0x20')]=_0x1d664b['callback'];this['callbackuniqueid']=_0x1d664b['callbackuniqueid'];this[_0x2416('0x21')]=_0x1d664b['callbackat'];this[_0x2416('0x22')]=_0x1d664b[_0x2416('0x22')];this['ContactId']=_0x1d664b[_0x2416('0x23')];this[_0x2416('0x24')]=_0x1d664b[_0x2416('0x24')];this[_0x2416('0x25')]=_0x1d664b[_0x2416('0x25')];this['VoiceQueueId']=_0x1d664b['VoiceQueueId'];this['CampaignId']=_0x1d664b['CampaignId'];}module[_0x2416('0x26')]=Hangup;