]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
NDLB-force-rport option
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 5 Jun 2008 15:55:06 +0000 (15:55 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 5 Jun 2008 15:55:06 +0000 (15:55 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8764 d0543943-73ff-0310-b7d9-9358b9ac24b2

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

index bd0aa5fe076d640f13b44b54acfa231cfbfb9419..2d9a738b2d724bf734e2dcbfe22d671404dd14b1 100644 (file)
@@ -338,7 +338,7 @@ struct sofia_profile {
        uint32_t reg_acl_count;
        char *nat_acl[SOFIA_MAX_ACL];
        uint32_t nat_acl_count;
-
+       int rport_level;
 };
 
 struct private_object {
index e4ec07b4192298f1e85ddb49e624f0326cc419df..ebe04e77c65fe639e532406cb3a88b383226b49b 100644 (file)
@@ -526,7 +526,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
        profile->nua = nua_create(profile->s_root,      /* Event loop */
                                                          sofia_event_callback, /* Callback for processing events */
                                                          profile,      /* Additional data to pass to callback */
-                                                         NUTAG_URL(profile->bindurl), TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), NUTAG_SIPS_URL(profile->tls_bindurl)), 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)), NTATAG_UDP_MTU(65536), NTATAG_SERVER_RPORT(2), TAG_IF(tportlog, TPTAG_LOG(1)), TAG_END());        /* Last tag should always finish the sequence */
+                                                         NUTAG_URL(profile->bindurl), TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), NUTAG_SIPS_URL(profile->tls_bindurl)), 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)), NTATAG_UDP_MTU(65536), NTATAG_SERVER_RPORT(profile->rport_level), TAG_IF(tportlog, TPTAG_LOG(1)), TAG_END());     /* Last tag should always finish the sequence */
 
        if (!profile->nua) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Creating SIP UA for profile: %s\n", profile->name);
@@ -1047,7 +1047,8 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                profile->dtmf_duration = 100;
                                profile->tls_version = 0;
                                profile->mflags = MFLAG_REFER | MFLAG_REGISTER;
-
+                               profile->rport_level = 1;
+                               
                                for (param = switch_xml_child(settings, "param"); param; param = param->next) {
                                        char *var = (char *) switch_xml_attr_soft(param, "name");
                                        char *val = (char *) switch_xml_attr_soft(param, "value");
@@ -1080,6 +1081,8 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                } else {
                                                        profile->dtmf_type = DTMF_NONE;
                                                }
+                                       } else if (!strcasecmp(var, "NDLB-force-rport")) {
+                                               profile->rport_level = 2;
                                        } else if (!strcasecmp(var, "record-template")) {
                                                profile->record_template = switch_core_strdup(profile->pool, val);;
                                        } else if (!strcasecmp(var, "inbound-no-media") && switch_true(val)) {