asterisk/res/res_pjsip
Walter Doekes f856d9b42b res/res_pjsip: Standardize/fix localnet checks across pjsip.
In 2dee95cc (ASTERISK-27024) and 776ffd77 (ASTERISK-26879) there was
confusion about whether the transport_state->localnet ACL has ALLOW or
DENY semantics.

For the record: the localnet has DENY semantics, meaning that "not in
the list" means ALLOW, and the local nets are in the list.

Therefore, checks like this look wrong, but are right:

    /* See if where we are sending this request is local or not, and if
       not that we can get a Contact URI to modify */
    if (ast_apply_ha(transport_state->localnet, &addr) != AST_SENSE_ALLOW) {
        ast_debug(5, "Request is being sent to local address, "
                     "skipping NAT manipulation\n");

(In the list == localnet == DENY == skip NAT manipulation.)

And conversely, other checks that looked right, were wrong.

This change adds two macro's to reduce the confusion and uses those
instead:

    ast_sip_transport_is_nonlocal(transport_state, addr)
    ast_sip_transport_is_local(transport_state, addr)

ASTERISK-27248 #close

Change-Id: Ie7767519eb5a822c4848e531a53c0fd054fae934
2017-09-05 09:17:32 -05:00
..
include res_pjsip: PJSIP Transport state monitor refactor. 2017-08-10 12:18:58 -05:00
config_auth.c res_pjsip: Add "like" processing to pjsip list and show commands 2015-10-24 11:02:43 -05:00
config_domain_aliases.c res_pjsip: Move internal init/destroy prototypes to private header file. 2015-03-11 16:39:29 +00:00
config_global.c res_pjsip: Add ignore_uri_user_options option. 2016-09-09 17:13:02 -05:00
config_system.c res_pjsip: Set threadpool max size default to 50. 2015-11-02 18:24:09 -05:00
config_transport.c res/res_pjsip: Standardize/fix localnet checks across pjsip. 2017-09-05 09:17:32 -05:00
location.c res_pjsip: Fix prune_on_boot to remove only contacts for the host. 2017-08-15 11:22:54 -05:00
pjsip_cli.c pjproject cli: Add object count after object lists 2017-02-20 08:07:31 -06:00
pjsip_configuration.c res_pjsip: Remove ephemeral registered contacts on transport shutdown. 2017-08-10 12:18:58 -05:00
pjsip_distributor.c Merge "pjsip_distributor.c: Fix deadlock with TCP type transports." 2017-07-05 16:08:46 -05:00
pjsip_global_headers.c res_pjsip: Allow global headers to be overridden. 2016-09-07 16:02:01 -05:00
pjsip_message_ip_updater.c pjsip_message_ip_updater: Fix issue handling "tel" URIs 2017-08-30 18:46:05 +00:00
pjsip_options.c res_pjsip: Fix crash when contact has no status 2017-02-27 15:16:57 -06:00
pjsip_resolver.c Add support for older name resolving version libraries like openBSD 2016-11-20 09:19:18 +11:00
pjsip_scheduler.c res_pjsip_pubsub: Correctly implement persisted subscriptions 2017-02-15 13:11:46 -06:00
pjsip_transport_events.c res_pjsip: PJSIP Transport state monitor refactor. 2017-08-10 12:18:58 -05:00
presence_xml.c res_pjsip_pidf_eyebeam_body_supplement: Correct status presentation 2017-08-01 15:42:38 -06:00
security_events.c res_pjsip WebRTC/websockets: Fix usage of WS vs WSS. 2017-03-01 09:53:18 -06:00