Built motion from commit (unavailable).|2.5.15
[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 _0x489e=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','http','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x3015f9,_0x6eeb0d){var _0x3390b6=function(_0x4cff57){while(--_0x4cff57){_0x3015f9['push'](_0x3015f9['shift']());}};_0x3390b6(++_0x6eeb0d);}(_0x489e,0x144));var _0xe489=function(_0x2d1eec,_0x5bb68b){_0x2d1eec=_0x2d1eec-0x0;var _0x365311=_0x489e[_0x2d1eec];return _0x365311;};'use strict';var _=require(_0xe489('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe489('0x1'));var rs=require(_0xe489('0x2'));var fs=require('fs');var Redis=require(_0xe489('0x3'));var db=require(_0xe489('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe489('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe489('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4e669d,_0x45a1b4,_0x200eb9){return new BPromise(function(_0x4dd7f5,_0x4d9710){return client['request'](_0x4e669d,_0x200eb9)[_0xe489('0x7')](function(_0x4d0513){logger[_0xe489('0x8')](_0xe489('0x9'),_0x45a1b4,_0xe489('0xa'));logger[_0xe489('0xb')](_0xe489('0xc'),_0x45a1b4,_0xe489('0xa'),JSON[_0xe489('0xd')](_0x4d0513));if(_0x4d0513[_0xe489('0xe')]){if(_0x4d0513['error']['code']===0x1f4){logger[_0xe489('0xe')](_0xe489('0x9'),_0x45a1b4,_0x4d0513[_0xe489('0xe')]['message']);return _0x4d9710(_0x4d0513['error']['message']);}logger['error'](_0xe489('0x9'),_0x45a1b4,_0x4d0513['error'][_0xe489('0xf')]);return _0x4dd7f5(_0x4d0513[_0xe489('0xe')][_0xe489('0xf')]);}else{logger[_0xe489('0x8')](_0xe489('0x9'),_0x45a1b4,'request\x20sent');_0x4dd7f5(_0x4d0513[_0xe489('0x10')][_0xe489('0xf')]);}})[_0xe489('0x11')](function(_0x5bdc2a){logger[_0xe489('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x45a1b4,_0x5bdc2a);_0x4d9710(_0x5bdc2a);});});}