Docker Freeswitch macOS

People seem to be able to run dockerized Freeswitch in Linux, but what about macOS ?
Unlike Linux, a macOS dockerized FS run in its own private network, making it a challenge to get audio to flow in and out of the container.

Let’s say I have Docker running at 192.168.0.100 and FS at 172.17.0.2 inside docker. Are there any FS nat settings that would make audio flow from a client making a call from 192.168.0.110 to 192.168.0.120 ?

Can you show me how you setup your Dockerfile or compose file for this?

/b

Here it is. The image doesn’t contain sounds, hence the “sound” volume.
In switch.conf.xml, I have set rtp-start-port to 16384 and rtp-end-port to 16394.

version: '3.8'
services:
  freeswitch:
    container_name: freeswitch_container
    image: safarov/freeswitch
    environment:
      SOUND_RATES: '8000:16000'
      SOUND_TYPES: 'music:en-us-callie'
    networks:
      - fshost
    # network_mode: "host" #not working on Mac
    volumes:
     # sounds
      - $PWD/sounds:/usr/share/freeswitch/sounds
      # initial
      - $PWD/autoload_configs/event_socket.conf.xml:/usr/share/freeswitch/conf/vanilla/autoload_configs/event_socket.conf.xml
      - $PWD/autoload_configs/switch.conf.xml:/usr/share/freeswitch/conf/vanilla/autoload_configs/switch.conf.xml
      # direct
      - $PWD/conf/vars.xml:/etc/freeswitch/vars.xml
      - $PWD/conf/sip_profiles/internal.xml:/etc/freeswitch/sip_profiles/internal.xml
      - $PWD/conf/sip_profiles/external.xml:/etc/freeswitch/sip_profiles/external.xml
    ports:
    # H.323 Gatekeeper RAS port
    - "1719:1719/udp"
    # H.323 Call Signaling
    - "1729-1729/tcp"
    # MSRP
    - "2855-2856:2855-2856/tcp"
    # STUN service NAT traversal
    - "3478-3479:3478-3479/udp"
    # MLP protocol server
    - "5002:5002/tcp"
    # Neighborhood service
    - "5003:5003/udp"
    # Standard SIP Port, for default Internal Profile
    - "5060:5060/udp"
    - "5060:5060/tcp"
    # Used for SIP signaling (For default "NAT" Profile)
    - "5070:5070/udp"
    - "5070:5070/tcp"
    # Used for SIP signaling (For default "External" Profile)
    - "5080:5080/udp"
    - "5080:5080/tcp"
    # Used for mod_event_socket (SECURITY RISK)
    - "8021:8021/tcp"
    # RTP/ RTCP multimedia streaming (reduced)
    - "16384-16394:16384-16394/udp"
    # WebRTC
    - "5066:5066/tcp"
    # WebRTC
    - "7443:7443/tcp"
    # Verto
    - "8081-8082:8081-8082/tcp"

networks:
  fshost: 
    name: fshost

You’ll need to do some docker in docker magic to get those ports done correctly, and we don’t have any H323 by default, and maybe lower the port range to 1000 ports, the issue in how docker does those proxy processes for ports is silly in my opinion.

/b

For the record, I better mention that I also disabled ipv6 by setting <param name="listen-ip" value="0.0.0.0"/> in event_socket_conf.xml, in case anyone reads this (it wan’t work without it).

Sorry, I don’t know what “docker magic” is.

With this config I can place calls from endpoint to endpoint, but no audio is coming through. If I call the demo ivr 5000, audio gets through from server, but not from client, so the DTMF’s are not registered at the server.

Is this a mac docker specific issue? because ::1 should work everywhere.

/b

Not a 100% sure, but I think ipv6 only works on Linux docker.

Interesting, you may want to file that on github, and we’ll be having two PR days on Tuesday, Mar 21st & April 18 (9am-1pm PST), where we’ve allocated a large chunk of time to help everyone with outsanding PR requests and issues.

/b

I have been using FreeSWITCH in Docker on macOS for many years, it works like a charm. I just set ext-sip-ip and sip-rtp-ip to my host IP and exported some sip and rtp port blocks.