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

**URL:** <https://janus.discourse.group/t/janus-sip-plugin-still-using-private-ip-in-contact-header-aws-ec2-fixed-public-ip/1670>\
**Category:** General\
**Tags:** sip\
**Created:** [July 8, 2025, 6:21pm UTC](https://janus.discourse.group/t/janus-sip-plugin-still-using-private-ip-in-contact-header-aws-ec2-fixed-public-ip/1670 "2025-07-08T18:21:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbalbuquerque](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rbalbuquerque](https://janus.discourse.group/u/rbalbuquerque)\
**Post date:** [July 8, 2025, 6:21pm UTC](https://janus.discourse.group/t/janus-sip-plugin-still-using-private-ip-in-contact-header-aws-ec2-fixed-public-ip/1670/1 "2025-07-08T18:21:08Z")

</div>

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)**

```auto
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**

```auto
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**

```auto
 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:**

```auto
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**

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [July 9, 2025, 9:05am UTC](https://janus.discourse.group/t/janus-sip-plugin-still-using-private-ip-in-contact-header-aws-ec2-fixed-public-ip/1670/2 "2025-07-09T09:05:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![atoppi](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/atoppi/32/8_2.png) [@atoppi](https://janus.discourse.group/u/atoppi)\
**Post date:** [July 9, 2025, 10:15am UTC](https://janus.discourse.group/t/janus-sip-plugin-still-using-private-ip-in-contact-header-aws-ec2-fixed-public-ip/1670/3 "2025-07-09T10:15:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rbalbuquerque](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rbalbuquerque](https://janus.discourse.group/u/rbalbuquerque)\
**Post date:** [July 9, 2025, 2:31pm UTC](https://janus.discourse.group/t/janus-sip-plugin-still-using-private-ip-in-contact-header-aws-ec2-fixed-public-ip/1670/4 "2025-07-09T14:31:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rbalbuquerque](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rbalbuquerque](https://janus.discourse.group/u/rbalbuquerque)\
**Post date:** [July 9, 2025, 2:36pm UTC](https://janus.discourse.group/t/janus-sip-plugin-still-using-private-ip-in-contact-header-aws-ec2-fixed-public-ip/1670/5 "2025-07-09T14:36:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ych](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/ych/32/11_2.png) [@ych](https://janus.discourse.group/u/ych)\
**Post date:** [July 11, 2025, 7:44am UTC](https://janus.discourse.group/t/janus-sip-plugin-still-using-private-ip-in-contact-header-aws-ec2-fixed-public-ip/1670/6 "2025-07-11T07:44:35Z")

</div>

Have you try [`behind_nat`](https://github.com/meetecho/janus-gateway/blob/2db8b0d690de5e1e96a08a73cc95bd0eefb1982f/conf/janus.plugin.sip.jcfg.sample#L22)?

---

<div class="post-metadata">

**Author:** ![rbalbuquerque](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rbalbuquerque](https://janus.discourse.group/u/rbalbuquerque)\
**Post date:** [July 11, 2025, 1:59pm UTC](https://janus.discourse.group/t/janus-sip-plugin-still-using-private-ip-in-contact-header-aws-ec2-fixed-public-ip/1670/7 "2025-07-11T13:59:45Z")

</div>

Hi Yurii!

Yes, I had, but no success.

Thanks!
