Built motion from commit (unavailable).|2.5.4
[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 _0x8335=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','debug','lodash','moment','bluebird','randomstring'];(function(_0x2f468c,_0x419c9a){var _0xe3f56f=function(_0x1da842){while(--_0x1da842){_0x2f468c['push'](_0x2f468c['shift']());}};_0xe3f56f(++_0x419c9a);}(_0x8335,0x132));var _0x5833=function(_0x5bac89,_0x3d1253){_0x5bac89=_0x5bac89-0x0;var _0xf079aa=_0x8335[_0x5bac89];return _0xf079aa;};'use strict';var _=require(_0x5833('0x0'));var util=require('util');var moment=require(_0x5833('0x1'));var BPromise=require(_0x5833('0x2'));var rs=require(_0x5833('0x3'));var fs=require('fs');var Redis=require(_0x5833('0x4'));var db=require(_0x5833('0x5'))['db'];var utils=require(_0x5833('0x6'));var logger=require(_0x5833('0x7'))(_0x5833('0x8'));var config=require(_0x5833('0x9'));var jayson=require(_0x5833('0xa'));var client=jayson[_0x5833('0xb')][_0x5833('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe47b17,_0x5f462b,_0x5dab9d){return new BPromise(function(_0x3d83d3,_0x373788){return client['request'](_0xe47b17,_0x5dab9d)[_0x5833('0xd')](function(_0x3a388f){logger[_0x5833('0xe')](_0x5833('0xf'),_0x5f462b,_0x5833('0x10'));logger['debug'](_0x5833('0x11'),_0x5f462b,_0x5833('0x10'),JSON[_0x5833('0x12')](_0x3a388f));if(_0x3a388f[_0x5833('0x13')]){if(_0x3a388f['error'][_0x5833('0x14')]===0x1f4){logger[_0x5833('0x13')](_0x5833('0xf'),_0x5f462b,_0x3a388f[_0x5833('0x13')][_0x5833('0x15')]);return _0x373788(_0x3a388f[_0x5833('0x13')][_0x5833('0x15')]);}logger[_0x5833('0x13')](_0x5833('0xf'),_0x5f462b,_0x3a388f[_0x5833('0x13')][_0x5833('0x15')]);return _0x3d83d3(_0x3a388f['error'][_0x5833('0x15')]);}else{logger[_0x5833('0xe')](_0x5833('0xf'),_0x5f462b,_0x5833('0x10'));_0x3d83d3(_0x3a388f[_0x5833('0x16')]['message']);}})[_0x5833('0x17')](function(_0x5d8231){logger[_0x5833('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x5f462b,_0x5d8231);_0x373788(_0x5d8231);});});}exports['CreateVoiceTransferReport']=function(_0x4c6ec1){var _0x206a5e=this;return new Promise(function(_0x123178,_0x1bbd67){return db[_0x5833('0x18')][_0x5833('0x19')](_0x4c6ec1[_0x5833('0x1a')],{'raw':_0x4c6ec1[_0x5833('0x1b')]?_0x4c6ec1[_0x5833('0x1b')][_0x5833('0x1c')]===undefined?!![]:![]:!![]})[_0x5833('0xd')](function(_0x1ee954){logger[_0x5833('0xe')](_0x5833('0x1d'),_0x4c6ec1);logger[_0x5833('0x1e')](_0x5833('0x1d'),_0x4c6ec1,JSON[_0x5833('0x12')](_0x1ee954));_0x123178(_0x1ee954);})[_0x5833('0x17')](function(_0x5f5174){logger[_0x5833('0x13')](_0x5833('0x1d'),_0x5f5174[_0x5833('0x15')],_0x4c6ec1);_0x1bbd67(_0x206a5e[_0x5833('0x13')](0x1f4,_0x5f5174[_0x5833('0x15')]));});});};