Built motion from commit fe909640.|2.6.8
[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 _0xd57b=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','catch','lodash','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent'];(function(_0x5971eb,_0x53ead0){var _0x1454a2=function(_0x31bb26){while(--_0x31bb26){_0x5971eb['push'](_0x5971eb['shift']());}};_0x1454a2(++_0x53ead0);}(_0xd57b,0x1be));var _0xbd57=function(_0x254744,_0x219e6b){_0x254744=_0x254744-0x0;var _0x2a6a96=_0xd57b[_0x254744];return _0x2a6a96;};'use strict';var _=require(_0xbd57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd57('0x1'));var db=require(_0xbd57('0x2'))['db'];var utils=require(_0xbd57('0x3'));var logger=require('../../config/logger')(_0xbd57('0x4'));var config=require('../../config/environment');var jayson=require(_0xbd57('0x5'));var client=jayson['client'][_0xbd57('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a8df9,_0x453e94,_0xeba986){return new BPromise(function(_0x8fe30b,_0x32ee5f){return client[_0xbd57('0x7')](_0x1a8df9,_0xeba986)[_0xbd57('0x8')](function(_0x3aad6a){logger['info']('VoiceContext,\x20%s,\x20%s',_0x453e94,_0xbd57('0x9'));logger[_0xbd57('0xa')](_0xbd57('0xb'),_0x453e94,_0xbd57('0x9'),JSON[_0xbd57('0xc')](_0x3aad6a));if(_0x3aad6a[_0xbd57('0xd')]){if(_0x3aad6a[_0xbd57('0xd')][_0xbd57('0xe')]===0x1f4){logger[_0xbd57('0xd')](_0xbd57('0xf'),_0x453e94,_0x3aad6a[_0xbd57('0xd')][_0xbd57('0x10')]);return _0x32ee5f(_0x3aad6a['error'][_0xbd57('0x10')]);}logger[_0xbd57('0xd')]('VoiceContext,\x20%s,\x20%s',_0x453e94,_0x3aad6a[_0xbd57('0xd')][_0xbd57('0x10')]);return _0x8fe30b(_0x3aad6a[_0xbd57('0xd')][_0xbd57('0x10')]);}else{logger[_0xbd57('0x11')](_0xbd57('0xf'),_0x453e94,_0xbd57('0x9'));_0x8fe30b(_0x3aad6a['result']['message']);}})[_0xbd57('0x12')](function(_0x18da7e){logger[_0xbd57('0xd')](_0xbd57('0xf'),_0x453e94,_0x18da7e);_0x32ee5f(_0x18da7e);});});}