summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsip/sip_transport_tcp.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-09-26 13:21:02 +0000
committerBenny Prijono <bennylp@teluu.com>2006-09-26 13:21:02 +0000
commit506917fa7dfa0cec64586417feb081b6dcf1f97e (patch)
tree9627c2f90727f171fbe2c82fcb256a6efb8b0c12 /pjsip/include/pjsip/sip_transport_tcp.h
parentdecb295824ef9cf2df5683d11b1c40fb6eff6ab5 (diff)
Added support for specifying IP address in PJSUA-LIB/pjsua.
This option can be used for example to select the IP interface of SIP/RTP/RTCP transports, or to specify the public IP address of NAT/router in case port forwarding is used. For SIP transports, this feature works for both UDP and TCP transports. Changes: - added public_ip field in pjsua_transport_config, and change SIP and media transport creation to consider this option. - added --ip-addr option in pjsua - added pjsip_tcp_transport_start2() which allows specifying alternate TCP published address when creating TCP transports. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@742 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsip/sip_transport_tcp.h')
-rw-r--r--pjsip/include/pjsip/sip_transport_tcp.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/pjsip/include/pjsip/sip_transport_tcp.h b/pjsip/include/pjsip/sip_transport_tcp.h
index 4f5664d4..db308d7d 100644
--- a/pjsip/include/pjsip/sip_transport_tcp.h
+++ b/pjsip/include/pjsip/sip_transport_tcp.h
@@ -78,6 +78,43 @@ PJ_DECL(pj_status_t) pjsip_tcp_transport_start(pjsip_endpoint *endpt,
pjsip_tpfactory **p_factory);
+
+/**
+ * A newer variant of #pjsip_tcp_transport_start(), which allows specifying
+ * the published/public address of the TCP transport.
+ *
+ * @param endpt The SIP endpoint.
+ * @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 PJ_INADDR_ANY. 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 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_start2(pjsip_endpoint *endpt,
+ const pj_sockaddr_in *local,
+ const pjsip_host_port *a_name,
+ unsigned async_cnt,
+ pjsip_tpfactory **p_factory);
+
+
+
PJ_END_DECL
/**