Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / api / voiceMailMessage / voiceMailMessage.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 _0x6493=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','http','request'];(function(_0x2fc026,_0xdc4f7a){var _0x34d056=function(_0x457d02){while(--_0x457d02){_0x2fc026['push'](_0x2fc026['shift']());}};_0x34d056(++_0xdc4f7a);}(_0x6493,0xc8));var _0x3649=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x6493[_0x5a99db];return _0x3aad62;};'use strict';var _=require(_0x3649('0x0'));var util=require('util');var moment=require(_0x3649('0x1'));var BPromise=require(_0x3649('0x2'));var rs=require(_0x3649('0x3'));var fs=require('fs');var Redis=require(_0x3649('0x4'));var db=require(_0x3649('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3649('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3649('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd2cb1f,_0x28890a,_0x259c47){return new BPromise(function(_0x2b1828,_0x31a3f2){return client[_0x3649('0x8')](_0xd2cb1f,_0x259c47)['then'](function(_0x48dd68){logger[_0x3649('0x9')](_0x3649('0xa'),_0x28890a,_0x3649('0xb'));logger['debug'](_0x3649('0xc'),_0x28890a,_0x3649('0xb'),JSON[_0x3649('0xd')](_0x48dd68));if(_0x48dd68[_0x3649('0xe')]){if(_0x48dd68[_0x3649('0xe')][_0x3649('0xf')]===0x1f4){logger[_0x3649('0xe')](_0x3649('0xa'),_0x28890a,_0x48dd68[_0x3649('0xe')][_0x3649('0x10')]);return _0x31a3f2(_0x48dd68[_0x3649('0xe')][_0x3649('0x10')]);}logger[_0x3649('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x28890a,_0x48dd68[_0x3649('0xe')][_0x3649('0x10')]);return _0x2b1828(_0x48dd68[_0x3649('0xe')]['message']);}else{logger[_0x3649('0x9')](_0x3649('0xa'),_0x28890a,_0x3649('0xb'));_0x2b1828(_0x48dd68[_0x3649('0x11')][_0x3649('0x10')]);}})[_0x3649('0x12')](function(_0x2c1bdd){logger[_0x3649('0xe')](_0x3649('0xa'),_0x28890a,_0x2c1bdd);_0x31a3f2(_0x2c1bdd);});});}