Summary:ASTERISK-00490: [patch] Handling of a 302 Redirect should be configurable
Reporter:cheiser (cheiser)Labels:
Date Opened:2003-11-06 08:29:41.000-0600Date Closed:2011-06-07 14:04:48
Versions:Frequency of
Environment:Attachments:( 0) chan_sip.c-fwdcontext.patch
Description:Currently it seems that Asterisk behaves in the following manner.

User A with context = acon
User B with context = bcon

User A makes a call.
Asterisk processes extensions.conf starting at context "acon" Invite goes to User B. User B throws a 302 Redirect.
It seems now Asterisk starts processing extensions.conf over starting at context "bcon"

It would seem to me that this behavior could be undesirable in a PBX situation where the administrator only wants to allow users to forward their phone to SIP endpoints and not to PSTN destinations.  I know I didn't want to eat 2 channels on a CAS link because a user forwarded his/her desk phone to their cell phone.

To solve this, I added a configuration parameter to sip.conf called fwdcontext
Basically, if fwdcontext is undefined for a user, the above mentioned processing holds true.  However, if fwdcontext is defined, then when Asterisk gets that 302 Redirect from User B, it will start processing extensions.conf starting at the context defined by fwdcontext instead
of User B's context.

A Patch is attached.
Comments:By: jrollyson (jrollyson) 2004-01-11 01:24:33.000-0600

IMHO This is something I think would be good for security reasons, and should be applied to anywhere where we support or enable transfers.

By: Brian West (bkw918) 2004-01-26 23:19:20.000-0600

Can you update this to only apply to type=peer or type=friend or can you explain why you think it should also apply to type=user.  Can you also update the example config and has this been disclaimed?

By: Olle Johansson (oej) 2004-03-19 04:19:37.000-0600

Is this disclaimed or in limbo?

By: Olle Johansson (oej) 2004-03-21 03:54:29.000-0600

This bug needs to be moved forward. Please answer or we have to close it until we see life signs again :-)

By: Olle Johansson (oej) 2004-03-21 04:48:56.000-0600

We need to join this patch with 0000730, better handling of SIP redirects

By: Olle Johansson (oej) 2004-03-25 17:09:24.000-0600

Discussion move to # 730.