Built motion from commit (unavailable).|2.6.0
[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 _0x92e0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','request\x20sent','error','message','SmsApplication,\x20%s,\x20%s','result','catch','lodash','moment'];(function(_0x2507e9,_0x17fd2b){var _0x4e05f3=function(_0x359355){while(--_0x359355){_0x2507e9['push'](_0x2507e9['shift']());}};_0x4e05f3(++_0x17fd2b);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x092e('0x0'));var util=require('util');var moment=require(_0x092e('0x1'));var BPromise=require(_0x092e('0x2'));var rs=require(_0x092e('0x3'));var fs=require('fs');var Redis=require(_0x092e('0x4'));var db=require(_0x092e('0x5'))['db'];var utils=require(_0x092e('0x6'));var logger=require(_0x092e('0x7'))(_0x092e('0x8'));var config=require(_0x092e('0x9'));var jayson=require(_0x092e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f1f0b,_0x1ddace,_0x1af53d){return new BPromise(function(_0x4c73a9,_0x414a72){return client['request'](_0x2f1f0b,_0x1af53d)['then'](function(_0x2b4a69){logger[_0x092e('0xb')]('SmsApplication,\x20%s,\x20%s',_0x1ddace,_0x092e('0xc'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x1ddace,_0x092e('0xc'),JSON['stringify'](_0x2b4a69));if(_0x2b4a69[_0x092e('0xd')]){if(_0x2b4a69['error']['code']===0x1f4){logger[_0x092e('0xd')]('SmsApplication,\x20%s,\x20%s',_0x1ddace,_0x2b4a69[_0x092e('0xd')][_0x092e('0xe')]);return _0x414a72(_0x2b4a69[_0x092e('0xd')][_0x092e('0xe')]);}logger[_0x092e('0xd')]('SmsApplication,\x20%s,\x20%s',_0x1ddace,_0x2b4a69['error'][_0x092e('0xe')]);return _0x4c73a9(_0x2b4a69[_0x092e('0xd')]['message']);}else{logger[_0x092e('0xb')](_0x092e('0xf'),_0x1ddace,_0x092e('0xc'));_0x4c73a9(_0x2b4a69[_0x092e('0x10')]['message']);}})[_0x092e('0x11')](function(_0x13bdf1){logger[_0x092e('0xd')]('SmsApplication,\x20%s,\x20%s',_0x1ddace,_0x13bdf1);_0x414a72(_0x13bdf1);});});}