]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3863 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 1 Feb 2012 22:44:18 +0000 (16:44 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 1 Feb 2012 22:44:26 +0000 (16:44 -0600)
src/mod/endpoints/mod_sofia/sofia_presence.c

index 30d5ba7888fe534d2d081e68de82efb26c849a21..3b7391351015bfd79bcde6d1220062051da1d2cd 100644 (file)
@@ -461,8 +461,8 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
                        char buf[512] = "";
                        switch_console_callback_match_t *matches;
 
-                       sql = switch_mprintf("select profile_name from sip_registrations where hostname='%q' and profile_name='%q' and (sip_host='%s' or mwi_host='%s')", 
-                                                                mod_sofia_globals.hostname, profile->name, host, host);
+                       sql = switch_mprintf("select profile_name from sip_registrations where hostname='%q' and (sip_host='%s' or mwi_host='%s')", 
+                                                                mod_sofia_globals.hostname, host, host);
 
                        if (list_profiles_full(NULL, NULL, &matches, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
                                switch_console_callback_match_node_t *m;
@@ -481,7 +481,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
                                switch_console_free_matches(&matches);
                        }
 
-                       
+                       switch_safe_free(sql);
 
                        if (!(profile = sofia_glue_find_profile(buf))) {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find profile %s\n", switch_str_nil(host));