Hi, <br><br>I think it should be there in Asterisk. I just want to know how Asterisk implements this and where does it implement it.<br><br>Regards<br><br>Arpit<br><br><div><span class="gmail_quote">On 4/1/07, <b class="gmail_sendername">
Steve Totaro</b> &lt;<a href="mailto:stotaro@totarotechnologies.com">stotaro@totarotechnologies.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The scenario you describe is *extremely easy* to setup and test.&nbsp;&nbsp;I am<br>sure, you will find that there is no loop detection and if you watch the<br>console with any level of verbose, it will continue to scroll very<br>rapidly down the screen.
<br><br>Maybe RDNIS could be used to back track one extra level of forwarding,<br>other than that, I do not believe there is any mechanism to prevent this.<br><br>What is your fear or what are you thinking is a problem?&nbsp;&nbsp;Do you see
<br>this causing so much activity that it slows or crashes a server?&nbsp;&nbsp;Why<br>not try it and see?<br><br>Thanks,<br>Steve<br><br>Arpit Mehta wrote:<br>&gt; Hi,<br>&gt;<br>&gt; Thanks. That was useful. But it is more like calling myself and hence
<br>&gt; making a loop.<br>&gt;<br>&gt; I was thinking of how Asterisk detects a loop where more than one<br>&gt; participants are involved. Also whether for detection of the loop,<br>&gt; Asterisk will require to store and receive information from the
<br>&gt; calling person that all these numbers have been call forwarded to<br>&gt; since that will be needed to find out whether or not you are call<br>&gt; forwarding to the same person.<br>&gt;<br>&gt; Thanks<br>&gt;<br>
&gt; Regards<br>&gt;<br>&gt; Arpit<br>&gt;<br>&gt; On 4/1/07, *Leif Madsen* &lt;<a href="mailto:leif.madsen@asteriskdocs.org">leif.madsen@asteriskdocs.org</a><br>&gt; &lt;mailto:<a href="mailto:leif.madsen@asteriskdocs.org">
leif.madsen@asteriskdocs.org</a>&gt;&gt; wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; On Sunday 01 April 2007 03:34:53 Arpit Mehta wrote:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; I just want to know if Asterisk handles a looping case and where<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; does it
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; handle that .<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; A--&gt; B --&gt; C--&gt; D --&gt; B<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; If A calls&nbsp;&nbsp;B ,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp; B call fwds to C ,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp; C call fwds to D ,
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp; D call fwds to B . Now there is a loop .<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; How does asterisk prevent this loop? I just to know where (as in<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; which<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; module in the Asterisk source code) and how is this prevented
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; (that is if a<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; data structure of all the numbers that it has call fwded to is<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; passed on to<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; B,C,D so that it can detect a loop)?<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Thanks. I hope you understand my scenario. Any suggestions are
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; welcome.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; As far I might understand it, Asterisk would basically parse the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Via: headers<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; to determine where the call was coming from, and if it detected a<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; loop,
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; *should* handle that (this does seem like a loop, and not a spiral).<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I&#39;ll have to defer this to the SIP experts and C experts, but<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; basically here<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; is the code that chan_sip.c (at line 13185 of my chan_sip.c file)
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; that checks<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; for the loop:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Check if this is a loop */<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (ast_test_flag(&amp;p-&gt;flags[0], SIP_OUTGOING) &amp;&amp; p-&gt;owner &amp;&amp;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; (p-&gt;owner-&gt;_state != AST_STATE_UP)) {
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* This is a call to ourself.&nbsp;&nbsp;Send ourselves an<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; error code<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; and stop<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; processing immediately, as SIP really has no good<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; mechanism
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; for<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; being able to call yourself */<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* If pedantic is on, we need to check the tags.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; If they&#39;re<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; different, this is<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in fact a forked call through a SIP proxy
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; somewhere. */<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; transmit_response(p, &quot;482 Loop Detected&quot;, req);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p-&gt;invitestate = INV_COMPLETED;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Leif Madsen.<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Arpit Mehta<br>&gt; Graduate Student<br>&gt; Department of Computer Science<br>
&gt; Columbia University<br>&gt;<br>&gt; Tel: 1-646-387-5998<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________<br>&gt; --Bandwidth and Colocation provided by 
<a href="http://Easynews.com">Easynews.com</a> --<br>&gt;<br>&gt; asterisk-dev mailing list<br>&gt; To UNSUBSCRIBE or update options visit:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev
</a><br>&gt;<br><br></blockquote></div><br><br clear="all"><br>-- <br>Arpit Mehta<br>Graduate Student<br>Department of Computer Science<br>Columbia University<br><br>Tel: 1-646-387-5998