diff options
author | Benny Prijono <bennylp@teluu.com> | 2012-09-20 06:00:23 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2012-09-20 06:00:23 +0000 |
commit | c1da22781bc970d7948f35e5fa6ede7b54f45549 (patch) | |
tree | 238d85c1b6e1375c207486e9f2c2f22188ae49ca /pjsip/include | |
parent | 8a001ec6f6a9c628eff9fbd9c9a478d127ed12d3 (diff) |
Fixed #1585: IPv6 support for SIP TCP and TLS transports and PJSUA-LIB v2
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4262 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r-- | pjsip/include/pjsip/sip_transport_tls.h | 40 | ||||
-rw-r--r-- | pjsip/include/pjsip/sip_types.h | 5 | ||||
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 22 |
3 files changed, 65 insertions, 2 deletions
diff --git a/pjsip/include/pjsip/sip_transport_tls.h b/pjsip/include/pjsip/sip_transport_tls.h index ae823f36..1f8ee431 100644 --- a/pjsip/include/pjsip/sip_transport_tls.h +++ b/pjsip/include/pjsip/sip_transport_tls.h @@ -262,6 +262,8 @@ PJ_INLINE(void) pjsip_tls_setting_copy(pj_pool_t *pool, * instance of SIP TLS transport factory and register it to the * transport manager. * + * See also #pjsip_tls_transport_start2() which supports IPv6. + * * @param endpt The SIP endpoint. * @param opt Optional TLS settings. * @param local Optional local address to bind, or specify the @@ -294,7 +296,43 @@ PJ_DECL(pj_status_t) pjsip_tls_transport_start(pjsip_endpoint *endpt, unsigned async_cnt, pjsip_tpfactory **p_factory); - +/** + * Variant of #pjsip_tls_transport_start() that supports IPv6. To instantiate + * IPv6 listener, set the address family of the "local" argument to IPv6 + * (the host and port part may be left unspecified if not desired, i.e. by + * filling them with zeroes). + * + * @param endpt The SIP endpoint. + * @param opt Optional TLS settings. + * @param local Optional local address to bind, or specify the + * address to bind the server socket to. Both IP + * interface address and port fields are optional. + * If IP interface address is not specified, socket + * will be bound to any address. If port is not + * specified, socket will be bound to any port + * selected by the operating system. + * @param a_name Optional published address, which is the address to be + * advertised as the address of this SIP transport. + * If this argument is NULL, then the bound address + * will be used as the published address. + * @param async_cnt 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). + * @param p_factory Optional pointer to receive the instance of the + * SIP TLS 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_tls_transport_start2(pjsip_endpoint *endpt, + const pjsip_tls_setting *opt, + const pj_sockaddr *local, + const pjsip_host_port *a_name, + unsigned async_cnt, + pjsip_tpfactory **p_factory); PJ_END_DECL diff --git a/pjsip/include/pjsip/sip_types.h b/pjsip/include/pjsip/sip_types.h index 2d863be0..d212dd2e 100644 --- a/pjsip/include/pjsip/sip_types.h +++ b/pjsip/include/pjsip/sip_types.h @@ -92,7 +92,10 @@ typedef enum pjsip_transport_type_e PJSIP_TRANSPORT_UDP6 = PJSIP_TRANSPORT_UDP + PJSIP_TRANSPORT_IPV6, /** TCP over IPv6 */ - PJSIP_TRANSPORT_TCP6 = PJSIP_TRANSPORT_TCP + PJSIP_TRANSPORT_IPV6 + PJSIP_TRANSPORT_TCP6 = PJSIP_TRANSPORT_TCP + PJSIP_TRANSPORT_IPV6, + + /** TLS over IPv6 */ + PJSIP_TRANSPORT_TLS6 = PJSIP_TRANSPORT_TLS + PJSIP_TRANSPORT_IPV6 } pjsip_transport_type_e; diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index 922190a3..ad8e519c 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -2690,6 +2690,23 @@ typedef struct pjsua_turn_config } pjsua_turn_config; /** + * Specify how IPv6 transport should be used in account config. + */ +typedef enum pjsua_ipv6_use +{ + /** + * IPv6 is not used. + */ + PJSUA_IPV6_DISABLED, + + /** + * IPv6 is enabled. + */ + PJSUA_IPV6_ENABLED + +} pjsua_ipv6_use; + +/** * This structure describes account configuration to be specified when * adding a new account with #pjsua_acc_add(). Application MUST initialize * this structure first by calling #pjsua_acc_config_default(). @@ -3090,6 +3107,11 @@ typedef struct pjsua_acc_config pjsua_transport_config rtp_cfg; /** + * Specify whether IPv6 should be used on media. + */ + pjsua_ipv6_use ipv6_media_use; + + /** * Control the use of STUN for the SIP signaling. * * Default: PJSUA_STUN_USE_DEFAULT |