summaryrefslogtreecommitdiff
path: root/pjnath/include/pjnath/turn_session.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-04-13 08:54:10 +0000
committerBenny Prijono <bennylp@teluu.com>2009-04-13 08:54:10 +0000
commit0efc01a54a538cb2ecaf03dcc77e12d78b346c39 (patch)
treeee63745c12c13d0efea0a94040b4778ef3dcc138 /pjnath/include/pjnath/turn_session.h
parent9053655bfd453951291fc84fdc99ea254c028611 (diff)
Ticket #780: Update TURN from draft 09 to draft 13:
- new rules for permissions: - permission must be created and refreshed explicitly with CreatePermission - transmitting data does not refresh permission - attributes changed/added: XOR-PEER-ADDRESS, XOR-RELAYED-ADDRESS, EVEN-PORT, DONT-FRAGMENT - attribute(s) removed: REQUESTED-PROPS - new status codes: 401 (Forbidden), 507 (Insufficient Capacity) - removed status codes: 443 (Invalid IP address), 444 (Invalid Port), 508 (Insufficient Port Capacity) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2589 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath/include/pjnath/turn_session.h')
-rw-r--r--pjnath/include/pjnath/turn_session.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/pjnath/include/pjnath/turn_session.h b/pjnath/include/pjnath/turn_session.h
index f028fd8e..88cf1bfe 100644
--- a/pjnath/include/pjnath/turn_session.h
+++ b/pjnath/include/pjnath/turn_session.h
@@ -437,6 +437,21 @@ PJ_DECL(void) pj_turn_session_set_log(pj_turn_session *sess,
/**
+ * Configure the SOFTWARE name to be sent in all STUN requests by the
+ * TURN session.
+ *
+ * @param sess The TURN client session.
+ * @param sw Software name string. If this argument is NULL or
+ * empty, the session will not include SOFTWARE attribute
+ * in STUN requests and responses.
+ *
+ * @return PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_turn_session_set_software_name(pj_turn_session *sess,
+ const pj_str_t *sw);
+
+
+/**
* Set the server or domain name of the server. Before the application
* can send Allocate request (with pj_turn_session_alloc()), it must first
* resolve the server address(es) using this function. This function will
@@ -519,6 +534,30 @@ PJ_DECL(pj_status_t) pj_turn_session_alloc(pj_turn_session *sess,
/**
+ * Create or renew permission in the TURN server for the specified peer IP
+ * addresses. Application must install permission for a particular (peer)
+ * IP address before it sends any data to that IP address, or otherwise
+ * the TURN server will drop the data.
+ *
+ * @param sess The TURN client session.
+ * @param addr_cnt Number of IP addresses.
+ * @param addr Array of peer IP addresses. Only the address family
+ * and IP address portion of the socket address matter.
+ * @param options Specify 1 to let the TURN client session automatically
+ * renew the permission later when they are about to
+ * expire.
+ *
+ * @return PJ_SUCCESS if the operation has been successfully
+ * issued, or the appropriate error code. Note that
+ * the operation itself will complete asynchronously.
+ */
+PJ_DECL(pj_status_t) pj_turn_session_set_perm(pj_turn_session *sess,
+ unsigned addr_cnt,
+ const pj_sockaddr addr[],
+ unsigned options);
+
+
+/**
* Send a data to the specified peer address via the TURN relay. This
* function will encapsulate the data as STUN Send Indication or TURN
* ChannelData packet and send the message to the TURN server. The TURN