Built motion from commit (unavailable).|2.5.25
[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 _0x1785=['rpc','../../config/environment','jayson/promise','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1785,0xd5));var _0x5178=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0x1785[_0x38c699];return _0x3b1ded;};'use strict';var _=require(_0x5178('0x0'));var util=require(_0x5178('0x1'));var moment=require('moment');var BPromise=require(_0x5178('0x2'));var rs=require(_0x5178('0x3'));var fs=require('fs');var Redis=require(_0x5178('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5178('0x5'));var logger=require(_0x5178('0x6'))(_0x5178('0x7'));var config=require(_0x5178('0x8'));var jayson=require(_0x5178('0x9'));var client=jayson['client'][_0x5178('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4134aa,_0x2d3caf,_0x888b46){return new BPromise(function(_0x1de70e,_0x16b3f0){return client[_0x5178('0xb')](_0x4134aa,_0x888b46)[_0x5178('0xc')](function(_0x3eee39){logger[_0x5178('0xd')](_0x5178('0xe'),_0x2d3caf,_0x5178('0xf'));logger['debug'](_0x5178('0x10'),_0x2d3caf,'request\x20sent',JSON[_0x5178('0x11')](_0x3eee39));if(_0x3eee39[_0x5178('0x12')]){if(_0x3eee39[_0x5178('0x12')]['code']===0x1f4){logger[_0x5178('0x12')](_0x5178('0xe'),_0x2d3caf,_0x3eee39['error']['message']);return _0x16b3f0(_0x3eee39['error'][_0x5178('0x13')]);}logger[_0x5178('0x12')](_0x5178('0xe'),_0x2d3caf,_0x3eee39['error'][_0x5178('0x13')]);return _0x1de70e(_0x3eee39[_0x5178('0x12')][_0x5178('0x13')]);}else{logger['info']('Disposition,\x20%s,\x20%s',_0x2d3caf,_0x5178('0xf'));_0x1de70e(_0x3eee39[_0x5178('0x14')][_0x5178('0x13')]);}})[_0x5178('0x15')](function(_0x366697){logger[_0x5178('0x12')](_0x5178('0xe'),_0x2d3caf,_0x366697);_0x16b3f0(_0x366697);});});}