19eeb377c0e4ccb5ad54a9db039818a65e253e8f
[motion2.git] / server / services / ami / rpc / memberReport.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 _0x4774=['queuecallercompleteAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','diff','seconds','calleridnum','exten','agent','accountcode','toNumber','uniqueid','voiceDialReport','membername','TALKING','starttime','endtime','dialstring','moment','util','../client','voiceQueueReport'];(function(_0x4011dd,_0x518454){var _0x1a7ce6=function(_0x3c24db){while(--_0x3c24db){_0x4011dd['push'](_0x4011dd['shift']());}};_0x1a7ce6(++_0x518454);}(_0x4774,0xd4));var _0x4477=function(_0x32393a,_0x2587ce){_0x32393a=_0x32393a-0x0;var _0x365000=_0x4774[_0x32393a];return _0x365000;};'use strict';var moment=require(_0x4477('0x0'));var _=require('lodash');var util=require(_0x4477('0x1'));var client=require(_0x4477('0x2'));exports[_0x4477('0x3')]=function(_0x48f5f2){var _0xe75707=_0x48f5f2[_0x4477('0x4')]||_0x48f5f2['queuecallerexitAt'];return client[_0x4477('0x5')](_0x4477('0x6'),{'body':{'channel':'voice','membername':_0x48f5f2[_0x4477('0x7')],'interface':_[_0x4477('0x8')](_0x48f5f2[_0x4477('0x9')])?util[_0x4477('0xa')](_0x4477('0xb'),_0x48f5f2[_0x4477('0x7')]):_0x48f5f2[_0x4477('0x9')],'type':'TALKING','enterAt':_0x48f5f2[_0x4477('0xc')],'exitAt':_0xe75707,'duration':moment(_0xe75707)[_0x4477('0xd')](_0x48f5f2[_0x4477('0xc')],_0x4477('0xe')),'data1':'inbound','data2':_0x48f5f2[_0x4477('0xf')],'data3':_0x48f5f2[_0x4477('0x10')],'data4':null,'data5':_0x48f5f2['queue'],'role':_0x4477('0x11'),'internal':_0x48f5f2[_0x4477('0x12')]?_[_0x4477('0x13')](_0x48f5f2[_0x4477('0x12')]):undefined,'uniqueid':_0x48f5f2[_0x4477('0x14')]},'log':_0x4477('0x6')});};exports[_0x4477('0x15')]=function(_0x532876){return client['Request'](_0x4477('0x6'),{'body':{'channel':'voice','membername':_0x532876[_0x4477('0x16')],'interface':_0x532876[_0x4477('0x9')],'type':_0x4477('0x17'),'enterAt':_0x532876[_0x4477('0x18')],'exitAt':_0x532876[_0x4477('0x19')],'duration':moment(_0x532876['endtime'])[_0x4477('0xd')](_0x532876['starttime'],_0x4477('0xe'))>=0x0?moment(_0x532876['endtime'])[_0x4477('0xd')](_0x532876[_0x4477('0x18')],'seconds'):null,'data1':'outbound','data2':_0x532876[_0x4477('0x12')],'data3':_0x532876[_0x4477('0x10')],'data4':_0x532876[_0x4477('0x1a')]||null,'role':_0x4477('0x11'),'internal':_0x532876[_0x4477('0x12')]?_[_0x4477('0x13')](_0x532876[_0x4477('0x12')]):undefined,'uniqueid':_0x532876[_0x4477('0x14')]},'log':'CreateMemberReport'});};