Janus SIP plugin still using private IP in Contact header (AWS EC2 fixed public IP)

Hi everyone,

We’re facing an issue where Janus SIP plugin keeps registering using the private IP (172.31.0.38) in the Contact: header, even though we’ve set up the correct public IP configuration.

Environment

  • Janus Version : 1.3.2
  • SIP Plugin Version : 0.0.9
  • Platform: Ubuntu 24.04 LTS on AWS EC2
  • Public IP: 18.xxx.xxx.xxx (Elastic IP, fixed)

Problem (from sngrep)

Contact: ca <sip:5681319XX521@172.31.0.38:37543;transport=tcp>

The Contact header is exposing the internal IP instead of the public one.

Configurations

/opt/janus/etc/janus/janus.jcfg

nat: {
        ice_lite: false
        nat_1_1_mapping: 18.xxx.xxx.xxx
        keep_private_host: false
        ice_enforce_list: 18.xxx.xxx.xxx
        ice_ignore_list: vmnet

/opt/janus/etc/janus/janus.plugin.sip.jcfg

 general: {
        contact_ip: 18.xxx.xxx.xxx
        contact_rewrite: true
        behind_nat: true
        register_ttl: 3600
        keepalive_interval: 120
        sip_timer_t1x64: 32000
        rtp_port_range: 20000-40000
        user_agent: Janus WebRTC
        sdp_ip: 18.xxx.xxx.xxx
    }

SDP is showing the correct public IP:

IP to advertise in SDP: 18.xxx.xxx.xxx

But the Contact header still reflects 172.31.0.38 .

Observations

  • We confirmed that behind_nat = true and contact_ip are explicitly defined.
  • Janus reports in logs:Using nat_1_1_mapping for public IP: 18.xxx.xxx.xxx
  • Despite this, sngrep shows that Janus is still sending the local IP in the REGISTER Contact header.

Question

What are we missing?

Is there any additional setting or known issue that prevents contact_ip or nat_1_1_mapping from being applied to the SIP Contact header in Janus v1.3.2?

Any help or guidance is appreciated!

Thanks in advance,

Ricardo

The config in janus.jcfg is esclusively for the Janus WebRTC side, it has nothing to do with plugins. The SIP plugin is configured in a different file.

On top of that, the configuration of the sip plugin includes unkown attributes like “contact_ip”.

Thanks, Atoppi.

I went back to the original janus.plugin.sip.jcfg.

I made the minimal configuration using only the parameters in that file.

But still no success.

I’ve been breaking my head over this for a week, and stuck at registration because the Contact header contains the private IP address.

I really don’t know what to try next.

Any help will be welcome.

Thanks Lorenzo.

What’s the correct parameter to set in janus.plugin.sip.jcfg to make Janus use the public IP address in the Contact header?

I really appreciate your help.

Have you try behind_nat?

Hi Yurii!

Yes, I had, but no success.

Thanks!