Commit eeec8d84 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

nta.c: streamlined NTATAG_REL100() handling in nta_outgoing_*create()

darcs-hash:20070523182900-65a35-be013b255ea54ff468a740c5ba562c22e69813eb.gz
parent 8a87d8e9
...@@ -6754,6 +6754,8 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent, ...@@ -6754,6 +6754,8 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
char const *scheme = NULL; char const *scheme = NULL;
char const *port = NULL; char const *port = NULL;
int invalid, resolved, stateless = 0, user_via = agent->sa_user_via; int invalid, resolved, stateless = 0, user_via = agent->sa_user_via;
int invite_100rel = agent->sa_invite_100rel;
tagi_t const *t; tagi_t const *t;
tport_t const *override_tport = NULL; tport_t const *override_tport = NULL;
...@@ -6818,6 +6820,9 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent, ...@@ -6818,6 +6820,9 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
else if (ntatag_tport == tt) { else if (ntatag_tport == tt) {
override_tport = (tport_t *)t->t_value; override_tport = (tport_t *)t->t_value;
} }
else if (ntatag_rel100 == tt) {
invite_100rel = t->t_value != 0;
}
} }
orq->orq_agent = agent; orq->orq_agent = agent;
...@@ -6839,6 +6844,8 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent, ...@@ -6839,6 +6844,8 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
orq->orq_delay = UINT_MAX; orq->orq_delay = UINT_MAX;
orq->orq_stateless = stateless != 0; orq->orq_stateless = stateless != 0;
orq->orq_user_via = user_via != 0 && sip->sip_via; orq->orq_user_via = user_via != 0 && sip->sip_via;
orq->orq_100rel = invite_100rel;
if (cc) if (cc)
orq->orq_cc = nta_compartment_ref(cc); orq->orq_cc = nta_compartment_ref(cc);
...@@ -7373,17 +7380,18 @@ int outgoing_features(nta_agent_t *agent, nta_outgoing_t *orq, ...@@ -7373,17 +7380,18 @@ int outgoing_features(nta_agent_t *agent, nta_outgoing_t *orq,
supported[i = 0] = NULL; supported[i = 0] = NULL;
if (orq->orq_method == sip_method_invite) { if (orq->orq_method == sip_method_invite) {
int add_100rel = agent->sa_invite_100rel;
int require_100rel = sip_has_feature(sip->sip_require, "100rel"); int require_100rel = sip_has_feature(sip->sip_require, "100rel");
tl_gets(tags, if (require_100rel) {
NTATAG_REL100_REF(add_100rel), orq->orq_must_100rel = 1;
TAG_END()); orq->orq_100rel = 1;
if (add_100rel && !require_100rel && }
!sip_has_feature(sip->sip_supported, "100rel")) else if (sip_has_feature(sip->sip_supported, "100rel")) {
supported[i++] = "100rel"; orq->orq_100rel = 1;
}
orq->orq_must_100rel = require_100rel; else if (orq->orq_100rel) {
supported[i++] = "100rel";
}
} }
if (i) { if (i) {
......
...@@ -517,6 +517,7 @@ struct nta_outgoing_s ...@@ -517,6 +517,7 @@ struct nta_outgoing_s
unsigned orq_sigcomp_zap:1; /**< Reset SigComp after completing */ unsigned orq_sigcomp_zap:1; /**< Reset SigComp after completing */
unsigned orq_must_100rel : 1; unsigned orq_must_100rel : 1;
unsigned orq_timestamp : 1; /**< Insert @Timestamp header. */ unsigned orq_timestamp : 1; /**< Insert @Timestamp header. */
unsigned orq_100rel:1; /**< Support 100rel */
unsigned : 0; /* pad */ unsigned : 0; /* pad */
#if HAVE_SOFIA_SRESOLV #if HAVE_SOFIA_SRESOLV
......
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