Built motion from commit (unavailable).|2.5.31
[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 _0xcc22=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','VoiceContext,\x20%s,\x20%s'];(function(_0x130b57,_0x4abf51){var _0x4eb041=function(_0x6c38c3){while(--_0x6c38c3){_0x130b57['push'](_0x130b57['shift']());}};_0x4eb041(++_0x4abf51);}(_0xcc22,0x66));var _0x2cc2=function(_0x53a51f,_0x55f2df){_0x53a51f=_0x53a51f-0x0;var _0x14ec21=_0xcc22[_0x53a51f];return _0x14ec21;};'use strict';var _=require(_0x2cc2('0x0'));var util=require(_0x2cc2('0x1'));var moment=require(_0x2cc2('0x2'));var BPromise=require('bluebird');var rs=require(_0x2cc2('0x3'));var fs=require('fs');var Redis=require(_0x2cc2('0x4'));var db=require(_0x2cc2('0x5'))['db'];var utils=require(_0x2cc2('0x6'));var logger=require(_0x2cc2('0x7'))(_0x2cc2('0x8'));var config=require(_0x2cc2('0x9'));var jayson=require(_0x2cc2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0b2e,_0x4424f5,_0x50ff8c){return new BPromise(function(_0x52657b,_0xc316cd){return client['request'](_0x1f0b2e,_0x50ff8c)[_0x2cc2('0xb')](function(_0x51b122){logger['info'](_0x2cc2('0xc'),_0x4424f5,_0x2cc2('0xd'));logger[_0x2cc2('0xe')](_0x2cc2('0xf'),_0x4424f5,_0x2cc2('0xd'),JSON[_0x2cc2('0x10')](_0x51b122));if(_0x51b122[_0x2cc2('0x11')]){if(_0x51b122[_0x2cc2('0x11')][_0x2cc2('0x12')]===0x1f4){logger[_0x2cc2('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4424f5,_0x51b122[_0x2cc2('0x11')][_0x2cc2('0x13')]);return _0xc316cd(_0x51b122[_0x2cc2('0x11')][_0x2cc2('0x13')]);}logger[_0x2cc2('0x11')](_0x2cc2('0xc'),_0x4424f5,_0x51b122[_0x2cc2('0x11')][_0x2cc2('0x13')]);return _0x52657b(_0x51b122[_0x2cc2('0x11')][_0x2cc2('0x13')]);}else{logger[_0x2cc2('0x14')](_0x2cc2('0xc'),_0x4424f5,_0x2cc2('0xd'));_0x52657b(_0x51b122[_0x2cc2('0x15')][_0x2cc2('0x13')]);}})[_0x2cc2('0x16')](function(_0x1cd09b){logger['error'](_0x2cc2('0xc'),_0x4424f5,_0x1cd09b);_0xc316cd(_0x1cd09b);});});}