]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix MODAPP-126
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 13 Aug 2008 17:24:33 +0000 (17:24 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 13 Aug 2008 17:24:33 +0000 (17:24 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9287 d0543943-73ff-0310-b7d9-9358b9ac24b2

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

index 81752ca22849ed49853d00f96636f71b5e1d0d09..5095bc577f4177db2c533fa4cfbc7b646a8a96c8 100644 (file)
@@ -1274,7 +1274,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
                        if ((argv[1]) && (profile = sofia_glue_find_profile(argv[1]))) {
                                stream->write_function(stream, "%s\n", line);
                                stream->write_function(stream, "Name          \t\t%s\n", switch_str_nil(argv[1]));
-                               stream->write_function(stream, "Domain Name   \t\t%s\n", switch_str_nil(profile->domain_name));
+                               stream->write_function(stream, "Domain Name   \t\t%s\n", profile->domain_name ? profile->domain_name : "N/A");
                                if (strcasecmp(argv[1], profile->name)) {
                                        stream->write_function(stream, "Alias Of      \t\t%s\n", switch_str_nil(profile->name));
                                }
@@ -1296,7 +1296,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
                                        stream->write_function(stream, "TLS-URL      \t\t%s\n", switch_str_nil(profile->tls_url));
                                        stream->write_function(stream, "TLS-BIND-URL      \t%s\n", switch_str_nil(profile->tls_bindurl));
                                }
-                               stream->write_function(stream, "HOLD-MUSIC    \t\t%s\n", switch_strlen_zero(profile->hold_music) ? "NONE" : profile->hold_music);
+                               stream->write_function(stream, "HOLD-MUSIC    \t\t%s\n", switch_strlen_zero(profile->hold_music) ? "N/A" : profile->hold_music);
                                stream->write_function(stream, "CODECS        \t\t%s\n", switch_str_nil(profile->codec_string));
                                stream->write_function(stream, "TEL-EVENT     \t\t%d\n", profile->te);
                                if (profile->dtmf_type == DTMF_2833) {
index fc94fa40083ff475c9fd7746fea45f9bf187b9d4..d32863096332a5b578c66820ed098a575638ee4f 100644 (file)
@@ -994,6 +994,7 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
        if ((profiles = switch_xml_child(cfg, "profiles"))) {
                for (xprofile = switch_xml_child(profiles, "profile"); xprofile; xprofile = xprofile->next) {
                        char *xprofilename = (char *) switch_xml_attr_soft(xprofile, "name");
+                       char *xprofiledomain = (char *) switch_xml_attr(xprofile, "domain");
 
                        if (strcasecmp(profile->name, xprofilename)) {
                                continue;
@@ -1004,6 +1005,10 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                        profile->acl_count = 0;
                        profile->pflags |= PFLAG_STUN_ENABLED;
 
+                       if (xprofiledomain) {
+                               profile->domain_name = switch_core_strdup(profile->pool, xprofiledomain);
+                       }
+
                        if ((settings = switch_xml_child(xprofile, "settings"))) {
                                for (param = switch_xml_child(settings, "param"); param; param = param->next) {
                                        char *var = (char *) switch_xml_attr_soft(param, "name");
@@ -1377,8 +1382,6 @@ switch_status_t config_sofia(int reload, char *profile_name)
 
                                if (xprofiledomain) {
                                        profile->domain_name = switch_core_strdup(profile->pool, xprofiledomain);
-                               } else {
-                                       profile->domain_name = profile->name;
                                }
 
                                profile->dbname = switch_core_strdup(profile->pool, url);
index 94f570497cfb3550701d4ea42aa5fde59d946554..ecd45e77c665bfab390063cc3b0a1dd57ad659d1 100644 (file)
@@ -248,7 +248,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
                }
        }
 
-       if (profile->domain_name && profile->domain_name != host) {
+       if (profile->domain_name && strcasecmp(profile->domain_name, host)) {
                host = profile->domain_name;
        }