[asterisk-dev] SIP loop detection

Olle E Johansson olle at voop.com
Thu Nov 8 11:08:23 CST 2007

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.

But there are other related issues still hanging around to fix.


More information about the asterisk-dev mailing list