[svn-commits] mmichelson: branch mmichelson/rls-rlmi r418257 - /team/mmichelson/rls-rlmi/res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jul 9 17:12:25 CDT 2014


Author: mmichelson
Date: Wed Jul  9 17:12:19 2014
New Revision: 418257

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418257
Log:
And now there are no more hard-coded Content-IDs.


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=418257&r1=418256&r2=418257
==============================================================================
--- team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c (original)
+++ team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c Wed Jul  9 17:12:19 2014
@@ -1479,7 +1479,7 @@
 }
 
 struct body_part {
-	const char *cid;
+	char *cid;
 	const char *resource;
 	pjsip_sip_uri *uri;
 	pjsip_evsub_state state;
@@ -1535,7 +1535,7 @@
 
 static void free_body_part(struct body_part *part)
 {
-	ast_free((char *) part->cid);
+	ast_free(part->cid);
 	ast_free(part);
 }
 
@@ -1554,13 +1554,15 @@
 static struct body_part *allocate_body_part(pj_pool_t *pool, const struct ast_sip_subscription *sub)
 {
 	struct body_part *bp;
+	char id[AST_UUID_STR_LEN];
 
 	bp = ast_calloc(1, sizeof(*bp));
 	if (!bp) {
 		return NULL;
 	}
 
-	bp->cid = ast_strdup("<prawnstar at bass-turd.org>");
+	ast_asprintf(&bp->cid, "<%s@%.*s>", ast_uuid_generate_str(id, sizeof(id)),
+			(int) pj_strlen(&sub->uri->host), pj_strbuf(&sub->uri->host));
 	if (!bp->cid) {
 		ast_free(bp);
 		return NULL;




More information about the svn-commits mailing list