|
@@ -494,3 +494,49 @@ int get_path_dst_uri(str *_p, str *_dst)
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+/*!
|
|
|
|
+ * Parse all Record-Route header
|
|
|
|
+ */
|
|
|
|
+int parse_record_route_headers(sip_msg_t *msg)
|
|
|
|
+{
|
|
|
|
+ hdr_field_t *hf;
|
|
|
|
+ if(parse_headers(msg, HDR_EOH_F, 0) < 0) {
|
|
|
|
+ LM_ERR("failed to parse the headers\n");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ hf = msg->record_route;
|
|
|
|
+ while(hf) {
|
|
|
|
+ if (parse_rr(hf) < 0) {
|
|
|
|
+ LM_ERR("failed to parse Record-Route\n");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ hf = next_sibling_hdr(hf);
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*!
|
|
|
|
+ * Parse all Route header
|
|
|
|
+ */
|
|
|
|
+int parse_route_headers(sip_msg_t *msg)
|
|
|
|
+{
|
|
|
|
+ hdr_field_t *hf;
|
|
|
|
+ if(parse_headers(msg, HDR_EOH_F, 0) < 0) {
|
|
|
|
+ LM_ERR("failed to parse the headers\n");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ hf = msg->route;
|
|
|
|
+ while(hf) {
|
|
|
|
+ if (parse_rr(hf) < 0) {
|
|
|
|
+ LM_ERR("failed to parse Record-Route\n");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ hf = next_sibling_hdr(hf);
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
|
|
+}
|