Built motion from commit (unavailable).|2.5.9
[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 _0xb43b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceTransferReport','create','body','options','info','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0xb43b,0xbf));var _0xbb43=function(_0x3ed9d3,_0xc76441){_0x3ed9d3=_0x3ed9d3-0x0;var _0x276215=_0xb43b[_0x3ed9d3];return _0x276215;};'use strict';var _=require(_0xbb43('0x0'));var util=require('util');var moment=require(_0xbb43('0x1'));var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require(_0xbb43('0x5'))['db'];var utils=require(_0xbb43('0x6'));var logger=require(_0xbb43('0x7'))(_0xbb43('0x8'));var config=require(_0xbb43('0x9'));var jayson=require(_0xbb43('0xa'));var client=jayson[_0xbb43('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16fc1c,_0x4a070c,_0x54806a){return new BPromise(function(_0x33f9a8,_0x120d67){return client[_0xbb43('0xc')](_0x16fc1c,_0x54806a)[_0xbb43('0xd')](function(_0x117f4d){logger['info'](_0xbb43('0xe'),_0x4a070c,_0xbb43('0xf'));logger[_0xbb43('0x10')](_0xbb43('0x11'),_0x4a070c,'request\x20sent',JSON[_0xbb43('0x12')](_0x117f4d));if(_0x117f4d[_0xbb43('0x13')]){if(_0x117f4d['error']['code']===0x1f4){logger['error'](_0xbb43('0xe'),_0x4a070c,_0x117f4d['error'][_0xbb43('0x14')]);return _0x120d67(_0x117f4d['error'][_0xbb43('0x14')]);}logger[_0xbb43('0x13')](_0xbb43('0xe'),_0x4a070c,_0x117f4d[_0xbb43('0x13')][_0xbb43('0x14')]);return _0x33f9a8(_0x117f4d['error'][_0xbb43('0x14')]);}else{logger['info'](_0xbb43('0xe'),_0x4a070c,_0xbb43('0xf'));_0x33f9a8(_0x117f4d[_0xbb43('0x15')][_0xbb43('0x14')]);}})[_0xbb43('0x16')](function(_0x126f61){logger[_0xbb43('0x13')](_0xbb43('0xe'),_0x4a070c,_0x126f61);_0x120d67(_0x126f61);});});}exports[_0xbb43('0x17')]=function(_0x4c223b){var _0xe15a1b=this;return new Promise(function(_0x4cb0b2,_0x78df91){return db['VoiceTransferReport'][_0xbb43('0x18')](_0x4c223b[_0xbb43('0x19')],{'raw':_0x4c223b[_0xbb43('0x1a')]?_0x4c223b[_0xbb43('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xbb43('0xd')](function(_0x6cdc26){logger[_0xbb43('0x1b')](_0xbb43('0x17'),_0x4c223b);logger[_0xbb43('0x10')](_0xbb43('0x17'),_0x4c223b,JSON[_0xbb43('0x12')](_0x6cdc26));_0x4cb0b2(_0x6cdc26);})[_0xbb43('0x16')](function(_0x3409d0){logger[_0xbb43('0x13')](_0xbb43('0x17'),_0x3409d0[_0xbb43('0x14')],_0x4c223b);_0x78df91(_0xe15a1b[_0xbb43('0x13')](0x1f4,_0x3409d0[_0xbb43('0x14')]));});});};