Fixed doxygen comments everywhere

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1748 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjlib-util/docs/doxygen.cfg b/pjlib-util/docs/doxygen.cfg
index 23cd696..5790dd5 100644
--- a/pjlib-util/docs/doxygen.cfg
+++ b/pjlib-util/docs/doxygen.cfg
@@ -843,11 +843,15 @@
 

 PREDEFINED             = PJ_DECL(x)=x PJ_DEF(x)=x PJ_IDECL(x)=x \

 			 PJ_IDEF(x)=x PJ_INLINE(x)=x \

+			 PJ_DECL_DATA(x)=x \

 			 PJ_DECL_NO_RETURN(x)=x \

+			 PJ_NO_RETURN=x \

 			 PJ_HAS_HIGH_RES_TIMER=1 \

 			 PJ_LOG_MAX_LEVEL=4 \

 			 PJ_HAS_SEMAPHORE=1 \

-			 PJ_HAS_EVENT_OBJ=1

+			 PJ_HAS_EVENT_OBJ=1 \

+			 PJ_HAS_TCP=1

+

 

 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 

 # this tag can be used to specify a list of macro names that should be expanded. 

diff --git a/pjlib-util/include/pjlib-util/md5.h b/pjlib-util/include/pjlib-util/md5.h
index 45c9bbe..a0dabf2 100644
--- a/pjlib-util/include/pjlib-util/md5.h
+++ b/pjlib-util/include/pjlib-util/md5.h
@@ -38,9 +38,9 @@
 /** MD5 context. */
 typedef struct pj_md5_context
 {
-	pj_uint32_t buf[4];
-	pj_uint32_t bits[2];
-	pj_uint8_t  in[64];
+	pj_uint32_t buf[4];	/**< buf    */
+	pj_uint32_t bits[2];	/**< bits   */
+	pj_uint8_t  in[64];	/**< in	    */
 } pj_md5_context;
 
 /** Initialize the algorithm. 
diff --git a/pjlib-util/include/pjlib-util/scanner_cis_uint.h b/pjlib-util/include/pjlib-util/scanner_cis_uint.h
index b44f8e6..99b06eb 100644
--- a/pjlib-util/include/pjlib-util/scanner_cis_uint.h
+++ b/pjlib-util/include/pjlib-util/scanner_cis_uint.h
@@ -45,7 +45,7 @@
  */
 typedef struct pj_cis_t
 {
-    PJ_CIS_ELEM_TYPE	cis_buf[256];
+    PJ_CIS_ELEM_TYPE	cis_buf[256];	/**< Internal buffer.	*/
 } pj_cis_t;
 
 
diff --git a/pjlib-util/include/pjlib-util/sha1.h b/pjlib-util/include/pjlib-util/sha1.h
index 752c04b..62b780e 100644
--- a/pjlib-util/include/pjlib-util/sha1.h
+++ b/pjlib-util/include/pjlib-util/sha1.h
@@ -37,9 +37,9 @@
 /** SHA1 context */
 typedef struct pj_sha1_context
 {
-    pj_uint32_t state[5];
-    pj_uint32_t count[2];
-    pj_uint8_t	buffer[64];
+    pj_uint32_t state[5];	/**< State  */
+    pj_uint32_t count[2];	/**< Count  */
+    pj_uint8_t	buffer[64];	/**< Buffer */
 } pj_sha1_context;
 
 /** SHA1 digest size is 20 bytes */
diff --git a/pjlib-util/include/pjlib-util/srv_resolver.h b/pjlib-util/include/pjlib-util/srv_resolver.h
index be71025..8fc9b59 100644
--- a/pjlib-util/include/pjlib-util/srv_resolver.h
+++ b/pjlib-util/include/pjlib-util/srv_resolver.h
@@ -32,7 +32,7 @@
  * @ingroup PJ_DNS
  * @{
  *
- * \subsection PJ_DNS_SRV_RESOLVER_INTRO DNS SRV Resolution Helper
+ * \section PJ_DNS_SRV_RESOLVER_INTRO DNS SRV Resolution Helper
  *
  * This module provides an even higher layer of abstraction for the DNS
  * resolution framework, to resolve DNS SRV names.
diff --git a/pjlib-util/include/pjlib-util/xml.h b/pjlib-util/include/pjlib-util/xml.h
index 1bfd7aa..d00960d 100644
--- a/pjlib-util/include/pjlib-util/xml.h
+++ b/pjlib-util/include/pjlib-util/xml.h
@@ -94,7 +94,7 @@
  *		    sufficient space in the buffer to print the message.
  */
 PJ_DECL(int) pj_xml_print( const pj_xml_node *node, char *buf, pj_size_t len,
-			   pj_bool_t include_prolog);
+			   pj_bool_t prolog);
 
 /**
  * Clone XML node and all subnodes.
@@ -123,7 +123,7 @@
  *
  * @param pool	    Pool.
  * @param name	    Attribute name.
- * @param attr	    Attribute value.
+ * @param value	    Attribute value.
  *
  * @return	    The new XML attribute.
  */
