diff -urNp openser-1.1.0-notls/modules/shuntroute/Makefile openser-1.1.0-shuntroute/modules/shuntroute/Makefile --- openser-1.1.0-notls/modules/shuntroute/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ openser-1.1.0-shuntroute/modules/shuntroute/Makefile 2006-08-29 14:33:42.000000000 +0200 @@ -0,0 +1,6 @@ +include ../../Makefile.defs +auto_gen= +NAME=shuntroute.so +LIBS= + +include ../../Makefile.modules diff -urNp openser-1.1.0-notls/modules/shuntroute/shuntroute.c openser-1.1.0-shuntroute/modules/shuntroute/shuntroute.c --- openser-1.1.0-notls/modules/shuntroute/shuntroute.c 1970-01-01 01:00:00.000000000 +0100 +++ openser-1.1.0-shuntroute/modules/shuntroute/shuntroute.c 2006-08-29 15:50:39.000000000 +0200 @@ -0,0 +1,80 @@ +/* + * $Id: mangler.c,v 1.3 2006/01/24 20:56:25 bogdan_iancu Exp $ + * + * mangler module + * + * Copyright (C) 2001-2003 FhG Fokus + * + * This file is part of openser, a free SIP server. + * + * openser is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * openser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * History: + * -------- + * 2003-04-07 first version. + */ + +#include +#include +#include +#include "../../sr_module.h" +#include "../../mem/mem.h" +#include "../../dprint.h" +#include "../../ut.h" +#include "../../error.h" +#include "../../str.h" +#include "../../parser/msg_parser.h" /* struct sip_msg */ + +MODULE_VERSION + +static int shuntroute(struct sip_msg *msg, char *unused1, char *unused2); + +/* Exported functions. */ +static cmd_export_t cmds[] = +{ + {"shuntroute", shuntroute, 0, NULL, REQUEST_ROUTE}, + {0, 0, 0, 0, 0} +}; + +/* Module interface. */ +struct module_exports exports = { + "shuntroute", + cmds, /* Exported functions */ + NULL, /* Exported parameters */ + NULL, /* exported statistics */ + NULL, /* module initialization function */ + NULL, /* response function */ + NULL, /* destroy function */ + NULL /* child initialization function */ +}; + +static int +shuntroute(struct sip_msg *msg, + char *unused1 __attribute__ ((unused)), + char *unused2 __attribute__ ((unused))) +{ + struct hdr_field *itr, *tmp;; + + if (msg->route == NULL) + return 1; + itr = msg->route; + while (itr) { + tmp = itr->sibling; + pkg_free(itr); + itr = tmp; + } + msg->route = NULL; + return 1; +}