From 9b87b32abf0c96f22896cc18528ca9d48803a626 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 9 Apr 2024 14:59:00 +0200 Subject: [PATCH] Adding JanusConn to config --- config/config_defaults.go | 3 +++ config/janusagntcfg.go | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/config/config_defaults.go b/config/config_defaults.go index 3fa771930..fabec2795 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -1184,6 +1184,9 @@ const CGRATES_CFG_JSON = ` "enabled": false, // enables the Janus agent: "url": "/janus", "sessions_conns": ["*internal"], + "janus_conns":[ // instantiate connections to multiple Asterisk servers + {"address": "127.0.0.1:8088", "type": "*ws"} + ], "request_processors": [ // request processors to be applied to Janus messages ], }, diff --git a/config/janusagntcfg.go b/config/janusagntcfg.go index 29ab9fd1f..e7671b56b 100644 --- a/config/janusagntcfg.go +++ b/config/janusagntcfg.go @@ -23,11 +23,18 @@ import ( "github.com/cgrates/rpcclient" ) +// JanusConn represents one connection to Janus server +type JanusConn struct { + Address string // Address to reach Janus + Type string // Connection type +} + // JanusAgentCfg the config for an Janus Agent type JanusAgentCfg struct { Enabled bool URL string SessionSConns []string + JanusConns []*JanusConn // connections towards Janus RequestProcessors []*RequestProcessor }