@@ -161,6 +161,7 @@
  * Find first node with the specified name.
  *
  * @param parent    Parent node.
+ * @param node	    node->next is the starting point.
  * @param name	    Node name to find.
  *
  * @return	    XML node found or NULL.
@@ -184,7 +185,7 @@
 /**
  * Find a direct child node with the specified name and match the function.
  *
- * @param node	    Parent node.
+ * @param parent    Parent node.
  * @param name	    Optional name.
  * @param data	    Data to be passed to matching function.
  * @param match	    Optional matching function.
diff --git a/pjlib/docs/doxygen.cfg b/pjlib/docs/doxygen.cfg
index bb333ac..e6b0d75 100644
--- a/pjlib/docs/doxygen.cfg
+++ b/pjlib/docs/doxygen.cfg
@@ -843,7 +843,9 @@
 

 PREDEFINED             = PJ_DECL(x)=x PJ_DEF(x)=x PJ_IDECL(x)=x \

 			 PJ_IDEF(x)=x PJ_INLINE(x)=x \

+			 PJ_DECL_DATA(x)=x \

 			 PJ_DECL_NO_RETURN(x)=x \

+			 PJ_NO_RETURN=x \

 			 PJ_HAS_HIGH_RES_TIMER=1 \

 			 PJ_LOG_MAX_LEVEL=4 \

 			 PJ_HAS_SEMAPHORE=1 \

diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
index 4a063be..d620d4b 100644
--- a/pjlib/include/pj/config.h
+++ b/pjlib/include/pj/config.h
@@ -449,7 +449,6 @@
 
 
 /**
- * \def PJ_HAS_TCP
  * Support TCP in the library.
  * Disabling TCP will reduce the footprint slightly (about 6KB).
  *
@@ -460,7 +459,6 @@
 #endif
 
 /**
- * \def PJ_HAS_IPV6
  * Support IPv6 in the library. If this support is disabled, some IPv6 
  * related functions will return PJ_EIPV6NOTSUP.
  *
@@ -846,6 +844,11 @@
  * Declare a function that will not return.
  */
 /**
+ * @def PJ_IDECL_NO_RETURN(type)
+ * @param type The return type of the function.
+ * Declare an inline function that will not return.
+ */
+/**
  * @def PJ_BEGIN_DECL
  * Mark beginning of declaration section in a header file.
  */
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h
index b838f06..57d90af 100644
--- a/pjlib/include/pj/errno.h
+++ b/pjlib/include/pj/errno.h
@@ -111,7 +111,18 @@
 PJ_DECL(pj_str_t) pj_strerror( pj_status_t statcode, 
 			       char *buf, pj_size_t bufsize);
 
-typedef pj_str_t (*pjsip_error_callback)(pj_status_t, char*, pj_size_t);
+/**
+ * Type of callback to be specified in #pj_register_strerror()
+ *
+ * @param e	    The error code to lookup.
+ * @param msg	    Buffer to store the error message.
+ * @param max	    Length of the buffer.
+ *
+ * @return	    The error string.
+ */
+typedef pj_str_t (*pj_error_callback)(pj_status_t e, char *msg, pj_size_t max);
+
+
 /**
  * Register strerror message handler for the specified error space.
  * Application can register its own handler to supply the error message
@@ -133,7 +144,7 @@
  */
 PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
 					  pj_status_t err_space,
