Index: pjproject/main/pjsip/include/pjsip/sip_endpoint.h
===================================================================
--- pjproject/main/pjsip/include/pjsip/sip_endpoint.h	(revision 38)
+++ pjproject/main/pjsip/include/pjsip/sip_endpoint.h	(revision 43)
@@ -1,4 +1,3 @@
 /* $Id$
- *
  */
 #ifndef __PJSIP_SIP_ENDPOINT_H__
@@ -29,5 +28,6 @@
  * all SIP objects in an application. It performs the following roles:
  *  - it manages the allocation/deallocation of memory pools for all objects.
- *  - it manages listeners and transports, and how they are used by transactions.
+ *  - it manages listeners and transports, and how they are used by 
+ *    transactions.
  *  - it owns transaction hash table.
  *  - it receives incoming messages from transport layer and automatically
@@ -35,5 +35,6 @@
  *  - it has a single instance of timer management (timer heap).
  *  - it manages modules, which is the primary means of extending the library.
- *  - it provides single polling function for all objects and distributes events.
+ *  - it provides single polling function for all objects and distributes 
+ *    events.
  *  - it provides SIP policy such as which outbound proxy to use for all
  *    outgoing SIP request messages.
@@ -50,12 +51,19 @@
 /**
  * Create an instance of SIP endpoint from the specified pool factory.
- * The pool factory reference then will be kept by the endpoint, so that future
- * memory allocations by SIP components will be taken from the same pool factory.
- *
- * @param pf	Pool factory that will be used for the lifetime of endpoint.
- *
- * @return the endpoint instance on success.
- */
-PJ_DECL(pjsip_endpoint*) pjsip_endpt_create(pj_pool_factory *pf);
+ * The pool factory reference then will be kept by the endpoint, so that 
+ * future memory allocations by SIP components will be taken from the same
+ * pool factory.
+ *
+ * @param pf	        Pool factory that will be used for the lifetime of 
+ *                      endpoint.
+ * @param name          Optional name to be specified for the endpoint.
+ *                      If this parameter is NULL, then the name will use
+ *                      local host name.
+ * @param endpt         Pointer to receive endpoint instance.
+ *
+ * @return              PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjsip_endpt_create(pj_pool_factory *pf,
+                                        pjsip_endpoint **endpt);
 
 /**
@@ -67,4 +75,14 @@
  */
 PJ_DECL(void) pjsip_endpt_destroy(pjsip_endpoint *endpt);
+
+/**
+ * Get endpoint name.
+ *
+ * @param endpt         The SIP endpoint instance.
+ *
+ * @return              Endpoint name, as was registered during endpoint
+ *                      creation. The string is NULL terminated.
+ */
+PJ_DECL(const pj_str_t*) pjsip_endpt_name(const pjsip_endpoint *endpt);
 
 /**
@@ -155,7 +173,10 @@
  *
  * @param endpt	    The SIP endpoint.
- * @return	    The new transaction, or NULL on failure.
- */
-PJ_DECL(pjsip_transaction*) pjsip_endpt_create_tsx(pjsip_endpoint *endpt);
+ * @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);
 
 /**
@@ -188,8 +209,11 @@
  * This function, like all other endpoint functions, is thread safe.
  *
- * @param endpt the endpoint.
- * @return new transmit data.
- */
-PJ_DECL(pjsip_tx_data*) pjsip_endpt_create_tdata( pjsip_endpoint *endpt );
+ * @param endpt	    The endpoint.
+ * @param p_tdata    Pointer to receive transmit data buffer.
+ *
+ * @return	    PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pjsip_endpt_create_tdata( pjsip_endpoint *endpt,
+					       pjsip_tx_data **p_tdata);
 
 /**
@@ -333,4 +357,22 @@
 
 /**
+ * Log an error.
+ */
+PJ_DECL(void) pjsip_endpt_log_error( pjsip_endpoint *endpt,
+				     const char *sender,
+                                     pj_status_t error_code,
+                                     const char *format,
+                                     ... );
+
+#define PJSIP_ENDPT_LOG_ERROR(expr)   \
+            pjsip_endpt_log_error expr
+
+#define PJSIP_ENDPT_TRACE(tracing,expr) \
+            do {                        \
+                if ((tracing))          \
+                    PJ_LOG(4,expr);     \
+            } while (0)
+
+/**
  * @}
  */
