Built motion from commit (unavailable).|2.5.11
[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 _0xb5cb=['lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0xb5cb,0x1ed));var _0xbb5c=function(_0x267559,_0x1f907c){_0x267559=_0x267559-0x0;var _0x2fafc9=_0xb5cb[_0x267559];return _0x2fafc9;};'use strict';var _=require(_0xbb5c('0x0'));var util=require('util');var moment=require(_0xbb5c('0x1'));var BPromise=require('bluebird');var rs=require(_0xbb5c('0x2'));var fs=require('fs');var Redis=require(_0xbb5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb5c('0x4'));var logger=require(_0xbb5c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbb5c('0x6'));var client=jayson[_0xbb5c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31935c,_0x512de4,_0x77d918){return new BPromise(function(_0x3f84bb,_0x48c5b2){return client['request'](_0x31935c,_0x77d918)[_0xbb5c('0x8')](function(_0x2382b0){logger[_0xbb5c('0x9')](_0xbb5c('0xa'),_0x512de4,_0xbb5c('0xb'));logger['debug']('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x512de4,_0xbb5c('0xb'),JSON[_0xbb5c('0xc')](_0x2382b0));if(_0x2382b0[_0xbb5c('0xd')]){if(_0x2382b0[_0xbb5c('0xd')]['code']===0x1f4){logger[_0xbb5c('0xd')](_0xbb5c('0xa'),_0x512de4,_0x2382b0[_0xbb5c('0xd')][_0xbb5c('0xe')]);return _0x48c5b2(_0x2382b0[_0xbb5c('0xd')]['message']);}logger[_0xbb5c('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x512de4,_0x2382b0[_0xbb5c('0xd')]['message']);return _0x3f84bb(_0x2382b0[_0xbb5c('0xd')]['message']);}else{logger[_0xbb5c('0x9')](_0xbb5c('0xa'),_0x512de4,_0xbb5c('0xb'));_0x3f84bb(_0x2382b0[_0xbb5c('0xf')][_0xbb5c('0xe')]);}})[_0xbb5c('0x10')](function(_0x4bd683){logger[_0xbb5c('0xd')](_0xbb5c('0xa'),_0x512de4,_0x4bd683);_0x48c5b2(_0x4bd683);});});}