-					  pjsip_error_callback f);
+					  pj_error_callback f);
 
 /**
  * @hideinitializer
diff --git a/pjlib/include/pj/ioqueue.h b/pjlib/include/pj/ioqueue.h
index 616ccc1..ded4aea 100644
--- a/pjlib/include/pj/ioqueue.h
+++ b/pjlib/include/pj/ioqueue.h
@@ -166,7 +166,7 @@
                              pj_ssize_t bytes_read);
 
     /**
-     * This callback is called when #pj_ioqueue_write or #pj_ioqueue_sendto
+     * This callback is called when #pj_ioqueue_send or #pj_ioqueue_sendto
      * completes.
      *
      * @param key	    The key.
diff --git a/pjlib/include/pj/pool.h b/pjlib/include/pj/pool.h
index d12076f..4288640 100644
--- a/pjlib/include/pj/pool.h
+++ b/pjlib/include/pj/pool.h
@@ -612,6 +612,7 @@
 } pj_pool_factory_policy;
 
 /**
+ * \def PJ_NO_MEMORY_EXCEPTION
  * This constant denotes the exception number that will be thrown by default
  * memory factory policy when memory allocation fails.
  *
diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c
index 1b86d4c..8779f00 100644
--- a/pjlib/src/pj/errno.c
+++ b/pjlib/src/pj/errno.c
@@ -106,7 +106,7 @@
 /* Register strerror handle. */
 PJ_DEF(pj_status_t) pj_register_strerror( pj_status_t start,
 					  pj_status_t space,
-					  pjsip_error_callback f)
+					  pj_error_callback f)
 {
     unsigned i;
 
diff --git a/pjmedia/docs/doxygen.cfg b/pjmedia/docs/doxygen.cfg
index 50f8f20..e2fa088 100644
--- a/pjmedia/docs/doxygen.cfg
+++ b/pjmedia/docs/doxygen.cfg
@@ -843,8 +843,15 @@
 

 PREDEFINED             = PJ_DECL(x)=x PJ_DEF(x)=x PJ_IDECL(x)=x \

 			 PJ_IDEF(x)=x PJ_INLINE(x)=x \

-			 PJ_BEGIN_DECL= PJ_END_DECL= \

-			 PJMEDIA_HAS_MP3_WRITER=1

+			 PJ_DECL_DATA(x)=x \

+			 PJ_DECL_NO_RETURN(x)=x \

+			 PJ_NO_RETURN=x \

+			 PJ_HAS_HIGH_RES_TIMER=1 \

+			 PJ_LOG_MAX_LEVEL=4 \

+			 PJ_HAS_SEMAPHORE=1 \

+			 PJ_HAS_EVENT_OBJ=1 \

+			 PJ_HAS_TCP=1 \

+			 PJMEDIA_HAS_SRTP=1

 

 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 

 # this tag can be used to specify a list of macro names that should be expanded. 

diff --git a/pjmedia/include/pjmedia/transport.h b/pjmedia/include/pjmedia/transport.h
index e9fbb1f..14b84e7 100644
--- a/pjmedia/include/pjmedia/transport.h
+++ b/pjmedia/include/pjmedia/transport.h
@@ -56,6 +56,12 @@
  * so it should not need to call the function pointer inside 
  * #pjmedia_transport_op directly.
  *
+ * The connection between \ref PJMED_STRM and media transport is shown in
+ * the diagram below:
+
+   \image html media-transport.PNG
+
+
  * \section PJMEDIA_TRANSPORT_H_USING Using the Media Transport
  *
  * The media transport's life-cycle normally follows the following stages.
@@ -135,6 +141,39 @@
  *    all resources used by the transport, such as sockets and memory.
  *
  *
+ * \section PJMEDIA_TRANSPORT_H_EXT Media Transport Extended API
+ 
+   Apart from the basic interface above, the media transport provides some
+   more APIs:
+
+    - pjmedia_transport_media_create()
+   \n
+      This API is provided to allow the media transport to add more information
+      in the SDP offer, before the offer is sent to remote. Additionally, for 
+      answerer side, this callback allows the media transport to reject the 
+      offer before this offer is processed by the SDP negotiator. 
+
+    - pjmedia_transport_media_start()
+    \n
+      This API should be called after offer and answer are negotiated, and 
+      both SDPs are available, and before the media is started. For answerer
+      side, this callback will be called before the answer is sent to remote,
+      to allow media transport to put additional info in the SDP. For 
+      offerer side, this callback will be called after SDP answer is 
+      received. In this callback, the media transport has the final chance 
+      to negotiate/validate the offer and answer before media is really 
+      started (and answer is sent, for answerer side). 
+
+    - pjmedia_transport_media_stop()
+    \n
+      This API should be called when the media is stopped, to allow the media
+      transport to release its resources. 
+
+    - pjmedia_transport_simulate_lost()
+    \n
+      This API can be used to instruct media transport to simulate packet lost
+      on a particular direction.
+
  * \section PJMEDIA_TRANSPORT_H_IMPL Implementing Media Transport
  *
  * To implement a new type of media transport, one needs to "subclass" the
@@ -168,7 +207,7 @@
 
 #include <pjmedia/sdp.h>
 
-/*
+/**
  * Forward declaration for media transport.
  */
 typedef struct pjmedia_transport pjmedia_transport;
@@ -458,6 +497,12 @@
  * Generate local SDP parts that are related to the specified media transport.
  * Remote SDP might be needed as reference when application is in deciding
  * side of negotiation (callee side), otherwise it should be NULL.
+ *
+ * This API is provided to allow the media transport to add more information
+ * in the SDP offer, before the offer is sent to remote. Additionally, for 
+ * answerer side, this callback allows the media transport to reject the 
+ * offer before this offer is processed by the SDP negotiator. 
+ *
  * This is just a simple wrapper which calls <tt>media_create()</tt> member 
  * of the transport.
  *
@@ -465,6 +510,7 @@
  * @param pool		The memory pool.
  * @param sdp_local	Local SDP.
  * @param sdp_remote	Remote SDP.
+ * @param media_index	Media index in SDP.
  *
  * @return		PJ_SUCCESS on success, or the appropriate error code.
  */
@@ -480,6 +526,15 @@
 
 /**
  * Start the transport with regards to SDP negotiation result. 
+ * This API should be called after offer and answer are negotiated, and 
+ * both SDPs are available, and before the media is started. For answerer
+ * side, this callback will be called before the answer is sent to remote,
+ * to allow media transport to put additional info in the SDP. For 
+ * offerer side, this callback will be called after SDP answer is 
+ * received. In this callback, the media transport has the final chance 
+ * to negotiate/validate the offer and answer before media is really 
+ * started (and answer is sent, for answerer side). 
+ *
  * This is just a simple wrapper which calls <tt>media_start()</tt> member 
  * of the transport.
  *
@@ -503,6 +558,9 @@
 
 /**
  * Stop the transport. 
+ * This API should be called when the media is stopped, to allow the media
+ * transport to release its resources. 
+ *
  * This is just a simple wrapper which calls <tt>media_stop()</tt> member 
  * of the transport.
  *
diff --git a/pjmedia/include/pjmedia/transport_srtp.h b/pjmedia/include/pjmedia/transport_srtp.h
index f7ea291..d6ccc2e 100644
--- a/pjmedia/include/pjmedia/transport_srtp.h
+++ b/pjmedia/include/pjmedia/transport_srtp.h
@@ -21,12 +21,52 @@
 
 /**
  * @file srtp.h
- * @brief transport SRTP encapsulates secure media transport.
+ * @brief Secure RTP (SRTP) transport.
  */
 
 #include <pjmedia/transport.h>
 
 
+/**
+ * @defgroup PJMEDIA_TRANSPORT_SRTP Secure RTP (SRTP) Transport Adapter
+ * @ingroup PJMEDIA_TRANSPORT
+ * @brief Media transport adapter to add SRTP feature to existing transports
+ * @{
+ *
+ * This module implements SRTP as described by RFC 3711, using RFC 4568 as
+ * key exchange method. It implements \ref PJMEDIA_TRANSPORT_H to integrate
+ * with the rest of PJMEDIA framework.
+ *
+ * As we know, media transport is separated from the stream object (which 
+ * does the encoding/decoding of PCM frames, (de)packetization of RTP/RTCP 
+ * packets, and de-jitter buffering). The connection between stream and media
+ * transport is established when the stream is created (we need to specify 
+ * media transport during stream creation), and the interconnection can be 
+ * depicted from the diagram below:
+ *
+   \image html media-transport.PNG
+
+ * I think the diagram above is self-explanatory.
+ *
+ * SRTP functionality is implemented as some kind of "adapter", which is 
+ * plugged between the stream and the actual media transport that does 
+ * sending/receiving RTP/RTCP packets. When SRTP is used, the interconnection
+ * between stream and transport is like the diagram below:
+ *
+    \image html media-srtp-transport.PNG
+
+ * So to stream, the SRTP transport behaves as if it is a media transport 
+ * (because it is a media transport), and to the media transport it behaves
+ * as if it is a stream. The SRTP object then forwards RTP packets back and
+ * forth between stream and the actual transport, encrypting/decrypting 
+ * the RTP/RTCP packets as necessary.
+ * 
+ * The neat thing about this design is the SRTP "adapter" then can be used 
+ * to encrypt any kind of media transports. We currently have UDP and ICE 
+ * media transports that can benefit SRTP, and we could add SRTP to any 
+ * media transports that will be added in the future. 
+ */
+
 PJ_BEGIN_DECL
 
 
@@ -55,7 +95,7 @@
     /** Crypto name.   */
     pj_str_t	name;
 
-    /* Flags, bitmask from #pjmedia_srtp_crypto_option */
+    /** Flags, bitmask from #pjmedia_srtp_crypto_option */
     unsigned	flags;
 
 } pjmedia_srtp_crypto;
@@ -168,7 +208,7 @@
  * @return	    PJ_SUCCESS on success.
  */
 PJ_DECL(pj_status_t) pjmedia_transport_srtp_start(
-					    pjmedia_transport *tp,
+					    pjmedia_transport *srtp,
 					    const pjmedia_srtp_crypto *tx,
 					    const pjmedia_srtp_crypto *rx);
 
@@ -181,7 +221,7 @@
  *
  * @see #pjmedia_transport_srtp_start() 
  */
-PJ_DECL(pj_status_t) pjmedia_transport_srtp_stop(pjmedia_transport *tp);
+PJ_DECL(pj_status_t) pjmedia_transport_srtp_stop(pjmedia_transport *srtp);
 
 
 /**
@@ -192,9 +232,13 @@
  * @return		    member media transport.
  */
 PJ_DECL(pjmedia_transport*) pjmedia_transport_srtp_get_member(
-						    pjmedia_transport *tp);
+						    pjmedia_transport *srtp);
 
 
 PJ_END_DECL
 
+/**
+ * @}
+ */
+
 #endif /* __PJMEDIA_TRANSPORT_SRTP_H__ */
diff --git a/pjmedia/src/pjmedia/transport_udp.c b/pjmedia/src/pjmedia/transport_udp.c
index a9a4df7..3caea68 100644
--- a/pjmedia/src/pjmedia/transport_udp.c
+++ b/pjmedia/src/pjmedia/transport_udp.c
@@ -748,6 +748,7 @@
     PJ_UNUSED_ARG(pool);
     PJ_UNUSED_ARG(sdp_local);
     PJ_UNUSED_ARG(sdp_remote);
+    PJ_UNUSED_ARG(media_index);
 
     return PJ_SUCCESS;
 }
diff --git a/pjsip/docs/doxygen.cfg b/pjsip/docs/doxygen.cfg
index 9de6aa8..1c5aad4 100644
--- a/pjsip/docs/doxygen.cfg
+++ b/pjsip/docs/doxygen.cfg
@@ -367,7 +367,7 @@
 # excluded from the INPUT source files. This way you can easily exclude a 

 # subdirectory from a directory tree whose root is specified with the INPUT tag.

 

-EXCLUDE                = *_i.h

+EXCLUDE                = *_i.h pjsua_internal.h

 

 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 

 # that are symbolic links (a Unix filesystem feature) are excluded from the input.

@@ -844,7 +844,8 @@
 

 

 PREDEFINED             = PJ_DECL(x)=x PJ_DEF(x)=x PJ_IDECL(x)=x \

-			 PJ_IDEF(x)=x PJ_INLINE(x)=x

+			 PJ_IDEF(x)=x PJ_INLINE(x)=x PJ_DECL_DATA(x)=x \

+			 PJMEDIA_HAS_SRTP=1

 

 

 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 

diff --git a/pjsip/include/pjsip-simple/evsub.h b/pjsip/include/pjsip-simple/evsub.h
index 1c3ee97..047952b 100644
--- a/pjsip/include/pjsip-simple/evsub.h
+++ b/pjsip/include/pjsip-simple/evsub.h
@@ -20,7 +20,7 @@
 #define __PJSIP_SIMPLE_EVSUB_H__
 
 /**
- * @file event_notify.h
+ * @file evsub.h
  * @brief SIP Specific Event Notification Extension (RFC 3265)
  */
 
@@ -132,7 +132,7 @@
      *
      * However, implementation MUST send NOTIFY request upon receiving this
      * callback. The suggested behavior is to call 
-     * #pjsip_evsub_last_notify(), since this function takes care
+     * #pjsip_evsub_current_notify(), since this function takes care
      * about unsubscription request and calculates the appropriate expiration
      * interval.
      */
diff --git a/pjsip/include/pjsip-simple/evsub_msg.h b/pjsip/include/pjsip-simple/evsub_msg.h
index f1c3f4b..520a0f9 100644
--- a/pjsip/include/pjsip-simple/evsub_msg.h
+++ b/pjsip/include/pjsip-simple/evsub_msg.h
@@ -20,7 +20,7 @@
 #define __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__
 
 /**
- * @file event_notify_msg.h
+ * @file evsub_msg.h
  * @brief SIP Event Notification Headers (RFC 3265)
  */
 #include <pjsip/sip_msg.h>
diff --git a/pjsip/include/pjsip-ua/sip_inv.h b/pjsip/include/pjsip-ua/sip_inv.h
index bfcc11c..448718d 100644
--- a/pjsip/include/pjsip-ua/sip_inv.h
+++ b/pjsip/include/pjsip-ua/sip_inv.h
@@ -495,7 +495,7 @@
 /**
  * Create the initial response message for the incoming INVITE request in
  * rdata with  status code st_code and optional status text st_text. Use
- * #pjsip_answer() to create subsequent response message.
+ * #pjsip_inv_answer() to create subsequent response message.
  */
 PJ_DECL(pj_status_t) pjsip_inv_initial_answer(	pjsip_inv_session *inv,
 						pjsip_rx_data *rdata,
diff --git a/pjsip/include/pjsip-ua/sip_regc.h b/pjsip/include/pjsip-ua/sip_regc.h
index 62d2336..03c71d9 100644
--- a/pjsip/include/pjsip-ua/sip_regc.h
+++ b/pjsip/include/pjsip-ua/sip_regc.h
@@ -20,7 +20,7 @@
 #define __PJSIP_SIP_REG_H__
 
 /**
- * @file sip_reg.h
+ * @file sip_regc.h
  * @brief SIP Registration Client
  */
 
diff --git a/pjsip/include/pjsip/sip_auth.h b/pjsip/include/pjsip/sip_auth.h
index 155c180..c6b32dd 100644
--- a/pjsip/include/pjsip/sip_auth.h
+++ b/pjsip/include/pjsip/sip_auth.h
@@ -30,7 +30,7 @@
 PJ_BEGIN_DECL
 
 /**
- * @addtogroup PJSIP_AUTH Authentication Framework
+ * @addtogroup PJSIP_AUTH
  * @ingroup PJSIP_CORE
  * @brief Client and server side authentication framework.
  */
diff --git a/pjsip/include/pjsip/sip_auth_parser.h b/pjsip/include/pjsip/sip_auth_parser.h
index 8aaa846..791bfce 100644
--- a/pjsip/include/pjsip/sip_auth_parser.h
+++ b/pjsip/include/pjsip/sip_auth_parser.h
@@ -20,7 +20,7 @@
 #define __PJSIP_AUTH_SIP_AUTH_PARSER_H__
 
 /**
- * @file pjsip_auth_parser.h
+ * @file sip_auth_parser.h
  * @brief SIP Authorization Parser Module.
  */
 
diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h
index 3809ff3..e72ab39 100644
--- a/pjsip/include/pjsip/sip_config.h
+++ b/pjsip/include/pjsip/sip_config.h
@@ -351,7 +351,7 @@
  *
  * Note that even when this setting is enabled, asynchronous DNS resolution
  * will only be done when application calls #pjsip_endpt_create_resolver(),
- * configure the nameservers with #pj_dns_resolver_set_ns(), and configure
+ * configure the nameservers with pj_dns_resolver_set_ns(), and configure
  * the SIP endpoint's DNS resolver with #pjsip_endpt_set_resolver(). If
  * these steps are not followed, the domain will be resolved with normal
  * pj_gethostbyname() function.
diff --git a/pjsip/include/pjsip/sip_dialog.h b/pjsip/include/pjsip/sip_dialog.h
index b11ba4c..c8711c4 100644
--- a/pjsip/include/pjsip/sip_dialog.h
+++ b/pjsip/include/pjsip/sip_dialog.h
@@ -21,7 +21,7 @@
 
 
 /**
- * @file dialog.h
+ * @file sip_dialog.h
  * @brief SIP Dialog abstraction
  */
 
diff --git a/pjsip/include/pjsip/sip_endpoint.h b/pjsip/include/pjsip/sip_endpoint.h
index f285ef8..baf5900 100644
--- a/pjsip/include/pjsip/sip_endpoint.h
+++ b/pjsip/include/pjsip/sip_endpoint.h
@@ -224,21 +224,6 @@
 					pj_pool_t *pool );
 
 /**
- * Create a new transaction. After creating the transaction, application MUST
- * initialize the transaction as either UAC or UAS (by calling
- * #pjsip_tsx_init_uac or #pjsip_tsx_init_uas), then must register the 
- * transaction to endpoint with #pjsip_endpt_register_tsx.
- * This function, like all other endpoint functions, is thread safe.
- *
- * @param endpt	    The SIP endpoint.
- * @param p_tsx	    Pointer to receive the transaction.
- *
- * @return	    PJ_SUCCESS or the appropriate error code.
- */
-PJ_DECL(pj_status_t) pjsip_endpt_create_tsx(pjsip_endpoint *endpt,
-					    pjsip_transaction **p_tsx);
-
-/**
  * Find transaction in endpoint's transaction table by the transaction's key.
  * This function normally is only used by modules. The key for a transaction
  * can be created by calling #pjsip_tsx_create_key.
diff --git a/pjsip/include/pjsip/sip_msg.h b/pjsip/include/pjsip/sip_msg.h
index 34bd996..8a202c4 100644
--- a/pjsip/include/pjsip/sip_msg.h
+++ b/pjsip/include/pjsip/sip_msg.h
@@ -1032,7 +1032,7 @@
     /** Number of tags/elements. */
     unsigned	count;
 
-    /**< Tags/elements. */
+    /** Tags/elements. */
     pj_str_t	values[PJSIP_GENERIC_ARRAY_MAX_COUNT];
 
 } pjsip_generic_array_hdr;
diff --git a/pjsip/include/pjsip/sip_resolve.h b/pjsip/include/pjsip/sip_resolve.h
index b4db9b3..089f290 100644
--- a/pjsip/include/pjsip/sip_resolve.h
+++ b/pjsip/include/pjsip/sip_resolve.h
@@ -209,7 +209,7 @@
  * Create SIP resolver engine. Note that this function is normally called
  * internally by pjsip_endpoint instance.
  *
- * @param pf	    The Pool Factory.
+ * @param pool	    Pool to allocate memory from.
  * @param p_res	    Pointer to receive SIP resolver instance.
  *
  * @return	    PJ_SUCCESS when resolver can be successfully created.
diff --git a/pjsip/include/pjsip/sip_transaction.h b/pjsip/include/pjsip/sip_transaction.h
index 9550c32..2865b6e 100644
--- a/pjsip/include/pjsip/sip_transaction.h
+++ b/pjsip/include/pjsip/sip_transaction.h
@@ -360,13 +360,15 @@
  */
 PJ_DECL(void) pjsip_tsx_layer_dump(pj_bool_t detail);
 
-/*
+/**
  * Get the string name for the state.
+ * @param state	State
  */
 PJ_DECL(const char *) pjsip_tsx_state_str(pjsip_tsx_state_e state);
 
-/*
+/**
  * Get the role name.
+ * @param role	Role.
  */
 PJ_DECL(const char *) pjsip_role_name(pjsip_role_e role);
 
diff --git a/pjsip/include/pjsip/sip_transport.h b/pjsip/include/pjsip/sip_transport.h
index 6097aba..34ea4b2 100644
--- a/pjsip/include/pjsip/sip_transport.h
+++ b/pjsip/include/pjsip/sip_transport.h
@@ -919,8 +919,27 @@
  * TRANSPORT MANAGER
  *
  *****************************************************************************/
