Repository navigation
NethVoice: reject unknown SIP peers without opening audio using upstream Core #8218
Description
Parent: #7570
Preserve this NethVoice behavior while using the unmodified upstream FreePBX Core module. The upgrade checkout installs Core 17.0.18.54. The old nethesis_nv8 fork is based on Core 16.0.68.40; comparing it with the matching upstream 16 release isolates the Nethesis changes from unrelated upstream updates. The obsolete Flexisip transport change is excluded from this migration.
Problem and original purpose
Calls from unknown SIP peers that are rejected by policy should end immediately without answering or opening an audio session. This concerns unmatched SIP peers, not legitimate callers who withhold their telephone number.
The fork first adjusted hangup behavior around Congestion() and later removed Answer, waiting, playback and congestion entirely, replacing them with immediate Hangup. Historical reports describe lingering calls and audio-related file descriptors remaining open until Asterisk exhausted its available resources.
Original changes: 14e0d95c, bf311736 and f1c7943d in nethesis/freepbx-core.
Upstream assessment
Core 17.0.18.54 still answers and plays audio before congestion in the unknown-peer rejection path. Immediate rejection therefore needs a replacement to preserve the fork's final behavior. The historical resource leak has not been reproduced on Asterisk 22 and must not be assumed to persist unchanged.
Implementation plan
- Confirm which supported trunks and gateways require guest acceptance, and verify their identification on the upgraded stack.
- If guest acceptance is unnecessary, disable it through supported SIP settings after validating supported inbound paths.
- Otherwise, route the anonymous endpoint through supported custom configuration to a module-owned context that retains the intended anonymous-call policy and logging, and immediately hangs up rejected calls without answering, playback or opening media.
- Preserve any deliberately permitted anonymous-call routing; do not change identified trunk behavior or reject legitimate withheld caller IDs.
- Leave Core's
etc/extensions.confunchanged.
Acceptance criteria
- Unknown-peer calls rejected by policy end without an answered or media session.
- Identified trunks, supported gateways and legitimate withheld caller IDs continue working.
- Deliberately permitted anonymous-call routing remains consistent with configuration.
- Repeated rejected calls do not accumulate channels or file descriptors; include IPv4 and IPv6 cases where supported.
- The configuration survives reload, restart and backup/restore with unmodified upstream Core.
- Record whether the historical lingering-call and descriptor-leak symptoms reproduce on Asterisk 22.
References
- congestion sometimes fails to kill anonymous call nethesis/dev#6183
- Asterisk hangs with "Too many open files" nethesis/dev#6218
- Don't open any audio channel when dealing with external anonymous calls nethesis/freepbx-core#6
- https://github.com/FreePBX/core/blob/release/17.0.18.54/etc/extensions.conf#L179
- https://github.com/FreePBX/core/blob/release/17.0.18.54/functions.inc/drivers/PJSip.class.php#L1098
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTesting
Activity
Stell0 commentedon Oct 9, 2026
Test
Test Case 1
unknown_peer_rejection_test.php: rejected peers use no audio applications; permitted anonymous routing remains intact.Test Case 2
Test Case 3
Completed checks passed on
nethvoice58withpr-1036.1093-1.1036f75: ten INVITEs returned100 → 603, no RTP reached the advertised port, no channels remained, and a registered call connected.Draft PR: nethesis/ns8-nethvoice#1036.
fix(sip): Reject unknown peers without audio