Module: sip-router
Branch: master
Commit: 713a6e02b866ed337146f2ee21b97cf15e4f9a37
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=713a6e0…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Tue Mar 17 22:06:36 2009 +0100
Replace missing logging macros with va_arg support using static buffer.
There is no support for logging macros with va_arg support in the
sr core, so we need to reimplement it in conf_error using a static
buffer. The function first prints the whole string into a static
buffer using vsnprintf and the buffer is then logged using LM_GEN1.
---
modules/carrierroute/cr_config.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/modules/carrierroute/cr_config.c b/modules/carrierroute/cr_config.c
index 48975a5..642f911 100644
--- a/modules/carrierroute/cr_config.c
+++ b/modules/carrierroute/cr_config.c
@@ -32,6 +32,8 @@
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
#include "../../mem/shm_mem.h"
#include "../../mem/mem.h"
#include "../../ut.h"
@@ -50,8 +52,17 @@
* @param ap format arguments
*/
static void conf_error(cfg_t *cfg, const char * fmt, va_list ap) {
- // FIXME this don't seems to work reliable, produces strange error messages
- LM_GEN1(L_ERR, (char *) fmt, ap);
+ int ret;
+ static char buf[1024];
+
+ ret = vsnprintf(buf, sizeof(buf), fmt, ap);
+ if (ret < 0 || ret >= sizeof(buf)) {
+ LM_ERR("could not print error message\n");
+ } else {
+ // FIXME this don't seems to work reliable in all cases, charset
+ // problems
+ LM_GEN1(L_ERR, "%s", buf);
+ }
}
Module: sip-router
Branch: master
Commit: 1f8f46a3a8f9ecf4d52086f3bb98483e6242aac6
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1f8f46a…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Tue Mar 17 21:03:46 2009 +0100
Adding send_sock to the dlg_t structure.
This patch adds a pointer to the socket to be used for sending into
the dlg_t structure. The pointer is not yet used, we will add the
code to use the socket later.
---
modules/tm/dlg.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/modules/tm/dlg.h b/modules/tm/dlg.h
index 2594ce3..8a3a153 100644
--- a/modules/tm/dlg.h
+++ b/modules/tm/dlg.h
@@ -35,6 +35,7 @@
#include <stdio.h>
#include "../../str.h"
+#include "../../ip_addr.h"
#include "../../parser/parse_rr.h"
#include "../../parser/msg_parser.h"
@@ -118,6 +119,7 @@ typedef struct dlg {
* can be reused when building a message (to
* prevent repeated analyzing of the dialog data
*/
+ struct socket_info* send_sock;
#ifdef DIALOG_CALLBACKS
struct tmcb_head_list dlg_callbacks;
#endif
On Tuesday 03 March 2009, Henning Westerholt wrote:
> [..]
> I'll provide the slides and eventual some notes after the talk as usual.
Hi all,
the event went pretty well. It was not a typical "free software conference"
like for example the FOSDEM, as most of the audience were system or
network administrators. The talks i visited were informative, in the evening
they organised a really nice social event.
My presentation is available at:
http://www.kamailio.org/events/2009-FFG/presentation.pdf
Cheers,
Henning
Hi,
attached patch removes the VQ_MALLOC memory manager from the sip-router core.
As discussed some time ago, this memory manager don't provide a realloc
implementation, and is thus not really usable for the modules, as some of
them needs this. We removed this in kamailio in the last year, so far nobody
missed it. Removing this memory manager is in my opinion a good cleanup, and
also make the synchronisation of this MM implementations with the ones in the
kamailio core easier.
Cheers,
Henning
Module: sip-router
Branch: master
Commit: e430fa027b632c289cd440a228f102f385d29087
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e430fa0…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Mon Mar 16 18:49:27 2009 +0100
Teach sip-router how to recognized Path header field name.
---
parser/case_path.h | 41 +++++++++++++++++++++++++++++++++++++++++
parser/hf.c | 1 +
parser/hf.h | 2 ++
parser/keys.h | 1 +
parser/msg_parser.c | 5 +++++
parser/msg_parser.h | 1 +
parser/parse_hname2.c | 2 ++
7 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/parser/case_path.h b/parser/case_path.h
new file mode 100644
index 0000000..5b065fc
--- /dev/null
+++ b/parser/case_path.h
@@ -0,0 +1,41 @@
+/*
+ * $Id$
+ *
+ * Path Header Field Name Parsing Macros
+ *
+ * Copyright (C) 2009 iptelorg GmbH
+ *
+ * This file is part of ser, a free SIP server.
+ *
+ * ser 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
+ *
+ * For a license to use the ser software under conditions
+ * other than those described here, or to purchase support for this
+ * software, please contact iptel.org by e-mail at the following addresses:
+ * info(a)iptel.org
+ *
+ * ser 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
+ */
+
+
+#ifndef CASE_PATH_H
+#define CASE_PATH_H
+
+
+#define path_CASE \
+ hdr->type = HDR_PATH_T; \
+ p += 4; \
+ goto dc_end
+
+
+#endif /* CASE_PATH_H */
diff --git a/parser/hf.c b/parser/hf.c
index 594a27f..c5f7ba3 100644
--- a/parser/hf.c
+++ b/parser/hf.c
@@ -211,6 +211,7 @@ void clean_hdr_field(struct hdr_field* hf)
case HDR_REQUESTDISPOSITION_T:
case HDR_WWW_AUTHENTICATE_T:
case HDR_PROXY_AUTHENTICATE_T:
+ case HDR_PATH_T:
break;
default:
LOG(L_CRIT, "BUG: clean_hdr_field: unknown header type %d\n",
diff --git a/parser/hf.h b/parser/hf.h
index 7196833..bddf0a2 100644
--- a/parser/hf.h
+++ b/parser/hf.h
@@ -109,6 +109,7 @@ enum _hdr_types_t {
HDR_RETRY_AFTER_T /* Retry-After header field */,
HDR_PPI_T /**< P-Preferred-Identity header field */,
HDR_PAI_T /**< P-Asserted-Identity header field */,
+ HDR_PATH_T /**< Path header field */,
HDR_EOH_T /* End of message header */
};
@@ -178,6 +179,7 @@ typedef unsigned long long hdr_flags_t;
#define HDR_RETRY_AFTER_F HDR_F_DEF(RETRY_AFTER)
#define HDR_PPI_F HDR_F_DEF(PPI)
#define HDR_PAI_F HDR_F_DEF(PAI)
+#define HDR_PATH_F HDR_F_DEF(PATH)
#define HDR_OTHER_F HDR_F_DEF(OTHER)
diff --git a/parser/keys.h b/parser/keys.h
index 92c60ce..bf17058 100644
--- a/parser/keys.h
+++ b/parser/keys.h
@@ -108,6 +108,7 @@
#define _iden_ 0x6e656469 /* "iden" */
#define _tity_ 0x79746974 /* "tity" */
#define _info_ 0x6f666e69 /* "info" */
+#define _path_ 0x68746170 /* "path" */
#define _pt_l_ 0x6c2d7470 /* "pt-l" */
#define _angu_ 0x75676e61 /* "angu" */
diff --git a/parser/msg_parser.c b/parser/msg_parser.c
index 5cfbd7c..cad8028 100644
--- a/parser/msg_parser.c
+++ b/parser/msg_parser.c
@@ -241,6 +241,7 @@ char* get_hdr_field(char* buf, char* end, struct hdr_field* hdr)
case HDR_REQUESTDISPOSITION_T:
case HDR_WWW_AUTHENTICATE_T:
case HDR_PROXY_AUTHENTICATE_T:
+ case HDR_PATH_T:
case HDR_OTHER_T:
/* just skip over it */
hdr->body.s=tmp;
@@ -516,6 +517,10 @@ int parse_headers(struct sip_msg* msg, hdr_flags_t flags, int next)
if (msg->identity_info==0) msg->identity_info=hf;
msg->parsed_flag|=HDR_IDENTITY_INFO_F;
break;
+ case HDR_PATH_T:
+ if (msg->path==0) msg->path=hf;
+ msg->parsed_flag|=HDR_PATH_F;
+ break;
default:
LOG(L_CRIT, "BUG: parse_headers: unknown header type %d\n",
hf->type);
diff --git a/parser/msg_parser.h b/parser/msg_parser.h
index 4b18ed5..48790c9 100644
--- a/parser/msg_parser.h
+++ b/parser/msg_parser.h
@@ -257,6 +257,7 @@ typedef struct sip_msg {
struct hdr_field* identity_info;
struct hdr_field* pai;
struct hdr_field* ppi;
+ struct hdr_field* path;
char* eoh; /* pointer to the end of header (if found) or null */
char* unparsed; /* here we stopped parsing*/
diff --git a/parser/parse_hname2.c b/parser/parse_hname2.c
index 6b8e159..a222d5e 100644
--- a/parser/parse_hname2.c
+++ b/parser/parse_hname2.c
@@ -98,6 +98,7 @@ static inline char* skip_ws(char* p, unsigned int size)
#include "case_date.h" /* Date */
#include "case_iden.h" /* Identity, Identity-info */
#include "case_retr.h" /* Retry-After */
+#include "case_path.h" /* Path */
#define READ(val) \
@@ -143,6 +144,7 @@ static inline char* skip_ws(char* p, unsigned int size)
case _date_: date_CASE; \
case _iden_: iden_CASE; \
case _retr_: retr_CASE; \
+ case _path_: path_CASE;