Built motion from commit b0a9a629.|2.6.33
[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 _0xc5b3=['client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0xc5b3[_0xd39959];return _0x1ff69c;};'use strict';var _=require(_0x3c5b('0x0'));var util=require(_0x3c5b('0x1'));var moment=require(_0x3c5b('0x2'));var BPromise=require(_0x3c5b('0x3'));var rs=require(_0x3c5b('0x4'));var fs=require('fs');var Redis=require(_0x3c5b('0x5'));var db=require(_0x3c5b('0x6'))['db'];var utils=require(_0x3c5b('0x7'));var logger=require('../../config/logger')(_0x3c5b('0x8'));var config=require(_0x3c5b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3c5b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7a363e,_0x4730e9,_0x894f97){return new BPromise(function(_0xae86a0,_0x32586d){return client[_0x3c5b('0xb')](_0x7a363e,_0x894f97)[_0x3c5b('0xc')](function(_0x5f5df9){logger[_0x3c5b('0xd')](_0x3c5b('0xe'),_0x4730e9,_0x3c5b('0xf'));logger[_0x3c5b('0x10')](_0x3c5b('0x11'),_0x4730e9,'request\x20sent',JSON[_0x3c5b('0x12')](_0x5f5df9));if(_0x5f5df9[_0x3c5b('0x13')]){if(_0x5f5df9[_0x3c5b('0x13')][_0x3c5b('0x14')]===0x1f4){logger[_0x3c5b('0x13')](_0x3c5b('0xe'),_0x4730e9,_0x5f5df9[_0x3c5b('0x13')]['message']);return _0x32586d(_0x5f5df9[_0x3c5b('0x13')][_0x3c5b('0x15')]);}logger[_0x3c5b('0x13')](_0x3c5b('0xe'),_0x4730e9,_0x5f5df9['error'][_0x3c5b('0x15')]);return _0xae86a0(_0x5f5df9['error'][_0x3c5b('0x15')]);}else{logger[_0x3c5b('0xd')]('SmsApplication,\x20%s,\x20%s',_0x4730e9,_0x3c5b('0xf'));_0xae86a0(_0x5f5df9[_0x3c5b('0x16')]['message']);}})[_0x3c5b('0x17')](function(_0x1cbe52){logger[_0x3c5b('0x13')]('SmsApplication,\x20%s,\x20%s',_0x4730e9,_0x1cbe52);_0x32586d(_0x1cbe52);});});}