Pekka,
For now, tport uses TPORT_LOG and TPORT_DUMP environment variables to
configure the log flags and we found that more dynamic configuration of
the above flags (e.g. on nua_create()) is much more comfortable.
Please find below a whatsnew patch which adds TPTAG_LOG() and TPTAG_DUMP()
tags, which take precedence over env. variables (if set).
{
hunk ./libsofia-sip-ua/nua/nua.c 106
+ * TPTAG_LOG() \n
+ * TPTAG_DUMP() \n
hunk ./libsofia-sip-ua/tport/sofia-sip/tport_tag.h 267
+
+TPORT_DLL extern tag_typedef_t tptag_log;
+/** If set, print out all parsed SIP messages on transport layer. */
+#define TPTAG_LOG(x) tptag_log, tag_bool_v((x))
+
+TPORT_DLL extern tag_typedef_t tptag_log_ref;
+#define TPTAG_LOG_REF(x) tptag_log_ref, tag_bool_vr(&(x))
+
+TPORT_DLL extern tag_typedef_t tptag_dump;
+/** Filename for dumping unparsed messages from transport. */
+#define TPTAG_DUMP(x) tptag_dump, tag_str_v((x))
+
+TPORT_DLL extern tag_typedef_t tptag_dump_ref;
+#define TPTAG_DUMP_REF(x) tptag_dump_ref, tag_str_vr(&(x))
hunk ./libsofia-sip-ua/tport/tport_logging.c 93
- char const *log;
+ char const *log = NULL;
+ int log_msg = getenv("MSG_STREAM_LOG") != NULL ||
+ getenv("TPORT_LOG") != NULL
+ ? 1 : 0;
hunk ./libsofia-sip-ua/tport/tport_logging.c 98
- mr->mr_log = $
- getenv("MSG_STREAM_LOG") != NULL ||
- getenv("TPORT_LOG") != NULL $
- ? MSG_DO_EXTRACT_COPY : 0;
- $
- if ((log = getenv("TPORT_DUMP")) || (log = getenv("MSG_DUMP"))) {
+ tl_gets(tags, TPTAG_LOG_REF(log_msg), TAG_END());
+
+ mr->mr_log = log_msg ? MSG_DO_EXTRACT_COPY : 0;
+
+ tl_gets(tags, TPTAG_DUMP_REF(log), TAG_END());
+ if ((log) || (log = getenv("TPORT_DUMP")) || (log =
getenv("MSG_DUMP"))) {
hunk ./libsofia-sip-ua/tport/tport_tag.c 81
+tag_typedef_t tptag_log = INTTAG_TYPEDEF(log);
+tag_typedef_t tptag_dump = STRTAG_TYPEDEF(dump);
}
I've sent you a complete darcs patch with a separate email.
Best regards,
Roman
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sofia-sip-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel