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