Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / api / voiceMail / voiceMail.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 _0x17e7=['info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0x17e7,0x199));var _0x717e=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x17e7[_0x1e2321];return _0x1d346d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x717e('0x0'));var BPromise=require(_0x717e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x717e('0x2'))['db'];var utils=require(_0x717e('0x3'));var logger=require('../../config/logger')(_0x717e('0x4'));var config=require(_0x717e('0x5'));var jayson=require(_0x717e('0x6'));var client=jayson[_0x717e('0x7')][_0x717e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5efb77,_0x15aaaf,_0x1b6e93){return new BPromise(function(_0x5bdf34,_0x3b6aef){return client[_0x717e('0x9')](_0x5efb77,_0x1b6e93)[_0x717e('0xa')](function(_0xb86499){logger[_0x717e('0xb')](_0x717e('0xc'),_0x15aaaf,_0x717e('0xd'));logger[_0x717e('0xe')](_0x717e('0xf'),_0x15aaaf,_0x717e('0xd'),JSON[_0x717e('0x10')](_0xb86499));if(_0xb86499[_0x717e('0x11')]){if(_0xb86499['error'][_0x717e('0x12')]===0x1f4){logger[_0x717e('0x11')](_0x717e('0xc'),_0x15aaaf,_0xb86499[_0x717e('0x11')][_0x717e('0x13')]);return _0x3b6aef(_0xb86499[_0x717e('0x11')][_0x717e('0x13')]);}logger['error'](_0x717e('0xc'),_0x15aaaf,_0xb86499[_0x717e('0x11')][_0x717e('0x13')]);return _0x5bdf34(_0xb86499[_0x717e('0x11')]['message']);}else{logger['info'](_0x717e('0xc'),_0x15aaaf,_0x717e('0xd'));_0x5bdf34(_0xb86499['result'][_0x717e('0x13')]);}})[_0x717e('0x14')](function(_0x30a3d5){logger[_0x717e('0x11')](_0x717e('0xc'),_0x15aaaf,_0x30a3d5);_0x3b6aef(_0x30a3d5);});});}