Built motion from commit (unavailable).|2.5.10
[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 _0x4607=['request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','request','info','Disposition,\x20%s,\x20%s'];(function(_0x179303,_0x361033){var _0x30cc8a=function(_0x15268b){while(--_0x15268b){_0x179303['push'](_0x179303['shift']());}};_0x30cc8a(++_0x361033);}(_0x4607,0x135));var _0x7460=function(_0x5d8f0b,_0x18526f){_0x5d8f0b=_0x5d8f0b-0x0;var _0x5786ac=_0x4607[_0x5d8f0b];return _0x5786ac;};'use strict';var _=require(_0x7460('0x0'));var util=require(_0x7460('0x1'));var moment=require(_0x7460('0x2'));var BPromise=require(_0x7460('0x3'));var rs=require(_0x7460('0x4'));var fs=require('fs');var Redis=require(_0x7460('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7460('0x6'));var logger=require(_0x7460('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdb3535,_0x509d51,_0x5c2baf){return new BPromise(function(_0x2d5018,_0x300000){return client[_0x7460('0x8')](_0xdb3535,_0x5c2baf)['then'](function(_0x2078af){logger[_0x7460('0x9')](_0x7460('0xa'),_0x509d51,_0x7460('0xb'));logger[_0x7460('0xc')](_0x7460('0xd'),_0x509d51,'request\x20sent',JSON[_0x7460('0xe')](_0x2078af));if(_0x2078af[_0x7460('0xf')]){if(_0x2078af[_0x7460('0xf')][_0x7460('0x10')]===0x1f4){logger[_0x7460('0xf')](_0x7460('0xa'),_0x509d51,_0x2078af['error'][_0x7460('0x11')]);return _0x300000(_0x2078af[_0x7460('0xf')][_0x7460('0x11')]);}logger[_0x7460('0xf')](_0x7460('0xa'),_0x509d51,_0x2078af[_0x7460('0xf')][_0x7460('0x11')]);return _0x2d5018(_0x2078af[_0x7460('0xf')][_0x7460('0x11')]);}else{logger[_0x7460('0x9')](_0x7460('0xa'),_0x509d51,'request\x20sent');_0x2d5018(_0x2078af[_0x7460('0x12')][_0x7460('0x11')]);}})[_0x7460('0x13')](function(_0x34d8e){logger[_0x7460('0xf')]('Disposition,\x20%s,\x20%s',_0x509d51,_0x34d8e);_0x300000(_0x34d8e);});});}