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 _0x7662=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7662,0xd2));var _0x2766=function(_0x21e85f,_0x5d141b){_0x21e85f=_0x21e85f-0x0;var _0x31978b=_0x7662[_0x21e85f];return _0x31978b;};'use strict';var _=require(_0x2766('0x0'));var util=require(_0x2766('0x1'));var moment=require(_0x2766('0x2'));var BPromise=require('bluebird');var rs=require(_0x2766('0x3'));var fs=require('fs');var Redis=require(_0x2766('0x4'));var db=require(_0x2766('0x5'))['db'];var utils=require(_0x2766('0x6'));var logger=require('../../config/logger')(_0x2766('0x7'));var config=require(_0x2766('0x8'));var jayson=require(_0x2766('0x9'));var client=jayson[_0x2766('0xa')][_0x2766('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a9852,_0x57930d,_0x40d57b){return new BPromise(function(_0x571ca7,_0x229f06){return client['request'](_0x1a9852,_0x40d57b)['then'](function(_0xf8c0d4){logger[_0x2766('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x57930d,_0x2766('0xd'));logger['debug'](_0x2766('0xe'),_0x57930d,_0x2766('0xd'),JSON['stringify'](_0xf8c0d4));if(_0xf8c0d4[_0x2766('0xf')]){if(_0xf8c0d4[_0x2766('0xf')]['code']===0x1f4){logger['error'](_0x2766('0x10'),_0x57930d,_0xf8c0d4[_0x2766('0xf')][_0x2766('0x11')]);return _0x229f06(_0xf8c0d4[_0x2766('0xf')][_0x2766('0x11')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x57930d,_0xf8c0d4[_0x2766('0xf')][_0x2766('0x11')]);return _0x571ca7(_0xf8c0d4[_0x2766('0xf')]['message']);}else{logger[_0x2766('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x57930d,'request\x20sent');_0x571ca7(_0xf8c0d4[_0x2766('0x12')]['message']);}})[_0x2766('0x13')](function(_0x20c0c2){logger['error'](_0x2766('0x10'),_0x57930d,_0x20c0c2);_0x229f06(_0x20c0c2);});});}exports[_0x2766('0x14')]=function(_0x5793a1){var _0x2bec43=this;return new Promise(function(_0x46f9e6,_0x5e4e8d){return db[_0x2766('0x15')][_0x2766('0x16')](_0x5793a1['body'],{'raw':_0x5793a1[_0x2766('0x17')]?_0x5793a1['options'][_0x2766('0x18')]===undefined?!![]:![]:!![]})[_0x2766('0x19')](function(_0x20af2b){logger[_0x2766('0xc')]('CreateVoiceTransferReport',_0x5793a1);logger[_0x2766('0x1a')](_0x2766('0x14'),_0x5793a1,JSON['stringify'](_0x20af2b));_0x46f9e6(_0x20af2b);})[_0x2766('0x13')](function(_0x52d42b){logger[_0x2766('0xf')]('CreateVoiceTransferReport',_0x52d42b[_0x2766('0x11')],_0x5793a1);_0x5e4e8d(_0x2bec43['error'](0x1f4,_0x52d42b[_0x2766('0x11')]));});});};