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