Pekka,

The below patch adds TPTAG_LOG() and TPTAG_DUMP() tags, which override 
TPORT_LOG and TPORT_DUMP environment variables. The patch also checks 
for TPORT_LOG_OVERRIDE environment variable, which, if set, has 
preference over TPTAG_LOG() and TPORT_LOG.

{
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());
+
+  if (getenv("TPORT_LOG_OVERRIDE"))
+     log_msg = 1;
+
+  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);
}

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
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to