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