3622b4c36a355b5ac03362d8b534105da236f8ee
[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 _0x5b12=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4bf2cb,_0x55f9c){var _0x5c22e3=function(_0xc9c678){while(--_0xc9c678){_0x4bf2cb['push'](_0x4bf2cb['shift']());}};_0x5c22e3(++_0x55f9c);}(_0x5b12,0x156));var _0x25b1=function(_0x4768eb,_0x1e5eb9){_0x4768eb=_0x4768eb-0x0;var _0x57a37a=_0x5b12[_0x4768eb];return _0x57a37a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x25b1('0x0'));var rs=require(_0x25b1('0x1'));var fs=require('fs');var Redis=require(_0x25b1('0x2'));var db=require(_0x25b1('0x3'))['db'];var utils=require(_0x25b1('0x4'));var logger=require(_0x25b1('0x5'))(_0x25b1('0x6'));var config=require(_0x25b1('0x7'));var jayson=require(_0x25b1('0x8'));var client=jayson[_0x25b1('0x9')][_0x25b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x193aa1,_0x2173ce,_0x3128f9){return new BPromise(function(_0x59cb0f,_0x4e2f6d){return client[_0x25b1('0xb')](_0x193aa1,_0x3128f9)[_0x25b1('0xc')](function(_0x2896a4){logger[_0x25b1('0xd')](_0x25b1('0xe'),_0x2173ce,_0x25b1('0xf'));logger['debug'](_0x25b1('0x10'),_0x2173ce,_0x25b1('0xf'),JSON[_0x25b1('0x11')](_0x2896a4));if(_0x2896a4[_0x25b1('0x12')]){if(_0x2896a4[_0x25b1('0x12')][_0x25b1('0x13')]===0x1f4){logger['error'](_0x25b1('0xe'),_0x2173ce,_0x2896a4[_0x25b1('0x12')][_0x25b1('0x14')]);return _0x4e2f6d(_0x2896a4[_0x25b1('0x12')][_0x25b1('0x14')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2173ce,_0x2896a4[_0x25b1('0x12')][_0x25b1('0x14')]);return _0x59cb0f(_0x2896a4[_0x25b1('0x12')]['message']);}else{logger[_0x25b1('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2173ce,'request\x20sent');_0x59cb0f(_0x2896a4['result'][_0x25b1('0x14')]);}})[_0x25b1('0x15')](function(_0xee2313){logger[_0x25b1('0x12')](_0x25b1('0xe'),_0x2173ce,_0xee2313);_0x4e2f6d(_0xee2313);});});}