Built motion from commit (unavailable).|2.5.8
[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 _0xa45b=['request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x1fcea1,_0x4052fa){var _0x453124=function(_0x50677c){while(--_0x50677c){_0x1fcea1['push'](_0x1fcea1['shift']());}};_0x453124(++_0x4052fa);}(_0xa45b,0x17c));var _0xba45=function(_0x12da81,_0x108035){_0x12da81=_0x12da81-0x0;var _0x564e5c=_0xa45b[_0x12da81];return _0x564e5c;};'use strict';var _=require(_0xba45('0x0'));var util=require('util');var moment=require(_0xba45('0x1'));var BPromise=require(_0xba45('0x2'));var rs=require(_0xba45('0x3'));var fs=require('fs');var Redis=require(_0xba45('0x4'));var db=require(_0xba45('0x5'))['db'];var utils=require(_0xba45('0x6'));var logger=require(_0xba45('0x7'))(_0xba45('0x8'));var config=require('../../config/environment');var jayson=require(_0xba45('0x9'));var client=jayson[_0xba45('0xa')][_0xba45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bd625,_0xeb737f,_0x2b6930){return new BPromise(function(_0x36346c,_0x57b3cf){return client[_0xba45('0xc')](_0x3bd625,_0x2b6930)[_0xba45('0xd')](function(_0x2e589f){logger[_0xba45('0xe')](_0xba45('0xf'),_0xeb737f,_0xba45('0x10'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0xeb737f,'request\x20sent',JSON[_0xba45('0x11')](_0x2e589f));if(_0x2e589f['error']){if(_0x2e589f[_0xba45('0x12')][_0xba45('0x13')]===0x1f4){logger[_0xba45('0x12')](_0xba45('0xf'),_0xeb737f,_0x2e589f[_0xba45('0x12')]['message']);return _0x57b3cf(_0x2e589f['error'][_0xba45('0x14')]);}logger[_0xba45('0x12')](_0xba45('0xf'),_0xeb737f,_0x2e589f[_0xba45('0x12')]['message']);return _0x36346c(_0x2e589f[_0xba45('0x12')]['message']);}else{logger['info'](_0xba45('0xf'),_0xeb737f,_0xba45('0x10'));_0x36346c(_0x2e589f['result']['message']);}})[_0xba45('0x15')](function(_0x16a0f8){logger[_0xba45('0x12')](_0xba45('0xf'),_0xeb737f,_0x16a0f8);_0x57b3cf(_0x16a0f8);});});}