[asterisk-bugs] [Asterisk 0011361]: [patch] serving multiple Realms with one Asterisk

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Aug 6 12:23:17 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=11361 
====================================================================== 
Reported By:                arkadia
Assigned To:                mnicholson
====================================================================== 
Project:                    Asterisk
Issue ID:                   11361
Category:                   Channels/chan_sip/NewFeature
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Target Version:             1.6.4.0
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2007-11-23 16:05 CST
Last Modified:              2009-08-06 12:23 CDT
====================================================================== 
Summary:                    [patch] serving multiple Realms with one Asterisk
Description: 
When the call comes to Asterisk it responds with authorization request
using specified realm (realm in config, global_realm in code).

OpenSER for this case has possibility to auto generate realm based on
"From" header:

if (!proxy_authorize("", "subscriber)) {
        proxy_challenge("", "1");  # Realm will be autogenerated
};

proxy_authorize(realm, table)
    * realm - Realm is a opaque string that the user agent
       should present to the user so he can decide what username
       and password to use. Usually this is domain of the host
       the server is running on.
       If an empty string "" is used then the server will
       generate it from the request. From header field domain
       will be used as realm.
       The string may contain pseudo variables.

This patch provides the same possibility for Asterisk. It is not user/peer
based.


====================================================================== 

---------------------------------------------------------------------- 
 (0108725) arkadia (reporter) - 2009-08-06 12:23
 https://issues.asterisk.org/view.php?id=11361#c108725 
---------------------------------------------------------------------- 
I've tested your patch for the trunk and it works fine.
I've modified it a little bit:

1. Comment for DEFAULT_DOMAINSASREALM clarified.

2. If realm wasn't found in From field we try to extract it from 'To'
field.
This addition was added some time ago to my production servers course some
clients user their our domain in from field. E.g. Linphone.
And in this case proper real is stored in 'To'.

Tested patch uploaded 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-08-06 12:23 arkadia        Note Added: 0108725                          
======================================================================




More information about the asterisk-bugs mailing list