[asterisk-commits] mmichelson: branch group/CCSS r248093 - /team/group/CCSS/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 19 14:07:36 CST 2010


Author: mmichelson
Date: Fri Feb 19 14:07:32 2010
New Revision: 248093

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=248093
Log:
Add a presentity to PIDF bodies.


Modified:
    team/group/CCSS/channels/chan_sip.c

Modified: team/group/CCSS/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_sip.c?view=diff&rev=248093&r1=248092&r2=248093
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Fri Feb 19 14:07:32 2010
@@ -2265,7 +2265,7 @@
 	return 0;
 }
 
-static int construct_pidf_body(enum sip_cc_publish_state state, char *pidf_body, size_t size)
+static int construct_pidf_body(enum sip_cc_publish_state state, char *pidf_body, size_t size, const char *presentity)
 {
 	struct ast_str *body = ast_str_alloca(size);
 	char tuple_id[32];
@@ -2276,8 +2276,7 @@
 	 * body gets a lot more extra junk that isn't necessary, so we'll leave it out here.
 	 */
 	ast_str_append(&body, 0, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
-	/* XXX Need to come up with an entity name to put in here. */
-	ast_str_append(&body, 0, "<presence xmlns=\"urn:ietf:params:xml:ns:pidf\" entity=\"?????\">\n");
+	ast_str_append(&body, 0, "<presence xmlns=\"urn:ietf:params:xml:ns:pidf\" entity=\"%s\">\n", presentity);
 	ast_str_append(&body, 0, "<tuple id=\"%s\">\n", tuple_id);
 	ast_str_append(&body, 0, "<status><basic>%s</basic></status>\n", state == CC_OPEN ? "open" : "closed");
 	ast_str_append(&body, 0, "</tuple>\n");
@@ -2333,7 +2332,7 @@
 		 */
 		return 0;
 	}
-	construct_pidf_body(CC_CLOSED, monitor_instance->suspension_entry->body, sizeof(monitor_instance->suspension_entry->body));
+	construct_pidf_body(CC_CLOSED, monitor_instance->suspension_entry->body, sizeof(monitor_instance->suspension_entry->body), monitor_instance->peername);
 	return transmit_publish(monitor_instance->suspension_entry, publish_type, monitor_instance->notify_uri);
 }
 
@@ -2365,7 +2364,7 @@
 		 */
 		return 0;
 	}
-	construct_pidf_body(CC_OPEN, monitor_instance->suspension_entry->body, sizeof(monitor_instance->suspension_entry->body));
+	construct_pidf_body(CC_OPEN, monitor_instance->suspension_entry->body, sizeof(monitor_instance->suspension_entry->body), monitor_instance->peername);
 	return transmit_publish(monitor_instance->suspension_entry, SIP_PUBLISH_MODIFY, monitor_instance->notify_uri);
 }
 
@@ -19609,7 +19608,8 @@
 			 * call leg had not yet notified us that it was ready for recall, it meant that we
 			 * could not yet send a PUBLISH. Now, however, we can.
 			 */
-			construct_pidf_body(CC_CLOSED, monitor_instance->suspension_entry->body, sizeof(monitor_instance->suspension_entry->body));
+			construct_pidf_body(CC_CLOSED, monitor_instance->suspension_entry->body,
+					sizeof(monitor_instance->suspension_entry->body), monitor_instance->peername);
 			transmit_publish(monitor_instance->suspension_entry, SIP_PUBLISH_INITIAL, monitor_instance->notify_uri);
 		} else {
 			ast_cc_monitor_callee_available(monitor_instance->core_id, "SIP monitored callee has become available");




More information about the asterisk-commits mailing list