]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make display in contact compat with broken aastra
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 17 Jul 2013 21:35:24 +0000 (16:35 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 17 Jul 2013 21:35:24 +0000 (16:35 -0500)
src/mod/endpoints/mod_sofia/sofia_reg.c

index aba34a321d5a7898db4e9f48958fa9b3f617a0e4..d45896a1a7c342f069fbad3dd5399393f57553d9 100644 (file)
@@ -1135,6 +1135,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
        const char *to_host = NULL;
        char *mwi_account = NULL;
        char *dup_mwi_account = NULL;
+       char *display_m = NULL;
        char *mwi_user = NULL;
        char *mwi_host = NULL;
        char *var = NULL;
@@ -1320,11 +1321,17 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
                        if (to) {
                                display = to->a_display;
                                if (zstr(display)) {
-                                       display = "\"user\"";
+                                       display = "\"\"";
                                }
                        }
                }
 
+               if (display && !strchr(display, '"')) {
+                       display_m = switch_mprintf("\"%q\"", display);
+                       display = display_m;
+               }
+
+
                if (sip->sip_path) {
                        path_val = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_path);
                        path_encoded_len = (int)(strlen(path_val) * 3) + 1;
@@ -2023,6 +2030,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
 
 
   end:
+       switch_safe_free(display_m);
        switch_safe_free(dup_mwi_account);
        switch_safe_free(utmp);