Built motion from commit (unavailable).|2.4.19
[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 _0x8c46=['info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x8c46,0x171));var _0x68c4=function(_0x2e71e0,_0x500edc){_0x2e71e0=_0x2e71e0-0x0;var _0x13616b=_0x8c46[_0x2e71e0];return _0x13616b;};'use strict';var _=require(_0x68c4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x68c4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68c4('0x2'))['db'];var utils=require(_0x68c4('0x3'));var logger=require(_0x68c4('0x4'))(_0x68c4('0x5'));var config=require(_0x68c4('0x6'));var jayson=require(_0x68c4('0x7'));var client=jayson[_0x68c4('0x8')][_0x68c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3da9c3,_0x458a2b,_0x5e57ce){return new BPromise(function(_0x1754d7,_0x1d40a3){return client[_0x68c4('0xa')](_0x3da9c3,_0x5e57ce)['then'](function(_0x356698){logger[_0x68c4('0xb')](_0x68c4('0xc'),_0x458a2b,'request\x20sent');logger['debug'](_0x68c4('0xd'),_0x458a2b,_0x68c4('0xe'),JSON['stringify'](_0x356698));if(_0x356698['error']){if(_0x356698[_0x68c4('0xf')][_0x68c4('0x10')]===0x1f4){logger[_0x68c4('0xf')]('SmsApplication,\x20%s,\x20%s',_0x458a2b,_0x356698[_0x68c4('0xf')][_0x68c4('0x11')]);return _0x1d40a3(_0x356698[_0x68c4('0xf')]['message']);}logger[_0x68c4('0xf')](_0x68c4('0xc'),_0x458a2b,_0x356698[_0x68c4('0xf')]['message']);return _0x1754d7(_0x356698[_0x68c4('0xf')][_0x68c4('0x11')]);}else{logger['info'](_0x68c4('0xc'),_0x458a2b,'request\x20sent');_0x1754d7(_0x356698[_0x68c4('0x12')]['message']);}})['catch'](function(_0xc2ea2f){logger[_0x68c4('0xf')]('SmsApplication,\x20%s,\x20%s',_0x458a2b,_0xc2ea2f);_0x1d40a3(_0xc2ea2f);});});}