Built motion from commit (unavailable).|2.5.27
[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 _0x8781=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0x8781,0x1c8));var _0x1878=function(_0x5e33ab,_0x1d797e){_0x5e33ab=_0x5e33ab-0x0;var _0x54887=_0x8781[_0x5e33ab];return _0x54887;};'use strict';var _=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var moment=require(_0x1878('0x2'));var BPromise=require(_0x1878('0x3'));var rs=require(_0x1878('0x4'));var fs=require('fs');var Redis=require(_0x1878('0x5'));var db=require(_0x1878('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1878('0x7'))(_0x1878('0x8'));var config=require(_0x1878('0x9'));var jayson=require(_0x1878('0xa'));var client=jayson[_0x1878('0xb')][_0x1878('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d2374,_0x3f62d9,_0x393fff){return new BPromise(function(_0x25441c,_0x46cd98){return client[_0x1878('0xd')](_0x4d2374,_0x393fff)[_0x1878('0xe')](function(_0x2756b4){logger[_0x1878('0xf')](_0x1878('0x10'),_0x3f62d9,_0x1878('0x11'));logger[_0x1878('0x12')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3f62d9,_0x1878('0x11'),JSON[_0x1878('0x13')](_0x2756b4));if(_0x2756b4[_0x1878('0x14')]){if(_0x2756b4[_0x1878('0x14')]['code']===0x1f4){logger['error'](_0x1878('0x10'),_0x3f62d9,_0x2756b4[_0x1878('0x14')][_0x1878('0x15')]);return _0x46cd98(_0x2756b4[_0x1878('0x14')]['message']);}logger['error'](_0x1878('0x10'),_0x3f62d9,_0x2756b4[_0x1878('0x14')]['message']);return _0x25441c(_0x2756b4[_0x1878('0x14')][_0x1878('0x15')]);}else{logger[_0x1878('0xf')]('SmsApplication,\x20%s,\x20%s',_0x3f62d9,'request\x20sent');_0x25441c(_0x2756b4[_0x1878('0x16')][_0x1878('0x15')]);}})[_0x1878('0x17')](function(_0x43b85e){logger[_0x1878('0x14')](_0x1878('0x10'),_0x3f62d9,_0x43b85e);_0x46cd98(_0x43b85e);});});}