summaryrefslogtreecommitdiff
path: root/pjsip/include
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip/include')
-rw-r--r--pjsip/include/pjsip/sip_transport.h28
-rw-r--r--pjsip/include/pjsip/sip_uri.h17
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h35
-rw-r--r--pjsip/include/pjsua-lib/pjsua_internal.h2
4 files changed, 73 insertions, 9 deletions
diff --git a/pjsip/include/pjsip/sip_transport.h b/pjsip/include/pjsip/sip_transport.h
index 002061cf..2f8f679f 100644
--- a/pjsip/include/pjsip/sip_transport.h
+++ b/pjsip/include/pjsip/sip_transport.h
@@ -62,7 +62,9 @@ enum pjsip_transport_flags_e
{
PJSIP_TRANSPORT_RELIABLE = 1, /**< Transport is reliable. */
PJSIP_TRANSPORT_SECURE = 2, /**< Transport is secure. */
- PJSIP_TRANSPORT_DATAGRAM = 4, /**< Datagram based transport. */
+ PJSIP_TRANSPORT_DATAGRAM = 4, /**< Datagram based transport.
+ (it's also assumed to be
+ connectionless) */
};
/**
@@ -786,6 +788,30 @@ PJ_DECL(pj_status_t) pjsip_tpmgr_create( pj_pool_t *pool,
/**
+ * Find out the appropriate local address info (IP address and port) to
+ * advertise in Contact header based on the remote address to be
+ * contacted. The local address info would be the address name of the
+ * transport or listener which will be used to send the request.
+ *
+ * In this implementation, it will only select the transport based on
+ * the transport type in the request.
+ *
+ * @param tpmgr The transport manager.
+ * @param pool Pool to allocate memory for the IP address.
+ * @param h Destination address to contact.
+ * @param ip_addr Pointer to receive the IP address.
+ * @param port Pointer to receive the port number.
+ *
+ * @return PJ_SUCCESS, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pjsip_tpmgr_find_local_addr( pjsip_tpmgr *tpmgr,
+ pj_pool_t *pool,
+ pjsip_transport_type_e type,
+ pj_str_t *ip_addr,
+ int *port);
+
+
+/**
* Destroy transport manager.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_destroy(pjsip_tpmgr *mgr);
diff --git a/pjsip/include/pjsip/sip_uri.h b/pjsip/include/pjsip/sip_uri.h
index e5bc4180..e5981f67 100644
--- a/pjsip/include/pjsip/sip_uri.h
+++ b/pjsip/include/pjsip/sip_uri.h
@@ -359,24 +359,27 @@ typedef struct pjsip_name_addr
/**
* Create new SIP URL and initialize all fields with zero or NULL.
* @param pool The pool.
- * @param secure Tlag to indicate whether secure transport should be used.
+ * @param secure Flag to indicate whether secure transport should be used.
* @return SIP URL.
*/
-PJ_DECL(pjsip_sip_uri*) pjsip_sip_uri_create( pj_pool_t *pool, int secure );
+PJ_DECL(pjsip_sip_uri*) pjsip_sip_uri_create( pj_pool_t *pool,
+ pj_bool_t secure );
/**
- * Create new SIPS URL and initialize all fields with zero or NULL.
- * @param pool The pool.
- * @return SIPS URL.
+ * Change the SIP URI scheme to sip or sips based on the secure flag.
+ * This would not change anything except the scheme.
+ * @param uri The URI
+ * @param secure Non-zero if sips is wanted.
*/
-PJ_DECL(pjsip_sip_uri*) pjsip_sips_uri_create( pj_pool_t *pool );
+PJ_DECL(void) pjsip_sip_uri_set_secure( pjsip_sip_uri *uri,
+ pj_bool_t secure );
/**
* Initialize SIP URL (all fields are set to NULL or zero).
* @param url The URL.
* @param secure Create sips URI?
*/
-PJ_DECL(void) pjsip_sip_uri_init(pjsip_sip_uri *url, int secure);
+PJ_DECL(void) pjsip_sip_uri_init(pjsip_sip_uri *url, pj_bool_t secure);
/**
* Perform full assignment to the SIP URL.
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index f8a9aff1..7ae37eed 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -1303,6 +1303,41 @@ PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_outgoing(const pj_str_t *url);
PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_incoming(pjsip_rx_data *rdata);
+/**
+ * Create a suitable URI to be put as Contact based on the specified
+ * target URI for the specified account.
+ *
+ * @param pool Pool to allocate memory for the string.
+ * @param contact The string where the Contact URI will be stored.
+ * @param acc_id Account ID.
+ * @param uri Destination URI of the request.
+ *
+ * @return PJ_SUCCESS on success, other on error.
+ */
+PJ_DECL(pj_status_t) pjsua_acc_create_uac_contact( pj_pool_t *pool,
+ pj_str_t *contact,
+ pjsua_acc_id acc_id,
+ const pj_str_t *uri);
+
+
+
+/**
+ * Create a suitable URI to be put as Contact based on the information
+ * in the incoming request.
+ *
+ * @param pool Pool to allocate memory for the string.
+ * @param contact The string where the Contact URI will be stored.
+ * @param acc_id Account ID.
+ * @param rdata Incoming request.
+ *
+ * @return PJ_SUCCESS on success, other on error.
+ */
+PJ_DECL(pj_status_t) pjsua_acc_create_uas_contact( pj_pool_t *pool,
+ pj_str_t *contact,
+ pjsua_acc_id acc_id,
+ pjsip_rx_data *rdata );
+
+
/**
* @}
diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h
index a0f52189..fe57b451 100644
--- a/pjsip/include/pjsua-lib/pjsua_internal.h
+++ b/pjsip/include/pjsua-lib/pjsua_internal.h
@@ -79,8 +79,8 @@ typedef struct pjsua_acc
pj_bool_t valid; /**< Is this account valid? */
int index; /**< Index in accounts array. */
+ pj_str_t display; /**< Display name, if any. */
pj_str_t user_part; /**< User part of local URI. */
- pj_str_t real_contact; /**< Real contact address. */
pj_str_t srv_domain; /**< Host part of reg server. */
int srv_port; /**< Port number of reg server. */