Built motion from commit (unavailable).|2.5.23
[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 _0xc1fe=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','error','code','Disposition,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x58bb01,_0x231a96){var _0x111373=function(_0x33031a){while(--_0x33031a){_0x58bb01['push'](_0x58bb01['shift']());}};_0x111373(++_0x231a96);}(_0xc1fe,0xb2));var _0xec1f=function(_0xfdc7b1,_0x295c90){_0xfdc7b1=_0xfdc7b1-0x0;var _0x395b66=_0xc1fe[_0xfdc7b1];return _0x395b66;};'use strict';var _=require(_0xec1f('0x0'));var util=require(_0xec1f('0x1'));var moment=require(_0xec1f('0x2'));var BPromise=require(_0xec1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec1f('0x4'));var db=require(_0xec1f('0x5'))['db'];var utils=require(_0xec1f('0x6'));var logger=require(_0xec1f('0x7'))(_0xec1f('0x8'));var config=require(_0xec1f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33d574,_0x5682a8,_0x44d859){return new BPromise(function(_0x55c9e3,_0x511f2b){return client[_0xec1f('0xb')](_0x33d574,_0x44d859)['then'](function(_0x3a4bd5){logger[_0xec1f('0xc')]('Disposition,\x20%s,\x20%s',_0x5682a8,_0xec1f('0xd'));logger['debug'](_0xec1f('0xe'),_0x5682a8,_0xec1f('0xd'),JSON['stringify'](_0x3a4bd5));if(_0x3a4bd5[_0xec1f('0xf')]){if(_0x3a4bd5[_0xec1f('0xf')][_0xec1f('0x10')]===0x1f4){logger[_0xec1f('0xf')](_0xec1f('0x11'),_0x5682a8,_0x3a4bd5[_0xec1f('0xf')]['message']);return _0x511f2b(_0x3a4bd5[_0xec1f('0xf')][_0xec1f('0x12')]);}logger[_0xec1f('0xf')](_0xec1f('0x11'),_0x5682a8,_0x3a4bd5[_0xec1f('0xf')][_0xec1f('0x12')]);return _0x55c9e3(_0x3a4bd5['error'][_0xec1f('0x12')]);}else{logger[_0xec1f('0xc')](_0xec1f('0x11'),_0x5682a8,_0xec1f('0xd'));_0x55c9e3(_0x3a4bd5['result'][_0xec1f('0x12')]);}})[_0xec1f('0x13')](function(_0x123de1){logger[_0xec1f('0xf')](_0xec1f('0x11'),_0x5682a8,_0x123de1);_0x511f2b(_0x123de1);});});}