I've taken a stab at fixing the issues I reported earlier and have
come up with a solution for one of them. The attached patches address
the issue of not being able to use a user specified RSeq header when
1XX answers are sent reliably.
I'm not sure this is the best way to solve this issue, so someone
please review them. Also, sorry if the naming conventions are not
coherent with the rest of the code. Anyway, it works for me.
Additionally, I've figured out the other issue and the difference
between responding with 180 or 183. Turns out simply including and SDP
in the 180 response is not enough for the stack to understand it as
early media, I have to set NUTAG_EARLY_MEDIA() as well. In this case,
the 180 answer is not sent reliably and the RSeq header supplied by
the application is used as expected. But the associated nta_incoming_t
structure is not updated, and the PRACK is refused with 481. I've not
yet looked into this one.
Thanks.

On Wed, Jun 18, 2008 at 10:28 AM, Fabio Margarido
<[EMAIL PROTECTED]> wrote:
> OK, I believe this has turned into a bug in the stack. I've noticed
> some more details:
>
> - When I send a 183 response with nua_respond() containing
> SIPTAG_RSEQ() or SIPTAG_RSEQ_STR() the stack disregards my RSeq and
> uses its own, and PRACK is treated correctly;
> - When I send a 180 response in exactly the same way the stack uses my
> supplied RSeq in the response, but when a PRACK is received with a
> RAck header containing the number I supplied in the response RSeq,
> sofia responds to the PRACK with '481 No Such Response'. I believe the
> RSeq value internally stored with the leg information is not updated
> when RSeq is supplied.
>
> Is there a reason 183 and 180 are treated differently in this situation?
> Thanks.
>
>
--- nua_session.c	2008-06-05 12:33:41.000000000 -0300
+++ nua_session.c.new	2008-06-25 16:32:25.000000000 -0300
@@ -2278,6 +2278,15 @@
   }
 
   if (reliable && sr->sr_status < 200) {
+    tagi_t const *t = tl_find_last(tags, siptag_rseq);
+    if (t)
+      incoming_override_rseq(sr->sr_irq, ((sip_rseq_t *)t->t_value)->rs_response);
+    else {
+      t = tl_find_last(tags, siptag_rseq_str);
+      if (t)
+	incoming_override_rseq(sr->sr_irq, strtoul((const char *)t->t_value, NULL, 10));
+    }
+
     sr->sr_response.msg = NULL, sr->sr_response.sip = NULL;
     if (nta_reliable_mreply(sr->sr_irq, process_prack, sr, msg) == NULL)
       return -1;
--- nta.c	2008-06-04 05:57:28.000000000 -0300
+++ nta.c.new	2008-06-25 16:37:30.000000000 -0300
@@ -10955,3 +10955,9 @@
 
   return 0;
 }
+
+void incoming_override_rseq(nta_incoming_t *irq, uint32_t rseq)
+{
+  if (irq != NULL)
+    irq->irq_rseq = rseq;
+}
--- nta.h	2008-05-26 09:25:11.000000000 -0300
+++ nta.h.new	2008-06-25 16:39:19.000000000 -0300
@@ -323,6 +323,8 @@
 
 SOFIAPUBFUN void nta_incoming_destroy(nta_incoming_t *irq);
 
+SOFIAPUBFUN void incoming_override_rseq(nta_incoming_t *irq, uint32_t rseq);
+
 /* Functions for feature, method, mime, session-timer negotation */
 
 SOFIAPUBFUN
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to