Built motion from commit a134ab58.|2.6.29
[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 _0x2839=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options'];(function(_0x2f176f,_0x2e3968){var _0x5d5d70=function(_0x5b25e7){while(--_0x5b25e7){_0x2f176f['push'](_0x2f176f['shift']());}};_0x5d5d70(++_0x2e3968);}(_0x2839,0xd8));var _0x9283=function(_0x3a790d,_0x48764f){_0x3a790d=_0x3a790d-0x0;var _0x6db16=_0x2839[_0x3a790d];return _0x6db16;};'use strict';var _=require(_0x9283('0x0'));var util=require(_0x9283('0x1'));var moment=require(_0x9283('0x2'));var BPromise=require(_0x9283('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9283('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9283('0x5'));var logger=require(_0x9283('0x6'))(_0x9283('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9283('0x8')][_0x9283('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x148b91,_0x370a1b,_0x5d5318){return new BPromise(function(_0x77161d,_0x5301dc){return client[_0x9283('0xa')](_0x148b91,_0x5d5318)[_0x9283('0xb')](function(_0x2e476e){logger[_0x9283('0xc')](_0x9283('0xd'),_0x370a1b,_0x9283('0xe'));logger[_0x9283('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x370a1b,'request\x20sent',JSON[_0x9283('0x10')](_0x2e476e));if(_0x2e476e[_0x9283('0x11')]){if(_0x2e476e[_0x9283('0x11')][_0x9283('0x12')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x370a1b,_0x2e476e[_0x9283('0x11')]['message']);return _0x5301dc(_0x2e476e[_0x9283('0x11')][_0x9283('0x13')]);}logger[_0x9283('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x370a1b,_0x2e476e['error'][_0x9283('0x13')]);return _0x77161d(_0x2e476e[_0x9283('0x11')]['message']);}else{logger[_0x9283('0xc')](_0x9283('0xd'),_0x370a1b,_0x9283('0xe'));_0x77161d(_0x2e476e[_0x9283('0x14')]['message']);}})[_0x9283('0x15')](function(_0x19934a){logger[_0x9283('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x370a1b,_0x19934a);_0x5301dc(_0x19934a);});});}exports[_0x9283('0x16')]=function(_0x3ac938){var _0xb8b0a=this;return new Promise(function(_0x16eeac,_0x17a7de){return db[_0x9283('0x17')][_0x9283('0x18')](_0x3ac938[_0x9283('0x19')],{'raw':_0x3ac938[_0x9283('0x1a')]?_0x3ac938['options']['raw']===undefined?!![]:![]:!![]})[_0x9283('0xb')](function(_0x2f6a71){logger[_0x9283('0xc')](_0x9283('0x16'),_0x3ac938);logger['debug'](_0x9283('0x16'),_0x3ac938,JSON[_0x9283('0x10')](_0x2f6a71));_0x16eeac(_0x2f6a71);})['catch'](function(_0x435326){logger[_0x9283('0x11')](_0x9283('0x16'),_0x435326['message'],_0x3ac938);_0x17a7de(_0xb8b0a[_0x9283('0x11')](0x1f4,_0x435326[_0x9283('0x13')]));});});};