From 99c68e87991d061606b4110bda0f5e22dfdf03a6 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 4 Mar 2008 01:23:55 +0000 Subject: [PATCH] add accept-blind-auth git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7780 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- conf/sip_profiles/default.xml | 3 +++ src/mod/endpoints/mod_sofia/mod_sofia.h | 3 ++- src/mod/endpoints/mod_sofia/sofia.c | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/conf/sip_profiles/default.xml b/conf/sip_profiles/default.xml index b9385ac1c5..a902758fd5 100644 --- a/conf/sip_profiles/default.xml +++ b/conf/sip_profiles/default.xml @@ -71,6 +71,9 @@ + + + diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 3c08a8a5ed..72b1efe8e3 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -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 { diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 609530b5f7..86e09db622 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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) {