<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 77.95pt 1.0in 77.95pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Thanks,</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Neel</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> -----Original Message-----</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> From: asterisk-dev-bounces@lists.digium.com [mailto:asterisk-dev-</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> bounces@lists.digium.com] On Behalf Of Watkins, Bradley</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> Sent: </span></font>Tuesday, April 17, 2007 8:56 PM</p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> To: Asterisk Developers Mailing List</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> Subject: [asterisk-dev] Custom SIP headers and reinvites</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> There seems to be a timing-based issue with custom headers and</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> reinvites.</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> What happens is that if there is any kind of delay in processing a
call</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> to SIP_HEADER (e.g., the extension is in Realtime or you have a
Wait(x)</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> before Set), you lose access to the custom headers. In my
situation,</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> there is a pair of Asterisk boxes, with one calling the other (the
first</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> one having been called by a SIP phone). The first box
essentially</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> immediately issues a reinvite so that media is directly from the
phone</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> to the second Asterisk box. If dialplan execution is fast
enough, you</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> can successfully acquire the headers in the original invite.
But as</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> stated, any delay will cause the SIP_HEADER call to look for
headers in</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> the reinvite, and you lose since they aren't sent.</span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;color:black'> </span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;color:black'>The Re-INVITE cant be sent before the
original INVITE is completed. So, a INVITE – Final Response –
ACK should be done. So, in your case, the first Asterisk Box should wait
before issuing Re-INVITE.</span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;color:black'> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> I guess what I'm looking for is some guidance on what the correct</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> behavior is here. Obviously, these headers should be
available one way</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> or the other. The question is whether the reinvite should
have the</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> custom headers or whether they need to have some more persistant
storage</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> at the receiving end. I'm inclined to say the latter, as
it's possible</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> that you could have this same issue with other B2BUA's in a
similar</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> scenario.</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;color:black'> </span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;color:black'>The original INVITE transaction should
still hang around to handle any possible retransmits. The CSeq number should
help here, so that you are looking at the original INVITE as opposed to
Re-INVITE. </span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;color:black'> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> FWIW, this is the root cause for the bug I describe in:</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> http://bugs.digium.com/view.php?id=9516</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> I'm actually using Realtime, hence the description there (which
after</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> some more debugging on my end is quite misleading, I'm afraid),
but a</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> Wait(.5) using regular extensions.conf has the same effect.
Heck, I</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> tried Wait(.01) and it still happens, though I can't say with any
(and I</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> mean *any*) authority what Wait's resolution is. Of course,
YMMV</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> depending on the speed of system you're running the instances of</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> Asterisk on.</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> Regards,</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> - Brad</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> The contents of this e-mail are intended for the named addressee
only. It</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> contains information that may be confidential. Unless you are the
named</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> addressee or an authorized designee, you may not copy or use it,
or</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> disclose it to anyone else. If you received it in error please
notify us</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> immediately and then destroy it.</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> _______________________________________________</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> --Bandwidth and Colocation provided by Easynews.com --</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> </span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> asterisk-dev mailing list</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> To UNSUBSCRIBE or update options visit:</span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>> http://lists.digium.com/mailman/listinfo/asterisk-dev</span></font></p>
</div>
</body>
</html>