a_id = switch_strip_whitespace(duped);
- if (zstr(a_id)) return;
+ if (zstr(a_id)) {
+ goto end;
+ }
p = strchr(a_id, ';');
if (p) *p = '\0';
if (!sofia_glue_is_valid_session_uuid(a_id)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Session-ID: Ignoring \"%s\" parsed as \"%s\"\n", header, a_id);
- return;
+ goto end;
}
/* RFC7329 compatibility */
if (!p) {
switch_channel_set_flag(channel, CF_RFC7329_COMPAT);
switch_channel_set_flag_partner(channel, CF_RFC7329_COMPAT);
- return;
+ goto end;
}
p++;
remote_param = strstr(p, "remote=");
switch_channel_set_flag(channel, CF_RFC7329_COMPAT);
switch_channel_set_flag_partner(channel, CF_RFC7329_COMPAT);
sofia_glue_check_filter_generic_params(session, profile, p);
- return;
+ goto end;
}
b_id = remote_param + 7;
if (!zstr(b_id) && strlen(b_id) == RFC7989_SESSION_UUID_LEN /*32*/) {
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Session-ID: invalid uuid, ignored.\n");
}
+
+end:
+ switch_safe_free(a_id);
}
/* add "Session-ID:" header */