Built motion from commit (unavailable).|2.4.18
[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 _0x9b2a=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x9b2a,0x127));var _0xa9b2=function(_0x1f4ec0,_0x5daf53){_0x1f4ec0=_0x1f4ec0-0x0;var _0x2156bb=_0x9b2a[_0x1f4ec0];return _0x2156bb;};'use strict';var _=require(_0xa9b2('0x0'));var util=require('util');var moment=require(_0xa9b2('0x1'));var BPromise=require(_0xa9b2('0x2'));var rs=require(_0xa9b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9b2('0x4'))['db'];var utils=require(_0xa9b2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa9b2('0x6'));var jayson=require(_0xa9b2('0x7'));var client=jayson[_0xa9b2('0x8')][_0xa9b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x558267,_0x29afe0,_0xce1b20){return new BPromise(function(_0x2d2560,_0x597c97){return client[_0xa9b2('0xa')](_0x558267,_0xce1b20)[_0xa9b2('0xb')](function(_0x146ebd){logger[_0xa9b2('0xc')](_0xa9b2('0xd'),_0x29afe0,_0xa9b2('0xe'));logger['debug'](_0xa9b2('0xf'),_0x29afe0,'request\x20sent',JSON['stringify'](_0x146ebd));if(_0x146ebd['error']){if(_0x146ebd[_0xa9b2('0x10')][_0xa9b2('0x11')]===0x1f4){logger[_0xa9b2('0x10')]('SmsApplication,\x20%s,\x20%s',_0x29afe0,_0x146ebd['error'][_0xa9b2('0x12')]);return _0x597c97(_0x146ebd['error'][_0xa9b2('0x12')]);}logger[_0xa9b2('0x10')](_0xa9b2('0xd'),_0x29afe0,_0x146ebd['error'][_0xa9b2('0x12')]);return _0x2d2560(_0x146ebd['error']['message']);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x29afe0,_0xa9b2('0xe'));_0x2d2560(_0x146ebd[_0xa9b2('0x13')]['message']);}})[_0xa9b2('0x14')](function(_0x57c82c){logger[_0xa9b2('0x10')](_0xa9b2('0xd'),_0x29afe0,_0x57c82c);_0x597c97(_0x57c82c);});});}