Built motion from commit (unavailable).|2.4.17
[motion2.git] / server / api / cdr / cdr.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 _0xbf16=['info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xbf16,0x18a));var _0x6bf1=function(_0x14d673,_0x293d6c){_0x14d673=_0x14d673-0x0;var _0x1df24c=_0xbf16[_0x14d673];return _0x1df24c;};'use strict';var _=require(_0x6bf1('0x0'));var util=require(_0x6bf1('0x1'));var moment=require(_0x6bf1('0x2'));var BPromise=require(_0x6bf1('0x3'));var rs=require(_0x6bf1('0x4'));var fs=require('fs');var Redis=require(_0x6bf1('0x5'));var db=require(_0x6bf1('0x6'))['db'];var utils=require(_0x6bf1('0x7'));var logger=require('../../config/logger')(_0x6bf1('0x8'));var config=require(_0x6bf1('0x9'));var jayson=require(_0x6bf1('0xa'));var client=jayson[_0x6bf1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34f3cb,_0x1007e3,_0x4ee60e){return new BPromise(function(_0x1036ca,_0x3e8d68){return client[_0x6bf1('0xc')](_0x34f3cb,_0x4ee60e)[_0x6bf1('0xd')](function(_0xad2399){logger[_0x6bf1('0xe')]('Cdr,\x20%s,\x20%s',_0x1007e3,_0x6bf1('0xf'));logger['debug'](_0x6bf1('0x10'),_0x1007e3,_0x6bf1('0xf'),JSON[_0x6bf1('0x11')](_0xad2399));if(_0xad2399[_0x6bf1('0x12')]){if(_0xad2399[_0x6bf1('0x12')][_0x6bf1('0x13')]===0x1f4){logger[_0x6bf1('0x12')](_0x6bf1('0x14'),_0x1007e3,_0xad2399[_0x6bf1('0x12')][_0x6bf1('0x15')]);return _0x3e8d68(_0xad2399[_0x6bf1('0x12')][_0x6bf1('0x15')]);}logger[_0x6bf1('0x12')]('Cdr,\x20%s,\x20%s',_0x1007e3,_0xad2399[_0x6bf1('0x12')]['message']);return _0x1036ca(_0xad2399[_0x6bf1('0x12')][_0x6bf1('0x15')]);}else{logger[_0x6bf1('0xe')](_0x6bf1('0x14'),_0x1007e3,'request\x20sent');_0x1036ca(_0xad2399[_0x6bf1('0x16')][_0x6bf1('0x15')]);}})[_0x6bf1('0x17')](function(_0x40d539){logger['error'](_0x6bf1('0x14'),_0x1007e3,_0x40d539);_0x3e8d68(_0x40d539);});});}