Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / smsApplication / smsApplication.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 _0x5c1f=['code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5a418b,_0x1d8b41){var _0x58318a=function(_0x168328){while(--_0x168328){_0x5a418b['push'](_0x5a418b['shift']());}};_0x58318a(++_0x1d8b41);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0x5c1f[_0x3b3210];return _0x5b5484;};'use strict';var _=require(_0xf5c1('0x0'));var util=require('util');var moment=require(_0xf5c1('0x1'));var BPromise=require(_0xf5c1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5c1('0x3'));var db=require(_0xf5c1('0x4'))['db'];var utils=require(_0xf5c1('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf5c1('0x6'));var client=jayson[_0xf5c1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a073,_0x21bb02,_0x12128b){return new BPromise(function(_0x40cad7,_0x5e3ef8){return client['request'](_0x34a073,_0x12128b)['then'](function(_0x4bd3a9){logger[_0xf5c1('0x8')](_0xf5c1('0x9'),_0x21bb02,_0xf5c1('0xa'));logger[_0xf5c1('0xb')](_0xf5c1('0xc'),_0x21bb02,_0xf5c1('0xa'),JSON[_0xf5c1('0xd')](_0x4bd3a9));if(_0x4bd3a9[_0xf5c1('0xe')]){if(_0x4bd3a9['error'][_0xf5c1('0xf')]===0x1f4){logger[_0xf5c1('0xe')](_0xf5c1('0x9'),_0x21bb02,_0x4bd3a9[_0xf5c1('0xe')][_0xf5c1('0x10')]);return _0x5e3ef8(_0x4bd3a9['error'][_0xf5c1('0x10')]);}logger['error'](_0xf5c1('0x9'),_0x21bb02,_0x4bd3a9[_0xf5c1('0xe')][_0xf5c1('0x10')]);return _0x40cad7(_0x4bd3a9['error'][_0xf5c1('0x10')]);}else{logger[_0xf5c1('0x8')](_0xf5c1('0x9'),_0x21bb02,_0xf5c1('0xa'));_0x40cad7(_0x4bd3a9['result'][_0xf5c1('0x10')]);}})[_0xf5c1('0x11')](function(_0x312d6b){logger[_0xf5c1('0xe')](_0xf5c1('0x9'),_0x21bb02,_0x312d6b);_0x5e3ef8(_0x312d6b);});});}