[asterisk-commits] mmichelson: branch mmichelson/pubsub_bodies r405989 - /team/mmichelson/pubsub...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 20 18:05:26 CST 2014


Author: mmichelson
Date: Mon Jan 20 18:05:24 2014
New Revision: 405989

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=405989
Log:
Remove unnecessary code from res/res_pjsip_exten_state.c


Modified:
    team/mmichelson/pubsub_bodies/res/res_pjsip_exten_state.c

Modified: team/mmichelson/pubsub_bodies/res/res_pjsip_exten_state.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pubsub_bodies/res/res_pjsip_exten_state.c?view=diff&rev=405989&r1=405988&r2=405989
==============================================================================
--- team/mmichelson/pubsub_bodies/res/res_pjsip_exten_state.c (original)
+++ team/mmichelson/pubsub_bodies/res/res_pjsip_exten_state.c Mon Jan 20 18:05:24 2014
@@ -53,12 +53,6 @@
 	int id;
 	/*! The SIP subscription */
 	struct ast_sip_subscription *sip_sub;
-	/*! The name of the event the subscribed to */
-	char event_name[EVENT_TYPE_SIZE];
-	/*! The number of body types */
-	int body_types_count;
-	/*! The subscription body types */
-	char **body_types;
 	/*! Context in which subscription looks for updates */
 	char context[AST_MAX_CONTEXT];
 	/*! Extension within the context to receive updates from */
@@ -95,37 +89,8 @@
 static void exten_state_subscription_destructor(void *obj)
 {
 	struct exten_state_subscription *sub = obj;
-	int i;
-
-	for (i = 0; i < sub->body_types_count; ++i) {
-		ast_free(sub->body_types[i]);
-	}
-
-	ast_free(sub->body_types);
+
 	ao2_cleanup(sub->sip_sub);
-}
-
-/*!
- * \internal
- * \brief Copies the body types the message wishes to subscribe to.
- */
-static void copy_body_types(pjsip_rx_data *rdata,
-			    struct exten_state_subscription *exten_state_sub)
-{
-	int i;
-	pjsip_accept_hdr *hdr = (pjsip_accept_hdr*)
-		pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL);
-
-	exten_state_sub->body_types_count = hdr->count;
-	exten_state_sub->body_types = ast_malloc(hdr->count * sizeof(char*));
-
-	for (i = 0; i < hdr->count; ++i) {
-		exten_state_sub->body_types[i] =
-			ast_malloc(hdr->values[i].slen * sizeof(char*) + 1);
-
-		ast_copy_string(exten_state_sub->body_types[i],
-				pj_strbuf(&hdr->values[i]), hdr->values[i].slen + 1);
-	}
 }
 
 /*!
@@ -145,20 +110,12 @@
 static struct exten_state_subscription *exten_state_subscription_alloc(
 	struct ast_sip_endpoint *endpoint, enum ast_sip_subscription_role role, pjsip_rx_data *rdata)
 {
-	static const pj_str_t event_name = { "Event", 5 };
-	pjsip_event_hdr *hdr = (pjsip_event_hdr*)pjsip_msg_find_hdr_by_name(
-		rdata->msg_info.msg, &event_name, NULL);
 	RAII_VAR(struct exten_state_subscription *, exten_state_sub,
 		 ao2_alloc(sizeof(*exten_state_sub), exten_state_subscription_destructor), ao2_cleanup);
 
 	if (!exten_state_sub) {
 		return NULL;
 	}
-
-	ast_copy_pj_str(exten_state_sub->event_name, &hdr->event_type,
-			sizeof(exten_state_sub->event_name));
-
-	copy_body_types(rdata, exten_state_sub);
 
 	if (!(exten_state_sub->sip_sub = ast_sip_create_subscription(
 		      &presence_handler, role, endpoint, rdata))) {




More information about the asterisk-commits mailing list