Built motion from commit (unavailable).|2.5.11
[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 _0xd624=['code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','debug','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3548eb,_0x1f9f39){var _0x15b85c=function(_0x385ce5){while(--_0x385ce5){_0x3548eb['push'](_0x3548eb['shift']());}};_0x15b85c(++_0x1f9f39);}(_0xd624,0x124));var _0x4d62=function(_0x3b5d44,_0x2aab40){_0x3b5d44=_0x3b5d44-0x0;var _0x146e22=_0xd624[_0x3b5d44];return _0x146e22;};'use strict';var _=require(_0x4d62('0x0'));var util=require(_0x4d62('0x1'));var moment=require('moment');var BPromise=require(_0x4d62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d62('0x3'));var logger=require(_0x4d62('0x4'))(_0x4d62('0x5'));var config=require(_0x4d62('0x6'));var jayson=require(_0x4d62('0x7'));var client=jayson[_0x4d62('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba7a1,_0x133d24,_0x3d6f78){return new BPromise(function(_0x12bf3c,_0x1377c3){return client[_0x4d62('0x9')](_0x4ba7a1,_0x3d6f78)['then'](function(_0x19e6cb){logger[_0x4d62('0xa')](_0x4d62('0xb'),_0x133d24,_0x4d62('0xc'));logger['debug'](_0x4d62('0xd'),_0x133d24,_0x4d62('0xc'),JSON[_0x4d62('0xe')](_0x19e6cb));if(_0x19e6cb[_0x4d62('0xf')]){if(_0x19e6cb[_0x4d62('0xf')][_0x4d62('0x10')]===0x1f4){logger[_0x4d62('0xf')](_0x4d62('0xb'),_0x133d24,_0x19e6cb[_0x4d62('0xf')][_0x4d62('0x11')]);return _0x1377c3(_0x19e6cb[_0x4d62('0xf')][_0x4d62('0x11')]);}logger['error'](_0x4d62('0xb'),_0x133d24,_0x19e6cb[_0x4d62('0xf')][_0x4d62('0x11')]);return _0x12bf3c(_0x19e6cb['error'][_0x4d62('0x11')]);}else{logger[_0x4d62('0xa')](_0x4d62('0xb'),_0x133d24,_0x4d62('0xc'));_0x12bf3c(_0x19e6cb[_0x4d62('0x12')][_0x4d62('0x11')]);}})[_0x4d62('0x13')](function(_0x55060d){logger['error'](_0x4d62('0xb'),_0x133d24,_0x55060d);_0x1377c3(_0x55060d);});});}exports[_0x4d62('0x14')]=function(_0x54920b){var _0x17a0e6=this;return new Promise(function(_0x27ca77,_0x11ed47){return db[_0x4d62('0x15')][_0x4d62('0x16')](_0x54920b[_0x4d62('0x17')],{'raw':_0x54920b[_0x4d62('0x18')]?_0x54920b[_0x4d62('0x18')][_0x4d62('0x19')]===undefined?!![]:![]:!![]})[_0x4d62('0x1a')](function(_0x494a8f){logger['info']('CreateVoiceTransferReport',_0x54920b);logger[_0x4d62('0x1b')](_0x4d62('0x14'),_0x54920b,JSON[_0x4d62('0xe')](_0x494a8f));_0x27ca77(_0x494a8f);})['catch'](function(_0x3a5e4f){logger[_0x4d62('0xf')](_0x4d62('0x14'),_0x3a5e4f['message'],_0x54920b);_0x11ed47(_0x17a0e6[_0x4d62('0xf')](0x1f4,_0x3a5e4f[_0x4d62('0x11')]));});});};