Built motion from commit (unavailable).|2.5.26
[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 _0x5650=['../../config/environment','jayson/promise','client','http','info','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','rpc'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0x5650,0xcc));var _0x0565=function(_0xa22981,_0x2a7cc8){_0xa22981=_0xa22981-0x0;var _0x425b3c=_0x5650[_0xa22981];return _0x425b3c;};'use strict';var _=require(_0x0565('0x0'));var util=require(_0x0565('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0565('0x2'))['db'];var utils=require(_0x0565('0x3'));var logger=require('../../config/logger')(_0x0565('0x4'));var config=require(_0x0565('0x5'));var jayson=require(_0x0565('0x6'));var client=jayson[_0x0565('0x7')][_0x0565('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4394e3,_0x192271,_0x5b3d6e){return new BPromise(function(_0xd675c,_0x1f32b4){return client['request'](_0x4394e3,_0x5b3d6e)['then'](function(_0x1c8cac){logger[_0x0565('0x9')](_0x0565('0xa'),_0x192271,_0x0565('0xb'));logger['debug'](_0x0565('0xc'),_0x192271,_0x0565('0xb'),JSON[_0x0565('0xd')](_0x1c8cac));if(_0x1c8cac[_0x0565('0xe')]){if(_0x1c8cac['error'][_0x0565('0xf')]===0x1f4){logger[_0x0565('0xe')]('Disposition,\x20%s,\x20%s',_0x192271,_0x1c8cac['error'][_0x0565('0x10')]);return _0x1f32b4(_0x1c8cac[_0x0565('0xe')][_0x0565('0x10')]);}logger[_0x0565('0xe')]('Disposition,\x20%s,\x20%s',_0x192271,_0x1c8cac[_0x0565('0xe')][_0x0565('0x10')]);return _0xd675c(_0x1c8cac[_0x0565('0xe')][_0x0565('0x10')]);}else{logger[_0x0565('0x9')](_0x0565('0xa'),_0x192271,'request\x20sent');_0xd675c(_0x1c8cac[_0x0565('0x11')][_0x0565('0x10')]);}})[_0x0565('0x12')](function(_0x598c8c){logger[_0x0565('0xe')](_0x0565('0xa'),_0x192271,_0x598c8c);_0x1f32b4(_0x598c8c);});});}