Built motion from commit d5e4af8c.|2.6.23
[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 _0xc19f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0xc19f,0x164));var _0xfc19=function(_0x5d8280,_0x5d02dd){_0x5d8280=_0x5d8280-0x0;var _0x1752a4=_0xc19f[_0x5d8280];return _0x1752a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc19('0x0'));var BPromise=require(_0xfc19('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc19('0x2'))['db'];var utils=require(_0xfc19('0x3'));var logger=require(_0xfc19('0x4'))(_0xfc19('0x5'));var config=require(_0xfc19('0x6'));var jayson=require(_0xfc19('0x7'));var client=jayson[_0xfc19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b914d,_0x5edecc,_0x77e5df){return new BPromise(function(_0x1d4fe7,_0x3ab241){return client[_0xfc19('0x9')](_0x4b914d,_0x77e5df)[_0xfc19('0xa')](function(_0x22fcbd){logger[_0xfc19('0xb')](_0xfc19('0xc'),_0x5edecc,'request\x20sent');logger['debug'](_0xfc19('0xd'),_0x5edecc,_0xfc19('0xe'),JSON['stringify'](_0x22fcbd));if(_0x22fcbd[_0xfc19('0xf')]){if(_0x22fcbd['error'][_0xfc19('0x10')]===0x1f4){logger[_0xfc19('0xf')]('SmsApplication,\x20%s,\x20%s',_0x5edecc,_0x22fcbd[_0xfc19('0xf')][_0xfc19('0x11')]);return _0x3ab241(_0x22fcbd['error'][_0xfc19('0x11')]);}logger[_0xfc19('0xf')](_0xfc19('0xc'),_0x5edecc,_0x22fcbd[_0xfc19('0xf')][_0xfc19('0x11')]);return _0x1d4fe7(_0x22fcbd['error'][_0xfc19('0x11')]);}else{logger[_0xfc19('0xb')](_0xfc19('0xc'),_0x5edecc,_0xfc19('0xe'));_0x1d4fe7(_0x22fcbd[_0xfc19('0x12')][_0xfc19('0x11')]);}})[_0xfc19('0x13')](function(_0x375f00){logger[_0xfc19('0xf')](_0xfc19('0xc'),_0x5edecc,_0x375f00);_0x3ab241(_0x375f00);});});}