[Freeswitch-svn] [commit] r5840 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua-glib libsofia-sip-ua-glib/su-glib libsofia-sip-ua/bnf libsofia-sip-ua/docs libsofia-sip-ua/http libsofia-sip-ua/ipt libsofia-sip-ua/ipt/sofia-sip libsofia-sip-ua/iptsec libsofia-sip-ua/iptsec/sofia-sip libsofia-sip-ua/msg libsofia-sip-ua/nea libsofia-sip-ua/nta libsofia-sip-ua/nta/sofia-sip libsofia-sip-ua/nth libsofia-sip-ua/nth/sofia-sip libsofia-sip-ua/nua libsofia-sip-ua/nua/sofia-sip libsofia-sip-ua/sdp libsofia-sip-ua/sdp/sofia-sip libsofia-sip-ua/sip libsofia-sip-ua/sip/sofia-sip libsofia-sip-ua/soa libsofia-sip-ua/sresolv libsofia-sip-ua/stun libsofia-sip-ua/su libsofia-sip-ua/su/sofia-sip libsofia-sip-ua/tport libsofia-sip-ua/tport/sofia-sip libsofia-sip-ua/url utils

Freeswitch SVN mikej at freeswitch.org
Thu Oct 11 10:17:00 EDT 2007


Author: mikej
Date: Thu Oct 11 10:16:59 2007
New Revision: 5840

Added:
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/foo.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/smoothsort.c
Modified:
   freeswitch/trunk/libs/sofia-sip/RELEASE
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/Makefile.am
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.aliases
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.conf
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.in
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Makefile.am
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/conformance.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/mainpage.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_tag.c.in
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/Doxyfile.in
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/ipt.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/base64.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/token64.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/Doxyfile.in
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_http.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_sip.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/Doxyfile.in
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.awk
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_event.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/portbind.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tag.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/Doxyfile.in
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_registrar.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_100rel.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_api.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_params.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_tag.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/ADD-A-HEADER
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/Makefile.am
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip.doxyaliases
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra_headers.txt
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_pref_util.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_util.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_extra.h.in
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_header.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_util.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/validator.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/run_test_sresolv
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/torture_sresolv.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/lookup_stun_server.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_common.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_mini.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_tag.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/Makefile.am
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memccpy.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memcspn.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memmem.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memspn.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/run_test_su
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/heap.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable2.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_config.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_os_nw.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_class.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_time.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_types.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_wait.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/strcasestr.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_bm.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_devpoll_port.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_epoll_port.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_module_debug.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_osx_runloop.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_poll_port.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_proxy.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_root.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_select_port.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_win32_port.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/test_poll.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_heap.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_rbtree.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_alloc.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_bm.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_port.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root_osx.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_tag.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_sigcomp.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_sigcomp.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/Doxyfile.in
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/Makefile.am
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.docs
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url_tag.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/urlmap.c
   freeswitch/trunk/libs/sofia-sip/utils/Makefile.am

Log:
Sync to current darcs tree:

Mon Sep 17 14:50:04 EDT 2007  Pekka.Pessi at nokia.com
  * sofia-sip/sip_util.h: updated documentation

Mon Sep 17 14:50:18 EDT 2007  Pekka.Pessi at nokia.com
  * sofia-sip/tport_tag.h: updated documentation

Mon Sep 17 14:50:28 EDT 2007  Pekka.Pessi at nokia.com
  * soa_tag.c: updated documentation

Wed Sep 19 12:50:01 EDT 2007  Pekka.Pessi at nokia.com
  * msg: updated documentation

Wed Sep 19 13:29:50 EDT 2007  Pekka.Pessi at nokia.com
  * url: updated documentation

Wed Sep 19 13:32:14 EDT 2007  Pekka.Pessi at nokia.com
  * nth: updated documentation

Wed Sep 19 13:32:27 EDT 2007  Pekka.Pessi at nokia.com
  * nea: updated documentation

Wed Sep 19 13:33:36 EDT 2007  Pekka.Pessi at nokia.com
  * http: updated documentation

Wed Sep 19 13:36:58 EDT 2007  Pekka.Pessi at nokia.com
  * bnf: updated documentation

Wed Sep 19 13:38:58 EDT 2007  Pekka.Pessi at nokia.com
  * nua: updated nua_stack_init_handle() prototype

Wed Sep 19 18:45:56 EDT 2007  Pekka.Pessi at nokia.com
  * sip: added sip_name_addr_xtra(), sip_name_addr_dup()

Wed Sep 19 19:00:19 EDT 2007  Pekka.Pessi at nokia.com
  * sip_basic.c: cleaned old crud

Thu Sep 20 13:34:04 EDT 2007  Pekka.Pessi at nokia.com
  * iptsec: updated documentation

Thu Sep 20 13:36:22 EDT 2007  Pekka.Pessi at nokia.com
  * tport: updated documentation

Thu Sep 20 13:36:56 EDT 2007  Pekka.Pessi at nokia.com
  * su: updated documentation
  Removed internal files from doxygen-generated documentation.

Thu Sep 20 13:38:29 EDT 2007  Pekka.Pessi at nokia.com
  * soa: fixed documentation

Thu Sep 20 13:39:56 EDT 2007  Pekka.Pessi at nokia.com
  * sdp: updated documentation

Thu Sep 20 13:40:16 EDT 2007  Pekka.Pessi at nokia.com
  * ipt: updated documentation

Thu Sep 20 14:24:20 EDT 2007  Pekka.Pessi at nokia.com
  * nta: updated documentation

Thu Sep 20 14:41:04 EDT 2007  Pekka.Pessi at nokia.com
  * nua: updated documentation

  Updated tag documentation.

  Moved doxygen doc entries from sofia-sip/nua_tag.h to nua_tag.c.

  Removed internal datatypes and files from the generated documents.

Wed Sep 19 13:34:20 EDT 2007  Pekka.Pessi at nokia.com
  * docs: updated the generation of documentation. Updated links to header files.

Thu Sep 20 08:45:32 EDT 2007  Pekka.Pessi at nokia.com
  * sip/Makefile.am: added tags to <sofia-sip/sip_extra.h>

  Added check for extra tags in torture_sip.c.

Thu Sep 20 14:45:22 EDT 2007  Pekka.Pessi at nokia.com
  * stun: updated documentation

Wed Jul  4 18:55:20 EDT 2007  Pekka.Pessi at nokia.com
  * torture_heap.c: added tests for ##sort() and su_smoothsort()

Wed Jul  4 18:56:59 EDT 2007  Pekka.Pessi at nokia.com
  * Makefile.am: added smoothsort.c

Fri Jul 13 12:38:44 EDT 2007  Pekka.Pessi at nokia.com
  * sofia-sip/heap.h: heap_remove() now set()s index to 0 on removed item

Mon Jul 23 11:14:22 EDT 2007  Pekka.Pessi at nokia.com
  * sofia-sip/heap.h: fixed bug in heap##remove()

  If left kid was in heap but right was not, left kid was ignored.

Wed Jul  4 18:51:08 EDT 2007  Pekka.Pessi at nokia.com
  * smoothsort.c: added

Wed Jul  4 18:51:34 EDT 2007  Pekka.Pessi at nokia.com
  * heap.h: using su_smoothsort()

Fri Jul  6 10:20:27 EDT 2007  Pekka.Pessi at nokia.com
  * smoothsort.c: added

Wed Sep 19 17:40:30 EDT 2007  Pekka.Pessi at nokia.com
  * msg_parser.awk: generate two parser tables, default and extended

Wed Sep 19 18:39:45 EDT 2007  Pekka.Pessi at nokia.com
  * msg_parser.awk: just generate list of extra headers

  Allocate extended parser dynamically.

Wed Sep 19 18:59:59 EDT 2007  Pekka.Pessi at nokia.com
  * sip: added Remote-Party-ID, P-Asserted-Identity, P-Preferred-Identity

  Added functions sip_update_default_mclass() and sip_extend_mclass()
  for handling the extended parser. Note that Reply-To and Alert-Info are only
  available with the extended parser.

Wed Sep 19 19:05:44 EDT 2007  Pekka.Pessi at nokia.com
  * RELEASE: updated

Thu Sep 20 13:38:59 EDT 2007  Pekka.Pessi at nokia.com
  * sip: updated documentation

Thu Sep 20 14:17:28 EDT 2007  Pekka.Pessi at nokia.com
  * docs/conformance.docs: updated

Mon Oct  1 10:11:14 EDT 2007  Pekka.Pessi at nokia.com
  * tport_tag.c: re-enabled tptag_trusted

Thu Oct  4 09:21:07 EDT 2007  Pekka.Pessi at nokia.com
  * su_osx_runloop.c: moved virtual function table after struct definition

  Preparing for su_port_vtable_t refactoring.

Thu Oct  4 10:22:03 EDT 2007  Pekka.Pessi at nokia.com
  * su_source.c: refactored initialization/deinitialization

Fri Oct  5 04:58:18 EDT 2007  Pekka Pessi <Pekka.Pessi at nokia.com>
  * sip_extra.c: fixed prototypes with isize_t

Fri Oct  5 04:58:45 EDT 2007  Pekka Pessi <Pekka.Pessi at nokia.com>
  * test_nta_api.c: removed warnings about signedness

Fri Oct  5 04:59:02 EDT 2007  Pekka Pessi <Pekka.Pessi at nokia.com>
  * test_nua_params.c: removed warnings about constness

Fri Oct  5 07:20:26 EDT 2007  Pekka Pessi <first.lastname at nokia.com>
  * su_port.h, su_root.c: cleaned argument checking

  The su_root_*() and su_port_*() functions now check their arguments once
  and do not assert() with NULL arguments. The sur_task->sut_port should
  always be valid while su_root_t is alive.

Fri Oct  5 07:22:09 EDT 2007  Pekka Pessi <first.lastname at nokia.com>
  * su: added su_root_obtain(), su_root_release() and su_root_has_thread()

  When root is created with su_root_create() or cloned with su_clone_start(),
  the resulting root is obtained by the calling or created thread,
  respectively.

  The root can be released with su_root_release() and another thread can
  obtain it.

  The function su_root_has_thread() can be used to check if a thread has
  obtained or released the root.

  Implementation upgraded the su_port_own_thread() method as su_port_thread().

Fri Oct  5 07:28:10 EDT 2007  Pekka Pessi <first.lastname at nokia.com>
  * su_port.h: removed su_port_threadsafe() and su_port_yield() methods

  su_port_wait_events() replaces su_port_yield().

Fri Oct  5 13:26:04 EDT 2007  Pekka Pessi <Pekka.Pessi at nokia.com>
  * msg_parser.awk: not extending header structure unless needed.

  Removed gawk-ish /* comments */.

Fri Oct  5 14:32:25 EDT 2007  Pekka Pessi <Pekka.Pessi at nokia.com>
  * run_test_su: removed GNUisms

Fri Oct  5 14:32:47 EDT 2007  Pekka Pessi <Pekka.Pessi at nokia.com>
  * Makefile.am: removed implicit check target test_urlmap

Fri Oct  5 14:22:32 EDT 2007  Pekka Pessi <first.lastname at nokia.com>
  * torture_sresolv.c: use CLOCK_REALTIME if no CLOCK_PROCESS_CPUTIME_ID available

  Casting timespec tv_sec to unsigned long.

Fri Oct * nua_s added handling nua_prack()

  Thanks to Fabio Margarido for the patch.

Mon Oct  8 10:24:35 EDT 2007  Pekka.Pessi at nokia.com
  * test_nua: added test for sf.net bug #1803686

Mon Oct  8 08:15:23 EDT 2007  Pekka.Pessi at nokia.com
  * RELEASE: updated.

Mon Oct  8 09:30:36 EDT 2007  Pekka.Pessi at nokia.com
  * nua_stack: added handling nua_prack()

  Thanks to Fabio Margarido for the patch.

Mon Oct  8 10:24:35 EDT 2007  Pekka.Pessi at nokia.com
  * test_nua: added test for sf.net bug #1803686

Mon Oct  8 10:26:31 EDT 2007  Pekka.Pessi at nokia.com
  * nua: added test for nua_prack() (sf.net bug #1804248)

  Avoid sending nua_i_state after nua_prack() if no SDP O/A is happening, too.

Mon Oct  8 10:32:04 EDT 2007  Mikhail Zabaluev <mikhail.zabaluev at nokia.com>
  * su_source.c: don t leak the wait arrays

Mon Oct  8 10:37:11 EDT 2007  Pekka.Pessi at nokia.com
  * RELEASE: updated

Wed Oct 10 11:55:21 EDT 2007  Pekka.Pessi at nokia.com
  * sip_parser.c: silenced warning about extra const in sip_extend_mclass()

Wed Oct 10 11:57:08 EDT 2007  Pekka.Pessi at nokia.com
  * nta_tag.c: updated tag documentation

Wed Oct 10 13:16:40 EDT 2007  Pekka.Pessi at nokia.com
  * nua: fix logging crash if outbound used with application contact

  Silenced warnings.

Wed Oct 10 13:30:45 EDT 2007  Pekka.Pessi at nokia.com
  * msg_parser.awk: removed extra "const"

Wed Oct 10 13:31:45 EDT 2007  Pekka.Pessi at nokia.com
  * Makefile.am's: fixed distclean of documentation



Modified: freeswitch/trunk/libs/sofia-sip/RELEASE
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/RELEASE	(original)
+++ freeswitch/trunk/libs/sofia-sip/RELEASE	Thu Oct 11 10:16:59 2007
@@ -4,42 +4,73 @@
 
 Changes since last release
 --------------------------
-
-<changes since last written in freshmeat.net "Changes:" style;
- and in less than 10 lines, written in 3rd person English, with
- complete sentences />
-
 The stack now compiles and runs on Symbian SDK with Open C support
 enabled.
 
-Bugs in blaa and foo have been fixed. The stack now supports
-use of foobar...
+The stacksupports specifying the outbound proxy by a set of Route
+headers as recommended by RFC3261. It also supports CR-LF-based keepalives
+on TCP connections.
+
+Bugs in call state machines, URI and SDP handling has been fixed.
+
 
 API/ABI changes and versioning
 ------------------------------
 
-<see previous release notes at
- http://sofia-sip.sourceforge.net/relnotes/ for examples ;
- - should include all changes to public headers, and 
-   other important information to developers; 
- - and should be updated _continuously_! />
-
-New features in API are marked with Doxytag macro @VERSION_1_12_7.
+New features in API are marked with Doxytag macro @VERSION_1_12_7 or
+ at NEW_1_12_7.
 
 libsofia-sip-ua:
-- Added access point selection functionality for Open C / Symbian
-- Removed extra system headers from <sofia-sip/stun_common.h>
-- Added global variable su_socket_blocking. If it is set to true,
-  sockets are created as blocking.
-- Added accessor function nta_outgoing_branch()
-- Added SIP headers Alert-Info and Reply-To.
-- Added macros SIP_HAVE_XXXX for extra headers, e.g., SIP_HAVE_ALERT_INFO().
-- **template**: Added foobar() function (sofia-sip/foobar.h).
 - This release is ABI/API compatible with applications linked against 
   any 1.12.x release. However, applications built against this release won't 
   work against an older library. The ABI has been tested with the nua module 
   unit test (test_nua) built against original 1.12.0 release.
 
+libsofia-sip-ua/nua:
+- Added tag NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR()
+
+libsofia-sip-ua/nta:
+- Added nta_incoming_received()
+- Added accessor function nta_outgoing_branch()
+- Added tag NTATAG_TIMER_C()
+- Deprecated nta_msg_ackbye()
+
+libsofia-sip-ua/iptsec:
+- Added tag AUTHTAG_MAX_NCOUNT()
+
+libsofia-sip-ua/sip:
+- Added SIPEXTHDRTAG_TYPEDEF() macro and tag class sipexthdrtag_class[]
+- Added SIP headers Alert-Info and Reply-To. Remote-Party-ID,
+  P-Asserted-Identity, P-Preferred-Identity
+- Added sip_update_default_mclass() and sip_extend_mclass()
+- Added macros SIP_HAVE_XXXX for extra headers, e.g., SIP_HAVE_ALERT_INFO().
+
+libsofia-sip-ua/soa:
+- Added tags SOATAG_ORDERED_USER() and SOATAG_REUSE_REJECTED()
+
+libsofia-sip-ua/tport:
+- Updated transport timers
+  - Added TPTAG_KEEPALIVE(), TPTAG_PINGPONG(), TPTAG_PONG2PING()
+  - Added tport_is_clear_to_send(), tport_has_queued()
+- Updated timer handling
+  - Added abstract type su_timer_queue_t (typedef'd to SU_TIMER_QUEUE_T)
+  - Updated su_task_timers() and su_timer_expire() prototypes
+
+libsofia-sip-ua/stun:
+- Removed extra system headers from <sofia-sip/stun_common.h>
+
+libsofia-sip-ua/su:
+- Added su_nanotime_t and functions su_nanotime()/su_monotime()
+- Added function su_getsocktype()
+- Added heap template in <sofia-sip/heap.h>
+- Added configure option --disable-tag-cast and macro SU_INLINE_TAG_CAST
+- Added global variable su_socket_blocking. If it is set to true,
+  sockets are created as blocking.
+- Added access point selection functionality for Open C / Symbian
+- Added functions su_root_release(), su_root_obtain() and
+  su_root_has_thread(). A thread can release a su_root_t and another one can
+  obtain it.
+
 libsofia-sip-ua-glib:
 - No ABI/API changes, compatible with 1.12.0. Note, libsofia-sip-ua-glib
   interface is not considered stable and may change in a future 1.12.x
@@ -48,28 +79,21 @@
 Contributors to this release
 ----------------------------
 
-<list of people who contributed to _this_ release
- - update as people's patches are added, or when you commit stuff
- - current development team members (see AUTHORS) may be omitted,
-   or listed at the end of the contribur list (depending on the scope 
-   of the work done since the last release)
- - name of the contributor should be enough (email addresses in AUTHORS),
-   plus a _brief_ description of what was contributed
- - roughly sorted by number of patches accepted
-/> 
-
+- Mikhail Zabaluev (bug fixes)
+- Fabio Margarido (bug fixes)
+- Martti Mela (Open C port and extra functionality, bug fixes)
 - Kai Vehmanen (fixes to win32 VC6/2005 project files)
+- Pekka Pessi (everything else)
 
 See the AUTHORS file in the distribution package.
 
 Notes on new features
 ---------------------
 
-<information about major new features
- - new/changed/removed functionality
- - links to further documentation
- - section may be omitted for minor releases
-/> 
+The route to the outbound proxy can now be specified as an explicit route
+set.
+
+The TCP transport can use CR-LF keepalive and CR-LF PING-PONG messages.
 
 IPv6 support can now be disabled in VC6/VC2005 builds, by
 setting SU_HAVE_IN6 to zero `win32/sofia-sip/su_configure.h'.
@@ -78,14 +102,53 @@
 libsofia-sip-ua-glib and for several test apps have been added under
 sofia-sip/open_c.
 
+New SIP headers are not available by default. Application must enable them
+with sip_update_default_mclass() and sip_extend_mclass().
+
 Bugs fixed in this release
 --------------------------
 
-< notable bugs fixed in this release
- - check the sf.net bug tracker; see closed bugs,
-   sorted by closing date
- - other bugs as fixed in CVS/darcs
-/>
-
-- Fixed #1472682 sf.net bug: ACK does not find INVITE when
-  To URI has been changed.
+- Fixed sf.net bug #1804248: nua_prack() now works. 
+  Thanks to Fabio Margarido for sending the patch.
+- Fixed sf.net bug 1803686: nua_destroy() can now be called from inside 
+  nua event callback.
+  Thanks to Mikhail Zabaluev for reporting the problem.
+- SIP Content-Length structure was casted to one with 64-bit integer instead 
+  of 32-bit, so message body was not parsed on 64-bit big-endian platform.
+  Thanks to Martin Drasar for hunting down the bug.
+- Authentication scheme token was compared as case-sensitive on client side.
+  Thanks to Russell McConnachie for reporting this problem.
+- Fixed sf.net bug #1706629: in-dialog requests not routed according to the
+  dialog route. Problem was because the outbound proxy was not handles as
+  RECOMMENDED by RFC 3261. The new tag NUTAG_INITIAL_ROUTE() allows correct
+  handling of requests.
+- Fixed problems in nua state engines (call setup failing if some messages 
+  were re-ordered or crashing when they were lost)
+  Thanks to Michail Jerris, Anthony Minessale, and others in Freeswitch
+  project for hunting down these bugs and reporting them
+- When nua generates Contact URI, the user-specified URI parameters are now
+  overriden by actual transport parameters (e.g., transport=tcp)
+  Thanks to Mikhail Zabaluev for submitting the patch.
+- Fixed sf.net bug #1750691: used to send ACK&BYE when extra 200 OK is
+  received and the 200 OK did not match any client transaction.
+  Thanks to Mikhail Zabaluev for reporting the problem.
+- Fixed problem of un-escaping reserved characters in URIs 
+  Thanks to Jan van den Bosch, Fabio Margarido and Mikhail Zabaluev for
+  reporting the problem.
+- Fixed missing links in doxygen-generated documentation
+  Thanks to Jerry Richards for reporting this problem.
+- Fixed timing problem with CANCELed INVITE transactions.
+  Thanks to Fabio Margarido for reporting this problem.
+- Fixed sf.net bug #1771243: tport_check_trunc() does not block anymore
+  Thanks to Erland Lwin for reporting the problem
+- Fixed sf.net bug #1733323: extra tag arguments were used by 
+  nta_outgoing_tcancel().
+  Thanks to Fabio Margarido for reporting this problem.
+- Fixed sf.net bug #1747149: sdp_session_cmp() ignored some m= lines
+  (e.g., new SDP in re-INVITE was sometimes ignored)
+  Thanks to Mikhail Zabaluev for reporting the problem.
+- Fixed sf.net bug #1726034: crash in msg_as_string() with too large messages 
+- Fixed sf.net bug #1472682: ACK did not find INVITE server transaction when
+  the To URI had been changed.
+- Do not block when making a TCP connect()ion in tport.
+  Thanks to Mikhail Zabaluev for submitting the patch.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/Makefile.am	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/Makefile.am	Thu Oct 11 10:16:59 2007
@@ -51,3 +51,8 @@
 endif
 
 .PHONY = $(PHONY)
+
+CLEANFILES = docs/*.doxytags
+
+distclean-local:
+	-rm -rf docs/html

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c	Thu Oct 11 10:16:59 2007
@@ -88,6 +88,9 @@
     NULL
   }};
 
+static int su_source_port_init(su_port_t *self, su_port_vtable_t const *vtable);
+static void su_source_port_deinit(su_port_t *self);
+
 static void su_source_lock(su_port_t *self, char const *who);
 static void su_source_unlock(su_port_t *self, char const *who);
 static void su_source_incref(su_port_t *self, char const *who);
@@ -115,7 +118,7 @@
 static void su_source_run(su_port_t *self);
 static void su_source_break(su_port_t *self);
 static su_duration_t su_source_step(su_port_t *self, su_duration_t tout);
-static int su_source_own_thread(su_port_t const *port);
+static int su_source_thread(su_port_t *self, enum su_port_thread_op op);
 static int su_source_add_prepoll(su_port_t *port,
 				 su_root_t *root, 
 				 su_prepoll_f *, 
@@ -147,13 +150,11 @@
       su_source_run,
       su_source_break,
       su_source_step,
-      su_source_own_thread,
+      su_source_thread,
       su_source_add_prepoll,
       su_source_remove_prepoll,
       su_base_port_timers,
       su_source_multishot,
-      su_base_port_threadsafe,
-      /*su_source_yield*/ NULL,
       /*su_source_wait_events*/ NULL,
       su_base_port_getmsgs,
       su_base_port_getmsgs_from,
@@ -177,6 +178,8 @@
   su_base_port_t   sup_base[1];
   
   GThread         *sup_tid;
+  GStaticMutex     sup_obtained[1];
+
   GStaticMutex     sup_mutex[1];
 
   GSource         *sup_source;	/**< Backpointer to source */
@@ -258,37 +261,51 @@
 /*=============== Private function definitions ===============*/
 
 /** Initialize source port */
-int su_source_port_init(su_port_t *self,
-			GSource *gs,
-			su_port_vtable_t const *vtable)
+static int su_source_port_init(su_port_t *self,
+			       su_port_vtable_t const *vtable)
 {
-  if (su_base_port_init(self, vtable) < 0)
-    return -1;
+  GSource *gs = (GSource *)((char *)self - offsetof(SuSource, ss_port));
 
   self->sup_source = gs;
-  self->sup_tid = g_thread_self();
+
+  g_static_mutex_init(self->sup_obtained);
 
   g_static_mutex_init(self->sup_mutex);
-  
-  return 0;
+
+  return su_base_port_init(self, vtable);
+}
+
+
+static void su_source_port_deinit(su_port_t *self)
+{
+  su_base_port_deinit(self);
+
+  g_static_mutex_free(self->sup_mutex);
+  g_static_mutex_free(self->sup_obtained);
+
+  if (self->sup_indices)
+    free (self->sup_indices), self->sup_indices = NULL;
+  if (self->sup_waits)
+    free (self->sup_waits), self->sup_waits = NULL;
+  if (self->sup_wait_cbs)
+    free (self->sup_wait_cbs), self->sup_wait_cbs = NULL;
+  if (self->sup_wait_args)
+    free (self->sup_wait_args), self->sup_wait_args = NULL;
+  if (self->sup_wait_roots)
+    free (self->sup_wait_roots), self->sup_wait_roots = NULL;
+
+  su_home_deinit(self->sup_base->sup_home);
 }
 
+
 /** @internal Destroy a port. */
 static 
 void su_source_finalize(GSource *gs)
 {
   SuSource *ss = (SuSource *)gs;
-  su_port_t *self = ss->ss_port;
-
   assert(gs);
-
   SU_DEBUG_9(("su_source_finalize() called\n"));
-
-  g_static_mutex_free(self->sup_mutex);
-
-  su_base_port_deinit(self);
-
-  su_home_deinit(self->sup_base->sup_home);
+  su_source_port_deinit(ss->ss_port);
 }
 
 void su_source_port_lock(su_port_t *self, char const *who)
@@ -330,16 +347,46 @@
 }
 
 /** @internal
- * Checks if the calling thread owns the port object.
+ *
+ * Change or query ownership of the port object.
  *
  * @param self pointer to a port object
+ * @param op operation 
  *
- * @retval true (nonzero) if the calling thread owns the port,
- * @retval false (zero) otherwise.
+ * @ERRORS
+ * @ERROR EALREADY port already has an owner (or has no owner)
  */
-int su_source_own_thread(su_port_t const *self)
+static int su_source_thread(su_port_t *self, enum su_port_thread_op op)
 {
-  return self == NULL || SU_SOURCE_OWN_THREAD(self);
+  GThread *me = g_thread_self();
+
+  switch (op) {
+
+  case su_port_thread_op_is_obtained:
+    if (self->sup_tid == me)
+      return 2;
+    else if (self->sup_tid)
+      return 1;
+    else
+      return 0;
+
+  case su_port_thread_op_release:
+    if (self->sup_tid != me)
+      return errno = EALREADY, -1;
+    self->sup_tid = NULL;
+    g_static_mutex_unlock(self->sup_obtained);
+    return 0;
+
+  case su_port_thread_op_obtain:
+    if (su_home_threadsafe(su_port_home(self)) == -1)
+      return -1;
+    g_static_mutex_lock(self->sup_obtained);
+    self->sup_tid = me;
+    return 0;
+
+  default:
+    return errno = ENOSYS, -1;
+  }
 }
 
 /* -- Registering and unregistering ------------------------------------- */
@@ -1044,7 +1091,7 @@
 
   if (ss) {
     self = ss->ss_port;
-    if (su_source_port_init(self, ss->ss_source, su_source_port_vtable) < 0)
+    if (su_source_port_init(self, su_source_port_vtable) < 0)
       g_source_unref(ss->ss_source), self = NULL;
   } else {
     su_perror("su_source_port_create(): g_source_new");

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.docs	Thu Oct 11 10:16:59 2007
@@ -6,8 +6,10 @@
  *
  * The Sofia @b bnf module contains macros and functions for parsing
  * text-based formats, for example, for SIP. The interface is described in
- * <bnf.h>, the <bnf.c> contains a #_bnf_table table used to classify
- * characters.
+ * <sofia-sip/bnf.h>.
+ *
+ * The interface used for validating hostnames and IP addresses is in
+ * <sofia-sip/hostdomain.h>.
  * 
  * @CONTACT Pekka Pessi <Pekka.Pessi at nokia.com>
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.aliases
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.aliases	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.aliases	Thu Oct 11 10:16:59 2007
@@ -28,7 +28,7 @@
  "TAG=\par \n" \
  "EVENTS=\par Events:\n" \
  "RESPONSES=\par Related Response Codes:\n" \
- "CFILE=\file" \
+ "CFILE=\internal \file" \
  "IFILE=\file" \
  "HI=\hideinitializer " \
  "HIDE=\hideinitializer " \

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.conf
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.conf	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.conf	Thu Oct 11 10:16:59 2007
@@ -23,6 +23,7 @@
 GROUP_GRAPHS         = NO
 EXTRACT_ALL          = NO
 EXTRACT_PRIVATE      = NO
+VERBATIM_HEADERS     = YES
 HIDE_UNDOC_RELATIONS = YES
 HIDE_UNDOC_MEMBERS   = YES
 HIDE_UNDOC_CLASSES   = YES

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.in
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.in	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.in	Thu Oct 11 10:16:59 2007
@@ -7,6 +7,7 @@
 
 @INCLUDE_PATH = . @srcdir@
 @INCLUDE = ../docs/Doxyfile.conf
+ at INCLUDE = ../sip/sip.doxyaliases
 
 GENERATE_TAGFILE    = docs.doxytags
 
@@ -28,4 +29,6 @@
 TAGFILES            += nua.doxytags=nua
 TAGFILES            += features.doxytags=features
 
+
+
 EXAMPLE_PATH = @srcdir@/../sip

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Makefile.am	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/Makefile.am	Thu Oct 11 10:16:59 2007
@@ -40,7 +40,10 @@
 	from=700 to=4800 \
 	/dev/null > $@
 
-CLEANFILES = Doxyfile.rfc
+CLEANFILES = Doxyfile.rfc *.doxytags
+
+distclean-local:
+	-rm -rf html
 
 # ----------------------------------------------------------------------
 # Sofia specific rules

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/conformance.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/conformance.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/conformance.docs	Thu Oct 11 10:16:59 2007
@@ -20,32 +20,37 @@
 <a href="#3313">RFC 3313</a> <br>
 <a href="#3323">RFC 3323</a> <br>
 <a href="#3326">RFC 3326</a> <br>
-</td><td>
 <a href="#3325">RFC 3325</a> <br>
 <a href="#3327">RFC 3327</a> <br>
+</td><td>
 <a href="#3329">RFC 3329</a> <br>
 <a href="#3361">RFC 3361</a> <br>
 <a href="#3420">RFC 3420</a> <br>
 <a href="#3428">RFC 3428</a> <br>
 <a href="#3486">RFC 3486</a> <br>
 <a href="#3515">RFC 3515</a> <br>
+<a href="#3581">RFC 3581</a> <br>
 <a href="#3608">RFC 3608</a> <br>
 <a href="#3680">RFC 3680</a> <br>
 <a href="#3824">RFC 3824</a> <br>
-</td><td>
 <a href="#3840">RFC 3840</a> <br>
 <a href="#3841">RFC 3841</a> <br>
 <a href="#3842">RFC 3842</a> <br>
+</td><td>
 <a href="#3856">RFC 3856</a> <br>
 <a href="#3857">RFC 3857</a> <br>
 <a href="#3858">RFC 3858</a> <br>
+<a href="#3859">RFC 3859</a> <br>
+<a href="#3860">RFC 3860</a> <br>
 <a href="#3891">RFC 3891</a> <br>
 <a href="#3892">RFC 3892</a> <br>
 <a href="#3903">RFC 3903</a> <br>
 <a href="#4028">RFC 4028</a> <br>
+<a href="#4168">RFC 4168</a> <br>
 <a href="#4320">RFC 4320</a> <br>
-<a href="#4566">RFC 4566</a> <br>
+<a href="#4488">RFC 4488</a> <br>
 </td><td>
+<a href="#4566">RFC 4566</a> <br>
 <a href="#2327">RFC 2327</a> <br>
 <a href="#3264">RFC 3264</a> <br>
 <a href="#3266">RFC 3266</a> <br>
@@ -53,6 +58,7 @@
 <a href="#3388">RFC 3388</a> <br>
 <a href="#3407">RFC 3407</a> <br>
 <a href="#3524">RFC 3524</a> <br>
+<a href="#3551">RFC 3551</a> <br>
 <a href="#3556">RFC 3556</a> <br>
 <a href="#3605">RFC 3605</a> <br>
 <a href="#3890">RFC 3890</a> <br>
@@ -98,7 +104,7 @@
     </td>
     <td>
 	The supported @RFC3261 methods are: @b REGISTER, @b OPTIONS, @b
-	INVITE, @b ACK, @b CANCEL, @b BYE, as well as methods
+	INVITE, @b ACK, @b CANCEL, @b BYE, as well as extension methods
 	<a href="#2976"><b>INFO</b></a>,
 	<a href="#3262"><b>PRACK</b></a>,
         <a href="#3265"><b>SUBSCRIBE</b></a>,
@@ -116,7 +122,7 @@
 	@ref sip_accept "Accept",
 	@ref sip_accept_encoding "Accept-Encoding",
 	@ref sip_accept_language "Accept-Language",
-	@ref sip_alert_info "Alert-Info" (@VERSION_1_12_7),
+	@ref sip_alert_info "Alert-Info" (extension in @VERSION_1_12_7),
 	@ref sip_allow "Allow",
 	@ref sip_authentication_info "Authentication-Info",
 	@ref sip_authorization "Authorization",
@@ -138,12 +144,18 @@
 	@ref sip_min_expires "Min-Expires",
 	@ref sip_mime_version "MIME-Version",
 	@ref sip_organization "Organization",
+	@ref sip_p_asserted_identity "P-Asserted-Identity" 
+        (extension in @VERSION_1_12_7),
+	@ref sip_p_preferred_identity "P-Preferred-Identity" 
+        (extension in @VERSION_1_12_7),
 	@ref sip_priority "Priority",
 	@ref sip_proxy_authenticate "Proxy-Authenticate",
 	@ref sip_proxy_authorization "Proxy-Authorization",
 	@ref sip_proxy_require "Proxy-Require",
 	@ref sip_record_route "Record-Route",
-	@ref sip_reply_to "Reply-To" (@VERSION_1_12_7),
+	@ref sip_refer_sub "Refer-Sub" (@VERSION_1_12_5),
+	@ref sip_remote_party_id "Remote-Party-ID" (extension in @VERSION_1_12_7),
+	@ref sip_reply_to "Reply-To" (extension in @VERSION_1_12_7),
 	@ref sip_require "Require",
 	@ref sip_retry_after "Retry-After",
 	@ref sip_route "Route",
@@ -167,7 +179,7 @@
     <td>
 	- Automatic escaping of reserved characters has not been
 	  implemented.
-	- Using NUL (zero byte) in doublequoted strings has not been implemented
+	- Using NUL (zero byte) in double-quoted strings has not been implemented
    </td>
 </tr>
 
@@ -196,7 +208,7 @@
 	Only one SIP message is accepted per UDP message, as per @RFC3261.
     </td>
     <td>
-	There is experimental support for SCTP, too.
+	There is <a href="#4168">experimental support for SCTP</a>, too.
     </td>
 </tr>
 
@@ -212,8 +224,12 @@
 	User-Agent and Proxy modes.
 
 	Default values for SIP timers are those specified by @RFC3261. The
-	defaults for T1, T1x64, T2 and T4 can be changed via
+	values for T1, T1x64, T2 and T4 can be changed via
         configuration tags defined in <sofia-sip/nta_tag.h>.
+
+	The SIP timer C is implemented from @VERSION_1_12_7. Also, its value
+	can be changed via configuration tag NTATAG_TIMER_C() defined in
+	<sofia-sip/nta_tag.h>.
     </td>
     <td>
 	&nbsp;
@@ -462,10 +478,13 @@
 	@RFC3325: Asserted Identity
     </th>
     <td>
-	Sofia-SIP provides <a href="#3261.19">generic support</a> for
-	extension headers and parameters. P-Asserted-Identity and
-	P-Preferred-Identity are supported as supported as @ref
-	sip_unknown "extension headers".
+	Sofia-SIP supports 
+	@ref sip_p_asserted_identity "P-Asserted-Identity" and
+	@ref sip_p_preferred_identity "P-Preferred-Identity" headers
+        (generating, parsing and syntax checking). Also the non-standard
+        header @ref sip_remote_party_id "Remote-Party-ID" is supported.
+
+        @NEW_1_12_7.
     </td>
     <td>
 	Not implemented:
@@ -733,10 +752,11 @@
     </td>
 </tr>
 
-<a name="3856"></a>
+<a name="3856"></a><a name="3859"></a>
 <tr valign=top>
     <th align="left">
-	@RFC3856: Presence
+	@RFC3856: Presence <br />
+	@RFC3859: Common Profile for Presence
     </th>
     <td>
 	Sofia-SIP supports <a href="#3265">generic SIP event support</a> for
@@ -778,7 +798,22 @@
           - Including correct @ref sip_event "Event" and
             @ref sip_accept "Accept" headers in the request (if needed)
 	- Processing notifications for winfo events:
-	  - Processing watcherxinfo XML documents
+	  - Processing watcherinfo XML documents
+    </td>
+</tr>
+
+<a name="3860"></a>
+<tr valign=top>
+    <th align="left">
+	@RFC3860: Common Profile for IM
+    </th>
+    <td>
+	Sofia-SIP supports handling of any URI type. Sofia-SIP parses "im:"
+        URIs.
+    </td>
+    <td>
+        Application must take care of:
+	- resolving the "im:" URI
     </td>
 </tr>
 
@@ -834,7 +869,7 @@
     <td>
         Application must take care of:
         - Including correct @ref sip_event "Event" in the request
-        - Permanently storing SIP-ETag
+        - Permanently storing @SIPETag
     </td>
 </tr>
 
@@ -864,6 +899,26 @@
     </td>
 </tr>
 
+<a name="4168"></a>
+<tr valign=top>
+    <th align="left">
+	@RFC4168: SCTP as Transport for SIP
+    </th>
+    <td>
+	The transport=sctp URI parameter is supported. The SCTP transport
+	protocol is supported as experimental. It is enabled with
+	configure script argument --enable-sctp.
+
+	The framing of SIP messages over SCTP is not specified clearly in
+	@RFC4168. It is possible to send SIP messages smaller than 64K over
+	SCTP.
+    </td>
+    <td>
+	&nbsp;
+    </td>
+</tr>
+
+
 <a name="4320"></a>
 <tr valign=top>
     <th align="left">
@@ -886,6 +941,28 @@
     </td>
 </tr>
 
+<a name="4488"></a>
+<tr valign=top>
+    <th align="left">
+	@RFC4488: Suppression of REFER Implicit Subscription
+    </th>
+    <td>
+	Sofia-SIP supports @ref sip_refer_sub "Refer-Sub" header
+	(generating, parsing and syntax checking).
+
+        The implicit subscription is suppressed by @nua, if the @ReferSub:
+        true header is included in the REFER 
+	request (@ref nua_refer "on server side") or
+	response (@ref nua_i_refer "on client side").
+
+	@NEW_1_12_5
+    </td>
+    <td>
+        The REFER client application must include SIPTAG_REFER_SUB_STR("true")
+	in the nua_refer() tags.
+    </td>
+</tr>
+
 </table>
 
 <table border=1 cellpadding=4 cellspacing=0>
@@ -922,7 +999,7 @@
 	"a=inactive", @ref sdp_rtpmap_s "a=rtpmap", and "a=fmtp" are parsed.
 
 	The implementation partially implements @RFC4566. Note that
-	definiton of 'token' was updated in @RFC4566 and the parser has not
+	definition of 'token' was updated in @RFC4566 and the parser has not
 	been updated yet.
     </td>
     <td>
@@ -1023,6 +1100,23 @@
     </td>
 </tr>
 
+
+<a name="3551"></a>
+<tr valign=top>
+    <th align="left">
+	@RFC3551: RTP/AVP
+    </th>
+    <td>
+	Sofia-SIP recognizes the RTP payload types for well-known audio and
+	video codecs defined in @RFC3551.
+    </td>
+    <td>
+        Application must take care of:
+	- Audio or video processing
+        - Generating a=rtpmap or a=fmtp lines when needed 
+    </td>
+</tr>
+
 <a name="3556"></a>
 <tr valign=top>
     <th align="left">

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/mainpage.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/mainpage.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/docs/mainpage.docs	Thu Oct 11 10:16:59 2007
@@ -260,7 +260,7 @@
 - int8_t
 - uint8_t
 
-To use these data types you must include the <su_types.h> header, which
+To use these data types you must include the <sofia-sip/su_types.h> header, which
 takes care of including correct file. If @b su includes are not available,
 you must include the following code segment to each file where you plan to
 use them:
@@ -298,7 +298,7 @@
 The ntohs() function converts the unsigned short integer netshort
 from network byte order to host byte order.
 
-You need to include <netinet/in.h> or <su.h> to use these functions.
+You need to include <netinet/in.h> or <sofia-sip/su.h> to use these functions.
 
 @subsection port_struct Packing structures
 
@@ -467,7 +467,7 @@
 not need to keep track of the allocated memory and free every allocated block 
 separately.
 
-See documentation of <su_alloc.h> and @ref su_alloc "memory managment tutorial"
+See documentation of <sofia-sip/su_alloc.h> and @ref su_alloc "memory managment tutorial"
 for more information of memory management services.
 
 @subsection contextdata Memory management of context data
@@ -532,7 +532,7 @@
 
 @section testing Testing Your Code
 
-See <tstdef.h> for example of how to write module tests with macros provided
+See <sofia-sip/tstdef.h> for example of how to write module tests with macros provided
 by Sofia.
 
 Here are some ideas of what you should test:

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http.docs	Thu Oct 11 10:16:59 2007
@@ -15,7 +15,7 @@
  *
  * @section http_overview Overview
  *
- * Each HTTP header has a structure defined for it in <http.h>. All the
+ * Each HTTP header has a structure defined for it in <sofia-sip/http.h>. All the
  * variables, objects and functions related to a particular HTTP header are
  * documented in a <a href="modules.html">submodule</a> for the header. In
  * addition to the header structure, there is defined a @em header @em class

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_tag.c.in
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_tag.c.in	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_tag.c.in	Thu Oct 11 10:16:59 2007
@@ -30,7 +30,7 @@
  *
  */
 
-/**@file http_tag.c  HTTP Tag classes
+/**@internal @file http_tag.c  HTTP Tag classes
  *
  * This file is autogenerated from <http_tag.c.in>.
  *

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/Doxyfile.in
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/Doxyfile.in	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/Doxyfile.in	Thu Oct 11 10:16:59 2007
@@ -1,7 +1,9 @@
 PROJECT_NAME         = "ipt"
-OUTPUT_DIRECTORY     = ../docs/html/ips
+OUTPUT_DIRECTORY     = ../docs/html/ipt
 
-INPUT 		     = @srcdir@/ipt.docs @srcdir@/sofia-sip @srcdir@ . 
+INPUT 		     = @srcdir@/ipt.docs
+INPUT               += @srcdir@/sofia-sip/base64.h @srcdir@/base64.c
+INPUT               += @srcdir@/sofia-sip/token64.h @srcdir@/token64.c
 
 @INCLUDE_PATH = . @srcdir@
 @INCLUDE = ../docs/Doxyfile.conf

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/ipt.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/ipt.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/ipt.docs	Thu Oct 11 10:16:59 2007
@@ -15,6 +15,6 @@
  * @section ipt_overview Overview
  *
  * This module contain some routines useful for IPT applications, like 
- * - <sofia-sip/base64.h> BASE64 encoding/decoding, 
- * - <sofia-sip/token64.h> encoding/decoding binary as SIP/HTTP token, 
+ * - <sofia-sip/base64.h> BASE64 encoding/decoding, and
+ * - <sofia-sip/token64.h> encoding/decoding binary as SIP/HTTP token.
  */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/base64.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/base64.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/base64.h	Thu Oct 11 10:16:59 2007
@@ -57,7 +57,7 @@
 /** Calculate size of n bytes encoded in base64 */
 #define BASE64_SIZE(n) ((((n) + 2) / 3) * 4)
 
-/** Calculate size of n bytes encoded in base64 sans trailing =. @NEW_1_12_5 */
+/** Calculate size of n bytes encoded in base64 sans trailing =. @NEW_1_12_5. */
 #define BASE64_MINSIZE(n) ((n * 4 + 2) / 3)
 
 SOFIA_END_DECLS

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/token64.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/token64.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/token64.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@CFILE token64.c  
+/**@internal @file token64.c  
  *
  * Token encoding.
  *
@@ -41,7 +41,7 @@
 static const char code[65] = 
 "0123456789-abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
-/** Encode data as an http token. 
+/** Encode data as a SIP/HTTP token. 
  *
  * @note
  * A token is case-independent, so this is really not a good idea.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/Doxyfile.in
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/Doxyfile.in	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/Doxyfile.in	Thu Oct 11 10:16:59 2007
@@ -20,7 +20,7 @@
 
 GENERATE_TAGFILE    = ../docs/iptsec.doxytags
 
-ALIASES 	   += 
+ALIASES 	   +=  "iptsec=@ref index \"iptsec\""
 
 PREDEFINED         += SOFIA_EXTEND_AUTH_CLIENT=1
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c	Thu Oct 11 10:16:59 2007
@@ -205,15 +205,17 @@
  * processed.
  *
  * @bug
- * The result can be quite unexpected if there are more than one
- * authenticator with the given type (specified by @a crcl). In principle,
- * SIP allows more than one challenge for a single request.
+ * In principle, SIP allows more than one challenge for a single request. 
+ * For example, there can be multiple proxies that each challenge the
+ * client. The result of storing authentication info can be quite unexpected
+ * if there are more than one authenticator with the given type (specified
+ * by @a credential_class).
  *
  * @retval number of challenges to updated
  * @retval 0 when there was no challenge to update
  * @retval -1 upon an error
  *
- * @NEW_1_12_5
+ * @NEW_1_12_5.
  */
 int auc_info(auth_client_t **auc_list,
 	     msg_auth_info_t const *info,
@@ -525,7 +527,7 @@
  * @retval 1 when authorization can proceed
  * @retval 0 when there is not enough credentials
  *
- * @NEW_1_12_5
+ * @NEW_1_12_5.
  */
 int auc_has_authorization(auth_client_t **auc_list)
 {

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_http.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_http.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_http.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file auth_module_http.c
  * @brief Authenticate HTTP request
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_sip.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_sip.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_sip.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file auth_module_sip.c
  * @brief Authenticate SIP request
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file auth_plugin.c
  * @brief Plugin interface for authentication verification modules.
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@file iptsec_debug.c
+/**@internal @file iptsec_debug.c
  * @brief Debug log for IPTSEC module.
  * 
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -36,25 +36,34 @@
 
 #include "iptsec_debug.h"
 
-/**@var IPTSEC_DEBUG
+#if DOXYGEN_ONLY
+/** @defgroup iptsec_env  Environment Variables Used by iptsec Module
  *
- * Environment variable determining the debug log level for @b iptsec
+ * @brief Environment variables used by @iptsec module are listed here.
+ *
+ * The #IPTSEC_DEBUG variable sets the debug level.
+ */
+
+/**@ingroup iptsec_env
+ *
+ * Environment variable determining the debug log level for @iptsec
  * module.
  *
  * The IPTSEC_DEBUG environment variable is used to determine the debug
- * logging level for @b iptsec module. The default level is 3.
+ * logging level for @iptsec module. The default level is 3.
  * 
- * @sa <sofia-sip/su_debug.h>, iptsec_log, SOFIA_DEBUG
+ * @sa <sofia-sip/su_debug.h>, #iptsec_log, #SOFIA_DEBUG
  */
-extern char const IPTSEC_DEBUG[];
+extern IPTSEC_DEBUG;
+#endif
 
 #ifndef SU_DEBUG
 #define SU_DEBUG 3
 #endif
 
-/**Debug log for @b iptsec module. 
+/** Common log for client and server components.
  * 
- * The iptsec_log is the log object used by @b iptsec module. The level of
+ * The iptsec_log is the log object used by @iptsec module. The level of
  * #iptsec_log is set using #IPTSEC_DEBUG environment variable.
  */
 su_log_t iptsec_log[] = { SU_LOG_INIT("iptsec", "IPTSEC_DEBUG", SU_DEBUG) };

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.h	Thu Oct 11 10:16:59 2007
@@ -26,7 +26,8 @@
 /** Defined when <iptsec_debug.h> has been included. */
 #define IPTSEC_DEBUG_H
 
-/**@file iptsec_debug.h
+/**@internal
+ * @file iptsec_debug.h
  * @brief Debug log for IPTSEC module.
  * 
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -38,7 +39,7 @@
 
 SOFIA_BEGIN_DECLS
 
-/** Common log for application and srvlib components. */
+/** Common log for client and server components. */
 SOFIAPUBVAR su_log_t iptsec_log[];
 
 SOFIA_END_DECLS

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h	Thu Oct 11 10:16:59 2007
@@ -91,12 +91,12 @@
   int (*auc_info)(auth_client_t *ca, msg_auth_info_t const *ai);
 
 #if SOFIA_EXTEND_AUTH_CLIENT
-  /** Clear credentials (user/pass). @NEW_1_12_6 */
+  /** Clear credentials (user/pass). @NEW_1_12_6. */
   int (*auc_clear)(auth_client_t *ca);
 #endif
 };
 
-/** Check if authentication client has been extended. @NEW_1_12_6 */
+/** Check if authentication client has been extended. @NEW_1_12_6. */
 #define AUTH_CLIENT_IS_EXTENDED(ca)					\
   ((ca)->ca_auc->auc_plugin_size >					\
    (int)offsetof(auth_client_plugin_t, auc_clear)			\

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/Doxyfile.in
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/Doxyfile.in	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/Doxyfile.in	Thu Oct 11 10:16:59 2007
@@ -7,6 +7,8 @@
 @INCLUDE = ../docs/Doxyfile.conf
 @INCLUDE = ../sip/sip.doxyaliases
 
+EXCLUDE_PATTERNS     += msg_test*.h msg_test*.c
+
 TAGFILES             += ../docs/ipt.doxytags=../ipt  \
 			../docs/su.doxytags=../su    \
 			../docs/sip.doxytags=../sip  \

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@file msg.c Message object implementation.
+/**@internal @file msg.c Message object implementation.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg.docs	Thu Oct 11 10:16:59 2007
@@ -142,7 +142,7 @@
 fragments form a dual-linked list known as @e fragment @e chain as shown in
 the above figure. The memory buffers for the message, the fragment chain,
 and a whole lot of other stuff is held by the generic message type, #msg_t,
-defined in <msg.h>. The internal structure of #msg_t is known only within @b
+defined in <sofia-sip/msg.h>. The internal structure of #msg_t is known only within @b
 msg module and it is opaque to other modules.
 
 The @b msg parser engine also drives the reverse process, invoking the
@@ -262,7 +262,7 @@
 structure. The @e sip_size indicates the size of the structure - the
 application can extend the parser and #sip_t structure beyond the
 original size. The @e sip_flags contains various flags used during the
-parsing and printing process. They are documented in the <msg.h>. These
+parsing and printing process. They are documented in the <sofia-sip/msg.h>. These
 boilerplate members are followed by the pointers to various message
 elements and headers.
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,8 @@
  *
  */
 
-/**@ingroup msg_parser
+/**@internal 
+ * @ingroup msg_parser
  * @file msg_generic.c
  * @brief Functions for generic headers
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c	Thu Oct 11 10:16:59 2007
@@ -67,36 +67,6 @@
 /** Protocol version of MIME */
 char const msg_mime_version_1_0[] = "MIME/1.0";
 
-/* Internally used version of msg_header_t */
-union msg_mime_u
-{
-  msg_common_t    sh_common[1];
-  struct {
-    msg_common_t  shn_common;
-    msg_header_t *shn_next;
-  }               sh_header_next[1];
-
-  msg_multipart_t           sh_multipart[1];
-
-  msg_accept_t              sh_accept[1];
-  msg_accept_any_t          sh_accept_any[1];
-  msg_accept_charset_t      sh_accept_charset[1];
-  msg_accept_encoding_t     sh_accept_encoding[1];
-  msg_accept_language_t     sh_accept_language[1];
-  msg_content_disposition_t sh_content_disposition[1];
-  msg_content_encoding_t    sh_content_encoding[1];
-  msg_content_id_t          sh_content_id[1];
-  msg_content_language_t    sh_content_language[1];
-  msg_content_length_t      sh_content_length[1];
-  msg_content_location_t    sh_content_location[1];
-  msg_content_type_t        sh_content_type[1];
-  msg_mime_version_t        sh_mime_version[1];
-  msg_warning_t             sh_warning[1];
-  msg_unknown_t             sh_unknown[1];
-  msg_separator_t           sh_separator[1];
-  msg_payload_t             sh_payload[1];
-};
-
 #include <sofia-sip/msg_parser.h>
 #include <sofia-sip/msg_mime_protos.h>
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.awk
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.awk	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.awk	Thu Oct 11 10:16:59 2007
@@ -54,25 +54,26 @@
   split("", NAMES);
   split("", Comments);
   split("", COMMENTS);
-  split("", experimental);
 
   # indexed by the C name of the header
   split("", Since);		# Non-NUL if extra
   split("", Extra);		# Offset in extra headers
 
+  total = 0;
+  ordinary = 0;
+  basic = 0;
+  extra = 0;
   without_experimental = 0;
+
   template="";
   template1="";
   template2="";
   template3="";
   prefix="";
   tprefix="";
-  extra=0;
   failed=0;
   success=0;
 
-  extra_struct = "msg_pub_extra";
-
   ERRNO="error";
 }
 
@@ -159,7 +160,6 @@
   symbols[name] = comment;
   if (since) {
     Since[name] = since;
-    Extra[name] = extra++;
   }
 
   expr = (without_experimental > 0 && do_hash);
@@ -210,7 +210,7 @@
 
 # 
 # Repeat each line in the footer containing the magic replacement
-# pattern with a instance of all headers
+# pattern with an instance of all headers
 #
 function process_footer (text)
 { 
@@ -368,9 +368,14 @@
 }
 
 /^#### EXTRA HEADER LIST STARTS HERE ####$/ { HLIST=1; templates(); }
+HLIST && /^#### DEFAULT HEADER LIST ENDS HERE ####$/ { basic=total; }
 HLIST && /^#### EXPERIMENTAL HEADER LIST STARTS HERE ####$/ { 
-  without_experimental=total; }
-HLIST && /^[a-z]/ { protos($1, $0, 0, $2); headers[total++] = $1; }
+  without_experimental = total; }
+
+HLIST && /^[a-z]/ { protos($1, $0, 0, $2); 
+  headers[total++] = $1; 
+  Extra[$1] = extra++;
+}
 /^#### EXTRA HEADER LIST ENDS HERE ####$/ { HLIST=0;  }
 
 /^ *\/\* === Headers start here \*\// { in_header_list=1;  templates(); }
@@ -396,15 +401,117 @@
   if (!NO_MIDDLE)
     protos(n, $0, 0);
 
-  headers[total++] = n;
+  headers[total] = n; total++; ordinary++;
+}
+
+function print_parser_table(struct, scope, name, N, N_EXPERIMENTAL)
+{
+  if (PT) {
+    if (N > ordinary) {
+      printf("/* Ordinary %u, extra %u, experimental %u */\n",
+	     ordinary, N - ordinary, N_EXPERIMENTAL - N) > PT;
+      printf("struct %s {\n", struct) > PT;
+      printf("  %s_t base;\n", module) > PT;
+      printf("  msg_header_t *extra[%u];\n", N - ordinary) > PT;
+      if (N != N_EXPERIMENTAL) {
+	print "#if SU_HAVE_EXPERIMENTAL" > PT;
+	printf("  msg_header_t *extra[%u];\n", N_EXPERIMENTAL - N) > PT;
+	print "#endif" > PT;
+      }
+      printf("};\n\n") > PT;
+    }
+
+    printf("%s\n", scope) > PT;
+    printf("msg_mclass_t const %s[1] = \n{{\n", name) > PT;
+    printf("# if defined (%s_HCLASS)\n", toupper(module)) > PT;
+    printf("  %s_HCLASS,\n", toupper(module)) > PT;
+    printf("#else\n") > PT;
+    printf("  {{ 0 }},\n") > PT;
+    printf("#endif\n") > PT;
+    printf("  %s_VERSION_CURRENT,\n", toupper(module)) > PT;
+    printf("  %s_PROTOCOL_TAG,\n", toupper(module)) > PT;
+    printf("#if defined (%s_PARSER_FLAGS)\n", toupper(module)) > PT;
+    printf("  %s_PARSER_FLAGS,\n", toupper(module)) > PT;
+    printf("#else\n") > PT;
+    printf("  0,\n") > PT;
+    printf("#endif\n") > PT;
+    if (N > ordinary) {
+      printf("  sizeof (struct %s),\n", struct) > PT;
+    }
+    else {
+      printf("  sizeof (%s_t),\n", module) > PT;
+    }
+    printf("  %s_extract_body,\n", module) > PT;
+
+    len = split("request status separator payload unknown error", unnamed, " ");
+
+    for (i = 1; i <= len; i++) {
+      printf("  {{ %s_%s_class, msg_offsetof(%s_t, %s_%s) }},\n", 
+	     tprefix, unnamed[i], module, prefix, unnamed[i]) > PT;
+    }
+    if (multipart) {
+      printf("  {{ %s_class, msg_offsetof(%s_t, %s_multipart) }},\n",
+	     multipart, module, prefix) > PT;
+    } else {
+      printf("  {{ NULL, 0 }},\n") > PT;
+    }
+    if (MC_SHORT_SIZE) {
+      printf("  %s_short_forms, \n", module) > PT;      
+    }
+    else {
+      printf("  NULL, \n") > PT;
+    }
+    printf("  %d, \n", MC_HASH_SIZE) > PT;
+    if (N != N_EXPERIMENTAL) {
+      print "#if SU_HAVE_EXPERIMENTAL" > PT;
+      printf("  %d,\n", N_EXPERIMENTAL) > PT;
+      print "#else" > PT;
+    }
+    printf("  %d,\n", N) > PT;
+    if (N != N_EXPERIMENTAL) {
+      print "#endif" > PT;
+    }
+
+    printf("  {\n") > PT;
+
+    for (j = 0; j < MC_HASH_SIZE; j++) {
+      c = (j + 1 == MC_HASH_SIZE) ? "" : ",";
+      if (j in header_hash) {
+	n = header_hash[j];
+	i = index_hash[j];
+
+        flags = header_flags[n]; if (flags) flags = ",\n      " flags;
+
+	if (i >= N) {
+	  print "#if SU_HAVE_EXPERIMENTAL" > PT;
+	}
+
+	if (i >= ordinary) {
+	  printf("    { %s_%s_class,\n" \
+		 "      msg_offsetof(struct %s, extra[%u])%s }%s\n", 
+		 tprefix, n, struct, Extra[n], flags, c) > PT;
+	}
+	else {
+	  printf("    { %s_%s_class, msg_offsetof(%s_t, %s_%s)%s }%s\n", 
+		 tprefix, n, module, prefix, n, flags, c) > PT;
+	}
+
+	if (i >= N) {
+	  printf("#else\n    { NULL, 0 }%s\n#endif\n", c) > PT;
+	}
+      }
+      else {
+	printf("    { NULL, 0 }%s\n", c) > PT;
+      }
+    }
+    printf("  }\n}};\n\n") > PT;
+
+    }
 }
 
 END {
   if (failed) { exit };
 
-  if (without_experimental == 0)
-    without_experimental = total;
-
   if (!NO_LAST) {
     protos("unknown", "/**< Unknown headers */", -3);
     protos("error", "/**< Erroneous headers */", -4);
@@ -429,8 +536,6 @@
     getline footer < TEMPLATE;
     RS=RS0;
 
-    module_struct = module "_t";
-
     sub(/.*[\/]/, "", TEMPLATE);
     gsub(/#AUTO#/, auto, header);
     gsub(/#DATE#/, "@date Generated: " date, header);
@@ -451,9 +556,9 @@
 	  n = shorts[i];
         flags = header_flags[n]; if (flags) flags = ",\n      " flags;
 	  
-	  printf("  { /* %s */ %s_%s_class, msg_offsetof(%s_t, %s_%s)%s }%s\n", 
-		 substr(lower_case, i, 1), 
-		 tprefix, n, module, prefix, n, flags, c)	\
+	printf("  { /* %s */ %s_%s_class, msg_offsetof(%s_t, %s_%s)%s }%s\n", 
+	       substr(lower_case, i, 1), 
+	       tprefix, n, module, prefix, n, flags, c)	\
 	    > PT;
 	}
 	else {
@@ -466,67 +571,49 @@
 
     # printf("extern msg_hclass_t msg_multipart_class[];\n\n") > PT;
 
-    if (extra > 0) {
-      printf("struct %s {\n", extra_struct) > PT;
-      printf("  %s base;\n", module_struct) > PT;
-      if (total - without_experimental < extra) {
-	printf("  msg_header_t *extra[%u];\n", 
-	       extra - (total - without_experimental)) > PT;
-      }
-      if (total - without_experimental > 0) {
-	print "#if SU_HAVE_EXPERIMENTAL" > PT;
-	printf("  msg_header_t *experimental[%u];\n", 
-	       total - without_experimental) > PT;
-	print "#endif" > PT;
-      }
-      printf("};\n\n") > PT;
-      module_struct = "struct " extra_struct;
-    }
+    if (basic == 0) basic = total;
+    if (without_experimental == 0) without_experimental = total;
 
-    printf("msg_mclass_t const %s_mclass[1] = \n{{\n", module) > PT;
-    printf("# if defined (%s_HCLASS)\n", toupper(module)) > PT;
-    printf("  %s_HCLASS,\n", toupper(module)) > PT;
-    printf("#else\n") > PT;
-    printf("  {{ 0 }},\n") > PT;
-    printf("#endif\n") > PT;
-    printf("  %s_VERSION_CURRENT,\n", toupper(module)) > PT;
-    printf("  %s_PROTOCOL_TAG,\n", toupper(module)) > PT;
-    printf("#if defined (%s_PARSER_FLAGS)\n", toupper(module)) > PT;
-    printf("  %s_PARSER_FLAGS,\n", toupper(module)) > PT;
-    printf("#else\n") > PT;
-    printf("  0,\n") > PT;
-    printf("#endif\n") > PT;
-    printf("  sizeof (%s),\n", module_struct) > PT;
-    printf("  %s_extract_body,\n", module) > PT;
+    split("", header_hash);
+    split("", index_hash);
 
-    len = split("request status separator payload unknown error", unnamed, " ");
+    for (i = 0; i < basic; i++) {
+      n = headers[i];
+      h = hashed[n];
 
-    for (i = 1; i <= len; i++) {
-      printf("  {{ %s_%s_class, msg_offsetof(%s_t, %s_%s) }},\n", 
-	     tprefix, unnamed[i], module, prefix, unnamed[i]) > PT;
+      if (h < 0)
+	continue;
+
+      j = h % MC_HASH_SIZE; if (j == -0) j = 0;
+
+      for (; j in header_hash;) {
+	if (++j == MC_HASH_SIZE) {
+	  j = 0;
+	}
+      }
+
+      header_hash[j] = n;
+      index_hash[j] = i;
     }
-    if (multipart) {
-      printf("  {{ %s_class, msg_offsetof(%s_t, %s_multipart) }},\n",
-	     multipart, module, prefix) > PT;
-    } else {
-      printf("  {{ NULL, 0 }},\n") > PT;
+
+    m = module "_mclass";
+    s = "_d_" module "_t";
+
+    # Add basic headers
+    if (ordinary == basic) {
+      print_parser_table(s, "", m, basic, basic);
     }
-    if (MC_SHORT_SIZE) {
-      printf("  %s_short_forms, \n", module) > PT;      
+    else if (basic < without_experimental) {
+      print_parser_table(s, "", m, basic, basic);
     }
     else {
-      printf("  NULL, \n") > PT;
-    }
-    printf("  %d, \n", MC_HASH_SIZE) > PT;
-    printf ("#if SU_HAVE_EXPERIMENTAL\n" \
-	    "  %d,\n" \
-	    "#else\n" \
-	    "  %d,\n" \
-	    "#endif\n", \
-	    total, without_experimental) > PT;
-    printf("  {\n") > PT;
+      print_parser_table(s, "", m, without_experimental, basic);
+   }
 
-    for (i = 0; i < total; i++) {
+   if (0) {
+
+   # Hash extra headers
+   for (i = basic; i < total; i++) {
       n = headers[i];
       h = hashed[n];
 
@@ -542,38 +629,31 @@
       }
 
       header_hash[j] = n;
-      experimental2[j] = (i >= without_experimental);
+      index_hash[j] = i;
     }
 
-    for (i = 0; i < MC_HASH_SIZE; i++) {
-      c = (i + 1 == MC_HASH_SIZE) ? "" : ",";
-      if (i in header_hash) {
-	n = header_hash[i];
-        flags = header_flags[n]; if (flags) flags = ",\n      " flags;
+    if (basic < total) {
+      m = module "_ext_mclass";
+      s = "_e_" module "_s";
+      print_parser_table(s, "static", m, without_experimental, total);
+    }
 
-	if (experimental2[i]) {
-	  print "#if SU_HAVE_EXPERIMENTAL" > PT;
-	}
+    printf("msg_mclass_t const * %s_extended_mclass = %s;\n\n", module, m) > PT;
 
-	if (Since[n]) {
-	  printf("    { %s_%s_class,\n" \
-		 "      msg_offsetof(struct %s, extra[%u])%s }%s\n", 
-		 tprefix, n, extra_struct, Extra[n], flags, c) > PT;
-	}
-	else {
-	  printf("    { %s_%s_class, msg_offsetof(%s_t, %s_%s)%s }%s\n", 
-		 tprefix, n, module, prefix, n, flags, c) > PT;
-	}
+    }
 
-	if (experimental2[i]) {
-	  printf("#else\n    { NULL, 0 }%s\n#endif\n", c) > PT;
-	}
-      }
-      else {
-	printf("    { NULL, 0 }%s\n", c) > PT;
+    if (basic < total) {
+      printf("msg_hclass_t * const %s_extensions[] = {\n", module) > PT;
+      for (i = basic; i < total; i++) {
+	if (i == without_experimental) {
+	  print "#if SU_HAVE_EXPERIMENTAL" > PT;
+        }
+	printf("  %s_%s_class,\n", module, headers[i]) > PT;
       }
+      if (total != without_experimental)
+	print "#endif" > PT;
+      print "  NULL\n};\n\n" > PT;
     }
-    printf("  }\n}};\n\n") > PT;
   }
 
   exit success;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_event.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_event.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_event.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file nea_event.c
  * @brief Default MIME type for certain events.
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@file nea_server.c
+/**@internal @file nea_server.c
  * @brief Nokia Event API - event notifier implementation.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -65,7 +65,7 @@
 /** Number of primary views (with different MIME type or content) */
 #define NEA_VIEW_MAX (8)
 
-/** Server object, created for every notifier.
+/** @internal Server object, created for every notifier.
  */
 struct nea_server_s {
   su_home_t                 nes_home[1];
@@ -112,7 +112,7 @@
 };
 
 
-/** Supported events and their subscribers  */
+/** @internal Supported events and their subscribers  */
 struct nea_event_s {
   nea_event_t              *ev_next;
   nea_event_t             **ev_prev;
@@ -141,7 +141,7 @@
 
 typedef struct nea_event_queue_s nea_event_queue_t;
 
-/** Object representing particular view of event */
+/** @internal Object representing particular view of event */
 struct nea_event_view_s
 {
   nea_event_view_t *evv_next;
@@ -156,7 +156,7 @@
   unsigned          evv_reliable:1;     /**< Keep all notifications */
   unsigned:0;
 
-  /** Queued notification */
+  /** @internal Queued notification */
   struct nea_event_queue_s
   {
     nea_event_queue_t  *evq_next;
@@ -173,7 +173,7 @@
 #define evv_payload evv_head->evq_payload
 
 
-/** Subscription object 
+/** @internal Subscription object.
  */
 struct nea_sub_s {
   nea_sub_t        *s_next;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	Thu Oct 11 10:16:59 2007
@@ -4538,7 +4538,7 @@
     irq->irq_home = home = msg_home(msg_ref_create(msg));
     irq->irq_agent = agent;
 
-    irq->irq_received = agent_now(agent);
+    irq->irq_received = agent_now(agent); /* Timestamp originally from tport */
 
     irq->irq_method = method;
     irq->irq_rq = sip_request_copy(home, sip->sip_request);
@@ -5129,7 +5129,12 @@
   return irq && irq->irq_callback == callback ? irq->irq_magic : NULL;
 }
 
-/** When received */
+/** When received. 
+ *
+ * Return timestamp from the reception of the initial request.
+ *
+ * @NEW_1_12_7.
+ */
 sip_time_t nta_incoming_received(nta_incoming_t *irq,
 				 su_nanotime_t *return_nano)
 {
@@ -6768,7 +6773,7 @@
   return orq != NULL && orq != NONE ? orq->orq_delay : UINT_MAX;
 }
 
-/** Get the branch parameter. @NEW_1_12_7 */
+/** Get the branch parameter. @NEW_1_12_7. */
 char const *nta_outgoing_branch(nta_outgoing_t const *orq)
 {
   return orq != NULL && orq != NONE && orq->orq_branch

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h	Thu Oct 11 10:16:59 2007
@@ -26,7 +26,8 @@
 /** Defined when <nta_internal.h> has been included. */
 #define NTA_INTERNAL_H 
 
-/**@IFILE nta_internal.h
+/**@internal @file nta_internal.h
+ *
  * @brief Internals of NTA objects.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c	Thu Oct 11 10:16:59 2007
@@ -49,99 +49,1778 @@
 
 tag_typedef_t ntatag_any = NSTAG_TYPEDEF(*);
 
+/**@def NTATAG_MCLASS(x)
+ *
+ * Message class used by NTA. 
+ *
+ * The nta can use a custom or extended parser created with
+ * msg_mclass_clone().
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    pointer to #msg_mclass_t.
+ *
+ * @par Values
+ *    - custom or extended parser created with msg_mclass_clone()
+ *    - NULL - use default parser
+ *
+ * @par Default Value
+ *    - Value returned by sip_default_mclass()
+ *
+ * @sa NTATAG_SIPFLAGS()
+ */
 tag_typedef_t ntatag_mclass = PTRTAG_TYPEDEF(mclass);
 
+/**@def NTATAG_BAD_REQ_MASK(x)
+ *
+ * Mask for bad request messages. 
+ * 
+ * If an incoming request has erroneous headers matching with the mask, nta
+ * automatically returns a 400 Bad Message response to them. 
+ *
+ * If mask ~0U (all bits set) is specified, all requests with any bad header
+ * are dropped. By default only the requests with bad headers essential for
+ * request processing or proxying are dropped.
+ * 
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    - bitwise or of enum #sip_bad_mask values
+ *
+ * @par Default Value
+ * - <code>sip_mask_response | sip_mask_ua | sip_mask_100rel | </code><br>
+ *   <code>sip_mask_events | sip_mask_timer | sip_mask_publish</code>
+ * The following headers are considered essential by default:
+ * - @ref sip_request \"request line\"", @From, @To, @CSeq, @CallID,
+ *   @ContentLength, @Via, @ContentType, @ContentDisposition,
+ *   @ContentEncoding, @Supported, @Contact, @Require, @RecordRoute, @RAck,
+ *   @RSeq, @Event, @Expires, @SubscriptionState, @SessionExpires,
+ *   @MinSE, @SIPEtag, and @SIPIfMatch.
+ *  
+ * @sa enum #sip_bad_mask, NTATAG_BAD_RESP_MASK()
+ */
 tag_typedef_t ntatag_bad_req_mask = UINTTAG_TYPEDEF(bad_req_mask);
+
+/**@def NTATAG_BAD_RESP_MASK(x)
+ *
+ * Mask for bad response messages. 
+ * 
+ * If an incoming response has erroneous headers matching with the mask, nta
+ * drops the response message. 
+ *
+ * If mask ~0U (all bits set) is specified, all responses with any bad header
+ * are dropped. By default only the responses with bad headers essential for
+ * response processing or proxying are dropped.
+ * 
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    - bitwise or of enum #sip_bad_mask values
+ *
+ * @sa enum #sip_bad_mask, NTATAG_BAD_REQ_MASK()
+ *
+ * @par Default Value
+ * - <code>sip_mask_response | sip_mask_ua | sip_mask_100rel | </code><br>
+ *   <code>sip_mask_events | sip_mask_timer | sip_mask_publish</code>
+ * The following headers are considered essential by default:
+ * - @ref sip_status \"status line\"", @From, @To, @CSeq, @CallID,
+ *   @ContentLength, @Via, @ContentType, @ContentDisposition,
+ *   @ContentEncoding, @Supported, @Contact, @Require, @RecordRoute, @RAck,
+ *   @RSeq, @Event, @Expires, @SubscriptionState, @SessionExpires, 
+ *   @MinSE, @SIPEtag, and @SIPIfMatch.
+ */
 tag_typedef_t ntatag_bad_resp_mask = UINTTAG_TYPEDEF(bad_resp_mask);
 
+/**@def NTATAG_DEFAULT_PROXY(x)
+ *
+ * URL for (default) proxy.
+ *
+ * The requests are sent towards the <i>default outbound proxy</i> regardless
+ * the values of request-URI or @Route headers in the request. The URL of
+ * the default proxy is not added to the request in the @Route header or in
+ * the request-URI (against the recommendation of @RFC3261 section 8.1.2).
+ *
+ * The outbound proxy set by NTATAG_DEFAULT_PROXY() is used even if the
+ * dialog had an established route set or registration provided User-Agent
+ * with a @ServiceRoute set.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params(),
+ *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
+ *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
+ *
+ * @par Parameter type
+ *    Pointer to a url_t structure or a string containg a SIP or SIPS URI
+ *
+ * @par Values
+ *    - Valid SIP or SIPS URI
+ */
 tag_typedef_t ntatag_default_proxy = URLTAG_TYPEDEF(default_proxy);
+
+/**@def NTATAG_CONTACT(x)
+ *
+ * Contact used by NTA.
+ */
 tag_typedef_t ntatag_contact = SIPHDRTAG_NAMED_TYPEDEF(contact, contact);
+
+/** @def NTATAG_TARGET(x)
+ *
+ * Dialog target (contact) used by NTA.
+ */
 tag_typedef_t ntatag_target = SIPHDRTAG_NAMED_TYPEDEF(target, contact);
+
+/** @def NTATAG_ALIASES(x) 
+ *
+ * Aliases used by NTA. 
+ * @deprecated
+ */
 tag_typedef_t ntatag_aliases = SIPHDRTAG_NAMED_TYPEDEF(aliases, contact);
 
+/**@def NTATAG_METHOD(x)
+ *
+ * Method name.
+ *
+ * Create a dialogless #nta_leg_t object matching only requests with
+ * the specified method.
+ *
+ * @par Used with
+ *   nta_leg_tcreate()
+ *
+ * @par Parameter type
+ *    String containing method name.
+ *
+ * @par Values
+ *    - A SIP method name (e.g., "SUBSCRIBE").
+ *
+ * @par Default Value
+ *    - None (i.e., all requests methods match with the leg)
+ * 
+ */
 tag_typedef_t ntatag_method = STRTAG_TYPEDEF(method);
+
+/**@def NTATAG_BRANCH_KEY(x)
+ *
+ * Branch ID to the topmost @Via header.
+ *
+ * The NTA generates a random branch ID for the topmost @Via header by default.
+ * The application can the branch by itself, for intance, if it wants to
+ * create a @RFC2543-era transaction.
+ *
+ * Note that according to @RFC3261 the branch ID must start with "z9hG4bK".
+ *
+ * @par Used with
+ *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
+ *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
+ *
+ * @par Parameter type
+ *    string
+ *
+ * @par Value
+ * - The "branch" ID to to insert into topmost @Via header of the 
+ *   request to be sent
+ *
+ * @par Default Value
+ *  - A token is generated, either by random when a client transaction is
+ *    created or by hashing the headers and contents of the request when
+ *    request is sent statelessly
+ *
+ * @sa @RFC3261 section 8.1.1.7
+ */
 tag_typedef_t ntatag_branch_key = STRTAG_TYPEDEF(branch_key);
+
+/**@def NTATAG_ACK_BRANCH(x)
+ *
+ * Branch of the transaction to ACK. 
+ *
+ * When creating a ACK transaction, the application should provide the
+ * branch parameter from the original transaction to the stack. The ACK
+ * transaction object then receives all the retransmitted 2XX responses to
+ * the original INVITE transaction.
+ *
+ * @par Used with
+ *    nta_outgoing_mcreate(), nta_outgoing_tcreate()
+ *
+ * @par Parameter type
+ *    string
+ *
+ * @par Value
+ *    - "branch" ID used to store the ACK transaction in the nta hash
+ *      table for outgoing client transaction
+ *
+ * @par Default Value
+ *  - The INVITE transaction is looked from the hash table using the @CallID,
+ *    @CSeq, @From and @To tags and its branch ID is used
+ */
 tag_typedef_t ntatag_ack_branch = STRTAG_TYPEDEF(ack_branch);
+
+/**@def NTATAG_COMP(x)
+ *
+ * Compression algorithm. 
+ *
+ * Set compression algorithm for request as described in @RFC3486.
+ *
+ * @note This tag is has no effect without a compression plugin.
+ *
+ * @par Used with
+ *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
+ *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
+ *
+ * @par
+ * Note that NTATAG_COMP(NULL) can be used with nta_incoming_set_params()
+ * and nta_incoming_treply(), too. It indicates that the response is sent
+ * uncompressed, no matter what the client has in @a comp parameter of @Via
+ * header.
+ *
+ * @par Parameter type
+ *    string
+ *
+ * @par Values
+ *    - name of the compression algorithm
+ *
+ * @par Default Value
+ *    - "sigcomp"
+ *
+ * @sa @RFC3320, @RFC3486, TPTAG_COMPARTMENT(),
+ * NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_AWARE(),
+ * NTATAG_SIGCOMP_CLOSE(), NTATAG_SIGCOMP_OPTIONS()
+ */
 tag_typedef_t ntatag_comp = CSTRTAG_TYPEDEF(comp);
+
+/**@def NTATAG_MSG(x)
+ *
+ * Pass a SIP message to treply()/tcreate() functions. 
+ *
+ * @par Used with
+ *    nta_outgoing_tcreate(), nta_incoming_treply()
+ *
+ * @par Parameter type
+ *    #msg_t
+ *
+ * @par Values
+ * - A message object which will be completed, serialized and encoded.
+ *   Note that the functions modify directly the message.
+ *
+ * @par Default Value
+ * - A new  message object is created and populated by the function call.
+ *
+ * @sa msg_copy(), msg_dup(), msg_create(), sip_default_mclass()
+ */
 tag_typedef_t ntatag_msg = PTRTAG_TYPEDEF(msg);
+
+/**@def NTATAG_TPORT(x)
+ *
+ * Pass a transport object. The transport object is used to send the request
+ * or response message(s).
+ *
+ * @par Used with
+ *    nta_outgoing_tcreate(), nta_outgoing_mcreate(), nta_outgoing_tcancel(), 
+ *    nta_incoming_create(), nta_msg_tsend(), nta_msg_mreply()
+ *
+ * @par Parameter type
+ *  - #tport_t
+ *
+ * @par Values
+ * - A pointer to the transport object. Note that a new reference to the transport
+ *   is created.
+ *
+ * @par Default Value
+ * - The transport is selected by resolving the outbound URI (specified with
+ *   NTATAG_DEFAULT_PROXY(), the topmost @Route URI or Request-URI.
+ */
 tag_typedef_t ntatag_tport = PTRTAG_TYPEDEF(tport);
+
+/**@def NTATAG_SMIME(x)
+ *
+ * Provide S/MIME context to NTA. 
+ *
+ * @todo S/MIME is not implemented. 
+ */
 tag_typedef_t ntatag_smime = PTRTAG_TYPEDEF(smime);
+
+/**@def NTATAG_REMOTE_CSEQ(x)
+ *
+ * Remote CSeq number.
+ *
+ * Specify remote command sequence number for a #nta_leg_t dialog object. If
+ * an request is received matching with the dialog but with @CSeq number
+ * less than the remote sequence number associated with the dialog, a <i>500
+ * Internal Server Error</i> response is automatically returned to the client.
+ *
+ * @par Used with
+ *   nta_leg_tcreate()
+ *
+ * @par Parameter type
+ *   - uint32_t
+ *
+ * @par Values
+ *    - Remote command sequence number 
+ *
+ * @par Default Value
+ *    - Initially 0, then determined by the received requests
+ *
+ */
 tag_typedef_t ntatag_remote_cseq = UINTTAG_TYPEDEF(remote_cseq);
 
+/**@def NTATAG_MAXSIZE(x)
+ *
+ * Maximum size of incoming message. 
+ *
+ * If the size of an incoming request message would exceed the
+ * given limit, the stack will automatically respond with <i>413 Request
+ * Entity Too Large</i>.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    - #usize_t 
+ *
+ * @par Values
+ *    - Maximum acceptable size of an incoming request message.
+ *
+ * @par Default Value
+ *    - 2097152 (bytes or 2 megabytes)
+ *
+ * @sa msg_maxsize(), NTATAG_UDP_MTU()
+ */
 tag_typedef_t ntatag_maxsize = USIZETAG_TYPEDEF(maxsize);
+
+/**@def NTATAG_UDP_MTU(x)
+ *
+ * Maximum size of outgoing UDP request. 
+ *
+ * The maximum UDP request size is used to control use of UDP with overtly
+ * large messages. The IETF requires that the SIP requests over 1300 bytes
+ * are sent over congestion-controlled transport such as TCP. If a SIP
+ * message size exceeds the UDP MTU, the TCP is tried instead of UDP. (If
+ * the TCP connection is refused, the stack reverts back to UDP).
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    - #usize_t
+ *
+ * @par Values
+ *    - Maximum size of an outgoing UDP request
+ *
+ * @par Default Value
+ *    - 1300 (bytes)
+ *
+ * @sa @RFC3261 section 18.1.1, NTATAG_MAXSIZE()
+ */
 tag_typedef_t ntatag_udp_mtu = UINTTAG_TYPEDEF(udp_mtu);
+
+/**@def NTATAG_MAX_FORWARDS(x)
+ *
+ * Default value for @MaxForwards header. 
+ *
+ * The default value of @MaxForwards header added to the requests. The
+ * initial value recommended by @RFC3261 is 70, but usually SIP proxies use
+ * much lower default value, such as 24.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned
+ *
+ * @par Values
+ *    - Default value added to the @MaxForwards header in the sent requests
+ *
+ * @par Default Value
+ *    - 70 (hops)
+ *
+ * @since New in @VERSION_1_12_2.
+ */
 tag_typedef_t ntatag_max_forwards = UINTTAG_TYPEDEF(max_forwards);
+
+/**@def NTATAG_SIP_T1(x)
+ *
+ * Initial retransmission interval (in milliseconds) 
+ *
+ * Set the T1 retransmission interval used by the SIP transaction engine. The
+ * T1 is the initial duration used by request retransmission timers A and E
+ * (UDP) as well as response retransmission timer G.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    - Value of SIP T1 in milliseconds 
+ *
+ * @par Default Value
+ *    - #NTA_SIP_T1 or 500 (milliseconds)
+ *
+ * @sa @RFC3261 appendix A, #NTA_SIP_T1, NTATAG_SIP_T1X4(), NTATAG_SIP_T1(), NTATAG_SIP_T4()
+ */
 tag_typedef_t ntatag_sip_t1 = UINTTAG_TYPEDEF(sip_t1);
+
+/**@def NTATAG_SIP_T1X64(x)
+ *
+ * Transaction timeout (defaults to T1 * 64). 
+ *
+ * Set the T1x64  timeout value used by the SIP transaction engine. The T1x64 is
+ * duration used for timers B, F, H, and J (UDP) by the SIP transaction engine. 
+ * The timeout value T1x64 can be adjusted separately from the initial
+ * retransmission interval T1, which is set with NTATAG_SIP_T1().
+ * 
+ * The default value for T1x64 is 64 times value of T1, or 32000 milliseconds.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    - Value of T1x64 in milliseconds
+ *
+ * @par Default Value
+ *    - 64 * #NTA_SIP_T1 or 32000 (milliseconds)
+ *
+ * @sa @RFC3261 appendix A, #NTA_SIP_T1, NTATAG_SIP_T1(), NTATAG_SIP_T2(), NTATAG_SIP_T4()
+ *
+ */
 tag_typedef_t ntatag_sip_t1x64 = UINTTAG_TYPEDEF(sip_t1x64);
+
+/**@def NTATAG_SIP_T2(x)
+ *
+ * Maximum retransmission interval (in milliseconds) 
+ *
+ * Set the maximum retransmission interval used by the SIP transaction
+ * engine. The T2 is the maximum duration used for the timers E (UDP) and G
+ * by the SIP transaction engine. Note that the timer A is not capped by T2. 
+ * Retransmission interval of INVITE requests grows exponentially until the
+ * timer B fires.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    - Value of SIP T2 in milliseconds 
+ *
+ * @par Default Value
+ *    - #NTA_SIP_T2 or 4000 (milliseconds)
+ *
+ * @sa @RFC3261 appendix A, #NTA_SIP_T2, NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T4()
+ */
 tag_typedef_t ntatag_sip_t2 = UINTTAG_TYPEDEF(sip_t2);
+
+/**@def NTATAG_SIP_T4(x)
+ *
+ * Transaction lifetime (in milliseconds) 
+ *
+ * Set the lifetime for completed transactions used by the SIP transaction
+ * engine. A completed transaction is kept around for the duration of T4 in
+ * order to catch late responses. The T4 is the maximum duration for the
+ * messages to stay in the network and the duration of SIP timer K.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    - Value of SIP T4 in milliseconds
+ *
+ * @par Default Value
+ *    - #NTA_SIP_T4 or 4000 (milliseconds)
+ *
+ * @sa @RFC3261 appendix A, #NTA_SIP_T4, NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T2()
+ */
 tag_typedef_t ntatag_sip_t4 = UINTTAG_TYPEDEF(sip_t4);
+
+/**@def NTATAG_PROGRESS(x)
+ *
+ * Progress timer for User-Agents (interval for retranmitting 1XXs).
+ *
+ * The UAS should retransmit preliminary responses to the INVITE
+ * transactions every minute in order to re-set the timer C within the
+ * intermediate proxies.
+ *
+ * The default value for the progress timer is 60000.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    Value of progress timer in milliseconds.
+ *
+ * @par Default Value
+ *   - 90000 (milliseconds, 1.5 minutes)
+ *
+ * @sa @RFC3261 sections 13.3.1.1, 16.7 and 16.8, NTATAG_TIMER_C(),
+ * NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T2(), NTATAG_SIP_T4()
+ */
 tag_typedef_t ntatag_progress = UINTTAG_TYPEDEF(progress);
+
+/**@def NTATAG_TIMER_C(x)
+ *
+ * Value for timer C in milliseconds.
+ *
+ * By default the INVITE transaction will not timeout after a preliminary
+ * response has been received. However, an intermediate proxy can timeout
+ * the transaction using timer C. Timer C is reset every time a response
+ * belonging to the transaction is received.
+ *
+ * The default value for the timer C is 185000 milliseconds (3 minutes and 5
+ * seconds). By default, timer C is not run on user agents (if NTATAG_UA(1)
+ * without NTATAG_TIMER_C() is given).
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    Value of SIP timer C in milliseconds. The default value is used
+ *    instead if NTATAG_TIMER_C(0) is given.
+ *
+ * @par Default Value
+ *   - 180000 (milliseconds, 3 minutes)
+ *
+ * @sa @RFC3261 sections 13.3.1.1, 16.7 and 16.8,
+ * NTATAG_UA(1), NTATAG_TIMER_C(),
+ * NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T2(), NTATAG_SIP_T4()
+ *
+ * @NEW_1_12_7.
+ */
 tag_typedef_t ntatag_timer_c = UINTTAG_TYPEDEF(timer_c);
+
+/**@def NTATAG_BLACKLIST(x)
+ *
+ * Add Retry-After header to error responses returned to application.
+ *
+ * The NTATAG_BLACKLIST() provides a default value for @RetryAfter header
+ * added to the internally generated responses such as <i>503 DNS Error</i>
+ * or <i>408 Timeout</i>. The idea is that the application can retain its
+ * current state and retry the operation after a while.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *     unsigned int
+ *
+ * @par Values
+ *    - Value of delta-seconds in @RetryAfter header
+ *
+ * @par Default Value
+ *    - 0 (no Retry-After is included)
+ *
+ * @sa NTATAG_TIMEOUT_408()
+ */
 tag_typedef_t ntatag_blacklist = UINTTAG_TYPEDEF(blacklist);
+
+/**@def NTATAG_DEBUG_DROP_PROB(x)
+ *
+ * Packet drop probability for debugging. 
+ *
+ * The packet drop probability parameter is useful mainly for debugging
+ * purposes. The stack drops an incoming message received over an unreliable
+ * transport (such as UDP) with the given probability. The range is in 0 .. 
+ * 1000, 500 means p=0.5.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned integer
+ *
+ * @par Values
+ *    - Valid values are in range 0 ... 1000
+ *    - Probablity to drop a given message is value / 1000.
+ *
+ * @par Default Value
+ *    - 0 (no packets are dropped)
+ *
+ * @sa TPTAG_DEBUG_DROP()
+ */
 tag_typedef_t ntatag_debug_drop_prob = UINTTAG_TYPEDEF(debug_drop_prob);
 
+/**@def NTATAG_SIGCOMP_OPTIONS(x)
+ *
+ * Semicolon-separated SigComp options.
+ *
+ * @note This tag is has no effect without a SigComp plugin.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params(),
+ *    nta_agent_add_tport()
+ *
+ * @par Parameter type
+ *    string 
+ *
+ * @par Values
+ *    - semicolon-separated parameter-value pairs, passed to the SigComp plugin
+ *
+ * @sa NTATAG_COMP(), NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_AWARE(),
+ * NTATAG_SIGCOMP_CLOSE(), @RFC3320
+ */
 tag_typedef_t ntatag_sigcomp_options = STRTAG_TYPEDEF(sigcomp_options);
+
+/**@def NTATAG_SIGCOMP_CLOSE(x)
+ *
+ * Close SigComp compartment after completing transaction.
+ *
+ * @note This tag is has no effect without a SigComp plugin.
+ *
+ * @par Used with
+ *    nta_incoming_set_params(), nta_incoming_treply()
+ *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
+ *    nta_outgoing_tmcreate(), nta_outgoing_tcancel(),
+ *    nta_outgoing_prack(), nta_msg_tsend(), nta_msg_treply()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - application takes care of compartment management
+ *    - false - stack manages compartments
+ *
+ * @sa NTATAG_COMP(), TPTAG_COMPARTMENT(),
+ * NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_AWARE(),
+ * NTATAG_SIGCOMP_OPTIONS(), @RFC3320
+ */
 tag_typedef_t ntatag_sigcomp_close = BOOLTAG_TYPEDEF(sigcomp_close);
+
+/**@def NTATAG_SIGCOMP_AWARE(x)
+ *
+ * Indicate that the application is SigComp-aware. 
+ *
+ * @note This tag is has no effect without a SigComp plugin.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - application takes care of compartment management
+ *    - false - stack manages compartments
+ *
+ * @sa NTATAG_COMP(), NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_CLOSE(),
+ * NTATAG_SIGCOMP_OPTIONS(), @RFC3320
+ */
 tag_typedef_t ntatag_sigcomp_aware = BOOLTAG_TYPEDEF(sigcomp_aware);
+
+/**@def NTATAG_SIGCOMP_ALGORITHM(x)
+ *
+ * Specify SigComp algorithm.  
+ *
+ * @note This tag is has no effect without a SigComp plugin.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params(),
+ *    nta_agent_add_tport()
+ *
+ * @par Parameter type
+ *    string 
+ *
+ * @par Values
+ *    - opaque string passed to the SigComp plugin
+ *
+ * @sa NTATAG_COMP(), NTATAG_SIGCOMP_AWARE(), NTATAG_SIGCOMP_CLOSE(),
+ * NTATAG_SIGCOMP_OPTIONS(), @RFC3320
+ */
 tag_typedef_t ntatag_sigcomp_algorithm = STRTAG_TYPEDEF(sigcomp_algorithm);
 
+/**@def NTATAG_UA(x)
+ *
+ * If true, NTA acts as User Agent Server or Client by default.
+ *
+ * When acting as an UA, the NTA stack will
+ * - respond with 481 to a PRACK request with no matching "100rel" response
+ * - check for out-of-order CSeq headers for each #nta_leg_t dialog object
+ * - if NTATAG_MERGE_482(1) is also used, return <i>482 Request Merged</i> to
+ *   a duplicate request with same @CallID, @CSeq, @From tag but different
+ *   topmost @Via header (see @RFC3261 section 8.2.2.2 Merged Requests)
+ * - silently discard duplicate final responses to INVITE
+ * - retransmit preliminary responses (101..199) to INVITE request in regular
+ *   intervals ("timer N2")
+ * - retransmit 2XX response to INVITE request with exponential intervals 
+ * - handle ACK sent in 2XX response to an INVITE using the
+ *   #nta_ack_cancel_f callback bound to #nta_incoming_t with
+ *   nta_incoming_bind()
+ * - not use timer C unless its value has been explicitly set
+ *
+ * @note This NUTAG_UA(1) is set internally by nua_create()
+ *
+ * @par Used with
+ *    nta_agent_create() \n
+ *    nta_agent_set_params() \n
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - act as an UA 
+ *    - false - act as an proxy 
+ *
+ * @par Default Value
+ *    - 0 (false)
+ *    
+ * @sa NTATAG_MERGE_482()
+ */
 tag_typedef_t ntatag_ua = BOOLTAG_TYPEDEF(ua);
+
+/**@def NTATAG_STATELESS(x)
+ *
+ * Enable stateless processing.
+ *
+ * @par Server side
+ * The incoming requests are processed statefully if there is a default leg
+ * (created with nta_leg_default()). This option is provided for proxies or
+ * other server elements that process requests statelessly.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Values
+ *    - true - do not pass incoming requests to default leg
+ *    - false - pass incoming requests to default leg, if it exists
+ *
+ * @par Default Value
+ *    - 0 (false,  pass incoming requests to default leg)
+ *
+ * @par Client side
+ * The outgoing requests can be sent statelessly, too, if the
+ * NTATAG_STATELESS(1) is included in the tag list of nta_outgoing_tcreate().
+ *
+ * @par Used with
+ *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
+ *    nta_outgoing_tcancel(), nta_outgoing_prack()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - create only a transient #nta_outgoing_t transaction object
+ *    - false - create an ordinary client transaction object
+ *
+ * @par Default Value
+ *    - 0 (false, create client transaction)
+ *
+ * @sa NTATAG_IS_UA(), nta_incoming_default(), nta_outgoing_default(),
+ * nta_leg_default()
+ */
 tag_typedef_t ntatag_stateless = BOOLTAG_TYPEDEF(stateless);
+
+/**@def NTATAG_USER_VIA(x)
+ *
+ * Allow application to insert Via headers.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params(),
+ *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
+ *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - do not add @Via header to the request (if it has one)
+ *    - false - always add a @Via header
+ *
+ * @par Default Value
+ *    - 0 (false, always add a @Via header)
+ *
+ * @sa NTATAG_BRANCH(), NTATAG_TPORT()
+ */
 tag_typedef_t ntatag_user_via = BOOLTAG_TYPEDEF(user_via);
+
+/**@def NTATAG_PASS_100(x)
+ *
+ * Pass "<i>100 Trying</i>" provisional answers to the application.
+ *
+ * By default, the stack silently processes the <i>100 Trying</i> responses
+ * from the server. Usually the <i>100 Trying</i> responses are not
+ * important to the application but rather sent by the outgoing proxy
+ * immediately after it has received the request. However, the application
+ * can ask nta for them by setting NTATAG_PASS_100(1) if, for instance, the
+ * <i>100 Trying</i> responses are needed for user feedback.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params(),
+ *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
+ *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - pass <i>100 Trying</i> to application
+ *    - false - silently process <i>100 Trying</i> responses
+ *
+ * @par Default Value
+ *    - 0 (false, save application from seeing 100 Trying)
+ *
+ * @sa NTATAG_EXTRA_100(), NTATAG_DEFAULT_PROXY()
+ */
 tag_typedef_t ntatag_pass_100 = BOOLTAG_TYPEDEF(pass_100);
+
+/**@def NTATAG_EXTRA_100(x)
+ *
+ * Respond with "100 Trying" if application has not responded.
+ *
+ * As per recommended by @RFC4320, the stack can generate a 100 Trying
+ * response to the non-INVITE requests if the application has not responded
+ * to a request within half of the SIP T2 (the default value for T2 is 4000
+ * milliseconds, so the extra <i>100 Trying<i/> would be sent after 2 seconds).
+ *
+ * @par Used with	
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - send extra 100 Trying if application does not respond
+ *    - false - do not send 100 Trying
+ *
+ * @par Default Value
+ *    - 0 (false, do not respond with 100 Trying to retransmissions)
+
+ * @sa @RFC4320, NTATAG_PASS_408(), NTATAG_TIMEOUT_408()
+ */
 tag_typedef_t ntatag_extra_100 = BOOLTAG_TYPEDEF(extra_100);
+
+/**@def NTATAG_TIMEOUT_408(x)
+ *
+ * Generate "408 Request Timeout" response when request times out. 
+ *
+ * This tag is used to prevent stack from generating extra 408 response
+ * messages to non-INVITE requests upon timeout. As per recommended by
+ * @RFC4320, the <i>408 Request Timeout</i> responses to non-INVITE
+ * transaction are not sent over the network to the client by default. The
+ * application can ask stack to pass the 408 responses with
+ * NTATAG_PASS_408(1).
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - generate 408 response
+ *    - false - invoke #nta_response_f callback with NULL sip pointer
+ *              when a non-INVITE transaction times out
+ *
+ * @sa @RFC4320, NTATAG_PASS_408(), NTATAG_EXTRA_100(),
+ */
 tag_typedef_t ntatag_timeout_408 = BOOLTAG_TYPEDEF(timeout_408);
+
+/**@def NTATAG_PASS_408(x)
+ *
+ * Pass "408 Request Timeout" responses to the client. 
+ *
+ * As per recommended by @RFC4320, the <i>408 Request Timeout</i> responses
+ * to non-INVITE transaction are not sent over the network to the client by
+ * default. The application can ask stack to pass the 408 responses with
+ * NTATAG_PASS_408(1). 
+ *
+ * Note that unlike NTATAG_PASS_100(), this tags changes the way server side
+ * works.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - pass superfluous 408 responses 
+ *    - false - discard superfluous 408 responses
+ *
+ * @sa @RFC4320, NTATAG_EXTRA_100(), NTATAG_TIMEOUT_408()
+ *
+ */
 tag_typedef_t ntatag_pass_408 = BOOLTAG_TYPEDEF(pass_408);
+
+/**@def NTATAG_MERGE_482(x)
+ *
+ * Merge requests, send 482 to other requests. 
+ *
+ * If an User-Agent receives a duplicate request with same @CallID, @CSeq,
+ * @From tag but different topmost @Via header (see @RFC3261 section 8.2.2.2
+ * Merged Requests), it should return <i>482 Request Merged</i> response to
+ * the duplicate request. Such a duplicate request has been originally
+ * generated by a forking proxy and usually routed via different route to
+ * the User-Agent. The User-Agent should only respond meaningfully to the
+ * first request and return the 482 response to the following forked
+ * requests.
+ *
+ * Note that also NTATAG_UA(1) should be set before nta detects merges and
+ * responds with 482 to them.
+ *
+ * @note If your application is an multi-lined user-agent, you may consider
+ * disabling request merging. However, you have to somehow handle merging
+ * within a single line.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - detect duplicate requests and respond with 482 to them
+ *    - false - process duplicate requests separately
+ *
+ * @sa NTATAG_UA(1)
+ */
 tag_typedef_t ntatag_merge_482 = BOOLTAG_TYPEDEF(merge_482);
+
+/**@def NTATAG_CANCEL_2543(x)
+ *
+ *Follow @RFC2543 semantics with CANCEL.
+ *
+ * By default, the nta follows "@RFC3261" semantics when CANCELing a
+ * request. The CANCEL does not terminate transaction, rather, it is just a
+ * hint to the server that it should respond immediately (with <i>487
+ * Request Terminated</i> if it has no better response). Also, if the
+ * original request was sent over unreliable transport such as UDP, the
+ * CANCEL is delayed until the server has sent a preliminary response to the
+ * original request.
+ *
+ * If NTATAG_CANCEL_2543(1) is given, the transaction is canceled
+ * immediately internally (a 487 response is generated locally) and the
+ * CANCEL request is sent without waiting for an provisional response.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *    nta_outgoing_tcancel()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - follow "RFC 2543" semantics with CANCEL
+ *    - false - follow "RFC 3261" semantics with CANCEL
+ *
+ * @sa NTATAG_CANCEL_408()
+ */
 tag_typedef_t ntatag_cancel_2543 = BOOLTAG_TYPEDEF(cancel_2543);
+
+/**@def NTATAG_CANCEL_408(x)
+ *
+ * Do not send a CANCEL but just timeout the request. 
+ *
+ * Calling nta_outgoing_tcancel() with this tag set marks request as
+ * canceled but does not actually send a CANCEL request. If
+ * NTATAG_CANCEL_2543(1) is also included, a 487 response is generated
+ * internally.
+ *
+ * @par Used with
+ *    nta_outgoing_tcancel() \n
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - do not send CANCEL
+ *    - false - let request to timeout
+ *
+ * @sa NTATAG_CANCEL_2543()
+ */
 tag_typedef_t ntatag_cancel_408 = BOOLTAG_TYPEDEF(cancel_408);
+
+/**@def NTATAG_CANCEL_487(x)
+ *
+ * When a CANCEL is received, automatically return 487 response to original request.
+ *
+ * When the CANCEL is received for an ongoing server transaction
+ * #nta_incoming_t, the stack will automatically return a <i>487 Request
+ * Terminated</i> response to the client after returning from the
+ * #nta_incoming_f callback bound to the transaction with
+ * nta_incoming_bind()
+ * 
+ * The application can delay sending the response to the original request
+ * when NTATAG_CANCEL_408(0) is used. This is useful, for instance, with a
+ * proxy that forwards the CANCEL downstream and the forwards the response
+ * back to upstream.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - respond automatically to the CANCELed transaction
+ *    - false - application takes care of responding
+ *
+ * @sa NTATAG_CANCEL_2543(), nta_incoming_bind()
+ */
 tag_typedef_t ntatag_cancel_487 = BOOLTAG_TYPEDEF(cancel_487);
+
+/**@def NTATAG_TAG_3261(x)
+ *
+ * When responding to requests, use unique tags. 
+ *
+ * If set the UA would generate an unique @From/@To tag for all dialogs. If
+ * unset UA would reuse same tag in order to make it easier to re-establish
+ * dialog state after a reboot.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - use different tag for each dialog
+ *    - false - use same tag for all dialogs
+ *
+ * @sa @RFC3261 section 12.2.2
+ */
 tag_typedef_t ntatag_tag_3261 = BOOLTAG_TYPEDEF(tag_3261);
+
+/**@def NTATAG_REL100(x)
+ *
+ * Include rel100 in INVITE requests. 
+ *
+ * Include feature tag "100rel" in @Supported header of the INVITE requests.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - include "100rel"
+ *    - false - do not include "100rel"
+ *
+ * @sa nta_outgoing_prack(), nta_reliable_treply(), nta_reliable_mreply()
+ */
 tag_typedef_t ntatag_rel100 = BOOLTAG_TYPEDEF(rel100);
+
+/**@def NTATAG_NO_DIALOG(x)
+ *
+ * Create a leg without dialog. */
 tag_typedef_t ntatag_no_dialog = BOOLTAG_TYPEDEF(no_dialog);
+
+/**@def NTATAG_USE_TIMESTAMP(x)
+ *
+ * Use @Timestamp header. 
+ *
+ * If set, a @Timestamp header would be added to stateful requests. The
+ * header can be used to calculate the roundtrip transport latency between
+ * client and server.
+ *
+ * @par Used with
+ *    nua_create(), 
+ *    nta_agent_create(),
+ *    nta_agent_set_params(),
+ *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
+ *    nta_outgoing_tcancel(), and nta_outgoing_prack().
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - Add @Timestamp header
+ *    - false - do not add @Timestamp header
+ *
+ * @sa @RFC3261 section 8.2.6
+ */
 tag_typedef_t ntatag_use_timestamp = BOOLTAG_TYPEDEF(use_timestamp);
+
+/**@def NTATAG_SIPFLAGS(x)
+ *
+ * Set SIP parser flags. 
+ *
+ * The SIP parser flags affect how the messages are parsed and the result
+ * presented to the application. They also control encoding of messages.
+ * The most important flags are as follows:
+ * - MSG_FLG_COMPACT - use compact form 
+ *                     (single-letter header names, minimum whitespace)
+ * - MSG_FLG_EXTRACT_COPY - cache printable copy of headers when parsing. 
+ *   Using this flag can speed up proxy processing considerably. It is
+ *   implied when the parsed messages are logged (because #TPORT_LOG
+ *   environment variable is set, or TPTAG_LOG() is used.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned int 
+ *
+ * @par Values
+ *    - Bitwise OR of SIP parser flags (enum #msg_flg_user)
+ *
+ * @sa NTATAG_PRELOAD(), enum #msg_flg_user, sip_s::sip_flags
+ */
 tag_typedef_t ntatag_sipflags = UINTTAG_TYPEDEF(sipflags);
+
+/**@def NTATAG_CLIENT_RPORT(x)
+ *
+ * Enable client-side "rport". 
+ *
+ * This tag controls @RFC3581 support on client side. The "rport" parameter
+ * is used when the response has to be routed symmetrically through a NAT box.
+ *
+ * The client-side support involves just adding the "rport" parameter to the topmost
+ * @Via header before the request is sent. 
+ *
+ * @note By default, the client "rport" is disabled when nta is used, and
+ * enabled when nua is used.
+ *
+ * @par Used with
+ *    nua_create() (nua uses NTATAG_CLIENT_RPORT(1) by default) \n
+ *    nta_agent_create() \n
+ *    nta_agent_set_params() \n
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - add "rport" parameter
+ *    - false - do not add "rport" parameter
+ *
+ * @note The NTATAG_RPORT() is a synonym for this.
+ *
+ * @sa @RFC3581, NTATAG_SERVER_RPORT(), NTATAG_TCP_RPORT(), @Via
+ */
 tag_typedef_t ntatag_client_rport = BOOLTAG_TYPEDEF(client_rport);
+
+/**@def NTATAG_SERVER_RPORT(x)
+ *
+ * Use rport parameter at server.
+ *
+ * This tag controls @RFC3581 support on server side. The "rport" parameter
+ * is used when the response has to be routed symmetrically through a NAT
+ * box.
+ *
+ * If the topmost @Via header has an "rport" parameter, the server stores
+ * the port number from which the request was sent in it. When sending the
+ * response back to the client, the server uses the port number in the
+ * "rport" parameter rather than the client-supplied port number in @Via
+ * header.
+ *
+ * Note that on server-side the port number is stored regardless of the
+ * transport protocol. (It is assumed that client supports rport if it
+ * includes "rport" parameter in @Via field).
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - use "rport" parameter (default)
+ *    - false - do not use "rport" parameterx
+ *
+ * @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_TCP_RPORT(), @Via
+ */
 tag_typedef_t ntatag_server_rport = BOOLTAG_TYPEDEF(server_rport);
+
+
+/**@def NTATAG_TCP_RPORT(x)
+ *
+ * Use rport with TCP, too. 
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - include rport parameter in the TCP via line on client side 
+ *    - false - do not include rport parameter in the TCP via line on client side
+ *
+ * @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_SERVER_RPORT(), @Via
+ */
 tag_typedef_t ntatag_tcp_rport = BOOLTAG_TYPEDEF(tcp_rport);
+
+/**@def NTATAG_PRELOAD(x)
+ *
+ * Preload by N bytes. 
+ *
+ * When the memory block is allocated for an incoming request by the stack,
+ * the stack can allocate some extra memory for the parser in addition to
+ * the memory used by the actual message contents. 
+ * 
+ * While wasting some memory, this can speed up parsing considerably.
+ * Recommended amount of preloading per packet is 1500 bytes.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    unsigned
+ *
+ * @par Values
+ *    Amount of extra per-message memory allocated for parser.
+ *
+ * @sa NTATAG_SIPFLAGS() and #MSG_FLG_EXTRACT_COPY
+ */
 tag_typedef_t ntatag_preload = UINTTAG_TYPEDEF(preload);
+
+/**@def NTATAG_USE_NAPTR(x)
+ *
+ * If true, try to use NAPTR records when resolving. 
+ *
+ * The application can disable NTA from using NAPTR records when resolving
+ * SIP URIs.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - enable NAPTR resolving
+ *    - false - disable NAPTR resolving
+ *
+ * @bug NAPTRs are not used with SIPS URIs in any case.
+ *
+ * @sa @RFC3263, NTATAG_USE_SRV()
+ */
 tag_typedef_t ntatag_use_naptr = BOOLTAG_TYPEDEF(naptr);
+
+/**@def NTATAG_USE_SRV(x)
+ *
+ * If true, try to use SRV records when resolving.
+ *
+ * The application can disable NTA from using SRV records when resolving
+ * SIP URIs.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(),
+ *    nta_agent_create(), nta_agent_set_params()
+ *
+ * @par Parameter type
+ *    boolean: true (non-zero or non-NULL pointer)
+ *          or false (zero or NULL pointer)
+ *
+ * @par Values
+ *    - true - enable SRV resolving
+ *    - false - disable SRV resolving
+ *
+ * @sa @RFC3263, NTATAG_USE_NAPTR()
+ */
 tag_typedef_t ntatag_use_srv = BOOLTAG_TYPEDEF(srv);
+
+/**@def NTATAG_RSEQ(x)
+ *
+ * @RSeq value for nta_outgoing_prack(). 
+ *
+ * @par Used with
+ *    nta_outgoing_prack()
+ *
+ * @par Parameter type
+ *    @c unsigned @c int
+ *
+ * @par Values
+ *    Response sequence number from the @RSeq header.
+*/
 tag_typedef_t ntatag_rseq = UINTTAG_TYPEDEF(rseq);
 
 /* Status */
 
+/**@def NTATAG_S_IRQ_HASH_REF(x)
+ *
+ * Get size of hash table for server-side transactions.
+ *
+ * Return number of transactions that fit in the hash table for server-side
+ * transactions.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_IRQ_HASH_USED_REF(),
+ * NTATAG_S_ORQ_HASH_REFxs(), NTATAG_S_LEG_HASH_REF()
+ */
 tag_typedef_t ntatag_s_irq_hash =         USIZETAG_TYPEDEF(s_irq_hash);
+
+/**@def NTATAG_S_ORQ_HASH_REF(x)
+ *
+ * Get size of hash table for client-side transactions.
+ *
+ * Return number of transactions that fit in the hash table for client-side
+ * transactions.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_ORQ_HASH_USED_REF(),
+ * NTATAG_S_IRQ_HASH_REF(), NTATAG_S_LEG_HASH_REF()
+ */
 tag_typedef_t ntatag_s_orq_hash =         USIZETAG_TYPEDEF(s_orq_hash);
+
+/**@def NTATAG_S_LEG_HASH_REF(x)
+ *
+ * Get size of hash table for dialogs.
+ *
+ * Return number of dialog objects that fit in the hash table for dialogs.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_LEG_HASH_USED_REF(),
+ * NTATAG_S_IRQ_HASH_REF(), NTATAG_S_ORQ_HASH_REF()
+ */
 tag_typedef_t ntatag_s_leg_hash =         USIZETAG_TYPEDEF(s_leg_hash);
+
+/**@def NTATAG_S_IRQ_HASH_USED_REF(x)
+ *
+ * Get number of server-side transactions in the hash table.
+ *
+ * Return number of server-side transactions objects in the hash table. The
+ * number includes all transactions destroyed by the application which have
+ * not expired yet.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_IRQ_HASH_REF(),
+ * NTATAG_S_ORQ_HASH_USED_REF(), NTATAG_S_LEG_HASH_USED_REF()
+ */
+/**@def NTATAG_S_IRQ_HASH_USED_REF(x)
+ *
+ * Get number of server-side transactions in the hash table.
+ *
+ * Return number of server-side transactions objects in the hash table. The
+ * number includes all transactions destroyed by the application which have
+ * not expired yet.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_IRQ_HASH_REF(),
+ * NTATAG_S_ORQ_HASH_USED_REF(), NTATAG_S_LEG_HASH_USED_REF()
+ */
 tag_typedef_t ntatag_s_irq_hash_used =    USIZETAG_TYPEDEF(s_irq_hash_used);
+
+/**@def NTATAG_S_ORQ_HASH_USED_REF(x)
+ *
+ * Get number of client-side transactions in the hash table.
+ *
+ * Return number of client-side transactions objects in the hash table. The
+ * number includes all transactions destroyed by the application which have
+ * not expired yet.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_ORQ_HASH_REF(),
+ * NTATAG_S_IRQ_HASH_USED_REF(), NTATAG_S_LEG_HASH_USED_REF()
+ */
 tag_typedef_t ntatag_s_orq_hash_used =    USIZETAG_TYPEDEF(s_orq_hash_used);
+
+/**@def NTATAG_S_LEG_HASH_USED_REF(x)
+ *
+ * Get number of dialogs in the hash table.
+ *
+ * Return number of dialog objects in the hash table. Note that the
+ * nta_leg_t objects created with NTATAG_NO_DIALOG(1) and this not
+ * corresponding to a dialog are not included in the number.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_LEG_HASH_REF(),
+ * NTATAG_S_IRQ_HASH_USED_REF(), NTATAG_S_ORQ_HASH_USED_REF()
+ */
 tag_typedef_t ntatag_s_leg_hash_used =    USIZETAG_TYPEDEF(s_leg_hash_used);
+
+/**@def NTATAG_S_RECV_MSG_REF(x)
+ *
+ * Get number of SIP messages received.
+ *
+ * Return number SIP messages that has been received.  The number includes
+ * also bad and unparsable messages.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_BAD_MESSAGE_REF(),
+ * NTATAG_S_RECV_REQUEST_REF(), NTATAG_S_RECV_RESPONSE_REF()
+ */
 tag_typedef_t ntatag_s_recv_msg =         USIZETAG_TYPEDEF(s_recv_msg);
+
+/**@def NTATAG_S_RECV_REQUEST_REF(x)
+ *
+ * Get number of SIP requests received.
+ *
+ * Return number SIP requests that has been received. The number includes
+ * also number of bad requests available with NTATAG_S_BAD_REQUEST_REF().
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_BAD_REQUEST_REF(),
+ * NTATAG_S_RECV_MSG_REF(), NTATAG_S_RECV_RESPONSE_REF()
+ */
 tag_typedef_t ntatag_s_recv_request =     USIZETAG_TYPEDEF(s_recv_request);
+
+/**@def NTATAG_S_RECV_RESPONSE_REF(x)
+ *
+ * Get number of SIP responses received.
+ *
+ * Return number SIP responses that has been received. The number includes
+ * also number of bad and unusable responses available with
+ * NTATAG_S_BAD_RESPONSE_REF().
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_BAD_RESPONSE_REF(),
+ * NTATAG_S_RECV_MSG_REF(), NTATAG_S_RECV_REQUEST_REF()
+ */
 tag_typedef_t ntatag_s_recv_response =    USIZETAG_TYPEDEF(s_recv_response);
+
+/**@def NTATAG_S_BAD_MESSAGE_REF(x)
+ *
+ * Get number of bad SIP messages received.
+ *
+ * Return number of bad SIP messages that has been received.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_RECV_MSG_REF(), 
+ * NTATAG_S_BAD_REQUEST_REF(), NTATAG_S_BAD_RESPONSE_REF().
+ */
 tag_typedef_t ntatag_s_bad_message =      USIZETAG_TYPEDEF(s_bad_message);
+
+/**@def NTATAG_S_BAD_REQUEST_REF(x)
+ *
+ * Get number of bad SIP requests received.
+ *
+ * Return number of bad SIP requests that has been received.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_BAD_MESSAGE_REF(),
+ * NTATAG_S_BAD_RESPONSE_REF().
+ */
 tag_typedef_t ntatag_s_bad_request =      USIZETAG_TYPEDEF(s_bad_request);
+
+/**@def NTATAG_S_BAD_RESPONSE_REF(x)
+ *
+ * Get number of bad SIP responses received.
+ *
+ * Return number of bad SIP responses that has been received.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_BAD_MESSAGE_REF(),
+ * NTATAG_S_BAD_REQUEST_REF()
+ */
 tag_typedef_t ntatag_s_bad_response =     USIZETAG_TYPEDEF(s_bad_response);
+
+/**@def NTATAG_S_DROP_REQUEST_REF(x)
+ *
+ * Get number of SIP requests dropped.
+ *
+ * Return number of SIP requests that has been randomly dropped after
+ * receiving them because of NTATAG_DEBUG_DROP_PROB() has been set.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_DEBUG_DROP_PROB(),
+ * NTATAG_S_DROP_RESPONSE_REF()
+ * 
+ * @note The value was not calculated before @VERSION_1_12_7.
+ */
 tag_typedef_t ntatag_s_drop_request =     USIZETAG_TYPEDEF(s_drop_request);
+
+/**@def NTATAG_S_DROP_RESPONSE_REF(x)
+ *
+ * Get number of SIP responses dropped.
+ *
+ * Return number of SIP responses that has been randomly dropped after
+ * receiving them because of NTATAG_DEBUG_DROP_PROB() has been set.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_DEBUG_DROP_PROB(),
+ * NTATAG_S_DROP_REQUEST_REF()
+ * 
+ * @note The value was not calculated before @VERSION_1_12_7.
+ */
 tag_typedef_t ntatag_s_drop_response =    USIZETAG_TYPEDEF(s_drop_response);
+
+/**@def NTATAG_S_CLIENT_TR_REF(x)
+ *
+ * Get number of client transactions created.
+ *
+ * Return number of client transactions created. The number also includes
+ * client transactions with which stack failed to send the request because
+ * the DNS resolving failed or the transport failed.
+ *
+ * @note The number include stateless requests sent with nta_msg_tsend(),
+ * too.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_SENT_REQUEST_REF(),
+ * NTATAG_S_SERVER_TR_REF().
+ */
 tag_typedef_t ntatag_s_client_tr =        USIZETAG_TYPEDEF(s_client_tr);
+
+/**@def NTATAG_S_SERVER_TR_REF(x)
+ *
+ * Get number of server transactions created.
+ *
+ * Return number of server transactions created. 
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_RECV_RESPONSE_REF(),
+ * NTATAG_S_CLIENT_TR_REF(), NTATAG_S_DIALOG_TR_REF(),
+ */
 tag_typedef_t ntatag_s_server_tr =        USIZETAG_TYPEDEF(s_server_tr);
+
+/**@def NTATAG_S_DIALOG_TR_REF(x)
+ *
+ * Get number of in-dialog server transactions created.
+ *
+ * Return number of in-dialog server transactions created. The number
+ * includes only those transactions that were correlated with a dialog
+ * object.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_SERVER_TR_REF(),
+ * NTATAG_S_CLIENT_TR_REF(), NTATAG_S_RECV_RESPONSE_REF().
+ */
 tag_typedef_t ntatag_s_dialog_tr =        USIZETAG_TYPEDEF(s_dialog_tr);
+
+/**@def NTATAG_S_ACKED_TR_REF(x)
+ *
+ * Get number of server transactions that have received ACK.
+ *
+ * Return number of INVITE server transactions for which an ACK request has
+ * been received.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_SERVER_TR_REF(),
+ * NTATAG_S_CANCELED_TR_REF()
+ */
 tag_typedef_t ntatag_s_acked_tr =         USIZETAG_TYPEDEF(s_acked_tr);
+
+/**@def NTATAG_S_CANCELED_TR_REF(x)
+ *
+ * Get number of server transactions that have been CANCELed.
+ *
+ * Return number of server transactions for which an CANCEL request has been
+ * received. Currently, the count includes only INVITE server transactions
+ * that have been CANCELed.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_SERVER_TR_REF(),
+ * NTATAG_S_ACKED_TR_REF().
+ */
 tag_typedef_t ntatag_s_canceled_tr =      USIZETAG_TYPEDEF(s_canceled_tr);
+
+/**@def NTATAG_S_TRLESS_REQUEST_REF(x)
+ *
+ * Get number of requests that were processed stateless.
+ *
+ * Return number of received requests that were processed statelessly,
+ * either with #nta_message_f message callback given with the
+ * nta_agent_create() or, missing the callback, by returning a <i>501 Not
+ * Implemented</i> response to the request.
+ *
+ * @sa nta_agent_get_stats(), <sofia-sip/nta_stateless.h>,
+ * nta_agent_create(), #nta_message_f, NTATAG_S_TRLESS_TO_TR_REF(),
+ * NTATAG_S_TRLESS_RESPONSE_REF()
+ */
 tag_typedef_t ntatag_s_trless_request =   USIZETAG_TYPEDEF(s_trless_request);
+
+/**@def NTATAG_S_TRLESS_TO_TR_REF(x)
+ *
+ * Get number of requests converted to transactions by message callback.
+ *
+ * Return number of requests that were converted to a server transaction
+ * with nta_incoming_create().
+ *
+ * @sa nta_agent_get_stats(), nta_incoming_create(), nta_agent_create(),
+ * #nta_message_f, NTATAG_S_TRLESS_REQUEST_REF()
+ */
 tag_typedef_t ntatag_s_trless_to_tr =     USIZETAG_TYPEDEF(s_trless_to_tr);
+
+/**@def NTATAG_S_TRLESS_RESPONSE_REF(x)
+ *
+ * Get number of responses without matching request.
+ *
+ * Return number of received responses for which no matching client
+ * transaction was found. Such responses are processed either by the
+ * client transaction created with nta_outgoing_default(), the
+ * #nta_message_f message callback given to nta_agent_create(), or, missing
+ * both the default client transaction and message callback, they are
+ * silently discarded.
+ *
+ * The NTATAG_S_TRLESS_200_REF() counter counts those successful 2XX
+ * responses to the INVITE without client transaction which are silently
+ * discarded.
+ *
+ * @sa nta_agent_get_stats(), nta_outgoing_default(), nta_agent_create(),
+ * <sofia-sip/nta_stateless.h>, #nta_message_f, nta_msg_ackbye(),
+ * NTATAG_S_TRLESS_REQUEST_REF(), NTATAG_S_TRLESS_200_REF().
+ */
 tag_typedef_t ntatag_s_trless_response =  USIZETAG_TYPEDEF(s_trless_response);
+
+/**@def NTATAG_S_TRLESS_200_REF(x)
+ *
+ * Get number of successful responses missing INVITE client transaction.
+ *
+ * Return number of received 2XX responses to INVITE transaction for which
+ * no matching client transaction was found nor which were processed by a
+ * default client transaction created with nta_outgoing_default() or
+ * #nta_message_f message callback given to nta_agent_create().
+ *
+ * @sa nta_agent_get_stats(), nta_outgoing_default(), nta_agent_create(),
+ * <sofia-sip/nta_stateless.h>, #nta_message_f, nta_msg_ackbye(),
+ * NTATAG_S_TRLESS_RESPONSE_REF().
+ */
 tag_typedef_t ntatag_s_trless_200 =       USIZETAG_TYPEDEF(s_trless_200);
+
+/**@def NTATAG_S_MERGED_REQUEST_REF(x)
+ *
+ * Get number of requests merged by UAS.
+ *
+ * Return number of requests for which UAS already has returned a response
+ * and which were merged (that is, returned a <i>482 Request Merged</i>
+ * response).
+ *
+ * @sa nta_agent_get_stats(), NTATAG_UA(1), @RFC3261 section 8.2.2.2
+ */
 tag_typedef_t ntatag_s_merged_request =   USIZETAG_TYPEDEF(s_merged_request);
+
+/**@def NTATAG_S_SENT_MSG_REF(x)
+ *
+ * Get number of SIP messages sent by stack.
+ *
+ * Return number of SIP messages given to the transport layer for
+ * transmission by the SIP stack. The number includes also messages which
+ * the transport layer failed to send for different reasons.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_RECV_MSG_REF(),
+ * NTATAG_S_SENT_REQUEST_REF(), NTATAG_S_SENT_RESPONSE_REF()
+ */
 tag_typedef_t ntatag_s_sent_msg =      	  USIZETAG_TYPEDEF(s_sent_msg);
+
+/**@def NTATAG_S_SENT_REQUEST_REF(x)
+ *
+ * Get number of SIP requests sent by stack.
+ *
+ * Return number of SIP requests given to the transport layer for
+ * transmission by the SIP stack. The number includes retransmissions and
+ * messages which the transport layer failed to send for different reasons.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_RECV_REQUEST_REF(),
+ * NTATAG_S_SENT_MSG_REF(), NTATAG_S_SENT_RESPONSE_REF()
+ */
 tag_typedef_t ntatag_s_sent_request =  	  USIZETAG_TYPEDEF(s_sent_request);
+
+/**@def NTATAG_S_SENT_RESPONSE_REF(x)
+ *
+ * Get number of SIP responses sent by stack.
+ *
+ * Return number of SIP responses given to the transport layer for
+ * transmission by the SIP stack. The number includes retransmissions and
+ * messages which the transport layer failed to send for different reasons.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_RECV_RESPONSE_REF(),
+ * NTATAG_S_SENT_MSG_REF(), NTATAG_S_SENT_REQUEST_REF()
+ */
 tag_typedef_t ntatag_s_sent_response = 	  USIZETAG_TYPEDEF(s_sent_response);
+
+/**@def NTATAG_S_RETRY_REQUEST_REF(x)
+ *
+ * Get number of SIP requests retransmitted by stack.
+ *
+ * Return number of SIP requests given to the transport layer for
+ * retransmission by the SIP stack. The number includes messages which the
+ * transport layer failed to send for different reasons.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_SENT_MSG_REF(),
+ * NTATAG_S_SENT_REQUEST_REF(), NTATAG_S_RETRY_RESPONSE_REF()
+ */
 tag_typedef_t ntatag_s_retry_request = 	  USIZETAG_TYPEDEF(s_retry_request);
+
+/**@def NTATAG_S_RETRY_RESPONSE_REF(x)
+ *
+ * Get number of SIP responses retransmitted by stack.
+ *
+ * Return number of SIP responses given to the transport layer for
+ * retransmission by the SIP stack. The number includes messages which the
+ * transport layer failed to send for different reasons.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_SENT_MSG_REF(),
+ * NTATAG_S_SENT_REQUEST_REF(), NTATAG_S_RETRY_REQUEST_REF()
+ */
 tag_typedef_t ntatag_s_retry_response =   USIZETAG_TYPEDEF(s_retry_response);
+
+/**@def NTATAG_S_RECV_RETRY_REF(x)
+ *
+ * Get number of retransmitted SIP requests received by stack.
+ *
+ * Return number of SIP requests received by the stack. This number only
+ * includes retransmission for which a matching server transaction object
+ * was found.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_RETRY_REQUEST_REF().
+ */
 tag_typedef_t ntatag_s_recv_retry =       USIZETAG_TYPEDEF(s_recv_retry);
+
+/**@def NTATAG_S_TOUT_REQUEST_REF(x)
+ *
+ * Get number of SIP client transactions that has timeout.
+ *
+ * Return number of SIP client transactions that has timeout.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_TOUT_RESPONSE_REF().
+ */
 tag_typedef_t ntatag_s_tout_request =     USIZETAG_TYPEDEF(s_tout_request);
+
+/**@def NTATAG_S_TOUT_RESPONSE_REF(x)
+ *
+ * Get number of SIP server transactions that has timeout.
+ *
+ * Return number of SIP server transactions that has timeout. The number
+ * includes only the INVITE transactions for which the stack has received no
+ * ACK requests.
+ *
+ * @sa nta_agent_get_stats(), NTATAG_S_TOUT_REQUEST_REF().
+ */
 tag_typedef_t ntatag_s_tout_response =    USIZETAG_TYPEDEF(s_tout_response);
 
 /* Internal */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/portbind.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/portbind.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/portbind.c	Thu Oct 11 10:16:59 2007
@@ -22,8 +22,8 @@
  *
  */
 
-/**@file portbind.c
- * @brief bind a socket to an UDP/TCP port and return the port number
+/**@internal @file portbind.c
+ * @brief Bind a socket to an UDP/TCP port and return the port number
  * 
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h	Thu Oct 11 10:16:59 2007
@@ -63,25 +63,25 @@
 #ifndef NTA_AGENT_MAGIC_T
 /** Default type of application context for NTA agents.
  * Application may define this to appropriate type before including
- * <nta.h>. */
+ * <sofia-sip/nta.h>. */
 #define NTA_AGENT_MAGIC_T struct nta_agent_magic_s
 #endif
 #ifndef NTA_LEG_MAGIC_T
 /** Default type of application context for NTA call legs.
  * Application may define this to appropriate type before including
- * <nta.h>. */
+ * <sofia-sip/nta.h>. */
 #define NTA_LEG_MAGIC_T struct nta_leg_magic_s
 #endif
 #ifndef NTA_OUTGOING_MAGIC_T
 /** Default type of application context for outgoing NTA requests.
  * Application may define this to appropriate type before including
- * <nta.h>. */
+ * <sofia-sip/nta.h>. */
 #define NTA_OUTGOING_MAGIC_T struct nta_outgoing_magic_s
 #endif
 #ifndef NTA_INCOMING_MAGIC_T
 /** Default type of application context for incoming NTA requests.
  * Application may define this to appropriate type before including
- * <nta.h>. */
+ * <sofia-sip/nta.h>. */
 #define NTA_INCOMING_MAGIC_T struct nta_incoming_magic_s
 #endif
 
@@ -439,13 +439,13 @@
 typedef struct nta_reliable_s   nta_reliable_t;
 
 #ifndef NTA_RELIABLE_MAGIC_T
-/** Default type of application context for reliable NTA responses.
+/** Default type of application context for reliable preliminary responses.
  * Application may define this to appropriate type before including
- * <nta.h>. */
+ * <sofia-sip/nta.h>. */
 #define NTA_RELIABLE_MAGIC_T struct nta_reliable_magic_s
 #endif
 
-/** Application context for reliable NTA requests */
+/** Application context for reliable preliminary responses. */
 typedef NTA_RELIABLE_MAGIC_T  nta_reliable_magic_t;
 
 typedef int nta_prack_f(nta_reliable_magic_t *rmagic,

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tag.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tag.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tag.h	Thu Oct 11 10:16:59 2007
@@ -58,126 +58,24 @@
 /* Tags for parameters */
 
 NTA_DLL extern tag_typedef_t ntatag_mclass;
-/** Message class used by NTA. 
- *
- * The nta can use a custom or extended parser created with
- * msg_mclass_clone().
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    pointer to #msg_mclass_t.
- *
- * @par Values
- *    - custom or extended parser created with msg_mclass_clone()
- *    - NULL - use default parser
- *
- * @sa NTATAG_SIPFLAGS()
- */
 #define NTATAG_MCLASS(x) ntatag_mclass, tag_cptr_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_mclass_ref;
 #define NTATAG_MCLASS_REF(x) ntatag_mclass_ref, tag_cptr_vr(&(x), (x))
 
 NTA_DLL extern tag_typedef_t ntatag_bad_req_mask;
-/** Mask for bad request messages. 
- * 
- * If an incoming request has erroneous headers matching with the mask, nta
- * automatically returns a 400 Bad Message response to them. 
- *
- * If mask ~0U (all bits set) is specified, all requests with any bad header
- * are dropped. By default only the requests with bad headers essential for
- * request processing or proxying are dropped.
- * 
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    - bitwise or of enum #sip_bad_mask values
- *
- * @sa enum #sip_bad_mask, NTATAG_BAD_RESP_MASK()
- *
- * @note
- * The following headers are considered essential by default:
- * - @ref sip_request \"request line\"", @From, @To, @CSeq, @CallID,
- *   @ContentLength, @Via, @ContentType, @ContentDisposition,
- *   @ContentEncoding, @Supported, @Contact, @Require, @RecordRoute, @RAck,
- *   @RSeq, @Event, @Expires, @SubscriptionState, @SessionExpires,
- *   @MinSE, @SIPEtag, and @SIPIfMatch.
- *  
- */
 #define NTATAG_BAD_REQ_MASK(x) ntatag_bad_req_mask, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_bad_req_mask_ref;
 #define NTATAG_BAD_REQ_MASK_REF(x) ntatag_bad_req_mask_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_bad_resp_mask;
-/** Mask for bad response messages. 
- * 
- * If an incoming response has erroneous headers matching with the mask, nta
- * drops the response message. 
- *
- * If mask ~0U (all bits set) is specified, all responses with any bad header
- * are dropped. By default only the responses with bad headers essential for
- * response processing or proxying are dropped.
- * 
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    - bitwise or of enum #sip_bad_mask values
- *
- * @sa enum #sip_bad_mask, NTATAG_BAD_REQ_MASK()
- *
- * @note
- * The following headers are considered essential by default:
- * - @ref sip_status \"status line\"", @From, @To, @CSeq, @CallID,
- *   @ContentLength, @Via, @ContentType, @ContentDisposition,
- *   @ContentEncoding, @Supported, @Contact, @Require, @RecordRoute, @RAck,
- *   @RSeq, @Event, @Expires, @SubscriptionState, @SessionExpires, 
- *   @MinSE, @SIPEtag, and @SIPIfMatch.
- */
 #define NTATAG_BAD_RESP_MASK(x) ntatag_bad_resp_mask, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_bad_resp_mask_ref;
 #define NTATAG_BAD_RESP_MASK_REF(x) ntatag_bad_resp_mask_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_default_proxy;
-/** URL for (default) proxy.
- *
- * The requests are sent towards the <i>default outbound proxy</i> regardless
- * the values of request-URI or @Route headers in the request. The URL of
- * the default proxy is not added to the request in the @Route header or in
- * the request-URI (against the recommendation of @RFC3261 section 8.1.2).
- *
- * The outbound proxy set by NTATAG_DEFAULT_PROXY() is used even if the
- * dialog had an established route set or registration provided User-Agent
- * with a @ServiceRoute set.
- *
- * @par Used with
- *    nua_create(), nta_agent_create(), nta_agent_set_params() \n
- *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
- *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
- *
- * @par Parameter type
- *    Pointer to a url_t structure or a string containg a SIP or SIPS URI
- *
- * @par Values
- *    - Valid SIP or SIPS URI
- */
 #define NTATAG_DEFAULT_PROXY(x) ntatag_default_proxy, urltag_url_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_default_proxy_ref;
@@ -185,507 +83,151 @@
 ntatag_default_proxy_ref, urltag_url_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_contact;
-/** Contact used by NTA. */
 #define NTATAG_CONTACT(x) ntatag_contact, siptag_contact_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_contact_ref;
-#define NTATAG_CONTACT_REF(x) \
-ntatag_contact_ref, siptag_contact_vr(&(x))
+#define NTATAG_CONTACT_REF(x) ntatag_contact_ref, siptag_contact_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_target;
-/** Dialog target (contact) used by NTA. @HI */
-#define NTATAG_TARGET(x) \
-ntatag_target, siptag_contact_v((x))
+#define NTATAG_TARGET(x) ntatag_target, siptag_contact_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_target_ref;
-#define NTATAG_TARGET_REF(x) \
-ntatag_target_ref, siptag_contact_vr(&(x))
+#define NTATAG_TARGET_REF(x) ntatag_target_ref, siptag_contact_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_aliases;
-/** Aliases used by NTA. @HI @deprecated */
-#define NTATAG_ALIASES(x) \
-ntatag_aliases, siptag_contact_v((x))
+#define NTATAG_ALIASES(x) ntatag_aliases, siptag_contact_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_aliases_ref;
-#define NTATAG_ALIASES_REF(x) \
-ntatag_aliases_ref, siptag_contact_vr(&(x))
+#define NTATAG_ALIASES_REF(x) ntatag_aliases_ref, siptag_contact_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_branch_key;
-/** Branch key. @HI */
-#define NTATAG_BRANCH_KEY(x) \
-ntatag_branch_key, tag_str_v((x))
+#define NTATAG_BRANCH_KEY(x) ntatag_branch_key, tag_str_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_branch_key_ref;
 #define NTATAG_BRANCH_KEY_REF(x) \
 ntatag_branch_key_ref, tag_str_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_ack_branch;
-/** Branch for ACKed transaction. @HI */
 #define NTATAG_ACK_BRANCH(x) ntatag_ack_branch, tag_str_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_ack_branch_ref;
 #define NTATAG_ACK_BRANCH_REF(x) ntatag_ack_branch_ref, tag_str_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_comp;
-/** Compression algorithm. 
- *
- * Set compression algorithm for request as described in @RFC3486.
- *
- * @note This tag is has no effect without a compression plugin.
- *
- * @par Used with
- *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
- *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
- *
- * @par
- * Note that NTATAG_COMP(NULL) can be used with nta_incoming_set_params()
- * and nta_incoming_treply(), too. It indicates that the response is sent
- * uncompressed, no matter what the client has in @a comp parameter of @Via
- * header.
- *
- * @par Parameter type
- *    string
- *
- * @par Values
- *    - name of the compression algorithm ("sigcomp")
- *
- * @sa @RFC3320, @RFC3486, TPTAG_COMPARTMENT(),
- * NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_AWARE(),
- * NTATAG_SIGCOMP_CLOSE(), NTATAG_SIGCOMP_OPTIONS()
- */
 #define NTATAG_COMP(x) ntatag_comp, tag_str_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_comp_ref;
 #define NTATAG_COMP_REF(x) ntatag_comp_ref, tag_str_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_msg;
-/** Pass a SIP message to treply()/tcreate() functions. @HI */
 #define NTATAG_MSG(x)     ntatag_msg, tag_ptr_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_msg_ref;
 #define NTATAG_MSG_REF(x) ntatag_msg_ref, tag_ptr_vr(&(x), (x))
 
 NTA_DLL extern tag_typedef_t ntatag_tport;
-/** Pass a transport object to msg_tsend/msg_treply. @HI */
 #define NTATAG_TPORT(x)     ntatag_tport, tag_ptr_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_tport_ref;
 #define NTATAG_TPORT_REF(x) ntatag_tport_ref, tag_ptr_vr(&(x), (x))
 
 NTA_DLL extern tag_typedef_t ntatag_remote_cseq;
-/** Remote CSeq number. @HI */
 #define NTATAG_REMOTE_CSEQ(x) ntatag_remote_cseq, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_remote_cseq_ref;
 #define NTATAG_REMOTE_CSEQ_REF(x) ntatag_remote_cseq_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_smime;
-/** Provide S/MIME context to NTA. @HI */
 #define NTATAG_SMIME(x)     ntatag_smime, tag_ptr_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_smime_ref;
 #define NTATAG_SMIME_REF(x) ntatag_smime_ref, tag_ptr_vr(&(x), (x))
  
 NTA_DLL extern tag_typedef_t ntatag_maxsize;
-/** Maximum size of incoming message. @HI 
- *
- * If the size of an incoming request message would exceed the
- * given limit, the stack will automatically respond with <i>413 Request
- * Entity Too Large</i>.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    usize_t 
- *
- * @par Values
- *    - Maximum acceptable size of an incoming request message.
- *      Default value is 2 megabytes (2097152 bytes).
- *
- * @sa msg_maxsize()
- */
 #define NTATAG_MAXSIZE(x) ntatag_maxsize, tag_usize_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_maxsize_ref;
 #define NTATAG_MAXSIZE_REF(x) ntatag_maxsize_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_udp_mtu;
-/** Maximum size of outgoing UDP request. @HI 
- *
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    
- *
- * @par Values
- *    - 
- *
- * @sa
- *
- */
 #define NTATAG_UDP_MTU(x) ntatag_udp_mtu, tag_usize_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_udp_mtu_ref;
 #define NTATAG_UDP_MTU_REF(x) ntatag_udp_mtu_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_max_forwards;
-/** Default value for @MaxForwards header. 
- *
- * The default value of @MaxForwards header added to the requests. The
- * initial value recommended by @RFC3261 is 70, but usually SIP proxies use
- * much lower default value, such as 24.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned
- *
- * @par Values
- *    - Default value added to the @MaxForwards header in the sent requests
- *
- * @since New in @VERSION_1_12_2.
- */
 #define NTATAG_MAX_FORWARDS(x) ntatag_max_forwards, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_max_forwards_ref;
 #define NTATAG_MAX_FORWARDS_REF(x) ntatag_max_forwards_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_sip_t1;
-/** Initial retransmission interval (in milliseconds) @HI 
- *
- * Set the T1 retransmission interval used by the SIP transaction engine. The
- * T1 is the initial duration used by request retransmission timers A and E
- * (UDP) as well as response retransmission timer G.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    - Value of SIP T1 in milliseconds 
- *
- * @sa @RFC3261 appendix A, NTATAG_SIP_T1X4(), NTATAG_SIP_T1(), NTATAG_SIP_T4()
- */
 #define NTATAG_SIP_T1(x) ntatag_sip_t1, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_sip_t1_ref;
 #define NTATAG_SIP_T1_REF(x) ntatag_sip_t1_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_sip_t1x64;
-/** Transaction timeout (defaults to T1 * 64). @HI 
- *
- * Set the T1x64  timeout value used by the SIP transaction engine. The T1x64 is
- * duration used for timers B, F, H, and J (UDP) by the SIP transaction engine. 
- * The timeout value T1x64 can be adjusted separately from the initial
- * retransmission interval T1, which is set with NTATAG_SIP_T1().
- * 
- * The default value for T1x64 is 64 times value of T1, or 32000 milliseconds.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    - Value of T1x64 in milliseconds
- *
- * @sa @RFC3261 appendix A, NTATAG_SIP_T1(), NTATAG_SIP_T2(), NTATAG_SIP_T4()
- *
- */
 #define NTATAG_SIP_T1X64(x) ntatag_sip_t1x64, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_sip_t1x64_ref;
 #define NTATAG_SIP_T1X64_REF(x) ntatag_sip_t1x64_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_sip_t2;
-/** Maximum retransmission interval (in milliseconds) @HI 
- *
- * Set the maximum retransmission interval used by the SIP transaction
- * engine. The T2 is the maximum duration used for the timers E (UDP) and G
- * by the SIP transaction engine. Note that the timer A is not capped by T2. 
- * Retransmission interval of INVITE requests grows exponentially until the
- * timer B fires.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    - Value of SIP T2 in milliseconds 
- *
- * @sa @RFC3261 appendix A, NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T4()
- */
 #define NTATAG_SIP_T2(x) ntatag_sip_t2, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_sip_t2_ref;
 #define NTATAG_SIP_T2_REF(x) ntatag_sip_t2_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_sip_t4;
-/** Transaction lifetime (in milliseconds) @HI 
- *
- * Set the lifetime for completed transactions used by the SIP transaction
- * engine. A completed transaction is kept around for the duration of T4 in
- * order to catch late responses. The T4 is the maximum duration for the
- * messages to stay in the network and the duration of SIP timer K.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    - Value of SIP T4 in milliseconds
- *
- * @sa @RFC3261 appendix A, NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T2()
- */
 #define NTATAG_SIP_T4(x)    ntatag_sip_t4, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_sip_t4_ref;
 #define NTATAG_SIP_T4_REF(x) ntatag_sip_t4_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_progress;
-/** Progress timer for User-Agents (interval for retranmitting 1XXs) @HI.
- *
- * The UAS should retransmit preliminary responses to the INVITE
- * transactions every minute in order to re-set the timer C within the
- * intermediate proxies.
- *
- * The default value for the progress timer is 60000.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    Value of progress timer in milliseconds.
- *
- * @sa @RFC3261 sections 13.3.1.1, 16.7 and 16.8, NTATAG_TIMER_C(),
- * NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T2(), NTATAG_SIP_T4()
- */
 #define NTATAG_PROGRESS(x)    ntatag_progress, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_progress_ref;
 #define NTATAG_PROGRESS_REF(x) ntatag_progress_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_timer_c;
-/** Value for timer C in milliseconds. @HI
- *
- * By default the INVITE transaction will not timeout after a preliminary
- * response has been received. However, an intermediate proxy can timeout
- * the transaction using timer C. Timer C is reset every time a response
- * belonging to the transaction is received.
- *
- * The default value for the timer C is 185000 milliseconds (3 minutes and 5
- * seconds). By default, timer C is not run on user agents (if NTATAG_UA(1)
- * without NTATAG_TIMER_C() is fgiven).
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    Value of SIP timer C in milliseconds. The default value is used
- *    instead if NTATAG_TIMER_C(0) is given.
- *
- * @sa @RFC3261 sections 13.3.1.1, 16.7 and 16.8,
- * NTATAG_UA(1), NTATAG_TIMER_C(),
- * NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T2(), NTATAG_SIP_T4()
- */
 #define NTATAG_TIMER_C(x)    ntatag_timer_c, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_timer_c_ref;
 #define NTATAG_TIMER_C_REF(x) ntatag_timer_c_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_blacklist;
-/** Add Retry-After header to internally-generated error messages. @HI 
- *
- * The NTATAG_BLACKLIST() provides a default value for @RetryAfter header
- * added to the internally generated responses such as <i>503 DNS Error</i>
- * or <i>408 Timeout</i>. The idea is that the application can retain its
- * current state and retry the operation after a while.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *     unsigned int
- *
- * @par Values
- *    - Value of @RetryAfter header (in seconds)
- *
- * @sa NTATAG_TIMEOUT_408()
- */
 #define NTATAG_BLACKLIST(x)  ntatag_blacklist, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_blacklist_ref;
 #define NTATAG_BLACKLIST_REF(x) ntatag_blacklist_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_debug_drop_prob;
-/** Packet drop probability for debugging. 
- *
- * The packet drop probability parameter is useful mainly for debugging
- * purposes. The stack drops an incoming message received over an unreliable
- * transport (such as UDP) with the given probability. The range is in 0 .. 
- * 1000, 500 means p=0.5.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned integer
- *
- * @par Values
- *    - Valid values are in range 0 ... 1000
- *    - Probablity to drop a given message is value / 1000.
- *
- * @HI
- */
 #define NTATAG_DEBUG_DROP_PROB(x) ntatag_debug_drop_prob, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_debug_drop_prob_ref;
 #define NTATAG_DEBUG_DROP_PROB_REF(x) ntatag_debug_drop_prob_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_sigcomp_options;
-/** Semicolon-separated SigComp options.
- *
- * @note This tag is has no effect without a SigComp plugin.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *    nta_agent_add_tport() \n
- *
- * @par Parameter type
- *    string 
- *
- * @par Values
- *    - semicolon-separated parameter-value pairs, passed to the SigComp plugin
- *
- * @sa NTATAG_COMP(), NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_AWARE(),
- * NTATAG_SIGCOMP_CLOSE(), @RFC3320
- * @HI
- */
 #define NTATAG_SIGCOMP_OPTIONS(x)    ntatag_sigcomp_options, tag_str_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_sigcomp_options_ref;
 #define NTATAG_SIGCOMP_OPTIONS_REF(x) ntatag_sigcomp_options_ref, tag_str_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_sigcomp_close;
-/** Close SigComp compartment after completing transaction.
- *
- * @note This tag is has no effect without a SigComp plugin.
- *
- * @par Used with
- *    nta_incoming_set_params(), nta_incoming_treply()
- *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
- *    nta_outgoing_tmcreate(), nta_outgoing_tcancel()
- *    nta_outgoing_prack(), nta_msg_tsend(), nta_msg_treply()
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - application takes care of compartment management
- *    - false - stack manages compartments
- *
- * @sa NTATAG_COMP(), TPTAG_COMPARTMENT(),
- * NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_AWARE(),
- * NTATAG_SIGCOMP_OPTIONS(), @RFC3320
- * @HI
- */
 #define NTATAG_SIGCOMP_CLOSE(x)  ntatag_sigcomp_close, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_sigcomp_close_ref;
 #define NTATAG_SIGCOMP_CLOSE_REF(x) ntatag_sigcomp_close_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_sigcomp_aware;
-/** Indicate that the application is SigComp-aware. 
- *
- * @note This tag is has no effect without a SigComp plugin.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - application takes care of compartment management
- *    - false - stack manages compartments
- *
- * @sa NTATAG_COMP(), NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_CLOSE(),
- * NTATAG_SIGCOMP_OPTIONS(), @RFC3320
- * 
- * @HI
- */
 #define NTATAG_SIGCOMP_AWARE(x) ntatag_sigcomp_aware, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_sigcomp_aware_ref;
 #define NTATAG_SIGCOMP_AWARE_REF(x) ntatag_sigcomp_aware_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_sigcomp_algorithm;
-/** Specify SigComp algorithm.  
- *
- * @note This tag is has no effect without a SigComp plugin.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *    nta_agent_add_tport() \n
- *
- * @par Parameter type
- *    string 
- *
- * @par Values
- *    - opaque string passed to the SigComp plugin
- *
- * @sa NTATAG_COMP(), NTATAG_SIGCOMP_AWARE(), NTATAG_SIGCOMP_CLOSE(),
- * NTATAG_SIGCOMP_OPTIONS(), @RFC3320
- * 
- * @HI
- */
 #define NTATAG_SIGCOMP_ALGORITHM(x) ntatag_sigcomp_algorithm, tag_str_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_sigcomp_algorithm_ref;
@@ -693,540 +235,108 @@
 ntatag_sigcomp_algorithm_ref, tag_str_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_ua;
-/** If true, NTA acts as User Agent Server or Client by default.
- *
- * When acting as an UA, the NTA stack will
- * - respond with 481 to a PRACK request with no matching "100rel" response
- * - check for out-of-order CSeq headers for each #nta_leg_t dialog object
- * - if NTATAG_MERGE_482(1) is also used, return <i>482 Request Merged</i> to
- *   a duplicate request with same @CallID, @CSeq, @From tag but different
- *   topmost @Via header (see @RFC3261 section 8.2.2.2 Merged Requests)
- * - silently discard duplicate final responses to INVITE
- * - retransmit preliminary responses (101..199) to INVITE request in regular
- *   intervals ("timer N2")
- * - retransmit 2XX response to INVITE request with exponential intervals 
- * - handle ACK sent in 2XX response to an INVITE using the
- *   #nta_ack_cancel_f callback bound to #nta_incoming_t with
- *   nta_incoming_bind()
- * - not use timer C unless its value has been explicitly set
- *
- * @note This NUTAG_UA(1) is set internally by nua_create()
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - act as an UA 
- *    - false - act as an proxy 
- *
- * @sa NTATAG_MERGE_482()
- */
 #define NTATAG_UA(x) ntatag_ua, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_ua_ref;
 #define NTATAG_UA_REF(x) ntatag_ua_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_stateless;
-/** Enable stateless processing. @HI 
- *
- * @par Server side
- * The incoming requests are processed statefully if there is a default leg
- * (created with nta_leg_default()). This option is provided for proxies or
- * other server elements that process requests statelessly.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Values
- *    - true - do not pass incoming requests to default leg
- *    - false - pass incoming requests to default leg, if it exists
- *
- * @par Client side
- * The outgoing requests can be sent statelessly, too, if the
- * NTATAG_STATELESS(1) is included in the tag list of nta_outgoing_tcreate().
- *
- * @par Used with
- *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
- *    nta_outgoing_tcancel(), nta_outgoing_prack()
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - create only a transient #nta_outgoing_t transaction object
- *    - false - create an ordinary client transaction object
- *
- * @sa NTATAG_IS_UA(), nta_incoming_default(), nta_outgoing_default(),
- * nta_leg_default()
- */
 #define NTATAG_STATELESS(x) ntatag_stateless, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_stateless_ref;
 #define NTATAG_STATELESS_REF(x) ntatag_stateless_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_user_via;
-/** Allow application to insert Via headers. @HI 
- *
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - 
- *    - false - 
- *
- * @sa
- *
- */
 #define NTATAG_USER_VIA(x) ntatag_user_via, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_user_via_ref;
 #define NTATAG_USER_VIA_REF(x) ntatag_user_via_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_extra_100;
-/** Respond with "100 Trying" if application has not responded.
- *
- * As per recommended by @RFC4320, the stack can generate a 100 Trying
- * response to the non-INVITE requests if the application has not responded
- * to a request within half of the SIP T2 (the default value for T2 is 4000
- * milliseconds, so the extra <i>100 Trying<i/> would be sent after 2 seconds).
- *
- * @par Used with	
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - send extra 100 Trying if application does not respond
- *    - false - do not send 100 Trying (default)
- *
- * @sa @RFC4320, NTATAG_PASS_408(), NTATAG_TIMEOUT_408()
- */
 #define NTATAG_EXTRA_100(x)    ntatag_extra_100, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_extra_100_ref;
 #define NTATAG_EXTRA_100_REF(x) ntatag_extra_100_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_pass_100;
-/** Pass "100 Trying" provisional answers to the application. @HI 
- *
- * By default, the stack silently processes the <i>100 Trying</i> responses
- * from the server. Usually the <i>100 Trying</i> responses are not
- * important to the application but rather sent by the outgoing proxy
- * immediately after it has received the request. However, the application
- * can ask nta for them by setting NTATAG_PASS_100(1) if, for instance, the
- * <i>100 Trying</i> responses are needed for user feedback.
- *
- * @par Used with
- *    nua_create(), nta_agent_create(), nta_agent_set_params() \n
- *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
- *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - pass <i>100 Trying</i> to application
- *    - false - silently process <i>100 Trying</i> responses
- *
- * @sa NTATAG_EXTRA_100(), NTATAG_DEFAULT_PROXY()
- */
 #define NTATAG_PASS_100(x) ntatag_pass_100, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_pass_100_ref;
 #define NTATAG_PASS_100_REF(x) ntatag_pass_100_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_timeout_408;
-/** Generate "408 Request Timeout" response when request times out. @HI 
- *
- * This tag is used to prevent stack from generating extra 408 response
- * messages to non-INVITE requests upon timeout. As per recommended by
- * @RFC4320, the <i>408 Request Timeout</i> responses to non-INVITE
- * transaction are not sent over the network to the client by default. The
- * application can ask stack to pass the 408 responses with
- * NTATAG_PASS_408(1).
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - generate 408 response
- *    - false - invoke #nta_response_f callback with NULL sip pointer
- *              when a non-INVITE transaction times out
- *
- * @sa @RFC4320, NTATAG_PASS_408(), NTATAG_EXTRA_100(),
- */
 #define NTATAG_TIMEOUT_408(x)  ntatag_timeout_408, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_timeout_408_ref;
 #define NTATAG_TIMEOUT_408_REF(x) ntatag_timeout_408_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_pass_408;
-/** Pass "408 Request Timeout" responses to the client. @HI 
- *
- * As per recommended by @RFC4320, the <i>408 Request Timeout</i> responses
- * to non-INVITE transaction are not sent over the network to the client by
- * default. The application can ask stack to pass the 408 responses with
- * NTATAG_PASS_408(1). 
- *
- * Note that unlike NTATAG_PASS_100(), this tags changes the way server side
- * works.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - pass superfluous 408 responses 
- *    - false - discard superfluous 408 responses
- *
- * @sa @RFC4320, NTATAG_EXTRA_100(), NTATAG_TIMEOUT_408()
- *
- */
 #define NTATAG_PASS_408(x)  ntatag_pass_408, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_pass_408_ref;
 #define NTATAG_PASS_408_REF(x) ntatag_pass_408_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_no_dialog;
-/** Create a leg without dialog. @HI */
 #define NTATAG_NO_DIALOG(x)       ntatag_no_dialog, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_no_dialog_ref;
 #define NTATAG_NO_DIALOG_REF(x)   ntatag_no_dialog_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_merge_482;
-/** Merge requests, send 482 to other requests. @HI 
- *
- * If an User-Agent receives a duplicate request with same @CallID, @CSeq,
- * @From tag but different topmost @Via header (see @RFC3261 section 8.2.2.2
- * Merged Requests), it should return <i>482 Request Merged</i> response to
- * the duplicate request. Such a duplicate request has been originally
- * generated by a forking proxy and usually routed via different route to
- * the User-Agent. The User-Agent should only respond meaningfully to the
- * first request and return the 482 response to the following forked
- * requests.
- *
- * Note that also NTATAG_UA(1) should be set before nta detects merges and
- * responds with 482 to them.
- *
- * @note If your application is an multi-lined user-agent, you may consider
- * disabling request merging. However, you have to somehow handle merging
- * within a single line.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - detect duplicate requests and respond with 482 to them
- *    - false - process duplicate requests separately
- *
- * @sa NTATAG_UA(1)
- */
 #define NTATAG_MERGE_482(x)       ntatag_merge_482, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_merge_482_ref;
 #define NTATAG_MERGE_482_REF(x)   ntatag_merge_482_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_cancel_2543;
-/**Follow @RFC2543 semantics with CANCEL.
- *
- * By default, the nta follows "@RFC3261" semantics when CANCELing a
- * request. The CANCEL does not terminate transaction, rather, it is just a
- * hint to the server that it should respond immediately (with <i>487
- * Request Terminated</i> if it has no better response). Also, if the
- * original request was sent over unreliable transport such as UDP, the
- * CANCEL is delayed until the server has sent a preliminary response to the
- * original request.
- *
- * If NTATAG_CANCEL_2543(1) is given, the transaction is canceled
- * immediately internally (a 487 response is generated locally) and the
- * CANCEL request is sent without waiting for an provisional response.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *    nta_outgoing_tcancel()
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - follow "RFC 2543" semantics with CANCEL
- *    - false - follow "RFC 3261" semantics with CANCEL
- *
- * @sa NTATAG_CANCEL_408()
- * 
- * @HI
- */
 #define NTATAG_CANCEL_2543(x)     ntatag_cancel_2543, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_cancel_2543_ref;
 #define NTATAG_CANCEL_2543_REF(x) ntatag_cancel_2543_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_cancel_408;
-/** Do not send a CANCEL but just timeout the request. 
- *
- * Calling nta_outgoing_tcancel() with this tag set marks request as
- * canceled but does not actually send a CANCEL request. If
- * NTATAG_CANCEL_2543(1) is also included, a 487 response is generated
- * internally.
- *
- * @par Used with
- *    nta_outgoing_tcancel() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - do not send CANCEL
- *    - false - let request to timeout
- *
- * @sa NTATAG_CANCEL_2543()
- */
 #define NTATAG_CANCEL_408(x)     ntatag_cancel_408, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_cancel_408_ref;
 #define NTATAG_CANCEL_408_REF(x) ntatag_cancel_408_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_tag_3261;
-/** When responding to requests, use unique tags. @HI 
- *
- * If set the UA would generate an unique @From/@To tag for all dialogs. If
- * unset UA would reuse same tag in order to make it easier to re-establish
- * dialog state after a reboot.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - use different tag for each dialog
- *    - false - use same tag for all dialogs
- *
- * @sa @RFC3261 section 12.2.2
- */
 #define NTATAG_TAG_3261(x)        ntatag_tag_3261, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_tag_3261_ref;
 #define NTATAG_TAG_3261_REF(x)    ntatag_tag_3261_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_use_timestamp;
-/** Use @Timestamp header. @HI 
- *
- * If set, a @Timestamp header would be added to stateful requests. The
- * header can be used to calculate the roundtrip transport latency between
- * client and server.
- *
- * @par Used with
- *    nua_create(), 
- *    nta_agent_create(),
- *    nta_agent_set_params(),
- *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
- *    nta_outgoing_tcancel(), and nta_outgoing_prack().
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - Add @Timestamp header
- *    - false - do not add @Timestamp header
- *
- * @sa @RFC3261 section 8.2.6
- */
 #define NTATAG_USE_TIMESTAMP(x) ntatag_use_timestamp, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_use_timestamp_ref;
 #define NTATAG_USE_TIMESTAMP_REF(x) ntatag_use_timestamp_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_method;
-/**Method name. @HI 
- *
- * Create a dialogless #nta_leg_t object matching only requests with
- * the specified method.
- *
- * @par Used with
- *   nta_leg_tcreate()
- *
- * @par Parameter type
- *    String containing method name.
- *
- * @par Values
- *    SIP method name (e.g., "SUBSCRIBE").
- *
- */
 #define NTATAG_METHOD(x)          ntatag_method, tag_str_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_method_ref;
 #define NTATAG_METHOD_REF(x)      ntatag_method_ref, tag_str_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_cancel_487;
-/** When a CANCEL is received, automatically return 487 response to original request.
- *
- * When the CANCEL is received for an ongoing server transaction
- * #nta_incoming_t, the stack will automatically return a <i>487 Request
- * Terminated</i> response to the client after returning from the
- * #nta_incoming_f callback bound to the transaction with
- * nta_incoming_bind()
- * 
- * The application can delay sending the response to the original request
- * when NTATAG_CANCEL_408(0) is used. This is useful, for instance, with a
- * proxy that forwards the CANCEL downstream and the forwards the response
- * back to upstream.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - respond automatically to the CANCELed transaction
- *    - false - application takes care of responding
- *
- * @sa NTATAG_CANCEL_2543(), nta_incoming_bind()
- *
- * @HI
- */
 #define NTATAG_CANCEL_487(x)     ntatag_cancel_487, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_cancel_487_ref;
 #define NTATAG_CANCEL_487_REF(x) ntatag_cancel_487_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_rel100;
-/** Include rel100 in INVITE requests. @HI 
- *
- * Include feature tag "100rel" in @Supported header of the INVITE requests.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - include "100rel"
- *    - false - do not include "100rel"
- *
- * @sa nta_outgoing_prack(), nta_reliable_treply(), nta_reliable_mreply()
- */
 #define NTATAG_REL100(x)     ntatag_rel100, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_rel100_ref;
 #define NTATAG_REL100_REF(x) ntatag_rel100_ref, tag_bool_vr(&(x))
  
 NTA_DLL extern tag_typedef_t ntatag_sipflags;
-/** Set SIP parser flags. @HI 
- *
- * The SIP parser flags affect how the messages are parsed and the result
- * presented to the application. They also control encoding of messages.
- * The most important flags are as follows:
- * - MSG_FLG_COMPACT - use compact form 
- *                     (single-letter header names, minimum whitespace)
- * - MSG_FLG_EXTRACT_COPY - cache printable copy of headers when parsing. 
- *   Using this flag can speed up proxy processing considerably. It is
- *   implied when the parsed messages are logged (because #TPORT_LOG
- *   environment variable is set, or TPTAG_LOG() is used.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned int 
- *
- * @par Values
- *    - Bitwise OR of SIP parser flags (enum #msg_flg_user)
- *
- * @sa NTATAG_PRELOAD(), enum #msg_flg_user, sip_s::sip_flags
- */
 #define NTATAG_SIPFLAGS(x)     ntatag_sipflags, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_sipflags_ref;
 #define NTATAG_SIPFLAGS_REF(x) ntatag_sipflags_ref, tag_uint_vr(&(x))
  
 NTA_DLL extern tag_typedef_t ntatag_client_rport;
-/** Enable client-side "rport". @HI 
- *
- * This tag controls @RFC3581 support on client side. The "rport" parameter
- * is used when the response has to be routed symmetrically through a NAT box.
- *
- * The client-side support involves just adding the "rport" parameter to the topmost
- * @Via header before the request is sent. 
- *
- * @note By default, the client "rport" is disabled when nta is used, and
- * enabled when nua is used.
- *
- * @par Used with
- *    nua_create() (nua uses NTATAG_CLIENT_RPORT(1) by default) \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - add "rport" parameter
- *    - false - do not add "rport" parameter
- *
- * @note The NTATAG_RPORT() is a synonym for this.
- *
- * @sa @RFC3581, NTATAG_SERVER_RPORT(), @Via
- */
 #define NTATAG_CLIENT_RPORT(x) ntatag_client_rport, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_client_rport_ref;
@@ -1236,158 +346,36 @@
 #define NTATAG_RPORT_REF(x) ntatag_client_rport_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_server_rport;
-/** Use rport parameter at server.
- *
- * This tag controls @RFC3581 support on server side. The "rport" parameter
- * is used when the response has to be routed symmetrically through a NAT
- * box.
- *
- * If the topmost @Via header has an "rport" parameter, the server stores
- * the port number from which the request was sent in it. When sending the
- * response back to the client, the server uses the port number in the
- * "rport" parameter rather than the client-supplied port number in @Via
- * header.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - use "rport" parameter (default)
- *    - false - do not use "rport" parameterx
- *
- * @sa @RFC3581, NTATAG_CLIENT_RPORT(), @Via
- */
 #define NTATAG_SERVER_RPORT(x) ntatag_server_rport, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_server_rport_ref;
 #define NTATAG_SERVER_RPORT_REF(x) ntatag_server_rport_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_tcp_rport;
-/** Use rport with TCP, too. @HI 
- *
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - 
- *    - false - 
- *
- * @sa
- *
- */
 #define NTATAG_TCP_RPORT(x) ntatag_tcp_rport, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_tcp_rport_ref;
 #define NTATAG_TCP_RPORT_REF(x) ntatag_tcp_rport_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_preload;
-/** Preload by N bytes. @HI 
- *
- * When the memory block is allocated for an incoming request by the stack,
- * the stack can allocate some extra memory for the parser in addition to
- * the memory used by the actual message contents. 
- * 
- * While wasting some memory, this can speed up parsing considerably.
- * Recommended amount of preloading per packet is 1500 bytes.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    unsigned
- *
- * @par Values
- *    Amount of extra per-message memory allocated for parser.
- *
- * @sa NTATAG_SIPFLAGS() and #MSG_FLG_EXTRACT_COPY
- */
 #define NTATAG_PRELOAD(x) ntatag_preload, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_preload_ref;
 #define NTATAG_PRELOAD_REF(x) ntatag_preload_ref, tag_uint_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_use_naptr;
-/** If true, try to use NAPTR records when resolving. @HI 
- *
- * The application can disable NTA from using NAPTR records when resolving
- * SIP URIs.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - enable NAPTR resolving
- *    - false - disable NAPTR resolving
- *
- * @bug NAPTRs are not used with SIPS URIs in any case.
- *
- * @sa @RFC3263, NTATAG_USE_SRV()
- */
 #define NTATAG_USE_NAPTR(x) ntatag_use_naptr, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_use_naptr_ref;
 #define NTATAG_USE_NAPTR_REF(x) ntatag_use_naptr_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_use_srv;
-/** If true, try to use SRV records when resolving.
- *
- * The application can disable NTA from using SRV records when resolving
- * SIP URIs.
- *
- * @par Used with
- *    nua_create() \n
- *    nta_agent_create() \n
- *    nta_agent_set_params() \n
- *
- * @par Parameter type
- *    boolean: true (non-zero or non-NULL pointer)
- *          or false (zero or NULL pointer)
- *
- * @par Values
- *    - true - enable SRV resolving
- *    - false - disable SRV resolving
- *
- * @sa @RFC3263, NTATAG_USE_NAPTR()
- */
 #define NTATAG_USE_SRV(x) ntatag_use_srv, tag_bool_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_use_srv_ref;
 #define NTATAG_USE_SRV_REF(x) ntatag_use_srv_ref, tag_bool_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_rseq;
-
-/** @RSeq value for nta_outgoing_prack(). @HI 
- *
- * @par Used with
- *    nta_outgoing_prack()
- *
- * @par Parameter type
- *    @c unsigned @c int
- *
- * @par Values
- *    Response sequence number from the @RSeq header.
-*/
 #define NTATAG_RSEQ(x)    ntatag_rseq, tag_uint_v((x))
 
 NTA_DLL extern tag_typedef_t ntatag_rseq_ref;
@@ -1400,503 +388,193 @@
 #define NTATAG_S_IRQ_HASH(x) ntatag_s_irq_hash, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_irq_hash_ref;
-/** Get size of hash table for server-side transactions.
- *
- * Return number of transactions that fit in the hash table for server-side
- * transactions.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_IRQ_HASH_USED_REF(),
- * NTATAG_S_ORQ_HASH_REFxs(), NTATAG_S_LEG_HASH_REF()
- */
 #define NTATAG_S_IRQ_HASH_REF(x) ntatag_s_irq_hash_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_orq_hash;
 #define NTATAG_S_ORQ_HASH(x) ntatag_s_orq_hash, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_orq_hash_ref;
-/** Get size of hash table for client-side transactions.
- *
- * Return number of transactions that fit in the hash table for client-side
- * transactions.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_ORQ_HASH_USED_REF(),
- * NTATAG_S_IRQ_HASH_REF(), NTATAG_S_LEG_HASH_REF()
- */
 #define NTATAG_S_ORQ_HASH_REF(x) ntatag_s_orq_hash_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_leg_hash;
 #define NTATAG_S_LEG_HASH(x) ntatag_s_leg_hash, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_leg_hash_ref;
-/** Get size of hash table for dialogs.
- *
- * Return number of dialog objects that fit in the hash table for dialogs.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_LEG_HASH_USED_REF(),
- * NTATAG_S_IRQ_HASH_REF(), NTATAG_S_ORQ_HASH_REF()
- */
 #define NTATAG_S_LEG_HASH_REF(x) ntatag_s_leg_hash_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_irq_hash_used;
 #define NTATAG_S_IRQ_HASH_USED(x) ntatag_s_irq_hash_used, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_irq_hash_used_ref;
-/** Get number of server-side transactions in the hash table.
- *
- * Return number of server-side transactions objects in the hash table. The
- * number includes all transactions destroyed by the application which have
- * not expired yet.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_IRQ_HASH_REF(),
- * NTATAG_S_ORQ_HASH_USED_REF(), NTATAG_S_LEG_HASH_USED_REF()
- */
-#define NTATAG_S_IRQ_HASH_USED_REF(x) \
-ntatag_s_irq_hash_used_ref, tag_usize_vr(&(x))
+#define NTATAG_S_IRQ_HASH_USED_REF(x) ntatag_s_irq_hash_used_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_orq_hash_used;
 #define NTATAG_S_ORQ_HASH_USED(x) ntatag_s_orq_hash_used, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_orq_hash_used_ref;
-/** Get number of client-side transactions in the hash table.
- *
- * Return number of client-side transactions objects in the hash table. The
- * number includes all transactions destroyed by the application which have
- * not expired yet.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_ORQ_HASH_REF(),
- * NTATAG_S_IRQ_HASH_USED_REF(), NTATAG_S_LEG_HASH_USED_REF()
- */
-#define NTATAG_S_ORQ_HASH_USED_REF(x) \
-ntatag_s_orq_hash_used_ref, tag_usize_vr(&(x))
+#define NTATAG_S_ORQ_HASH_USED_REF(x) ntatag_s_orq_hash_used_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_leg_hash_used;
 #define NTATAG_S_LEG_HASH_USED(x) ntatag_s_leg_hash_used, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_leg_hash_used_ref;
-/** Get number of dialogs in the hash table.
- *
- * Return number of dialog objects in the hash table. Note that the
- * nta_leg_t objects created with NTATAG_NO_DIALOG(1) and this not
- * corresponding to a dialog are not included in the number.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_LEG_HASH_REF(),
- * NTATAG_S_IRQ_HASH_USED_REF(), NTATAG_S_ORQ_HASH_USED_REF()
- */
-#define NTATAG_S_LEG_HASH_USED_REF(x) \
-ntatag_s_leg_hash_used_ref, tag_usize_vr(&(x))
+#define NTATAG_S_LEG_HASH_USED_REF(x) ntatag_s_leg_hash_used_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_recv_msg;
 #define NTATAG_S_RECV_MSG(x) ntatag_s_recv_msg, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_recv_msg_ref;
-/** Get number of SIP messages received.
- *
- * Return number SIP messages that has been received.  The number includes
- * also bad and unparsable messages.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_BAD_MESSAGE_REF(),
- * NTATAG_S_RECV_REQUEST_REF(), NTATAG_S_RECV_RESPONSE_REF()
- */
 #define NTATAG_S_RECV_MSG_REF(x) ntatag_s_recv_msg_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_recv_request;
 #define NTATAG_S_RECV_REQUEST(x) ntatag_s_recv_request, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_recv_request_ref;
-/** Get number of SIP requests received.
- *
- * Return number SIP requests that has been received. The number includes
- * also number of bad requests available with NTATAG_S_BAD_REQUEST_REF().
- *
- * @sa nta_agent_get_stats(), NTATAG_S_BAD_REQUEST_REF(),
- * NTATAG_S_RECV_MSG_REF(), NTATAG_S_RECV_RESPONSE_REF()
- */
-#define NTATAG_S_RECV_REQUEST_REF(x)\
- ntatag_s_recv_request_ref, tag_usize_vr(&(x))
+#define NTATAG_S_RECV_REQUEST_REF(x) ntatag_s_recv_request_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_recv_response;
 #define NTATAG_S_RECV_RESPONSE(x) ntatag_s_recv_response, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_recv_response_ref;
-/** Get number of SIP responses received.
- *
- * Return number SIP responses that has been received. The number includes
- * also number of bad and unusable responses available with
- * NTATAG_S_BAD_RESPONSE_REF().
- *
- * @sa nta_agent_get_stats(), NTATAG_S_BAD_RESPONSE_REF(),
- * NTATAG_S_RECV_MSG_REF(), NTATAG_S_RECV_REQUEST_REF()
- */
-#define NTATAG_S_RECV_RESPONSE_REF(x)\
- ntatag_s_recv_response_ref, tag_usize_vr(&(x))
+#define NTATAG_S_RECV_RESPONSE_REF(x) ntatag_s_recv_response_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_bad_message;
 #define NTATAG_S_BAD_MESSAGE(x) ntatag_s_bad_message, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_bad_message_ref;
-/** Get number of bad SIP messages received.
- *
- * Return number of bad SIP messages that has been received.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_RECV_MSG_REF(), 
- * NTATAG_S_BAD_REQUEST_REF(), NTATAG_S_BAD_RESPONSE_REF().
- */
-#define NTATAG_S_BAD_MESSAGE_REF(x)\
- ntatag_s_bad_message_ref, tag_usize_vr(&(x))
+#define NTATAG_S_BAD_MESSAGE_REF(x) ntatag_s_bad_message_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_bad_request;
 #define NTATAG_S_BAD_REQUEST(x) ntatag_s_bad_request, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_bad_request_ref;
-/** Get number of bad SIP requests received.
- *
- * Return number of bad SIP requests that has been received.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_BAD_MESSAGE_REF(),
- * NTATAG_S_BAD_RESPONSE_REF().
- */
-#define NTATAG_S_BAD_REQUEST_REF(x)\
- ntatag_s_bad_request_ref, tag_usize_vr(&(x))
+#define NTATAG_S_BAD_REQUEST_REF(x) ntatag_s_bad_request_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_bad_response;
 #define NTATAG_S_BAD_RESPONSE(x) ntatag_s_bad_response, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_bad_response_ref;
-/** Get number of bad SIP responses received.
- *
- * Return number of bad SIP responses that has been received.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_BAD_MESSAGE_REF(),
- * NTATAG_S_BAD_REQUEST_REF()
- */
-#define NTATAG_S_BAD_RESPONSE_REF(x)\
- ntatag_s_bad_response_ref, tag_usize_vr(&(x))
+#define NTATAG_S_BAD_RESPONSE_REF(x) ntatag_s_bad_response_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_drop_request;
 #define NTATAG_S_DROP_REQUEST(x) ntatag_s_drop_request, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_drop_request_ref;
-/** Get number of SIP requests dropped.
- *
- * Return number of SIP requests that has been randomly dropped after
- * receiving them because of NTATAG_DEBUG_DROP_PROB() has been set.
- *
- * @sa nta_agent_get_stats(), NTATAG_DEBUG_DROP_PROB(),
- * NTATAG_S_DROP_RESPONSE_REF()
- * 
- * @note The value was not calculated before @VERSION_1_12_7.
- */
-#define NTATAG_S_DROP_REQUEST_REF(x)\
- ntatag_s_drop_request_ref, tag_usize_vr(&(x))
+#define NTATAG_S_DROP_REQUEST_REF(x) ntatag_s_drop_request_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_drop_response;
 #define NTATAG_S_DROP_RESPONSE(x) ntatag_s_drop_response, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_drop_response_ref;
-/** Get number of SIP responses dropped.
- *
- * Return number of SIP responses that has been randomly dropped after
- * receiving them because of NTATAG_DEBUG_DROP_PROB() has been set.
- *
- * @sa nta_agent_get_stats(), NTATAG_DEBUG_DROP_PROB(),
- * NTATAG_S_DROP_REQUEST_REF()
- * 
- * @note The value was not calculated before @VERSION_1_12_7.
- */
-#define NTATAG_S_DROP_RESPONSE_REF(x)\
- ntatag_s_drop_response_ref, tag_usize_vr(&(x))
+#define NTATAG_S_DROP_RESPONSE_REF(x) ntatag_s_drop_response_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_client_tr;
 #define NTATAG_S_CLIENT_TR(x) ntatag_s_client_tr, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_client_tr_ref;
-/** Get number of client transactions created.
- *
- * Return number of client transactions created. The number also includes
- * client transactions with which stack failed to send the request because
- * the DNS resolving failed or the transport failed.
- *
- * @note The number include stateless requests sent with nta_msg_tsend(),
- * too.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_SENT_REQUEST_REF(),
- * NTATAG_S_SERVER_TR_REF().
- */
-#define NTATAG_S_CLIENT_TR_REF(x)\
- ntatag_s_client_tr_ref, tag_usize_vr(&(x))
+#define NTATAG_S_CLIENT_TR_REF(x) ntatag_s_client_tr_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_server_tr;
 #define NTATAG_S_SERVER_TR(x) ntatag_s_server_tr, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_server_tr_ref;
-/** Get number of server transactions created.
- *
- * Return number of server transactions created. 
- *
- * @sa nta_agent_get_stats(), NTATAG_S_RECV_RESPONSE_REF(),
- * NTATAG_S_CLIENT_TR_REF(), NTATAG_S_DIALOG_TR_REF(),
- */
-#define NTATAG_S_SERVER_TR_REF(x)\
- ntatag_s_server_tr_ref, tag_usize_vr(&(x))
+#define NTATAG_S_SERVER_TR_REF(x) ntatag_s_server_tr_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_dialog_tr;
 #define NTATAG_S_DIALOG_TR(x) ntatag_s_dialog_tr, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_dialog_tr_ref;
-/** Get number of in-dialog server transactions created.
- *
- * Return number of in-dialog server transactions created. The number
- * includes only those transactions that were correlated with a dialog
- * object.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_SERVER_TR_REF(),
- * NTATAG_S_CLIENT_TR_REF(), NTATAG_S_RECV_RESPONSE_REF().
- */
-#define NTATAG_S_DIALOG_TR_REF(x)\
- ntatag_s_dialog_tr_ref, tag_usize_vr(&(x))
+#define NTATAG_S_DIALOG_TR_REF(x) ntatag_s_dialog_tr_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_acked_tr;
 #define NTATAG_S_ACKED_TR(x) ntatag_s_acked_tr, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_acked_tr_ref;
-/** Get number of server transactions that have received ACK.
- *
- * Return number of INVITE server transactions for which an ACK request has
- * been received.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_SERVER_TR_REF(),
- * NTATAG_S_CANCELED_TR_REF()
- */
 #define NTATAG_S_ACKED_TR_REF(x) ntatag_s_acked_tr_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_canceled_tr;
 #define NTATAG_S_CANCELED_TR(x) ntatag_s_canceled_tr, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_canceled_tr_ref;
-/** Get number of server transactions that have been CANCELed.
- *
- * Return number of server transactions for which an CANCEL request has been
- * received. Currently, the count includes only INVITE server transactions
- * that have been CANCELed.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_SERVER_TR_REF(),
- * NTATAG_S_ACKED_TR_REF().
- */
-#define NTATAG_S_CANCELED_TR_REF(x)  \
- ntatag_s_canceled_tr_ref, tag_usize_vr(&(x))
+#define NTATAG_S_CANCELED_TR_REF(x)   ntatag_s_canceled_tr_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_trless_request;
 #define NTATAG_S_TRLESS_REQUEST(x) ntatag_s_trless_request, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_trless_request_ref;
-/** Get number of requests that were processed stateless.
- *
- * Return number of received requests that were processed statelessly,
- * either with #nta_message_f message callback given with the
- * nta_agent_create() or, missing the callback, by returning a <i>501 Not
- * Implemented</i> response to the request.
- *
- * @sa nta_agent_get_stats(), <sofia-sip/nta_stateless.h>,
- * nta_agent_create(), #nta_message_f, NTATAG_S_TRLESS_TO_TR_REF(),
- * NTATAG_S_TRLESS_RESPONSE_REF()
- */
-#define NTATAG_S_TRLESS_REQUEST_REF(x)\
- ntatag_s_trless_request_ref, tag_usize_vr(&(x))
+#define NTATAG_S_TRLESS_REQUEST_REF(x) ntatag_s_trless_request_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_trless_to_tr;
 #define NTATAG_S_TRLESS_TO_TR(x) ntatag_s_trless_to_tr, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_trless_to_tr_ref;
-/** Get number of requests converted to transactions by message callback.
- *
- * Return number of requests that were converted to a server transaction
- * with nta_incoming_create().
- *
- * @sa nta_agent_get_stats(), nta_incoming_create(), nta_agent_create(),
- * #nta_message_f, NTATAG_S_TRLESS_REQUEST_REF()
- */
-#define NTATAG_S_TRLESS_TO_TR_REF(x)\
- ntatag_s_trless_to_tr_ref, tag_usize_vr(&(x))
+#define NTATAG_S_TRLESS_TO_TR_REF(x) ntatag_s_trless_to_tr_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_trless_response;
 #define NTATAG_S_TRLESS_RESPONSE(x) ntatag_s_trless_response, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_trless_response_ref;
-/** Get number of responses without matching request.
- *
- * Return number of received responses for which no matching client
- * transaction was found. Such responses are processed either by the
- * client transaction created with nta_outgoing_default(), the
- * #nta_message_f message callback given to nta_agent_create(), or, missing
- * both the default client transaction and message callback, they are
- * silently discarded.
- *
- * The NTATAG_S_TRLESS_200_REF() counter counts those successful 2XX
- * responses to the INVITE without client transaction which are silently
- * discarded.
- *
- * @sa nta_agent_get_stats(), nta_outgoing_default(), nta_agent_create(),
- * <sofia-sip/nta_stateless.h>, #nta_message_f, nta_msg_ackbye(),
- * NTATAG_S_TRLESS_REQUEST_REF(), NTATAG_S_TRLESS_200_REF().
- */
-#define NTATAG_S_TRLESS_RESPONSE_REF(x)\
- ntatag_s_trless_response_ref, tag_usize_vr(&(x))
+#define NTATAG_S_TRLESS_RESPONSE_REF(x) ntatag_s_trless_response_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_trless_200;
 #define NTATAG_S_TRLESS_200(x) ntatag_s_trless_200, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_trless_200_ref;
-/** Get number of successful responses missing INVITE client transaction.
- *
- * Return number of received 2XX responses to INVITE transaction for which
- * no matching client transaction was found nor which were processed by a
- * default client transaction created with nta_outgoing_default() or
- * #nta_message_f message callback given to nta_agent_create().
- *
- * @sa nta_agent_get_stats(), nta_outgoing_default(), nta_agent_create(),
- * <sofia-sip/nta_stateless.h>, #nta_message_f, nta_msg_ackbye(),
- * NTATAG_S_TRLESS_RESPONSE_REF().
- */
-#define NTATAG_S_TRLESS_200_REF(x)\
- ntatag_s_trless_200_ref, tag_usize_vr(&(x))
+#define NTATAG_S_TRLESS_200_REF(x) ntatag_s_trless_200_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_merged_request;
 #define NTATAG_S_MERGED_REQUEST(x) ntatag_s_merged_request, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_merged_request_ref;
-/** Get number of requests merged by UAS.
- *
- * Return number of requests for which UAS already has returned a response
- * and which were merged (that is, returned a <i>482 Request Merged</i>
- * response).
- *
- * @sa nta_agent_get_stats(), NTATAG_UA(1), @RFC3261 section 8.2.2.2
- */
-#define NTATAG_S_MERGED_REQUEST_REF(x)\
- ntatag_s_merged_request_ref, tag_usize_vr(&(x))
+#define NTATAG_S_MERGED_REQUEST_REF(x) ntatag_s_merged_request_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_sent_msg;
 #define NTATAG_S_SENT_MSG(x) ntatag_s_sent_msg, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_sent_msg_ref;
-/** Get number of SIP messages sent by stack.
- *
- * Return number of SIP messages given to the transport layer for
- * transmission by the SIP stack. The number includes also messages which
- * the transport layer failed to send for different reasons.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_RECV_MSG_REF(),
- * NTATAG_S_SENT_REQUEST_REF(), NTATAG_S_SENT_RESPONSE_REF()
- */
-#define NTATAG_S_SENT_MSG_REF(x)\
- ntatag_s_sent_msg_ref, tag_usize_vr(&(x))
+#define NTATAG_S_SENT_MSG_REF(x) ntatag_s_sent_msg_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_sent_request;
 #define NTATAG_S_SENT_REQUEST(x) ntatag_s_sent_request, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_sent_request_ref;
-/** Get number of SIP requests sent by stack.
- *
- * Return number of SIP requests given to the transport layer for
- * transmission by the SIP stack. The number includes retransmissions and
- * messages which the transport layer failed to send for different reasons.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_RECV_REQUEST_REF(),
- * NTATAG_S_SENT_MSG_REF(), NTATAG_S_SENT_RESPONSE_REF()
- */
-#define NTATAG_S_SENT_REQUEST_REF(x)\
- ntatag_s_sent_request_ref, tag_usize_vr(&(x))
+#define NTATAG_S_SENT_REQUEST_REF(x) ntatag_s_sent_request_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_sent_response;
 #define NTATAG_S_SENT_RESPONSE(x) ntatag_s_sent_response, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_sent_response_ref;
-/** Get number of SIP responses sent by stack.
- *
- * Return number of SIP responses given to the transport layer for
- * transmission by the SIP stack. The number includes retransmissions and
- * messages which the transport layer failed to send for different reasons.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_RECV_RESPONSE_REF(),
- * NTATAG_S_SENT_MSG_REF(), NTATAG_S_SENT_REQUEST_REF()
- */
-#define NTATAG_S_SENT_RESPONSE_REF(x)\
- ntatag_s_sent_response_ref, tag_usize_vr(&(x))
+#define NTATAG_S_SENT_RESPONSE_REF(x) ntatag_s_sent_response_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_retry_request;
 #define NTATAG_S_RETRY_REQUEST(x) ntatag_s_retry_request, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_retry_request_ref;
-/** Get number of SIP requests retransmitted by stack.
- *
- * Return number of SIP requests given to the transport layer for
- * retransmission by the SIP stack. The number includes messages which the
- * transport layer failed to send for different reasons.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_SENT_MSG_REF(),
- * NTATAG_S_SENT_REQUEST_REF(), NTATAG_S_RETRY_RESPONSE_REF()
- */
-#define NTATAG_S_RETRY_REQUEST_REF(x)\
- ntatag_s_retry_request_ref, tag_usize_vr(&(x))
+#define NTATAG_S_RETRY_REQUEST_REF(x) ntatag_s_retry_request_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_retry_response;
 #define NTATAG_S_RETRY_RESPONSE(x) ntatag_s_retry_response, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_retry_response_ref;
-/** Get number of SIP responses retransmitted by stack.
- *
- * Return number of SIP responses given to the transport layer for
- * retransmission by the SIP stack. The number includes messages which the
- * transport layer failed to send for different reasons.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_SENT_MSG_REF(),
- * NTATAG_S_SENT_REQUEST_REF(), NTATAG_S_RETRY_REQUEST_REF()
- */
-#define NTATAG_S_RETRY_RESPONSE_REF(x)\
- ntatag_s_retry_response_ref, tag_usize_vr(&(x))
+#define NTATAG_S_RETRY_RESPONSE_REF(x) ntatag_s_retry_response_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_recv_retry;
 #define NTATAG_S_RECV_RETRY(x) ntatag_s_recv_retry, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_recv_retry_ref;
-/** Get number of retransmitted SIP requests received by stack.
- *
- * Return number of SIP requests received by the stack. This number only
- * includes retransmission for which a matching server transaction object
- * was found.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_RETRY_REQUEST_REF().
- */
-#define NTATAG_S_RECV_RETRY_REF(x)\
- ntatag_s_recv_retry_ref, tag_usize_vr(&(x))
+#define NTATAG_S_RECV_RETRY_REF(x) ntatag_s_recv_retry_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_tout_request;
 #define NTATAG_S_TOUT_REQUEST(x) ntatag_s_tout_request, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_tout_request_ref;
-/** Get number of SIP client transactions that has timeout.
- *
- * Return number of SIP client transactions that has timeout.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_TOUT_RESPONSE_REF().
- */
-#define NTATAG_S_TOUT_REQUEST_REF(x)\
- ntatag_s_tout_request_ref, tag_usize_vr(&(x))
+#define NTATAG_S_TOUT_REQUEST_REF(x) ntatag_s_tout_request_ref, tag_usize_vr(&(x))
 
 NTA_DLL extern tag_typedef_t ntatag_s_tout_response;
 #define NTATAG_S_TOUT_RESPONSE(x) ntatag_s_tout_response, tag_usize_v(x)
 
 NTA_DLL extern tag_typedef_t ntatag_s_tout_response_ref;
-/** Get number of SIP server transactions that has timeout.
- *
- * Return number of SIP server transactions that has timeout. The number
- * includes only the INVITE transactions for which the stack has received no
- * ACK requests.
- *
- * @sa nta_agent_get_stats(), NTATAG_S_TOUT_REQUEST_REF().
- */
-#define NTATAG_S_TOUT_RESPONSE_REF(x)\
- ntatag_s_tout_response_ref, tag_usize_vr(&(x))
+#define NTATAG_S_TOUT_RESPONSE_REF(x) ntatag_s_tout_response_ref, tag_usize_vr(&(x))
 
 SOFIA_END_DECLS
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c	Thu Oct 11 10:16:59 2007
@@ -534,11 +534,11 @@
   TEST_1(default_proxy == NULL);
   TEST_1(smime == NULL);
 
-  TEST_1(blacklist != -1);
+  TEST_1(blacklist != (unsigned)-1);
   TEST(debug_drop_prob, 0);
   TEST_1(max_forwards >= 20);
   TEST_1(maxsize >= 65536);
-  TEST_1(preload != -1);
+  TEST_1(preload != (unsigned)-1);
   TEST_1(progress <= 60 * 1000);
   TEST(sip_t1, NTA_SIP_T1);
   TEST(sip_t2, NTA_SIP_T2);

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@file nth_server.c
+/**@internal @file nth_server.c
  * @brief HTTP server.
  * 
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth.h	Thu Oct 11 10:16:59 2007
@@ -50,7 +50,7 @@
 #ifndef NTH_CLIENT_MAGIC_T
 /** Default type of application context for client NTH requests.
  * Application may define this to appropriate type before including
- * <nth.h>. */
+ * <sofia-sip/nth.h>. */
 #define NTH_CLIENT_MAGIC_T struct nth_client_magic_s
 #endif
 
@@ -60,7 +60,7 @@
 #ifndef NTH_SITE_MAGIC_T
 /** Default type of application context for NTH servers.
  * Application may define this to appropriate type before including
- * <nth.h>. */
+ * <sofia-sip/nth.h>. */
 #define NTH_SITE_MAGIC_T struct nth_site_magic_s
 #endif
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/Doxyfile.in
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/Doxyfile.in	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/Doxyfile.in	Thu Oct 11 10:16:59 2007
@@ -32,7 +32,7 @@
 ALIASES		    += END_NUA_EVENT="@par &nbsp;"
 
 ALIASES             += \
-  NUA_HPARAM_CALLS="nua_invite(), nua_respond(), nua_ack(), nua_prack(), nua_update(), nua_info(), nua_bye(), nua_options(), nua_message(), nua_register(), nua_publish(), nua_refer(),nua_subscribe(), nua_notify(), nua_refer(), nua_notifier()"
+  NUA_HPARAM_CALLS="nua_method(), nua_respond(), nua_invite(), nua_ack(), nua_cancel(), nua_prack(), nua_update(), nua_info(), nua_bye(), nua_options(), nua_message(), nua_register(), nua_unregister(), nua_publish(), nua_refer(), nua_subscribe(), nua_unsubscribe(), nua_notify(), nua_notifier()"
 
 VERBATIM_HEADERS     = NO
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@file nua.c High-Level User Agent Library - "nua" Implementation.
+/**@internal @file nua.c High-Level User Agent Library - "nua" Implementation.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Kai Vehmanen <Kai.Vehmanen at nokia.com>
@@ -93,19 +93,28 @@
  * @param magic           Pointer to callback context
  * @param tag, value, ... List of tagged parameters
  *
- * @retval !=NULL a pointer to a @nua stack object \n
+ * @retval !=NULL a pointer to a @nua stack object
  * @retval NULL upon an error
  *
  * @par Related tags:
- *     NUTAG_PROXY()            \n
- *     NUTAG_URL()              \n
- *     NUTAG_SIPS_URL()         \n
- *     NUTAG_SIP_PARSER()       \n
- *     NUTAG_CERTIFICATE_DIR()  \n
- *     all tags listed in nua_set_params(), \n
- *     all NTATAG_* are passed to NTA listed in <sofia-sip/nta_tag.h> \n
- *     all tport tags listed in <sofia-sip/tport_tag.h> \n
- *     STUNTAG_DOMAIN(), STUNTAG_SERVER() \n
+ * - NUTAG_PROXY(), giving the URI of the outbound proxy
+ *   (but see also NUTAG_INITIAL_ROUTE()).
+ * - NUTAG_URL() (and NUTAG_SIPS_URL(), listing URIs describing
+ *   transports)
+ * - NUTAG_CERTIFICATE_DIR(), specifying the location of the 
+ *   root and client/server certificate files
+ * - NUTAG_SIP_PARSER(), providing customized parser used to 
+ *   parse received SIP messages
+ * - All parameter tags, listed with nua_set_params()
+ * - All NTATAG_* are passed to NTA documented in <sofia-sip/nta_tag.h>:
+ *   see NTATAG_EXTRA_100(), 
+ * - All tport tags are passed to tport. 
+ *   They are documented in <sofia-sip/tport_tag.h>
+ * - All SOATAG_* are passed to the default SOA (media session) object which
+ *   is created by nua_create() unless NUTAG_MEDIA_ENABLE(0) is included in
+ *   the tag list
+ * - STUN tags STUNTAG_DOMAIN(), STUNTAG_SERVER().
+ *   STUN is deprecated, however.
  *
  * @note
  * From the @VERSION_1_12_2 all the nua_set_params() tags are processed.
@@ -186,6 +195,13 @@
   nua_signal(nua, NULL, NULL, 1, nua_r_shutdown, 0, NULL, TAG_END());
 }
 
+/** @internal Linked stack frames from nua event callback */
+struct nua_event_frame_s {
+  nua_event_frame_t *nf_next;
+  nua_t *nf_nua;
+  nua_saved_event_t nf_saved[1];
+};
+
 /** Destroy the @nua stack.
  *
  * Before calling nua_destroy() the application
@@ -211,6 +227,8 @@
   enter;
 
   if (nua) {
+    nua_event_frame_t *nf;
+
     if (!nua->nua_shutdown_final) {
       SU_DEBUG_0(("nua_destroy(%p): FATAL: nua_shutdown not completed\n",
 		  (void *)nua));
@@ -218,6 +236,13 @@
       return;
     }
 
+    nua->nua_callback = NULL;
+
+    for (nf = nua->nua_current; nf; nf = nf->nf_next) {
+      nf->nf_nua = NULL;
+    }
+    nua->nua_current = NULL;
+
     su_task_deinit(nua->nua_server);
     su_task_deinit(nua->nua_client);
 
@@ -975,9 +1000,10 @@
 {
   nua_t *nua;
   nua_handle_t *nh = e->e_nh;
-
   enter;
 
+  e->e_nh = NULL;
+
   if (nh) {
     if (!nh->nh_ref_by_user && nh->nh_valid) {
       nh->nh_ref_by_user = 1;
@@ -1004,40 +1030,40 @@
 
   nua = nh->nh_nua; assert(nua);
 
-  if (e->e_event == nua_r_shutdown && e->e_status >= 200)
-    nua->nua_shutdown_final = 1;
-
-  if (!nua->nua_callback)
-    return;
-
   if (NH_IS_DEFAULT(nh))
     nh = NULL;
 
-  su_msg_save(nua->nua_current, sumsg);
+  if (e->e_event == nua_r_shutdown && e->e_status >= 200)
+    nua->nua_shutdown_final = 1;
 
-  e->e_nh = NULL;
+  if (nua->nua_callback) {
+    nua_event_frame_t frame[1];
+    
+    su_msg_remove_refs(sumsg);    /* Remove references to tasks */
+    su_msg_save(frame->nf_saved, sumsg);
+    frame->nf_nua = nua;
+    frame->nf_next = nua->nua_current, nua->nua_current = frame;
+
+    nua->nua_callback(e->e_event, e->e_status, e->e_phrase,
+		      nua, nua->nua_magic,
+		      nh, nh ? nh->nh_magic : NULL,
+		      e->e_msg ? sip_object(e->e_msg) : NULL,
+		      e->e_tags);
 
-  nua->nua_callback(e->e_event, e->e_status, e->e_phrase,
-		    nua, nua->nua_magic,
-		    nh, nh ? nh->nh_magic : NULL,
-		    e->e_msg ? sip_object(e->e_msg) : NULL,
-		    e->e_tags);
+    su_msg_destroy(frame->nf_saved);
+
+    if (frame->nf_nua == NULL)
+      return;
+    nua->nua_current = frame->nf_next;
+  }
 
-  if (nh && !NH_IS_DEFAULT(nh) && nua_handle_unref(nh)) {
+  if (nh && nua_handle_unref(nh)) {
 #if HAVE_NUA_HANDLE_DEBUG
     SU_DEBUG_0(("nua(%p): freed by application\n", (void *)nh));
 #else
     SU_DEBUG_9(("nua(%p): freed by application\n", (void *)nh));
 #endif
   }
-
-  if (!su_msg_is_non_null(nua->nua_current))
-    return;
-
-  if (e->e_msg)
-    msg_destroy(e->e_msg), e->e_msg = NULL;
-
-  su_msg_destroy(nua->nua_current);
 }
 
 /** Get current request message. @NEW_1_12_4.
@@ -1048,7 +1074,9 @@
  */
 msg_t *nua_current_request(nua_t const *nua)
 {
-  return nua && nua->nua_current ? su_msg_data(nua->nua_current)->e_msg : NULL;
+  if (nua && nua->nua_current && su_msg_is_non_null(nua->nua_current->nf_saved))
+    return su_msg_data(nua->nua_current->nf_saved)->e_msg;
+  return NULL;
 }
 
 /** Get request message from saved nua event. @NEW_1_12_4. 
@@ -1066,14 +1094,15 @@
  */
 int nua_save_event(nua_t *nua, nua_saved_event_t return_saved[1])
 {
-  if (nua && return_saved) {
-    su_msg_save(return_saved, nua->nua_current);
-    if (su_msg_is_non_null(return_saved)) {
-      /* Remove references to tasks */
-      su_msg_remove_refs(return_saved);
-      return 1;
+  if (return_saved) {
+    if (nua && nua->nua_current) {
+      su_msg_save(return_saved, nua->nua_current->nf_saved);
+      return su_msg_is_non_null(return_saved);
     }
+    else
+      *return_saved = NULL;
   }
+
   return 0;
 }
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c	Thu Oct 11 10:16:59 2007
@@ -238,7 +238,7 @@
  *
  * @sa nua_respond(), #nua_event_e, #nua_event_t, nua_event_name()
  *
- * @NEW_1_12_6
+ * @NEW_1_12_6.
  */
 int nua_event_is_incoming_request(nua_event_t event)
 {

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h	Thu Oct 11 10:16:59 2007
@@ -80,7 +80,7 @@
 
 } nua_server_methods_t;
 
-/** Server side transaction */
+/* Server side transaction */
 struct nua_server_request {
   struct nua_server_request *sr_next, **sr_prev;
 
@@ -147,7 +147,7 @@
   return (void)(sr->sr_phrase = phrase), (sr->sr_status = status);
 }
 
-/** Methods for client request */
+/* Methods for client request. @internal */
 typedef struct {
   sip_method_t crm_method;
   char const *crm_method_name;
@@ -367,7 +367,7 @@
   } ds_remote_ua[1];
 };
 
-/** Virtual function pointer table for dialog usage. */
+/* Virtual function pointer table for dialog usage. */
 typedef struct {
   unsigned usage_size, usage_class_size;
   int (*usage_add)(nua_owner_t *, 
@@ -387,7 +387,7 @@
 } nua_usage_class;
 
 
-/** Base structure for dialog usage. */
+/* Base structure for dialog usage. */
 struct nua_dialog_usage {
   nua_dialog_usage_t *du_next;
   nua_usage_class const *du_class;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c	Thu Oct 11 10:16:59 2007
@@ -79,7 +79,7 @@
   int status = 900;
   char const *phrase = nua_internal_error;
 
-  nua_stack_init_handle(nua, nh, TAG_NEXT(tags));
+  nua_stack_init_handle(nua, nh, tags);
 
   tl_gets(tags, 
 	  NUTAG_URL_REF(url), 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h	Thu Oct 11 10:16:59 2007
@@ -35,7 +35,7 @@
  * @date Created: Wed Mar  8 11:38:18 EET 2006  ppessi
  */
 
-/** NUA preferences.
+/**@internal @brief NUA preferences. 
  *
  * This structure contains values for various preferences and a separate
  * bitmap (nhp_set) for each preference. Preferences are set using

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c	Thu Oct 11 10:16:59 2007
@@ -116,7 +116,7 @@
 				       nua_dialog_state_t *,
 				       nua_dialog_usage_t *);
 
-/** REGISTER usage, aka nua_registration_t */
+/** @internal @brief REGISTER usage, aka nua_registration_t. */
 struct register_usage {
   nua_registration_t *nr_next, **nr_prev, **nr_list; /* Doubly linked list and its head */
   sip_from_t *nr_aor;		/**< AoR for this registration, NULL if none */
@@ -293,7 +293,7 @@
  * @par Related tags:
  *     NUTAG_REGISTRAR(), NUTAG_INSTANCE(), NUTAG_OUTBOUND(),
  *     NUTAG_KEEPALIVE(), NUTAG_KEEPALIVE_STREAM(), NUTAG_M_USERNAME(),
- *     NUTAG_M_DISPLAY(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES(), 
+ *     NUTAG_M_DISPLAY(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES()
  *
  * @par Events:
  *     #nua_r_register, #nua_i_outbound

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_registrar.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_registrar.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_registrar.c	Thu Oct 11 10:16:59 2007
@@ -57,9 +57,15 @@
  * Incoming REGISTER request.
  *
  * In order to receive #nua_i_register events, the application must enable
- * the REGISTER method with NUTAG_ALLOW() tag.
+ * the REGISTER method with NUTAG_ALLOW() tag, e.g.,
+ * @verbatim
+ * nua_set_params(nua;
+ *    NUTAG_APPL_METHOD("REGISTER"),
+ *    NUTAG_ALLOW("REGISTER"),
+ *    TAG_END());
+ * @endverbatim
  *
- * The nua_response() call responding to a REGISTER request must have
+ * The nua_response() call responding to a REGISTER request must include
  * NUTAG_WITH() (or NUTAG_WITH_THIS()/NUTAG_WITH_SAVED()) tag. Note that
  * a successful response to REGISTER @b MUST include the @Contact header
  * bound to the the AoR URI (in @To header).

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	Thu Oct 11 10:16:59 2007
@@ -137,7 +137,7 @@
 /* ---------------------------------------------------------------------- */
 /* Session event usage */
 
-/** Session-related state */
+/** @internal @brief Session-related state. */
 typedef struct nua_session_usage
 {
   enum nua_callstate ss_state;		/**< Session status (enum nua_callstate) */
@@ -1591,7 +1591,11 @@
     else if (answer_sent)
       ss->ss_oa_sent = Answer;
 
-    if (!cr->cr_restarting) /* Restart logic calls nua_prack_client_report */
+    if (cr->cr_restarting) 
+      /* Restart logic calls nua_prack_client_report */;
+    else if (!cr->cr_auto && (!offer_sent || !answer_sent))
+      /* Suppose application know it called nua_prack() */;
+    else
       signal_call_state_change(nh, ss, status, phrase, ss->ss_state);
   }
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	Thu Oct 11 10:16:59 2007
@@ -414,6 +414,9 @@
   case nua_r_info:
     error = nua_stack_info(nua, nh, event, tags);
     break;
+  case nua_r_prack:
+    error = nua_stack_prack(nua, nh, event, tags);
+    break;
   case nua_r_update:
     error = nua_stack_update(nua, nh, event, tags);
     break;
@@ -754,10 +757,8 @@
  * @retval -1 upon an error
  * @retval 0 when successful
  */
-int nua_stack_init_handle(nua_t *nua, nua_handle_t *nh,
-			  tag_type_t tag, tag_value_t value, ...)
+int nua_stack_init_handle(nua_t *nua, nua_handle_t *nh, tagi_t const *tags)
 {
-  ta_list ta;
   int retval = 0;
 
   if (nh == NULL)
@@ -765,13 +766,9 @@
 
   assert(nh != nua->nua_dhandle);
 
-  ta_start(ta, tag, value);
-
-  if (nua_stack_set_params(nua, nh, nua_i_error, ta_args(ta)) < 0)
+  if (nua_stack_set_params(nua, nh, nua_i_error, tags) < 0)
     retval = -1;
 
-  ta_end(ta);
-
   if (retval || nh->nh_init) /* Already initialized? */
     return retval;
 
@@ -814,7 +811,7 @@
 		 SIPTAG_FROM(from), /* Remote AoR */
 		 TAG_END());
 
-  if (nua_stack_init_handle(nh->nh_nua, nh, TAG_END()) < 0)
+  if (nua_stack_init_handle(nh->nh_nua, nh, NULL) < 0)
     nh_destroy(nua, nh), nh = NULL;
 
   if (nh && create_dialog) {
@@ -1672,7 +1669,9 @@
 
 /* ---------------------------------------------------------------------- */
 
-/** @class nua_client_request
+/**@internal
+ *
+ * @class nua_client_request
  *
  * Each handle has a queue of client-side requests; if a request is pending,
  * a new request from API is added to the queue. After the request is
@@ -1944,7 +1943,7 @@
   cr->cr_offer_recv = 0, cr->cr_answer_sent = 0;
   cr->cr_terminated = 0, cr->cr_graceful = 0;
 
-  nua_stack_init_handle(nua, nh, TAG_NEXT(cr->cr_tags));
+  nua_stack_init_handle(nua, nh, cr->cr_tags);
 
   if (cr->cr_method == sip_method_cancel) {
     if (cr->cr_methods->crm_init) {

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h	Thu Oct 11 10:16:59 2007
@@ -129,7 +129,7 @@
 
 #endif
 
-/** NUA handle. 
+/** @internal @brief NUA handle. 
  *
  */
 struct nua_handle_s 
@@ -197,6 +197,8 @@
   return nh == NULL || nh->nh_special;
 }
 
+typedef struct nua_event_frame_s nua_event_frame_t;
+
 extern char const nua_internal_error[];
 
 #define NUA_INTERNAL_ERROR 900, nua_internal_error
@@ -214,7 +216,7 @@
   nua_callback_f       nua_callback;
   nua_magic_t         *nua_magic;
 
-  nua_saved_event_t    nua_current[1];
+  nua_event_frame_t   *nua_current;
   nua_saved_event_t    nua_signal[1];
 
   /* Engine state flags */
@@ -307,7 +309,8 @@
   nua_stack_set_params, nua_stack_get_params,
   nua_stack_register, 
   nua_stack_invite, nua_stack_ack, nua_stack_cancel, 
-  nua_stack_bye, nua_stack_info, nua_stack_update, 
+  nua_stack_bye, nua_stack_info, nua_stack_update,
+  nua_stack_prack,
   nua_stack_options, nua_stack_publish, nua_stack_message, 
   nua_stack_subscribe, nua_stack_notify, nua_stack_refer,
   nua_stack_method;
@@ -336,8 +339,7 @@
 					sip_t const *sip,
 					int create_dialog);
 
-int nua_stack_init_handle(nua_t *nua, nua_handle_t *nh, 
-			  tag_type_t tag, tag_value_t value, ...);
+int nua_stack_init_handle(nua_t *nua, nua_handle_t *nh, tagi_t const *tags);
 
 enum nh_kind {
   nh_has_nothing,

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c	Thu Oct 11 10:16:59 2007
@@ -737,7 +737,10 @@
  *    #nua_i_notify
  *
  * @sa #nua_r_refer, NUTAG_SUBSTATE(), NUTAG_REFER_EVENT(),#nua_i_refer,
- * @RFC3515, @ReferTo, @RFC3892, @ReferredBy
+ * @RFC3515, @ReferTo, SIPTAG_REFER_TO(), SIPTAG_REFER_TO_STR(),
+ * @RFC3892, @ReferredBy, SIPTAG_REFERRED_BY(), SIPTAG_REFERRED_BY_STR(),
+ * @RFC3891, @Replaces, SIPTAG_REPLACES(), SIPTAG_REPLACES_STR(),
+ * @RFC4488, @ReferSub, SIPTAG_REFER_SUB(), SIPTAG_REFER_SUB_STR()
  */
 
 /**@NUA_EVENT nua_r_refer
@@ -758,7 +761,7 @@
  *                NUTAG_SUBSTATE()
  *
  * @sa nua_refer(), NUTAG_SUBSTATE(), #nua_i_refer,
- * @RFC3515, @ReferTo, @RFC3892, @ReferredBy
+ * @RFC3515, @RFC4488, @ReferSub
  *
  * @END_NUA_EVENT
  */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c	Thu Oct 11 10:16:59 2007
@@ -42,115 +42,2702 @@
 #include <sofia-sip/sip_tag_class.h>
 #include <sofia-sip/sip_hclasses.h>
 
+/** @page nua_api_overview NUA API Overview
+ *
+ * This page shortly overviews the NUA API: different functions, tags, and
+ * where and how they affect the working of NUA engine.
+ *
+ * The application and the NUA engine can pass various parameters between
+ * them using tagged arguments. Tagged arguments can be used like named
+ * arguments in higher-lever language.
+ *
+ * @par NUA Agent
+ *
+ * The NUA agent object is created with nua_create(). The nua_create() also
+ * creates the transports and binds the transport sockets used by the SIP
+ * stack.
+ *
+ * The special tags controlling the transports are
+ * - NUTAG_URL(), NUTAG_SIPS_URL(),  NUTAG_CERTIFICATE_DIR(), NUTAG_SIP_PARSER()
+ *
+ * See nta_agent_add_tport() for discussion about magic URIs used to
+ * initialize transports.
+ *
+ * The agent-wide parameter can be later modified or obtained with
+ * nua_set_params() and nua_get_params(), respectively.
+ *
+ * The #su_root_t mainloop integration uses
+ * - su_root_create(), su_root_threading(),
+ *   su_root_poll(), su_root_run(), su_root_break()
+ *
+ * @par NUA Handles
+ * - nua_handle(), nua_get_hparams(), nua_set_hparams()
+ * - nua_handle_home(), nua_handle_has_invite(), nua_handle_has_subscribe(),
+ *   nua_handle_has_register(), nua_handle_has_active_call(),
+ *   nua_handle_has_call_on_hold(), nua_handle_has_events(),
+ *   nua_handle_has_registrations(), nua_handle_remote(), and
+ *   nua_handle_local().
+ * - Settings:
+ *   See nua_set_hparams(). There are a few "sticky" headers that are used
+ *   on subsequent requests if given on any handle-specific call:
+ *   - @Contact, @UserAgent, @Supported, @Allow, @Organization
+ *
+ * @par Client Generating SIP Requests
+ * - nua_register(), nua_unregister(), nua_invite(), nua_cancel(),
+ *   nua_ack(), nua_bye(), nua_options(), nua_refer(), nua_publish(),
+ *   nua_unpublish(), nua_prack(), nua_info(), nua_update(), nua_message(),
+ *   nua_subscribe(), nua_unsubscribe(), nua_notify(), nua_method()
+ * - NUTAG_URL()
+ *  Settings:
+ * - NUTAG_RETRY_COUNT(), NUTAG_PROXY(),
+ *   NUTAG_INITIAL_ROUTE() and NUTAG_INITIAL_ROUTE_STR()
+ * - NUTAG_ALLOW(), SIPTAG_ALLOW(), and SIPTAG_ALLOW_STR()
+ * - NUTAG_SUPPORTED(), SIPTAG_SUPPORTED(), and SIPTAG_SUPPORTED_STR()
+ * - NUTAG_USER_AGENT(), SIPTAG_USER_AGENT() and SIPTAG_USER_AGENT_STR()
+ * - SIPTAG_ORGANIZATION() and SIPTAG_ORGANIZATION_STR()
+ *
+ * @par Client Authenticating Requests
+ * - nua_authenticate(), #nua_r_authenticate
+ * - NUTAG_AUTH(), NUTAG_AUTH_CACHE()
+ *
+ * @par Server Processing Received SIP Requests
+ * - nua_respond(), NUTAG_WITH_THIS(), NUTAG_WITH_SAVED(), NUTAG_WITH()
+ * - #nua_i_invite, #nua_i_cancel, #nua_i_ack, #nua_i_bye,
+ *   #nua_i_options, #nua_i_refer, #nua_i_publish, #nua_i_prack,
+ *   #nua_i_info, #nua_i_update, #nua_i_message, #nua_i_subscribe,
+ *   #nua_i_notify, #nua_i_method, #nua_i_register
+ *  Settings:
+ * - NUTAG_APPL_METHOD()
+ * - NUTAG_ALLOW(), SIPTAG_ALLOW(), and SIPTAG_ALLOW_STR()
+ * - NUTAG_SUPPORTED(), SIPTAG_SUPPORTED(), and SIPTAG_SUPPORTED_STR()
+ *
+ * @par Registrations and Contact Header Generation
+ * - nua_register(), #nua_r_register(), #nua_i_outbound,
+ *   nua_unregister(), and #nua_r_unregister
+ * Settings:
+ * - NUTAG_CALLEE_CAPS()
+ * - NUTAG_DETECT_NETWORK_UPDATES()
+ * - NUTAG_INSTANCE()
+ * - NUTAG_KEEPALIVE()
+ * - NUTAG_KEEPALIVE_STREAM()
+ * - NUTAG_M_DISPLAY()
+ * - NUTAG_M_FEATURES()
+ * - NUTAG_M_PARAMS()
+ * - NUTAG_M_USERNAME()
+ * - NUTAG_OUTBOUND()
+ * - NUTAG_PATH_ENABLE()
+ * - NUTAG_SERVICE_ROUTE_ENABLE()
+ * Specifications:
+ * - @RFC3261 section 10, @RFC3327, @RFC3608, @RFC3680, @RFC3840,
+ *   draft-ietf-sip-outbound, draft-ietf-sip-gruu-14
+ *
+ * @par INVITE Sessions and Call Model
+ * - nua_invite(), #nua_r_invite, #nua_i_invite
+ * - nua_handle_has_active_call(), nua_handle_has_call_on_hold(),
+ *   nua_handle_has_invite()
+ * - nua_cancel(), #nua_r_cancel, #nua_i_cancel
+ * - nua_ack(), #nua_i_ack
+ * - nua_bye(), #nua_r_bye, #nua_i_bye
+ * - #nua_i_state, NUTAG_CALLSTATE(),
+ *   NUTAG_OFFER_SENT(), NUTAG_OFFER_RECV(), NUTAG_ANSWER_RECV(), and
+ *   NUTAG_ANSWER_SENT(), SOATAG_REMOTE_SDP(), SOATAG_REMOTE_SDP_STR(),
+ *   SOATAG_LOCAL_SDP(), SOATAG_LOCAL_SDP_STR()
+ *  Settings:
+ * - NUTAG_AUTOACK(), NUTAG_AUTOALERT(), NUTAG_AUTOANSWER(),
+ *   NUTAG_ENABLEINVITE(), NUTAG_INVITE_TIMER(), NUTAG_MEDIA_ENABLE(),
+ *   SOATAG_USER_SDP(), SOATAG_USER_SDP_STR(), SOATAG_CAPS_SDP(),
+ *   SOATAG_CAPS_SDP_STR()
+ * Specifications:
+ * - @RFC3261, @RFC3264
+ *
+ * @par In-Session Information requests
+ * - nua_info() #nua_r_info, #nua_i_info
+ * Settings:
+ * - NUTAG_ALLOW("INFO"), NUTAG_APPL_METHOD("INFO")
+ *
+ * @par SDP Processing
+ * - #nua_i_state, SOATAG_ACTIVE_AUDIO(), SOATAG_ACTIVE_VIDEO(),
+ *   SOATAG_ACTIVE_IMAGE(), SOATAG_ACTIVE_CHAT(),
+ *   SOATAG_REMOTE_SDP(), SOATAG_REMOTE_SDP_STR(),
+ *   SOATAG_LOCAL_SDP(), SOATAG_LOCAL_SDP_STR()
+ * Settings:
+ * - NUTAG_MEDIA_ENABLE(), NUTAG_SOA_NAME(), NUTAG_EARLY_ANSWER(),
+ *   SOATAG_USER_SDP(), SOATAG_USER_SDP_STR(), SOATAG_CAPS_SDP(),
+ *   SOATAG_CAPS_SDP_STR()
+ * Specifications:
+ * - @RFC3264
+ *
+ * @par Call Model Extensions ("100rel" and "precondition")
+ * Early
+ * - nua_prack(), #nua_r_prack, #nua_i_prack
+ * - nua_update() #nua_r_update, #nua_i_update
+ * Settings:
+ * - NUTAG_EARLY_MEDIA(), NUTAG_ONLY183_100REL()
+ * - "100rel" or "precondition" in NUTAG_SUPPORTED()/SIPTAG_SUPPORTED()
+ * Specifications:
+ * - @RFC3262, @RFC3311, @RFC3312
+ *
+ * @par SIP Session Timers ("timer")
+ * Periodic refresh of SIP Session initiated with INVITE with re-INVITE or
+ * UPDATE requests.
+ * Settings:
+ * - NUTAG_MIN_SE(), NUTAG_SESSION_REFRESHER(),
+ *   NUTAG_SESSION_TIMER(), NUTAG_UPDATE_REFRESH()
+ * - "timer" in NUTAG_SUPPORTED()/SIPTAG_SUPPORTED()
+ * Specifications:
+ * - @RFC4028
+ *
+ * @par Caller Preferences and Callee Caps
+ * - Caller preferences in @AcceptContact header in a INVITE requests
+ * - Callee caps contained in @Contact header in a REGISTER request
+ * Settings:
+ * - NUTAG_CALLEE_CAPS(), NUTAG_MEDIA_FEATURES(),
+ *   NUTAG_M_FEATURES()
+ * Specifications:
+ * - @RFC3840, @RFC3841
+ *
+ * @par Instant Messaging
+ * - nua_message(), #nua_r_message, #nua_i_message
+ * Settings:
+ * - NUTAG_APPL_METHOD("MESSAGE"),
+ *   NUTAG_ENABLEMESSAGE(), NUTAG_ENABLEMESSENGER()
+ * Specifications:
+ * - @RFC3428
+ *
+ * @par Call Transfer
+ * - nua_refer(), #nua_r_refer, #nua_i_notify, SIPTAG_EVENT(),
+ *   @ReferTo, SIPTAG_REFER_TO(), @ReferredBy, SIPTAG_REFERRED_BY(),
+ *   nua_handle_make_replaces(), @Replaces, SIPTAG_REPLACES(),
+ *   @ReferSub, SIPTAG_REFER_SUB()
+ * - #nua_i_refer, nua_notify(), #nua_r_notify,
+ *   nua_handle_by_replaces()
+ * - nua_invite() with NUTAG_NOTIFY_REFER() and NUTAG_REFER_EVENT()
+ * Settings:
+ * - NUTAG_REFER_EXPIRES(), NUTAG_REFER_WITH_ID()
+ * Specifications:
+ * - @RFC3515 (@ReferTo), @RFC3892 (@ReferredBy), @RFC3891 (@Replaces),
+ *   @RFC4488, @ReferSub
+ *
+ * @par Internal SIP Event Server
+ * - nua_notifier(), #nua_r_notifier, #nua_i_subscription,
+ *   nua_authorize(), #nua_r_authorize, nua_terminate(), #nua_r_terminate
+ * - SIPTAG_EVENT(), SIPTAG_CONTENT_TYPE(), SIPTAG_PAYLOAD(),
+ *   NUTAG_SUBSTATE()
+ * @par Settings
+ * - NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and
+ *                          SIPTAG_ALLOW_EVENTS_STR()
+ * - NUTAG_MAX_SUBSCRIPTIONS()
+ * - NUTAG_SUBSTATE()
+ * @par Specifications
+ * - @RFC3265
+ *
+ * @par SIP Event Subscriber
+ * - nua_subscribe(), #nua_r_subscribe, #nua_i_notify, NUTAG_SUBSTATE(),
+ *   SIPTAG_EVENT(), SIPTAG_EXPIRES(),
+ * - nua_unsubscribe(), #nua_r_unsubscribe()
+ * @par Specifications
+ * - @RFC3265
+ *
+ * @par SIP Event Notifier
+ * - #nua_i_subscribe(), nua_notify(), #nua_r_notify,
+ *   NUTAG_SUBSTATE(), SIPTAG_EVENT()
+ * Settings:
+ * - NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and
+ *                          SIPTAG_ALLOW_EVENTS_STR()
+ * - NUTAG_ALLOW("SUBSCRIBE"), NUTAG_APPL_METHOD("SUBSCRIBE")
+ * @par Specifications
+ * - @RFC3265
+ *
+ * @par SIP Event Publisher
+ * - nua_publish(), #nua_r_publish(), nua_unpublish(), nua_r_unpublish()
+ * - @SIPETag, SIPTAG_ETAG(), @SIPIfMatch, SIPTAG_IF_MATCH()
+ * @par Specifications
+ * - @RFC3903
+ *
+ * @par SIP Event State Compositor (PUBLISH Server)
+ * - #nua_i_publish, @SIPETag, @SIPIfMatch
+ * @par Settings
+ * - NUTAG_ALLOW("PUBLISH"), NUTAG_APPL_METHOD("PUBLISH")
+ * @par Specifications
+ * - @RFC3903
+ *
+ * @par Non-Standard Extension Methods
+ * - nua_method(), NUTAG_METHOD(), #nua_r_method, NUTAG_DIALOG()
+ * - #nua_i_method, nua_respond()
+ * Settings:
+ * - NUTAG_ALLOW(x), NUTAG_APPL_METHOD(x)
+ *
+ */
+
+/* @par S/MIME
+ * - NUTAG_SMIME_ENABLE()
+ * - NUTAG_SMIME_KEY_ENCRYPTION()
+ * - NUTAG_SMIME_MESSAGE_DIGEST()
+ * - NUTAG_SMIME_MESSAGE_ENCRYPTION()
+ * - NUTAG_SMIME_OPT()
+ * - NUTAG_SMIME_PROTECTION_MODE()
+ * - NUTAG_SMIME_SIGNATURE()
+ */
+
 tag_typedef_t nutag_any = NSTAG_TYPEDEF(*);
 
+/**@def NUTAG_URL()
+ *
+ * URL address from application to NUA
+ *
+ * @par Used with
+ *    any function that create SIP request or nua_handle() \n
+ *    nua_create() \n
+ *    nua_set_params() \n
+ *    nua_get_params() \n
+ *
+ * @par Parameter type
+ *    char const *   or   url_t *  or url_string_t *
+ *
+ * @par Values
+ *    #url_string_t, which is either a pointer to #url_t or NULL terminated
+ *    character string representing URL \n
+ *
+ * For normal nua calls, this tag is used as request target, which is usually
+ * stored as request-URI.
+ *
+ * It is used to set stack's own address with nua_create(), nua_set_params()
+ * and nua_get_params(). It can be specified multiple times when used with
+ * nua_create().
+ *
+ * @sa SIPTAG_TO()
+ *
+ * Corresponding tag taking reference parameter is NUTAG_URL_REF()
+ */
 tag_typedef_t nutag_url = URLTAG_TYPEDEF(url);
-tag_typedef_t nutag_address = STRTAG_TYPEDEF(address);
+
+
+/**@def NUTAG_METHOD(x)
+ *
+ * Extension method name.
+ *
+ * Specify extension method name with nua_method() function.
+ *
+ * @par Used with
+ *    nua_method() \n
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *    Extension method name (e.g., "SERVICE")
+ *
+ * Corresponding tag taking reference parameter is NUTAG_METHOD_REF()
+ *
+ * @sa nua_method(), SIP_METHOD_UNKNOWN()
+ *
+ * @since New in @VERSION_1_12_4.
+ */
 tag_typedef_t nutag_method = STRTAG_TYPEDEF(method);
+
+/**@def NUTAG_METHOD_REF(x) 
+ * Reference tag for NUTAG_METHOD().
+ */
+
+
+/*#@def NUTAG_UICC(x)
+ *
+ * Intentionally undocumented.
+ */
 tag_typedef_t nutag_uicc = STRTAG_TYPEDEF(uicc);
+
+/*#@def NUTAG_UICC_REF(x) 
+ * Reference tag for NUTAG_UICC().
+ */
+
+
+/**@def NUTAG_MEDIA_FEATURES()
+ *
+ * Add media tags from our offer to Accept-Contact headers.
+ *
+ * Automatically generate @AcceptContact headers for caller
+ * preference processing according to the media capabilities in @a soa.
+ *
+ * @par Used with
+ * - nua_create(), nua_set_params(), nua_get_params()
+ * - nua_handle(), nua_set_hparams(), nua_get_hparams()
+ * - nua_invite()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   Do not add @AcceptContact \n
+ *    @c !=0 Add @AcceptContact with media tags
+ *
+ * Corresponding tag taking reference parameter is NUTAG_MEDIA_FEATURES_REF()
+ *
+ * @sa nua_invite(), @AcceptContact, @RFC3841, @RFC3840, SOATAG_USER_SDP(),
+ * SIPTAG_ACCEPT_CONTACT(), NUTAG_CALLEE_CAPS()
+ */
 tag_typedef_t nutag_media_features = BOOLTAG_TYPEDEF(media_features);
+
+/**@def NUTAG_MEDIA_FEATURES_REF(x) 
+ * Reference tag for NUTAG_MEDIA_FEATURES().
+ */
+
+
+/**@def NUTAG_CALLEE_CAPS(x) 
+ * 
+ * Add methods parameter and media feature parameter to the @Contact headers
+ * generated for REGISTER request.
+ *
+ * @par Used with
+ * - nua_create(), nua_set_params(), nua_get_params()
+ * - nua_handle(), nua_set_hparams(), nua_get_hparams()
+ * - nua_register()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   Do not include methods and media feature paramete \n
+ *    @c !=0 Include media tags in 
+ *
+ * Corresponding tag taking reference parameter is NUTAG_MEDIA_FEATURES_REF().
+ *
+ * @sa nua_register(), @Contact, NUTAG_M_FEATURES(), @RFC3840, @RFC3841,
+ * SOATAG_USER_SDP(), NUTAG_MEDIA_FEATURES()
+ */
 tag_typedef_t nutag_callee_caps = BOOLTAG_TYPEDEF(callee_caps);
+
+/**@def NUTAG_CALLEE_CAPS_REF(x) 
+ * Reference tag for NUTAG_CALLEE_CAPS().
+ */
+
+
+/**@def NUTAG_EARLY_MEDIA(x)
+ *
+ * Establish early media session using 100rel, 183 responses and PRACK.
+ *
+ * @par Used with
+ * - nua_create(), nua_set_params(), nua_get_params()
+ * - nua_handle(), nua_set_hparams(), nua_get_hparams()
+ * - nua_invite(), nua_respond()
+ *
+ * @par Parameter type
+ *    int (boolean)
+ *
+ * @par Values
+ *    @c 0   False - do not try to use early media \n
+ *    @c !=0 True - try to use early media
+ *
+ * @sa NUTAG_EARLY_ANSWER()
+ *
+ * Corresponding tag taking reference parameter is NUTAG_EARLY_MEDIA_REF().
+ */
 tag_typedef_t nutag_early_media = BOOLTAG_TYPEDEF(early_media);
+
+/**@def NUTAG_EARLY_MEDIA_REF(x) 
+ * Reference tag for NUTAG_EARLY_MEDIA().
+ */
+
+
+/**@def NUTAG_ONLY183_100REL(x)
+ *
+ * Require 100rel extension and PRACK only with 183 response.
+ *
+ * If this parameter is set, stack includes feature tag "100rel" in the
+ * @Require header only with 183: otherwise, all 1XX responses (except
+ * <i>100 Trying</i>) require 100rel.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params() \n
+ *    nua_handle() \n
+ *    nua_set_hparams() \n
+ *    nua_get_hparams() \n
+ *    nua_invite() \n
+ *    nua_respond()
+ *
+ * @par Parameter type
+ *    int (boolean)
+ *
+ * @par Values
+ *    @c 0   False \n
+ *    @c !=0 True
+ *
+ * Corresponding tag taking reference parameter is NUTAG_ONLY183_100REL_REF().
+ */
 tag_typedef_t nutag_only183_100rel = BOOLTAG_TYPEDEF(only183_100rel);
+
+/**@def NUTAG_ONLY183_100REL_REF(x) 
+ * Reference tag for NUTAG_ONLY183_100REL().
+ */
+
+
+/**@def NUTAG_EARLY_ANSWER(x)
+ *
+ * Establish early media session by including SDP answer in 1XX response.
+ *
+ * @par Used with
+ *    nua_respond(), nua_set_params(), nua_set_hparams()
+ *
+ * @par Parameter type
+ *    int (boolean)
+ *
+ * @par Values
+ *    @c 0   False \n
+ *    @c !=0 True
+ *
+ * Corresponding tag taking reference parameter is NUTAG_EARLY_ANSWER_REF().
+ *
+ * @note Requires that @soa is enabled with NUTAG_MEDIA_ENABLE(1).
+ *
+ * @sa NUTAG_EARLY_MEDIA(), NUTAG_AUTOALERT(), NUTAG_MEDIA_ENABLE()
+ * 
+ * @since New in @VERSION_1_12_2.
+ */
 tag_typedef_t nutag_early_answer = BOOLTAG_TYPEDEF(early_answer);
+
+/**@def NUTAG_EARLY_ANSWER_REF(x) 
+ * Reference tag for NUTAG_EARLY_ANSWER().
+ */
+
+
+/**@def NUTAG_INCLUDE_EXTRA_SDP(x)
+ *
+ * Include an extra copy of SDP answer in the response.
+ *
+ * When NUTAG_INCLUDE_EXTRA_SDP(1) is included in nua_respond() tags, stack
+ * will include in the response a copy of the SDP offer/answer that was last
+ * sent to the client. This tag should be used only when you know that the
+ * remote end requires the extra SDP, for example, some versions of Cisco
+ * SIPGateway need a copy of answer in 200 OK even when they indicate
+ * support for 100rel.
+ *
+ * @par Used with
+ *    nua_respond()
+ *
+ * @par Parameter type
+ *    int (boolean)
+ *
+ * @par Values
+ *    @c 0   False \n
+ *    @c !=0 True
+ *
+ * Corresponding tag taking reference parameter is
+ * NUTAG_INCLUDE_EXTRA_SDP_REF().
+ *
+ * @note Requires that @soa is enabled with NUTAG_MEDIA_ENABLE(1).
+ *
+ * @sa NUTAG_EARLY_ANSWER(), NUTAG_EARLY_MEDIA(), NUTAG_AUTOALERT(),
+ * NUTAG_MEDIA_ENABLE(), @RFC3264, @RFC3264
+ * 
+ * @since New in @VERSION_1_12_4.
+ */
 tag_typedef_t nutag_include_extra_sdp = BOOLTAG_TYPEDEF(include_extra_sdp);
+
+/**@def NUTAG_INCLUDE_EXTRA_SDP_REF(x) 
+ * Reference tag for NUTAG_INCLUDE_EXTRA_SDP().
+ */
+
+
+/**@def NUTAG_MEDIA_ENABLE()
+ *
+ * Enable built-in media session handling
+ *
+ * The built-in media session object @soa takes care of most details
+ * of offer-answer negotiation. 
+ *
+ * @par Used with
+ *    nua_create()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   False \n
+ *    @c !=0 True
+ *
+ * Corresponding tag taking reference parameter is NUTAG_MEDIA_ENABLE_REF()
+ */
 tag_typedef_t nutag_media_enable = BOOLTAG_TYPEDEF(media_enable);
 
-tag_typedef_t nutag_soa_session = PTRTAG_TYPEDEF(soa_session);
+/**@def NUTAG_MEDIA_ENABLE_REF(x) 
+ * Reference tag for NUTAG_MEDIA_ENABLE().
+ */
+
+
+
+/**@def NUTAG_SOA_NAME(x)
+ *
+ * Name for SDP Offer-Answer session object.
+ *
+ * SDP Offer-Answer session object name.
+ *
+ * @par Used with nua_create(), nua_handle().
+ *
+ * @par Parameter type
+ *    void * (actually soa_session_t *)
+ *
+ * @par Values
+ *    Pointer to MSS media session.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SOA_NAME_REF().
+ */
 tag_typedef_t nutag_soa_name = STRTAG_TYPEDEF(soa_name);
 
+/**@def NUTAG_SOA_NAME_REF(x) 
+ * Reference tag for NUTAG_SOA_NAME().
+ */
+
+
+/**@def NUTAG_RETRY_COUNT(x)
+ * 
+ * Set request retry count.
+ *
+ * Retry count determines how many times stack will automatically retry
+ * after an recoverable error response, like 302, 401 or 407.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(), nua_handle(), nua_set_hparams(),
+ *    nua_get_params(), nua_get_hparams(),
+ *    nua_register(), nua_unregister(),
+ *    nua_options(), nua_invite(), nua_ack(), nua_cancel(), nua_bye(),
+ *    nua_prack(), nua_update(), nua_info(),
+ *    nua_message(), nua_publish(), nua_unpublish(), nua_notifier(),
+ *    nua_subscribe(), nua_unsubscribe(), nua_notify(), nua_refer(), 
+ *    nua_method(), nua_respond()
+ *    nua_authenticate().
+ *
+ * @par Parameter type
+ *    unsigned
+ *
+ * @par Values
+ *    @c 0   Never retry automatically \n
+ *
+ * @NEW_1_12_4.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_RETRY_COUNT_REF().
+ */
 tag_typedef_t nutag_retry_count = UINTTAG_TYPEDEF(retry_count);
+
+/**@def NUTAG_RETRY_COUNT_REF(x) 
+ *
+ * Reference tag for NUTAG_RETRY_COUNT().
+ */
+
+
+/**@def NUTAG_MAX_SUBSCRIPTIONS(x)
+ *
+ * Set maximum number of simultaneous subscribers per single event server.
+ *
+ * Determines how many subscribers can simultaneously subscribe to a single
+ * event.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *
+ * @par Parameter type
+ *    unsigned
+ *
+ * @par Values
+ *    @c 0   Do not allow any subscriptions \n
+ *
+ * @sa nua_notifier(), nua_authorize()
+ *
+ * Corresponding tag taking reference parameter is 
+ * NUTAG_MAX_SUBSCRIPTIONS_REF().
+ */
 tag_typedef_t nutag_max_subscriptions = UINTTAG_TYPEDEF(max_subscriptions);
 
+/**@def NUTAG_MAX_SUBSCRIPTIONS_REF(x) 
+ * Reference tag for NUTAG_MAX_SUBSCRIPTIONS().
+ */
+
+
+/**@def NUTAG_CALLSTATE()
+ *
+ * Call state
+ *
+ * @par Used with
+ *    #nua_i_state
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ * - #nua_callstate_init - Initial state
+ * - #nua_callstate_authenticating - 401/407 received
+ * - #nua_callstate_calling - INVITE sent
+ * - #nua_callstate_proceeding - 18X received
+ * - #nua_callstate_completing   - 2XX received
+ * - #nua_callstate_received - INVITE received (and 100 Trying sent)
+ * - #nua_callstate_early       - 18X sent
+ * - #nua_callstate_completed   - 2XX sent
+ * - #nua_callstate_ready       - 2XX and ACK received/sent
+ * - #nua_callstate_terminating - BYE sent
+ * - #nua_callstate_terminated  - BYE complete
+ *
+ * Corresponding tag taking reference parameter is NUTAG_CALLSTATE_REF().
+ */
 tag_typedef_t nutag_callstate = INTTAG_TYPEDEF(callstate);
+
+/**@def NUTAG_CALLSTATE_REF(x) 
+ * Reference tag for NUTAG_CALLSTATE().
+ */
+
+
+/**@def NUTAG_OFFER_RECV()
+ *
+ * Indicate that SDP offer has been received.
+ *
+ * @par Used with
+ *    #nua_i_state
+ *
+ * @par Parameter type
+ *    boolean
+ *
+ * Corresponding tag taking reference parameter is NUTAG_OFFER_RECV_REF().
+ */
 tag_typedef_t nutag_offer_recv = BOOLTAG_TYPEDEF(offer_recv);
+
+/**@def NUTAG_OFFER_RECV_REF(x) 
+ * Reference tag for NUTAG_OFFER_RECV().
+ */
+
+
+/**@def NUTAG_ANSWER_RECV()
+ *
+ * Indicate that SDP answer has been received.
+ *
+ * @par Used with
+ *    #nua_i_state
+ *
+ * @par Parameter type
+ *    boolean
+ *
+ * Corresponding tag taking reference parameter is NUTAG_ANSWER_RECV_REF().
+ */
 tag_typedef_t nutag_answer_recv = BOOLTAG_TYPEDEF(answer_recv);
+
+/**@def NUTAG_ANSWER_RECV_REF(x) 
+ * Reference tag for NUTAG_ANSWER_RECV().
+ */
+
+
+/**@def NUTAG_OFFER_SENT()
+ *
+ * Indicate that SDP offer has been sent.
+ *
+ * @par Used with
+ *    #nua_i_state
+ *
+ * @par Parameter type
+ *    boolean
+ *
+ * Corresponding tag taking reference parameter is NUTAG_OFFER_SENT_REF().
+ */
 tag_typedef_t nutag_offer_sent = BOOLTAG_TYPEDEF(offer_sent);
+
+/**@def NUTAG_OFFER_SENT_REF(x) 
+ * Reference tag for NUTAG_OFFER_SENT().
+ */
+
+
+/**@def NUTAG_ANSWER_SENT()
+ *
+ * Indicate that SDP answer has been sent.
+ *
+ * @par Used with
+ *    #nua_i_state
+ *
+ * @par Parameter type
+ *    int (boolean: nonzero is true, zero is false)
+ *
+ * Corresponding tag taking reference parameter is NUTAG_ANSWER_SENT_REF().
+ */
 tag_typedef_t nutag_answer_sent = BOOLTAG_TYPEDEF(answer_sent);
+
+/**@def NUTAG_ANSWER_SENT_REF(x) 
+ * Reference tag for NUTAG_ANSWER_SENT().
+ */
+
+
+/**@def NUTAG_SUBSTATE()
+ *
+ * Subscription state.
+ *
+ * @par Used with
+ * - with nua_create(), nua_set_params(), nua_get_params(),
+ *    nua_handle(), nua_set_hparams(), nua_get_hparams(), and
+ *    nua_notifier() to change the default subscription state returned by
+ *    the intenal event server
+ * - with nua_notify() and nua_respond() to SUBSCRIBE to determine the
+ *    subscription state (if application include @SubscriptionState
+ *    header in the tag list, the NUTAG_SUBSTATE() value is ignored)
+ * - with #nua_r_subscribe, #nua_i_notify, #nua_i_subscribe, and #nua_r_notify
+ *    to indicate the current subscription state
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *   - #nua_substate_embryonic (0)
+ *   - #nua_substate_pending (1)
+ *   - #nua_substate_active (2)
+ *   - #nua_substate_terminated (3)
+ *
+ * Note that the @SubscriptionState or @Expires headers specified by
+ * application with the nua_notify() or nua_respond() to SUBSCRIBE overrides
+ * the subscription state specified by NUTAG_SUBSTATE(). 
+ * Application can terminate subscription by including
+ * NUTAG_SUBSTATE(nua_substate_terminated), @SubscriptionState with value
+ * "terminated" or @Expires header with value 0 in the NOTIFY request sent
+ * by nua_notify().
+ *
+ * @sa @RFC3265, @SubscriptionState, SIPTAG_SUBSCRIPTION_STATE(),
+ * SIPTAG_SUBSCRIPTION_STATE_STR(), nua_notifier(), #nua_r_subscribe,
+ * #nua_i_subscribe, #nua_i_refer, #nua_r_notify, #nua_i_notify.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SUBSTATE_REF().
+ */
 tag_typedef_t nutag_substate = INTTAG_TYPEDEF(substate);
+
+/**@def NUTAG_SUBSTATE_REF(x) 
+ * Reference tag for NUTAG_SUBSTATE().
+ */
+
+
+/**@def NUTAG_NEWSUB()
+ *
+ * Send unsolicited NOTIFY request.
+ *
+ * Some applications may require sending unsolicited NOTIFY requests, that
+ * is, NOTIFY without SUBSCRIBE or REFER request sent by event watcher. 
+ * However, sending NOTIFY request requires an existing dialog usage by
+ * default. If the nua_notify() tags include NUTAG_NEWSUB(1), the usage
+ * is created by nua_notify() itself.
+ *
+ * If you want to create a subscription that does not terminate immediately
+ * include SIPTAG_SUBSCRIPTION_STATE()/SIPTAG_SUBSCRIPTION_STATE_STR() with
+ * an "expires" parameter in the argument list, too.
+ *
+ * @par Used with
+ *    nua_notify()
+ *
+ * @par Parameter type
+ *    int (boolean)
+ *
+ * @par Values
+ *   - 0 - false (default) - do not create new subscription 
+ *         but reject NOTIFY with 481 locally \n
+ *   - 1 - true - create a subscription if it does not exist \n
+ *
+ * Corresponding tag taking reference parameter is NUTAG_NEWSUB_REF().
+ *
+ * @since @NEW_1_12_5.
+ */
 tag_typedef_t nutag_newsub = BOOLTAG_TYPEDEF(newsub);
+
+/**@def NUTAG_NEWSUB_REF(x) 
+ * Reference tag for NUTAG_NEWSUB().
+ */
+
+
+/**@def NUTAG_INVITE_TIMER(x)
+ *
+ * Timer for outstanding INVITE in seconds.
+ *
+ * INVITE will be canceled if no answer is received before timer expires.
+ *
+ * @par Used with
+ *    nua_invite() \n
+ *    nua_set_params(), nua_set_hparams(),
+ *    nua_get_params(), nua_get_hparams()
+ *
+ * @par Parameter type
+ *    int (enum nua_af)
+ *
+ * @par Values
+ *    @c 0  no timer \n
+ *    @c >0 timer in seconds
+ *
+ * Corresponding tag taking reference parameter is NUTAG_INVITE_TIMER_REF().
+ */
 tag_typedef_t nutag_invite_timer = UINTTAG_TYPEDEF(invite_timer);
+
+/**@def NUTAG_INVITE_TIMER_REF(x) 
+ * Reference tag for NUTAG_INVITE_TIMER().
+ */
+
+
+/**@def NUTAG_SESSION_TIMER(x)
+ *
+ * Default session timer in seconds.
+ *
+ * Set default value for session timer in seconds when the session timer
+ * extension is used. The tag value is the proposed session expiration time
+ * in seconds, the session is refreshed twice during the expiration time.
+ *
+ * @par Sending INVITE and UPDATE Requests 
+ *
+ * If NUTAG_SESSION_TIMER() is used with non-zero value, the value is used
+ * in the @SessionExpires header included in the INVITE or UPDATE requests. 
+ * The intermediate proxies or the ultimate destination can lower the
+ * interval in @SessionExpires header. If the value is too low, they can
+ * reject the request with the status code <i>422 Session Timer Too
+ * Small</i>. In that case, @b nua increases the value of @SessionExpires
+ * header and retries the request automatically.
+ *
+ * @par Returning a Response to the INVITE and UPDATE Requests 
+ *
+ * The NUTAG_SESSION_TIMER() value is also used when sending the final
+ * response to the INVITE or UPDATE requests. If the NUTAG_SESSION_TIMER()
+ * value is 0 or the value in the @SessionExpires header of the request is
+ * lower than the value in NUTAG_SESSION_TIMER(), the value from the
+ * incoming @SessionExpires header is used. However, if the value in
+ * @SessionExpires is lower than the minimal acceptable session expiration
+ * interval specified with the tag NUTAG_MIN_SE() the request is
+ * automatically rejected with <i>422 Session Timer Too Small</i>.
+ *
+ * @par Refreshes
+ *
+ * After the initial INVITE request, the SIP session is refreshed at the
+ * intervals indicated by the @SessionExpires header returned in the 2XX
+ * response. The party indicated with the "refresher" parameter of the
+ * @SessionExpires header sends a re-INVITE requests (or an UPDATE
+ * request if NUTAG_UPDATE_REFRESH(1) parameter tag has been set).
+ * 
+ * @par When to Use NUTAG_SESSION_TIMER()?
+ *
+ * The session time extension is enabled ("timer" feature tag is included in
+ * @Supported header) but not activated by default (no @SessionExpires
+ * header is included in the requests or responses by default). Using
+ * non-zero value with NUTAG_SESSION_TIMER() or NUTAG_SESSION_REFRESHER()
+ * activates it. When the extension is activated, @nua refreshes the call
+ * state by sending periodic re-INVITE or UPDATE requests unless the remote
+ * end indicated that it will take care of refreshes.
+ *
+ * The session timer extension is mainly useful for proxies or back-to-back
+ * user agents that keep call state. The call state is "soft" meaning that
+ * if no call-related SIP messages are processed for certain time the state
+ * will be destroyed. An ordinary user-agent can also make use of session
+ * timer if it cannot get any activity feedback from RTP or other media.
+ *
+ * @note The session timer extension is used only if the feature
+ * tag "timer" is listed in the @Supported header, set by NUTAG_SUPPORTED(),
+ * SIPTAG_SUPPORTED(), or SIPTAG_SUPPORTED_STR() tags.
+ *
+ * @par Used with
+ *    nua_invite(), nua_update(), nua_respond() \n
+ *    nua_set_params() or nua_set_hparams() \n
+ *    nua_get_params() or nua_get_hparams()
+ *
+ * See nua_set_hparams() for a complete list of the the nua operations that
+ * accept this tag.
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    @c 0  disable \n
+ *    @c >0 interval in seconds
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SESSION_TIMER_REF().
+ *
+ * @sa NUTAG_SUPPORTED(), NUTAG_MIN_SE(), NUTAG_SESSION_REFRESHER(),
+ * nua_invite(), #nua_r_invite, #nua_i_invite, nua_respond(), 
+ * nua_update(), #nua_r_update, #nua_i_update, 
+ * NUTAG_UPDATE_REFRESH(), @RFC4028, @SessionExpires, @MinSE
+ */
 tag_typedef_t nutag_session_timer = UINTTAG_TYPEDEF(session_timer);
+
+/**@def NUTAG_SESSION_TIMER_REF(x) 
+ * Reference tag for NUTAG_SESSION_TIMER().
+ */
+
+
+/**@def NUTAG_MIN_SE(x)
+ *
+ * Minimum acceptable refresh interval for session.
+ *
+ * Specifies the value of @MinSE header in seconds. The @b Min-SE header is
+ * used to specify minimum acceptable refresh interval for session timer
+ * extension.
+ *
+ * @par Used with
+ *    nua_handle(), nua_invite(), nua_update(), nua_respond() \n
+ *    nua_set_params() or nua_set_hparams() \n
+ *    nua_get_params() or nua_get_hparams()
+ *
+ * See nua_set_hparams() for a complete list of the nua operations that
+ * accept this tag.
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    interval in seconds.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_MIN_SE_REF().
+ *
+ * @sa NUTAG_SESSION_TIMER(), NUTAG_SESSION_REFRESHER(),
+ * NUTAG_UPDATE_REFRESH(), @RFC4028, @MinSE, @SessionExpires
+ */
 tag_typedef_t nutag_min_se = UINTTAG_TYPEDEF(min_se);
+
+/**@def NUTAG_MIN_SE_REF(x) 
+ * Reference tag for NUTAG_MIN_SE().
+ */
+
+
+/**@def NUTAG_SESSION_REFRESHER(x)
+ *
+ * Specify the preferred refresher.
+ *
+ * Specify for session timer extension which party is the preferred refresher.
+ *
+ * @par Used with
+ *    nua_handle(), nua_invite(), nua_update(), nua_respond() \n
+ *    nua_set_params() or nua_set_hparams() \n
+ *    nua_get_params() or nua_get_hparams()
+ *
+ * See nua_set_hparams() for a complete list of all the nua operations that
+ * accept this tag.
+ *
+ * @par Parameter type
+ *   enum { #nua_no_refresher,  #nua_local_refresher, #nua_remote_refresher,
+ *          #nua_any_refresher }
+ *
+ * @par Values
+ *    @c nua_no_refresher (session timers are disabled) \n
+ *    @c nua_local_refresher \n
+ *    @c nua_remote_refresher \n
+ *    @c nua_any_refresher (default) \n
+ *
+ * Corresponding tag taking reference parameter is
+ * NUTAG_SESSION_REFRESHER_REF().
+ *
+ * @sa NUTAG_SESSION_TIMER(), NUTAG_MIN_SE_REF(),
+ * NUTAG_UPDATE_REFRESH(), @RFC4028, @SessionExpires, @MinSE
+ */
 tag_typedef_t nutag_session_refresher = INTTAG_TYPEDEF(session_refresher);
+
+/**@def NUTAG_SESSION_REFRESHER_REF(x) 
+ * Reference tag for NUTAG_SESSION_REFRESHER().
+ */
+
+
+
+
+/**@def NUTAG_UPDATE_REFRESH(x)
+ *
+ * Use UPDATE as refresh method.
+ *
+ * If this parameter is true and the remote endpoint has included UPDATE in
+ * Allow header, the nua stack uses UPDATE instead of INVITE to refresh the 
+ * session when using the session timer extension.
+ *
+ * Note that the session timer headers @SessionExpires and @MinSE are always
+ * included in the UPDATE request and responses regardless of the value of
+ * this tag.
+ *
+ * @par Used with
+ *    nua_handle(), nua_invite(), nua_update(), nua_respond() \n
+ *    nua_set_params() or nua_set_hparams() \n
+ *    nua_get_params() or nua_get_hparams()
+ *
+ * See nua_set_hparams() for a complete list of all the nua operations that
+ * accept this tag.
+ *
+ * @par Parameter type
+ *    boolean
+ *
+ * @par Values
+ *    @c 1 Use UPDATE \n
+ *    @c 0 Use INVITE
+ *
+ * Corresponding tag taking reference parameter is NUTAG_UPDATE_REFRESH_REF().
+ *
+ * @sa #nua_r_update, NUTAG_SESSION_TIMER(), NUTAG_MIN_SE_REF(),
+ * NUTAG_UPDATE_REFRESH(), @RFC4028, @SessionExpires, @MinSE
+ */
 tag_typedef_t nutag_update_refresh = BOOLTAG_TYPEDEF(update_refresh);
+
+/**@def NUTAG_UPDATE_REFRESH_REF(x) 
+ * Reference tag for NUTAG_UPDATE_REFRESH().
+ */
+
+
+/**@def NUTAG_REFER_EXPIRES()
+ *
+ * Default lifetime for implicit subscriptions created by REFER.
+ *
+ * Default expiration time in seconds for implicit subscriptions created by
+ * REFER.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params() \n
+ *    nua_set_hparams() \n
+ *    nua_get_hparams() \n
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    @c 0  disable \n
+ *    @c >0 interval in seconds
+ *
+ * Corresponding tag taking reference parameter is NUTAG_REFER_EXPIRES_REF().
+ */
 tag_typedef_t nutag_refer_expires = UINTTAG_TYPEDEF(refer_expires);
+
+/**@def NUTAG_REFER_EXPIRES_REF(x) 
+ * Reference tag for NUTAG_REFER_EXPIRES().
+ */
+
+
+/**@def NUTAG_REFER_WITH_ID()
+ *
+ * Always use id parameter with refer event.
+ *
+ * When an incoming REFER creates an implicit subscription, the event header
+ * in the NOTIFY request may have an id parameter. The id parameter can be
+ * either always included (default behavior), or the parameter can be used
+ * only for the second and subsequent REFER requests received in a given
+ * dialog.
+ *
+ * Note that once the subscription is created, the event header should not
+ * be modified. Therefore this tag has no effect on already established
+ * subscriptions, and its use makes sense largely on nua_set_params() only.
+ *
+ * @par Used with
+ *    nua_set_params() (nua_set_hparams(), nua_invite(), nua_respond(),
+ *    nua_update()).
+ *
+ * @par Parameter type
+ *    int (boolean)
+ *
+ * @par Values
+ *   0 (false, do not use id with subscription created with first REFER request) \n
+ *   1 (true, use id with all subscriptions created with REFER request) \n
+ *
+ * Corresponding tag taking reference parameter is NUTAG_REFER_WITH_ID_REF().
+ *
+ * @since New in @VERSION_1_12_2.
+ */
 tag_typedef_t nutag_refer_with_id = BOOLTAG_TYPEDEF(refer_with_id);
+
+/**@def NUTAG_REFER_WITH_ID_REF(x) 
+ * Reference tag for NUTAG_REFER_WITH_ID().
+ */
+
+/**@def NUTAG_AUTOALERT(x)
+ *
+ * Send alerting (180 Ringing) automatically
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   No automatic sending of "180 Ringing" \n
+ *    @c !=0 "180 Ringing" sent automatically
+ *
+ * Corresponding tag taking reference parameter is NUTAG_AUTOALERT_REF().
+ */
 tag_typedef_t nutag_autoalert = BOOLTAG_TYPEDEF(autoAlert);
+
+/**@def NUTAG_AUTOALERT_REF(x) 
+ * Reference tag for NUTAG_AUTOALERT().
+ */
+
+
+/**@def NUTAG_AUTOANSWER(x)
+ *
+ * Answer (with 200 Ok) automatically to incoming call.
+ *
+ * @par Used with
+ *    nua_set_params(), nua_set_hparams() \n
+ *    nua_get_params(), nua_get_hparams() \n
+ *    nua_invite() \n
+ *    nua_respond()
+ *
+ * @par Parameter type
+ *    int (boolean)
+ *
+ * @par Values
+ *    @c 0    No automatic sending of "200 Ok" \n
+ *    @c !=0 "200 Ok" sent automatically
+ *
+ * Corresponding tag taking reference parameter is NUTAG_AUTOANSWER_REF().
+ *
+ * @note Requires that @soa is enabled with NUTAG_MEDIA_ENABLE(1).
+ * 
+ * @par Auto-Answer to Re-INVITE requests
+ * By default, NUA tries to auto answer the re-INVITEs used to refresh the
+ * session when the media is enabled. Set NUTAG_AUTOANSWER(0) on the call
+ * handle (e.g., include the tag with nua_invite(), nua_respond()) in order
+ * to disable the auto answer on re-INVITEs.
+ *
+ * @bug If the re-INVITE modifies the session (e.g., SDP contains offer that
+ * adds video stream to the session), NUA auto-answers it if
+ * NUTAG_AUTOANSWER(0) has not been set on the handle. It accepts or rejects
+ * media based on the existing user SDP (set with SOATAG_USER_SDP(), for
+ * example). It should auto-answer only session refresh request and let
+ * application decide how to handle requests to modify the session.
+ *
+ * @sa NUTAG_MEDIA_ENABLE(), NUTAG_AUTOALERT(), NUTAG_AUTOACK().
+ */
 tag_typedef_t nutag_autoanswer = BOOLTAG_TYPEDEF(autoAnswer);
+
+/**@def NUTAG_AUTOANSWER_REF(x) 
+ * Reference tag for NUTAG_AUTOANSWER().
+ */
+
+
+/**@def NUTAG_AUTOACK(x)
+ *
+ * ACK automatically
+ *
+ * If this parameter is true, ACK is sent automatically after receiving 2XX
+ * series response to INVITE. Note that ACK is always sent automatically by
+ * lower layers of the stack after receiving an error response 3XX, 4XX, 5XX
+ * or 6XX.
+ *
+ * @par Used with
+ *    nua_set_params(), nua_set_hparams(), \n
+ *    nua_get_params(), nua_get_hparams(), \n
+ *    nua_invite(), nua_ack(), nua_respond(), nua_update() \n
+ *    nua_respond()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0    No automatic sending of ACK \n
+ *    @c !=0 ACK sent automatically
+ *
+ * Default value is NUTAG_AUTOACK(1).
+ * 
+ * Corresponding tag taking reference parameter is NUTAG_AUTOACK_REF().
+ */
 tag_typedef_t nutag_autoack = BOOLTAG_TYPEDEF(autoACK);
+
+/**@def NUTAG_AUTOACK_REF(x) 
+ * Reference tag for NUTAG_AUTOACK().
+ */
+
+
+/**@def NUTAG_ENABLEINVITE(x)
+ *
+ * Enable incoming INVITE
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   Incoming INVITE not enabled. NUA answers 403 Forbidden \n
+ *    @c !=0 Incoming INVITE enabled
+ *
+ * Corresponding tag taking reference parameter is NUTAG_ENABLEINVITE_REF().
+ */
 tag_typedef_t nutag_enableinvite = BOOLTAG_TYPEDEF(enableInvite);
+
+/**@def NUTAG_ENABLEINVITE_REF(x) 
+ * Reference tag for NUTAG_ENABLEINVITE().
+ */
+
+
+
+/**@def NUTAG_ENABLEMESSAGE(x)
+ *
+ * Enable incoming MESSAGE
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   Incoming MESSAGE not enabled. NUA answers 403 Forbidden \n
+ *    @c !=0 Incoming MESSAGE enabled
+ *
+ * Corresponding tag taking reference parameter is NUTAG_ENABLEMESSAGE_REF().
+ */
 tag_typedef_t nutag_enablemessage = BOOLTAG_TYPEDEF(enableMessage);
+
+/**@def NUTAG_ENABLEMESSAGE_REF(x) 
+ * Reference tag for NUTAG_ENABLEMESSAGE().
+ */
+
+
+
+/**@def NUTAG_ENABLEMESSENGER(x)
+ *
+ * Enable incoming MESSAGE with To tag.
+ *
+ * Set this parameter if you want to chat with Windows Messenger.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   False \n
+ *    @c !=0 True
+ *
+ * Corresponding tag taking reference parameter is NUTAG_ENABLEMESSENGER_REF().
+ */
 tag_typedef_t nutag_enablemessenger = BOOLTAG_TYPEDEF(enableMessenger);
 
+/**@def NUTAG_ENABLEMESSENGER_REF(x) 
+ * Reference tag for NUTAG_ENABLEMESSENGER().
+ */
+
 
-/* Start NRC Boston */
+/**@def NUTAG_SMIME_ENABLE(x)
+ *
+ * Enable S/MIME
+ *
+ * @par Used with
+ *    nua_create() \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *
+ * @par Parameter type
+ *    boolean
+ *
+ * @par Values
+ *    @c 0   S/MIME is Disabled \n
+ *    @c !=0 S/MIME is Enabled
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SMIME_ENABLE_REF().
+ */
 tag_typedef_t nutag_smime_enable = BOOLTAG_TYPEDEF(smime_enable);
+
+/**@def NUTAG_SMIME_ENABLE_REF(x) 
+ * Reference tag for NUTAG_SMIME_ENABLE().
+ */
+
+
+/**@def NUTAG_SMIME_OPT(x)
+ *
+ * S/MIME Options
+ *
+ * This tag specifies the type of S/MIME security services requested
+ * by the user.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params() \n
+ *    nua_message()
+ *
+ * @par Parameter type
+ *   int
+ *
+ * @par Values
+ *   @c -1 (SM_ID_NULL) No security service needed \n
+ *   @c  0 (SM_ID_CLEAR_SIGN) Clear signing \n
+ *   @c  1 (SM_ID_SIGN) S/MIME signing \n
+ *   @c  2 (SM_ID_ENCRYPT) S/MIME encryption
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SMIME_OPT_REF().
+ */
 tag_typedef_t nutag_smime_opt = INTTAG_TYPEDEF(smime_opt);
+
+/**@def NUTAG_SMIME_OPT_REF(x) 
+ * Reference tag for NUTAG_SMIME_OPT().
+ */
+
+
+/**@def NUTAG_SMIME_PROTECTION_MODE(x)
+ *
+ * S/MIME protection mode
+ *
+ * This tag specifies the protection mode of the SIP message by
+ * S/MIME as requested by the user
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *
+ * @par Parameter type
+ *   unsigned int
+ *
+ * @par Values
+ *   @c -1 (SM_MODE_NULL) Unspecified \n
+ *   @c  0 (SM_MODE_PAYLOAD_ONLY) SIP payload only \n
+ *   @c  1 (SM_MODE_TUNNEL) SIP tunneling mode \n
+ *   @c  2 (SM_MODE_SIPFRAG) SIPfrag protection
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SMIME_PROTECTION_MODE_REF().
+ */
 tag_typedef_t nutag_smime_protection_mode = 
   INTTAG_TYPEDEF(smime_protection_mode);
+
+/**@def NUTAG_SMIME_PROTECTION_MODE_REF(x) 
+ * Reference tag for NUTAG_SMIME_PROTECTION_MODE().
+ */
+
+
+/**@def NUTAG_SMIME_MESSAGE_DIGEST(x)
+ *
+ * S/MIME digest algorithm
+ *
+ * This tag specifies the message digest algorithm to be used in S/MIME.
+ *
+ * @par Used with
+ *    To be implemented
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SMIME_MESSAGE_DIGEST_REF().
+ */
 tag_typedef_t nutag_smime_message_digest = 
   STRTAG_TYPEDEF(smime_message_digest);
+
+/**@def NUTAG_SMIME_MESSAGE_DIGEST_REF(x) 
+ * Reference tag for NUTAG_SMIME_MESSAGE_DIGEST().
+ */
+
+
+/**@def NUTAG_SMIME_SIGNATURE(x)
+ *
+ * S/MIME signature algorithm
+ *
+ * This tag specifies the signature algorithm to be used in S/MIME.
+ *
+ * @par Used with
+ *    To be implemented.
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SMIME_SIGNATURE_REF().
+ */
 tag_typedef_t nutag_smime_signature = 
   STRTAG_TYPEDEF(smime_signature);
+
+/**@def NUTAG_SMIME_SIGNATURE_REF(x) 
+ * Reference tag for NUTAG_SMIME_SIGNATURE().
+ */
+
+
+/**@def NUTAG_SMIME_KEY_ENCRYPTION(x)
+ *
+ * S/MIME key encryption algorithm
+ *
+ * This tag specifies the key encryption algorithm to be used by S/MIME.
+ *
+ * @par Used with
+ *    To be implemented
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SMIME_KEY_ENCRYPTION_REF().
+ */
 tag_typedef_t nutag_smime_key_encryption = 
   STRTAG_TYPEDEF(smime_key_encryption);
+
+/**@def NUTAG_SMIME_KEY_ENCRYPTION_REF(x) 
+ * Reference tag for NUTAG_SMIME_KEY_ENCRYPTION().
+ */
+
+
+/**@def NUTAG_SMIME_MESSAGE_ENCRYPTION(x)
+ *
+ * S/MIME message encryption algorithm
+ *
+ * This tag specifies the message encryption algorithm to be used in S/MIME.
+ *
+ * @par Used with
+ *    To be implemented.
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SMIME_MESSAGE_ENCRYPTION_REF().
+ */
 tag_typedef_t nutag_smime_message_encryption = 
   STRTAG_TYPEDEF(smime_message_encryption);
-/* End NRC Boston */
 
+/**@def NUTAG_SMIME_MESSAGE_ENCRYPTION_REF(x) 
+ * Reference tag for NUTAG_SMIME_MESSAGE_ENCRYPTION().
+ */
+
+
+/**@def NUTAG_SIPS_URL(x)
+ *
+ * Local SIPS url.
+ *
+ * The application can specify an alternative local address for
+ * NUA user agent engine. Usually the alternative address is a
+ * secure SIP URI (SIPS) used with TLS transport.
+ *
+ * @par Used with
+ *    nua_create()
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SIPS_URL_REF().
+ */
 tag_typedef_t nutag_sips_url = URLTAG_TYPEDEF(sips_url);
+
+/**@def NUTAG_SIPS_URL_REF(x) 
+ * Reference tag for NUTAG_SIPS_URL().
+ */
+
+
+/**@def NUTAG_CERTIFICATE_DIR(x)
+ *
+ * X.500 certificate directory
+ *
+ * @par Used with
+ *    nua_create()
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *    NULL terminated pathname of directory containing agent.pem and cafile.pem files.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_CERTIFICATE_DIR_REF().
+ */
 tag_typedef_t nutag_certificate_dir = STRTAG_TYPEDEF(certificate_dir);
+
+/**@def NUTAG_CERTIFICATE_DIR_REF(x) 
+ * Reference tag for NUTAG_CERTIFICATE_DIR().
+ */
+
+
+/**@def NUTAG_CERTIFICATE_PHRASE(x)
+ *
+ * Certificate phrase
+ *
+ * @par Used with
+ *    Currently not processed by NUA
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_CERTIFICATE_PHRASE_REF().
+ */
 tag_typedef_t nutag_certificate_phrase = STRTAG_TYPEDEF(certificate_phrase);
 
+/**@def NUTAG_CERTIFICATE_PHRASE_REF(x) 
+ * Reference tag for NUTAG_CERTIFICATE_PHRASE().
+ */
+
 extern msg_hclass_t sip_route_class[];
+
+/**@def NUTAG_INITIAL_ROUTE(x)
+ *
+ * Specify initial route set.
+ *
+ * The initial route set is used instead or or in addition to the outbound
+ * proxy URL given by NUTAG_PROXY(). The NUTAG_INITIAL_ROUTE() accepts a
+ * list of parsed @Route header structures, NUTAG_INITIAL_ROUTE_STR() an
+ * unparsed string. 
+ * 
+ * If a tag list contains multiple NUTAG_INITIAL_ROUTE() or
+ * NUTAG_INITIAL_ROUTE_STR() tags, the route set is constructed from them
+ * all.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_set_hparams() \n
+ *    any handle-specific nua call
+ *
+ * @par Parameter type
+ *    sip_route_t const *
+ *
+ * @par Values
+ *    Linked list of #sip_route_t structures
+ *
+ * Corresponding tag taking reference parameter is NUTAG_INITIAL_ROUTE_REF().
+ *
+ * @NEW_1_12_7.
+ */
 tag_typedef_t nutag_initial_route = SIPEXTHDRTAG_TYPEDEF(initial_route, route);
+
+/**@def NUTAG_INITIAL_ROUTE_REF(x) 
+ * Reference tag for NUTAG_INITIAL_ROUTE().
+ */
+
+
+/**@def NUTAG_INITIAL_ROUTE_STR(x)
+ *
+ * Specify initial route set.
+ *
+ * The initial route set is used instead or or in addition to the outbound
+ * proxy URL given by NUTAG_PROXY(). The NUTAG_INITIAL_ROUTE() accepts a
+ * list of parsed @Route header structures, NUTAG_INITIAL_ROUTE_STR() a
+ * unparsed string containing route URIs, quoted with <> and separated by
+ * commas.
+ *
+ * Please note that the syntax requires <> around the @Route URIs if they
+ * contain parameters, e.g., "lr". 
+ *
+ * If a tag list contains multiple NUTAG_INITIAL_ROUTE() or
+ * NUTAG_INITIAL_ROUTE_STR() tags, the route set is constructed from them
+ * all. 
+ *
+ * The initial route set can be reset with NUTAG_INITIAL_ROUTE(NULL).
+ *
+ * If a tag list of a request contains SIPTAG_ROUTE() or
+ * SIPTAG_ROUTE_STR() tags, the resulting route set will contain first the
+ * initial route entries followed by the route URIs given with the
+ * SIPTAG_ROUTE()/SIPTAG_ROUTE_STR() tags.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_set_hparams() \n
+ *    any handle-specific nua call
+ *
+ * @par Parameter type
+ *    sip_route_t const *
+ *
+ * @par Values
+ *    Linked list of #sip_route_t structures
+ *
+ * Corresponding tag taking reference parameter is NUTAG_INITIAL_ROUTE_STR_REF().
+ *
+ * @NEW_1_12_7.
+ */
 tag_typedef_t nutag_initial_route_str = STRTAG_TYPEDEF(inital_route_str);
 
+/**@def NUTAG_INITIAL_ROUTE_STR_REF(x) 
+ * Reference tag for NUTAG_INITIAL_ROUTE_STR().
+ */
+
+
+/**@def NUTAG_REGISTRAR(x)
+ *
+ * Registrar URL
+ *
+ * @par Used with
+ *    nua_register()   \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *
+ * @par Parameter type
+ *    url_string_t const * (either char const * or url_t *)
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_REGISTRAR_REF().
+ */
 tag_typedef_t nutag_registrar = URLTAG_TYPEDEF(registrar);
+
+/**@def NUTAG_REGISTRAR_REF(x) 
+ * Reference tag for NUTAG_REGISTRAR().
+ */
+
+
+/**@def NUTAG_IDENTITY(x)
+ *
+ * Registration handle (used with requests and nua_respond()) (NOT YET IMPLEMENTED)
+ *
+ * When a new request is made or new call is responded, a new identity can
+ * be selected with NUTAG_IDENTITY(). The identity comprises of @b From
+ * header, initial route set, local contact header and media tags associated
+ * with it, soa handle and so on. User can make multiple registrations using
+ * multiple identities.
+ *
+ * @par Used with
+ *    nua_invite()
+ *
+ * @par Parameter type
+ *    nua_handle_t *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_IDENTITY_REF().
+ */
 tag_typedef_t nutag_identity = PTRTAG_TYPEDEF(identity);
+
+/**@def NUTAG_IDENTITY_REF(x) 
+ * Reference tag for NUTAG_IDENTITY().
+ */
+
+
+/**@def NUTAG_M_DISPLAY(x)
+ *
+ * Display name for @Contact.
+ *
+ * Specify display name for the Contact header URI generated for
+ * registration request and dialog-creating requests/responses.
+ *
+ * Note that the display name is not included the request-URI when proxy
+ * forwards the request towards the user-agent.
+ *
+ * @par Used with
+ *    nua_register(), nua_set_hparams(), nua_set_params().
+ *    nua_invite(), nua_respond(), nua_subscribe(), nua_notify()
+ *
+ * @par Parameter type
+ *    string (char *)
+ *
+ * @par Values
+ *    Valid display name.
+ *
+ * @sa NUTAG_M_USERNAME(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES(),
+ * NUTAG_CALLEE_CAPS().
+ *
+ * Corresponding tag taking reference parameter is NUTAG_M_DISPLAY_REF().
+ *
+ * @since New in @VERSION_1_12_2.
+ */
 tag_typedef_t nutag_m_display = STRTAG_TYPEDEF(m_display);
+
+/**@def NUTAG_M_DISPLAY_REF(x) 
+ * Reference tag for NUTAG_M_DISPLAY().
+ */
+
+
+/**@def NUTAG_M_USERNAME(x)
+ *
+ * Username prefix for @Contact.
+ *
+ * Specify username part for the Contact header URI generated for
+ * registration request and dialog-creating requests/responses.
+ *
+ * Using username, application can make multiple registrations using
+ * multiple identities, or it can distinguish between different logical
+ * destinations.
+ *
+ * @par Used with
+ *    nua_register(), nua_set_hparams(), nua_set_params().
+ *    nua_invite(), nua_respond(), nua_subscribe(), nua_notify()
+ *
+ * @par Parameter type
+ *    string (char *)
+ *
+ * @par Values
+ *    Valid SIP username.
+ *
+ * @sa NUTAG_M_DISPLAY(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES(),
+ * NUTAG_CALLEE_CAPS().
+ *
+ * Corresponding tag taking reference parameter is NUTAG_M_USERNAME_REF().
+ *
+ * @since New in @VERSION_1_12_2.
+ */
 tag_typedef_t nutag_m_username = STRTAG_TYPEDEF(m_username);
+
+/**@def NUTAG_M_USERNAME_REF(x) 
+ * Reference tag for NUTAG_M_USERNAME().
+ */
+
+
+/**@def NUTAG_M_PARAMS(x)
+ *
+ * URL parameters for @Contact.
+ *
+ * Specify URL parameters for the @Contact header URI generated for
+ * registration request and dialog-creating requests/responses.
+ *
+ * Please note that some proxies may remove even the non-transport
+ * parameters from the request-URI when they forward the request towards
+ * user-agent.
+ *
+ * @par Used with
+ *    nua_register(), nua_set_hparams(), nua_set_params(), 
+ *    nua_invite(), nua_respond(), nua_subscribe(), nua_notify()
+ *
+ * @par Parameter type
+ *    string (char *)
+ *
+ * @par Values
+ *    Semicolon-separated URL parameters.
+ *
+ * @sa NUTAG_M_DISPLAY(), NUTAG_M_USERNAME(), NUTAG_M_FEATURES(),
+ * NUTAG_CALLEE_CAPS().
+ *
+ * Corresponding tag taking reference parameter is NUTAG_M_PARAMS_REF().
+ *
+ * @since New in @VERSION_1_12_2.
+ */
 tag_typedef_t nutag_m_params = STRTAG_TYPEDEF(m_params);
+
+/**@def NUTAG_M_PARAMS_REF(x) 
+ * Reference tag for NUTAG_M_PARAMS().
+ */
+
+
+/**@def NUTAG_M_FEATURES(x)
+ *
+ * Header parameters for @Contact used in registration.
+ *
+ * Specify header parameters for the @Contact header generated for
+ * registration request and dialog-creating requests/responses. Such header
+ * parameters include "q", indicating preference for the @Contact URI, and
+ * "expires", indicating the desired expiration time for the registration.
+ *
+ * Additional header parameters are typically media feature tags, specified in
+ * @RFC3840. If NUTAG_CALLEE_CAPS(1) is specified, additional @Contact header
+ * parameters are generated based on SDP capabilities and SIP @Allow header.
+ *
+ * When using the "outbound" extension option, the stack will also add
+ * "+sip.instance" and "reg-id" header parameters to the @Contact.
+ *
+ * @par Used with
+ *    nua_register(), nua_set_hparams(), nua_set_params()
+ *
+ * @par Parameter type
+ *    string (char *)
+ *
+ * @par Values
+ *    Semicolon-separated SIP header parameters.
+ *
+ * @sa NUTAG_M_DISPLAY(), NUTAG_M_USERNAME(), NUTAG_M_PARAMS(),
+ * NUTAG_CALLEE_CAPS(), NUTAG_IDENTITY().
+ *
+ * Corresponding tag taking reference parameter is NUTAG_M_FEATURES_REF().
+ *
+ * @since New in @VERSION_1_12_2.
+ */
 tag_typedef_t nutag_m_features = STRTAG_TYPEDEF(m_features);
+
+/**@def NUTAG_M_FEATURES_REF(x) 
+ * Reference tag for NUTAG_M_FEATURES().
+ */
+
+
+/**@def NUTAG_INSTANCE(x)
+ *
+ * Intance identifier.
+ *
+ * @par Used with
+ *    nua_create(), nua_set_params(), nua_get_params(), 
+ *    nua_register()
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Value
+ *    urn:uuid string, a globally unique identifier for this user-agent
+ *    instance.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_INSTANCE_REF().
+ */
 tag_typedef_t nutag_instance = STRTAG_TYPEDEF(instance);
+
+/**@def NUTAG_INSTANCE_REF(x) 
+ * Reference tag for NUTAG_INSTANCE().
+ */
+
+
+/**@def NUTAG_OUTBOUND(x)
+ *
+ * Outbound option string.
+ *
+ * The outbound option string can specify how the NAT traversal is handled.
+ * The option tokens are as follows:
+ * - "gruuize": try to generate a GRUU contact from REGISTER response
+ * - "outbound": use SIP outbound extension (off by default)
+ * - "validate": validate registration behind a NAT by sending OPTIONS to self
+ * - "natify": try to traverse NAT
+ * - "use-rport": use rport to traverse NAT
+ * - "options-keepalive": send periodic OPTIONS requests as keepalive messages
+ *
+ * An option token with "no-" or "not-" prefix turns the option off. For
+ * example, if you want to try to traverse NATs but not to use OPTIONS
+ * keepalive, use NUTAG_OUTBOUND("natify no-options-keepalive").
+ * 
+ * An empty string can be passed to let the stack choose the
+ * default values for outbound usage (in the 1.12.5 release, the
+ * defaults are: "gruuize no-outbound validate use-port options-keepalive").
+ *
+ * @note
+ * Options string is used so that no new tags need to be added when the
+ * outbound functionality changes.
+ *
+ * @par Used with
+ *    nua_register()   \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *    nua_set_hparams() \n
+ *    nua_get_hparams()
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_REF().
+ */
 tag_typedef_t nutag_outbound = STRTAG_TYPEDEF(outbound);
 
+/**@def NUTAG_OUTBOUND_REF(x) 
+ * Reference tag for NUTAG_OUTBOUND().
+ */
+
+
+/*#@def NUTAG_OUTBOUND_SET1(x)
+ *
+ * Outbound proxy set 1.
+ *
+ * @par Used with
+ *    nua_register()   \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *    nua_set_hparams() \n
+ *    nua_get_hparams()
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET1_REF().
+ */
 tag_typedef_t nutag_outbound_set1 = STRTAG_TYPEDEF(outbound_set1);
+
+/*#@def NUTAG_OUTBOUND_SET1_REF(x) 
+ * Reference tag for NUTAG_OUTBOUND_SET1().
+ */
+
+
+/*#@def NUTAG_OUTBOUND_SET2(x)
+ *
+ * Outbound proxy set 2.
+ *
+ * @par Used with
+ *    nua_register()   \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *    nua_set_hparams() \n
+ *    nua_get_hparams()
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET2_REF().
+ */
 tag_typedef_t nutag_outbound_set2 = STRTAG_TYPEDEF(outbound_set2);
+
+/*#@def NUTAG_OUTBOUND_SET2_REF(x) 
+ * Reference tag for NUTAG_OUTBOUND_SET2().
+ */
+
+
+/*#@def NUTAG_OUTBOUND_SET3(x)
+ *
+ * Outbound proxy set 3.
+ *
+ * @par Used with
+ *    nua_register()   \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *    nua_set_hparams() \n
+ *    nua_get_hparams()
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET3_REF().
+ */
 tag_typedef_t nutag_outbound_set3 = STRTAG_TYPEDEF(outbound_set3);
+
+/*#@def NUTAG_OUTBOUND_SET3_REF(x) 
+ * Reference tag for NUTAG_OUTBOUND_SET3().
+ */
+
+
+/*#@def NUTAG_OUTBOUND_SET4(x)
+ *
+ * Outbound proxy set 4.
+ *
+ * @par Used with
+ *    nua_register()   \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *    nua_set_hparams() \n
+ *    nua_get_hparams()
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET4_REF().
+ */
 tag_typedef_t nutag_outbound_set4 = STRTAG_TYPEDEF(outbound_set4);
 
+/*#@def NUTAG_OUTBOUND_SET4_REF(x) 
+ * Reference tag for NUTAG_OUTBOUND_SET4().
+ */
+
+
+
+/**@def NUTAG_KEEPALIVE(x)
+ *
+ * Keepalive interval in milliseconds.
+ *
+ * This setting applies to OPTIONS/STUN keepalives. See documentation 
+ * for nua_register() for more detailed information.
+ *
+ * @par Used with
+ *    nua_register()   \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *    nua_set_hparams() \n
+ *    nua_get_hparams()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values 
+ *   - 0 - disable keepalives
+ *   - 120000 - default value (120000 milliseconds, 120 seconds)
+ *
+ * Corresponding tag taking reference parameter is
+ * NUTAG_KEEPALIVE_REF().
+ */
 tag_typedef_t nutag_keepalive = UINTTAG_TYPEDEF(keepalive);
+
+/**@def NUTAG_KEEPALIVE_REF(x) 
+ * Reference tag for NUTAG_KEEPALIVE().
+ */
+
+
+/**@def NUTAG_KEEPALIVE_STREAM(x)
+ *
+ * Transport-level keepalive interval for streams.
+ *
+ * See documentation for nua_register() for more detailed information.
+ *
+ * @par Used with
+ *    nua_register()   \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *    nua_set_hparams() \n
+ *    nua_get_hparams()
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values 
+ *
+ * Transport-level keepalive interval for streams in milliseconds. If this
+ * parameter specified, it takes presedence over value given in
+ * NUTAG_KEEPALIVE().
+ *
+ * Corresponding tag taking reference parameter is
+ * NUTAG_KEEPALIVE_STREAM_REF().
+ *
+ * @todo Actually pass NUTAG_KEEPALIVE_STREAM() to transport layer.
+ */
 tag_typedef_t nutag_keepalive_stream = UINTTAG_TYPEDEF(keepalive_stream);
 
+/**@def NUTAG_KEEPALIVE_STREAM_REF(x) 
+ * Reference tag for NUTAG_KEEPALIVE_STREAM().
+ */
+
+
+
+/**@def NUTAG_USE_DIALOG(x)
+ *
+ * Ask NUA to create dialog for this handle
+ *
+ * @par Used with nua calls that send a SIP request
+ *
+ * @par Parameter type
+ *   int
+ *
+ * @par Values
+ *    @c False (zero) \n
+ *    @c True (nonzero)
+ *
+ * Corresponding tag taking reference parameter is NUTAG_USE_DIALOG_REF().
+ */
 tag_typedef_t nutag_use_dialog = BOOLTAG_TYPEDEF(use_dialog);
 
+/**@def NUTAG_USE_DIALOG_REF(x) 
+ * Reference tag for NUTAG_USE_DIALOG().
+ */
+
+
+/**@def NUTAG_AUTH(x)
+ *
+ * Authentication data ("scheme" "realm" "user" "password")
+ *
+ * @par Used with
+ *    nua_authenticate()
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *    NULL terminated string of format: \n
+ *    basic digest scheme:"realm":user:password  \n
+ *    @b NOTE the double quotes around realm!
+ *    For example: \n
+ *	\code Digest:"nokia proxy":xyz:secret \endcode
+ *
+ * Corresponding tag taking reference parameter is NUTAG_AUTH_REF().
+ */
 tag_typedef_t nutag_auth = STRTAG_TYPEDEF(auth);
+
+/**@def NUTAG_AUTH_REF(x) 
+ * Reference tag for NUTAG_AUTH().
+ */
+
+
+/**@def NUTAG_AUTHTIME(x)
+ *
+ * Lifetime of authentication data in seconds.
+ *
+ * @par Used with
+ *    Currently not processed by NUA
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ *    @c 0   Use authentication data only for this handle \n
+ *    @c !=0 Lifetime in seconds
+ *
+ * @todo
+ *
+ * Corresponding tag taking reference parameter is NUTAG_AUTHTIME_REF().
+ */
 tag_typedef_t nutag_authtime = INTTAG_TYPEDEF(authtime);
 
+/**@def NUTAG_AUTHTIME_REF(x) 
+ * Reference tag for NUTAG_AUTHTIME().
+ */
+
+
+
+/**@def NUTAG_EVENT(x)
+ *
+ * NUA event.
+ *
+ * @deprecated
+ *
+ * @par Parameter type
+ *    enum nua_event_e
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_EVENT_REF().
+ */
 tag_typedef_t nutag_event = INTTAG_TYPEDEF(event);
+
+/**@def NUTAG_EVENT_REF(x) 
+ * Reference tag for NUTAG_EVENT().
+ */
+
+
+/**@def NUTAG_STATUS(x)
+ *
+ * Response status code
+ *
+ * @deprecated
+ *
+ * @par Parameter type
+ *    unsigned int
+ *
+ * @par Values
+ * 100 - preliminary response, request is being processed by next hop \n
+ * 1XX - preliminary response, request is being processed by UAS \n
+ * 2XX - successful final response \n
+ * 3XX - redirection error response \n
+ * 4XX - client error response \n
+ * 5XX - server error response \n
+ * 6XX - global error response \n
+ *
+ * Corresponding tag taking reference parameter is NUTAG_STATUS_REF().
+ */
 tag_typedef_t nutag_status = INTTAG_TYPEDEF(status);
+
+/**@def NUTAG_STATUS_REF(x) 
+ * Reference tag for NUTAG_STATUS().
+ */
+
+
+/**@def NUTAG_PHRASE(x)
+ *
+ * Response phrase
+ *
+ * @deprecated
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_PHRASE_REF().
+ */
 tag_typedef_t nutag_phrase = STRTAG_TYPEDEF(phrase);
 
+/**@def NUTAG_PHRASE_REF(x) 
+ * Reference tag for NUTAG_PHRASE().
+ */
+
+
+/**@def NUTAG_HANDLE(x)
+ *
+ * NUA Handle
+ *
+ * @deprecated
+ *
+ * @par Parameter type
+ *    nua_handle_t *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_HANDLE_REF().
+ */
 tag_typedef_t nutag_handle = PTRTAG_TYPEDEF(handle);
 
-tag_typedef_t nutag_hold = BOOLTAG_TYPEDEF(hold);
+/**@def NUTAG_HANDLE_REF(x) 
+ * Reference tag for NUTAG_HANDLE().
+ */
+
 
+/**@def NUTAG_NOTIFY_REFER(x)
+ *
+ * Refer reply handle (used with refer)
+ *
+ * When making a call in response to a REFER request [RFC3515] with
+ * nua_invite(), the application can ask NUA to automatically generate
+ * notifications about the call progress to the referrer. In order to
+ * do that the application should pass to the stack the handle, which
+ * it used to receive the REFER request. It should also pass the event
+ * header object along with the handle using NUTAG_REFER_EVENT().
+ *
+ * @par Used with
+ *    nua_invite()
+ *
+ * @par Parameter type
+ *    nua_handle_t *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_NOTIFY_REFER_REF().
+ */
 tag_typedef_t nutag_notify_refer = PTRTAG_TYPEDEF(notify_refer);
+
+/**@def NUTAG_NOTIFY_REFER_REF(x) 
+ * Reference tag for NUTAG_NOTIFY_REFER().
+ */
+
+/**@def NUTAG_REFER_EVENT(x)
+ *
+ * Event used with automatic refer notifications.
+ *
+ * When creating a call in response to a REFER request [RFC3515]
+ * the application can ask NUA to automatically generate notifications
+ * about the call progress to the referrer. The #nua_i_refer event will
+ * contain a suitable SIP event header for the notifications in the
+ * NUTAG_REFER_EVENT() tag. The application should store the SIP event
+ * header and when it makes the referred call, it should pass it back
+ * to the stack again using the NUTAG_REFER_EVENT() tag.
+ *
+ * @par Used with
+ *
+ * @par Parameter type
+ *    sip_event_t *
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_REFER_EVENT_REF().
+ */
 tag_typedef_t nutag_refer_event = SIPHDRTAG_NAMED_TYPEDEF(refer_event, event);
+
+/**@def NUTAG_REFER_EVENT_REF(x) 
+ * Reference tag for NUTAG_REFER_EVENT().
+ */
+
+
+/**@def NUTAG_REFER_PAUSE()
+ *
+ * Invite pauses referrer's handle.
+ *
+ * When creating a call in response to a REFER [RFC3515] request,
+ * the application can ask that the original call will be muted
+ * when the new call is connected by specifying NUTAG_REFER_PAUSE()
+ * along with NUTAG_NOTIFY_REFER() as a parameter to nua_invite() call.
+ *
+ * @par Used with
+ *    nua_invite()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   False \n
+ *    @c !=0 True
+ *
+ * Corresponding tag taking reference parameter is NUTAG_REFER_PAUSE_REF().
+ *
+ * @deprecated Not implemented.
+ */
 tag_typedef_t nutag_refer_pause = BOOLTAG_TYPEDEF(refer_pause);
+
+/**@def NUTAG_REFER_PAUSE_REF(x) 
+ * Reference tag for NUTAG_REFER_PAUSE().
+ */
+
+
+/**@def NUTAG_USER_AGENT()
+ *
+ * User-Agent string.
+ *
+ * Indicate the User-Agent header used by the stack. The value set with this
+ * tag is concatenated with the value indicating the stack name and version,
+ * e.g., "sofia-sip/1.12.1" unless the stack name "sofia-sip" followed by
+ * slash is already included in the string. The concatenated value is
+ * returned in SIPTAG_USER_AGENT_STR() and NUTAG_USER_AGENT() when
+ * nua_get_params() is called.
+ *
+ * If you want to set the complete string, use SIPTAG_USER_AGENT_STR() or
+ * SIPTAG_USER_AGENT().
+ *
+ * @par Used with
+ *    nua_set_params(), nua_set_hparams() \n
+ *    nua_get_params(), nua_get_hparams(), #nua_r_get_params \n
+ *    any handle-specific nua call
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *    See @RFC3261 \n
+ *    If NULL, stack uses default string which of format "sofia-sip/1.12".
+ *
+ * Corresponding tag taking reference parameter is NUTAG_USER_AGENT_REF().
+ */
 tag_typedef_t nutag_user_agent = STRTAG_TYPEDEF(user_agent);
+
+/**@def NUTAG_USER_AGENT_REF(x) 
+ * Reference tag for NUTAG_USER_AGENT().
+ */
+
+
+/**@def NUTAG_ALLOW()
+ *
+ * Allow a method (or methods).
+ *
+ * This tag is used to add a new method to the already existing set of
+ * allowed methods. If you want to ignore the existing set of allowed
+ * methods, use SIPTAG_ALLOW_STR() or SIPTAG_ALLOW().
+ *
+ * The set of allowed methods is added to the @Allow header in the response
+ * or request messages. For incoming request, an error response <i>405
+ * Method Not Allowed</i> is automatically returned if the incoming method
+ * is not included in the set.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_set_hparams() \n
+ *    any handle-specific nua call
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *    Valid method name, or comma-separated list of them.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_ALLOW_REF().
+ */
 tag_typedef_t nutag_allow = STRTAG_TYPEDEF(allow);
+
+/**@def NUTAG_ALLOW_REF(x) 
+ * Reference tag for NUTAG_ALLOW().
+ */
+
+
+/**@def NUTAG_ALLOW_EVENTS()
+ *
+ * Allow an event or events.
+ *
+ * This tag is used to add a new event to the already existing set of
+ * allowed events. If you want to ignore the existing set of allowed events,
+ * set the allowed event set with SIPTAG_ALLOW_EVENTS_STR() or
+ * SIPTAG_ALLOW_EVENTS().
+ *
+ * The set of allowed methods is added to the @AllowEvents header in the
+ * response to the SUBSCRIBE or PUBLISH requests. For incoming SUBSCRIBE or
+ * PUBLISH request, an error response <i>489 Bad Event</i> is automatically
+ * returned if the incoming method is not included in the set.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_set_hparams() \n
+ *    any handle-specific nua call
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *    Valid event name, or comma-separated list of them.
+ *
+ * @sa @AllowEvents, @RFC3265, @RFC3903, #nua_i_subscribe, #nua_i_publish,
+ * nua_subscribe(), nua_publish(), SIPTAG_ALLOW_EVENTS(),
+ * SIPTAG_ALLOW_EVENTS_STR()
+ *
+ * @NEW_1_12_4.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_ALLOW_EVENTS_REF().
+ */
 tag_typedef_t nutag_allow_events = STRTAG_TYPEDEF(allow_events);
+
+/**@def NUTAG_ALLOW_EVENTS_REF(x) 
+ * Reference tag for NUTAG_ALLOW_EVENTS().
+ */
+
+
+/**@def NUTAG_APPL_METHOD()
+ *
+ * Indicate that a method (or methods) are handled by application.
+ *
+ * This tag is used to add a new method to the already existing set of
+ * methods handled by application, or clear the set. If you want to
+ * determine the set explicitly, include NUTAG_APPL_METHOD() twice,
+ * first with NULL and then with your supported set.
+ *
+ * The default set of application methods now include INVITE, REGISTER,
+ * PUBLISH and SUBSCRIBE.
+ *
+ * If the request method is in the set of methods handled by application,
+ * the nua stack does not automatically respond to the incoming request nor
+ * it will automatically send such a request. Note if the application adds
+ * the PRACK and UPDATE requests to the set of application methods it must
+ * also take care for sending the PRACK and UPDATE requests during the call
+ * setup when necessary.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_set_hparams() \n
+ *    any handle-specific nua call
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *    Valid method name, or comma-separated list of them.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_APPL_METHOD_REF().
+ *
+ * @since Working since @VERSION_1_12_5. Handling of client-side PRACK and
+ * UPDATE was fixed in @VERSION_1_12_6.
+ */
 tag_typedef_t nutag_appl_method = STRTAG_TYPEDEF(appl_method);
+
+/**@def NUTAG_APPL_METHOD_REF(x) 
+ * Reference tag for NUTAG_APPL_METHOD().
+ */
+
+
+/**@def NUTAG_SUPPORTED()
+ *
+ * Support a feature.
+ *
+ * This tag is used to add a new feature to the existing set of supported
+ * SIP features. If you want to ignore the existing set of supported
+ * features, use SIPTAG_SUPPORTED_STR() or SIPTAG_SUPPORTED().
+ *
+ * The set of supported features is added to the @Supported header in the
+ * response or request messages. For incoming requests, an error response
+ * <i>420 Bad Extension </i> is automatically returned if the request
+ * requires features that are not included in the supported feature set.
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_set_hparams() \n
+ *    any handle-specific nua call
+ *
+ * @par Parameter type
+ *    char const *
+ *
+ * @par Values
+ *    Feature name, or comma-separated list of them.
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SUPPORTED_REF().
+ *
+ * @since New in @VERSION_1_12_2.
+ */
 tag_typedef_t nutag_supported = STRTAG_TYPEDEF(supported);
+
+/**@def NUTAG_SUPPORTED_REF(x) 
+ * Reference tag for NUTAG_SUPPORTED().
+ */
+
+
+/**@def NUTAG_PATH_ENABLE(x) 
+ * 
+ * If true, add "path" to @Supported in REGISTER.
+ *
+ * @par Used with
+ * - nua_create(), nua_set_params(), nua_get_params()
+ * - nua_handle(), nua_set_hparams(), nua_get_hparams()
+ * - nua_register()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   Do not include "path" to @Supported header
+ *    @c !=0 Include "path" to @Supported header
+ *
+ * @sa NUTAG_SERVICE_ROUTE_ENABLE(), NUTAG_SUPPORTED(),
+ * NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(), @RFC3327
+ * <i>"SIP Extension Header Field for Registering Non-Adjacent Contacts"</i>,
+ * D. Willis, B. Hoeneisen,
+ * December 2002.
+ */
 tag_typedef_t nutag_path_enable = BOOLTAG_TYPEDEF(path_enable);
+
+/**@def NUTAG_PATH_ENABLE_REF(x) 
+ * Reference tag for NUTAG_PATH_ENABLE().
+ */
+
+
+
+/**@def NUTAG_SERVICE_ROUTE_ENABLE(x) 
+ *
+ * Use route from @ServiceRoute header in response to REGISTER.
+ *
+ * @par Used with
+ * - nua_create(), nua_set_params(), nua_get_params()
+ * - nua_handle(), nua_set_hparams(), nua_get_hparams()
+ * - nua_register()
+ *
+ * @par Parameter type
+ *    int
+ *
+ * @par Values
+ *    @c 0   Do not use @ServiceRoute
+ *    @c !=0 Use @ServiceRoute
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SERVICE_ROUTE_ENABLE_REF().
+ *
+ * @sa NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(), @RFC3608
+ *
+ * @todo 
+ */
 tag_typedef_t nutag_service_route_enable = 
   BOOLTAG_TYPEDEF(service_route_enable);
+
+/**@def NUTAG_SERVICE_ROUTE_ENABLE_REF(x) 
+ * Reference tag for NUTAG_SERVICE_ROUTE_ENABLE().
+ */
+
+
+/**@def NUTAG_AUTH_CACHE(x)
+ *
+ * Authentication caching policy
+ *
+ * @par Used with
+ *    nua_set_params(), nua_set_hparams() \n
+ *    nua_get_params(), nua_get_hparams() \n
+ *    @NUA_HPARAM_CALLS 
+ *
+ * @par Parameter type
+ *    enum nua_auth_cache
+ *
+ * @par Values
+ *    - nua_auth_cache_dialog (0) - include credentials within dialog
+ *    - nua_auth_cache_challenged (1) - include credentials only when 
+ *                                      challenged
+ *    
+ * Corresponding tag taking reference parameter is NUTAG_AUTH_CACHE_REF().
+ *
+ * @NEW_1_12_6.
+ */
 tag_typedef_t nutag_auth_cache = INTTAG_TYPEDEF(auth_cache);
 
+/**@def NUTAG_AUTH_CACHE_REF(x) 
+ * Reference tag for NUTAG_AUTH_CACHE().
+ */
+
+
+/**@def NUTAG_DETECT_NETWORK_UPDATES(x)
+ *
+ * Enable detection of local IP address updates.
+ *
+ * @par Used with
+ *    nua_create() \n
+ *    nua_set_params() \n
+ *    nua_get_params()
+ *
+ * @par Parameter type
+ *    int (enum nua_nw_detector_e aka #nua_nw_detector_t)
+ *
+ * @sa #nua_i_network_changed, #nua_nw_detector_t
+ *
+ * Corresponding tag taking reference parameter is
+ * NUTAG_DETECT_NETWORK_UPDATES_REF().
+ *
+ * @since New in @VERSION_1_12_2.
+ */
 tag_typedef_t nutag_detect_network_updates = UINTTAG_TYPEDEF(detect_network_updates);
 
+/**@def NUTAG_DETECT_NETWORK_UPDATES_REF(x) 
+ * Reference tag for NUTAG_DETECT_NETWORK_UPDATES().
+ */
+
+
+/**@def NUTAG_WITH_THIS(nua)
+ *
+ * Specify request to respond to.
+ *
+ * @par Used with
+ *    nua_respond()
+ *
+ * @par Parameter type
+ *    nua_t *
+ *
+ * @par Values
+ *   Pointer to the nua agent instance object.
+ *
+ * @NEW_1_12_4.
+ *
+ * @sa NUTAG_WITH(), NUTAG_WITH_SAVED()
+ */
+
+/**@def NUTAG_WITH(msg)
+ *
+ * Specify request to respond to.
+ *
+ * @par Used with
+ *    nua_respond()
+ *
+ * @par Parameter type
+ *    msg_t *
+ *
+ * @par Values
+ *   Pointer to a request message.
+ *
+ * @NEW_1_12_4.
+ *
+ * @sa nua_save_event(), NUTAG_WITH_THIS(), NUTAG_WITH_SAVED()
+ */
+
+/**@def NUTAG_WITH_SAVED(event)
+ *
+ * Specify request to respond to.
+ *
+ * @par Used with
+ *    nua_respond()
+ *
+ * @par Parameter type
+ *    nua_saved_event_t *
+ *
+ * @par Values
+ *   Pointer to a saved event.
+ *
+ * @NEW_1_12_4.
+ *
+ * @sa nua_save_event(), NUTAG_WITH(), NUTAG_WITH_THIS()
+ */
+
 tag_typedef_t nutag_with = PTRTAG_TYPEDEF(with);
+
+/**@def NUTAG_DIALOG(x)
+ *
+ * An (extension) method is used to create dialog or refresh target.
+ *
+ * @par Used with
+ *    nua_method()
+ *
+ * @par Parameter type
+ *    unsigned int (0, 1, 2) 
+ *
+ * @par Values
+ *   - 0 if dialog target is not refreshed
+ *   - 1 if dialog target is refreshed
+ *   - > 1 if dialog is to be created 
+ *
+ * @NEW_1_12_6.
+ *
+ * @sa nua_method(), #nua_i_method
+ */
 tag_typedef_t nutag_dialog = UINTTAG_TYPEDEF(dialog);
+
+
+/**@def NUTAG_PROXY(x)
+ *
+ * Outbound proxy URL
+ *
+ * Same tag as NTATAG_DEFAULT_PROXY()
+ *
+ * @par Used with
+ *    nua_set_params() \n
+ *    nua_get_params() \n
+ *    nua_create()
+ *
+ * @par Parameter type
+ *    url_string_t const * (either char const * or url_t *)
+ *
+ * @par Values
+ *
+ * Corresponding tag taking reference parameter is NUTAG_PROXY_REF().
+ */
+
+/**@def NUTAG_PROXY_REF(x) 
+ * Reference tag for NUTAG_PROXY().
+ */
+
+/**@def NUTAG_SIP_PARSER(x)
+ *
+ * Pointer to SIP parser structure
+ *
+ * @par Used with
+ *    nua_create()
+ *
+ * @par Parameter type
+ *    msg_mclass_t const *
+ *
+ * @par Values
+ *    Pointer to an extended SIP parser.
+ *
+ * @sa msg_mclass_clone(), msg_mclass_insert_header()
+ *
+ * Corresponding tag taking reference parameter is NUTAG_SIP_PARSER_REF().
+ */
+
+/**@def NUTAG_SIP_PARSER_REF(x) 
+ * Reference tag for NUTAG_SIP_PARSER().
+ */
+
+/* ---------------------------------------------------------------------- */
+
+tag_typedef_t nutag_soa_session = PTRTAG_TYPEDEF(soa_session);
+tag_typedef_t nutag_hold = BOOLTAG_TYPEDEF(hold);
+tag_typedef_t nutag_address = STRTAG_TYPEDEF(address);

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c	Thu Oct 11 10:16:59 2007
@@ -863,11 +863,20 @@
     loglevel = 1;		/* XXX ... for now */
 
     if (loglevel >= SU_LOG->log_level) {
-      su_llog(SU_LOG, loglevel,       
-	      "outbound(%p): %s <" URL_PRINT_FORMAT ">\n",
-	      (void *)ob->ob_owner,
-	      failed ? "FAILED to validate" : "validated",
-	      URL_PRINT_ARGS(ob->ob_rcontact->m_url));
+      sip_contact_t const *m = ob->ob_rcontact;
+
+      if  (m)
+	su_llog(SU_LOG, loglevel,       
+		"outbound(%p): %s <" URL_PRINT_FORMAT ">\n",
+		(void *)ob->ob_owner,
+		failed ? "FAILED to validate" : "validated",
+		URL_PRINT_ARGS(m->m_url));
+      else
+	su_llog(SU_LOG, loglevel,       
+		"outbound(%p): %s registration\n",
+		(void *)ob->ob_owner,
+		failed ? "FAILED to validate" : "validated");
+
       if (failed)
 	su_llog(SU_LOG, loglevel, "outbound(%p): FAILED with %u %s\n", 
 		(void *)ob->ob_owner, status, phrase);
@@ -1101,6 +1110,8 @@
       previous = ob->ob_rcontact;
   }
   else if (application_contact) {
+    rcontact = sip_contact_dup(home, application_contact);
+
     if (!ob->ob_rcontact || 
 	url_cmp_all(ob->ob_rcontact->m_url, application_contact->m_url)) {
       contact_uri_changed = 1;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h	Thu Oct 11 10:16:59 2007
@@ -72,232 +72,45 @@
 #define NUTAG_ANY()          nutag_any, ((tag_value_t)0)
 SOFIAPUBVAR tag_typedef_t nutag_any;
 
-/** URL address from application to NUA
- *
- * @par Used with
- *    any function that create SIP request or nua_handle() \n
- *    nua_create() \n
- *    nua_set_params() \n
- *    nua_get_params() \n
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    #url_string_t, which is either a pointer to #url_t or NULL terminated
- *    character string representing URL \n
- *
- * For normal nua calls, this tag is used as request target, which is usually
- * stored as request-URI.
- *
- * It is used to set stack's own address with nua_create(), nua_set_params()
- * and nua_get_params().
- *
- * @sa SIPTAG_TO()
- *
- * Corresponding tag taking reference parameter is NUTAG_URL_REF()
- */
 #define NUTAG_URL(x)            nutag_url, urltag_url_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_url;
-
 #define NUTAG_URL_REF(x)        nutag_url_ref, urltag_url_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_url_ref;
 
-/** Address as a string
- *
- * @deprecated Not used.
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    String in form "name <url>"
- *
- * Corresponding tag taking reference parameter is
- * NUTAG_ADDRESS_REF()
- */
 #define NUTAG_ADDRESS(x)        nutag_address, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_address;
-
 #define NUTAG_ADDRESS_REF(x)    nutag_address_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_address_ref;
 
-/**Specify request to respond to.
- *
- * @par Used with
- *    nua_respond()
- *
- * @par Parameter type
- *    msg_t *
- *
- * @par Values
- *   Pointer to a request message.
- *
- * @NEW_1_12_4.
- *
- * @sa NUTAG_WITH_THIS(), NUTAG_WITH_SAVED()
- */
 #define NUTAG_WITH(x)         nutag_with, tag_ptr_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_with;
 
-/**Specify request to respond to.
- *
- * @par Used with
- *    nua_respond()
- *
- * @par Parameter type
- *    nua_t *
- *
- * @par Values
- *   Pointer to the nua agent instance object.
- *
- * @NEW_1_12_4.
- *
- * @sa nua_save_event(), NUTAG_WITH(), NUTAG_WITH_SAVED()
- */
 #define NUTAG_WITH_THIS(nua) nutag_with, tag_ptr_v(nua_current_request((nua)))
-
 #define NUTAG_WITH_CURRENT(nua) \
    nutag_with, tag_ptr_v(nua_current_request((nua)))
-
-/**Specify request to respond to.
- *
- * @par Used with
- *    nua_respond()
- *
- * @par Parameter type
- *    nua_saved_event_t *
- *
- * @par Values
- *   Pointer to a saved event.
- *
- * @NEW_1_12_4.
- *
- * @sa nua_save_event(), NUTAG_WITH(), NUTAG_WITH_THIS()
- */
 #define NUTAG_WITH_SAVED(e) nutag_with, tag_ptr_v(nua_saved_event_request((e)))
 
-/**An (extension) method is used to create dialog or refresh target.
- *
- * @par Used with
- *    nua_method()
- *
- * @par Parameter type
- *    unsigned int (0, 1, 2) 
- *
- * @par Values
- *   - 0 if dialog target is not refreshed
- *   - 1 if dialog target is refreshed
- *   - > 1 if dialog is to be created 
- *
- * @NEW_1_12_6.
- *
- * @sa nua_method(), #nua_i_method
- */
 #define NUTAG_DIALOG(b) nutag_dialog, tag_uint_v((b))
 SOFIAPUBVAR tag_typedef_t nutag_dialog;
 
-/**Set request retry count.
- *
- * Retry count determines how many times stack will automatically retry
- * after an recoverable error response, like 302, 401 or 407.
- *
- * @par Used with
- *    nua_set_params(), nua_set_hparams() \n
- *    nua_get_params(), nua_get_hparams() \n
- *    nua_invite(), nua_ack()
- *
- * @par Parameter type
- *    unsigned
- *
- * @par Values
- *    @c 0   Never retry automatically \n
- *
- * @NEW_1_12_4.
- *
- * Corresponding tag taking reference parameter is NUTAG_RETRY_COUNT_REF()
- */
-#define NUTAG_RETRY_COUNT(x)      nutag_retry_count, tag_uint_v(x)
-SOFIAPUBVAR tag_typedef_t nutag_retry_count;
-
-#define NUTAG_RETRY_COUNT_REF(x)  nutag_retry_count_ref, tag_uint_vr(&(x))
-SOFIAPUBVAR tag_typedef_t nutag_retry_count_ref;
-
-/** Extension method name.
- *
- * Specify extension method name with nua_method() function.
- *
- * @par Used with
- *    nua_method() \n
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    Extension method name (e.g., "SERVICE")
- *
- * Corresponding tag taking reference parameter is NUTAG_METHOD_REF()
- *
- * @sa nua_method(), SIP_METHOD_UNKNOWN()
- *
- * @since New in @VERSION_1_12_4.
- */
 #define NUTAG_METHOD(x)            nutag_method, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_method;
-
 #define NUTAG_METHOD_REF(x)        nutag_method_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_method_ref;
 
-/**Set maximum number of simultaneous subscribers per single event server.
- *
- * Determines how many subscribers can simultaneously subscribe to a single
- * event.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *    unsigned
- *
- * @par Values
- *    @c 0   Do not allow any subscriptions \n
- *
- * @sa nua_notifier(), nua_authorize()
- *
- * Corresponding tag taking reference parameter is 
- * NUTAG_MAX_SUBSCRIPTIONS_REF()
- */
 #define NUTAG_MAX_SUBSCRIPTIONS(x)      nutag_max_subscriptions, tag_uint_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_max_subscriptions;
-
 #define NUTAG_MAX_SUBSCRIPTIONS_REF(x) \
 nutag_max_subscriptions_ref, tag_uint_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_max_subscriptions_ref;
 
-/** Intentionally undocumented. */
 #define NUTAG_UICC(x)  nutag_uicc, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_uicc;
-
 #define NUTAG_UICC_REF(x) nutag_uicc_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_uicc_ref;
 
-/** Ask NUA to create dialog for this handle
- *
- * @par Used with nua calls that send a SIP request
- *
- * @par Parameter type
- *   int
- *
- * @par Values
- *    @c False (zero) \n
- *    @c True (nonzero)
- *
- * Corresponding tag taking reference parameter is NUTAG_USE_DIALOG_REF()
- */
 #define NUTAG_USE_DIALOG(x)        nutag_use_dialog, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_use_dialog;
-
 #define NUTAG_USE_DIALOG_REF(x)    nutag_use_dialog_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_use_dialog_ref;
 
@@ -305,304 +118,50 @@
 /* Protocol engine parameters,
  * set by nua_set_params(), get by nua_get_params() */
 
-#if 0
-
-/**Pointer to a SDP Offer-Answer session object.
- *
- * Pointer to the media session object.
- *
- * @par Used with nua_create(), nua_handle().
- *
- * @par Parameter type
- *    void * (actually soa_session_t *)
- *
- * @par Values
- *    Pointer to MSS media session.
- *
- * Corresponding tag taking reference parameter is NUTAG_SOA_SESSION_REF.
- */
-#define NUTAG_SOA_SESSION(x)  nutag_soa_session, tag_ptr_v(x)
-SOFIAPUBVAR tag_typedef_t nutag_soa_session;
-
-#define NUTAG_SOA_SESSION_REF(x) \
- nutag_soa_session_ref, tag_ptr_vr(&(x),(x))
-SOFIAPUBVAR tag_typedef_t nutag_soa_session_ref;
-
-#endif
+#define NUTAG_RETRY_COUNT(x)      nutag_retry_count, tag_uint_v(x)
+SOFIAPUBVAR tag_typedef_t nutag_retry_count;
+#define NUTAG_RETRY_COUNT_REF(x)  nutag_retry_count_ref, tag_uint_vr(&(x))
+SOFIAPUBVAR tag_typedef_t nutag_retry_count_ref;
 
-/**Name for SDP Offer-Answer session object.
- *
- * SDP Offer-Answer session object name.
- *
- * @par Used with nua_create(), nua_handle().
- *
- * @par Parameter type
- *    void * (actually soa_session_t *)
- *
- * @par Values
- *    Pointer to MSS media session.
- *
- * Corresponding tag taking reference parameter is NUTAG_SOA_SESSION_REF.
- */
 #define NUTAG_SOA_NAME(x)  nutag_soa_name, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_soa_name;
-
 #define NUTAG_SOA_NAME_REF(x) \
  nutag_soa_name_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_soa_name_ref;
 
-/**Establish early media session using 100rel, 183 responses and PRACK.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params() \n
- *    nua_set_hparams() \n
- *    nua_get_hparams() \n
- *    nua_invite() \n
- *    nua_respond() \n
- *
- * @par Parameter type
- *    int (boolean)
- *
- * @par Values
- *    @c 0   False \n
- *    @c !=0 True
- *
- * @sa NUTAG_EARLY_ANWER()
- *
- * Corresponding tag taking reference parameter is NUTAG_EARLY_MEDIA_REF()
- */
 #define NUTAG_EARLY_MEDIA(x)    nutag_early_media, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_early_media;
-
 #define NUTAG_EARLY_MEDIA_REF(x) nutag_early_media_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_early_media_ref;
 
-/**Respond only 183 with 100rel.
- *
- * If this parameter is set, stack uses 100rel only with 183: otherwise, all
- * 1XX responses (except <i>100 Trying</i>) uses 100rel.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params() \n
- *    nua_set_hparams() \n
- *    nua_get_hparams() \n
- *    nua_invite() \n
- *    nua_respond()
- *
- * @par Parameter type
- *    int (boolean)
- *
- * @par Values
- *    @c 0   False \n
- *    @c !=0 True
- *
- * Corresponding tag taking reference parameter is NUTAG_ONLY183_100REL_REF()
-*/
 #define NUTAG_ONLY183_100REL(x)    nutag_only183_100rel, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_only183_100rel;
-
 #define NUTAG_ONLY183_100REL_REF(x) nutag_only183_100rel_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_only183_100rel_ref;
 
-/**Establish early media session by including SDP answer in 1XX response.
- *
- * @par Used with
- *    nua_respond(), nua_set_params(), nua_set_hparams()
- *
- * @par Parameter type
- *    int (boolean)
- *
- * @par Values
- *    @c 0   False \n
- *    @c !=0 True
- *
- * Corresponding tag taking reference parameter is NUTAG_EARLY_ANSWER_REF().
- *
- * @note Requires that @soa is enabled with NUTAG_MEDIA_ENABLE(1).
- *
- * @sa NUTAG_EARLY_MEDIA(), NUTAG_AUTOALERT(), NUTAG_MEDIA_ENABLE()
- * 
- * @since New in @VERSION_1_12_2.
- */
 #define NUTAG_EARLY_ANSWER(x)    nutag_early_answer, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_early_answer;
-
 #define NUTAG_EARLY_ANSWER_REF(x) nutag_early_answer_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_early_answer_ref;
 
-/**Include an extra copy of SDP answer in the response.
- *
- * When NUTAG_INCLUDE_EXTRA_SDP(1) is included in nua_respond() tags, stack
- * will include in the response a copy of the SDP offer/answer that was last
- * sent to the client. This tag should be used only when you know that the
- * remote end requires the extra SDP, for example, some versions of Cisco
- * SIPGateway need a copy of answer in 200 OK even when they indicate
- * support for 100rel.
- *
- * @par Used with
- *    nua_respond()
- *
- * @par Parameter type
- *    int (boolean)
- *
- * @par Values
- *    @c 0   False \n
- *    @c !=0 True
- *
- * Corresponding tag taking reference parameter is
- * NUTAG_INCLUDE_EXTRA_SDP_REF().
- *
- * @note Requires that @soa is enabled with NUTAG_MEDIA_ENABLE(1).
- *
- * @sa NUTAG_EARLY_ANSWER(), NUTAG_EARLY_MEDIA(), NUTAG_AUTOALERT(),
- * NUTAG_MEDIA_ENABLE(), @RFC3264, @RFC3264
- * 
- * @since New in @VERSION_1_12_4.
- */
 #define NUTAG_INCLUDE_EXTRA_SDP(x)    nutag_include_extra_sdp, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_include_extra_sdp;
-
 #define NUTAG_INCLUDE_EXTRA_SDP_REF(x) \
    nutag_include_extra_sdp_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_include_extra_sdp_ref;
 
-/** Timer for outstanding INVITE in seconds.
- *
- * INVITE will be canceled if no answer is received before timer expires.
- *
- * @par Used with
- *    nua_invite() \n
- *    nua_set_params(), nua_set_hparams(),
- *    nua_get_params(), nua_get_hparams()
- *
- * @par Parameter type
- *    int (enum nua_af)
- *
- * @par Values
- *    @c 0  no timer \n
- *    @c >0 timer in seconds
- *
- * Corresponding tag taking reference parameter is NUTAG_INVITE_TIMER_REF()
- */
 #define NUTAG_INVITE_TIMER(x)  nutag_invite_timer, tag_uint_v((x))
 SOFIAPUBVAR tag_typedef_t nutag_invite_timer;
-
 #define NUTAG_INVITE_TIMER_REF(x) nutag_invite_timer_ref, tag_uint_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_invite_timer_ref;
 
-/**Default session timer in seconds.
- *
- * Set default value for session timer in seconds when the session timer
- * extension is used. The tag value is the proposed session expiration time
- * in seconds, the session is refreshed twice during the expiration time.
- *
- * @par Sending INVITE and UPDATE Requests 
- *
- * If NUTAG_SESSION_TIMER() is used with non-zero value, the value is used
- * in the @SessionExpires header included in the INVITE or UPDATE requests. 
- * The intermediate proxies or the ultimate destination can lower the
- * interval in @SessionExpires header. If the value is too low, they can
- * reject the request with the status code <i>422 Session Timer Too
- * Small</i>. In that case, @b nua increases the value of @SessionExpires
- * header and retries the request automatically.
- *
- * @par Returning a Response to the INVITE and UPDATE Requests 
- *
- * The NUTAG_SESSION_TIMER() value is also used when sending the final
- * response to the INVITE or UPDATE requests. If the NUTAG_SESSION_TIMER()
- * value is 0 or the value in the @SessionExpires header of the request is
- * lower than the value in NUTAG_SESSION_TIMER(), the value from the
- * incoming @SessionExpires header is used. However, if the value in
- * @SessionExpires is lower than the minimal acceptable session expiration
- * interval specified with the tag NUTAG_MIN_SE() the request is
- * automatically rejected with <i>422 Session Timer Too Small</i>.
- *
- * @par Refreshes
- *
- * After the initial INVITE request, the SIP session is refreshed at the
- * intervals indicated by the @SessionExpires header returned in the 2XX
- * response. The party indicated with the "refresher" parameter of the
- * @SessionExpires header sends a re-INVITE requests (or an UPDATE
- * request if NUTAG_UPDATE_REFRESH(1) parameter tag has been set).
- * 
- * @par When to Use NUTAG_SESSION_TIMER()?
- *
- * The session time extension is enabled ("timer" feature tag is included in
- * @Supported header) but not activated by default (no @SessionExpires
- * header is included in the requests or responses by default). Using
- * non-zero value with NUTAG_SESSION_TIMER() or NUTAG_SESSION_REFRESHER()
- * activates it. When the extension is activated, @nua refreshes the call
- * state by sending periodic re-INVITE or UPDATE requests unless the remote
- * end indicated that it will take care of refreshes.
- *
- * The session timer extension is mainly useful for proxies or back-to-back
- * user agents that keep call state. The call state is "soft" meaning that
- * if no call-related SIP messages are processed for certain time the state
- * will be destroyed. An ordinary user-agent can also make use of session
- * timer if it cannot get any activity feedback from RTP or other media.
- *
- * @note The session timer extension is used only if the feature
- * tag "timer" is listed in the @Supported header, set by NUTAG_SUPPORTED(),
- * SIPTAG_SUPPORTED(), or SIPTAG_SUPPORTED_STR() tags.
- *
- * @par Used with
- *    nua_invite(), nua_update(), nua_respond() \n
- *    nua_set_params() or nua_set_hparams() \n
- *    nua_get_params() or nua_get_hparams()
- *
- * See nua_set_hparams() for a complete list of the the nua operations that
- * accept this tag.
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    @c 0  disable \n
- *    @c >0 interval in seconds
- *
- * Corresponding tag taking reference parameter is NUTAG_SESSION_TIMER_REF()
- *
- * @sa NUTAG_SUPPORTED(), NUTAG_MIN_SE(), NUTAG_SESSION_REFRESHER(),
- * nua_invite(), #nua_r_invite, #nua_i_invite, nua_respond(), 
- * nua_update(), #nua_r_update, #nua_i_update, 
- * NUTAG_UPDATE_REFRESH(), @RFC4028, @SessionExpires, @MinSE
- */
 #define NUTAG_SESSION_TIMER(x)  nutag_session_timer, tag_uint_v((x))
 SOFIAPUBVAR tag_typedef_t nutag_session_timer;
-
 #define NUTAG_SESSION_TIMER_REF(x) nutag_session_timer_ref, tag_uint_vr((&(x)))
 SOFIAPUBVAR tag_typedef_t nutag_session_timer_ref;
 
-/** Minimum acceptable refresh interval for session.
- *
- * Specifies the value of @MinSE header in seconds. The @b Min-SE header is
- * used to specify minimum acceptable refresh interval for session timer
- * extension.
- *
- * @par Used with
- *    nua_handle(), nua_invite(), nua_update(), nua_respond() \n
- *    nua_set_params() or nua_set_hparams() \n
- *    nua_get_params() or nua_get_hparams()
- *
- * See nua_set_hparams() for a complete list of the nua operations that
- * accept this tag.
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    interval in seconds.
- *
- * Corresponding tag taking reference parameter is NUTAG_MIN_SE_REF()
- *
- * @sa NUTAG_SESSION_TIMER(), NUTAG_SESSION_REFRESHER(),
- * NUTAG_UPDATE_REFRESH(), @RFC4028, @MinSE, @SessionExpires
- */
 #define NUTAG_MIN_SE(x)         nutag_min_se, tag_uint_v((x))
 SOFIAPUBVAR tag_typedef_t nutag_min_se;
-
 #define NUTAG_MIN_SE_REF(x)     nutag_min_se_ref, tag_uint_vr((&(x)))
 SOFIAPUBVAR tag_typedef_t nutag_min_se_ref;
 
@@ -614,779 +173,170 @@
   nua_any_refresher		/**< No preference (default). */
 };
 
-/**Specify the preferred refresher.
- *
- * Specify for session timer extension which party is the preferred refresher.
- *
- * @par Used with
- *    nua_handle(), nua_invite(), nua_update(), nua_respond() \n
- *    nua_set_params() or nua_set_hparams() \n
- *    nua_get_params() or nua_get_hparams()
- *
- * See nua_set_hparams() for a complete list of all the nua operations that
- * accept this tag.
- *
- * @par Parameter type
- *   enum { #nua_no_refresher,  #nua_local_refresher, #nua_remote_refresher,
- *          #nua_any_refresher }
- *
- * @par Values
- *    @c nua_no_refresher (session timers are disabled) \n
- *    @c nua_local_refresher \n
- *    @c nua_remote_refresher \n
- *    @c nua_any_refresher (default) \n
- *
- * Corresponding tag taking reference parameter is
- * NUTAG_SESSION_REFRESHER_REF()
- *
- * @sa NUTAG_SESSION_TIMER(), NUTAG_MIN_SE_REF(),
- * NUTAG_UPDATE_REFRESH(), @RFC4028, @SessionExpires, @MinSE
- */
 #define NUTAG_SESSION_REFRESHER(x)  nutag_session_refresher, tag_int_v((x))
 SOFIAPUBVAR tag_typedef_t nutag_session_refresher;
-
 #define NUTAG_SESSION_REFRESHER_REF(x) nutag_session_refresher_ref, tag_int_vr((&(x)))
 SOFIAPUBVAR tag_typedef_t nutag_session_refresher_ref;
 
-/** Use UPDATE as refresh method.
- *
- * If this parameter is true and the remote endpoint has included UPDATE in
- * Allow header, the nua stack uses UPDATE instead of INVITE to refresh the 
- * session when using the session timer extension.
- *
- * Note that the session timer headers @SessionExpires and @MinSE are always
- * included in the UPDATE request and responses regardless of the value of
- * this tag.
- *
- * @par Used with
- *    nua_handle(), nua_invite(), nua_update(), nua_respond() \n
- *    nua_set_params() or nua_set_hparams() \n
- *    nua_get_params() or nua_get_hparams()
- *
- * See nua_set_hparams() for a complete list of all the nua operations that
- * accept this tag.
- *
- * @par Parameter type
- *    boolean
- *
- * @par Values
- *    @c 1 Use UPDATE \n
- *    @c 0 Use INVITE
- *
- * Corresponding tag taking reference parameter is NUTAG_UPDATE_REFRESH_REF()
- *
- * @sa #nua_r_update, NUTAG_SESSION_TIMER(), NUTAG_MIN_SE_REF(),
- * NUTAG_UPDATE_REFRESH(), @RFC4028, @SessionExpires, @MinSE
- */
 #define NUTAG_UPDATE_REFRESH(x)  nutag_update_refresh, tag_bool_v((x))
 SOFIAPUBVAR tag_typedef_t nutag_update_refresh;
-
 #define NUTAG_UPDATE_REFRESH_REF(x) nutag_update_refresh_ref, tag_bool_vr((&(x)))
 SOFIAPUBVAR tag_typedef_t nutag_update_refresh_ref;
 
-/** Send alerting (180 Ringing) automatically
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- *    @c 0   No automatic sending of "180 Ringing" \n
- *    @c !=0 "180 Ringing" sent automatically
- *
- * Corresponding tag taking reference parameter is NUTAG_AUTOALERT_REF()
- */
 #define NUTAG_AUTOALERT(x)      nutag_autoalert, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_autoalert;
-
 #define NUTAG_AUTOALERT_REF(x)  nutag_autoalert_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_autoalert_ref;
 
-/** ACK automatically
- *
- * If this parameter is true, ACK is sent automatically after receiving 2XX
- * series response to INVITE. Note that ACK is always sent automatically by
- * lower layers of the stack after receiving an error response 3XX, 4XX, 5XX
- * or 6XX.
- *
- * @par Used with
- *    nua_set_params(), nua_set_hparams(), \n
- *    nua_get_params(), nua_get_hparams(), \n
- *    nua_invite(), nua_ack(), nua_respond(), nua_update() \n
- *    nua_respond()
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- *    @c 0    No automatic sending of ACK \n
- *    @c !=0 ACK sent automatically
- *
- * Default value is NUTAG_AUTOACK(1).
- * 
- * Corresponding tag taking reference parameter is NUTAG_AUTOACK_REF()
- */
 #define NUTAG_AUTOACK(x)        nutag_autoack, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_autoack;
-
 #define NUTAG_AUTOACK_REF(x)    nutag_autoack_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_autoack_ref;
 
-/** Answer (with 200 Ok) automatically to incoming call.
- *
- * @par Used with
- *    nua_set_params(), nua_set_hparams() \n
- *    nua_get_params(), nua_get_hparams() \n
- *    nua_invite() \n
- *    nua_respond()
- *
- * @par Parameter type
- *    int (boolean)
- *
- * @par Values
- *    @c 0    No automatic sending of "200 Ok" \n
- *    @c !=0 "200 Ok" sent automatically
- *
- * Corresponding tag taking reference parameter is NUTAG_AUTOANSWER_REF()
- *
- * @note Requires that @soa is enabled with NUTAG_MEDIA_ENABLE(1).
- * 
- * @par Auto-Answer to Re-INVITE requests
- * By default, NUA tries to auto answer the re-INVITEs used to refresh the
- * session when the media is enabled. Set NUTAG_AUTOANSWER(0) on the call
- * handle (e.g., include the tag with nua_invite(), nua_respond()) in order
- * to disable the auto answer on re-INVITEs.
- *
- * @bug If the re-INVITE modifies the session (e.g., SDP contains offer that
- * adds video stream to the session), NUA auto-answers it if
- * NUTAG_AUTOANSWER(0) has not been set on the handle. It accepts or rejects
- * media based on the existing user SDP (set with SOATAG_USER_SDP(), for
- * example). It should auto-answer only session refresh request and let
- * application decide how to handle requests to modify the session.
- *
- * @sa NUTAG_MEDIA_ENABLE(), NUTAG_AUTOALERT(), NUTAG_AUTOACK().
- */
 #define NUTAG_AUTOANSWER(x)     nutag_autoanswer, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_autoanswer;
-
 #define NUTAG_AUTOANSWER_REF(x) nutag_autoanswer_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_autoanswer_ref;
 
-/** Enable incoming INVITE
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- *    @c 0   Incoming INVITE not enabled. NUA answers 403 Forbidden \n
- *    @c !=0 Incoming INVITE enabled
- *
- * Corresponding tag taking reference parameter is NUTAG_ENABLEINVITE_REF()
- */
 #define NUTAG_ENABLEINVITE(x)   nutag_enableinvite, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_enableinvite;
-
 #define NUTAG_ENABLEINVITE_REF(x) nutag_enableinvite_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_enableinvite_ref;
 
-/** Enable incoming MESSAGE
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- *    @c 0   Incoming MESSAGE not enabled. NUA answers 403 Forbidden \n
- *    @c !=0 Incoming MESSAGE enabled
- *
- * Corresponding tag taking reference parameter is NUTAG_ENABLEMESSAGE_REF()
- */
 #define NUTAG_ENABLEMESSAGE(x)  nutag_enablemessage, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_enablemessage;
-
 #define NUTAG_ENABLEMESSAGE_REF(x) nutag_enablemessage_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_enablemessage_ref;
 
-/** Enable incoming MESSAGE with To tag.
- *
- * Set this parameter if you want to chat with Windows Messenger.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- *    @c 0   False \n
- *    @c !=0 True
- *
- * Corresponding tag taking reference parameter is NUTAG_ENABLEMESSENGER_REF()
- */
 #define NUTAG_ENABLEMESSENGER(x)  nutag_enablemessenger, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_enablemessenger;
-
 #define NUTAG_ENABLEMESSENGER_REF(x) \
   nutag_enablemessenger_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_enablemessenger_ref;
 
 /* Start NRC Boston */
 
-/** Enable S/MIME
- *
- * @par Used with
- *    nua_create() \n
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *    boolean
- *
- * @par Values
- *    @c 0   S/MIME is Disabled \n
- *    @c !=0 S/MIME is Enabled
- *
- * Corresponding tag taking reference parameter is NUTAG_SMIME_ENABLE_REF()
- */
 #define NUTAG_SMIME_ENABLE(x)  nutag_smime_enable, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_smime_enable;
-
 #define NUTAG_SMIME_ENABLE_REF(x) nutag_smime_enable_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_smime_enable_ref;
 
-/** S/MIME Options
- *
- * This tag specifies the type of S/MIME security services requested
- * by the user.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params() \n
- *    nua_message()
- *
- * @par Parameter type
- *   int
- *
- * @par Values
- *   @c -1 (SM_ID_NULL) No security service needed \n
- *   @c  0 (SM_ID_CLEAR_SIGN) Clear signing \n
- *   @c  1 (SM_ID_SIGN) S/MIME signing \n
- *   @c  2 (SM_ID_ENCRYPT) S/MIME encryption
- *
- * Corresponding tag taking reference parameter is NUTAG_SMIME_OPT_REF()
- */
 #define NUTAG_SMIME_OPT(x)  nutag_smime_opt, tag_int_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_smime_opt;
-
 #define NUTAG_SMIME_OPT_REF(x) nutag_smime_opt_ref, tag_int_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_smime_opt_ref;
 
-/* End NRC Boston */
-
-/** S/MIME protection mode
- *
- * This tag specifies the protection mode of the SIP message by
- * S/MIME as requested by the user
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *   unsigned int
- *
- * @par Values
- *   @c -1 (SM_MODE_NULL) Unspecified \n
- *   @c  0 (SM_MODE_PAYLOAD_ONLY) SIP payload only \n
- *   @c  1 (SM_MODE_TUNNEL) SIP tunneling mode \n
- *   @c  2 (SM_MODE_SIPFRAG) SIPfrag protection
- *
- * Corresponding tag taking reference parameter is NUTAG_SMIME_PROTECTION_MODE_REF()
- */
 #define NUTAG_SMIME_PROTECTION_MODE(x) nutag_smime_protection_mode, tag_uint_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_smime_protection_mode;
-
 #define NUTAG_SMIME_PROTECTION_MODE_REF(x) \
            nutag_smime_protection_mode_ref, tag_uint_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_smime_protection_mode_ref;
 
-/** S/MIME digest algorithm
- *
- * This tag specifies the message digest algorithm to be used in S/MIME.
- *
- * @par Used with
- *    To be implemented
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_SMIME_MESSAGE_DIGEST_REF()
- */
 #define NUTAG_SMIME_MESSAGE_DIGEST(x) nutag_smime_message_digest, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_smime_message_digest;
-
 #define NUTAG_SMIME_MESSAGE_DIGEST_REF(x) \
             nutag_smime_message_digest_ref, tag_str_vr((&x))
 SOFIAPUBVAR tag_typedef_t nutag_smime_message_digest_ref;
 
-/** S/MIME signature algorithm
- *
- * This tag specifies the signature algorithm to be used in S/MIME.
- *
- * @par Used with
- *    To be implemented.
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_SMIME_SIGNATURE_REF()
- */
 #define NUTAG_SMIME_SIGNATURE(x) nutag_smime_signature, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_smime_signature;
-
 #define NUTAG_SMIME_SIGNATURE_REF(x) \
             nutag_smime_signature_ref, tag_str_vr((&x))
 SOFIAPUBVAR tag_typedef_t nutag_smime_signature_ref;
 
-/** S/MIME key encryption algorithm
- *
- * This tag specifies the key encryption algorithm to be used by S/MIME.
- *
- * @par Used with
- *    To be implemented
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_SMIME_KEY_ENCRYPTION_REF()
- */
 #define NUTAG_SMIME_KEY_ENCRYPTION(x) nutag_smime_key_encryption, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_smime_key_encryption;
-
 #define NUTAG_SMIME_KEY_ENCRYPTION_REF(x) \
           nutag_smime_key_encryption_ref, tag_str_vr((&x))
 SOFIAPUBVAR tag_typedef_t nutag_smime_key_encryption_ref;
 
-/** S/MIME message encryption algorithm
- *
- * This tag specifies the message encryption algorithm to be used in S/MIME.
- *
- * @par Used with
- *    To be implemented.
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_SMIME_MESSAGE_ENCRYPTION_REF()
- */
 #define NUTAG_SMIME_MESSAGE_ENCRYPTION(x) nutag_smime_message_encryption, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_smime_message_encryption;
-
 #define NUTAG_SMIME_MESSAGE_ENCRYPTION_REF(x) \
            nutag_smime_message_encryption_ref, tag_str_vr((&x))
 SOFIAPUBVAR tag_typedef_t nutag_smime_message_encryption_ref;
 
-/** x.500 certificate directory
- *
- * @par Used with
- *    nua_create()
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    NULL terminated pathname of directory containing agent.pem and cafile.pem files.
- *
- * Corresponding tag taking reference parameter is NUTAG_CERTIFICATE_DIR_REF()
- */
+/* End NRC Boston */
+
 #define NUTAG_CERTIFICATE_DIR(x) nutag_certificate_dir, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_certificate_dir;
-
 #define NUTAG_CERTIFICATE_DIR_REF(x) \
           nutag_certificate_dir_ref, tag_str_vr((&x))
 SOFIAPUBVAR tag_typedef_t nutag_certificate_dir_ref;
 
-/** Certificate phrase
- *
- * @par Used with
- *    Currently not processed by NUA
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_CERTIFICATE_PHRASE_REF()
- */
 #define NUTAG_CERTIFICATE_PHRASE(x) nutag_certificate_phrase, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_certificate_phrase;
-
 #define NUTAG_CERTIFICATE_PHRASE_REF(x) \
           nutag_certificate_phrase_ref, tag_str_vr((&x))
 SOFIAPUBVAR tag_typedef_t nutag_certificate_phrase_ref;
 
-/** Local SIPS url.
- *
- * The application can specify an alternative local address for
- * NUA user agent engine. Usually the alternative address is a
- * secure SIP URI (SIPS) used with TLS transport.
- *
- * @par Used with
- *    nua_create()
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_SIPS_URL_REF()
- */
 #define NUTAG_SIPS_URL(x)       nutag_sips_url, urltag_url_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_sips_url;
-
 #define NUTAG_SIPS_URL_REF(x)   nutag_sips_url_ref, urltag_url_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_sips_url_ref;
 
-/** Outbound proxy URL
- *
- * Same tag as NTATAG_DEFAULT_PROXY()
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params() \n
- *    nua_create()
- *
- * @par Parameter type
- *    url_string_t const * (either char const * or url_t *)
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_PROXY_REF()
- */
 #define NUTAG_PROXY(x)          NTATAG_DEFAULT_PROXY(x)
 #define NUTAG_PROXY_REF(x)      NTATAG_DEFAULT_PROXY_REF(x)
 #define nutag_proxy             ntatag_default_proxy
 
-
-/** Specify initial route set.
- *
- * The initial route set is used instead or or in addition to the outbound
- * proxy URL given by NUTAG_PROXY(). The NUTAG_INITIAL_ROUTE() accepts a
- * list of parsed @Route header structures, NUTAG_INITIAL_ROUTE_STR() an
- * unparsed string. 
- * 
- * If a tag list contains multiple NUTAG_INITIAL_ROUTE() or
- * NUTAG_INITIAL_ROUTE_STR() tags, the route set is constructed from them
- * all.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_set_hparams() \n
- *    any handle-specific nua call
- *
- * @par Parameter type
- *    sip_route_t const *
- *
- * @par Values
- *    Linked list of #sip_route_t structures
- *
- * Corresponding tag taking reference parameter is NUTAG_INITIAL_ROUTE_REF().
- *
- * @since @NEW_1_12_7.
- */
 #define NUTAG_INITIAL_ROUTE(x)     nutag_initial_route, siptag_route_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_initial_route;
-
 #define NUTAG_INITIAL_ROUTE_REF(x) nutag_initial_route_ref, siptag_route_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_initial_route_ref;
 
-
-/** Specify initial route set.
- *
- * The initial route set is used instead or or in addition to the outbound
- * proxy URL given by NUTAG_PROXY(). The NUTAG_INITIAL_ROUTE() accepts a
- * list of parsed @Route header structures, NUTAG_INITIAL_ROUTE_STR() a
- * unparsed string containing route URIs, quoted with <> and separated by
- * commas.
- *
- * Please note that the syntax requires <> around the @Route URIs if they
- * contain parameters, e.g., "lr". 
- *
- * If a tag list contains multiple NUTAG_INITIAL_ROUTE() or
- * NUTAG_INITIAL_ROUTE_STR() tags, the route set is constructed from them
- * all. 
- *
- * The initial route set can be reset with NUTAG_INITIAL_ROUTE(NULL).
- *
- * If a tag list of a request contains SIPTAG_ROUTE() or
- * SIPTAG_ROUTE_STR() tags, the resulting route set will contain first the
- * initial route entries followed by the route URIs given with the
- * SIPTAG_ROUTE()/SIPTAG_ROUTE_STR() tags.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_set_hparams() \n
- *    any handle-specific nua call
- *
- * @par Parameter type
- *    sip_route_t const *
- *
- * @par Values
- *    Linked list of #sip_route_t structures
- *
- * Corresponding tag taking reference parameter is NUTAG_INITIAL_ROUTE_STR_REF().
- *
- * @since @NEW_1_12_7.
- */
 #define NUTAG_INITIAL_ROUTE_STR(x)     nutag_initial_route_str, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_initial_route_str;
-
 #define NUTAG_INITIAL_ROUTE_STR_REF(x) nutag_initial_route_str_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_initial_route_str_ref;
 
-
-
-/** Registrar URL
- *
- * @par Used with
- *    nua_register()   \n
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *    url_string_t const * (either char const * or url_t *)
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_REGISTRAR_REF()
- */
 #define NUTAG_REGISTRAR(x)      nutag_registrar, urltag_url_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_registrar;
-
 #define NUTAG_REGISTRAR_REF(x)  nutag_registrar_ref, urltag_url_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_registrar_ref;
 
-/** Outbound option string.
- *
- * The outbound option string can specify how the NAT traversal is handled.
- * The option tokens are as follows:
- * - "gruuize": try to generate a GRUU contact from REGISTER response
- * - "outbound": use SIP outbound extension (off by default)
- * - "validate": validate registration behind a NAT by sending OPTIONS to self
- * - "natify": try to traverse NAT
- * - "use-rport": use rport to traverse NAT
- * - "options-keepalive": send periodic OPTIONS requests as keepalive messages
- *
- * An option token with "no-" or "not-" prefix turns the option off. For
- * example, if you want to try to traverse NATs but not to use OPTIONS
- * keepalive, use NUTAG_OUTBOUND("natify no-options-keepalive").
- * 
- * An empty string can be passed to let the stack choose the
- * default values for outbound usage (in the 1.12.5 release, the
- * defaults are: "gruuize no-outbound validate use-port options-keepalive").
- *
- * @note
- * Options string is used so that no new tags need to be added when the
- * outbound functionality changes.
- *
- * @par Used with
- *    nua_register()   \n
- *    nua_set_params() \n
- *    nua_get_params()
- *    nua_set_hparams() \n
- *    nua_get_hparams()
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_REF()
- */
 #define NUTAG_OUTBOUND(x)      nutag_outbound, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_outbound;
-
 #define NUTAG_OUTBOUND_REF(x)  nutag_outbound_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_outbound_ref;
 
 #if notyet
 
-/** Outbound proxy set 1.
- *
- * @par Used with
- *    nua_register()   \n
- *    nua_set_params() \n
- *    nua_get_params()
- *    nua_set_hparams() \n
- *    nua_get_hparams()
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET1_REF()
- */
 #define NUTAG_OUTBOUND_SET1(x)      nutag_outbound_set1, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_outbound_set1;
-
 #define NUTAG_OUTBOUND_SET1_REF(x)  nutag_outbound_set1_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_outbound_set1_ref;
 
-/** Outbound proxy set 2.
- *
- * @par Used with
- *    nua_register()   \n
- *    nua_set_params() \n
- *    nua_get_params()
- *    nua_set_hparams() \n
- *    nua_get_hparams()
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET2_REF()
- */
 #define NUTAG_OUTBOUND_SET2(x)      nutag_outbound_set2, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_outbound_set2;
-
 #define NUTAG_OUTBOUND_SET2_REF(x)  nutag_outbound_set2_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_outbound_set2_ref;
 
-/** Outbound proxy set 3.
- *
- * @par Used with
- *    nua_register()   \n
- *    nua_set_params() \n
- *    nua_get_params()
- *    nua_set_hparams() \n
- *    nua_get_hparams()
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET3_REF()
- */
 #define NUTAG_OUTBOUND_SET3(x)      nutag_outbound_set3, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_outbound_set3;
-
 #define NUTAG_OUTBOUND_SET3_REF(x)  nutag_outbound_set3_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_outbound_set3_ref;
 
-/** Outbound proxy set 4.
- *
- * @par Used with
- *    nua_register()   \n
- *    nua_set_params() \n
- *    nua_get_params()
- *    nua_set_hparams() \n
- *    nua_get_hparams()
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET4_REF()
- */
 #define NUTAG_OUTBOUND_SET4(x)      nutag_outbound_set4, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_outbound_set4;
-
 #define NUTAG_OUTBOUND_SET4_REF(x)  nutag_outbound_set4_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_outbound_set4_ref;
 
 #endif	/* ...notyet */
 
-/** Pointer to SIP parser structure
- *
- * @par Used with
- *    nua_create()
- *
- * @par Parameter type
- *    msg_mclass_t const *
- *
- * @par Values
- *    Pointer to an extended SIP parser.
- *
- * @sa msg_mclass_clone(), msg_mclass_insert_header()
- *
- * Corresponding tag taking reference parameter is NUTAG_SIP_PARSER_REF().
- */
 #define NUTAG_SIP_PARSER(x)     NTATAG_MCLASS(x)
 #define NUTAG_SIP_PARSER_REF(x) NTATAG_MCLASS_REF(x)
 
-/** Authentication data ("scheme" "realm" "user" "password")
- *
- * @par Used with
- *    nua_authenticate()
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    NULL terminated string of format: \n
- *    basic digest scheme:"realm":user:password  \n
- *    @b NOTE the double quotes around realm!
- *    For example: \n
- *	\code Digest:"nokia proxy":xyz:secret \endcode
- *
- * Corresponding tag taking reference parameter is NUTAG_AUTH_REF()
- */
 #define NUTAG_AUTH(x)		nutag_auth, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_auth;
-
 #define NUTAG_AUTH_REF(x)	    nutag_auth_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_auth_ref;
 
-/** Authentication caching policy
- *
- * @par Used with
- *    nua_set_params(), nua_set_hparams() \n
- *    nua_get_params(), nua_get_hparams() \n
- *    @NUA_HPARAM_CALLS 
- *
- * @par Parameter type
- *    enum nua_auth_cache
- *
- * @par Values
- *    - nua_auth_cache_dialog (0) - include credentials within dialog
- *    - nua_auth_cache_challenged (1) - include credentials only when 
- *                                      challenged
- *    
- * Corresponding tag taking reference parameter is NUTAG_AUTH_CACHE_REF().
- *
- * @NEW_1_12_6
- */
 #define NUTAG_AUTH_CACHE(x)   nutag_auth_cache, tag_int_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_auth_cache;
-
 #define NUTAG_AUTH_CACHE_REF(x) nutag_auth_cache_ref, tag_int_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_auth_cache_ref;
 
-/** Authentication caching policy. @NEW_1_12_6 */
+/** Authentication caching policy. @NEW_1_12_6. */
 enum nua_auth_cache {
   /** Include credentials within dialog (default) */
   nua_auth_cache_dialog = 0,
@@ -1395,612 +345,116 @@
   _nua_auth_cache_invalid
 };
 
-/** Keepalive interval in milliseconds.
- *
- * This setting applies to OPTIONS/STUN keepalives. See documentation 
- * for nua_register() for more detailed information.
- *
- * @par Used with
- *    nua_register()   \n
- *    nua_set_params() \n
- *    nua_get_params()
- *    nua_set_hparams() \n
- *    nua_get_hparams()
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values 
- *   - 0 - disable keepalives
- *   - 120000 - default value (120000 milliseconds, 120 seconds)
- *
- * Corresponding tag taking reference parameter is
- * NUTAG_KEEPALIVE_REF()
- */
 #define NUTAG_KEEPALIVE(x) nutag_keepalive, tag_uint_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_keepalive;
-
 #define NUTAG_KEEPALIVE_REF(x) nutag_keepalive_ref, tag_uint_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_keepalive_ref;
 
-/** Transport-level keepalive interval for streams.
- *
- * See documentation for nua_register() for more detailed information.
- *
- * @par Used with
- *    nua_register()   \n
- *    nua_set_params() \n
- *    nua_get_params()
- *    nua_set_hparams() \n
- *    nua_get_hparams()
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values 
- *
- * Transport-level keepalive interval for streams in milliseconds. If this
- * parameter specified, it takes presedence over value given in
- * NUTAG_KEEPALIVE().
- *
- * Corresponding tag taking reference parameter is
- * NUTAG_KEEPALIVE_STREAM_REF()
- *
- * @todo Actually pass NUTAG_KEEPALIVE_STREAM() to transport layer.
- */
 #define NUTAG_KEEPALIVE_STREAM(x) nutag_keepalive_stream, tag_uint_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_keepalive_stream;
-
 #define NUTAG_KEEPALIVE_STREAM_REF(x) \
 nutag_keepalive_stream_ref, tag_uint_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_keepalive_stream_ref;
 
-/** Lifetime of authentication data in seconds.
- *
- * @par Used with
- *    Currently not processed by NUA
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    @c 0   Use authentication data only for this handle \n
- *    @c !=0 Lifetime in seconds
- *
- * Corresponding tag taking reference parameter is NUTAG_AUTHTIME_REF()
- */
 #define NUTAG_AUTHTIME(x)	nutag_authtime, tag_uint_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_authtime;
-
 #define NUTAG_AUTHTIME_REF(x)	nutag_authtime_ref, tag_uint_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_authtime_ref;
 
-/**Display name for @Contact.
- *
- * Specify display name for the Contact header URI generated for
- * registration request and dialog-creating requests/responses.
- *
- * Note that display name is not included the request-URI when proxy
- * forwards the request towards user-agent.
- *
- * @par Used with
- *    nua_register(), nua_set_hparams(), nua_set_params().
- *    nua_invite(), nua_respond(), nua_subscribe(), nua_notify()
- *
- * @par Parameter type
- *    string (char *)
- *
- * @par Values
- *    Valid display name.
- *
- * @sa NUTAG_M_USERNAME(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES(),
- * NUTAG_CALLEE_CAPS().
- *
- * Corresponding tag taking reference parameter is NUTAG_M_DISPLAY_REF().
- *
- * @since New in @VERSION_1_12_2.
- */
 #define NUTAG_M_DISPLAY(x)   nutag_m_display, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_m_display;
-
 #define NUTAG_M_DISPLAY_REF(x) nutag_m_display_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_m_display_ref;
 
-/**Username prefix for @Contact.
- *
- * Specify username part for the Contact header URI generated for
- * registration request and dialog-creating requests/responses.
- *
- * Using username, application can make multiple registrations using
- * multiple identities, or it can distinguish between different logical
- * destinations.
- *
- * @par Used with
- *    nua_register(), nua_set_hparams(), nua_set_params().
- *    nua_invite(), nua_respond(), nua_subscribe(), nua_notify()
- *
- * @par Parameter type
- *    string (char *)
- *
- * @par Values
- *    Valid SIP username.
- *
- * @sa NUTAG_M_DISPLAY(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES(),
- * NUTAG_CALLEE_CAPS().
- *
- * Corresponding tag taking reference parameter is NUTAG_M_USERNAME_REF().
- *
- * @since New in @VERSION_1_12_2.
- */
 #define NUTAG_M_USERNAME(x)   nutag_m_username, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_m_username;
-
 #define NUTAG_M_USERNAME_REF(x) nutag_m_username_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_m_username_ref;
 
-/**URL parameters for @Contact.
- *
- * Specify URL parameters for the @Contact header URI generated for
- * registration request and dialog-creating requests/responses.
- *
- * Please note that some proxies may remove even the non-transport
- * parameters from the request-URI when they forward the request towards
- * user-agent.
- *
- * @par Used with
- *    nua_register(), nua_set_hparams(), nua_set_params(), 
- *    nua_invite(), nua_respond(), nua_subscribe(), nua_notify()
- *
- * @par Parameter type
- *    string (char *)
- *
- * @par Values
- *    Semicolon-separated URL parameters.
- *
- * @sa NUTAG_M_DISPLAY(), NUTAG_M_USERNAME(), NUTAG_M_FEATURES(),
- * NUTAG_CALLEE_CAPS().
- *
- * Corresponding tag taking reference parameter is NUTAG_M_PARAMS_REF().
- *
- * @since New in @VERSION_1_12_2.
- */
 #define NUTAG_M_PARAMS(x)   nutag_m_params, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_m_params;
-
 #define NUTAG_M_PARAMS_REF(x) nutag_m_params_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_m_params_ref;
 
-/**Header parameters for registration @Contact.
- *
- * Specify header parameters for the @Contact header generated for
- * registration request and dialog-creating requests/responses. Such header
- * parameters include "q", indicating preference for the @Contact URI, and
- * "expires", indicating the desired expiration time for the registration.
- *
- * Additional header parameters are typically media feature tags, specified in
- * @RFC3840. If NUTAG_CALLEE_CAPS(1) is specified, additional @Contact header
- * parameters are generated based on SDP capabilities and SIP @Allow header.
- *
- * When using the "outbound" extension option, the stack will also add
- * "+sip.instance" and "reg-id" header parameters to the @Contact.
- *
- * @par Used with
- *    nua_register(), nua_set_hparams(), nua_set_params()
- *
- * @par Parameter type
- *    string (char *)
- *
- * @par Values
- *    Semicolon-separated SIP header parameters.
- *
- * @sa NUTAG_M_DISPLAY(), NUTAG_M_USERNAME(), NUTAG_M_PARAMS(),
- * NUTAG_CALLEE_CAPS(), NUTAG_IDENTITY().
- *
- * Corresponding tag taking reference parameter is NUTAG_M_FEATURES_REF().
- *
- * @since New in @VERSION_1_12_2.
- */
 #define NUTAG_M_FEATURES(x)   nutag_m_features, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_m_features;
-
 #define NUTAG_M_FEATURES_REF(x) nutag_m_features_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_m_features_ref;
 
-/**NUA event.
- *
- * @deprecated
- *
- * @par Parameter type
- *    enum nua_event_e
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_EVENT_REF()
- */
 #define NUTAG_EVENT(x)          nutag_event, tag_int_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_event;
-
 #define NUTAG_EVENT_REF(x)      nutag_event_ref, tag_int_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_event_ref;
 
-/** Response status code
- *
- * @deprecated
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- * 100 - preliminary response, request is being processed by next hop \n
- * 1XX - preliminary response, request is being processed by UAS \n
- * 2XX - successful final response \n
- * 3XX - redirection error response \n
- * 4XX - client error response \n
- * 5XX - server error response \n
- * 6XX - global error response \n
- *
- * Corresponding tag taking reference parameter is NUTAG_STATUS_REF()
- */
 #define NUTAG_STATUS(x)         nutag_status, tag_uint_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_status;
-
 #define NUTAG_STATUS_REF(x)     nutag_status_ref, tag_uint_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_status_ref;
 
-/** Response phrase
- *
- * @deprecated
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values.
- *
- * Corresponding tag taking reference parameter is NUTAG_PHRASE_REF()
- */
 #define NUTAG_PHRASE(x)         nutag_phrase, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_phrase;
-
 #define NUTAG_PHRASE_REF(x)     nutag_phrase_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_phrase_ref;
 
-/** NUA Handle
- *
- * @deprecated
- *
- * @par Parameter type
- *    nua_handle_t *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_HANDLE_REF()
- */
 #define NUTAG_HANDLE(x)         nutag_handle, nutag_handle_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_handle;
-
 #define NUTAG_HANDLE_REF(x)     nutag_handle_ref, nutag_handle_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_handle_ref;
 
-/** Registration handle (used with requests and nua_respond()) (NOT YET IMPLEMENTED)
- *
- * When a new request is made or new call is responded, a new identity can
- * be selected with NUTAG_IDENTITY(). The identity comprises of @b From
- * header, initial route set, local contact header and media tags associated
- * with it, soa handle and so on. User can make multiple registrations using
- * multiple identities.
- *
- * @par Used with
- *    nua_invite()
- *
- * @par Parameter type
- *    nua_handle_t *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_IDENTITY_REF()
-*/
 #define NUTAG_IDENTITY(x)   nutag_identity, nutag_handle_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_identity;
-
 #define NUTAG_IDENTITY_REF(x) nutag_identity_ref, nutag_handle_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_identity_ref;
 
-/**Intance identifier.
- *
- * @par Used with
- *    nua_create(), nua_set_params(), nua_get_params(), 
- *    nua_register()
- *
- * @par Parameter type
- *    char const *
- *
- * @par Value
- *    urn:uuid string, a globally unique identifier for this user-agent
- *    instance.
- *
- * Corresponding tag taking reference parameter is NUTAG_INSTANCE_REF()
- */
 #define NUTAG_INSTANCE(x)        nutag_instance, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_instance;
-
 #define NUTAG_INSTANCE_REF(x)    nutag_instance_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_instance_ref;
 
-/** Refer reply handle (used with refer)
- *
- * When making a call in response to a REFER request [RFC3515] with
- * nua_invite(), the application can ask NUA to automatically generate
- * notifications about the call progress to the referrer. In order to
- * do that the application should pass to the stack the handle, which
- * it used to receive the REFER request. It should also pass the event
- * header object along with the handle using NUTAG_REFER_EVENT().
- *
- * @par Used with
- *    nua_invite()
- *
- * @par Parameter type
- *    nua_handle_t *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_NOTIFY_REFER_REF()
-*/
 #define NUTAG_NOTIFY_REFER(x)   nutag_notify_refer, nutag_handle_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_notify_refer;
-
 #define NUTAG_NOTIFY_REFER_REF(x) nutag_notify_refer_ref, nutag_handle_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_notify_refer_ref;
 
-/** Event used with automatic refer notifications.
- *
- * When creating a call in response to a REFER request [RFC3515]
- * the application can ask NUA to automatically generate notifications
- * about the call progress to the referrer. The #nua_i_refer event will
- * contain a suitable SIP event header for the notifications in the
- * NUTAG_REFER_EVENT() tag. The application should store the SIP event
- * header and when it makes the referred call, it should pass it back
- * to the stack again using the NUTAG_REFER_EVENT() tag.
- *
- * @par Used with
- *
- * @par Parameter type
- *    sip_event_t *
- *
- * @par Values
- *
- * Corresponding tag taking reference parameter is NUTAG_REFER_EVENT_REF()
- */
 #define NUTAG_REFER_EVENT(x)   nutag_refer_event, siptag_event_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_refer_event;
-
 #define NUTAG_REFER_EVENT_REF(x) nutag_refer_event_ref, siptag_event_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_refer_event_ref;
 
-/** Invite pauses referrer's handle.
- *
- * When creating a call in response to a REFER [RFC3515] request,
- * the application can ask that the original call will be muted
- * when the new call is connected by specifying NUTAG_REFER_PAUSE()
- * along with NUTAG_NOTIFY_REFER() as a parameter to nua_invite() call.
- *
- * @par Used with
- *    nua_invite()
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- *    @c 0   False \n
- *    @c !=0 True
- *
- * Corresponding tag taking reference parameter is NUTAG_REFER_PAUSE_REF()
- *
- * @deprecated Not implemented.
- */
 #define NUTAG_REFER_PAUSE(x)   nutag_refer_pause, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_refer_pause;
-
 #define NUTAG_REFER_PAUSE_REF(x) nutag_refer_pause_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_refer_pause_ref;
 
-/**User-Agent string.
- *
- * Indicate the User-Agent header used by the stack. The value set with this
- * tag is concatenated with the value indicating the stack name and version,
- * e.g., "sofia-sip/1.12.1" unless the stack name "sofia-sip" followed by
- * slash is already included in the string. The concatenated value is
- * returned in SIPTAG_USER_AGENT_STR() and NUTAG_USER_AGENT() when
- * nua_get_params() is called.
- *
- * If you want to set the complete string, use SIPTAG_USER_AGENT_STR() or
- * SIPTAG_USER_AGENT().
- *
- * @par Used with
- *    nua_set_params(), nua_set_hparams() \n
- *    nua_get_params(), nua_get_hparams(), #nua_r_get_params \n
- *    any handle-specific nua call
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    See @RFC3261 \n
- *    If NULL, stack uses default string which of format "sofia-sip/1.12".
- *
- * Corresponding tag taking reference parameter is NUTAG_USER_AGENT_REF()
- */
 #define NUTAG_USER_AGENT(x)     nutag_user_agent, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_user_agent;
-
 #define NUTAG_USER_AGENT_REF(x) nutag_user_agent_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_user_agent_ref;
 
-/** Allow a method (or methods).
- *
- * This tag is used to add a new method to the already existing set of
- * allowed methods. If you want to ignore the existing set of allowed
- * methods, use SIPTAG_ALLOW_STR() or SIPTAG_ALLOW().
- *
- * The set of allowed methods is added to the @Allow header in the response
- * or request messages. For incoming request, an error response <i>405
- * Method Not Allowed</i> is automatically returned if the incoming method
- * is not included in the set.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_set_hparams() \n
- *    any handle-specific nua call
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    Valid method name, or comma-separated list of them.
- *
- * Corresponding tag taking reference parameter is NUTAG_ALLOW_REF()
- */
 #define NUTAG_ALLOW(x)     nutag_allow, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_allow;
-
 #define NUTAG_ALLOW_REF(x) nutag_allow_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_allow_ref;
 
 
-/** Indicate that a method (or methods) are handled by application.
- *
- * This tag is used to add a new method to the already existing set of
- * methods handled by application, or clear the set. If you want to
- * determine the set explicitly, include NUTAG_APPL_METHOD() twice,
- * first with NULL and then with your supported set.
- *
- * The default set of application methods now include INVITE, REGISTER,
- * PUBLISH and SUBSCRIBE.
- *
- * If the request method is in the set of methods handled by application,
- * the nua stack does not automatically respond to the incoming request nor
- * it will automatically send such a request. Note if the application adds
- * the PRACK and UPDATE requests to the set of application methods it must
- * also take care for sending the PRACK and UPDATE requests during the call
- * setup when necessary.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_set_hparams() \n
- *    any handle-specific nua call
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    Valid method name, or comma-separated list of them.
- *
- * Corresponding tag taking reference parameter is NUTAG_APPL_METHOD_REF()
- *
- * @since Working since @VERSION_1_12_5. Handling of client-side PRACK and
- * UPDATE was fixed in @VERSION_1_12_6.
- */
 #define NUTAG_APPL_METHOD(x)     nutag_appl_method, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_appl_method;
-
 #define NUTAG_APPL_METHOD_REF(x) nutag_appl_method_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_appl_method_ref;
 
 
-/** Support a feature.
- *
- * This tag is used to add a new feature to the existing set of supported
- * SIP features. If you want to ignore the existing set of supported
- * features, use SIPTAG_SUPPORTED_STR() or SIPTAG_SUPPORTED().
- *
- * The set of supported features is added to the @Supported header in the
- * response or request messages. For incoming requests, an error response
- * <i>420 Bad Extension </i> is automatically returned if the request
- * requires features that are not included in the supported feature set.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_set_hparams() \n
- *    any handle-specific nua call
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    Feature name, or comma-separated list of them.
- *
- * Corresponding tag taking reference parameter is NUTAG_SUPPORTED_REF()
- *
- * @since New in @VERSION_1_12_2.
- */
 #define NUTAG_SUPPORTED(x)     nutag_supported, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_supported;
-
 #define NUTAG_SUPPORTED_REF(x) nutag_supported_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_supported_ref;
 
-/** Allow an event or events.
- *
- * This tag is used to add a new event to the already existing set of
- * allowed events. If you want to ignore the existing set of allowed events,
- * set the allowed event set with SIPTAG_ALLOW_EVENTS_STR() or
- * SIPTAG_ALLOW_EVENTS().
- *
- * The set of allowed methods is added to the @AllowEvents header in the
- * response to the SUBSCRIBE or PUBLISH requests. For incoming SUBSCRIBE or
- * PUBLISH request, an error response <i>489 Bad Event</i> is automatically
- * returned if the incoming method is not included in the set.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_set_hparams() \n
- *    any handle-specific nua call
- *
- * @par Parameter type
- *    char const *
- *
- * @par Values
- *    Valid event name, or comma-separated list of them.
- *
- * @sa @AllowEvents, @RFC3265, @RFC3903, #nua_i_subscribe, #nua_i_publish,
- * nua_subscribe(), nua_publish(), SIPTAG_ALLOW_EVENTS(),
- * SIPTAG_ALLOW_EVENTS_STR()
- *
- * @NEW_1_12_4.
- *
- * Corresponding tag taking reference parameter is NUTAG_ALLOW_EVENTS_REF()
- */
 #define NUTAG_ALLOW_EVENTS(x)     nutag_allow_events, tag_str_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_allow_events;
-
 #define NUTAG_ALLOW_EVENTS_REF(x) nutag_allow_events_ref, tag_str_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_allow_events_ref;
 
-/** Call state
- *
- * @par Used with
- *    #nua_i_state
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- * - #nua_callstate_init - Initial state
- * - #nua_callstate_authenticating - 401/407 received
- * - #nua_callstate_calling - INVITE sent
- * - #nua_callstate_proceeding - 18X received
- * - #nua_callstate_completing   - 2XX received
- * - #nua_callstate_received - INVITE received (and 100 Trying sent)
- * - #nua_callstate_early       - 18X sent
- * - #nua_callstate_completed   - 2XX sent
- * - #nua_callstate_ready       - 2XX and ACK received/sent
- * - #nua_callstate_terminating - BYE sent
- * - #nua_callstate_terminated  - BYE complete
- *
- * Corresponding tag taking reference parameter is NUTAG_CALLSTATE_REF()
- */
 #define NUTAG_CALLSTATE(x) nutag_callstate, tag_int_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_callstate;
-
 #define NUTAG_CALLSTATE_REF(x) nutag_callstate_ref, tag_int_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_callstate_ref;
 
@@ -2021,42 +475,8 @@
 /** Get name for NUA call state */
 SOFIAPUBFUN char const *nua_callstate_name(enum nua_callstate state);
 
-/**Subscription state.
- *
- * @par Used with
- *    #nua_notify() \n
- *    #nua_r_subscribe \n
- *    #nua_i_notify \n
- *    #nua_i_subscribe \n
- *    #nua_r_notify \n
- *    nua_notify() \n
- *    nua_respond() to SUBSCRIBE
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- *   - #nua_substate_embryonic (0)
- *   - #nua_substate_pending (1)
- *   - #nua_substate_active (2)
- *   - #nua_substate_terminated (3)
- *
- * Note that the @SubscriptionState or @Expires headers specified by
- * application overrides the subscription state specified by
- * NUTAG_SUBSTATE(). Application can terminate subscription by including
- * NUTAG_SUBSTATE(nua_substate_terminated), @SubscriptionState with value
- * "terminated" or @Expires header with value 0 in the NOTIFY request sent
- * by nua_notify().
- *
- * @sa @RFC3265, @SubscriptionState, SIPTAG_SUBSCRIPTION_STATE(),
- * SIPTAG_SUBSCRIPTION_STATE_STR(), #nua_r_subscribe, #nua_i_subscribe,
- * #nua_i_refer, #nua_r_notify, #nua_i_notify.
- *
- * Corresponding tag taking reference parameter is NUTAG_SUBSTATE_REF()
- */
 #define NUTAG_SUBSTATE(x) nutag_substate, tag_int_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_substate;
-
 #define NUTAG_SUBSTATE_REF(x) nutag_substate_ref, tag_int_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_substate_ref;
 
@@ -2077,273 +497,74 @@
 /** Convert string to enum nua_substate. @NEW_1_12_5. */
 SOFIAPUBFUN enum nua_substate nua_substate_make(char const *sip_substate);
 
-/**Send unsolicited NOTIFY request.
- *
- * Some applications may require sending unsolicited NOTIFY requests, that
- * is, NOTIFY without SUBSCRIBE or REFER request sent by event watcher. 
- * However, sending NOTIFY request requires an existing dialog usage by
- * default. If NUTAG_NEWSUB(1) is included in the nua_notify() the usage
- * is create the usage by itself.
- *
- * If you want to create a subscription that does not terminate immediately
- * include SIPTAG_SUBSCRIPTION_STATE_STR() with an "expires" parameter in
- * the argument list, too.
- *
- * @par Used with
- *    nua_notify()
- *
- * @par Parameter type
- *    int (boolean)
- *
- * @par Values
- *   - 0 - false (default) - do not create new subscription 
- *         but reject NOTIFY with 481 locally \n
- *   - 1 - true - create a subscription if it does not exist \n
- *
- * Corresponding tag taking reference parameter is NUTAG_NEWSUB().
- *
- * @since @NEW_1_12_5.
- */
 #define NUTAG_NEWSUB(x)   nutag_newsub, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_newsub;
-
 #define NUTAG_NEWSUB_REF(x) nutag_newsub_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_newsub_ref;
 
 
-/**Default lifetime for implicit subscriptions created by REFER.
- *
- * Default expiration time in seconds for implicit subscriptions created by
- * REFER.
- *
- * @par Used with
- *    nua_set_params() \n
- *    nua_get_params() \n
- *    nua_set_hparams() \n
- *    nua_get_hparams() \n
- *
- * @par Parameter type
- *    unsigned int
- *
- * @par Values
- *    @c 0  disable \n
- *    @c >0 interval in seconds
- *
- * Corresponding tag taking reference parameter is NUTAG_REFER_EXPIRES()
- */
 #define NUTAG_REFER_EXPIRES(x)  nutag_refer_expires, tag_uint_v((x))
 SOFIAPUBVAR tag_typedef_t nutag_refer_expires;
-
 #define NUTAG_REFER_EXPIRES_REF(x) nutag_refer_expires_ref, tag_uint_vr((&(x)))
 SOFIAPUBVAR tag_typedef_t nutag_refer_expires_ref;
 
-/**Always use id parameter with refer event.
- *
- * When an incoming REFER creates an implicit subscription, the event header
- * in the NOTIFY request may have an id parameter. The id parameter can be
- * either always included (default behavior), or the parameter can be used
- * only for the second and subsequent REFER requests received in a given
- * dialog.
- *
- * Note that once the subscription is created, the event header should not
- * be modified. Therefore this tag has no effect on already established
- * subscriptions, and its use makes sense largely on nua_set_params() only.
- *
- * @par Used with
- *    nua_set_params() (nua_set_hparams(), nua_invite(), nua_respond(),
- *    nua_update()).
- *
- * @par Parameter type
- *    int (boolean)
- *
- * @par Values
- *   0 (false, do not use id with subscription created with first REFER request) \n
- *   1 (true, use id with all subscriptions created with REFER request) \n
- *
- * Corresponding tag taking reference parameter is NUTAG_REFER_WITH_ID_REF().
- *
- * @since New in @VERSION_1_12_2.
- */
 #define NUTAG_REFER_WITH_ID(x)   nutag_refer_with_id, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_refer_with_id;
-
 #define NUTAG_REFER_WITH_ID_REF(x) nutag_refer_with_id_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_refer_with_id_ref;
 
-/**Add media tags from our offer to Accept-Contact headers.
- *
- * Automatically generate @AcceptContact headers for caller
- * preference processing according to our the media capabilities in @a soa.
- *
- * @par Used with
- *    nua_invite()  \n
- *    nua_update()  \n
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- *    @c 0   Do not add media tags \n
- *    @c !=0 Add media tags
- *
- * Corresponding tag taking reference parameter is NUTAG_MEDIA_FEATURES_REF()
- *
- * @sa nua_invite(), SOATAG_USER_SDP(), SIPTAG_ACCEPT_CONTACT(),
- *     NUTAG_CALLEE_CAPS()
- */
 #define NUTAG_MEDIA_FEATURES(x) nutag_media_features, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_media_features;
-
 #define NUTAG_MEDIA_FEATURES_REF(x) \
           nutag_media_features_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_media_features_ref;
 
-/** Add methods and media tags to Contact headers. */
 #define NUTAG_CALLEE_CAPS(x) nutag_callee_caps, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_callee_caps;
-
 #define NUTAG_CALLEE_CAPS_REF(x) \
           nutag_callee_caps_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_callee_caps_ref;
 
-/** If true, add "path" to Supported in REGISTER.
- *
- * @sa <a href="http://www.ietf.org/rfc/rfc3327.txt">RFC 3327</a>,
- * <i>"SIP Extension Header Field for Registering Non-Adjacent Contacts"</i>,
- * D. Willis, B. Hoeneisen,
- * December 2002.
- */
 #define NUTAG_PATH_ENABLE(x)   nutag_path_enable, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_path_enable;
-
 #define NUTAG_PATH_ENABLE_REF(x) nutag_path_enable_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_path_enable_ref;
 
-/** Use route from Service-Route header in response to REGISTER.
- *
- * @sa <a href="http://www.ietf.org/rfc/rfc3327.txt">RFC 3327</a>,
- * <i>"SIP Extension Header Field for Registering Non-Adjacent Contacts"</i>,
- * D. Willis, B. Hoeneisen,
- * December 2002.
- */
 #define NUTAG_SERVICE_ROUTE_ENABLE(x) nutag_service_route_enable, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_service_route_enable;
-
 #define NUTAG_SERVICE_ROUTE_ENABLE_REF(x) \
           nutag_service_route_enable_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_service_route_enable_ref;
 
-/** Enable built-in media session handling
- *
- * The built-in media session object @soa takes care of most details
- * of offer-answer negotiation. 
- *
- * @par Used with
- *    nua_create()
- *
- * @par Parameter type
- *    int
- *
- * @par Values
- *    @c 0   False \n
- *    @c !=0 True
- *
- * Corresponding tag taking reference parameter is NUTAG_MEDIA_ENABLE_REF()
-*/
 #define NUTAG_MEDIA_ENABLE(x) nutag_media_enable, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_media_enable;
-
 #define NUTAG_MEDIA_ENABLE_REF(x) \
           nutag_media_enable_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_media_enable_ref;
 
-/** Indicate that SDP offer has been received.
- *
- * @par Used with
- *    #nua_i_state
- *
- * @par Parameter type
- *    boolean
- *
- * Corresponding tag taking reference parameter is NUTAG_OFFER_RECV_REF()
- */
 #define NUTAG_OFFER_RECV(x) nutag_offer_recv, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_offer_recv;
-
 #define NUTAG_OFFER_RECV_REF(x) nutag_offer_recv_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_offer_recv_ref;
 
-/** Indicate that SDP answer has been received.
- *
- * @par Used with
- *    #nua_i_state
- *
- * @par Parameter type
- *    boolean
- *
- * Corresponding tag taking reference parameter is NUTAG_ANSWER_RECV_REF()
- */
 #define NUTAG_ANSWER_RECV(x) nutag_answer_recv, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_answer_recv;
-
 #define NUTAG_ANSWER_RECV_REF(x) nutag_answer_recv_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_answer_recv_ref;
 
-/** Indicate that SDP offer has been sent.
- *
- * @par Used with
- *    #nua_i_state
- *
- * @par Parameter type
- *    boolean
- *
- * Corresponding tag taking reference parameter is NUTAG_OFFER_SENT_REF()
- */
 #define NUTAG_OFFER_SENT(x) nutag_offer_sent, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_offer_sent;
-
 #define NUTAG_OFFER_SENT_REF(x) nutag_offer_sent_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_offer_sent_ref;
 
-/** Indicate that SDP answer has been sent.
- *
- * @par Used with
- *    #nua_i_state
- *
- * @par Parameter type
- *    int (boolean: nonzero is true, zero is false)
- *
- * Corresponding tag taking reference parameter is NUTAG_ANSWER_SENT_REF()
- */
 #define NUTAG_ANSWER_SENT(x) nutag_answer_sent, tag_bool_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_answer_sent;
-
 #define NUTAG_ANSWER_SENT_REF(x) nutag_answer_sent_ref, tag_bool_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_answer_sent_ref;
 
-/**Enable detection of local IP address updates.
- *
- * @par Used with
- *    nua_create() \n
- *    nua_set_params() \n
- *    nua_get_params()
- *
- * @par Parameter type
- *    int (enum nua_nw_detector_e aka #nua_nw_detector_t)
- *
- * @sa #nua_i_network_changed, #nua_nw_detector_t
- *
- * Corresponding tag taking reference parameter is
- * NUTAG_DETECT_NETWORK_UPDATES_REF().
- *
- * @since New in @VERSION_1_12_2.
- */
 #define NUTAG_DETECT_NETWORK_UPDATES(x) \
           nutag_detect_network_updates, tag_int_v(x)
 SOFIAPUBVAR tag_typedef_t nutag_detect_network_updates;
-
 #define NUTAG_DETECT_NETWORK_UPDATES_REF(x) \
           nutag_detect_network_updates_ref, tag_int_vr(&(x))
 SOFIAPUBVAR tag_typedef_t nutag_detect_network_updates_ref;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_100rel.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_100rel.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_100rel.c	Thu Oct 11 10:16:59 2007
@@ -550,6 +550,7 @@
 }
 
 int respond_483_to_prack(CONDITION_PARAMS);
+static int prack_100rel(CONDITION_PARAMS);
 
 int test_183rel(struct context *ctx)
 {
@@ -681,13 +682,14 @@
   if (print_headings)
     printf("TEST NUA-10.2.2: graceful termination because PRACK fails\n");
 
+  nua_set_hparams(a_call->nh, NUTAG_APPL_METHOD("PRACK"), TAG_END());
   nua_set_hparams(b_call->nh, NUTAG_APPL_METHOD("PRACK"),
 		  NUTAG_AUTOANSWER(0), TAG_END());
-  run_b_until(ctx, nua_r_set_params, NULL);
+  run_ab_until(ctx, nua_r_set_params, NULL, nua_r_set_params, NULL);
 
   INVITE(a, a_call, a_call->nh, TAG_END());
 
-  run_ab_until(ctx, -1, until_terminated, -1, respond_483_to_prack);
+  run_ab_until(ctx, -1, prack_100rel, -1, respond_483_to_prack);
 
   /* Client transitions:
      INIT -(C1)-> CALLING: nua_invite(), nua_i_state
@@ -790,6 +792,29 @@
   END();
 }
 
+static int prack_100rel(CONDITION_PARAMS)
+{
+  if (!check_handle(ep, call, nh, SIP_500_INTERNAL_SERVER_ERROR))
+    return 0;
+
+  save_event_in_list(ctx, event, ep, call);
+
+  if (event == nua_r_invite && 100 < status && status < 200 &&
+      sip_has_feature(sip->sip_require, "100rel")) {
+    sip_rack_t rack[1];
+
+    sip_rack_init(rack);
+    rack->ra_response = sip->sip_rseq->rs_response;
+    rack->ra_cseq = sip->sip_cseq->cs_seq;
+    rack->ra_method = sip->sip_cseq->cs_method;
+    rack->ra_method_name = sip->sip_cseq->cs_method_name;
+
+    nua_prack(nh, SIPTAG_RACK(rack), TAG_END());
+  }
+
+  return event == nua_i_state && callstate(tags) == nua_callstate_terminated;
+}
+
 int respond_483_to_prack(CONDITION_PARAMS)
 {
   if (!(check_handle(ep, call, nh, SIP_500_INTERNAL_SERVER_ERROR)))

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.c	Thu Oct 11 10:16:59 2007
@@ -338,6 +338,8 @@
 
   retval |= test_nua_params(ctx); SINGLE_FAILURE_CHECK();
 
+  retval |= test_nua_destroy(ctx); SINGLE_FAILURE_CHECK();
+
   retval |= test_nua_init(ctx, o_iproxy, o_proxy, o_inat,
 			  TESTNATTAG_SYMMETRIC(o_inat_symmetric),
 			  TESTNATTAG_LOGGING(o_inat_logging),

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.h	Thu Oct 11 10:16:59 2007
@@ -327,6 +327,7 @@
 int test_deinit(struct context *ctx);
 
 int test_nua_api_errors(struct context *ctx);
+int test_nua_destroy(struct context *ctx);
 int test_stack_errors(struct context *ctx);
 int test_tag_filter(void);
 int test_nua_params(struct context *ctx);

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_api.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_api.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_api.c	Thu Oct 11 10:16:59 2007
@@ -34,6 +34,7 @@
 #include "config.h"
 
 #include "test_nua.h"
+#include "sofia-sip/tport_tag.h"
 
 #if HAVE_FUNC
 #elif HAVE_FUNCTION
@@ -71,9 +72,9 @@
   TEST(status, 200); TEST_S(phrase, sip_200_OK);
 
   su_log_init(nua_log);
+  level = nua_log->log_level;
   if (!(tstflags & tst_verbatim))
     su_log_set_level(nua_log, 0);  /* Log at level 0 by default */
-  level = nua_log->log_level;
 
   TEST_1(!nua_create(NULL, NULL, NULL, TAG_END()));
   TEST_VOID(nua_shutdown(NULL));
@@ -142,6 +143,61 @@
 
 /* ======================================================================== */
 
+void destroy_callback(nua_event_t event,
+		      int status, char const *phrase,
+		      nua_t *nua, struct context *ctx,
+		      nua_handle_t *nh, struct call *call,
+		      sip_t const *sip,
+		      tagi_t tags[])
+{
+  if (status >= 200) {
+    nua_destroy(ctx->a.nua), ctx->a.nua = NULL;
+    su_root_break(ctx->root);
+  }
+}
+
+/* Test different nua_destroy() corner cases */
+int test_nua_destroy(struct context *ctx)
+{
+  BEGIN();
+  
+  struct endpoint *a = &ctx->a;
+
+  TEST_1(ctx->root = su_root_create(NULL));
+
+#if 0
+  a->nua = nua_create(ctx->root, destroy_callback, ctx,
+		      NUTAG_URL("sip:0.0.0.0:*"),
+		      TAG_IF(ctx->a.logging, TPTAG_LOG(1)),
+		      TAG_END());
+  TEST_1(a->nua);
+
+  nua_get_params(a->nua, TAG_ANY(), TAG_END());
+
+  su_root_run(ctx->root);
+
+  TEST_1(a->nua == NULL);
+#endif
+
+  a->nua = nua_create(ctx->root, destroy_callback, ctx,
+		      NUTAG_URL("sip:0.0.0.0:*"),
+		      TAG_IF(ctx->a.logging, TPTAG_LOG(1)),
+		      TAG_END());
+  TEST_1(a->nua);
+
+  nua_shutdown(a->nua);
+
+  su_root_run(ctx->root);
+
+  TEST_1(a->nua == NULL);
+
+  su_root_destroy(ctx->root), ctx->root = NULL;
+
+  END();
+}
+
+/* ======================================================================== */
+
 int test_stack_errors(struct context *ctx)
 {
   BEGIN();

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_params.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_params.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_params.c	Thu Oct 11 10:16:59 2007
@@ -299,7 +299,7 @@
     sip_organization_t const *organization = NONE;
     char const *organization_str = "NONE";
 
-    sip_route_t *initial_route = NONE;
+    sip_route_t const *initial_route = NONE;
     char const *initial_route_str = NONE;
 
     char const *outbound = "NONE";

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_tag.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_tag.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file sdp_tag.c
  * @brief SDP Tags
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp.h	Thu Oct 11 10:16:59 2007
@@ -230,7 +230,7 @@
   sdp_media_control,			/**< Additional conference control */
   sdp_media_message,			/**< Messaging sessions*/
   sdp_media_image,			/**< Image browsing sessions for JPIP, and T.38 */
-  sdp_media_red				/**< Redundancy. @NEW_1_12_4 */
+  sdp_media_red				/**< Redundancy. @NEW_1_12_4. */
 } sdp_media_e;
 
 /** Media transport protocol. */
@@ -241,7 +241,7 @@
   sdp_proto_udp = 17,			/**< Plain UDP */
   sdp_proto_rtp = 256,			/**< RTP/AVP */
   sdp_proto_srtp = 257,			/**< RTP/SAVP  */
-  sdp_proto_udptl = 258,		/**< UDPTL. @NEW_1_12_4  */
+  sdp_proto_udptl = 258,		/**< UDPTL. @NEW_1_12_4. */
   sdp_proto_tls = 511,			/**< TLS over TCP */
   sdp_proto_any = 512		        /**< * wildcard */
 } sdp_proto_e;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/ADD-A-HEADER
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/ADD-A-HEADER	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/ADD-A-HEADER	Thu Oct 11 10:16:59 2007
@@ -1,13 +1,11 @@
-Description of Adding a SIP Header to Sofia SIP
-===============================================
+Adding a SIP Header to Sofia SIP
+================================
 
-by Pekka Pessi (2002-08-16, updated 2006-10-03)
+by Pekka Pessi (2002-08-16, last updated 2007-09-19)
 
-There are three ways to extend the Sofia SIP parser, including a standard
-header in sip_t structure, including a standard header in extra headers or
-putting the extension headers into a separate library.
-
-Probalem with extending #sip_t is that it breaks binary compatibility.
+There are two recommended ways to extend the Sofia SIP parser, including a
+standard header in extra headers or putting the extension headers into a
+separate library.
 
 In the text below, we use "Example" header as our example with following
 ABNF:
@@ -18,30 +16,18 @@
 IF YOUR HEADER IS A STANDARD ONE
 --------------------------------
 
-  * In <sip.h>, add:
+  * In <sofia-sip/sip_extra.h>, add:
 
   - Add typedef to the header structure.
 
-    The typedefs to ordinary headers are in more or less alphabetic
-    order after typedef of sip_unknown_t. You should add a typedef line
-    like this:
+    You should add a typedef line like this:
 
      typedef struct sip_example_s sip_example_t;
 	
     Note that the typedefs are documented together with the
     implementation in the .c file.
 
-  - Add field to the sip_t structure (struct sip_s)
-    - Remember to add a comment containing the header name
-      after field for benefit of the AWK script autmatically generating
-      boilerplate functions and macros:
-      sip_example_t *sip_example; /**< Example */
-    - The AWK script msg_parser.awk automatically creates the default
-      prototypes and tags for the newly created header when the entry in
-      sip_t structure is formatted like to the example above. 
-      It will complain about mismatches between header name and field name.
-
-  * Add the actual header structure:
+ - Add the actual header structure:
 
     The header structure would look like below. The first field MUST be a
     sip_common_t structure, second field MUST be a pointer to next header
@@ -61,6 +47,21 @@
          unsigned long  ex_value;	    /**< Value of example. */
        };
 
+  * Add entry to sip_extra_headers.txt:
+   - In this case:
+     example @NEW_2_0 /* Example header */
+   - The first is the base C name used for functions and types related to 
+     the type. The AWK script msg_parser.awk automatically creates the
+     default prototypes and tags for the newly created header. It will
+     complain about mismatches between header name and the base name.
+
+   - If the entry is before #### DEFAULT HEADER LIST ENDS HERE #### 
+     the new header is added to the default parser
+   - If after, the new header is added only to the extended parser.
+
+   - The extended parser will be used after call to 
+     sip_update_default_mclass(NULL)
+
   * Write parsing tests for your new headers in torture_sip.c:
 
     Add all relevant parsing/processing cases you can think of
@@ -86,8 +87,10 @@
   * Run "make check" after you are ready. Really.
 
 
-IF YOUR HEADERS ARE NON-STANDARD
---------------------------------
+IF YOUR HEADERS ARE COMPLETELY NON-STANDARD
+-------------------------------------------
+
+  * Add a separate library package for them
 
     - There is an example package sofia-sip-2543.tar.gz, available from
       sofia-sip.sourceforge.net
@@ -147,6 +150,3 @@
 
 #endif /** !defined(SIP_EXAMPLE_H) */
 --->8---->8---->8---->8---->8---->8---->8---->8---->8---->8---->8---->8---
-
-
-

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/Makefile.am	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/Makefile.am	Thu Oct 11 10:16:59 2007
@@ -148,4 +148,5 @@
 		PACKAGE_VERSION="${PACKAGE_VERSION}" \
 		TEMPLATE1=${srcdir}/sofia-sip/sip_hclasses.h.in \
 		TEMPLATE2=${srcdir}/sofia-sip/sip_protos.h.in \
+		TEMPLATE3=${srcdir}/sofia-sip/sip_tag.h.in \
 		TEMPLATE=${srcdir}/sofia-sip/sip_extra.h.in ${EXTRA}

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip.doxyaliases
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip.doxyaliases	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip.doxyaliases	Thu Oct 11 10:16:59 2007
@@ -69,4 +69,6 @@
  "ReplyTo=@ref sip_reply_to \"Reply-To\"" \
  "SuppressBodyIfMatch=@ref sip_suppress_body_if_match \"Suppress-Body-If-Match\"" \
  "SuppressNotifyIfMatch=@ref sip_suppress_notify_if_match \"Suppress-Notify-If-Match\"" \
-  
+ "RemotePartyID=@ref sip_remote_party_id \"Remote-Party-ID\"" \  
+ "PAssertedIdentity=@ref sip_p_asserted_identity \"P-Asserted-Identity\"" \  
+ "PPreferredIdentity=@ref sip_p_preferred_identity \"P-Preferred-Identity\"" \  

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c	Thu Oct 11 10:16:59 2007
@@ -123,7 +123,7 @@
 /**Parse @ref sip_request "request line" from a a SIP message. */
 issize_t sip_request_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
 {
-  sip_request_t *rq = h->sh_request;
+  sip_request_t *rq = (sip_request_t *)h;
   char *uri, *version;
 
   if (msg_firstline_d(s, &uri, &version) < 0 || !uri || !version ||
@@ -138,7 +138,7 @@
 /**Encode @ref sip_request "request line" of a a SIP message. */
 issize_t sip_request_e(char b[], isize_t bsiz, sip_header_t const *h, int flags)
 {
-  sip_request_t const *rq = h->sh_request;
+  sip_request_t const *rq = (sip_request_t *)h;
 
   return snprintf(b, bsiz, "%s " URL_FORMAT_STRING " %s" CRLF,
 		  rq->rq_method_name,
@@ -148,7 +148,7 @@
 
 isize_t sip_request_dup_xtra(sip_header_t const *h, isize_t offset)
 {
-  sip_request_t const *rq = h->sh_request;
+  sip_request_t const *rq = (sip_request_t *)h;
 
   offset += url_xtra(rq->rq_url);
   if (!rq->rq_method)
@@ -162,8 +162,8 @@
 char *sip_request_dup_one(sip_header_t *dst, sip_header_t const *src,
 			  char *b, isize_t xtra)
 {
-  sip_request_t *rq = dst->sh_request;
-  sip_request_t const *o = src->sh_request;
+  sip_request_t *rq = (sip_request_t *)dst;
+  sip_request_t const *o = (sip_request_t *)src;
   char *end = b + xtra;
 
   URL_DUP(b, end, rq->rq_url, o->rq_url);
@@ -224,7 +224,7 @@
 
   xtra = url_xtra(uri->us_url) + (method ? 0 : strlen(name) + 1);
 
-  rq = sip_header_alloc(home, sip_request_class, xtra)->sh_request;
+  rq = (sip_request_t *)sip_header_alloc(home, sip_request_class, xtra);
 
   if (rq) {
     char *b = (char *)(rq + 1), *end = b + xtra;
@@ -298,7 +298,7 @@
 /** Parse status line */
 issize_t sip_status_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
 {
-  sip_status_t *st = h->sh_status;
+  sip_status_t *st = (sip_status_t *)h;
   char *status, *phrase;
   unsigned long code;
 
@@ -315,25 +315,26 @@
 
 issize_t sip_status_e(char b[], isize_t bsiz, sip_header_t const *h, int flags)
 {
+  sip_status_t const *st = (sip_status_t *)h;
   int status;
 
   assert(sip_is_status(h));
 
-  status = h->sh_status->st_status;
+  status = st->st_status;
 
   if (status > 999 || status < 100)
     status = 0;
 
   return snprintf(b, bsiz, "%s %03u %s" CRLF,
-		  h->sh_status->st_version,
+		  st->st_version,
 		  status,
-		  h->sh_status->st_phrase);
+		  st->st_phrase);
 }
 
 /** Extra size of a #sip_status_t object. */
 isize_t sip_status_dup_xtra(sip_header_t const *h, isize_t offset)
 {
-  sip_status_t const *st = h->sh_status;
+  sip_status_t const *st = (sip_status_t *)h;
   offset += sip_version_xtra(st->st_version);
   offset += MSG_STRING_SIZE(st->st_phrase);
   return offset;
@@ -343,8 +344,8 @@
 char *sip_status_dup_one(sip_header_t *dst, sip_header_t const *src,
 			 char *b, isize_t xtra)
 {
-  sip_status_t *st = dst->sh_status;
-  sip_status_t const *o = src->sh_status;
+  sip_status_t *st = (sip_status_t *)dst;
+  sip_status_t const *o = (sip_status_t *)src;
   char *end = b + xtra;
 
   sip_version_dup(&b, &st->st_version, o->st_version);
@@ -386,7 +387,7 @@
   if (phrase == NULL && (phrase = sip_status_phrase(status)) == NULL)
     phrase = "";
 
-  if ((st = sip_header_alloc(home, sip_status_class, 0)->sh_status)) {
+  if ((st = (sip_status_t *)sip_header_alloc(home, sip_status_class, 0))) {
     st->st_status = status;
     st->st_phrase = phrase;
     st->st_version = version ? version : SIP_VERSION_CURRENT;
@@ -452,7 +453,7 @@
 {
   msg_hclass_t *hc = sip_payload_class;
   sip_header_t *h = sip_header_alloc(home, hc, len + 1);
-  sip_payload_t *pl = h->sh_payload;
+  sip_payload_t *pl = (sip_payload_t *)h;
 
   if (pl) {
     char *b = sip_header_data(h);
@@ -512,8 +513,8 @@
  */
 sip_separator_t *sip_separator_create(su_home_t *home)
 {
-  sip_separator_t *sep = 
-    sip_header_alloc(home, sip_separator_class, 0)->sh_separator;
+  sip_separator_t *sep = (sip_separator_t *)
+    sip_header_alloc(home, sip_separator_class, 0);
 
   if (sep)
     strcpy(sep->sep_data, CRLF);
@@ -764,7 +765,7 @@
 			 int flags, 
 			 char const *display, 
 			 int brackets, url_t const url[],
-			 msg_param_t const params[], 
+			 msg_param_t const params[],
 			 char const *comment)
 {
   int const compact = MSG_IS_COMPACT(flags);
@@ -801,6 +802,63 @@
   return b - b0;
 }
 
+/** Calculate the extra size needed to duplicate a name-addr-params construct.
+ *
+ * @param display  display name (may be NULL)
+ * @param addr     pointer to URL structure
+ * @param params   pointer to parameter list (may be NULL)
+ * @param offset   base offset
+ *
+ * @retval Size of duplicated name-addr-params construct, including base offset.
+ *
+ * @NEW_1_12_7.
+ */
+isize_t sip_name_addr_xtra(char const *display, url_t const *addr,
+			   msg_param_t const params[],
+			   isize_t offset)
+{
+  SIP_PARAMS_SIZE(offset, params);
+  offset += SIP_STRING_SIZE(display);
+  offset += url_xtra(addr);
+  return offset;
+}
+
+/**Duplicate a name-addr-params construct.
+ *
+ * @param d_display value-result parameter for copied @e name (may be NULL)
+ * @param display   display name (may be NULL)
+ * @param d_addr    value-result parameter for copied @e address
+ * @param addr      pointer to URL address structure
+ * @param d_params value-result parameter for copied parameters (may be NULL)
+ * @param params   pointer to parameter list (may be NULL)
+ * @param b        pointer to memory pool
+ * @param xtra     size of the memory pool
+ *
+ * @retval End of the memory area used.
+ *
+ * @NEW_1_12_7.
+ */
+char *sip_name_addr_dup(char const **d_display, char const *display,
+			url_t *d_addr, url_t const *addr,
+			msg_param_t const **d_params, msg_param_t const params[],
+			char *b, isize_t xtra)
+{
+  char *end = b + xtra;
+
+  if (d_params)
+    b = msg_params_dup(d_params, params, b, xtra);
+
+  URL_DUP(b, end, d_addr, addr);
+
+  if (d_display)
+    MSG_STRING_DUP(b, *d_display, display);
+
+  assert(b <= end);
+
+  return b;
+}
+
+
 /** Parse @To or @From headers */
 static issize_t sip_addr_d(su_home_t *home,
 			   sip_header_t *h,
@@ -851,10 +909,11 @@
 {
   sip_addr_t const *a = (sip_addr_t const *)h;
 
-  MSG_PARAMS_SIZE(offset, a->a_params);
-  offset += MSG_STRING_SIZE(a->a_display);
-  offset += url_xtra(a->a_url);
-    
+  return sip_name_addr_xtra(a->a_display, 
+			    a->a_url,
+			    a->a_params,
+			    offset);
+
   return offset;
 }
 
@@ -866,15 +925,11 @@
 {
   sip_addr_t *a = (sip_addr_t *)dst;
   sip_addr_t const *o = (sip_addr_t *)src;
-  char *end = b + xtra;
-
-  b = msg_params_dup(&a->a_params, o->a_params, b, xtra);
-  MSG_STRING_DUP(b, a->a_display, o->a_display);
-  URL_DUP(b, end, a->a_url, o->a_url);
 
-  assert(b <= end);
-
-  return b;
+  return sip_name_addr_dup(&a->a_display, o->a_display,
+			   a->a_url, o->a_url,
+			   &a->a_params, o->a_params,
+			   b, xtra);
 }
 
 /** Update parameters in sip_addr_t object */
@@ -905,7 +960,7 @@
   h = sip_header_alloc(home, hc, n);    
 
   if (h) {
-    sip_addr_t *a = h->sh_to;
+    sip_addr_t *a = (sip_to_t *)h;
     char *s2 = sip_header_data(h);
 
     if ((size_t)url_dup(s2, n, a->a_url, us->us_url) == n)
@@ -997,7 +1052,7 @@
 		       char *s, 
 		       isize_t slen)
 {
-  sip_call_id_t *i = h->sh_call_id;
+  sip_call_id_t *i = (sip_call_id_t *)h;
   
   i->i_id = s; /* XXX - why not sip_word_at_word_d(&s); */
   i->i_hash = msg_hash_string(s);
@@ -1008,10 +1063,11 @@
 
 issize_t sip_call_id_e(char b[], isize_t bsiz, sip_header_t const *h, int flags)
 {
-  size_t n = strlen(h->sh_call_id->i_id);
+  sip_call_id_t const *i = (sip_call_id_t *)h;
+  size_t n = strlen(i->i_id);
 
   if (bsiz > n)
-    strcpy(b, h->sh_call_id->i_id);
+    strcpy(b, i->i_id);
 
   return (issize_t)n;
 }
@@ -1019,7 +1075,7 @@
 /** Extra size of a #sip_call_id_t object. */
 isize_t sip_call_id_dup_xtra(sip_header_t const *h, isize_t offset)
 {
-  sip_call_id_t const *i = h->sh_call_id;
+  sip_call_id_t const *i = (sip_call_id_t *)h;
   return offset + MSG_STRING_SIZE(i->i_id);
 }
 
@@ -1038,8 +1094,8 @@
 char *sip_call_id_dup_one(sip_header_t *dst, sip_header_t const *src,
 			  char *b, isize_t xtra)
 {
-  sip_call_id_t *i = dst->sh_call_id;
-  sip_call_id_t const *o = src->sh_call_id;
+  sip_call_id_t *i = (sip_call_id_t *)dst;
+  sip_call_id_t const *o = (sip_call_id_t *)src;
   char *end = b + xtra;
 
   MSG_STRING_DUP(b, i->i_id, o->i_id);
@@ -1072,7 +1128,7 @@
   sip_call_id_t *i;
   size_t xtra = su_guid_strlen + 1 + (domain ? strlen(domain) + 1 : 0);
 
-  i = sip_header_alloc(home, sip_call_id_class, xtra)->sh_call_id;
+  i = (sip_call_id_t *)sip_header_alloc(home, sip_call_id_class, xtra);
   
   if (i) {
     char *b;
@@ -1149,7 +1205,7 @@
 		    char *s,
 		    isize_t slen)
 {
-  sip_cseq_t *cs = h->sh_cseq;
+  sip_cseq_t *cs = (sip_cseq_t *)h;
 
   if (msg_uint32_d(&s, &cs->cs_seq) < 0)
     return -1;
@@ -1165,17 +1221,16 @@
 
 issize_t sip_cseq_e(char b[], isize_t bsiz, sip_header_t const *h, int flags)
 {
+  sip_cseq_t const *cs = (sip_cseq_t *)h;
+
   assert(sip_is_cseq(h));
 
-  return snprintf(b, bsiz, 
-		  "%u %s", 
-		  h->sh_cseq->cs_seq,
-		  h->sh_cseq->cs_method_name);
+  return snprintf(b, bsiz, "%u %s", cs->cs_seq, cs->cs_method_name);
 }
 
 isize_t sip_cseq_dup_xtra(sip_header_t const *h, isize_t offset)
 {
-  sip_cseq_t const *cs = h->sh_cseq;
+  sip_cseq_t const *cs = (sip_cseq_t *)h;
   if (!cs->cs_method)
     return offset + MSG_STRING_SIZE(cs->cs_method_name);
   else
@@ -1185,8 +1240,8 @@
 char *sip_cseq_dup_one(sip_header_t *dst, sip_header_t const *src,
 		       char *b, isize_t xtra)
 {
-  sip_cseq_t *cs = dst->sh_cseq;
-  sip_cseq_t const *o = src->sh_cseq;
+  sip_cseq_t *cs = (sip_cseq_t *)dst;
+  sip_cseq_t const *o = (sip_cseq_t *)src;
   char *end = b + xtra;
 
   if (!(cs->cs_method = o->cs_method))
@@ -1241,7 +1296,7 @@
 
   xtra = (method ? 0 : (strlen(method_name) + 1));
 
-  cs = sip_header_alloc(home, sip_cseq_class, xtra)->sh_cseq;
+  cs = (sip_cseq_t *)sip_header_alloc(home, sip_cseq_class, xtra);
   
   if (cs) {
     cs->cs_seq = seq;
@@ -1355,7 +1410,7 @@
 
 issize_t sip_contact_e(char b[], isize_t bsiz, sip_header_t const *h, int flags)
 {
-  sip_contact_t const *m = h->sh_contact;
+  sip_contact_t const *m = (sip_contact_t *)h;
   int always_lt_gt = MSG_IS_CANONIC(flags) && m->m_url->url_type != url_any;
 
   assert(sip_is_contact(h));
@@ -1369,30 +1424,26 @@
 
 isize_t sip_contact_dup_xtra(sip_header_t const *h, isize_t offset)
 {
-  sip_contact_t const *m = h->sh_contact;
-
-  MSG_PARAMS_SIZE(offset, m->m_params);
-  offset += MSG_STRING_SIZE(m->m_display);
-  offset += url_xtra(m->m_url);
-  offset += MSG_STRING_SIZE(m->m_comment);
+  sip_contact_t const *m = (sip_contact_t *)h;
 
-  return offset;
+  return sip_name_addr_xtra(m->m_display,
+			    m->m_url,
+			    m->m_params,
+			    offset)
+    + MSG_STRING_SIZE(m->m_comment);
 }
 
 char *sip_contact_dup_one(sip_header_t *dst, sip_header_t const *src,
 			  char *b, isize_t xtra)
 {
-  char *end = b + xtra;
-  sip_contact_t *m = dst->sh_contact;
-  sip_contact_t const *o = src->sh_contact;
+  sip_contact_t *m = (sip_contact_t *)dst;
+  sip_contact_t const *o = (sip_contact_t *)src;
 
-  b = msg_params_dup(&m->m_params, o->m_params, b, xtra);
-  MSG_STRING_DUP(b, m->m_display, o->m_display);
-  URL_DUP(b, end, m->m_url, o->m_url);
+  b = sip_name_addr_dup(&m->m_display, o->m_display,
+			m->m_url, o->m_url,
+			&m->m_params, o->m_params,
+			b, xtra);
   MSG_STRING_DUP(b, m->m_comment, o->m_comment);
-
-  assert(b <= end);
-
   return b;
 }
 
@@ -1515,8 +1566,8 @@
  */
 sip_content_length_t *sip_content_length_create(su_home_t *home, uint32_t n)
 {
-  sip_content_length_t *l = 
-    sip_header_alloc(home, sip_content_length_class, 0)->sh_content_length;
+  sip_content_length_t *l = (sip_content_length_t *)
+    sip_header_alloc(home, sip_content_length_class, 0);
   
   if (l)
     l->l_length = n;
@@ -1570,7 +1621,7 @@
 
 issize_t sip_date_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
 {
-  sip_date_t *date = h->sh_date;
+  sip_date_t *date = (sip_date_t *)h;
 
   if (msg_date_d((char const **)&s, &date->d_time) < 0 || *s)
     return -1;
@@ -1580,7 +1631,7 @@
 
 issize_t sip_date_e(char b[], isize_t bsiz, sip_header_t const *h, int f)
 {
-  sip_date_t const *date = h->sh_date;
+  sip_date_t const *date = (sip_date_t *)h;
 
   return msg_date_e(b, bsiz, date->d_time);
 }
@@ -1601,15 +1652,15 @@
  */
 sip_date_t *sip_date_create(su_home_t *home, sip_time_t date)
 {
-  sip_header_t *h = sip_header_alloc(home, sip_date_class, 0);
+  sip_date_t *d = (sip_date_t *)sip_header_alloc(home, sip_date_class, 0);
   
-  if (h) {
+  if (d) {
     if (date == 0)
       date = sip_now();
-    h->sh_date->d_time = date;
+    d->d_time = date;
   }
 
-  return h->sh_date;
+  return d;
 }
 
 /* ====================================================================== */
@@ -1651,7 +1702,7 @@
 
 issize_t sip_expires_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
 {
-  sip_expires_t *expires = h->sh_expires;
+  sip_expires_t *expires = (sip_expires_t *)h;
 
   if (msg_date_delta_d((char const **)&s, 
 		       &expires->ex_date, 
@@ -1663,7 +1714,7 @@
 
 issize_t sip_expires_e(char b[], isize_t bsiz, sip_header_t const *h, int f)
 {
-  sip_expires_t const *expires = h->sh_expires;
+  sip_expires_t const *expires = (sip_expires_t *)h;
 
   if (expires->ex_date)
     return msg_date_e(b, bsiz, expires->ex_date + expires->ex_delta);
@@ -1685,12 +1736,13 @@
  */
 sip_expires_t *sip_expires_create(su_home_t *home, sip_time_t delta)
 {
-  sip_header_t *h = sip_header_alloc(home, sip_expires_class, 0);
+  sip_expires_t *ex = (sip_expires_t *)
+    sip_header_alloc(home, sip_expires_class, 0);
 
-  if (h)
-    h->sh_expires->ex_delta = delta;
+  if (ex)
+    ex->ex_delta = delta;
 
-  return h->sh_expires;
+  return ex;
 }
 
 /* ====================================================================== */
@@ -1955,7 +2007,7 @@
 
 issize_t sip_retry_after_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
 {
-  sip_retry_after_t *af = h->sh_retry_after;
+  sip_retry_after_t *af = (sip_retry_after_t *)h;
 
   if ((msg_delta_d((char const **)&s, &af->af_delta) < 0) ||
       (*s == '(' && msg_comment_d(&s, &af->af_comment) == -1) ||
@@ -1974,7 +2026,7 @@
 
 issize_t sip_retry_after_e(char b[], isize_t bsiz, sip_header_t const *h, int f)
 {
-  sip_retry_after_t const *af = h->sh_retry_after;
+  sip_retry_after_t const *af = (sip_retry_after_t *)h;
   int const compact = MSG_IS_COMPACT(f);
   char *b0 = b, *end = b + bsiz;
 
@@ -2000,7 +2052,7 @@
 
 isize_t sip_retry_after_dup_xtra(sip_header_t const *h, isize_t offset)
 {
-  sip_retry_after_t const *af = h->sh_retry_after;
+  sip_retry_after_t const *af = (sip_retry_after_t *)h;
 
   MSG_PARAMS_SIZE(offset, af->af_params);
   offset += MSG_STRING_SIZE(af->af_comment);
@@ -2013,8 +2065,8 @@
 			      char *b,
 			      isize_t xtra)
 {
-  sip_retry_after_t *af = dst->sh_retry_after;
-  sip_retry_after_t const *o = src->sh_retry_after;
+  sip_retry_after_t *af = (sip_retry_after_t *)dst;
+  sip_retry_after_t const *o = (sip_retry_after_t *)src;
   char *end = b + xtra;
 
   b = msg_params_dup(&af->af_params, o->af_params, b, xtra);
@@ -2072,7 +2124,7 @@
 
 issize_t sip_any_route_e(char b[], isize_t bsiz, sip_header_t const *h, int flags)
 {
-  sip_route_t const *r = h->sh_route;
+  sip_route_t const *r = (sip_route_t *)h;
 
   return sip_name_addr_e(b, bsiz, flags, 
 			 r->r_display, 1, r->r_url, r->r_params, NULL);
@@ -2080,30 +2132,23 @@
 
 isize_t sip_any_route_dup_xtra(sip_header_t const *h, isize_t offset)
 {
-  sip_route_t const *r = h->sh_route;
-
-  MSG_PARAMS_SIZE(offset, r->r_params);
-  offset += MSG_STRING_SIZE(r->r_display);
-  offset += url_xtra(r->r_url);
-
-  return offset;
+  sip_route_t const *r = (sip_route_t *)h;
+  return sip_name_addr_xtra(r->r_display, 
+			    r->r_url,
+			    r->r_params,
+			    offset);
 }
 
 char *sip_any_route_dup_one(sip_header_t *dst, sip_header_t const *src,
 			    char *b,
 			    isize_t xtra)
 {
-  sip_route_t *r = dst->sh_route;
-  sip_route_t const *o = src->sh_route;
-  char *end = b + xtra;
-
-  b = msg_params_dup(&r->r_params, o->r_params, b, xtra);
-  MSG_STRING_DUP(b, r->r_display, o->r_display);
-  URL_DUP(b, end, r->r_url, o->r_url);
-    
-  assert(b <= end);
-
-  return b;
+  sip_route_t *r = (sip_route_t *)dst;
+  sip_route_t const *o = (sip_route_t *)src;
+  return sip_name_addr_dup(&r->r_display, o->r_display,
+			   r->r_url, o->r_url,
+			   &r->r_params, o->r_params,
+			   b, xtra);
 }
 
 #define sip_any_route_update NULL
@@ -2149,7 +2194,7 @@
   xtra = n_url + n_params + n_addr + (n_params || n_addr);
 
   h = sip_header_alloc(home, hc, xtra);
-  if ((rr = h->sh_record_route)) {
+  if ((rr = (sip_record_route_t *)h)) {
     b = sip_header_data(h);
     n = url_dup(b, n_url, rr->r_url, url);
     assert(n == n_url);
@@ -2519,7 +2564,7 @@
 issize_t sip_via_e(char b[], isize_t bsiz, sip_header_t const *h, int flags)
 {
   char *b0 = b, *end = b + bsiz;
-  sip_via_t const *v = h->sh_via;
+  sip_via_t const *v = (sip_via_t *)h;
 
   assert(sip_is_via(h));
 
@@ -2548,7 +2593,7 @@
 
 isize_t sip_via_dup_xtra(sip_header_t const *h, isize_t offset)
 {
-  sip_via_t const *v = h->sh_via;
+  sip_via_t const *v = (sip_via_t *)h;
 
   MSG_PARAMS_SIZE(offset, v->v_params);
   offset += sip_transport_xtra(v->v_protocol);
@@ -2563,8 +2608,8 @@
 char *sip_via_dup_one(sip_header_t *dst, sip_header_t const *src,
 		      char *b, isize_t xtra)
 {
-  sip_via_t *v = dst->sh_via;
-  sip_via_t const *o = src->sh_via;
+  sip_via_t *v = (sip_via_t *)dst;
+  sip_via_t const *o = (sip_via_t *)src;
   char *end = b + xtra;
 
   b = msg_params_dup(&v->v_params, o->v_params, b, xtra);
@@ -2679,7 +2724,7 @@
   via->v_host = host;
   via->v_port = port;
 
-  v = msg_header_dup_as(home, sip_via_class, (sip_header_t *)via)->sh_via;
+  v = (sip_via_t *)msg_header_dup_as(home, sip_via_class, (sip_header_t *)via);
 
   if (v) {
     char const *param;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra.c	Thu Oct 11 10:16:59 2007
@@ -219,7 +219,9 @@
  *
  * The parsed Alert-Info header is stored in #sip_alert_info_t structure.
  *
- * @NEW_1_12_7
+ * @NEW_1_12_7. In order to use @b Alert-Info header, 
+ * initialize the SIP parser with, e.g.,
+ * sip_update_default_mclass(sip_extend_mclass(NULL))
  */
 
 /**@ingroup sip_alert_info
@@ -239,7 +241,7 @@
  * };
  * @endcode
  *
- * @NEW_1_12_7
+ * @NEW_1_12_7.
  */
 
 msg_hclass_t sip_alert_info_class[] =
@@ -276,6 +278,12 @@
  * @endcode
  *
  * The parsed Reply-To header is stored in #sip_reply_to_t structure.
+ *
+ * @sa sip_update_default_mclass()
+ *
+ * @NEW_1_12_7. In order to use @b Reply-To header,
+ * initialize the SIP parser with, e.g.,
+ * sip_update_default_mclass(sip_extend_mclass(NULL)).
  */
 
 /**@ingroup sip_reply_to
@@ -336,11 +344,10 @@
 {
   sip_reply_to_t const *rplyto = (sip_reply_to_t const *)h;
 
-  MSG_PARAMS_SIZE(offset, rplyto->rplyto_params);
-  offset += MSG_STRING_SIZE(rplyto->rplyto_display);
-  offset += url_xtra(rplyto->rplyto_url);
-
-  return offset;
+  return sip_name_addr_xtra(rplyto->rplyto_display,
+			    rplyto->rplyto_url,
+			    rplyto->rplyto_params,
+			    offset);
 }
 
 /**@internal Duplicate one sip_reply_to_t object. */
@@ -349,15 +356,11 @@
 {
   sip_reply_to_t *rplyto = (sip_reply_to_t *)dst;
   sip_reply_to_t const *o = (sip_reply_to_t *)src;
-  char *end = b + xtra;
 
-  b = msg_params_dup(&rplyto->rplyto_params, o->rplyto_params, b, xtra);
-  MSG_STRING_DUP(b, rplyto->rplyto_display, o->rplyto_display);
-  URL_DUP(b, end, rplyto->rplyto_url, o->rplyto_url);
-
-  assert(b <= end);
-
-  return b;
+  return sip_name_addr_dup(&rplyto->rplyto_display, o->rplyto_display,
+			   rplyto->rplyto_url, o->rplyto_url,
+			   &rplyto->rplyto_params, o->rplyto_params,
+			   b, xtra);
 }
 
 /* ====================================================================== */
@@ -889,10 +892,10 @@
 {
   sip_call_info_t const *ci = h->sh_call_info;
 
-  MSG_PARAMS_SIZE(offset, ci->ci_params);
-  offset += url_xtra(ci->ci_url);
-
-  return offset;
+  return sip_name_addr_xtra(NULL,
+			    ci->ci_url,
+			    ci->ci_params,
+			    offset);
 }
 
 char *sip_info_dup_one(sip_header_t *dst,
@@ -902,14 +905,11 @@
 {
   sip_call_info_t *ci = dst->sh_call_info;
   sip_call_info_t const *o = src->sh_call_info;
-  char *end = b + xtra;
-
-  b = msg_params_dup(&ci->ci_params, o->ci_params, b, xtra);
-  URL_DUP(b, end, ci->ci_url, o->ci_url);
-
-  assert(b <= end);
 
-  return b;
+  return sip_name_addr_dup(NULL, NULL,
+			   ci->ci_url, o->ci_url,
+			   &ci->ci_params, o->ci_params,
+			   b, xtra);
 }
 
 /* ====================================================================== */
@@ -1047,3 +1047,319 @@
 }
 
 #endif
+
+#if SIP_HAVE_REMOTE_PARTY_ID
+
+/**@SIP_HEADER sip_remote_party_id Remote-Party-ID Header
+ *
+ * The syntax of the Remote-Party-ID header is described as follows:
+ * @code
+ *   Remote-Party-ID  = "Remote-Party-ID" HCOLON rpid *(COMMA rpid)
+ *
+ *   rpid             =  [display-name] LAQUOT addr-spec RAQUOT
+ *                                                 *(SEMI rpi-token)
+ *
+ *   rpi-token        = rpi-screen / rpi-pty-type /
+ *                       rpi-id-type / rpi-privacy / other-rpi-token
+ *
+ *   rpi-screen       = "screen" EQUAL ("no" / "yes")
+ *
+ *   rpi-pty-type     = "party" EQUAL ("calling" / "called" / token)
+ *
+ *   rpi-id-type      = "id-type" EQUAL ("subscriber" / "user" /
+ *                                                  "term"  / token)
+ *
+ *   rpi-privacy      = "privacy" EQUAL
+ *                      ( rpi-priv-element
+ *                        / (LDQUOT rpi-priv-element
+ *                          *(COMMA rpi-priv-element) RDQUOT) )
+ *
+ *   rpi-priv-element = ("full" / "name" / "uri" / "off" / token)
+ *                                      ["-" ( "network" / token )]
+ *
+ *   other-rpi-token  = ["-"] token [EQUAL (token / quoted-string)]
+ *
+ * @endcode
+ *
+ * @sa sip_update_default_mclass(), draft-ietf-sip-privacy-04.txt, @RFC3325
+ *
+ * @NEW_1_12_7. In order to use @b Remote-Party-ID header,
+ * initialize the SIP parser with, e.g.,
+ * sip_update_default_mclass(sip_extend_mclass(NULL)).
+ */
+
+/**@ingroup sip_remote_party_id
+ * @typedef typedef struct sip_remote_party_id_s sip_remote_party_id_t;
+ *
+ * The structure #sip_remote_party_id_t contains representation of SIP
+ * @RemotePartyID header.
+ *
+ * The #sip_remote_party_id_t is defined as follows:
+ * @code
+ * typedef struct sip_remote_party_id_s {
+ *   sip_common_t           rpid_common[1]; // Common fragment info
+ *   sip_remote_party_id_t *rpid_next;      // Link to next
+ *   char const        *rpid_display;       // Display name
+ *   url_t              rpid_url[1];        // URL
+ *   sip_param_t const *rpid_params;        // Parameters
+ *   // Shortcuts to screen, party, id-type and privacy parameters
+ *   char const        *rpid_screen, *rpid_party, *rpid_id_type, *rpid_privacy;
+ * } sip_remote_party_id_t;
+ * @endcode
+ */
+
+extern msg_xtra_f sip_remote_party_id_dup_xtra;
+extern msg_dup_f sip_remote_party_id_dup_one;
+
+static msg_update_f sip_remote_party_id_update;
+
+msg_hclass_t sip_remote_party_id_class[] =
+SIP_HEADER_CLASS(remote_party_id, "Remote-Party-ID", "",
+		 rpid_params, append, remote_party_id);
+
+issize_t sip_remote_party_id_d(su_home_t *home, sip_header_t *h,
+			       char *s, isize_t slen)
+{
+  sip_remote_party_id_t *rpid = (sip_remote_party_id_t *)h;
+
+  while (*s == ',')   /* Ignore empty entries (comma-whitespace) */
+    *s = '\0', s += span_lws(s + 1) + 1;
+
+  if (sip_name_addr_d(home, &s,
+		      &rpid->rpid_display,
+		      rpid->rpid_url,
+		      &rpid->rpid_params, NULL) == -1)
+    return -1;
+
+  return msg_parse_next_field(home, h, s, slen);
+}
+
+issize_t sip_remote_party_id_e(char b[], isize_t bsiz,
+			       sip_header_t const *h, int f)
+{
+  sip_remote_party_id_t const *rpid = (sip_remote_party_id_t *)h;
+
+  return sip_name_addr_e(b, bsiz, f,
+			 rpid->rpid_display, 1,
+			 rpid->rpid_url,
+			 rpid->rpid_params,
+			 NULL);
+}
+
+/** Calculate size of extra data required for duplicating one
+ *  sip_remote_party_id_t header. 
+ */
+isize_t sip_remote_party_id_dup_xtra(sip_header_t const *h, isize_t offset)
+{
+  sip_remote_party_id_t const *rpid = (sip_remote_party_id_t *)h;
+  return sip_name_addr_xtra(rpid->rpid_display, 
+			    rpid->rpid_url,
+			    rpid->rpid_params,
+			    offset);
+}
+
+/** Duplicate one sip_remote_party_id_t object */
+char *sip_remote_party_id_dup_one(sip_header_t *dst,
+				  sip_header_t const *src,
+				  char *b, isize_t xtra)
+{
+  sip_remote_party_id_t *rpid = (sip_remote_party_id_t *)dst;
+  sip_remote_party_id_t const *o = (sip_remote_party_id_t const *)src;
+
+  return sip_name_addr_dup(&rpid->rpid_display, o->rpid_display,
+			   rpid->rpid_url, o->rpid_url,
+			   &rpid->rpid_params, o->rpid_params,
+			   b, xtra);
+}
+
+static int sip_remote_party_id_update(msg_common_t *h, 
+				      char const *name, isize_t namelen,
+				      char const *value)
+{
+  sip_remote_party_id_t *rpid = (sip_remote_party_id_t *)h;
+
+  if (name == NULL) {
+    rpid->rpid_screen = NULL;
+    rpid->rpid_party = NULL;
+    rpid->rpid_id_type = NULL;
+    rpid->rpid_privacy = NULL;
+  }
+
+#define MATCH(s) (namelen == strlen(#s) && !strncasecmp(name, #s, strlen(#s)))
+
+  else if (MATCH(screen))
+    rpid->rpid_screen = value;
+  else if (MATCH(party))
+    rpid->rpid_party = value;
+  else if (MATCH(id-type))
+    rpid->rpid_id_type = value;
+  else if (MATCH(privacy))
+    rpid->rpid_privacy = value;
+
+#undef MATCH
+
+  return 0;
+}
+
+#endif
+
+#if SIP_HAVE_P_ASSERTED_IDENTITY
+
+/**@SIP_HEADER sip_p_asserted_identity P-Asserted-Identity Header
+ *
+ * The P-Asserted-Identity header is used used among trusted SIP entities
+ * (typically intermediaries) to carry the identity of the user sending a
+ * SIP message as it was verified by authentication. It is "defined" in
+ * @RFC3325 section 9.1 as follows:
+ *
+ * @code
+ *    PAssertedID = "P-Asserted-Identity" HCOLON PAssertedID-value
+ *                    *(COMMA PAssertedID-value)
+ *    PAssertedID-value = name-addr / addr-spec
+ * @endcode
+ *
+ * @sa @RFC3325, @PPreferredIdentity
+ *
+ * @NEW_1_12_7. In order to use @b P-Asserted-Identity header, 
+ * initialize the SIP parser with, e.g.,
+ * sip_update_default_mclass(sip_extend_mclass(NULL)).
+ */
+
+/**@ingroup sip_p_asserted_identity
+ * @typedef typedef struct sip_p_asserted_identity_s sip_p_asserted_identity_t;
+ *
+ * The structure #sip_p_asserted_identity_t contains representation of SIP
+ * @PAssertedIdentity header.
+ *
+ * The #sip_p_asserted_identity_t is defined as follows:
+ * @code
+ * typedef struct sip_p_asserted_identity_s {
+ *   sip_common_t           paid_common[1];   // Common fragment info
+ *   sip_p_asserted_identity_t *paid_next;    // Link to next
+ *   char const                *paid_display; // Display name
+ *   url_t                      paid_url[1];  // URL
+ * } sip_p_asserted_identity_t;
+ * @endcode
+ */
+
+static msg_xtra_f sip_p_asserted_identity_dup_xtra;
+static msg_dup_f sip_p_asserted_identity_dup_one;
+
+#define sip_p_asserted_identity_update NULL
+
+msg_hclass_t sip_p_asserted_identity_class[] =
+SIP_HEADER_CLASS(p_asserted_identity, "P-Asserted-Identity", "",
+		 paid_common, append, p_asserted_identity);
+
+issize_t sip_p_asserted_identity_d(su_home_t *home, sip_header_t *h,
+				   char *s, isize_t slen)
+{
+  sip_p_asserted_identity_t *paid = (sip_p_asserted_identity_t *)h;
+
+  while (*s == ',')   /* Ignore empty entries (comma-whitespace) */
+    *s = '\0', s += span_lws(s + 1) + 1;
+
+  if (sip_name_addr_d(home, &s,
+		      &paid->paid_display,
+		      paid->paid_url,
+		      NULL, NULL) == -1)
+    return -1;
+
+  return msg_parse_next_field(home, h, s, slen);
+}
+
+issize_t sip_p_asserted_identity_e(char b[], isize_t bsiz,
+				   sip_header_t const *h, int f)
+{
+  sip_p_asserted_identity_t const *paid = (sip_p_asserted_identity_t *)h;
+
+  return sip_name_addr_e(b, bsiz, f,
+			 paid->paid_display, MSG_IS_CANONIC(f),
+			 paid->paid_url,
+			 NULL,
+			 NULL);
+}
+
+isize_t sip_p_asserted_identity_dup_xtra(sip_header_t const *h, isize_t offset)
+{
+  sip_p_asserted_identity_t const *paid = (sip_p_asserted_identity_t *)h;
+
+  return sip_name_addr_xtra(paid->paid_display, 
+			    paid->paid_url,
+			    NULL,
+			    offset);
+}
+
+/** Duplicate one sip_p_asserted_identity_t object */
+char *sip_p_asserted_identity_dup_one(sip_header_t *dst,
+				      sip_header_t const *src,
+				      char *b, isize_t xtra)
+{
+  sip_p_asserted_identity_t *paid = (sip_p_asserted_identity_t *)dst;
+  sip_p_asserted_identity_t const *o = (sip_p_asserted_identity_t *)src;
+
+  return sip_name_addr_dup(&paid->paid_display, o->paid_display,
+			   paid->paid_url, o->paid_url,
+			   NULL, NULL,
+			   b, xtra);
+}
+
+#endif
+
+#if SIP_HAVE_P_PREFERRED_IDENTITY
+
+/**@SIP_HEADER sip_p_preferred_identity P-Preferred-Identity Header
+ *
+ * The P-Preferred-Identity header is used used among trusted SIP entities
+ * (typically intermediaries) to carry the identity of the user sending a
+ * SIP message as it was verified by authentication. It is "defined" in
+ * @RFC3325 section 9.1 as follows:
+ *
+ * @code
+ *    PPreferredID = "P-Preferred-Identity" HCOLON PPreferredID-value
+ *                    *(COMMA PPreferredID-value)
+ *    PPreferredID-value = name-addr / addr-spec
+ * @endcode
+ *
+ * @sa @RFC3325, @PAssertedIdentity
+ *
+ * @NEW_1_12_7. In order to use @b P-Preferred-Identity header,
+ * initialize the SIP parser with, e.g.,
+ * sip_update_default_mclass(sip_extend_mclass(NULL)).
+ */
+
+/**@ingroup sip_p_preferred_identity
+ * @typedef typedef struct sip_p_preferred_identity_s sip_p_preferred_identity_t;
+ *
+ * The structure #sip_p_preferred_identity_t contains representation of SIP
+ * @PPreferredIdentity header.
+ *
+ * The #sip_p_preferred_identity_t is defined as follows:
+ * @code
+ * typedef struct sip_p_preferred_identity_s {
+ *   sip_common_t           ppid_common[1]; // Common fragment info
+ *   sip_p_preferred_identity_t *ppid_next; // Link to next
+ *   char const        *ppid_display;       // Display name
+ *   url_t              ppid_url[1];        // URL
+ * } sip_p_preferred_identity_t;
+ * @endcode
+ */
+
+
+msg_hclass_t sip_p_preferred_identity_class[] =
+SIP_HEADER_CLASS(p_preferred_identity, "P-Preferred-Identity", "",
+		 ppid_common, append, p_asserted_identity);
+
+issize_t sip_p_preferred_identity_d(su_home_t *home, sip_header_t *h,
+				    char *s, isize_t slen)
+{
+  return sip_p_asserted_identity_d(home, h, s, slen);
+}
+
+issize_t sip_p_preferred_identity_e(char b[], isize_t bsiz,
+				    sip_header_t const *h, int f)
+{
+  return sip_p_asserted_identity_e(b, bsiz, h, f);
+}
+
+#endif 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra_headers.txt
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra_headers.txt	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra_headers.txt	Thu Oct 11 10:16:59 2007
@@ -1,6 +1,9 @@
 #
 # This file specifies extra SIP headers not included in sip_t structure
 #
+# The parsed headers are accessed with function (or macro) like sip_refer_sub()
+# e.g., sip_refer_sub_t *rsub = sip_refer_sub(sip);
+#
 # The line format is: 
 # C-name @SINCE sip_t-like-comment
 #
@@ -9,8 +12,19 @@
 #### EXTRA HEADER LIST STARTS HERE ####
 
 refer_sub @NEW_1_12_5 /**< Refer-Sub header */
+
+#### DEFAULT HEADER LIST ENDS HERE ####
+
+#
+# These headers are added to the extended parser, installed
+# as default with sip_update_default_mclass(NULL)
+#
+
 alert_info @NEW_1_12_7 /**< Alert-Info header */
 reply_to @NEW_1_12_7 /**< Reply-To header */
+remote_party_id @NEW_1_12_7 /**< Remote-Party-ID header */
+p_asserted_identity @NEW_1_12_7  /**<P-Asserted-Identity*/
+p_preferred_identity @NEW_1_12_7 /**<P-Preferred-Identity*/
 
 #### EXPERIMENTAL HEADER LIST STARTS HERE ####
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c	Thu Oct 11 10:16:59 2007
@@ -60,11 +60,84 @@
 char const sip_version_2_0[] = "SIP/2.0";
 
 /** Default message class */
-extern msg_mclass_t const sip_mclass[];
+extern msg_mclass_t sip_mclass[];
 
+static msg_mclass_t const *_default = sip_mclass;
+
+/** Return a built-in SIP parser object. */
 msg_mclass_t const *sip_default_mclass(void)
 {
-  return sip_mclass;
+  return _default;
+}
+
+/** Update the default SIP parser.
+ *
+ * Use the extended SIP parser as default one.
+ *
+ * If the applications want to use headers added after @VERSION_1_12_5,
+ * they should call this function before doing any other initialization, e.g.,
+ * @code
+ *   su_init();
+ *   if (sip_update_default_mclass(sip_extend_mclass(NULL)) < 0) {
+ *     su_deinit();
+ *     exit(2);
+ *   }
+ * @endcode
+ *
+ * The default parser is not extended because it may break the old
+ * applications looking for extension headers from sip_unknown list.
+ *
+ * @retval 0 when successful
+ * @retval -1 upon an error
+ *
+ * @NEW_1_12_7.
+ */
+int sip_update_default_mclass(msg_mclass_t const *mclass)
+{
+  if (mclass == NULL)
+    return -1;
+  _default = mclass;
+  return 0;
+}
+
+/**Extend SIP parser class with extension headers.
+ *
+ * Extend given SIP parser class with extension headers. If the given parser
+ * class is the default one or NULL, make a clone of it before extending it.
+ *
+ * @param input pointer to a SIP message class (may be NULL)
+ *
+ * @return Pointer to extended mclass, or NULL upon an error.
+ *
+ * @NEW_1_12_7.
+ */
+msg_mclass_t *sip_extend_mclass(msg_mclass_t *input)
+{
+  msg_mclass_t *mclass;
+
+  if (input == NULL || input == _default)
+    mclass = msg_mclass_clone(_default, 0, 0);
+  else
+    mclass = input;
+
+  if (mclass) {
+    extern msg_hclass_t * const sip_extensions[];
+    int i;
+
+    for (i = 0; sip_extensions[i]; i++) {
+      msg_hclass_t *hclass = sip_extensions[i];
+      if (mclass->mc_unknown != msg_find_hclass(mclass, hclass->hc_name, NULL))
+	continue;
+
+      if (msg_mclass_insert_header(mclass, hclass, 0) < 0) {
+	if (input != mclass)
+	  free(mclass);
+	return mclass = NULL;
+      }
+    }
+  }
+
+  return mclass;
 }
 
 /** Extract the SIP message body, including separator line. 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.docs	Thu Oct 11 10:16:59 2007
@@ -56,7 +56,7 @@
  */
 
 #ifndef SIP_H
-#include <sip.h>
+#include <sofia-sip/sip.h>
 #endif
 
 /**@ingroup sip_also

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_pref_util.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_pref_util.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_pref_util.c	Thu Oct 11 10:16:59 2007
@@ -543,12 +543,12 @@
  * 
  * @retval -1 if the contact is rejected
  * @retval 1000 if contact is immune to caller preferences
- * @retval 0..1000 reflecting @RFC3481 score in 0.000 - 1.000.
+ * @retval 0..1000 reflecting @RFC3841 score in 0.000 - 1.000.
  *
  * @sa sip_q_value(),
  * sip_contact_accept(), sip_contact_reject(), sip_contact_is_immune(),
  * sip_contact_immunize(), sip_is_callerpref(), sip_prefs_matching(),
- * @RFC3481, @AcceptContact, @RejectContact, @Contact
+ * @RFC3841, @AcceptContact, @RejectContact, @Contact
  */
 int sip_contact_score(sip_contact_t const *m,
 		      sip_accept_contact_t const *ac,

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_util.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_util.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_util.c	Thu Oct 11 10:16:59 2007
@@ -1421,3 +1421,4 @@
 
   return 0;
 }
+

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h	Thu Oct 11 10:16:59 2007
@@ -107,7 +107,7 @@
 /** Latest time that can be expressed with #sip_time_t. @HIDE */
 #define SIP_TIME_MAX ((sip_time_t)MSG_TIME_MAX)
 
-/** SIP message object. */
+/** Structure for accessing parsed SIP headers. */
 typedef struct sip_s                sip_t;
 
 /** Any SIP header - union of all possible SIP headers. */
@@ -409,7 +409,7 @@
 /**@ingroup sip_allow
  * @brief Structure for @Allow header field.
  *
- * @NEW_1_12_5 (before used struct msg_list_s with @Allow).
+ * @NEW_1_12_5. (Before used struct msg_list_s with @Allow).
  */
 struct sip_allow_s
 {
@@ -417,7 +417,7 @@
   msg_list_t        *k_next;	    /**< Link to next */
   msg_param_t       *k_items;	    /**< List of allowed items */
   uint32_t           k_bitmap;	    /**< Bitmap of allowed methods. 
-				       @NEW_1_12_5 */
+				       @NEW_1_12_5. */
 };
 
 /**@ingroup sip_authentication_info
@@ -573,7 +573,7 @@
 };
 
 /**@ingroup sip_rack
- * @brief Structure for @b Rack header.
+ * @brief Structure for @RAck header.
  */
 struct sip_rack_s
 {

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_extra.h.in
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_extra.h.in	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_extra.h.in	Thu Oct 11 10:16:59 2007
@@ -1,4 +1,4 @@
-/**@file sofia-sip/sip_extra.h.in
+`/**@file sofia-sip/sip_extra.h.in
  *  -*- C -*-
  * Template for <sofia-sip/sip_extra.h>.
  *
@@ -117,6 +117,55 @@
   char const    *snim_tag;		/**< Entity-tag */
 };
 
+typedef struct sip_p_asserted_identity_s sip_p_asserted_identity_t;
+
+/**@ingroup sip_p_asserted_identity
+ * @brief Structure for @PAssertedIdentity header.
+ */
+struct sip_p_asserted_identity_s
+{
+  sip_common_t       paid_common[1];/**< Common fragment info */
+  sip_p_asserted_identity_t
+                    *paid_next;	    /**< Link to next identity */
+  char const        *paid_display;  /**< Display name */
+  url_t              paid_url[1];   /**< SIP, SIPS or TEL URL */
+};
+
+typedef struct sip_p_preferred_identity_s sip_p_preferred_identity_t;
+
+/**@ingroup sip_p_preferred_identity
+ * @brief Structure for @PPreferredIdentity header.
+ */
+struct sip_p_preferred_identity_s
+{
+  sip_common_t       ppid_common[1];/**< Common fragment info */
+  sip_p_preferred_identity_t
+                    *ppid_next;	    /**< Link to next identity */
+  char const        *ppid_display;  /**< Display name */
+  url_t              ppid_url[1];   /**< SIP, SIPS or TEL URL */
+};
+
+
+int sip_p_initialize_remote_party_id_headers(msg_mclass_t *mclass);
+
+typedef struct sip_remote_party_id_s sip_remote_party_id_t;
+
+/**@ingroup sip_remote_party_id
+ * @brief Structure for @RemotePartyID header.
+ */
+struct sip_remote_party_id_s
+{
+  sip_common_t       rpid_common[1];/**< Common fragment info */
+  sip_remote_party_id_t
+                    *rpid_next;	    /**< Link to next identity */
+  char const        *rpid_display;  /**< Display name */
+  url_t              rpid_url[1];   /**< URL */
+  sip_param_t const *rpid_params;   /**< Parameters */
+  /** Shortcuts to screen, party, id-type and privacy parameters */
+  char const        *rpid_screen, *rpid_party, *rpid_id_type, *rpid_privacy;
+};
+
+
 
 /** Defined as 1 if the @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" is supported */
 #define SIP_HAVE_#XXXXXX# 1

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_header.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_header.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_header.h	Thu Oct 11 10:16:59 2007
@@ -57,13 +57,16 @@
 
 SOFIA_BEGIN_DECLS
 
-/** Return built-in SIP parser object. */
+/** Return a built-in SIP parser object. */
 SOFIAPUBFUN msg_mclass_t const *sip_default_mclass(void);
 
-/** Check that sip_t is a SIP structure (not RTSP or HTTP). @HIDE */
+SOFIAPUBFUN int sip_update_default_mclass(msg_mclass_t const *mclass);
+SOFIAPUBFUN msg_mclass_t *sip_extend_mclass(msg_mclass_t *input);
+
+/** Check that sip_t is a SIP header structure (not MIME or HTTP). @HIDE */
 #define sip_is_sip(sip) ((sip) && (sip)->sip_ident == SIP_PROTOCOL_TAG)
 
-/** Initializer for a SIP header object. @HIDE */
+/** Initializer for a SIP header structure. @HIDE */
 #define SIP_HDR_INIT(name) {{{ 0, 0, sip_##name##_class }}}
 
 /** Initialize a SIP header structure. @HIDE */
@@ -349,7 +352,7 @@
 SOFIAPUBFUN int sip_is_allowed(sip_allow_t const *allow, 
 			       sip_method_t method, char const *name);
 
-/** Check if the well-known method is listed in @Allow header. @NEW_1_12_6 */
+/** Check if the well-known method is listed in @Allow header. @NEW_1_12_6. */
 #define SIP_IS_ALLOWED(allow, method) \
   (sip_method_unknown < (method) && (method) < 32 && \
    (allow) && ((allow)->k_bitmap & (1 << (method))) != 0)
@@ -447,7 +450,7 @@
 
   /** Bit marking essential headers for PUBLISH servers and clients.
    *
-   * @SIPEtag, and @SIPIfMatch.
+   * @SIPETag, and @SIPIfMatch.
    * 
    * @sa @RFC3903.
    */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h	Thu Oct 11 10:16:59 2007
@@ -137,6 +137,17 @@
 				     msg_param_t const params[], 
 				     char const *comment);
 
+SOFIAPUBFUN isize_t sip_name_addr_xtra(char const *display, url_t const *addr,
+				       msg_param_t const params[],
+				       isize_t offset);
+
+SOFIAPUBFUN char *sip_name_addr_dup(char const **d_display, char const *display,
+				    url_t *d_addr, url_t const *addr,
+				    msg_param_t const **d_params, 
+				    msg_param_t const params[],
+				    char *b, isize_t xtra);
+
+
 /* ---------------------------------------------------------------------------
  * 3) Compatibility macros and functions
  */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in	Thu Oct 11 10:16:59 2007
@@ -153,7 +153,7 @@
  * Macro is used to include a tag item containing an unknown extension
  * header in the tag list, e.g.,
  * @code
- * SIPTAG_HEADER_STR("Remote-Party-ID: +358718008000")
+ * SIPTAG_HEADER_STR("P-Alternative-URL: <+358718008000>")
  * @endcode
  *
  * It is also possible to include multiple headers at once

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_util.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_util.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_util.h	Thu Oct 11 10:16:59 2007
@@ -138,7 +138,7 @@
     usize_t spl_length;
   } sp_literal;
 
-  /** String (tag="&lt;foo&gt;"). */
+  /** String (tag="&lt;foo&gt;"). */ /* (tag="<foo>") */
   struct sp_string {
     enum sp_type sps_type;
     char const *sps_value;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c	Thu Oct 11 10:16:59 2007
@@ -74,6 +74,135 @@
 
 static msg_t *read_message(int flags, char const string[]);
 
+static int test_identity(void)
+{
+  su_home_t *home;
+  sip_p_asserted_identity_t *paid;
+  sip_p_preferred_identity_t *ppid;
+
+  msg_t *msg;
+  sip_t *sip;
+
+  BEGIN();
+
+  msg_href_t const *href;
+  msg_mclass_t const *def0, *def1, *ext;
+
+  def0 = sip_default_mclass();
+
+  /* Check that Refer-Sub has been added to our parser */
+  TEST_1(href = msg_find_hclass(def0, "Refer-Sub", NULL));
+  TEST_P(href->hr_class, sip_refer_sub_class);
+  /* Check that Reply-To is not there */
+  TEST_P(msg_find_hclass(def0, "Reply-To", NULL), def0->mc_unknown);
+
+  TEST_1(ext = sip_extend_mclass(NULL));
+  /* Update default parser */
+  TEST_1(sip_update_default_mclass(ext) == 0);
+  def1 = sip_default_mclass();
+  TEST_1(def0 != def1);
+  TEST_1(ext == def1);
+
+  TEST_1(href = msg_find_hclass(def1, "Reply-To", NULL));
+  TEST_P(href->hr_class, sip_reply_to_class);
+
+  TEST_1(test_mclass = msg_mclass_clone(def0, 0, 0));
+
+  msg = read_message(MSG_DO_EXTRACT_COPY, 
+    "BYE sip:foo at bar SIP/2.0\r\n"
+    "To: <sip:foo at bar>;tag=deadbeef\r\n"
+    "From: <sip:bar at foo>;\r\n"
+    "Call-ID: 0ha0isndaksdj at 10.1.2.3\r\n"
+    "CSeq: 8 SUBSCRIBE\r\n"
+    "Via: SIP/2.0/UDP 135.180.130.133\r\n"
+    "P-Asserted-Identity: <sip:test at test.domain.com>\r\n"
+    "P-Preferred-Identity: <sip:test at test.domain.com>, <tel:+358708008000>\r\n"
+    "Content-Length: 0\r\n"
+    "\r\n");
+
+  sip = sip_object(msg);
+
+  TEST_1(!sip_p_asserted_identity(sip));
+  TEST_1(!sip_p_preferred_identity(sip));
+
+  msg_destroy(msg);
+
+  TEST_1(msg_mclass_insert_header(test_mclass, 
+				  sip_p_asserted_identity_class, 0) > 0);
+  TEST_1(msg_mclass_insert_header(test_mclass, 
+				  sip_p_preferred_identity_class, 0) > 0);
+
+  msg = read_message(MSG_DO_EXTRACT_COPY, 
+    "BYE sip:foo at bar SIP/2.0\r\n"
+    "To: <sip:foo at bar>;tag=deadbeef\r\n"
+    "From: <sip:bar at foo>;\r\n"
+    "Call-ID: 0ha0isndaksdj at 10.1.2.3\r\n"
+    "CSeq: 8 SUBSCRIBE\r\n"
+    "Via: SIP/2.0/UDP 135.180.130.133\r\n"
+    "P-Asserted-Identity: <sip:test at test.domain.com>\r\n"
+    "P-Preferred-Identity: <sip:test at test.domain.com>, <tel:+358708008000>\r\n"
+    "Content-Length: 0\r\n"
+    "\r\n");
+
+  sip = sip_object(msg);
+
+  TEST_1(home = msg_home(msg));
+  
+  TEST_1((paid = sip_p_asserted_identity_make(home, "sip:joe at example.com")));
+  TEST_1((paid = sip_p_asserted_identity_make
+	  (home, "Jaska <sip:joe at example.com>, Helmi <tel:+3587808000>")));
+  TEST_1(paid->paid_next);
+  TEST_1((ppid = sip_p_preferred_identity_make(home, "sip:joe at example.com")));
+  TEST_1((ppid = sip_p_preferred_identity_make
+	  (home, "Jaska <sip:joe at example.com>, Helmi <tel:+3587808000>")));
+
+  msg_destroy(msg);
+
+  /* Now with extensions */
+  TEST_1(test_mclass = msg_mclass_clone(def1, 0, 0));
+
+  {
+    su_home_t *home = su_home_clone(NULL, sizeof *home);
+
+    char *s;
+    char const canonic[] = 
+      "\"Jaska Jokunen\" <sip:jaska.jokunen at example.com>;"
+      "screen=yes;party=called;id-type=user;privacy=\"name,uri-network\"";
+    char const canonic2[] = 
+      "Jaska Jokunen <sip:jaska.jokunen at example.com>;"
+      "screen=yes;party=called;id-type=user;privacy=\"name,uri-network\"";
+
+    sip_remote_party_id_t *rpid, *d;
+
+    TEST_1(rpid = sip_remote_party_id_make(home, canonic));
+    TEST_S(rpid->rpid_display, "\"Jaska Jokunen\"");
+    TEST_S(rpid->rpid_url->url_user, "jaska.jokunen");
+    TEST_S(rpid->rpid_params[0], "screen=yes");
+    TEST_S(rpid->rpid_screen, "yes");
+    TEST_S(rpid->rpid_party, "called");
+    TEST_S(rpid->rpid_id_type, "user");
+    TEST_S(rpid->rpid_privacy, "\"name,uri-network\"");
+    TEST_1(s = sip_header_as_string(home, (void*)rpid));
+    TEST_S(s, canonic);
+    TEST_1(d = sip_remote_party_id_dup(home, rpid));
+    TEST_S(d->rpid_display, rpid->rpid_display);
+    TEST_S(d->rpid_params[0], rpid->rpid_params[0]);
+
+    TEST_1(rpid = sip_remote_party_id_make(home, canonic2));
+    TEST_S(rpid->rpid_display, "Jaska Jokunen");
+    TEST_1(s = sip_header_as_string(home, (void*)rpid));
+    TEST_S(s, canonic2);
+    TEST_1(d = sip_remote_party_id_dup(home, rpid));
+    TEST_S(d->rpid_display, rpid->rpid_display);
+
+    su_home_check(home);
+    
+    su_home_zap(home);
+  }
+
+  END();
+}
+
 int test_url_headers(void)
 {
   BEGIN();
@@ -84,16 +213,20 @@
   sip_from_t const *f;
   sip_accept_t const *ac;
   sip_payload_t const *body;
+  sip_refer_sub_t rs[1];
 
   TEST_1(home = su_home_new(sizeof *home));
 
+  sip_refer_sub_init(rs)->rs_value = "false";
+
   s = sip_headers_as_url_query
     (home,
-     SIPTAG_SUBJECT_STR(";"),
+     SIPTAG_SUBJECT_STR("kuik"),
+     SIPTAG_REFER_SUB(rs),
      TAG_END());
 
   TEST_1(s);
-  TEST_S(s, "subject=;");
+  TEST_S(s, "subject=kuik&refer-sub=false");
 
   s = sip_headers_as_url_query
     (home,
@@ -2189,7 +2322,7 @@
 
   TEST_1(home = su_home_create());
 
-  /* Check that Refer-Sub has already been added to our parser */
+  /* Check that Refer-Sub has now been added to our parser */
   TEST_1(msg_mclass_insert_with_mask(test_mclass, sip_refer_sub_class, 
 				     0, 0) == -1);
   
@@ -3334,9 +3467,13 @@
   tstflags |= tst_verbatim;
 #endif
 
-  if (!test_mclass)
+  retval |= test_identity(); fflush(stdout);
+
+  if (test_mclass == NULL)
     test_mclass = msg_mclass_clone(sip_default_mclass(), 0, 0);
 
+  retval |= parser_test(); fflush(stdout);
+
   retval |= test_url_headers(); fflush(stdout);
   retval |= test_manipulation(); fflush(stdout);
   retval |= test_methods(); fflush(stdout);
@@ -3348,7 +3485,7 @@
   retval |= tag_test(); fflush(stdout);
   retval |= parser_tag_test(); fflush(stdout);
   retval |= response_phrase_test(); fflush(stdout);
-  retval |= parser_test(); fflush(stdout);
+
   retval |= sip_header_test(); fflush(stdout);
   retval |= test_bad_packet(); fflush(stdout);
   retval |= test_sip_list_header(); fflush(stdout);

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/validator.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/validator.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/validator.c	Thu Oct 11 10:16:59 2007
@@ -22,9 +22,10 @@
  *
  */
 
-/**@IFILE validator.c  
+/**@internal @IFILE validator.c  
  *
- * SIP parser tester. This uses output
+ * SIP parser tester. This uses output from tport dump where messages are
+ * separated with Control-K ('\v') from each other.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
  *

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.c	Thu Oct 11 10:16:59 2007
@@ -824,7 +824,7 @@
  * nua_options(), #nua_i_options
  */
 int soa_get_capability_sdp(soa_session_t const *ss,
-			   sdp_session_t const **return_sdp,
+			   struct sdp_session_s const **return_sdp,
 			   char const **return_sdp_str,
 			   isize_t *return_len)
 {
@@ -874,7 +874,7 @@
  * nua_options(), #nua_i_options
  */
 int soa_set_capability_sdp(soa_session_t *ss, 
-			   sdp_session_t const *sdp,
+			   struct sdp_session_s const *sdp,
 			   char const *str, issize_t len)
 {
   SU_DEBUG_9(("soa_set_capability_sdp(%s::%p, %p, %p, "MOD_ZD") called\n",
@@ -956,7 +956,7 @@
  * soa_get_capability_sdp()
  */
 int soa_get_user_sdp(soa_session_t const *ss,
-		     sdp_session_t const **return_sdp,
+		     struct sdp_session_s const **return_sdp,
 		     char const **return_sdp_str,
 		     isize_t *return_len)
 {
@@ -1032,7 +1032,7 @@
  * soa_set_remote_sdp()
  */
 int soa_set_user_sdp(soa_session_t *ss, 
-		     sdp_session_t const *sdp,
+		     struct sdp_session_s const *sdp,
 		     char const *str, issize_t len)
 {
   SU_DEBUG_9(("soa_set_user_sdp(%s::%p, %p, %p, "MOD_ZD") called\n",
@@ -1073,7 +1073,7 @@
  * soa_get_local_sdp(), soa_get_user_sdp(), soa_get_capability_sdp().
  */
 int soa_get_remote_sdp(soa_session_t const *ss,
-		       sdp_session_t const **return_sdp,
+		       struct sdp_session_s const **return_sdp,
 		       char const **return_sdp_str,
 		       isize_t *return_len)
 {
@@ -1151,7 +1151,7 @@
  * soa_set_user_sdp(), soa_set_capability_sdp().
  */
 int soa_set_remote_sdp(soa_session_t *ss, 
-		       sdp_session_t const *sdp,
+		       struct sdp_session_s const *sdp,
 		       char const *str, issize_t len)
 {
   SU_DEBUG_9(("soa_set_remote_sdp(%s::%p, %p, %p, "MOD_ZD") called\n",
@@ -1245,7 +1245,7 @@
  * soa_get_user_sdp(), soa_get_remote_sdp(), soa_get_capability_sdp().
  */
 int soa_get_local_sdp(soa_session_t const *ss,
-		      sdp_session_t const **return_sdp,
+		      struct sdp_session_s const **return_sdp,
 		      char const **return_sdp_str,
 		      isize_t *return_len)
 {
@@ -1412,7 +1412,7 @@
   if (ss == NULL)
     return su_seterrno(EFAULT), -1;
 
-  /** @ERROR An operation is already in progress */
+  /** @ERROR EALREADY An operation is already in progress */
   if (ss->ss_in_progress)
     return su_seterrno(EALREADY), -1;
 
@@ -1500,7 +1500,7 @@
   if (ss == NULL)
     return su_seterrno(EFAULT), -1;
 
-  /** @ERROR An operation is already in progress. */
+  /** @ERROR EALREADY An operation is already in progress. */
   if (ss->ss_in_progress)
     return su_seterrno(EALREADY), -1;
 
@@ -1580,7 +1580,7 @@
   if (ss == NULL)
     return su_seterrno(EFAULT), -1;
 
-  /** @ERROR An operation is already in progress. */
+  /** @ERROR EALREADY An operation is already in progress. */
   if (ss->ss_in_progress)
     return su_seterrno(EALREADY), -1;
 
@@ -1661,7 +1661,7 @@
   if (ss == NULL)
     return su_seterrno(EFAULT), -1;
 
-  /** @ERROR An operation is already in progress. */
+  /** @ERROR EALREADY An operation is already in progress. */
   if (ss->ss_in_progress)
     return su_seterrno(EALREADY), -1;
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.docs	Thu Oct 11 10:16:59 2007
@@ -3,7 +3,7 @@
 @section soa_meta Module Information
 
 The Sofia SIP @b soa module consists of an asynchronous SDP Offer/Answer engine
-library. The interface to library is defined in <soa.h>.
+library. The interface to library is defined in <sofia-sip/soa.h>.
 
 @CONTACT Pekka Pessi <Pekka.Pessi at nokia.com>
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c	Thu Oct 11 10:16:59 2007
@@ -631,6 +631,8 @@
  * Corresponding tag taking a reference parameter is SOATAG_RTP_SELECT_REF().
  *
  * @sa @RFC3264 section 8.3.3, T.38
+ *
+ * @NEW_1_12_7.
  */
 tag_typedef_t soatag_ordered_user = BOOLTAG_TYPEDEF(ordered_user);
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/run_test_sresolv
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/run_test_sresolv	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/run_test_sresolv	Thu Oct 11 10:16:59 2007
@@ -30,14 +30,14 @@
 # Author(s): Pekka Pessi <Pekka.Pessi at nokia.com>.
 #
 
-s=${0%/*}
-
-test x$s = x$0 && s=`pwd`
+s=`dirname $0`
+test x$s = x. && s=`pwd`
 
 PATH=/usr/sbin:/usr/local/sbin:/sbin:$PATH
+export PATH
 
 # Test for support for IPv6 on Linux. This probably fails on everything else.
-ipv6='sysctl net.ipv6.conf.default.mtu >& /dev/null'
+ipv6='sysctl net.ipv6.conf.default.mtu >/dev/null 2>&1'
 # Bind not working with IPv6 on RHEL 4:
 # client.c:1325: unexpected error: failed to get request's destination: failure
 #ipv6=false
@@ -46,18 +46,18 @@
 
 # Try to find a free port
 if netstat --ip >/dev/null 2>&1 ; then
-    while netstat --ip -n -a | fgrep -q ":$port "
+    while netstat --ip -n -a | fgrep ":$port " > /dev/null
     do
-	port=$(($port + 1))
-	if [$port = 65536] ; then
+	port=`expr $port + 1`
+	if test $port = 65536 ; then
 	    port=1024
 	fi
     done
 fi
 
 # No BIND 9, no fun
-{ type -p named >/dev/null &&
-  named -v | grep -q BIND.*9 
+{ type named >/dev/null &&
+  named -v | grep BIND.*9 > /dev/null
 } || {
 echo test_sresolv: there is no BIND 9 named in you path, skipping
 exit 77
@@ -66,10 +66,10 @@
 if eval $ipv6
 then
     # Figure out nice IPv6 address for us
-    ns=$(ip addr ls | awk '
+    ns=`ip addr ls | awk '
     /^[0-9]:/ { up = ($3 ~ /UP/) && ($3 !~ /LOOPBACK/); }
     /inet6 fe80::/ { next; } # no link-local 
-    up && $1 ~ /inet6/ { sub(/\/.*$/, "", $2); print $2; exit 0; }')
+    up && $1 ~ /inet6/ { sub(/\/.*$/, "", $2); print $2; exit 0; }'`
 
     # Nothing found, use localnode ::1
     if test -z "$ns"; then ns=::1 ; fi
@@ -113,9 +113,11 @@
 port $port
 EOF
 
+absolute=`cd $s; pwd`
+
 cat > $t/named.conf <<EOF
 options {
-	directory "$(cd $s; pwd)";
+	directory "$absolute";
 	pid-file "$t/named.pid";
 	notify no;
 	$listen4
@@ -164,16 +166,16 @@
 
 test -r $t/named.pid || { 
     echo $0: cannot start named >&2 ; 
-    if fgrep -q -i -e SELINUX=enforcing /etc/selinux/config 2>&/dev/null ; then
+    if fgrep -i -e SELINUX=enforcing /etc/selinux/config >/dev/null 2>&1 ; then
 	echo $0: perhaps you have to disable SELinux protection for named 
     fi
     exit 77
 }
 
-function kill_named
+kill_named ()
 {
     kill `cat $t/named.pid`
-    rm $t/named.conf $t/resolv.conf $t/error.conf $t/named.pid
+    rm $t/named.conf $t/resolv.conf $t/error.conf $t/named.pid 2>/dev/null
     rmdir $t
 }
 trap kill_named EXIT

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/torture_sresolv.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/torture_sresolv.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/torture_sresolv.c	Thu Oct 11 10:16:59 2007
@@ -224,6 +224,10 @@
 
 extern void sres_cache_clean(sres_cache_t *cache, time_t now);
 
+#ifndef CLOCK_PROCESS_CPUTIME_ID
+#define CLOCK_PROCESS_CPUTIME_ID CLOCK_REALTIME
+#endif
+
 static
 int test_cache(void)
 {
@@ -282,7 +286,7 @@
     if (t1.tv_nsec < t0.tv_nsec)
       t2.tv_sec--, t2.tv_nsec += 1000000000;
     printf("sres_cache: stored %u entries: %lu.%09lu sec\n", 
-	   N, t2.tv_sec, t2.tv_nsec);
+	   N, (long unsigned)t2.tv_sec, t2.tv_nsec);
   }
 
   for (i = 0, N; i < N; i++)
@@ -299,7 +303,7 @@
     if (t1.tv_nsec < t0.tv_nsec)
       t2.tv_sec--, t2.tv_nsec += 1000000000;
     printf("sres_cache: cleaned %u entries: %lu.%09lu sec\n", 
-	   N, t2.tv_sec, t2.tv_nsec);
+	   N, (long unsigned)t2.tv_sec, t2.tv_nsec);
   }
 
   for (i = 0, N; i < N; i++)
@@ -321,7 +325,7 @@
     if (t1.tv_nsec < t0.tv_nsec)
       t2.tv_sec--, t2.tv_nsec += 1000000000;
     printf("sres_cache: stored %u entries: %lu.%09lu sec\n", 
-	   N, t2.tv_sec, t2.tv_nsec);
+	   N, (long unsigned)t2.tv_sec, t2.tv_nsec);
   }
 
   for (i = 0, N; i < N; i++)
@@ -339,7 +343,7 @@
     if (t1.tv_nsec < t0.tv_nsec)
       t2.tv_sec--, t2.tv_nsec += 1000000000;
     printf("sres_cache: cleaned %u entries: %lu.%09lu sec\n", 
-	   N, t2.tv_sec, t2.tv_nsec);
+	   N, (long unsigned)t2.tv_sec, t2.tv_nsec);
   }
 
   for (i = 0, N; i < N; i++) {

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/lookup_stun_server.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/lookup_stun_server.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/lookup_stun_server.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file lookup_stun_server.c 
  * @brief Test app for STUN DNS-SRV lookups.
  *

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file stun.c STUN client module
  *
  * See RFC 3489/3489bis for further information.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.docs	Thu Oct 11 10:16:59 2007
@@ -14,9 +14,9 @@
 @section stun_contents Contents of stun Module
 
 The stun module contains the public header files as follows:
-- <stun.h>        the public API of the module
-- <stun_common.h> low-level functions for parsing and encoding STUN messages
-- <stun_tag.h>    defines the su tags used by stun
+- <sofia-sip/stun.h>        the public API of the module
+- <sofia-sip/stun_common.h> low-level functions for parsing and encoding STUN messages
+- <sofia-sip/stun_tag.h>    defines the su tags used by stun
 
 @section stun_usage Using Sofia STUN Library
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_common.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_common.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_common.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file stun_common.c
  * @brief 
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file stun_dns.c 
  * @brief Functins to discover STUN server address using DNS-SRV.
  *

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_mini.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_mini.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_mini.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file stun_mini.c
  * @brief Minimal stun server 
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_tag.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_tag.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@CFILE stun_tag.c  Tags and tag lists for Offer/Answer Engine
+/**@internal @CFILE stun_tag.c  Tags and tag lists for Offer/Answer Engine
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Martti Mela <Martti.Mela at nokia.com>

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/Makefile.am	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/Makefile.am	Thu Oct 11 10:16:59 2007
@@ -73,7 +73,7 @@
 	su_os_nw.c \
 	su_taglist.c su_tag.c su_tag_io.c \
 	su_log.c su_global_log.c su_default_log.c su_module_debug.h \
-	su_md5.c su_uniqueid.c su_bm.c string0.c $(OSXSOURCES)
+	su_md5.c su_uniqueid.c su_bm.c smoothsort.c string0.c $(OSXSOURCES)
 
 
 EXTRA_libsu_la_SOURCES = \

Added: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/foo.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/foo.c	Thu Oct 11 10:16:59 2007
@@ -0,0 +1,265 @@
+/*
+ * This file is part of the Sofia-SIP package
+ *
+ * Copyright (C) 2005 Nokia Corporation.
+ *
+ * Contact: Pekka Pessi <pekka.pessi at nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+/**@file smoothsort.c
+ * @brief Smoothsort implementation
+ * 
+ * Smoothsort is a in-place sorting algorithm with performance of O(NlogN)
+ * in worst case and O(n) in best case.
+ *
+ * @sa <a href="http://www.enterag.ch/hartwig/order/smoothsort.pdf">
+ * "Smoothsort, an alternative for sorting in-situ", E.D. Dijkstra, EWD796a</a>,
+ * &lt;http://www.enterag.ch/hartwig/order/smoothsort.pdf&gt;.
+ *
+ * @author Pekka Pessi <Pekka.Pessi at nokia.com>
+ */
+
+#include "config.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+/** Description of current stretch */
+typedef struct {
+  size_t b, c;		/**< Leonardo numbers */
+  unsigned longlong p;		/**< Concatenation codification */
+} stretch;
+
+/** Description of array */
+typedef struct
+{
+  void *m;
+  int (*less)(void *m, size_t a, size_t b);
+  void (*swap)(void *m, size_t a, size_t b);
+} array;
+
+static inline size_t stretch_up(stretch s[1])
+{
+  size_t next;
+
+  s->p >>= 1;
+  
+  next = s->b + s->c + 1, s->c = s->b, s->b = next;
+
+  return next;
+}
+
+static inline size_t stretch_down(stretch s[1], unsigned bit)
+{
+  size_t next;
+
+  s->p <<= 1, s->p |= bit;
+
+  next = s->c, s->c = s->b - s->c - 1, s->b = next;
+
+  return next;
+}
+
+#if DEBUG_SMOOTHSORT
+static char const *binary(unsigned long long p)
+{
+  static char binary[65];
+  int i;
+
+  if (p == 0)
+    return "0";
+
+  binary[64] = 0;
+  
+  for (i = 64; p; p >>= 1) 
+    binary[--i] = "01"[p & 1];
+
+  return binary + i;
+}
+#else
+#define DEBUG(x) ((void)0)
+#endif
+
+/**
+ * Sift the root of the stretch.
+ *
+ * The low values are sifted up (towards index 0) from root.
+ *
+ * @param array   description of array to sort
+ * @param r       root of the stretch
+ * @param s       description of current stretch
+ */
+static void sift(array const *array, size_t r, stretch s)
+{ 
+  while (s.b >= 3) {
+    size_t r2 = r - s.b + s.c;
+
+    if (!array->less(array->m, r - 1, r2)) {
+      r2 = r - 1;
+      stretch_down(&s, 0);
+    }
+ 
+    if (array->less(array->m, r2, r))
+      break;
+
+    DEBUG(("\tswap(%p @%zu <=> @%zu)\n", array, r, r2));
+
+    array->swap(array->m, r, r2); r = r2;
+
+    stretch_down(&s, 0);
+  }
+} 
+ 
+/** Trinkle the roots of the given stretches
+ *
+ * @param array   description of array to sort
+ * @param r       root of the stretch
+ * @param s       description of stretches to concatenate
+ */
+static void trinkle(array const *array, size_t r, stretch s)
+{
+  DEBUG(("trinkle(%p, %zu, (%u, %s))\n", array, r, s.b, binary(s.p)));
+
+  while (s.p != 0) {
+    size_t r2, r3;
+
+    while ((s.p & 1) == 0)
+      stretch_up(&s);
+
+    if (s.p == 1)
+      break;
+
+    r3 = r - s.b;
+
+    if (array->less(array->m, r3, r))
+      break;
+
+    s.p--;
+
+    if (s.b < 3) {
+      DEBUG(("\tswap(%p @%zu <=> @%zu b=%u)\n", array,  r, r3, s.b));
+      array->swap(array->m, r, r3); r = r3;
+      continue;
+    }
+
+    r2 = r - s.b + s.c;
+ 
+    if (array->less(array->m, r2, r - 1)) {
+      r2 = r - 1;
+      stretch_down(&s, 0);
+    }
+ 
+    if (array->less(array->m, r2, r3)) {
+      DEBUG(("swap(%p [%zu]=[%zu])\n", array, r, r3));
+      array->swap(array->m, r, r3); r = r3;
+      continue;
+    }
+
+    DEBUG(("\tswap(%p @%zu <=> @%zu b=%u)\n", array, r, r2, s.b));
+    array->swap(array->m, r, r2); r = r2;
+    stretch_down(&s, 0);
+    break; 
+  }
+ 
+  sift(array, r, s);
+}
+
+/** Trinkles the stretches when the adjacent stretches are already trusty.
+ *
+ * @param array   description of array to sort
+ * @param r       root of the stretch
+ * @param stretch description of stretches to trinkle
+ */
+static void semitrinkle(array const *array, size_t r, stretch s)
+{
+  size_t r1 = r - s.c;
+
+  DEBUG(("semitrinkle(%p, %zu, (%u, %s))\n", array, r, s.b, binary(s.p)));
+
+  if (array->less(array->m, r, r1)) {
+    DEBUG(("\tswap(%p @%zu <=> @%zu b=%u)\n", array, r, r1, s.b));
+    array->swap(array->m, r, r1);
+    trinkle(array, r1, s);
+  }
+} 
+
+/** Sort array using smoothsort.
+ *
+ * Sort @a N elements from array @a base starting with index @a r with smoothsort.
+ *
+ * @param base  pointer to array
+ * @param r     lowest index to sort
+ * @param N     number of elements to sort
+ * @param less  comparison function returning nonzero if m[a] < m[b]
+ * @param swap  swapper function exchanging elements m[a] and m[b]
+ */
+void su_smoothsort(void *base, size_t r, size_t N,
+		   int (*less)(void *m, size_t a, size_t b),
+		   void (*swap)(void *m, size_t a, size_t b))
+{
+  stretch s = { 1, 1, 1 };
+  size_t q;
+
+  array const array[1] = {{ base, less, swap }};
+
+  assert(less && swap);
+
+  if (base == NULL || N <= 1 || less == NULL || swap == NULL)
+    return;
+
+  DEBUG(("\nsmoothsort(%p, %zu)\n", array, nmemb));
+
+  for (q = 1; q != N; q++, r++, s.p++) {
+    DEBUG(("loop0 q=%zu, b=%u, p=%s \n", q, s.b, binary(s.p)));
+
+    if ((s.p & 7) == 3) {
+      sift(array, r, s), stretch_up(&s), stretch_up(&s);
+    }
+    else /* if ((s.p & 3) == 1) */ { assert((s.p & 3) == 1);
+      if (q + s.c < N)
+	sift(array, r, s);
+      else
+	trinkle(array, r, s);
+
+      while (stretch_down(&s, 0) > 1)
+	;
+    }
+  }
+
+  trinkle(array, r, s);
+
+  for (; q > 1; q--) {
+    s.p--;
+
+    DEBUG(("loop1 q=%zu: b=%u p=%s\n", q, s.b, binary(s.p)));
+
+    if (s.b <= 1) {
+      while ((s.p & 1) == 0) 
+	stretch_up(&s);
+      --r;
+    } 
+    else /* if b >= 3 */ {
+      if (s.p) semitrinkle(array, r - (s.b - s.c), s);
+      stretch_down(&s, 1);
+      semitrinkle(array, --r, s);
+      stretch_down(&s, 1);
+    }
+  }
+}

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memccpy.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memccpy.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memccpy.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@file memccpy.c
+/**@internal @file memccpy.c
  * @brief The memccpy() replacement function.
  *  
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memcspn.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memcspn.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memcspn.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@file memcspn.c
+/**@internal @file memcspn.c
  * @brief The memcspn() replacement function.
  *  
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memmem.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memmem.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memmem.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,8 @@
  *
  */
 
-/**@file memmem.c
+/**@internal @file memmem.c
+ *
  * @brief Backup implementation of memmem()
  *  
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memspn.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memspn.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memspn.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,8 @@
  *
  */
 
-/**@file memspn.c
+/**@internal @file memspn.c
+ * 
  * The memspn() replacement function.
  *  
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/run_test_su
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/run_test_su	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/run_test_su	Thu Oct 11 10:16:59 2007
@@ -8,7 +8,7 @@
 
 export SU_PORT
 
-egrep -q -i '^#define have_(sys_)?'$SU_PORT ../../config.h ||
+egrep -i '^#define have_(sys_)?'$SU_PORT ../../config.h >/dev/null ||
 continue
 
 run=yes

Added: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/smoothsort.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/smoothsort.c	Thu Oct 11 10:16:59 2007
@@ -0,0 +1,265 @@
+/*
+ * This file is part of the Sofia-SIP package
+ *
+ * Copyright (C) 2005 Nokia Corporation.
+ *
+ * Contact: Pekka Pessi <pekka.pessi at nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+/**@file smoothsort.c
+ * @brief Smoothsort implementation
+ * 
+ * Smoothsort is a in-place sorting algorithm with performance of O(NlogN)
+ * in worst case and O(n) in best case.
+ *
+ * @sa <a href="http://www.enterag.ch/hartwig/order/smoothsort.pdf">
+ * "Smoothsort, an alternative for sorting in-situ", E.D. Dijkstra, EWD796a</a>,
+ * &lt;http://www.enterag.ch/hartwig/order/smoothsort.pdf&gt;.
+ *
+ * @author Pekka Pessi <Pekka.Pessi at nokia.com>
+ */
+
+#include "config.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+/** Description of current stretch */
+typedef struct {
+  size_t b, c;		/**< Leonardo numbers */
+  unsigned longlong p;		/**< Concatenation codification */
+} stretch;
+
+/** Description of array */
+typedef struct
+{
+  void *m;
+  int (*less)(void *m, size_t a, size_t b);
+  void (*swap)(void *m, size_t a, size_t b);
+} array;
+
+static inline size_t stretch_up(stretch s[1])
+{
+  size_t next;
+
+  s->p >>= 1;
+  
+  next = s->b + s->c + 1, s->c = s->b, s->b = next;
+
+  return next;
+}
+
+static inline size_t stretch_down(stretch s[1], unsigned bit)
+{
+  size_t next;
+
+  s->p <<= 1, s->p |= bit;
+
+  next = s->c, s->c = s->b - s->c - 1, s->b = next;
+
+  return next;
+}
+
+#if DEBUG_SMOOTHSORT
+static char const *binary(unsigned long long p)
+{
+  static char binary[65];
+  int i;
+
+  if (p == 0)
+    return "0";
+
+  binary[64] = 0;
+  
+  for (i = 64; p; p >>= 1) 
+    binary[--i] = "01"[p & 1];
+
+  return binary + i;
+}
+#else
+#define DEBUG(x) ((void)0)
+#endif
+
+/**
+ * Sift the root of the stretch.
+ *
+ * The low values are sifted up (towards index 0) from root.
+ *
+ * @param array   description of array to sort
+ * @param r       root of the stretch
+ * @param s       description of current stretch
+ */
+static void sift(array const *array, size_t r, stretch s)
+{ 
+  while (s.b >= 3) {
+    size_t r2 = r - s.b + s.c;
+
+    if (!array->less(array->m, r - 1, r2)) {
+      r2 = r - 1;
+      stretch_down(&s, 0);
+    }
+ 
+    if (array->less(array->m, r2, r))
+      break;
+
+    DEBUG(("\tswap(%p @%zu <=> @%zu)\n", array, r, r2));
+
+    array->swap(array->m, r, r2); r = r2;
+
+    stretch_down(&s, 0);
+  }
+} 
+ 
+/** Trinkle the roots of the given stretches
+ *
+ * @param array   description of array to sort
+ * @param r       root of the stretch
+ * @param s       description of stretches to concatenate
+ */
+static void trinkle(array const *array, size_t r, stretch s)
+{
+  DEBUG(("trinkle(%p, %zu, (%u, %s))\n", array, r, s.b, binary(s.p)));
+
+  while (s.p != 0) {
+    size_t r2, r3;
+
+    while ((s.p & 1) == 0)
+      stretch_up(&s);
+
+    if (s.p == 1)
+      break;
+
+    r3 = r - s.b;
+
+    if (array->less(array->m, r3, r))
+      break;
+
+    s.p--;
+
+    if (s.b < 3) {
+      DEBUG(("\tswap(%p @%zu <=> @%zu b=%u)\n", array,  r, r3, s.b));
+      array->swap(array->m, r, r3); r = r3;
+      continue;
+    }
+
+    r2 = r - s.b + s.c;
+ 
+    if (array->less(array->m, r2, r - 1)) {
+      r2 = r - 1;
+      stretch_down(&s, 0);
+    }
+ 
+    if (array->less(array->m, r2, r3)) {
+      DEBUG(("swap(%p [%zu]=[%zu])\n", array, r, r3));
+      array->swap(array->m, r, r3); r = r3;
+      continue;
+    }
+
+    DEBUG(("\tswap(%p @%zu <=> @%zu b=%u)\n", array, r, r2, s.b));
+    array->swap(array->m, r, r2); r = r2;
+    stretch_down(&s, 0);
+    break; 
+  }
+ 
+  sift(array, r, s);
+}
+
+/** Trinkles the stretches when the adjacent stretches are already trusty.
+ *
+ * @param array   description of array to sort
+ * @param r       root of the stretch
+ * @param stretch description of stretches to trinkle
+ */
+static void semitrinkle(array const *array, size_t r, stretch s)
+{
+  size_t r1 = r - s.c;
+
+  DEBUG(("semitrinkle(%p, %zu, (%u, %s))\n", array, r, s.b, binary(s.p)));
+
+  if (array->less(array->m, r, r1)) {
+    DEBUG(("\tswap(%p @%zu <=> @%zu b=%u)\n", array, r, r1, s.b));
+    array->swap(array->m, r, r1);
+    trinkle(array, r1, s);
+  }
+} 
+
+/** Sort array using smoothsort.
+ *
+ * Sort @a N elements from array @a base starting with index @a r with smoothsort.
+ *
+ * @param base  pointer to array
+ * @param r     lowest index to sort
+ * @param N     number of elements to sort
+ * @param less  comparison function returning nonzero if m[a] < m[b]
+ * @param swap  swapper function exchanging elements m[a] and m[b]
+ */
+void su_smoothsort(void *base, size_t r, size_t N,
+		   int (*less)(void *m, size_t a, size_t b),
+		   void (*swap)(void *m, size_t a, size_t b))
+{
+  stretch s = { 1, 1, 1 };
+  size_t q;
+
+  array const array[1] = {{ base, less, swap }};
+
+  assert(less && swap);
+
+  if (base == NULL || N <= 1 || less == NULL || swap == NULL)
+    return;
+
+  DEBUG(("\nsmoothsort(%p, %zu)\n", array, nmemb));
+
+  for (q = 1; q != N; q++, r++, s.p++) {
+    DEBUG(("loop0 q=%zu, b=%u, p=%s \n", q, s.b, binary(s.p)));
+
+    if ((s.p & 7) == 3) {
+      sift(array, r, s), stretch_up(&s), stretch_up(&s);
+    }
+    else /* if ((s.p & 3) == 1) */ { assert((s.p & 3) == 1);
+      if (q + s.c < N)
+	sift(array, r, s);
+      else
+	trinkle(array, r, s);
+
+      while (stretch_down(&s, 0) > 1)
+	;
+    }
+  }
+
+  trinkle(array, r, s);
+
+  for (; q > 1; q--) {
+    s.p--;
+
+    DEBUG(("loop1 q=%zu: b=%u p=%s\n", q, s.b, binary(s.p)));
+
+    if (s.b <= 1) {
+      while ((s.p & 1) == 0) 
+	stretch_up(&s);
+      --r;
+    } 
+    else /* if b >= 3 */ {
+      if (s.p) semitrinkle(array, r - (s.b - s.c), s);
+      stretch_down(&s, 1);
+      semitrinkle(array, --r, s);
+      stretch_down(&s, 1);
+    }
+  }
+}

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/heap.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/heap.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/heap.h	Thu Oct 11 10:16:59 2007
@@ -114,6 +114,7 @@
 scope int prefix##is_full(heaptype const); \
 scope size_t prefix##size(heaptype const); \
 scope size_t prefix##used(heaptype const); \
+scope void prefix##sort(heaptype); \
 scope int prefix##add(heaptype, type); \
 scope type prefix##remove(heaptype, size_t); \
 scope type prefix##get(heaptype, size_t)
@@ -126,6 +127,7 @@
  * - prefix ## is_full(heap)
  * - prefix ## size(heap)
  * - prefix ## used(heap)
+ * - prefix ## sort(heap)
  * - prefix ## add(heap, entry)
  * - prefix ## remove(heap, index)
  * - prefix ## get(heap, index)
@@ -240,35 +242,32 @@
   struct prefix##priv { size_t _size, _used; type _heap[1];}; \
   struct prefix##priv *_priv = *(void **)&h; \
   type *heap = _priv->_heap - 1; \
-  type retval; \
+  type retval[1]; \
   type e; \
  \
   size_t top, left, right, move; \
  \
-  move = _priv->_used; \
- \
   if (index - 1 >= _priv->_used) \
     return (null); \
  \
   move = _priv->_used--; \
-  retval = heap[top = index]; \
+  set(retval, 0, heap[index]); \
  \
-  for (;;) { \
+  for (top = index;;index = top) { \
     left = 2 * top; \
     right = 2 * top + 1; \
  \
-    if (right >= move) \
+    if (left >= move) \
       break; \
-    if (less(heap[right], heap[left])) \
+    if (right < move && less(heap[right], heap[left])) \
       top = right; \
     else \
       top = left; \
     set(heap, index, heap[top]); \
-    index = top; \
   } \
  \
   if (index == move) \
-    return retval; \
+    return *retval; \
  \
   e = heap[move]; \
   for (; index > 1; index = top) { \
@@ -280,7 +279,7 @@
  \
   set(heap, index, e); \
  \
-  return retval; \
+  return *retval; \
 } \
  \
 scope \
@@ -310,6 +309,25 @@
   struct prefix##priv *_priv = *(void **)&h; \
   return _priv ? _priv->_used : 0; \
 } \
+scope int prefix##_less(void *h, size_t a, size_t b) \
+{ \
+  type *_heap = h; return less(_heap[a], _heap[b]);	\
+} \
+scope void prefix##_swap(void *h, size_t a, size_t b) \
+{ \
+  type *_heap = h; type _swap = _heap[a]; \
+  set(_heap, a, _heap[b]); set(_heap, b, _swap); \
+} \
+void su_smoothsort(void *base, size_t r0, size_t N,		\
+		   int (*less)(void *base, size_t a, size_t b), \
+		   void (*swap)(void *base, size_t a, size_t b));	\
+scope void prefix##sort(heaptype h) \
+{ \
+  struct prefix##priv { size_t _size, _used; type _heap[1];}; \
+  struct prefix##priv *_priv = *(void **)&h; \
+  if (_priv) \
+    su_smoothsort(_priv->_heap - 1, 1, _priv->_used, prefix##_less, prefix##_swap); \
+} \
 extern int const prefix##dummy_heap
 
 #endif /** !defined(SOFIA_SIP_HEAP_H) */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable2.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable2.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable2.h	Thu Oct 11 10:16:59 2007
@@ -31,7 +31,7 @@
  * Hash tables templates, take 2.
  *
  * Note: this version can handle structures as entries, and it can be used
- * without <su_alloc.h>.
+ * without <sofia-sip/su_alloc.h>.
  * 
  * This file contain a hash table template for C.  The hash tables are
  * resizeable, and they usually contain pointers to entries.  The

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_config.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_config.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_config.h	Thu Oct 11 10:16:59 2007
@@ -28,7 +28,7 @@
  * 
  * @b su library configuration
  * 
- * This file includes an appropriate <su_configure*.h> include file.
+ * This file includes an appropriate <sofia-sip/su_configure*.h> include file.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_os_nw.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_os_nw.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_os_nw.h	Thu Oct 11 10:16:59 2007
@@ -70,11 +70,11 @@
 /**Default type of application context for network_changed function.
  *
  * Application may define the typedef ::su_network_changed_magic_t to appropriate type
- * by defining macro #SU_NETWORK_CHANGED_MAGIC_T before including <su_os_nw.h>, for
+ * by defining macro #SU_NETWORK_CHANGED_MAGIC_T before including <sofia-sip/su_os_nw.h>, for
  * example,
  * @code
  * #define SU_NETWORK_CHANGED_MAGIC_T struct context
- * #include <su_os_nw.h>
+ * #include <sofia-sip/su_os_nw.h>
  * @endcode
  *
  * @since New in @VERSION_1_12_2.
@@ -85,11 +85,11 @@
 /** <a href="#su_root_t">Root context</a> pointer type.
  *
  * Application may define the typedef ::su_network_changed_magic_t to appropriate type
- * by defining macro #SU_NETWORK_CHANGED_MAGIC_T before including <su_os_nw.h>, for
+ * by defining macro #SU_NETWORK_CHANGED_MAGIC_T before including <sofia-sip/su_os_nw.h>, for
  * example,
  * @code
  * #define SU_NETWORK_CHANGED_MAGIC_T struct context
- * #include <su_os_nw.h>
+ * #include <sofia-sip/su_os_nw.h>
  * @endcode
  *
  * @since New in @VERSION_1_12_2.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h	Thu Oct 11 10:16:59 2007
@@ -68,11 +68,17 @@
 /** Tag type class */
 typedef struct tag_class_s const tag_class_t;
 
+/** Tag structure. 
+ *
+ * The tag structure contains the name, namespace and class of the tag. The
+ * fourth field, @a tt_magic, is interpreted by the tag class.
+ */
 struct tag_type_s {
-  char const    *tt_ns;
-  char const 	*tt_name;
-  tag_class_t   *tt_class;
-  tag_value_t    tt_magic;
+  char const    *tt_ns;		/**< Tag namespace (e.g., "sip" or "nua") */
+  char const 	*tt_name;	/**< Tag name (e.g, "min_se")  */
+  tag_class_t   *tt_class;	/**< Tag class defines the type of the value */
+  tag_value_t    tt_magic;	/**< Class-specific data 
+				   (e.g., pointer to header class structure) */
 };
 
 /** Definition of tag type. */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_class.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_class.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_class.h	Thu Oct 11 10:16:59 2007
@@ -49,7 +49,7 @@
 #endif
 
 #define TAG_TYPEDEF(t, type) \
-  {{ TAG_NAMESPACE, #t, type ## _tag_class }}
+  {{ TAG_NAMESPACE, #t, type ## _tag_class, 0 }}
 
 #define INTTAG_TYPEDEF(t)      TAG_TYPEDEF(t, int)
 #define UINTTAG_TYPEDEF(t)     TAG_TYPEDEF(t, uint)
@@ -63,7 +63,7 @@
 #define NSTAG_TYPEDEF(t)       TAG_TYPEDEF(t, ns)
 
 struct tag_class_s {
-  int             tc_size;
+  int             tc_size;	/**< Size of the tag_class_t structure */
   tagi_t const *(*tc_next)(tagi_t const *t);
   size_t        (*tc_len)(tagi_t const *t);
   tagi_t       *(*tc_move)(tagi_t *dst, tagi_t const *src);

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h	Thu Oct 11 10:16:59 2007
@@ -43,7 +43,7 @@
 /**@page tagarg Tagarg Functions
  *
  * A @em tagarg function may be called with a varying number of tagged
- * arguments.  The include file <su_tagarg.h> declares a type ta_list and
+ * arguments.  The include file <sofia-sip/su_tagarg.h> declares a type ta_list and
  * defines four macros (ta_start(), ta_args(), ta_tags() and ta_end()) for
  * accessing the argument list.
  *
@@ -66,10 +66,11 @@
  * TAG_NULL() or TAG_NEXT().
  */
 
-/**Object for accessing tagged argument lists.
+/**Structure for accessing tagged argument lists.
  *
- * The called function must declare an object of type ta_list which is
- * used by the macros ta_start(), ta_args(), ta_tags(), and ta_end().
+ * The function called with tagged arguments must declare an object of type
+ * ta_list which is used by the macros ta_start(), ta_args(), ta_tags(), and
+ * ta_end().
  *
  * If a tagged list is not finished with TAG_END(), TAG_NULL(), or
  * TAG_NEXT() items, random errors may occur.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_time.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_time.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_time.h	Thu Oct 11 10:16:59 2007
@@ -78,7 +78,7 @@
 
 #define SU_TIME_CMP(t1, t2) su_time_cmp(t1, t2)
 
-/** Seconds from 1.1.1900 to 1.1.1970. @NEW_1_12_4 */
+/** Seconds from 1.1.1900 to 1.1.1970. @NEW_1_12_4. */
 #define SU_TIME_EPOCH 2208988800UL 
 
 typedef uint64_t su_nanotime_t;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_types.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_types.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_types.h	Thu Oct 11 10:16:59 2007
@@ -68,7 +68,7 @@
 
 #if DOXYGEN_ONLY || (!SU_HAVE_STDINT && !SU_HAVE_INTTYPES && SU_HAVE_WIN32)
 
-/* Use macros defined in <su_configure_win32.h> */
+/* Use macros defined in <sofia-sip/su_configure_win32.h> */
 
 #ifndef _INTPTR_T_DEFINED
 /** Integer type large enough to store pointers */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_wait.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_wait.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_wait.h	Thu Oct 11 10:16:59 2007
@@ -213,11 +213,11 @@
 /**Default type of application context for <a href="#su_root_t">su_root_t</a>.
  *
  * Application may define the typedef ::su_root_magic_t to appropriate type
- * by defining macro SU_ROOT_MAGIC_T before including <su_wait.h>, for
+ * by defining macro SU_ROOT_MAGIC_T before including <sofia-sip/su_wait.h>, for
  * example,
  * @code
  * #define SU_ROOT_MAGIC_T struct context
- * #include <su_wait.h>
+f * #include <sofia-sip/su_wait.h>
  * @endcode
  */
 #define SU_ROOT_MAGIC_T void
@@ -226,11 +226,11 @@
 /** <a href="#su_root_t">Root context</a> pointer type.
  *
  * Application may define the typedef ::su_root_magic_t to appropriate type
- * by defining macro SU_ROOT_MAGIC_T () before including <su_wait.h>, for
+ * by defining macro SU_ROOT_MAGIC_T () before including <sofia-sip/su_wait.h>, for
  * example,
  * @code
  * #define SU_ROOT_MAGIC_T struct context
- * #include <su_wait.h>
+ * #include <sofia-sip/su_wait.h>
  * @endcode
  */
 typedef SU_ROOT_MAGIC_T su_root_magic_t;
@@ -240,10 +240,10 @@
  * @link ::su_wakeup_arg_t argument type @endlink.  
  *
  * The application can define the typedef ::su_wakeup_arg_t by defining
- * the SU_WAKEUP_ARG_T () before including <su_wait.h>, for example,
+ * the SU_WAKEUP_ARG_T () before including <sofia-sip/su_wait.h>, for example,
  * @code
  * #define SU_WAKEUP_ARG_T struct transport
- * #include <su_wait.h>
+ * #include <sofia-sip/su_wait.h>
  * @endcode
  */
 #define SU_WAKEUP_ARG_T void
@@ -252,10 +252,10 @@
 /** @link ::su_wakeup_f Wakeup callback @endlink argument type. 
  *
  * The application can define the typedef ::su_wakeup_arg_t by defining
- * the SU_WAKEUP_ARG_T () before including <su_wait.h>, for example,
+ * the SU_WAKEUP_ARG_T () before including <sofia-sip/su_wait.h>, for example,
  * @code
  * #define SU_WAKEUP_ARG_T struct transport
- * #include <su_wait.h>
+ * #include <sofia-sip/su_wait.h>
  * @endcode
  */
 typedef SU_WAKEUP_ARG_T su_wakeup_arg_t;
@@ -287,11 +287,11 @@
 /**Default type of application context for prepoll function.
  *
  * Application may define the typedef ::su_prepoll_magic_t to appropriate type
- * by defining macro #SU_PREPOLL_MAGIC_T before including <su_wait.h>, for
+ * by defining macro #SU_PREPOLL_MAGIC_T before including <sofia-sip/su_wait.h>, for
  * example,
  * @code
  * #define SU_PREPOLL_MAGIC_T struct context
- * #include <su_wait.h>
+ * #include <sofia-sip/su_wait.h>
  * @endcode
  */
 #define SU_PREPOLL_MAGIC_T void
@@ -300,11 +300,11 @@
 /** <a href="#su_root_t">Root context</a> pointer type.
  *
  * Application may define the typedef ::su_prepoll_magic_t to appropriate type
- * by defining macro #SU_PREPOLL_MAGIC_T before including <su_wait.h>, for
+ * by defining macro #SU_PREPOLL_MAGIC_T before including <sofia-sip/su_wait.h>, for
  * example,
  * @code
  * #define SU_PREPOLL_MAGIC_T struct context
- * #include <su_wait.h>
+ * #include <sofia-sip/su_wait.h>
  * @endcode
  */
 typedef SU_PREPOLL_MAGIC_T su_prepoll_magic_t;
@@ -326,7 +326,7 @@
 #ifndef SU_TIMER_ARG_T
 /** Default type of timer expiration callback function argument type.
  * Application may define this to appropriate type before including
- * <su_wait.h>. */
+ * <sofia-sip/su_wait.h>. */
 #define SU_TIMER_ARG_T void 
 #endif
 
@@ -370,7 +370,7 @@
 /* Messages */
 #ifndef SU_MSG_ARG_T
 /** Default type of su_msg_t message data.  Application may define this to
- * appropriate type before including <su_wait.h>.
+ * appropriate type before including <sofia-sip/su_wait.h>.
  */
 #define SU_MSG_ARG_T void 
 #endif
@@ -477,6 +477,10 @@
 
 SOFIAPUBFUN int su_root_yield(su_root_t *root);
 
+SOFIAPUBFUN int su_root_release(su_root_t *root);
+SOFIAPUBFUN int su_root_obtain(su_root_t *root);
+SOFIAPUBFUN int su_root_has_thread(su_root_t *root);
+
 /* Timers */
 SOFIAPUBFUN su_timer_t *su_timer_create(su_task_r const, su_duration_t msec)
      __attribute__((__malloc__));

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/strcasestr.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/strcasestr.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/strcasestr.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@file strcasestr.c
+/**@internal @file strcasestr.c
  * @brief Backup implementation of strcasestr()
  *  
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c	Thu Oct 11 10:16:59 2007
@@ -22,14 +22,6 @@
  *
  */
 
-/**@ingroup su_alloc
- * @CFILE su_alloc.c  Home-based memory management.
- *
- * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
- * 
- * @date Created: Thu Aug 19 01:12:25 1999 ppessi
- */
-
 #include "config.h"
 
 /**@defgroup su_alloc Memory Management Tutorial
@@ -181,6 +173,14 @@
  * where the stack frame used in su_home_auto() was allocated.
  */
 
+/**@ingroup su_alloc
+ * @CFILE su_alloc.c  Home-based memory management.
+ *
+ * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
+ * 
+ * @date Created: Thu Aug 19 01:12:25 1999 ppessi
+ */
+
 #include <sofia-sip/su_config.h>
 #include "sofia-sip/su_alloc.h"
 #include "sofia-sip/su_alloc_stat.h"

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c	Thu Oct 11 10:16:59 2007
@@ -73,8 +73,7 @@
   if (self) {
     self->sup_vtable = vtable;
     self->sup_tail = &self->sup_head;
-
-    return 0;
+    return su_port_obtain(self);
   }
 
   return -1;
@@ -83,6 +82,8 @@
 /** @internal Deinit a base implementation of port. */
 void su_base_port_deinit(su_port_t *self)
 {
+  if (su_port_own_thread(self))
+    su_port_release(self);
 }
 
 void su_base_port_lock(su_port_t *self, char const *who)
@@ -93,9 +94,27 @@
 {
 }
 
-int su_base_port_own_thread(su_port_t const *self)
+/** @internal Dummy implementation of su_port_thread() method.
+ *
+ * Currently this is only used if SU_HAVE_PTHREADS is 0.
+ */
+int su_base_port_thread(su_port_t const *self, 
+			enum su_port_thread_op op)
 {
-  return 1;
+  switch (op) {
+
+  case su_port_thread_op_is_obtained:
+    return 2;			/* Current thread has obtained the port */
+
+  case su_port_thread_op_release:
+    return errno = ENOSYS, -1;
+
+  case su_port_thread_op_obtain:
+    return 0;			/* Allow initial obtain */
+
+  default:
+    return errno = ENOSYS, -1;
+  }
 }
 
 void su_base_port_incref(su_port_t *self, char const *who)
@@ -278,12 +297,6 @@
   return 0;
 }
 
-/** @internal Enable threadsafe operation. */
-int su_base_port_threadsafe(su_port_t *self)
-{
-  return su_home_threadsafe(self->sup_home);
-}
-
 /** @internal Main loop.
  * 
  * The function @c su_port_run() waits for wait objects and the timers
@@ -482,22 +495,6 @@
   return &self->sup_timers;
 }
 
-/* ====================================================================== */
-
-/** @internal 
- * Used to check wait events in callbacks that take lots of time
- *
- * This function does a timeout 0 poll() and runs wait objects.
- *
- * @param port     pointer to port
- *
- * @return number of events handled
- */
-int su_base_port_yield(su_port_t *self)
-{
-  return self->sup_vtable->su_port_wait_events(self, 0);
-}
-
 /* ====================================================================== 
  * Clones 
  */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_bm.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_bm.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_bm.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file su_bm.c
  * @brief Search with Boyer-Moore algorithm
  *  

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_devpoll_port.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_devpoll_port.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_devpoll_port.c	Thu Oct 11 10:16:59 2007
@@ -136,13 +136,11 @@
       su_base_port_run,
       su_base_port_break,
       su_base_port_step,
-      su_pthread_port_own_thread,
+      su_pthread_port_thread,
       su_base_port_add_prepoll,
       su_base_port_remove_prepoll,
       su_base_port_timers,
       su_devpoll_port_multishot,
-      su_base_port_threadsafe,
-      su_base_port_yield,
       su_devpoll_port_wait_events,
       su_base_port_getmsgs,
       su_base_port_getmsgs_from,

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_epoll_port.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_epoll_port.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_epoll_port.c	Thu Oct 11 10:16:59 2007
@@ -131,13 +131,11 @@
       su_base_port_run,
       su_base_port_break,
       su_base_port_step,
-      su_pthread_port_own_thread,
+      su_pthread_port_thread,
       su_base_port_add_prepoll,
       su_base_port_remove_prepoll,
       su_base_port_timers,
       su_epoll_port_multishot,
-      su_base_port_threadsafe,
-      su_base_port_yield,
       su_epoll_port_wait_events,
       su_base_port_getmsgs,
       su_base_port_getmsgs_from,

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c	Thu Oct 11 10:16:59 2007
@@ -128,13 +128,11 @@
       su_base_port_run,
       su_base_port_break,
       su_base_port_step,
-      su_pthread_port_own_thread,
+      su_pthread_port_thread,
       su_base_port_add_prepoll,
       su_base_port_remove_prepoll,
       su_base_port_timers,
       su_kqueue_port_multishot,
-      su_base_port_threadsafe,
-      su_base_port_yield,
       su_kqueue_port_wait_events,
       su_base_port_getmsgs,
       su_base_port_getmsgs_from,

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_module_debug.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_module_debug.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_module_debug.h	Thu Oct 11 10:16:59 2007
@@ -27,7 +27,7 @@
 #define SU_MODULE_DEBUG_H
 
 /**@ingroup su_log
- * @file su_module_debug.h
+ * @internal @file su_module_debug.h
  * @brief Debug log for @b su module
  *
  * The su_module_debug.h defines a common debug log #su_log_global for all

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_osx_runloop.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_osx_runloop.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_osx_runloop.c	Thu Oct 11 10:16:59 2007
@@ -117,39 +117,6 @@
   return "CFRunLoop";
 }
 
-su_port_vtable_t const su_osx_port_vtable[1] =
-  {{
-      /* su_vtable_size: */ sizeof su_osx_port_vtable,
-      su_pthread_port_lock,
-      su_pthread_port_unlock,
-      su_base_port_incref,
-      su_osx_port_decref,
-      su_base_port_gsource,
-      su_osx_port_send,
-      su_osx_port_register,
-      su_osx_port_unregister,
-      su_osx_port_deregister,
-      su_osx_port_unregister_all,
-      su_osx_port_eventmask,
-      su_osx_port_run,
-      su_osx_port_break,
-      su_osx_port_step,
-      su_pthread_port_own_thread,
-      su_base_port_add_prepoll,
-      su_base_port_remove_prepoll,
-      su_base_port_timers,
-      su_osx_port_multishot,
-      su_base_port_threadsafe,
-      su_base_port_yield,
-      su_osx_port_wait_events,
-      su_base_port_getmsgs,
-      su_base_port_getmsgs_from,
-      su_osx_port_name,
-      su_base_port_start_shared,
-      su_pthread_port_wait,
-      su_pthread_port_execute,
-    }};
-
 /*
  * Port is a per-thread reactor.  
  *
@@ -208,6 +175,37 @@
 };
 
 
+su_port_vtable_t const su_osx_port_vtable[1] =
+  {{
+      /* su_vtable_size: */ sizeof su_osx_port_vtable,
+      su_pthread_port_lock,
+      su_pthread_port_unlock,
+      su_base_port_incref,
+      su_osx_port_decref,
+      su_base_port_gsource,
+      su_osx_port_send,
+      su_osx_port_register,
+      su_osx_port_unregister,
+      su_osx_port_deregister,
+      su_osx_port_unregister_all,
+      su_osx_port_eventmask,
+      su_osx_port_run,
+      su_osx_port_break,
+      su_osx_port_step,
+      su_pthread_port_thread,
+      su_base_port_add_prepoll,
+      su_base_port_remove_prepoll,
+      su_base_port_timers,
+      su_osx_port_multishot,
+      su_osx_port_wait_events,
+      su_base_port_getmsgs,
+      su_base_port_getmsgs_from,
+      su_osx_port_name,
+      su_base_port_start_shared,
+      su_pthread_port_wait,
+      su_pthread_port_execute,
+    }};
+
 /* XXX - mela static void su_osx_port_destroy(su_port_t *self); */
 
 /** Create a reactor object.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_poll_port.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_poll_port.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_poll_port.c	Thu Oct 11 10:16:59 2007
@@ -129,13 +129,11 @@
       su_base_port_run,
       su_base_port_break,
       su_base_port_step,
-      su_pthread_port_own_thread,
+      su_pthread_port_thread,
       su_base_port_add_prepoll,
       su_base_port_remove_prepoll,
       su_base_port_timers,
       su_poll_port_multishot,
-      su_base_port_threadsafe,
-      su_base_port_yield,
       su_poll_port_wait_events,
       su_base_port_getmsgs,
       su_base_port_getmsgs_from,

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.h	Thu Oct 11 10:16:59 2007
@@ -26,7 +26,7 @@
 /** Defined when <su_port.h> has been included. */
 #define SU_PORT_H
 
-/**@IFILE su_port.h 
+/**@internal @file su_port.h 
  *
  * @brief Internal OS-independent syncronization interface.
  *
@@ -59,7 +59,7 @@
 
 SOFIA_BEGIN_DECLS
 
-/** Message */
+/** @internal Message */
 struct su_msg_s {
   isize_t        sum_size;
   su_msg_t      *sum_next;
@@ -72,7 +72,7 @@
 
 struct _GSource;
 
-/** Root structure */
+/** @internal Root structure */
 struct su_root_s {
   int              sur_size;
   su_root_magic_t *sur_magic;
@@ -85,7 +85,13 @@
 
 #define SU_ROOT_MAGIC(r) ((r) ? (r)->sur_magic : NULL)
 
-/** Virtual function table for port */
+enum su_port_thread_op {
+  su_port_thread_op_is_obtained,
+  su_port_thread_op_release,
+  su_port_thread_op_obtain
+};
+  
+/** @internal Virtual function table for port */
 typedef struct su_port_vtable {
   unsigned su_vtable_size;
   void (*su_port_lock)(su_port_t *port, char const *who);
@@ -113,7 +119,8 @@
   void (*su_port_break)(su_port_t *self);
   su_duration_t (*su_port_step)(su_port_t *self, su_duration_t tout);
   
-  int (*su_port_own_thread)(su_port_t const *port);
+  /* Reused slot */
+  int (*su_port_thread)(su_port_t *port, enum su_port_thread_op op);
   
   int (*su_port_add_prepoll)(su_port_t *port,
 			     su_root_t *root, 
@@ -127,9 +134,6 @@
 
   int (*su_port_multishot)(su_port_t *port, int multishot);
 
-  int (*su_port_threadsafe)(su_port_t *port);
-  /* Extension from > 1.12.0 */
-  int (*su_port_yield)(su_port_t *port);
   /* Extension from >= 1.12.4 */
   int (*su_port_wait_events)(su_port_t *port, su_duration_t timeout);
   int (*su_port_getmsgs)(su_port_t *port);
@@ -192,52 +196,49 @@
 void su_port_lock(su_port_t *self, char const *who)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base) base->sup_vtable->su_port_lock(self, who);
+  base->sup_vtable->su_port_lock(self, who);
 }
 
 su_inline
 void su_port_unlock(su_port_t *self, char const *who)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base) base->sup_vtable->su_port_unlock(self, who);
+  base->sup_vtable->su_port_unlock(self, who);
 }
 
 su_inline
 void su_port_incref(su_port_t *self, char const *who)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base) base->sup_vtable->su_port_incref(self, who);
+  base->sup_vtable->su_port_incref(self, who);
 }
 
 su_inline
 void su_port_decref(su_port_t *self, char const *who)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base) base->sup_vtable->su_port_decref(self, 0, who);
+  base->sup_vtable->su_port_decref(self, 0, who);
 }
 
 su_inline
 void su_port_zapref(su_port_t *self, char const *who)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base) base->sup_vtable->su_port_decref(self, 1, who);
+  base->sup_vtable->su_port_decref(self, 1, who);
 }
 
 su_inline
 struct _GSource *su_port_gsource(su_port_t *self)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  return base ? base->sup_vtable->su_port_gsource(self) : NULL;
+  return base->sup_vtable->su_port_gsource(self);
 }
 
 su_inline
 int su_port_send(su_port_t *self, su_msg_r rmsg)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base) 
-    return base->sup_vtable->su_port_send(self, rmsg);
-  errno = EINVAL;
-  return -1;
+  return base->sup_vtable->su_port_send(self, rmsg);
 }
 
 
@@ -250,11 +251,8 @@
 		     int priority)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->su_port_register(self, root, wait,
-					      callback, arg, priority);
-  errno = EINVAL;
-  return -1;
+  return base->sup_vtable->
+    su_port_register(self, root, wait, callback, arg, priority);
 }
 
 su_inline
@@ -265,21 +263,16 @@
 		       su_wakeup_arg_t *arg)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->
-      su_port_unregister(self, root, wait, callback, arg);
-  errno = EINVAL;
-  return -1;
+  return base->sup_vtable->
+    su_port_unregister(self, root, wait, callback, arg);
 }
 
 su_inline
 int su_port_deregister(su_port_t *self, int i)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->su_port_deregister(self, i);
-  errno = EINVAL;
-  return -1;
+  return base->sup_vtable->
+    su_port_deregister(self, i);
 }
 
 su_inline
@@ -287,49 +280,47 @@
 			   su_root_t *root)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->
-      su_port_unregister_all(self, root);
-  errno = EINVAL;
-  return -1;
+  return base->sup_vtable->
+    su_port_unregister_all(self, root);
 }
 
 su_inline
 int su_port_eventmask(su_port_t *self, int index, int socket, int events)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->
-      su_port_eventmask(self, index, socket, events);
-  assert(base);
-  errno = EINVAL;
-  return -1;
+  return base->sup_vtable->
+    su_port_eventmask(self, index, socket, events);
+}
+
+su_inline
+int su_port_wait_events(su_port_t *self, su_duration_t timeout)
+{
+  su_virtual_port_t *base = (su_virtual_port_t *)self;
+  if (base->sup_vtable->su_port_wait_events == NULL)
+    return errno = ENOSYS, -1;
+  return base->sup_vtable->
+    su_port_wait_events(self, timeout);
 }
 
 su_inline
 void su_port_run(su_port_t *self)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    base->sup_vtable->su_port_run(self);
+  base->sup_vtable->su_port_run(self);
 }
 
 su_inline
 void su_port_break(su_port_t *self)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    base->sup_vtable->su_port_break(self);
+  base->sup_vtable->su_port_break(self);
 }
 
 su_inline
 su_duration_t su_port_step(su_port_t *self, su_duration_t tout)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->su_port_step(self, tout);
-  errno = EINVAL;
-  return (su_duration_t)-1;
+  return base->sup_vtable->su_port_step(self, tout);
 }
 
 
@@ -337,7 +328,26 @@
 int su_port_own_thread(su_port_t const *self)
 {
   su_virtual_port_t const *base = (su_virtual_port_t *)self;
-  return base == NULL || base->sup_vtable->su_port_own_thread(self);
+  return base->sup_vtable->
+    su_port_thread((su_port_t *)self, su_port_thread_op_is_obtained) == 2;
+}
+
+su_inline int su_port_has_thread(su_port_t *self)
+{
+  su_virtual_port_t *base = (su_virtual_port_t *)self;
+  return base->sup_vtable->su_port_thread(self, su_port_thread_op_is_obtained);
+}
+
+su_inline int su_port_release(su_port_t *self)
+{
+  su_virtual_port_t *base = (su_virtual_port_t *)self;
+  return base->sup_vtable->su_port_thread(self, su_port_thread_op_release);
+}
+
+su_inline int su_port_obtain(su_port_t *self)
+{
+  su_virtual_port_t *base = (su_virtual_port_t *)self;
+  return base->sup_vtable->su_port_thread(self, su_port_thread_op_obtain);
 }
 
 su_inline
@@ -347,11 +357,7 @@
 			su_prepoll_magic_t *magic)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->
-      su_port_add_prepoll(self, root, prepoll, magic);
-  errno = EINVAL;
-  return -1;
+  return base->sup_vtable->su_port_add_prepoll(self, root, prepoll, magic);
 }
 
 su_inline
@@ -359,51 +365,27 @@
 			   su_root_t *root)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->su_port_remove_prepoll(self, root);
-  errno = EINVAL;
-  return -1;
+  return base->sup_vtable->su_port_remove_prepoll(self, root);
 }
 
 su_inline
 su_timer_t **su_port_timers(su_port_t *self)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->su_port_timers(self);
-  errno = EINVAL;
-  return NULL;
+  return base->sup_vtable->su_port_timers(self);
 }
 
 su_inline
 int su_port_multishot(su_port_t *self, int multishot)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->su_port_multishot(self, multishot);
-
-  assert(base);
-  errno = EINVAL;
-  return -1;
-}
-
-su_inline
-int su_port_threadsafe(su_port_t *self)
-{
-  su_virtual_port_t *base = (su_virtual_port_t *)self;
-  if (base)
-    return base->sup_vtable->su_port_threadsafe(self);
-
-  assert(base);
-  errno = EINVAL;
-  return -1;
+  return base->sup_vtable->su_port_multishot(self, multishot);
 }
 
 su_inline
 int su_port_getmsgs(su_port_t *self)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-
   return base->sup_vtable->su_port_getmsgs(self);
 }
 
@@ -411,7 +393,6 @@
 int su_port_getmsgs_from(su_port_t *self, su_port_t *cloneport)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
-
   return base->sup_vtable->su_port_getmsgs_from(self, cloneport);
 }
 
@@ -423,7 +404,7 @@
 
 /* ---------------------------------------------------------------------- */
 
-/** Base port object.
+/**@internal Base port object.
  *
  * Port is a per-thread reactor. Multiple root objects executed by a single
  * thread share the su_port_t object.
@@ -456,7 +437,8 @@
 SOFIAPUBFUN void su_base_port_lock(su_port_t *self, char const *who);
 SOFIAPUBFUN void su_base_port_unlock(su_port_t *self, char const *who);
 
-SOFIAPUBFUN int su_base_port_own_thread(su_port_t const *self);
+SOFIAPUBFUN int su_base_port_thread(su_port_t const *self,
+				    enum su_port_thread_op op);
 
 SOFIAPUBFUN void su_base_port_incref(su_port_t *self, char const *who);
 SOFIAPUBFUN int su_base_port_decref(su_port_t *self,
@@ -486,8 +468,6 @@
 SOFIAPUBFUN su_timer_t **su_base_port_timers(su_port_t *self);
 
 SOFIAPUBFUN int su_base_port_multishot(su_port_t *self, int multishot);
-SOFIAPUBFUN int su_base_port_threadsafe(su_port_t *self);
-SOFIAPUBFUN int su_base_port_yield(su_port_t *self);
 
 SOFIAPUBFUN int su_base_port_start_shared(su_root_t *parent,
 					  su_clone_r return_clone,
@@ -502,12 +482,14 @@
 
 #include <pthread.h>
 
-/** Pthread port object */ 
+/** @internal Pthread port object */ 
 typedef struct su_pthread_port_s {
   su_base_port_t   sup_base[1];
   struct su_pthread_port_waiting_parent 
                   *sup_waiting_parent;
   pthread_t        sup_tid;
+  pthread_mutex_t  sup_obtained[1];
+
 #if 0
   pthread_mutex_t  sup_runlock[1];
   pthread_cond_t   sup_resume[1];
@@ -524,7 +506,8 @@
 SOFIAPUBFUN void su_pthread_port_lock(su_port_t *self, char const *who);
 SOFIAPUBFUN void su_pthread_port_unlock(su_port_t *self, char const *who);
 
-SOFIAPUBFUN int su_pthread_port_own_thread(su_port_t const *self);
+SOFIAPUBFUN int su_pthread_port_thread(su_port_t *self,
+				       enum su_port_thread_op op);
 
 #if 0				/* not yet  */
 SOFIAPUBFUN int su_pthread_port_send(su_port_t *self, su_msg_r rmsg);
@@ -563,7 +546,7 @@
 #define su_pthread_port_deinit su_base_port_deinit
 #define su_pthread_port_lock   su_base_port_lock
 #define su_pthread_port_unlock su_base_port_unlock
-#define su_pthread_port_own_thread su_base_port_own_thread
+#define su_pthread_port_thread su_base_port_thread
 #define su_pthread_port_wait   su_base_port_wait
 #define su_pthread_port_execute  su_base_port_execute
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_proxy.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_proxy.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_proxy.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@ingroup su_root_ex
+/**@internal @ingroup su_root_ex
  *
  * @file su_proxy.c 
  *

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c	Thu Oct 11 10:16:59 2007
@@ -72,16 +72,9 @@
   SU_DEBUG_9(("su_pthread_port_init(%p, %p) called\n",
 	      (void *)self, (void *)vtable));
 
-  self->sup_tid = pthread_self();
+  pthread_mutex_init(self->sup_obtained, NULL);
 
-  if (su_base_port_init(self, vtable) == 0 &&
-      su_base_port_threadsafe(self) == 0) {
-    return 0;
-  }
-  else
-    su_base_port_deinit(self);
-
-  return -1;
+  return su_base_port_init(self, vtable);
 }
 
 
@@ -90,12 +83,13 @@
 {
   assert(self);
 
+  su_base_port_deinit(self);
+
 #if 0
   pthread_mutex_destroy(self->sup_runlock);
   pthread_cond_destroy(self->sup_resume);
 #endif
-
-  su_base_port_deinit(self);
+  pthread_mutex_destroy(self->sup_obtained);
 }
 
 void su_pthread_port_lock(su_port_t *self, char const *who)
@@ -118,17 +112,46 @@
 }
 
 /** @internal
- * Checks if the calling thread owns the port object.
+ *
+ * Change or query ownership of the port object.
  *
  * @param self pointer to a port object
+ * @param op operation 
  *
- * @retval true (nonzero) if the calling thread owns the port,
- * @retval false (zero) otherwise.
+ * @ERRORS
+ * @ERROR EALREADY port already has an owner (or has no owner)
  */
-int su_pthread_port_own_thread(su_port_t const *self)
+int su_pthread_port_thread(su_port_t *self, enum su_port_thread_op op)
 {
-  return self == NULL || 
-    pthread_equal(self->sup_tid, pthread_self());
+  pthread_t me = pthread_self();
+
+  switch (op) {
+
+  case su_port_thread_op_is_obtained:
+    if (self->sup_thread == 0)
+      return 0;			/* No thread has obtained the port */
+    else if (pthread_equal(self->sup_tid, me))
+      return 2;			/* Current thread has obtained the port */
+    else
+      return 1;			/* A thread has obtained the port */
+
+  case su_port_thread_op_release:
+    if (!self->sup_thread || !pthread_equal(self->sup_tid, me))
+      return errno = EALREADY, -1;
+    self->sup_thread = 0;
+    pthread_mutex_unlock(self->sup_obtained);
+    return 0;
+
+  case su_port_thread_op_obtain:
+    su_home_threadsafe(su_port_home(self));
+    pthread_mutex_lock(self->sup_obtained);
+    self->sup_tid = me;
+    self->sup_thread = 1;
+    return 0;
+
+  default:
+    return errno = ENOSYS, -1;
+  }
 }
 
 /* -- Clones ------------------------------------------------------------ */

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_root.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_root.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_root.c	Thu Oct 11 10:16:59 2007
@@ -315,7 +315,7 @@
  */
 su_timer_queue_t *su_task_timers(su_task_r const task)
 {
-  return task ? su_port_timers(task->sut_port) : NULL;
+  return task->sut_port ? su_port_timers(task->sut_port) : NULL;
 }
 
 /** Execute the @a function by @a task thread.
@@ -355,7 +355,7 @@
 #define sur_port sur_task->sut_port
 #define sur_root sur_task->sut_root
 
-#define SU_ROOT_OWN_THREAD(r) (su_port_own_thread(r->sur_port))
+#define SU_ROOT_OWN_THREAD(r) (r->sur_port && su_port_own_thread(r->sur_port))
 
 /** Create a reactor object.
  *
@@ -458,14 +458,14 @@
  *
  * @return Instance name (e.g., "epoll", "devpoll", "select").
  *
- * @NEW_1_12_6
+ * @NEW_1_12_6.
  */
 char const *su_root_name(su_root_t *self)
 {
-  if (self && self->sur_task->sut_port)
-    return su_port_name(self->sur_task->sut_port);
-  else
-    return NULL;
+  if (!self)
+    return (void)(errno = EFAULT), NULL;
+  assert(self->sur_port);
+  return su_port_name(self->sur_task->sut_port);
 }
 
 /** Set the context pointer.
@@ -480,12 +480,10 @@
  */
 int su_root_set_magic(su_root_t *self, su_root_magic_t *magic)
 {
+  if (self == NULL)
+    return (void)(errno = EFAULT), -1;
   assert(SU_ROOT_OWN_THREAD(self));
-
-  if (self) {
-    self->sur_magic = magic;
-  }
-
+  self->sur_magic = magic;
   return 0;
 }
 
@@ -500,16 +498,15 @@
  */
 int su_root_threading(su_root_t *self, int enable)
 {
-  if (self) {
-    assert(SU_ROOT_OWN_THREAD(self));
-
+  if (self == NULL)
+    return (void)(errno = EFAULT), -1;
+  assert(SU_ROOT_OWN_THREAD(self));
 #if SU_HAVE_PTHREADS
-    self->sur_threading = enable = enable != 0;
-    return enable;
-#endif
-  }
-
+  self->sur_threading = enable = enable != 0;
+  return enable;
+#else
   return 0;
+#endif
 }
 
 /** Get context pointer.
@@ -523,13 +520,20 @@
  */
 su_root_magic_t *su_root_magic(su_root_t *self)
 {
-  return self ? self->sur_magic : NULL;
+  if (!self)
+    return (void)(errno = EFAULT), NULL;
+
+  return self->sur_magic;
 }
 
 /** Get a GSource */
 struct _GSource *su_root_gsource(su_root_t *self)
 {
-  return self ? su_port_gsource(self->sur_port) : NULL;
+  if (!self)
+    return (void)(errno = EFAULT), NULL;
+  assert(self->sur_port);
+
+  return su_port_gsource(self->sur_port);
 }
 
 /** Register a su_wait_t object. 
@@ -557,10 +561,9 @@
 		     su_wakeup_arg_t *arg,
 		     int priority)
 {
-  assert(self && self->sur_port);
-
-  if (!self || !self->sur_port)
-    return -1;
+  if (!self || !wait)
+    return (void)(errno = EFAULT), -1;
+  assert(self->sur_port);
 
   return su_port_register(self->sur_port, self, wait, callback, arg, priority);
 }
@@ -584,10 +587,9 @@
 		       su_wakeup_f callback, /* XXX - ignored */
 		       su_wakeup_arg_t *arg)
 {
-  assert(self && self->sur_port);
-
-  if (!self || !self->sur_port)
-    return -1;
+  if (!self || !wait)
+    return (void)(errno = EFAULT), -1;
+  assert(self->sur_port);
 
   return su_port_unregister(self->sur_port, self, wait, callback, arg);
 }
@@ -599,21 +601,19 @@
  *  root object. The wait object is destroyed.
  *
  * @param self      pointer to root object
- * @param i         registration index
+ * @param index     registration index
  *
  * @return Index of the wait object, or -1 upon an error.
  */
-int su_root_deregister(su_root_t *self, int i)
+int su_root_deregister(su_root_t *self, int index)
 {
-  if (i == 0 || i == -1)
-    return -1;
-
-  assert(self && self->sur_port);
-
-  if (!self || !self->sur_port)
-    return -1;
+  if (!self)
+    return (void)(errno = EFAULT), -1;
+  if (index == 0 || index == -1)
+    return (void)(errno = EINVAL), -1;
+  assert(self->sur_port);
 
-  return su_port_deregister(self->sur_port, i);
+  return su_port_deregister(self->sur_port, index);
 }
 
 /** Set mask for a registered event.
@@ -631,10 +631,11 @@
  */
 int su_root_eventmask(su_root_t *self, int index, int socket, int events)
 {
-  assert(self && self->sur_port);
-
-  if (!self || !self->sur_port)
-    return -1;
+  if (!self)
+    return (void)(errno = EFAULT), -1;
+  if (index == 0 || index == -1)
+    return (void)(errno = EINVAL), -1;
+  assert(self->sur_port);
 
   return su_port_eventmask(self->sur_port, index, socket, events);
 }
@@ -656,11 +657,10 @@
  */
 int su_root_multishot(su_root_t *self, int multishot)
 {
-  if (self && self->sur_port) {
-    return su_port_multishot(self->sur_port, multishot);
-  } else {
-    return (errno = EINVAL), -1;
-  }
+  if (!self)
+    return (void)(errno = EFAULT), -1;
+  assert(self->sur_port);
+  return su_port_multishot(self->sur_port, multishot);
 }
 
 /** Run event and message loop.
@@ -677,10 +677,11 @@
  */
 void su_root_run(su_root_t *self)
 {
-  assert(self && self->sur_port);
+  if (!self)
+    return /* (void)(errno = EFAULT), -1 */;
+  assert(self->sur_port);
 
-  if (self && self->sur_port)
-    su_port_run(self->sur_port);
+  /* return */ su_port_run(self->sur_port);
 }
 
 /** Terminate event loop.
@@ -692,10 +693,11 @@
  */
 void su_root_break(su_root_t *self)
 {
-  assert(self && self->sur_port);
+  if (!self)
+    return /* (void)(errno = EFAULT), -1 */;
+  assert(self->sur_port);
 
-  if (self && self->sur_port)
-    su_port_break(self->sur_port);
+  /* return */ su_port_break(self->sur_port);
 }
 
 /** Process events, timers and messages.
@@ -710,13 +712,14 @@
  * @param self      pointer to root object
  * @param tout      timeout in milliseconds
  *
- * @return Milliseconds to the next invocation of timer, or SU_WAIT_FOREVER
- *         if there are no active timers.
+ * @return Milliseconds to the next invocation of timer
+ * @retval SU_WAIT_FOREVER if there are no active timers or if there was an error
  */
 su_duration_t su_root_step(su_root_t *self, su_duration_t tout)
 {
-  assert(self && self->sur_port);
-
+  if (self == NULL)
+    return (void)(errno = EFAULT), SU_WAIT_FOREVER;
+  assert(self->sur_port);
   return su_port_step(self->sur_port, tout);
 }
 
@@ -729,13 +732,19 @@
  *
  * @param self      pointer to root object
  * @param duration  milliseconds to run event loop
+ *
+ * @retval milliseconds until next timer expiration
  */
 su_duration_t su_root_sleep(su_root_t *self, su_duration_t duration)
 {
   su_duration_t retval, accrued = 0;
-  su_time_t started = su_now();
+  su_time_t started;
+
+  if (self == NULL)
+    return (void)(errno = EFAULT), SU_WAIT_FOREVER;
 
-  assert(self && self->sur_port);
+  assert(self->sur_port);
+  started = su_now();
 
   do {
     retval = su_port_step(self->sur_port, duration - accrued);
@@ -753,35 +762,20 @@
  */
 int su_root_yield(su_root_t *self)
 {
-  if (self && self->sur_task[0].sut_port) {
-    su_virtual_port_t *port = (su_virtual_port_t *)self->sur_task[0].sut_port;
-    /* Make sure we have su_port_wait_events extension */
-    if (port->sup_vtable->su_vtable_size >= 
-	offsetof(su_port_vtable_t, su_port_wait_events) 
-	&& port->sup_vtable->su_port_wait_events)
-      return port->sup_vtable->
-	su_port_wait_events(self->sur_task[0].sut_port, 0);
-
-    /* Make sure we have su_port_yield extension */
-    if (port->sup_vtable->su_vtable_size >= 
-	offsetof(su_port_vtable_t, su_port_yield) 
-	&& port->sup_vtable->su_port_yield)
-    return port->sup_vtable->
-      su_port_yield(self->sur_task[0].sut_port);
-  }
-  errno = EINVAL;
-  return -1;
+  if (self == NULL)
+    return (void)(errno = EFAULT), SU_WAIT_FOREVER;
+  assert(self->sur_port);
+
+  return su_port_wait_events(self->sur_port, 0);
 }
 
 /** Get task reference.
  *
- *   The function su_root_task() is used to retrieve the task reference
- *   (PId) related with the root object.
+ * Retrieve the task reference related with the root object.
  *
  * @param self      a pointer to a root object
  *
- * @return The function su_root_task() returns a reference to the task
- *         object.
+ * @return A reference to the task object.
  */
 _su_task_r su_root_task(su_root_t const *self)
 {
@@ -793,13 +787,12 @@
 
 /** Get parent task reference.
  *
- *   The function su_root_parent() is used to retrieve the task reference
- *   (PId) of the parent task.
+ * Retrieve the task reference of the parent task associated with the root
+ * object.
  *
- * @param self      a pointer to a root object
+ * @param self a pointer to a root object
  *
- * @return The function su_root_parent() returns a reference to the parent
- *         task object.
+ * @return A reference to the parent task object.
  */
 _su_task_r su_root_parent(su_root_t const *self)
 {
@@ -814,8 +807,9 @@
 			su_prepoll_f *callback, 
 			su_prepoll_magic_t *magic)
 {
-  if (root == NULL || root->sur_port == NULL)
-    return -1;
+  if (root == NULL)
+    return (void)(errno = EFAULT), -1;
+  assert(root->sur_port);
 
   return su_port_add_prepoll(root->sur_port, root, callback, magic);
 }
@@ -823,12 +817,60 @@
 /** Remove a pre-poll callback */
 int su_root_remove_prepoll(su_root_t *root)
 {
-  if (root == NULL || root->sur_port == NULL)
-    return -1;
+  if (root == NULL)
+    return (void)(errno = EFAULT), -1;
+  assert(root->sur_port);
 
   return su_port_remove_prepoll(root->sur_port, root);
 }
 
+/** Release the root port for other threads.
+ *
+ * @NEW_1_12_7
+ */
+int su_root_release(su_root_t *root)
+{
+  if (root == NULL || root->sur_port == NULL)
+    return (void)(errno = EFAULT), -1;
+  return su_port_release(root->sur_port);
+}
+
+/** Obtain the root port from other thread. 
+ *
+ * @param root pointer to root object
+ *
+ * @retval 0 if successful
+ * @retval -1 upon an error
+ *
+ * @ERRORS
+ * @ERROR EFAULT 
+ * @NEW_1_12_7
+ */
+int su_root_obtain(su_root_t *root)
+{
+  if (root == NULL || root->sur_port == NULL)
+    return (void)(errno = EFAULT), -1;
+  return su_port_obtain(root->sur_port);
+}
+
+/**Check if a thread has obtained the root. 
+ *
+ * @param root a pointer to root object
+ *
+ * @retval 2 if current thread has obtained the root
+ * @retval 1 if an another thread  has obtained the root
+ * @retval 0 if no thread has obtained the root
+ * @retval -1 upon an error
+ *
+ * @NEW_1_12_7
+ */
+int su_root_has_thread(su_root_t *root)
+{
+  if (root == NULL || root->sur_port == NULL)
+    return (void)(errno = EFAULT), -1;
+  return su_port_has_thread(root->sur_port);
+}
+
 /* =========================================================================
  * Messages
  */
@@ -966,16 +1008,10 @@
   assert(rmsg);
 
   if (rmsg[0]) {
-    /* su_port_t *port = rmsg[0]->sum_to->sut_port; */
-
-    /* su_port_incref(port, "su_msg_destroy"); */
     SU_TASK_ZAP(rmsg[0]->sum_to, su_msg_destroy);
     SU_TASK_ZAP(rmsg[0]->sum_from, su_msg_destroy);
 
-    su_free(NULL /* port->sup_home */, rmsg[0]);
-    /* SU_PORT_UNLOCK(port, su_msg_destroy); */
-
-    /* su_port_decref(port, "su_msg_destroy"); */
+    su_free(NULL, rmsg[0]);
   }
 
   rmsg[0] = NULL;
@@ -1068,8 +1104,13 @@
 
   if (rmsg[0]) {
     su_msg_t *msg = rmsg[0];
-    assert(msg->sum_to->sut_port);
-    return su_port_send(msg->sum_to->sut_port, rmsg);
+
+    if (msg->sum_to->sut_port) 
+      return su_port_send(msg->sum_to->sut_port, rmsg);
+
+    su_msg_destroy(rmsg);
+    errno = EINVAL;
+    return -1;
   }
 
   return 0;		

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_select_port.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_select_port.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_select_port.c	Thu Oct 11 10:16:59 2007
@@ -148,13 +148,11 @@
       su_base_port_run,
       su_base_port_break,
       su_base_port_step,
-      su_pthread_port_own_thread,
+      su_pthread_port_thread,
       su_base_port_add_prepoll,
       su_base_port_remove_prepoll,
       su_base_port_timers,
       su_select_port_multishot,
-      su_base_port_threadsafe,
-      su_base_port_yield,
       su_select_port_wait_events,
       su_base_port_getmsgs,
       su_base_port_getmsgs_from,

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c	Thu Oct 11 10:16:59 2007
@@ -1299,7 +1299,7 @@
   }
 }
 
-/** Tag class for tags with size_t value. @NEW_1_12_5 */
+/** Tag class for tags with size_t value. @NEW_1_12_5. */
 tag_class_t size_tag_class[1] = 
   {{
     sizeof(int_tag_class),
@@ -1347,7 +1347,7 @@
   }
 }
 
-/** Tag class for tags with usize_t value. @NEW_1_12_5 */
+/** Tag class for tags with usize_t value. @NEW_1_12_5. */
 tag_class_t usize_tag_class[1] = 
   {{
     sizeof(int_tag_class),

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_win32_port.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_win32_port.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_win32_port.c	Thu Oct 11 10:16:59 2007
@@ -25,7 +25,7 @@
 /**@ingroup su_wait
  * @CFILE su_win32_port.c
  *
- * Port implementation using WSAEVENTs
+ * Port implementation using WSAEVENTs. Incomplete.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Kai Vehmanen <kai.vehmanen at nokia.com>
@@ -127,13 +127,11 @@
       su_base_port_run,
       su_base_port_break,
       su_base_port_step,
-      su_pthread_port_own_thread,
+      su_pthread_port_thread,
       su_base_port_add_prepoll,
       su_base_port_remove_prepoll,
       su_base_port_timers,
       su_wsevent_port_multishot,
-      su_base_port_threadsafe,
-      su_base_port_yield,
       su_wsevent_port_wait_events,
       su_base_port_getmsgs,
       su_base_port_getmsgs_from,

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/test_poll.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/test_poll.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/test_poll.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**@ingroup su_root_ex
+/**@internal 
  * @file test_poll.c
  * Example code for <sofia-sip/su_wait.h>.
  *

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_heap.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_heap.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_heap.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file torture_heap.c
  * @brief Test heap
  *
@@ -33,6 +33,7 @@
 
 #include <sofia-sip/heap.h>
 
+#include <unistd.h>
 #include <stddef.h>
 #include <string.h>
 #include <assert.h>
@@ -57,7 +58,6 @@
 static inline
 void set1(type1 *heap, size_t index, type1 e)
 {
-  assert(index > 0);
   e.index = index;
   heap[index] = e;
 }
@@ -73,7 +73,6 @@
 static inline
 void set2(type2 *heap, size_t index, type2 e)
 {
-  assert(index > 0);
   e->index = index;
   heap[index] = e;
 }
@@ -104,6 +103,82 @@
 
 char name[] = "torture_heap";
 
+size_t _set, _cmp;
+
+static int int_less(void *_array, size_t a, size_t b)
+{
+  int *array = _array;
+  _cmp++;
+  return array[a] < array[b];
+}
+
+static void int_swap(void *_array, size_t a, size_t b)
+{
+  int *array = _array;
+  int swap = array[a];
+  array[a] = array[b];
+  array[b] = swap;
+
+  _set++;
+}
+
+void test_sort(int *array, size_t r, size_t N)
+{
+  su_smoothsort(array, r, N, int_less, int_swap);
+}
+
+int test_smooth_sort()
+{
+  BEGIN();
+
+  size_t i, n, N = 300000;
+  int array[N];
+
+  size_t v1 = 3, v2 = 1;
+
+  for (n = v1; n <= N; n = v1 + v2 + 1, v2 = v1, v1 = n) {
+    for (i = 0; i < n; i++) {
+      array[i] = (int)(n - i - 1);
+    }
+
+    _set = 0;
+
+    /* write(1, ".", 1); */
+
+    test_sort(array, 0, n);
+
+    TEST_1(_set > 0); _set = 0;
+
+    test_sort(array, 0, n);
+
+    TEST(_set, 0);
+
+    for (i = 0; i < n; i++) {
+      TEST(array[i], i);
+    }
+  }
+
+  for (n = 4; n <= N; n *= 2) {
+    for (i = 0; i < n; i++) {
+      array[i] = (int)(n - i - 1);
+    }
+
+    /* write(1, "/", 1); */
+
+    test_sort(array, 0, n / 2);
+    test_sort(array, n / 2, n / 2);
+
+    for (i = 0; i < n / 2; i++) {
+      TEST(array[i], i + n / 2);
+    }
+    for (; i < n; i++) {
+      TEST(array[i], i - n / 2);
+    }
+  }
+  
+  END();
+}
+
 int test_value()
 {
   BEGIN();
@@ -112,7 +187,7 @@
   unsigned i, previous, n, N;
   unsigned char *tests;
 
-  N = 300000;
+  N = 3000;
 
   TEST_1(tests = calloc(sizeof (unsigned char), N + 1));
 
@@ -159,7 +234,8 @@
     tests[e.value] |= 4;
 
     previous = e.key;
-    TEST(heap1_remove(heap, 1).index, 1);
+    TEST(heap1_get(heap, 1).index, 1);
+    TEST(heap1_remove(heap, 1).index, 0);
   }
   TEST(n, N);
 
@@ -174,6 +250,12 @@
 
   TEST(heap1_used(heap), N);
 
+  heap1_sort(heap);
+  for (i = 1; i <= N; i++) {
+    type1 e = heap1_get(heap, i);
+    TEST(e.index, i);
+  }
+
   /* Remove 1000 entries from random places */
   previous = 0;
 
@@ -183,7 +265,8 @@
     e = heap1_get(heap, n);
     TEST(e.index, n);
     TEST(tests[e.value] & 8, 0); tests[e.value] |= 8;
-    TEST(heap1_remove(heap, n).index, n);
+    TEST(heap1_get(heap, n).index, n);
+    TEST(heap1_remove(heap, n).index, 0);
   }
 
   for (i = 1; i <= heap1_used(heap); i++) {
@@ -202,7 +285,8 @@
     tests[e.value] |= 8;
     TEST_1(previous <= e.key);
     previous = e.key;
-    TEST(heap1_remove(heap, 1).index, 1);
+    TEST(heap1_get(heap, 1).index, 1);
+    TEST(heap1_remove(heap, 1).index, 0);
   }
 
   for (i = 1; i <= N; i++) {
@@ -297,9 +381,41 @@
 
   TEST(heap2_used(heap), N);
 
-  /* Remove 1000 entries from random places */
-  previous = 0;
+  heap2_sort(heap);
+  for (i = 1; i <= N; i++) {
+    type2 const e = heap2_get(heap, i);
+    TEST_1(e); TEST(e->index, i);
+  }
 
+  heap2_sort(heap);
+  for (i = 1; i <= N; i++) {
+    type2 const e = heap2_get(heap, i);
+    TEST_1(e); TEST(e->index, i);
+  }
+
+  /* Remove all odd entries */
+  for (i = heap2_used(heap), n = 0; i > 0; i--) {
+    type2 e = heap2_get(heap, i);
+    TEST_1(e); TEST(e->index, i);
+
+    n++;
+
+    tests[e->value] |= 16;
+
+    if (e->value & 1) {
+      TEST(tests[e->value] & 8, 0); tests[e->value] |= 8;
+      heap2_remove(heap, i);
+    }
+  }
+
+  for (i = 1; i <= N; i++) {
+    if (i & 1)
+      TEST(tests[i] & 8, 8);
+    else
+      TEST(tests[i] & 8, 0);
+  }
+
+  /* Remove 1000 entries from random places */
   for (i = 0; i < 1000 && heap2_used(heap) > 0; i++) {
     type2 e;
     n = i * 397651 % heap2_used(heap) + 1;
@@ -330,7 +446,7 @@
   /* Remove rest */
   for (n = 0, previous = 0; heap2_used(heap) > 0; n++) {
     type2 e = heap2_remove(heap, 1);
-    TEST_1(e); TEST(e->index, 1);
+    TEST_1(e); TEST(e->index, 0);
     TEST(tests[e->value] & 8, 0);
     tests[e->value] |= 8;
     TEST_1(previous <= e->key);
@@ -338,7 +454,7 @@
   }
 
   for (i = 1; i <= N; i++) {
-    TEST(tests[i], 8 | 4 | 2 | 1);
+    TEST(tests[i], 16 | 8 | 4 | 2 | 1);
   }
 
   TEST(heap2_resize(NULL, &heap, 63), 0);
@@ -351,6 +467,51 @@
   END();
 }
 
+int test_triplet()
+{
+  BEGIN();
+
+  Heap2 heap = { NULL };
+  
+  unsigned i, N;
+  type1 *items;
+
+  N = 3;
+
+  TEST_1(items = calloc((sizeof *items), N + 1));
+
+  TEST(heap2_resize(NULL, &heap, 0), 0);
+
+  for (i = 1; i <= N; i++) {
+    type2 e = items + i;
+
+    e->key = i, e->value = i;
+
+    if (heap2_is_full(heap))
+      TEST(heap2_resize(NULL, &heap, 0), 0);
+    TEST(heap2_is_full(heap), 0);
+    TEST(heap2_add(heap, e), 0);
+  }
+
+  for (i = 1; i <= N; i++) {
+    type2 e = heap2_get(heap, i);
+    TEST(e->key, i);
+    TEST(e->value, i);
+  }
+  
+  for (i = 1; i <= N; i++) {
+    type2 e = heap2_remove(heap, 1);
+    TEST(e->key, i);
+    TEST(e->value, i);
+  }
+
+  TEST(heap2_free(NULL, &heap), 0);
+  free(items);
+
+  END();
+}
+
+
 void usage(int exitcode)
 {
   fprintf(stderr,
@@ -373,6 +534,8 @@
       usage(1);
   }
 
+  retval |= test_triplet(); fflush(stdout);
+  retval |= test_smooth_sort(); fflush(stdout);
   retval |= test_value(); fflush(stdout);
   retval |= test_ref(); fflush(stdout);
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_rbtree.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_rbtree.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_rbtree.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file torture_rbtree.c
  * @brief Test red-black tree
  *

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c	Thu Oct 11 10:16:59 2007
@@ -22,8 +22,7 @@
  *
  */
 
-/**@ingroup su
- * 
+/**@internal
  * @file torture_su.c
  *
  * Testing functions for su socket functions.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_alloc.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_alloc.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_alloc.c	Thu Oct 11 10:16:59 2007
@@ -22,8 +22,7 @@
  *
  */
 
-/**@ingroup su_alloc
- *
+/**@internal 
  * @file su_alloc_test.c
  *
  * Testing functions for su_alloc functions.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_bm.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_bm.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_bm.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file torture_su_bm.c
  * @brief Test string search with Boyer-Moore algorithm 
  *  

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_port.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_port.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_port.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file torture_su_port.c
  * @brief Test su_poll_port interface
  *
@@ -197,7 +197,7 @@
   su_root_size_hint = 16;
 
   TEST_1(port = su_poll_port_create());
-  TEST(su_port_threadsafe(port), 0);
+  TEST(su_home_threadsafe(su_port_home(port)), 0);
   /* Before 1.12.4 su_port_create() had reference count 0 after creation */
   /* su_port_incref(port, "test_register"); */
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root.c	Thu Oct 11 10:16:59 2007
@@ -22,8 +22,7 @@
  *
  */
 
-/**@ingroup su_root_ex
- * 
+/**@internal
  * @file torture_su_root.c
  *
  * Test su_root_register functionality.
@@ -56,6 +55,10 @@
 #include <sofia-sip/su_alloc.h>
 #include <sofia-sip/su_log.h>
 
+#if SU_HAVE_PTHREADS
+#include <pthread.h>
+#endif
+
 struct test_ep_s {
   test_ep_t     *next, **prev, **list;
   int           i;
@@ -96,8 +99,88 @@
   test_ep_at rt_ep[5];
 
   int rt_sockets, rt_woken;
+
+#if SU_HAVE_PTHREADS
+  struct {
+    /* Used to test su_root_obtain()/su_root_release() */
+    pthread_mutex_t mutex[1];
+    pthread_cond_t cond[1];
+    pthread_t slave;
+    int done;
+    pthread_mutex_t deinit[1];
+  } rt_sr;
+#endif
 };
 
+int test_api(root_test_t *rt)
+{
+  BEGIN();
+  TEST_1(rt->rt_root = su_root_create(NULL));
+  
+  TEST_VOID(su_root_destroy(NULL));
+  TEST_P(su_root_name(NULL), NULL);  
+  TEST_1(su_root_name(rt->rt_root) != NULL);  
+  TEST(su_root_set_magic(NULL, rt), -1);
+  TEST_P(su_root_magic(rt->rt_root), NULL);
+  TEST(su_root_set_magic(rt->rt_root, rt), 0);
+  TEST_P(su_root_magic(rt->rt_root), rt);
+  TEST_P(su_root_magic(NULL), NULL);
+  TEST(su_root_register(NULL, NULL, NULL, NULL, 0), -1);  
+  TEST(su_root_unregister(NULL, NULL, NULL, NULL), -1);  
+  TEST(su_root_deregister(NULL, 0), -1);  
+  TEST(su_root_deregister(rt->rt_root, 0), -1);  
+  TEST(su_root_deregister(rt->rt_root, -1), -1);  
+  TEST(su_root_eventmask(NULL, 0, -1, -1), -1);  
+  TEST((long int)su_root_step(NULL, 0), -1L);  
+  TEST((long int)su_root_sleep(NULL, 0), -1L);  
+  TEST(su_root_multishot(NULL, 0), -1);  
+  TEST_VOID((void)su_root_run(NULL));  
+  TEST_VOID((void)su_root_break(NULL));  
+  TEST_M(su_root_task(NULL), su_task_null, sizeof su_task_null);
+  TEST_M(su_root_parent(NULL), su_task_null, sizeof su_task_null);
+  TEST(su_root_add_prepoll(NULL, NULL, NULL), -1);  
+  TEST(su_root_remove_prepoll(NULL), -1);  
+  TEST_P(su_root_gsource(NULL), NULL);  
+  TEST_VOID((void)su_root_gsource(rt->rt_root));  
+  TEST(su_root_yield(NULL), -1);  
+  TEST(su_root_release(NULL), -1);
+  TEST(su_root_obtain(NULL), -1);
+  TEST(su_root_has_thread(NULL), -1);
+  TEST(su_root_has_thread(rt->rt_root), 2);
+  TEST(su_root_release(rt->rt_root), 0);
+  TEST(su_root_has_thread(rt->rt_root), 0);
+  TEST(su_root_obtain(rt->rt_root), 0);
+  TEST(su_root_has_thread(rt->rt_root), 2);
+  TEST_VOID((void)su_root_destroy(rt->rt_root));
+  rt->rt_root = NULL;
+  END();
+}
+
+
+#if SU_HAVE_PTHREADS
+
+#include <pthread.h>
+
+void *suspend_resume_test_thread(void *_rt) 
+{
+  root_test_t *rt = _rt;
+
+  pthread_mutex_lock(rt->rt_sr.mutex);
+  rt->rt_root = su_root_create(rt);
+  rt->rt_sr.done = 1;
+  pthread_cond_signal(rt->rt_sr.cond);
+  pthread_mutex_unlock(rt->rt_sr.mutex);
+  su_root_release(rt->rt_root);
+
+  pthread_mutex_lock(rt->rt_sr.deinit);
+  su_root_obtain(rt->rt_root);
+  su_root_destroy(rt->rt_root);
+  rt->rt_root = NULL;
+  pthread_mutex_unlock(rt->rt_sr.deinit);
+  return NULL;
+}
+#endif
+
 /** Test root initialization */
 int init_test(root_test_t *rt,
 	      char const *preference,
@@ -113,7 +196,26 @@
 
   su_port_prefer(create, start);
 
+#if SU_HAVE_PTHREADS
+  pthread_mutex_init(rt->rt_sr.mutex, NULL);
+  pthread_cond_init(rt->rt_sr.cond, NULL);
+  pthread_mutex_init(rt->rt_sr.deinit, NULL);
+
+  pthread_mutex_lock(rt->rt_sr.deinit);
+
+  pthread_create(&rt->rt_sr.slave, NULL, suspend_resume_test_thread, rt);
+
+  pthread_mutex_lock(rt->rt_sr.mutex);
+  while (rt->rt_sr.done == 0)
+    pthread_cond_wait(rt->rt_sr.cond, rt->rt_sr.mutex);
+  pthread_mutex_unlock(rt->rt_sr.mutex);
+
+  TEST_1(rt->rt_root);
+  TEST(su_root_obtain(rt->rt_root), 0);
+  TEST(su_root_has_thread(rt->rt_root), 2);
+#else  
   TEST_1(rt->rt_root = su_root_create(rt));
+#endif
 
   printf("%s: testing %s (%s) implementation\n",
 	 name, preference, su_root_name(rt->rt_root));
@@ -142,8 +244,18 @@
 {
   BEGIN();
 
+#if SU_HAVE_PTHREADS
+  TEST(su_root_has_thread(rt->rt_root), 2);
+  TEST(su_root_release(rt->rt_root), 0);
+  TEST(su_root_has_thread(rt->rt_root), 0);
+  pthread_mutex_unlock(rt->rt_sr.deinit);
+  pthread_join(rt->rt_sr.slave, NULL);
+  pthread_mutex_destroy(rt->rt_sr.mutex);
+  pthread_cond_destroy(rt->rt_sr.cond);
+  pthread_mutex_destroy(rt->rt_sr.deinit);
+#else
   TEST_VOID(su_root_destroy(rt->rt_root)); rt->rt_root = NULL;
-  TEST_VOID(su_root_destroy(NULL));
+#endif  
 
   su_deinit();
 
@@ -615,6 +727,8 @@
   do {
     rt = rt1, *rt = *rt0;
 
+    retval |= test_api(rt);
+
     retval |= init_test(rt, prefer[i].name, prefer[i].create, prefer[i].start);
     retval |= register_test(rt);
     retval |= event_test(rt);

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root_osx.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root_osx.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root_osx.c	Thu Oct 11 10:16:59 2007
@@ -22,8 +22,7 @@
  *
  */
 
-/**@ingroup su_root_ex
- * 
+/**@internal
  * @file torture_su_root_osx.c
  *
  * Test su_root_register functionality.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_tag.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_tag.c	Thu Oct 11 10:16:59 2007
@@ -22,8 +22,7 @@
  *
  */
 
-/**@SU_TAG
- * 
+/**@internal
  * @file torture_su_tag.c
  *
  * Testing functions for su_tag module.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h	Thu Oct 11 10:16:59 2007
@@ -270,16 +270,16 @@
 /** Return true if transport is being updated. */
 TPORT_DLL int tport_is_updating(tport_t const *self);
 
-/** Test if transport has been closed (added to @VERSION_1_12_4 ) */
+/** Test if transport has been closed. @NEW_1_12_4. */
 TPORT_DLL int tport_is_closed(tport_t const *self);
 
-/** Test if transport has been shut down (added to @VERSION_1_12_4 ) */
+/** Test if transport has been shut down. @NEW_1_12_4. */
 TPORT_DLL int tport_is_shutdown(tport_t const *self);
 
-/** Test if transport is connected. @NEW_1_12_5 */
+/** Test if transport is connected. @NEW_1_12_5. */
 TPORT_DLL int tport_is_connected(tport_t const *self);
 
-/** Test if transport can be used to send message. @NEW_1_12_7 */
+/** Test if transport can be used to send message. @NEW_1_12_7. */
 TPORT_DLL int tport_is_clear_to_send(tport_t const *self);
 
 /** Set transport magic. */
@@ -381,12 +381,6 @@
 			  char const *name, isize_t namelen,
 			  int create_if_needed);
 
-TPORT_DLL struct sigcomp_compartment *
-tport_compartment_incref(struct sigcomp_compartment *cc);
-
-TPORT_DLL void
-tport_compartment_decref(struct sigcomp_compartment **pointer_to_cc);
-
 /** Assign a SigComp compartment to a connection-oriented tport. */
 TPORT_DLL int
 tport_sigcomp_assign(tport_t *self, struct sigcomp_compartment *);

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h	Thu Oct 11 10:16:59 2007
@@ -51,46 +51,24 @@
 TPORT_DLL extern tag_typedef_t tptag_any;
 
 TPORT_DLL extern tag_typedef_t tptag_ident;
-/**Identify a transport interface. 
- *
- * Use with tport_tbind(), tport_tsend(), nua_create(), nta_agent_create(),
- * nta_agent_add_tport(), nta_outgoing_tcreate(), nta_outgoing_mcreate(),
- * nth_engine_create(), nth_client_tcreate(), or initial nth_site_create().
- */
 #define TPTAG_IDENT(x) tptag_ident, tag_str_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_ident_ref;
 #define TPTAG_IDENT_REF(x) tptag_ident_ref, tag_str_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_reuse;
-/** Allow reusing transport connection (true by default).
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(),
- * tport_tsend(), nua_create(), nta_agent_create(), nta_agent_add_tport(),
- * nta_outgoing_tcreate(), nta_outgoing_mcreate(), nth_engine_create(),
- * nth_client_tcreate(), or initial nth_site_create().
- */
 #define TPTAG_REUSE(x) tptag_reuse, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_reuse_ref;
 #define TPTAG_REUSE_REF(x) tptag_reuse_ref, tag_bool_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_fresh;
-/** Create new connection (but allow other messages to reuse the new one). 
- *
- * Use with tport_tsend(), nta_outgoing_tcreate(), nta_outgoing_mcreate(),
- * or nth_client_tcreate().
- */
 #define TPTAG_FRESH(x) tptag_fresh, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_fresh_ref;
 #define TPTAG_FRESH_REF(x) tptag_fresh_ref, tag_bool_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_server;
-/** Bind server sockets (true by default, disable with TPTAG_SERVER(0)).
- *
- * Use with tport_tbind().
- */
 #define TPTAG_SERVER(x) tptag_server, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_server_ref;
@@ -111,191 +89,78 @@
 } tport_pri_type_t;
 
 TPORT_DLL extern tag_typedef_t tptag_public;
-/** Use a transport reaching to public Internet. 
- *
- * Use with tport_tbind(), nua_create(), nta_agent_create(),
- * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
- */
 #define TPTAG_PUBLIC(x) tptag_public, tag_int_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_public_ref;
 #define TPTAG_PUBLIC_REF(x) tptag_public_ref, tag_int_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_mtu;
-/** Specify MTU.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(),
- * tport_tsend(), nua_create(), nta_agent_create(), nta_agent_add_tport(),
- * nta_outgoing_tcreate(), nta_outgoing_mcreate(), nth_engine_create(),
- * nth_client_tcreate(), or initial nth_site_create().
- */
 #define TPTAG_MTU(x) tptag_mtu, tag_usize_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_mtu_ref;
 #define TPTAG_MTU_REF(x) tptag_mtu_ref, tag_usize_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_connect;
-/** Specify that tport must always use connections (even with UDP).
- *
- * @note Unimplemented (?).
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_CONNECT(x) tptag_connect, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_connect_ref;
 #define TPTAG_CONNECT_REF(x) tptag_connect_ref, tag_bool_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_queuesize;
-/** Specify the number of messages that can be queued per connection.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_QUEUESIZE(x) tptag_queuesize, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_queuesize_ref;
 #define TPTAG_QUEUESIZE_REF(x) tptag_queuesize_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_sdwn_error;
-/** If true, half close of a connection by remote is considered as an error.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_SDWN_ERROR(x) tptag_sdwn_error, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_sdwn_error_ref;
 #define TPTAG_SDWN_ERROR_REF(x) tptag_sdwn_error_ref, tag_bool_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_sdwn_after;
-/** Half-close (shutdown(c, 1)) after sending the message.
- *
- * Use with tport_tsend(), nta_outgoing_tcreate(), nta_outgoing_mcreate(),
- * or nth_client_tcreate().
- */
 #define TPTAG_SDWN_AFTER(x) tptag_sdwn_after, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_sdwn_after_ref;
 #define TPTAG_SDWN_AFTER_REF(x) tptag_sdwn_after_ref, tag_bool_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_close_after;
-/** Close of a connection after sending the message.
- * 
- * Use with tport_tsend(), nta_outgoing_tcreate(), nta_outgoing_mcreate(),
- * or nth_client_tcreate().
- */
 #define TPTAG_CLOSE_AFTER(x) tptag_close_after, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_close_after_ref;
 #define TPTAG_CLOSE_AFTER_REF(x) tptag_close_after_ref, tag_bool_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_idle;
-/** How long transports may be idle (value in milliseconds).
- *
- * If 0, zap immediately, 
- * if UINT_MAX, leave them there (default value for now).
- *
- * @par Use With
- * tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_IDLE(x) tptag_idle, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_idle_ref;
 #define TPTAG_IDLE_REF(x) tptag_idle_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_timeout;
-/**Timeout for incomplete incoming message  (value in milliseconds).
- *
- * If UINT_MAX, leave the incomplete messages there for ever.
- * Default value for now is UINT_MAX.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_TIMEOUT(x) tptag_timeout, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_timeout_ref;
 #define TPTAG_TIMEOUT_REF(x) tptag_timeout_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_keepalive;
-/**Keepalive interval in milliseconds.
- *
- * If 0 or UINT_MAX, do not use keepalives. Default value is 0.
- *
- * On TCP, the keepalive if a CR-LF-CR-LF sequence.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- *
- * @sa TPTAG_PINGPONG(), TPTAG_PONG2PING(), TPTAG_TIMEOUT(), TPTAG_IDLE()
- */
 #define TPTAG_KEEPALIVE(x) tptag_keepalive, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_keepalive_ref;
 #define TPTAG_KEEPALIVE_REF(x) tptag_keepalive_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_pingpong;
-/**Ping-pong interval in milliseconds.
- *
- * If 0 or UINT_MAX, do not check for PONGs. Default value is 0. 
- *
- * If set, the ping-pong protocol is used on TCP connections. If pinger
- * sends a ping and receives no data in the specified ping-pong interval, it
- * considers the connection failed and closes it. The value recommended in
- * draft-ietf-sip-outbound-10 is 10 seconds (10000 milliseconds).
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- *
- * @sa TPTAG_PONG2PING(), TPTAG_KEEPALIVE(), TPTAG_TIMEOUT(), TPTAG_IDLE(),
- * draft-ietf-sip-outbound-10.txt
- */
 #define TPTAG_PINGPONG(x) tptag_pingpong, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_pingpong_ref;
 #define TPTAG_PINGPONG_REF(x) tptag_pingpong_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_pong2ping;
-/**Respond PING with PONG.
- *
- * If true, respond with PONG to PING. Default value is 0 (false).
- *
- * If set, the ping-pong protocol is used on TCP connections. If a ping (at
- * least 4 whitespace characters) is received within messages, a pong
- * (CR-LF) is sent in response.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- *
- * @sa TPTAG_PINGPONG(), TPTAG_KEEPALIVE(), TPTAG_TIMEOUT(), TPTAG_IDLE()
- */
 #define TPTAG_PONG2PING(x) tptag_pong2ping, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_pong2ping_ref;
 #define TPTAG_PONG2PING_REF(x) tptag_pong2ping_ref, tag_bool_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_sigcomp_lifetime;
-/**Default SigComp lifetime in seconds.
- *
- * If value is UINT_MAX, keep SigComp compartments around for ever.
- *
- * @note Experimental.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_SIGCOMP_LIFETIME(x) tptag_sigcomp_lifetime, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_sigcomp_lifetime_ref;
@@ -303,10 +168,6 @@
 tptag_sigcomp_lifetime_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_compartment;
-/** Pointer to SigComp compartment.
- *
- * @note Not used.
- */
 #define TPTAG_COMPARTMENT(x) tptag_compartment, tag_ptr_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_compartment_ref;
@@ -314,22 +175,12 @@
   tptag_compartment_ref, tag_ptr_vr(&(x), x)
 
 TPORT_DLL extern tag_typedef_t tptag_certificate;
-/** Path to the public key certificate directory.
- *
- * Use with tport_tbind(), nua_create(), nta_agent_create(), 
- * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
- */
 #define TPTAG_CERTIFICATE(x) tptag_certificate, tag_str_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_certificate_ref;
 #define TPTAG_CERTIFICATE_REF(x) tptag_certificate_ref, tag_str_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_tls_version;
-/** Sets the TLS version (version 0 implies SSL2/SSL3).
- *
- * Use with tport_tbind(), nua_create(), nta_agent_create(), 
- * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
- */
 #define TPTAG_TLS_VERSION(x) tptag_tls_version, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_tls_version_ref;
@@ -337,10 +188,6 @@
 
 #if 0
 TPORT_DLL extern tag_typedef_t tptag_trusted;
-/** Mark transport as trusted. 
- *
- * @note Not implemented.
-*/
 #define TPTAG_TRUSTED(x) tptag_trusted, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_trusted_ref;
@@ -348,140 +195,60 @@
 #endif
 
 TPORT_DLL extern tag_typedef_t tptag_debug_drop;
-/** Sets the drop propability for (0..1000) incoming/outgoing packets.
- *
- * This is a parameter suitable for debugging only.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_DEBUG_DROP(x) tptag_debug_drop, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_debug_drop_ref;
 #define TPTAG_DEBUG_DROP_REF(x) tptag_debug_drop_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_udp_rmem;
-/** Sets the maximum receive buffer in bytes for primary UDP socket.
- *
- * This is a parameter suitable for tuning.
- *
- * Use with tport_tbind(), nua_create(), nta_agent_create(),
- * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
- */
 #define TPTAG_UDP_RMEM(x) tptag_udp_rmem, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_udp_rmem_ref;
 #define TPTAG_UDP_RMEM_REF(x) tptag_udp_rmem_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_udp_wmem;
-/** Sets the maximum send buffer in bytes for primary UDP socket.
- *
- * This is a parameter suitable for tuning.
- *
- * Use with tport_tbind(), nua_create(), nta_agent_create(),
- * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
- */
 #define TPTAG_UDP_WMEM(x) tptag_udp_wmem, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_udp_wmem_ref;
 #define TPTAG_UDP_WMEM_REF(x) tptag_udp_wmem_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_thrpsize;
-/**Determines the number of threads in the pool.
- *
- * The thread pools can have multiple threads receiving, uncompressing,
- * parsing, compressing, and sending messages.
- *
- * This is a parameter suitable for tuning.
- *
- * @note Thread pools are currently broken.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_THRPSIZE(x) tptag_thrpsize, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_thrpsize_ref;
 #define TPTAG_THRPSIZE_REF(x) tptag_thrpsize_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_thrprqsize;
-/** Length of per-thread receive queue (as messages).
- *
- * This is a parameter suitable for tuning.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_THRPRQSIZE(x) tptag_thrprqsize, tag_uint_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_thrprqsize_ref;
 #define TPTAG_THRPRQSIZE_REF(x) tptag_thrprqsize_ref, tag_uint_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_http_connect;
-/** Specify that tport can use HTTP connect method.
- *
- * Use with tport_tbind(), nua_create(), nta_agent_create(),
- * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
- */
 #define TPTAG_HTTP_CONNECT(x) tptag_http_connect, tag_str_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_http_connect_ref;
 #define TPTAG_HTTP_CONNECT_REF(x) tptag_http_connect_ref, tag_str_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_stun_server;
-/** Enable STUN server.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- */
 #define TPTAG_STUN_SERVER(x) tptag_stun_server, tag_bool_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_stun_server_ref;
 #define TPTAG_STUN_SERVER_REF(x) tptag_stun_server_ref, tag_bool_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_tos;
-/** Sets the IP TOS for the socket.
- *
- * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
- * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
- * initial nth_site_create().
- *
- * @NEW_1_12_5
- */
 #define TPTAG_TOS(x) tptag_tos, tag_int_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_tos_ref;
 #define TPTAG_TOS_REF(x) tptag_tos_ref, tag_int_vr(&(x))
 
 TPORT_DLL extern tag_typedef_t tptag_log;
-/** If set, print out parsed or sent messages at transport layer.
- *
- * Use with tport_tcreate(), nua_create(), nta_agent_create(), 
- * nth_engine_create(), or initial nth_site_create().
- *
- * @sa #TPORT_LOG environment variable, TPTAG_DUMP()
- *
- * @NEW_1_12_5
- */
 #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. 
- *
- * Use with tport_tcreate(), nta_agent_create(), nua_create(),
- * nth_engine_create(), or initial nth_site_create().
- *
- * @sa #TPORT_DUMP environment variable, TPTAG_LOG().
- *
- * @NEW_1_12_5
- */
 #define TPTAG_DUMP(x) tptag_dump, tag_str_v((x))
 
 TPORT_DLL extern tag_typedef_t tptag_dump_ref;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c	Thu Oct 11 10:16:59 2007
@@ -236,9 +236,9 @@
 
 /** Return 0 if self is local, nonzero otherwise.
  *
- * The return valu is the 
+ * The return valu is the tport_via enum.
  *
- * @sa TPTAG_PUBLIC(), enum #tport_via.
+ * @sa TPTAG_PUBLIC(), enum tport_via.
  */
 int tport_is_public(tport_t const *self)
 {
@@ -312,13 +312,13 @@
   return self->tp_protoname != NULL;
 }
 
-/** Test if transport connection has been established. @NEW_1_12_5 */
+/** Test if transport connection has been established. @NEW_1_12_5. */
 int tport_is_connected(tport_t const *self)
 {
   return self->tp_is_connected;
 }
 
-/** Test if transport can be used to send message. @NEW_1_12_7 */
+/** Test if transport can be used to send message. @NEW_1_12_7. */
 int tport_is_clear_to_send(tport_t const *self)
 {
   return
@@ -331,7 +331,7 @@
      !self->tp_send_close);
 }
 
-/** Return true if transport has message in send queue. @NEW_1_12_7  */
+/** Return true if transport has message in send queue. @NEW_1_12_7. */
 int tport_has_queued(tport_t const *self)
 {
   return self && self->tp_queue && self->tp_queue[self->tp_qhead];

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.docs	Thu Oct 11 10:16:59 2007
@@ -4,11 +4,14 @@
 
 The @b tport module contains a generic transport interface used by SIP,
 RTSP, and HTTP protocols. It is an abstraction layer between a protocol
-stack and a transport protocol implementation. The interface is
-implemented via transport objects.
+stack and a transport protocol implementation. The interface is implemented
+via transport objects. The tag parameters for transport objects are defined
+in <sofia-sip/tport_tag.h>.
 
 @CONTACT Pekka.Pessi at nokia.com
 
+ at STATUS @SofiaSIP Core library
+
 @LICENSE LGPL
 
 @section tp_primary Master, Primary and Secondary Transport Objects
@@ -102,7 +105,7 @@
 Transport magic is a cookie, a piece of data specified by stack that can
 be associated with a transport (e.g., a Via header). The protocol stack
 can change the type of transport magic by defining the macro
-#TP_MAGIC_T before including <tport.h>.
+#TP_MAGIC_T before including <sofia-sip/tport.h>.
 
 @section tp_op Transport Operations
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h	Thu Oct 11 10:16:59 2007
@@ -26,8 +26,9 @@
 /** Defined when <tport_internal.h> has been included. */
 #define TPORT_INTERNAL_H
 
-/**@file tport_internal.h
- * @brief Transport interface
+/**@internal
+ * @file tport_internal.h
+ * @brief Internal implementation of transport interface
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
@@ -89,7 +90,7 @@
 
 typedef long unsigned LU; 	/* for printf() and friends */
 
-/** Transport parameters */
+/** @internal Transport parameters */
 typedef struct {
   unsigned tpp_mtu;		/**< Maximum packet size */
   unsigned tpp_idle;		/**< Allowed connection idle time. */
@@ -116,7 +117,7 @@
 } tport_params_t;
 
 
-/** Transport object.
+/** @internal Transport object.
  *
  * A transport object can be used in three roles, to represent transport
  * list (aka master transport), to represent available transports (aka
@@ -225,7 +226,7 @@
   } tp_stats;
 };
 
-/** Primary structure */
+/** @internal Primary structure */
 struct tport_primary {
   tport_t             pri_primary[1];   /**< Transport part */
 #if DOXYGEN_ONLY
@@ -257,7 +258,7 @@
   tport_params_t      pri_params[1];      /**< Transport parameters */
 };
 
-/** Master structure */
+/** @internal Master structure */
 struct tport_master {
   tport_t             mr_master[1];
 #if DOXYGEN_ONLY
@@ -320,7 +321,7 @@
 #endif
 };
 
-/** Virtual function table for transports */
+/** @internal Virtual function table for transports */
 struct tport_vtable
 {
   char const *vtp_name;
@@ -364,13 +365,13 @@
 
 int tport_register_type(tport_vtable_t const *vtp);
 
-/** Test if transport is needs connect() before sending. */
+/** @internal Test if transport is needs connect() before sending. */
 su_inline int tport_is_connection_oriented(tport_t const *self)
 {
   return self->tp_conn_orient;
 }
 
-/** Test if transport involves connection. @NEW_1_12_5 */
+/** @internal Test if transport involves connection. @NEW_1_12_5. */
 su_inline int tport_has_connection(tport_t const *self)
 {
   return self->tp_has_connection;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_sigcomp.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_sigcomp.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_sigcomp.c	Thu Oct 11 10:16:59 2007
@@ -52,13 +52,13 @@
 
 typedef struct tport_sigcomp_handler tport_sigcomp_handler_t;
 
-/** Per end-point SigComp data */
+/** @internal Per end-point SigComp data */
 struct tport_compressor {
   struct sigcomp_state_handler *msc_state_handler;
   struct sigcomp_compartment *msc_compartment;
 };
 
-/** Per-socket SigComp data */
+/** @internal Per-socket SigComp data */
 struct tport_comp {
   struct sigcomp_udvm          *sc_udvm;
   struct sigcomp_compartment   *sc_cc;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_sigcomp.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_sigcomp.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_sigcomp.c	Thu Oct 11 10:16:59 2007
@@ -143,6 +143,7 @@
     self->tp_name->tpn_comp == tport_canonize_comp(comp);
 }
 
+/** Set the compression protocol as @a comp. */
 int tport_set_compression(tport_t *self, char const *comp)
 {
   tport_comp_vtable_t const *vsc = tport_comp_vtable;
@@ -153,7 +154,7 @@
   return (self == NULL || comp) ? -1 : 0;
 }
 
-/** Set options to SigComp */
+/** Set SigComp options. */
 int tport_sigcomp_option(tport_t const *self,
 			 struct sigcomp_compartment *cc,
 			 char const *option)

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c	Thu Oct 11 10:16:59 2007
@@ -52,35 +52,373 @@
 
 tag_typedef_t tptag_any = NSTAG_TYPEDEF(*);
 
+/**@def TPTAG_IDENT(cstr)
+ *
+ * Identify a transport interface. 
+ *
+ * Use with tport_tbind(), tport_tsend(), nua_create(), nta_agent_create(),
+ * nta_agent_add_tport(), nta_outgoing_tcreate(), nta_outgoing_mcreate(),
+ * nth_engine_create(), nth_client_tcreate(), or initial nth_site_create().
+ */
 tag_typedef_t tptag_ident = CSTRTAG_TYPEDEF(ident);
+
+/**@def TPTAG_REUSE(boolean)
+ *
+ * Allow reusing transport connection (true by default).
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(),
+ * tport_tsend(), nua_create(), nta_agent_create(), nta_agent_add_tport(),
+ * nta_outgoing_tcreate(), nta_outgoing_mcreate(), nth_engine_create(),
+ * nth_client_tcreate(), or initial nth_site_create().
+ */
 tag_typedef_t tptag_reuse = BOOLTAG_TYPEDEF(reuse);
+
+/**@def TPTAG_FRESH(boolean)
+ *
+ * Create new connection (but allow other messages to reuse the new one). 
+ *
+ * Use with tport_tsend(), nta_outgoing_tcreate(), nta_outgoing_mcreate(),
+ * or nth_client_tcreate().
+ */
 tag_typedef_t tptag_fresh = BOOLTAG_TYPEDEF(fresh);
+
+/**@def TPTAG_SERVER(boolean)
+ *
+ * Bind server sockets (true by default, disable with TPTAG_SERVER(0)).
+ *
+ * Use with tport_tbind().
+ */
 tag_typedef_t tptag_server = BOOLTAG_TYPEDEF(server);
+
+/**@def TPTAG_PUBLIC(tport_via)
+ *
+ * Define how the public transport connects to Internet. 
+ *
+ * Use with tport_tbind(), nua_create(), nta_agent_create(),
+ * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
+ *
+ * @sa TPTAG_PUBLIC(), tport_is_public().
+ */
 tag_typedef_t tptag_public = INTTAG_TYPEDEF(public);
+
+/**@def TPTAG_MTU(usize_t)
+ *
+ * Specify MTU.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(),
+ * tport_tsend(), nua_create(), nta_agent_create(), nta_agent_add_tport(),
+ * nta_outgoing_tcreate(), nta_outgoing_mcreate(), nth_engine_create(),
+ * nth_client_tcreate(), or initial nth_site_create().
+ */
 tag_typedef_t tptag_mtu = USIZETAG_TYPEDEF(mtu);
+
+/**@def TPTAG_CONNECT(x)
+ *
+ * Specify that tport must always use connections (even with UDP).
+ *
+ * @note Unimplemented (?).
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_connect = BOOLTAG_TYPEDEF(connect);
+
+/**@def TPTAG_SDWN_ERROR(x)
+ *
+ * If true, half close of a connection by remote is considered as an error.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_sdwn_error = BOOLTAG_TYPEDEF(sdwn_error);
+
+/**@def TPTAG_SDWN_AFTER(x)
+ *
+ * Half-close (shutdown(c, 1)) after sending the message.
+ *
+ * Use with tport_tsend(), nta_outgoing_tcreate(), nta_outgoing_mcreate(),
+ * or nth_client_tcreate().
+ */
 tag_typedef_t tptag_sdwn_after = BOOLTAG_TYPEDEF(sdwn_after);
+
+/**@def TPTAG_CLOSE_AFTER(x)
+ *
+ * Close of a connection after sending the message.
+ * 
+ * Use with tport_tsend(), nta_outgoing_tcreate(), nta_outgoing_mcreate(),
+ * or nth_client_tcreate().
+ */
 tag_typedef_t tptag_close_after = BOOLTAG_TYPEDEF(sdwn_after);
+
+/**@def TPTAG_IDLE(x)
+ *
+ * How long transports may be idle (value in milliseconds).
+ *
+ * If 0, zap immediately, 
+ * if UINT_MAX, leave them there (default value for now).
+ *
+ * @par Use With
+ * tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_idle = UINTTAG_TYPEDEF(idle);
+
+/**@def TPTAG_TIMEOUT(x)
+ *
+ * Timeout for incomplete incoming message  (value in milliseconds).
+ *
+ * If UINT_MAX, leave the incomplete messages there for ever.
+ * Default value for now is UINT_MAX.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_timeout = UINTTAG_TYPEDEF(timeout);
+
+/**@def TPTAG_KEEPALIVE(x)
+ *
+ * Keepalive interval in milliseconds.
+ *
+ * If 0 or UINT_MAX, do not use keepalives. Default value is 0.
+ *
+ * On TCP, the keepalive if a CR-LF-CR-LF sequence.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ *
+ * @sa TPTAG_PINGPONG(), TPTAG_PONG2PING(), TPTAG_TIMEOUT(), TPTAG_IDLE()
+ *
+ * @NEW_1_12_7.
+ */
 tag_typedef_t tptag_keepalive = UINTTAG_TYPEDEF(keepalive);
+
+/**@def TPTAG_PINGPONG(x)
+ *
+ * Ping-pong interval in milliseconds.
+ *
+ * If 0 or UINT_MAX, do not check for PONGs. Default value is 0. 
+ *
+ * If set, the ping-pong protocol is used on TCP connections. If pinger
+ * sends a ping and receives no data in the specified ping-pong interval, it
+ * considers the connection failed and closes it. The value recommended in
+ * draft-ietf-sip-outbound-10 is 10 seconds (10000 milliseconds).
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ *
+ * @sa TPTAG_PONG2PING(), TPTAG_KEEPALIVE(), TPTAG_TIMEOUT(), TPTAG_IDLE(),
+ * draft-ietf-sip-outbound-10.txt
+ *
+ * @NEW_1_12_7.
+ */
 tag_typedef_t tptag_pingpong = UINTTAG_TYPEDEF(pingpong);
+
+/**@def TPTAG_PONG2PING(x)
+ *
+ * Respond PING with PONG.
+ *
+ * If true, respond with PONG to PING. Default value is 0 (false).
+ *
+ * If set, the ping-pong protocol is used on TCP connections. If a ping (at
+ * least 4 whitespace characters) is received within messages, a pong
+ * (CR-LF) is sent in response.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ *
+ * @sa TPTAG_PINGPONG(), TPTAG_KEEPALIVE(), TPTAG_TIMEOUT(), TPTAG_IDLE()
+ *
+ * @NEW_1_12_7.
+ */
 tag_typedef_t tptag_pong2ping = BOOLTAG_TYPEDEF(pong2ping);
+
+/**@def TPTAG_SIGCOMP_LIFETIME(x)
+ *
+ * Default SigComp lifetime in seconds.
+ *
+ * If value is UINT_MAX, keep SigComp compartments around for ever.
+ *
+ * @note Experimental.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_sigcomp_lifetime = UINTTAG_TYPEDEF(sigcomp_lifetime);
+
+/**@def TPTAG_CERTIFICATE(x)
+ *
+ * Path to the public key certificate directory.
+ *
+ * Use with tport_tbind(), nua_create(), nta_agent_create(), 
+ * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
+ */
 tag_typedef_t tptag_certificate = STRTAG_TYPEDEF(certificate);
+
+/**@def TPTAG_COMPARTMENT(x)
+ *
+ * Pointer to SigComp compartment.
+ *
+ * @note Not used.
+ */
 tag_typedef_t tptag_compartment = PTRTAG_TYPEDEF(compartment);
 
+
+/**@def TPTAG_TLS_VERSION(x)
+ *
+ * Sets the TLS version (version 0 implies SSL2/SSL3).
+ *
+ * Use with tport_tbind(), nua_create(), nta_agent_create(), 
+ * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
+ */
 tag_typedef_t tptag_tls_version = UINTTAG_TYPEDEF(tls_version);
+
+/**@def TPTAG_QUEUESIZE(x)
+ *
+ * Specify the number of messages that can be queued per connection.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_queuesize = UINTTAG_TYPEDEF(queuesize);
+
+/**@def TPTAG_DEBUG_DROP(x)
+ *
+ * Sets the drop propability for incoming/outgoing packets.
+ *
+ * The incoming/outgoing packets are dropped with the given probablity
+ * (in the range 0..1000) on unreliable transports.
+ *
+ * This is a parameter suitable for debugging only.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_debug_drop = UINTTAG_TYPEDEF(debug_drop);
+
+/**@def TPTAG_UDP_RMEM(x)
+ *
+ * Sets the maximum receive buffer in bytes for primary UDP socket.
+ *
+ * This is a parameter suitable for tuning.
+ *
+ * Use with tport_tbind(), nua_create(), nta_agent_create(),
+ * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
+ */
 tag_typedef_t tptag_udp_rmem = UINTTAG_TYPEDEF(udp_rmem);
+
+/**@def TPTAG_UDP_WMEM(x)
+ *
+ * Sets the maximum send buffer in bytes for primary UDP socket.
+ *
+ * This is a parameter suitable for tuning.
+ *
+ * Use with tport_tbind(), nua_create(), nta_agent_create(),
+ * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
+ */
 tag_typedef_t tptag_udp_wmem = UINTTAG_TYPEDEF(udp_wmem);
+
+/**@def TPTAG_THRPSIZE(x)
+ *
+ * Determines the number of threads in the pool.
+ *
+ * The thread pools can have multiple threads receiving, uncompressing,
+ * parsing, compressing, and sending messages.
+ *
+ * This is a parameter suitable for tuning.
+ *
+ * @note Thread pools are currently broken.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_thrpsize = UINTTAG_TYPEDEF(thrpsize);
+
+/**@def TPTAG_THRPRQSIZE(x)
+ *
+ * Length of per-thread receive queue (as messages).
+ *
+ * This is a parameter suitable for tuning.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_thrprqsize = UINTTAG_TYPEDEF(thrprqsize);
+
+/**@def TPTAG_HTTP_CONNECT(x)
+ *
+ * Specify that tport can use HTTP connect method.
+ *
+ * Use with tport_tbind(), nua_create(), nta_agent_create(),
+ * nta_agent_add_tport(), nth_engine_create(), or initial nth_site_create().
+ */
 tag_typedef_t tptag_http_connect = STRTAG_TYPEDEF(http_connect);
+
+/**@def TPTAG_STUN_SERVER(x)
+ *
+ * Enable STUN server.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
 tag_typedef_t tptag_stun_server = BOOLTAG_TYPEDEF(stun_server);
+
+/**@def TPTAG_TOS(x)
+ *
+ * Sets the IP TOS for the socket.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ *
+ * @NEW_1_12_5.
+ */
 tag_typedef_t tptag_tos = INTTAG_TYPEDEF(tos);
+
+/**@def TPTAG_LOG(x)
+ *
+ * If set, print out parsed or sent messages at transport layer.
+ *
+ * Use with tport_tcreate(), nua_create(), nta_agent_create(), 
+ * nth_engine_create(), or initial nth_site_create().
+ *
+ * @sa #TPORT_LOG environment variable, TPTAG_DUMP()
+ *
+ * @NEW_1_12_5.
+ */
 tag_typedef_t tptag_log = INTTAG_TYPEDEF(log);
+
+/**@def TPTAG_DUMP(x)
+ *
+ * Filename for dumping unparsed messages from transport. 
+ *
+ * Use with tport_tcreate(), nta_agent_create(), nua_create(),
+ * nth_engine_create(), or initial nth_site_create().
+ *
+ * @sa #TPORT_DUMP environment variable, TPTAG_LOG().
+ *
+ * @NEW_1_12_5.
+ */
 tag_typedef_t tptag_dump = STRTAG_TYPEDEF(dump);
 
+/** Mark transport as trusted. 
+ *
+ * @note Not implemented by tport module.
+ *
+ * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
+ * nta_agent_create(), nta_agent_add_tport(), nth_engine_create(), or
+ * initial nth_site_create().
+ */
+tag_typedef_t tptag_trusted = BOOLTAG_TYPEDEF(trusted);

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.h	Thu Oct 11 10:16:59 2007
@@ -25,12 +25,14 @@
 #ifndef TPORT_TLS_H
 /** Defined when <tport_tls.h> has been included. */
 #define TPORT_TLS_H
-/**@IFILE tport_tls.h
- * @brief TLS interface
- * 
+/**@internal 
+ * @file tport_tls.h
+ * @brief Internal TLS interface
+ *
  * @author Mikko Haataja <ext-Mikko.A.Haataja at nokia.com>
  *
  * Copyright 2001, 2002 Nokia Research Center.  All rights reserved.
+ *
  */
 
 #ifndef SU_TYPES_H

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/Doxyfile.in
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/Doxyfile.in	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/Doxyfile.in	Thu Oct 11 10:16:59 2007
@@ -1,7 +1,8 @@
 PROJECT_NAME         = "url"
 OUTPUT_DIRECTORY     = ../docs/html/url
 
-INPUT 		     = @srcdir@/url.docs @srcdir@/sofia-sip @srcdir@ . 
+INPUT 		     = @srcdir@/url.docs @srcdir@/sofia-sip/url.h @srcdir@/url.c
+INPUT		    += @srcdir@/url_tag.c
 
 @INCLUDE_PATH = . @srcdir@
 @INCLUDE = ../docs/Doxyfile.conf

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/Makefile.am	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/Makefile.am	Thu Oct 11 10:16:59 2007
@@ -17,7 +17,7 @@
 
 noinst_LTLIBRARIES = 	liburl.la
 
-check_PROGRAMS = 	torture_url test_urlmap
+check_PROGRAMS = 	torture_url
 
 # ----------------------------------------------------------------------
 # Rules for building the targets
@@ -37,18 +37,22 @@
 			../ipt/libipt.la \
 			../su/libsu.la
 
-test_urlmap_SOURCES = 	urlmap.c urlmap.h
-test_urlmap_CFLAGS =	$(CFLAGS) -DTEST_URLMAP=1
-
 # ----------------------------------------------------------------------
 # Install and distribution rules
 
 EXTRA_DIST =		url.docs $(BUILT_SOURCES)
 
 # ----------------------------------------------------------------------
+# urlmap is not used
+#check_PROGRAMS +=	test_urlmap
+#test_urlmap_SOURCES = 	urlmap.c urlmap.h
+#test_urlmap_CFLAGS =	$(CFLAGS) -DTEST_URLMAP=1
+EXTRA_DIST +=		urlmap.c urlmap.h
+
+# ----------------------------------------------------------------------
 # Tests
 
-TESTS = 		torture_url test_urlmap
+TESTS = 		torture_url
 
 # ----------------------------------------------------------------------
 # Sofia specific rules

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.docs
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.docs	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.docs	Thu Oct 11 10:16:59 2007
@@ -20,8 +20,7 @@
 @note 
 Please note that we use terms URL and URI interchangeable.
 
-The formal URI syntax is defined in the 
-<a href="http://www.ietf.org/rfc/rfc2396.txt">RFC2396</a>.
+The formal URI syntax is defined in the @RFC3986.
 
 The URLs consist of a subset of printable ASCII (ECMA-5) characters. The
 subset excludes space and characters commonly used as @e delimiters in
@@ -51,7 +50,7 @@
 <i>host</i> [":" <i>port</i> ] ] [";" <i>params</i> ] ["?" <i>query</i> ]
 ["#" <i>fragment</i> ]
 
-Note that also "*" is considered to be a valid URL (with type #url_any).
+Note that url parser also considers "*" to be a valid URL (with type #url_any).
 
 For example: \n
 @code
@@ -103,7 +102,7 @@
 
 @subsection url_reference Functions and Macros in URL Module
 
-The include file <url.h> contains the types, function and macros of URL
+The include file <sofia-sip/url.h> contains the types, function and macros of URL
 module. The functions and macros are listed here for the reference, too.
 The most important functions and macros for manipulating URLs are here:
 @code
@@ -123,7 +122,6 @@
 isize_t url_param(char const *params, char const *tag,
 		  char value[], isize_t vlen);
 int url_has_param(url_t const *url, char const *name);
-isize_t url_have_param(char const *params, char const *tag);
 int url_param_add(su_home_t *h, url_t *url, char const *param);
 @endcode
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url_tag.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url_tag.c	Thu Oct 11 10:16:59 2007
@@ -126,6 +126,8 @@
   url_t *url;
   char *s;
 
+  (void)tt;
+
   for (len = 0; !IS_EXCLUDED(str[len]); len++)
     ;
   

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/urlmap.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/urlmap.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/urlmap.c	Thu Oct 11 10:16:59 2007
@@ -22,7 +22,7 @@
  *
  */
 
-/**
+/**@internal
  * @file urlmap.c
  * @brief Mapping with hierarchical URLs.
  *

Modified: freeswitch/trunk/libs/sofia-sip/utils/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/utils/Makefile.am	(original)
+++ freeswitch/trunk/libs/sofia-sip/utils/Makefile.am	Thu Oct 11 10:16:59 2007
@@ -48,3 +48,5 @@
 # ----------------------------------------------------------------------
 # Dist and install
 EXTRA_DIST = utils.docs
+
+CLEANFILES = utils.doxytags
\ No newline at end of file



More information about the Freeswitch-svn mailing list