Summary:ASTERISK-14052: [patch] Patch that makes chan_sip check if the forward domain is itself on a 302 response
Reporter:Brent Thomson (_brent_)Labels:
Date Opened:2009-05-01 16:11:36Date Closed:2011-07-26 14:17:40
Versions:Frequency of
Environment:Attachments:( 0) domain_forward.patch
Description:With promiscredir=yes in sip.conf, Asterisk assumes that *all* forwards are non-local and attempts to send them out over the wire. If the domain is one that Asterisk is configured to accept, the call comes back (hairpin) and Asterisk changes it to a forward in an attempt to handle the hairpin.

This patch changes chan_sip to make it check if the domain is one that it handles before blindly sending the forward out on the wire. If promiscredir is set, it *is* a local domain, and either the domain has a context set or the global variable FORWARD_CONTEXT is set, the forward is sent to Local/user@context instead of SIP/user@domain.


To reiterate, the following have to be true in order for this to do anything:

- promiscredir=yes
- 302 forward is received for a local domain
- either the domain has a context or FORWARD_CONTEXT is set
Comments:By: Leif Madsen (lmadsen) 2009-09-18 09:11:28

I'm setting this as Ready for Testing, and assigning it to oej just to review this functionality, and advise the reporter on how best to proceed forward (or perhaps this is the best way forward, in which just a thumbs up will be required).


By: Olle Johansson (oej) 2009-09-18 09:14:35

I really think that we should remove promiscredir support. All calls need to go through the dialplan and this function breaks that paradigm. We do set SIPdomain on 302 without promiscredir so you can handle this through a normal dialplan context (FORWARD_CONTEXT).

I'd rather fix this by totally removing the promiscredir support.

By: Brent Thomson (_brent_) 2009-09-30 20:41:26

This function actually make the redirects pass back through the dial plan, starting in the context associated with the domain (if handled locally).

It's been a while and I don't remember what issue turning on promiscredir fixed, but I'll poke at it again. In either case, if the promiscredir functionality isn't removed altogether, this is probably a valuable fix.

By: Olle Johansson (oej) 2009-10-01 02:09:36

Kevin and I have agreed on removing promsicredir. So we will have to check that we have proper functionality with 302s through the dialplan before that. If you can help us checking this, it will be appreciated :-)


By: Brent Thomson (_brent_) 2009-10-01 09:23:35

I'll try my setup w/o promiscredir.

By: Leif Madsen (lmadsen) 2011-07-26 14:17:34.418-0500

Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.4 and 1.6.x branches has ended. For continued maintenance support please move to the 1.8 branch which is a long term support (LTS) branch. For more information about branch support, please see https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions

If this is still an issue, please open a new issue so it can be re-triaged appropriately. Thanks!