a172507d0ac1e7beb1392ca33989abec0a87d887
[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 _0xb59f=['format','SIP/%s','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','outbound','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface'];(function(_0x22258a,_0x2b154d){var _0x542f38=function(_0x312d07){while(--_0x312d07){_0x22258a['push'](_0x22258a['shift']());}};_0x542f38(++_0x2b154d);}(_0xb59f,0x198));var _0xfb59=function(_0x392f70,_0x27c10c){_0x392f70=_0x392f70-0x0;var _0x20bd58=_0xb59f[_0x392f70];return _0x20bd58;};'use strict';var moment=require(_0xfb59('0x0'));var _=require(_0xfb59('0x1'));var util=require(_0xfb59('0x2'));var client=require(_0xfb59('0x3'));exports[_0xfb59('0x4')]=function(_0x399cf0){var _0x26e9f8=_0x399cf0[_0xfb59('0x5')]||_0x399cf0[_0xfb59('0x6')];return client[_0xfb59('0x7')](_0xfb59('0x8'),{'body':{'channel':_0xfb59('0x9'),'membername':_0x399cf0[_0xfb59('0xa')],'interface':_['isNil'](_0x399cf0[_0xfb59('0xb')])?util[_0xfb59('0xc')](_0xfb59('0xd'),_0x399cf0[_0xfb59('0xa')]):_0x399cf0[_0xfb59('0xb')],'type':'TALKING','enterAt':_0x399cf0[_0xfb59('0xe')],'exitAt':_0x26e9f8,'duration':moment(_0x26e9f8)[_0xfb59('0xf')](_0x399cf0[_0xfb59('0xe')],_0xfb59('0x10')),'data1':_0xfb59('0x11'),'data2':_0x399cf0[_0xfb59('0x12')],'data3':_0x399cf0[_0xfb59('0x13')],'data4':null,'data5':_0x399cf0[_0xfb59('0x14')],'role':_0xfb59('0x15'),'internal':_0x399cf0[_0xfb59('0x16')]?_[_0xfb59('0x17')](_0x399cf0[_0xfb59('0x16')]):undefined,'uniqueid':_0x399cf0[_0xfb59('0x18')]},'log':_0xfb59('0x8')});};exports[_0xfb59('0x19')]=function(_0x1d42b8){return client['Request']('CreateMemberReport',{'body':{'channel':_0xfb59('0x9'),'membername':_0x1d42b8['membername'],'interface':_0x1d42b8[_0xfb59('0xb')],'type':'TALKING','enterAt':_0x1d42b8[_0xfb59('0x1a')],'exitAt':_0x1d42b8[_0xfb59('0x1b')],'duration':moment(_0x1d42b8['endtime'])[_0xfb59('0xf')](_0x1d42b8[_0xfb59('0x1a')],_0xfb59('0x10'))>=0x0?moment(_0x1d42b8[_0xfb59('0x1b')])['diff'](_0x1d42b8['starttime'],_0xfb59('0x10')):null,'data1':_0xfb59('0x1c'),'data2':_0x1d42b8['accountcode'],'data3':_0x1d42b8['exten'],'data4':_0x1d42b8[_0xfb59('0x1d')]||null,'role':_0xfb59('0x15'),'internal':_0x1d42b8[_0xfb59('0x16')]?_['toNumber'](_0x1d42b8[_0xfb59('0x16')]):undefined,'uniqueid':_0x1d42b8[_0xfb59('0x18')]},'log':_0xfb59('0x8')});};