9411768e4ab900d59749178ed051db75d5fa08f8
[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 _0xe558=['ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','diff','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x333fed,_0x3d2122){var _0x12cac2=function(_0x41d9af){while(--_0x41d9af){_0x333fed['push'](_0x333fed['shift']());}};_0x12cac2(++_0x3d2122);}(_0xe558,0x1d3));var _0x8e55=function(_0x2a84ea,_0x446cb3){_0x2a84ea=_0x2a84ea-0x0;var _0x15e78b=_0xe558[_0x2a84ea];return _0x15e78b;};'use strict';var util=require('util');var _=require(_0x8e55('0x0'));var moment=require('moment');function getSeconds(_0x4a3da5,_0xb3a25b){var _0x8cc868=moment(_0x4a3da5)[_0x8e55('0x1')](0x0);var _0x523881=moment(_0xb3a25b)[_0x8e55('0x1')](0x0);return _0x8cc868[_0x8e55('0x2')](_0x523881,'seconds');}function Hangup(_0x5957a1,_0x4778f0){this[_0x8e55('0x3')]=0x4;this[_0x8e55('0x4')]='Answer';this[_0x8e55('0x5')]=_0x5957a1[_0x8e55('0x5')];this[_0x8e55('0x6')]=_0x5957a1['type'];this[_0x8e55('0x7')]=_0x5957a1[_0x8e55('0x6')]===_0x8e55('0x8')?_0x8e55('0x9'):_0x5957a1[_0x8e55('0x6')];this['countbusyretry']=_0x5957a1[_0x8e55('0xa')];this[_0x8e55('0xb')]=_0x5957a1[_0x8e55('0xb')];this['countnoanswerretry']=_0x5957a1[_0x8e55('0xc')];this[_0x8e55('0xd')]=_0x5957a1[_0x8e55('0xa')]+_0x5957a1['countcongestionretry']+_0x5957a1[_0x8e55('0xc')]+_0x5957a1[_0x8e55('0xe')]+_0x5957a1[_0x8e55('0xf')]+_0x5957a1['countabandonedretry']+_0x5957a1[_0x8e55('0x10')]+_0x5957a1['countagentrejectretry'];this[_0x8e55('0xe')]=_0x5957a1['countnosuchnumberretry'];this['countdropretry']=_0x5957a1[_0x8e55('0xf')];this[_0x8e55('0x11')]=_0x5957a1[_0x8e55('0x11')];this[_0x8e55('0x10')]=_0x5957a1['countmachineretry'];this['countagentrejectretry']=_0x5957a1[_0x8e55('0x12')];this['uniqueid']=_0x4778f0[_0x8e55('0x13')];this['calleridname']=_0x5957a1[_0x8e55('0x14')];this['calleridnum']=_0x5957a1[_0x8e55('0x15')];this[_0x8e55('0x16')]=_0x5957a1[_0x8e55('0x16')];this[_0x8e55('0x17')]=_0x5957a1[_0x8e55('0x17')];this[_0x8e55('0x18')]=moment()[_0x8e55('0x19')](_0x8e55('0x1a'));this['ringtime']=getSeconds(_0x5957a1[_0x8e55('0x17')],_0x5957a1['starttime']);this[_0x8e55('0x1b')]=0x0;this['talktime']=getSeconds(this[_0x8e55('0x18')],_0x5957a1[_0x8e55('0x17')]);this[_0x8e55('0x9')]=_0x5957a1[_0x8e55('0x9')];this[_0x8e55('0x1c')]=_0x8e55('0x1d');this[_0x8e55('0x1e')]=_0x4778f0[_0x8e55('0x1f')];this['callback']=_0x5957a1[_0x8e55('0x20')];this[_0x8e55('0x21')]=_0x5957a1[_0x8e55('0x21')];this[_0x8e55('0x22')]=_0x5957a1[_0x8e55('0x22')];this[_0x8e55('0x23')]=_0x5957a1[_0x8e55('0x23')];this[_0x8e55('0x24')]=_0x5957a1[_0x8e55('0x24')];this[_0x8e55('0x25')]=_0x5957a1[_0x8e55('0x25')];this[_0x8e55('0x26')]=_0x5957a1[_0x8e55('0x26')];this[_0x8e55('0x27')]=_0x5957a1['VoiceQueueId'];this[_0x8e55('0x28')]=_0x5957a1[_0x8e55('0x28')];}module[_0x8e55('0x29')]=Hangup;