4ea78b043f3ffb664e287426e5da70cf27964a0e
[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 _0x5c40=['voiceDialReport','membername','endtime','starttime','dialstring','agent','toNumber','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','interface','SIP/%s','lastAssignedTo','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','accountcode','uniqueid'];(function(_0x2eab12,_0x1bc6d3){var _0x337e13=function(_0xb5916f){while(--_0xb5916f){_0x2eab12['push'](_0x2eab12['shift']());}};_0x337e13(++_0x1bc6d3);}(_0x5c40,0xb5));var _0x05c4=function(_0x54868c,_0x15997a){_0x54868c=_0x54868c-0x0;var _0x2e9e2d=_0x5c40[_0x54868c];return _0x2e9e2d;};'use strict';var moment=require('moment');var _=require(_0x05c4('0x0'));var util=require(_0x05c4('0x1'));var client=require(_0x05c4('0x2'));exports['voiceQueueReport']=function(_0x3be156){var _0x2624df=_0x3be156[_0x05c4('0x3')]||_0x3be156[_0x05c4('0x4')];return client[_0x05c4('0x5')](_0x05c4('0x6'),{'body':{'channel':_0x05c4('0x7'),'membername':_0x3be156['lastAssignedTo'],'interface':_[_0x05c4('0x8')](_0x3be156[_0x05c4('0x9')])?util['format'](_0x05c4('0xa'),_0x3be156[_0x05c4('0xb')]):_0x3be156[_0x05c4('0x9')],'type':_0x05c4('0xc'),'enterAt':_0x3be156['queuecallerleaveAt'],'exitAt':_0x2624df,'duration':moment(_0x2624df)[_0x05c4('0xd')](_0x3be156[_0x05c4('0xe')],_0x05c4('0xf')),'data1':_0x05c4('0x10'),'data2':_0x3be156[_0x05c4('0x11')],'data3':_0x3be156[_0x05c4('0x12')],'data4':null,'data5':_0x3be156[_0x05c4('0x13')],'role':'agent','internal':_0x3be156[_0x05c4('0x14')]?_['toNumber'](_0x3be156[_0x05c4('0x14')]):undefined,'uniqueid':_0x3be156[_0x05c4('0x15')]},'log':_0x05c4('0x6')});};exports[_0x05c4('0x16')]=function(_0x15f45d){return client['Request'](_0x05c4('0x6'),{'body':{'channel':_0x05c4('0x7'),'membername':_0x15f45d[_0x05c4('0x17')],'interface':_0x15f45d[_0x05c4('0x9')],'type':_0x05c4('0xc'),'enterAt':_0x15f45d['starttime'],'exitAt':_0x15f45d[_0x05c4('0x18')],'duration':moment(_0x15f45d[_0x05c4('0x18')])[_0x05c4('0xd')](_0x15f45d[_0x05c4('0x19')],'seconds')>=0x0?moment(_0x15f45d[_0x05c4('0x18')])['diff'](_0x15f45d[_0x05c4('0x19')],_0x05c4('0xf')):null,'data1':'outbound','data2':_0x15f45d['accountcode'],'data3':_0x15f45d[_0x05c4('0x12')],'data4':_0x15f45d[_0x05c4('0x1a')]||null,'role':_0x05c4('0x1b'),'internal':_0x15f45d['accountcode']?_[_0x05c4('0x1c')](_0x15f45d['accountcode']):undefined,'uniqueid':_0x15f45d['uniqueid']},'log':_0x05c4('0x6')});};