res_pjsip_session: Correct inverted test in session_outgoing_nat_hook
authorGeorge Joseph <gjoseph@digium.com>
Wed, 14 Jun 2017 13:29:00 +0000 (07:29 -0600)
committerSean Bright <sean.bright@gmail.com>
Wed, 14 Jun 2017 16:07:07 +0000 (11:07 -0500)
There was a typo introduced in commit 776ffd77 which was preventing
the transport's external media address from being used.

ASTERISK-27024 #close
Reported-by: Christopher van de Sande
patches:
patch.diff submitted by Florian Floimair (license 6892)

Change-Id: I7ec617171eaa2d86d2680b00cf37d5088adafc27

res/res_pjsip_session.c

index 8447be3..bde66d2 100644 (file)
@@ -3159,8 +3159,7 @@ static void session_outgoing_nat_hook(pjsip_tx_data *tdata, struct ast_sip_trans
                ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);
 
                if (!transport_state->localnet
-                       || (transport_state->localnet
-                               && ast_apply_ha(transport_state->localnet, &addr) == AST_SENSE_ALLOW)) {
+                       || ast_apply_ha(transport_state->localnet, &addr) != AST_SENSE_ALLOW) {
                        ast_debug(5, "Setting external media address to %s\n", transport->external_media_address);
                        pj_strdup2(tdata->pool, &sdp->conn->addr, transport->external_media_address);
                }