[asterisk-commits] mmichelson: branch mmichelson/sip_endpoint_reorg r395498 - in /team/mmichelso...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 26 09:22:14 CDT 2013


Author: mmichelson
Date: Fri Jul 26 09:22:13 2013
New Revision: 395498

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395498
Log:
Group NAT options.


Modified:
    team/mmichelson/sip_endpoint_reorg/include/asterisk/res_sip.h
    team/mmichelson/sip_endpoint_reorg/res/res_sip/sip_configuration.c
    team/mmichelson/sip_endpoint_reorg/res/res_sip_nat.c

Modified: team/mmichelson/sip_endpoint_reorg/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_endpoint_reorg/include/asterisk/res_sip.h?view=diff&rev=395498&r1=395497&r2=395498
==============================================================================
--- team/mmichelson/sip_endpoint_reorg/include/asterisk/res_sip.h (original)
+++ team/mmichelson/sip_endpoint_reorg/include/asterisk/res_sip.h Fri Jul 26 09:22:13 2013
@@ -416,6 +416,12 @@
 			unsigned int aggregate;
 		} mwi;
 	} subscription;
+	struct {
+		/*! Whether to force using the source IP address/port for sending responses */
+		unsigned int force_rport;
+		/*! Whether to rewrite the Contact header with the source IP address/port or not */
+		unsigned int rewrite_contact;
+	} nat;
 	/*! Identification information for this endpoint */
 	struct ast_party_id id;
 	/*! Domain to which this endpoint belongs */
@@ -432,10 +438,6 @@
 	size_t num_outbound_auths;
 	/*! DTMF mode to use with this endpoint */
 	enum ast_sip_dtmf_mode dtmf;
-	/*! Whether to force using the source IP address/port for sending responses */
-	unsigned int force_rport;
-	/*! Whether to rewrite the Contact header with the source IP address/port or not */
-	unsigned int rewrite_contact;
 	/*! List of outbound registrations */
 	AST_LIST_HEAD_NOLOCK(, ast_sip_registration) registrations;
 	/*! Method(s) by which the endpoint should be identified. */

Modified: team/mmichelson/sip_endpoint_reorg/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_endpoint_reorg/res/res_sip/sip_configuration.c?view=diff&rev=395498&r1=395497&r2=395498
==============================================================================
--- team/mmichelson/sip_endpoint_reorg/res/res_sip/sip_configuration.c (original)
+++ team/mmichelson/sip_endpoint_reorg/res/res_sip/sip_configuration.c Fri Jul 26 09:22:13 2013
@@ -629,8 +629,8 @@
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "rtp_symmetric", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.rtp.symmetric));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "ice_support", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.rtp.ice_support));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "use_ptime", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.rtp.use_ptime));
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "force_rport", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, force_rport));
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "rewrite_contact", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, rewrite_contact));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "force_rport", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, nat.force_rport));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "rewrite_contact", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, nat.rewrite_contact));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "transport", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, transport));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "outbound_proxy", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, outbound_proxy));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "mohsuggest", "default", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, mohsuggest));

Modified: team/mmichelson/sip_endpoint_reorg/res/res_sip_nat.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_endpoint_reorg/res/res_sip_nat.c?view=diff&rev=395498&r1=395497&r2=395498
==============================================================================
--- team/mmichelson/sip_endpoint_reorg/res/res_sip_nat.c (original)
+++ team/mmichelson/sip_endpoint_reorg/res/res_sip_nat.c Fri Jul 26 09:22:13 2013
@@ -40,7 +40,7 @@
 		return PJ_FALSE;
 	}
 
-	if (endpoint->rewrite_contact && (contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, NULL)) &&
+	if (endpoint->nat.rewrite_contact && (contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, NULL)) &&
 		(PJSIP_URI_SCHEME_IS_SIP(contact->uri) || PJSIP_URI_SCHEME_IS_SIPS(contact->uri))) {
 		pjsip_sip_uri *uri = pjsip_uri_get_uri(contact->uri);
 
@@ -48,7 +48,7 @@
 		uri->port = rdata->pkt_info.src_port;
 	}
 
-	if (endpoint->force_rport) {
+	if (endpoint->nat.force_rport) {
 		rdata->msg_info.via->rport_param = 0;
 	}
 




More information about the asterisk-commits mailing list