[asterisk-dev] SIP loop detection

Olle E Johansson olle at voop.com
Thu Nov 8 13:50:58 CST 2007


8 nov 2007 kl. 19.32 skrev Philipp Kempgen:

> Olle E Johansson wrote:
>> 8 nov 2007 kl. 16.11 skrev Philipp Kempgen:
>>
>>> ... in handle_request_invite() in chan_sip.c
>>> (same thing in 1.4.13 and trunk)
>>>
>>> ---cut---
>>> 	/* Check if this is a loop */
>>> 	if (ast_test_flag(&p->flags[0], SIP_OUTGOING) && p->owner && (p-
>>>> owner->_state != AST_STATE_UP)) {
>>> 		/* This is a call to ourself.  Send ourselves an error code and  
>>> stop
>>> 	   	processing immediately, as SIP really has no good mechanism for
>>> 	   	being able to call yourself */
>>> 		/* If pedantic is on, we need to check the tags. If they're
>>> different, this is
>>> 	   	in fact a forked call through a SIP proxy somewhere. */
>>> 		transmit_response(p, "482 Loop Detected", req);
>>> 		p->invitestate = INV_COMPLETED;
>>> 		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
>>> 		return 0;
>>> 	}
>>> ---cut---
>>>
>>> "If pedantic is on, we need to check the tags." -- is that a "FIXME"
>>> type of comment? I don't see any checks. Am I missing something?
>> That's a note to myself to remember to fix the whole issue. We do
>> check tags
>> in another part of the code now, if pedantic is on, and don't really
>> come here.
>
> Ok, thanks. Could you give my any hint as of where these checks
> are done or when they were introduced?
>
> We seem to experience a problem like the one in bug 7403.
> Without the loop detection code (see above) everything
> works fine.
Oh, those changes has been gradually inserted and improved upon.

I will have to check 7403.

/O



More information about the asterisk-dev mailing list