Built motion from commit (unavailable).|2.4.21
[motion2.git] / server / api / voiceContext / voiceContext.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 _0x6cdf=['code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x455ee4,_0x5c7974){var _0x35b73e=function(_0x2786a7){while(--_0x2786a7){_0x455ee4['push'](_0x455ee4['shift']());}};_0x35b73e(++_0x5c7974);}(_0x6cdf,0x1d2));var _0xf6cd=function(_0x40da2f,_0x37e0cb){_0x40da2f=_0x40da2f-0x0;var _0x416bba=_0x6cdf[_0x40da2f];return _0x416bba;};'use strict';var _=require('lodash');var util=require(_0xf6cd('0x0'));var moment=require(_0xf6cd('0x1'));var BPromise=require('bluebird');var rs=require(_0xf6cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6cd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6cd('0x4'))(_0xf6cd('0x5'));var config=require(_0xf6cd('0x6'));var jayson=require(_0xf6cd('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3daaf2,_0x405cca,_0x556ab1){return new BPromise(function(_0x39369d,_0x2cfb8c){return client[_0xf6cd('0x8')](_0x3daaf2,_0x556ab1)[_0xf6cd('0x9')](function(_0x302dc1){logger[_0xf6cd('0xa')](_0xf6cd('0xb'),_0x405cca,'request\x20sent');logger[_0xf6cd('0xc')](_0xf6cd('0xd'),_0x405cca,_0xf6cd('0xe'),JSON[_0xf6cd('0xf')](_0x302dc1));if(_0x302dc1['error']){if(_0x302dc1[_0xf6cd('0x10')][_0xf6cd('0x11')]===0x1f4){logger[_0xf6cd('0x10')]('VoiceContext,\x20%s,\x20%s',_0x405cca,_0x302dc1[_0xf6cd('0x10')][_0xf6cd('0x12')]);return _0x2cfb8c(_0x302dc1[_0xf6cd('0x10')][_0xf6cd('0x12')]);}logger[_0xf6cd('0x10')]('VoiceContext,\x20%s,\x20%s',_0x405cca,_0x302dc1[_0xf6cd('0x10')]['message']);return _0x39369d(_0x302dc1['error'][_0xf6cd('0x12')]);}else{logger[_0xf6cd('0xa')](_0xf6cd('0xb'),_0x405cca,_0xf6cd('0xe'));_0x39369d(_0x302dc1[_0xf6cd('0x13')][_0xf6cd('0x12')]);}})[_0xf6cd('0x14')](function(_0x47b137){logger[_0xf6cd('0x10')]('VoiceContext,\x20%s,\x20%s',_0x405cca,_0x47b137);_0x2cfb8c(_0x47b137);});});}