Built motion from commit (unavailable).|2.5.13
[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 _0x16a1=['message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4cf224,_0x30f810){var _0x3ce77c=function(_0x5484b3){while(--_0x5484b3){_0x4cf224['push'](_0x4cf224['shift']());}};_0x3ce77c(++_0x30f810);}(_0x16a1,0x152));var _0x116a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x16a1[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x116a('0x0'));var moment=require('moment');var BPromise=require(_0x116a('0x1'));var rs=require(_0x116a('0x2'));var fs=require('fs');var Redis=require(_0x116a('0x3'));var db=require(_0x116a('0x4'))['db'];var utils=require(_0x116a('0x5'));var logger=require(_0x116a('0x6'))('rpc');var config=require(_0x116a('0x7'));var jayson=require(_0x116a('0x8'));var client=jayson[_0x116a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdbe3b5,_0x24610e,_0x388ed9){return new BPromise(function(_0x2809ef,_0x1a7a2d){return client[_0x116a('0xa')](_0xdbe3b5,_0x388ed9)['then'](function(_0x1cdade){logger[_0x116a('0xb')](_0x116a('0xc'),_0x24610e,_0x116a('0xd'));logger[_0x116a('0xe')](_0x116a('0xf'),_0x24610e,_0x116a('0xd'),JSON[_0x116a('0x10')](_0x1cdade));if(_0x1cdade[_0x116a('0x11')]){if(_0x1cdade[_0x116a('0x11')][_0x116a('0x12')]===0x1f4){logger[_0x116a('0x11')](_0x116a('0xc'),_0x24610e,_0x1cdade[_0x116a('0x11')][_0x116a('0x13')]);return _0x1a7a2d(_0x1cdade['error']['message']);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x24610e,_0x1cdade['error'][_0x116a('0x13')]);return _0x2809ef(_0x1cdade[_0x116a('0x11')]['message']);}else{logger[_0x116a('0xb')](_0x116a('0xc'),_0x24610e,_0x116a('0xd'));_0x2809ef(_0x1cdade[_0x116a('0x14')][_0x116a('0x13')]);}})['catch'](function(_0x477d4a){logger[_0x116a('0x11')](_0x116a('0xc'),_0x24610e,_0x477d4a);_0x1a7a2d(_0x477d4a);});});}