[asterisk-commits] mmichelson: branch mmichelson/rls-rlmi r418357 - /team/mmichelson/rls-rlmi/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 10 14:14:08 CDT 2014


Author: mmichelson
Date: Thu Jul 10 14:14:06 2014
New Revision: 418357

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418357
Log:
Add type parameter to Content-Type header for RLS NOTIFY.


Modified:
    team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c

Modified: team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c?view=diff&rev=418357&r1=418356&r2=418357
==============================================================================
--- team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c (original)
+++ team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c Thu Jul 10 14:14:06 2014
@@ -1644,20 +1644,36 @@
 	AST_VECTOR_APPEND(parts, bp);
 }
 
+static pjsip_msg_body *create_multipart_body(pj_pool_t *pool)
+{
+	pjsip_media_type media_type;
+	pjsip_param *media_type_param;
+
+	pjsip_media_type_init2(&media_type, "multipart", "related");
+
+	media_type_param = pj_pool_alloc(pool, sizeof(*media_type_param));
+	pj_list_init(media_type_param);
+
+	pj_strdup2(pool, &media_type_param->name, "type");
+	pj_strdup2(pool, &media_type_param->value, "\"application/rlmi+xml\"");
+
+	pj_list_insert_before(&media_type.param, media_type_param);
+	
+	return pjsip_multipart_create(pool, &media_type, NULL);
+}
+
 static pjsip_msg_body *generate_list_body(pj_pool_t *pool, struct ast_sip_subscription *sub,
 		int force_full_state)
 {
 	int i;
 	pjsip_multipart_part *rlmi_part;
 	pjsip_msg_body *multipart;
-	pjsip_media_type media_type;
 	struct body_part_list body_parts;
 	int use_full_state = force_full_state ? 1 : sub->full_state;
 
 	AST_VECTOR_INIT(&body_parts, AST_VECTOR_SIZE(&sub->children));
 	
-	pjsip_media_type_init2(&media_type, "multipart", "related");
-	multipart = pjsip_multipart_create(pool, &media_type, NULL);
+	multipart = create_multipart_body(pool);
 
 	for (i = 0; i < AST_VECTOR_SIZE(&sub->children); ++i) {
 		build_body_part(pool, AST_VECTOR_GET(&sub->children, i), &body_parts, use_full_state);




More information about the asterisk-commits mailing list