Hey Timo,<br><br><div class="gmail_quote">On Wed, Aug 24, 2011 at 2:45 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;">
Hey,<br>
<div class="im"><br>
<br>
On <a href="tel:24.08.2011%2013" value="+12408201113">24.08.2011 13</a>:38, marius zbihlei wrote:<br>
&gt; On 08/24/2011 02:32 PM, Jason Penton wrote:<br>
&gt;&gt; Hi Guys,<br>
&gt;&gt;<br>
&gt;&gt; Have been playing around with the dialog module and spiralling and one<br>
&gt;&gt; thing I have noticed is that if you spiral and dont have<br>
&gt;&gt; detect_spirals enabled the dialog module will create 2 dialogs. This<br>
&gt;&gt; is great and &#39;expected&#39; in this case. However, as it stands there is<br>
&gt;&gt; no way of distinguishing between the 2 dialogs. So for example, a BYE<br>
&gt;&gt; could come in from either &#39;side&#39; of the spiral and the first dialog is<br>
&gt;&gt; matched - not necessarily the correct one. this is because the match<br>
&gt;&gt; is purely done on callid, from and to tags (if using RFC3261 matching).<br>
<br>
</div>And for the record: It doesn&#39;t help if you switch to cookie-based<br>
matching (dlg_match_mode 0 or 1). Since cookies are implemented as<br>
hashed Call-IDs, two different dialogs spawn from a spiral situation<br>
still map to the same entry in the hash table.<br>
<div class="im"><br></div></blockquote><div><br>yes, sure<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
<br>
&gt;&gt; My initial thought is to have some sort of direction identifiers<br>
&gt;&gt; stored in the dialog structure itself. Then using Via and contact<br>
&gt;&gt; headers we can make a pretty good assumption as to which &#39;end&#39; of the<br>
&gt;&gt; spiral and therefore choose the correct dialog in the match algorithm.<br>
<br>
</div>I am not quite sure if I understand how the &quot;ends&quot; of a spiral and the<br>
available dialog structures in the hash table relate to each other. From<br>
a technical perspective, the result of an (undetected) spiraled call is<br>
just a second transaction on the same proxy mapping to the same call. No<br>
matter whether a request arrives from one end (caller) or the other<br>
(callee), the message will transition both transactions and thus relate<br>
to the same dialog. AFAICS, that&#39;s no different to a non-spiraled call.<br></blockquote><div><br>Let me give you a scenario that may help this picture. Once again, IMS related ;)<br><br>In IMS we have different proxies (called CSCFs - Call Session Control Functions). These can behave in &#39;terminating&#39; or &#39;originating&#39; mode. So for an example call between users on the same IMS network, it would look something like this:<br>
<br>UA1  &lt;=a=&gt; PCSCF(Orig)  &lt;=b=&gt; SCSCF(Orig) &lt;=c=&gt; SCSCF(Term) &lt;=d=&gt; PCSCF(Term) &lt;=e=&gt; UA1<br><br>So for an invite from UA1 to UA2 the INVITE will appear twice at the same PCSCF (assuming there is only one PCSCF in this case). This will result in spiraling on Kamailio right now, BUT there is no way to distinguish between the &#39;originating&#39; dialog and the &#39;terminating&#39; dialog. why is this a problem? well it would be nice to know in the config file in which mode you are in. I am sure there will be non ims related scenarios but I can think of any ;)<br>
<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
If what you&#39;re interested in is simply the direction the request came<br>
from you may evaluate the &quot;dir&quot; variable programmatically which is<br>
passed as part of each dialog callback parameter structure.<br></blockquote><div><br>Because this wont be available in the config file AND the wrong dlg will be matched already at this point <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im"><br>
<br>
&gt;&gt; some may say just enable spiral_detection. Actually, in some cases it<br>
&gt;&gt; is nice to be able to track a spiral in different dialogs, which most<br>
&gt;&gt; likely why the option to enable or disable spiral detection in the<br>
&gt;&gt; first place<br>
<br>
</div>In order to get a better feel for what you wish to accomplish, could you<br>
give an example of such a case?<br>
<br>
<br>
Cheers,<br>
<br>
--Timo<br>
<br>
_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
</blockquote></div><br>