fonoster / routr

⚡ The future of programmable SIP servers.
https://routr.io
MIT License
1.42k stars 147 forks source link

Allow custom configurations via json file input to replace default rtpengine parameters #225

Open psanders opened 1 year ago

psanders commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently, the RTPRelay module hardcodes the Offer/Answer parameter according to the most common use case for Routr. This approach limits the flexibility for users who may have different requirements based on specific use cases.

Describe the solution you'd like

Allow users to overwrite the default parameters by passing a JSON file with their own configurations. The file could look as follows:

{
  "webToWeb": {
    "ICE": "force",
    "SDES": "off",
    "flags": ["trust-address", "replace-origin", "replace-session-connection"]
  },
  "webToPhone": {
    "transport-protocol": "RTP/AVP",
    "rtcp-mux": "demux",
    "ICE": "remove",
    "flags": ["trust-address", "replace-origin", "replace-session-connection"]
  },
  "phoneToWeb": {
    "transport-protocol": "UDP/TLS/RTP/SAVPF",
    "rtcp-mux": "required",
    "ICE": "force",
    "SDES": "off",
    "flags": ["trust-address", "replace-origin", "replace-session-connection", "generate-mid"]
  },
  "phoneToPhone": {
    "transport-protocol": "RTP/AVP",
    "rtcp-mux": "demux",
    "ICE": "remove",
    "flags": ["trust-address", "replace-origin", "replace-session-connection"]
  }
}

Describe alternatives you've considered

As of now, implementing the ability to pass a JSON file for configurations seems like a more efficient solution.

Additional context

N/A