Built motion from commit (unavailable).|2.5.1
[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 _0x7b83=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsApplication,\x20%s,\x20%s','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0x7b83,0xa1));var _0x37b8=function(_0x1a8b58,_0x2c6665){_0x1a8b58=_0x1a8b58-0x0;var _0x3fa938=_0x7b83[_0x1a8b58];return _0x3fa938;};'use strict';var _=require(_0x37b8('0x0'));var util=require(_0x37b8('0x1'));var moment=require(_0x37b8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37b8('0x3'));var db=require(_0x37b8('0x4'))['db'];var utils=require(_0x37b8('0x5'));var logger=require('../../config/logger')(_0x37b8('0x6'));var config=require(_0x37b8('0x7'));var jayson=require(_0x37b8('0x8'));var client=jayson[_0x37b8('0x9')][_0x37b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x220cd2,_0x5eb540,_0x45e094){return new BPromise(function(_0xc3ab5b,_0x50f729){return client[_0x37b8('0xb')](_0x220cd2,_0x45e094)['then'](function(_0x548dfd){logger['info']('SmsApplication,\x20%s,\x20%s',_0x5eb540,_0x37b8('0xc'));logger[_0x37b8('0xd')](_0x37b8('0xe'),_0x5eb540,_0x37b8('0xc'),JSON[_0x37b8('0xf')](_0x548dfd));if(_0x548dfd['error']){if(_0x548dfd[_0x37b8('0x10')]['code']===0x1f4){logger[_0x37b8('0x10')]('SmsApplication,\x20%s,\x20%s',_0x5eb540,_0x548dfd[_0x37b8('0x10')][_0x37b8('0x11')]);return _0x50f729(_0x548dfd[_0x37b8('0x10')][_0x37b8('0x11')]);}logger[_0x37b8('0x10')]('SmsApplication,\x20%s,\x20%s',_0x5eb540,_0x548dfd['error'][_0x37b8('0x11')]);return _0xc3ab5b(_0x548dfd[_0x37b8('0x10')][_0x37b8('0x11')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x5eb540,_0x37b8('0xc'));_0xc3ab5b(_0x548dfd[_0x37b8('0x12')][_0x37b8('0x11')]);}})[_0x37b8('0x13')](function(_0x290068){logger[_0x37b8('0x10')](_0x37b8('0x14'),_0x5eb540,_0x290068);_0x50f729(_0x290068);});});}