Built motion from commit e02f907f.|2.6.14
[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 _0x9a18=['SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x36f874,_0x1ebf09){var _0x52a402=function(_0x8ace8a){while(--_0x8ace8a){_0x36f874['push'](_0x36f874['shift']());}};_0x52a402(++_0x1ebf09);}(_0x9a18,0x187));var _0x89a1=function(_0x3de0b5,_0x541e35){_0x3de0b5=_0x3de0b5-0x0;var _0x3fded2=_0x9a18[_0x3de0b5];return _0x3fded2;};'use strict';var _=require(_0x89a1('0x0'));var util=require('util');var moment=require(_0x89a1('0x1'));var BPromise=require(_0x89a1('0x2'));var rs=require(_0x89a1('0x3'));var fs=require('fs');var Redis=require(_0x89a1('0x4'));var db=require(_0x89a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x89a1('0x6'))(_0x89a1('0x7'));var config=require(_0x89a1('0x8'));var jayson=require(_0x89a1('0x9'));var client=jayson[_0x89a1('0xa')][_0x89a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec780,_0xcde361,_0x5da9e6){return new BPromise(function(_0x55ac1e,_0x3bba21){return client['request'](_0x3ec780,_0x5da9e6)[_0x89a1('0xc')](function(_0x541951){logger[_0x89a1('0xd')](_0x89a1('0xe'),_0xcde361,_0x89a1('0xf'));logger[_0x89a1('0x10')](_0x89a1('0x11'),_0xcde361,_0x89a1('0xf'),JSON[_0x89a1('0x12')](_0x541951));if(_0x541951[_0x89a1('0x13')]){if(_0x541951[_0x89a1('0x13')][_0x89a1('0x14')]===0x1f4){logger[_0x89a1('0x13')]('SmsApplication,\x20%s,\x20%s',_0xcde361,_0x541951['error'][_0x89a1('0x15')]);return _0x3bba21(_0x541951[_0x89a1('0x13')][_0x89a1('0x15')]);}logger[_0x89a1('0x13')]('SmsApplication,\x20%s,\x20%s',_0xcde361,_0x541951[_0x89a1('0x13')][_0x89a1('0x15')]);return _0x55ac1e(_0x541951['error'][_0x89a1('0x15')]);}else{logger[_0x89a1('0xd')](_0x89a1('0xe'),_0xcde361,_0x89a1('0xf'));_0x55ac1e(_0x541951[_0x89a1('0x16')][_0x89a1('0x15')]);}})[_0x89a1('0x17')](function(_0x325a5a){logger['error'](_0x89a1('0xe'),_0xcde361,_0x325a5a);_0x3bba21(_0x325a5a);});});}