]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add accept-blind-auth
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 4 Mar 2008 01:23:55 +0000 (01:23 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 4 Mar 2008 01:23:55 +0000 (01:23 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7780 d0543943-73ff-0310-b7d9-9358b9ac24b2

conf/sip_profiles/default.xml
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c

index b9385ac1c59fdc2119fc4bed9e643d756193bdd5..a902758fd562f6ad9a8d7f73c0b5ea7c56ed9e05 100644 (file)
@@ -71,6 +71,9 @@
     <!-- this lets anything register -->
     <!--  comment the next line and uncomment one or both of the other 2 lines for call authentication -->
     <!-- <param name="accept-blind-reg" value="true"/> -->
+
+    <!-- accept any authentication without actually checking (not a good feature for most people) -->
+    <!-- <param name="accept-blind-auth" value="true"/> -->
     
     <!--TTL for nonce in sip auth-->
     <param name="nonce-ttl" value="60"/>
index 3c08a8a5ed0c07d10ca8374fe2f1dc13103fde1d..72b1efe8e3eae33aaf671085f48e6cc729cec1fc 100644 (file)
@@ -129,7 +129,8 @@ typedef enum {
        PFLAG_SUPRESS_CNG = (1 << 12),
        PFLAG_TLS = (1 << 13),
        PFLAG_CHECKUSER = (1 << 14),
-       PFLAG_SECURE = (1 << 15)
+       PFLAG_SECURE = (1 << 15),
+       PFLAG_BLIND_AUTH = (1 << 16)
 } PFLAGS;
 
 typedef enum {
index 609530b5f76551b60418c3c954cc6d28abc486d3..86e09db62282ea01b883e1b4856e054789c03c9e 100644 (file)
@@ -1099,6 +1099,10 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                if (switch_true(val)) {
                                                        profile->pflags |= PFLAG_BLIND_REG;
                                                }
+                                       } else if (!strcasecmp(var, "accept-blind-auth")) {
+                                               if (switch_true(val)) {
+                                                       profile->pflags |= PFLAG_BLIND_AUTH;
+                                               }
                                        } else if (!strcasecmp(var, "auth-all-packets")) {
                                                if (switch_true(val)) {
                                                        profile->pflags |= PFLAG_AUTH_ALL;
@@ -2374,7 +2378,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
        
        get_addr(network_ip, sizeof(network_ip), &((struct sockaddr_in *) my_addrinfo->ai_addr)->sin_addr);
 
-       if ((profile->pflags & PFLAG_AUTH_CALLS) || sip->sip_proxy_authorization || sip->sip_authorization) {
+       if ((profile->pflags & PFLAG_AUTH_CALLS) || (!(profile->pflags & PFLAG_BLIND_AUTH) && (sip->sip_proxy_authorization || sip->sip_authorization))) {
                if (strcmp(network_ip, profile->sipip)) {
                        if (sofia_reg_handle_register(nua, profile, nh, sip, REG_INVITE, key, sizeof(key), &v_event)) {
                                if (v_event) {