Commit 91eb7b36 authored by Pekka Pessi's avatar Pekka Pessi

nta.c: use user-provided CSeq if the request gets a new Call-ID

darcs-hash:20061222131949-65a35-5b8385ef48d269e554fcba3ad0c3ef60f7a0bdda.gz
parent 61b03200
......@@ -3074,13 +3074,6 @@ int nta_msg_request_complete(msg_t *msg,
if (!sip->sip_max_forwards)
sip_add_dup(msg, sip, (sip_header_t *)leg->leg_agent->sa_max_forwards);
if (!sip->sip_call_id) {
if (leg->leg_id)
sip->sip_call_id = sip_call_id_dup(home, leg->leg_id);
else
sip->sip_call_id = sip_call_id_create(home, NULL);
}
if (!sip->sip_from)
sip->sip_from = sip_from_dup(home, leg->leg_local);
else if (leg->leg_local && leg->leg_local->a_tag &&
......@@ -3113,7 +3106,10 @@ int nta_msg_request_complete(msg_t *msg,
method = sip->sip_request->rq_method;
method_name = sip->sip_request->rq_method_name;
if (method == sip_method_ack || method == sip_method_cancel)
if (!leg->leg_id && !sip->sip_call_id && sip->sip_cseq)
seq = sip->sip_cseq->cs_seq;
else if (method == sip_method_ack || method == sip_method_cancel)
/* Dangerous - we may do PRACK/UPDATE meanwhile */
seq = sip->sip_cseq ? sip->sip_cseq->cs_seq : leg->leg_seq;
else if (leg->leg_seq)
seq = ++leg->leg_seq;
......@@ -3122,6 +3118,13 @@ int nta_msg_request_complete(msg_t *msg,
else
seq = leg->leg_seq = (sip_now() >> 1) & 0x7ffffff;
if (!sip->sip_call_id) {
if (leg->leg_id)
sip->sip_call_id = sip_call_id_dup(home, leg->leg_id);
else
sip->sip_call_id = sip_call_id_create(home, NULL);
}
if ((!sip->sip_cseq ||
seq != sip->sip_cseq->cs_seq ||
method != sip->sip_cseq->cs_method ||
......
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