]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5318 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 17 Apr 2013 20:58:10 +0000 (15:58 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 17 Apr 2013 20:58:15 +0000 (15:58 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index 922f6e8870e914cbcfc9a75450031190dccea342..9e1e57f0ad48f8cdaa1dcc6171509717fe621f13 100644 (file)
@@ -4419,9 +4419,18 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
                                        } else if (!strcasecmp(var, "tls")) {
                                                if (switch_true(val)) {
                                                        sofia_set_pflag(profile, PFLAG_TLS);
+                                                       if (profile->tls_bind_params) {
+                                                               profile->tls_bind_params = switch_core_sprintf(profile->pool, "%s;transport=tls", profile->tls_bind_params);
+                                                       } else {
+                                                               profile->tls_bind_params = switch_core_strdup(profile->pool, "transport=tls");
+                                                       }
                                                }
                                        } else if (!strcasecmp(var, "tls-bind-params")) {
-                                               profile->tls_bind_params = switch_core_strdup(profile->pool, val);
+                                               if (switch_stristr("transport=tls", val)) {
+                                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Transport is already set, not adding another one.\n");
+                                               } else {
+                                                       profile->tls_bind_params = switch_core_strdup(profile->pool, val);
+                                               }
                                        } else if (!strcasecmp(var, "tls-only")) {
                                                profile->tls_only = switch_true(val);
                                        } else if (!strcasecmp(var, "tls-verify-date")) {