[SR-Dev] git:master: * Any pending string after the last \n token was ignored. Port

Juha Heinanen jh at tutpro.com
Fri Apr 17 11:17:57 CEST 2009


Module: sip-router
Branch: master
Commit: 34df941208059d3e09c641672b7d6c55bf740729
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=34df941208059d3e09c641672b7d6c55bf740729

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date:   Fri Apr 17 10:03:00 2009 +0300

* Any pending string after the last \n token was ignored.  Port
  from Kamailio 1.5 branch.

---

 modules_k/dialplan/dp_repl.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules_k/dialplan/dp_repl.c b/modules_k/dialplan/dp_repl.c
index 740145d..21dbd26 100644
--- a/modules_k/dialplan/dp_repl.c
+++ b/modules_k/dialplan/dp_repl.c
@@ -250,6 +250,15 @@ int rule_translate(struct sip_msg *msg, str string, dpl_node_t * rule,
 		}
 		repl_nb++;
 	}
+	/* anything left? */
+	if( repl_nb && token.offset+token.size < repl_comp->replacement.len){
+		/*copy from the replacing string*/
+		memcpy(result->s + result->len,
+			repl_comp->replacement.s + token.offset+token.size, 
+			repl_comp->replacement.len -(token.offset+token.size) );
+			result->len +=repl_comp->replacement.len-(token.offset+token.size);
+	}
+
 	result->s[result->len] = '\0';
 	return 0;
 




More information about the sr-dev mailing list