Built motion from commit 52c8a02d.|2.6.29
[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 _0xb95f=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s'];(function(_0x3879cb,_0x253d8e){var _0x4c0ee8=function(_0x73fa83){while(--_0x73fa83){_0x3879cb['push'](_0x3879cb['shift']());}};_0x4c0ee8(++_0x253d8e);}(_0xb95f,0xfe));var _0xfb95=function(_0x56e43a,_0x2d2b96){_0x56e43a=_0x56e43a-0x0;var _0x3e5096=_0xb95f[_0x56e43a];return _0x3e5096;};'use strict';var _=require(_0xfb95('0x0'));var util=require(_0xfb95('0x1'));var moment=require(_0xfb95('0x2'));var BPromise=require(_0xfb95('0x3'));var rs=require(_0xfb95('0x4'));var fs=require('fs');var Redis=require(_0xfb95('0x5'));var db=require(_0xfb95('0x6'))['db'];var utils=require(_0xfb95('0x7'));var logger=require('../../config/logger')(_0xfb95('0x8'));var config=require(_0xfb95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb95('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcce92c,_0x209b02,_0x3a4f98){return new BPromise(function(_0x58264d,_0x3a7c1f){return client[_0xfb95('0xb')](_0xcce92c,_0x3a4f98)[_0xfb95('0xc')](function(_0x5a146b){logger[_0xfb95('0xd')]('CmCompany,\x20%s,\x20%s',_0x209b02,_0xfb95('0xe'));logger[_0xfb95('0xf')](_0xfb95('0x10'),_0x209b02,_0xfb95('0xe'),JSON[_0xfb95('0x11')](_0x5a146b));if(_0x5a146b[_0xfb95('0x12')]){if(_0x5a146b[_0xfb95('0x12')][_0xfb95('0x13')]===0x1f4){logger[_0xfb95('0x12')]('CmCompany,\x20%s,\x20%s',_0x209b02,_0x5a146b[_0xfb95('0x12')][_0xfb95('0x14')]);return _0x3a7c1f(_0x5a146b[_0xfb95('0x12')][_0xfb95('0x14')]);}logger['error'](_0xfb95('0x15'),_0x209b02,_0x5a146b[_0xfb95('0x12')][_0xfb95('0x14')]);return _0x58264d(_0x5a146b[_0xfb95('0x12')][_0xfb95('0x14')]);}else{logger[_0xfb95('0xd')](_0xfb95('0x15'),_0x209b02,_0xfb95('0xe'));_0x58264d(_0x5a146b[_0xfb95('0x16')][_0xfb95('0x14')]);}})['catch'](function(_0xcbf5cf){logger[_0xfb95('0x12')](_0xfb95('0x15'),_0x209b02,_0xcbf5cf);_0x3a7c1f(_0xcbf5cf);});});}