Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support rtcp without address #355

Open
tylerlong opened this issue Nov 28, 2023 · 1 comment
Open

support rtcp without address #355

tylerlong opened this issue Nov 28, 2023 · 1 comment

Comments

@tylerlong
Copy link

tylerlong commented Nov 28, 2023

function ipAddressFromSdp(sdp: string) {
  const m = sdp.match(/^IN (IP4|IP6) ([^ ]+)$/);
  if (!m) throw new Error("exception");
  return m[2];
}

According to https://www.ietf.org/rfc/rfc3605.txt

    m=audio 49170 RTP/AVP 0
    a=rtcp:53020

is valid. In such case, there is no IP address.

@tylerlong
Copy link
Author

tylerlong commented Nov 28, 2023

Suggested change:

function ipAddressFromSdp(sdp: string) {
  const m = sdp.match(/^IN (IP4|IP6) ([^ ]+)$/);
  if (!m) return undefined;
  return m[2];
}

Or

function ipAddressFromSdp(sdp: string) {
  const m = sdp.match(/^IN (IP4|IP6) ([^ ]+)$/);
  if (!m) return '0.0.0.0';
  return m[2];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant