[sr-dev] git:master: tm: adjust size of the hooks to From/ To headers for local genrated requests

Daniel-Constantin Mierla miconda at gmail.com
Fri Apr 26 18:25:15 CEST 2013


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Apr 26 18:24:01 2013 +0200

tm: adjust size of the hooks to From/To headers for local genrated requests

- take in cosideration <> if it is the case

---

 modules/tm/t_msgbuilder.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/tm/t_msgbuilder.c b/modules/tm/t_msgbuilder.c
index b5ff309..b36020a 100644
--- a/modules/tm/t_msgbuilder.c
+++ b/modules/tm/t_msgbuilder.c
@@ -1398,7 +1398,8 @@ static inline char* print_request_uri(char* w, str* method, dlg_t* dialog, struc
 static inline char* print_to(char* w, dlg_t* dialog, struct cell* t)
 {
 	t->to.s = w;
-	t->to.len = TO_LEN + dialog->rem_uri.len + CRLF_LEN;
+	t->to.len = TO_LEN + dialog->rem_uri.len + CRLF_LEN
+		+ (dialog->rem_uri.s[0]!='<')?2:0;
 
 	memapp(w, TO, TO_LEN);
 	if(dialog->rem_uri.s[0]!='<') memapp(w, "<", 1);
@@ -1422,7 +1423,8 @@ static inline char* print_to(char* w, dlg_t* dialog, struct cell* t)
 static inline char* print_from(char* w, dlg_t* dialog, struct cell* t)
 {
 	t->from.s = w;
-	t->from.len = FROM_LEN + dialog->loc_uri.len + CRLF_LEN;
+	t->from.len = FROM_LEN + dialog->loc_uri.len + CRLF_LEN
+		+ (dialog->rem_uri.s[0]!='<')?2:0;
 
 	memapp(w, FROM, FROM_LEN);
 	if(dialog->loc_uri.s[0]!='<') memapp(w, "<", 1);




More information about the sr-dev mailing list