9fa06834490eb14c5a38a8ee80b285567fd73b4b
[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 _0x6bf8=['starttime','endtime','seconds','outbound','exten','dialstring','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','CreateMemberReport','voice','lastAssignedTo','isNil','format','SIP/%s','interface','queuecallerleaveAt','diff','inbound','calleridnum','agent','accountcode','toNumber','uniqueid','voiceDialReport','Request','membername','TALKING'];(function(_0x460fe3,_0x594db1){var _0x79d36a=function(_0x4fbe3f){while(--_0x4fbe3f){_0x460fe3['push'](_0x460fe3['shift']());}};_0x79d36a(++_0x594db1);}(_0x6bf8,0x1c8));var _0x86bf=function(_0x569f9a,_0x58cc03){_0x569f9a=_0x569f9a-0x0;var _0x33cafb=_0x6bf8[_0x569f9a];return _0x33cafb;};'use strict';var moment=require('moment');var _=require(_0x86bf('0x0'));var util=require(_0x86bf('0x1'));var client=require(_0x86bf('0x2'));exports[_0x86bf('0x3')]=function(_0x3172d5){var _0x2bfc64=_0x3172d5[_0x86bf('0x4')]||_0x3172d5['queuecallerexitAt'];return client['Request'](_0x86bf('0x5'),{'body':{'channel':_0x86bf('0x6'),'membername':_0x3172d5[_0x86bf('0x7')],'interface':_[_0x86bf('0x8')](_0x3172d5['interface'])?util[_0x86bf('0x9')](_0x86bf('0xa'),_0x3172d5[_0x86bf('0x7')]):_0x3172d5[_0x86bf('0xb')],'type':'TALKING','enterAt':_0x3172d5[_0x86bf('0xc')],'exitAt':_0x2bfc64,'duration':moment(_0x2bfc64)[_0x86bf('0xd')](_0x3172d5[_0x86bf('0xc')],'seconds'),'data1':_0x86bf('0xe'),'data2':_0x3172d5[_0x86bf('0xf')],'data3':_0x3172d5['exten'],'data4':null,'data5':_0x3172d5['queue'],'role':_0x86bf('0x10'),'internal':_0x3172d5[_0x86bf('0x11')]?_[_0x86bf('0x12')](_0x3172d5['accountcode']):undefined,'uniqueid':_0x3172d5[_0x86bf('0x13')]},'log':'CreateMemberReport'});};exports[_0x86bf('0x14')]=function(_0x455b5b){return client[_0x86bf('0x15')](_0x86bf('0x5'),{'body':{'channel':_0x86bf('0x6'),'membername':_0x455b5b[_0x86bf('0x16')],'interface':_0x455b5b[_0x86bf('0xb')],'type':_0x86bf('0x17'),'enterAt':_0x455b5b[_0x86bf('0x18')],'exitAt':_0x455b5b[_0x86bf('0x19')],'duration':moment(_0x455b5b[_0x86bf('0x19')])[_0x86bf('0xd')](_0x455b5b[_0x86bf('0x18')],_0x86bf('0x1a'))>=0x0?moment(_0x455b5b[_0x86bf('0x19')])[_0x86bf('0xd')](_0x455b5b[_0x86bf('0x18')],_0x86bf('0x1a')):null,'data1':_0x86bf('0x1b'),'data2':_0x455b5b['accountcode'],'data3':_0x455b5b[_0x86bf('0x1c')],'data4':_0x455b5b[_0x86bf('0x1d')]||null,'role':'agent','internal':_0x455b5b[_0x86bf('0x11')]?_[_0x86bf('0x12')](_0x455b5b[_0x86bf('0x11')]):undefined,'uniqueid':_0x455b5b[_0x86bf('0x13')]},'log':'CreateMemberReport'});};