[svn-commits] mmichelson: branch group/CCSS r233467 - /team/group/CCSS/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 7 11:04:03 CST 2009


Author: mmichelson
Date: Mon Dec  7 11:04:01 2009
New Revision: 233467

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=233467
Log:
Add some code to check for the dependency on XML parsing.

SIP CC agents may only be used if we can parse PIDF bodies
that we may receive due to incoming PUBLISH requests. This
adds a file-scoped variable we may check at runtime in order
to determine what actions to take.


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=233467&r1=233466&r2=233467
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Mon Dec  7 11:04:01 2009
@@ -1269,6 +1269,13 @@
 static int global_dynamic_exclude_static = 0;	/*!< Exclude static peers from contact registrations */
 /*@}*/
 
+/*!
+ * We use libxml2 in order to parse XML that may appear in the body of a SIP message. Currently,
+ * the only usage is for parsing PIDF bodies of incoming PUBLISH requests in the call-completion
+ * event package. This variable is set at module load time and may be checked at runtime to determine
+ * if XML parsing support was found.
+ */
+static int can_parse_xml;
 
 /*! \name Object counters @{
  * \bug These counters are not handled in a thread-safe way ast_atomic_fetchadd_int()
@@ -28227,6 +28234,15 @@
 	return 0;
 }
 
+static int sip_is_xml_parsable(void)
+{
+#ifdef HAVE_XML
+	return TRUE;
+#else
+	return FALSE;
+#endif
+}
+
 /*! \brief Send a poke to all known peers */
 static void sip_poke_all_peers(void)
 {
@@ -28462,6 +28478,7 @@
 	sip_send_all_registers();
 	sip_send_all_mwi_subscriptions();
 	initialize_escs();
+	can_parse_xml = sip_is_xml_parsable();
 	if (sip_epa_register(&cc_epa_static_data)) {
 		return AST_MODULE_LOAD_DECLINE;
 	}




More information about the svn-commits mailing list