3588470a434776555500906f868d5ea3bfc8ba54
[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 _0x823e=['util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','accountcode','toNumber','uniqueid','voiceDialReport','membername','starttime','endtime','outbound','dialstring','moment'];(function(_0x2f1fde,_0x53cfde){var _0x55ace1=function(_0x1875bf){while(--_0x1875bf){_0x2f1fde['push'](_0x2f1fde['shift']());}};_0x55ace1(++_0x53cfde);}(_0x823e,0x1db));var _0xe823=function(_0x26cfb7,_0x169710){_0x26cfb7=_0x26cfb7-0x0;var _0x10c163=_0x823e[_0x26cfb7];return _0x10c163;};'use strict';var moment=require(_0xe823('0x0'));var _=require('lodash');var util=require(_0xe823('0x1'));var client=require('../client');exports[_0xe823('0x2')]=function(_0x521172){var _0x476594=_0x521172[_0xe823('0x3')]||_0x521172[_0xe823('0x4')];return client[_0xe823('0x5')](_0xe823('0x6'),{'body':{'channel':_0xe823('0x7'),'membername':_0x521172[_0xe823('0x8')],'interface':_[_0xe823('0x9')](_0x521172[_0xe823('0xa')])?util['format'](_0xe823('0xb'),_0x521172[_0xe823('0x8')]):_0x521172[_0xe823('0xa')],'type':_0xe823('0xc'),'enterAt':_0x521172['queuecallerleaveAt'],'exitAt':_0x476594,'duration':moment(_0x476594)[_0xe823('0xd')](_0x521172[_0xe823('0xe')],_0xe823('0xf')),'data1':_0xe823('0x10'),'data2':_0x521172[_0xe823('0x11')],'data3':_0x521172[_0xe823('0x12')],'data4':null,'data5':_0x521172['queue'],'role':'agent','internal':_0x521172[_0xe823('0x13')]?_[_0xe823('0x14')](_0x521172[_0xe823('0x13')]):undefined,'uniqueid':_0x521172[_0xe823('0x15')]},'log':'CreateMemberReport'});};exports[_0xe823('0x16')]=function(_0x1137cc){return client[_0xe823('0x5')]('CreateMemberReport',{'body':{'channel':_0xe823('0x7'),'membername':_0x1137cc[_0xe823('0x17')],'interface':_0x1137cc[_0xe823('0xa')],'type':_0xe823('0xc'),'enterAt':_0x1137cc[_0xe823('0x18')],'exitAt':_0x1137cc[_0xe823('0x19')],'duration':moment(_0x1137cc[_0xe823('0x19')])[_0xe823('0xd')](_0x1137cc['starttime'],_0xe823('0xf'))>=0x0?moment(_0x1137cc[_0xe823('0x19')])['diff'](_0x1137cc['starttime'],_0xe823('0xf')):null,'data1':_0xe823('0x1a'),'data2':_0x1137cc[_0xe823('0x13')],'data3':_0x1137cc[_0xe823('0x12')],'data4':_0x1137cc[_0xe823('0x1b')]||null,'role':'agent','internal':_0x1137cc['accountcode']?_[_0xe823('0x14')](_0x1137cc[_0xe823('0x13')]):undefined,'uniqueid':_0x1137cc[_0xe823('0x15')]},'log':_0xe823('0x6')});};