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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 25 16:13:17 CDT 2013


Author: mmichelson
Date: Thu Jul 25 16:13:16 2013
New Revision: 395456

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395456
Log:
Place 100rel and timer options into an extensions substruct in the endpoint.


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_session.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=395456&r1=395455&r2=395456
==============================================================================
--- team/mmichelson/sip_endpoint_reorg/include/asterisk/res_sip.h (original)
+++ team/mmichelson/sip_endpoint_reorg/include/asterisk/res_sip.h Thu Jul 25 16:13:16 2013
@@ -323,8 +323,8 @@
 		AST_STRING_FIELD(outbound_proxy);
 		/*! Explicit AORs to dial if none are specified */
 		AST_STRING_FIELD(aors);
-                /*! Musiconhold class to suggest that the other side use when placing on hold */
-                AST_STRING_FIELD(mohsuggest);
+		/*! Musiconhold class to suggest that the other side use when placing on hold */
+		AST_STRING_FIELD(mohsuggest);
 		/*! Optional external media address to use in SDP */
 		AST_STRING_FIELD(external_media_address);
 		/*! Configured voicemail boxes for this endpoint. Used for MWI */
@@ -350,6 +350,17 @@
 		/*! Username to use when sending MWI NOTIFYs to this endpoint */
 		AST_STRING_FIELD(mwi_from);
 	);
+	/* Configuration for extensions (i.e. Supported and Required headers) */
+	struct {
+		/*! Enabled SIP extensions */
+		unsigned int flags;
+		struct {
+			/*! Minimum session expiration period, in seconds */
+			unsigned int min_se;
+			/*! Session expiration period, in seconds */
+			unsigned int sess_expires;
+		} timer;
+	} extensions;
 	/*! Identification information for this endpoint */
 	struct ast_party_id id;
 	/*! Domain to which this endpoint belongs */
@@ -382,12 +393,6 @@
 	unsigned int force_rport;
 	/*! Whether to rewrite the Contact header with the source IP address/port or not */
 	unsigned int rewrite_contact;
-	/*! Enabled SIP extensions */
-	unsigned int extensions;
-	/*! Minimum session expiration period, in seconds */
-	unsigned int min_se;
-	/*! Session expiration period, in seconds */
-	unsigned int sess_expires;
 	/*! 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=395456&r1=395455&r2=395456
==============================================================================
--- team/mmichelson/sip_endpoint_reorg/res/res_sip/sip_configuration.c (original)
+++ team/mmichelson/sip_endpoint_reorg/res/res_sip/sip_configuration.c Thu Jul 25 16:13:16 2013
@@ -247,11 +247,11 @@
 	struct ast_sip_endpoint *endpoint = obj;
 
 	if (ast_true(var->value)) {
-		endpoint->extensions |= PJSIP_INV_SUPPORT_100REL;
+		endpoint->extensions.flags |= PJSIP_INV_SUPPORT_100REL;
 	} else if (ast_false(var->value)) {
-		endpoint->extensions &= PJSIP_INV_SUPPORT_100REL;
+		endpoint->extensions.flags &= PJSIP_INV_SUPPORT_100REL;
 	} else if (!strcasecmp(var->value, "required")) {
-		endpoint->extensions |= PJSIP_INV_REQUIRE_100REL;
+		endpoint->extensions.flags |= PJSIP_INV_REQUIRE_100REL;
 	} else {
 		return -1;
 	}
@@ -264,13 +264,13 @@
 	struct ast_sip_endpoint *endpoint = obj;
 
 	if (ast_true(var->value)) {
-		endpoint->extensions |= PJSIP_INV_SUPPORT_TIMER;
+		endpoint->extensions.flags |= PJSIP_INV_SUPPORT_TIMER;
 	} else if (ast_false(var->value)) {
-		endpoint->extensions &= PJSIP_INV_SUPPORT_TIMER;
+		endpoint->extensions.flags &= PJSIP_INV_SUPPORT_TIMER;
 	} else if (!strcasecmp(var->value, "required")) {
-		endpoint->extensions |= PJSIP_INV_REQUIRE_TIMER;
+		endpoint->extensions.flags |= PJSIP_INV_REQUIRE_TIMER;
 	} else if (!strcasecmp(var->value, "always")) {
-		endpoint->extensions |= PJSIP_INV_ALWAYS_USE_TIMER;
+		endpoint->extensions.flags |= PJSIP_INV_ALWAYS_USE_TIMER;
 	} else {
 		return -1;
 	}
@@ -636,8 +636,8 @@
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "mohsuggest", "default", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, mohsuggest));
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "100rel", "yes", prack_handler, NULL, 0, 0);
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "timers", "yes", timers_handler, NULL, 0, 0);
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "timers_min_se", "90", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, min_se));
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "timers_sess_expires", "1800", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, sess_expires));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "timers_min_se", "90", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, extensions.timer.min_se));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "timers_sess_expires", "1800", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, extensions.timer.sess_expires));
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "auth", "", inbound_auth_handler, NULL, 0, 0);
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "outbound_auth", "", outbound_auth_handler, NULL, 0, 0);
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "aors", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, aors));

Modified: team/mmichelson/sip_endpoint_reorg/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_endpoint_reorg/res/res_sip_session.c?view=diff&rev=395456&r1=395455&r2=395456
==============================================================================
--- team/mmichelson/sip_endpoint_reorg/res/res_sip_session.c (original)
+++ team/mmichelson/sip_endpoint_reorg/res/res_sip_session.c Thu Jul 25 16:13:16 2013
@@ -1031,14 +1031,14 @@
 		return NULL;
 	}
 
-	if (pjsip_inv_create_uac(dlg, NULL, endpoint->extensions, &inv_session) != PJ_SUCCESS) {
+	if (pjsip_inv_create_uac(dlg, NULL, endpoint->extensions.flags, &inv_session) != PJ_SUCCESS) {
 		pjsip_dlg_terminate(dlg);
 		return NULL;
 	}
 
 	pjsip_timer_setting_default(&timer);
-	timer.min_se = endpoint->min_se;
-	timer.sess_expires = endpoint->sess_expires;
+	timer.min_se = endpoint->extensions.timer.min_se;
+	timer.sess_expires = endpoint->extensions.timer.sess_expires;
 	pjsip_timer_init_session(inv_session, &timer);
 
 	if (!(session = ast_sip_session_alloc(endpoint, inv_session))) {
@@ -1161,7 +1161,7 @@
 	pjsip_tx_data *tdata;
 	pjsip_dialog *dlg;
 	pjsip_inv_session *inv_session;
-	unsigned int options = endpoint->extensions;
+	unsigned int options = endpoint->extensions.flags;
 
 	if (pjsip_inv_verify_request(rdata, &options, NULL, NULL, ast_sip_get_pjsip_endpoint(), &tdata) != PJ_SUCCESS) {
 		if (tdata) {
@@ -1296,8 +1296,8 @@
 	}
 
 	pjsip_timer_setting_default(&timer);
-	timer.min_se = invite->session->endpoint->min_se;
-	timer.sess_expires = invite->session->endpoint->sess_expires;
+	timer.min_se = invite->session->endpoint->extensions.timer.min_se;
+	timer.sess_expires = invite->session->endpoint->extensions.timer.sess_expires;
 	pjsip_timer_init_session(invite->session->inv_session, &timer);
 
 	/* At this point, we've verified what we can, so let's go ahead and send a 100 Trying out */




More information about the asterisk-commits mailing list