Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / cmCompany / cmCompany.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 _0x330d=['CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x204922,_0x2322e8){var _0x174e4a=function(_0x21d57d){while(--_0x21d57d){_0x204922['push'](_0x204922['shift']());}};_0x174e4a(++_0x2322e8);}(_0x330d,0xb2));var _0xd330=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x330d[_0xd0a847];return _0x2536ec;};'use strict';var _=require(_0xd330('0x0'));var util=require(_0xd330('0x1'));var moment=require(_0xd330('0x2'));var BPromise=require('bluebird');var rs=require(_0xd330('0x3'));var fs=require('fs');var Redis=require(_0xd330('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd330('0x5'));var logger=require(_0xd330('0x6'))('rpc');var config=require(_0xd330('0x7'));var jayson=require(_0xd330('0x8'));var client=jayson[_0xd330('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23fa2f,_0x55d0d0,_0x42cc42){return new BPromise(function(_0x1eed0f,_0x4eee71){return client['request'](_0x23fa2f,_0x42cc42)[_0xd330('0xa')](function(_0x3877ce){logger['info'](_0xd330('0xb'),_0x55d0d0,_0xd330('0xc'));logger['debug'](_0xd330('0xd'),_0x55d0d0,_0xd330('0xc'),JSON[_0xd330('0xe')](_0x3877ce));if(_0x3877ce[_0xd330('0xf')]){if(_0x3877ce[_0xd330('0xf')][_0xd330('0x10')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x55d0d0,_0x3877ce[_0xd330('0xf')][_0xd330('0x11')]);return _0x4eee71(_0x3877ce[_0xd330('0xf')][_0xd330('0x11')]);}logger[_0xd330('0xf')]('CmCompany,\x20%s,\x20%s',_0x55d0d0,_0x3877ce[_0xd330('0xf')][_0xd330('0x11')]);return _0x1eed0f(_0x3877ce[_0xd330('0xf')][_0xd330('0x11')]);}else{logger[_0xd330('0x12')](_0xd330('0xb'),_0x55d0d0,_0xd330('0xc'));_0x1eed0f(_0x3877ce[_0xd330('0x13')][_0xd330('0x11')]);}})[_0xd330('0x14')](function(_0x319ab6){logger[_0xd330('0xf')](_0xd330('0xb'),_0x55d0d0,_0x319ab6);_0x4eee71(_0x319ab6);});});}