When enforcing the routing path, you shouldn’t be considering the Contact header. There are valid reasons for the Contact header to remain as it is.

 

Instead, you should be making use of Record-Route and Route headers. Look into loose_route()