Built motion from commit (unavailable).|2.4.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 _0xf322=['info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message'];(function(_0xa99292,_0xb8964e){var _0x317b2c=function(_0x503258){while(--_0x503258){_0xa99292['push'](_0xa99292['shift']());}};_0x317b2c(++_0xb8964e);}(_0xf322,0x165));var _0x2f32=function(_0x1a9e12,_0x16eeab){_0x1a9e12=_0x1a9e12-0x0;var _0x5d7689=_0xf322[_0x1a9e12];return _0x5d7689;};'use strict';var _=require(_0x2f32('0x0'));var util=require(_0x2f32('0x1'));var moment=require('moment');var BPromise=require(_0x2f32('0x2'));var rs=require(_0x2f32('0x3'));var fs=require('fs');var Redis=require(_0x2f32('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f32('0x5'));var logger=require(_0x2f32('0x6'))('rpc');var config=require(_0x2f32('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2f32('0x8')][_0x2f32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x465eec,_0x11a92f,_0x45705a){return new BPromise(function(_0x326cb3,_0xa63f52){return client[_0x2f32('0xa')](_0x465eec,_0x45705a)[_0x2f32('0xb')](function(_0x295fe7){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x11a92f,_0x2f32('0xc'));logger[_0x2f32('0xd')](_0x2f32('0xe'),_0x11a92f,_0x2f32('0xc'),JSON[_0x2f32('0xf')](_0x295fe7));if(_0x295fe7[_0x2f32('0x10')]){if(_0x295fe7[_0x2f32('0x10')][_0x2f32('0x11')]===0x1f4){logger[_0x2f32('0x10')](_0x2f32('0x12'),_0x11a92f,_0x295fe7[_0x2f32('0x10')]['message']);return _0xa63f52(_0x295fe7[_0x2f32('0x10')][_0x2f32('0x13')]);}logger[_0x2f32('0x10')](_0x2f32('0x12'),_0x11a92f,_0x295fe7[_0x2f32('0x10')]['message']);return _0x326cb3(_0x295fe7[_0x2f32('0x10')][_0x2f32('0x13')]);}else{logger[_0x2f32('0x14')](_0x2f32('0x12'),_0x11a92f,_0x2f32('0xc'));_0x326cb3(_0x295fe7[_0x2f32('0x15')]['message']);}})[_0x2f32('0x16')](function(_0x3f1e71){logger[_0x2f32('0x10')](_0x2f32('0x12'),_0x11a92f,_0x3f1e71);_0xa63f52(_0x3f1e71);});});}exports[_0x2f32('0x17')]=function(_0x4f997b){var _0x55bfcd=this;return new Promise(function(_0xccb3cf,_0x368f1a){return db[_0x2f32('0x18')][_0x2f32('0x19')](_0x4f997b[_0x2f32('0x1a')],{'raw':_0x4f997b['options']?_0x4f997b[_0x2f32('0x1b')][_0x2f32('0x1c')]===undefined?!![]:![]:!![]})[_0x2f32('0xb')](function(_0x3c82a5){logger['info']('CreateVoiceTransferReport',_0x4f997b);logger[_0x2f32('0xd')](_0x2f32('0x17'),_0x4f997b,JSON[_0x2f32('0xf')](_0x3c82a5));_0xccb3cf(_0x3c82a5);})[_0x2f32('0x16')](function(_0x47f2b7){logger[_0x2f32('0x10')](_0x2f32('0x17'),_0x47f2b7[_0x2f32('0x13')],_0x4f997b);_0x368f1a(_0x55bfcd[_0x2f32('0x10')](0x1f4,_0x47f2b7[_0x2f32('0x13')]));});});};