Built motion from commit b5413ace.|2.6.9
[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 _0xf604=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','code','error','VoiceContext,\x20%s,\x20%s','message'];(function(_0x1585b8,_0x27876a){var _0x11d594=function(_0x37cb59){while(--_0x37cb59){_0x1585b8['push'](_0x1585b8['shift']());}};_0x11d594(++_0x27876a);}(_0xf604,0x1a4));var _0x4f60=function(_0x20634c,_0x5534fc){_0x20634c=_0x20634c-0x0;var _0x5d8936=_0xf604[_0x20634c];return _0x5d8936;};'use strict';var _=require(_0x4f60('0x0'));var util=require(_0x4f60('0x1'));var moment=require(_0x4f60('0x2'));var BPromise=require(_0x4f60('0x3'));var rs=require(_0x4f60('0x4'));var fs=require('fs');var Redis=require(_0x4f60('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4f60('0x6'))(_0x4f60('0x7'));var config=require(_0x4f60('0x8'));var jayson=require(_0x4f60('0x9'));var client=jayson[_0x4f60('0xa')][_0x4f60('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf758bb,_0x48bf70,_0x39e283){return new BPromise(function(_0x3818d4,_0x43c2bf){return client['request'](_0xf758bb,_0x39e283)['then'](function(_0x4fdf1b){logger[_0x4f60('0xc')]('VoiceContext,\x20%s,\x20%s',_0x48bf70,_0x4f60('0xd'));logger[_0x4f60('0xe')](_0x4f60('0xf'),_0x48bf70,_0x4f60('0xd'),JSON['stringify'](_0x4fdf1b));if(_0x4fdf1b['error']){if(_0x4fdf1b['error'][_0x4f60('0x10')]===0x1f4){logger[_0x4f60('0x11')](_0x4f60('0x12'),_0x48bf70,_0x4fdf1b[_0x4f60('0x11')]['message']);return _0x43c2bf(_0x4fdf1b[_0x4f60('0x11')][_0x4f60('0x13')]);}logger['error'](_0x4f60('0x12'),_0x48bf70,_0x4fdf1b[_0x4f60('0x11')][_0x4f60('0x13')]);return _0x3818d4(_0x4fdf1b['error'][_0x4f60('0x13')]);}else{logger[_0x4f60('0xc')]('VoiceContext,\x20%s,\x20%s',_0x48bf70,_0x4f60('0xd'));_0x3818d4(_0x4fdf1b[_0x4f60('0x14')][_0x4f60('0x13')]);}})[_0x4f60('0x15')](function(_0x5a93e9){logger[_0x4f60('0x11')]('VoiceContext,\x20%s,\x20%s',_0x48bf70,_0x5a93e9);_0x43c2bf(_0x5a93e9);});});}