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 _0x414f=['then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x414f,0x13f));var _0xf414=function(_0x1405c1,_0x532676){_0x1405c1=_0x1405c1-0x0;var _0x59aabc=_0x414f[_0x1405c1];return _0x59aabc;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var moment=require(_0xf414('0x1'));var BPromise=require(_0xf414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf414('0x3'));var db=require(_0xf414('0x4'))['db'];var utils=require(_0xf414('0x5'));var logger=require(_0xf414('0x6'))(_0xf414('0x7'));var config=require(_0xf414('0x8'));var jayson=require(_0xf414('0x9'));var client=jayson['client'][_0xf414('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cdcdb,_0x34c4d0,_0x2306e5){return new BPromise(function(_0xad732,_0x5194e5){return client['request'](_0x4cdcdb,_0x2306e5)[_0xf414('0xb')](function(_0x2bbf01){logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));logger[_0xf414('0xf')](_0xf414('0x10'),_0x34c4d0,_0xf414('0xe'),JSON['stringify'](_0x2bbf01));if(_0x2bbf01['error']){if(_0x2bbf01[_0xf414('0x11')][_0xf414('0x12')]===0x1f4){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0x5194e5(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0xad732(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}else{logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));_0xad732(_0x2bbf01[_0xf414('0x14')][_0xf414('0x13')]);}})[_0xf414('0x15')](function(_0x483e29){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x483e29);_0x5194e5(_0x483e29);});});}