ae945fad760377fdb3b716ceee05ca676f62b0ae
[motion2.git] / server / services / ami / dialer / models / 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 _0x531f=['starttime','responsetime','endtime','format','ringtime','getSeconds','talktime','queue','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','../utils','state','type','campaigntype','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','number'];(function(_0xe7c4be,_0x124018){var _0x2ea623=function(_0x5977b2){while(--_0x5977b2){_0xe7c4be['push'](_0xe7c4be['shift']());}};_0x2ea623(++_0x124018);}(_0x531f,0xcd));var _0xf531=function(_0x372ee1,_0x45c637){_0x372ee1=_0x372ee1-0x0;var _0x31ea06=_0x531f[_0x372ee1];return _0x31ea06;};'use strict';var moment=require('moment');var utils=require(_0xf531('0x0'));function Hangup(_0x4f8352,_0x168712){this[_0xf531('0x1')]=0x4;this['statedesc']='Answer';this['scheduledat']=_0x4f8352['scheduledat'];this['type']=_0x4f8352[_0xf531('0x2')];this[_0xf531('0x3')]=_0x4f8352[_0xf531('0x2')]==='outbound'?'queue':_0x4f8352[_0xf531('0x2')];this[_0xf531('0x4')]=_0x4f8352['amd']||![];this[_0xf531('0x5')]=_0x4f8352[_0xf531('0x5')];this['countcongestionretry']=_0x4f8352[_0xf531('0x6')];this[_0xf531('0x7')]=_0x4f8352[_0xf531('0x7')];this[_0xf531('0x8')]=_0x4f8352['countbusyretry']+_0x4f8352[_0xf531('0x6')]+_0x4f8352[_0xf531('0x7')]+_0x4f8352[_0xf531('0x9')]+_0x4f8352[_0xf531('0xa')]+_0x4f8352[_0xf531('0xb')]+_0x4f8352['countmachineretry']+_0x4f8352[_0xf531('0xc')];this[_0xf531('0x9')]=_0x4f8352['countnosuchnumberretry'];this[_0xf531('0xa')]=_0x4f8352[_0xf531('0xa')];this[_0xf531('0xb')]=_0x4f8352[_0xf531('0xb')];this[_0xf531('0xd')]=_0x4f8352[_0xf531('0xd')];this[_0xf531('0xc')]=_0x4f8352[_0xf531('0xc')];this['uniqueid']=_0x168712[_0xf531('0xe')];this['calleridname']=_0x4f8352[_0xf531('0xf')];this['calleridnum']=_0x4f8352[_0xf531('0x10')];this[_0xf531('0x11')]=_0x4f8352[_0xf531('0x11')];this['responsetime']=_0x4f8352[_0xf531('0x12')];this[_0xf531('0x13')]=moment()[_0xf531('0x14')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf531('0x15')]=utils[_0xf531('0x16')](_0x4f8352[_0xf531('0x12')],_0x4f8352[_0xf531('0x11')]);this['holdtime']=0x0;this[_0xf531('0x17')]=utils[_0xf531('0x16')](this['endtime'],_0x4f8352[_0xf531('0x12')]);this[_0xf531('0x18')]=_0x4f8352['queue'];this[_0xf531('0x19')]=_0xf531('0x1a');this['reason']=_0x168712['cause-txt'];this[_0xf531('0x1b')]=_0x4f8352['callback'];this[_0xf531('0x1c')]=_0x4f8352[_0xf531('0x1c')];this[_0xf531('0x1d')]=_0x4f8352[_0xf531('0x1d')];this[_0xf531('0x1e')]=_0x4f8352['recallme'];this[_0xf531('0x1f')]=_0x4f8352[_0xf531('0x1f')];this[_0xf531('0x20')]=_0x4f8352['ListId'];this['UserId']=_0x4f8352[_0xf531('0x21')];this[_0xf531('0x22')]=_0x4f8352[_0xf531('0x22')];this[_0xf531('0x23')]=_0x4f8352[_0xf531('0x23')];}module[_0xf531('0x24')]=Hangup;