]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3304 --resolve attended transfers, it fails to parse the Replaces when encoded
authorJeff Lenk <jeff@jefflenk.com>
Sat, 9 Jul 2011 03:48:11 +0000 (22:48 -0500)
committerJeff Lenk <jeff@jefflenk.com>
Sat, 9 Jul 2011 03:48:11 +0000 (22:48 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index 41cd10872b9c48e821befe77809fecbed2c23e78..ddb7f6dc3116ab0e6826f9d174125e678ac87b91 100644 (file)
@@ -6033,12 +6033,11 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
 
                                rep = switch_core_session_strdup(session, rep + 9);
 
-                               if ((p = strchr(rep, ';'))) {
-                                       *p = '\0';
-                               }
-
                                if ((buf = switch_core_session_alloc(session, strlen(rep) + 1))) {
                                        rep = url_unescape(buf, (const char *) rep);
+                                       if ((p = strchr(rep, ';'))) {
+                                               *p = '\0';
+                                       }
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Replaces: [%s]\n", rep);
                                } else {
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Memory Error!\n");