Built motion from commit 43538d75.|2.5.35
[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 _0x1fe4=['error','code','message','info','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x8cb86,_0xcb0904){var _0x52bcb7=function(_0x9fcbb1){while(--_0x9fcbb1){_0x8cb86['push'](_0x8cb86['shift']());}};_0x52bcb7(++_0xcb0904);}(_0x1fe4,0x1a9));var _0x41fe=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0x1fe4[_0x15dbca];return _0x326533;};'use strict';var _=require(_0x41fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x41fe('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41fe('0x2'));var db=require(_0x41fe('0x3'))['db'];var utils=require(_0x41fe('0x4'));var logger=require(_0x41fe('0x5'))(_0x41fe('0x6'));var config=require(_0x41fe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x41fe('0x8')][_0x41fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c63ff,_0x5537f3,_0x5d032c){return new BPromise(function(_0x25e33d,_0x29382b){return client[_0x41fe('0xa')](_0x2c63ff,_0x5d032c)[_0x41fe('0xb')](function(_0x22c692){logger['info'](_0x41fe('0xc'),_0x5537f3,'request\x20sent');logger[_0x41fe('0xd')](_0x41fe('0xe'),_0x5537f3,_0x41fe('0xf'),JSON[_0x41fe('0x10')](_0x22c692));if(_0x22c692['error']){if(_0x22c692[_0x41fe('0x11')][_0x41fe('0x12')]===0x1f4){logger[_0x41fe('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x5537f3,_0x22c692['error'][_0x41fe('0x13')]);return _0x29382b(_0x22c692[_0x41fe('0x11')][_0x41fe('0x13')]);}logger[_0x41fe('0x11')](_0x41fe('0xc'),_0x5537f3,_0x22c692['error'][_0x41fe('0x13')]);return _0x25e33d(_0x22c692[_0x41fe('0x11')]['message']);}else{logger[_0x41fe('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x5537f3,'request\x20sent');_0x25e33d(_0x22c692['result'][_0x41fe('0x13')]);}})[_0x41fe('0x15')](function(_0x2c79de){logger[_0x41fe('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x5537f3,_0x2c79de);_0x29382b(_0x2c79de);});});}exports[_0x41fe('0x16')]=function(_0x49676c){var _0x5a985d=this;return new Promise(function(_0x288ce7,_0x47aa92){return db[_0x41fe('0x17')]['create'](_0x49676c[_0x41fe('0x18')],{'raw':_0x49676c['options']?_0x49676c[_0x41fe('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x41fe('0xb')](function(_0x3ecf20){logger[_0x41fe('0x14')](_0x41fe('0x16'),_0x49676c);logger[_0x41fe('0xd')](_0x41fe('0x16'),_0x49676c,JSON['stringify'](_0x3ecf20));_0x288ce7(_0x3ecf20);})[_0x41fe('0x15')](function(_0x333eee){logger[_0x41fe('0x11')]('CreateVoiceTransferReport',_0x333eee['message'],_0x49676c);_0x47aa92(_0x5a985d[_0x41fe('0x11')](0x1f4,_0x333eee['message']));});});};