Built motion from commit 0c5f406c.|2.6.29
[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 _0xff3f=['toNumber','voiceDialReport','membername','TALKING','endtime','starttime','outbound','uniqueid','moment','util','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','interface','SIP/%s','lastAssignedTo','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode'];(function(_0x53f943,_0x2ed7d4){var _0x33a3d2=function(_0x452972){while(--_0x452972){_0x53f943['push'](_0x53f943['shift']());}};_0x33a3d2(++_0x2ed7d4);}(_0xff3f,0xb0));var _0xfff3=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0xff3f[_0x545bed];return _0x16c79c;};'use strict';var moment=require(_0xfff3('0x0'));var _=require('lodash');var util=require(_0xfff3('0x1'));var client=require('../client');exports[_0xfff3('0x2')]=function(_0x1d0b95){var _0x521fdf=_0x1d0b95['queuecallercompleteAt']||_0x1d0b95[_0xfff3('0x3')];return client[_0xfff3('0x4')](_0xfff3('0x5'),{'body':{'channel':_0xfff3('0x6'),'membername':_0x1d0b95['lastAssignedTo'],'interface':_[_0xfff3('0x7')](_0x1d0b95[_0xfff3('0x8')])?util['format'](_0xfff3('0x9'),_0x1d0b95[_0xfff3('0xa')]):_0x1d0b95[_0xfff3('0x8')],'type':'TALKING','enterAt':_0x1d0b95['queuecallerleaveAt'],'exitAt':_0x521fdf,'duration':moment(_0x521fdf)[_0xfff3('0xb')](_0x1d0b95[_0xfff3('0xc')],_0xfff3('0xd')),'data1':_0xfff3('0xe'),'data2':_0x1d0b95[_0xfff3('0xf')],'data3':_0x1d0b95[_0xfff3('0x10')],'data4':null,'data5':_0x1d0b95[_0xfff3('0x11')],'role':_0xfff3('0x12'),'internal':_0x1d0b95[_0xfff3('0x13')]?_[_0xfff3('0x14')](_0x1d0b95[_0xfff3('0x13')]):undefined,'uniqueid':_0x1d0b95['uniqueid']},'log':'CreateMemberReport'});};exports[_0xfff3('0x15')]=function(_0x4dc2aa){return client[_0xfff3('0x4')]('CreateMemberReport',{'body':{'channel':_0xfff3('0x6'),'membername':_0x4dc2aa[_0xfff3('0x16')],'interface':_0x4dc2aa['interface'],'type':_0xfff3('0x17'),'enterAt':_0x4dc2aa['starttime'],'exitAt':_0x4dc2aa[_0xfff3('0x18')],'duration':moment(_0x4dc2aa[_0xfff3('0x18')])['diff'](_0x4dc2aa[_0xfff3('0x19')],'seconds')>=0x0?moment(_0x4dc2aa['endtime'])[_0xfff3('0xb')](_0x4dc2aa[_0xfff3('0x19')],_0xfff3('0xd')):null,'data1':_0xfff3('0x1a'),'data2':_0x4dc2aa['accountcode'],'data3':_0x4dc2aa['exten'],'data4':_0x4dc2aa['dialstring']||null,'role':_0xfff3('0x12'),'internal':_0x4dc2aa['accountcode']?_[_0xfff3('0x14')](_0x4dc2aa[_0xfff3('0x13')]):undefined,'uniqueid':_0x4dc2aa[_0xfff3('0x1b')]},'log':_0xfff3('0x5')});};