Built motion from commit (unavailable).|2.3.4
[motion2.git] / server / api / disposition / disposition.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 _0xb4c7=['client','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1f9613,_0x3be92f){var _0xe0ef2=function(_0x498287){while(--_0x498287){_0x1f9613['push'](_0x1f9613['shift']());}};_0xe0ef2(++_0x3be92f);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2eb62e,_0x3deeec){_0x2eb62e=_0x2eb62e-0x0;var _0xe24137=_0xb4c7[_0x2eb62e];return _0xe24137;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){return client[_0x7b4c('0xc')](_0x2dd5c7,_0x2d7b7e)[_0x7b4c('0xd')](function(_0x28e902){logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));logger[_0x7b4c('0x11')](_0x7b4c('0x12'),_0x4bf85d,_0x7b4c('0x10'),JSON[_0x7b4c('0x13')](_0x28e902));if(_0x28e902['error']){if(_0x28e902['error'][_0x7b4c('0x14')]===0x1f4){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);return _0x570daa(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')]['message']);return _0x21687f(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}else{logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));_0x21687f(_0x28e902[_0x7b4c('0x17')][_0x7b4c('0x16')]);}})[_0x7b4c('0x18')](function(_0x4d3f5e){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x4d3f5e);_0x570daa(_0x4d3f5e);});});}