Built motion from commit (unavailable).|2.5.17
[motion2.git] / server / api / voiceMusicOnHold / voiceMusicOnHold.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 _0xe236=['../../config/environment','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','randomstring','ioredis','../../config/logger'];(function(_0x62fbbe,_0x4c91d5){var _0x4fd5aa=function(_0x37109f){while(--_0x37109f){_0x62fbbe['push'](_0x62fbbe['shift']());}};_0x4fd5aa(++_0x4c91d5);}(_0xe236,0x11d));var _0x6e23=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xe236[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e23('0x0'));var fs=require('fs');var Redis=require(_0x6e23('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6e23('0x2'))('rpc');var config=require(_0x6e23('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6e23('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x18d7bb,_0x477117,_0x20bb16){return new BPromise(function(_0x20823d,_0x3fc291){return client[_0x6e23('0x5')](_0x18d7bb,_0x20bb16)[_0x6e23('0x6')](function(_0x4d8081){logger[_0x6e23('0x7')](_0x6e23('0x8'),_0x477117,'request\x20sent');logger[_0x6e23('0x9')](_0x6e23('0xa'),_0x477117,_0x6e23('0xb'),JSON[_0x6e23('0xc')](_0x4d8081));if(_0x4d8081['error']){if(_0x4d8081['error'][_0x6e23('0xd')]===0x1f4){logger[_0x6e23('0xe')](_0x6e23('0x8'),_0x477117,_0x4d8081[_0x6e23('0xe')]['message']);return _0x3fc291(_0x4d8081[_0x6e23('0xe')][_0x6e23('0xf')]);}logger[_0x6e23('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x477117,_0x4d8081['error'][_0x6e23('0xf')]);return _0x20823d(_0x4d8081[_0x6e23('0xe')][_0x6e23('0xf')]);}else{logger[_0x6e23('0x7')](_0x6e23('0x8'),_0x477117,_0x6e23('0xb'));_0x20823d(_0x4d8081[_0x6e23('0x10')][_0x6e23('0xf')]);}})[_0x6e23('0x11')](function(_0x1d1e57){logger[_0x6e23('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x477117,_0x1d1e57);_0x3fc291(_0x1d1e57);});});}