diff -r 8f552d1cd671 -r 67e813202d53 opensips/opensips.patch.save --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/opensips/opensips.patch.save Wed Sep 21 14:04:16 2011 +0200 @@ -0,0 +1,42 @@ +Index: modules/registrar/save.c +diff -Nau modules/registrar/save.c.orig modules/registrar/save.c +--- modules/registrar/save.c.orig 2008-03-07 14:12:56.307895000 +0100 ++++ modules/registrar/save.c 2008-03-08 00:03:02.436987000 +0100 +@@ -51,6 +51,7 @@ + #include "../../ut.h" + #include "../../qvalue.h" + #include "../../dset.h" ++#include "../../msg_translator.h" + #ifdef USE_TCP + #include "../../tcp_server.h" + #endif +@@ -687,9 +688,28 @@ + contact_t* c; + int st; + str aor; ++ unsigned int new_len = 0; ++ struct sip_msg* sip_manip = 0; + + rerrno = R_FINE; + ++ /* make a cheap shallow copy of the incoming message */ ++ sip_manip = (void*)pkg_malloc(sizeof(struct sip_msg)); ++ if (sip_manip==0) { ++ LM_ERR("no more pkg memory\n"); ++ goto error; ++ } ++ memcpy(sip_manip,_m,sizeof(struct sip_msg)); ++ ++ /* incorporate changes made to the routing script so far, */ ++ /* this mean that the so called 'lumps' will be processed */ ++ sip_manip->buf = build_res_buf_from_sip_res(_m, &new_len); ++ sip_manip->len = new_len; ++ ++ /* from here on, use the new refreshed message data as */ ++ /* specifically manipulated according to the user's wish */ ++ _m = sip_manip; /* only safe when passing by value */ ++ + if (parse_message(_m) < 0) { + goto error; + } +Don't forget to free(3) the pkg_alloc(3) memory!!!