[asterisk-dev] SIP loop detection

Philipp Kempgen philipp.kempgen at amooma.de
Thu Nov 8 12:32:52 CST 2007


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.

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
    Let's use IT to solve problems and not to create new ones.
          Asterisk? -> http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998



More information about the asterisk-dev mailing list