0b9a08aae0f9b86b8d0d8bbb01bb90ef004e9c22
[motion2.git] / server / api / UserSmsInteraction / UserSmsInteraction.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 _0xe206=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','UserSmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsInteraction,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xe206,0x146));var _0x6e20=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xe206[_0x215e65];return _0xa85842;};'use strict';var _=require(_0x6e20('0x0'));var util=require(_0x6e20('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e20('0x2'));var fs=require('fs');var Redis=require(_0x6e20('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6e20('0x4'))(_0x6e20('0x5'));var config=require(_0x6e20('0x6'));var jayson=require(_0x6e20('0x7'));var client=jayson[_0x6e20('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc55829,_0x1febbf,_0x3bcf56){return new BPromise(function(_0x18ef76,_0x5b085b){return client[_0x6e20('0x9')](_0xc55829,_0x3bcf56)[_0x6e20('0xa')](function(_0x8197ed){logger[_0x6e20('0xb')]('UserSmsInteraction,\x20%s,\x20%s',_0x1febbf,_0x6e20('0xc'));logger[_0x6e20('0xd')](_0x6e20('0xe'),_0x1febbf,_0x6e20('0xc'),JSON[_0x6e20('0xf')](_0x8197ed));if(_0x8197ed[_0x6e20('0x10')]){if(_0x8197ed['error'][_0x6e20('0x11')]===0x1f4){logger['error'](_0x6e20('0x12'),_0x1febbf,_0x8197ed['error']['message']);return _0x5b085b(_0x8197ed[_0x6e20('0x10')][_0x6e20('0x13')]);}logger['error']('UserSmsInteraction,\x20%s,\x20%s',_0x1febbf,_0x8197ed['error']['message']);return _0x18ef76(_0x8197ed[_0x6e20('0x10')]['message']);}else{logger[_0x6e20('0xb')](_0x6e20('0x12'),_0x1febbf,_0x6e20('0xc'));_0x18ef76(_0x8197ed[_0x6e20('0x14')][_0x6e20('0x13')]);}})[_0x6e20('0x15')](function(_0x53d898){logger[_0x6e20('0x10')](_0x6e20('0x12'),_0x1febbf,_0x53d898);_0x5b085b(_0x53d898);});});}