ec608311327a5448eee989a1d9e3bcd2374fc678
[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 _0xa3b0=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMusicOnHold,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4ebc44,_0x4c7df0){var _0x6a8422=function(_0x583974){while(--_0x583974){_0x4ebc44['push'](_0x4ebc44['shift']());}};_0x6a8422(++_0x4c7df0);}(_0xa3b0,0x148));var _0x0a3b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0a3b('0x0'));var util=require('util');var moment=require(_0x0a3b('0x1'));var BPromise=require(_0x0a3b('0x2'));var rs=require(_0x0a3b('0x3'));var fs=require('fs');var Redis=require(_0x0a3b('0x4'));var db=require(_0x0a3b('0x5'))['db'];var utils=require(_0x0a3b('0x6'));var logger=require(_0x0a3b('0x7'))('rpc');var config=require(_0x0a3b('0x8'));var jayson=require(_0x0a3b('0x9'));var client=jayson[_0x0a3b('0xa')][_0x0a3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4860b5,_0x502678,_0x31732d){return new BPromise(function(_0x4bbc86,_0x19e67c){return client[_0x0a3b('0xc')](_0x4860b5,_0x31732d)[_0x0a3b('0xd')](function(_0x53e60d){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x502678,_0x0a3b('0xe'));logger[_0x0a3b('0xf')](_0x0a3b('0x10'),_0x502678,_0x0a3b('0xe'),JSON[_0x0a3b('0x11')](_0x53e60d));if(_0x53e60d['error']){if(_0x53e60d[_0x0a3b('0x12')]['code']===0x1f4){logger[_0x0a3b('0x12')](_0x0a3b('0x13'),_0x502678,_0x53e60d['error'][_0x0a3b('0x14')]);return _0x19e67c(_0x53e60d[_0x0a3b('0x12')][_0x0a3b('0x14')]);}logger[_0x0a3b('0x12')](_0x0a3b('0x13'),_0x502678,_0x53e60d[_0x0a3b('0x12')]['message']);return _0x4bbc86(_0x53e60d[_0x0a3b('0x12')][_0x0a3b('0x14')]);}else{logger[_0x0a3b('0x15')](_0x0a3b('0x13'),_0x502678,_0x0a3b('0xe'));_0x4bbc86(_0x53e60d[_0x0a3b('0x16')][_0x0a3b('0x14')]);}})[_0x0a3b('0x17')](function(_0x4349ca){logger[_0x0a3b('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x502678,_0x4349ca);_0x19e67c(_0x4349ca);});});}