opensips/opensips.patch.save

Wed, 21 Sep 2011 14:04:16 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 21 Sep 2011 14:04:16 +0200
changeset 377
67e813202d53
permissions
-rw-r--r--

Introduce severe but necessary corrections and update to new vendor version.

michael@377 1 Index: modules/registrar/save.c
michael@377 2 diff -Nau modules/registrar/save.c.orig modules/registrar/save.c
michael@377 3 --- modules/registrar/save.c.orig 2008-03-07 14:12:56.307895000 +0100
michael@377 4 +++ modules/registrar/save.c 2008-03-08 00:03:02.436987000 +0100
michael@377 5 @@ -51,6 +51,7 @@
michael@377 6 #include "../../ut.h"
michael@377 7 #include "../../qvalue.h"
michael@377 8 #include "../../dset.h"
michael@377 9 +#include "../../msg_translator.h"
michael@377 10 #ifdef USE_TCP
michael@377 11 #include "../../tcp_server.h"
michael@377 12 #endif
michael@377 13 @@ -687,9 +688,28 @@
michael@377 14 contact_t* c;
michael@377 15 int st;
michael@377 16 str aor;
michael@377 17 + unsigned int new_len = 0;
michael@377 18 + struct sip_msg* sip_manip = 0;
michael@377 19
michael@377 20 rerrno = R_FINE;
michael@377 21
michael@377 22 + /* make a cheap shallow copy of the incoming message */
michael@377 23 + sip_manip = (void*)pkg_malloc(sizeof(struct sip_msg));
michael@377 24 + if (sip_manip==0) {
michael@377 25 + LM_ERR("no more pkg memory\n");
michael@377 26 + goto error;
michael@377 27 + }
michael@377 28 + memcpy(sip_manip,_m,sizeof(struct sip_msg));
michael@377 29 +
michael@377 30 + /* incorporate changes made to the routing script so far, */
michael@377 31 + /* this mean that the so called 'lumps' will be processed */
michael@377 32 + sip_manip->buf = build_res_buf_from_sip_res(_m, &new_len);
michael@377 33 + sip_manip->len = new_len;
michael@377 34 +
michael@377 35 + /* from here on, use the new refreshed message data as */
michael@377 36 + /* specifically manipulated according to the user's wish */
michael@377 37 + _m = sip_manip; /* only safe when passing by value */
michael@377 38 +
michael@377 39 if (parse_message(_m) < 0) {
michael@377 40 goto error;
michael@377 41 }
michael@377 42 Don't forget to free(3) the pkg_alloc(3) memory!!!

mercurial