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

Broken SIP message standard #1061

Open
skotow opened this issue Nov 15, 2023 · 3 comments
Open

Broken SIP message standard #1061

skotow opened this issue Nov 15, 2023 · 3 comments

Comments

@skotow
Copy link

skotow commented Nov 15, 2023

Sip messages not recognizing a double-CRLF sequence

in order to work properly and keep socket live state ( for Opensips )

you should send OPTION message . without that socket will close as not getting response from proxy server possible solution

Before
/**
* Send a keep-alive (a double-CRLF sequence).
/
sendKeepAlive() {
if (this.keepAliveDebounceTimeout) {
// We already have an outstanding keep alive, do not send another.
return Promise.resolve();
}
this.keepAliveDebounceTimeout = setTimeout(() => {
this.clearKeepAliveTimeout();
}, this.configuration.keepAliveDebounce * 1000);
return this.send("\r\n\r\n");
}
/
*
* Start sending keep-alives.
*/

 After 
 
 sendKeepAlive() {
if (this.keepAliveDebounceTimeout) {
  return Promise.resolve();
}
this.keepAliveDebounceTimeout = setTimeout(() => {
  this.clearKeepAliveTimeout();
}, this.configuration.keepAliveDebounce * 1e3);
  const randomString = Math.random().toString(36).substring(7);
  const prox = "xxxxxxx"
  const toFrom = "xxxxx"
  const optionsRequest = `OPTIONS sip:${prox} SIP/2.0\r\n` +
      `Via: SIP/2.0/WSS xxxxx;branch=z9hG4bK` + randomString + `\r\n` +
      `From: <sip:${toFrom}@${prox}>\r\n` +
      `To: <sip:${toFrom}@${prox}>\r\n` +
      `Call-ID: `+ randomString +`\r\n` +
      `CSeq: 1 OPTIONS\r\n`;
  return this.send(optionsRequest.toString());

}

@seanbright
Copy link
Contributor

@skotow
Copy link
Author

skotow commented Nov 15, 2023

if you using proto_wss ? I don't think it will work

@seanbright
Copy link
Contributor

seanbright commented Nov 15, 2023

If it doesn't work then OpenSIPS should add support for it.

Edit: https://www.rfc-editor.org/rfc/rfc7118#section-6 and https://www.rfc-editor.org/rfc/rfc5626#section-4.4.1

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

2 participants