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

[BUG] SIP OPTIONS sent by nathelper module re-use the same branch and CSeq #3536

Open
gmzaza opened this issue Dec 5, 2024 · 1 comment
Open
Labels

Comments

@gmzaza
Copy link

gmzaza commented Dec 5, 2024

OpenSIPS version you are running

version: opensips 3.4.9 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: cd02af8d9
main.c compiled on  with gcc 11

Describe the bug
When a device registers to the OpenSIPS registrar and nathelper is pinging it using the OPTIONS method, each SIP OPTIONS packet sent will have the same "branch=" value in the SIP Via header and same "CSeq: 1 OPTIONS"

The "branch" is meant to be unique for each transaction.

OpenSIPS will even use the same "branch=" value when sending SIP OPTIONS to multiple different endpoint devices registered with the same username.

This confuses some endpoint devices that then reply with a Call-ID associated with the incorrect OPTIONS and OpenSIPS thinks that the device has become unreachable.

To Reproduce
Set up OpenSIPS as a registrar with nathelper enabled and register an endpoint device using SIP over UDP (5060).

loadmodule "nathelper.so"
modparam("nathelper", "max_pings_lost", 3)
modparam("nathelper", "natping_interval", 60)
modparam("nathelper", "natping_partitions", 8)
modparam("nathelper", "natping_tcp", 1)
modparam("nathelper", "ping_nated_only", 0)
modparam("nathelper", "ping_threshold", 3)
modparam("nathelper", "sipping_bflag", "SIP_PING_FLAG")
modparam("nathelper", "sipping_from", "sip:[email protected]")
modparam("nathelper", "sipping_latency_flag", "SIP_PING_FLAG")
modparam("nathelper", "remove_on_timeout_bflag", "SIP_PING_FLAG")
modparam("nathelper", "sipping_method", "OPTIONS")
modparam("nathelper", "received_avp", "$avp(received_nh)")

Expected behavior
The "branch" should be unique for each transaction and, accordingly, each SIP OPTIONS packet sent by OpenSIPS (with the possible exception of retransmissions within the retransmission timer).

Relevant System Logs
No logs

OS/environment information

  • Operating System: Ubuntu Linux 22.04.5, kernel 5.15.0-91-generic, x86_64
  • OpenSIPS installation: debs apt.opensips.org 3.4-releases
  • other relevant information:

Additional context

Copy link

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

@github-actions github-actions bot added the stale label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant