Built motion from commit (unavailable).|2.5.14
[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 _0x90ef=['moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','raw','stringify','lodash'];(function(_0x4f6b32,_0x17239f){var _0xddf425=function(_0x1eb3ff){while(--_0x1eb3ff){_0x4f6b32['push'](_0x4f6b32['shift']());}};_0xddf425(++_0x17239f);}(_0x90ef,0x8f));var _0xf90e=function(_0x881c21,_0x22f1ce){_0x881c21=_0x881c21-0x0;var _0xcf0b84=_0x90ef[_0x881c21];return _0xcf0b84;};'use strict';var _=require(_0xf90e('0x0'));var util=require('util');var moment=require(_0xf90e('0x1'));var BPromise=require(_0xf90e('0x2'));var rs=require(_0xf90e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf90e('0x4'));var config=require(_0xf90e('0x5'));var jayson=require(_0xf90e('0x6'));var client=jayson['client'][_0xf90e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x59086f,_0x4883ed,_0x3c65fa){return new BPromise(function(_0x21b10e,_0x1b2d7e){return client[_0xf90e('0x8')](_0x59086f,_0x3c65fa)[_0xf90e('0x9')](function(_0x1262f3){logger[_0xf90e('0xa')](_0xf90e('0xb'),_0x4883ed,_0xf90e('0xc'));logger[_0xf90e('0xd')](_0xf90e('0xe'),_0x4883ed,_0xf90e('0xc'),JSON['stringify'](_0x1262f3));if(_0x1262f3[_0xf90e('0xf')]){if(_0x1262f3['error'][_0xf90e('0x10')]===0x1f4){logger['error'](_0xf90e('0xb'),_0x4883ed,_0x1262f3[_0xf90e('0xf')][_0xf90e('0x11')]);return _0x1b2d7e(_0x1262f3[_0xf90e('0xf')][_0xf90e('0x11')]);}logger[_0xf90e('0xf')](_0xf90e('0xb'),_0x4883ed,_0x1262f3[_0xf90e('0xf')][_0xf90e('0x11')]);return _0x21b10e(_0x1262f3[_0xf90e('0xf')][_0xf90e('0x11')]);}else{logger[_0xf90e('0xa')](_0xf90e('0xb'),_0x4883ed,_0xf90e('0xc'));_0x21b10e(_0x1262f3[_0xf90e('0x12')]['message']);}})['catch'](function(_0x2abf44){logger[_0xf90e('0xf')](_0xf90e('0xb'),_0x4883ed,_0x2abf44);_0x1b2d7e(_0x2abf44);});});}exports[_0xf90e('0x13')]=function(_0x5a5593){var _0x257c8a=this;return new Promise(function(_0x57908d,_0x2b7d9b){return db[_0xf90e('0x14')][_0xf90e('0x15')](_0x5a5593['body'],{'raw':_0x5a5593['options']?_0x5a5593['options'][_0xf90e('0x16')]===undefined?!![]:![]:!![]})[_0xf90e('0x9')](function(_0x5ce523){logger['info'](_0xf90e('0x13'),_0x5a5593);logger[_0xf90e('0xd')](_0xf90e('0x13'),_0x5a5593,JSON[_0xf90e('0x17')](_0x5ce523));_0x57908d(_0x5ce523);})['catch'](function(_0x1662b3){logger[_0xf90e('0xf')](_0xf90e('0x13'),_0x1662b3['message'],_0x5a5593);_0x2b7d9b(_0x257c8a['error'](0x1f4,_0x1662b3[_0xf90e('0x11')]));});});};