Built motion from commit (unavailable).|2.5.9
[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 _0x758b=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4d1e71,_0x2bc66d){var _0x2e6955=function(_0x5aad76){while(--_0x5aad76){_0x4d1e71['push'](_0x4d1e71['shift']());}};_0x2e6955(++_0x2bc66d);}(_0x758b,0x172));var _0xb758=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x758b[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xb758('0x0'));var util=require(_0xb758('0x1'));var moment=require(_0xb758('0x2'));var BPromise=require(_0xb758('0x3'));var rs=require(_0xb758('0x4'));var fs=require('fs');var Redis=require(_0xb758('0x5'));var db=require(_0xb758('0x6'))['db'];var utils=require(_0xb758('0x7'));var logger=require('../../config/logger')(_0xb758('0x8'));var config=require(_0xb758('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb758('0xa')][_0xb758('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37872c,_0x263f3d,_0x112e86){return new BPromise(function(_0x5ca35c,_0x4c0dc3){return client[_0xb758('0xc')](_0x37872c,_0x112e86)['then'](function(_0x21f828){logger[_0xb758('0xd')](_0xb758('0xe'),_0x263f3d,_0xb758('0xf'));logger[_0xb758('0x10')]('Disposition,\x20%s,\x20%s,\x20%s',_0x263f3d,_0xb758('0xf'),JSON[_0xb758('0x11')](_0x21f828));if(_0x21f828[_0xb758('0x12')]){if(_0x21f828[_0xb758('0x12')][_0xb758('0x13')]===0x1f4){logger[_0xb758('0x12')](_0xb758('0xe'),_0x263f3d,_0x21f828[_0xb758('0x12')]['message']);return _0x4c0dc3(_0x21f828[_0xb758('0x12')][_0xb758('0x14')]);}logger[_0xb758('0x12')]('Disposition,\x20%s,\x20%s',_0x263f3d,_0x21f828['error'][_0xb758('0x14')]);return _0x5ca35c(_0x21f828[_0xb758('0x12')][_0xb758('0x14')]);}else{logger[_0xb758('0xd')](_0xb758('0xe'),_0x263f3d,_0xb758('0xf'));_0x5ca35c(_0x21f828[_0xb758('0x15')]['message']);}})[_0xb758('0x16')](function(_0x22cd07){logger[_0xb758('0x12')](_0xb758('0xe'),_0x263f3d,_0x22cd07);_0x4c0dc3(_0x22cd07);});});}