[Home]

Summary:ASTERISK-26879: PJSIP external_media_address ignored if no local_net options are provided
Reporter:Matt Jordan (mjordan)Labels:pjsip
Date Opened:2017-03-16 10:07:24Date Closed:2017-03-20 14:39:45
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:Frequency of
Occurrence
Related
Issues:
causesASTERISK-27024 nat/external_media settings ignored in 14.4.1
Environment:Attachments:
Description:Let's say you have the following transport definition:

```
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
external_media_address=x.x.x.x
```

We're saying that regardless of who I'm sending a packet to, advertise as {{x.x.x.x}} in the SDP. This may be a bit odd, as it means we want to advertise as that IP address regardless of the network we send on - but in some odd situations (like where you're running Asterisk in a Docker container with `network=host` and you're communicating with stuff inside the Docker container which may also be punching holes through its NAT'd network back to the outside world) you may want to do that.

(The above is purely hypothetical).

Unfortunately, in today's implementation, we will ignore the `external_media_address`, as checking a `localnet` that is NULL (because it wasn't set) against the address we're sending to will always return 'true' - so Asterisk will always think we're sending a SIP message to a network within our localnet. Even though we didn't define one.
Comments:By: Friendly Automation (friendly-automation) 2017-03-20 14:39:46.170-0500

Change 5229 merged by zuul:
res/res_pjsip_session: Only check localnet if it is defined

[https://gerrit.asterisk.org/5229|https://gerrit.asterisk.org/5229]

By: Friendly Automation (friendly-automation) 2017-03-20 14:40:30.560-0500

Change 5231 merged by Joshua Colp:
res/res_pjsip_session: Only check localnet if it is defined

[https://gerrit.asterisk.org/5231|https://gerrit.asterisk.org/5231]

By: Friendly Automation (friendly-automation) 2017-03-20 14:52:37.550-0500

Change 5230 merged by zuul:
res/res_pjsip_session: Only check localnet if it is defined

[https://gerrit.asterisk.org/5230|https://gerrit.asterisk.org/5230]

By: Bud (Bud82) 2017-05-17 13:40:57.066-0500

Since 14.4.0 it looks like this change has broken the use of an Asterisk server inside a NAT environment with port-forwarding correctly set (similar to the Docker environment concept above) while having the [transport-udp] set similar to above. Instead of giving the x.x.x.x external_media_address / external_signaling_address to the client to connect to RTP streams, the LAN IP-address of the Asterisk server is given (to which the remote client is unable to connect). This did work in 14.3.0 however.

local_net is set to 192.168.x.x LAN range

Calls do work when both clients are connected to this LAN.

By: Joshua C. Colp (jcolp) 2017-05-17 13:56:10.630-0500

[~Bud82] Please create a new issue and attach full logs as well as complete configuration.

By: Florian Floimair (f.floimair) 2017-06-06 10:51:15.623-0500

Bud's problem looks to be ASTERISK-27024


By: Friendly Automation (friendly-automation) 2017-09-06 09:45:45.826-0500

Change 6395 merged by Jenkins2:
res/res_pjsip: Standardize/fix localnet checks across pjsip.

[https://gerrit.asterisk.org/6395|https://gerrit.asterisk.org/6395]

By: Friendly Automation (friendly-automation) 2017-09-06 10:10:32.788-0500

Change 6396 merged by Jenkins2:
res/res_pjsip: Standardize/fix localnet checks across pjsip.

[https://gerrit.asterisk.org/6396|https://gerrit.asterisk.org/6396]

By: Friendly Automation (friendly-automation) 2017-09-06 10:15:40.174-0500

Change 6397 merged by Joshua Colp:
res/res_pjsip: Standardize/fix localnet checks across pjsip.

[https://gerrit.asterisk.org/6397|https://gerrit.asterisk.org/6397]

By: Friendly Automation (friendly-automation) 2017-09-06 10:19:14.874-0500

Change 6398 merged by Jenkins2:
res/res_pjsip: Standardize/fix localnet checks across pjsip.

[https://gerrit.asterisk.org/6398|https://gerrit.asterisk.org/6398]