Commit a139cff4 authored by Pekka Pessi's avatar Pekka Pessi

Added NTATAG_TCP_RPORT().

Do not use rport with TCP by default.

darcs-hash:20060103134910-65a35-5eb3a6e7e5f334c3cf23195f477cd8e3ac0d439e.gz
parent 65126ecb
......@@ -748,7 +748,8 @@ void agent_kill_terminator(nta_agent_t *agent)
* NTATAG_CANCEL_2543(), NTATAG_CANCEL_487(), NTATAG_DEBUG_DROP_PROB(),
* NTATAG_DEFAULT_PROXY(), NTATAG_EXTRA_100(), NTATAG_MAXSIZE(),
* NTATAG_UDP_MTU(), NTATAG_MERGE_482(), NTATAG_PASS_100(),
* NTATAG_PRELOAD(), NTATAG_REL100(), NTATAG_RPORT(), NTATAG_SERVER_RPORT(),
* NTATAG_PRELOAD(), NTATAG_REL100(), NTATAG_RPORT(), NTATAG_SERVER_RPORT(),
* NTATAG_TCP_RPORT(),
* NTATAG_SIPFLAGS(), NTATAG_SIP_T1X64(), NTATAG_SIP_T1(), NTATAG_SIP_T2(),
* NTATAG_SIP_T4(), NTATAG_SMIME(), NTATAG_STATELESS(), NTATAG_TAG_3261(),
* NTATAG_TIMEOUT_408(), NTATAG_PASS_408(), NTATAG_UA(), NTATAG_USER_VIA(),
......@@ -806,6 +807,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
uint32_t flags = agent->sa_flags;
int rport = agent->sa_rport;
int server_rport = agent->sa_server_rport;
int tcp_rport = agent->sa_tcp_rport;
unsigned preload = agent->sa_preload;
unsigned threadpool = agent->sa_tport_threadpool;
#if HAVE_SIGCOMP
......@@ -854,6 +856,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
NTATAG_SIPFLAGS_REF(flags),
NTATAG_RPORT_REF(rport),
NTATAG_SERVER_RPORT_REF(server_rport),
NTATAG_TCP_RPORT_REF(tcp_rport),
NTATAG_PRELOAD_REF(preload),
#ifdef TPTAG_THRPSIZE
/* If threadpool is enabled, start a separate "reaper thread" */
......@@ -992,6 +995,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
agent->sa_flags = flags & MSG_FLG_USERMASK;
agent->sa_rport = rport != 0;
agent->sa_server_rport = server_rport != 0;
agent->sa_tcp_rport = tcp_rport != 0;
agent->sa_preload = preload;
agent->sa_tport_threadpool = threadpool;
......@@ -1704,7 +1708,9 @@ int outgoing_insert_via(nta_outgoing_t *orq,
return -1;
if (orq->orq_method != sip_method_ack) {
if (self->sa_rport && !v->v_rport)
if (!v->v_rport &&
((self->sa_rport && v->v_protocol == sip_transport_udp) ||
(self->sa_tcp_rport && v->v_protocol == sip_transport_tcp)))
msg_header_add_param(msg_home(msg), v->v_common, "rport");
}
else {
......
......@@ -215,6 +215,8 @@ struct nta_agent_s
unsigned sa_rport:1;
/** If true, use rport at server */
unsigned sa_server_rport:1;
/** If true, use rport with tcp, too */
unsigned sa_tcp_rport:1;
/** If true, automatically create compartments */
unsigned sa_auto_comp:1;
......
......@@ -98,6 +98,7 @@ tag_typedef_t ntatag_use_timestamp = BOOLTAG_TYPEDEF(use_timestamp);
tag_typedef_t ntatag_sipflags = UINTTAG_TYPEDEF(sipflags);
tag_typedef_t ntatag_rport = BOOLTAG_TYPEDEF(rport);
tag_typedef_t ntatag_server_rport = BOOLTAG_TYPEDEF(server_rport);
tag_typedef_t ntatag_tcp_rport = BOOLTAG_TYPEDEF(tcp_rport);
tag_typedef_t ntatag_preload = UINTTAG_TYPEDEF(preload);
tag_typedef_t ntatag_use_naptr = BOOLTAG_TYPEDEF(naptr);
tag_typedef_t ntatag_use_srv = BOOLTAG_TYPEDEF(srv);
......
......@@ -407,6 +407,13 @@ NTA_DLL extern tag_typedef_t ntatag_server_rport;
NTA_DLL extern tag_typedef_t ntatag_server_rport_ref;
#define NTATAG_SERVER_RPORT_REF(x) ntatag_server_rport_ref, tag_bool_vr(&(x))
NTA_DLL extern tag_typedef_t ntatag_tcp_rport;
/** Use rport with TCP, too. @HI */
#define NTATAG_TCP_RPORT(x) ntatag_tcp_rport, tag_bool_v((x))
NTA_DLL extern tag_typedef_t ntatag_tcp_rport_ref;
#define NTATAG_TCP_RPORT_REF(x) ntatag_tcp_rport_ref, tag_bool_vr(&(x))
NTA_DLL extern tag_typedef_t ntatag_preload;
/** Preload by N bytes. @HI */
#define NTATAG_PRELOAD(x) ntatag_preload, tag_uint_v((x))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment