From 1e23c65e3ed233f35fa836cfbbc119eb71b81451 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Sun, 8 Feb 2009 00:38:48 +0000 Subject: [PATCH] MODENDP-183 Add disable-srv and disable-naptr params to sip profiles (default false) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11683 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/mod_sofia.h | 2 ++ src/mod/endpoints/mod_sofia/sofia.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 47d5a9e3bd..83eb9791ab 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -441,6 +441,8 @@ struct sofia_profile { uint32_t force_subscription_expires; switch_rtp_bug_flag_t auto_rtp_bugs; char manage_shared_appearance; /* pflags was all full up - MTK */ + char disable_srv; + char disable_naptr; }; struct private_object { diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 1b68100a85..666ca7de80 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -728,6 +728,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), NUTAG_CERTIFICATE_DIR(profile->tls_cert_dir)), TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), TPTAG_TLS_VERSION(profile->tls_version)), TAG_IF(!strchr(profile->sipip, ':'), NTATAG_UDP_MTU(65535)), + TAG_IF(profile->disable_srv, NTATAG_USE_SRV(0)), + TAG_IF(profile->disable_naptr, NTATAG_USE_NAPTR(0)), NTATAG_SERVER_RPORT(profile->rport_level), TAG_IF(tportlog, TPTAG_LOG(1)), TAG_END()); /* Last tag should always finish the sequence */ @@ -1798,6 +1800,9 @@ switch_status_t config_sofia(int reload, char *profile_name) profile->pflags |= PFLAG_STUN_ENABLED; profile->pflags |= PFLAG_DISABLE_100REL; profile->auto_restart = 1; + profile->manage_shared_appearance = 0; /* Initialize default */ + profile->disable_srv = 0; + profile->disable_naptr = 0; for (param = switch_xml_child(settings, "param"); param; param = param->next) { char *var = (char *) switch_xml_attr_soft(param, "name"); @@ -2016,6 +2021,14 @@ switch_status_t config_sofia(int reload, char *profile_name) profile->manage_shared_appearance = 1; profile->sla_contact = switch_core_sprintf(profile->pool, "sip:sla-agent@%s", profile->sipip); } + } else if (!strcasecmp(var, "disable-srv")) { + if (switch_true(val)) { + profile->disable_srv = 1; + } + } else if (!strcasecmp(var, "disable-naptr")) { + if (switch_true(val)) { + profile->disable_naptr = 1; + } } else if (!strcasecmp(var, "unregister-on-options-fail")) { if (switch_true(val)) { profile->pflags |= PFLAG_UNREG_OPTIONS_FAIL;