493: Undecipherable

-Blog-

-Projects-

-About me-

-RSS-

Disable Asterisk call loop detection: SIP 482 check

Dennis Guse

UPDATE: This patch is not required on Asterisk 11.7 upwards.

Asterisk 1.8 does not allow to loop sip calls. This is in fact the correct behavior as specified in the SIP RFC. However, in some cases this might be very well the behavior that someone wants. What loop detection prevents is essentially that an Asterisk instance does not accept an incoming call that was triggered by himself. This might be necessary, if the Asterisk:

How to disable loop detection There is no default option provided to deactivate this feature (as this should only be done, if you know what you are doing). Loop detection is done in

channel/chan_sip.c in function handle_request_invite(…)

On line 22325 (Asterisk 1.8) a check is done, if loop detection should be done. You can also search for 482 Loop Detected. If this if-statement is disabled (add 0 == 1 &&) or removed, no loop detection will be done. Re-compile and install as I described here.

I am using Asterisk for Transcoding twice in the same instance.

Basically Asterisk fowards an incoming SIP-call to himself (setting SIP_CODEC_OUTBOUND to whatever I needed) and then relays the call to the callee:

Caller Client –(slin) -> Asterisk –(whatever) -> Asterisk –(slin) -> Callee Client