Built motion from commit 497d3d92.|2.5.43
[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 _0xccee=['uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry'];(function(_0x171418,_0x173a01){var _0x5d6ac5=function(_0x25d4c1){while(--_0x25d4c1){_0x171418['push'](_0x171418['shift']());}};_0x5d6ac5(++_0x173a01);}(_0xccee,0xcc));var _0xecce=function(_0x359142,_0x5d4d2a){_0x359142=_0x359142-0x0;var _0x53f01c=_0xccee[_0x359142];return _0x53f01c;};'use strict';var util=require(_0xecce('0x0'));var _=require(_0xecce('0x1'));var moment=require(_0xecce('0x2'));function getSeconds(_0x5f1a3c,_0x31f836){var _0x47e335=moment(_0x5f1a3c)[_0xecce('0x3')](0x0);var _0x5456f7=moment(_0x31f836)[_0xecce('0x3')](0x0);return _0x47e335[_0xecce('0x4')](_0x5456f7,_0xecce('0x5'));}function Hangup(_0x31613c,_0x353eba){this[_0xecce('0x6')]=0x4;this[_0xecce('0x7')]=_0xecce('0x8');this['scheduledat']=_0x31613c[_0xecce('0x9')];this[_0xecce('0xa')]=_0x31613c['type'];this[_0xecce('0xb')]=_0x31613c[_0xecce('0xa')]==='outbound'?'queue':_0x31613c[_0xecce('0xa')];this[_0xecce('0xc')]=_0x31613c[_0xecce('0xc')];this[_0xecce('0xd')]=_0x31613c[_0xecce('0xd')];this[_0xecce('0xe')]=_0x31613c['countnoanswerretry'];this[_0xecce('0xf')]=_0x31613c[_0xecce('0xc')]+_0x31613c['countcongestionretry']+_0x31613c[_0xecce('0xe')]+_0x31613c[_0xecce('0x10')]+_0x31613c['countdropretry']+_0x31613c[_0xecce('0x11')]+_0x31613c[_0xecce('0x12')]+_0x31613c[_0xecce('0x13')];this[_0xecce('0x10')]=_0x31613c[_0xecce('0x10')];this[_0xecce('0x14')]=_0x31613c[_0xecce('0x14')];this[_0xecce('0x11')]=_0x31613c['countabandonedretry'];this['countmachineretry']=_0x31613c['countmachineretry'];this[_0xecce('0x13')]=_0x31613c[_0xecce('0x13')];this[_0xecce('0x15')]=_0x353eba[_0xecce('0x15')];this[_0xecce('0x16')]=_0x31613c['name'];this[_0xecce('0x17')]=_0x31613c[_0xecce('0x18')];this['starttime']=_0x31613c[_0xecce('0x19')];this['responsetime']=_0x31613c[_0xecce('0x1a')];this[_0xecce('0x1b')]=moment()[_0xecce('0x1c')](_0xecce('0x1d'));this[_0xecce('0x1e')]=getSeconds(_0x31613c[_0xecce('0x1a')],_0x31613c[_0xecce('0x19')]);this['holdtime']=0x0;this[_0xecce('0x1f')]=getSeconds(this[_0xecce('0x1b')],_0x31613c[_0xecce('0x1a')]);this[_0xecce('0x20')]=_0x31613c[_0xecce('0x20')];this[_0xecce('0x21')]=_0xecce('0x22');this['reason']=_0x353eba['cause-txt'];this[_0xecce('0x23')]=_0x31613c[_0xecce('0x23')];this[_0xecce('0x24')]=_0x31613c[_0xecce('0x24')];this[_0xecce('0x25')]=_0x31613c[_0xecce('0x25')];this['recallme']=_0x31613c[_0xecce('0x26')];this[_0xecce('0x27')]=_0x31613c[_0xecce('0x27')];this[_0xecce('0x28')]=_0x31613c[_0xecce('0x28')];this['UserId']=_0x31613c[_0xecce('0x29')];this[_0xecce('0x2a')]=_0x31613c['VoiceQueueId'];this[_0xecce('0x2b')]=_0x31613c[_0xecce('0x2b')];}module[_0xecce('0x2c')]=Hangup;