Module: kamailio
Branch: master
Commit: e01f50fa3de5b0eb24ba0852917d682fe1d83ea1
URL: 
https://github.com/kamailio/kamailio/commit/e01f50fa3de5b0eb24ba0852917d682fe1d83ea1

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2025-06-24T12:15:37+02:00

core: dset - wrapper function to reset request uri

---

Modified: src/core/dset.c
Modified: src/core/dset.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/e01f50fa3de5b0eb24ba0852917d682fe1d83ea1.diff
Patch: 
https://github.com/kamailio/kamailio/commit/e01f50fa3de5b0eb24ba0852917d682fe1d83ea1.patch

---

diff --git a/src/core/dset.c b/src/core/dset.c
index d449f33e325..29a376e99a0 100644
--- a/src/core/dset.c
+++ b/src/core/dset.c
@@ -813,6 +813,22 @@ int rewrite_uri(struct sip_msg *_m, str *_s)
        return 1;
 }
 
+/*
+ * Reset Request-URI
+ */
+void reset_uri(sip_msg_t *msg)
+{
+       if(msg->new_uri.s == NULL) {
+               return;
+       }
+       pkg_free(msg->new_uri.s);
+       msg->new_uri.len = 0;
+       msg->new_uri.s = 0;
+       msg->parsed_uri_ok = 0;
+       ruri_mark_new();
+       return;
+}
+
 /**
  * return src ip, port and proto as a SIP uri or proxy address
  * - value stored in a static buffer
diff --git a/src/core/dset.h b/src/core/dset.h
index a46639a1adb..f8fd86c17f7 100644
--- a/src/core/dset.h
+++ b/src/core/dset.h
@@ -233,6 +233,8 @@ inline static int get_request_uri(struct sip_msg *_m, str 
*_u)
 
 int rewrite_uri(struct sip_msg *_m, str *_s);
 
+void reset_uri(sip_msg_t *msg);
+
 /*! \brief
  * Set a per-branch flag to 1.
  *

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to