diff options
Diffstat (limited to 'include/asterisk/res_pjsip.h')
-rw-r--r-- | include/asterisk/res_pjsip.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index e2c487aa3..ad881382c 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -98,7 +98,10 @@ struct ast_sip_transport_state { */ pj_ssl_cipher ciphers[SIP_TLS_MAX_CIPHERS]; /*! - * Optional local network information, used for NAT purposes + * Optional local network information, used for NAT purposes. + * "deny" (set) means that it's in the local network. Use the + * ast_sip_transport_is_nonlocal and ast_sip_transport_is_local + * macro's. * \since 13.8.0 */ struct ast_ha *localnet; @@ -124,6 +127,12 @@ struct ast_sip_transport_state { struct ast_sockaddr external_media_address; }; +#define ast_sip_transport_is_nonlocal(transport_state, addr) \ + (!transport_state->localnet || ast_apply_ha(transport_state->localnet, addr) == AST_SENSE_ALLOW) + +#define ast_sip_transport_is_local(transport_state, addr) \ + (transport_state->localnet && ast_apply_ha(transport_state->localnet, addr) != AST_SENSE_ALLOW) + /* * \brief Transport to bind to */ |