29cf43d9ae0b44888c750f306dc3276ed101bb24
[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 _0x6b1e=['toNumber','uniqueid','voiceDialReport','Request','membername','TALKING','endtime','starttime','seconds','outbound','dialstring','agent','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','accountcode'];(function(_0x4de622,_0x16bf7c){var _0x2b238a=function(_0x2ac5e2){while(--_0x2ac5e2){_0x4de622['push'](_0x4de622['shift']());}};_0x2b238a(++_0x16bf7c);}(_0x6b1e,0x142));var _0xe6b1=function(_0x22e1c4,_0x410e2a){_0x22e1c4=_0x22e1c4-0x0;var _0x5d70d5=_0x6b1e[_0x22e1c4];return _0x5d70d5;};'use strict';var moment=require('moment');var _=require(_0xe6b1('0x0'));var util=require(_0xe6b1('0x1'));var client=require(_0xe6b1('0x2'));exports[_0xe6b1('0x3')]=function(_0xdf45e0){var _0x39c2c6=_0xdf45e0[_0xe6b1('0x4')]||_0xdf45e0[_0xe6b1('0x5')];return client['Request'](_0xe6b1('0x6'),{'body':{'channel':_0xe6b1('0x7'),'membername':_0xdf45e0[_0xe6b1('0x8')],'interface':_[_0xe6b1('0x9')](_0xdf45e0[_0xe6b1('0xa')])?util['format'](_0xe6b1('0xb'),_0xdf45e0['lastAssignedTo']):_0xdf45e0[_0xe6b1('0xa')],'type':'TALKING','enterAt':_0xdf45e0[_0xe6b1('0xc')],'exitAt':_0x39c2c6,'duration':moment(_0x39c2c6)[_0xe6b1('0xd')](_0xdf45e0[_0xe6b1('0xc')],'seconds'),'data1':_0xe6b1('0xe'),'data2':_0xdf45e0[_0xe6b1('0xf')],'data3':_0xdf45e0[_0xe6b1('0x10')],'data4':null,'data5':_0xdf45e0[_0xe6b1('0x11')],'role':'agent','internal':_0xdf45e0[_0xe6b1('0x12')]?_[_0xe6b1('0x13')](_0xdf45e0[_0xe6b1('0x12')]):undefined,'uniqueid':_0xdf45e0[_0xe6b1('0x14')]},'log':_0xe6b1('0x6')});};exports[_0xe6b1('0x15')]=function(_0x59bf48){return client[_0xe6b1('0x16')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x59bf48[_0xe6b1('0x17')],'interface':_0x59bf48[_0xe6b1('0xa')],'type':_0xe6b1('0x18'),'enterAt':_0x59bf48['starttime'],'exitAt':_0x59bf48[_0xe6b1('0x19')],'duration':moment(_0x59bf48[_0xe6b1('0x19')])[_0xe6b1('0xd')](_0x59bf48[_0xe6b1('0x1a')],'seconds')>=0x0?moment(_0x59bf48[_0xe6b1('0x19')])[_0xe6b1('0xd')](_0x59bf48[_0xe6b1('0x1a')],_0xe6b1('0x1b')):null,'data1':_0xe6b1('0x1c'),'data2':_0x59bf48[_0xe6b1('0x12')],'data3':_0x59bf48['exten'],'data4':_0x59bf48[_0xe6b1('0x1d')]||null,'role':_0xe6b1('0x1e'),'internal':_0x59bf48['accountcode']?_[_0xe6b1('0x13')](_0x59bf48[_0xe6b1('0x12')]):undefined,'uniqueid':_0x59bf48['uniqueid']},'log':_0xe6b1('0x6')});};