Built motion from commit (unavailable).|2.5.9
[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 _0xf0a8=['jayson/promise','client','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x48a49e,_0x2f1d73){var _0x34d1f1=function(_0x2ac5f3){while(--_0x2ac5f3){_0x48a49e['push'](_0x48a49e['shift']());}};_0x34d1f1(++_0x2f1d73);}(_0xf0a8,0x13a));var _0x8f0a=function(_0x41159b,_0x18ae88){_0x41159b=_0x41159b-0x0;var _0x5bea4e=_0xf0a8[_0x41159b];return _0x5bea4e;};'use strict';var _=require(_0x8f0a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8f0a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f0a('0x2'));var db=require(_0x8f0a('0x3'))['db'];var utils=require(_0x8f0a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x8f0a('0x5'));var jayson=require(_0x8f0a('0x6'));var client=jayson[_0x8f0a('0x7')][_0x8f0a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x111cd4,_0x19df1d,_0x44a55a){return new BPromise(function(_0x5f25fe,_0x5b5783){return client[_0x8f0a('0x9')](_0x111cd4,_0x44a55a)['then'](function(_0x3f348a){logger[_0x8f0a('0xa')](_0x8f0a('0xb'),_0x19df1d,_0x8f0a('0xc'));logger[_0x8f0a('0xd')](_0x8f0a('0xe'),_0x19df1d,_0x8f0a('0xc'),JSON[_0x8f0a('0xf')](_0x3f348a));if(_0x3f348a[_0x8f0a('0x10')]){if(_0x3f348a[_0x8f0a('0x10')][_0x8f0a('0x11')]===0x1f4){logger[_0x8f0a('0x10')](_0x8f0a('0xb'),_0x19df1d,_0x3f348a[_0x8f0a('0x10')][_0x8f0a('0x12')]);return _0x5b5783(_0x3f348a[_0x8f0a('0x10')][_0x8f0a('0x12')]);}logger[_0x8f0a('0x10')](_0x8f0a('0xb'),_0x19df1d,_0x3f348a[_0x8f0a('0x10')][_0x8f0a('0x12')]);return _0x5f25fe(_0x3f348a['error'][_0x8f0a('0x12')]);}else{logger[_0x8f0a('0xa')](_0x8f0a('0xb'),_0x19df1d,_0x8f0a('0xc'));_0x5f25fe(_0x3f348a['result'][_0x8f0a('0x12')]);}})[_0x8f0a('0x13')](function(_0x127374){logger[_0x8f0a('0x10')](_0x8f0a('0xb'),_0x19df1d,_0x127374);_0x5b5783(_0x127374);});});}