Built motion from commit 85328c08.|2.5.50
[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 _0x8a11=['seconds','inbound','exten','queue','agent','accountcode','uniqueid','voiceDialReport','CreateMemberReport','interface','starttime','endtime','outbound','dialstring','toNumber','moment','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','format','SIP/%s','TALKING','diff','queuecallerleaveAt'];(function(_0x221817,_0x47628e){var _0x45d32b=function(_0x2c7e46){while(--_0x2c7e46){_0x221817['push'](_0x221817['shift']());}};_0x45d32b(++_0x47628e);}(_0x8a11,0xda));var _0x18a1=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x8a11[_0x18afca];return _0x11603f;};'use strict';var moment=require(_0x18a1('0x0'));var _=require('lodash');var util=require(_0x18a1('0x1'));var client=require(_0x18a1('0x2'));exports['voiceQueueReport']=function(_0x3fcc38){var _0x4d363f=_0x3fcc38[_0x18a1('0x3')]||_0x3fcc38[_0x18a1('0x4')];return client[_0x18a1('0x5')]('CreateMemberReport',{'body':{'channel':_0x18a1('0x6'),'membername':_0x3fcc38[_0x18a1('0x7')],'interface':_[_0x18a1('0x8')](_0x3fcc38['interface'])?util[_0x18a1('0x9')](_0x18a1('0xa'),_0x3fcc38[_0x18a1('0x7')]):_0x3fcc38['interface'],'type':_0x18a1('0xb'),'enterAt':_0x3fcc38['queuecallerleaveAt'],'exitAt':_0x4d363f,'duration':moment(_0x4d363f)[_0x18a1('0xc')](_0x3fcc38[_0x18a1('0xd')],_0x18a1('0xe')),'data1':_0x18a1('0xf'),'data2':_0x3fcc38['calleridnum'],'data3':_0x3fcc38[_0x18a1('0x10')],'data4':null,'data5':_0x3fcc38[_0x18a1('0x11')],'role':_0x18a1('0x12'),'internal':_0x3fcc38[_0x18a1('0x13')]?_['toNumber'](_0x3fcc38[_0x18a1('0x13')]):undefined,'uniqueid':_0x3fcc38[_0x18a1('0x14')]},'log':'CreateMemberReport'});};exports[_0x18a1('0x15')]=function(_0x5a817c){return client[_0x18a1('0x5')](_0x18a1('0x16'),{'body':{'channel':'voice','membername':_0x5a817c['membername'],'interface':_0x5a817c[_0x18a1('0x17')],'type':_0x18a1('0xb'),'enterAt':_0x5a817c[_0x18a1('0x18')],'exitAt':_0x5a817c['endtime'],'duration':moment(_0x5a817c[_0x18a1('0x19')])[_0x18a1('0xc')](_0x5a817c[_0x18a1('0x18')],_0x18a1('0xe'))>=0x0?moment(_0x5a817c['endtime'])[_0x18a1('0xc')](_0x5a817c[_0x18a1('0x18')],'seconds'):null,'data1':_0x18a1('0x1a'),'data2':_0x5a817c[_0x18a1('0x13')],'data3':_0x5a817c[_0x18a1('0x10')],'data4':_0x5a817c[_0x18a1('0x1b')]||null,'role':_0x18a1('0x12'),'internal':_0x5a817c[_0x18a1('0x13')]?_[_0x18a1('0x1c')](_0x5a817c['accountcode']):undefined,'uniqueid':_0x5a817c[_0x18a1('0x14')]},'log':_0x18a1('0x16')});};