]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODENDP-183 Add disable-srv and disable-naptr params to sip profiles (default false)
authorMathieu Rene <mrene@avgs.ca>
Sun, 8 Feb 2009 00:38:48 +0000 (00:38 +0000)
committerMathieu Rene <mrene@avgs.ca>
Sun, 8 Feb 2009 00:38:48 +0000 (00:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11683 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c

index 47d5a9e3bd7b7aa87b4f078422f81617b5528b50..83eb9791abbbb7beb3309e93fce6c75865356917 100644 (file)
@@ -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 {
index 1b68100a8562a4b9ca14e0957eb0c1638460b12e..666ca7de80584535e38e2ab9a2233c94da438110 100644 (file)
@@ -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;