[sr-dev] git:5.5:04591e08: avpops: removed unused function get_source_uri()

Daniel-Constantin Mierla miconda at gmail.com
Fri Nov 5 08:51:21 CET 2021


Module: kamailio
Branch: 5.5
Commit: 04591e08a4d74a9f57972b1552f941b86cbb6e55
URL: https://github.com/kamailio/kamailio/commit/04591e08a4d74a9f57972b1552f941b86cbb6e55

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-11-05T08:41:53+01:00

avpops: removed unused function get_source_uri()

(cherry picked from commit c9b885ff791bd71fcbf40824369fc9369dcc6e48)

---

Modified: src/modules/avpops/avpops_impl.c

---

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

---

diff --git a/src/modules/avpops/avpops_impl.c b/src/modules/avpops/avpops_impl.c
index c760becb43..8a6e4c2b2d 100644
--- a/src/modules/avpops/avpops_impl.c
+++ b/src/modules/avpops/avpops_impl.c
@@ -214,38 +214,6 @@ static int dbrow2avp(struct db_row *row, struct db_param *dbp, int_str attr,
 	return add_avp( (unsigned short)db_flags, avp_attr, avp_val);
 }
 
-
-inline static str* get_source_uri(struct sip_msg* msg,int source)
-{
-	/* which uri will be used? */
-	if (source&AVPOPS_USE_FROM)
-	{ /* from */
-		if (parse_from_header( msg )<0 )
-		{
-			LM_ERR("failed to parse from\n");
-			goto error;
-		}
-		return &(get_from(msg)->uri);
-	} else if (source&AVPOPS_USE_TO)
-	{  /* to */
-		if (parse_headers( msg, HDR_TO_F, 0)<0)
-		{
-			LM_ERR("failed to parse to\n");
-			goto error;
-		}
-		return &(get_to(msg)->uri);
-	} else if (source&AVPOPS_USE_RURI) {  /* RURI */
-		if(msg->new_uri.s!=NULL && msg->new_uri.len>0)
-			return &(msg->new_uri);
-		return &(msg->first_line.u.request.uri);
-	} else {
-		LM_ERR("unknown source <%d>\n", source);
-		goto error;
-	}
-error:
-	return 0;
-}
-
 static inline void int_str2db_val( int_str is_val, str *val, int is_s)
 {
 	if (is_s)




More information about the sr-dev mailing list