yeah! 100%.<br><br>Thanks Timo. Will work on this right away.<br><br>Cheers<br>Jason<br><br><div class="gmail_quote">On Wed, Aug 24, 2011 at 4:55 PM, Timo Reimann <span dir="ltr">&lt;<a href="mailto:timo.reimann@1und1.de">timo.reimann@1und1.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On <a href="tel:24.08.2011%2015" value="+12408201115">24.08.2011 15</a>:19, Jason Penton wrote:<br>
&gt; On Wed, Aug 24, 2011 at 2:45 PM, Timo Reimann &lt;<a href="mailto:timo.reimann@1und1.de">timo.reimann@1und1.de</a><br>
</div><div><div></div><div class="h5">&gt; &lt;mailto:<a href="mailto:timo.reimann@1und1.de">timo.reimann@1und1.de</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     &gt;&gt; My initial thought is to have some sort of direction identifiers<br>
&gt;     &gt;&gt; stored in the dialog structure itself. Then using Via and contact<br>
&gt;     &gt;&gt; headers we can make a pretty good assumption as to which &#39;end&#39; of the<br>
&gt;     &gt;&gt; spiral and therefore choose the correct dialog in the match<br>
&gt;     algorithm.<br>
&gt;<br>
&gt;     I am not quite sure if I understand how the &quot;ends&quot; of a spiral and the<br>
&gt;     available dialog structures in the hash table relate to each other. From<br>
&gt;     a technical perspective, the result of an (undetected) spiraled call is<br>
&gt;     just a second transaction on the same proxy mapping to the same call. No<br>
&gt;     matter whether a request arrives from one end (caller) or the other<br>
&gt;     (callee), the message will transition both transactions and thus relate<br>
&gt;     to the same dialog. AFAICS, that&#39;s no different to a non-spiraled call.<br>
&gt;<br>
&gt;<br>
&gt; Let me give you a scenario that may help this picture. Once again, IMS<br>
&gt; related ;)<br>
&gt;<br>
&gt; In IMS we have different proxies (called CSCFs - Call Session Control<br>
&gt; Functions). These can behave in &#39;terminating&#39; or &#39;originating&#39; mode. So<br>
&gt; for an example call between users on the same IMS network, it would look<br>
&gt; something like this:<br>
&gt;<br>
&gt; UA1  &lt;=a=&gt; PCSCF(Orig)  &lt;=b=&gt; SCSCF(Orig) &lt;=c=&gt; SCSCF(Term) &lt;=d=&gt;<br>
&gt; PCSCF(Term) &lt;=e=&gt; UA1<br>
&gt;<br>
&gt; So for an invite from UA1 to UA2 the INVITE will appear twice at the<br>
&gt; same PCSCF (assuming there is only one PCSCF in this case). This will<br>
&gt; result in spiraling on Kamailio right now, BUT there is no way to<br>
&gt; distinguish between the &#39;originating&#39; dialog and the &#39;terminating&#39;<br>
&gt; dialog. why is this a problem? well it would be nice to know in the<br>
&gt; config file in which mode you are in. I am sure there will be non ims<br>
&gt; related scenarios but I can think of any ;)<br>
<br>
</div></div>Gotcha.<br>
<br>
The only thing that tells dialogs on the two machines apart is varying<br>
transactions. So one approach to achieve what you seek is to include a<br>
transaction identifier in the dialog hash&#39;s computation. You already<br>
mentioned Via headers which seem like a viable option to me. In fact,<br>
using the top Via branch identifier should suffice. In addition, this<br>
shouldn&#39;t affect existing logic: Whether the top Via branch is included<br>
in the hash or not makes no difference regarding both use cases with<br>
spiral detection enabled and spiral-less ones.<br>
<div class="im"><br>
<br>
&gt;     If what you&#39;re interested in is simply the direction the request came<br>
&gt;     from you may evaluate the &quot;dir&quot; variable programmatically which is<br>
&gt;     passed as part of each dialog callback parameter structure.<br>
&gt;<br>
&gt;<br>
&gt; Because this wont be available in the config file AND the wrong dlg will<br>
&gt; be matched already at this point<br>
<br>
</div>Providing the direction information to the configuration script<br>
shouldn&#39;t be too hard.<br>
<br>
<br>
So after the proposed modifications, you could reference distinguishable<br>
dialogs per spiraled location and use the then-provided direction<br>
information in the script.<br>
<br>
Does that sound sound? :)<br>
<br>
<br>
Cheers,<br>
<font color="#888888"><br>
--Timo<br>
</font></blockquote></div><br>