Built motion from commit (unavailable).|2.5.14
[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 _0x3461=['accountcode','toNumber','CreateMemberReport','voiceDialReport','membername','endtime','starttime','seconds','outbound','dialstring','agent','uniqueid','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','diff','queuecallerleaveAt','inbound','exten','queue'];(function(_0x7400cd,_0x38906e){var _0x377202=function(_0x9b6ca7){while(--_0x9b6ca7){_0x7400cd['push'](_0x7400cd['shift']());}};_0x377202(++_0x38906e);}(_0x3461,0x19f));var _0x1346=function(_0x5c5999,_0x1c18ed){_0x5c5999=_0x5c5999-0x0;var _0x3983d8=_0x3461[_0x5c5999];return _0x3983d8;};'use strict';var moment=require(_0x1346('0x0'));var _=require(_0x1346('0x1'));var util=require(_0x1346('0x2'));var client=require(_0x1346('0x3'));exports[_0x1346('0x4')]=function(_0x5597c2){var _0x2c6c88=_0x5597c2[_0x1346('0x5')]||_0x5597c2[_0x1346('0x6')];return client[_0x1346('0x7')]('CreateMemberReport',{'body':{'channel':_0x1346('0x8'),'membername':_0x5597c2[_0x1346('0x9')],'interface':_[_0x1346('0xa')](_0x5597c2[_0x1346('0xb')])?util[_0x1346('0xc')](_0x1346('0xd'),_0x5597c2[_0x1346('0x9')]):_0x5597c2[_0x1346('0xb')],'type':'TALKING','enterAt':_0x5597c2['queuecallerleaveAt'],'exitAt':_0x2c6c88,'duration':moment(_0x2c6c88)[_0x1346('0xe')](_0x5597c2[_0x1346('0xf')],'seconds'),'data1':_0x1346('0x10'),'data2':_0x5597c2['calleridnum'],'data3':_0x5597c2[_0x1346('0x11')],'data4':null,'data5':_0x5597c2[_0x1346('0x12')],'role':'agent','internal':_0x5597c2[_0x1346('0x13')]?_[_0x1346('0x14')](_0x5597c2[_0x1346('0x13')]):undefined,'uniqueid':_0x5597c2['uniqueid']},'log':_0x1346('0x15')});};exports[_0x1346('0x16')]=function(_0x19abfa){return client[_0x1346('0x7')](_0x1346('0x15'),{'body':{'channel':_0x1346('0x8'),'membername':_0x19abfa[_0x1346('0x17')],'interface':_0x19abfa[_0x1346('0xb')],'type':'TALKING','enterAt':_0x19abfa['starttime'],'exitAt':_0x19abfa[_0x1346('0x18')],'duration':moment(_0x19abfa['endtime'])[_0x1346('0xe')](_0x19abfa[_0x1346('0x19')],'seconds')>=0x0?moment(_0x19abfa[_0x1346('0x18')])['diff'](_0x19abfa[_0x1346('0x19')],_0x1346('0x1a')):null,'data1':_0x1346('0x1b'),'data2':_0x19abfa['accountcode'],'data3':_0x19abfa['exten'],'data4':_0x19abfa[_0x1346('0x1c')]||null,'role':_0x1346('0x1d'),'internal':_0x19abfa[_0x1346('0x13')]?_[_0x1346('0x14')](_0x19abfa[_0x1346('0x13')]):undefined,'uniqueid':_0x19abfa[_0x1346('0x1e')]},'log':_0x1346('0x15')});};