Built motion from commit 9d0783e6.|2.6.13
[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 _0x234f=['seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','starttime','endtime','outbound','dialstring','moment','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff'];(function(_0x200082,_0x5db061){var _0x1a9035=function(_0x2f6a54){while(--_0x2f6a54){_0x200082['push'](_0x200082['shift']());}};_0x1a9035(++_0x5db061);}(_0x234f,0xed));var _0xf234=function(_0x44bf1a,_0x7956){_0x44bf1a=_0x44bf1a-0x0;var _0xe43640=_0x234f[_0x44bf1a];return _0xe43640;};'use strict';var moment=require(_0xf234('0x0'));var _=require('lodash');var util=require('util');var client=require(_0xf234('0x1'));exports[_0xf234('0x2')]=function(_0x1a504d){var _0x8fe48=_0x1a504d[_0xf234('0x3')]||_0x1a504d[_0xf234('0x4')];return client[_0xf234('0x5')](_0xf234('0x6'),{'body':{'channel':'voice','membername':_0x1a504d[_0xf234('0x7')],'interface':_[_0xf234('0x8')](_0x1a504d[_0xf234('0x9')])?util[_0xf234('0xa')](_0xf234('0xb'),_0x1a504d['lastAssignedTo']):_0x1a504d[_0xf234('0x9')],'type':_0xf234('0xc'),'enterAt':_0x1a504d[_0xf234('0xd')],'exitAt':_0x8fe48,'duration':moment(_0x8fe48)[_0xf234('0xe')](_0x1a504d[_0xf234('0xd')],_0xf234('0xf')),'data1':_0xf234('0x10'),'data2':_0x1a504d[_0xf234('0x11')],'data3':_0x1a504d[_0xf234('0x12')],'data4':null,'data5':_0x1a504d[_0xf234('0x13')],'role':_0xf234('0x14'),'internal':_0x1a504d[_0xf234('0x15')]?_[_0xf234('0x16')](_0x1a504d[_0xf234('0x15')]):undefined,'uniqueid':_0x1a504d[_0xf234('0x17')]},'log':_0xf234('0x6')});};exports['voiceDialReport']=function(_0x430a54){return client['Request'](_0xf234('0x6'),{'body':{'channel':'voice','membername':_0x430a54['membername'],'interface':_0x430a54[_0xf234('0x9')],'type':'TALKING','enterAt':_0x430a54[_0xf234('0x18')],'exitAt':_0x430a54[_0xf234('0x19')],'duration':moment(_0x430a54[_0xf234('0x19')])[_0xf234('0xe')](_0x430a54['starttime'],'seconds')>=0x0?moment(_0x430a54[_0xf234('0x19')])['diff'](_0x430a54[_0xf234('0x18')],_0xf234('0xf')):null,'data1':_0xf234('0x1a'),'data2':_0x430a54[_0xf234('0x15')],'data3':_0x430a54['exten'],'data4':_0x430a54[_0xf234('0x1b')]||null,'role':_0xf234('0x14'),'internal':_0x430a54[_0xf234('0x15')]?_[_0xf234('0x16')](_0x430a54['accountcode']):undefined,'uniqueid':_0x430a54[_0xf234('0x17')]},'log':_0xf234('0x6')});};