macOS: Call allocation always uses AF_UNSPEC with regint=0 accounts, ignoring net_af and mediaaf settings #3642
Unanswered
svengerhardt
asked this question in
Q&A
Replies: 1 comment
-
|
And please don't make any assumptions with AI generated bug reports. A clear log, config and short description of the problem is enough. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
macOS: Call allocation always uses AF_UNSPEC with regint=0 accounts, ignoring net_af and mediaaf settings
Summary
On macOS, outgoing calls from local accounts (
regint=0) always useAF_UNSPECfor RTP socket allocation, regardless ofnet_af ipv4in config ormediaaf=ipv4in account parameters. This causesgetaddrinfofailures and prevents call establishment.Environment
/usr/local/lib/baresip/modules/)regint=0)Problem Description
When initiating an outgoing call, baresip always allocates the call with:
This causes RTP socket creation to fail on macOS because
getaddrinfocannot resolve?:0withAF_UNSPEC:The expected behavior would be:
Configuration
config file (
~/.baresip/config)module_path /usr/local/lib/baresip/modules/ module stdio.so module debug_cmd.so module uuid.so module_app menu.so module coreaudio.so ausrc coreaudio auplay coreaudio module g711.so module opus.so audio_codecs pcmu/8000,pcma/8000,opus/48000/2 module srtp.so module ice.so module stun.so stun_server stun:74.125.250.129:19302 rtp_ports 22000-22100 module account.so sip_listen 192.168.2.102:5060 sip_transports tcp sip_trans_def tcp # Attempting to force IPv4 net_af ipv4 net_interface en0 dns_server 8.8.8.8:53accounts file (
~/.baresip/accounts)<sip:tester@xxx.sip.livekit.cloud>;auth_pass=tester;regint=0;sipnat=outbound;outbound="sip:xxx.eu.sip.livekit.cloud;transport=tcp";mediaenc=srtp-mand;medianat=ice;stunserver="stun:74.125.250.129:19302";mediaaf=ipv4Steps to Reproduce
baresip -vFull Startup Log
Full Dial Failure Log
UA Status Output (
/uastat)Note:
mediaaf=ipv4appears in the address string but is not parsed as a separate parameter (nomediaaf:line in output):Network Status (
/netstat)Attempted Workarounds (all failed)
net_af ipv4in config - Network layer detects IPv4 correctly, but call allocation still usesAF_UNSPECmediaaf=ipv4in account - Parameter appears in address string but is not parsed (nomediaaf:in/uastatoutput)dns_server 8.8.8.8:53in config - Does not affect call allocationDisabling IPv6 on macOS system level:
Still results in
AF_UNSPEC- the problem is in baresip's call allocation logic, not system network configurationUsing STUN server IP directly (avoiding DNS lookup) - STUN resolves correctly but call allocation still fails
Analysis
The issue appears to be in the call allocation path for
regint=0(local/peer-to-peer) accounts:AF_INET(IPv4) - visible in startup logmediaafparameter is not being parsed from the account stringua_connect()is called, the address family is not inherited from the network layer or account settingsAF_UNSPEC, which fails on macOS when trying to bind RTP socketsAccording to the wiki documentation,
mediaafshould be a valid account parameter:However, the parameter does not appear in the parsed account output, suggesting it may have been removed or renamed in version 4.x.
Expected Behavior
For
regint=0accounts on a system with only IPv4 configured (or withnet_af ipv4), calls should be allocated with:Possible Fix Locations
src/call.c-call_alloc()function where laddr and af are determinedsrc/ua.c-ua_connect()where the call parameters are set upsrc/account.c- Parsing ofmediaafparameter (if it should still be supported)Related Issues
This may be related to the changes in PR #1618 "ua: select proper af and laddr for outgoing IP calls" and PR #1590 "ua: select laddr with route to SDP offer address", which addressed similar issues on Linux.
Workaround Request
Is there any other configuration option to force IPv4 for call allocation that I may have missed?
Beta Was this translation helpful? Give feedback.
All reactions