summaryrefslogtreecommitdiff
path: root/res/res_pjsip_sdp_rtp.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2017-03-16 10:39:00 -0500
committerMatt Jordan <mjordan@digium.com>2017-03-16 15:00:53 -0500
commit486abb4210079fa29ec14e34189d959fa7d08f6d (patch)
tree91009fdbedab48202f9ceb95e5080a3385cfcaad /res/res_pjsip_sdp_rtp.c
parent6541a0708320970379d8197a8ede49b264a0c043 (diff)
res/res_pjsip_session: Only check localnet if it is defined
If local_net is not defined on a transport, transport_state->localnet will be NULL. ast_apply_ha will, be default, return AST_SENSE_ALLOW in this case, causing the external_media_address, if set, to be skipped. This patch causes us to only check if we are sending within a network if local_net is defined. ASTERISK-26879 #close Change-Id: Ib661c31a954cabc9c99f1f25c9c9a5c5b82cbbfb
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r--res/res_pjsip_sdp_rtp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 8c1c9383d..7e4decea1 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1469,10 +1469,11 @@ static void change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struc
ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);
/* Is the address within the SDP inside the same network? */
- if (ast_apply_ha(transport_state->localnet, &addr) == AST_SENSE_ALLOW) {
+ if (transport_state->localnet
+ && ast_apply_ha(transport_state->localnet, &addr) == AST_SENSE_ALLOW) {
return;
}
-
+ ast_debug(5, "Setting media address to %s\n", transport->external_media_address);
pj_strdup2(tdata->pool, &stream->conn->addr, transport->external_media_address);
}