Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / voicePrefix / voicePrefix.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 _0xbc7a=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','message','request\x20sent'];(function(_0x34c403,_0x341b70){var _0x5bf2b9=function(_0x300064){while(--_0x300064){_0x34c403['push'](_0x34c403['shift']());}};_0x5bf2b9(++_0x341b70);}(_0xbc7a,0xa4));var _0xabc7=function(_0x5d8be1,_0x44bfb5){_0x5d8be1=_0x5d8be1-0x0;var _0x4e2e9c=_0xbc7a[_0x5d8be1];return _0x4e2e9c;};'use strict';var _=require(_0xabc7('0x0'));var util=require(_0xabc7('0x1'));var moment=require(_0xabc7('0x2'));var BPromise=require('bluebird');var rs=require(_0xabc7('0x3'));var fs=require('fs');var Redis=require(_0xabc7('0x4'));var db=require(_0xabc7('0x5'))['db'];var utils=require(_0xabc7('0x6'));var logger=require(_0xabc7('0x7'))(_0xabc7('0x8'));var config=require('../../config/environment');var jayson=require(_0xabc7('0x9'));var client=jayson[_0xabc7('0xa')][_0xabc7('0xb')]({'port':0x232a});config[_0xabc7('0xc')]=_[_0xabc7('0xd')](config[_0xabc7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xabc7('0xe'))(new Redis(config['redis']));require(_0xabc7('0xf'))[_0xabc7('0x10')](socket);function respondWithRpcPromise(_0x3db08f,_0x6fe2da,_0x3677d2){return new BPromise(function(_0x5c6c81,_0x590292){return client[_0xabc7('0x11')](_0x3db08f,_0x3677d2)['then'](function(_0x42cb88){logger[_0xabc7('0x12')](_0xabc7('0x13'),_0x6fe2da,'request\x20sent');logger[_0xabc7('0x14')](_0xabc7('0x15'),_0x6fe2da,'request\x20sent',JSON['stringify'](_0x42cb88));if(_0x42cb88[_0xabc7('0x16')]){if(_0x42cb88[_0xabc7('0x16')]['code']===0x1f4){logger[_0xabc7('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x6fe2da,_0x42cb88[_0xabc7('0x16')][_0xabc7('0x17')]);return _0x590292(_0x42cb88[_0xabc7('0x16')][_0xabc7('0x17')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x6fe2da,_0x42cb88[_0xabc7('0x16')][_0xabc7('0x17')]);return _0x5c6c81(_0x42cb88[_0xabc7('0x16')][_0xabc7('0x17')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x6fe2da,_0xabc7('0x18'));_0x5c6c81(_0x42cb88[_0xabc7('0x19')]['message']);}})[_0xabc7('0x1a')](function(_0x15be22){logger['error'](_0xabc7('0x13'),_0x6fe2da,_0x15be22);_0x590292(_0x15be22);});});}