Built motion from commit 85f716e9.|2.6.8
[motion2.git] / server / api / voiceTransferReport / voiceTransferReport.rpc.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 _0x45d6=['CreateVoiceTransferReport','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','result','catch','VoiceTransferReport','create','body','options','raw'];(function(_0x321223,_0x5beb9e){var _0x9ebe09=function(_0x2e6b3d){while(--_0x2e6b3d){_0x321223['push'](_0x321223['shift']());}};_0x9ebe09(++_0x5beb9e);}(_0x45d6,0x69));var _0x645d=function(_0x313de8,_0x6d5d77){_0x313de8=_0x313de8-0x0;var _0xa4a1ed=_0x45d6[_0x313de8];return _0xa4a1ed;};'use strict';var _=require(_0x645d('0x0'));var util=require(_0x645d('0x1'));var moment=require(_0x645d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x645d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x645d('0x4'));var logger=require(_0x645d('0x5'))('rpc');var config=require(_0x645d('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5fde99,_0x5e166b,_0x52dd8b){return new BPromise(function(_0x3ded1,_0x34b6c2){return client[_0x645d('0x7')](_0x5fde99,_0x52dd8b)[_0x645d('0x8')](function(_0x5b9d81){logger[_0x645d('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x5e166b,_0x645d('0xa'));logger[_0x645d('0xb')](_0x645d('0xc'),_0x5e166b,_0x645d('0xa'),JSON[_0x645d('0xd')](_0x5b9d81));if(_0x5b9d81[_0x645d('0xe')]){if(_0x5b9d81[_0x645d('0xe')][_0x645d('0xf')]===0x1f4){logger[_0x645d('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x5e166b,_0x5b9d81['error']['message']);return _0x34b6c2(_0x5b9d81[_0x645d('0xe')][_0x645d('0x10')]);}logger[_0x645d('0xe')](_0x645d('0x11'),_0x5e166b,_0x5b9d81['error'][_0x645d('0x10')]);return _0x3ded1(_0x5b9d81[_0x645d('0xe')][_0x645d('0x10')]);}else{logger[_0x645d('0x9')](_0x645d('0x11'),_0x5e166b,_0x645d('0xa'));_0x3ded1(_0x5b9d81[_0x645d('0x12')][_0x645d('0x10')]);}})[_0x645d('0x13')](function(_0x2c305a){logger[_0x645d('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x5e166b,_0x2c305a);_0x34b6c2(_0x2c305a);});});}exports['CreateVoiceTransferReport']=function(_0xf1d8c2){var _0x31ebc2=this;return new Promise(function(_0x26bca7,_0x752426){return db[_0x645d('0x14')][_0x645d('0x15')](_0xf1d8c2[_0x645d('0x16')],{'raw':_0xf1d8c2['options']?_0xf1d8c2[_0x645d('0x17')][_0x645d('0x18')]===undefined?!![]:![]:!![]})[_0x645d('0x8')](function(_0x44e328){logger['info'](_0x645d('0x19'),_0xf1d8c2);logger['debug'](_0x645d('0x19'),_0xf1d8c2,JSON[_0x645d('0xd')](_0x44e328));_0x26bca7(_0x44e328);})[_0x645d('0x13')](function(_0x26a53e){logger[_0x645d('0xe')](_0x645d('0x19'),_0x26a53e[_0x645d('0x10')],_0xf1d8c2);_0x752426(_0x31ebc2[_0x645d('0xe')](0x1f4,_0x26a53e[_0x645d('0x10')]));});});};