-typedef void (*pjsip_rx_callback)(pjsip_endpoint*, pj_status_t, pjsip_rx_data *);
-typedef pj_status_t (*pjsip_tx_callback)(pjsip_endpoint*, pjsip_tx_data*);
+
+/**
+ * Type of callback to be called when transport manager receives incoming
+ * SIP message.
+ *
+ * @param ep	    Endpoint.
+ * @param status    Receiption status.
+ * @param rd	    Received packet.
+ */
+typedef void (*pjsip_rx_callback)(pjsip_endpoint *ep, pj_status_t status, 
+				  pjsip_rx_data *rd);
+
+/**
+ * Type of callback to be called before transport manager is about
+ * to transmit SIP message.
+ *
+ * @param ep	    Endpoint.
+ * @param td	    Transmit data.
+ */
+typedef pj_status_t (*pjsip_tx_callback)(pjsip_endpoint *ep, pjsip_tx_data*td);
+
 /**
  * Create a transport manager. Normally application doesn't need to call
  * this function directly, since a transport manager will be created and
diff --git a/pjsip/include/pjsip/sip_util.h b/pjsip/include/pjsip/sip_util.h
index 75112cc..b6b3df8 100644
--- a/pjsip/include/pjsip/sip_util.h
+++ b/pjsip/include/pjsip/sip_util.h
@@ -259,7 +259,17 @@
 } pjsip_send_state;
 
 
-typedef void (*pjsip_send_callback)(pjsip_send_state*, pj_ssize_t sent,
+/**
+ * Declaration for callback function to be specified in 
+ * #pjsip_endpt_send_request_stateless(), #pjsip_endpt_send_response(), or
+ * #pjsip_endpt_send_response2().
+ *
+ * @param st	    Structure to keep transmission state.
+ * @param sent	    Number of bytes sent.
+ * @param cont	    When current transmission fails, specify whether
+ *		    the function should fallback to next destination.
+ */
+typedef void (*pjsip_send_callback)(pjsip_send_state *st, pj_ssize_t sent,
 				    pj_bool_t *cont);
 
 /**
@@ -517,7 +527,14 @@
 					  const pjsip_msg_body *body,
 					  pjsip_transaction **p_tsx );
 
-typedef void (*pjsip_endpt_send_callback)(void*, pjsip_event*);
+/**
+ * Type of callback to be specified in #pjsip_endpt_send_request().
+ *
+ * @param token	    The token that was given in #pjsip_endpt_send_request()
+ * @param e	    Completion event.
+ */
+typedef void (*pjsip_endpt_send_callback)(void *token, pjsip_event *e);
+
 /**
  * Send outgoing request and initiate UAC transaction for the request.
  * This is an auxiliary function to be used by application to send arbitrary
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index d78eeb7..ca93208 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -1104,7 +1104,7 @@
 PJ_DECL(void) pjsua_config_default(pjsua_config *cfg);
 
 
-/* The implementation has been moved to sip_auth.h */
+/** The implementation has been moved to sip_auth.h */
 #define pjsip_cred_dup	pjsip_cred_info_dup
 
 
@@ -1197,7 +1197,7 @@
 PJ_DECL(pj_status_t) pjsua_create(void);
 
 
-/* Forward declaration */
+/** Forward declaration */
 typedef struct pjsua_media_config pjsua_media_config;
 
 
@@ -3393,7 +3393,7 @@
  * for this buddy, this function will also start the presence subscription
  * session immediately.
  *
- * @param buddy)cfg	Buddy configuration.
+ * @param buddy_cfg	Buddy configuration.
  * @param p_buddy_id	Pointer to receive buddy ID.
  *
  * @return		PJ_SUCCESS on success, or the appropriate error code.
@@ -4449,7 +4449,7 @@
  *
  * @param tail_ms	The tail length, in miliseconds. Set to zero to
  *			disable AEC.
- * @param options	Options to be passed to #pjmedia_echo_create().
+ * @param options	Options to be passed to pjmedia_echo_create().
  *			Normally the value should be zero.
  *
  * @return		PJ_SUCCESS on success.