Built motion from commit (unavailable).|2.5.4
[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 _0xcc2f=['accountcode','uniqueid','voiceDialReport','voice','membername','starttime','endtime','dialstring','toNumber','moment','lodash','util','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','diff','seconds','inbound','exten','agent'];(function(_0x4d7583,_0x48d896){var _0x54ddde=function(_0x32b8c8){while(--_0x32b8c8){_0x4d7583['push'](_0x4d7583['shift']());}};_0x54ddde(++_0x48d896);}(_0xcc2f,0xab));var _0xfcc2=function(_0x2a6786,_0x1c5b74){_0x2a6786=_0x2a6786-0x0;var _0x3627fa=_0xcc2f[_0x2a6786];return _0x3627fa;};'use strict';var moment=require(_0xfcc2('0x0'));var _=require(_0xfcc2('0x1'));var util=require(_0xfcc2('0x2'));var client=require('../client');exports['voiceQueueReport']=function(_0x3aa0e1){var _0x27eac3=_0x3aa0e1[_0xfcc2('0x3')]||_0x3aa0e1[_0xfcc2('0x4')];return client[_0xfcc2('0x5')](_0xfcc2('0x6'),{'body':{'channel':'voice','membername':_0x3aa0e1[_0xfcc2('0x7')],'interface':_[_0xfcc2('0x8')](_0x3aa0e1[_0xfcc2('0x9')])?util[_0xfcc2('0xa')](_0xfcc2('0xb'),_0x3aa0e1['lastAssignedTo']):_0x3aa0e1[_0xfcc2('0x9')],'type':'TALKING','enterAt':_0x3aa0e1[_0xfcc2('0xc')],'exitAt':_0x27eac3,'duration':moment(_0x27eac3)[_0xfcc2('0xd')](_0x3aa0e1[_0xfcc2('0xc')],_0xfcc2('0xe')),'data1':_0xfcc2('0xf'),'data2':_0x3aa0e1['calleridnum'],'data3':_0x3aa0e1[_0xfcc2('0x10')],'data4':null,'data5':_0x3aa0e1['queue'],'role':_0xfcc2('0x11'),'internal':_0x3aa0e1[_0xfcc2('0x12')]?_['toNumber'](_0x3aa0e1['accountcode']):undefined,'uniqueid':_0x3aa0e1[_0xfcc2('0x13')]},'log':'CreateMemberReport'});};exports[_0xfcc2('0x14')]=function(_0x3f0ef8){return client[_0xfcc2('0x5')](_0xfcc2('0x6'),{'body':{'channel':_0xfcc2('0x15'),'membername':_0x3f0ef8[_0xfcc2('0x16')],'interface':_0x3f0ef8['interface'],'type':'TALKING','enterAt':_0x3f0ef8[_0xfcc2('0x17')],'exitAt':_0x3f0ef8['endtime'],'duration':moment(_0x3f0ef8[_0xfcc2('0x18')])['diff'](_0x3f0ef8[_0xfcc2('0x17')],'seconds')>=0x0?moment(_0x3f0ef8[_0xfcc2('0x18')])[_0xfcc2('0xd')](_0x3f0ef8['starttime'],'seconds'):null,'data1':'outbound','data2':_0x3f0ef8[_0xfcc2('0x12')],'data3':_0x3f0ef8[_0xfcc2('0x10')],'data4':_0x3f0ef8[_0xfcc2('0x19')]||null,'role':'agent','internal':_0x3f0ef8[_0xfcc2('0x12')]?_[_0xfcc2('0x1a')](_0x3f0ef8[_0xfcc2('0x12')]):undefined,'uniqueid':_0x3f0ef8['uniqueid']},'log':'CreateMemberReport'});};