Built motion from commit (unavailable).|2.5.28
[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 _0xe132=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x150e3c,_0x4b9d90){var _0x5abca7=function(_0x1e583e){while(--_0x1e583e){_0x150e3c['push'](_0x150e3c['shift']());}};_0x5abca7(++_0x4b9d90);}(_0xe132,0x162));var _0x2e13=function(_0x452ff0,_0x53e1c7){_0x452ff0=_0x452ff0-0x0;var _0xb7c692=_0xe132[_0x452ff0];return _0xb7c692;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var moment=require(_0x2e13('0x1'));var BPromise=require(_0x2e13('0x2'));var rs=require(_0x2e13('0x3'));var fs=require('fs');var Redis=require(_0x2e13('0x4'));var db=require(_0x2e13('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e13('0x6'))(_0x2e13('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e13('0x8')][_0x2e13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c670b,_0x71f9d3,_0x3be5dc){return new BPromise(function(_0x2d9487,_0x370a85){return client[_0x2e13('0xa')](_0x1c670b,_0x3be5dc)[_0x2e13('0xb')](function(_0x240bc3){logger['info'](_0x2e13('0xc'),_0x71f9d3,_0x2e13('0xd'));logger[_0x2e13('0xe')](_0x2e13('0xf'),_0x71f9d3,_0x2e13('0xd'),JSON[_0x2e13('0x10')](_0x240bc3));if(_0x240bc3[_0x2e13('0x11')]){if(_0x240bc3['error'][_0x2e13('0x12')]===0x1f4){logger[_0x2e13('0x11')](_0x2e13('0xc'),_0x71f9d3,_0x240bc3[_0x2e13('0x11')][_0x2e13('0x13')]);return _0x370a85(_0x240bc3[_0x2e13('0x11')][_0x2e13('0x13')]);}logger['error'](_0x2e13('0xc'),_0x71f9d3,_0x240bc3[_0x2e13('0x11')][_0x2e13('0x13')]);return _0x2d9487(_0x240bc3['error'][_0x2e13('0x13')]);}else{logger[_0x2e13('0x14')](_0x2e13('0xc'),_0x71f9d3,'request\x20sent');_0x2d9487(_0x240bc3[_0x2e13('0x15')][_0x2e13('0x13')]);}})[_0x2e13('0x16')](function(_0x4a466b){logger['error'](_0x2e13('0xc'),_0x71f9d3,_0x4a466b);_0x370a85(_0x4a466b);});});}