diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-10-25 09:02:07 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-10-25 09:02:07 +0000 |
commit | fdc0f2ecdb18b9176f87f55ee17f054ce107e8c7 (patch) | |
tree | 768b9507e60426fcabcc8b4ce2540ae727cf7ffa /pjsip/include | |
parent | 2053af19e76b9c13e8bdebb13669cf915dc49981 (diff) |
Initial commit for ticket #950: QoS support:
- implementation:
- PJLIB (sock_qos*.*)
- added QoS support in:
- SIP UDP transport,
- SIP TCP transport,
- media UDP transport (done in pjsua-lib),
- pjnath ICE stream transport,
- pjnath STUN socket,
- pjnath TURN client
- added QoS options in pjsua-lib:
- QoS fields in pjsua_transport_config
- added "--set-qos" parameter in pjsua
Notes:
- QoS in TLS transport is not yet implemented, waiting for #957
- build ok on VS6, VS2005 (multiple targets), Carbide, and Mingw
- no run-time testing yet
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2966 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r-- | pjsip/include/pjsip/sip_transport_tcp.h | 87 | ||||
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 18 |
2 files changed, 105 insertions, 0 deletions
diff --git a/pjsip/include/pjsip/sip_transport_tcp.h b/pjsip/include/pjsip/sip_transport_tcp.h index c2ef1db0..50f82564 100644 --- a/pjsip/include/pjsip/sip_transport_tcp.h +++ b/pjsip/include/pjsip/sip_transport_tcp.h @@ -26,6 +26,7 @@ */ #include <pjsip/sip_transport.h> +#include <pj/sock_qos.h> /* Only declare the API if PJ_HAS_TCP is true */ @@ -44,6 +45,74 @@ PJ_BEGIN_DECL */ /** + * Settings to be specified when creating the TCP transport. Application + * should initialize this structure with its default values by calling + * pjsip_tcp_transport_cfg_default(). + */ +typedef struct pjsip_tcp_transport_cfg +{ + /** + * Address family to use. Valid values are pj_AF_INET() and + * pj_AF_INET6(). Default is pj_AF_INET(). + */ + int af; + + /** + * Optional address to bind the socket to. Default is to bind to + * PJ_INADDR_ANY and to any available port. + */ + pj_sockaddr bind_addr; + + /** + * Optional published address, which is the address to be + * advertised as the address of this SIP transport. + * By default the bound address will be used as the published address. + */ + pjsip_host_port addr_name; + + /** + * Number of simultaneous asynchronous accept() operations to be + * supported. It is recommended that the number here corresponds to + * the number of processors in the system (or the number of SIP + * worker threads). + * + * Default: 1 + */ + unsigned async_cnt; + + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default is QoS not set. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * Default is QoS not set. + */ + pj_qos_params qos_params; + +} pjsip_tcp_transport_cfg; + + +/** + * Initialize pjsip_tcp_transport_cfg structure with default values for + * the specifed address family. + * + * @param cfg The structure to initialize. + * @param af Address family to be used. + */ +PJ_DECL(void) pjsip_tcp_transport_cfg_default(pjsip_tcp_transport_cfg *cfg, + int af); + + +/** * Register support for SIP TCP transport by creating TCP listener on * the specified address and port. This function will create an * instance of SIP TCP transport factory and register it to the @@ -110,6 +179,24 @@ PJ_DECL(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, unsigned async_cnt, pjsip_tpfactory **p_factory); +/** + * Another variant of #pjsip_tcp_transport_start(). + * + * @param endpt The SIP endpoint. + * @param cfg TCP transport settings. Application should initialize + * this setting with #pjsip_tcp_transport_cfg_default(). + * @param p_factory Optional pointer to receive the instance of the + * SIP TCP transport factory just created. + * + * @return PJ_SUCCESS when the transport has been successfully + * started and registered to transport manager, or + * the appropriate error code. + */ +PJ_DECL(pj_status_t) pjsip_tcp_transport_start3( + pjsip_endpoint *endpt, + const pjsip_tcp_transport_cfg *cfg, + pjsip_tpfactory **p_factory + ); PJ_END_DECL diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index 4727448c..356cab76 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -1517,6 +1517,24 @@ typedef struct pjsua_transport_config */ pjsip_tls_setting tls_setting; + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default is QoS not set. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * Default is QoS not set. + */ + pj_qos_params qos_params; + } pjsua_transport_config; |