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

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


Author: mmichelson
Date: Fri Jul 26 09:13:37 2013
New Revision: 395497

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395497
Log:
Group subscription-related information together.


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_mwi.c
    team/mmichelson/sip_endpoint_reorg/res/res_sip_pubsub.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=395497&r1=395496&r2=395497
==============================================================================
--- 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:13:37 2013
@@ -406,6 +406,16 @@
 		/*! Priority for video streams */
 		unsigned int cos_video;
 	} media;
+	struct {
+		/*! Indicates if endpoint is allowed to initiate subscriptions */
+		unsigned int allow;
+		/*! The minimum allowed expiration for subscriptions from endpoint */
+		unsigned int minexpiry;
+		struct {
+			/*! Should unsolicited MWI be aggregated into a single NOTIFY? */
+			unsigned int aggregate;
+		} mwi;
+	} subscription;
 	/*! Identification information for this endpoint */
 	struct ast_party_id id;
 	/*! Domain to which this endpoint belongs */
@@ -442,8 +452,6 @@
 	unsigned int send_rpid;
 	/*! Do we add Diversion headers to applicable outgoing requests/responses? */
 	unsigned int send_diversion;
-	/*! Should unsolicited MWI be aggregated into a single NOTIFY? */
-	unsigned int aggregate_mwi;
 	/*! Is one-touch recording permitted? */
 	unsigned int one_touch_recording;
 	/*! Boolean indicating if ringing should be sent as inband progress */
@@ -462,10 +470,6 @@
 	unsigned int devicestate_busy_at;
 	/*! Determines if transfers (using REFER) are allowed by this endpoint */
 	unsigned int allowtransfer;
-	/*! Indicates if endpoint is allowed to initiate subscriptions */
-	unsigned int allowsubscribe;
-	/*! The minimum allowed expiration for subscriptions from endpoint */
-	unsigned int subminexpiry;
 };
 
 /*!

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=395497&r1=395496&r2=395497
==============================================================================
--- 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:13:37 2013
@@ -657,7 +657,7 @@
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_rpid", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_rpid));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_diversion", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_diversion));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "mailboxes", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, mailboxes));
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "aggregate_mwi", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, aggregate_mwi));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "aggregate_mwi", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, subscription.mwi.aggregate));
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "media_encryption", "no", media_encryption_handler, NULL, 0, 0);
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "use_avpf", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.rtp.use_avpf));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "one_touch_recording", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, one_touch_recording));
@@ -679,9 +679,9 @@
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "tos_video", "0", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, media.tos_video));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "cos_audio", "0", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, media.cos_audio));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "cos_video", "0", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, media.cos_video));
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "allowsubscribe", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, allowsubscribe));
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "subminexpiry", "0", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, subminexpiry));
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "subminexpirey", "0", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, subminexpiry));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "allowsubscribe", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, subscription.allow));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "subminexpiry", "0", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, subscription.minexpiry));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "subminexpirey", "0", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, subscription.minexpiry));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "fromuser", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, fromuser));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "fromdomain", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, fromdomain));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "mwifromuser", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, mwi_from));

Modified: team/mmichelson/sip_endpoint_reorg/res/res_sip_mwi.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_endpoint_reorg/res/res_sip_mwi.c?view=diff&rev=395497&r1=395496&r2=395497
==============================================================================
--- team/mmichelson/sip_endpoint_reorg/res/res_sip_mwi.c (original)
+++ team/mmichelson/sip_endpoint_reorg/res/res_sip_mwi.c Fri Jul 26 09:13:37 2013
@@ -631,7 +631,7 @@
 		return 0;
 	}
 
-	if (endpoint->aggregate_mwi) {
+	if (endpoint->subscription.mwi.aggregate) {
 		aggregate_sub = mwi_subscription_alloc(endpoint, AST_SIP_NOTIFIER, 0, NULL);
 		if (!aggregate_sub) {
 			return 0;

Modified: team/mmichelson/sip_endpoint_reorg/res/res_sip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_endpoint_reorg/res/res_sip_pubsub.c?view=diff&rev=395497&r1=395496&r2=395497
==============================================================================
--- team/mmichelson/sip_endpoint_reorg/res/res_sip_pubsub.c (original)
+++ team/mmichelson/sip_endpoint_reorg/res/res_sip_pubsub.c Fri Jul 26 09:13:37 2013
@@ -625,7 +625,7 @@
 	endpoint = ast_pjsip_rdata_get_endpoint(rdata);
 	ast_assert(endpoint != NULL);
 
-	if (!endpoint->allowsubscribe) {
+	if (!endpoint->subscription.allow) {
 		ast_log(LOG_WARNING, "Subscriptions not permitted for endpoint %s.\n", ast_sorcery_object_get_id(endpoint));
 		pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 603, NULL, NULL, NULL);
 		return PJ_TRUE;
@@ -633,9 +633,9 @@
 
 	expires_header = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_EXPIRES, rdata->msg_info.msg->hdr.next);
 
-	if (expires_header && expires_header->ivalue < endpoint->subminexpiry) {
+	if (expires_header && expires_header->ivalue < endpoint->subscription.minexpiry) {
 		ast_log(LOG_WARNING, "Subscription expiration %d is too brief for endpoint %s. Minimum is %d\n",
-				expires_header->ivalue, ast_sorcery_object_get_id(endpoint), endpoint->subminexpiry);
+				expires_header->ivalue, ast_sorcery_object_get_id(endpoint), endpoint->subscription.minexpiry);
 		pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 423, NULL, NULL, NULL);
 		return PJ_TRUE;
 	}




More information about the asterisk-commits mailing list