diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 1f518dca8b0dbb9af7557f4c751cad614ec2f45d..e5da2eb3145b00a58919d066c42a8c48999470ea 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -1539,7 +1539,7 @@ pjsip_dialog *ast_sip_create_dialog_uac(const struct ast_sip_endpoint *endpoint,
 			pjsip_dlg_terminate(dlg);
 			return NULL;
 		}
-		pj_list_push_back(&route_set, route);
+		pj_list_insert_nodes_before(&route_set, route);
 
 		pjsip_dlg_set_route_set(dlg, &route_set);
 	}
@@ -1901,7 +1901,7 @@ int ast_sip_set_outbound_proxy(pjsip_tx_data *tdata, const char *proxy)
 		return -1;
 	}
 
-	pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)route);
+	pj_list_insert_nodes_before(&tdata->msg->hdr, (pjsip_hdr*)route);
 
 	return 0;
 }
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index 55279c58c0c531376874964e298ed1826e69bc83..c51904253f9e94d85fc41e942a83f52cf4fe4086 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -776,7 +776,7 @@ static int sip_outbound_registration_regc_alloc(void *data)
 		if (!(route = pjsip_parse_hdr(pjsip_regc_get_pool(registration->state->client_state->client), &ROUTE_HNAME, tmp.ptr, tmp.slen, NULL))) {
 			return -1;
 		}
-		pj_list_push_back(&route_set, route);
+		pj_list_insert_nodes_before(&route_set, route);
 
 		pjsip_regc_set_route_set(registration->state->client_state->client, &route_set);
 	}