f2de677d37244d3705a52ffa24c1187e6bd2f5ac
[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 _0x45a8=['lastAssignedTo','interface','format','TALKING','queuecallerleaveAt','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','CreateMemberReport','voiceDialReport','Request','membername','starttime','endtime','diff','outbound','uniqueid','moment','lodash','util','queuecallercompleteAt','voice'];(function(_0x5c6637,_0x3a272f){var _0x4f836e=function(_0x3c355b){while(--_0x3c355b){_0x5c6637['push'](_0x5c6637['shift']());}};_0x4f836e(++_0x3a272f);}(_0x45a8,0x14d));var _0x845a=function(_0x262d7b,_0x3ec3e8){_0x262d7b=_0x262d7b-0x0;var _0x582939=_0x45a8[_0x262d7b];return _0x582939;};'use strict';var moment=require(_0x845a('0x0'));var _=require(_0x845a('0x1'));var util=require(_0x845a('0x2'));var client=require('../client');exports['voiceQueueReport']=function(_0x4d6cf8){var _0x48379c=_0x4d6cf8[_0x845a('0x3')]||_0x4d6cf8['queuecallerexitAt'];return client['Request']('CreateMemberReport',{'body':{'channel':_0x845a('0x4'),'membername':_0x4d6cf8[_0x845a('0x5')],'interface':_['isNil'](_0x4d6cf8[_0x845a('0x6')])?util[_0x845a('0x7')]('SIP/%s',_0x4d6cf8[_0x845a('0x5')]):_0x4d6cf8[_0x845a('0x6')],'type':_0x845a('0x8'),'enterAt':_0x4d6cf8[_0x845a('0x9')],'exitAt':_0x48379c,'duration':moment(_0x48379c)['diff'](_0x4d6cf8['queuecallerleaveAt'],'seconds'),'data1':_0x845a('0xa'),'data2':_0x4d6cf8[_0x845a('0xb')],'data3':_0x4d6cf8[_0x845a('0xc')],'data4':null,'data5':_0x4d6cf8[_0x845a('0xd')],'role':_0x845a('0xe'),'internal':_0x4d6cf8[_0x845a('0xf')]?_[_0x845a('0x10')](_0x4d6cf8[_0x845a('0xf')]):undefined,'uniqueid':_0x4d6cf8['uniqueid']},'log':_0x845a('0x11')});};exports[_0x845a('0x12')]=function(_0x18fb12){return client[_0x845a('0x13')](_0x845a('0x11'),{'body':{'channel':_0x845a('0x4'),'membername':_0x18fb12[_0x845a('0x14')],'interface':_0x18fb12[_0x845a('0x6')],'type':_0x845a('0x8'),'enterAt':_0x18fb12[_0x845a('0x15')],'exitAt':_0x18fb12['endtime'],'duration':moment(_0x18fb12[_0x845a('0x16')])[_0x845a('0x17')](_0x18fb12[_0x845a('0x15')],'seconds')>=0x0?moment(_0x18fb12['endtime'])[_0x845a('0x17')](_0x18fb12[_0x845a('0x15')],'seconds'):null,'data1':_0x845a('0x18'),'data2':_0x18fb12[_0x845a('0xf')],'data3':_0x18fb12['exten'],'data4':_0x18fb12['dialstring']||null,'role':_0x845a('0xe'),'internal':_0x18fb12[_0x845a('0xf')]?_['toNumber'](_0x18fb12[_0x845a('0xf')]):undefined,'uniqueid':_0x18fb12[_0x845a('0x19')]},'log':_0x845a('0x11')});};