Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / openchannelAccount / openchannelAccount.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 _0x6c8e=['request','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x2a9016,_0x145e3f){var _0x5e5cc6=function(_0x1568ef){while(--_0x1568ef){_0x2a9016['push'](_0x2a9016['shift']());}};_0x5e5cc6(++_0x145e3f);}(_0x6c8e,0xa7));var _0xe6c8=function(_0x402e25,_0x1f5108){_0x402e25=_0x402e25-0x0;var _0x311bde=_0x6c8e[_0x402e25];return _0x311bde;};'use strict';var _=require(_0xe6c8('0x0'));var util=require(_0xe6c8('0x1'));var moment=require(_0xe6c8('0x2'));var BPromise=require(_0xe6c8('0x3'));var rs=require(_0xe6c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6c8('0x6'))('rpc');var config=require(_0xe6c8('0x7'));var jayson=require(_0xe6c8('0x8'));var client=jayson[_0xe6c8('0x9')]['http']({'port':0x232a});config['redis']=_[_0xe6c8('0xa')](config[_0xe6c8('0xb')],{'host':_0xe6c8('0xc'),'port':0x18eb});var socket=require(_0xe6c8('0xd'))(new Redis(config[_0xe6c8('0xb')]));require('./openchannelAccount.socket')[_0xe6c8('0xe')](socket);function respondWithRpcPromise(_0x1f4e45,_0x349f29,_0x793097){return new BPromise(function(_0x4929f5,_0x295a88){return client[_0xe6c8('0xf')](_0x1f4e45,_0x793097)['then'](function(_0x25b8fe){logger[_0xe6c8('0x10')](_0xe6c8('0x11'),_0x349f29,'request\x20sent');logger[_0xe6c8('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x349f29,_0xe6c8('0x13'),JSON[_0xe6c8('0x14')](_0x25b8fe));if(_0x25b8fe[_0xe6c8('0x15')]){if(_0x25b8fe[_0xe6c8('0x15')][_0xe6c8('0x16')]===0x1f4){logger[_0xe6c8('0x15')](_0xe6c8('0x11'),_0x349f29,_0x25b8fe[_0xe6c8('0x15')][_0xe6c8('0x17')]);return _0x295a88(_0x25b8fe[_0xe6c8('0x15')][_0xe6c8('0x17')]);}logger[_0xe6c8('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x349f29,_0x25b8fe[_0xe6c8('0x15')][_0xe6c8('0x17')]);return _0x4929f5(_0x25b8fe[_0xe6c8('0x15')][_0xe6c8('0x17')]);}else{logger[_0xe6c8('0x10')](_0xe6c8('0x11'),_0x349f29,_0xe6c8('0x13'));_0x4929f5(_0x25b8fe[_0xe6c8('0x18')][_0xe6c8('0x17')]);}})[_0xe6c8('0x19')](function(_0x51b4dd){logger[_0xe6c8('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x349f29,_0x51b4dd);_0x295a88(_0x51b4dd);});});}