[Freeswitch-branches] [commit] r10916 - in freeswitch/branches/gmaruzz: . build conf conf/autoload_configs conf/dialplan conf/dialplan/default conf/sip_profiles docs/phrase libs/codec/ilbc/src libs/esl libs/esl/src libs/esl/src/include libs/js/nsprpub libs/libg722_1/src libs/pcre libs/sofia-sip libs/sofia-sip/docs libs/sofia-sip/libsofia-sip-ua libs/sofia-sip/libsofia-sip-ua-glib libs/sofia-sip/libsofia-sip-ua-glib/su-glib libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip libs/sofia-sip/libsofia-sip-ua/bnf libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip libs/sofia-sip/libsofia-sip-ua/docs libs/sofia-sip/libsofia-sip-ua/features libs/sofia-sip/libsofia-sip-ua/http libs/sofia-sip/libsofia-sip-ua/http/sofia-sip libs/sofia-sip/libsofia-sip-ua/ipt libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip libs/sofia-sip/libsofia-sip-ua/iptsec libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip libs/sofia-sip/libsofia-sip-ua/msg libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip libs/sofia-sip/libsofia-sip-ua/nea libs/sofia-sip/libsofia-sip-ua/nea/sofia-sip libs/sofia-sip/libsofia-sip-ua/nta libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip libs/sofia-sip/libsofia-sip-ua/nth libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip libs/sofia-sip/libsofia-sip-ua/nua libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip libs/sofia-sip/libsofia-sip-ua/sdp libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip libs/sofia-sip/libsofia-sip-ua/sip libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip libs/sofia-sip/libsofia-sip-ua/soa libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip libs/sofia-sip/libsofia-sip-ua/sresolv libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-sip libs/sofia-sip/libsofia-sip-ua/stun libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip libs/sofia-sip/libsofia-sip-ua/su libs/sofia-sip/libsofia-sip-ua/su/sofia-sip libs/sofia-sip/libsofia-sip-ua/tport libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip libs/sofia-sip/libsofia-sip-ua/url libs/sofia-sip/libsofia-sip-ua/url/sofia-sip libs/sofia-sip/m4 libs/sofia-sip/open_c libs/sofia-sip/packages libs/sofia-sip/rules libs/sofia-sip/scripts libs/sofia-sip/tests libs/sofia-sip/utils libs/sofia-sip/win32 libs/sofia-sip/win32/libsofia-sip-ua libs/sofia-sip/win32/sofia-sip libs/win32/libg722_1 libs/win32/libshout libs/win32/mpg123 libs/xmlrpc-c/Windows libs/xmlrpc-c/lib/abyss/src scripts/aadir scripts/s25vmail scripts/socket/FreeSWITCH src src/include src/mod/applications/mod_commands src/mod/applications/mod_conference src/mod/applications/mod_expr src/mod/applications/mod_http src/mod/applications/mod_limit src/mod/applications/mod_vmd src/mod/applications/mod_voicemail src/mod/codecs/mod_amr src/mod/codecs/mod_celt src/mod/codecs/mod_g729 src/mod/codecs/mod_siren src/mod/codecs/mod_voipcodecs src/mod/directories/mod_ldap src/mod/endpoints/mod_opal src/mod/endpoints/mod_sofia src/mod/event_handlers/mod_event_socket src/mod/event_handlers/mod_radius_cdr src/mod/formats/mod_local_stream src/mod/formats/mod_sndfile src/mod/languages/mod_lua src/mod/languages/mod_spidermonkey support-d

FreeSWITCH SVN gmaruzz at freeswitch.org
Tue Dec 23 04:37:05 PST 2008


Author: gmaruzz
Date: Tue Dec 23 07:37:03 2008
New Revision: 10916

Log:
Merge of trunk revisions 10773:10915 into gmaruzz branch

Added:
   freeswitch/branches/gmaruzz/build/buildopal.sh
      - copied unchanged from r10915, /freeswitch/trunk/build/buildopal.sh
   freeswitch/branches/gmaruzz/build/freeswitch.init.archlinux
      - copied unchanged from r10915, /freeswitch/trunk/build/freeswitch.init.archlinux
   freeswitch/branches/gmaruzz/libs/esl/   (props changed)
      - copied from r10915, /freeswitch/trunk/libs/esl/
   freeswitch/branches/gmaruzz/libs/esl/Makefile
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/Makefile
   freeswitch/branches/gmaruzz/libs/esl/fs_cli.2008.vcproj
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/fs_cli.2008.vcproj
   freeswitch/branches/gmaruzz/libs/esl/fs_cli.c
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/fs_cli.c
   freeswitch/branches/gmaruzz/libs/esl/src/   (props changed)
      - copied from r10915, /freeswitch/trunk/libs/esl/src/
   freeswitch/branches/gmaruzz/libs/esl/src/esl.2008.vcproj
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/src/esl.2008.vcproj
   freeswitch/branches/gmaruzz/libs/esl/src/esl.c
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/src/esl.c
   freeswitch/branches/gmaruzz/libs/esl/src/esl_config.c
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/src/esl_config.c
   freeswitch/branches/gmaruzz/libs/esl/src/esl_event.c
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/src/esl_event.c
   freeswitch/branches/gmaruzz/libs/esl/src/esl_threadmutex.c
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/src/esl_threadmutex.c
   freeswitch/branches/gmaruzz/libs/esl/src/include/
      - copied from r10915, /freeswitch/trunk/libs/esl/src/include/
   freeswitch/branches/gmaruzz/libs/esl/src/include/esl.h
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/src/include/esl.h
   freeswitch/branches/gmaruzz/libs/esl/src/include/esl_config.h
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/src/include/esl_config.h
   freeswitch/branches/gmaruzz/libs/esl/src/include/esl_event.h
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/src/include/esl_event.h
   freeswitch/branches/gmaruzz/libs/esl/src/include/esl_threadmutex.h
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/src/include/esl_threadmutex.h
   freeswitch/branches/gmaruzz/libs/esl/testclient.c
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/testclient.c
   freeswitch/branches/gmaruzz/libs/esl/testserver.c
      - copied unchanged from r10915, /freeswitch/trunk/libs/esl/testserver.c
   freeswitch/branches/gmaruzz/libs/win32/libg722_1/   (props changed)
      - copied from r10915, /freeswitch/trunk/libs/win32/libg722_1/
   freeswitch/branches/gmaruzz/libs/win32/libg722_1/libg722_1.vcproj
      - copied unchanged from r10915, /freeswitch/trunk/libs/win32/libg722_1/libg722_1.vcproj
   freeswitch/branches/gmaruzz/scripts/aadir/
      - copied from r10915, /freeswitch/trunk/scripts/aadir/
   freeswitch/branches/gmaruzz/scripts/aadir/README
      - copied unchanged from r10915, /freeswitch/trunk/scripts/aadir/README
   freeswitch/branches/gmaruzz/scripts/aadir/aadir.js
      - copied unchanged from r10915, /freeswitch/trunk/scripts/aadir/aadir.js
   freeswitch/branches/gmaruzz/scripts/s25vmail/
      - copied from r10915, /freeswitch/trunk/scripts/s25vmail/
   freeswitch/branches/gmaruzz/scripts/s25vmail/README
      - copied unchanged from r10915, /freeswitch/trunk/scripts/s25vmail/README
   freeswitch/branches/gmaruzz/scripts/s25vmail/s25vmail.js
      - copied unchanged from r10915, /freeswitch/trunk/scripts/s25vmail/s25vmail.js
   freeswitch/branches/gmaruzz/scripts/s25vmail/s25vmail_mwi.c
      - copied unchanged from r10915, /freeswitch/trunk/scripts/s25vmail/s25vmail_mwi.c
   freeswitch/branches/gmaruzz/src/mod/codecs/mod_celt/
      - copied from r10915, /freeswitch/trunk/src/mod/codecs/mod_celt/
   freeswitch/branches/gmaruzz/src/mod/codecs/mod_celt/Makefile
      - copied unchanged from r10915, /freeswitch/trunk/src/mod/codecs/mod_celt/Makefile
   freeswitch/branches/gmaruzz/src/mod/codecs/mod_celt/mod_celt.c
      - copied unchanged from r10915, /freeswitch/trunk/src/mod/codecs/mod_celt/mod_celt.c
   freeswitch/branches/gmaruzz/src/mod/codecs/mod_siren/mod_siren.2008.vcproj
      - copied unchanged from r10915, /freeswitch/trunk/src/mod/codecs/mod_siren/mod_siren.2008.vcproj
   freeswitch/branches/gmaruzz/support-d/prereq.sh
      - copied unchanged from r10915, /freeswitch/trunk/support-d/prereq.sh
Modified:
   freeswitch/branches/gmaruzz/Freeswitch.2008.sln
   freeswitch/branches/gmaruzz/bootstrap.sh
   freeswitch/branches/gmaruzz/build/modules.conf.in
   freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml
   freeswitch/branches/gmaruzz/conf/autoload_configs/local_stream.conf.xml
   freeswitch/branches/gmaruzz/conf/autoload_configs/voicemail.conf.xml
   freeswitch/branches/gmaruzz/conf/dialplan/default.xml
   freeswitch/branches/gmaruzz/conf/dialplan/default/01_example.com.xml
   freeswitch/branches/gmaruzz/conf/sip_profiles/internal.xml
   freeswitch/branches/gmaruzz/conf/vars.xml
   freeswitch/branches/gmaruzz/docs/phrase/phrase_en.xml
   freeswitch/branches/gmaruzz/libs/codec/ilbc/src/iLBC_define.h
   freeswitch/branches/gmaruzz/libs/js/nsprpub/configure.in
   freeswitch/branches/gmaruzz/libs/libg722_1/src/coef2sam.h
   freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4.h
   freeswitch/branches/gmaruzz/libs/libg722_1/src/decoderf.c
   freeswitch/branches/gmaruzz/libs/libg722_1/src/sam2coef.h
   freeswitch/branches/gmaruzz/libs/libg722_1/src/tables.c
   freeswitch/branches/gmaruzz/libs/pcre/pcretest.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/.update
   freeswitch/branches/gmaruzz/libs/sofia-sip/AUTHORS
   freeswitch/branches/gmaruzz/libs/sofia-sip/COPYING
   freeswitch/branches/gmaruzz/libs/sofia-sip/COPYRIGHTS
   freeswitch/branches/gmaruzz/libs/sofia-sip/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/ChangeLog.ext-trees
   freeswitch/branches/gmaruzz/libs/sofia-sip/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/README
   freeswitch/branches/gmaruzz/libs/sofia-sip/README.developers
   freeswitch/branches/gmaruzz/libs/sofia-sip/RELEASE
   freeswitch/branches/gmaruzz/libs/sofia-sip/RELEASE.template
   freeswitch/branches/gmaruzz/libs/sofia-sip/TODO
   freeswitch/branches/gmaruzz/libs/sofia-sip/autogen.sh
   freeswitch/branches/gmaruzz/libs/sofia-sip/configure.ac
   freeswitch/branches/gmaruzz/libs/sofia-sip/docs/build_system.txt
   freeswitch/branches/gmaruzz/libs/sofia-sip/docs/devel_platform_notes.txt
   freeswitch/branches/gmaruzz/libs/sofia-sip/docs/release_management.txt
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_glib.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_source.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_glib.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source_test.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/torture_su_glib_timer.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/bnf.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/hostdomain.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/torture_bnf.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.conf
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/conformance.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/docguide.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/mainpage.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/features/features.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/features/features.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/Doxyfile.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_extra.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_header.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_parser.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_parser_table.c.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_status.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_tag.c.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_tag_class.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_hclasses.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_header.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_parser.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_protos.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_status.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag_class.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/test_http.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/base64.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ipt.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/rc4.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/base64.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/rc4.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/uniqueid.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/utf8.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/token64.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ucs2.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ucs4.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8internal.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8test.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/Doxyfile.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client_ntlm.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_common.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_digest.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_http.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_sip.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_ntlm.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_delayed.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_ntlm.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_common.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_digest.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_module.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_ntlm.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_plugin.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/test_auth_digest.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_auth.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_basic.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_date.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_copy.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_make.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_internal.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mclass.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime_table.c.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_name_hash.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.awk
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_addr.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_buffer.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_date.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass_hash.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime_protos.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_parser.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_protos.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_tag_class.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_types.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_class.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_class.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_protos.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_table.c.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/Doxyfile.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_debug.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_event.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/sofia-sip/nea.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/Doxyfile.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/invite.msc
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/portbind.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/run_test_nta
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_read_payload.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_log.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_print.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_stateless.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tag.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tport.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/sl_utils.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/test_nta.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/Doxyfile.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/http-client.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_client.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth_tag.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/test_nth.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/check_register.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_extension.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_message.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_options.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_registrar.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_types.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/outbound.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/errata
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/run_test_sdp
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp_tag.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/test_sdp.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/torture_sdp.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/ADD-A-HEADER
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/Doxyfile.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/GRAMMAR
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/run-tests
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/run_test_sip_msg
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip.doxyaliases
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_bad_mask
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_caller_prefs.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_event.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra_headers.txt
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_feature.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_header.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_mime.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser_table.c.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_prack.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_pref_util.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_reason.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_refer.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_session.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_status.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_tag.c.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_tag_class.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_time.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_util.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_hclasses.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_header.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_protos.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_status.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag_class.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_util.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/test_date.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/test_sip_msg.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/validator.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/Doxyfile.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_session.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_tag.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/127.zone
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/194.2.188
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/3.f.f.e.1.2.0.0.3.0.1.2.c.0.0.0
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/3.f.f.e.1.2.0.0.3.0.1.2.c.0.0.0.arpa
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/example.com
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/resolve_sip.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/root.zone
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/run_test_sresolv
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_async.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_cache.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_config.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_record.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-sip/sresolv.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_blocking.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_cache.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sresolv.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sresolv.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/test_sresolv.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/torture_sresolv.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/lookup_stun_server.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun_common.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_common.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_internal.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_mini.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stunc.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/addrinfo.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/foo.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/getopt.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/localinfo.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memccpy.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memcspn.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memmem.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memspn.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/poll.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/smoothsort.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/heap.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable2.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/rbtree.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_addrinfo.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc_stat.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_bm.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_config.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_configure.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_debug.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_localinfo.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_log.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_md5.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_os_nw.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_osx_runloop.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_strlst.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_class.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_inline.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_io.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_time.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_types.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_uniqueid.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_vector.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_wait.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/tstdef.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/strcasestr.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/strtoull.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_addrinfo.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_alloc_lock.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_bm.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_default_log.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_devpoll_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_epoll_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_errno.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_global_log.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_log.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_md5.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_module_debug.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_open_c_localinfo.cpp
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_os_nw.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_osx_runloop.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_perf.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_poll_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_port.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_proxy.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_root.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_select_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_sprintf.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_strdup.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_strlst.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_tag_io.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_time.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_time0.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_timer.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_vector.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_wait.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_win32_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/tag_dll.awk
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_htable.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_htable2.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_memmem.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_poll.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_su.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_su_osx.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_heap.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_rbtree.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_alloc.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_bm.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_port.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root_osx.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_time.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_timer.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_plugins.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/test_tport.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_client.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_server.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_logging.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_sigcomp.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_sigcomp.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_stun.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_threadpool.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_connect.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_sctp.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tls.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag_class.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url_tag.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/urlmap.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/urlmap.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-coverage.m4
   freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-general.m4
   freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-openssl.m4
   freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-su2.m4
   freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-tport.m4
   freeswitch/branches/gmaruzz/libs/sofia-sip/open_c/build_sources.cmd
   freeswitch/branches/gmaruzz/libs/sofia-sip/open_c/version.awk
   freeswitch/branches/gmaruzz/libs/sofia-sip/packages/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/packages/Makefile.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/packages/sofia-sip.spec.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/rules/lcov.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/rules/recursive.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/rules/valcheck.am
   freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/coverage
   freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/fix-include-sofia-sip
   freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/hide_emails.sh
   freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/lcov-report
   freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/rpmbuild-snaphot
   freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/uncovered
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/check_sofia.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_100rel.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_basic_call.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_call_hold.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_call_reject.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_cancel_bye.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_extension.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_init.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nat.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nat.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua_api.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua_params.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_offer_answer.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_ops.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_proxy.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_proxy.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_refer.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_register.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_session_timer.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_simple.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_sip_events.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/utils/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/utils/Doxyfile.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/utils/apps_utils.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-date.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-dig.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-options.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/utils/utils.docs
   freeswitch/branches/gmaruzz/libs/sofia-sip/win32/ChangeLog
   freeswitch/branches/gmaruzz/libs/sofia-sip/win32/README.txt
   freeswitch/branches/gmaruzz/libs/sofia-sip/win32/build_sources.cmd
   freeswitch/branches/gmaruzz/libs/sofia-sip/win32/config.h.in
   freeswitch/branches/gmaruzz/libs/sofia-sip/win32/libsofia-sip-ua/sofia-sip-ua.def
   freeswitch/branches/gmaruzz/libs/sofia-sip/win32/sofia-sip/su_configure.h
   freeswitch/branches/gmaruzz/libs/sofia-sip/win32/version.awk
   freeswitch/branches/gmaruzz/libs/win32/libshout/   (props changed)
   freeswitch/branches/gmaruzz/libs/win32/mpg123/   (props changed)
   freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/abyss.2008.vcproj
   freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmlparse.2008.vcproj
   freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmlrpc.2008.vcproj
   freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmltok.2008.vcproj
   freeswitch/branches/gmaruzz/libs/xmlrpc-c/lib/abyss/src/file.c
   freeswitch/branches/gmaruzz/scripts/socket/FreeSWITCH/Client.pm
   freeswitch/branches/gmaruzz/src/include/switch_core.h
   freeswitch/branches/gmaruzz/src/include/switch_loadable_module.h
   freeswitch/branches/gmaruzz/src/include/switch_log.h
   freeswitch/branches/gmaruzz/src/include/switch_types.h
   freeswitch/branches/gmaruzz/src/include/switch_utils.h
   freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprpars.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprpriv.h
   freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprutil.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_http/http_req.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_http/mod_http.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_limit/mod_limit.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_vmd/   (props changed)
   freeswitch/branches/gmaruzz/src/mod/applications/mod_voicemail/mod_voicemail.c
   freeswitch/branches/gmaruzz/src/mod/codecs/mod_amr/mod_amr.c
   freeswitch/branches/gmaruzz/src/mod/codecs/mod_g729/mod_g729.c
   freeswitch/branches/gmaruzz/src/mod/codecs/mod_siren/   (props changed)
   freeswitch/branches/gmaruzz/src/mod/codecs/mod_siren/mod_siren.c
   freeswitch/branches/gmaruzz/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c
   freeswitch/branches/gmaruzz/src/mod/directories/mod_ldap/Makefile
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/mod_opal.cpp
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/Makefile.am
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_glue.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_presence.c
   freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
   freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
   freeswitch/branches/gmaruzz/src/mod/formats/mod_local_stream/mod_local_stream.c
   freeswitch/branches/gmaruzz/src/mod/formats/mod_sndfile/mod_sndfile.c
   freeswitch/branches/gmaruzz/src/mod/languages/mod_lua/mod_lua.cpp
   freeswitch/branches/gmaruzz/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/branches/gmaruzz/src/switch_core_codec.c
   freeswitch/branches/gmaruzz/src/switch_core_db.c
   freeswitch/branches/gmaruzz/src/switch_core_io.c
   freeswitch/branches/gmaruzz/src/switch_core_sqldb.c
   freeswitch/branches/gmaruzz/src/switch_ivr.c
   freeswitch/branches/gmaruzz/src/switch_loadable_module.c
   freeswitch/branches/gmaruzz/src/switch_log.c
   freeswitch/branches/gmaruzz/src/switch_pcm.c
   freeswitch/branches/gmaruzz/src/switch_time.c
   freeswitch/branches/gmaruzz/support-d/.bashrc

Modified: freeswitch/branches/gmaruzz/Freeswitch.2008.sln
==============================================================================
--- freeswitch/branches/gmaruzz/Freeswitch.2008.sln	(original)
+++ freeswitch/branches/gmaruzz/Freeswitch.2008.sln	Tue Dec 23 07:37:03 2008
@@ -1,6 +1,6 @@
 
 Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual C++ Express 2008
+# Visual Studio 2008
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Endpoints", "Endpoints", "{9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}"
@@ -160,28 +160,28 @@
 		conf\lang\de\vm\tts.xml = conf\lang\de\vm\tts.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (2)", "demo (2)", "{765EF1B9-5027-4820-BC37-A44466A51631}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{765EF1B9-5027-4820-BC37-A44466A51631}"
 	ProjectSection(SolutionItems) = preProject
 		conf\lang\en\demo\demo.xml = conf\lang\en\demo\demo.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (2)", "vm (2)", "{713E4747-1126-40B1-BD84-58F9A7745423}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{713E4747-1126-40B1-BD84-58F9A7745423}"
 	ProjectSection(SolutionItems) = preProject
 		conf\lang\en\vm\sounds.xml = conf\lang\en\vm\sounds.xml
 		conf\lang\en\vm\tts.xml = conf\lang\en\vm\tts.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (3)", "demo (3)", "{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843}"
 	ProjectSection(SolutionItems) = preProject
 		conf\lang\fr\demo\demo.xml = conf\lang\fr\demo\demo.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (3)", "vm (3)", "{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0}"
 	ProjectSection(SolutionItems) = preProject
 		conf\lang\fr\vm\sounds.xml = conf\lang\fr\vm\sounds.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs (2)", "autoload_configs (2)", "{4833F8E3-ABBF-4260-9DB1-B34015676CFC}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoload_configs", "{4833F8E3-ABBF-4260-9DB1-B34015676CFC}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\autoload_configs\alsa.conf.xml = debug\conf\autoload_configs\alsa.conf.xml
 		debug\conf\autoload_configs\conference.conf.xml = debug\conf\autoload_configs\conference.conf.xml
@@ -214,26 +214,26 @@
 		debug\conf\autoload_configs\zeroconf.conf.xml = debug\conf\autoload_configs\zeroconf.conf.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan (2)", "dialplan (2)", "{D44DD429-FE98-42AA-B5B7-4B4EBE33AEFD}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{D44DD429-FE98-42AA-B5B7-4B4EBE33AEFD}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\dialplan\default.xml = debug\conf\dialplan\default.xml
 		debug\conf\dialplan\US.conf.xml = debug\conf\dialplan\US.conf.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory (2)", "directory (2)", "{471110C9-A7ED-4966-98E1-8EA667BF0EEA}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{471110C9-A7ED-4966-98E1-8EA667BF0EEA}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\directory\default.xml = debug\conf\directory\default.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles (2)", "sip_profiles (2)", "{4DF5199E-F7F5-4347-97DD-22078FCDB371}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles", "sip_profiles", "{4DF5199E-F7F5-4347-97DD-22078FCDB371}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\sip_profiles\default.xml = debug\conf\sip_profiles\default.xml
 		debug\conf\sip_profiles\nat.xml = debug\conf\sip_profiles\nat.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang (2)", "lang (2)", "{B487BEBE-4A5C-434F-8D30-39465412F84F}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang", "lang", "{B487BEBE-4A5C-434F-8D30-39465412F84F}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de (2)", "de (2)", "{2003189F-0E69-4FF7-A11D-3BFB3F03D558}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de", "de", "{2003189F-0E69-4FF7-A11D-3BFB3F03D558}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\lang\de\de.xml = debug\conf\lang\de\de.xml
 	EndProjectSection
@@ -243,43 +243,43 @@
 		debug\conf\lang\en\en.xml = debug\conf\lang\en\en.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr (2)", "fr (2)", "{1240C217-6674-43C1-B099-B0290D84F28B}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr", "fr", "{1240C217-6674-43C1-B099-B0290D84F28B}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\lang\fr\fr.xml = debug\conf\lang\fr\fr.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (4)", "demo (4)", "{03517B06-98A1-46DD-9347-BFFFED7DD8A4}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{03517B06-98A1-46DD-9347-BFFFED7DD8A4}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\lang\de\demo\demo.xml = debug\conf\lang\de\demo\demo.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (4)", "vm (4)", "{1D339A14-FFC2-4F6E-BEF2-D5D6DF14AC88}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{1D339A14-FFC2-4F6E-BEF2-D5D6DF14AC88}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\lang\de\vm\tts.xml = debug\conf\lang\de\vm\tts.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (5)", "demo (5)", "{B4C6D0B5-5F39-4546-820D-4BCAA6C3E301}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{B4C6D0B5-5F39-4546-820D-4BCAA6C3E301}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\lang\en\demo\demo.xml = debug\conf\lang\en\demo\demo.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (5)", "vm (5)", "{3041F86C-51D4-4D9E-8A00-91BA4B7C51D4}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{3041F86C-51D4-4D9E-8A00-91BA4B7C51D4}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\lang\en\vm\sounds.xml = debug\conf\lang\en\vm\sounds.xml
 		debug\conf\lang\en\vm\tts.xml = debug\conf\lang\en\vm\tts.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (6)", "demo (6)", "{DFE96A6E-5C9A-4C74-959A-9C485A7AD95C}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{DFE96A6E-5C9A-4C74-959A-9C485A7AD95C}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\lang\fr\demo\demo.xml = debug\conf\lang\fr\demo\demo.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (6)", "vm (6)", "{80A4CA5C-7208-4134-8EFD-C147B03C8AA1}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{80A4CA5C-7208-4134-8EFD-C147B03C8AA1}"
 	ProjectSection(SolutionItems) = preProject
 		debug\conf\lang\fr\vm\sounds.xml = debug\conf\lang\fr\vm\sounds.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs (3)", "autoload_configs (3)", "{8D29085B-952D-4594-9BB9-5781CE552D0A}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoload_configs", "{8D29085B-952D-4594-9BB9-5781CE552D0A}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\autoload_configs\alsa.conf.xml = release\conf\autoload_configs\alsa.conf.xml
 		release\conf\autoload_configs\conference.conf.xml = release\conf\autoload_configs\conference.conf.xml
@@ -312,25 +312,25 @@
 		release\conf\autoload_configs\zeroconf.conf.xml = release\conf\autoload_configs\zeroconf.conf.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan (3)", "dialplan (3)", "{23874F4B-C0AF-4587-9F7E-DB0F06DE8CB4}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{23874F4B-C0AF-4587-9F7E-DB0F06DE8CB4}"
 	ProjectSection(SolutionItems) = preProject
 		conf\dialplan\default.xml = conf\dialplan\default.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory (3)", "directory (3)", "{19ED97F6-30D8-4FCE-AE1D-8B7FCB170D40}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{19ED97F6-30D8-4FCE-AE1D-8B7FCB170D40}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\directory\default.xml = release\conf\directory\default.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles (3)", "sip_profiles (3)", "{99E79D76-FCFC-466B-965B-273CCACF99B0}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles", "sip_profiles", "{99E79D76-FCFC-466B-965B-273CCACF99B0}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\sip_profiles\default.xml = release\conf\sip_profiles\default.xml
 		release\conf\sip_profiles\nat.xml = release\conf\sip_profiles\nat.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang (3)", "lang (3)", "{8FADAC7F-CA9E-49D9-B957-A5F5605D238C}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang", "lang", "{8FADAC7F-CA9E-49D9-B957-A5F5605D238C}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de (3)", "de (3)", "{58A56014-DEA7-4172-8C26-BAD8D499A1E8}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de", "de", "{58A56014-DEA7-4172-8C26-BAD8D499A1E8}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\lang\de\de.xml = release\conf\lang\de\de.xml
 	EndProjectSection
@@ -340,38 +340,38 @@
 		release\conf\lang\en\en.xml = release\conf\lang\en\en.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr (3)", "fr (3)", "{89A94241-1DA6-44E8-A685-AED1E665C2AD}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr", "fr", "{89A94241-1DA6-44E8-A685-AED1E665C2AD}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\lang\fr\fr.xml = release\conf\lang\fr\fr.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (7)", "demo (7)", "{2D74F635-AB18-43B3-A87E-A71F3EA24DDB}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{2D74F635-AB18-43B3-A87E-A71F3EA24DDB}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\lang\de\demo\demo.xml = release\conf\lang\de\demo\demo.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (7)", "vm (7)", "{A721E646-07E9-4E16-A92D-B97F654B2BAC}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{A721E646-07E9-4E16-A92D-B97F654B2BAC}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\lang\de\vm\tts.xml = release\conf\lang\de\vm\tts.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (8)", "demo (8)", "{50331CA0-7038-4341-B92D-C34E1601EFF0}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{50331CA0-7038-4341-B92D-C34E1601EFF0}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\lang\en\demo\demo.xml = release\conf\lang\en\demo\demo.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (8)", "vm (8)", "{FC0DB2A2-B1A3-426E-9E37-BE28FE8FE01B}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{FC0DB2A2-B1A3-426E-9E37-BE28FE8FE01B}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\lang\en\vm\sounds.xml = release\conf\lang\en\vm\sounds.xml
 		release\conf\lang\en\vm\tts.xml = release\conf\lang\en\vm\tts.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (9)", "demo (9)", "{91C6DEDE-CE4A-47D1-A84B-3E828F82E2B0}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{91C6DEDE-CE4A-47D1-A84B-3E828F82E2B0}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\lang\fr\demo\demo.xml = release\conf\lang\fr\demo\demo.xml
 	EndProjectSection
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (9)", "vm (9)", "{8F5A511B-F716-4D07-9657-55B9E4F1D3E9}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{8F5A511B-F716-4D07-9657-55B9E4F1D3E9}"
 	ProjectSection(SolutionItems) = preProject
 		release\conf\lang\fr\vm\sounds.xml = release\conf\lang\fr\vm\sounds.xml
 	EndProjectSection
@@ -424,12 +424,6 @@
 		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918} = {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_woomera", "src\mod\endpoints\mod_woomera\mod_woomera.2008.vcproj", "{FE3540C5-3303-46E0-A69E-D92F775687F1}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "docs", "docs\docs.2008.vcproj", "{1A1FF289-4FD6-4285-A422-D31DD67A4723}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_xml", "src\mod\dialplans\mod_dialplan_xml\mod_dialplan_xml.2008.vcproj", "{07113B25-D3AF-4E04-BA77-4CD1171F022C}"
@@ -996,7 +990,20 @@
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skypiax", "src\mod\endpoints\mod_skypiax\mod_skypiax.2008.vcproj", "{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg722_1", "libs\win32\libg722_1\libg722_1.vcproj", "{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_siren", "src\mod\codecs\mod_siren\mod_siren.2008.vcproj", "{0B6C905B-142E-4999-B39D-92FF7951E921}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C} = {1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esl", "libs\esl\src\esl.2008.vcproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fs_cli", "libs\esl\fs_cli.2008.vcproj", "{D2FB8043-D208-4AEE-8F18-3B5857C871B9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E} = {CF405366-9558-4AE8-90EF-5E21B51CCB4E}
+	EndProjectSection
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1048,12 +1055,6 @@
 		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.ActiveCfg = Release|Win32
 		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.Build.0 = Release|Win32
 		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|x64.ActiveCfg = Release|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.Build.0 = Debug|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|x64.ActiveCfg = Debug|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.ActiveCfg = Release|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.Build.0 = Release|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|x64.ActiveCfg = Release|Win32
 		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Win32.ActiveCfg = Debug|Win32
 		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|x64.ActiveCfg = Debug|Win32
 		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Win32.ActiveCfg = Release|Win32
@@ -1748,12 +1749,28 @@
 		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.ActiveCfg = Release|Win32
 		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.Build.0 = Release|Win32
 		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|x64.ActiveCfg = Release|Win32
-		{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.Build.0 = Debug|Win32
-		{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|x64.ActiveCfg = Debug|Win32
-		{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.ActiveCfg = Release|Win32
-		{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.Build.0 = Release|Win32
-		{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x64.ActiveCfg = Release|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|Win32.Build.0 = Debug|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|x64.ActiveCfg = Debug|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|Win32.ActiveCfg = Release|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|Win32.Build.0 = Release|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|x64.ActiveCfg = Release|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|Win32.Build.0 = Debug|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|x64.ActiveCfg = Debug|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|Win32.ActiveCfg = Release|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|Win32.Build.0 = Release|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|x64.ActiveCfg = Release|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Win32.Build.0 = Debug|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|x64.ActiveCfg = Debug|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.ActiveCfg = Release|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.Build.0 = Release|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.ActiveCfg = Release|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|x64.ActiveCfg = Debug|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.ActiveCfg = Release|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|x64.ActiveCfg = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -1766,9 +1783,9 @@
 		{8DEB383C-4091-4F42-A56F-C9E46D552D79} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
 		{2C3C2423-234B-4772-8899-D3B137E5CA35} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
 		{42B6C2E3-7D5F-4204-A1F6-C0376B86C315} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{0B6C905B-142E-4999-B39D-92FF7951E921} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
 		{3A5B9131-F20C-4A85-9447-6C1610941CEE} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
 		{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{FE3540C5-3303-46E0-A69E-D92F775687F1} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
 		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
 		{0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
 		{B3F424EC-3D8F-417C-B244-3919D5E1A577} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
@@ -1807,7 +1824,6 @@
 		{36E854E3-CE12-4348-A125-CCF3F9D74813} = {0C808854-54D1-4230-BFF5-77B5FD905000}
 		{7B077E7F-1BE7-4291-AB86-55E527B25CAC} = {0C808854-54D1-4230-BFF5-77B5FD905000}
 		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0} = {0C808854-54D1-4230-BFF5-77B5FD905000}
 		{692F6330-4D87-4C82-81DF-40DB5892636E} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
 		{E7116F50-2B10-472F-92BD-C8667AA9C1AE} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
 		{2286DA73-9FC5-45BC-A508-85994C3317AB} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
@@ -1852,6 +1868,8 @@
 		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
 		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
 		{419C8F80-D858-4B48-A25C-AF4007608137} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
 		{5927104D-C14C-4AC8-925C-4AB681762E75} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 		{4F92B672-DADB-4047-8D6A-4BB3796733FD} = {C120A020-773F-4EA3-923F-B67AF28B750D}

Modified: freeswitch/branches/gmaruzz/bootstrap.sh
==============================================================================
--- freeswitch/branches/gmaruzz/bootstrap.sh	(original)
+++ freeswitch/branches/gmaruzz/bootstrap.sh	Tue Dec 23 07:37:03 2008
@@ -60,6 +60,27 @@
 echo "bootstrap: automake version $am_version (ok)"
 fi
 
+# aclocal 1.7 or newer
+
+acl_version=`${ACLOCAL:-aclocal} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;s/[- ].*//g;q'`
+if test -z "$acl_version"; then
+echo "bootstrap: aclocal not found."
+echo "           You need aclocal version 1.7 or newer installed"
+echo "           to build FreeSWITCH from SVN."
+exit 1
+fi
+IFS=_; set $acl_version; IFS=' '
+acl_version=$1
+IFS=.; set $acl_version; IFS=' '
+if test "$1" = "1" -a "$2" -lt "7"; then
+echo "bootstrap: aclocal version $acl_version found."
+echo "           You need aclocal version 1.7 or newer installed"
+echo "           to build FreeSWITCH from SVN."
+exit 1
+else
+echo "bootstrap: aclocal version $acl_version (ok)"
+fi
+
 # Sample libtool --version outputs:
 # ltmain.sh (GNU libtool) 1.3.3 (1.385.2.181 1999/07/02 15:49:11)
 # ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a
@@ -70,7 +91,8 @@
 lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
 if test -z "$lt_pversion"; then
 echo "bootstrap: libtool not found."
-echo "           You need libtool version 1.5.14 or newer installed"
+echo "           You need libtool version 1.5.14 or newer up to 1.9.x installed"
+echo "           libtool version 2.0 and above WILL NOT work."
 echo "           to build FreeSWITCH from SVN."
 exit 1
 fi

Modified: freeswitch/branches/gmaruzz/build/modules.conf.in
==============================================================================
--- freeswitch/branches/gmaruzz/build/modules.conf.in	(original)
+++ freeswitch/branches/gmaruzz/build/modules.conf.in	Tue Dec 23 07:37:03 2008
@@ -28,6 +28,7 @@
 codecs/mod_ilbc
 codecs/mod_speex
 #codecs/mod_siren
+#codecs/mod_celt
 #dialplans/mod_dialplan_directory
 dialplans/mod_dialplan_xml
 dialplans/mod_dialplan_asterisk

Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml	Tue Dec 23 07:37:03 2008
@@ -150,5 +150,29 @@
       <!--<param name="tts-engine" value="flite"/>-->
       <!--<param name="tts-voice" value="kal16"/>-->
     </profile>
+    <!--
+    <profile name="cdquality">
+      <param name="domain" value="$${domain}"/>
+      <param name="rate" value="48000"/>
+      <param name="interval" value="10"/>
+      <param name="energy-level" value="300"/>
+      <param name="sound-prefix" value="$${base_dir}/sounds/en/us/callie"/>
+      <param name="muted-sound" value="conference/conf-muted.wav"/>
+      <param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
+      <param name="alone-sound" value="conference/conf-alone.wav"/>
+      <param name="moh-sound" value="$${hold_music}"/>
+      <param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
+      <param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
+      <param name="kicked-sound" value="conference/conf-kicked.wav"/>
+      <param name="locked-sound" value="conference/conf-locked.wav"/>
+      <param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
+      <param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
+      <param name="pin-sound" value="conference/conf-pin.wav"/>
+      <param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
+      <param name="caller-id-name" value="$${outbound_caller_name}"/>
+      <param name="caller-id-number" value="$${outbound_caller_id}"/>
+      <param name="comfort-noise" value="true"/>
+    </profile>
+    -->
   </profiles>
 </configuration>

Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/local_stream.conf.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/autoload_configs/local_stream.conf.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/autoload_configs/local_stream.conf.xml	Tue Dec 23 07:37:03 2008
@@ -22,5 +22,13 @@
     <param name="interval" value="20"/>
     <param name="timer-name" value="soft"/>
   </directory>
-
+  <!--
+  <directory name="moh/48000" path="$${base_dir}/sounds/music/48000">
+    <param name="rate" value="48000"/>
+    <param name="shuffle" value="true"/>
+    <param name="channels" value="1"/>
+    <param name="interval" value="10"/>
+    <param name="timer-name" value="soft"/>
+  </directory>
+  -->
 </configuration>

Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/voicemail.conf.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/autoload_configs/voicemail.conf.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/autoload_configs/voicemail.conf.xml	Tue Dec 23 07:37:03 2008
@@ -30,6 +30,7 @@
       <param name="restart-key" value="1"/>
       <param name="ff-key" value="6"/>
       <param name="rew-key" value="4"/>
+      <param name="skip-greet-key" value="#"/>
       <param name="record-silence-threshold" value="200"/>
       <param name="record-silence-hits" value="2"/>
       <param name="web-template-file" value="web-vm.tpl"/>

Modified: freeswitch/branches/gmaruzz/conf/dialplan/default.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/dialplan/default.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/dialplan/default.xml	Tue Dec 23 07:37:03 2008
@@ -91,7 +91,7 @@
       <condition field="${numbering_plan}" expression="^$" break="never">
 	<action application="set_user" data="default@${domain_name}"/>
       </condition>
-      <condition field="$${call_debug}" expression="^true$" break="never">
+      <condition field="${call_debug}" expression="^true$" break="never">
 	<action application="info"/>
       </condition>
       <condition field="${sip_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$" break="never">

Modified: freeswitch/branches/gmaruzz/conf/dialplan/default/01_example.com.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/dialplan/default/01_example.com.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/dialplan/default/01_example.com.xml	Tue Dec 23 07:37:03 2008
@@ -20,7 +20,7 @@
 
   <extension name="international.example.com">
     <condition field="${toll_allow}" expression="international"/>
-    <condition field="destination_number" expression="^(011\d{10+})$">
+    <condition field="destination_number" expression="^(011\d+)$">
       <action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
       <action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/>
       <action application="bridge" data="sofia/gateway/${default_gateway}/$1"/>

Modified: freeswitch/branches/gmaruzz/conf/sip_profiles/internal.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/sip_profiles/internal.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/sip_profiles/internal.xml	Tue Dec 23 07:37:03 2008
@@ -157,11 +157,6 @@
 	<!-- enable-3pcc can be set to either 'true' or 'proxy', true accepts the call right away, proxy waits until the call has been answered then sends accepts -->
     <!--<param name="enable-3pcc" value="true"/>-->
 	
-    <!-- use stun when specified (default is true) -->
-    <!--<param name="stun-enabled" value="true"/>-->
-    <!-- use stun when specified (default is true) -->
-    <!-- set to true to have the profile determine stun is not useful and turn it off globally-->
-    <!--<param name="stun-auto-disable" value="true"/>-->
     <!-- use at your own risk or if you know what this does.-->
     <!--<param name="NDLB-force-rport" value="true"/>-->
     <!--

Modified: freeswitch/branches/gmaruzz/conf/vars.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/vars.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/vars.xml	Tue Dec 23 07:37:03 2008
@@ -35,6 +35,8 @@
        speex at 32000h@20i - Speex 32kHz using 20ms ptime.
        G7221 at 16000h     - G722.1 16kHz (aka Siren 7)
        G7221 at 32000h     - G722.1C 32kHz (aka Siren 14)
+       CELT at 32000h      - CELT 32kHz, only 10ms supported
+       CELT at 48000h      - CELT 48kHz, only 10ms supported
        GSM at 40i          - GSM 8kHz using 40ms ptime. (GSM is done in multiples of 20, Default is 20ms)
        G722             - G722 16kHz using default 20ms ptime. (multiples of 10)
        PCMU             - G711 8kHz ulaw using default 20ms ptime. (multiples of 10)

Modified: freeswitch/branches/gmaruzz/docs/phrase/phrase_en.xml
==============================================================================
--- freeswitch/branches/gmaruzz/docs/phrase/phrase_en.xml	(original)
+++ freeswitch/branches/gmaruzz/docs/phrase/phrase_en.xml	Tue Dec 23 07:37:03 2008
@@ -267,12 +267,20 @@
       <prompt phrase="To speak with an operator" filename="ivr-to_speak_with_an_operator.wav"/>
       <prompt phrase="Welcome to FreeSWITCH, the future of telephony" filename="ivr-welcome_to_freeswitch.wav"/>
       <prompt phrase="You may exit at any time by simply hanging up" filename="ivr-you_may_exit_by_hanging_up.wav"/>
-      <!-- Suggested additions
-       <prompt phrase="or" filename ="ivr-or.wav"/>
-       <prompt phrase="not" filename ="ivr-not.wav"/>
-       <prompt phrase="call" filename ="ivr-call.wav"/>
-       <prompt phrase="You may" filename ="ivr-you_may.wav"/>
-       -->
+      <prompt phrase="or" filename ="ivr-or.wav"/>
+      <prompt phrase="not" filename ="ivr-not.wav"/>
+      <prompt phrase="call" filename ="ivr-call.wav"/>
+      <prompt phrase="You may" filename ="ivr-you_may.wav"/>
+      <prompt phrase="hello" filename="ivr-hello.wav"/>
+      <prompt phrase="Using your telephone keypad..." filename="ivr-use_telephone_keypad.wav"/>
+      <prompt phrase="please spell the name of the person you are trying to reach." filename="ivr-spell_name.wav"/>
+      <prompt phrase="Last name first" filename="ivr-last_name_first.wav"/>
+      <prompt phrase="First name first" filename="ivr-first_name_first.wav"/>
+      <prompt phrase="Press 1 for Q or Z." filename="ivr-press_one_q_or_z.wav"/>
+      <prompt phrase="Sales" filename="ivr-sales.wav"/>
+      <prompt phrase="Customer service" filename="ivr-customer_service.wav"/>
+      <prompt phrase="Technical support" filename="ivr-technical_support.wav"/>
+      <prompt phrase="Operator" filename="ivr-operator.wav"/>
     </ivr>
     <misc>
       <prompt phrase="This call has been secured" filename="call_secured.wav"/>

Modified: freeswitch/branches/gmaruzz/libs/codec/ilbc/src/iLBC_define.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/codec/ilbc/src/iLBC_define.h	(original)
+++ freeswitch/branches/gmaruzz/libs/codec/ilbc/src/iLBC_define.h	Tue Dec 23 07:37:03 2008
@@ -16,7 +16,7 @@
 
 /* general codec settings */
 
-#define FS                      (float)8000.0
+#define FREQ_S                  (float)8000.0
 #define BLOCKL_20MS             160
 #define BLOCKL_30MS             240
 #define BLOCKL_MAX              240

Modified: freeswitch/branches/gmaruzz/libs/js/nsprpub/configure.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/js/nsprpub/configure.in	(original)
+++ freeswitch/branches/gmaruzz/libs/js/nsprpub/configure.in	Tue Dec 23 07:37:03 2008
@@ -2825,4 +2825,7 @@
     MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
 fi
 
+# mmkay, this fixes things on FreeBSD-7.1(-rc1)...
+MAKEFILES="`echo $MAKEFILES | tr -d '\n'`"
+
 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])

Modified: freeswitch/branches/gmaruzz/libs/libg722_1/src/coef2sam.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/libg722_1/src/coef2sam.h	(original)
+++ freeswitch/branches/gmaruzz/libs/libg722_1/src/coef2sam.h	Tue Dec 23 07:37:03 2008
@@ -123,970 +123,970 @@
 #else
 const float rmlt_to_samples_window[DCT_LENGTH] =
 {
-    2.45436677e-03,
-    7.36304140e-03,
-    1.22715384e-02,
-    1.71797387e-02,
-    2.20875274e-02,
-    2.69947816e-02,
-    3.19013856e-02,
-    3.68072242e-02,
-    4.17121723e-02,
-    4.66161147e-02,
-    5.15189357e-02,
-    5.64205162e-02,
-    6.13207370e-02,
-    6.62194788e-02,
-    7.11166263e-02,
-    7.60120600e-02,
-    8.09056610e-02,
-    8.57973099e-02,
-    9.06868950e-02,
-    9.55742970e-02,
-    1.00459397e-01,
-    1.05342068e-01,
-    1.10222206e-01,
-    1.15099691e-01,
-    1.19974397e-01,
-    1.24846213e-01,
-    1.29715025e-01,
-    1.34580702e-01,
-    1.39443144e-01,
-    1.44302234e-01,
-    1.49157837e-01,
-    1.54009849e-01,
-    1.58858150e-01,
-    1.63702607e-01,
-    1.68543145e-01,
-    1.73379600e-01,
-    1.78211898e-01,
-    1.83039889e-01,
-    1.87863469e-01,
-    1.92682534e-01,
-    1.97496936e-01,
-    2.02306598e-01,
-    2.07111374e-01,
-    2.11911172e-01,
-    2.16705844e-01,
-    2.21495315e-01,
-    2.26279438e-01,
-    2.31058106e-01,
-    2.35831216e-01,
-    2.40598634e-01,
-    2.45360255e-01,
-    2.50115961e-01,
-    2.54865646e-01,
-    2.59609193e-01,
-    2.64346480e-01,
-    2.69077420e-01,
-    2.73801863e-01,
-    2.78519690e-01,
-    2.83230811e-01,
-    2.87935108e-01,
-    2.92632490e-01,
-    2.97322810e-01,
-    3.02005947e-01,
-    3.06681812e-01,
-    3.11350316e-01,
-    3.16011280e-01,
-    3.20664644e-01,
-    3.25310290e-01,
-    3.29948097e-01,
-    3.34577948e-01,
-    3.39199722e-01,
-    3.43813360e-01,
-    3.48418683e-01,
-    3.53015602e-01,
-    3.57604057e-01,
-    3.62183869e-01,
-    3.66754949e-01,
-    3.71317208e-01,
-    3.75870496e-01,
-    3.80414754e-01,
-    3.84949833e-01,
-    3.89475614e-01,
-    3.93992037e-01,
-    3.98498952e-01,
-    4.02996302e-01,
-    4.07483906e-01,
-    4.11961704e-01,
-    4.16429549e-01,
-    4.20887381e-01,
-    4.25335079e-01,
-    4.29772526e-01,
-    4.34199601e-01,
-    4.38616246e-01,
-    4.43022281e-01,
-    4.47417676e-01,
-    4.51802284e-01,
-    4.56175983e-01,
-    4.60538715e-01,
-    4.64890331e-01,
-    4.69230771e-01,
-    4.73559886e-01,
-    4.77877587e-01,
-    4.82183784e-01,
-    4.86478359e-01,
-    4.90761191e-01,
-    4.95032221e-01,
-    4.99291331e-01,
-    5.03538370e-01,
-    5.07773340e-01,
-    5.11996031e-01,
-    5.16206384e-01,
-    5.20404279e-01,
-    5.24589658e-01,
-    5.28762400e-01,
-    5.32922447e-01,
-    5.37069619e-01,
-    5.41203797e-01,
-    5.45324981e-01,
-    5.49433053e-01,
-    5.53527832e-01,
-    5.57609320e-01,
-    5.61677337e-01,
-    5.65731823e-01,
-    5.69772661e-01,
-    5.73799789e-01,
-    5.77813089e-01,
-    5.81812501e-01,
-    5.85797846e-01,
-    5.89769125e-01,
-    5.93726158e-01,
-    5.97668886e-01,
-    6.01597190e-01,
-    6.05511069e-01,
-    6.09410286e-01,
-    6.13294840e-01,
-    6.17164612e-01,
-    6.21019542e-01,
-    6.24859512e-01,
-    6.28684402e-01,
-    6.32494152e-01,
-    6.36288643e-01,
-    6.40067816e-01,
-    6.43831551e-01,
-    6.47579789e-01,
-    6.51312411e-01,
-    6.55029356e-01,
-    6.58730507e-01,
-    6.62415802e-01,
-    6.66085124e-01,
-    6.69738352e-01,
-    6.73375487e-01,
-    6.76996410e-01,
-    6.80601001e-01,
-    6.84189200e-01,
-    6.87760890e-01,
-    6.91316009e-01,
-    6.94854498e-01,
-    6.98376238e-01,
-    7.01881170e-01,
-    7.05369174e-01,
-    7.08840132e-01,
-    7.12294042e-01,
-    7.15730846e-01,
-    7.19150364e-01,
-    7.22552538e-01,
-    7.25937307e-01,
-    7.29304552e-01,
-    7.32654274e-01,
-    7.35986352e-01,
-    7.39300668e-01,
-    7.42597163e-01,
-    7.45875776e-01,
-    7.49136388e-01,
-    7.52379000e-01,
-    7.55603433e-01,
-    7.58809686e-01,
-    7.61997640e-01,
-    7.65167236e-01,
-    7.68318415e-01,
-    7.71451116e-01,
-    7.74565160e-01,
-    7.77660549e-01,
-    7.80737221e-01,
-    7.83795059e-01,
-    7.86834061e-01,
-    7.89854050e-01,
-    7.92855024e-01,
-    7.95836926e-01,
-    7.98799574e-01,
-    8.01743031e-01,
-    8.04667175e-01,
-    8.07571888e-01,
-    8.10457170e-01,
-    8.13322961e-01,
-    8.16169083e-01,
-    8.18995595e-01,
-    8.21802378e-01,
-    8.24589312e-01,
-    8.27356398e-01,
-    8.30103517e-01,
-    8.32830667e-01,
-    8.35537732e-01,
-    8.38224709e-01,
-    8.40891480e-01,
-    8.43537927e-01,
-    8.46164107e-01,
-    8.48769844e-01,
-    8.51355195e-01,
-    8.53919983e-01,
-    8.56464207e-01,
-    8.58987808e-01,
-    8.61490726e-01,
-    8.63972843e-01,
-    8.66434157e-01,
-    8.68874609e-01,
-    8.71294141e-01,
-    8.73692632e-01,
-    8.76070082e-01,
-    8.78426433e-01,
-    8.80761623e-01,
-    8.83075595e-01,
-    8.85368288e-01,
-    8.87639642e-01,
-    8.89889598e-01,
-    8.92118096e-01,
-    8.94325137e-01,
-    8.96510601e-01,
-    8.98674488e-01,
-    9.00816679e-01,
-    9.02937174e-01,
-    9.05035973e-01,
-    9.07112896e-01,
-    9.09168005e-01,
-    9.11201179e-01,
-    9.13212419e-01,
-    9.15201604e-01,
-    9.17168796e-01,
-    9.19113874e-01,
-    9.21036780e-01,
-    9.22937512e-01,
-    9.24816012e-01,
-    9.26672220e-01,
-    9.28506076e-01,
-    9.30317581e-01,
-    9.32106674e-01,
-    9.33873296e-01,
-    9.35617447e-01,
-    9.37339008e-01,
-    9.39037979e-01,
-    9.40714359e-01,
-    9.42368090e-01,
-    9.43999052e-01,
-    9.45607305e-01,
-    9.47192788e-01,
-    9.48755443e-01,
-    9.50295210e-01,
-    9.51812088e-01,
-    9.53306019e-01,
-    9.54777002e-01,
-    9.56224978e-01,
-    9.57649946e-01,
-    9.59051788e-01,
-    9.60430503e-01,
-    9.61786151e-01,
-    9.63118553e-01,
-    9.64427769e-01,
-    9.65713739e-01,
-    9.66976464e-01,
-    9.68215883e-01,
-    9.69431996e-01,
-    9.70624685e-01,
-    9.71794009e-01,
-    9.72939968e-01,
-    9.74062443e-01,
-    9.75161433e-01,
-    9.76236939e-01,
-    9.77288961e-01,
-    9.78317380e-01,
-    9.79322255e-01,
-    9.80303526e-01,
-    9.81261134e-01,
-    9.82195139e-01,
-    9.83105481e-01,
-    9.83992159e-01,
-    9.84855056e-01,
-    9.85694289e-01,
-    9.86509740e-01,
-    9.87301409e-01,
-    9.88069296e-01,
-    9.88813400e-01,
-    9.89533663e-01,
-    9.90230083e-01,
-    9.90902662e-01,
-    9.91551340e-01,
-    9.92176116e-01,
-    9.92776990e-01,
-    9.93353963e-01,
-    9.93906975e-01,
-    9.94436026e-01,
-    9.94941175e-01,
-    9.95422304e-01,
-    9.95879471e-01,
-    9.96312618e-01,
-    9.96721745e-01,
-    9.97106910e-01,
-    9.97467995e-01,
-    9.97805059e-01,
-    9.98118103e-01,
-    9.98407066e-01,
-    9.98672009e-01,
-    9.98912871e-01,
-    9.99129653e-01,
-    9.99322355e-01,
-    9.99491036e-01,
-    9.99635577e-01,
-    9.99756038e-01,
-    9.99852419e-01,
-    9.99924719e-01,
-    9.99972880e-01,
-    9.99996960e-01
+    2.45436677e-03f,
+    7.36304140e-03f,
+    1.22715384e-02f,
+    1.71797387e-02f,
+    2.20875274e-02f,
+    2.69947816e-02f,
+    3.19013856e-02f,
+    3.68072242e-02f,
+    4.17121723e-02f,
+    4.66161147e-02f,
+    5.15189357e-02f,
+    5.64205162e-02f,
+    6.13207370e-02f,
+    6.62194788e-02f,
+    7.11166263e-02f,
+    7.60120600e-02f,
+    8.09056610e-02f,
+    8.57973099e-02f,
+    9.06868950e-02f,
+    9.55742970e-02f,
+    1.00459397e-01f,
+    1.05342068e-01f,
+    1.10222206e-01f,
+    1.15099691e-01f,
+    1.19974397e-01f,
+    1.24846213e-01f,
+    1.29715025e-01f,
+    1.34580702e-01f,
+    1.39443144e-01f,
+    1.44302234e-01f,
+    1.49157837e-01f,
+    1.54009849e-01f,
+    1.58858150e-01f,
+    1.63702607e-01f,
+    1.68543145e-01f,
+    1.73379600e-01f,
+    1.78211898e-01f,
+    1.83039889e-01f,
+    1.87863469e-01f,
+    1.92682534e-01f,
+    1.97496936e-01f,
+    2.02306598e-01f,
+    2.07111374e-01f,
+    2.11911172e-01f,
+    2.16705844e-01f,
+    2.21495315e-01f,
+    2.26279438e-01f,
+    2.31058106e-01f,
+    2.35831216e-01f,
+    2.40598634e-01f,
+    2.45360255e-01f,
+    2.50115961e-01f,
+    2.54865646e-01f,
+    2.59609193e-01f,
+    2.64346480e-01f,
+    2.69077420e-01f,
+    2.73801863e-01f,
+    2.78519690e-01f,
+    2.83230811e-01f,
+    2.87935108e-01f,
+    2.92632490e-01f,
+    2.97322810e-01f,
+    3.02005947e-01f,
+    3.06681812e-01f,
+    3.11350316e-01f,
+    3.16011280e-01f,
+    3.20664644e-01f,
+    3.25310290e-01f,
+    3.29948097e-01f,
+    3.34577948e-01f,
+    3.39199722e-01f,
+    3.43813360e-01f,
+    3.48418683e-01f,
+    3.53015602e-01f,
+    3.57604057e-01f,
+    3.62183869e-01f,
+    3.66754949e-01f,
+    3.71317208e-01f,
+    3.75870496e-01f,
+    3.80414754e-01f,
+    3.84949833e-01f,
+    3.89475614e-01f,
+    3.93992037e-01f,
+    3.98498952e-01f,
+    4.02996302e-01f,
+    4.07483906e-01f,
+    4.11961704e-01f,
+    4.16429549e-01f,
+    4.20887381e-01f,
+    4.25335079e-01f,
+    4.29772526e-01f,
+    4.34199601e-01f,
+    4.38616246e-01f,
+    4.43022281e-01f,
+    4.47417676e-01f,
+    4.51802284e-01f,
+    4.56175983e-01f,
+    4.60538715e-01f,
+    4.64890331e-01f,
+    4.69230771e-01f,
+    4.73559886e-01f,
+    4.77877587e-01f,
+    4.82183784e-01f,
+    4.86478359e-01f,
+    4.90761191e-01f,
+    4.95032221e-01f,
+    4.99291331e-01f,
+    5.03538370e-01f,
+    5.07773340e-01f,
+    5.11996031e-01f,
+    5.16206384e-01f,
+    5.20404279e-01f,
+    5.24589658e-01f,
+    5.28762400e-01f,
+    5.32922447e-01f,
+    5.37069619e-01f,
+    5.41203797e-01f,
+    5.45324981e-01f,
+    5.49433053e-01f,
+    5.53527832e-01f,
+    5.57609320e-01f,
+    5.61677337e-01f,
+    5.65731823e-01f,
+    5.69772661e-01f,
+    5.73799789e-01f,
+    5.77813089e-01f,
+    5.81812501e-01f,
+    5.85797846e-01f,
+    5.89769125e-01f,
+    5.93726158e-01f,
+    5.97668886e-01f,
+    6.01597190e-01f,
+    6.05511069e-01f,
+    6.09410286e-01f,
+    6.13294840e-01f,
+    6.17164612e-01f,
+    6.21019542e-01f,
+    6.24859512e-01f,
+    6.28684402e-01f,
+    6.32494152e-01f,
+    6.36288643e-01f,
+    6.40067816e-01f,
+    6.43831551e-01f,
+    6.47579789e-01f,
+    6.51312411e-01f,
+    6.55029356e-01f,
+    6.58730507e-01f,
+    6.62415802e-01f,
+    6.66085124e-01f,
+    6.69738352e-01f,
+    6.73375487e-01f,
+    6.76996410e-01f,
+    6.80601001e-01f,
+    6.84189200e-01f,
+    6.87760890e-01f,
+    6.91316009e-01f,
+    6.94854498e-01f,
+    6.98376238e-01f,
+    7.01881170e-01f,
+    7.05369174e-01f,
+    7.08840132e-01f,
+    7.12294042e-01f,
+    7.15730846e-01f,
+    7.19150364e-01f,
+    7.22552538e-01f,
+    7.25937307e-01f,
+    7.29304552e-01f,
+    7.32654274e-01f,
+    7.35986352e-01f,
+    7.39300668e-01f,
+    7.42597163e-01f,
+    7.45875776e-01f,
+    7.49136388e-01f,
+    7.52379000e-01f,
+    7.55603433e-01f,
+    7.58809686e-01f,
+    7.61997640e-01f,
+    7.65167236e-01f,
+    7.68318415e-01f,
+    7.71451116e-01f,
+    7.74565160e-01f,
+    7.77660549e-01f,
+    7.80737221e-01f,
+    7.83795059e-01f,
+    7.86834061e-01f,
+    7.89854050e-01f,
+    7.92855024e-01f,
+    7.95836926e-01f,
+    7.98799574e-01f,
+    8.01743031e-01f,
+    8.04667175e-01f,
+    8.07571888e-01f,
+    8.10457170e-01f,
+    8.13322961e-01f,
+    8.16169083e-01f,
+    8.18995595e-01f,
+    8.21802378e-01f,
+    8.24589312e-01f,
+    8.27356398e-01f,
+    8.30103517e-01f,
+    8.32830667e-01f,
+    8.35537732e-01f,
+    8.38224709e-01f,
+    8.40891480e-01f,
+    8.43537927e-01f,
+    8.46164107e-01f,
+    8.48769844e-01f,
+    8.51355195e-01f,
+    8.53919983e-01f,
+    8.56464207e-01f,
+    8.58987808e-01f,
+    8.61490726e-01f,
+    8.63972843e-01f,
+    8.66434157e-01f,
+    8.68874609e-01f,
+    8.71294141e-01f,
+    8.73692632e-01f,
+    8.76070082e-01f,
+    8.78426433e-01f,
+    8.80761623e-01f,
+    8.83075595e-01f,
+    8.85368288e-01f,
+    8.87639642e-01f,
+    8.89889598e-01f,
+    8.92118096e-01f,
+    8.94325137e-01f,
+    8.96510601e-01f,
+    8.98674488e-01f,
+    9.00816679e-01f,
+    9.02937174e-01f,
+    9.05035973e-01f,
+    9.07112896e-01f,
+    9.09168005e-01f,
+    9.11201179e-01f,
+    9.13212419e-01f,
+    9.15201604e-01f,
+    9.17168796e-01f,
+    9.19113874e-01f,
+    9.21036780e-01f,
+    9.22937512e-01f,
+    9.24816012e-01f,
+    9.26672220e-01f,
+    9.28506076e-01f,
+    9.30317581e-01f,
+    9.32106674e-01f,
+    9.33873296e-01f,
+    9.35617447e-01f,
+    9.37339008e-01f,
+    9.39037979e-01f,
+    9.40714359e-01f,
+    9.42368090e-01f,
+    9.43999052e-01f,
+    9.45607305e-01f,
+    9.47192788e-01f,
+    9.48755443e-01f,
+    9.50295210e-01f,
+    9.51812088e-01f,
+    9.53306019e-01f,
+    9.54777002e-01f,
+    9.56224978e-01f,
+    9.57649946e-01f,
+    9.59051788e-01f,
+    9.60430503e-01f,
+    9.61786151e-01f,
+    9.63118553e-01f,
+    9.64427769e-01f,
+    9.65713739e-01f,
+    9.66976464e-01f,
+    9.68215883e-01f,
+    9.69431996e-01f,
+    9.70624685e-01f,
+    9.71794009e-01f,
+    9.72939968e-01f,
+    9.74062443e-01f,
+    9.75161433e-01f,
+    9.76236939e-01f,
+    9.77288961e-01f,
+    9.78317380e-01f,
+    9.79322255e-01f,
+    9.80303526e-01f,
+    9.81261134e-01f,
+    9.82195139e-01f,
+    9.83105481e-01f,
+    9.83992159e-01f,
+    9.84855056e-01f,
+    9.85694289e-01f,
+    9.86509740e-01f,
+    9.87301409e-01f,
+    9.88069296e-01f,
+    9.88813400e-01f,
+    9.89533663e-01f,
+    9.90230083e-01f,
+    9.90902662e-01f,
+    9.91551340e-01f,
+    9.92176116e-01f,
+    9.92776990e-01f,
+    9.93353963e-01f,
+    9.93906975e-01f,
+    9.94436026e-01f,
+    9.94941175e-01f,
+    9.95422304e-01f,
+    9.95879471e-01f,
+    9.96312618e-01f,
+    9.96721745e-01f,
+    9.97106910e-01f,
+    9.97467995e-01f,
+    9.97805059e-01f,
+    9.98118103e-01f,
+    9.98407066e-01f,
+    9.98672009e-01f,
+    9.98912871e-01f,
+    9.99129653e-01f,
+    9.99322355e-01f,
+    9.99491036e-01f,
+    9.99635577e-01f,
+    9.99756038e-01f,
+    9.99852419e-01f,
+    9.99924719e-01f,
+    9.99972880e-01f,
+    9.99996960e-01f
 };
 
 const float max_rmlt_to_samples_window[MAX_DCT_LENGTH] =
 {
-    1.22718432e-03,
-    3.68154561e-03,
-    6.13588467e-03,
-    8.59018695e-03,
-    1.10444371e-02,
-    1.34986211e-02,
-    1.59527231e-02,
-    1.84067301e-02,
-    2.08606254e-02,
-    2.33143959e-02,
-    2.57680248e-02,
-    2.82214992e-02,
-    3.06748040e-02,
-    3.31279226e-02,
-    3.55808437e-02,
-    3.80335487e-02,
-    4.04860228e-02,
-    4.29382585e-02,
-    4.53902297e-02,
-    4.78419326e-02,
-    5.02933450e-02,
-    5.27444519e-02,
-    5.51952459e-02,
-    5.76457046e-02,
-    6.00958169e-02,
-    6.25455678e-02,
-    6.49949387e-02,
-    6.74439222e-02,
-    6.98924959e-02,
-    7.23406523e-02,
-    7.47883692e-02,
-    7.72356316e-02,
-    7.96824396e-02,
-    8.21287632e-02,
-    8.45745876e-02,
-    8.70199054e-02,
-    8.94647017e-02,
-    9.19089541e-02,
-    9.43526551e-02,
-    9.67957899e-02,
-    9.92383435e-02,
-    1.01680294e-01,
-    1.04121633e-01,
-    1.06562346e-01,
-    1.09002419e-01,
-    1.11441828e-01,
-    1.13880575e-01,
-    1.16318628e-01,
-    1.18755989e-01,
-    1.21192627e-01,
-    1.23628542e-01,
-    1.26063704e-01,
-    1.28498107e-01,
-    1.30931750e-01,
-    1.33364588e-01,
-    1.35796621e-01,
-    1.38227850e-01,
-    1.40658244e-01,
-    1.43087775e-01,
-    1.45516455e-01,
-    1.47944272e-01,
-    1.50371179e-01,
-    1.52797192e-01,
-    1.55222267e-01,
-    1.57646418e-01,
-    1.60069630e-01,
-    1.62491858e-01,
-    1.64913118e-01,
-    1.67333379e-01,
-    1.69752643e-01,
-    1.72170877e-01,
-    1.74588069e-01,
-    1.77004218e-01,
-    1.79419294e-01,
-    1.81833297e-01,
-    1.84246197e-01,
-    1.86657995e-01,
-    1.89068660e-01,
-    1.91478193e-01,
-    1.93886578e-01,
-    1.96293786e-01,
-    1.98699802e-01,
-    2.01104641e-01,
-    2.03508258e-01,
-    2.05910638e-01,
-    2.08311796e-01,
-    2.10711688e-01,
-    2.13110313e-01,
-    2.15507656e-01,
-    2.17903703e-01,
-    2.20298439e-01,
-    2.22691849e-01,
-    2.25083917e-01,
-    2.27474615e-01,
-    2.29863957e-01,
-    2.32251912e-01,
-    2.34638467e-01,
-    2.37023607e-01,
-    2.39407316e-01,
-    2.41789594e-01,
-    2.44170398e-01,
-    2.46549740e-01,
-    2.48927608e-01,
-    2.51303971e-01,
-    2.53678799e-01,
-    2.56052136e-01,
-    2.58423895e-01,
-    2.60794103e-01,
-    2.63162762e-01,
-    2.65529811e-01,
-    2.67895281e-01,
-    2.70259142e-01,
-    2.72621363e-01,
-    2.74981946e-01,
-    2.77340859e-01,
-    2.79698104e-01,
-    2.82053679e-01,
-    2.84407526e-01,
-    2.86759704e-01,
-    2.89110124e-01,
-    2.91458815e-01,
-    2.93805718e-01,
-    2.96150893e-01,
-    2.98494250e-01,
-    3.00835848e-01,
-    3.03175598e-01,
-    3.05513531e-01,
-    3.07849646e-01,
-    3.10183883e-01,
-    3.12516272e-01,
-    3.14846754e-01,
-    3.17175359e-01,
-    3.19502026e-01,
-    3.21826786e-01,
-    3.24149609e-01,
-    3.26470494e-01,
-    3.28789383e-01,
-    3.31106305e-01,
-    3.33421230e-01,
-    3.35734159e-01,
-    3.38045061e-01,
-    3.40353906e-01,
-    3.42660725e-01,
-    3.44965458e-01,
-    3.47268134e-01,
-    3.49568695e-01,
-    3.51867169e-01,
-    3.54163527e-01,
-    3.56457740e-01,
-    3.58749807e-01,
-    3.61039728e-01,
-    3.63327444e-01,
-    3.65612984e-01,
-    3.67896348e-01,
-    3.70177478e-01,
-    3.72456372e-01,
-    3.74733001e-01,
-    3.77007425e-01,
-    3.79279524e-01,
-    3.81549388e-01,
-    3.83816928e-01,
-    3.86082143e-01,
-    3.88345033e-01,
-    3.90605599e-01,
-    3.92863810e-01,
-    3.95119667e-01,
-    3.97373140e-01,
-    3.99624199e-01,
-    4.01872873e-01,
-    4.04119104e-01,
-    4.06362921e-01,
-    4.08604264e-01,
-    4.10843164e-01,
-    4.13079590e-01,
-    4.15313542e-01,
-    4.17544961e-01,
-    4.19773877e-01,
-    4.22000259e-01,
-    4.24224108e-01,
-    4.26445425e-01,
-    4.28664148e-01,
-    4.30880278e-01,
-    4.33093816e-01,
-    4.35304761e-01,
-    4.37513083e-01,
-    4.39718753e-01,
-    4.41921771e-01,
-    4.44122136e-01,
-    4.46319848e-01,
-    4.48514849e-01,
-    4.50707138e-01,
-    4.52896714e-01,
-    4.55083579e-01,
-    4.57267702e-01,
-    4.59449053e-01,
-    4.61627662e-01,
-    4.63803470e-01,
-    4.65976506e-01,
-    4.68146712e-01,
-    4.70314115e-01,
-    4.72478658e-01,
-    4.74640369e-01,
-    4.76799220e-01,
-    4.78955209e-01,
-    4.81108308e-01,
-    4.83258516e-01,
-    4.85405803e-01,
-    4.87550169e-01,
-    4.89691585e-01,
-    4.91830051e-01,
-    4.93965566e-01,
-    4.96098131e-01,
-    4.98227656e-01,
-    5.00354230e-01,
-    5.02477765e-01,
-    5.04598260e-01,
-    5.06715715e-01,
-    5.08830130e-01,
-    5.10941505e-01,
-    5.13049781e-01,
-    5.15154958e-01,
-    5.17257035e-01,
-    5.19356012e-01,
-    5.21451831e-01,
-    5.23544490e-01,
-    5.25634050e-01,
-    5.27720451e-01,
-    5.29803634e-01,
-    5.31883657e-01,
-    5.33960402e-01,
-    5.36033988e-01,
-    5.38104355e-01,
-    5.40171444e-01,
-    5.42235315e-01,
-    5.44295907e-01,
-    5.46353221e-01,
-    5.48407257e-01,
-    5.50457954e-01,
-    5.52505374e-01,
-    5.54549456e-01,
-    5.56590199e-01,
-    5.58627546e-01,
-    5.60661554e-01,
-    5.62692225e-01,
-    5.64719439e-01,
-    5.66743314e-01,
-    5.68763733e-01,
-    5.70780754e-01,
-    5.72794318e-01,
-    5.74804425e-01,
-    5.76811075e-01,
-    5.78814268e-01,
-    5.80813944e-01,
-    5.82810163e-01,
-    5.84802806e-01,
-    5.86791992e-01,
-    5.88777602e-01,
-    5.90759695e-01,
-    5.92738211e-01,
-    5.94713151e-01,
-    5.96684515e-01,
-    5.98652303e-01,
-    6.00616455e-01,
-    6.02577031e-01,
-    6.04533970e-01,
-    6.06487215e-01,
-    6.08436823e-01,
-    6.10382795e-01,
-    6.12325072e-01,
-    6.14263654e-01,
-    6.16198599e-01,
-    6.18129730e-01,
-    6.20057225e-01,
-    6.21980906e-01,
-    6.23900890e-01,
-    6.25817120e-01,
-    6.27729595e-01,
-    6.29638255e-01,
-    6.31543100e-01,
-    6.33444190e-01,
-    6.35341406e-01,
-    6.37234867e-01,
-    6.39124453e-01,
-    6.41010165e-01,
-    6.42892063e-01,
-    6.44770086e-01,
-    6.46644175e-01,
-    6.48514390e-01,
-    6.50380731e-01,
-    6.52243137e-01,
-    6.54101610e-01,
-    6.55956089e-01,
-    6.57806695e-01,
-    6.59653306e-01,
-    6.61495924e-01,
-    6.63334608e-01,
-    6.65169239e-01,
-    6.66999936e-01,
-    6.68826580e-01,
-    6.70649171e-01,
-    6.72467709e-01,
-    6.74282253e-01,
-    6.76092684e-01,
-    6.77899063e-01,
-    6.79701388e-01,
-    6.81499600e-01,
-    6.83293700e-01,
-    6.85083687e-01,
-    6.86869502e-01,
-    6.88651264e-01,
-    6.90428793e-01,
-    6.92202210e-01,
-    6.93971455e-01,
-    6.95736527e-01,
-    6.97497368e-01,
-    6.99254036e-01,
-    7.01006532e-01,
-    7.02754736e-01,
-    7.04498768e-01,
-    7.06238508e-01,
-    7.07974017e-01,
-    7.09705234e-01,
-    7.11432219e-01,
-    7.13154852e-01,
-    7.14873254e-01,
-    7.16587305e-01,
-    7.18297064e-01,
-    7.20002532e-01,
-    7.21703589e-01,
-    7.23400354e-01,
-    7.25092709e-01,
-    7.26780772e-01,
-    7.28464365e-01,
-    7.30143666e-01,
-    7.31818497e-01,
-    7.33488917e-01,
-    7.35154986e-01,
-    7.36816585e-01,
-    7.38473713e-01,
-    7.40126431e-01,
-    7.41774678e-01,
-    7.43418455e-01,
-    7.45057762e-01,
-    7.46692598e-01,
-    7.48322904e-01,
-    7.49948740e-01,
-    7.51570046e-01,
-    7.53186822e-01,
-    7.54799008e-01,
-    7.56406724e-01,
-    7.58009851e-01,
-    7.59608388e-01,
-    7.61202395e-01,
-    7.62791812e-01,
-    7.64376581e-01,
-    7.65956819e-01,
-    7.67532349e-01,
-    7.69103348e-01,
-    7.70669639e-01,
-    7.72231340e-01,
-    7.73788393e-01,
-    7.75340736e-01,
-    7.76888490e-01,
-    7.78431475e-01,
-    7.79969811e-01,
-    7.81503439e-01,
-    7.83032358e-01,
-    7.84556568e-01,
-    7.86076069e-01,
-    7.87590802e-01,
-    7.89100826e-01,
-    7.90606081e-01,
-    7.92106569e-01,
-    7.93602288e-01,
-    7.95093238e-01,
-    7.96579361e-01,
-    7.98060715e-01,
-    7.99537241e-01,
-    8.01008999e-01,
-    8.02475870e-01,
-    8.03937972e-01,
-    8.05395186e-01,
-    8.06847572e-01,
-    8.08295071e-01,
-    8.09737682e-01,
-    8.11175466e-01,
-    8.12608361e-01,
-    8.14036310e-01,
-    8.15459430e-01,
-    8.16877604e-01,
-    8.18290830e-01,
-    8.19699109e-01,
-    8.21102500e-01,
-    8.22500944e-01,
-    8.23894441e-01,
-    8.25282931e-01,
-    8.26666474e-01,
-    8.28045070e-01,
-    8.29418600e-01,
-    8.30787182e-01,
-    8.32150757e-01,
-    8.33509326e-01,
-    8.34862888e-01,
-    8.36211383e-01,
-    8.37554872e-01,
-    8.38893294e-01,
-    8.40226650e-01,
-    8.41554999e-01,
-    8.42878222e-01,
-    8.44196379e-01,
-    8.45509470e-01,
-    8.46817434e-01,
-    8.48120332e-01,
-    8.49418104e-01,
-    8.50710809e-01,
-    8.51998329e-01,
-    8.53280723e-01,
-    8.54557991e-01,
-    8.55830133e-01,
-    8.57097089e-01,
-    8.58358860e-01,
-    8.59615505e-01,
-    8.60866964e-01,
-    8.62113178e-01,
-    8.63354266e-01,
-    8.64590168e-01,
-    8.65820825e-01,
-    8.67046237e-01,
-    8.68266463e-01,
-    8.69481444e-01,
-    8.70691240e-01,
-    8.71895730e-01,
-    8.73094976e-01,
-    8.74288976e-01,
-    8.75477731e-01,
-    8.76661181e-01,
-    8.77839327e-01,
-    8.79012227e-01,
-    8.80179822e-01,
-    8.81342113e-01,
-    8.82499099e-01,
-    8.83650780e-01,
-    8.84797096e-01,
-    8.85938108e-01,
-    8.87073815e-01,
-    8.88204098e-01,
-    8.89329076e-01,
-    8.90448749e-01,
-    8.91562998e-01,
-    8.92671883e-01,
-    8.93775403e-01,
-    8.94873500e-01,
-    8.95966232e-01,
-    8.97053599e-01,
-    8.98135543e-01,
-    8.99212062e-01,
-    9.00283158e-01,
-    9.01348829e-01,
-    9.02409077e-01,
-    9.03463900e-01,
-    9.04513299e-01,
-    9.05557215e-01,
-    9.06595707e-01,
-    9.07628715e-01,
-    9.08656240e-01,
-    9.09678340e-01,
-    9.10694897e-01,
-    9.11706030e-01,
-    9.12711620e-01,
-    9.13711786e-01,
-    9.14706349e-01,
-    9.15695488e-01,
-    9.16679084e-01,
-    9.17657137e-01,
-    9.18629646e-01,
-    9.19596672e-01,
-    9.20558095e-01,
-    9.21514034e-01,
-    9.22464430e-01,
-    9.23409224e-01,
-    9.24348474e-01,
-    9.25282121e-01,
-    9.26210225e-01,
-    9.27132785e-01,
-    9.28049684e-01,
-    9.28961039e-01,
-    9.29866791e-01,
-    9.30766940e-01,
-    9.31661487e-01,
-    9.32550430e-01,
-    9.33433771e-01,
-    9.34311450e-01,
-    9.35183525e-01,
-    9.36049938e-01,
-    9.36910748e-01,
-    9.37765896e-01,
-    9.38615382e-01,
-    9.39459205e-01,
-    9.40297425e-01,
-    9.41129923e-01,
-    9.41956758e-01,
-    9.42777932e-01,
-    9.43593442e-01,
-    9.44403291e-01,
-    9.45207417e-01,
-    9.46005821e-01,
-    9.46798563e-01,
-    9.47585583e-01,
-    9.48366940e-01,
-    9.49142516e-01,
-    9.49912429e-01,
-    9.50676560e-01,
-    9.51435030e-01,
-    9.52187717e-01,
-    9.52934682e-01,
-    9.53675926e-01,
-    9.54411447e-01,
-    9.55141187e-01,
-    9.55865145e-01,
-    9.56583381e-01,
-    9.57295835e-01,
-    9.58002567e-01,
-    9.58703458e-01,
-    9.59398627e-01,
-    9.60088015e-01,
-    9.60771620e-01,
-    9.61449385e-01,
-    9.62121427e-01,
-    9.62787628e-01,
-    9.63448048e-01,
-    9.64102626e-01,
-    9.64751422e-01,
-    9.65394437e-01,
-    9.66031611e-01,
-    9.66663003e-01,
-    9.67288494e-01,
-    9.67908204e-01,
-    9.68522072e-01,
-    9.69130158e-01,
-    9.69732344e-01,
-    9.70328689e-01,
-    9.70919251e-01,
-    9.71503913e-01,
-    9.72082734e-01,
-    9.72655654e-01,
-    9.73222792e-01,
-    9.73784029e-01,
-    9.74339366e-01,
-    9.74888861e-01,
-    9.75432515e-01,
-    9.75970268e-01,
-    9.76502120e-01,
-    9.77028131e-01,
-    9.77548242e-01,
-    9.78062451e-01,
-    9.78570819e-01,
-    9.79073226e-01,
-    9.79569793e-01,
-    9.80060399e-01,
-    9.80545104e-01,
-    9.81023967e-01,
-    9.81496871e-01,
-    9.81963873e-01,
-    9.82424974e-01,
-    9.82880116e-01,
-    9.83329356e-01,
-    9.83772695e-01,
-    9.84210074e-01,
-    9.84641552e-01,
-    9.85067070e-01,
-    9.85486686e-01,
-    9.85900342e-01,
-    9.86308098e-01,
-    9.86709893e-01,
-    9.87105727e-01,
-    9.87495601e-01,
-    9.87879574e-01,
-    9.88257587e-01,
-    9.88629639e-01,
-    9.88995671e-01,
-    9.89355803e-01,
-    9.89709973e-01,
-    9.90058184e-01,
-    9.90400434e-01,
-    9.90736723e-01,
-    9.91067052e-01,
-    9.91391361e-01,
-    9.91709769e-01,
-    9.92022157e-01,
-    9.92328584e-01,
-    9.92628992e-01,
-    9.92923498e-01,
-    9.93211925e-01,
-    9.93494451e-01,
-    9.93770957e-01,
-    9.94041502e-01,
-    9.94306028e-01,
-    9.94564593e-01,
-    9.94817138e-01,
-    9.95063663e-01,
-    9.95304286e-01,
-    9.95538831e-01,
-    9.95767415e-01,
-    9.95989978e-01,
-    9.96206582e-01,
-    9.96417165e-01,
-    9.96621728e-01,
-    9.96820271e-01,
-    9.97012854e-01,
-    9.97199416e-01,
-    9.97379959e-01,
-    9.97554541e-01,
-    9.97723043e-01,
-    9.97885585e-01,
-    9.98042107e-01,
-    9.98192608e-01,
-    9.98337090e-01,
-    9.98475552e-01,
-    9.98608053e-01,
-    9.98734474e-01,
-    9.98854935e-01,
-    9.98969316e-01,
-    9.99077737e-01,
-    9.99180079e-01,
-    9.99276459e-01,
-    9.99366820e-01,
-    9.99451101e-01,
-    9.99529421e-01,
-    9.99601722e-01,
-    9.99667943e-01,
-    9.99728203e-01,
-    9.99782383e-01,
-    9.99830604e-01,
-    9.99872744e-01,
-    9.99908864e-01,
-    9.99939024e-01,
-    9.99963105e-01,
-    9.99981165e-01,
-    9.99993205e-01,
-    9.99999225e-01
+    1.22718432e-03f,
+    3.68154561e-03f,
+    6.13588467e-03f,
+    8.59018695e-03f,
+    1.10444371e-02f,
+    1.34986211e-02f,
+    1.59527231e-02f,
+    1.84067301e-02f,
+    2.08606254e-02f,
+    2.33143959e-02f,
+    2.57680248e-02f,
+    2.82214992e-02f,
+    3.06748040e-02f,
+    3.31279226e-02f,
+    3.55808437e-02f,
+    3.80335487e-02f,
+    4.04860228e-02f,
+    4.29382585e-02f,
+    4.53902297e-02f,
+    4.78419326e-02f,
+    5.02933450e-02f,
+    5.27444519e-02f,
+    5.51952459e-02f,
+    5.76457046e-02f,
+    6.00958169e-02f,
+    6.25455678e-02f,
+    6.49949387e-02f,
+    6.74439222e-02f,
+    6.98924959e-02f,
+    7.23406523e-02f,
+    7.47883692e-02f,
+    7.72356316e-02f,
+    7.96824396e-02f,
+    8.21287632e-02f,
+    8.45745876e-02f,
+    8.70199054e-02f,
+    8.94647017e-02f,
+    9.19089541e-02f,
+    9.43526551e-02f,
+    9.67957899e-02f,
+    9.92383435e-02f,
+    1.01680294e-01f,
+    1.04121633e-01f,
+    1.06562346e-01f,
+    1.09002419e-01f,
+    1.11441828e-01f,
+    1.13880575e-01f,
+    1.16318628e-01f,
+    1.18755989e-01f,
+    1.21192627e-01f,
+    1.23628542e-01f,
+    1.26063704e-01f,
+    1.28498107e-01f,
+    1.30931750e-01f,
+    1.33364588e-01f,
+    1.35796621e-01f,
+    1.38227850e-01f,
+    1.40658244e-01f,
+    1.43087775e-01f,
+    1.45516455e-01f,
+    1.47944272e-01f,
+    1.50371179e-01f,
+    1.52797192e-01f,
+    1.55222267e-01f,
+    1.57646418e-01f,
+    1.60069630e-01f,
+    1.62491858e-01f,
+    1.64913118e-01f,
+    1.67333379e-01f,
+    1.69752643e-01f,
+    1.72170877e-01f,
+    1.74588069e-01f,
+    1.77004218e-01f,
+    1.79419294e-01f,
+    1.81833297e-01f,
+    1.84246197e-01f,
+    1.86657995e-01f,
+    1.89068660e-01f,
+    1.91478193e-01f,
+    1.93886578e-01f,
+    1.96293786e-01f,
+    1.98699802e-01f,
+    2.01104641e-01f,
+    2.03508258e-01f,
+    2.05910638e-01f,
+    2.08311796e-01f,
+    2.10711688e-01f,
+    2.13110313e-01f,
+    2.15507656e-01f,
+    2.17903703e-01f,
+    2.20298439e-01f,
+    2.22691849e-01f,
+    2.25083917e-01f,
+    2.27474615e-01f,
+    2.29863957e-01f,
+    2.32251912e-01f,
+    2.34638467e-01f,
+    2.37023607e-01f,
+    2.39407316e-01f,
+    2.41789594e-01f,
+    2.44170398e-01f,
+    2.46549740e-01f,
+    2.48927608e-01f,
+    2.51303971e-01f,
+    2.53678799e-01f,
+    2.56052136e-01f,
+    2.58423895e-01f,
+    2.60794103e-01f,
+    2.63162762e-01f,
+    2.65529811e-01f,
+    2.67895281e-01f,
+    2.70259142e-01f,
+    2.72621363e-01f,
+    2.74981946e-01f,
+    2.77340859e-01f,
+    2.79698104e-01f,
+    2.82053679e-01f,
+    2.84407526e-01f,
+    2.86759704e-01f,
+    2.89110124e-01f,
+    2.91458815e-01f,
+    2.93805718e-01f,
+    2.96150893e-01f,
+    2.98494250e-01f,
+    3.00835848e-01f,
+    3.03175598e-01f,
+    3.05513531e-01f,
+    3.07849646e-01f,
+    3.10183883e-01f,
+    3.12516272e-01f,
+    3.14846754e-01f,
+    3.17175359e-01f,
+    3.19502026e-01f,
+    3.21826786e-01f,
+    3.24149609e-01f,
+    3.26470494e-01f,
+    3.28789383e-01f,
+    3.31106305e-01f,
+    3.33421230e-01f,
+    3.35734159e-01f,
+    3.38045061e-01f,
+    3.40353906e-01f,
+    3.42660725e-01f,
+    3.44965458e-01f,
+    3.47268134e-01f,
+    3.49568695e-01f,
+    3.51867169e-01f,
+    3.54163527e-01f,
+    3.56457740e-01f,
+    3.58749807e-01f,
+    3.61039728e-01f,
+    3.63327444e-01f,
+    3.65612984e-01f,
+    3.67896348e-01f,
+    3.70177478e-01f,
+    3.72456372e-01f,
+    3.74733001e-01f,
+    3.77007425e-01f,
+    3.79279524e-01f,
+    3.81549388e-01f,
+    3.83816928e-01f,
+    3.86082143e-01f,
+    3.88345033e-01f,
+    3.90605599e-01f,
+    3.92863810e-01f,
+    3.95119667e-01f,
+    3.97373140e-01f,
+    3.99624199e-01f,
+    4.01872873e-01f,
+    4.04119104e-01f,
+    4.06362921e-01f,
+    4.08604264e-01f,
+    4.10843164e-01f,
+    4.13079590e-01f,
+    4.15313542e-01f,
+    4.17544961e-01f,
+    4.19773877e-01f,
+    4.22000259e-01f,
+    4.24224108e-01f,
+    4.26445425e-01f,
+    4.28664148e-01f,
+    4.30880278e-01f,
+    4.33093816e-01f,
+    4.35304761e-01f,
+    4.37513083e-01f,
+    4.39718753e-01f,
+    4.41921771e-01f,
+    4.44122136e-01f,
+    4.46319848e-01f,
+    4.48514849e-01f,
+    4.50707138e-01f,
+    4.52896714e-01f,
+    4.55083579e-01f,
+    4.57267702e-01f,
+    4.59449053e-01f,
+    4.61627662e-01f,
+    4.63803470e-01f,
+    4.65976506e-01f,
+    4.68146712e-01f,
+    4.70314115e-01f,
+    4.72478658e-01f,
+    4.74640369e-01f,
+    4.76799220e-01f,
+    4.78955209e-01f,
+    4.81108308e-01f,
+    4.83258516e-01f,
+    4.85405803e-01f,
+    4.87550169e-01f,
+    4.89691585e-01f,
+    4.91830051e-01f,
+    4.93965566e-01f,
+    4.96098131e-01f,
+    4.98227656e-01f,
+    5.00354230e-01f,
+    5.02477765e-01f,
+    5.04598260e-01f,
+    5.06715715e-01f,
+    5.08830130e-01f,
+    5.10941505e-01f,
+    5.13049781e-01f,
+    5.15154958e-01f,
+    5.17257035e-01f,
+    5.19356012e-01f,
+    5.21451831e-01f,
+    5.23544490e-01f,
+    5.25634050e-01f,
+    5.27720451e-01f,
+    5.29803634e-01f,
+    5.31883657e-01f,
+    5.33960402e-01f,
+    5.36033988e-01f,
+    5.38104355e-01f,
+    5.40171444e-01f,
+    5.42235315e-01f,
+    5.44295907e-01f,
+    5.46353221e-01f,
+    5.48407257e-01f,
+    5.50457954e-01f,
+    5.52505374e-01f,
+    5.54549456e-01f,
+    5.56590199e-01f,
+    5.58627546e-01f,
+    5.60661554e-01f,
+    5.62692225e-01f,
+    5.64719439e-01f,
+    5.66743314e-01f,
+    5.68763733e-01f,
+    5.70780754e-01f,
+    5.72794318e-01f,
+    5.74804425e-01f,
+    5.76811075e-01f,
+    5.78814268e-01f,
+    5.80813944e-01f,
+    5.82810163e-01f,
+    5.84802806e-01f,
+    5.86791992e-01f,
+    5.88777602e-01f,
+    5.90759695e-01f,
+    5.92738211e-01f,
+    5.94713151e-01f,
+    5.96684515e-01f,
+    5.98652303e-01f,
+    6.00616455e-01f,
+    6.02577031e-01f,
+    6.04533970e-01f,
+    6.06487215e-01f,
+    6.08436823e-01f,
+    6.10382795e-01f,
+    6.12325072e-01f,
+    6.14263654e-01f,
+    6.16198599e-01f,
+    6.18129730e-01f,
+    6.20057225e-01f,
+    6.21980906e-01f,
+    6.23900890e-01f,
+    6.25817120e-01f,
+    6.27729595e-01f,
+    6.29638255e-01f,
+    6.31543100e-01f,
+    6.33444190e-01f,
+    6.35341406e-01f,
+    6.37234867e-01f,
+    6.39124453e-01f,
+    6.41010165e-01f,
+    6.42892063e-01f,
+    6.44770086e-01f,
+    6.46644175e-01f,
+    6.48514390e-01f,
+    6.50380731e-01f,
+    6.52243137e-01f,
+    6.54101610e-01f,
+    6.55956089e-01f,
+    6.57806695e-01f,
+    6.59653306e-01f,
+    6.61495924e-01f,
+    6.63334608e-01f,
+    6.65169239e-01f,
+    6.66999936e-01f,
+    6.68826580e-01f,
+    6.70649171e-01f,
+    6.72467709e-01f,
+    6.74282253e-01f,
+    6.76092684e-01f,
+    6.77899063e-01f,
+    6.79701388e-01f,
+    6.81499600e-01f,
+    6.83293700e-01f,
+    6.85083687e-01f,
+    6.86869502e-01f,
+    6.88651264e-01f,
+    6.90428793e-01f,
+    6.92202210e-01f,
+    6.93971455e-01f,
+    6.95736527e-01f,
+    6.97497368e-01f,
+    6.99254036e-01f,
+    7.01006532e-01f,
+    7.02754736e-01f,
+    7.04498768e-01f,
+    7.06238508e-01f,
+    7.07974017e-01f,
+    7.09705234e-01f,
+    7.11432219e-01f,
+    7.13154852e-01f,
+    7.14873254e-01f,
+    7.16587305e-01f,
+    7.18297064e-01f,
+    7.20002532e-01f,
+    7.21703589e-01f,
+    7.23400354e-01f,
+    7.25092709e-01f,
+    7.26780772e-01f,
+    7.28464365e-01f,
+    7.30143666e-01f,
+    7.31818497e-01f,
+    7.33488917e-01f,
+    7.35154986e-01f,
+    7.36816585e-01f,
+    7.38473713e-01f,
+    7.40126431e-01f,
+    7.41774678e-01f,
+    7.43418455e-01f,
+    7.45057762e-01f,
+    7.46692598e-01f,
+    7.48322904e-01f,
+    7.49948740e-01f,
+    7.51570046e-01f,
+    7.53186822e-01f,
+    7.54799008e-01f,
+    7.56406724e-01f,
+    7.58009851e-01f,
+    7.59608388e-01f,
+    7.61202395e-01f,
+    7.62791812e-01f,
+    7.64376581e-01f,
+    7.65956819e-01f,
+    7.67532349e-01f,
+    7.69103348e-01f,
+    7.70669639e-01f,
+    7.72231340e-01f,
+    7.73788393e-01f,
+    7.75340736e-01f,
+    7.76888490e-01f,
+    7.78431475e-01f,
+    7.79969811e-01f,
+    7.81503439e-01f,
+    7.83032358e-01f,
+    7.84556568e-01f,
+    7.86076069e-01f,
+    7.87590802e-01f,
+    7.89100826e-01f,
+    7.90606081e-01f,
+    7.92106569e-01f,
+    7.93602288e-01f,
+    7.95093238e-01f,
+    7.96579361e-01f,
+    7.98060715e-01f,
+    7.99537241e-01f,
+    8.01008999e-01f,
+    8.02475870e-01f,
+    8.03937972e-01f,
+    8.05395186e-01f,
+    8.06847572e-01f,
+    8.08295071e-01f,
+    8.09737682e-01f,
+    8.11175466e-01f,
+    8.12608361e-01f,
+    8.14036310e-01f,
+    8.15459430e-01f,
+    8.16877604e-01f,
+    8.18290830e-01f,
+    8.19699109e-01f,
+    8.21102500e-01f,
+    8.22500944e-01f,
+    8.23894441e-01f,
+    8.25282931e-01f,
+    8.26666474e-01f,
+    8.28045070e-01f,
+    8.29418600e-01f,
+    8.30787182e-01f,
+    8.32150757e-01f,
+    8.33509326e-01f,
+    8.34862888e-01f,
+    8.36211383e-01f,
+    8.37554872e-01f,
+    8.38893294e-01f,
+    8.40226650e-01f,
+    8.41554999e-01f,
+    8.42878222e-01f,
+    8.44196379e-01f,
+    8.45509470e-01f,
+    8.46817434e-01f,
+    8.48120332e-01f,
+    8.49418104e-01f,
+    8.50710809e-01f,
+    8.51998329e-01f,
+    8.53280723e-01f,
+    8.54557991e-01f,
+    8.55830133e-01f,
+    8.57097089e-01f,
+    8.58358860e-01f,
+    8.59615505e-01f,
+    8.60866964e-01f,
+    8.62113178e-01f,
+    8.63354266e-01f,
+    8.64590168e-01f,
+    8.65820825e-01f,
+    8.67046237e-01f,
+    8.68266463e-01f,
+    8.69481444e-01f,
+    8.70691240e-01f,
+    8.71895730e-01f,
+    8.73094976e-01f,
+    8.74288976e-01f,
+    8.75477731e-01f,
+    8.76661181e-01f,
+    8.77839327e-01f,
+    8.79012227e-01f,
+    8.80179822e-01f,
+    8.81342113e-01f,
+    8.82499099e-01f,
+    8.83650780e-01f,
+    8.84797096e-01f,
+    8.85938108e-01f,
+    8.87073815e-01f,
+    8.88204098e-01f,
+    8.89329076e-01f,
+    8.90448749e-01f,
+    8.91562998e-01f,
+    8.92671883e-01f,
+    8.93775403e-01f,
+    8.94873500e-01f,
+    8.95966232e-01f,
+    8.97053599e-01f,
+    8.98135543e-01f,
+    8.99212062e-01f,
+    9.00283158e-01f,
+    9.01348829e-01f,
+    9.02409077e-01f,
+    9.03463900e-01f,
+    9.04513299e-01f,
+    9.05557215e-01f,
+    9.06595707e-01f,
+    9.07628715e-01f,
+    9.08656240e-01f,
+    9.09678340e-01f,
+    9.10694897e-01f,
+    9.11706030e-01f,
+    9.12711620e-01f,
+    9.13711786e-01f,
+    9.14706349e-01f,
+    9.15695488e-01f,
+    9.16679084e-01f,
+    9.17657137e-01f,
+    9.18629646e-01f,
+    9.19596672e-01f,
+    9.20558095e-01f,
+    9.21514034e-01f,
+    9.22464430e-01f,
+    9.23409224e-01f,
+    9.24348474e-01f,
+    9.25282121e-01f,
+    9.26210225e-01f,
+    9.27132785e-01f,
+    9.28049684e-01f,
+    9.28961039e-01f,
+    9.29866791e-01f,
+    9.30766940e-01f,
+    9.31661487e-01f,
+    9.32550430e-01f,
+    9.33433771e-01f,
+    9.34311450e-01f,
+    9.35183525e-01f,
+    9.36049938e-01f,
+    9.36910748e-01f,
+    9.37765896e-01f,
+    9.38615382e-01f,
+    9.39459205e-01f,
+    9.40297425e-01f,
+    9.41129923e-01f,
+    9.41956758e-01f,
+    9.42777932e-01f,
+    9.43593442e-01f,
+    9.44403291e-01f,
+    9.45207417e-01f,
+    9.46005821e-01f,
+    9.46798563e-01f,
+    9.47585583e-01f,
+    9.48366940e-01f,
+    9.49142516e-01f,
+    9.49912429e-01f,
+    9.50676560e-01f,
+    9.51435030e-01f,
+    9.52187717e-01f,
+    9.52934682e-01f,
+    9.53675926e-01f,
+    9.54411447e-01f,
+    9.55141187e-01f,
+    9.55865145e-01f,
+    9.56583381e-01f,
+    9.57295835e-01f,
+    9.58002567e-01f,
+    9.58703458e-01f,
+    9.59398627e-01f,
+    9.60088015e-01f,
+    9.60771620e-01f,
+    9.61449385e-01f,
+    9.62121427e-01f,
+    9.62787628e-01f,
+    9.63448048e-01f,
+    9.64102626e-01f,
+    9.64751422e-01f,
+    9.65394437e-01f,
+    9.66031611e-01f,
+    9.66663003e-01f,
+    9.67288494e-01f,
+    9.67908204e-01f,
+    9.68522072e-01f,
+    9.69130158e-01f,
+    9.69732344e-01f,
+    9.70328689e-01f,
+    9.70919251e-01f,
+    9.71503913e-01f,
+    9.72082734e-01f,
+    9.72655654e-01f,
+    9.73222792e-01f,
+    9.73784029e-01f,
+    9.74339366e-01f,
+    9.74888861e-01f,
+    9.75432515e-01f,
+    9.75970268e-01f,
+    9.76502120e-01f,
+    9.77028131e-01f,
+    9.77548242e-01f,
+    9.78062451e-01f,
+    9.78570819e-01f,
+    9.79073226e-01f,
+    9.79569793e-01f,
+    9.80060399e-01f,
+    9.80545104e-01f,
+    9.81023967e-01f,
+    9.81496871e-01f,
+    9.81963873e-01f,
+    9.82424974e-01f,
+    9.82880116e-01f,
+    9.83329356e-01f,
+    9.83772695e-01f,
+    9.84210074e-01f,
+    9.84641552e-01f,
+    9.85067070e-01f,
+    9.85486686e-01f,
+    9.85900342e-01f,
+    9.86308098e-01f,
+    9.86709893e-01f,
+    9.87105727e-01f,
+    9.87495601e-01f,
+    9.87879574e-01f,
+    9.88257587e-01f,
+    9.88629639e-01f,
+    9.88995671e-01f,
+    9.89355803e-01f,
+    9.89709973e-01f,
+    9.90058184e-01f,
+    9.90400434e-01f,
+    9.90736723e-01f,
+    9.91067052e-01f,
+    9.91391361e-01f,
+    9.91709769e-01f,
+    9.92022157e-01f,
+    9.92328584e-01f,
+    9.92628992e-01f,
+    9.92923498e-01f,
+    9.93211925e-01f,
+    9.93494451e-01f,
+    9.93770957e-01f,
+    9.94041502e-01f,
+    9.94306028e-01f,
+    9.94564593e-01f,
+    9.94817138e-01f,
+    9.95063663e-01f,
+    9.95304286e-01f,
+    9.95538831e-01f,
+    9.95767415e-01f,
+    9.95989978e-01f,
+    9.96206582e-01f,
+    9.96417165e-01f,
+    9.96621728e-01f,
+    9.96820271e-01f,
+    9.97012854e-01f,
+    9.97199416e-01f,
+    9.97379959e-01f,
+    9.97554541e-01f,
+    9.97723043e-01f,
+    9.97885585e-01f,
+    9.98042107e-01f,
+    9.98192608e-01f,
+    9.98337090e-01f,
+    9.98475552e-01f,
+    9.98608053e-01f,
+    9.98734474e-01f,
+    9.98854935e-01f,
+    9.98969316e-01f,
+    9.99077737e-01f,
+    9.99180079e-01f,
+    9.99276459e-01f,
+    9.99366820e-01f,
+    9.99451101e-01f,
+    9.99529421e-01f,
+    9.99601722e-01f,
+    9.99667943e-01f,
+    9.99728203e-01f,
+    9.99782383e-01f,
+    9.99830604e-01f,
+    9.99872744e-01f,
+    9.99908864e-01f,
+    9.99939024e-01f,
+    9.99963105e-01f,
+    9.99981165e-01f,
+    9.99993205e-01f,
+    9.99999225e-01f
 };
 #endif
 /*- End of file ------------------------------------------------------------*/

Modified: freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4.h	(original)
+++ freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4.h	Tue Dec 23 07:37:03 2008
@@ -1,1515 +1,1515 @@
 static const float max_dct_core_a[] =
 {
-     5.572937315437795e-02,
-     5.435713103213160e-02,
-     5.164643594289910e-02,
-     4.766403419605858e-02,
-     4.250798573945089e-02,
-     3.630524959802148e-02,
-     2.920855772127337e-02,
-     2.139265421578210e-02,
-     1.304999256534943e-02,
-     4.385996787515619e-03,
-     5.435713103213160e-02,
-     4.250798573945089e-02,
-     2.139265421578210e-02,
-    -4.385996787515612e-03,
-    -2.920855772127336e-02,
-    -4.766403419605858e-02,
-    -5.572937315437795e-02,
-    -5.164643594289911e-02,
-    -3.630524959802151e-02,
-    -1.304999256534941e-02,
-     5.164643594289910e-02,
-     2.139265421578210e-02,
-    -2.139265421578209e-02,
-    -5.164643594289910e-02,
-    -5.164643594289911e-02,
-    -2.139265421578213e-02,
-     2.139265421578211e-02,
-     5.164643594289909e-02,
-     5.164643594289910e-02,
-     2.139265421578213e-02,
-     4.766403419605858e-02,
-    -4.385996787515612e-03,
-    -5.164643594289910e-02,
-    -4.250798573945090e-02,
-     1.304999256534939e-02,
-     5.435713103213161e-02,
-     3.630524959802152e-02,
-    -2.139265421578210e-02,
-    -5.572937315437795e-02,
-    -2.920855772127336e-02,
-     4.250798573945089e-02,
-    -2.920855772127336e-02,
-    -5.164643594289911e-02,
-     1.304999256534939e-02,
-     5.572937315437795e-02,
-     4.385996787515657e-03,
-    -5.435713103213161e-02,
-    -2.139265421578214e-02,
-     4.766403419605858e-02,
-     3.630524959802153e-02,
-     3.630524959802148e-02,
-    -4.766403419605858e-02,
-    -2.139265421578213e-02,
-     5.435713103213161e-02,
-     4.385996787515657e-03,
-    -5.572937315437795e-02,
-     1.304999256534937e-02,
-     5.164643594289910e-02,
-    -2.920855772127332e-02,
-    -4.250798573945090e-02,
-     2.920855772127337e-02,
-    -5.572937315437795e-02,
-     2.139265421578211e-02,
-     3.630524959802152e-02,
-    -5.435713103213161e-02,
-     1.304999256534937e-02,
-     4.250798573945089e-02,
-    -5.164643594289908e-02,
-     4.385996787515504e-03,
-     4.766403419605861e-02,
-     2.139265421578210e-02,
-    -5.164643594289911e-02,
-     5.164643594289909e-02,
-    -2.139265421578210e-02,
-    -2.139265421578214e-02,
-     5.164643594289910e-02,
-    -5.164643594289908e-02,
-     2.139265421578208e-02,
-     2.139265421578216e-02,
-    -5.164643594289915e-02,
-     1.304999256534943e-02,
-    -3.630524959802151e-02,
-     5.164643594289910e-02,
-    -5.572937315437795e-02,
-     4.766403419605858e-02,
-    -2.920855772127332e-02,
-     4.385996787515504e-03,
-     2.139265421578216e-02,
-    -4.250798573945092e-02,
-     5.435713103213160e-02,
-     4.385996787515619e-03,
-    -1.304999256534941e-02,
-     2.139265421578213e-02,
-    -2.920855772127336e-02,
-     3.630524959802153e-02,
-    -4.250798573945090e-02,
-     4.766403419605861e-02,
-    -5.164643594289915e-02,
-     5.435713103213160e-02,
-    -5.572937315437796e-02
+     5.572937315437795e-02f,
+     5.435713103213160e-02f,
+     5.164643594289910e-02f,
+     4.766403419605858e-02f,
+     4.250798573945089e-02f,
+     3.630524959802148e-02f,
+     2.920855772127337e-02f,
+     2.139265421578210e-02f,
+     1.304999256534943e-02f,
+     4.385996787515619e-03f,
+     5.435713103213160e-02f,
+     4.250798573945089e-02f,
+     2.139265421578210e-02f,
+    -4.385996787515612e-03f,
+    -2.920855772127336e-02f,
+    -4.766403419605858e-02f,
+    -5.572937315437795e-02f,
+    -5.164643594289911e-02f,
+    -3.630524959802151e-02f,
+    -1.304999256534941e-02f,
+     5.164643594289910e-02f,
+     2.139265421578210e-02f,
+    -2.139265421578209e-02f,
+    -5.164643594289910e-02f,
+    -5.164643594289911e-02f,
+    -2.139265421578213e-02f,
+     2.139265421578211e-02f,
+     5.164643594289909e-02f,
+     5.164643594289910e-02f,
+     2.139265421578213e-02f,
+     4.766403419605858e-02f,
+    -4.385996787515612e-03f,
+    -5.164643594289910e-02f,
+    -4.250798573945090e-02f,
+     1.304999256534939e-02f,
+     5.435713103213161e-02f,
+     3.630524959802152e-02f,
+    -2.139265421578210e-02f,
+    -5.572937315437795e-02f,
+    -2.920855772127336e-02f,
+     4.250798573945089e-02f,
+    -2.920855772127336e-02f,
+    -5.164643594289911e-02f,
+     1.304999256534939e-02f,
+     5.572937315437795e-02f,
+     4.385996787515657e-03f,
+    -5.435713103213161e-02f,
+    -2.139265421578214e-02f,
+     4.766403419605858e-02f,
+     3.630524959802153e-02f,
+     3.630524959802148e-02f,
+    -4.766403419605858e-02f,
+    -2.139265421578213e-02f,
+     5.435713103213161e-02f,
+     4.385996787515657e-03f,
+    -5.572937315437795e-02f,
+     1.304999256534937e-02f,
+     5.164643594289910e-02f,
+    -2.920855772127332e-02f,
+    -4.250798573945090e-02f,
+     2.920855772127337e-02f,
+    -5.572937315437795e-02f,
+     2.139265421578211e-02f,
+     3.630524959802152e-02f,
+    -5.435713103213161e-02f,
+     1.304999256534937e-02f,
+     4.250798573945089e-02f,
+    -5.164643594289908e-02f,
+     4.385996787515504e-03f,
+     4.766403419605861e-02f,
+     2.139265421578210e-02f,
+    -5.164643594289911e-02f,
+     5.164643594289909e-02f,
+    -2.139265421578210e-02f,
+    -2.139265421578214e-02f,
+     5.164643594289910e-02f,
+    -5.164643594289908e-02f,
+     2.139265421578208e-02f,
+     2.139265421578216e-02f,
+    -5.164643594289915e-02f,
+     1.304999256534943e-02f,
+    -3.630524959802151e-02f,
+     5.164643594289910e-02f,
+    -5.572937315437795e-02f,
+     4.766403419605858e-02f,
+    -2.920855772127332e-02f,
+     4.385996787515504e-03f,
+     2.139265421578216e-02f,
+    -4.250798573945092e-02f,
+     5.435713103213160e-02f,
+     4.385996787515619e-03f,
+    -1.304999256534941e-02f,
+     2.139265421578213e-02f,
+    -2.920855772127336e-02f,
+     3.630524959802153e-02f,
+    -4.250798573945090e-02f,
+     4.766403419605861e-02f,
+    -5.164643594289915e-02f,
+     5.435713103213160e-02f,
+    -5.572937315437796e-02f
 };
 
 static const float dct_core_a[] =
 {
-     7.881323533747238e-02,
-     7.687259191733195e-02,
-     7.303909015868119e-02,
-     6.740712359748102e-02,
-     6.011536994189358e-02,
-     5.134337636686234e-02,
-     4.130713846678219e-02,
-     3.025378172711701e-02,
-     1.845547647478522e-02,
-     6.202736141429415e-03,
-     7.687259191733195e-02,
-     6.011536994189358e-02,
-     3.025378172711701e-02,
-    -6.202736141429404e-03,
-    -4.130713846678218e-02,
-    -6.740712359748102e-02,
-    -7.881323533747238e-02,
-    -7.303909015868121e-02,
-    -5.134337636686238e-02,
-    -1.845547647478519e-02,
-     7.303909015868119e-02,
-     3.025378172711701e-02,
-    -3.025378172711701e-02,
-    -7.303909015868119e-02,
-    -7.303909015868121e-02,
-    -3.025378172711705e-02,
-     3.025378172711703e-02,
-     7.303909015868118e-02,
-     7.303909015868119e-02,
-     3.025378172711706e-02,
-     6.740712359748102e-02,
-    -6.202736141429404e-03,
-    -7.303909015868119e-02,
-    -6.011536994189359e-02,
-     1.845547647478516e-02,
-     7.687259191733196e-02,
-     5.134337636686239e-02,
-    -3.025378172711702e-02,
-    -7.881323533747238e-02,
-    -4.130713846678218e-02,
-     6.011536994189358e-02,
-    -4.130713846678218e-02,
-    -7.303909015868121e-02,
-     1.845547647478516e-02,
-     7.881323533747238e-02,
-     6.202736141429469e-03,
-    -7.687259191733196e-02,
-    -3.025378172711707e-02,
-     6.740712359748102e-02,
-     5.134337636686240e-02,
-     5.134337636686234e-02,
-    -6.740712359748102e-02,
-    -3.025378172711705e-02,
-     7.687259191733196e-02,
-     6.202736141429469e-03,
-    -7.881323533747238e-02,
-     1.845547647478515e-02,
-     7.303909015868119e-02,
-    -4.130713846678212e-02,
-    -6.011536994189359e-02,
-     4.130713846678219e-02,
-    -7.881323533747238e-02,
-     3.025378172711703e-02,
-     5.134337636686239e-02,
-    -7.687259191733196e-02,
-     1.845547647478515e-02,
-     6.011536994189358e-02,
-    -7.303909015868118e-02,
-     6.202736141429252e-03,
-     6.740712359748108e-02,
-     3.025378172711701e-02,
-    -7.303909015868121e-02,
-     7.303909015868118e-02,
-    -3.025378172711702e-02,
-    -3.025378172711707e-02,
-     7.303909015868119e-02,
-    -7.303909015868118e-02,
-     3.025378172711699e-02,
-     3.025378172711710e-02,
-    -7.303909015868128e-02,
-     1.845547647478522e-02,
-    -5.134337636686238e-02,
-     7.303909015868119e-02,
-    -7.881323533747238e-02,
-     6.740712359748102e-02,
-    -4.130713846678212e-02,
-     6.202736141429252e-03,
-     3.025378172711710e-02,
-    -6.011536994189360e-02,
-     7.687259191733195e-02,
-     6.202736141429415e-03,
-    -1.845547647478519e-02,
-     3.025378172711706e-02,
-    -4.130713846678218e-02,
-     5.134337636686240e-02,
-    -6.011536994189359e-02,
-     6.740712359748108e-02,
-    -7.303909015868128e-02,
-     7.687259191733195e-02,
-    -7.881323533747239e-02
+     7.881323533747238e-02f,
+     7.687259191733195e-02f,
+     7.303909015868119e-02f,
+     6.740712359748102e-02f,
+     6.011536994189358e-02f,
+     5.134337636686234e-02f,
+     4.130713846678219e-02f,
+     3.025378172711701e-02f,
+     1.845547647478522e-02f,
+     6.202736141429415e-03f,
+     7.687259191733195e-02f,
+     6.011536994189358e-02f,
+     3.025378172711701e-02f,
+    -6.202736141429404e-03f,
+    -4.130713846678218e-02f,
+    -6.740712359748102e-02f,
+    -7.881323533747238e-02f,
+    -7.303909015868121e-02f,
+    -5.134337636686238e-02f,
+    -1.845547647478519e-02f,
+     7.303909015868119e-02f,
+     3.025378172711701e-02f,
+    -3.025378172711701e-02f,
+    -7.303909015868119e-02f,
+    -7.303909015868121e-02f,
+    -3.025378172711705e-02f,
+     3.025378172711703e-02f,
+     7.303909015868118e-02f,
+     7.303909015868119e-02f,
+     3.025378172711706e-02f,
+     6.740712359748102e-02f,
+    -6.202736141429404e-03f,
+    -7.303909015868119e-02f,
+    -6.011536994189359e-02f,
+     1.845547647478516e-02f,
+     7.687259191733196e-02f,
+     5.134337636686239e-02f,
+    -3.025378172711702e-02f,
+    -7.881323533747238e-02f,
+    -4.130713846678218e-02f,
+     6.011536994189358e-02f,
+    -4.130713846678218e-02f,
+    -7.303909015868121e-02f,
+     1.845547647478516e-02f,
+     7.881323533747238e-02f,
+     6.202736141429469e-03f,
+    -7.687259191733196e-02f,
+    -3.025378172711707e-02f,
+     6.740712359748102e-02f,
+     5.134337636686240e-02f,
+     5.134337636686234e-02f,
+    -6.740712359748102e-02f,
+    -3.025378172711705e-02f,
+     7.687259191733196e-02f,
+     6.202736141429469e-03f,
+    -7.881323533747238e-02f,
+     1.845547647478515e-02f,
+     7.303909015868119e-02f,
+    -4.130713846678212e-02f,
+    -6.011536994189359e-02f,
+     4.130713846678219e-02f,
+    -7.881323533747238e-02f,
+     3.025378172711703e-02f,
+     5.134337636686239e-02f,
+    -7.687259191733196e-02f,
+     1.845547647478515e-02f,
+     6.011536994189358e-02f,
+    -7.303909015868118e-02f,
+     6.202736141429252e-03f,
+     6.740712359748108e-02f,
+     3.025378172711701e-02f,
+    -7.303909015868121e-02f,
+     7.303909015868118e-02f,
+    -3.025378172711702e-02f,
+    -3.025378172711707e-02f,
+     7.303909015868119e-02f,
+    -7.303909015868118e-02f,
+     3.025378172711699e-02f,
+     3.025378172711710e-02f,
+    -7.303909015868128e-02f,
+     1.845547647478522e-02f,
+    -5.134337636686238e-02f,
+     7.303909015868119e-02f,
+    -7.881323533747238e-02f,
+     6.740712359748102e-02f,
+    -4.130713846678212e-02f,
+     6.202736141429252e-03f,
+     3.025378172711710e-02f,
+    -6.011536994189360e-02f,
+     7.687259191733195e-02f,
+     6.202736141429415e-03f,
+    -1.845547647478519e-02f,
+     3.025378172711706e-02f,
+    -4.130713846678218e-02f,
+     5.134337636686240e-02f,
+    -6.011536994189359e-02f,
+     6.740712359748108e-02f,
+    -7.303909015868128e-02f,
+     7.687259191733195e-02f,
+    -7.881323533747239e-02f
 };
 
 static const cos_msin_t cos_msin_5[5] =
 {
-    {9.969173337331280e-01, -7.845909572784494e-02},
-    {9.723699203976766e-01, -2.334453638559054e-01},
-    {9.238795325112867e-01, -3.826834323650898e-01},
-    {8.526401643540922e-01, -5.224985647159488e-01},
-    {7.604059656000309e-01, -6.494480483301837e-01}
+    {9.969173337331280e-01f, -7.845909572784494e-02f},
+    {9.723699203976766e-01f, -2.334453638559054e-01f},
+    {9.238795325112867e-01f, -3.826834323650898e-01f},
+    {8.526401643540922e-01f, -5.224985647159488e-01f},
+    {7.604059656000309e-01f, -6.494480483301837e-01f}
 };
 
 static const cos_msin_t cos_msin_10[10] =
 {
-    {9.992290362407229e-01, -3.925981575906861e-02},
-    {9.930684569549263e-01, -1.175373974578376e-01},
-    {9.807852804032304e-01, -1.950903220161282e-01},
-    {9.624552364536473e-01, -2.714404498650743e-01},
-    {9.381913359224842e-01, -3.461170570774930e-01},
-    {9.081431738250813e-01, -4.186597375374281e-01},
-    {8.724960070727972e-01, -4.886212414969549e-01},
-    {8.314696123025452e-01, -5.555702330196022e-01},
-    {7.853169308807449e-01, -6.190939493098340e-01},
-    {7.343225094356856e-01, -6.788007455329417e-01}
+    {9.992290362407229e-01f, -3.925981575906861e-02f},
+    {9.930684569549263e-01f, -1.175373974578376e-01f},
+    {9.807852804032304e-01f, -1.950903220161282e-01f},
+    {9.624552364536473e-01f, -2.714404498650743e-01f},
+    {9.381913359224842e-01f, -3.461170570774930e-01f},
+    {9.081431738250813e-01f, -4.186597375374281e-01f},
+    {8.724960070727972e-01f, -4.886212414969549e-01f},
+    {8.314696123025452e-01f, -5.555702330196022e-01f},
+    {7.853169308807449e-01f, -6.190939493098340e-01f},
+    {7.343225094356856e-01f, -6.788007455329417e-01f}
 };
 
 static const cos_msin_t cos_msin_20[20] =
 {
-    {9.998072404820648e-01, -1.963369246062830e-02},
-    {9.982656101847159e-01, -5.887080365118903e-02},
-    {9.951847266721969e-01, -9.801714032956060e-02},
-    {9.905693404435773e-01, -1.370123416819680e-01},
-    {9.844265680898916e-01, -1.757962799343545e-01},
-    {9.767658813208724e-01, -2.143091530650507e-01},
-    {9.675990923602598e-01, -2.524915770151580e-01},
-    {9.569403357322088e-01, -2.902846772544623e-01},
-    {9.448060464668780e-01, -3.276301795616935e-01},
-    {9.312149347588036e-01, -3.644704998791496e-01},
-    {9.161879571171360e-01, -4.007488331031410e-01},
-    {8.997482840522215e-01, -4.364092406733421e-01},
-    {8.819212643483550e-01, -4.713967368259976e-01},
-    {8.627343859777918e-01, -5.056573733779846e-01},
-    {8.422172337162865e-01, -5.391383229110002e-01},
-    {8.204014435255136e-01, -5.717879602276122e-01},
-    {7.973206537727071e-01, -6.035559419535714e-01},
-    {7.730104533627370e-01, -6.343932841636455e-01},
-    {7.475083268625968e-01, -6.642524379112817e-01},
-    {7.208535967029188e-01, -6.930873625456359e-01}
+    {9.998072404820648e-01f, -1.963369246062830e-02f},
+    {9.982656101847159e-01f, -5.887080365118903e-02f},
+    {9.951847266721969e-01f, -9.801714032956060e-02f},
+    {9.905693404435773e-01f, -1.370123416819680e-01f},
+    {9.844265680898916e-01f, -1.757962799343545e-01f},
+    {9.767658813208724e-01f, -2.143091530650507e-01f},
+    {9.675990923602598e-01f, -2.524915770151580e-01f},
+    {9.569403357322088e-01f, -2.902846772544623e-01f},
+    {9.448060464668780e-01f, -3.276301795616935e-01f},
+    {9.312149347588036e-01f, -3.644704998791496e-01f},
+    {9.161879571171360e-01f, -4.007488331031410e-01f},
+    {8.997482840522215e-01f, -4.364092406733421e-01f},
+    {8.819212643483550e-01f, -4.713967368259976e-01f},
+    {8.627343859777918e-01f, -5.056573733779846e-01f},
+    {8.422172337162865e-01f, -5.391383229110002e-01f},
+    {8.204014435255136e-01f, -5.717879602276122e-01f},
+    {7.973206537727071e-01f, -6.035559419535714e-01f},
+    {7.730104533627370e-01f, -6.343932841636455e-01f},
+    {7.475083268625968e-01f, -6.642524379112817e-01f},
+    {7.208535967029188e-01f, -6.930873625456359e-01f}
 };
 
 static const cos_msin_t cos_msin_40[40] =
 {
-    {9.999518089593280e-01, -9.817319337149617e-03},
-    {9.995663085020212e-01, -2.944817324796316e-02},
-    {9.987954562051724e-01, -4.906767432741801e-02},
-    {9.976395492470157e-01, -6.866825888437376e-02},
-    {9.960990332516871e-01, -8.824237052036951e-02},
-    {9.941745021174282e-01, -1.077824630427593e-01},
-    {9.918666977876260e-01, -1.272810033739132e-01},
-    {9.891765099647810e-01, -1.467304744553617e-01},
-    {9.861049757675088e-01, -1.661233781457655e-01},
-    {9.826532793307118e-01, -1.854522381115909e-01},
-    {9.788227513490724e-01, -2.047096027093796e-01},
-    {9.746148685640450e-01, -2.238880478584984e-01},
-    {9.700312531945440e-01, -2.429801799032639e-01},
-    {9.650736723115474e-01, -2.619786384633375e-01},
-    {9.597440371568574e-01, -2.808760992712921e-01},
-    {9.540444024062804e-01, -2.996652769962566e-01},
-    {9.479769653775104e-01, -3.183389280525497e-01},
-    {9.415440651830208e-01, -3.368898533922201e-01},
-    {9.347481818282924e-01, -3.553109012804161e-01},
-    {9.275919352557240e-01, -3.735949700525164e-01},
-    {9.200780843345949e-01, -3.917350108519559e-01},
-    {9.122095257974677e-01, -4.097240303476953e-01},
-    {9.039892931234433e-01, -4.275550934302821e-01},
-    {8.954205553686970e-01, -4.452213258854682e-01},
-    {8.865066159447464e-01, -4.627159170443501e-01},
-    {8.772509113449243e-01, -4.800321224090111e-01},
-    {8.676570098195440e-01, -4.971632662526544e-01},
-    {8.577286100002721e-01, -5.141027441932217e-01},
-    {8.474695394742344e-01, -5.308440257395095e-01},
-    {8.368837533084094e-01, -5.473806568087964e-01},
-    {8.259753325248732e-01, -5.637062622150167e-01},
-    {8.147484825274894e-01, -5.798145481265136e-01},
-    {8.032075314806449e-01, -5.956993044924334e-01},
-    {7.913569286406602e-01, -6.113544074368165e-01},
-    {7.792012426405167e-01, -6.267738216194696e-01},
-    {7.667451597285615e-01, -6.419516025627030e-01},
-    {7.539934819618694e-01, -6.568818989430414e-01},
-    {7.409511253549591e-01, -6.715589548470183e-01},
-    {7.276231179845748e-01, -6.859771119901928e-01},
-    {7.140145980512683e-01, -7.001308118985236e-01}
+    {9.999518089593280e-01f, -9.817319337149617e-03f},
+    {9.995663085020212e-01f, -2.944817324796316e-02f},
+    {9.987954562051724e-01f, -4.906767432741801e-02f},
+    {9.976395492470157e-01f, -6.866825888437376e-02f},
+    {9.960990332516871e-01f, -8.824237052036951e-02f},
+    {9.941745021174282e-01f, -1.077824630427593e-01f},
+    {9.918666977876260e-01f, -1.272810033739132e-01f},
+    {9.891765099647810e-01f, -1.467304744553617e-01f},
+    {9.861049757675088e-01f, -1.661233781457655e-01f},
+    {9.826532793307118e-01f, -1.854522381115909e-01f},
+    {9.788227513490724e-01f, -2.047096027093796e-01f},
+    {9.746148685640450e-01f, -2.238880478584984e-01f},
+    {9.700312531945440e-01f, -2.429801799032639e-01f},
+    {9.650736723115474e-01f, -2.619786384633375e-01f},
+    {9.597440371568574e-01f, -2.808760992712921e-01f},
+    {9.540444024062804e-01f, -2.996652769962566e-01f},
+    {9.479769653775104e-01f, -3.183389280525497e-01f},
+    {9.415440651830208e-01f, -3.368898533922201e-01f},
+    {9.347481818282924e-01f, -3.553109012804161e-01f},
+    {9.275919352557240e-01f, -3.735949700525164e-01f},
+    {9.200780843345949e-01f, -3.917350108519559e-01f},
+    {9.122095257974677e-01f, -4.097240303476953e-01f},
+    {9.039892931234433e-01f, -4.275550934302821e-01f},
+    {8.954205553686970e-01f, -4.452213258854682e-01f},
+    {8.865066159447464e-01f, -4.627159170443501e-01f},
+    {8.772509113449243e-01f, -4.800321224090111e-01f},
+    {8.676570098195440e-01f, -4.971632662526544e-01f},
+    {8.577286100002721e-01f, -5.141027441932217e-01f},
+    {8.474695394742344e-01f, -5.308440257395095e-01f},
+    {8.368837533084094e-01f, -5.473806568087964e-01f},
+    {8.259753325248732e-01f, -5.637062622150167e-01f},
+    {8.147484825274894e-01f, -5.798145481265136e-01f},
+    {8.032075314806449e-01f, -5.956993044924334e-01f},
+    {7.913569286406602e-01f, -6.113544074368165e-01f},
+    {7.792012426405167e-01f, -6.267738216194696e-01f},
+    {7.667451597285615e-01f, -6.419516025627030e-01f},
+    {7.539934819618694e-01f, -6.568818989430414e-01f},
+    {7.409511253549591e-01f, -6.715589548470183e-01f},
+    {7.276231179845748e-01f, -6.859771119901928e-01f},
+    {7.140145980512683e-01f, -7.001308118985236e-01f}
 };
 
 static const cos_msin_t cos_msin_80[80] =
 {
-    {9.999879521672569e-01, -4.908718807997990e-03},
-    {9.998915712471080e-01, -1.472568331145852e-02},
-    {9.996988186962042e-01, -2.454122852291229e-02},
-    {9.994097130924373e-01, -3.435440839968228e-02},
-    {9.990242823004072e-01, -4.416427712706736e-02},
-    {9.985425634687357e-01, -5.396988920950188e-02},
-    {9.979646030264866e-01, -6.377029956168449e-02},
-    {9.972904566786902e-01, -7.356456359966743e-02},
-    {9.965201894009746e-01, -8.335173733189745e-02},
-    {9.956538754333033e-01, -9.313087745019979e-02},
-    {9.946915982728195e-01, -1.029010414206961e-01},
-    {9.936334506657989e-01, -1.126612875746478e-01},
-    {9.924795345987100e-01, -1.224106751992162e-01},
-    {9.912299612883853e-01, -1.321482646281301e-01},
-    {9.898848511713010e-01, -1.418731173322532e-01},
-    {9.884443338919700e-01, -1.515842960100411e-01},
-    {9.869085482904458e-01, -1.612808646778805e-01},
-    {9.852776423889412e-01, -1.709618887603012e-01},
-    {9.835517733775615e-01, -1.806264351800528e-01},
-    {9.817311075991542e-01, -1.902735724480359e-01},
-    {9.798158205332763e-01, -1.999023707530817e-01},
-    {9.778060967792817e-01, -2.095119020515688e-01},
-    {9.757021300385286e-01, -2.191012401568698e-01},
-    {9.735041230957107e-01, -2.286694608286194e-01},
-    {9.712122877993118e-01, -2.382156418617946e-01},
-    {9.688268450411880e-01, -2.477388631755984e-01},
-    {9.663480247352773e-01, -2.572382069021397e-01},
-    {9.637760657954398e-01, -2.667127574748984e-01},
-    {9.611112161124317e-01, -2.761616017169707e-01},
-    {9.583537325300114e-01, -2.855838289290823e-01},
-    {9.555038808201862e-01, -2.949785309773635e-01},
-    {9.525619356575953e-01, -3.043448023808773e-01},
-    {9.495281805930367e-01, -3.136817403988915e-01},
-    {9.464029080261377e-01, -3.229884451178863e-01},
-    {9.431864191771733e-01, -3.322640195382908e-01},
-    {9.398790240580331e-01, -3.415075696609363e-01},
-    {9.364810414423427e-01, -3.507182045732232e-01},
-    {9.329927988347390e-01, -3.598950365349881e-01},
-    {9.294146324393044e-01, -3.690371810640665e-01},
-    {9.257468871271640e-01, -3.781437570215405e-01},
-    {9.219899164032445e-01, -3.872138866966656e-01},
-    {9.181440823722039e-01, -3.962466958914656e-01},
-    {9.142097557035307e-01, -4.052413140049899e-01},
-    {9.101873155958178e-01, -4.141968741172237e-01},
-    {9.060771497402148e-01, -4.231125130726441e-01},
-    {9.018796542830616e-01, -4.319873715634118e-01},
-    {8.975952337877069e-01, -4.408205942121939e-01},
-    {8.932243011955153e-01, -4.496113296546065e-01},
-    {8.887672777860675e-01, -4.583587306212713e-01},
-    {8.842245931365562e-01, -4.670619540194765e-01},
-    {8.795966850803829e-01, -4.757201610144369e-01},
-    {8.748839996649583e-01, -4.843325171101412e-01},
-    {8.700869911087115e-01, -4.928981922297840e-01},
-    {8.652061217573113e-01, -5.014163607957690e-01},
-    {8.602418620391045e-01, -5.098862018092806e-01},
-    {8.551946904197751e-01, -5.183068989294132e-01},
-    {8.500650933562288e-01, -5.266776405518521e-01},
-    {8.448535652497071e-01, -5.349976198870972e-01},
-    {8.395606083981356e-01, -5.432660350382236e-01},
-    {8.341867329477124e-01, -5.514820890781694e-01},
-    {8.287324568437381e-01, -5.596449901265460e-01},
-    {8.231983057806959e-01, -5.677539514259605e-01},
-    {8.175848131515837e-01, -5.758081914178453e-01},
-    {8.118925199965048e-01, -5.838069338177863e-01},
-    {8.061219749505210e-01, -5.917494076903429e-01},
-    {8.002737341907743e-01, -5.996348475233523e-01},
-    {7.943483613828813e-01, -6.074624933017110e-01},
-    {7.883464276266063e-01, -6.152315905806268e-01},
-    {7.822685114008164e-01, -6.229413905583340e-01},
-    {7.761151985077279e-01, -6.305911501482637e-01},
-    {7.698870820164444e-01, -6.381801320506653e-01},
-    {7.635847622057965e-01, -6.457076048236672e-01},
-    {7.572088465064846e-01, -6.531728429537768e-01},
-    {7.507599494425343e-01, -6.605751269258050e-01},
-    {7.442386925720670e-01, -6.679137432922161e-01},
-    {7.376457044273930e-01, -6.751879847418903e-01},
-    {7.309816204544317e-01, -6.823971501682968e-01},
-    {7.242470829514670e-01, -6.895405447370668e-01},
-    {7.174427410072399e-01, -6.966174799529642e-01},
-    {7.105692504383896e-01, -7.036272737262429e-01}
+    {9.999879521672569e-01f, -4.908718807997990e-03f},
+    {9.998915712471080e-01f, -1.472568331145852e-02f},
+    {9.996988186962042e-01f, -2.454122852291229e-02f},
+    {9.994097130924373e-01f, -3.435440839968228e-02f},
+    {9.990242823004072e-01f, -4.416427712706736e-02f},
+    {9.985425634687357e-01f, -5.396988920950188e-02f},
+    {9.979646030264866e-01f, -6.377029956168449e-02f},
+    {9.972904566786902e-01f, -7.356456359966743e-02f},
+    {9.965201894009746e-01f, -8.335173733189745e-02f},
+    {9.956538754333033e-01f, -9.313087745019979e-02f},
+    {9.946915982728195e-01f, -1.029010414206961e-01f},
+    {9.936334506657989e-01f, -1.126612875746478e-01f},
+    {9.924795345987100e-01f, -1.224106751992162e-01f},
+    {9.912299612883853e-01f, -1.321482646281301e-01f},
+    {9.898848511713010e-01f, -1.418731173322532e-01f},
+    {9.884443338919700e-01f, -1.515842960100411e-01f},
+    {9.869085482904458e-01f, -1.612808646778805e-01f},
+    {9.852776423889412e-01f, -1.709618887603012e-01f},
+    {9.835517733775615e-01f, -1.806264351800528e-01f},
+    {9.817311075991542e-01f, -1.902735724480359e-01f},
+    {9.798158205332763e-01f, -1.999023707530817e-01f},
+    {9.778060967792817e-01f, -2.095119020515688e-01f},
+    {9.757021300385286e-01f, -2.191012401568698e-01f},
+    {9.735041230957107e-01f, -2.286694608286194e-01f},
+    {9.712122877993118e-01f, -2.382156418617946e-01f},
+    {9.688268450411880e-01f, -2.477388631755984e-01f},
+    {9.663480247352773e-01f, -2.572382069021397e-01f},
+    {9.637760657954398e-01f, -2.667127574748984e-01f},
+    {9.611112161124317e-01f, -2.761616017169707e-01f},
+    {9.583537325300114e-01f, -2.855838289290823e-01f},
+    {9.555038808201862e-01f, -2.949785309773635e-01f},
+    {9.525619356575953e-01f, -3.043448023808773e-01f},
+    {9.495281805930367e-01f, -3.136817403988915e-01f},
+    {9.464029080261377e-01f, -3.229884451178863e-01f},
+    {9.431864191771733e-01f, -3.322640195382908e-01f},
+    {9.398790240580331e-01f, -3.415075696609363e-01f},
+    {9.364810414423427e-01f, -3.507182045732232e-01f},
+    {9.329927988347390e-01f, -3.598950365349881e-01f},
+    {9.294146324393044e-01f, -3.690371810640665e-01f},
+    {9.257468871271640e-01f, -3.781437570215405e-01f},
+    {9.219899164032445e-01f, -3.872138866966656e-01f},
+    {9.181440823722039e-01f, -3.962466958914656e-01f},
+    {9.142097557035307e-01f, -4.052413140049899e-01f},
+    {9.101873155958178e-01f, -4.141968741172237e-01f},
+    {9.060771497402148e-01f, -4.231125130726441e-01f},
+    {9.018796542830616e-01f, -4.319873715634118e-01f},
+    {8.975952337877069e-01f, -4.408205942121939e-01f},
+    {8.932243011955153e-01f, -4.496113296546065e-01f},
+    {8.887672777860675e-01f, -4.583587306212713e-01f},
+    {8.842245931365562e-01f, -4.670619540194765e-01f},
+    {8.795966850803829e-01f, -4.757201610144369e-01f},
+    {8.748839996649583e-01f, -4.843325171101412e-01f},
+    {8.700869911087115e-01f, -4.928981922297840e-01f},
+    {8.652061217573113e-01f, -5.014163607957690e-01f},
+    {8.602418620391045e-01f, -5.098862018092806e-01f},
+    {8.551946904197751e-01f, -5.183068989294132e-01f},
+    {8.500650933562288e-01f, -5.266776405518521e-01f},
+    {8.448535652497071e-01f, -5.349976198870972e-01f},
+    {8.395606083981356e-01f, -5.432660350382236e-01f},
+    {8.341867329477124e-01f, -5.514820890781694e-01f},
+    {8.287324568437381e-01f, -5.596449901265460e-01f},
+    {8.231983057806959e-01f, -5.677539514259605e-01f},
+    {8.175848131515837e-01f, -5.758081914178453e-01f},
+    {8.118925199965048e-01f, -5.838069338177863e-01f},
+    {8.061219749505210e-01f, -5.917494076903429e-01f},
+    {8.002737341907743e-01f, -5.996348475233523e-01f},
+    {7.943483613828813e-01f, -6.074624933017110e-01f},
+    {7.883464276266063e-01f, -6.152315905806268e-01f},
+    {7.822685114008164e-01f, -6.229413905583340e-01f},
+    {7.761151985077279e-01f, -6.305911501482637e-01f},
+    {7.698870820164444e-01f, -6.381801320506653e-01f},
+    {7.635847622057965e-01f, -6.457076048236672e-01f},
+    {7.572088465064846e-01f, -6.531728429537768e-01f},
+    {7.507599494425343e-01f, -6.605751269258050e-01f},
+    {7.442386925720670e-01f, -6.679137432922161e-01f},
+    {7.376457044273930e-01f, -6.751879847418903e-01f},
+    {7.309816204544317e-01f, -6.823971501682968e-01f},
+    {7.242470829514670e-01f, -6.895405447370668e-01f},
+    {7.174427410072399e-01f, -6.966174799529642e-01f},
+    {7.105692504383896e-01f, -7.036272737262429e-01f}
 };
 
 static const cos_msin_t cos_msin_160[160] =
 {
-    {9.999969880372782e-01, -2.454366796460292e-03},
-    {9.999728924443673e-01, -7.363041249779567e-03},
-    {9.999247018391445e-01, -1.227153828571993e-02},
-    {9.998524173827948e-01, -1.717973963077875e-02},
-    {9.997560408170603e-01, -2.208752701857829e-02},
-    {9.996355744641984e-01, -2.699478219271537e-02},
-    {9.994910212269259e-01, -3.190138690961086e-02},
-    {9.993223845883495e-01, -3.680722294135883e-02},
-    {9.991296686118811e-01, -4.171217207857533e-02},
-    {9.989128779411404e-01, -4.661611613324671e-02},
-    {9.986720177998429e-01, -5.151893694157748e-02},
-    {9.984070939916740e-01, -5.642051636683749e-02},
-    {9.981181129001492e-01, -6.132073630220858e-02},
-    {9.978050814884601e-01, -6.621947867363034e-02},
-    {9.974680072993071e-01, -7.111662544264533e-02},
-    {9.971068984547168e-01, -7.601205860924312e-02},
-    {9.967217636558474e-01, -8.090566021470375e-02},
-    {9.963126121827780e-01, -8.579731234443989e-02},
-    {9.958794538942858e-01, -9.068689713083816e-02},
-    {9.954222992276077e-01, -9.557429675609919e-02},
-    {9.949411591981900e-01, -1.004593934550765e-01},
-    {9.944360453994218e-01, -1.053420695181141e-01},
-    {9.939069700023561e-01, -1.102222072938831e-01},
-    {9.933539457554167e-01, -1.150996891922159e-01},
-    {9.927769859840909e-01, -1.199743976869403e-01},
-    {9.921761045906085e-01, -1.248462153187112e-01},
-    {9.915513160536062e-01, -1.297150246978405e-01},
-    {9.909026354277800e-01, -1.345807085071262e-01},
-    {9.902300783435211e-01, -1.394431495046788e-01},
-    {9.895336610065398e-01, -1.443022305267465e-01},
-    {9.888134001974757e-01, -1.491578344905386e-01},
-    {9.880693132714919e-01, -1.540098443970461e-01},
-    {9.873014181578584e-01, -1.588581433338614e-01},
-    {9.865097333595187e-01, -1.637026144779952e-01},
-    {9.856942779526452e-01, -1.685431410986913e-01},
-    {9.848550715861784e-01, -1.733796065602395e-01},
-    {9.839921344813541e-01, -1.782118943247859e-01},
-    {9.831054874312163e-01, -1.830398879551410e-01},
-    {9.821951518001156e-01, -1.878634711175852e-01},
-    {9.812611495231950e-01, -1.926825275846723e-01},
-    {9.803035031058607e-01, -1.974969412380297e-01},
-    {9.793222356232406e-01, -2.023065960711564e-01},
-    {9.783173707196277e-01, -2.071113761922186e-01},
-    {9.772889326079104e-01, -2.119111658268416e-01},
-    {9.762369460689896e-01, -2.167058493209000e-01},
-    {9.751614364511810e-01, -2.214953111433043e-01},
-    {9.740624296696047e-01, -2.262794358887845e-01},
-    {9.729399522055602e-01, -2.310581082806711e-01},
-    {9.717940311058891e-01, -2.358312131736727e-01},
-    {9.706246939823230e-01, -2.405986355566504e-01},
-    {9.694319690108180e-01, -2.453602605553894e-01},
-    {9.682158849308760e-01, -2.501159734353663e-01},
-    {9.669764710448521e-01, -2.548656596045146e-01},
-    {9.657137572172489e-01, -2.596092046159851e-01},
-    {9.644277738739964e-01, -2.643464941709040e-01},
-    {9.631185520017188e-01, -2.690774141211269e-01},
-    {9.617861231469886e-01, -2.738018504719892e-01},
-    {9.604305194155658e-01, -2.785196893850531e-01},
-    {9.590517734716243e-01, -2.832308171808502e-01},
-    {9.576499185369652e-01, -2.879351203416211e-01},
-    {9.562249883902162e-01, -2.926324855140505e-01},
-    {9.547770173660172e-01, -2.973227995119985e-01},
-    {9.533060403541939e-01, -3.020059493192281e-01},
-    {9.518120927989161e-01, -3.066818220921279e-01},
-    {9.502952106978444e-01, -3.113503051624320e-01},
-    {9.487554306012626e-01, -3.160112860399338e-01},
-    {9.471927896111967e-01, -3.206646524151973e-01},
-    {9.456073253805213e-01, -3.253102921622629e-01},
-    {9.439990761120522e-01, -3.299480933413494e-01},
-    {9.423680805576258e-01, -3.345779442015508e-01},
-    {9.407143780171653e-01, -3.391997331835298e-01},
-    {9.390380083377340e-01, -3.438133489222048e-01},
-    {9.373390119125750e-01, -3.484186802494346e-01},
-    {9.356174296801376e-01, -3.530156161966958e-01},
-    {9.338733031230915e-01, -3.576040459977578e-01},
-    {9.321066742673269e-01, -3.621838590913509e-01},
-    {9.303175856809415e-01, -3.667549451238308e-01},
-    {9.285060804732156e-01, -3.713171939518375e-01},
-    {9.266722022935726e-01, -3.758704956449495e-01},
-    {9.248159953305278e-01, -3.804147404883323e-01},
-    {9.229375043106232e-01, -3.849498189853822e-01},
-    {9.210367744973499e-01, -3.894756218603648e-01},
-    {9.191138516900578e-01, -3.939920400610481e-01},
-    {9.171687822228516e-01, -3.984989647613298e-01},
-    {9.152016129634744e-01, -4.029962873638600e-01},
-    {9.132123913121788e-01, -4.074838995026576e-01},
-    {9.112011652005843e-01, -4.119616930457218e-01},
-    {9.091679830905224e-01, -4.164295600976372e-01},
-    {9.071128939728691e-01, -4.208873930021739e-01},
-    {9.050359473663644e-01, -4.253350843448814e-01},
-    {9.029371933164189e-01, -4.297725269556770e-01},
-    {9.008166823939081e-01, -4.341996139114278e-01},
-    {8.986744656939538e-01, -4.386162385385277e-01},
-    {8.965105948346932e-01, -4.430222944154668e-01},
-    {8.943251219560346e-01, -4.474176753753967e-01},
-    {8.921180997184014e-01, -4.518022755086881e-01},
-    {8.898895813014630e-01, -4.561759891654830e-01},
-    {8.876396204028539e-01, -4.605387109582400e-01},
-    {8.853682712368793e-01, -4.648903357642744e-01},
-    {8.830755885332088e-01, -4.692307587282903e-01},
-    {8.807616275355579e-01, -4.735598752649081e-01},
-    {8.784264440003567e-01, -4.778775810611837e-01},
-    {8.760700941954066e-01, -4.821837720791227e-01},
-    {8.736926348985243e-01, -4.864783445581868e-01},
-    {8.712941233961736e-01, -4.907611950177941e-01},
-    {8.688746174820854e-01, -4.950322202598127e-01},
-    {8.664341754558650e-01, -4.992913173710469e-01},
-    {8.639728561215868e-01, -5.035383837257176e-01},
-    {8.614907187863783e-01, -5.077733169879345e-01},
-    {8.589878232589904e-01, -5.119960151141624e-01},
-    {8.564642298483565e-01, -5.162063763556797e-01},
-    {8.539199993621391e-01, -5.204042992610306e-01},
-    {8.513551931052652e-01, -5.245896826784689e-01},
-    {8.487698728784481e-01, -5.287624257583958e-01},
-    {8.461641009766995e-01, -5.329224279557898e-01},
-    {8.435379401878270e-01, -5.370695890326298e-01},
-    {8.408914537909229e-01, -5.412038090603096e-01},
-    {8.382247055548381e-01, -5.453249884220465e-01},
-    {8.355377597366458e-01, -5.494330278152808e-01},
-    {8.328306810800937e-01, -5.535278282540700e-01},
-    {8.301035348140438e-01, -5.576092910714722e-01},
-    {8.273563866508998e-01, -5.616773179219247e-01},
-    {8.245893027850253e-01, -5.657318107836131e-01},
-    {8.218023498911473e-01, -5.697726719608341e-01},
-    {8.189955951227504e-01, -5.737998040863485e-01},
-    {8.161691061104588e-01, -5.778131101237274e-01},
-    {8.133229509604062e-01, -5.818124933696910e-01},
-    {8.104571982525948e-01, -5.857978574564389e-01},
-    {8.075719170392435e-01, -5.897691063539708e-01},
-    {8.046671768431229e-01, -5.937261443724019e-01},
-    {8.017430476558816e-01, -5.976688761642677e-01},
-    {7.987995999363579e-01, -6.015972067268220e-01},
-    {7.958369046088836e-01, -6.055110414043255e-01},
-    {7.928550330615741e-01, -6.094102858903271e-01},
-    {7.898540571446090e-01, -6.132948462299359e-01},
-    {7.868340491684999e-01, -6.171646288220856e-01},
-    {7.837950819023488e-01, -6.210195404217892e-01},
-    {7.807372285720945e-01, -6.248594881423863e-01},
-    {7.776605628587479e-01, -6.286843794577813e-01},
-    {7.745651588966166e-01, -6.324941222046724e-01},
-    {7.714510912715192e-01, -6.362886245847729e-01},
-    {7.683184350189877e-01, -6.400677951670226e-01},
-    {7.651672656224590e-01, -6.438315428897914e-01},
-    {7.619976590114568e-01, -6.475797770630733e-01},
-    {7.588096915597616e-01, -6.513124073706714e-01},
-    {7.556034400835709e-01, -6.550293438723744e-01},
-    {7.523789818396478e-01, -6.587304970061237e-01},
-    {7.491363945234594e-01, -6.624157775901718e-01},
-    {7.458757562673048e-01, -6.660850968252301e-01},
-    {7.425971456384329e-01, -6.697383662966099e-01},
-    {7.393006416371488e-01, -6.733754979763520e-01},
-    {7.359863236949099e-01, -6.769964042253483e-01},
-    {7.326542716724128e-01, -6.806009977954530e-01},
-    {7.293045658576685e-01, -6.841891918315852e-01},
-    {7.259372869640676e-01, -6.877608998738217e-01},
-    {7.225525161284360e-01, -6.913160358594803e-01},
-    {7.191503349090794e-01, -6.948545141251936e-01},
-    {7.157308252838186e-01, -6.983762494089729e-01},
-    {7.122940696480137e-01, -7.018811568522627e-01},
-    {7.088401508125785e-01, -7.053691520019861e-01}
+    {9.999969880372782e-01f, -2.454366796460292e-03f},
+    {9.999728924443673e-01f, -7.363041249779567e-03f},
+    {9.999247018391445e-01f, -1.227153828571993e-02f},
+    {9.998524173827948e-01f, -1.717973963077875e-02f},
+    {9.997560408170603e-01f, -2.208752701857829e-02f},
+    {9.996355744641984e-01f, -2.699478219271537e-02f},
+    {9.994910212269259e-01f, -3.190138690961086e-02f},
+    {9.993223845883495e-01f, -3.680722294135883e-02f},
+    {9.991296686118811e-01f, -4.171217207857533e-02f},
+    {9.989128779411404e-01f, -4.661611613324671e-02f},
+    {9.986720177998429e-01f, -5.151893694157748e-02f},
+    {9.984070939916740e-01f, -5.642051636683749e-02f},
+    {9.981181129001492e-01f, -6.132073630220858e-02f},
+    {9.978050814884601e-01f, -6.621947867363034e-02f},
+    {9.974680072993071e-01f, -7.111662544264533e-02f},
+    {9.971068984547168e-01f, -7.601205860924312e-02f},
+    {9.967217636558474e-01f, -8.090566021470375e-02f},
+    {9.963126121827780e-01f, -8.579731234443989e-02f},
+    {9.958794538942858e-01f, -9.068689713083816e-02f},
+    {9.954222992276077e-01f, -9.557429675609919e-02f},
+    {9.949411591981900e-01f, -1.004593934550765e-01f},
+    {9.944360453994218e-01f, -1.053420695181141e-01f},
+    {9.939069700023561e-01f, -1.102222072938831e-01f},
+    {9.933539457554167e-01f, -1.150996891922159e-01f},
+    {9.927769859840909e-01f, -1.199743976869403e-01f},
+    {9.921761045906085e-01f, -1.248462153187112e-01f},
+    {9.915513160536062e-01f, -1.297150246978405e-01f},
+    {9.909026354277800e-01f, -1.345807085071262e-01f},
+    {9.902300783435211e-01f, -1.394431495046788e-01f},
+    {9.895336610065398e-01f, -1.443022305267465e-01f},
+    {9.888134001974757e-01f, -1.491578344905386e-01f},
+    {9.880693132714919e-01f, -1.540098443970461e-01f},
+    {9.873014181578584e-01f, -1.588581433338614e-01f},
+    {9.865097333595187e-01f, -1.637026144779952e-01f},
+    {9.856942779526452e-01f, -1.685431410986913e-01f},
+    {9.848550715861784e-01f, -1.733796065602395e-01f},
+    {9.839921344813541e-01f, -1.782118943247859e-01f},
+    {9.831054874312163e-01f, -1.830398879551410e-01f},
+    {9.821951518001156e-01f, -1.878634711175852e-01f},
+    {9.812611495231950e-01f, -1.926825275846723e-01f},
+    {9.803035031058607e-01f, -1.974969412380297e-01f},
+    {9.793222356232406e-01f, -2.023065960711564e-01f},
+    {9.783173707196277e-01f, -2.071113761922186e-01f},
+    {9.772889326079104e-01f, -2.119111658268416e-01f},
+    {9.762369460689896e-01f, -2.167058493209000e-01f},
+    {9.751614364511810e-01f, -2.214953111433043e-01f},
+    {9.740624296696047e-01f, -2.262794358887845e-01f},
+    {9.729399522055602e-01f, -2.310581082806711e-01f},
+    {9.717940311058891e-01f, -2.358312131736727e-01f},
+    {9.706246939823230e-01f, -2.405986355566504e-01f},
+    {9.694319690108180e-01f, -2.453602605553894e-01f},
+    {9.682158849308760e-01f, -2.501159734353663e-01f},
+    {9.669764710448521e-01f, -2.548656596045146e-01f},
+    {9.657137572172489e-01f, -2.596092046159851e-01f},
+    {9.644277738739964e-01f, -2.643464941709040e-01f},
+    {9.631185520017188e-01f, -2.690774141211269e-01f},
+    {9.617861231469886e-01f, -2.738018504719892e-01f},
+    {9.604305194155658e-01f, -2.785196893850531e-01f},
+    {9.590517734716243e-01f, -2.832308171808502e-01f},
+    {9.576499185369652e-01f, -2.879351203416211e-01f},
+    {9.562249883902162e-01f, -2.926324855140505e-01f},
+    {9.547770173660172e-01f, -2.973227995119985e-01f},
+    {9.533060403541939e-01f, -3.020059493192281e-01f},
+    {9.518120927989161e-01f, -3.066818220921279e-01f},
+    {9.502952106978444e-01f, -3.113503051624320e-01f},
+    {9.487554306012626e-01f, -3.160112860399338e-01f},
+    {9.471927896111967e-01f, -3.206646524151973e-01f},
+    {9.456073253805213e-01f, -3.253102921622629e-01f},
+    {9.439990761120522e-01f, -3.299480933413494e-01f},
+    {9.423680805576258e-01f, -3.345779442015508e-01f},
+    {9.407143780171653e-01f, -3.391997331835298e-01f},
+    {9.390380083377340e-01f, -3.438133489222048e-01f},
+    {9.373390119125750e-01f, -3.484186802494346e-01f},
+    {9.356174296801376e-01f, -3.530156161966958e-01f},
+    {9.338733031230915e-01f, -3.576040459977578e-01f},
+    {9.321066742673269e-01f, -3.621838590913509e-01f},
+    {9.303175856809415e-01f, -3.667549451238308e-01f},
+    {9.285060804732156e-01f, -3.713171939518375e-01f},
+    {9.266722022935726e-01f, -3.758704956449495e-01f},
+    {9.248159953305278e-01f, -3.804147404883323e-01f},
+    {9.229375043106232e-01f, -3.849498189853822e-01f},
+    {9.210367744973499e-01f, -3.894756218603648e-01f},
+    {9.191138516900578e-01f, -3.939920400610481e-01f},
+    {9.171687822228516e-01f, -3.984989647613298e-01f},
+    {9.152016129634744e-01f, -4.029962873638600e-01f},
+    {9.132123913121788e-01f, -4.074838995026576e-01f},
+    {9.112011652005843e-01f, -4.119616930457218e-01f},
+    {9.091679830905224e-01f, -4.164295600976372e-01f},
+    {9.071128939728691e-01f, -4.208873930021739e-01f},
+    {9.050359473663644e-01f, -4.253350843448814e-01f},
+    {9.029371933164189e-01f, -4.297725269556770e-01f},
+    {9.008166823939081e-01f, -4.341996139114278e-01f},
+    {8.986744656939538e-01f, -4.386162385385277e-01f},
+    {8.965105948346932e-01f, -4.430222944154668e-01f},
+    {8.943251219560346e-01f, -4.474176753753967e-01f},
+    {8.921180997184014e-01f, -4.518022755086881e-01f},
+    {8.898895813014630e-01f, -4.561759891654830e-01f},
+    {8.876396204028539e-01f, -4.605387109582400e-01f},
+    {8.853682712368793e-01f, -4.648903357642744e-01f},
+    {8.830755885332088e-01f, -4.692307587282903e-01f},
+    {8.807616275355579e-01f, -4.735598752649081e-01f},
+    {8.784264440003567e-01f, -4.778775810611837e-01f},
+    {8.760700941954066e-01f, -4.821837720791227e-01f},
+    {8.736926348985243e-01f, -4.864783445581868e-01f},
+    {8.712941233961736e-01f, -4.907611950177941e-01f},
+    {8.688746174820854e-01f, -4.950322202598127e-01f},
+    {8.664341754558650e-01f, -4.992913173710469e-01f},
+    {8.639728561215868e-01f, -5.035383837257176e-01f},
+    {8.614907187863783e-01f, -5.077733169879345e-01f},
+    {8.589878232589904e-01f, -5.119960151141624e-01f},
+    {8.564642298483565e-01f, -5.162063763556797e-01f},
+    {8.539199993621391e-01f, -5.204042992610306e-01f},
+    {8.513551931052652e-01f, -5.245896826784689e-01f},
+    {8.487698728784481e-01f, -5.287624257583958e-01f},
+    {8.461641009766995e-01f, -5.329224279557898e-01f},
+    {8.435379401878270e-01f, -5.370695890326298e-01f},
+    {8.408914537909229e-01f, -5.412038090603096e-01f},
+    {8.382247055548381e-01f, -5.453249884220465e-01f},
+    {8.355377597366458e-01f, -5.494330278152808e-01f},
+    {8.328306810800937e-01f, -5.535278282540700e-01f},
+    {8.301035348140438e-01f, -5.576092910714722e-01f},
+    {8.273563866508998e-01f, -5.616773179219247e-01f},
+    {8.245893027850253e-01f, -5.657318107836131e-01f},
+    {8.218023498911473e-01f, -5.697726719608341e-01f},
+    {8.189955951227504e-01f, -5.737998040863485e-01f},
+    {8.161691061104588e-01f, -5.778131101237274e-01f},
+    {8.133229509604062e-01f, -5.818124933696910e-01f},
+    {8.104571982525948e-01f, -5.857978574564389e-01f},
+    {8.075719170392435e-01f, -5.897691063539708e-01f},
+    {8.046671768431229e-01f, -5.937261443724019e-01f},
+    {8.017430476558816e-01f, -5.976688761642677e-01f},
+    {7.987995999363579e-01f, -6.015972067268220e-01f},
+    {7.958369046088836e-01f, -6.055110414043255e-01f},
+    {7.928550330615741e-01f, -6.094102858903271e-01f},
+    {7.898540571446090e-01f, -6.132948462299359e-01f},
+    {7.868340491684999e-01f, -6.171646288220856e-01f},
+    {7.837950819023488e-01f, -6.210195404217892e-01f},
+    {7.807372285720945e-01f, -6.248594881423863e-01f},
+    {7.776605628587479e-01f, -6.286843794577813e-01f},
+    {7.745651588966166e-01f, -6.324941222046724e-01f},
+    {7.714510912715192e-01f, -6.362886245847729e-01f},
+    {7.683184350189877e-01f, -6.400677951670226e-01f},
+    {7.651672656224590e-01f, -6.438315428897914e-01f},
+    {7.619976590114568e-01f, -6.475797770630733e-01f},
+    {7.588096915597616e-01f, -6.513124073706714e-01f},
+    {7.556034400835709e-01f, -6.550293438723744e-01f},
+    {7.523789818396478e-01f, -6.587304970061237e-01f},
+    {7.491363945234594e-01f, -6.624157775901718e-01f},
+    {7.458757562673048e-01f, -6.660850968252301e-01f},
+    {7.425971456384329e-01f, -6.697383662966099e-01f},
+    {7.393006416371488e-01f, -6.733754979763520e-01f},
+    {7.359863236949099e-01f, -6.769964042253483e-01f},
+    {7.326542716724128e-01f, -6.806009977954530e-01f},
+    {7.293045658576685e-01f, -6.841891918315852e-01f},
+    {7.259372869640676e-01f, -6.877608998738217e-01f},
+    {7.225525161284360e-01f, -6.913160358594803e-01f},
+    {7.191503349090794e-01f, -6.948545141251936e-01f},
+    {7.157308252838186e-01f, -6.983762494089729e-01f},
+    {7.122940696480137e-01f, -7.018811568522627e-01f},
+    {7.088401508125785e-01f, -7.053691520019861e-01f}
 };
 
 static const cos_msin_t cos_msin_320[320] =
 {
-    {9.999992470090361e-01, -1.227184322288852e-03},
-    {9.999932230881285e-01, -3.681545574399692e-03},
-    {9.999811752826011e-01, -6.135884649154475e-03},
-    {9.999631036650289e-01, -8.590186761797602e-03},
-    {9.999390083442741e-01, -1.104443712779613e-02},
-    {9.999088894654848e-01, -1.349862096292883e-02},
-    {9.998727472100952e-01, -1.595272348337527e-02},
-    {9.998305817958234e-01, -1.840672990580482e-02},
-    {9.997823934766707e-01, -2.086062544746576e-02},
-    {9.997281825429201e-01, -2.331439532627430e-02},
-    {9.996679493211340e-01, -2.576802476090363e-02},
-    {9.996016941741530e-01, -2.822149897087298e-02},
-    {9.995294175010931e-01, -3.067480317663663e-02},
-    {9.994511197373437e-01, -3.312792259967294e-02},
-    {9.993668013545645e-01, -3.558084246257342e-02},
-    {9.992764628606833e-01, -3.803354798913168e-02},
-    {9.991801047998923e-01, -4.048602440443251e-02},
-    {9.990777277526454e-01, -4.293825693494082e-02},
-    {9.989693323356542e-01, -4.539023080859068e-02},
-    {9.988549192018848e-01, -4.784193125487429e-02},
-    {9.987344890405533e-01, -5.029334350493095e-02},
-    {9.986080425771219e-01, -5.274445279163603e-02},
-    {9.984755805732948e-01, -5.519524434968993e-02},
-    {9.983371038270131e-01, -5.764570341570704e-02},
-    {9.981926131724506e-01, -6.009581522830464e-02},
-    {9.980421094800079e-01, -6.254556502819182e-02},
-    {9.978855936563085e-01, -6.499493805825848e-02},
-    {9.977230666441916e-01, -6.744391956366405e-02},
-    {9.975545294227081e-01, -6.989249479192657e-02},
-    {9.973799830071135e-01, -7.234064899301137e-02},
-    {9.971994284488623e-01, -7.478836741942015e-02},
-    {9.970128668356021e-01, -7.723563532627951e-02},
-    {9.968202992911657e-01, -7.968243797143013e-02},
-    {9.966217269755658e-01, -8.212876061551522e-02},
-    {9.964171510849874e-01, -8.457458852206962e-02},
-    {9.962065728517802e-01, -8.701990695760831e-02},
-    {9.959899935444517e-01, -8.946470119171543e-02},
-    {9.957674144676598e-01, -9.190895649713272e-02},
-    {9.955388369622040e-01, -9.435265814984850e-02},
-    {9.953042624050182e-01, -9.679579142918618e-02},
-    {9.950636922091622e-01, -9.923834161789306e-02},
-    {9.948171278238128e-01, -1.016802940022289e-01},
-    {9.945645707342554e-01, -1.041216338720546e-01},
-    {9.943060224618753e-01, -1.065623465209208e-01},
-    {9.940414845641478e-01, -1.090024172461564e-01},
-    {9.937709586346295e-01, -1.114418313489574e-01},
-    {9.934944463029486e-01, -1.138805741344751e-01},
-    {9.932119492347945e-01, -1.163186309119048e-01},
-    {9.929234691319088e-01, -1.187559869945741e-01},
-    {9.926290077320739e-01, -1.211926277000318e-01},
-    {9.923285668091033e-01, -1.236285383501360e-01},
-    {9.920221481728309e-01, -1.260637042711424e-01},
-    {9.917097536690995e-01, -1.284981107937932e-01},
-    {9.913913851797506e-01, -1.309317432534049e-01},
-    {9.910670446226119e-01, -1.333645869899571e-01},
-    {9.907367339514870e-01, -1.357966273481804e-01},
-    {9.904004551561425e-01, -1.382278496776452e-01},
-    {9.900582102622971e-01, -1.406582393328492e-01},
-    {9.897100013316084e-01, -1.430877816733065e-01},
-    {9.893558304616609e-01, -1.455164620636352e-01},
-    {9.889956997859536e-01, -1.479442658736455e-01},
-    {9.886296114738869e-01, -1.503711784784285e-01},
-    {9.882575677307495e-01, -1.527971852584434e-01},
-    {9.878795707977051e-01, -1.552222715996064e-01},
-    {9.874956229517791e-01, -1.576464228933781e-01},
-    {9.871057265058446e-01, -1.600696245368518e-01},
-    {9.867098838086088e-01, -1.624918619328416e-01},
-    {9.863080972445987e-01, -1.649131204899699e-01},
-    {9.859003692341464e-01, -1.673333856227558e-01},
-    {9.854867022333751e-01, -1.697526427517024e-01},
-    {9.850670987341841e-01, -1.721708773033852e-01},
-    {9.846415612642334e-01, -1.745880747105397e-01},
-    {9.842100923869290e-01, -1.770042204121487e-01},
-    {9.837726947014075e-01, -1.794192998535309e-01},
-    {9.833293708425197e-01, -1.818332984864276e-01},
-    {9.828801234808157e-01, -1.842462017690910e-01},
-    {9.824249553225278e-01, -1.866579951663718e-01},
-    {9.819638691095552e-01, -1.890686641498062e-01},
-    {9.814968676194470e-01, -1.914781941977041e-01},
-    {9.810239536653852e-01, -1.938865707952361e-01},
-    {9.805451300961683e-01, -1.962937794345212e-01},
-    {9.800603997961936e-01, -1.986998056147138e-01},
-    {9.795697656854405e-01, -2.011046348420919e-01},
-    {9.790732307194523e-01, -2.035082526301433e-01},
-    {9.785707978893183e-01, -2.059106444996538e-01},
-    {9.780624702216568e-01, -2.083117959787937e-01},
-    {9.775482507785956e-01, -2.107116926032057e-01},
-    {9.770281426577544e-01, -2.131103199160914e-01},
-    {9.765021489922255e-01, -2.155076634682986e-01},
-    {9.759702729505557e-01, -2.179037088184086e-01},
-    {9.754325177367266e-01, -2.202984415328229e-01},
-    {9.748888865901355e-01, -2.226918471858500e-01},
-    {9.743393827855759e-01, -2.250839113597928e-01},
-    {9.737840096332177e-01, -2.274746196450351e-01},
-    {9.732227704785874e-01, -2.298639576401283e-01},
-    {9.726556687025479e-01, -2.322519109518786e-01},
-    {9.720827077212779e-01, -2.346384651954331e-01},
-    {9.715038909862518e-01, -2.370236059943672e-01},
-    {9.709192219842182e-01, -2.394073189807704e-01},
-    {9.703287042371799e-01, -2.417895897953334e-01},
-    {9.697323413023714e-01, -2.441704040874346e-01},
-    {9.691301367722388e-01, -2.465497475152259e-01},
-    {9.685220942744174e-01, -2.489276057457201e-01},
-    {9.679082174717095e-01, -2.513039644548766e-01},
-    {9.672885100620635e-01, -2.536788093276874e-01},
-    {9.666629757785506e-01, -2.560521260582643e-01},
-    {9.660316183893426e-01, -2.584239003499241e-01},
-    {9.653944416976894e-01, -2.607941179152755e-01},
-    {9.647514495418958e-01, -2.631627644763044e-01},
-    {9.641026457952987e-01, -2.655298257644607e-01},
-    {9.634480343662435e-01, -2.678952875207434e-01},
-    {9.627876191980606e-01, -2.702591354957875e-01},
-    {9.621214042690416e-01, -2.726213554499490e-01},
-    {9.614493935924158e-01, -2.749819331533909e-01},
-    {9.607715912163253e-01, -2.773408543861692e-01},
-    {9.600880012238011e-01, -2.796981049383182e-01},
-    {9.593986277327383e-01, -2.820536706099365e-01},
-    {9.587034748958716e-01, -2.844075372112719e-01},
-    {9.580025469007496e-01, -2.867596905628075e-01},
-    {9.572958479697103e-01, -2.891101164953470e-01},
-    {9.565833823598556e-01, -2.914588008500998e-01},
-    {9.558651543630251e-01, -2.938057294787664e-01},
-    {9.551411683057708e-01, -2.961508882436238e-01},
-    {9.544114285493304e-01, -2.984942630176104e-01},
-    {9.536759394896021e-01, -3.008358396844112e-01},
-    {9.529347055571170e-01, -3.031756041385431e-01},
-    {9.521877312170133e-01, -3.055135422854393e-01},
-    {9.514350209690083e-01, -3.078496400415349e-01},
-    {9.506765793473728e-01, -3.101838833343510e-01},
-    {9.499124109209025e-01, -3.125162581025802e-01},
-    {9.491425202928909e-01, -3.148467502961706e-01},
-    {9.483669121011018e-01, -3.171753458764112e-01},
-    {9.475855910177411e-01, -3.195020308160157e-01},
-    {9.467985617494289e-01, -3.218267910992075e-01},
-    {9.460058290371707e-01, -3.241496127218040e-01},
-    {9.452073976563291e-01, -3.264704816913009e-01},
-    {9.444032724165956e-01, -3.287893840269567e-01},
-    {9.435934581619604e-01, -3.311063057598764e-01},
-    {9.427779597706842e-01, -3.334212329330963e-01},
-    {9.419567821552687e-01, -3.357341516016679e-01},
-    {9.411299302624264e-01, -3.380450478327413e-01},
-    {9.402974090730516e-01, -3.403539077056500e-01},
-    {9.394592236021899e-01, -3.426607173119944e-01},
-    {9.386153788990080e-01, -3.449654627557252e-01},
-    {9.377658800467635e-01, -3.472681301532278e-01},
-    {9.369107321627741e-01, -3.495687056334055e-01},
-    {9.360499403983871e-01, -3.518671753377630e-01},
-    {9.351835099389476e-01, -3.541635254204903e-01},
-    {9.343114460037683e-01, -3.564577420485457e-01},
-    {9.334337538460973e-01, -3.587498114017393e-01},
-    {9.325504387530866e-01, -3.610397196728160e-01},
-    {9.316615060457607e-01, -3.633274530675394e-01},
-    {9.307669610789837e-01, -3.656129978047739e-01},
-    {9.298668092414279e-01, -3.678963401165684e-01},
-    {9.289610559555410e-01, -3.701774662482391e-01},
-    {9.280497066775131e-01, -3.724563624584523e-01},
-    {9.271327668972442e-01, -3.747330150193071e-01},
-    {9.262102421383114e-01, -3.770074102164183e-01},
-    {9.252821379579349e-01, -3.792795343489985e-01},
-    {9.243484599469451e-01, -3.815493737299417e-01},
-    {9.234092137297489e-01, -3.838169146859046e-01},
-    {9.224644049642953e-01, -3.860821435573893e-01},
-    {9.215140393420420e-01, -3.883450466988262e-01},
-    {9.205581225879205e-01, -3.906056104786556e-01},
-    {9.195966604603021e-01, -3.928638212794095e-01},
-    {9.186296587509630e-01, -3.951196654977946e-01},
-    {9.176571232850496e-01, -3.973731295447735e-01},
-    {9.166790599210427e-01, -3.996241998456468e-01},
-    {9.156954745507232e-01, -4.018728628401348e-01},
-    {9.147063730991362e-01, -4.041191049824593e-01},
-    {9.137117615245548e-01, -4.063629127414251e-01},
-    {9.127116458184452e-01, -4.086042726005015e-01},
-    {9.117060320054299e-01, -4.108431710579039e-01},
-    {9.106949261432513e-01, -4.130795946266749e-01},
-    {9.096783343227359e-01, -4.153135298347656e-01},
-    {9.086562626677570e-01, -4.175449632251170e-01},
-    {9.076287173351980e-01, -4.197738813557405e-01},
-    {9.065957045149153e-01, -4.220002707997997e-01},
-    {9.055572304297014e-01, -4.242241181456904e-01},
-    {9.045133013352465e-01, -4.264454099971220e-01},
-    {9.034639235201017e-01, -4.286641329731982e-01},
-    {9.024091033056408e-01, -4.308802737084970e-01},
-    {9.013488470460220e-01, -4.330938188531520e-01},
-    {9.002831611281501e-01, -4.353047550729321e-01},
-    {8.992120519716374e-01, -4.375130690493225e-01},
-    {8.981355260287659e-01, -4.397187474796043e-01},
-    {8.970535897844474e-01, -4.419217770769352e-01},
-    {8.959662497561852e-01, -4.441221445704292e-01},
-    {8.948735124940346e-01, -4.463198367052365e-01},
-    {8.937753845805634e-01, -4.485148402426236e-01},
-    {8.926718726308122e-01, -4.507071419600526e-01},
-    {8.915629832922548e-01, -4.528967286512617e-01},
-    {8.904487232447579e-01, -4.550835871263438e-01},
-    {8.893290992005409e-01, -4.572677042118265e-01},
-    {8.882041179041357e-01, -4.594490667507513e-01},
-    {8.870737861323454e-01, -4.616276616027529e-01},
-    {8.859381106942048e-01, -4.638034756441384e-01},
-    {8.847970984309378e-01, -4.659764957679662e-01},
-    {8.836507562159172e-01, -4.681467088841250e-01},
-    {8.824990909546231e-01, -4.703141019194129e-01},
-    {8.813421095846011e-01, -4.724786618176158e-01},
-    {8.801798190754208e-01, -4.746403755395864e-01},
-    {8.790122264286335e-01, -4.767992300633221e-01},
-    {8.778393386777302e-01, -4.789552123840445e-01},
-    {8.766611628880995e-01, -4.811083095142767e-01},
-    {8.754777061569843e-01, -4.832585084839222e-01},
-    {8.742889756134398e-01, -4.854057963403425e-01},
-    {8.730949784182901e-01, -4.875501601484360e-01},
-    {8.718957217640854e-01, -4.896915869907146e-01},
-    {8.706912128750582e-01, -4.918300639673830e-01},
-    {8.694814590070804e-01, -4.939655781964152e-01},
-    {8.682664674476190e-01, -4.960981168136327e-01},
-    {8.670462455156926e-01, -4.982276669727819e-01},
-    {8.658208005618273e-01, -5.003542158456112e-01},
-    {8.645901399680118e-01, -5.024777506219491e-01},
-    {8.633542711476541e-01, -5.045982585097801e-01},
-    {8.621132015455357e-01, -5.067157267353229e-01},
-    {8.608669386377673e-01, -5.088301425431070e-01},
-    {8.596154899317437e-01, -5.109414931960489e-01},
-    {8.583588629660989e-01, -5.130497659755299e-01},
-    {8.570970653106597e-01, -5.151549481814718e-01},
-    {8.558301045664012e-01, -5.172570271324139e-01},
-    {8.545579883654005e-01, -5.193559901655896e-01},
-    {8.532807243707908e-01, -5.214518246370019e-01},
-    {8.519983202767152e-01, -5.235445179215000e-01},
-    {8.507107838082801e-01, -5.256340574128560e-01},
-    {8.494181227215095e-01, -5.277204305238395e-01},
-    {8.481203448032972e-01, -5.298036246862946e-01},
-    {8.468174578713608e-01, -5.318836273512150e-01},
-    {8.455094697741939e-01, -5.339604259888194e-01},
-    {8.441963883910193e-01, -5.360340080886280e-01},
-    {8.428782216317413e-01, -5.381043611595366e-01},
-    {8.415549774368984e-01, -5.401714727298929e-01},
-    {8.402266637776148e-01, -5.422353303475707e-01},
-    {8.388932886555529e-01, -5.442959215800456e-01},
-    {8.375548601028652e-01, -5.463532340144698e-01},
-    {8.362113861821453e-01, -5.484072552577465e-01},
-    {8.348628749863800e-01, -5.504579729366048e-01},
-    {8.335093346389004e-01, -5.525053746976744e-01},
-    {8.321507732933324e-01, -5.545494482075597e-01},
-    {8.307871991335484e-01, -5.565901811529141e-01},
-    {8.294186203736174e-01, -5.586275612405148e-01},
-    {8.280450452577558e-01, -5.606615761973360e-01},
-    {8.266664820602777e-01, -5.626922137706231e-01},
-    {8.252829390855451e-01, -5.647194617279668e-01},
-    {8.238944246679176e-01, -5.667433078573766e-01},
-    {8.225009471717026e-01, -5.687637399673542e-01},
-    {8.211025149911046e-01, -5.707807458869673e-01},
-    {8.196991365501750e-01, -5.727943134659226e-01},
-    {8.182908203027607e-01, -5.748044305746390e-01},
-    {8.168775747324537e-01, -5.768110851043212e-01},
-    {8.154594083525400e-01, -5.788142649670318e-01},
-    {8.140363297059484e-01, -5.808139580957645e-01},
-    {8.126083473651983e-01, -5.828101524445172e-01},
-    {8.111754699323488e-01, -5.848028359883638e-01},
-    {8.097377060389469e-01, -5.867919967235272e-01},
-    {8.082950643459751e-01, -5.887776226674516e-01},
-    {8.068475535437993e-01, -5.907597018588742e-01},
-    {8.053951823521167e-01, -5.927382223578977e-01},
-    {8.039379595199031e-01, -5.947131722460625e-01},
-    {8.024758938253601e-01, -5.966845396264172e-01},
-    {8.010089940758625e-01, -5.986523126235920e-01},
-    {7.995372691079050e-01, -6.006164793838690e-01},
-    {7.980607277870492e-01, -6.025770280752539e-01},
-    {7.965793790078698e-01, -6.045339468875478e-01},
-    {7.950932316939014e-01, -6.064872240324176e-01},
-    {7.936022947975847e-01, -6.084368477434675e-01},
-    {7.921065773002124e-01, -6.103828062763095e-01},
-    {7.906060882118751e-01, -6.123250879086344e-01},
-    {7.891008365714072e-01, -6.142636809402826e-01},
-    {7.875908314463325e-01, -6.161985736933142e-01},
-    {7.860760819328091e-01, -6.181297545120795e-01},
-    {7.845565971555752e-01, -6.200572117632891e-01},
-    {7.830323862678940e-01, -6.219809338360844e-01},
-    {7.815034584514979e-01, -6.239009091421072e-01},
-    {7.799698229165344e-01, -6.258171261155689e-01},
-    {7.784314889015095e-01, -6.277295732133219e-01},
-    {7.768884656732324e-01, -6.296382389149270e-01},
-    {7.753407625267603e-01, -6.315431117227246e-01},
-    {7.737883887853415e-01, -6.334441801619028e-01},
-    {7.722313538003597e-01, -6.353414327805670e-01},
-    {7.706696669512773e-01, -6.372348581498091e-01},
-    {7.691033376455797e-01, -6.391244448637757e-01},
-    {7.675323753187178e-01, -6.410101815397373e-01},
-    {7.659567894340514e-01, -6.428920568181569e-01},
-    {7.643765894827926e-01, -6.447700593627579e-01},
-    {7.627917849839481e-01, -6.466441778605931e-01},
-    {7.612023854842618e-01, -6.485144010221124e-01},
-    {7.596084005581580e-01, -6.503807175812309e-01},
-    {7.580098398076831e-01, -6.522431162953969e-01},
-    {7.564067128624476e-01, -6.541015859456593e-01},
-    {7.547990293795690e-01, -6.559561153367355e-01},
-    {7.531867990436125e-01, -6.578066932970786e-01},
-    {7.515700315665336e-01, -6.596533086789452e-01},
-    {7.499487366876190e-01, -6.614959503584616e-01},
-    {7.483229241734281e-01, -6.633346072356920e-01},
-    {7.466926038177344e-01, -6.651692682347043e-01},
-    {7.450577854414661e-01, -6.669999223036375e-01},
-    {7.434184788926470e-01, -6.688265584147679e-01},
-    {7.417746940463380e-01, -6.706491655645758e-01},
-    {7.401264408045760e-01, -6.724677327738116e-01},
-    {7.384737290963160e-01, -6.742822490875620e-01},
-    {7.368165688773699e-01, -6.760927035753159e-01},
-    {7.351549701303474e-01, -6.778990853310308e-01},
-    {7.334889428645953e-01, -6.797013834731973e-01},
-    {7.318184971161379e-01, -6.814995871449060e-01},
-    {7.301436429476156e-01, -6.832936855139119e-01},
-    {7.284643904482252e-01, -6.850836677727004e-01},
-    {7.267807497336585e-01, -6.868695231385515e-01},
-    {7.250927309460417e-01, -6.886512408536060e-01},
-    {7.234003442538740e-01, -6.904288101849290e-01},
-    {7.217035998519666e-01, -6.922022204245754e-01},
-    {7.200025079613817e-01, -6.939714608896540e-01},
-    {7.182970788293696e-01, -6.957365209223924e-01},
-    {7.165873227293083e-01, -6.974973898902004e-01},
-    {7.148732499606411e-01, -6.992540571857347e-01},
-    {7.131548708488146e-01, -7.010065122269625e-01},
-    {7.114321957452164e-01, -7.027547444572253e-01},
-    {7.097052350271130e-01, -7.044987433453024e-01},
-    {7.079739990975870e-01, -7.062384983854745e-01}
+    {9.999992470090361e-01f, -1.227184322288852e-03f},
+    {9.999932230881285e-01f, -3.681545574399692e-03f},
+    {9.999811752826011e-01f, -6.135884649154475e-03f},
+    {9.999631036650289e-01f, -8.590186761797602e-03f},
+    {9.999390083442741e-01f, -1.104443712779613e-02f},
+    {9.999088894654848e-01f, -1.349862096292883e-02f},
+    {9.998727472100952e-01f, -1.595272348337527e-02f},
+    {9.998305817958234e-01f, -1.840672990580482e-02f},
+    {9.997823934766707e-01f, -2.086062544746576e-02f},
+    {9.997281825429201e-01f, -2.331439532627430e-02f},
+    {9.996679493211340e-01f, -2.576802476090363e-02f},
+    {9.996016941741530e-01f, -2.822149897087298e-02f},
+    {9.995294175010931e-01f, -3.067480317663663e-02f},
+    {9.994511197373437e-01f, -3.312792259967294e-02f},
+    {9.993668013545645e-01f, -3.558084246257342e-02f},
+    {9.992764628606833e-01f, -3.803354798913168e-02f},
+    {9.991801047998923e-01f, -4.048602440443251e-02f},
+    {9.990777277526454e-01f, -4.293825693494082e-02f},
+    {9.989693323356542e-01f, -4.539023080859068e-02f},
+    {9.988549192018848e-01f, -4.784193125487429e-02f},
+    {9.987344890405533e-01f, -5.029334350493095e-02f},
+    {9.986080425771219e-01f, -5.274445279163603e-02f},
+    {9.984755805732948e-01f, -5.519524434968993e-02f},
+    {9.983371038270131e-01f, -5.764570341570704e-02f},
+    {9.981926131724506e-01f, -6.009581522830464e-02f},
+    {9.980421094800079e-01f, -6.254556502819182e-02f},
+    {9.978855936563085e-01f, -6.499493805825848e-02f},
+    {9.977230666441916e-01f, -6.744391956366405e-02f},
+    {9.975545294227081e-01f, -6.989249479192657e-02f},
+    {9.973799830071135e-01f, -7.234064899301137e-02f},
+    {9.971994284488623e-01f, -7.478836741942015e-02f},
+    {9.970128668356021e-01f, -7.723563532627951e-02f},
+    {9.968202992911657e-01f, -7.968243797143013e-02f},
+    {9.966217269755658e-01f, -8.212876061551522e-02f},
+    {9.964171510849874e-01f, -8.457458852206962e-02f},
+    {9.962065728517802e-01f, -8.701990695760831e-02f},
+    {9.959899935444517e-01f, -8.946470119171543e-02f},
+    {9.957674144676598e-01f, -9.190895649713272e-02f},
+    {9.955388369622040e-01f, -9.435265814984850e-02f},
+    {9.953042624050182e-01f, -9.679579142918618e-02f},
+    {9.950636922091622e-01f, -9.923834161789306e-02f},
+    {9.948171278238128e-01f, -1.016802940022289e-01f},
+    {9.945645707342554e-01f, -1.041216338720546e-01f},
+    {9.943060224618753e-01f, -1.065623465209208e-01f},
+    {9.940414845641478e-01f, -1.090024172461564e-01f},
+    {9.937709586346295e-01f, -1.114418313489574e-01f},
+    {9.934944463029486e-01f, -1.138805741344751e-01f},
+    {9.932119492347945e-01f, -1.163186309119048e-01f},
+    {9.929234691319088e-01f, -1.187559869945741e-01f},
+    {9.926290077320739e-01f, -1.211926277000318e-01f},
+    {9.923285668091033e-01f, -1.236285383501360e-01f},
+    {9.920221481728309e-01f, -1.260637042711424e-01f},
+    {9.917097536690995e-01f, -1.284981107937932e-01f},
+    {9.913913851797506e-01f, -1.309317432534049e-01f},
+    {9.910670446226119e-01f, -1.333645869899571e-01f},
+    {9.907367339514870e-01f, -1.357966273481804e-01f},
+    {9.904004551561425e-01f, -1.382278496776452e-01f},
+    {9.900582102622971e-01f, -1.406582393328492e-01f},
+    {9.897100013316084e-01f, -1.430877816733065e-01f},
+    {9.893558304616609e-01f, -1.455164620636352e-01f},
+    {9.889956997859536e-01f, -1.479442658736455e-01f},
+    {9.886296114738869e-01f, -1.503711784784285e-01f},
+    {9.882575677307495e-01f, -1.527971852584434e-01f},
+    {9.878795707977051e-01f, -1.552222715996064e-01f},
+    {9.874956229517791e-01f, -1.576464228933781e-01f},
+    {9.871057265058446e-01f, -1.600696245368518e-01f},
+    {9.867098838086088e-01f, -1.624918619328416e-01f},
+    {9.863080972445987e-01f, -1.649131204899699e-01f},
+    {9.859003692341464e-01f, -1.673333856227558e-01f},
+    {9.854867022333751e-01f, -1.697526427517024e-01f},
+    {9.850670987341841e-01f, -1.721708773033852e-01f},
+    {9.846415612642334e-01f, -1.745880747105397e-01f},
+    {9.842100923869290e-01f, -1.770042204121487e-01f},
+    {9.837726947014075e-01f, -1.794192998535309e-01f},
+    {9.833293708425197e-01f, -1.818332984864276e-01f},
+    {9.828801234808157e-01f, -1.842462017690910e-01f},
+    {9.824249553225278e-01f, -1.866579951663718e-01f},
+    {9.819638691095552e-01f, -1.890686641498062e-01f},
+    {9.814968676194470e-01f, -1.914781941977041e-01f},
+    {9.810239536653852e-01f, -1.938865707952361e-01f},
+    {9.805451300961683e-01f, -1.962937794345212e-01f},
+    {9.800603997961936e-01f, -1.986998056147138e-01f},
+    {9.795697656854405e-01f, -2.011046348420919e-01f},
+    {9.790732307194523e-01f, -2.035082526301433e-01f},
+    {9.785707978893183e-01f, -2.059106444996538e-01f},
+    {9.780624702216568e-01f, -2.083117959787937e-01f},
+    {9.775482507785956e-01f, -2.107116926032057e-01f},
+    {9.770281426577544e-01f, -2.131103199160914e-01f},
+    {9.765021489922255e-01f, -2.155076634682986e-01f},
+    {9.759702729505557e-01f, -2.179037088184086e-01f},
+    {9.754325177367266e-01f, -2.202984415328229e-01f},
+    {9.748888865901355e-01f, -2.226918471858500e-01f},
+    {9.743393827855759e-01f, -2.250839113597928e-01f},
+    {9.737840096332177e-01f, -2.274746196450351e-01f},
+    {9.732227704785874e-01f, -2.298639576401283e-01f},
+    {9.726556687025479e-01f, -2.322519109518786e-01f},
+    {9.720827077212779e-01f, -2.346384651954331e-01f},
+    {9.715038909862518e-01f, -2.370236059943672e-01f},
+    {9.709192219842182e-01f, -2.394073189807704e-01f},
+    {9.703287042371799e-01f, -2.417895897953334e-01f},
+    {9.697323413023714e-01f, -2.441704040874346e-01f},
+    {9.691301367722388e-01f, -2.465497475152259e-01f},
+    {9.685220942744174e-01f, -2.489276057457201e-01f},
+    {9.679082174717095e-01f, -2.513039644548766e-01f},
+    {9.672885100620635e-01f, -2.536788093276874e-01f},
+    {9.666629757785506e-01f, -2.560521260582643e-01f},
+    {9.660316183893426e-01f, -2.584239003499241e-01f},
+    {9.653944416976894e-01f, -2.607941179152755e-01f},
+    {9.647514495418958e-01f, -2.631627644763044e-01f},
+    {9.641026457952987e-01f, -2.655298257644607e-01f},
+    {9.634480343662435e-01f, -2.678952875207434e-01f},
+    {9.627876191980606e-01f, -2.702591354957875e-01f},
+    {9.621214042690416e-01f, -2.726213554499490e-01f},
+    {9.614493935924158e-01f, -2.749819331533909e-01f},
+    {9.607715912163253e-01f, -2.773408543861692e-01f},
+    {9.600880012238011e-01f, -2.796981049383182e-01f},
+    {9.593986277327383e-01f, -2.820536706099365e-01f},
+    {9.587034748958716e-01f, -2.844075372112719e-01f},
+    {9.580025469007496e-01f, -2.867596905628075e-01f},
+    {9.572958479697103e-01f, -2.891101164953470e-01f},
+    {9.565833823598556e-01f, -2.914588008500998e-01f},
+    {9.558651543630251e-01f, -2.938057294787664e-01f},
+    {9.551411683057708e-01f, -2.961508882436238e-01f},
+    {9.544114285493304e-01f, -2.984942630176104e-01f},
+    {9.536759394896021e-01f, -3.008358396844112e-01f},
+    {9.529347055571170e-01f, -3.031756041385431e-01f},
+    {9.521877312170133e-01f, -3.055135422854393e-01f},
+    {9.514350209690083e-01f, -3.078496400415349e-01f},
+    {9.506765793473728e-01f, -3.101838833343510e-01f},
+    {9.499124109209025e-01f, -3.125162581025802e-01f},
+    {9.491425202928909e-01f, -3.148467502961706e-01f},
+    {9.483669121011018e-01f, -3.171753458764112e-01f},
+    {9.475855910177411e-01f, -3.195020308160157e-01f},
+    {9.467985617494289e-01f, -3.218267910992075e-01f},
+    {9.460058290371707e-01f, -3.241496127218040e-01f},
+    {9.452073976563291e-01f, -3.264704816913009e-01f},
+    {9.444032724165956e-01f, -3.287893840269567e-01f},
+    {9.435934581619604e-01f, -3.311063057598764e-01f},
+    {9.427779597706842e-01f, -3.334212329330963e-01f},
+    {9.419567821552687e-01f, -3.357341516016679e-01f},
+    {9.411299302624264e-01f, -3.380450478327413e-01f},
+    {9.402974090730516e-01f, -3.403539077056500e-01f},
+    {9.394592236021899e-01f, -3.426607173119944e-01f},
+    {9.386153788990080e-01f, -3.449654627557252e-01f},
+    {9.377658800467635e-01f, -3.472681301532278e-01f},
+    {9.369107321627741e-01f, -3.495687056334055e-01f},
+    {9.360499403983871e-01f, -3.518671753377630e-01f},
+    {9.351835099389476e-01f, -3.541635254204903e-01f},
+    {9.343114460037683e-01f, -3.564577420485457e-01f},
+    {9.334337538460973e-01f, -3.587498114017393e-01f},
+    {9.325504387530866e-01f, -3.610397196728160e-01f},
+    {9.316615060457607e-01f, -3.633274530675394e-01f},
+    {9.307669610789837e-01f, -3.656129978047739e-01f},
+    {9.298668092414279e-01f, -3.678963401165684e-01f},
+    {9.289610559555410e-01f, -3.701774662482391e-01f},
+    {9.280497066775131e-01f, -3.724563624584523e-01f},
+    {9.271327668972442e-01f, -3.747330150193071e-01f},
+    {9.262102421383114e-01f, -3.770074102164183e-01f},
+    {9.252821379579349e-01f, -3.792795343489985e-01f},
+    {9.243484599469451e-01f, -3.815493737299417e-01f},
+    {9.234092137297489e-01f, -3.838169146859046e-01f},
+    {9.224644049642953e-01f, -3.860821435573893e-01f},
+    {9.215140393420420e-01f, -3.883450466988262e-01f},
+    {9.205581225879205e-01f, -3.906056104786556e-01f},
+    {9.195966604603021e-01f, -3.928638212794095e-01f},
+    {9.186296587509630e-01f, -3.951196654977946e-01f},
+    {9.176571232850496e-01f, -3.973731295447735e-01f},
+    {9.166790599210427e-01f, -3.996241998456468e-01f},
+    {9.156954745507232e-01f, -4.018728628401348e-01f},
+    {9.147063730991362e-01f, -4.041191049824593e-01f},
+    {9.137117615245548e-01f, -4.063629127414251e-01f},
+    {9.127116458184452e-01f, -4.086042726005015e-01f},
+    {9.117060320054299e-01f, -4.108431710579039e-01f},
+    {9.106949261432513e-01f, -4.130795946266749e-01f},
+    {9.096783343227359e-01f, -4.153135298347656e-01f},
+    {9.086562626677570e-01f, -4.175449632251170e-01f},
+    {9.076287173351980e-01f, -4.197738813557405e-01f},
+    {9.065957045149153e-01f, -4.220002707997997e-01f},
+    {9.055572304297014e-01f, -4.242241181456904e-01f},
+    {9.045133013352465e-01f, -4.264454099971220e-01f},
+    {9.034639235201017e-01f, -4.286641329731982e-01f},
+    {9.024091033056408e-01f, -4.308802737084970e-01f},
+    {9.013488470460220e-01f, -4.330938188531520e-01f},
+    {9.002831611281501e-01f, -4.353047550729321e-01f},
+    {8.992120519716374e-01f, -4.375130690493225e-01f},
+    {8.981355260287659e-01f, -4.397187474796043e-01f},
+    {8.970535897844474e-01f, -4.419217770769352e-01f},
+    {8.959662497561852e-01f, -4.441221445704292e-01f},
+    {8.948735124940346e-01f, -4.463198367052365e-01f},
+    {8.937753845805634e-01f, -4.485148402426236e-01f},
+    {8.926718726308122e-01f, -4.507071419600526e-01f},
+    {8.915629832922548e-01f, -4.528967286512617e-01f},
+    {8.904487232447579e-01f, -4.550835871263438e-01f},
+    {8.893290992005409e-01f, -4.572677042118265e-01f},
+    {8.882041179041357e-01f, -4.594490667507513e-01f},
+    {8.870737861323454e-01f, -4.616276616027529e-01f},
+    {8.859381106942048e-01f, -4.638034756441384e-01f},
+    {8.847970984309378e-01f, -4.659764957679662e-01f},
+    {8.836507562159172e-01f, -4.681467088841250e-01f},
+    {8.824990909546231e-01f, -4.703141019194129e-01f},
+    {8.813421095846011e-01f, -4.724786618176158e-01f},
+    {8.801798190754208e-01f, -4.746403755395864e-01f},
+    {8.790122264286335e-01f, -4.767992300633221e-01f},
+    {8.778393386777302e-01f, -4.789552123840445e-01f},
+    {8.766611628880995e-01f, -4.811083095142767e-01f},
+    {8.754777061569843e-01f, -4.832585084839222e-01f},
+    {8.742889756134398e-01f, -4.854057963403425e-01f},
+    {8.730949784182901e-01f, -4.875501601484360e-01f},
+    {8.718957217640854e-01f, -4.896915869907146e-01f},
+    {8.706912128750582e-01f, -4.918300639673830e-01f},
+    {8.694814590070804e-01f, -4.939655781964152e-01f},
+    {8.682664674476190e-01f, -4.960981168136327e-01f},
+    {8.670462455156926e-01f, -4.982276669727819e-01f},
+    {8.658208005618273e-01f, -5.003542158456112e-01f},
+    {8.645901399680118e-01f, -5.024777506219491e-01f},
+    {8.633542711476541e-01f, -5.045982585097801e-01f},
+    {8.621132015455357e-01f, -5.067157267353229e-01f},
+    {8.608669386377673e-01f, -5.088301425431070e-01f},
+    {8.596154899317437e-01f, -5.109414931960489e-01f},
+    {8.583588629660989e-01f, -5.130497659755299e-01f},
+    {8.570970653106597e-01f, -5.151549481814718e-01f},
+    {8.558301045664012e-01f, -5.172570271324139e-01f},
+    {8.545579883654005e-01f, -5.193559901655896e-01f},
+    {8.532807243707908e-01f, -5.214518246370019e-01f},
+    {8.519983202767152e-01f, -5.235445179215000e-01f},
+    {8.507107838082801e-01f, -5.256340574128560e-01f},
+    {8.494181227215095e-01f, -5.277204305238395e-01f},
+    {8.481203448032972e-01f, -5.298036246862946e-01f},
+    {8.468174578713608e-01f, -5.318836273512150e-01f},
+    {8.455094697741939e-01f, -5.339604259888194e-01f},
+    {8.441963883910193e-01f, -5.360340080886280e-01f},
+    {8.428782216317413e-01f, -5.381043611595366e-01f},
+    {8.415549774368984e-01f, -5.401714727298929e-01f},
+    {8.402266637776148e-01f, -5.422353303475707e-01f},
+    {8.388932886555529e-01f, -5.442959215800456e-01f},
+    {8.375548601028652e-01f, -5.463532340144698e-01f},
+    {8.362113861821453e-01f, -5.484072552577465e-01f},
+    {8.348628749863800e-01f, -5.504579729366048e-01f},
+    {8.335093346389004e-01f, -5.525053746976744e-01f},
+    {8.321507732933324e-01f, -5.545494482075597e-01f},
+    {8.307871991335484e-01f, -5.565901811529141e-01f},
+    {8.294186203736174e-01f, -5.586275612405148e-01f},
+    {8.280450452577558e-01f, -5.606615761973360e-01f},
+    {8.266664820602777e-01f, -5.626922137706231e-01f},
+    {8.252829390855451e-01f, -5.647194617279668e-01f},
+    {8.238944246679176e-01f, -5.667433078573766e-01f},
+    {8.225009471717026e-01f, -5.687637399673542e-01f},
+    {8.211025149911046e-01f, -5.707807458869673e-01f},
+    {8.196991365501750e-01f, -5.727943134659226e-01f},
+    {8.182908203027607e-01f, -5.748044305746390e-01f},
+    {8.168775747324537e-01f, -5.768110851043212e-01f},
+    {8.154594083525400e-01f, -5.788142649670318e-01f},
+    {8.140363297059484e-01f, -5.808139580957645e-01f},
+    {8.126083473651983e-01f, -5.828101524445172e-01f},
+    {8.111754699323488e-01f, -5.848028359883638e-01f},
+    {8.097377060389469e-01f, -5.867919967235272e-01f},
+    {8.082950643459751e-01f, -5.887776226674516e-01f},
+    {8.068475535437993e-01f, -5.907597018588742e-01f},
+    {8.053951823521167e-01f, -5.927382223578977e-01f},
+    {8.039379595199031e-01f, -5.947131722460625e-01f},
+    {8.024758938253601e-01f, -5.966845396264172e-01f},
+    {8.010089940758625e-01f, -5.986523126235920e-01f},
+    {7.995372691079050e-01f, -6.006164793838690e-01f},
+    {7.980607277870492e-01f, -6.025770280752539e-01f},
+    {7.965793790078698e-01f, -6.045339468875478e-01f},
+    {7.950932316939014e-01f, -6.064872240324176e-01f},
+    {7.936022947975847e-01f, -6.084368477434675e-01f},
+    {7.921065773002124e-01f, -6.103828062763095e-01f},
+    {7.906060882118751e-01f, -6.123250879086344e-01f},
+    {7.891008365714072e-01f, -6.142636809402826e-01f},
+    {7.875908314463325e-01f, -6.161985736933142e-01f},
+    {7.860760819328091e-01f, -6.181297545120795e-01f},
+    {7.845565971555752e-01f, -6.200572117632891e-01f},
+    {7.830323862678940e-01f, -6.219809338360844e-01f},
+    {7.815034584514979e-01f, -6.239009091421072e-01f},
+    {7.799698229165344e-01f, -6.258171261155689e-01f},
+    {7.784314889015095e-01f, -6.277295732133219e-01f},
+    {7.768884656732324e-01f, -6.296382389149270e-01f},
+    {7.753407625267603e-01f, -6.315431117227246e-01f},
+    {7.737883887853415e-01f, -6.334441801619028e-01f},
+    {7.722313538003597e-01f, -6.353414327805670e-01f},
+    {7.706696669512773e-01f, -6.372348581498091e-01f},
+    {7.691033376455797e-01f, -6.391244448637757e-01f},
+    {7.675323753187178e-01f, -6.410101815397373e-01f},
+    {7.659567894340514e-01f, -6.428920568181569e-01f},
+    {7.643765894827926e-01f, -6.447700593627579e-01f},
+    {7.627917849839481e-01f, -6.466441778605931e-01f},
+    {7.612023854842618e-01f, -6.485144010221124e-01f},
+    {7.596084005581580e-01f, -6.503807175812309e-01f},
+    {7.580098398076831e-01f, -6.522431162953969e-01f},
+    {7.564067128624476e-01f, -6.541015859456593e-01f},
+    {7.547990293795690e-01f, -6.559561153367355e-01f},
+    {7.531867990436125e-01f, -6.578066932970786e-01f},
+    {7.515700315665336e-01f, -6.596533086789452e-01f},
+    {7.499487366876190e-01f, -6.614959503584616e-01f},
+    {7.483229241734281e-01f, -6.633346072356920e-01f},
+    {7.466926038177344e-01f, -6.651692682347043e-01f},
+    {7.450577854414661e-01f, -6.669999223036375e-01f},
+    {7.434184788926470e-01f, -6.688265584147679e-01f},
+    {7.417746940463380e-01f, -6.706491655645758e-01f},
+    {7.401264408045760e-01f, -6.724677327738116e-01f},
+    {7.384737290963160e-01f, -6.742822490875620e-01f},
+    {7.368165688773699e-01f, -6.760927035753159e-01f},
+    {7.351549701303474e-01f, -6.778990853310308e-01f},
+    {7.334889428645953e-01f, -6.797013834731973e-01f},
+    {7.318184971161379e-01f, -6.814995871449060e-01f},
+    {7.301436429476156e-01f, -6.832936855139119e-01f},
+    {7.284643904482252e-01f, -6.850836677727004e-01f},
+    {7.267807497336585e-01f, -6.868695231385515e-01f},
+    {7.250927309460417e-01f, -6.886512408536060e-01f},
+    {7.234003442538740e-01f, -6.904288101849290e-01f},
+    {7.217035998519666e-01f, -6.922022204245754e-01f},
+    {7.200025079613817e-01f, -6.939714608896540e-01f},
+    {7.182970788293696e-01f, -6.957365209223924e-01f},
+    {7.165873227293083e-01f, -6.974973898902004e-01f},
+    {7.148732499606411e-01f, -6.992540571857347e-01f},
+    {7.131548708488146e-01f, -7.010065122269625e-01f},
+    {7.114321957452164e-01f, -7.027547444572253e-01f},
+    {7.097052350271130e-01f, -7.044987433453024e-01f},
+    {7.079739990975870e-01f, -7.062384983854745e-01f}
 };
 
 static const cos_msin_t cos_msin_640[640] =
 {
-    {9.999998117522413e-01, -6.135922766517967e-04},
-    {9.999983057705969e-01, -1.840775905896510e-03},
-    {9.999952938095762e-01, -3.067956762965976e-03},
-    {9.999907758737150e-01, -4.295132999748002e-03},
-    {9.999847519698173e-01, -5.522302768137352e-03},
-    {9.999772221069551e-01, -6.749464220038533e-03},
-    {9.999681862964679e-01, -7.976615507368575e-03},
-    {9.999576445519639e-01, -9.203754782059819e-03},
-    {9.999455968893185e-01, -1.043088019606269e-02},
-    {9.999320433266753e-01, -1.165798990134850e-02},
-    {9.999169838844458e-01, -1.288508204991220e-02},
-    {9.999004185853092e-01, -1.411215479377519e-02},
-    {9.998823474542126e-01, -1.533920628498810e-02},
-    {9.998627705183706e-01, -1.656623467563356e-02},
-    {9.998416878072659e-01, -1.779323811782898e-02},
-    {9.998190993526487e-01, -1.902021476372936e-02},
-    {9.997950051885367e-01, -2.024716276553004e-02},
-    {9.997694053512153e-01, -2.147408027546951e-02},
-    {9.997422998792375e-01, -2.270096544583216e-02},
-    {9.997136888134235e-01, -2.392781642895110e-02},
-    {9.996835721968610e-01, -2.515463137721094e-02},
-    {9.996519500749053e-01, -2.638140844305051e-02},
-    {9.996188224951786e-01, -2.760814577896574e-02},
-    {9.995841895075704e-01, -2.883484153751236e-02},
-    {9.995480511642375e-01, -3.006149387130874e-02},
-    {9.995104075196035e-01, -3.128810093303862e-02},
-    {9.994712586303591e-01, -3.251466087545394e-02},
-    {9.994306045554617e-01, -3.374117185137758e-02},
-    {9.993884453561358e-01, -3.496763201370620e-02},
-    {9.993447810958722e-01, -3.619403951541294e-02},
-    {9.992996118404286e-01, -3.742039250955028e-02},
-    {9.992529376578290e-01, -3.864668914925275e-02},
-    {9.992047586183639e-01, -3.987292758773981e-02},
-    {9.991550747945901e-01, -4.109910597831850e-02},
-    {9.991038862613305e-01, -4.232522247438635e-02},
-    {9.990511930956741e-01, -4.355127522943403e-02},
-    {9.989969953769761e-01, -4.477726239704831e-02},
-    {9.989412931868569e-01, -4.600318213091462e-02},
-    {9.988840866092031e-01, -4.722903258482004e-02},
-    {9.988253757301669e-01, -4.845481191265589e-02},
-    {9.987651606381658e-01, -4.968051826842070e-02},
-    {9.987034414238826e-01, -5.090614980622282e-02},
-    {9.986402181802653e-01, -5.213170468028332e-02},
-    {9.985754910025268e-01, -5.335718104493870e-02},
-    {9.985092599881454e-01, -5.458257705464371e-02},
-    {9.984415252368637e-01, -5.580789086397409e-02},
-    {9.983722868506889e-01, -5.703312062762941e-02},
-    {9.983015449338929e-01, -5.825826450043575e-02},
-    {9.982292995930115e-01, -5.948332063734863e-02},
-    {9.981555509368452e-01, -6.070828719345561e-02},
-    {9.980802990764579e-01, -6.193316232397920e-02},
-    {9.980035441251777e-01, -6.315794418427960e-02},
-    {9.979252861985960e-01, -6.438263092985747e-02},
-    {9.978455254145679e-01, -6.560722071635666e-02},
-    {9.977642618932119e-01, -6.683171169956714e-02},
-    {9.976814957569091e-01, -6.805610203542757e-02},
-    {9.975972271303040e-01, -6.928038988002828e-02},
-    {9.975114561403035e-01, -7.050457338961386e-02},
-    {9.974241829160772e-01, -7.172865072058610e-02},
-    {9.973354075890570e-01, -7.295262002950662e-02},
-    {9.972451302929369e-01, -7.417647947309980e-02},
-    {9.971533511636731e-01, -7.540022720825540e-02},
-    {9.970600703394830e-01, -7.662386139203149e-02},
-    {9.969652879608459e-01, -7.784738018165707e-02},
-    {9.968690041705026e-01, -7.907078173453497e-02},
-    {9.967712191134545e-01, -8.029406420824454e-02},
-    {9.966719329369642e-01, -8.151722576054453e-02},
-    {9.965711457905548e-01, -8.274026454937569e-02},
-    {9.964688578260101e-01, -8.396317873286374e-02},
-    {9.963650691973739e-01, -8.518596646932200e-02},
-    {9.962597800609497e-01, -8.640862591725426e-02},
-    {9.961529905753015e-01, -8.763115523535747e-02},
-    {9.960447009012520e-01, -8.885355258252460e-02},
-    {9.959349112018836e-01, -9.007581611784729e-02},
-    {9.958236216425376e-01, -9.129794400061877e-02},
-    {9.957108323908140e-01, -9.251993439033654e-02},
-    {9.955965436165716e-01, -9.374178544670515e-02},
-    {9.954807554919269e-01, -9.496349532963899e-02},
-    {9.953634681912550e-01, -9.618506219926506e-02},
-    {9.952446818911883e-01, -9.740648421592572e-02},
-    {9.951243967706169e-01, -9.862775954018151e-02},
-    {9.950026130106879e-01, -9.984888633281383e-02},
-    {9.948793307948056e-01, -1.010698627548278e-01},
-    {9.947545503086307e-01, -1.022906869674551e-01},
-    {9.946282717400804e-01, -1.035113571321563e-01},
-    {9.945004952793278e-01, -1.047318714106244e-01},
-    {9.943712211188022e-01, -1.059522279647869e-01},
-    {9.942404494531879e-01, -1.071724249568088e-01},
-    {9.941081804794248e-01, -1.083924605490956e-01},
-    {9.939744143967076e-01, -1.096123329042957e-01},
-    {9.938391514064855e-01, -1.108320401853034e-01},
-    {9.937023917124622e-01, -1.120515805552615e-01},
-    {9.935641355205953e-01, -1.132709521775643e-01},
-    {9.934243830390962e-01, -1.144901532158602e-01},
-    {9.932831344784294e-01, -1.157091818340545e-01},
-    {9.931403900513129e-01, -1.169280361963119e-01},
-    {9.929961499727171e-01, -1.181467144670601e-01},
-    {9.928504144598651e-01, -1.193652148109914e-01},
-    {9.927031837322318e-01, -1.205835353930663e-01},
-    {9.925544580115441e-01, -1.218016743785162e-01},
-    {9.924042375217801e-01, -1.230196299328457e-01},
-    {9.922525224891693e-01, -1.242374002218357e-01},
-    {9.920993131421918e-01, -1.254549834115462e-01},
-    {9.919446097115779e-01, -1.266723776683190e-01},
-    {9.917884124303086e-01, -1.278895811587802e-01},
-    {9.916307215336136e-01, -1.291065920498434e-01},
-    {9.914715372589731e-01, -1.303234085087122e-01},
-    {9.913108598461154e-01, -1.315400287028831e-01},
-    {9.911486895370180e-01, -1.327564508001479e-01},
-    {9.909850265759061e-01, -1.339726729685971e-01},
-    {9.908198712092535e-01, -1.351886933766218e-01},
-    {9.906532236857811e-01, -1.364045101929175e-01},
-    {9.904850842564571e-01, -1.376201215864860e-01},
-    {9.903154531744962e-01, -1.388355257266385e-01},
-    {9.901443306953601e-01, -1.400507207829983e-01},
-    {9.899717170767560e-01, -1.412657049255036e-01},
-    {9.897976125786367e-01, -1.424804763244102e-01},
-    {9.896220174632009e-01, -1.436950331502945e-01},
-    {9.894449319948911e-01, -1.449093735740556e-01},
-    {9.892663564403953e-01, -1.461234957669190e-01},
-    {9.890862910686448e-01, -1.473373979004386e-01},
-    {9.889047361508148e-01, -1.485510781464996e-01},
-    {9.887216919603238e-01, -1.497645346773215e-01},
-    {9.885371587728330e-01, -1.509777656654608e-01},
-    {9.883511368662461e-01, -1.521907692838135e-01},
-    {9.881636265207087e-01, -1.534035437056180e-01},
-    {9.879746280186079e-01, -1.546160871044581e-01},
-    {9.877841416445722e-01, -1.558283976542652e-01},
-    {9.875921676854704e-01, -1.570404735293217e-01},
-    {9.873987064304122e-01, -1.582523129042630e-01},
-    {9.872037581707463e-01, -1.594639139540810e-01},
-    {9.870073232000616e-01, -1.606752748541265e-01},
-    {9.868094018141855e-01, -1.618863937801118e-01},
-    {9.866099943111839e-01, -1.630972689081137e-01},
-    {9.864091009913611e-01, -1.643078984145762e-01},
-    {9.862067221572588e-01, -1.655182804763130e-01},
-    {9.860028581136556e-01, -1.667284132705107e-01},
-    {9.857975091675675e-01, -1.679382949747312e-01},
-    {9.855906756282459e-01, -1.691479237669144e-01},
-    {9.853823578071785e-01, -1.703572978253813e-01},
-    {9.851725560180883e-01, -1.715664153288364e-01},
-    {9.849612705769328e-01, -1.727752744563706e-01},
-    {9.847485018019042e-01, -1.739838733874638e-01},
-    {9.845342500134284e-01, -1.751922103019880e-01},
-    {9.843185155341647e-01, -1.764002833802096e-01},
-    {9.841012986890054e-01, -1.776080908027924e-01},
-    {9.838825998050751e-01, -1.788156307508001e-01},
-    {9.836624192117303e-01, -1.800229014056995e-01},
-    {9.834407572405590e-01, -1.812299009493628e-01},
-    {9.832176142253802e-01, -1.824366275640705e-01},
-    {9.829929905022433e-01, -1.836430794325141e-01},
-    {9.827668864094273e-01, -1.848492547377989e-01},
-    {9.825393022874412e-01, -1.860551516634466e-01},
-    {9.823102384790224e-01, -1.872607683933984e-01},
-    {9.820796953291370e-01, -1.884661031120172e-01},
-    {9.818476731849786e-01, -1.896711540040907e-01},
-    {9.816141723959685e-01, -1.908759192548340e-01},
-    {9.813791933137546e-01, -1.920803970498924e-01},
-    {9.811427362922112e-01, -1.932845855753442e-01},
-    {9.809048016874382e-01, -1.944884830177032e-01},
-    {9.806653898577611e-01, -1.956920875639216e-01},
-    {9.804245011637294e-01, -1.968953974013927e-01},
-    {9.801821359681174e-01, -1.980984107179536e-01},
-    {9.799382946359226e-01, -1.993011257018880e-01},
-    {9.796929775343657e-01, -2.005035405419289e-01},
-    {9.794461850328897e-01, -2.017056534272613e-01},
-    {9.791979175031598e-01, -2.029074625475249e-01},
-    {9.789481753190622e-01, -2.041089660928169e-01},
-    {9.786969588567044e-01, -2.053101622536946e-01},
-    {9.784442684944136e-01, -2.065110492211783e-01},
-    {9.781901046127370e-01, -2.077116251867540e-01},
-    {9.779344675944409e-01, -2.089118883423760e-01},
-    {9.776773578245099e-01, -2.101118368804696e-01},
-    {9.774187756901469e-01, -2.113114689939341e-01},
-    {9.771587215807717e-01, -2.125107828761450e-01},
-    {9.768971958880210e-01, -2.137097767209575e-01},
-    {9.766341990057480e-01, -2.149084487227085e-01},
-    {9.763697313300211e-01, -2.161067970762195e-01},
-    {9.761037932591240e-01, -2.173048199767996e-01},
-    {9.758363851935545e-01, -2.185025156202481e-01},
-    {9.755675075360243e-01, -2.196998822028567e-01},
-    {9.752971606914583e-01, -2.208969179214133e-01},
-    {9.750253450669941e-01, -2.220936209732035e-01},
-    {9.747520610719810e-01, -2.232899895560143e-01},
-    {9.744773091179798e-01, -2.244860218681361e-01},
-    {9.742010896187618e-01, -2.256817161083659e-01},
-    {9.739234029903089e-01, -2.268770704760098e-01},
-    {9.736442496508120e-01, -2.280720831708857e-01},
-    {9.733636300206708e-01, -2.292667523933261e-01},
-    {9.730815445224936e-01, -2.304610763441808e-01},
-    {9.727979935810960e-01, -2.316550532248194e-01},
-    {9.725129776235006e-01, -2.328486812371343e-01},
-    {9.722264970789363e-01, -2.340419585835434e-01},
-    {9.719385523788376e-01, -2.352348834669925e-01},
-    {9.716491439568440e-01, -2.364274540909583e-01},
-    {9.713582722487994e-01, -2.376196686594509e-01},
-    {9.710659376927513e-01, -2.388115253770169e-01},
-    {9.707721407289504e-01, -2.400030224487415e-01},
-    {9.704768817998493e-01, -2.411941580802516e-01},
-    {9.701801613501028e-01, -2.423849304777186e-01},
-    {9.698819798265667e-01, -2.435753378478606e-01},
-    {9.695823376782966e-01, -2.447653783979458e-01},
-    {9.692812353565485e-01, -2.459550503357946e-01},
-    {9.689786733147769e-01, -2.471443518697825e-01},
-    {9.686746520086348e-01, -2.483332812088429e-01},
-    {9.683691718959728e-01, -2.495218365624697e-01},
-    {9.680622334368384e-01, -2.507100161407201e-01},
-    {9.677538370934755e-01, -2.518978181542170e-01},
-    {9.674439833303232e-01, -2.530852408141520e-01},
-    {9.671326726140158e-01, -2.542722823322882e-01},
-    {9.668199054133816e-01, -2.554589409209625e-01},
-    {9.665056821994423e-01, -2.566452147930884e-01},
-    {9.661900034454125e-01, -2.578311021621590e-01},
-    {9.658728696266987e-01, -2.590166012422493e-01},
-    {9.655542812208985e-01, -2.602017102480191e-01},
-    {9.652342387078005e-01, -2.613864273947156e-01},
-    {9.649127425693828e-01, -2.625707508981763e-01},
-    {9.645897932898128e-01, -2.637546789748313e-01},
-    {9.642653913554462e-01, -2.649382098417065e-01},
-    {9.639395372548267e-01, -2.661213417164257e-01},
-    {9.636122314786845e-01, -2.673040728172135e-01},
-    {9.632834745199362e-01, -2.684864013628985e-01},
-    {9.629532668736839e-01, -2.696683255729151e-01},
-    {9.626216090372143e-01, -2.708498436673069e-01},
-    {9.622885015099981e-01, -2.720309538667289e-01},
-    {9.619539447936892e-01, -2.732116543924507e-01},
-    {9.616179393921240e-01, -2.743919434663584e-01},
-    {9.612804858113206e-01, -2.755718193109581e-01},
-    {9.609415845594780e-01, -2.767512801493782e-01},
-    {9.606012361469752e-01, -2.779303242053718e-01},
-    {9.602594410863711e-01, -2.791089497033199e-01},
-    {9.599161998924024e-01, -2.802871548682339e-01},
-    {9.595715130819845e-01, -2.814649379257579e-01},
-    {9.592253811742094e-01, -2.826422971021723e-01},
-    {9.588778046903456e-01, -2.838192306243950e-01},
-    {9.585287841538368e-01, -2.849957367199857e-01},
-    {9.581783200903017e-01, -2.861718136171474e-01},
-    {9.578264130275329e-01, -2.873474595447295e-01},
-    {9.574730634954960e-01, -2.885226727322305e-01},
-    {9.571182720263292e-01, -2.896974514098006e-01},
-    {9.567620391543418e-01, -2.908717938082443e-01},
-    {9.564043654160141e-01, -2.920456981590233e-01},
-    {9.560452513499964e-01, -2.932191626942586e-01},
-    {9.556846974971080e-01, -2.943921856467341e-01},
-    {9.553227044003364e-01, -2.955647652498983e-01},
-    {9.549592726048367e-01, -2.967368997378675e-01},
-    {9.545944026579306e-01, -2.979085873454284e-01},
-    {9.542280951091057e-01, -2.990798263080405e-01},
-    {9.538603505100144e-01, -3.002506148618392e-01},
-    {9.534911694144735e-01, -3.014209512436381e-01},
-    {9.531205523784633e-01, -3.025908336909318e-01},
-    {9.527484999601259e-01, -3.037602604418984e-01},
-    {9.523750127197659e-01, -3.049292297354024e-01},
-    {9.520000912198481e-01, -3.060977398109971e-01},
-    {9.516237360249976e-01, -3.072657889089275e-01},
-    {9.512459477019986e-01, -3.084333752701328e-01},
-    {9.508667268197933e-01, -3.096004971362489e-01},
-    {9.504860739494817e-01, -3.107671527496115e-01},
-    {9.501039896643201e-01, -3.119333403532583e-01},
-    {9.497204745397203e-01, -3.130990581909318e-01},
-    {9.493355291532494e-01, -3.142643045070820e-01},
-    {9.489491540846281e-01, -3.154290775468691e-01},
-    {9.485613499157303e-01, -3.165933755561658e-01},
-    {9.481721172305820e-01, -3.177571967815606e-01},
-    {9.477814566153607e-01, -3.189205394703594e-01},
-    {9.473893686583942e-01, -3.200834018705895e-01},
-    {9.469958539501598e-01, -3.212457822310009e-01},
-    {9.466009130832835e-01, -3.224076788010699e-01},
-    {9.462045466525394e-01, -3.235690898310011e-01},
-    {9.458067552548478e-01, -3.247300135717307e-01},
-    {9.454075394892756e-01, -3.258904482749284e-01},
-    {9.450068999570345e-01, -3.270503921930005e-01},
-    {9.446048372614803e-01, -3.282098435790925e-01},
-    {9.442013520081122e-01, -3.293688006870915e-01},
-    {9.437964448045717e-01, -3.305272617716291e-01},
-    {9.433901162606417e-01, -3.316852250880838e-01},
-    {9.429823669882458e-01, -3.328426888925837e-01},
-    {9.425731976014469e-01, -3.339996514420094e-01},
-    {9.421626087164466e-01, -3.351561109939961e-01},
-    {9.417506009515846e-01, -3.363120658069366e-01},
-    {9.413371749273369e-01, -3.374675141399838e-01},
-    {9.409223312663159e-01, -3.386224542530535e-01},
-    {9.405060705932683e-01, -3.397768844068269e-01},
-    {9.400883935350755e-01, -3.409308028627527e-01},
-    {9.396693007207513e-01, -3.420842078830508e-01},
-    {9.392487927814420e-01, -3.432370977307140e-01},
-    {9.388268703504251e-01, -3.443894706695110e-01},
-    {9.384035340631081e-01, -3.455413249639891e-01},
-    {9.379787845570278e-01, -3.466926588794764e-01},
-    {9.375526224718491e-01, -3.478434706820849e-01},
-    {9.371250484493645e-01, -3.489937586387129e-01},
-    {9.366960631334929e-01, -3.501435210170474e-01},
-    {9.362656671702783e-01, -3.512927560855671e-01},
-    {9.358338612078891e-01, -3.524414621135448e-01},
-    {9.354006458966176e-01, -3.535896373710499e-01},
-    {9.349660218888781e-01, -3.547372801289512e-01},
-    {9.345299898392064e-01, -3.558843886589194e-01},
-    {9.340925504042590e-01, -3.570309612334300e-01},
-    {9.336537042428116e-01, -3.581769961257653e-01},
-    {9.332134520157588e-01, -3.593224916100174e-01},
-    {9.327717943861125e-01, -3.604674459610909e-01},
-    {9.323287320190009e-01, -3.616118574547051e-01},
-    {9.318842655816681e-01, -3.627557243673972e-01},
-    {9.314383957434725e-01, -3.638990449765241e-01},
-    {9.309911231758859e-01, -3.650418175602657e-01},
-    {9.305424485524929e-01, -3.661840403976272e-01},
-    {9.300923725489892e-01, -3.673257117684415e-01},
-    {9.296408958431813e-01, -3.684668299533723e-01},
-    {9.291880191149847e-01, -3.696073932339162e-01},
-    {9.287337430464239e-01, -3.707473998924054e-01},
-    {9.282780683216301e-01, -3.718868482120106e-01},
-    {9.278209956268415e-01, -3.730257364767432e-01},
-    {9.273625256504011e-01, -3.741640629714579e-01},
-    {9.269026590827565e-01, -3.753018259818559e-01},
-    {9.264413966164585e-01, -3.764390237944864e-01},
-    {9.259787389461599e-01, -3.775756546967501e-01},
-    {9.255146867686148e-01, -3.787117169769015e-01},
-    {9.250492407826776e-01, -3.798472089240512e-01},
-    {9.245824016893013e-01, -3.809821288281689e-01},
-    {9.241141701915373e-01, -3.821164749800858e-01},
-    {9.236445469945337e-01, -3.832502456714969e-01},
-    {9.231735328055345e-01, -3.843834391949643e-01},
-    {9.227011283338786e-01, -3.855160538439188e-01},
-    {9.222273342909986e-01, -3.866480879126634e-01},
-    {9.217521513904198e-01, -3.877795396963752e-01},
-    {9.212755803477590e-01, -3.889104074911081e-01},
-    {9.207976218807237e-01, -3.900406895937958e-01},
-    {9.203182767091106e-01, -3.911703843022539e-01},
-    {9.198375455548048e-01, -3.922994899151824e-01},
-    {9.193554291417789e-01, -3.934280047321689e-01},
-    {9.188719281960914e-01, -3.945559270536903e-01},
-    {9.183870434458861e-01, -3.956832551811160e-01},
-    {9.179007756213905e-01, -3.968099874167103e-01},
-    {9.174131254549152e-01, -3.979361220636348e-01},
-    {9.169240936808526e-01, -3.990616574259509e-01},
-    {9.164336810356757e-01, -4.001865918086229e-01},
-    {9.159418882579371e-01, -4.013109235175197e-01},
-    {9.154487160882678e-01, -4.024346508594184e-01},
-    {9.149541652693762e-01, -4.035577721420057e-01},
-    {9.144582365460469e-01, -4.046802856738814e-01},
-    {9.139609306651395e-01, -4.058021897645602e-01},
-    {9.134622483755878e-01, -4.069234827244749e-01},
-    {9.129621904283982e-01, -4.080441628649787e-01},
-    {9.124607575766490e-01, -4.091642284983474e-01},
-    {9.119579505754890e-01, -4.102836779377824e-01},
-    {9.114537701821365e-01, -4.114025094974132e-01},
-    {9.109482171558779e-01, -4.125207214922996e-01},
-    {9.104412922580672e-01, -4.136383122384345e-01},
-    {9.099329962521239e-01, -4.147552800527466e-01},
-    {9.094233299035327e-01, -4.158716232531024e-01},
-    {9.089122939798419e-01, -4.169873401583093e-01},
-    {9.083998892506623e-01, -4.181024290881177e-01},
-    {9.078861164876663e-01, -4.192168883632239e-01},
-    {9.073709764645862e-01, -4.203307163052724e-01},
-    {9.068544699572136e-01, -4.214439112368585e-01},
-    {9.063365977433983e-01, -4.225564714815306e-01},
-    {9.058173606030460e-01, -4.236683953637931e-01},
-    {9.052967593181188e-01, -4.247796812091088e-01},
-    {9.047747946726327e-01, -4.258903273439013e-01},
-    {9.042514674526569e-01, -4.270003320955576e-01},
-    {9.037267784463131e-01, -4.281096937924305e-01},
-    {9.032007284437731e-01, -4.292184107638414e-01},
-    {9.026733182372588e-01, -4.303264813400826e-01},
-    {9.021445486210405e-01, -4.314339038524199e-01},
-    {9.016144203914357e-01, -4.325406766330948e-01},
-    {9.010829343468079e-01, -4.336467980153277e-01},
-    {9.005500912875654e-01, -4.347522663333197e-01},
-    {9.000158920161603e-01, -4.358570799222555e-01},
-    {8.994803373370870e-01, -4.369612371183058e-01},
-    {8.989434280568812e-01, -4.380647362586298e-01},
-    {8.984051649841186e-01, -4.391675756813778e-01},
-    {8.978655489294136e-01, -4.402697537256935e-01},
-    {8.973245807054183e-01, -4.413712687317167e-01},
-    {8.967822611268210e-01, -4.424721190405857e-01},
-    {8.962385910103452e-01, -4.435723029944398e-01},
-    {8.956935711747483e-01, -4.446718189364220e-01},
-    {8.951472024408204e-01, -4.457706652106809e-01},
-    {8.945994856313827e-01, -4.468688401623742e-01},
-    {8.940504215712870e-01, -4.479663421376699e-01},
-    {8.935000110874138e-01, -4.490631694837502e-01},
-    {8.929482550086714e-01, -4.501593205488127e-01},
-    {8.923951541659944e-01, -4.512547936820739e-01},
-    {8.918407093923427e-01, -4.523495872337709e-01},
-    {8.912849215227001e-01, -4.534436995551644e-01},
-    {8.907277913940732e-01, -4.545371289985410e-01},
-    {8.901693198454897e-01, -4.556298739172159e-01},
-    {8.896095077179980e-01, -4.567219326655349e-01},
-    {8.890483558546646e-01, -4.578133035988772e-01},
-    {8.884858651005743e-01, -4.589039850736579e-01},
-    {8.879220363028281e-01, -4.599939754473306e-01},
-    {8.873568703105417e-01, -4.610832730783892e-01},
-    {8.867903679748451e-01, -4.621718763263714e-01},
-    {8.862225301488806e-01, -4.632597835518601e-01},
-    {8.856533576878016e-01, -4.643469931164871e-01},
-    {8.850828514487716e-01, -4.654335033829341e-01},
-    {8.845110122909626e-01, -4.665193127149364e-01},
-    {8.839378410755541e-01, -4.676044194772847e-01},
-    {8.833633386657316e-01, -4.686888220358279e-01},
-    {8.827875059266853e-01, -4.697725187574754e-01},
-    {8.822103437256089e-01, -4.708555080101994e-01},
-    {8.816318529316984e-01, -4.719377881630376e-01},
-    {8.810520344161502e-01, -4.730193575860958e-01},
-    {8.804708890521608e-01, -4.741002146505500e-01},
-    {8.798884177149244e-01, -4.751803577286489e-01},
-    {8.793046212816323e-01, -4.762597851937166e-01},
-    {8.787195006314716e-01, -4.773384954201548e-01},
-    {8.781330566456232e-01, -4.784164867834454e-01},
-    {8.775452902072614e-01, -4.794937576601530e-01},
-    {8.769562022015515e-01, -4.805703064279270e-01},
-    {8.763657935156495e-01, -4.816461314655044e-01},
-    {8.757740650387004e-01, -4.827212311527123e-01},
-    {8.751810176618363e-01, -4.837956038704698e-01},
-    {8.745866522781761e-01, -4.848692480007911e-01},
-    {8.739909697828232e-01, -4.859421619267875e-01},
-    {8.733939710728648e-01, -4.870143440326701e-01},
-    {8.727956570473698e-01, -4.880857927037520e-01},
-    {8.721960286073888e-01, -4.891565063264507e-01},
-    {8.715950866559510e-01, -4.902264832882912e-01},
-    {8.709928320980644e-01, -4.912957219779071e-01},
-    {8.703892658407133e-01, -4.923642207850446e-01},
-    {8.697843887928577e-01, -4.934319781005636e-01},
-    {8.691782018654314e-01, -4.944989923164409e-01},
-    {8.685707059713409e-01, -4.955652618257725e-01},
-    {8.679619020254642e-01, -4.966307850227757e-01},
-    {8.673517909446490e-01, -4.976955603027919e-01},
-    {8.667403736477115e-01, -4.987595860622885e-01},
-    {8.661276510554351e-01, -4.998228606988624e-01},
-    {8.655136240905691e-01, -5.008853826112407e-01},
-    {8.648982936778269e-01, -5.019471501992850e-01},
-    {8.642816607438848e-01, -5.030081618639924e-01},
-    {8.636637262173812e-01, -5.040684160074983e-01},
-    {8.630444910289141e-01, -5.051279110330795e-01},
-    {8.624239561110406e-01, -5.061866453451552e-01},
-    {8.618021223982749e-01, -5.072446173492910e-01},
-    {8.611789908270876e-01, -5.083018254522002e-01},
-    {8.605545623359034e-01, -5.093582680617462e-01},
-    {8.599288378651004e-01, -5.104139435869457e-01},
-    {8.593018183570085e-01, -5.114688504379703e-01},
-    {8.586735047559073e-01, -5.125229870261497e-01},
-    {8.580438980080262e-01, -5.135763517639729e-01},
-    {8.574129990615412e-01, -5.146289430650919e-01},
-    {8.567808088665750e-01, -5.156807593443229e-01},
-    {8.561473283751945e-01, -5.167317990176499e-01},
-    {8.555125585414098e-01, -5.177820605022260e-01},
-    {8.548765003211730e-01, -5.188315422163763e-01},
-    {8.542391546723761e-01, -5.198802425796005e-01},
-    {8.536005225548502e-01, -5.209281600125748e-01},
-    {8.529606049303636e-01, -5.219752929371544e-01},
-    {8.523194027626210e-01, -5.230216397763758e-01},
-    {8.516769170172609e-01, -5.240671989544601e-01},
-    {8.510331486618554e-01, -5.251119688968137e-01},
-    {8.503880986659081e-01, -5.261559480300321e-01},
-    {8.497417680008525e-01, -5.271991347819013e-01},
-    {8.490941576400509e-01, -5.282415275814013e-01},
-    {8.484452685587929e-01, -5.292831248587072e-01},
-    {8.477951017342936e-01, -5.303239250451923e-01},
-    {8.471436581456926e-01, -5.313639265734305e-01},
-    {8.464909387740521e-01, -5.324031278771979e-01},
-    {8.458369446023557e-01, -5.334415273914767e-01},
-    {8.451816766155068e-01, -5.344791235524554e-01},
-    {8.445251358003272e-01, -5.355159147975332e-01},
-    {8.438673231455553e-01, -5.365518995653215e-01},
-    {8.432082396418454e-01, -5.375870762956454e-01},
-    {8.425478862817651e-01, -5.386214434295480e-01},
-    {8.418862640597948e-01, -5.396549994092906e-01},
-    {8.412233739723254e-01, -5.406877426783570e-01},
-    {8.405592170176576e-01, -5.417196716814542e-01},
-    {8.398937941959995e-01, -5.427507848645159e-01},
-    {8.392271065094661e-01, -5.437810806747042e-01},
-    {8.385591549620770e-01, -5.448105575604123e-01},
-    {8.378899405597550e-01, -5.458392139712668e-01},
-    {8.372194643103249e-01, -5.468670483581293e-01},
-    {8.365477272235120e-01, -5.478940591731002e-01},
-    {8.358747303109401e-01, -5.489202448695194e-01},
-    {8.352004745861303e-01, -5.499456039019702e-01},
-    {8.345249610644997e-01, -5.509701347262801e-01},
-    {8.338481907633595e-01, -5.519938357995242e-01},
-    {8.331701647019132e-01, -5.530167055800275e-01},
-    {8.324908839012561e-01, -5.540387425273663e-01},
-    {8.318103493843727e-01, -5.550599451023716e-01},
-    {8.311285621761358e-01, -5.560803117671306e-01},
-    {8.304455233033046e-01, -5.570998409849897e-01},
-    {8.297612337945230e-01, -5.581185312205561e-01},
-    {8.290756946803191e-01, -5.591363809397010e-01},
-    {8.283889069931020e-01, -5.601533886095610e-01},
-    {8.277008717671618e-01, -5.611695526985409e-01},
-    {8.270115900386670e-01, -5.621848716763159e-01},
-    {8.263210628456635e-01, -5.631993440138341e-01},
-    {8.256292912280727e-01, -5.642129681833185e-01},
-    {8.249362762276903e-01, -5.652257426582692e-01},
-    {8.242420188881840e-01, -5.662376659134664e-01},
-    {8.235465202550933e-01, -5.672487364249718e-01},
-    {8.228497813758264e-01, -5.682589526701315e-01},
-    {8.221518032996592e-01, -5.692683131275782e-01},
-    {8.214525870777344e-01, -5.702768162772331e-01},
-    {8.207521337630588e-01, -5.712844606003090e-01},
-    {8.200504444105025e-01, -5.722912445793115e-01},
-    {8.193475200767969e-01, -5.732971666980422e-01},
-    {8.186433618205335e-01, -5.743022254416005e-01},
-    {8.179379707021619e-01, -5.753064192963863e-01},
-    {8.172313477839882e-01, -5.763097467501014e-01},
-    {8.165234941301740e-01, -5.773122062917532e-01},
-    {8.158144108067338e-01, -5.783137964116556e-01},
-    {8.151040988815345e-01, -5.793145156014319e-01},
-    {8.143925594242929e-01, -5.803143623540171e-01},
-    {8.136797935065747e-01, -5.813133351636602e-01},
-    {8.129658022017924e-01, -5.823114325259262e-01},
-    {8.122505865852039e-01, -5.833086529376983e-01},
-    {8.115341477339112e-01, -5.843049948971807e-01},
-    {8.108164867268581e-01, -5.853004569039005e-01},
-    {8.100976046448293e-01, -5.862950374587097e-01},
-    {8.093775025704479e-01, -5.872887350637883e-01},
-    {8.086561815881750e-01, -5.882815482226452e-01},
-    {8.079336427843067e-01, -5.892734754401222e-01},
-    {8.072098872469734e-01, -5.902645152223945e-01},
-    {8.064849160661379e-01, -5.912546660769743e-01},
-    {8.057587303335938e-01, -5.922439265127122e-01},
-    {8.050313311429637e-01, -5.932322950397998e-01},
-    {8.043027195896973e-01, -5.942197701697721e-01},
-    {8.035728967710708e-01, -5.952063504155093e-01},
-    {8.028418637861839e-01, -5.961920342912395e-01},
-    {8.021096217359593e-01, -5.971768203125404e-01},
-    {8.013761717231402e-01, -5.981607069963423e-01},
-    {8.006415148522891e-01, -5.991436928609294e-01},
-    {7.999056522297859e-01, -6.001257764259429e-01},
-    {7.991685849638264e-01, -6.011069562123827e-01},
-    {7.984303141644207e-01, -6.020872307426096e-01},
-    {7.976908409433912e-01, -6.030665985403482e-01},
-    {7.969501664143711e-01, -6.040450581306880e-01},
-    {7.962082916928030e-01, -6.050226080400867e-01},
-    {7.954652178959369e-01, -6.059992467963715e-01},
-    {7.947209461428283e-01, -6.069749729287426e-01},
-    {7.939754775543372e-01, -6.079497849677736e-01},
-    {7.932288132531257e-01, -6.089236814454155e-01},
-    {7.924809543636567e-01, -6.098966608949977e-01},
-    {7.917319020121923e-01, -6.108687218512306e-01},
-    {7.909816573267918e-01, -6.118398628502083e-01},
-    {7.902302214373100e-01, -6.128100824294097e-01},
-    {7.894775954753960e-01, -6.137793791277018e-01},
-    {7.887237805744907e-01, -6.147477514853411e-01},
-    {7.879687778698258e-01, -6.157151980439765e-01},
-    {7.872125884984216e-01, -6.166817173466510e-01},
-    {7.864552135990858e-01, -6.176473079378039e-01},
-    {7.856966543124112e-01, -6.186119683632733e-01},
-    {7.849369117807745e-01, -6.195756971702979e-01},
-    {7.841759871483340e-01, -6.205384929075197e-01},
-    {7.834138815610288e-01, -6.215003541249855e-01},
-    {7.826505961665757e-01, -6.224612793741500e-01},
-    {7.818861321144691e-01, -6.234212672078768e-01},
-    {7.811204905559779e-01, -6.243803161804418e-01},
-    {7.803536726441443e-01, -6.253384248475345e-01},
-    {7.795856795337824e-01, -6.262955917662607e-01},
-    {7.788165123814760e-01, -6.272518154951441e-01},
-    {7.780461723455767e-01, -6.282070945941292e-01},
-    {7.772746605862029e-01, -6.291614276245828e-01},
-    {7.765019782652373e-01, -6.301148131492967e-01},
-    {7.757281265463254e-01, -6.310672497324895e-01},
-    {7.749531065948739e-01, -6.320187359398091e-01},
-    {7.741769195780490e-01, -6.329692703383341e-01},
-    {7.733995666647743e-01, -6.339188514965771e-01},
-    {7.726210490257291e-01, -6.348674779844861e-01},
-    {7.718413678333470e-01, -6.358151483734467e-01},
-    {7.710605242618138e-01, -6.367618612362842e-01},
-    {7.702785194870657e-01, -6.377076151472665e-01},
-    {7.694953546867879e-01, -6.386524086821050e-01},
-    {7.687110310404124e-01, -6.395962404179578e-01},
-    {7.679255497291163e-01, -6.405391089334316e-01},
-    {7.671389119358204e-01, -6.414810128085832e-01},
-    {7.663511188451869e-01, -6.424219506249224e-01},
-    {7.655621716436182e-01, -6.433619209654138e-01},
-    {7.647720715192542e-01, -6.443009224144792e-01},
-    {7.639808196619715e-01, -6.452389535579994e-01},
-    {7.631884172633813e-01, -6.461760129833163e-01},
-    {7.623948655168271e-01, -6.471120992792355e-01},
-    {7.616001656173835e-01, -6.480472110360278e-01},
-    {7.608043187618542e-01, -6.489813468454321e-01},
-    {7.600073261487703e-01, -6.499145053006563e-01},
-    {7.592091889783881e-01, -6.508466849963809e-01},
-    {7.584099084526877e-01, -6.517778845287601e-01},
-    {7.576094857753715e-01, -6.527081024954242e-01},
-    {7.568079221518612e-01, -6.536373374954818e-01},
-    {7.560052187892974e-01, -6.545655881295217e-01},
-    {7.552013768965365e-01, -6.554928529996153e-01},
-    {7.543963976841503e-01, -6.564191307093185e-01},
-    {7.535902823644226e-01, -6.573444198636738e-01},
-    {7.527830321513488e-01, -6.582687190692122e-01},
-    {7.519746482606328e-01, -6.591920269339562e-01},
-    {7.511651319096865e-01, -6.601143420674205e-01},
-    {7.503544843176265e-01, -6.610356630806152e-01},
-    {7.495427067052737e-01, -6.619559885860479e-01},
-    {7.487298002951505e-01, -6.628753171977246e-01},
-    {7.479157663114792e-01, -6.637936475311532e-01},
-    {7.471006059801801e-01, -6.647109782033448e-01},
-    {7.462843205288703e-01, -6.656273078328160e-01},
-    {7.454669111868606e-01, -6.665426350395909e-01},
-    {7.446483791851549e-01, -6.674569584452033e-01},
-    {7.438287257564475e-01, -6.683702766726985e-01},
-    {7.430079521351217e-01, -6.692825883466360e-01},
-    {7.421860595572477e-01, -6.701938920930909e-01},
-    {7.413630492605809e-01, -6.711041865396560e-01},
-    {7.405389224845600e-01, -6.720134703154446e-01},
-    {7.397136804703048e-01, -6.729217420510915e-01},
-    {7.388873244606151e-01, -6.738290003787560e-01},
-    {7.380598556999681e-01, -6.747352439321236e-01},
-    {7.372312754345167e-01, -6.756404713464076e-01},
-    {7.364015849120877e-01, -6.765446812583521e-01},
-    {7.355707853821803e-01, -6.774478723062332e-01},
-    {7.347388780959635e-01, -6.783500431298615e-01},
-    {7.339058643062745e-01, -6.792511923705841e-01},
-    {7.330717452676171e-01, -6.801513186712865e-01},
-    {7.322365222361595e-01, -6.810504206763948e-01},
-    {7.314001964697324e-01, -6.819484970318775e-01},
-    {7.305627692278276e-01, -6.828455463852481e-01},
-    {7.297242417715950e-01, -6.837415673855661e-01},
-    {7.288846153638420e-01, -6.846365586834405e-01},
-    {7.280438912690308e-01, -6.855305189310302e-01},
-    {7.272020707532766e-01, -6.864234467820476e-01},
-    {7.263591550843460e-01, -6.873153408917591e-01},
-    {7.255151455316546e-01, -6.882061999169885e-01},
-    {7.246700433662657e-01, -6.890960225161182e-01},
-    {7.238238498608879e-01, -6.899848073490914e-01},
-    {7.229765662898732e-01, -6.908725530774144e-01},
-    {7.221281939292153e-01, -6.917592583641577e-01},
-    {7.212787340565479e-01, -6.926449218739597e-01},
-    {7.204281879511419e-01, -6.935295422730269e-01},
-    {7.195765568939045e-01, -6.944131182291369e-01},
-    {7.187238421673769e-01, -6.952956484116404e-01},
-    {7.178700450557317e-01, -6.961771314914630e-01},
-    {7.170151668447722e-01, -6.970575661411068e-01},
-    {7.161592088219294e-01, -6.979369510346534e-01},
-    {7.153021722762606e-01, -6.988152848477649e-01},
-    {7.144440584984474e-01, -6.996925662576865e-01},
-    {7.135848687807936e-01, -7.005687939432483e-01},
-    {7.127246044172235e-01, -7.014439665848672e-01},
-    {7.118632667032795e-01, -7.023180828645491e-01},
-    {7.110008569361208e-01, -7.031911414658905e-01},
-    {7.101373764145209e-01, -7.040631410740809e-01},
-    {7.092728264388657e-01, -7.049340803759049e-01},
-    {7.084072083111520e-01, -7.058039580597435e-01},
-    {7.075405233349850e-01, -7.066727728155766e-01}
+    {9.999998117522413e-01f, -6.135922766517967e-04f},
+    {9.999983057705969e-01f, -1.840775905896510e-03f},
+    {9.999952938095762e-01f, -3.067956762965976e-03f},
+    {9.999907758737150e-01f, -4.295132999748002e-03f},
+    {9.999847519698173e-01f, -5.522302768137352e-03f},
+    {9.999772221069551e-01f, -6.749464220038533e-03f},
+    {9.999681862964679e-01f, -7.976615507368575e-03f},
+    {9.999576445519639e-01f, -9.203754782059819e-03f},
+    {9.999455968893185e-01f, -1.043088019606269e-02f},
+    {9.999320433266753e-01f, -1.165798990134850e-02f},
+    {9.999169838844458e-01f, -1.288508204991220e-02f},
+    {9.999004185853092e-01f, -1.411215479377519e-02f},
+    {9.998823474542126e-01f, -1.533920628498810e-02f},
+    {9.998627705183706e-01f, -1.656623467563356e-02f},
+    {9.998416878072659e-01f, -1.779323811782898e-02f},
+    {9.998190993526487e-01f, -1.902021476372936e-02f},
+    {9.997950051885367e-01f, -2.024716276553004e-02f},
+    {9.997694053512153e-01f, -2.147408027546951e-02f},
+    {9.997422998792375e-01f, -2.270096544583216e-02f},
+    {9.997136888134235e-01f, -2.392781642895110e-02f},
+    {9.996835721968610e-01f, -2.515463137721094e-02f},
+    {9.996519500749053e-01f, -2.638140844305051e-02f},
+    {9.996188224951786e-01f, -2.760814577896574e-02f},
+    {9.995841895075704e-01f, -2.883484153751236e-02f},
+    {9.995480511642375e-01f, -3.006149387130874e-02f},
+    {9.995104075196035e-01f, -3.128810093303862e-02f},
+    {9.994712586303591e-01f, -3.251466087545394e-02f},
+    {9.994306045554617e-01f, -3.374117185137758e-02f},
+    {9.993884453561358e-01f, -3.496763201370620e-02f},
+    {9.993447810958722e-01f, -3.619403951541294e-02f},
+    {9.992996118404286e-01f, -3.742039250955028e-02f},
+    {9.992529376578290e-01f, -3.864668914925275e-02f},
+    {9.992047586183639e-01f, -3.987292758773981e-02f},
+    {9.991550747945901e-01f, -4.109910597831850e-02f},
+    {9.991038862613305e-01f, -4.232522247438635e-02f},
+    {9.990511930956741e-01f, -4.355127522943403e-02f},
+    {9.989969953769761e-01f, -4.477726239704831e-02f},
+    {9.989412931868569e-01f, -4.600318213091462e-02f},
+    {9.988840866092031e-01f, -4.722903258482004e-02f},
+    {9.988253757301669e-01f, -4.845481191265589e-02f},
+    {9.987651606381658e-01f, -4.968051826842070e-02f},
+    {9.987034414238826e-01f, -5.090614980622282e-02f},
+    {9.986402181802653e-01f, -5.213170468028332e-02f},
+    {9.985754910025268e-01f, -5.335718104493870e-02f},
+    {9.985092599881454e-01f, -5.458257705464371e-02f},
+    {9.984415252368637e-01f, -5.580789086397409e-02f},
+    {9.983722868506889e-01f, -5.703312062762941e-02f},
+    {9.983015449338929e-01f, -5.825826450043575e-02f},
+    {9.982292995930115e-01f, -5.948332063734863e-02f},
+    {9.981555509368452e-01f, -6.070828719345561e-02f},
+    {9.980802990764579e-01f, -6.193316232397920e-02f},
+    {9.980035441251777e-01f, -6.315794418427960e-02f},
+    {9.979252861985960e-01f, -6.438263092985747e-02f},
+    {9.978455254145679e-01f, -6.560722071635666e-02f},
+    {9.977642618932119e-01f, -6.683171169956714e-02f},
+    {9.976814957569091e-01f, -6.805610203542757e-02f},
+    {9.975972271303040e-01f, -6.928038988002828e-02f},
+    {9.975114561403035e-01f, -7.050457338961386e-02f},
+    {9.974241829160772e-01f, -7.172865072058610e-02f},
+    {9.973354075890570e-01f, -7.295262002950662e-02f},
+    {9.972451302929369e-01f, -7.417647947309980e-02f},
+    {9.971533511636731e-01f, -7.540022720825540e-02f},
+    {9.970600703394830e-01f, -7.662386139203149e-02f},
+    {9.969652879608459e-01f, -7.784738018165707e-02f},
+    {9.968690041705026e-01f, -7.907078173453497e-02f},
+    {9.967712191134545e-01f, -8.029406420824454e-02f},
+    {9.966719329369642e-01f, -8.151722576054453e-02f},
+    {9.965711457905548e-01f, -8.274026454937569e-02f},
+    {9.964688578260101e-01f, -8.396317873286374e-02f},
+    {9.963650691973739e-01f, -8.518596646932200e-02f},
+    {9.962597800609497e-01f, -8.640862591725426e-02f},
+    {9.961529905753015e-01f, -8.763115523535747e-02f},
+    {9.960447009012520e-01f, -8.885355258252460e-02f},
+    {9.959349112018836e-01f, -9.007581611784729e-02f},
+    {9.958236216425376e-01f, -9.129794400061877e-02f},
+    {9.957108323908140e-01f, -9.251993439033654e-02f},
+    {9.955965436165716e-01f, -9.374178544670515e-02f},
+    {9.954807554919269e-01f, -9.496349532963899e-02f},
+    {9.953634681912550e-01f, -9.618506219926506e-02f},
+    {9.952446818911883e-01f, -9.740648421592572e-02f},
+    {9.951243967706169e-01f, -9.862775954018151e-02f},
+    {9.950026130106879e-01f, -9.984888633281383e-02f},
+    {9.948793307948056e-01f, -1.010698627548278e-01f},
+    {9.947545503086307e-01f, -1.022906869674551e-01f},
+    {9.946282717400804e-01f, -1.035113571321563e-01f},
+    {9.945004952793278e-01f, -1.047318714106244e-01f},
+    {9.943712211188022e-01f, -1.059522279647869e-01f},
+    {9.942404494531879e-01f, -1.071724249568088e-01f},
+    {9.941081804794248e-01f, -1.083924605490956e-01f},
+    {9.939744143967076e-01f, -1.096123329042957e-01f},
+    {9.938391514064855e-01f, -1.108320401853034e-01f},
+    {9.937023917124622e-01f, -1.120515805552615e-01f},
+    {9.935641355205953e-01f, -1.132709521775643e-01f},
+    {9.934243830390962e-01f, -1.144901532158602e-01f},
+    {9.932831344784294e-01f, -1.157091818340545e-01f},
+    {9.931403900513129e-01f, -1.169280361963119e-01f},
+    {9.929961499727171e-01f, -1.181467144670601e-01f},
+    {9.928504144598651e-01f, -1.193652148109914e-01f},
+    {9.927031837322318e-01f, -1.205835353930663e-01f},
+    {9.925544580115441e-01f, -1.218016743785162e-01f},
+    {9.924042375217801e-01f, -1.230196299328457e-01f},
+    {9.922525224891693e-01f, -1.242374002218357e-01f},
+    {9.920993131421918e-01f, -1.254549834115462e-01f},
+    {9.919446097115779e-01f, -1.266723776683190e-01f},
+    {9.917884124303086e-01f, -1.278895811587802e-01f},
+    {9.916307215336136e-01f, -1.291065920498434e-01f},
+    {9.914715372589731e-01f, -1.303234085087122e-01f},
+    {9.913108598461154e-01f, -1.315400287028831e-01f},
+    {9.911486895370180e-01f, -1.327564508001479e-01f},
+    {9.909850265759061e-01f, -1.339726729685971e-01f},
+    {9.908198712092535e-01f, -1.351886933766218e-01f},
+    {9.906532236857811e-01f, -1.364045101929175e-01f},
+    {9.904850842564571e-01f, -1.376201215864860e-01f},
+    {9.903154531744962e-01f, -1.388355257266385e-01f},
+    {9.901443306953601e-01f, -1.400507207829983e-01f},
+    {9.899717170767560e-01f, -1.412657049255036e-01f},
+    {9.897976125786367e-01f, -1.424804763244102e-01f},
+    {9.896220174632009e-01f, -1.436950331502945e-01f},
+    {9.894449319948911e-01f, -1.449093735740556e-01f},
+    {9.892663564403953e-01f, -1.461234957669190e-01f},
+    {9.890862910686448e-01f, -1.473373979004386e-01f},
+    {9.889047361508148e-01f, -1.485510781464996e-01f},
+    {9.887216919603238e-01f, -1.497645346773215e-01f},
+    {9.885371587728330e-01f, -1.509777656654608e-01f},
+    {9.883511368662461e-01f, -1.521907692838135e-01f},
+    {9.881636265207087e-01f, -1.534035437056180e-01f},
+    {9.879746280186079e-01f, -1.546160871044581e-01f},
+    {9.877841416445722e-01f, -1.558283976542652e-01f},
+    {9.875921676854704e-01f, -1.570404735293217e-01f},
+    {9.873987064304122e-01f, -1.582523129042630e-01f},
+    {9.872037581707463e-01f, -1.594639139540810e-01f},
+    {9.870073232000616e-01f, -1.606752748541265e-01f},
+    {9.868094018141855e-01f, -1.618863937801118e-01f},
+    {9.866099943111839e-01f, -1.630972689081137e-01f},
+    {9.864091009913611e-01f, -1.643078984145762e-01f},
+    {9.862067221572588e-01f, -1.655182804763130e-01f},
+    {9.860028581136556e-01f, -1.667284132705107e-01f},
+    {9.857975091675675e-01f, -1.679382949747312e-01f},
+    {9.855906756282459e-01f, -1.691479237669144e-01f},
+    {9.853823578071785e-01f, -1.703572978253813e-01f},
+    {9.851725560180883e-01f, -1.715664153288364e-01f},
+    {9.849612705769328e-01f, -1.727752744563706e-01f},
+    {9.847485018019042e-01f, -1.739838733874638e-01f},
+    {9.845342500134284e-01f, -1.751922103019880e-01f},
+    {9.843185155341647e-01f, -1.764002833802096e-01f},
+    {9.841012986890054e-01f, -1.776080908027924e-01f},
+    {9.838825998050751e-01f, -1.788156307508001e-01f},
+    {9.836624192117303e-01f, -1.800229014056995e-01f},
+    {9.834407572405590e-01f, -1.812299009493628e-01f},
+    {9.832176142253802e-01f, -1.824366275640705e-01f},
+    {9.829929905022433e-01f, -1.836430794325141e-01f},
+    {9.827668864094273e-01f, -1.848492547377989e-01f},
+    {9.825393022874412e-01f, -1.860551516634466e-01f},
+    {9.823102384790224e-01f, -1.872607683933984e-01f},
+    {9.820796953291370e-01f, -1.884661031120172e-01f},
+    {9.818476731849786e-01f, -1.896711540040907e-01f},
+    {9.816141723959685e-01f, -1.908759192548340e-01f},
+    {9.813791933137546e-01f, -1.920803970498924e-01f},
+    {9.811427362922112e-01f, -1.932845855753442e-01f},
+    {9.809048016874382e-01f, -1.944884830177032e-01f},
+    {9.806653898577611e-01f, -1.956920875639216e-01f},
+    {9.804245011637294e-01f, -1.968953974013927e-01f},
+    {9.801821359681174e-01f, -1.980984107179536e-01f},
+    {9.799382946359226e-01f, -1.993011257018880e-01f},
+    {9.796929775343657e-01f, -2.005035405419289e-01f},
+    {9.794461850328897e-01f, -2.017056534272613e-01f},
+    {9.791979175031598e-01f, -2.029074625475249e-01f},
+    {9.789481753190622e-01f, -2.041089660928169e-01f},
+    {9.786969588567044e-01f, -2.053101622536946e-01f},
+    {9.784442684944136e-01f, -2.065110492211783e-01f},
+    {9.781901046127370e-01f, -2.077116251867540e-01f},
+    {9.779344675944409e-01f, -2.089118883423760e-01f},
+    {9.776773578245099e-01f, -2.101118368804696e-01f},
+    {9.774187756901469e-01f, -2.113114689939341e-01f},
+    {9.771587215807717e-01f, -2.125107828761450e-01f},
+    {9.768971958880210e-01f, -2.137097767209575e-01f},
+    {9.766341990057480e-01f, -2.149084487227085e-01f},
+    {9.763697313300211e-01f, -2.161067970762195e-01f},
+    {9.761037932591240e-01f, -2.173048199767996e-01f},
+    {9.758363851935545e-01f, -2.185025156202481e-01f},
+    {9.755675075360243e-01f, -2.196998822028567e-01f},
+    {9.752971606914583e-01f, -2.208969179214133e-01f},
+    {9.750253450669941e-01f, -2.220936209732035e-01f},
+    {9.747520610719810e-01f, -2.232899895560143e-01f},
+    {9.744773091179798e-01f, -2.244860218681361e-01f},
+    {9.742010896187618e-01f, -2.256817161083659e-01f},
+    {9.739234029903089e-01f, -2.268770704760098e-01f},
+    {9.736442496508120e-01f, -2.280720831708857e-01f},
+    {9.733636300206708e-01f, -2.292667523933261e-01f},
+    {9.730815445224936e-01f, -2.304610763441808e-01f},
+    {9.727979935810960e-01f, -2.316550532248194e-01f},
+    {9.725129776235006e-01f, -2.328486812371343e-01f},
+    {9.722264970789363e-01f, -2.340419585835434e-01f},
+    {9.719385523788376e-01f, -2.352348834669925e-01f},
+    {9.716491439568440e-01f, -2.364274540909583e-01f},
+    {9.713582722487994e-01f, -2.376196686594509e-01f},
+    {9.710659376927513e-01f, -2.388115253770169e-01f},
+    {9.707721407289504e-01f, -2.400030224487415e-01f},
+    {9.704768817998493e-01f, -2.411941580802516e-01f},
+    {9.701801613501028e-01f, -2.423849304777186e-01f},
+    {9.698819798265667e-01f, -2.435753378478606e-01f},
+    {9.695823376782966e-01f, -2.447653783979458e-01f},
+    {9.692812353565485e-01f, -2.459550503357946e-01f},
+    {9.689786733147769e-01f, -2.471443518697825e-01f},
+    {9.686746520086348e-01f, -2.483332812088429e-01f},
+    {9.683691718959728e-01f, -2.495218365624697e-01f},
+    {9.680622334368384e-01f, -2.507100161407201e-01f},
+    {9.677538370934755e-01f, -2.518978181542170e-01f},
+    {9.674439833303232e-01f, -2.530852408141520e-01f},
+    {9.671326726140158e-01f, -2.542722823322882e-01f},
+    {9.668199054133816e-01f, -2.554589409209625e-01f},
+    {9.665056821994423e-01f, -2.566452147930884e-01f},
+    {9.661900034454125e-01f, -2.578311021621590e-01f},
+    {9.658728696266987e-01f, -2.590166012422493e-01f},
+    {9.655542812208985e-01f, -2.602017102480191e-01f},
+    {9.652342387078005e-01f, -2.613864273947156e-01f},
+    {9.649127425693828e-01f, -2.625707508981763e-01f},
+    {9.645897932898128e-01f, -2.637546789748313e-01f},
+    {9.642653913554462e-01f, -2.649382098417065e-01f},
+    {9.639395372548267e-01f, -2.661213417164257e-01f},
+    {9.636122314786845e-01f, -2.673040728172135e-01f},
+    {9.632834745199362e-01f, -2.684864013628985e-01f},
+    {9.629532668736839e-01f, -2.696683255729151e-01f},
+    {9.626216090372143e-01f, -2.708498436673069e-01f},
+    {9.622885015099981e-01f, -2.720309538667289e-01f},
+    {9.619539447936892e-01f, -2.732116543924507e-01f},
+    {9.616179393921240e-01f, -2.743919434663584e-01f},
+    {9.612804858113206e-01f, -2.755718193109581e-01f},
+    {9.609415845594780e-01f, -2.767512801493782e-01f},
+    {9.606012361469752e-01f, -2.779303242053718e-01f},
+    {9.602594410863711e-01f, -2.791089497033199e-01f},
+    {9.599161998924024e-01f, -2.802871548682339e-01f},
+    {9.595715130819845e-01f, -2.814649379257579e-01f},
+    {9.592253811742094e-01f, -2.826422971021723e-01f},
+    {9.588778046903456e-01f, -2.838192306243950e-01f},
+    {9.585287841538368e-01f, -2.849957367199857e-01f},
+    {9.581783200903017e-01f, -2.861718136171474e-01f},
+    {9.578264130275329e-01f, -2.873474595447295e-01f},
+    {9.574730634954960e-01f, -2.885226727322305e-01f},
+    {9.571182720263292e-01f, -2.896974514098006e-01f},
+    {9.567620391543418e-01f, -2.908717938082443e-01f},
+    {9.564043654160141e-01f, -2.920456981590233e-01f},
+    {9.560452513499964e-01f, -2.932191626942586e-01f},
+    {9.556846974971080e-01f, -2.943921856467341e-01f},
+    {9.553227044003364e-01f, -2.955647652498983e-01f},
+    {9.549592726048367e-01f, -2.967368997378675e-01f},
+    {9.545944026579306e-01f, -2.979085873454284e-01f},
+    {9.542280951091057e-01f, -2.990798263080405e-01f},
+    {9.538603505100144e-01f, -3.002506148618392e-01f},
+    {9.534911694144735e-01f, -3.014209512436381e-01f},
+    {9.531205523784633e-01f, -3.025908336909318e-01f},
+    {9.527484999601259e-01f, -3.037602604418984e-01f},
+    {9.523750127197659e-01f, -3.049292297354024e-01f},
+    {9.520000912198481e-01f, -3.060977398109971e-01f},
+    {9.516237360249976e-01f, -3.072657889089275e-01f},
+    {9.512459477019986e-01f, -3.084333752701328e-01f},
+    {9.508667268197933e-01f, -3.096004971362489e-01f},
+    {9.504860739494817e-01f, -3.107671527496115e-01f},
+    {9.501039896643201e-01f, -3.119333403532583e-01f},
+    {9.497204745397203e-01f, -3.130990581909318e-01f},
+    {9.493355291532494e-01f, -3.142643045070820e-01f},
+    {9.489491540846281e-01f, -3.154290775468691e-01f},
+    {9.485613499157303e-01f, -3.165933755561658e-01f},
+    {9.481721172305820e-01f, -3.177571967815606e-01f},
+    {9.477814566153607e-01f, -3.189205394703594e-01f},
+    {9.473893686583942e-01f, -3.200834018705895e-01f},
+    {9.469958539501598e-01f, -3.212457822310009e-01f},
+    {9.466009130832835e-01f, -3.224076788010699e-01f},
+    {9.462045466525394e-01f, -3.235690898310011e-01f},
+    {9.458067552548478e-01f, -3.247300135717307e-01f},
+    {9.454075394892756e-01f, -3.258904482749284e-01f},
+    {9.450068999570345e-01f, -3.270503921930005e-01f},
+    {9.446048372614803e-01f, -3.282098435790925e-01f},
+    {9.442013520081122e-01f, -3.293688006870915e-01f},
+    {9.437964448045717e-01f, -3.305272617716291e-01f},
+    {9.433901162606417e-01f, -3.316852250880838e-01f},
+    {9.429823669882458e-01f, -3.328426888925837e-01f},
+    {9.425731976014469e-01f, -3.339996514420094e-01f},
+    {9.421626087164466e-01f, -3.351561109939961e-01f},
+    {9.417506009515846e-01f, -3.363120658069366e-01f},
+    {9.413371749273369e-01f, -3.374675141399838e-01f},
+    {9.409223312663159e-01f, -3.386224542530535e-01f},
+    {9.405060705932683e-01f, -3.397768844068269e-01f},
+    {9.400883935350755e-01f, -3.409308028627527e-01f},
+    {9.396693007207513e-01f, -3.420842078830508e-01f},
+    {9.392487927814420e-01f, -3.432370977307140e-01f},
+    {9.388268703504251e-01f, -3.443894706695110e-01f},
+    {9.384035340631081e-01f, -3.455413249639891e-01f},
+    {9.379787845570278e-01f, -3.466926588794764e-01f},
+    {9.375526224718491e-01f, -3.478434706820849e-01f},
+    {9.371250484493645e-01f, -3.489937586387129e-01f},
+    {9.366960631334929e-01f, -3.501435210170474e-01f},
+    {9.362656671702783e-01f, -3.512927560855671e-01f},
+    {9.358338612078891e-01f, -3.524414621135448e-01f},
+    {9.354006458966176e-01f, -3.535896373710499e-01f},
+    {9.349660218888781e-01f, -3.547372801289512e-01f},
+    {9.345299898392064e-01f, -3.558843886589194e-01f},
+    {9.340925504042590e-01f, -3.570309612334300e-01f},
+    {9.336537042428116e-01f, -3.581769961257653e-01f},
+    {9.332134520157588e-01f, -3.593224916100174e-01f},
+    {9.327717943861125e-01f, -3.604674459610909e-01f},
+    {9.323287320190009e-01f, -3.616118574547051e-01f},
+    {9.318842655816681e-01f, -3.627557243673972e-01f},
+    {9.314383957434725e-01f, -3.638990449765241e-01f},
+    {9.309911231758859e-01f, -3.650418175602657e-01f},
+    {9.305424485524929e-01f, -3.661840403976272e-01f},
+    {9.300923725489892e-01f, -3.673257117684415e-01f},
+    {9.296408958431813e-01f, -3.684668299533723e-01f},
+    {9.291880191149847e-01f, -3.696073932339162e-01f},
+    {9.287337430464239e-01f, -3.707473998924054e-01f},
+    {9.282780683216301e-01f, -3.718868482120106e-01f},
+    {9.278209956268415e-01f, -3.730257364767432e-01f},
+    {9.273625256504011e-01f, -3.741640629714579e-01f},
+    {9.269026590827565e-01f, -3.753018259818559e-01f},
+    {9.264413966164585e-01f, -3.764390237944864e-01f},
+    {9.259787389461599e-01f, -3.775756546967501e-01f},
+    {9.255146867686148e-01f, -3.787117169769015e-01f},
+    {9.250492407826776e-01f, -3.798472089240512e-01f},
+    {9.245824016893013e-01f, -3.809821288281689e-01f},
+    {9.241141701915373e-01f, -3.821164749800858e-01f},
+    {9.236445469945337e-01f, -3.832502456714969e-01f},
+    {9.231735328055345e-01f, -3.843834391949643e-01f},
+    {9.227011283338786e-01f, -3.855160538439188e-01f},
+    {9.222273342909986e-01f, -3.866480879126634e-01f},
+    {9.217521513904198e-01f, -3.877795396963752e-01f},
+    {9.212755803477590e-01f, -3.889104074911081e-01f},
+    {9.207976218807237e-01f, -3.900406895937958e-01f},
+    {9.203182767091106e-01f, -3.911703843022539e-01f},
+    {9.198375455548048e-01f, -3.922994899151824e-01f},
+    {9.193554291417789e-01f, -3.934280047321689e-01f},
+    {9.188719281960914e-01f, -3.945559270536903e-01f},
+    {9.183870434458861e-01f, -3.956832551811160e-01f},
+    {9.179007756213905e-01f, -3.968099874167103e-01f},
+    {9.174131254549152e-01f, -3.979361220636348e-01f},
+    {9.169240936808526e-01f, -3.990616574259509e-01f},
+    {9.164336810356757e-01f, -4.001865918086229e-01f},
+    {9.159418882579371e-01f, -4.013109235175197e-01f},
+    {9.154487160882678e-01f, -4.024346508594184e-01f},
+    {9.149541652693762e-01f, -4.035577721420057e-01f},
+    {9.144582365460469e-01f, -4.046802856738814e-01f},
+    {9.139609306651395e-01f, -4.058021897645602e-01f},
+    {9.134622483755878e-01f, -4.069234827244749e-01f},
+    {9.129621904283982e-01f, -4.080441628649787e-01f},
+    {9.124607575766490e-01f, -4.091642284983474e-01f},
+    {9.119579505754890e-01f, -4.102836779377824e-01f},
+    {9.114537701821365e-01f, -4.114025094974132e-01f},
+    {9.109482171558779e-01f, -4.125207214922996e-01f},
+    {9.104412922580672e-01f, -4.136383122384345e-01f},
+    {9.099329962521239e-01f, -4.147552800527466e-01f},
+    {9.094233299035327e-01f, -4.158716232531024e-01f},
+    {9.089122939798419e-01f, -4.169873401583093e-01f},
+    {9.083998892506623e-01f, -4.181024290881177e-01f},
+    {9.078861164876663e-01f, -4.192168883632239e-01f},
+    {9.073709764645862e-01f, -4.203307163052724e-01f},
+    {9.068544699572136e-01f, -4.214439112368585e-01f},
+    {9.063365977433983e-01f, -4.225564714815306e-01f},
+    {9.058173606030460e-01f, -4.236683953637931e-01f},
+    {9.052967593181188e-01f, -4.247796812091088e-01f},
+    {9.047747946726327e-01f, -4.258903273439013e-01f},
+    {9.042514674526569e-01f, -4.270003320955576e-01f},
+    {9.037267784463131e-01f, -4.281096937924305e-01f},
+    {9.032007284437731e-01f, -4.292184107638414e-01f},
+    {9.026733182372588e-01f, -4.303264813400826e-01f},
+    {9.021445486210405e-01f, -4.314339038524199e-01f},
+    {9.016144203914357e-01f, -4.325406766330948e-01f},
+    {9.010829343468079e-01f, -4.336467980153277e-01f},
+    {9.005500912875654e-01f, -4.347522663333197e-01f},
+    {9.000158920161603e-01f, -4.358570799222555e-01f},
+    {8.994803373370870e-01f, -4.369612371183058e-01f},
+    {8.989434280568812e-01f, -4.380647362586298e-01f},
+    {8.984051649841186e-01f, -4.391675756813778e-01f},
+    {8.978655489294136e-01f, -4.402697537256935e-01f},
+    {8.973245807054183e-01f, -4.413712687317167e-01f},
+    {8.967822611268210e-01f, -4.424721190405857e-01f},
+    {8.962385910103452e-01f, -4.435723029944398e-01f},
+    {8.956935711747483e-01f, -4.446718189364220e-01f},
+    {8.951472024408204e-01f, -4.457706652106809e-01f},
+    {8.945994856313827e-01f, -4.468688401623742e-01f},
+    {8.940504215712870e-01f, -4.479663421376699e-01f},
+    {8.935000110874138e-01f, -4.490631694837502e-01f},
+    {8.929482550086714e-01f, -4.501593205488127e-01f},
+    {8.923951541659944e-01f, -4.512547936820739e-01f},
+    {8.918407093923427e-01f, -4.523495872337709e-01f},
+    {8.912849215227001e-01f, -4.534436995551644e-01f},
+    {8.907277913940732e-01f, -4.545371289985410e-01f},
+    {8.901693198454897e-01f, -4.556298739172159e-01f},
+    {8.896095077179980e-01f, -4.567219326655349e-01f},
+    {8.890483558546646e-01f, -4.578133035988772e-01f},
+    {8.884858651005743e-01f, -4.589039850736579e-01f},
+    {8.879220363028281e-01f, -4.599939754473306e-01f},
+    {8.873568703105417e-01f, -4.610832730783892e-01f},
+    {8.867903679748451e-01f, -4.621718763263714e-01f},
+    {8.862225301488806e-01f, -4.632597835518601e-01f},
+    {8.856533576878016e-01f, -4.643469931164871e-01f},
+    {8.850828514487716e-01f, -4.654335033829341e-01f},
+    {8.845110122909626e-01f, -4.665193127149364e-01f},
+    {8.839378410755541e-01f, -4.676044194772847e-01f},
+    {8.833633386657316e-01f, -4.686888220358279e-01f},
+    {8.827875059266853e-01f, -4.697725187574754e-01f},
+    {8.822103437256089e-01f, -4.708555080101994e-01f},
+    {8.816318529316984e-01f, -4.719377881630376e-01f},
+    {8.810520344161502e-01f, -4.730193575860958e-01f},
+    {8.804708890521608e-01f, -4.741002146505500e-01f},
+    {8.798884177149244e-01f, -4.751803577286489e-01f},
+    {8.793046212816323e-01f, -4.762597851937166e-01f},
+    {8.787195006314716e-01f, -4.773384954201548e-01f},
+    {8.781330566456232e-01f, -4.784164867834454e-01f},
+    {8.775452902072614e-01f, -4.794937576601530e-01f},
+    {8.769562022015515e-01f, -4.805703064279270e-01f},
+    {8.763657935156495e-01f, -4.816461314655044e-01f},
+    {8.757740650387004e-01f, -4.827212311527123e-01f},
+    {8.751810176618363e-01f, -4.837956038704698e-01f},
+    {8.745866522781761e-01f, -4.848692480007911e-01f},
+    {8.739909697828232e-01f, -4.859421619267875e-01f},
+    {8.733939710728648e-01f, -4.870143440326701e-01f},
+    {8.727956570473698e-01f, -4.880857927037520e-01f},
+    {8.721960286073888e-01f, -4.891565063264507e-01f},
+    {8.715950866559510e-01f, -4.902264832882912e-01f},
+    {8.709928320980644e-01f, -4.912957219779071e-01f},
+    {8.703892658407133e-01f, -4.923642207850446e-01f},
+    {8.697843887928577e-01f, -4.934319781005636e-01f},
+    {8.691782018654314e-01f, -4.944989923164409e-01f},
+    {8.685707059713409e-01f, -4.955652618257725e-01f},
+    {8.679619020254642e-01f, -4.966307850227757e-01f},
+    {8.673517909446490e-01f, -4.976955603027919e-01f},
+    {8.667403736477115e-01f, -4.987595860622885e-01f},
+    {8.661276510554351e-01f, -4.998228606988624e-01f},
+    {8.655136240905691e-01f, -5.008853826112407e-01f},
+    {8.648982936778269e-01f, -5.019471501992850e-01f},
+    {8.642816607438848e-01f, -5.030081618639924e-01f},
+    {8.636637262173812e-01f, -5.040684160074983e-01f},
+    {8.630444910289141e-01f, -5.051279110330795e-01f},
+    {8.624239561110406e-01f, -5.061866453451552e-01f},
+    {8.618021223982749e-01f, -5.072446173492910e-01f},
+    {8.611789908270876e-01f, -5.083018254522002e-01f},
+    {8.605545623359034e-01f, -5.093582680617462e-01f},
+    {8.599288378651004e-01f, -5.104139435869457e-01f},
+    {8.593018183570085e-01f, -5.114688504379703e-01f},
+    {8.586735047559073e-01f, -5.125229870261497e-01f},
+    {8.580438980080262e-01f, -5.135763517639729e-01f},
+    {8.574129990615412e-01f, -5.146289430650919e-01f},
+    {8.567808088665750e-01f, -5.156807593443229e-01f},
+    {8.561473283751945e-01f, -5.167317990176499e-01f},
+    {8.555125585414098e-01f, -5.177820605022260e-01f},
+    {8.548765003211730e-01f, -5.188315422163763e-01f},
+    {8.542391546723761e-01f, -5.198802425796005e-01f},
+    {8.536005225548502e-01f, -5.209281600125748e-01f},
+    {8.529606049303636e-01f, -5.219752929371544e-01f},
+    {8.523194027626210e-01f, -5.230216397763758e-01f},
+    {8.516769170172609e-01f, -5.240671989544601e-01f},
+    {8.510331486618554e-01f, -5.251119688968137e-01f},
+    {8.503880986659081e-01f, -5.261559480300321e-01f},
+    {8.497417680008525e-01f, -5.271991347819013e-01f},
+    {8.490941576400509e-01f, -5.282415275814013e-01f},
+    {8.484452685587929e-01f, -5.292831248587072e-01f},
+    {8.477951017342936e-01f, -5.303239250451923e-01f},
+    {8.471436581456926e-01f, -5.313639265734305e-01f},
+    {8.464909387740521e-01f, -5.324031278771979e-01f},
+    {8.458369446023557e-01f, -5.334415273914767e-01f},
+    {8.451816766155068e-01f, -5.344791235524554e-01f},
+    {8.445251358003272e-01f, -5.355159147975332e-01f},
+    {8.438673231455553e-01f, -5.365518995653215e-01f},
+    {8.432082396418454e-01f, -5.375870762956454e-01f},
+    {8.425478862817651e-01f, -5.386214434295480e-01f},
+    {8.418862640597948e-01f, -5.396549994092906e-01f},
+    {8.412233739723254e-01f, -5.406877426783570e-01f},
+    {8.405592170176576e-01f, -5.417196716814542e-01f},
+    {8.398937941959995e-01f, -5.427507848645159e-01f},
+    {8.392271065094661e-01f, -5.437810806747042e-01f},
+    {8.385591549620770e-01f, -5.448105575604123e-01f},
+    {8.378899405597550e-01f, -5.458392139712668e-01f},
+    {8.372194643103249e-01f, -5.468670483581293e-01f},
+    {8.365477272235120e-01f, -5.478940591731002e-01f},
+    {8.358747303109401e-01f, -5.489202448695194e-01f},
+    {8.352004745861303e-01f, -5.499456039019702e-01f},
+    {8.345249610644997e-01f, -5.509701347262801e-01f},
+    {8.338481907633595e-01f, -5.519938357995242e-01f},
+    {8.331701647019132e-01f, -5.530167055800275e-01f},
+    {8.324908839012561e-01f, -5.540387425273663e-01f},
+    {8.318103493843727e-01f, -5.550599451023716e-01f},
+    {8.311285621761358e-01f, -5.560803117671306e-01f},
+    {8.304455233033046e-01f, -5.570998409849897e-01f},
+    {8.297612337945230e-01f, -5.581185312205561e-01f},
+    {8.290756946803191e-01f, -5.591363809397010e-01f},
+    {8.283889069931020e-01f, -5.601533886095610e-01f},
+    {8.277008717671618e-01f, -5.611695526985409e-01f},
+    {8.270115900386670e-01f, -5.621848716763159e-01f},
+    {8.263210628456635e-01f, -5.631993440138341e-01f},
+    {8.256292912280727e-01f, -5.642129681833185e-01f},
+    {8.249362762276903e-01f, -5.652257426582692e-01f},
+    {8.242420188881840e-01f, -5.662376659134664e-01f},
+    {8.235465202550933e-01f, -5.672487364249718e-01f},
+    {8.228497813758264e-01f, -5.682589526701315e-01f},
+    {8.221518032996592e-01f, -5.692683131275782e-01f},
+    {8.214525870777344e-01f, -5.702768162772331e-01f},
+    {8.207521337630588e-01f, -5.712844606003090e-01f},
+    {8.200504444105025e-01f, -5.722912445793115e-01f},
+    {8.193475200767969e-01f, -5.732971666980422e-01f},
+    {8.186433618205335e-01f, -5.743022254416005e-01f},
+    {8.179379707021619e-01f, -5.753064192963863e-01f},
+    {8.172313477839882e-01f, -5.763097467501014e-01f},
+    {8.165234941301740e-01f, -5.773122062917532e-01f},
+    {8.158144108067338e-01f, -5.783137964116556e-01f},
+    {8.151040988815345e-01f, -5.793145156014319e-01f},
+    {8.143925594242929e-01f, -5.803143623540171e-01f},
+    {8.136797935065747e-01f, -5.813133351636602e-01f},
+    {8.129658022017924e-01f, -5.823114325259262e-01f},
+    {8.122505865852039e-01f, -5.833086529376983e-01f},
+    {8.115341477339112e-01f, -5.843049948971807e-01f},
+    {8.108164867268581e-01f, -5.853004569039005e-01f},
+    {8.100976046448293e-01f, -5.862950374587097e-01f},
+    {8.093775025704479e-01f, -5.872887350637883e-01f},
+    {8.086561815881750e-01f, -5.882815482226452e-01f},
+    {8.079336427843067e-01f, -5.892734754401222e-01f},
+    {8.072098872469734e-01f, -5.902645152223945e-01f},
+    {8.064849160661379e-01f, -5.912546660769743e-01f},
+    {8.057587303335938e-01f, -5.922439265127122e-01f},
+    {8.050313311429637e-01f, -5.932322950397998e-01f},
+    {8.043027195896973e-01f, -5.942197701697721e-01f},
+    {8.035728967710708e-01f, -5.952063504155093e-01f},
+    {8.028418637861839e-01f, -5.961920342912395e-01f},
+    {8.021096217359593e-01f, -5.971768203125404e-01f},
+    {8.013761717231402e-01f, -5.981607069963423e-01f},
+    {8.006415148522891e-01f, -5.991436928609294e-01f},
+    {7.999056522297859e-01f, -6.001257764259429e-01f},
+    {7.991685849638264e-01f, -6.011069562123827e-01f},
+    {7.984303141644207e-01f, -6.020872307426096e-01f},
+    {7.976908409433912e-01f, -6.030665985403482e-01f},
+    {7.969501664143711e-01f, -6.040450581306880e-01f},
+    {7.962082916928030e-01f, -6.050226080400867e-01f},
+    {7.954652178959369e-01f, -6.059992467963715e-01f},
+    {7.947209461428283e-01f, -6.069749729287426e-01f},
+    {7.939754775543372e-01f, -6.079497849677736e-01f},
+    {7.932288132531257e-01f, -6.089236814454155e-01f},
+    {7.924809543636567e-01f, -6.098966608949977e-01f},
+    {7.917319020121923e-01f, -6.108687218512306e-01f},
+    {7.909816573267918e-01f, -6.118398628502083e-01f},
+    {7.902302214373100e-01f, -6.128100824294097e-01f},
+    {7.894775954753960e-01f, -6.137793791277018e-01f},
+    {7.887237805744907e-01f, -6.147477514853411e-01f},
+    {7.879687778698258e-01f, -6.157151980439765e-01f},
+    {7.872125884984216e-01f, -6.166817173466510e-01f},
+    {7.864552135990858e-01f, -6.176473079378039e-01f},
+    {7.856966543124112e-01f, -6.186119683632733e-01f},
+    {7.849369117807745e-01f, -6.195756971702979e-01f},
+    {7.841759871483340e-01f, -6.205384929075197e-01f},
+    {7.834138815610288e-01f, -6.215003541249855e-01f},
+    {7.826505961665757e-01f, -6.224612793741500e-01f},
+    {7.818861321144691e-01f, -6.234212672078768e-01f},
+    {7.811204905559779e-01f, -6.243803161804418e-01f},
+    {7.803536726441443e-01f, -6.253384248475345e-01f},
+    {7.795856795337824e-01f, -6.262955917662607e-01f},
+    {7.788165123814760e-01f, -6.272518154951441e-01f},
+    {7.780461723455767e-01f, -6.282070945941292e-01f},
+    {7.772746605862029e-01f, -6.291614276245828e-01f},
+    {7.765019782652373e-01f, -6.301148131492967e-01f},
+    {7.757281265463254e-01f, -6.310672497324895e-01f},
+    {7.749531065948739e-01f, -6.320187359398091e-01f},
+    {7.741769195780490e-01f, -6.329692703383341e-01f},
+    {7.733995666647743e-01f, -6.339188514965771e-01f},
+    {7.726210490257291e-01f, -6.348674779844861e-01f},
+    {7.718413678333470e-01f, -6.358151483734467e-01f},
+    {7.710605242618138e-01f, -6.367618612362842e-01f},
+    {7.702785194870657e-01f, -6.377076151472665e-01f},
+    {7.694953546867879e-01f, -6.386524086821050e-01f},
+    {7.687110310404124e-01f, -6.395962404179578e-01f},
+    {7.679255497291163e-01f, -6.405391089334316e-01f},
+    {7.671389119358204e-01f, -6.414810128085832e-01f},
+    {7.663511188451869e-01f, -6.424219506249224e-01f},
+    {7.655621716436182e-01f, -6.433619209654138e-01f},
+    {7.647720715192542e-01f, -6.443009224144792e-01f},
+    {7.639808196619715e-01f, -6.452389535579994e-01f},
+    {7.631884172633813e-01f, -6.461760129833163e-01f},
+    {7.623948655168271e-01f, -6.471120992792355e-01f},
+    {7.616001656173835e-01f, -6.480472110360278e-01f},
+    {7.608043187618542e-01f, -6.489813468454321e-01f},
+    {7.600073261487703e-01f, -6.499145053006563e-01f},
+    {7.592091889783881e-01f, -6.508466849963809e-01f},
+    {7.584099084526877e-01f, -6.517778845287601e-01f},
+    {7.576094857753715e-01f, -6.527081024954242e-01f},
+    {7.568079221518612e-01f, -6.536373374954818e-01f},
+    {7.560052187892974e-01f, -6.545655881295217e-01f},
+    {7.552013768965365e-01f, -6.554928529996153e-01f},
+    {7.543963976841503e-01f, -6.564191307093185e-01f},
+    {7.535902823644226e-01f, -6.573444198636738e-01f},
+    {7.527830321513488e-01f, -6.582687190692122e-01f},
+    {7.519746482606328e-01f, -6.591920269339562e-01f},
+    {7.511651319096865e-01f, -6.601143420674205e-01f},
+    {7.503544843176265e-01f, -6.610356630806152e-01f},
+    {7.495427067052737e-01f, -6.619559885860479e-01f},
+    {7.487298002951505e-01f, -6.628753171977246e-01f},
+    {7.479157663114792e-01f, -6.637936475311532e-01f},
+    {7.471006059801801e-01f, -6.647109782033448e-01f},
+    {7.462843205288703e-01f, -6.656273078328160e-01f},
+    {7.454669111868606e-01f, -6.665426350395909e-01f},
+    {7.446483791851549e-01f, -6.674569584452033e-01f},
+    {7.438287257564475e-01f, -6.683702766726985e-01f},
+    {7.430079521351217e-01f, -6.692825883466360e-01f},
+    {7.421860595572477e-01f, -6.701938920930909e-01f},
+    {7.413630492605809e-01f, -6.711041865396560e-01f},
+    {7.405389224845600e-01f, -6.720134703154446e-01f},
+    {7.397136804703048e-01f, -6.729217420510915e-01f},
+    {7.388873244606151e-01f, -6.738290003787560e-01f},
+    {7.380598556999681e-01f, -6.747352439321236e-01f},
+    {7.372312754345167e-01f, -6.756404713464076e-01f},
+    {7.364015849120877e-01f, -6.765446812583521e-01f},
+    {7.355707853821803e-01f, -6.774478723062332e-01f},
+    {7.347388780959635e-01f, -6.783500431298615e-01f},
+    {7.339058643062745e-01f, -6.792511923705841e-01f},
+    {7.330717452676171e-01f, -6.801513186712865e-01f},
+    {7.322365222361595e-01f, -6.810504206763948e-01f},
+    {7.314001964697324e-01f, -6.819484970318775e-01f},
+    {7.305627692278276e-01f, -6.828455463852481e-01f},
+    {7.297242417715950e-01f, -6.837415673855661e-01f},
+    {7.288846153638420e-01f, -6.846365586834405e-01f},
+    {7.280438912690308e-01f, -6.855305189310302e-01f},
+    {7.272020707532766e-01f, -6.864234467820476e-01f},
+    {7.263591550843460e-01f, -6.873153408917591e-01f},
+    {7.255151455316546e-01f, -6.882061999169885e-01f},
+    {7.246700433662657e-01f, -6.890960225161182e-01f},
+    {7.238238498608879e-01f, -6.899848073490914e-01f},
+    {7.229765662898732e-01f, -6.908725530774144e-01f},
+    {7.221281939292153e-01f, -6.917592583641577e-01f},
+    {7.212787340565479e-01f, -6.926449218739597e-01f},
+    {7.204281879511419e-01f, -6.935295422730269e-01f},
+    {7.195765568939045e-01f, -6.944131182291369e-01f},
+    {7.187238421673769e-01f, -6.952956484116404e-01f},
+    {7.178700450557317e-01f, -6.961771314914630e-01f},
+    {7.170151668447722e-01f, -6.970575661411068e-01f},
+    {7.161592088219294e-01f, -6.979369510346534e-01f},
+    {7.153021722762606e-01f, -6.988152848477649e-01f},
+    {7.144440584984474e-01f, -6.996925662576865e-01f},
+    {7.135848687807936e-01f, -7.005687939432483e-01f},
+    {7.127246044172235e-01f, -7.014439665848672e-01f},
+    {7.118632667032795e-01f, -7.023180828645491e-01f},
+    {7.110008569361208e-01f, -7.031911414658905e-01f},
+    {7.101373764145209e-01f, -7.040631410740809e-01f},
+    {7.092728264388657e-01f, -7.049340803759049e-01f},
+    {7.084072083111520e-01f, -7.058039580597435e-01f},
+    {7.075405233349850e-01f, -7.066727728155766e-01f}
 };
 

Modified: freeswitch/branches/gmaruzz/libs/libg722_1/src/decoderf.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/libg722_1/src/decoderf.c	(original)
+++ freeswitch/branches/gmaruzz/libs/libg722_1/src/decoderf.c	Tue Dec 23 07:37:03 2008
@@ -451,7 +451,7 @@
 
         if (category == NUM_CATEGORIES - 1)
         {
-            noifillpos = standard_deviation*0.70711;
+            noifillpos = standard_deviation*0.70711f;
             noifillneg = -noifillpos;
 
             /* This assumes region_size = 20 */

Modified: freeswitch/branches/gmaruzz/libs/libg722_1/src/sam2coef.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/libg722_1/src/sam2coef.h	(original)
+++ freeswitch/branches/gmaruzz/libs/libg722_1/src/sam2coef.h	Tue Dec 23 07:37:03 2008
@@ -124,970 +124,970 @@
 #else
 const float samples_to_rmlt_window[DCT_LENGTH] =
 {
-    2.45436677e-03,
-    7.36304140e-03,
-    1.22715384e-02,
-    1.71797387e-02,
-    2.20875274e-02,
-    2.69947816e-02,
-    3.19013856e-02,
-    3.68072242e-02,
-    4.17121723e-02,
-    4.66161147e-02,
-    5.15189357e-02,
-    5.64205162e-02,
-    6.13207370e-02,
-    6.62194788e-02,
-    7.11166263e-02,
-    7.60120600e-02,
-    8.09056610e-02,
-    8.57973099e-02,
-    9.06868950e-02,
-    9.55742970e-02,
-    1.00459397e-01,
-    1.05342068e-01,
-    1.10222206e-01,
-    1.15099691e-01,
-    1.19974397e-01,
-    1.24846213e-01,
-    1.29715025e-01,
-    1.34580702e-01,
-    1.39443144e-01,
-    1.44302234e-01,
-    1.49157837e-01,
-    1.54009849e-01,
-    1.58858150e-01,
-    1.63702607e-01,
-    1.68543145e-01,
-    1.73379600e-01,
-    1.78211898e-01,
-    1.83039889e-01,
-    1.87863469e-01,
-    1.92682534e-01,
-    1.97496936e-01,
-    2.02306598e-01,
-    2.07111374e-01,
-    2.11911172e-01,
-    2.16705844e-01,
-    2.21495315e-01,
-    2.26279438e-01,
-    2.31058106e-01,
-    2.35831216e-01,
-    2.40598634e-01,
-    2.45360255e-01,
-    2.50115961e-01,
-    2.54865646e-01,
-    2.59609193e-01,
-    2.64346480e-01,
-    2.69077420e-01,
-    2.73801863e-01,
-    2.78519690e-01,
-    2.83230811e-01,
-    2.87935108e-01,
-    2.92632490e-01,
-    2.97322810e-01,
-    3.02005947e-01,
-    3.06681812e-01,
-    3.11350316e-01,
-    3.16011280e-01,
-    3.20664644e-01,
-    3.25310290e-01,
-    3.29948097e-01,
-    3.34577948e-01,
-    3.39199722e-01,
-    3.43813360e-01,
-    3.48418683e-01,
-    3.53015602e-01,
-    3.57604057e-01,
-    3.62183869e-01,
-    3.66754949e-01,
-    3.71317208e-01,
-    3.75870496e-01,
-    3.80414754e-01,
-    3.84949833e-01,
-    3.89475614e-01,
-    3.93992037e-01,
-    3.98498952e-01,
-    4.02996302e-01,
-    4.07483906e-01,
-    4.11961704e-01,
-    4.16429549e-01,
-    4.20887381e-01,
-    4.25335079e-01,
-    4.29772526e-01,
-    4.34199601e-01,
-    4.38616246e-01,
-    4.43022281e-01,
-    4.47417676e-01,
-    4.51802284e-01,
-    4.56175983e-01,
-    4.60538715e-01,
-    4.64890331e-01,
-    4.69230771e-01,
-    4.73559886e-01,
-    4.77877587e-01,
-    4.82183784e-01,
-    4.86478359e-01,
-    4.90761191e-01,
-    4.95032221e-01,
-    4.99291331e-01,
-    5.03538370e-01,
-    5.07773340e-01,
-    5.11996031e-01,
-    5.16206384e-01,
-    5.20404279e-01,
-    5.24589658e-01,
-    5.28762400e-01,
-    5.32922447e-01,
-    5.37069619e-01,
-    5.41203797e-01,
-    5.45324981e-01,
-    5.49433053e-01,
-    5.53527832e-01,
-    5.57609320e-01,
-    5.61677337e-01,
-    5.65731823e-01,
-    5.69772661e-01,
-    5.73799789e-01,
-    5.77813089e-01,
-    5.81812501e-01,
-    5.85797846e-01,
-    5.89769125e-01,
-    5.93726158e-01,
-    5.97668886e-01,
-    6.01597190e-01,
-    6.05511069e-01,
-    6.09410286e-01,
-    6.13294840e-01,
-    6.17164612e-01,
-    6.21019542e-01,
-    6.24859512e-01,
-    6.28684402e-01,
-    6.32494152e-01,
-    6.36288643e-01,
-    6.40067816e-01,
-    6.43831551e-01,
-    6.47579789e-01,
-    6.51312411e-01,
-    6.55029356e-01,
-    6.58730507e-01,
-    6.62415802e-01,
-    6.66085124e-01,
-    6.69738352e-01,
-    6.73375487e-01,
-    6.76996410e-01,
-    6.80601001e-01,
-    6.84189200e-01,
-    6.87760890e-01,
-    6.91316009e-01,
-    6.94854498e-01,
-    6.98376238e-01,
-    7.01881170e-01,
-    7.05369174e-01,
-    7.08840132e-01,
-    7.12294042e-01,
-    7.15730846e-01,
-    7.19150364e-01,
-    7.22552538e-01,
-    7.25937307e-01,
-    7.29304552e-01,
-    7.32654274e-01,
-    7.35986352e-01,
-    7.39300668e-01,
-    7.42597163e-01,
-    7.45875776e-01,
-    7.49136388e-01,
-    7.52379000e-01,
-    7.55603433e-01,
-    7.58809686e-01,
-    7.61997640e-01,
-    7.65167236e-01,
-    7.68318415e-01,
-    7.71451116e-01,
-    7.74565160e-01,
-    7.77660549e-01,
-    7.80737221e-01,
-    7.83795059e-01,
-    7.86834061e-01,
-    7.89854050e-01,
-    7.92855024e-01,
-    7.95836926e-01,
-    7.98799574e-01,
-    8.01743031e-01,
-    8.04667175e-01,
-    8.07571888e-01,
-    8.10457170e-01,
-    8.13322961e-01,
-    8.16169083e-01,
-    8.18995595e-01,
-    8.21802378e-01,
-    8.24589312e-01,
-    8.27356398e-01,
-    8.30103517e-01,
-    8.32830667e-01,
-    8.35537732e-01,
-    8.38224709e-01,
-    8.40891480e-01,
-    8.43537927e-01,
-    8.46164107e-01,
-    8.48769844e-01,
-    8.51355195e-01,
-    8.53919983e-01,
-    8.56464207e-01,
-    8.58987808e-01,
-    8.61490726e-01,
-    8.63972843e-01,
-    8.66434157e-01,
-    8.68874609e-01,
-    8.71294141e-01,
-    8.73692632e-01,
-    8.76070082e-01,
-    8.78426433e-01,
-    8.80761623e-01,
-    8.83075595e-01,
-    8.85368288e-01,
-    8.87639642e-01,
-    8.89889598e-01,
-    8.92118096e-01,
-    8.94325137e-01,
-    8.96510601e-01,
-    8.98674488e-01,
-    9.00816679e-01,
-    9.02937174e-01,
-    9.05035973e-01,
-    9.07112896e-01,
-    9.09168005e-01,
-    9.11201179e-01,
-    9.13212419e-01,
-    9.15201604e-01,
-    9.17168796e-01,
-    9.19113874e-01,
-    9.21036780e-01,
-    9.22937512e-01,
-    9.24816012e-01,
-    9.26672220e-01,
-    9.28506076e-01,
-    9.30317581e-01,
-    9.32106674e-01,
-    9.33873296e-01,
-    9.35617447e-01,
-    9.37339008e-01,
-    9.39037979e-01,
-    9.40714359e-01,
-    9.42368090e-01,
-    9.43999052e-01,
-    9.45607305e-01,
-    9.47192788e-01,
-    9.48755443e-01,
-    9.50295210e-01,
-    9.51812088e-01,
-    9.53306019e-01,
-    9.54777002e-01,
-    9.56224978e-01,
-    9.57649946e-01,
-    9.59051788e-01,
-    9.60430503e-01,
-    9.61786151e-01,
-    9.63118553e-01,
-    9.64427769e-01,
-    9.65713739e-01,
-    9.66976464e-01,
-    9.68215883e-01,
-    9.69431996e-01,
-    9.70624685e-01,
-    9.71794009e-01,
-    9.72939968e-01,
-    9.74062443e-01,
-    9.75161433e-01,
-    9.76236939e-01,
-    9.77288961e-01,
-    9.78317380e-01,
-    9.79322255e-01,
-    9.80303526e-01,
-    9.81261134e-01,
-    9.82195139e-01,
-    9.83105481e-01,
-    9.83992159e-01,
-    9.84855056e-01,
-    9.85694289e-01,
-    9.86509740e-01,
-    9.87301409e-01,
-    9.88069296e-01,
-    9.88813400e-01,
-    9.89533663e-01,
-    9.90230083e-01,
-    9.90902662e-01,
-    9.91551340e-01,
-    9.92176116e-01,
-    9.92776990e-01,
-    9.93353963e-01,
-    9.93906975e-01,
-    9.94436026e-01,
-    9.94941175e-01,
-    9.95422304e-01,
-    9.95879471e-01,
-    9.96312618e-01,
-    9.96721745e-01,
-    9.97106910e-01,
-    9.97467995e-01,
-    9.97805059e-01,
-    9.98118103e-01,
-    9.98407066e-01,
-    9.98672009e-01,
-    9.98912871e-01,
-    9.99129653e-01,
-    9.99322355e-01,
-    9.99491036e-01,
-    9.99635577e-01,
-    9.99756038e-01,
-    9.99852419e-01,
-    9.99924719e-01,
-    9.99972880e-01,
-    9.99996960e-01
+    2.45436677e-03f,
+    7.36304140e-03f,
+    1.22715384e-02f,
+    1.71797387e-02f,
+    2.20875274e-02f,
+    2.69947816e-02f,
+    3.19013856e-02f,
+    3.68072242e-02f,
+    4.17121723e-02f,
+    4.66161147e-02f,
+    5.15189357e-02f,
+    5.64205162e-02f,
+    6.13207370e-02f,
+    6.62194788e-02f,
+    7.11166263e-02f,
+    7.60120600e-02f,
+    8.09056610e-02f,
+    8.57973099e-02f,
+    9.06868950e-02f,
+    9.55742970e-02f,
+    1.00459397e-01f,
+    1.05342068e-01f,
+    1.10222206e-01f,
+    1.15099691e-01f,
+    1.19974397e-01f,
+    1.24846213e-01f,
+    1.29715025e-01f,
+    1.34580702e-01f,
+    1.39443144e-01f,
+    1.44302234e-01f,
+    1.49157837e-01f,
+    1.54009849e-01f,
+    1.58858150e-01f,
+    1.63702607e-01f,
+    1.68543145e-01f,
+    1.73379600e-01f,
+    1.78211898e-01f,
+    1.83039889e-01f,
+    1.87863469e-01f,
+    1.92682534e-01f,
+    1.97496936e-01f,
+    2.02306598e-01f,
+    2.07111374e-01f,
+    2.11911172e-01f,
+    2.16705844e-01f,
+    2.21495315e-01f,
+    2.26279438e-01f,
+    2.31058106e-01f,
+    2.35831216e-01f,
+    2.40598634e-01f,
+    2.45360255e-01f,
+    2.50115961e-01f,
+    2.54865646e-01f,
+    2.59609193e-01f,
+    2.64346480e-01f,
+    2.69077420e-01f,
+    2.73801863e-01f,
+    2.78519690e-01f,
+    2.83230811e-01f,
+    2.87935108e-01f,
+    2.92632490e-01f,
+    2.97322810e-01f,
+    3.02005947e-01f,
+    3.06681812e-01f,
+    3.11350316e-01f,
+    3.16011280e-01f,
+    3.20664644e-01f,
+    3.25310290e-01f,
+    3.29948097e-01f,
+    3.34577948e-01f,
+    3.39199722e-01f,
+    3.43813360e-01f,
+    3.48418683e-01f,
+    3.53015602e-01f,
+    3.57604057e-01f,
+    3.62183869e-01f,
+    3.66754949e-01f,
+    3.71317208e-01f,
+    3.75870496e-01f,
+    3.80414754e-01f,
+    3.84949833e-01f,
+    3.89475614e-01f,
+    3.93992037e-01f,
+    3.98498952e-01f,
+    4.02996302e-01f,
+    4.07483906e-01f,
+    4.11961704e-01f,
+    4.16429549e-01f,
+    4.20887381e-01f,
+    4.25335079e-01f,
+    4.29772526e-01f,
+    4.34199601e-01f,
+    4.38616246e-01f,
+    4.43022281e-01f,
+    4.47417676e-01f,
+    4.51802284e-01f,
+    4.56175983e-01f,
+    4.60538715e-01f,
+    4.64890331e-01f,
+    4.69230771e-01f,
+    4.73559886e-01f,
+    4.77877587e-01f,
+    4.82183784e-01f,
+    4.86478359e-01f,
+    4.90761191e-01f,
+    4.95032221e-01f,
+    4.99291331e-01f,
+    5.03538370e-01f,
+    5.07773340e-01f,
+    5.11996031e-01f,
+    5.16206384e-01f,
+    5.20404279e-01f,
+    5.24589658e-01f,
+    5.28762400e-01f,
+    5.32922447e-01f,
+    5.37069619e-01f,
+    5.41203797e-01f,
+    5.45324981e-01f,
+    5.49433053e-01f,
+    5.53527832e-01f,
+    5.57609320e-01f,
+    5.61677337e-01f,
+    5.65731823e-01f,
+    5.69772661e-01f,
+    5.73799789e-01f,
+    5.77813089e-01f,
+    5.81812501e-01f,
+    5.85797846e-01f,
+    5.89769125e-01f,
+    5.93726158e-01f,
+    5.97668886e-01f,
+    6.01597190e-01f,
+    6.05511069e-01f,
+    6.09410286e-01f,
+    6.13294840e-01f,
+    6.17164612e-01f,
+    6.21019542e-01f,
+    6.24859512e-01f,
+    6.28684402e-01f,
+    6.32494152e-01f,
+    6.36288643e-01f,
+    6.40067816e-01f,
+    6.43831551e-01f,
+    6.47579789e-01f,
+    6.51312411e-01f,
+    6.55029356e-01f,
+    6.58730507e-01f,
+    6.62415802e-01f,
+    6.66085124e-01f,
+    6.69738352e-01f,
+    6.73375487e-01f,
+    6.76996410e-01f,
+    6.80601001e-01f,
+    6.84189200e-01f,
+    6.87760890e-01f,
+    6.91316009e-01f,
+    6.94854498e-01f,
+    6.98376238e-01f,
+    7.01881170e-01f,
+    7.05369174e-01f,
+    7.08840132e-01f,
+    7.12294042e-01f,
+    7.15730846e-01f,
+    7.19150364e-01f,
+    7.22552538e-01f,
+    7.25937307e-01f,
+    7.29304552e-01f,
+    7.32654274e-01f,
+    7.35986352e-01f,
+    7.39300668e-01f,
+    7.42597163e-01f,
+    7.45875776e-01f,
+    7.49136388e-01f,
+    7.52379000e-01f,
+    7.55603433e-01f,
+    7.58809686e-01f,
+    7.61997640e-01f,
+    7.65167236e-01f,
+    7.68318415e-01f,
+    7.71451116e-01f,
+    7.74565160e-01f,
+    7.77660549e-01f,
+    7.80737221e-01f,
+    7.83795059e-01f,
+    7.86834061e-01f,
+    7.89854050e-01f,
+    7.92855024e-01f,
+    7.95836926e-01f,
+    7.98799574e-01f,
+    8.01743031e-01f,
+    8.04667175e-01f,
+    8.07571888e-01f,
+    8.10457170e-01f,
+    8.13322961e-01f,
+    8.16169083e-01f,
+    8.18995595e-01f,
+    8.21802378e-01f,
+    8.24589312e-01f,
+    8.27356398e-01f,
+    8.30103517e-01f,
+    8.32830667e-01f,
+    8.35537732e-01f,
+    8.38224709e-01f,
+    8.40891480e-01f,
+    8.43537927e-01f,
+    8.46164107e-01f,
+    8.48769844e-01f,
+    8.51355195e-01f,
+    8.53919983e-01f,
+    8.56464207e-01f,
+    8.58987808e-01f,
+    8.61490726e-01f,
+    8.63972843e-01f,
+    8.66434157e-01f,
+    8.68874609e-01f,
+    8.71294141e-01f,
+    8.73692632e-01f,
+    8.76070082e-01f,
+    8.78426433e-01f,
+    8.80761623e-01f,
+    8.83075595e-01f,
+    8.85368288e-01f,
+    8.87639642e-01f,
+    8.89889598e-01f,
+    8.92118096e-01f,
+    8.94325137e-01f,
+    8.96510601e-01f,
+    8.98674488e-01f,
+    9.00816679e-01f,
+    9.02937174e-01f,
+    9.05035973e-01f,
+    9.07112896e-01f,
+    9.09168005e-01f,
+    9.11201179e-01f,
+    9.13212419e-01f,
+    9.15201604e-01f,
+    9.17168796e-01f,
+    9.19113874e-01f,
+    9.21036780e-01f,
+    9.22937512e-01f,
+    9.24816012e-01f,
+    9.26672220e-01f,
+    9.28506076e-01f,
+    9.30317581e-01f,
+    9.32106674e-01f,
+    9.33873296e-01f,
+    9.35617447e-01f,
+    9.37339008e-01f,
+    9.39037979e-01f,
+    9.40714359e-01f,
+    9.42368090e-01f,
+    9.43999052e-01f,
+    9.45607305e-01f,
+    9.47192788e-01f,
+    9.48755443e-01f,
+    9.50295210e-01f,
+    9.51812088e-01f,
+    9.53306019e-01f,
+    9.54777002e-01f,
+    9.56224978e-01f,
+    9.57649946e-01f,
+    9.59051788e-01f,
+    9.60430503e-01f,
+    9.61786151e-01f,
+    9.63118553e-01f,
+    9.64427769e-01f,
+    9.65713739e-01f,
+    9.66976464e-01f,
+    9.68215883e-01f,
+    9.69431996e-01f,
+    9.70624685e-01f,
+    9.71794009e-01f,
+    9.72939968e-01f,
+    9.74062443e-01f,
+    9.75161433e-01f,
+    9.76236939e-01f,
+    9.77288961e-01f,
+    9.78317380e-01f,
+    9.79322255e-01f,
+    9.80303526e-01f,
+    9.81261134e-01f,
+    9.82195139e-01f,
+    9.83105481e-01f,
+    9.83992159e-01f,
+    9.84855056e-01f,
+    9.85694289e-01f,
+    9.86509740e-01f,
+    9.87301409e-01f,
+    9.88069296e-01f,
+    9.88813400e-01f,
+    9.89533663e-01f,
+    9.90230083e-01f,
+    9.90902662e-01f,
+    9.91551340e-01f,
+    9.92176116e-01f,
+    9.92776990e-01f,
+    9.93353963e-01f,
+    9.93906975e-01f,
+    9.94436026e-01f,
+    9.94941175e-01f,
+    9.95422304e-01f,
+    9.95879471e-01f,
+    9.96312618e-01f,
+    9.96721745e-01f,
+    9.97106910e-01f,
+    9.97467995e-01f,
+    9.97805059e-01f,
+    9.98118103e-01f,
+    9.98407066e-01f,
+    9.98672009e-01f,
+    9.98912871e-01f,
+    9.99129653e-01f,
+    9.99322355e-01f,
+    9.99491036e-01f,
+    9.99635577e-01f,
+    9.99756038e-01f,
+    9.99852419e-01f,
+    9.99924719e-01f,
+    9.99972880e-01f,
+    9.99996960e-01f
 };
 
 const float max_samples_to_rmlt_window[MAX_DCT_LENGTH] =
 {
-    1.22718432e-03,
-    3.68154561e-03,
-    6.13588467e-03,
-    8.59018695e-03,
-    1.10444371e-02,
-    1.34986211e-02,
-    1.59527231e-02,
-    1.84067301e-02,
-    2.08606254e-02,
-    2.33143959e-02,
-    2.57680248e-02,
-    2.82214992e-02,
-    3.06748040e-02,
-    3.31279226e-02,
-    3.55808437e-02,
-    3.80335487e-02,
-    4.04860228e-02,
-    4.29382585e-02,
-    4.53902297e-02,
-    4.78419326e-02,
-    5.02933450e-02,
-    5.27444519e-02,
-    5.51952459e-02,
-    5.76457046e-02,
-    6.00958169e-02,
-    6.25455678e-02,
-    6.49949387e-02,
-    6.74439222e-02,
-    6.98924959e-02,
-    7.23406523e-02,
-    7.47883692e-02,
-    7.72356316e-02,
-    7.96824396e-02,
-    8.21287632e-02,
-    8.45745876e-02,
-    8.70199054e-02,
-    8.94647017e-02,
-    9.19089541e-02,
-    9.43526551e-02,
-    9.67957899e-02,
-    9.92383435e-02,
-    1.01680294e-01,
-    1.04121633e-01,
-    1.06562346e-01,
-    1.09002419e-01,
-    1.11441828e-01,
-    1.13880575e-01,
-    1.16318628e-01,
-    1.18755989e-01,
-    1.21192627e-01,
-    1.23628542e-01,
-    1.26063704e-01,
-    1.28498107e-01,
-    1.30931750e-01,
-    1.33364588e-01,
-    1.35796621e-01,
-    1.38227850e-01,
-    1.40658244e-01,
-    1.43087775e-01,
-    1.45516455e-01,
-    1.47944272e-01,
-    1.50371179e-01,
-    1.52797192e-01,
-    1.55222267e-01,
-    1.57646418e-01,
-    1.60069630e-01,
-    1.62491858e-01,
-    1.64913118e-01,
-    1.67333379e-01,
-    1.69752643e-01,
-    1.72170877e-01,
-    1.74588069e-01,
-    1.77004218e-01,
-    1.79419294e-01,
-    1.81833297e-01,
-    1.84246197e-01,
-    1.86657995e-01,
-    1.89068660e-01,
-    1.91478193e-01,
-    1.93886578e-01,
-    1.96293786e-01,
-    1.98699802e-01,
-    2.01104641e-01,
-    2.03508258e-01,
-    2.05910638e-01,
-    2.08311796e-01,
-    2.10711688e-01,
-    2.13110313e-01,
-    2.15507656e-01,
-    2.17903703e-01,
-    2.20298439e-01,
-    2.22691849e-01,
-    2.25083917e-01,
-    2.27474615e-01,
-    2.29863957e-01,
-    2.32251912e-01,
-    2.34638467e-01,
-    2.37023607e-01,
-    2.39407316e-01,
-    2.41789594e-01,
-    2.44170398e-01,
-    2.46549740e-01,
-    2.48927608e-01,
-    2.51303971e-01,
-    2.53678799e-01,
-    2.56052136e-01,
-    2.58423895e-01,
-    2.60794103e-01,
-    2.63162762e-01,
-    2.65529811e-01,
-    2.67895281e-01,
-    2.70259142e-01,
-    2.72621363e-01,
-    2.74981946e-01,
-    2.77340859e-01,
-    2.79698104e-01,
-    2.82053679e-01,
-    2.84407526e-01,
-    2.86759704e-01,
-    2.89110124e-01,
-    2.91458815e-01,
-    2.93805718e-01,
-    2.96150893e-01,
-    2.98494250e-01,
-    3.00835848e-01,
-    3.03175598e-01,
-    3.05513531e-01,
-    3.07849646e-01,
-    3.10183883e-01,
-    3.12516272e-01,
-    3.14846754e-01,
-    3.17175359e-01,
-    3.19502026e-01,
-    3.21826786e-01,
-    3.24149609e-01,
-    3.26470494e-01,
-    3.28789383e-01,
-    3.31106305e-01,
-    3.33421230e-01,
-    3.35734159e-01,
-    3.38045061e-01,
-    3.40353906e-01,
-    3.42660725e-01,
-    3.44965458e-01,
-    3.47268134e-01,
-    3.49568695e-01,
-    3.51867169e-01,
-    3.54163527e-01,
-    3.56457740e-01,
-    3.58749807e-01,
-    3.61039728e-01,
-    3.63327444e-01,
-    3.65612984e-01,
-    3.67896348e-01,
-    3.70177478e-01,
-    3.72456372e-01,
-    3.74733001e-01,
-    3.77007425e-01,
-    3.79279524e-01,
-    3.81549388e-01,
-    3.83816928e-01,
-    3.86082143e-01,
-    3.88345033e-01,
-    3.90605599e-01,
-    3.92863810e-01,
-    3.95119667e-01,
-    3.97373140e-01,
-    3.99624199e-01,
-    4.01872873e-01,
-    4.04119104e-01,
-    4.06362921e-01,
-    4.08604264e-01,
-    4.10843164e-01,
-    4.13079590e-01,
-    4.15313542e-01,
-    4.17544961e-01,
-    4.19773877e-01,
-    4.22000259e-01,
-    4.24224108e-01,
-    4.26445425e-01,
-    4.28664148e-01,
-    4.30880278e-01,
-    4.33093816e-01,
-    4.35304761e-01,
-    4.37513083e-01,
-    4.39718753e-01,
-    4.41921771e-01,
-    4.44122136e-01,
-    4.46319848e-01,
-    4.48514849e-01,
-    4.50707138e-01,
-    4.52896714e-01,
-    4.55083579e-01,
-    4.57267702e-01,
-    4.59449053e-01,
-    4.61627662e-01,
-    4.63803470e-01,
-    4.65976506e-01,
-    4.68146712e-01,
-    4.70314115e-01,
-    4.72478658e-01,
-    4.74640369e-01,
-    4.76799220e-01,
-    4.78955209e-01,
-    4.81108308e-01,
-    4.83258516e-01,
-    4.85405803e-01,
-    4.87550169e-01,
-    4.89691585e-01,
-    4.91830051e-01,
-    4.93965566e-01,
-    4.96098131e-01,
-    4.98227656e-01,
-    5.00354230e-01,
-    5.02477765e-01,
-    5.04598260e-01,
-    5.06715715e-01,
-    5.08830130e-01,
-    5.10941505e-01,
-    5.13049781e-01,
-    5.15154958e-01,
-    5.17257035e-01,
-    5.19356012e-01,
-    5.21451831e-01,
-    5.23544490e-01,
-    5.25634050e-01,
-    5.27720451e-01,
-    5.29803634e-01,
-    5.31883657e-01,
-    5.33960402e-01,
-    5.36033988e-01,
-    5.38104355e-01,
-    5.40171444e-01,
-    5.42235315e-01,
-    5.44295907e-01,
-    5.46353221e-01,
-    5.48407257e-01,
-    5.50457954e-01,
-    5.52505374e-01,
-    5.54549456e-01,
-    5.56590199e-01,
-    5.58627546e-01,
-    5.60661554e-01,
-    5.62692225e-01,
-    5.64719439e-01,
-    5.66743314e-01,
-    5.68763733e-01,
-    5.70780754e-01,
-    5.72794318e-01,
-    5.74804425e-01,
-    5.76811075e-01,
-    5.78814268e-01,
-    5.80813944e-01,
-    5.82810163e-01,
-    5.84802806e-01,
-    5.86791992e-01,
-    5.88777602e-01,
-    5.90759695e-01,
-    5.92738211e-01,
-    5.94713151e-01,
-    5.96684515e-01,
-    5.98652303e-01,
-    6.00616455e-01,
-    6.02577031e-01,
-    6.04533970e-01,
-    6.06487215e-01,
-    6.08436823e-01,
-    6.10382795e-01,
-    6.12325072e-01,
-    6.14263654e-01,
-    6.16198599e-01,
-    6.18129730e-01,
-    6.20057225e-01,
-    6.21980906e-01,
-    6.23900890e-01,
-    6.25817120e-01,
-    6.27729595e-01,
-    6.29638255e-01,
-    6.31543100e-01,
-    6.33444190e-01,
-    6.35341406e-01,
-    6.37234867e-01,
-    6.39124453e-01,
-    6.41010165e-01,
-    6.42892063e-01,
-    6.44770086e-01,
-    6.46644175e-01,
-    6.48514390e-01,
-    6.50380731e-01,
-    6.52243137e-01,
-    6.54101610e-01,
-    6.55956089e-01,
-    6.57806695e-01,
-    6.59653306e-01,
-    6.61495924e-01,
-    6.63334608e-01,
-    6.65169239e-01,
-    6.66999936e-01,
-    6.68826580e-01,
-    6.70649171e-01,
-    6.72467709e-01,
-    6.74282253e-01,
-    6.76092684e-01,
-    6.77899063e-01,
-    6.79701388e-01,
-    6.81499600e-01,
-    6.83293700e-01,
-    6.85083687e-01,
-    6.86869502e-01,
-    6.88651264e-01,
-    6.90428793e-01,
-    6.92202210e-01,
-    6.93971455e-01,
-    6.95736527e-01,
-    6.97497368e-01,
-    6.99254036e-01,
-    7.01006532e-01,
-    7.02754736e-01,
-    7.04498768e-01,
-    7.06238508e-01,
-    7.07974017e-01,
-    7.09705234e-01,
-    7.11432219e-01,
-    7.13154852e-01,
-    7.14873254e-01,
-    7.16587305e-01,
-    7.18297064e-01,
-    7.20002532e-01,
-    7.21703589e-01,
-    7.23400354e-01,
-    7.25092709e-01,
-    7.26780772e-01,
-    7.28464365e-01,
-    7.30143666e-01,
-    7.31818497e-01,
-    7.33488917e-01,
-    7.35154986e-01,
-    7.36816585e-01,
-    7.38473713e-01,
-    7.40126431e-01,
-    7.41774678e-01,
-    7.43418455e-01,
-    7.45057762e-01,
-    7.46692598e-01,
-    7.48322904e-01,
-    7.49948740e-01,
-    7.51570046e-01,
-    7.53186822e-01,
-    7.54799008e-01,
-    7.56406724e-01,
-    7.58009851e-01,
-    7.59608388e-01,
-    7.61202395e-01,
-    7.62791812e-01,
-    7.64376581e-01,
-    7.65956819e-01,
-    7.67532349e-01,
-    7.69103348e-01,
-    7.70669639e-01,
-    7.72231340e-01,
-    7.73788393e-01,
-    7.75340736e-01,
-    7.76888490e-01,
-    7.78431475e-01,
-    7.79969811e-01,
-    7.81503439e-01,
-    7.83032358e-01,
-    7.84556568e-01,
-    7.86076069e-01,
-    7.87590802e-01,
-    7.89100826e-01,
-    7.90606081e-01,
-    7.92106569e-01,
-    7.93602288e-01,
-    7.95093238e-01,
-    7.96579361e-01,
-    7.98060715e-01,
-    7.99537241e-01,
-    8.01008999e-01,
-    8.02475870e-01,
-    8.03937972e-01,
-    8.05395186e-01,
-    8.06847572e-01,
-    8.08295071e-01,
-    8.09737682e-01,
-    8.11175466e-01,
-    8.12608361e-01,
-    8.14036310e-01,
-    8.15459430e-01,
-    8.16877604e-01,
-    8.18290830e-01,
-    8.19699109e-01,
-    8.21102500e-01,
-    8.22500944e-01,
-    8.23894441e-01,
-    8.25282931e-01,
-    8.26666474e-01,
-    8.28045070e-01,
-    8.29418600e-01,
-    8.30787182e-01,
-    8.32150757e-01,
-    8.33509326e-01,
-    8.34862888e-01,
-    8.36211383e-01,
-    8.37554872e-01,
-    8.38893294e-01,
-    8.40226650e-01,
-    8.41554999e-01,
-    8.42878222e-01,
-    8.44196379e-01,
-    8.45509470e-01,
-    8.46817434e-01,
-    8.48120332e-01,
-    8.49418104e-01,
-    8.50710809e-01,
-    8.51998329e-01,
-    8.53280723e-01,
-    8.54557991e-01,
-    8.55830133e-01,
-    8.57097089e-01,
-    8.58358860e-01,
-    8.59615505e-01,
-    8.60866964e-01,
-    8.62113178e-01,
-    8.63354266e-01,
-    8.64590168e-01,
-    8.65820825e-01,
-    8.67046237e-01,
-    8.68266463e-01,
-    8.69481444e-01,
-    8.70691240e-01,
-    8.71895730e-01,
-    8.73094976e-01,
-    8.74288976e-01,
-    8.75477731e-01,
-    8.76661181e-01,
-    8.77839327e-01,
-    8.79012227e-01,
-    8.80179822e-01,
-    8.81342113e-01,
-    8.82499099e-01,
-    8.83650780e-01,
-    8.84797096e-01,
-    8.85938108e-01,
-    8.87073815e-01,
-    8.88204098e-01,
-    8.89329076e-01,
-    8.90448749e-01,
-    8.91562998e-01,
-    8.92671883e-01,
-    8.93775403e-01,
-    8.94873500e-01,
-    8.95966232e-01,
-    8.97053599e-01,
-    8.98135543e-01,
-    8.99212062e-01,
-    9.00283158e-01,
-    9.01348829e-01,
-    9.02409077e-01,
-    9.03463900e-01,
-    9.04513299e-01,
-    9.05557215e-01,
-    9.06595707e-01,
-    9.07628715e-01,
-    9.08656240e-01,
-    9.09678340e-01,
-    9.10694897e-01,
-    9.11706030e-01,
-    9.12711620e-01,
-    9.13711786e-01,
-    9.14706349e-01,
-    9.15695488e-01,
-    9.16679084e-01,
-    9.17657137e-01,
-    9.18629646e-01,
-    9.19596672e-01,
-    9.20558095e-01,
-    9.21514034e-01,
-    9.22464430e-01,
-    9.23409224e-01,
-    9.24348474e-01,
-    9.25282121e-01,
-    9.26210225e-01,
-    9.27132785e-01,
-    9.28049684e-01,
-    9.28961039e-01,
-    9.29866791e-01,
-    9.30766940e-01,
-    9.31661487e-01,
-    9.32550430e-01,
-    9.33433771e-01,
-    9.34311450e-01,
-    9.35183525e-01,
-    9.36049938e-01,
-    9.36910748e-01,
-    9.37765896e-01,
-    9.38615382e-01,
-    9.39459205e-01,
-    9.40297425e-01,
-    9.41129923e-01,
-    9.41956758e-01,
-    9.42777932e-01,
-    9.43593442e-01,
-    9.44403291e-01,
-    9.45207417e-01,
-    9.46005821e-01,
-    9.46798563e-01,
-    9.47585583e-01,
-    9.48366940e-01,
-    9.49142516e-01,
-    9.49912429e-01,
-    9.50676560e-01,
-    9.51435030e-01,
-    9.52187717e-01,
-    9.52934682e-01,
-    9.53675926e-01,
-    9.54411447e-01,
-    9.55141187e-01,
-    9.55865145e-01,
-    9.56583381e-01,
-    9.57295835e-01,
-    9.58002567e-01,
-    9.58703458e-01,
-    9.59398627e-01,
-    9.60088015e-01,
-    9.60771620e-01,
-    9.61449385e-01,
-    9.62121427e-01,
-    9.62787628e-01,
-    9.63448048e-01,
-    9.64102626e-01,
-    9.64751422e-01,
-    9.65394437e-01,
-    9.66031611e-01,
-    9.66663003e-01,
-    9.67288494e-01,
-    9.67908204e-01,
-    9.68522072e-01,
-    9.69130158e-01,
-    9.69732344e-01,
-    9.70328689e-01,
-    9.70919251e-01,
-    9.71503913e-01,
-    9.72082734e-01,
-    9.72655654e-01,
-    9.73222792e-01,
-    9.73784029e-01,
-    9.74339366e-01,
-    9.74888861e-01,
-    9.75432515e-01,
-    9.75970268e-01,
-    9.76502120e-01,
-    9.77028131e-01,
-    9.77548242e-01,
-    9.78062451e-01,
-    9.78570819e-01,
-    9.79073226e-01,
-    9.79569793e-01,
-    9.80060399e-01,
-    9.80545104e-01,
-    9.81023967e-01,
-    9.81496871e-01,
-    9.81963873e-01,
-    9.82424974e-01,
-    9.82880116e-01,
-    9.83329356e-01,
-    9.83772695e-01,
-    9.84210074e-01,
-    9.84641552e-01,
-    9.85067070e-01,
-    9.85486686e-01,
-    9.85900342e-01,
-    9.86308098e-01,
-    9.86709893e-01,
-    9.87105727e-01,
-    9.87495601e-01,
-    9.87879574e-01,
-    9.88257587e-01,
-    9.88629639e-01,
-    9.88995671e-01,
-    9.89355803e-01,
-    9.89709973e-01,
-    9.90058184e-01,
-    9.90400434e-01,
-    9.90736723e-01,
-    9.91067052e-01,
-    9.91391361e-01,
-    9.91709769e-01,
-    9.92022157e-01,
-    9.92328584e-01,
-    9.92628992e-01,
-    9.92923498e-01,
-    9.93211925e-01,
-    9.93494451e-01,
-    9.93770957e-01,
-    9.94041502e-01,
-    9.94306028e-01,
-    9.94564593e-01,
-    9.94817138e-01,
-    9.95063663e-01,
-    9.95304286e-01,
-    9.95538831e-01,
-    9.95767415e-01,
-    9.95989978e-01,
-    9.96206582e-01,
-    9.96417165e-01,
-    9.96621728e-01,
-    9.96820271e-01,
-    9.97012854e-01,
-    9.97199416e-01,
-    9.97379959e-01,
-    9.97554541e-01,
-    9.97723043e-01,
-    9.97885585e-01,
-    9.98042107e-01,
-    9.98192608e-01,
-    9.98337090e-01,
-    9.98475552e-01,
-    9.98608053e-01,
-    9.98734474e-01,
-    9.98854935e-01,
-    9.98969316e-01,
-    9.99077737e-01,
-    9.99180079e-01,
-    9.99276459e-01,
-    9.99366820e-01,
-    9.99451101e-01,
-    9.99529421e-01,
-    9.99601722e-01,
-    9.99667943e-01,
-    9.99728203e-01,
-    9.99782383e-01,
-    9.99830604e-01,
-    9.99872744e-01,
-    9.99908864e-01,
-    9.99939024e-01,
-    9.99963105e-01,
-    9.99981165e-01,
-    9.99993205e-01,
-    9.99999225e-01
+    1.22718432e-03f,
+    3.68154561e-03f,
+    6.13588467e-03f,
+    8.59018695e-03f,
+    1.10444371e-02f,
+    1.34986211e-02f,
+    1.59527231e-02f,
+    1.84067301e-02f,
+    2.08606254e-02f,
+    2.33143959e-02f,
+    2.57680248e-02f,
+    2.82214992e-02f,
+    3.06748040e-02f,
+    3.31279226e-02f,
+    3.55808437e-02f,
+    3.80335487e-02f,
+    4.04860228e-02f,
+    4.29382585e-02f,
+    4.53902297e-02f,
+    4.78419326e-02f,
+    5.02933450e-02f,
+    5.27444519e-02f,
+    5.51952459e-02f,
+    5.76457046e-02f,
+    6.00958169e-02f,
+    6.25455678e-02f,
+    6.49949387e-02f,
+    6.74439222e-02f,
+    6.98924959e-02f,
+    7.23406523e-02f,
+    7.47883692e-02f,
+    7.72356316e-02f,
+    7.96824396e-02f,
+    8.21287632e-02f,
+    8.45745876e-02f,
+    8.70199054e-02f,
+    8.94647017e-02f,
+    9.19089541e-02f,
+    9.43526551e-02f,
+    9.67957899e-02f,
+    9.92383435e-02f,
+    1.01680294e-01f,
+    1.04121633e-01f,
+    1.06562346e-01f,
+    1.09002419e-01f,
+    1.11441828e-01f,
+    1.13880575e-01f,
+    1.16318628e-01f,
+    1.18755989e-01f,
+    1.21192627e-01f,
+    1.23628542e-01f,
+    1.26063704e-01f,
+    1.28498107e-01f,
+    1.30931750e-01f,
+    1.33364588e-01f,
+    1.35796621e-01f,
+    1.38227850e-01f,
+    1.40658244e-01f,
+    1.43087775e-01f,
+    1.45516455e-01f,
+    1.47944272e-01f,
+    1.50371179e-01f,
+    1.52797192e-01f,
+    1.55222267e-01f,
+    1.57646418e-01f,
+    1.60069630e-01f,
+    1.62491858e-01f,
+    1.64913118e-01f,
+    1.67333379e-01f,
+    1.69752643e-01f,
+    1.72170877e-01f,
+    1.74588069e-01f,
+    1.77004218e-01f,
+    1.79419294e-01f,
+    1.81833297e-01f,
+    1.84246197e-01f,
+    1.86657995e-01f,
+    1.89068660e-01f,
+    1.91478193e-01f,
+    1.93886578e-01f,
+    1.96293786e-01f,
+    1.98699802e-01f,
+    2.01104641e-01f,
+    2.03508258e-01f,
+    2.05910638e-01f,
+    2.08311796e-01f,
+    2.10711688e-01f,
+    2.13110313e-01f,
+    2.15507656e-01f,
+    2.17903703e-01f,
+    2.20298439e-01f,
+    2.22691849e-01f,
+    2.25083917e-01f,
+    2.27474615e-01f,
+    2.29863957e-01f,
+    2.32251912e-01f,
+    2.34638467e-01f,
+    2.37023607e-01f,
+    2.39407316e-01f,
+    2.41789594e-01f,
+    2.44170398e-01f,
+    2.46549740e-01f,
+    2.48927608e-01f,
+    2.51303971e-01f,
+    2.53678799e-01f,
+    2.56052136e-01f,
+    2.58423895e-01f,
+    2.60794103e-01f,
+    2.63162762e-01f,
+    2.65529811e-01f,
+    2.67895281e-01f,
+    2.70259142e-01f,
+    2.72621363e-01f,
+    2.74981946e-01f,
+    2.77340859e-01f,
+    2.79698104e-01f,
+    2.82053679e-01f,
+    2.84407526e-01f,
+    2.86759704e-01f,
+    2.89110124e-01f,
+    2.91458815e-01f,
+    2.93805718e-01f,
+    2.96150893e-01f,
+    2.98494250e-01f,
+    3.00835848e-01f,
+    3.03175598e-01f,
+    3.05513531e-01f,
+    3.07849646e-01f,
+    3.10183883e-01f,
+    3.12516272e-01f,
+    3.14846754e-01f,
+    3.17175359e-01f,
+    3.19502026e-01f,
+    3.21826786e-01f,
+    3.24149609e-01f,
+    3.26470494e-01f,
+    3.28789383e-01f,
+    3.31106305e-01f,
+    3.33421230e-01f,
+    3.35734159e-01f,
+    3.38045061e-01f,
+    3.40353906e-01f,
+    3.42660725e-01f,
+    3.44965458e-01f,
+    3.47268134e-01f,
+    3.49568695e-01f,
+    3.51867169e-01f,
+    3.54163527e-01f,
+    3.56457740e-01f,
+    3.58749807e-01f,
+    3.61039728e-01f,
+    3.63327444e-01f,
+    3.65612984e-01f,
+    3.67896348e-01f,
+    3.70177478e-01f,
+    3.72456372e-01f,
+    3.74733001e-01f,
+    3.77007425e-01f,
+    3.79279524e-01f,
+    3.81549388e-01f,
+    3.83816928e-01f,
+    3.86082143e-01f,
+    3.88345033e-01f,
+    3.90605599e-01f,
+    3.92863810e-01f,
+    3.95119667e-01f,
+    3.97373140e-01f,
+    3.99624199e-01f,
+    4.01872873e-01f,
+    4.04119104e-01f,
+    4.06362921e-01f,
+    4.08604264e-01f,
+    4.10843164e-01f,
+    4.13079590e-01f,
+    4.15313542e-01f,
+    4.17544961e-01f,
+    4.19773877e-01f,
+    4.22000259e-01f,
+    4.24224108e-01f,
+    4.26445425e-01f,
+    4.28664148e-01f,
+    4.30880278e-01f,
+    4.33093816e-01f,
+    4.35304761e-01f,
+    4.37513083e-01f,
+    4.39718753e-01f,
+    4.41921771e-01f,
+    4.44122136e-01f,
+    4.46319848e-01f,
+    4.48514849e-01f,
+    4.50707138e-01f,
+    4.52896714e-01f,
+    4.55083579e-01f,
+    4.57267702e-01f,
+    4.59449053e-01f,
+    4.61627662e-01f,
+    4.63803470e-01f,
+    4.65976506e-01f,
+    4.68146712e-01f,
+    4.70314115e-01f,
+    4.72478658e-01f,
+    4.74640369e-01f,
+    4.76799220e-01f,
+    4.78955209e-01f,
+    4.81108308e-01f,
+    4.83258516e-01f,
+    4.85405803e-01f,
+    4.87550169e-01f,
+    4.89691585e-01f,
+    4.91830051e-01f,
+    4.93965566e-01f,
+    4.96098131e-01f,
+    4.98227656e-01f,
+    5.00354230e-01f,
+    5.02477765e-01f,
+    5.04598260e-01f,
+    5.06715715e-01f,
+    5.08830130e-01f,
+    5.10941505e-01f,
+    5.13049781e-01f,
+    5.15154958e-01f,
+    5.17257035e-01f,
+    5.19356012e-01f,
+    5.21451831e-01f,
+    5.23544490e-01f,
+    5.25634050e-01f,
+    5.27720451e-01f,
+    5.29803634e-01f,
+    5.31883657e-01f,
+    5.33960402e-01f,
+    5.36033988e-01f,
+    5.38104355e-01f,
+    5.40171444e-01f,
+    5.42235315e-01f,
+    5.44295907e-01f,
+    5.46353221e-01f,
+    5.48407257e-01f,
+    5.50457954e-01f,
+    5.52505374e-01f,
+    5.54549456e-01f,
+    5.56590199e-01f,
+    5.58627546e-01f,
+    5.60661554e-01f,
+    5.62692225e-01f,
+    5.64719439e-01f,
+    5.66743314e-01f,
+    5.68763733e-01f,
+    5.70780754e-01f,
+    5.72794318e-01f,
+    5.74804425e-01f,
+    5.76811075e-01f,
+    5.78814268e-01f,
+    5.80813944e-01f,
+    5.82810163e-01f,
+    5.84802806e-01f,
+    5.86791992e-01f,
+    5.88777602e-01f,
+    5.90759695e-01f,
+    5.92738211e-01f,
+    5.94713151e-01f,
+    5.96684515e-01f,
+    5.98652303e-01f,
+    6.00616455e-01f,
+    6.02577031e-01f,
+    6.04533970e-01f,
+    6.06487215e-01f,
+    6.08436823e-01f,
+    6.10382795e-01f,
+    6.12325072e-01f,
+    6.14263654e-01f,
+    6.16198599e-01f,
+    6.18129730e-01f,
+    6.20057225e-01f,
+    6.21980906e-01f,
+    6.23900890e-01f,
+    6.25817120e-01f,
+    6.27729595e-01f,
+    6.29638255e-01f,
+    6.31543100e-01f,
+    6.33444190e-01f,
+    6.35341406e-01f,
+    6.37234867e-01f,
+    6.39124453e-01f,
+    6.41010165e-01f,
+    6.42892063e-01f,
+    6.44770086e-01f,
+    6.46644175e-01f,
+    6.48514390e-01f,
+    6.50380731e-01f,
+    6.52243137e-01f,
+    6.54101610e-01f,
+    6.55956089e-01f,
+    6.57806695e-01f,
+    6.59653306e-01f,
+    6.61495924e-01f,
+    6.63334608e-01f,
+    6.65169239e-01f,
+    6.66999936e-01f,
+    6.68826580e-01f,
+    6.70649171e-01f,
+    6.72467709e-01f,
+    6.74282253e-01f,
+    6.76092684e-01f,
+    6.77899063e-01f,
+    6.79701388e-01f,
+    6.81499600e-01f,
+    6.83293700e-01f,
+    6.85083687e-01f,
+    6.86869502e-01f,
+    6.88651264e-01f,
+    6.90428793e-01f,
+    6.92202210e-01f,
+    6.93971455e-01f,
+    6.95736527e-01f,
+    6.97497368e-01f,
+    6.99254036e-01f,
+    7.01006532e-01f,
+    7.02754736e-01f,
+    7.04498768e-01f,
+    7.06238508e-01f,
+    7.07974017e-01f,
+    7.09705234e-01f,
+    7.11432219e-01f,
+    7.13154852e-01f,
+    7.14873254e-01f,
+    7.16587305e-01f,
+    7.18297064e-01f,
+    7.20002532e-01f,
+    7.21703589e-01f,
+    7.23400354e-01f,
+    7.25092709e-01f,
+    7.26780772e-01f,
+    7.28464365e-01f,
+    7.30143666e-01f,
+    7.31818497e-01f,
+    7.33488917e-01f,
+    7.35154986e-01f,
+    7.36816585e-01f,
+    7.38473713e-01f,
+    7.40126431e-01f,
+    7.41774678e-01f,
+    7.43418455e-01f,
+    7.45057762e-01f,
+    7.46692598e-01f,
+    7.48322904e-01f,
+    7.49948740e-01f,
+    7.51570046e-01f,
+    7.53186822e-01f,
+    7.54799008e-01f,
+    7.56406724e-01f,
+    7.58009851e-01f,
+    7.59608388e-01f,
+    7.61202395e-01f,
+    7.62791812e-01f,
+    7.64376581e-01f,
+    7.65956819e-01f,
+    7.67532349e-01f,
+    7.69103348e-01f,
+    7.70669639e-01f,
+    7.72231340e-01f,
+    7.73788393e-01f,
+    7.75340736e-01f,
+    7.76888490e-01f,
+    7.78431475e-01f,
+    7.79969811e-01f,
+    7.81503439e-01f,
+    7.83032358e-01f,
+    7.84556568e-01f,
+    7.86076069e-01f,
+    7.87590802e-01f,
+    7.89100826e-01f,
+    7.90606081e-01f,
+    7.92106569e-01f,
+    7.93602288e-01f,
+    7.95093238e-01f,
+    7.96579361e-01f,
+    7.98060715e-01f,
+    7.99537241e-01f,
+    8.01008999e-01f,
+    8.02475870e-01f,
+    8.03937972e-01f,
+    8.05395186e-01f,
+    8.06847572e-01f,
+    8.08295071e-01f,
+    8.09737682e-01f,
+    8.11175466e-01f,
+    8.12608361e-01f,
+    8.14036310e-01f,
+    8.15459430e-01f,
+    8.16877604e-01f,
+    8.18290830e-01f,
+    8.19699109e-01f,
+    8.21102500e-01f,
+    8.22500944e-01f,
+    8.23894441e-01f,
+    8.25282931e-01f,
+    8.26666474e-01f,
+    8.28045070e-01f,
+    8.29418600e-01f,
+    8.30787182e-01f,
+    8.32150757e-01f,
+    8.33509326e-01f,
+    8.34862888e-01f,
+    8.36211383e-01f,
+    8.37554872e-01f,
+    8.38893294e-01f,
+    8.40226650e-01f,
+    8.41554999e-01f,
+    8.42878222e-01f,
+    8.44196379e-01f,
+    8.45509470e-01f,
+    8.46817434e-01f,
+    8.48120332e-01f,
+    8.49418104e-01f,
+    8.50710809e-01f,
+    8.51998329e-01f,
+    8.53280723e-01f,
+    8.54557991e-01f,
+    8.55830133e-01f,
+    8.57097089e-01f,
+    8.58358860e-01f,
+    8.59615505e-01f,
+    8.60866964e-01f,
+    8.62113178e-01f,
+    8.63354266e-01f,
+    8.64590168e-01f,
+    8.65820825e-01f,
+    8.67046237e-01f,
+    8.68266463e-01f,
+    8.69481444e-01f,
+    8.70691240e-01f,
+    8.71895730e-01f,
+    8.73094976e-01f,
+    8.74288976e-01f,
+    8.75477731e-01f,
+    8.76661181e-01f,
+    8.77839327e-01f,
+    8.79012227e-01f,
+    8.80179822e-01f,
+    8.81342113e-01f,
+    8.82499099e-01f,
+    8.83650780e-01f,
+    8.84797096e-01f,
+    8.85938108e-01f,
+    8.87073815e-01f,
+    8.88204098e-01f,
+    8.89329076e-01f,
+    8.90448749e-01f,
+    8.91562998e-01f,
+    8.92671883e-01f,
+    8.93775403e-01f,
+    8.94873500e-01f,
+    8.95966232e-01f,
+    8.97053599e-01f,
+    8.98135543e-01f,
+    8.99212062e-01f,
+    9.00283158e-01f,
+    9.01348829e-01f,
+    9.02409077e-01f,
+    9.03463900e-01f,
+    9.04513299e-01f,
+    9.05557215e-01f,
+    9.06595707e-01f,
+    9.07628715e-01f,
+    9.08656240e-01f,
+    9.09678340e-01f,
+    9.10694897e-01f,
+    9.11706030e-01f,
+    9.12711620e-01f,
+    9.13711786e-01f,
+    9.14706349e-01f,
+    9.15695488e-01f,
+    9.16679084e-01f,
+    9.17657137e-01f,
+    9.18629646e-01f,
+    9.19596672e-01f,
+    9.20558095e-01f,
+    9.21514034e-01f,
+    9.22464430e-01f,
+    9.23409224e-01f,
+    9.24348474e-01f,
+    9.25282121e-01f,
+    9.26210225e-01f,
+    9.27132785e-01f,
+    9.28049684e-01f,
+    9.28961039e-01f,
+    9.29866791e-01f,
+    9.30766940e-01f,
+    9.31661487e-01f,
+    9.32550430e-01f,
+    9.33433771e-01f,
+    9.34311450e-01f,
+    9.35183525e-01f,
+    9.36049938e-01f,
+    9.36910748e-01f,
+    9.37765896e-01f,
+    9.38615382e-01f,
+    9.39459205e-01f,
+    9.40297425e-01f,
+    9.41129923e-01f,
+    9.41956758e-01f,
+    9.42777932e-01f,
+    9.43593442e-01f,
+    9.44403291e-01f,
+    9.45207417e-01f,
+    9.46005821e-01f,
+    9.46798563e-01f,
+    9.47585583e-01f,
+    9.48366940e-01f,
+    9.49142516e-01f,
+    9.49912429e-01f,
+    9.50676560e-01f,
+    9.51435030e-01f,
+    9.52187717e-01f,
+    9.52934682e-01f,
+    9.53675926e-01f,
+    9.54411447e-01f,
+    9.55141187e-01f,
+    9.55865145e-01f,
+    9.56583381e-01f,
+    9.57295835e-01f,
+    9.58002567e-01f,
+    9.58703458e-01f,
+    9.59398627e-01f,
+    9.60088015e-01f,
+    9.60771620e-01f,
+    9.61449385e-01f,
+    9.62121427e-01f,
+    9.62787628e-01f,
+    9.63448048e-01f,
+    9.64102626e-01f,
+    9.64751422e-01f,
+    9.65394437e-01f,
+    9.66031611e-01f,
+    9.66663003e-01f,
+    9.67288494e-01f,
+    9.67908204e-01f,
+    9.68522072e-01f,
+    9.69130158e-01f,
+    9.69732344e-01f,
+    9.70328689e-01f,
+    9.70919251e-01f,
+    9.71503913e-01f,
+    9.72082734e-01f,
+    9.72655654e-01f,
+    9.73222792e-01f,
+    9.73784029e-01f,
+    9.74339366e-01f,
+    9.74888861e-01f,
+    9.75432515e-01f,
+    9.75970268e-01f,
+    9.76502120e-01f,
+    9.77028131e-01f,
+    9.77548242e-01f,
+    9.78062451e-01f,
+    9.78570819e-01f,
+    9.79073226e-01f,
+    9.79569793e-01f,
+    9.80060399e-01f,
+    9.80545104e-01f,
+    9.81023967e-01f,
+    9.81496871e-01f,
+    9.81963873e-01f,
+    9.82424974e-01f,
+    9.82880116e-01f,
+    9.83329356e-01f,
+    9.83772695e-01f,
+    9.84210074e-01f,
+    9.84641552e-01f,
+    9.85067070e-01f,
+    9.85486686e-01f,
+    9.85900342e-01f,
+    9.86308098e-01f,
+    9.86709893e-01f,
+    9.87105727e-01f,
+    9.87495601e-01f,
+    9.87879574e-01f,
+    9.88257587e-01f,
+    9.88629639e-01f,
+    9.88995671e-01f,
+    9.89355803e-01f,
+    9.89709973e-01f,
+    9.90058184e-01f,
+    9.90400434e-01f,
+    9.90736723e-01f,
+    9.91067052e-01f,
+    9.91391361e-01f,
+    9.91709769e-01f,
+    9.92022157e-01f,
+    9.92328584e-01f,
+    9.92628992e-01f,
+    9.92923498e-01f,
+    9.93211925e-01f,
+    9.93494451e-01f,
+    9.93770957e-01f,
+    9.94041502e-01f,
+    9.94306028e-01f,
+    9.94564593e-01f,
+    9.94817138e-01f,
+    9.95063663e-01f,
+    9.95304286e-01f,
+    9.95538831e-01f,
+    9.95767415e-01f,
+    9.95989978e-01f,
+    9.96206582e-01f,
+    9.96417165e-01f,
+    9.96621728e-01f,
+    9.96820271e-01f,
+    9.97012854e-01f,
+    9.97199416e-01f,
+    9.97379959e-01f,
+    9.97554541e-01f,
+    9.97723043e-01f,
+    9.97885585e-01f,
+    9.98042107e-01f,
+    9.98192608e-01f,
+    9.98337090e-01f,
+    9.98475552e-01f,
+    9.98608053e-01f,
+    9.98734474e-01f,
+    9.98854935e-01f,
+    9.98969316e-01f,
+    9.99077737e-01f,
+    9.99180079e-01f,
+    9.99276459e-01f,
+    9.99366820e-01f,
+    9.99451101e-01f,
+    9.99529421e-01f,
+    9.99601722e-01f,
+    9.99667943e-01f,
+    9.99728203e-01f,
+    9.99782383e-01f,
+    9.99830604e-01f,
+    9.99872744e-01f,
+    9.99908864e-01f,
+    9.99939024e-01f,
+    9.99963105e-01f,
+    9.99981165e-01f,
+    9.99993205e-01f,
+    9.99999225e-01f
 };
 #endif
 /*- End of file ------------------------------------------------------------*/

Modified: freeswitch/branches/gmaruzz/libs/libg722_1/src/tables.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/libg722_1/src/tables.c	(original)
+++ freeswitch/branches/gmaruzz/libs/libg722_1/src/tables.c	Tue Dec 23 07:37:03 2008
@@ -65,70 +65,70 @@
 #else
 const float region_standard_deviation_table[REGION_POWER_TABLE_SIZE] =
 {
-    2.441406247570224e-04,
-    3.452669826719395e-04,
-    4.882812495545411e-04,
-    6.905339654011486e-04,
-    9.765624991900746e-04,
-    1.381067930916839e-03,
-    1.953124998542134e-03,
-    2.762135862062757e-03,
-    3.906249997408239e-03,
-    5.524271724583683e-03,
-    7.812499995464418e-03,
-    1.104854345008369e-02,
-    1.562499999222472e-02,
-    2.209708690200003e-02,
-    3.124999998704119e-02,
-    4.419417380766535e-02,
-    6.249999997926591e-02,
-    8.838834762266132e-02,
-    1.249999999688989e-01,
-    1.767766952599839e-01,
-    2.499999999585318e-01,
-    3.535533905492901e-01,
-    4.999999999585318e-01,
-    7.071067811572251e-01,
-    1.000000000000000e+00,
-    1.414213562431740e+00,
-    2.000000000165873e+00,
-    2.828427125098059e+00,
-    4.000000000663491e+00,
-    5.656854250665278e+00,
-    8.000000001990472e+00,
-    1.131370850226887e+01,
-    1.600000000530792e+01,
-    2.262741700641438e+01,
-    3.200000001326981e+01,
-    4.525483401658204e+01,
-    6.400000003184756e+01,
-    9.050966804067060e+01,
-    1.280000000743110e+02,
-    1.810193360963542e+02,
-    2.560000001698536e+02,
-    3.620386722227349e+02,
-    5.120000003821707e+02,
-    7.240773445055215e+02,
-    1.024000000849268e+03,
-    1.448154689131149e+03,
-    2.048000001868390e+03,
-    2.896309378502505e+03,
-    4.096000004076487e+03,
-    5.792618757485434e+03,
-    8.192000008832390e+03,
-    1.158523751593169e+04,
-    1.638400001902361e+04,
-    2.317047503378509e+04,
-    3.276800004076484e+04,
-    4.634095007141347e+04,
-    6.553600008696507e+04,
-    9.268190015051374e+04,
-    1.310720001848009e+05,
-    1.853638003164007e+05,
-    2.621440003913428e+05,
-    3.707276006635486e+05,
-    5.242880008261676e+05,
-    7.414552013885899e+05
+    2.441406247570224e-04f,
+    3.452669826719395e-04f,
+    4.882812495545411e-04f,
+    6.905339654011486e-04f,
+    9.765624991900746e-04f,
+    1.381067930916839e-03f,
+    1.953124998542134e-03f,
+    2.762135862062757e-03f,
+    3.906249997408239e-03f,
+    5.524271724583683e-03f,
+    7.812499995464418e-03f,
+    1.104854345008369e-02f,
+    1.562499999222472e-02f,
+    2.209708690200003e-02f,
+    3.124999998704119e-02f,
+    4.419417380766535e-02f,
+    6.249999997926591e-02f,
+    8.838834762266132e-02f,
+    1.249999999688989e-01f,
+    1.767766952599839e-01f,
+    2.499999999585318e-01f,
+    3.535533905492901e-01f,
+    4.999999999585318e-01f,
+    7.071067811572251e-01f,
+    1.000000000000000e+00f,
+    1.414213562431740e+00f,
+    2.000000000165873e+00f,
+    2.828427125098059e+00f,
+    4.000000000663491e+00f,
+    5.656854250665278e+00f,
+    8.000000001990472e+00f,
+    1.131370850226887e+01f,
+    1.600000000530792e+01f,
+    2.262741700641438e+01f,
+    3.200000001326981e+01f,
+    4.525483401658204e+01f,
+    6.400000003184756e+01f,
+    9.050966804067060e+01f,
+    1.280000000743110e+02f,
+    1.810193360963542e+02f,
+    2.560000001698536e+02f,
+    3.620386722227349e+02f,
+    5.120000003821707e+02f,
+    7.240773445055215e+02f,
+    1.024000000849268e+03f,
+    1.448154689131149e+03f,
+    2.048000001868390e+03f,
+    2.896309378502505e+03f,
+    4.096000004076487e+03f,
+    5.792618757485434e+03f,
+    8.192000008832390e+03f,
+    1.158523751593169e+04f,
+    1.638400001902361e+04f,
+    2.317047503378509e+04f,
+    3.276800004076484e+04f,
+    4.634095007141347e+04f,
+    6.553600008696507e+04f,
+    9.268190015051374e+04f,
+    1.310720001848009e+05f,
+    1.853638003164007e+05f,
+    2.621440003913428e+05f,
+    3.707276006635486e+05f,
+    5.242880008261676e+05f,
+    7.414552013885899e+05f
 };
 #endif
 
@@ -146,70 +146,70 @@
 #else
 const float standard_deviation_inverse_table[REGION_POWER_TABLE_SIZE] =
 {
-    4.096000004076488e+03,
-    2.896309378502504e+03,
-    2.048000001868390e+03,
-    1.448154689131149e+03,
-    1.024000000849268e+03,
-    7.240773445055215e+02,
-    5.120000003821708e+02,
-    3.620386722227349e+02,
-    2.560000001698537e+02,
-    1.810193360963542e+02,
-    1.280000000743110e+02,
-    9.050966804067060e+01,
-    6.400000003184756e+01,
-    4.525483401658203e+01,
-    3.200000001326982e+01,
-    2.262741700641438e+01,
-    1.600000000530793e+01,
-    1.131370850226887e+01,
-    8.000000001990474e+00,
-    5.656854250665277e+00,
-    4.000000000663491e+00,
-    2.828427125098059e+00,
-    2.000000000165873e+00,
-    1.414213562431740e+00,
-    1.000000000000000e+00,
-    7.071067811572251e-01,
-    4.999999999585318e-01,
-    3.535533905492901e-01,
-    2.499999999585318e-01,
-    1.767766952599838e-01,
-    1.249999999688989e-01,
-    8.838834762266132e-02,
-    6.249999997926592e-02,
-    4.419417380766535e-02,
-    3.124999998704120e-02,
-    2.209708690200002e-02,
-    1.562499999222472e-02,
-    1.104854345008369e-02,
-    7.812499995464418e-03,
-    5.524271724583683e-03,
-    3.906249997408239e-03,
-    2.762135862062757e-03,
-    1.953124998542134e-03,
-    1.381067930916839e-03,
-    9.765624991900747e-04,
-    6.905339654011486e-04,
-    4.882812495545411e-04,
-    3.452669826719394e-04,
-    2.441406247570224e-04,
-    1.726334913216520e-04,
-    1.220703123683871e-04,
-    8.631674565366727e-05,
-    6.103515617913153e-05,
-    4.315837282325419e-05,
-    3.051757808703478e-05,
-    2.157918640983742e-05,
-    1.525878904225187e-05,
-    1.078959320402385e-05,
-    7.629394520493171e-06,
-    5.394796601564505e-06,
-    3.814697259930213e-06,
-    2.697398300558537e-06,
-    1.907348629806920e-06,
-    1.348699150167414e-06
+    4.096000004076488e+03f,
+    2.896309378502504e+03f,
+    2.048000001868390e+03f,
+    1.448154689131149e+03f,
+    1.024000000849268e+03f,
+    7.240773445055215e+02f,
+    5.120000003821708e+02f,
+    3.620386722227349e+02f,
+    2.560000001698537e+02f,
+    1.810193360963542e+02f,
+    1.280000000743110e+02f,
+    9.050966804067060e+01f,
+    6.400000003184756e+01f,
+    4.525483401658203e+01f,
+    3.200000001326982e+01f,
+    2.262741700641438e+01f,
+    1.600000000530793e+01f,
+    1.131370850226887e+01f,
+    8.000000001990474e+00f,
+    5.656854250665277e+00f,
+    4.000000000663491e+00f,
+    2.828427125098059e+00f,
+    2.000000000165873e+00f,
+    1.414213562431740e+00f,
+    1.000000000000000e+00f,
+    7.071067811572251e-01f,
+    4.999999999585318e-01f,
+    3.535533905492901e-01f,
+    2.499999999585318e-01f,
+    1.767766952599838e-01f,
+    1.249999999688989e-01f,
+    8.838834762266132e-02f,
+    6.249999997926592e-02f,
+    4.419417380766535e-02f,
+    3.124999998704120e-02f,
+    2.209708690200002e-02f,
+    1.562499999222472e-02f,
+    1.104854345008369e-02f,
+    7.812499995464418e-03f,
+    5.524271724583683e-03f,
+    3.906249997408239e-03f,
+    2.762135862062757e-03f,
+    1.953124998542134e-03f,
+    1.381067930916839e-03f,
+    9.765624991900747e-04f,
+    6.905339654011486e-04f,
+    4.882812495545411e-04f,
+    3.452669826719394e-04f,
+    2.441406247570224e-04f,
+    1.726334913216520e-04f,
+    1.220703123683871e-04f,
+    8.631674565366727e-05f,
+    6.103515617913153e-05f,
+    4.315837282325419e-05f,
+    3.051757808703478e-05f,
+    2.157918640983742e-05f,
+    1.525878904225187e-05f,
+    1.078959320402385e-05f,
+    7.629394520493171e-06f,
+    5.394796601564505e-06f,
+    3.814697259930213e-06f,
+    2.697398300558537e-06f,
+    1.907348629806920e-06f,
+    1.348699150167414e-06f
 };
 #endif
 
@@ -241,14 +241,14 @@
 
 const float step_size_inverse_table[NUM_CATEGORIES] =
 {
-    2.82805443e+00,
-    2.00000000e+00,
-    1.41422713e+00,
-    1.00000000e+00,
-    7.07113564e-01,
-    5.00000000e-01,
-    3.53556782e-01,
-    3.53556782e-01
+    2.82805443e+00f,
+    2.00000000e+00f,
+    1.41422713e+00f,
+    1.00000000e+00f,
+    7.07113564e-01f,
+    5.00000000e-01f,
+    3.53556782e-01f,
+    3.53556782e-01f
 };
 #endif
 
@@ -279,137 +279,137 @@
 #if !defined(G722_1_USE_FIXED_POINT)
 const float region_power_table[REGION_POWER_TABLE_SIZE] =
 {
-    5.96046448e-08,
-    1.19209290e-07,
-    2.38418579e-07,
-    4.76837158e-07,
-    9.53674316e-07,
-    1.90734863e-06,
-    3.81469727e-06,
-    7.62939453e-06,
-    1.52587891e-05,
-    3.05175781e-05,
-    6.10351562e-05,
-    1.22070312e-04,
-    2.44140625e-04,
-    4.88281250e-04,
-    9.76562500e-04,
-    1.95312500e-03,
-    3.90625000e-03,
-    7.81250000e-03,
-    1.56250000e-02,
-    3.12500000e-02,
-    6.25000000e-02,
-    1.25000000e-01,
-    2.50000000e-01,
-    5.00000000e-01,
-    1.00000000e+00,
-    2.00000000e+00,
-    4.00000000e+00,
-    8.00000000e+00,
-    1.60000000e+01,
-    3.20000000e+01,
-    6.40000000e+01,
-    1.28000000e+02,
-    2.56000000e+02,
-    5.12000000e+02,
-    1.02400000e+03,
-    2.04800000e+03,
-    4.09600000e+03,
-    8.19200000e+03,
-    1.63840000e+04,
-    3.27680000e+04,
-    6.55360000e+04,
-    1.31072000e+05,
-    2.62144000e+05,
-    5.24288000e+05,
-    1.04857600e+06,
-    2.09715200e+06,
-    4.19430400e+06,
-    8.38860800e+06,
-    1.67772160e+07,
-    3.35544320e+07,
-    6.71088640e+07,
-    1.34217728e+08,
-    2.68435456e+08,
-    5.36870912e+08,
-    1.07374182e+09,
-    2.14748365e+09,
-    4.29496730e+09,
-    8.58993459e+09,
-    1.71798692e+10,
-    3.43597384e+10,
-    6.87194767e+10,
-    1.37438953e+11,
-    2.74877907e+11,
-    5.49755814e+11
+    5.96046448e-08f,
+    1.19209290e-07f,
+    2.38418579e-07f,
+    4.76837158e-07f,
+    9.53674316e-07f,
+    1.90734863e-06f,
+    3.81469727e-06f,
+    7.62939453e-06f,
+    1.52587891e-05f,
+    3.05175781e-05f,
+    6.10351562e-05f,
+    1.22070312e-04f,
+    2.44140625e-04f,
+    4.88281250e-04f,
+    9.76562500e-04f,
+    1.95312500e-03f,
+    3.90625000e-03f,
+    7.81250000e-03f,
+    1.56250000e-02f,
+    3.12500000e-02f,
+    6.25000000e-02f,
+    1.25000000e-01f,
+    2.50000000e-01f,
+    5.00000000e-01f,
+    1.00000000e+00f,
+    2.00000000e+00f,
+    4.00000000e+00f,
+    8.00000000e+00f,
+    1.60000000e+01f,
+    3.20000000e+01f,
+    6.40000000e+01f,
+    1.28000000e+02f,
+    2.56000000e+02f,
+    5.12000000e+02f,
+    1.02400000e+03f,
+    2.04800000e+03f,
+    4.09600000e+03f,
+    8.19200000e+03f,
+    1.63840000e+04f,
+    3.27680000e+04f,
+    6.55360000e+04f,
+    1.31072000e+05f,
+    2.62144000e+05f,
+    5.24288000e+05f,
+    1.04857600e+06f,
+    2.09715200e+06f,
+    4.19430400e+06f,
+    8.38860800e+06f,
+    1.67772160e+07f,
+    3.35544320e+07f,
+    6.71088640e+07f,
+    1.34217728e+08f,
+    2.68435456e+08f,
+    5.36870912e+08f,
+    1.07374182e+09f,
+    2.14748365e+09f,
+    4.29496730e+09f,
+    8.58993459e+09f,
+    1.71798692e+10f,
+    3.43597384e+10f,
+    6.87194767e+10f,
+    1.37438953e+11f,
+    2.74877907e+11f,
+    5.49755814e+11f
 };
 
 const float region_power_table_boundary[REGION_POWER_TABLE_SIZE - 1] =
 {
-    8.42936956e-08,
-    1.68587391e-07,
-    3.37174782e-07,
-    6.74349565e-07,
-    1.34869913e-06,
-    2.69739826e-06,
-    5.39479652e-06,
-    1.07895930e-05,
-    2.15791861e-05,
-    4.31583721e-05,
-    8.63167443e-05,
-    1.72633489e-04,
-    3.45266977e-04,
-    6.90533954e-04,
-    1.38106791e-03,
-    2.76213582e-03,
-    5.52427163e-03,
-    1.10485433e-02,
-    2.20970865e-02,
-    4.41941731e-02,
-    8.83883461e-02,
-    1.76776692e-01,
-    3.53553385e-01,
-    7.07106769e-01,
-    1.41421354e+00,
-    2.82842708e+00,
-    5.65685415e+00,
-    1.13137083e+01,
-    2.26274166e+01,
-    4.52548332e+01,
-    9.05096664e+01,
-    1.81019333e+02,
-    3.62038666e+02,
-    7.24077332e+02,
-    1.44815466e+03,
-    2.89630933e+03,
-    5.79261865e+03,
-    1.15852373e+04,
-    2.31704746e+04,
-    4.63409492e+04,
-    9.26818984e+04,
-    1.85363797e+05,
-    3.70727594e+05,
-    7.41455188e+05,
-    1.48291038e+06,
-    2.96582075e+06,
-    5.93164150e+06,
-    1.18632830e+07,
-    2.37265660e+07,
-    4.74531320e+07,
-    9.49062640e+07,
-    1.89812528e+08,
-    3.79625056e+08,
-    7.59250112e+08,
-    1.51850022e+09,
-    3.03700045e+09,
-    6.07400090e+09,
-    1.21480018e+10,
-    2.42960036e+10,
-    4.85920072e+10,
-    9.71840143e+10,
-    1.94368029e+11,
-    3.88736057e+11
+    8.42936956e-08f,
+    1.68587391e-07f,
+    3.37174782e-07f,
+    6.74349565e-07f,
+    1.34869913e-06f,
+    2.69739826e-06f,
+    5.39479652e-06f,
+    1.07895930e-05f,
+    2.15791861e-05f,
+    4.31583721e-05f,
+    8.63167443e-05f,
+    1.72633489e-04f,
+    3.45266977e-04f,
+    6.90533954e-04f,
+    1.38106791e-03f,
+    2.76213582e-03f,
+    5.52427163e-03f,
+    1.10485433e-02f,
+    2.20970865e-02f,
+    4.41941731e-02f,
+    8.83883461e-02f,
+    1.76776692e-01f,
+    3.53553385e-01f,
+    7.07106769e-01f,
+    1.41421354e+00f,
+    2.82842708e+00f,
+    5.65685415e+00f,
+    1.13137083e+01f,
+    2.26274166e+01f,
+    4.52548332e+01f,
+    9.05096664e+01f,
+    1.81019333e+02f,
+    3.62038666e+02f,
+    7.24077332e+02f,
+    1.44815466e+03f,
+    2.89630933e+03f,
+    5.79261865e+03f,
+    1.15852373e+04f,
+    2.31704746e+04f,
+    4.63409492e+04f,
+    9.26818984e+04f,
+    1.85363797e+05f,
+    3.70727594e+05f,
+    7.41455188e+05f,
+    1.48291038e+06f,
+    2.96582075e+06f,
+    5.93164150e+06f,
+    1.18632830e+07f,
+    2.37265660e+07f,
+    4.74531320e+07f,
+    9.49062640e+07f,
+    1.89812528e+08f,
+    3.79625056e+08f,
+    7.59250112e+08f,
+    1.51850022e+09f,
+    3.03700045e+09f,
+    6.07400090e+09f,
+    1.21480018e+10f,
+    2.42960036e+10f,
+    4.85920072e+10f,
+    9.71840143e+10f,
+    1.94368029e+11f,
+    3.88736057e+11f
 };
 #endif
 

Modified: freeswitch/branches/gmaruzz/libs/pcre/pcretest.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/pcre/pcretest.c	(original)
+++ freeswitch/branches/gmaruzz/libs/pcre/pcretest.c	Tue Dec 23 07:37:03 2008
@@ -794,7 +794,7 @@
 if (offsets == NULL)
   {
   printf("** Failed to get %d bytes of memory for offsets vector\n",
-    size_offsets_max * sizeof(int));
+    size_offsets_max * (int)sizeof(int));
   yield = 1;
   goto EXIT;
   }
@@ -1736,7 +1736,7 @@
           if (offsets == NULL)
             {
             printf("** Failed to get %d bytes of memory for offsets vector\n",
-              size_offsets_max * sizeof(int));
+              size_offsets_max * (int)sizeof(int));
             yield = 1;
             goto EXIT;
             }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/.update
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/.update	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/.update	Tue Dec 23 07:37:03 2008
@@ -1 +1 @@
-Wed Nov 12 11:28:12 EST 2008
+Thur Dec 18 17:23:18 CST 2008

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/AUTHORS
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/AUTHORS	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/AUTHORS	Tue Dec 23 07:37:03 2008
@@ -8,30 +8,42 @@
 Contributors (in alphabetical order, surname first)
 ---------------------------------------------------
 
+Alaoui, Youness <youness -dot alaoui -at collabora -dot co -dot uk>
 Chan, Tat <first.surname at nokia.com>
 Ciarkowski, Andrzej <wp-voigtkampff -at users -dot sourceforge -dot net>
+Czapiga, Brian <rys -at evool -dot com>
 Denis-Courmont, Remi <first.surname at nokia.com>
+Ferrari, Fabio <fabioferrari -at gmail -dot com>
 Filonenko Roman <shkoder -at ua -dot fm>
 Haataja, Mikko <first.surname at nokia.com>
 Jacobs, Remeres <first.surname at nokia.com>
 Jalava, Teemu <first.surname at nokia.com>
 Jerris, Michael <mike -at jerris -dot com>
+Katcipis, Tiago <katcipis AT inf DOT ufcs DOT br>
+Knoblich, Stefan
 Legostayev, Denis <legostayev -at neic -dot nsk -dot su>
+Lenk, Jeff <jlenk -at frontiernet -dot net>
 Leuenberger, Stefan <first.surname -at netmodule -dot com>
+Margarido, Fabio <fabiomargarido AT gmail DOT com>
+Neuner, Jarod <janeuner -at networkharbor -dot com>
+Paul, Johan <johan -dot paul -at plenware -dot fi>
+Pizarro, Paulo <paulo -dot pizarro -at gmail -dot com>
 Prado, Dimitri E. <dprado -at e3c -dot com -dot br>
 Puolakka, Petteri <first.surname at nokia.com>
 Puustinen, Ismo <first.surname at nokia.com>
 Rinne-Rahkola, Pasi <first.surname at nokia.com>
+Richards, Jerry <jerryr at tonecommander dot com>
 Rondina, Daniele <geaary -at gmail -dot com>
 Saari, Mika <first.surname at nokia.com>
+Sabatini, Stefano
 Selin, Jari <first.surname at nokia.com>
 Suttner, Bernhard <suttner -at comdasys -dot com>
 Underwood, Steve <steveu -at coppice -dot org>
 Urpalainen, Jari <first.surname at nokia.com>
 Whittaker, Colin <colinw -at occamnetworks -dot com>
 Zabaluev, Mikhail <first.surname at nokia.com>
+Zaikin, Maxim <Maxim -at amsd -dot com>
 
-Note: for details on who did what, see the version control 
+Note: for details on who did what, see the version control
       system change history, and release notes for past releases at
       http://sofia-sip.sourceforge.net/relnotes/
- 
\ No newline at end of file

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/COPYING
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/COPYING	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/COPYING	Tue Dec 23 07:37:03 2008
@@ -146,7 +146,7 @@
 on the Library (independent of the use of the Library in a tool for
 writing it).  Whether that is true depends on what the Library does
 and what the program that uses the Library does.
-  
+
   1. You may copy and distribute verbatim copies of the Library's
 complete source code as you receive it, in any medium, provided that
 you conspicuously and appropriately publish on each copy an

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/COPYRIGHTS
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/COPYRIGHTS	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/COPYRIGHTS	Tue Dec 23 07:37:03 2008
@@ -1,6 +1,6 @@
 This package contains the Sofia-SIP library.
 
-Copyright (C) 2005-2006 Nokia Corporation and others (see the 
+Copyright (C) 2005-2006 Nokia Corporation and others (see the
 in individual files for a detailed list of copyright holders).
 
 Contact: Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -102,23 +102,23 @@
 The package also contains files licensed by IBM Corporation. These files are
 distributed with the following copyright notice:
 
-           This module contains code made available by IBM 
-           Corporation on an AS IS basis.  Any one receiving the 
-           module is considered to be licensed under IBM copyrights 
-           to use the IBM-provided source code in any way he or she 
-           deems fit, including copying it, compiling it, modifying 
-           it, and redistributing it, with or without 
-           modifications.  No license under any IBM patents or 
-           patent applications is to be implied from this copyright 
-           license. 
-
-           A user of the module should understand that IBM cannot 
-           provide technical support for the module and will not be 
-           responsible for any consequences of use of the program. 
-
-           Any notices, including this one, are not to be removed 
-           from the module without the prior written consent of 
-           IBM. 
+           This module contains code made available by IBM
+           Corporation on an AS IS basis.  Any one receiving the
+           module is considered to be licensed under IBM copyrights
+           to use the IBM-provided source code in any way he or she
+           deems fit, including copying it, compiling it, modifying
+           it, and redistributing it, with or without
+           modifications.  No license under any IBM patents or
+           patent applications is to be implied from this copyright
+           license.
+
+           A user of the module should understand that IBM cannot
+           provide technical support for the module and will not be
+           responsible for any consequences of use of the program.
+
+           Any notices, including this one, are not to be removed
+           from the module without the prior written consent of
+           IBM.
 
 ----------------------------------------------------------------------------
 
@@ -149,7 +149,7 @@
 
 The following license.terms for information on usage and redistribution
 of this individual file, and for a DISCLAIMER OF ALL WARRANTIES.
- 
+
 This software is copyrighted by the Regents of the University of
 California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
 Corporation and other parties.  The following terms apply to all files
@@ -181,7 +181,7 @@
 
 GOVERNMENT USE: If you are acquiring this software on behalf of the
 U.S. government, the Government shall have only "Restricted Rights"
-in the software and related documentation as defined in the Federal 
+in the software and related documentation as defined in the Federal
 Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you
 are acquiring the software on behalf of the Department of Defense, the
 software shall be classified as "Commercial Computer Software" and the
@@ -189,7 +189,7 @@
 252.227-7013 (c) (1) of DFARs.  Notwithstanding the foregoing, the
 authors grant the U.S. Government and others acting in its behalf
 permission to use and distribute the software in accordance with the
-terms specified in this license. 
+terms specified in this license.
 
 ----------------------------------------------------------------------------
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -2,11 +2,11 @@
 ChangeLog / Sofia-SIP - SIP User-Agent library
 ===============================================================
 
-Sofia-SIP library ChangeLog files are available in the 
+Sofia-SIP library ChangeLog files are available in the
 following places:
 
-- per subdirectory ChangeLog files 
-    - all non-trivial changes to files (unless documented  
+- per subdirectory ChangeLog files
+    - all non-trivial changes to files (unless documented
       elsewhere)
 - version control system changelogs
     - darcs and CVS tree repositories (see README.developers

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/ChangeLog.ext-trees
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/ChangeLog.ext-trees	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/ChangeLog.ext-trees	Tue Dec 23 07:37:03 2008
@@ -20,18 +20,18 @@
 
   * Fixed binding problems in nua and nta.c.
   Returning more appropriate error code from tport_tbind(), too.
-  This patch fixes tracked bugs 
-  #1485624 (nua not binding to 5060), 
-  #1485625 (nua_create() fails if STUN init fails) and 
+  This patch fixes tracked bugs
+  #1485624 (nua not binding to 5060),
+  #1485625 (nua_create() fails if STUN init fails) and
   #1485632 (ncorrect error message for nua bind error).
   Nua now also binds both to NUTAG_URL and NUTAG_SIPS_URL() URIs, nua_create()
   fails if binding either of them fails.
 
   * Fixed msg_addrlen() usage.
-  
+
   msg_addrlen() returns a pointer to ai_addrlen field of struct addrinfo
   inside the msg_t object. ai_addrlen has type size_t. However, system calls
-  taking a return valur pointer to address length, use type socklen_t. 
+  taking a return valur pointer to address length, use type socklen_t.
   Typically size_t is unsigned long, socklen_t is int, so casting
   msg_addrlen() return value to (socklen_t *) will break on (high-endian)
   64-bit platforms. svsp.
@@ -74,22 +74,22 @@
   - win32/tests/test_nua/test_nat_tags.cpp
 
   * Now building libsofia_sip_ua.dll on win32.
-  
+
   We define both IN_LIBSOFIA_SIP_UA and IN_LIBSOFIA_SRES in
   libsofia_sip_ua.dsp.
-  
+
   Because of DLL linkage, we compile tags typedefs as C++
   (see win32/tests/test_nua/test_nat_tags.cpp).
-  
+
   Removed LIBSOFIA_SIP_UA_STATIC from win32/sofia-sip/su_configure.h.
-  
+
   Added libsofia_sip_ua_static.lib, too. If you want to compile against
-  that, you need define LIBSOFIA_SIP_UA_STATIC by yourself. 
-  
+  that, you need define LIBSOFIA_SIP_UA_STATIC by yourself.
+
   Added libsofia-sip-ua-static/libsofia_sip_ua_static.dsp.
-  
+
   Using multithreaded DLL runtime for all projects.
-  
+
   * Added SOFIAPUBFUN/SOFIAPUBVAR to stun module, too.
 
   * Added test_nat_tags.c to nua module.
@@ -99,11 +99,11 @@
   * Added SRESPUBFUN and sres_config.h to sresolv module.
 
   * Updated headers.
-  
+
   Added sofia-sip/ prefix to documentation entries referring to include files.
-  
+
   Added SOFIAPUBFUN and SOFIAPUBVAR to files that missed them.
-  
+
   Removed some deprecated functions and macros.
 
   * Avoid #include ordering problem with sip_parser.h in sip_test_msg.c, too.
@@ -118,7 +118,7 @@
   Avoid #include ordering problem with <sofia-sip/http_parser.h>.
 
   * Removed utf8 and unicode-related stuff from library.
-  
+
   Source files are still included in source tar.
 
   * Reordered #includes in sip module.
@@ -137,9 +137,9 @@
 
   * Fixed includes in outbound.[hc].
 
-  * Added Doxyfiles to libsofia-sip-ua-glib. 
-  
-  Note that the files are not actually commented. 
+  * Added Doxyfiles to libsofia-sip-ua-glib.
+
+  Note that the files are not actually commented.
 
   * nua, soa: Adding Warnings to the response if appropriate.
 
@@ -166,18 +166,18 @@
   * nua_register.c: use nua-generated contact for refresh interval calculation.
   Allow SIPS uris in contacts, too.
 
-  * nua_register.c: ignoring bad received parameters in Via header. 
+  * nua_register.c: ignoring bad received parameters in Via header.
+
+  * Updated config file handling in sresolv/sres.c.
 
-  * Updated config file handling in sresolv/sres.c. 
-  
   Using reference counting with config structure when copying
   resolver objects.
-  
+
   Trying harder to avoid re-parsing resolv.conf and checking for
   updated servers.
-  
+
   Changed SRES_UPDATE_INTERVAL_SECS to 5 for non-WIN32 platforms.
-  
+
   * su/su_alloc.c, su/sofia-sip/su_alloc.h: su_home_ref() takes const pointer.
 
 2006-05-08  kai.vehmanen at nokia.com
@@ -252,10 +252,10 @@
   * test_sresolv.v: added more tests for A6 record parsing.
 
   * sres.c, sres_cache.c: records are now allocated in a single chunk.
-  
+
   Bug hunted down by Thomas Rosenblatt: strings and domains belonging to
   record were allocated from resolver home, not from cache home.
-  
+
   * Fixed problem with config without search domains in sresolv/sres.c.
 
   * Added information for COPYRIGHTS file to README.developers.
@@ -277,7 +277,7 @@
   * Added sofia-sip/auth_ntlm.h auth_ntlm.c to dist in iptsec module.
 
   * Added license to Makefiles (kv)
-    
+
   Added copyright lines and reference to LGPL license to the Makefile.am and
   configure.ac files.
 
@@ -286,7 +286,7 @@
   * Added libsofia-sip-ua-glib/ChangeLog to darcs (kv)
 
   * Added win32 registry name server discovery (kv)
-  
+
   Based on a patch from Dimitri E. Prado.
   Decreased update interval to 180secs (SRES_UPDATE_INTERVAL_SECS).
 
@@ -371,7 +371,7 @@
 	const *, too.
 
 	* Added SOFIAPUBFUN to auth_struct_copy(), too.
-	
+
   * iptsec module (by Martti Mela):
 
 	* ntlm support now compiles, not working.
@@ -393,7 +393,7 @@
   * iptsec module:
 
 	* Updated headers in iptsec module.
-	Added SOFIAPUBFUN and SOFIAPUBVAR where needed. 
+	Added SOFIAPUBFUN and SOFIAPUBVAR where needed.
 	Removed auc_with_uicc().
 
 	* Fixed memory management problems in iptsec module.
@@ -403,7 +403,7 @@
 	freed.
 	Now we are actually running the tests in test_auth_digest.c, too.
 	The problem was reported and patch submitted by Colin Whittaker.
-  
+
   * sresolv module:
 
 	* Updated sresolv API.
@@ -743,7 +743,7 @@
 
     M ./libsofia-sip-ua/nua/test_nua.c +138
 
-  * Fixed NTA API test for SigComp options (they are now always processed). 
+  * Fixed NTA API test for SigComp options (they are now always processed).
 
     M ./libsofia-sip-ua/nta/test_nta_api.c -8 +4
 
@@ -800,7 +800,7 @@
 
 2006-04-11  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-  Synchronizing CVS with darcs (other contributors pp = Pekka Pessi, 
+  Synchronizing CVS with darcs (other contributors pp = Pekka Pessi,
   mm = Martti Mela).
 
   * NDEBUG oops. (pp)
@@ -897,7 +897,7 @@
     M ./libsofia-sip-ua/nua/nua_tag.c -2
     M ./libsofia-sip-ua/nua/sofia-sip/nua_tag.h -7 +6
 
-  * Fixed su_root_run() usage in docs. (pp) 
+  * Fixed su_root_run() usage in docs. (pp)
   Thanks for hint by Julio Auto.
 
     M ./libsofia-sip-ua/nua/nua.docs -1 +1
@@ -915,7 +915,7 @@
     M ./libsofia-sip-ua/nua/nua_register.c -7 +11
 
   * Removed obsoleted nua events. (pp)
-  
+
   Removed nua events nua_i_media_event, nua_r_set_media_param,
   nua_r_get_media_param, nua_r_media_setup, nua_r_media_describe,
   nua_r_media_event, nua_i_announce, nua_i_describe, nua_i_get_parameter,
@@ -923,7 +923,7 @@
   nua_i_setup, nua_i_teardown, nua_r_setup, nua_r_play, nua_r_record,
   nua_r_pause, nua_r_describe, nua_r_teardown, nua_r_options2, nua_r_announce,
   nua_r_get_parameter, and nua_r_set_parameter.
-  
+
   Removed nua functions nua_announce(), nua_describe(), nua_get_media_param(),
   nua_get_parameter(), nua_media_describe(), nua_media_event(),
   nua_media_setup(), nua_options2(), nua_pause(), nua_play(), nua_record(),
@@ -1330,7 +1330,7 @@
     A ./libsofia-sip-ua/tport/tport_type_connect.c
 
   * Split tport.c into multiple modules. (pp)
-  STUN, UPnP and SigComp still need some polishing. 
+  STUN, UPnP and SigComp still need some polishing.
 
     M ./libsofia-sip-ua/tport/Makefile.am -3 +7
     M ./libsofia-sip-ua/tport/test_tport.c -13 +11
@@ -1574,12 +1574,12 @@
     M ./libsofia-sip-ua/nta/nta.c -3 +9
 
   * Using SOFIAPUBFUN in msg_header.h. Avoiding use of msg_param_t where possible. (pp)
-      
+
   API CHANGE:
   Allowing NULL as message public pointer (using default) in calls to
   msg_serialize(), msg_header_add(), msg_header_prepend(),
   msg_header_add_dup(), msg_header_add_dup_as(), msg_header_add_make(),
-  msg_header_add_str(), msg_header_insert(), msg_header_remove(), 
+  msg_header_add_str(), msg_header_insert(), msg_header_remove(),
   msg_header_remove_all(), and msg_header_replace().
 
     M ./libsofia-sip-ua/msg/msg_parser.c -155 +182
@@ -1613,7 +1613,7 @@
   * nua_dialog_store_peer_info() now optionally removes peer info. (pp)
   If the SIP message given to nua_dialog_store_peer_info() is redirection
   response, reset peer info.
-  
+
 
     M ./libsofia-sip-ua/nua/nua_dialog.c +14
 
@@ -1645,7 +1645,7 @@
 2006-03-16  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
   Synchronizing CVS with darcs.
-	
+
   * Fixed lib-sofia-sip-ua-glib Makefile.ams.
   Tried to sanitize glib-less compilation.
 
@@ -1718,7 +1718,7 @@
   * Using alarm() with su_test.c.
 
   * Fixed hc_print usage in msg_header_prepare().
-  Some headers use snprintf() which may return -1 on some platforms if 
+  Some headers use snprintf() which may return -1 on some platforms if
   buffer is too small.
 
   * Fixed problems in test_nua on win32.
@@ -1753,13 +1753,13 @@
     M ./libsofia-sip-ua/nua/nua_stack.c -1 +1
 
 2006-03-13  Martti Mela  <martti.mela at nokia.com>
-	
+
   * win32 defs, compiles and installs in mingw environment
 
 2006-03-09  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-  * Synchronized darcs and CVS. 
-	
+  * Synchronized darcs and CVS.
+
   * Added missing su_source_test.c file.
 
     A ./libsofia-sip-ua-glib/su-glib/su_source_test.c
@@ -1978,8 +1978,8 @@
 
 2006-03-01  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
-  * Synchronized darcs and CVS. 
-	
+  * Synchronized darcs and CVS.
+
   * Added utils/Doxyfile
 
     A ./utils/Doxyfile
@@ -2122,7 +2122,7 @@
 2006-02-15  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
   * Release 1.11.6.
-	
+
   * Fixed problems in doxygen documentation and dist.
 
   * Updated PRACK and nta_outgoing_prack().
@@ -2173,19 +2173,19 @@
   <sofia-sip/su.h>.
 
   You can either fix your applications to use the new include file names
-  with the fix-include-sofia-sip sed script found in scripts/ directory, or 
-  add both ${sofiadir} and ${sofiadir}/sofia-sip into your include path, 
+  with the fix-include-sofia-sip sed script found in scripts/ directory, or
+  add both ${sofiadir} and ${sofiadir}/sofia-sip into your include path,
   e.g.,
 
-  INCLUDES = -I/usr/include/sofia-1.11 -I/usr/include/sofia-1.11/sofia-sip 
+  INCLUDES = -I/usr/include/sofia-1.11 -I/usr/include/sofia-1.11/sofia-sip
 
   At the same time, I took the liberty to rename two include files
 
   sofia_sip_features.h => sofia-sip/features.h
-  su_memmem.h => sofia-sip/su_bm.h	
+  su_memmem.h => sofia-sip/su_bm.h
 
   The fix-include-sofia-sip sed script takes care of both of them.
-	
+
   * Improved 100rel handling in nua.
   Added test_100rel to test_nua.c.
 
@@ -2193,7 +2193,7 @@
 
   * Improving getaddrinfo replacements.
   Testing functions getaddrinfo()/freeaddrinfo(), getnameinfo() and
-  gai_strerror() separately. 
+  gai_strerror() separately.
   There is no gai_strerror() in windows, I think.
 
 2006-02-03  Pekka Pessi  <Pekka.Pessi at nokia.com>
@@ -2286,12 +2286,12 @@
     M ./libsofia-sip-ua/nea/nea_server.c -1 +1
 
   * Added functions for scanning domain names and IP addresses.
-  Added span_ip4_address()/scan_ip4_address(), 
-        span_ip6_address()/scan_ip6_address(), 
+  Added span_ip4_address()/scan_ip4_address(),
+        span_ip6_address()/scan_ip6_address(),
         span_ip6_reference()/scan_ip6_reference(),
-        span_ip_address()/scan_ip_address(), 
+        span_ip_address()/scan_ip_address(),
         span_domain()/scan_domain(), and
-        span_host()/scan_host(). 
+        span_host()/scan_host().
 
     M ./libsofia-sip-ua/bnf/bnf.c -2 +588
     M ./libsofia-sip-ua/bnf/bnf.h -2 +18
@@ -2393,7 +2393,7 @@
 2006-01-03  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
   Syncinc darcs and CVS.
-	
+
   * Added more tests for call hold.
 
   * Using msg_header_replace_param() in nua_stack.c.
@@ -2410,7 +2410,7 @@
 
   * Removed msg_bnf.h
 
-  * Added NTATAG_TCP_RPORT(). 
+  * Added NTATAG_TCP_RPORT().
   Do not use rport with TCP by default.
 
   * Added test for comp=sigcomp.
@@ -2420,7 +2420,7 @@
 
   * Documented TP_AI_ flags.
   Test our TP_AI_ assumptions.
-  Added a test for asymmetric SigComp on TCP. 
+  Added a test for asymmetric SigComp on TCP.
   We use TP_AI_COMPRESSED flag in this test.
 
   * Added TPTAG_FRESH() and a test for it.
@@ -2429,7 +2429,7 @@
 
   * Use #include <stdio.h> for FILE.
 
-  * Fixed include_sofiadir handling in pkg-config and rpm files. 
+  * Fixed include_sofiadir handling in pkg-config and rpm files.
 
 2005-12-27  Martti Mela <martti.mela at nokia.com
 
@@ -2559,7 +2559,7 @@
     M ./libsofia-sip-ua/sip/torture_sip.c -13 +137
 
   * Added manipulation functions for header parameters.
-  msg_header_find_param(), msg_header_add_param(), 
+  msg_header_find_param(), msg_header_add_param(),
   msg_header_replace_param(), and msg_header_remove_param().
 
     M ./libsofia-sip-ua/http/http_basic.c -1 +1
@@ -2659,7 +2659,7 @@
 
     M ./libsofia-sip-ua/su/su_localinfo.c +3
     M ./libsofia-sip-ua/su/su_localinfo.h -2 +3
-   
+
 2005-12-02  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
    Again, syncing darcs and CVS.
@@ -3025,11 +3025,11 @@
 
   * Cleaned up su_addrinfo.c. [pp]
   Cleaned up comments.
-  Using SU_HAVE_ flags. 
+  Using SU_HAVE_ flags.
   Added support for SCTP in getaddrinfo() replacement.
 
     M ./libsofia-sip-ua/su/su_addrinfo.c -10 +38
-	
+
   * Declaring sockaddr_storage in su.h if it is not provided in environment.
 
     M ./libsofia-sip-ua/su/su.h +23
@@ -3052,7 +3052,7 @@
 2005-11-30  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
   Syncing darcs with CVS.
-	
+
   * Silenced warning in su_addrinfo.c.
 
     M ./libsofia-sip-ua/su/su_addrinfo.c -1 +2
@@ -3158,16 +3158,16 @@
 
     M ./libsofia-sip-ua/nua/nua_stack.c -10 +18
 
-  * Rewrote uas_check_session_content(). 
+  * Rewrote uas_check_session_content().
   Returning empty Accept-Encoding header in 415/406 responses.
 
     M ./libsofia-sip-ua/nua/nua_stack.c -21 +41
 
   * Do not throttle at termination. [FIX]
-  
-  nea_server now sends NOTIFYs that terminate subscription even if the 
+
+  nea_server now sends NOTIFYs that terminate subscription even if the
   previous NOTIFY transaction has not completed yet.
-  
+
   This fixes the race condition in nua_terminate() (where terminating NOTIFY
   was is never sent).
 
@@ -3203,7 +3203,7 @@
     M ./RELEASE -3 +16
 
   * Fixed installing and distributing m4 files.
-  Not installing m4/sac-su2.m4. 
+  Not installing m4/sac-su2.m4.
   Including m4/sac-tport.m4 and m4/sac-openssl.m4 in distribution.
 
     M ./Makefile.am -1 +2
@@ -3219,7 +3219,7 @@
     M ./libsofia-sip-ua/docs/mainpage.docs -5 +7
 
   * Updated subscriptuion authorization and nua_terminate() semantics.
-  Subscription authorization now rejects SUBSCRIBE if 
+  Subscription authorization now rejects SUBSCRIBE if
   NUTAG_SUBSTATE(nua_substate_terminated) parameter is set.
   Correct status code is relayed to application, too.
   nua_terminate() now always terminates whole notifier.
@@ -3253,7 +3253,7 @@
 
     M ./libsofia-sip-ua/docs/Doxyfile -1 +1
     M ./libsofia-sip-ua/features/Doxyfile -1 +1
-	
+
 	M ./libsofia-sip-ua/nea/Doxyfile -1 +1
 
   * Moved typedefs nua_t and nua_handle_t into <nua_tag.h>
@@ -3409,9 +3409,9 @@
 2005-11-28  Martti Mela  <martti.mela at nokia.com>
 
 	* nua.h: added event nua_i_subscription
-	
+
 	* nua_commmon.c: added event nua_i_subscription
-	
+
 	* nua_stack.c: ua_event for nua_i_subscription (nea subscribers)
 
 	* nea.h, nea_tag.c, nea_tag_ref.c, nea_server.c: support for a new
@@ -3419,7 +3419,7 @@
 
 2005-11-15  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-	* configure.ac: Added VER_LIBSOFIA_SIP_UA variables. 
+	* configure.ac: Added VER_LIBSOFIA_SIP_UA variables.
 
 2005-11-14  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
@@ -3469,7 +3469,7 @@
     M ./libsofia-sip-ua/soa/test_soa.c -19 +382
 
   * Added funtions for rtp payload type management.
-  
+
   Added sdp_media_uses_rtp(), sdp_rtpmap_match(), sdp_rtpmap_find_matching()
   and sdp_rtpmap_well_known[]. Fixed RTP timestamp rate for G722: it was 16000
   but it should be 8000.
@@ -3510,8 +3510,8 @@
     M ./libsofia-sip-ua/su/su_wait.h +3
 
   * Fixed tport.c on Win32 port.
-  Added a separate "connecting" phase. 
-  Checking EWOULDBLOCK in addition to EAGAIN. 
+  Added a separate "connecting" phase.
+  Checking EWOULDBLOCK in addition to EAGAIN.
   Fixed TP_AI_CLOSE and TP_AI_SHUTDOWN flags.
   Improved logging.
 
@@ -3757,7 +3757,7 @@
   * Cleaned up nta module interfaces.
   Use uint32_t instead of sip_u32_t.
   Removed old funtions not using reference counting with messages:
-  Replaced nta_outgoing_getresponse() with nta_outgoing_getresponse_ref(), 
+  Replaced nta_outgoing_getresponse() with nta_outgoing_getresponse_ref(),
   and nta_outgoing_getrequest() with nta_outgoing_getrequest_ref().
   Removed nta_incoming_getresponse(), nta_leg_stateful().
   Removed nta_outgoing_tmcreate(): use nta_outgoing_mcreate() instead.
@@ -3795,7 +3795,7 @@
 
     M ./libsofia-sip-ua/sip/sip_protos.h.in -1 +1
 
-  * Cleaned up sip types. 
+  * Cleaned up sip types.
   Not using special typedefs sip_u32_t or sip_u16_t.
 
     M ./libsofia-sip-ua/sip/sip.h -15 +11
@@ -3816,7 +3816,7 @@
   * Removed annoying Last modified from iptsec.
 
 2005-11-04  Pekka Pessi  <Pekka.Pessi at nokia.com>
-	
+
   * Removed annoying Last modified from msg module.
 
   * Removed Last modified things from sip module.
@@ -3852,7 +3852,7 @@
 
     M ./libsofia-sip-ua/nua/test_nua.c +409
 
-  * Added nua_unpublish(). 
+  * Added nua_unpublish().
   Some cosmetic changes, too.
 
     M ./libsofia-sip-ua/nua/nua.h -1 +4
@@ -3899,14 +3899,14 @@
 
   * Moved deprecated functions to nta/nta_compat.c.
   nta_msg_vsend() and msg_msg_send() should not be used anymore.
-  
+
   nta_msg_discard() is also deprecated, but getting rid of references to it
   takes time.
 
     M ./libsofia-sip-ua/nta/nta.c -43 +42
     M ./libsofia-sip-ua/nta/nta_compat.c -1 +31
 
-  * Plugged memory leak in nth_engine_create() in nth/nth_client.c 
+  * Plugged memory leak in nth_engine_create() in nth/nth_client.c
   Use su_home_new() instead of su_salloc().
 
     M ./libsofia-sip-ua/nth/nth_client.c -3 +2
@@ -4297,7 +4297,7 @@
 
 	* Importing darcs-to-cvs-2005-10-04.
 
-  * Using DIST_SUBDIRS when including dist-only dirs 
+  * Using DIST_SUBDIRS when including dist-only dirs
 
     M ./Makefile.am -1 +2
     M ./libsofia-sip-ua/Makefile.am -1 +4
@@ -4308,7 +4308,7 @@
 2005-10-03  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
 	* Importing darcs-to-cvs-2005-10-03.
-	
+
   * Removed old .def files.
 
     R ./libsofia-sip-ua/ipt/ipt.def
@@ -4337,7 +4337,7 @@
 2005-09-29  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
 	* Importing darcs-to-cvs-2005-09-29.
-		
+
 2005-09-28  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
 	* Added nua improvements.
@@ -4347,7 +4347,7 @@
 2005-09-23  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
 	* darcs changes:
-	
+
 	Fri Sep 23 18:58:29 EEST 2005  Pekka.Pessi at nokia.com
 	  * Building msg_test class into msg_test library, use that in tport.
 
@@ -4460,7 +4460,7 @@
 	    M ./libsofia-sip-ua/sip/sip_header.h +3
 
 	Mon Sep 19 20:12:33 EEST 2005  Pekka.Pessi at nokia.com
-	  * Updated. Added rules for ignoring SDP. corrected some 
+	  * Updated. Added rules for ignoring SDP. corrected some
 
 	    M ./libsofia-sip-ua/soa/soa.docs -8 +18
 
@@ -4567,7 +4567,7 @@
 	* Makefile.am: Added requirement for automake-1.6.1
 	or newer.
 
-	* autogen.sh: Fixed interop problem with older automake 
+	* autogen.sh: Fixed interop problem with older automake
 	versions.
 
 	* configure.ac: Do not compile STUN if OpenSSL is not

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -21,12 +21,12 @@
 VERSION = @VERSION@
 
 EXTRA_DIST =	AUTHORS COPYING COPYRIGHTS ChangeLog.ext-trees \
-		README README.developers RELEASE TODO 
+		README README.developers RELEASE TODO
 
 ACLOCAL_AMFLAGS = -I m4
 
 EXTRA_DIST += 	m4/sac-general.m4 m4/sac-coverage.m4 \
-		m4/sac-su2.m4 m4/sac-tport.m4 m4/sac-openssl.m4 
+		m4/sac-su2.m4 m4/sac-tport.m4 m4/sac-openssl.m4
 
 EXTRA_DIST +=   docs/build_system.txt \
 		docs/devel_platform_notes.txt \

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/README
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/README	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/README	Tue Dec 23 07:37:03 2008
@@ -5,12 +5,12 @@
 Introduction
 ------------
 
-Sofia-SIP is an open-source SIP User-Agent library, compliant 
-with the IETF RFC3261 specification. It can be used as 
-a building block for SIP client software for uses such as VoIP, 
-IM, and many other real-time and person-to-person communication 
-services. The primary target platform for Sofia-SIP is 
-GNU/Linux. Sofia-SIP is based on a SIP stack developed at 
+Sofia-SIP is an open-source SIP User-Agent library, compliant
+with the IETF RFC3261 specification. It can be used as
+a building block for SIP client software for uses such as VoIP,
+IM, and many other real-time and person-to-person communication
+services. The primary target platform for Sofia-SIP is
+GNU/Linux. Sofia-SIP is based on a SIP stack developed at
 the Nokia Research Center. Sofia-SIP is licensed under the LGPL.
 
 
@@ -42,9 +42,9 @@
 
 The Sofia-SIP su submodule also provides some small utilities:
 
-- addrinfo (libsofia-sip-ua/su), resolve host names 
+- addrinfo (libsofia-sip-ua/su), resolve host names
 - localinfo (libsofia-sip-ua/su), prints information about
-  local network interfaces 
+  local network interfaces
 
 References
 ----------

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/README.developers
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/README.developers	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/README.developers	Tue Dec 23 07:37:03 2008
@@ -6,8 +6,8 @@
 ============
 
 This file is a collection of practices and rules for Sofia-SIP
-development. If you have questions, or would like to make 
-changes, raise the issue on sofia-sip-devel (see 
+development. If you have questions, or would like to make
+changes, raise the issue on sofia-sip-devel (see
 http://lists.sourceforge.net/lists/listinfo/sofia-sip-devel ).
 
 
@@ -15,17 +15,17 @@
 ==============================
 
 AUTHORS
-	List of contributors. When contributing new code, add 
+	List of contributors. When contributing new code, add
 	yourself to AUTHORS, and also remember to update the
 	per source file copyright statements.
 
 COPYRIGHTS
-	List of licenses and related copyright statements. While 
+	List of licenses and related copyright statements. While
 	majority of Sofia-SIP is licensed under LGPL, there are
-	a few files with different, but LGPL compatible, licensing 
+	a few files with different, but LGPL compatible, licensing
 	terms.
-	
-README.developers 
+
+README.developers
 	This file.
 
 TODO
@@ -33,11 +33,11 @@
 
 <dir>/ChangeLog files
 	All non-trivial changes to the source code should
-	be documented in the ChangeLog files. See also the 
+	be documented in the ChangeLog files. See also the
 	top-level ChangeLog.
 
 
-Version numbering 
+Version numbering
 =================
 
 Package version
@@ -50,8 +50,8 @@
      vMAJOR.MINOR.REVISION, where minor is odd
      vMAJOR.MINOR.REVISION.YEAR.MONTH.DAY, where minor is odd
 
-For all releases, the version should be changed in configure.ac 
-and committed to Darcs/CVS before making the release package. The person 
+For all releases, the version should be changed in configure.ac
+and committed to Darcs/CVS before making the release package. The person
 doing the release is responsible for updating the version number.
 
 Library interface versions
@@ -64,14 +64,14 @@
 
 The interface versions are set in top-level 'configure.ac' file.
 Additionally, the SONAME version (CURRENT-AGE) is set in the
-same place. These version numbers are available for use as autoconf 
-variables (see the library 'Makefile.am' files and 
+same place. These version numbers are available for use as autoconf
+variables (see the library 'Makefile.am' files and
 'packages/sofia-sip.spec.in').
 
 All changes to the library versions should be marked to the
 appropriate library 'ChangeLog' file. The library version should
-be changed at the same time as the first interface change is 
-committed since the previous release. The interface version is 
+be changed at the same time as the first interface change is
+committed since the previous release. The interface version is
 frozen (should be marked to the 'ChangeLog' file) at the time
 the next release is tagged (in other words, intra-release changes
 need not be tracked with libtool versions).
@@ -95,7 +95,7 @@
     - CVS tree (only used to track major releases) at:
       http://sourceforge.net/cvs/?group_id=143636
 - tags: rel-sofia-sip-x_y_z
-    - stable and development releases (matches release 
+    - stable and development releases (matches release
       version sofia-sip-x.y.z)
 - tags: snapshot_rel_YEARMMDD
     - snapshot releases at
@@ -113,13 +113,13 @@
 People without Darcs access
 ---------------------------
 
-Send your patches to sofia-sip-devel. Someone from the 
+Send your patches to sofia-sip-devel. Someone from the
 development team (see AUTHORS) will handle the patch.
 
 People with Darcs access
 ------------------------
 
-Trivial changes can be committed without review. For non-trivial 
+Trivial changes can be committed without review. For non-trivial
 changes, you should first send a proposal to sofia-sip-devel and
 wait for comments. There are no strict approval rules so use of
 common sense is recommended. ;)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/RELEASE
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/RELEASE	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/RELEASE	Tue Dec 23 07:37:03 2008
@@ -17,17 +17,17 @@
 
 <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; 
+ - should include all changes to public headers, and
+   other important information to developers;
  - and should be updated _continuously_! />
 
 **template**: New features in API are marked with Doxytag macro @VERSION_1_XX_X.
 
 libsofia-sip-ua:
 - **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 
+- 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-glib:
@@ -41,12 +41,12 @@
 <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 
+   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
-/> 
+/>
 
 - **template**: First Surname (patch to nua/soa/msg)
 
@@ -59,7 +59,7 @@
  - new/changed/removed functionality
  - links to further documentation
  - section may be omitted for minor releases
-/> 
+/>
 
 Bugs fixed in this release
 --------------------------

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/RELEASE.template
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/RELEASE.template	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/RELEASE.template	Tue Dec 23 07:37:03 2008
@@ -17,17 +17,17 @@
 
 <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; 
+ - should include all changes to public headers, and
+   other important information to developers;
  - and should be updated _continuously_! />
 
 **template**: New features in API are marked with Doxytag macro @VERSION_1_XX_X.
 
 libsofia-sip-ua:
 - **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 
+- 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-glib:
@@ -41,12 +41,12 @@
 <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 
+   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
-/> 
+/>
 
 - **template**: First Surname (patch to nua/soa/msg)
 
@@ -59,7 +59,7 @@
  - new/changed/removed functionality
  - links to further documentation
  - section may be omitted for minor releases
-/> 
+/>
 
 Bugs fixed in this release
 --------------------------

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/TODO
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/TODO	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/TODO	Tue Dec 23 07:37:03 2008
@@ -8,11 +8,11 @@
 ---------------
 
 1.11/1.12 series
-    - first version of the new nua+soa API 
+    - first version of the new nua+soa API
  	- nua_respond_nit() (non-INVITEs)
 	- nua_set_hparams()/nua_get_hparams() [DONE]
 	- session object ownership changes [DONE]
-        - allow multiple registrations (lines) and selecting 
+        - allow multiple registrations (lines) and selecting
           service route, outbound proxy, and transport independently
           for each handle; NUTAG_IDENTITY
     - doxygen documentation updates [DONE]

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/autogen.sh
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/autogen.sh	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/autogen.sh	Tue Dec 23 07:37:03 2008
@@ -1,4 +1,4 @@
-#!/bin/sh 
+#!/bin/sh
 
 set -x
 AUTOMAKE=${AUTOMAKE:-automake-1.9} ACLOCAL=${ACLOCAL:-aclocal-1.9}

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/configure.ac	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/configure.ac	Tue Dec 23 07:37:03 2008
@@ -2,7 +2,7 @@
 dnl Contact: Pekka Pessi <pekka.pessi at nokia.com>
 dnl Licensed under LGPL. See file COPYING.
 
-dnl 
+dnl
 dnl ref: http://www.gnu.org/software/autoconf/manual/autoconf.info.gz
 dnl
 AC_PREREQ(2.57)
@@ -11,7 +11,7 @@
 dnl ---------------------------
 
 dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
-AC_INIT([sofia-sip], [1.12.9devel1])
+AC_INIT([sofia-sip], [1.12.10devel])
 AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
 AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.12])
 dnl Includedir specific to this sofia version
@@ -24,7 +24,7 @@
 AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_REV, [0])
 AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_AGE, [0])
 AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_SOVER, [3]) # CUR-AGE
-					    
+
 # dnl calls AC_CANONICAL_ macros that are required by AM_INIT_AUTOMAKE
 SAC_CANONICAL_SYSTEM_CACHE_CHECK
 
@@ -56,7 +56,7 @@
 
 AC_ARG_WITH(doxygen,
 [  --with-doxygen[[=CMD]]    use doxygen command CMD [[doxygen]]],[
-case $enable_doxygen in 
+case $enable_doxygen in
 yes ) doxygen=doxygen ;;
 no ) doxygen=echo ;;
 esac], doxygen=doxygen)
@@ -249,12 +249,12 @@
 if test $ac_cv_c_z_format = yes; then
   AC_DEFINE([MOD_ZD], ["%ld"], [Define printf() modifier for ssize_t])dnl
   AC_DEFINE([MOD_ZU], ["%lu"], [Define printf() modifier for size_t])dnl
-else 
+else
   dnl Cross fingers
   AC_MSG_WARN("printf cannot handle size_t, using long instead")
   AC_DEFINE([MOD_ZD], ["%ld"], [Define printf() modifier for ssize_t])dnl
   AC_DEFINE([MOD_ZU], ["%lu"], [Define printf() modifier for size_t])dnl
-fi 
+fi
 
 fi
 
@@ -327,7 +327,7 @@
 libsofia-sip-ua/soa/Doxyfile
 libsofia-sip-ua/soa/Makefile
 libsofia-sip-ua/sresolv/Doxyfile
-libsofia-sip-ua/sresolv/Makefile 
+libsofia-sip-ua/sresolv/Makefile
 libsofia-sip-ua/stun/Doxyfile
 libsofia-sip-ua/stun/Makefile
 libsofia-sip-ua/su/Doxyfile

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/docs/build_system.txt
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/docs/build_system.txt	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/docs/build_system.txt	Tue Dec 23 07:37:03 2008
@@ -73,8 +73,8 @@
 ================
 
 Most of the code resides in the libsofia-sip-ua directory.
-The main library, libsofia-sip-ua.so, is created by 
-collecting object files (for example bnf/bnf_objs.o) from 
+The main library, libsofia-sip-ua.so, is created by
+collecting object files (for example bnf/bnf_objs.o) from
 individual modules.
 
 There are some portability issues with the way the
@@ -89,13 +89,13 @@
 Developer documentation
 =======================
 
-Generating reference documentation from source code 
+Generating reference documentation from source code
 ---------------------------------------------------
 
 The libsofia-sip-ua library has a top-level make target
 "doxygen" for generating the HTML reference documentation.
-The pages will be created to libsofia-sip-ua/docs 
-subdirectory. 
+The pages will be created to libsofia-sip-ua/docs
+subdirectory.
 
 This special target is primarily meant for use by
 the Sofia-SIP website admins, but can be used by anyone

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/docs/devel_platform_notes.txt
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/docs/devel_platform_notes.txt	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/docs/devel_platform_notes.txt	Tue Dec 23 07:37:03 2008
@@ -14,16 +14,16 @@
 Notes to distributors
 ----------------------
 
-Build options such as "--disable-stun" (HAVE_SOFIA_STUN) and 
+Build options such as "--disable-stun" (HAVE_SOFIA_STUN) and
 "--disable-nth" (HAVE_SOFIA_NTH) modify the public library API/ABI,
 by omitting certain interfaces from the resulting library and installed
 header files.
 
 Options such as '--disable-size-compat' modify the library
-ABI by changing the types used in public library function 
+ABI by changing the types used in public library function
 signatures.
 
-Generic POSIX (GNU/Linux, BSD, ...) 
+Generic POSIX (GNU/Linux, BSD, ...)
 -----------------------------------
 
 Sofia-SIP should compile out-of-the-box on generic POSIX
@@ -35,17 +35,17 @@
 for the full list.
 
 
-Mac OS X 
+Mac OS X
 --------
 
 TBD
 
-Win32 / Mingw 
+Win32 / Mingw
 -------------
 
-TBD 
+TBD
 
-Win32 / Cygwin 
+Win32 / Cygwin
 --------------
 
 TBD

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/docs/release_management.txt
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/docs/release_management.txt	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/docs/release_management.txt	Tue Dec 23 07:37:03 2008
@@ -27,8 +27,8 @@
     - maintained in sofia-sip/RELEASE
     - see diff between cvs/darcs between previous and
       this version
-    - written in freshmeat.net "Changes:" style 
-- notes on API/ABI interface changes 
+    - written in freshmeat.net "Changes:" style
+- notes on API/ABI interface changes
     - maintained in sofia-sip/RELEASE
     - all changes in public interfaces, plus other
       notes that developers should be aware of
@@ -41,7 +41,7 @@
 See the RELEASE.template file for a full list of release note
 sections.
 
-Making the release tarball 
+Making the release tarball
 ==========================
 
 - basics: check system clock of the build host ;)
@@ -71,15 +71,15 @@
 
 - combine the sofia-sip/RELEASE contents with
   the template found from sfnet_www/templates/relnotes.txt
-- store the resulting release notes to 
+- store the resulting release notes to
   sfnet_www/relnotes/relnotes-sofia-sip-x.y.z.txt
-- add explicit link to the release notes to 
+- add explicit link to the release notes to
   sfnet_www/download.html (three most recent releases,
   see guidelines in the html comments)
 - update sfnet_www/index.html to mention the latest
   release
-- commit the change to sf.net website CVS, and run the 
-  sfnet_www/put_online.sh script 
+- commit the change to sf.net website CVS, and run the
+  sfnet_www/put_online.sh script
 
 Uploading the release to sourceforge.net
 ========================================
@@ -104,8 +104,8 @@
 
 - replace the RELEASE file with RELEASE.template, and
   commit it to master source repository (see sofia-sip/README.developers)
-- change version in configure.ac from "X.Y.Z" to 
-  "X.Y.Zdevel" (as it is in many cases unknown what the 
+- change version in configure.ac from "X.Y.Z" to
+  "X.Y.Zdevel" (as it is in many cases unknown what the
   next version will be)
 - make a "tree open for development" commit
 
@@ -122,15 +122,15 @@
 
 - Always tag the src-tree with "syncuser-fromvcs-to-tovcs-yearmmdd".
 
-- Add a top-level ChangeLog entry that documents all the 
+- Add a top-level ChangeLog entry that documents all the
   changes made outside the target tree (what, who and when -
-  for example produced with the "darcs changes --summary" 
+  for example produced with the "darcs changes --summary"
   command).
 
 Checking API/ABI compatibility
 ==============================
 
-- Use a unit test binary built against an old library, 
+- Use a unit test binary built against an old library,
   to verify a new library version (forwards-compatibility).
 - Use the 'icheck' tool (in Debian) to make comparison
   between two released versions.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -17,7 +17,7 @@
 lib_LTLIBRARIES += libsofia-sip-ua-glib.la
 endif
 
-libsofia_sip_ua_glib_la_SOURCES = 
+libsofia_sip_ua_glib_la_SOURCES =
 libsofia_sip_ua_glib_la_LIBADD = $(GLIB_TARGETS) $(GLIB_LIBS)
 
 # set the libtool version info version:revision:age for libsofia-sip-ua-glib
@@ -42,7 +42,7 @@
 	done
 	${top_srcdir}/scripts/hide_emails.sh docs/html
 
-PHONY = doxygen 
+PHONY = doxygen
 
 include $(top_srcdir)/rules/recursive.am
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_glib.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_glib.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_glib.h	Tue Dec 23 07:37:03 2008
@@ -27,7 +27,7 @@
 
 /**
  * @file su_glib.h
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Kai Vehmanen <first.surname at nokia.com>
  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_source.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_source.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_source.h	Tue Dec 23 07:37:03 2008
@@ -27,16 +27,16 @@
 
 /**
  * @file su_source.h
- * @brief 
+ * @brief
  *
- * NOTE: This file (su_source.h) is DEPRECATED as of 1.12.2 release. 
+ * NOTE: This file (su_source.h) is DEPRECATED as of 1.12.2 release.
  *       Please use su_glib.h instead.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Kai Vehmanen <first.surname at nokia.com>
- *  
+ *
  * @date Created: Thu Mar  4 19:58:50 2004 ppessi
- * 
+ *
  */
 
 #ifndef SU_WAIT_H

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_glib.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_glib.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_glib.docs	Tue Dec 23 07:37:03 2008
@@ -4,7 +4,7 @@
 
 @section su_glib_meta Module Meta Information
 
-The su-glib module provides an interface to connect Sofia-SIP event loop 
+The su-glib module provides an interface to connect Sofia-SIP event loop
 to an existing glib main loop. Without this interface, a glib based
 application would have to create a separate thread for running
 the Sofia-SIP event loop.
@@ -29,14 +29,14 @@
   #include <sofia-sip/su_glib.h>
 
   /* ... */
-  
+
   GMainLoop *ptr = g_main_loop_new(NULL, FALSE);
   GSource *gsource;
   su_root_t *sofia_event_loop;
   su_timer_t *timer;
 
   /* create a sofia event loop using su-glib function su_glib_root_source_create() */
-  sofia_event_loop = su_glib_root_create(NULL); 
+  sofia_event_loop = su_glib_root_create(NULL);
 
   /* attach the created GSource to glib event loop */
   gsource = su_glib_root_gsource(sofia_event_loop);
@@ -48,12 +48,12 @@
   /* ... initialize other Sofia-SIP modules/functrions */
 
   /* run the glib mainloop */
-  g_main_loop_run(ptr);  
- at endcode   
+  g_main_loop_run(ptr);
+ at endcode
 
 @section su_glib_todo Todo
 
-- see sourceforge.net issue tracker for sofia-sip 
+- see sourceforge.net issue tracker for sofia-sip
   (-> http://sofia-sip.sourceforge.net/development.html )
 
 */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c	Tue Dec 23 07:37:03 2008
@@ -25,15 +25,15 @@
 /**
  * @file su_source.c
  * @brief Wrapper for glib GSource.
- *  
- * Refs: 
+ *
+ * Refs:
  *  - http://sofia-sip.sourceforge.net/refdocs/su/group__su__wait.html
  *  - http://developer.gnome.org/doc/API/glib/glib-the-main-event-loop.html
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
- * 
+ *
  * @date Created: Thu Mar  4 15:15:15 2004 ppessi
- * 
+ *
  */
 
 #include "config.h"
@@ -100,28 +100,28 @@
 static int su_source_send(su_port_t *self, su_msg_r rmsg);
 
 static int su_source_register(su_port_t *self,
-			    su_root_t *root, 
-			    su_wait_t *wait, 
+			    su_root_t *root,
+			    su_wait_t *wait,
 			    su_wakeup_f callback,
 			    su_wakeup_arg_t *arg,
 			    int priority);
 static int su_source_unregister(su_port_t *port,
-			      su_root_t *root, 
-			      su_wait_t *wait,	
-			      su_wakeup_f callback, 
+			      su_root_t *root,
+			      su_wait_t *wait,
+			      su_wakeup_f callback,
 			      su_wakeup_arg_t *arg);
 static int su_source_deregister(su_port_t *self, int i);
 static int su_source_unregister_all(su_port_t *self,
 				  su_root_t *root);
-static int su_source_eventmask(su_port_t *self, 
+static int su_source_eventmask(su_port_t *self,
 			     int index, int socket, int events);
 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_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 *, 
+				 su_root_t *root,
+				 su_prepoll_f *,
 				 su_prepoll_magic_t *);
 static int su_source_remove_prepoll(su_port_t *port,
 				  su_root_t *root);
@@ -129,7 +129,7 @@
 
 static char const *su_source_name(su_port_t const *self);
 
-static 
+static
 su_port_vtable_t const su_source_port_vtable[1] =
   {{
       /* su_vtable_size: */ sizeof su_source_port_vtable,
@@ -169,14 +169,14 @@
   return "GSource";
 }
 
-/** 
- * Port is a per-thread reactor.  
+/**
+ * Port is a per-thread reactor.
  *
- * Multiple root objects executed by single thread share a su_port_t object. 
+ * Multiple root objects executed by single thread share a su_port_t object.
  */
 struct su_source_s {
   su_base_port_t   sup_base[1];
-  
+
   GThread         *sup_tid;
   GStaticMutex     sup_obtained[1];
 
@@ -184,20 +184,20 @@
 
   GSource         *sup_source;	/**< Backpointer to source */
   GMainLoop       *sup_main_loop; /**< Reference to mainloop while running */
-  
+
   /* Waits */
-  unsigned         sup_registers; /** Counter incremented by 
-				      su_port_register() or 
+  unsigned         sup_registers; /** Counter incremented by
+				      su_port_register() or
 				      su_port_unregister()
 				  */
-  unsigned         sup_n_waits; 
-  unsigned         sup_size_waits; 
+  unsigned         sup_n_waits;
+  unsigned         sup_size_waits;
   unsigned         sup_max_index;
-  unsigned        *sup_indices; 
-  su_wait_t       *sup_waits; 
-  su_wakeup_f     *sup_wait_cbs; 
-  su_wakeup_arg_t**sup_wait_args; 
-  su_root_t      **sup_wait_roots; 
+  unsigned        *sup_indices;
+  su_wait_t       *sup_waits;
+  su_wakeup_f     *sup_wait_cbs;
+  su_wakeup_arg_t**sup_wait_args;
+  su_root_t      **sup_wait_roots;
 };
 
 typedef struct _SuSource
@@ -243,13 +243,13 @@
   return su_glib_root_create(magic);
 }
 
-/** 
- * Returns a GSource object for the root 
+/**
+ * Returns a GSource object for the root
  *
- * Note that you need to unref the GSource with g_source_unref() 
+ * Note that you need to unref the GSource with g_source_unref()
  * before destroying the root object.
  *
- * @return NULL on error (for instance if root was not created with 
+ * @return NULL on error (for instance if root was not created with
  *         su_glib_root_create())
  */
 GSource *su_glib_root_gsource(su_root_t *root)
@@ -299,7 +299,7 @@
 
 
 /** @internal Destroy a port. */
-static 
+static
 void su_source_finalize(GSource *gs)
 {
   SuSource *ss = (SuSource *)gs;
@@ -315,7 +315,7 @@
 
   g_static_mutex_lock(self->sup_mutex);
 
-  PORT_LOCK_DEBUG((" ...%p at %s locked(%p)...", 
+  PORT_LOCK_DEBUG((" ...%p at %s locked(%p)...",
 		   (void *)g_thread_self(), who, self));
 }
 
@@ -323,7 +323,7 @@
 {
   g_static_mutex_unlock(self->sup_mutex);
 
-  PORT_LOCK_DEBUG((" ...%p at %s unlocked(%p)\n", 
+  PORT_LOCK_DEBUG((" ...%p at %s unlocked(%p)\n",
 		   (void *)g_thread_self(), who, self));
 }
 
@@ -351,7 +351,7 @@
  * Change or query ownership of the port object.
  *
  * @param self pointer to a port object
- * @param op operation 
+ * @param op operation
  *
  * @ERRORS
  * @ERROR EALREADY port already has an owner (or has no owner)
@@ -392,7 +392,7 @@
 /* -- Registering and unregistering ------------------------------------- */
 
 /* Seconds from 1.1.1900 to 1.1.1970 */
-#define NTP_EPOCH 2208988800UL 
+#define NTP_EPOCH 2208988800UL
 
 /** Prepare to wait - calculate time to next timer */
 static
@@ -402,7 +402,7 @@
   su_port_t *self = ss->ss_port;
 
   enter;
-  
+
   if (self->sup_base->sup_head) {
     *return_tout = 0;
     return TRUE;
@@ -450,7 +450,7 @@
   return su_source_prepare(gs, &tout);
 }
 
-static 
+static
 gboolean su_source_dispatch(GSource *gs,
 			    GSourceFunc callback,
 			    gpointer user_data)
@@ -489,8 +489,8 @@
     for (i = 0; i < n; i++) {
       if (waits[i].revents) {
 	root = self->sup_wait_roots[i];
-	self->sup_wait_cbs[i](root ? su_root_magic(root) : NULL, 
-			      &waits[i], 
+	self->sup_wait_cbs[i](root ? su_root_magic(root) : NULL,
+			      &waits[i],
 			      self->sup_wait_args[i]);
 	/* Callback used su_register()/su_unregister() */
 	if (version != self->sup_registers)
@@ -512,7 +512,7 @@
 		   (void *)g_thread_self(), who, self));
   g_static_mutex_lock(self->sup_mutex);
 
-  PORT_LOCK_DEBUG((" ...%p at %s locked(%p)...", 
+  PORT_LOCK_DEBUG((" ...%p at %s locked(%p)...",
 		   (void *)g_thread_self(), who, self));
 }
 
@@ -520,7 +520,7 @@
 {
   g_static_mutex_unlock(self->sup_mutex);
 
-  PORT_LOCK_DEBUG((" ...%p at %s unlocked(%p)\n", 
+  PORT_LOCK_DEBUG((" ...%p at %s unlocked(%p)\n",
 		   (void *)g_thread_self(), who, self));
 }
 
@@ -548,21 +548,21 @@
  *
  *  Please note if identical wait objects are inserted, only first one is
  *  ever signalled.
- * 
+ *
  * @param self	     pointer to port
  * @param root	     pointer to root object
  * @param waits	     pointer to wait object
  * @param callback   callback function pointer
  * @param arg	     argument given to callback function when it is invoked
- * @param priority   relative priority of the wait object 
+ * @param priority   relative priority of the wait object
  *              (0 is normal, 1 important, 2 realtime)
- * 
+ *
  * @return
- *   The function @su_source_register returns nonzero index of the wait object, 
+ *   The function @su_source_register returns nonzero index of the wait object,
  *   or -1 upon an error.  */
 int su_source_register(su_port_t *self,
-		       su_root_t *root, 
-		       su_wait_t *wait, 
+		       su_root_t *root,
+		       su_wait_t *wait,
 		       su_wakeup_f callback,
 		       su_wakeup_arg_t *arg,
 		       int priority)
@@ -571,7 +571,7 @@
   unsigned n;
 
   enter;
-  
+
   assert(SU_SOURCE_OWN_THREAD(self));
 
   n = self->sup_n_waits;
@@ -587,7 +587,7 @@
 
     if (self->sup_size_waits == 0)
       size = SU_WAIT_MIN;
-    else 
+    else
       size = 2 * self->sup_size_waits;
 
     indices = realloc(self->sup_indices, size * sizeof(*indices));
@@ -600,14 +600,14 @@
 
     for (i = 0; i < self->sup_n_waits; i++)
       g_source_remove_poll(self->sup_source, (GPollFD*)&self->sup_waits[i]);
-      
+
     waits = realloc(self->sup_waits, size * sizeof(*waits));
     if (waits)
       self->sup_waits = waits;
 
     for (i = 0; i < self->sup_n_waits; i++)
       g_source_add_poll(self->sup_source, (GPollFD*)&waits[i]);
-      
+
     wait_cbs = realloc(self->sup_wait_cbs, size * sizeof(*wait_cbs));
     if (wait_cbs)
       self->sup_wait_cbs = wait_cbs;
@@ -618,7 +618,7 @@
 
     /* Add sup_wait_roots array, if needed */
     wait_tasks = realloc(self->sup_wait_roots, size * sizeof(*wait_tasks));
-    if (wait_tasks) 
+    if (wait_tasks)
       self->sup_wait_roots = wait_tasks;
 
     if (!(indices && waits && wait_cbs && wait_args && wait_tasks)) {
@@ -638,7 +638,7 @@
       g_source_add_poll(self->sup_source, (GPollFD*)&self->sup_waits[n]);
       self->sup_wait_cbs[n] = self->sup_wait_cbs[n-1];
       self->sup_wait_args[n] = self->sup_wait_args[n-1];
-      self->sup_wait_roots[n] = self->sup_wait_roots[n-1];	
+      self->sup_wait_roots[n] = self->sup_wait_roots[n-1];
     }
   }
   else {
@@ -653,13 +653,13 @@
 
   I = self->sup_max_index;
 
-  for (i = 0; i < I; i++)  
+  for (i = 0; i < I; i++)
     if (self->sup_indices[i] == UINT_MAX)
       break;
     else if (self->sup_indices[i] >= n)
       self->sup_indices[i]++;
 
-  if (i == I) 
+  if (i == I)
     self->sup_max_index++;
 
   if (n + 1 < self->sup_n_waits)
@@ -676,23 +676,23 @@
 }
 
 /** Unregister a su_wait_t object.
- *  
+ *
  *  The function su_source_unregister() unregisters a su_wait_t object. The
  *  wait object, a callback function and a argument are removed from the
  *  port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param root     - pointer to root object
  * @param wait     - pointer to wait object
  * @param callback - callback function pointer (may be NULL)
- * @param arg      - argument given to callback function when it is invoked 
+ * @param arg      - argument given to callback function when it is invoked
  *                   (may be NULL)
- * 
+ *
  * @return Nonzero index of the wait object, or -1 upon an error.
  */
 int su_source_unregister(su_port_t *self,
-			 su_root_t *root, 
-			 su_wait_t *wait,	
+			 su_root_t *root,
+			 su_wait_t *wait,
 			 su_wakeup_f callback, /* XXX - ignored */
 			 su_wakeup_arg_t *arg)
 {
@@ -700,7 +700,7 @@
   unsigned i, I, j, *indices;
 
   enter;
-  
+
   assert(self);
   assert(SU_SOURCE_OWN_THREAD(self));
 
@@ -733,14 +733,14 @@
 	if (self->sup_indices[j] != UINT_MAX &&
 	    self->sup_indices[j] > n)
 	  self->sup_indices[j]--;
-    
+
     for (; n < N; n++) {
       g_source_remove_poll(self->sup_source, (GPollFD*)&self->sup_waits[n+1]);
       self->sup_waits[n] = self->sup_waits[n+1];
       g_source_add_poll(self->sup_source, (GPollFD*)&self->sup_waits[n]);
       self->sup_wait_cbs[n] = self->sup_wait_cbs[n+1];
       self->sup_wait_args[n] = self->sup_wait_args[n+1];
-      self->sup_wait_roots[n] = self->sup_wait_roots[n+1];	  
+      self->sup_wait_roots[n] = self->sup_wait_roots[n+1];
     }
 
     i += 1;	/* 0 is failure */
@@ -757,14 +757,14 @@
 }
 
 /** Deregister a su_wait_t object.
- *  
- *  The function su_source_deregister() deregisters a su_wait_t registrattion. 
+ *
+ *  The function su_source_deregister() deregisters a su_wait_t registrattion.
  *  The wait object, a callback function and a argument are removed from the
  *  port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param i        - registration index
- * 
+ *
  * @return Index of the wait object, or -1 upon an error.
  */
 int su_source_deregister(su_port_t *self, int i)
@@ -774,7 +774,7 @@
   su_wait_t wait[1];
 
   enter;
-  
+
   assert(self);
   assert(SU_SOURCE_OWN_THREAD(self));
 
@@ -810,7 +810,7 @@
     g_source_add_poll(self->sup_source, (GPollFD*)&self->sup_waits[n]);
     self->sup_wait_cbs[n] = self->sup_wait_cbs[n+1];
     self->sup_wait_args[n] = self->sup_wait_args[n+1];
-    self->sup_wait_roots[n] = self->sup_wait_roots[n+1];	  
+    self->sup_wait_roots[n] = self->sup_wait_roots[n+1];
   }
 
   indices[i - 1] = UINT_MAX;
@@ -830,13 +830,13 @@
  *
  * The function su_source_unregister_all() unregisters all su_wait_t objects
  * associated with given root object destroys all queued timers.
- * 
+ *
  * @param  self     - pointer to port object
  * @param  root     - pointer to root object
- * 
+ *
  * @return Number of wait objects removed.
  */
-int su_source_unregister_all(su_port_t *self, 
+int su_source_unregister_all(su_port_t *self,
 			   su_root_t *root)
 {
   unsigned i, j;
@@ -847,15 +847,15 @@
   su_root_t      **wait_roots;
 
   enter;
-  
+
   assert(SU_SOURCE_OWN_THREAD(self));
 
   n_waits    = self->sup_n_waits;
-  waits      = self->sup_waits; 
-  wait_cbs   = self->sup_wait_cbs; 
+  waits      = self->sup_waits;
+  wait_cbs   = self->sup_wait_cbs;
   wait_args  = self->sup_wait_args;
-  wait_roots = self->sup_wait_roots; 
-  
+  wait_roots = self->sup_wait_roots;
+
   for (i = j = 0; (unsigned)i < n_waits; i++) {
     if (wait_roots[i] == root) {
       /* XXX - we should free all resources associated with this */
@@ -872,7 +872,7 @@
     }
     j++;
   }
-  
+
   self->sup_n_waits = j;
   self->sup_registers++;
 
@@ -898,7 +898,7 @@
   int retval;
 
   enter;
-  
+
   assert(self);
   assert(SU_SOURCE_OWN_THREAD(self));
   assert(0 < index && (unsigned)index <= self->sup_max_index);
@@ -927,18 +927,18 @@
     return 1;
   else if (multishot == 0 || multishot == 1)
     return 1;			/* Always enabled */
-  else 
+  else
     return (errno = EINVAL), -1;
 }
 
 
 /** @internal Main loop.
- * 
+ *
  * The function @c su_source_run() runs the main loop
- * 
+ *
  * The function @c su_source_run() runs until @c su_source_break() is called
  * from a callback.
- * 
+ *
  * @param self     pointer to root object
  * */
 void su_source_run(su_port_t *self)
@@ -947,7 +947,7 @@
   GMainLoop *gml;
 
   enter;
-  
+
   gmc = g_source_get_context(self->sup_source);
   if (gmc && g_main_context_acquire(gmc)) {
     gml = g_main_loop_new(gmc, TRUE);
@@ -962,30 +962,30 @@
 /** @internal
  * The function @c su_source_break() is used to terminate execution of @c
  * su_source_run(). It can be called from a callback function.
- * 
+ *
  * @param self     pointer to port
- * 
+ *
  */
 void su_source_break(su_port_t *self)
 {
   enter;
-  
+
   if (self->sup_main_loop)
     g_main_loop_quit(self->sup_main_loop);
 }
 
 /** @internal Block until wait object is signaled or timeout.
  *
- * This function waits for wait objects and the timers associated with 
+ * This function waits for wait objects and the timers associated with
  * the root object.  When any wait object is signaled or timer is
- * expired, it invokes the callbacks. 
- * 
+ * expired, it invokes the callbacks.
+ *
  *   This function returns when a callback has been invoked or @c tout
- *   milliseconds is elapsed. 
+ *   milliseconds is elapsed.
  *
  * @param self     pointer to port
  * @param tout     timeout in milliseconds
- * 
+ *
  * @Return
  *   Milliseconds to the next invocation of timer, or @c SU_WAIT_FOREVER if
  *   there are no active timers.
@@ -995,7 +995,7 @@
   GMainContext *gmc;
 
   enter;
-  
+
   gmc = g_source_get_context(self->sup_source);
 
   if (gmc && g_main_context_acquire(gmc)) {
@@ -1030,8 +1030,8 @@
 }
 
 static int su_source_add_prepoll(su_port_t *port,
-				 su_root_t *root, 
-				 su_prepoll_f *prepoll, 
+				 su_root_t *root,
+				 su_prepoll_f *prepoll,
 				 su_prepoll_magic_t *magic)
 {
   /* We could call prepoll in su_source_prepare()?? */
@@ -1066,7 +1066,7 @@
   fprintf(f, "\tport tid %p\n", (void *)self->sup_tid);
   fprintf(f, "\t%d wait objects\n", self->sup_n_waits);
   for (i = 0; i < self->sup_n_waits; i++) {
-    
+
   }
 }
 
@@ -1078,7 +1078,7 @@
  *
  * @return
  *   If successful a pointer to the new message port is returned, otherwise
- *   NULL is returned.  
+ *   NULL is returned.
  */
 static su_port_t *su_source_port_create(void)
 {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source_test.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source_test.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source_test.c	Tue Dec 23 07:37:03 2008
@@ -28,7 +28,7 @@
  * @brief Test program for glib and su root event loop integration.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Mar 18 19:40:51 1999 pessi
  */
 
@@ -74,7 +74,7 @@
 short opt_singlethread = 0;
 GMainLoop *global_gmainloop = NULL;
 
-static su_socket_t udpsocket(void) 
+static su_socket_t udpsocket(void)
 {
   su_socket_t s;
   su_sockaddr_t su = { 0 };
@@ -98,7 +98,7 @@
 
   if (getsockname(s, &su.su_sa, &sulen) == SOCKET_ERROR) {
     su_perror("udpsocket: getsockname");
-    exit(1); 
+    exit(1);
   }
 
   if (opt_verbatim)
@@ -118,7 +118,7 @@
   return buf;
 }
 
-void 
+void
 do_ping(struct pinger *p, su_timer_t *t, void *p0)
 {
   char buf[1024];
@@ -129,7 +129,7 @@
   p->when = su_now();
 
   snprintf(buf, sizeof(buf), "Ping %d at %s", p->id++, snow(p->when));
-  if (sendto(p->s, buf, strlen(buf), 0, 
+  if (sendto(p->s, buf, strlen(buf), 0,
 	     &p->addr.su_sa, su_sockaddr_size(&p->addr)) == -1) {
     su_perror("do_ping: send");
   }
@@ -189,7 +189,7 @@
   p->id = 0;
 
   snprintf(buf, sizeof(buf), "Pong at %s", snow(su_now()));
-  if (sendto(p->s, buf, strlen(buf), 0, 
+  if (sendto(p->s, buf, strlen(buf), 0,
 	     &p->addr.su_sa, su_sockaddr_size(&p->addr)) == -1) {
     su_perror("do_pong: send");
   }
@@ -412,7 +412,7 @@
 /*
  * test su_wait functionality:
  *
- * Create a ponger, waking up do_recv() when data arrives, 
+ * Create a ponger, waking up do_recv() when data arrives,
  *                  then scheduling do_pong() by timer
  *
  * Create a pinger, executed from timer, scheduling do_ping(),
@@ -428,8 +428,8 @@
   su_timer_t *t;
   unsigned long sleeppid = 0;
 
-  struct pinger 
-    pinger = { PINGER, "ping", 1 }, 
+  struct pinger
+    pinger = { PINGER, "ping", 1 },
     ponger = { PONGER, "pong", 1 };
 
   char *argv0 = argv[0];
@@ -437,7 +437,7 @@
 #if HAVE_OPEN_C
   dup2(1, 2);
 #endif
-  
+
   while (argv[1]) {
     if (strcmp(argv[1], "-v") == 0) {
       opt_verbatim = 1;
@@ -465,9 +465,9 @@
 #if HAVE_OPEN_C
   opt_verbatim = 1;
   opt_singlethread = 1;
-  su_log_soft_set_level(su_log_default, 9);  
+  su_log_soft_set_level(su_log_default, 9);
 #endif
-  
+
 #if HAVE_SIGNAL
   signal(SIGTERM, term);
 #endif
@@ -478,20 +478,20 @@
 
   global_gmainloop = g_main_loop_new(NULL, FALSE);
   g_assert(global_gmainloop);
-  
-  root = su_glib_root_create(NULL); 
+
+  root = su_glib_root_create(NULL);
 
   if (!root) perror("su_root_glib_create"), exit(1);
-  
-  if (!g_source_attach(su_glib_root_gsource(root), g_main_loop_get_context(global_gmainloop))) 
+
+  if (!g_source_attach(su_glib_root_gsource(root), g_main_loop_get_context(global_gmainloop)))
     perror("g_source_attach"), exit(1);
-  
+
   su_root_threading(root, 0 && !opt_singlethread);
 
   if (su_clone_start(root, ping, &pinger, do_init, do_destroy) != 0)
     perror("su_clone_start"), exit(1);
   if (su_clone_start(root, pong, &ponger, do_init, do_destroy) != 0)
-    perror("su_clone_start"), exit(1); 
+    perror("su_clone_start"), exit(1);
 
   /* Test timer, exiting after 200 milliseconds */
   t = su_timer_create(su_root_task(root), 200L);
@@ -499,7 +499,7 @@
     su_perror("su_timer_create"), exit(1);
   su_timer_set(t, (su_timer_f)do_exit, NULL);
 
-  su_msg_create(start_msg, su_clone_task(ping), su_clone_task(pong), 
+  su_msg_create(start_msg, su_clone_task(ping), su_clone_task(pong),
 		init_ping, 0);
   su_msg_send(start_msg);
 
@@ -511,7 +511,7 @@
   su_timer_destroy(t);
 
   if (pinger.rtt_n) {
-    printf("%s executed %u pings in %g, mean rtt=%g sec\n", name, 
+    printf("%s executed %u pings in %g, mean rtt=%g sec\n", name,
 	   pinger.rtt_n, pinger.rtt_total, pinger.rtt_total / pinger.rtt_n);
   }
   su_root_destroy(root);
@@ -519,7 +519,7 @@
   g_main_loop_unref(global_gmainloop), global_gmainloop = NULL;
 
   if (opt_verbatim)
-    printf("%s exiting\n", argv0); 
+    printf("%s exiting\n", argv0);
 
 #ifndef HAVE_WIN32
 #if HAVE_SIGNAL
@@ -531,6 +531,6 @@
 #if HAVE_OPEN_C
    sleep(7);
 #endif
-   
+
   return 0;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/torture_su_glib_timer.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/torture_su_glib_timer.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/torture_su_glib_timer.c	Tue Dec 23 07:37:03 2008
@@ -23,7 +23,7 @@
  */
 
 /**
- * @brief Test program for su-glib timers 
+ * @brief Test program for su-glib timers
  *
  * Based on torture_su_timer.c of libsofia-sip-ua.
  *
@@ -186,7 +186,7 @@
   su_init(); atexit(su_deinit);
 
   tester->root = root = su_glib_root_create(tester);
-  
+
   source = su_root_gsource(tester->root);
   g_source_attach(source, NULL /*g_main_context_default ()*/);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -9,7 +9,7 @@
 2006-10-12  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* libsofia-sip-ua interface v3 frozen (3:0:3) for the 1.12.3 release
-	
+
 2006-09-26  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* libsofia-sip-ua interface v2 frozen (2:0:2) for the 1.12.2 release
@@ -27,9 +27,9 @@
 	* Added urltag_scan().
 
 2006-08-23  Pekka Pessi  <Pekka.Pessi at nokia.com>
-	
+
 	* nta.c, nta.h: added nta_leg_make_replaces(), nta_leg_by_replaces().
-	
+
 	* nua: event watcher (nua_subscribe, nua_watcher) now tries to re-establish
 	  subscription if the subscription was terminated with reason "deactivated" or
 	  "probation". Likewise, if SUBSCRIBE was returned a suitable error response
@@ -49,13 +49,13 @@
 	* <SUBDIRS>/Doxyfile: Fixed the use of doxytags. Now
 	a separate 'doxytags_MODNAME' file is created for each
 	module.
-	
+
 2005-11-15  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-	* <SUBDIRS>/Makefile.am: Changed to use the 'include_sofia_HEADERS' 
+	* <SUBDIRS>/Makefile.am: Changed to use the 'include_sofia_HEADERS'
 	variable for listing public library headers. The variable
 	is defined in the top-level configure.ac.
-	
+
 2005-10-27  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
   * Always including stun library.
@@ -84,7 +84,7 @@
 
 2005-10-14  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
-	  * Shell syntax exercise. 
+	  * Shell syntax exercise.
 
 	    M ./autogen.sh -4 +4
 
@@ -94,7 +94,7 @@
 
 2005-10-13  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-	* <SUBDIRS>/Makefile.am: Build all submodules as proper shared 
+	* <SUBDIRS>/Makefile.am: Build all submodules as proper shared
 	libraries (noinst_LTLIBRARIES). Fixes sf.net:#1264030.
 
 2005-09-09  Pekka Pessi  <Pekka.Pessi at nokia.com>
@@ -179,7 +179,7 @@
 	    M ./iptsec/auth_module.c -5 +5
 
 	Thu Sep  8 21:10:23 EEST 2005  Pekka.Pessi at nokia.com
-	  * Added auth_digest_credentials(). 
+	  * Added auth_digest_credentials().
 	  Use opaque to match Authorization header.
 
 	    M ./iptsec/auth_digest_test.c -2 +3
@@ -319,7 +319,7 @@
 	    M ./url/url.c -1 +6
 
 	Thu Sep  8 18:01:17 EEST 2005  Pekka.Pessi at nokia.com
-	  * Explicitly using <errno.h> 
+	  * Explicitly using <errno.h>
 
 	    M ./msg/msg.c +2
 	    M ./msg/msg_mclass.c +1
@@ -369,10 +369,10 @@
 
 	Thu Sep  8 03:11:35 EEST 2005  Pekka.Pessi at nokia.com
 	  * su_home_new and su_home_unref
-	  Added su_home_new() and su_home_unref(). 
-	  
+	  Added su_home_new() and su_home_unref().
+
 	  Fixed su_home_mutex_lock() and su_home_mutex_unlock().
-	  
+
 	  Slightly changed semantics of su_home_clone() versus
 	  su_home_threadsafe().
 
@@ -386,7 +386,7 @@
 
 	Thu Sep  8 03:07:17 EEST 2005  Pekka.Pessi at nokia.com
 	  * More liberal sdp parsing for config files.
-	  Be more liberal when parsing config files 
+	  Be more liberal when parsing config files
 	  (do not require v=, accept -1 as len argument).
 
 	    M ./sdp/sdp_parse.c -9 +25
@@ -403,7 +403,7 @@
 
 	    M ./sdp/sdp.h +2
 	    M ./sdp/sdp_parse.c +10
-	
+
 2005-09-08  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* Makefile.am: Workaround for automake bug related to adding
@@ -416,7 +416,7 @@
 
 2005-08-17  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
-	* Fixed BEGIN()/END() pairs in test programs. 
+	* Fixed BEGIN()/END() pairs in test programs.
 
 2005-08-04  Pekka Pessi  <Pekka.Pessi at nokia.com>
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -16,13 +16,13 @@
 OPT_SUBDIRS_HTTP =
 OPT_SUBDIRS_NTH =
 if HAVE_STUN
-OPT_LIBADD += stun/libstun.la 
+OPT_LIBADD += stun/libstun.la
 OPT_SUBDIRS_STUN += stun
 endif
 if HAVE_NTH
-OPT_LIBADD += http/libhttp.la nth/libnth.la 
+OPT_LIBADD += http/libhttp.la nth/libnth.la
 OPT_SUBDIRS_HTTP += http
-OPT_SUBDIRS_NTH += nth 
+OPT_SUBDIRS_NTH += nth
 endif
 
 # note: order does matter in the subdir list
@@ -37,7 +37,7 @@
 
 noinst_LTLIBRARIES = libsofia-sip-ua.la
 
-libsofia_sip_ua_la_SOURCES = 
+libsofia_sip_ua_la_SOURCES =
 libsofia_sip_ua_la_LIBADD = 	bnf/libbnf.la \
 				features/libfeatures.la \
 				ipt/libipt.la \
@@ -80,29 +80,27 @@
           fi ; \
 	done
 	for d in $(DIST_SUBDIRS); do \
-	  test -r $$d/Doxyfile \
-	  && pushd $$d > /dev/null \
-	  && echo running ${DOXYGEN} first time in $$d \
-          && ${DOXYGEN} 2>&1 \
-	  | egrep -v -i -e 'Warning: (unsupported (xml/)?html tag|unable to resolve reference|explicit link.*could not be resolved)' \
-          ; popd > /dev/null ; \
-	  test -r docs/$$d.doxytags && \
+	  ( test -r $$d/Doxyfile && \
+	  cd $$d > /dev/null && \
+	  echo running ${DOXYGEN} first time in $$d && \
+          ${DOXYGEN} 2>&1 ) | \
+	  egrep -v -i -e 'Warning: (unsupported (xml/)?html tag|unable to resolve reference|explicit link.*could not be resolved)' ; \
+          test -r docs/$$d.doxytags && \
 	  sed '2,10s!<name>index</name>!<name>'$$d'_index</name>!' \
 	    docs/$$d.doxytags > docs/$$d.doxytags.tmp && \
 	  mv -f docs/$$d.doxytags.tmp docs/$$d.doxytags ; \
-	done 
+	done
 	for d in $(DIST_SUBDIRS); do \
-	  test -r $$d/Doxyfile \
-	  && pushd $$d > /dev/null \
-	  && echo running ${DOXYGEN} second time in $$d \
-          && ${DOXYGEN} 2>&1 \
-	   | egrep -v -i -e 'Warning: Unsupported (xml/)?html tag' \
-          ; popd > /dev/null ; \
+	  ( test -r $$d/Doxyfile && \
+	    cd $$d > /dev/null \
+	    echo running ${DOXYGEN} second time in $$d && \
+            ${DOXYGEN} 2>&1 ) | \
+	    egrep -v -i -e 'Warning: Unsupported (xml/)?html tag' ; \
 	  test -r docs/$$d.doxytags && \
 	  sed '2,10s!<name>index</name>!<name>'$$d'_index</name>!' \
 	    docs/$$d.doxytags > docs/$$d.doxytags.tmp && \
 	  mv -f docs/$$d.doxytags.tmp docs/$$d.doxytags ; \
-	done 
+	done
 	${top_srcdir}/scripts/hide_emails.sh docs/html
 
 if HAVE_LCOV

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.c	Tue Dec 23 07:37:03 2008
@@ -96,10 +96,10 @@
 /** Span of a token */
 size_t bnf_span_token4(char const *s)
 {
-  char const *e = s; 
+  char const *e = s;
   while (_bnf_table[(unsigned char)(*e)] & bnf_token)
-    e++; 
-  return e - s; 
+    e++;
+  return e - s;
 }
 
 char * bnf_span_token_end(char const *s)
@@ -192,9 +192,9 @@
 
 /** Return length of valid IP4 address.
  *
- * Note that we accept here up to two leading zeroes 
+ * Note that we accept here up to two leading zeroes
  * which makes "dotted decimal" notation ambiguous:
- * 127.000.000.001 is interpreted same as 127.0.0.1 
+ * 127.000.000.001 is interpreted same as 127.0.0.1
  *
  * Note that traditionally IP address octets starting
  * with zero have been interpreted as octal:
@@ -711,7 +711,7 @@
 
 /** Return true if @a string is valid IP6 address in hex notation.
  *
- * E.g., fe80::1 is a valid IP6 address. 
+ * E.g., fe80::1 is a valid IP6 address.
  */
 int host_is_ip6_address(char const *string)
 {
@@ -724,7 +724,7 @@
   return host_is_ip6_reference(string);
 }
 
-/** Return true if @a string is valid IP6 reference, 
+/** Return true if @a string is valid IP6 reference,
  *  i.e. hex notation in square brackets.
  *
  * E.g., [::1] is a valid IP6 reference.
@@ -737,7 +737,7 @@
 
 /** Return true if @a string is valid IP address.
  *
- * Valid IP address is either a IP4 adddress in quad-octet notation, 
+ * Valid IP address is either a IP4 adddress in quad-octet notation,
  * IP6 hex address or IP6 reference in square brackets ([]).
  */
 int host_is_ip_address(char const *string)
@@ -748,7 +748,7 @@
 
 /** Return true if @a string is valid a domain name.
  *
- * Valid domain name consists of alphanumeric labels separated with 
+ * Valid domain name consists of alphanumeric labels separated with
  * dot ("."). There can be a "-" in the middle of label.
  * The last label must start with a letter.
  *
@@ -777,8 +777,8 @@
 
 /** Returns true if @a string is describing a local address.
  *
- * Uses the definitions of local addresses found in RFC1700 and 
- * RFC4291. 
+ * Uses the definitions of local addresses found in RFC1700 and
+ * RFC4291.
  */
 int host_is_local(char const *host)
 {
@@ -793,10 +793,10 @@
 
   n = span_domain(host);
 
-  return 
+  return
     n >= 9 /* strlen("localhost") */ &&
     strncasecmp(host, "localhost", 9) == 0 &&
-    (n == 9 || 
+    (n == 9 ||
      ((n == 10 || /* localhost. */
        n == 21 || /* strlen("localhost.localdomain") */
        n == 22) && /* strlen("localhost.localdomain.") */
@@ -866,7 +866,7 @@
     if (canonize) {
       char *tmp = buf;
       s = memcpy(tmp, s, len + 1);
-      scan_ip4_address(&tmp);      
+      scan_ip4_address(&tmp);
     }
     if (s[len] == '\0' && su_inet_pton(AF_INET, s, addr) == 1)
       return (void)(*return_addrlen = 4), len;
@@ -877,14 +877,14 @@
 
 /** Compare two host names or IP addresses
  *
- * Converts valid IP addresses to the binary format before comparing them. 
+ * Converts valid IP addresses to the binary format before comparing them.
  * Note that IP6-mapped IP4 addresses and IP6-compatible IP4 addresses are
  * compared as IP4 addresses; that is, ::ffff:127.0.0.1, ::127.0.0.1 and
  * 127.0.0.1 all are all equal.
  *
  * @param a IP address or domain name
  * @param b IP address or domain name
- * 
+ *
  * @retval -1 if a < b
  * @retval 0 if a == b
  * @retval 1 if a > b

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.docs	Tue Dec 23 07:37:03 2008
@@ -10,9 +10,9 @@
  *
  * The interface used for validating hostnames and IP addresses is in
  * <sofia-sip/hostdomain.h>.
- * 
+ *
  * @CONTACT Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @STATUS @SofiaSIP Core library
  *
  * @LICENSE LGPL

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/bnf.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/bnf.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/bnf.h	Tue Dec 23 07:37:03 2008
@@ -26,11 +26,11 @@
 #define BNF_H
 
 /**@file sofia-sip/bnf.h
- * 
+ *
  * Parsing macros and prototypes for HTTP-like protocols.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Jun 06 10:59:34 2000 ppessi
  *
  */
@@ -58,7 +58,7 @@
 /** Line-ending characters */
 #define CRLF     CR LF
 /** Whitespace */
-#define WS       SP HT 
+#define WS       SP HT
 /** Linear whitespace */
 #define LWS      SP HT CR LF
 /** Lower-case alphabetic characters */
@@ -71,11 +71,11 @@
 #define DIGIT   "0123456789"
 /** RTSP safe characters */
 #define SAFE    "$-_." /* RTSP stuff */
-#define ALPHANUM DIGIT ALPHA 
+#define ALPHANUM DIGIT ALPHA
 #define HEX      DIGIT "ABCDEF" "abcdef"
 
 /** SIP token characters.
- * @note $|&^# were token chars in RFC 2543, but no more in RFC 3261. 
+ * @note $|&^# were token chars in RFC 2543, but no more in RFC 3261.
  */
 #define SIP_TOKEN  ALPHANUM "-.!%*_+`'~"
 /** SIP separator characters */
@@ -109,7 +109,7 @@
 #define skip_word(ss) (*(ss) += span_word(*(ss)))
 
 /** Test if @c is CR or LF */
-#define IS_CRLF(c)       ((c) == '\r' || (c) == '\n') 
+#define IS_CRLF(c)       ((c) == '\r' || (c) == '\n')
 /** Test if @c is linear whitespace */
 #define IS_LWS(c)  	 ((c) == ' ' || (c) == '\t' || (c) == '\r' || (c) == '\n')
 /*#define IS_LWS(c)  	 ((_bnf_table[(unsigned char)(c)] & bnf_lws))*/
@@ -150,7 +150,7 @@
   bnf_unreserved = bnf_alpha | bnf_mark,	/**< URL unreserved */
   bnf_separator = 32,				/**< SIP separator */
   /** SIP token, not alphabetic (0123456789-.!%*_+`'~) */
-  bnf_token0 = 64 | bnf_safe,				
+  bnf_token0 = 64 | bnf_safe,
   bnf_token = bnf_token0 | bnf_alpha,		/**< SIP token */
   bnf_param0 = 128,				/**< SIP parameter, not token */
   bnf_param = bnf_token | bnf_param0 /**< SIP/HTTP parameter */
@@ -171,7 +171,7 @@
 /** Get number of characters before linear whitespace */
 #define span_non_lws(s) strcspn(s, LWS)
 
-/** Calculate span of a linear whitespace. 
+/** Calculate span of a linear whitespace.
  * LWS = [*WSP CRLF] 1*WSP
  */
 su_inline isize_t span_lws(char const *s)
@@ -189,73 +189,73 @@
 /** Calculate span of a token or linear whitespace characters.  */
 su_inline isize_t span_token_lws(char const *s)
 {
-  char const *e = s; 
+  char const *e = s;
   while (_bnf_table[(unsigned char)(*e)] & (bnf_token | bnf_lws))
-    e++; 
-  return e - s; 
+    e++;
+  return e - s;
 }
 
 /** Calculate span of a token characters.  */
 su_inline isize_t span_token(char const *s)
 {
-  char const *e = s; 
+  char const *e = s;
   while (_bnf_table[(unsigned char)(*e)] & bnf_token)
-    e++; 
-  return e - s; 
+    e++;
+  return e - s;
 }
 
 /** Calculate span of a alphabetic characters.  */
 su_inline isize_t span_alpha(char const *s)
 {
-  char const *e = s; 
+  char const *e = s;
   while (_bnf_table[(unsigned char)(*e)] & bnf_alpha)
-    e++; 
-  return e - s; 
+    e++;
+  return e - s;
 }
 
 /** Calculate span of a digits.  */
 su_inline isize_t span_digit(char const *s)
 {
-  char const *e = s; 
+  char const *e = s;
   while (*e >= '0' && *e <= '9')
-    e++; 
-  return e - s; 
+    e++;
+  return e - s;
 }
 
 /** Calculate span of a hex.  */
 su_inline isize_t span_hexdigit(char const *s)
 {
-  char const *e = s; 
+  char const *e = s;
   while (IS_HEX(*e))
-    e++; 
-  return e - s; 
+    e++;
+  return e - s;
 }
 
 /** Calculate span of characters belonging to an RTSP token */
 su_inline isize_t span_alpha_digit_safe(char const *s)
 {
-  char const *e = s; 
+  char const *e = s;
   while (_bnf_table[(unsigned char)(*e)] & (bnf_alpha | bnf_safe))
-    e++; 
-  return e - s; 
+    e++;
+  return e - s;
 }
 
 /** Calculate span of a characters valid in parameters.  */
 su_inline isize_t span_param(char const *s)
 {
-  char const *e = s; 
+  char const *e = s;
   while (IS_PARAM(*e))
-    e++; 
-  return e - s; 
+    e++;
+  return e - s;
 }
 
 /** Calculate span of a SIP word.  */
 su_inline isize_t span_word(char const *s)
 {
-  char const *e = s; 
+  char const *e = s;
   while (*e && (IS_TOKEN(*e) || strchr(SIP_WORD, *e)))
-    e++; 
-  return e - s; 
+    e++;
+  return e - s;
 }
 
 /** Calculate span of a unreserved characters.  */
@@ -290,13 +290,13 @@
 /** Reserved in URLs */
 #define URL_RESERVED        ";/?:=+$,"
 
-/** Non-alphanumeric characters without syntactical meaning. */ 
+/** Non-alphanumeric characters without syntactical meaning. */
 #define URL_MARK            "-_.!~*'()"
 
-/** Unreserved characters. */ 
+/** Unreserved characters. */
 #define URL_UNRESERVED ALPHANUM URL_MARK
 
-/** URL hex escape. */ 
+/** URL hex escape. */
 #define URL_ESCAPED    "%"
 #define URL_DELIMS     "<>#%\""
 #define URL_UNWISE     "{}|\\^[]`"

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/hostdomain.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/hostdomain.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/hostdomain.h	Tue Dec 23 07:37:03 2008
@@ -27,11 +27,11 @@
 #define SOFIA_SIP_HOSTDOMAIN_H
 
 /**@file sofia-sip/hostdomain.h
- * 
+ *
  * Predicates for handling host names: IP addresses or domain names.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Mar  9 16:15:22 EET 2006 ppessi
  */
 
@@ -51,7 +51,7 @@
 SOFIAPUBFUN int host_has_domain_invalid(char const *string);
 SOFIAPUBFUN int host_cmp(char const *a, char const *b);
 
-/** This is typo. @deprecated Use host_is_ip6_reference() instead. */ 
+/** This is typo. @deprecated Use host_is_ip6_reference() instead. */
 SOFIAPUBFUN int host_ip6_reference(char const *string);
 
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/torture_bnf.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/torture_bnf.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/bnf/torture_bnf.c	Tue Dec 23 07:37:03 2008
@@ -281,7 +281,7 @@
   TEST_SCAN(scan_host, "127.255.249.000.a,", "127.255.249.000.a,", ",");
   TEST_SCAN(scan_host, "0.00.000.000:,", "0.0.0.0", ":,");
   TEST_SCAN(scan_host, "127.255.249.000,", "127.255.249.0", ",");
-  TEST_SCAN(scan_host, "[dead:beef:feed:ded:0:1:2:3]:1", 
+  TEST_SCAN(scan_host, "[dead:beef:feed:ded:0:1:2:3]:1",
                        "[dead:beef:feed:ded::1:2:3]", ":1");
   TEST_SCAN(scan_host, "[::127.0.0.1]:1", "[::127.0.0.1]:1", ":1");
 
@@ -323,10 +323,10 @@
   /* Invalid IP4 address (extra leading zeros) */
   TEST_1(!host_cmp("127.0.0.1", "127.0.0.01"));
   /* Invalid reference (extra leading zeros) */
-  TEST_1(host_cmp("[0ffff:0ffff:0ffff:0ffff:0ffff:0ffff:255.255.255.255]", 
+  TEST_1(host_cmp("[0ffff:0ffff:0ffff:0ffff:0ffff:0ffff:255.255.255.255]",
 		  "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"));
 #if SU_HAVE_IN6
-  TEST_1(!host_cmp("[ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255]", 
+  TEST_1(!host_cmp("[ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255]",
 		  "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"));
   TEST_1(!host_cmp("::1", "::001"));
   TEST_1(!host_cmp("[::1]", "::1"));

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -13,7 +13,7 @@
 2005-09-08  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* hide_emails.sh: Fixed bug in hiding addresses of
-	form foo.bar-bar at something.org. Fixed sf.net 
+	form foo.bar-bar at something.org. Fixed sf.net
 	bug #1277167.
 
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.conf
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.conf	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.conf	Tue Dec 23 07:37:03 2008
@@ -55,10 +55,10 @@
 PDF_HYPERLINKS       = YES
 COMPACT_LATEX        = YES
 PAPER_TYPE           = a4wide
-EXTRA_PACKAGES       = 
+EXTRA_PACKAGES       =
 LATEX_BATCHMODE      = YES
 
-FILE_PATTERNS        = *.h *.c 
+FILE_PATTERNS        = *.h *.c
 
 EXCLUDE_PATTERNS     = acconfig.h config.h confdefs.h \
 			test*.h test*.c torture*.c *test.c *torture.c \

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Doxyfile.in	Tue Dec 23 07:37:03 2008
@@ -11,7 +11,7 @@
 
 GENERATE_TAGFILE    = docs.doxytags
 
-TAGFILES            = 
+TAGFILES            =
 TAGFILES            += su.doxytags=su
 TAGFILES            += ipt.doxytags=ipt
 TAGFILES            += bnf.doxytags=bnf

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
 	pictures/autotools.gif \
 	pictures/autotools.vsd \
 	pictures/nta-receiving-message.eps \
-	pictures/nta-receiving-message.gif 
+	pictures/nta-receiving-message.gif
 
 BUILT_SOURCES = Doxyfile.rfc
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/conformance.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/conformance.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/conformance.docs	Tue Dec 23 07:37:03 2008
@@ -145,9 +145,9 @@
 	@ref sip_min_expires "Min-Expires",
 	@ref sip_mime_version "MIME-Version",
 	@ref sip_organization "Organization",
-	@ref sip_p_asserted_identity "P-Asserted-Identity" 
+	@ref sip_p_asserted_identity "P-Asserted-Identity"
         (extension in @VERSION_1_12_7),
-	@ref sip_p_preferred_identity "P-Preferred-Identity" 
+	@ref sip_p_preferred_identity "P-Preferred-Identity"
         (extension in @VERSION_1_12_7),
 	@ref sip_priority "Priority",
 	@ref sip_proxy_authenticate "Proxy-Authenticate",
@@ -479,7 +479,7 @@
 	@RFC3325: Asserted Identity
     </th>
     <td>
-	Sofia-SIP supports 
+	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
@@ -952,7 +952,7 @@
 	(generating, parsing and syntax checking).
 
         The implicit subscription is suppressed by @nua, if the @ReferSub:
-        true header is included in the REFER 
+        true header is included in the REFER
 	request (@ref nua_refer "on server side") or
 	response (@ref nua_i_refer "on client side").
 
@@ -972,7 +972,7 @@
     <td>
 	Sofia-SIP provides function sip_response_terminates_dialog() that
 	can be used to determine the effect of error response with dialog.
-	
+
 	The nua UA engine uses sip_response_terminates_dialog().
     </td>
     <td>
@@ -1131,7 +1131,7 @@
     <td>
         Application must take care of:
 	- Audio or video processing
-        - Generating a=rtpmap or a=fmtp lines when needed 
+        - Generating a=rtpmap or a=fmtp lines when needed
     </td>
 </tr>
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/docguide.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/docguide.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/docguide.docs	Tue Dec 23 07:37:03 2008
@@ -1,33 +1,33 @@
 /*!
 
 @page docguide Documentation Guidelines
- 
+
 @section doxygen Using Doxygen
 
 Doxygen is a document generation program, used by many C/C++ projects. Its
-home page is at <a href="http://www.doxygen.org">http://www.doxygen.org</a>. 
+home page is at <a href="http://www.doxygen.org">http://www.doxygen.org</a>.
 The Sofia documentation is written using Doxygen.
 
 Doxygen works by extracting the documentation data both from the actual
-C/C++ source code and from the specially formatted comments. 
-The comments can contain some Javadoc-like 
- at ref doxycommands "special commands". 
+C/C++ source code and from the specially formatted comments.
+The comments can contain some Javadoc-like
+ at ref doxycommands "special commands".
 
 In general the the style of the comments and documentation should follow the
 <a href="http://java.sun.com/j2se/javadoc/writingdoccomments/">
 javadoc style guide</a>.
 
 A Doxygen comment must either contain reference about the entity
-it is describing, e.g., command 
+it is describing, e.g., command
 \@file when describing files:
 @verbatim
 /**
- * @file foo.c 
- * 
+ * @file foo.c
+ *
  * Implementation of foo. The foo takes care of grokking xyzzy.
- * 
+ *
  * @author Jaska Jokunen <jaska.jokunen at company.com> \n
- * 
+ *
  * @date Created: Wed Oct 20 15:06:51 EEST 2004 jasjoku
  */
 @endverbatim
@@ -40,7 +40,7 @@
 /**
  * Orches a candometer. If orching candometer is not possible, it
  * tries to schadule hearping.
- * 
+ *
  * @param[in]  k        pointer to a candometer
  * @param[in]  level    orching level
  * @param[out] return_hearping return value for schaduled hearping
@@ -59,15 +59,15 @@
 @subsection doxyfile Doxyfile and Doxyfile.conf
 
 The doxygen options are specified through a configuration file,
-<i>Doxyfile</i>. As a convention, a module-specific Doxyfile includes 
-a common file libsofia-sip-ua/docs/Doxyfile.conf. This makes it possible 
+<i>Doxyfile</i>. As a convention, a module-specific Doxyfile includes
+a common file libsofia-sip-ua/docs/Doxyfile.conf. This makes it possible
 to keep the module-specific Doxyfiles as clean as possible:
 
 @code
 PROJECT_NAME         = "ipt"
 OUTPUT_DIRECTORY     = ../docs/ipt
 
-INPUT 		     = ipt.docs . 
+INPUT 		     = ipt.docs .
 
 @INCLUDE = ../Doxyfile.conf
 
@@ -80,7 +80,7 @@
 Doxygen-generated HTML documentation is collected in @b docs
 subdirectory at top level. A separate output directory is created for
 each submodule under it. Doxytags for the module are generated in the @e
-doxytags file in the output directory. 
+doxytags file in the output directory.
 
 @subsection module_docs Module documentation in \<module\>.docs
 
@@ -105,7 +105,7 @@
 
 @section ipt_overview Overview
 
-This module contain some routines useful for IPT applications, like 
+This module contain some routines useful for IPT applications, like
 - ...
 - ...
 */
@@ -115,7 +115,7 @@
 
 In this section we go through the most common Doxygen commands. All
 the commands are explained in the manual.
-The commands include 
+The commands include
 - @ref doxystyle "style commands (@@a, @@b, @@c, @@e, @@em, @@p)"
 - @ref doxyfuncs "function parameters and return values (@@param, @@return, @@retval)"
 
@@ -123,17 +123,17 @@
 
 The text style can be changed with @@b @b (bold), @@c @c (code), or
 @@e @e (italic) commands. Function argument names use style command
-@@a. 
+@@a.
 
 For example, a sentence "The @b Content-Type header @a ct specifies the @e
 media-type of the message body, e.g., @c audio/amr would be AMR-encoded
 audio." is produced with commands like
 @code
-The @b Content-Type header @a ct specifies the @e media-type of 
+The @b Content-Type header @a ct specifies the @e media-type of
 the message body, e.g., @c audio/amr would be AMR-encoded audio.
- at endcode 
+ at endcode
 
-The style commands have synonyms, e.g., @@em and @@e mean same, as 
+The style commands have synonyms, e.g., @@em and @@e mean same, as
 well as @@c and @@p.
 
 @subsection doxyfuncs Function Parameters and Return Values - @param, @return, @retval
@@ -150,11 +150,11 @@
 
 @verbatim
 /**Schadule hearping.
- * 
+ *
  * The function schadule() schadules a hearping.
- * 
+ *
  * @param[in] h pointer to hearping
- * 
+ *
  * @retval 0  hearping was successful
  * @retval -1 an error occurred
  */
@@ -170,12 +170,12 @@
 commands.
 @verbatim
 /**Destroy a hearping.
- * 
+ *
  * The function hearping_destroy() deinitializes a hearping and
- * reclaims the memory allocated for it. 
- * 
+ * reclaims the memory allocated for it.
+ *
  * @param[in,out] h pointer to pointer to hearping
- * 
+ *
  * The function clears the pointer to hearping, so it must be called
  * with a pointer to pointer:
  * @code
@@ -204,7 +204,7 @@
 When the structure of the documentation does not follow directory or file
 structure, it is possible to use grouping commands @@defgroup and @@ingroup.
 The command @@defgroup creates a group, and @@ingroup adds an entry to an
-group. 
+group.
 
 @subsection doclinking Creating Links
 
@@ -215,7 +215,7 @@
 variable is prefixed with hash @#, Doxygen creates a link to it.
 
 It is also possible to create links with freely selected link to
-documentation entries with @@link and @@endlink commands. 
+documentation entries with @@link and @@endlink commands.
 
 When the link target is a named page, section, or subsection, it is possible
 to use the @@ref command.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/mainpage.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/mainpage.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/docs/mainpage.docs	Tue Dec 23 07:37:03 2008
@@ -8,39 +8,39 @@
 for Sofia-SIP components. Some introductory material and
 pointers to the example code are also included.
 
-For a list of module specific pages, see @ref subdirs 
+For a list of module specific pages, see @ref subdirs
 "source tree structure" or direct links to submodules:<br>
-<a href="nua/index.html">nua</a> 
-<a href="su/index.html">su</a> 
-<a href="features/index.html">features</a> 
-<a href="soa/index.html">soa</a> 
-<a href="sdp/index.html">sdp</a> 
-<a href="nta/index.html">nta</a> 
-<a href="tport/index.html">tport</a> 
-<a href="sresolv/index.html">sresolv</a> 
-<a href="sip/index.html">sip</a> 
-<a href="msg/index.html">msg</a> 
-<a href="url/index.html">url</a> 
-<a href="stun/index.html">stun</a> 
-<a href="iptsec/index.html">iptsec</a> 
-<a href="nea/index.html">nea</a> 
-<a href="nth/index.html">nth</a> 
-<a href="http/index.html">http</a> 
-<a href="bnf/index.html">bnf</a> 
-<a href="ipt/index.html">ipt</a> 
+<a href="nua/index.html">nua</a>
+<a href="su/index.html">su</a>
+<a href="features/index.html">features</a>
+<a href="soa/index.html">soa</a>
+<a href="sdp/index.html">sdp</a>
+<a href="nta/index.html">nta</a>
+<a href="tport/index.html">tport</a>
+<a href="sresolv/index.html">sresolv</a>
+<a href="sip/index.html">sip</a>
+<a href="msg/index.html">msg</a>
+<a href="url/index.html">url</a>
+<a href="stun/index.html">stun</a>
+<a href="iptsec/index.html">iptsec</a>
+<a href="nea/index.html">nea</a>
+<a href="nth/index.html">nth</a>
+<a href="http/index.html">http</a>
+<a href="bnf/index.html">bnf</a>
+<a href="ipt/index.html">ipt</a>
 
 @section who Contact Information
 
-You can download latest Sofia SIP from the project 
-<a href="http://sofia-sip.sf.net">home page</a> at 
+You can download latest Sofia SIP from the project
+<a href="http://sofia-sip.sf.net">home page</a> at
 <a href="sf.net">Sourceforge.net</a>.
 
 Please contact us if you have questions regarding this software:
 
-<ul> 
+<ul>
 <li>Pekka Pessi <Pekka.Pessi at nokia.com></li>
 <li>Kai Vehmanen <Kai.Vehmanen at nokia.com></li>
-</ul> 
+</ul>
 
 Or post to the Sofia-SIP mailing list:
 
@@ -68,7 +68,7 @@
 SIP Signaling:
  - <a href="nua/index.html">"nua" - SIP User Agent library</a>
  - <a href="nea/index.html">"nea" - SIP Event API</a>
- - <a href="iptsec/index.html">"iptsec" - 
+ - <a href="iptsec/index.html">"iptsec" -
     Digest authentication for HTTP and SIP</a>
  - <a href="nta/index.html">"nta" - SIP transaction engine</a>
  - <a href="tport/index.html">"tport" - Message transport</a>
@@ -103,7 +103,7 @@
 formatting within Sofia-SIP. The guidelines include identifier naming
 conventions, indenting convention, and tool usage directions.
 
-Please note that C style is always a matter of taste. 
+Please note that C style is always a matter of taste.
 
 @section naming Naming Conventions
 
@@ -177,7 +177,7 @@
 -saw -nsc -nsob -nss
 @endcode
 
-Loops without condition use @c for @c (;;) instead of @c while @c (1). 
+Loops without condition use @c for @c (;;) instead of @c while @c (1).
 
 @code
   for (;;) {
@@ -220,7 +220,7 @@
 wrapper interface.
 
 SU module handles abstraction to OS specific functionality such as
-memory management, sockets, threads and time functions. 
+memory management, sockets, threads and time functions.
 
 @subsection ansi_99 ANSI C 99 features
 
@@ -322,7 +322,7 @@
 
 If compiler decides to pack this structure, this code generates a
 structure that has @a bar and @a foo in the first seven bits, and then
- at a something beginning from the next 32 bit boundary. 
+ at a something beginning from the next 32 bit boundary.
 
 One problem arises when using packed bit-fields: on ARM it is
 generally not possible to access a 32 bit field that does not start from
@@ -348,9 +348,9 @@
 @section file_organization File and Directory Structure
 
 A Sofia-SIP library module can be defined as a subdirectory under the
-libsofia-sip-ua directory hierarchy that contains a file \<modulename\>.docs 
-(where the \<modulename\> of course referes to the actual name of 
-the module). 
+libsofia-sip-ua directory hierarchy that contains a file \<modulename\>.docs
+(where the \<modulename\> of course referes to the actual name of
+the module).
 
 In case you like to start developing a new module, please
 contact Sofia-SIP development team so that they can help you to set up
@@ -364,16 +364,16 @@
     Contains any pictures/images
     that are needed by the module documentation. The
     file formats to use are GIF (for html pages) and
-    EPS (for latex). If some program (e.g. MS Visio) is 
+    EPS (for latex). If some program (e.g. MS Visio) is
     used to create the pictures, also the original
     files must be stored here.\n
     (Note that old modules may have "images" subdirectory instead of
     "pictures")
   - files Makefile.am \n
     See section @ref build "dealing with GNU Autotools" below.
-  - (optionally) source code file(s) of the module and module tests. 
+  - (optionally) source code file(s) of the module and module tests.
     The source code file(s) can also be located in subdirectories if necesary.
-    
+
 
 @section oo_with_c Writing Object-Oriented Code
 
@@ -423,17 +423,17 @@
 
 @subsection oo_derived Inheritance and Derived Objects
 
-Inheritance is a object-oriented practice that has limited use in Sofia. 
+Inheritance is a object-oriented practice that has limited use in Sofia.
 Most common example of inheritance is use of #su_home_t. Many objects are
 derived from #su_home_t, which means that they can use the various
-home-based memory management functions from <su_alloc.h>. 
+home-based memory management functions from <su_alloc.h>.
 
 In this sence, inheritance means that a pointer to a derived object can be
 casted as a pointer to a base object. In other words, the derived object
 must have the base object at the beginning of its memory area:
 
 @code
-struct derived 
+struct derived
 {
   struct base base[1];
   int         extra;
@@ -452,19 +452,19 @@
 
 @subsection oo_templates Templates
 
-There are a few template types implemented as macros in Sofia libraries. 
+There are a few template types implemented as macros in Sofia libraries.
 They include hash table, defined in <sofia-sip/htable.h>, which can be used
 to define hash tables types and accessor functions for different object, and
 red-black tree, defined in <sofia-sip/rbtree.h>.
 
 @section memory Memory Management
 
-The home-based memory management is useful when a lot of memory blocks are 
-allocated for given task. The allocations are done via the memory home, 
-which keeps a reference to each allocated memory block. When the memory 
-home is then freed, it will free all memory blocks to which it has 
-reference. This simplifies application logic because application code does 
-not need to keep track of the allocated memory and free every allocated block 
+The home-based memory management is useful when a lot of memory blocks are
+allocated for given task. The allocations are done via the memory home,
+which keeps a reference to each allocated memory block. When the memory
+home is then freed, it will free all memory blocks to which it has
+reference. This simplifies application logic because application code does
+not need to keep track of the allocated memory and free every allocated block
 separately.
 
 See documentation of <sofia-sip/su_alloc.h> and @ref su_alloc "memory managment tutorial"
@@ -502,8 +502,8 @@
 @subsection combining Combining allocations
 
 Another place where home-based memory management makes programmers
-life easier is case where a sub-procedure makes multiple memory allocations 
-and, in case the sub-procedure fails, all the allocations must be released 
+life easier is case where a sub-procedure makes multiple memory allocations
+and, in case the sub-procedure fails, all the allocations must be released
 and, in case the sub-procedure is succesfull, all allocations must be
 controlled by upper level memory management.
 
@@ -522,7 +522,7 @@
     }
     /* destroy temporary memory home (and registered allocations) */
     /* Note than in case processing was succesfull the memory     */
-    /* registrations were already moved to upper level home.      */ 
+    /* registrations were already moved to upper level home.      */
     su_home_deinit(temphome);
 
     /* return ok/not-ok */
@@ -542,9 +542,9 @@
   - valid args
   - not valid args
 - Aim for 100% line coverage\n
-  (If there is a line of code that you have not tested, you don't know 
+  (If there is a line of code that you have not tested, you don't know
   if its working.) \n
-  For selected part of code you should also aim for 
+  For selected part of code you should also aim for
   100% branch/path coverage.\n
   But be anyway reasonable with these because in practise complete
   coverage is next to impossible to achive (so 80% is ok in practise).
@@ -573,13 +573,13 @@
 
 Each test program should either return zero for success or a non-zero
 error code in its main function. Now when you run "make check",
- at b my_test_foo and @b my_test_bar will be built and then run. 
+ at b my_test_foo and @b my_test_bar will be built and then run.
 Make will print a
-summary of how the tests went. As these tests are run from the build 
-system, the tests must be non-interactive (no questions asked) and not 
+summary of how the tests went. As these tests are run from the build
+system, the tests must be non-interactive (no questions asked) and not
 rely on any files that are not in version control system.
 
-Sofia SIP's top-level makefile contains a recursive check target, so 
+Sofia SIP's top-level makefile contains a recursive check target, so
 you can use "cd sofia-sip ; make check" to run all the existing tests
 with a single command.
 
@@ -594,7 +594,7 @@
 <a href="http://developer.gnome.org/doc/books/WGA/generating-makefiles.html">
 developer.gnome.org</a>. <a href="http://sources.redhat.com/autobook">Autobook</a>
 provides more detailed documentation for autoconf and automake.
-The <a href="http://www.gnu.org/manual/make/">GNU make manual</a> 
+The <a href="http://www.gnu.org/manual/make/">GNU make manual</a>
 is also a good source of information.
 
 @subsection autogen_sh autogen.sh
@@ -629,14 +629,14 @@
 
 @subsection aclocal_m4 aclocal.m4
 
-The aclocal.m4 contains the definitions of the autoconf macros used in 
+The aclocal.m4 contains the definitions of the autoconf macros used in
 @b configure.ac.
 
 This file is generated by aclocal command.
 
 @subsection Makefile_am Makefile.am
 
-Makefile.am is where you define what programs and libraries should 
+Makefile.am is where you define what programs and libraries should
 be built, and also what source files are needed to create them.
 When you run automake, it creates the file Makefile.in.
 
@@ -644,12 +644,12 @@
 
 @subsection configure configure
 
-When you run configure script, it performs all the checks defined in 
- at b configure.ac and then replaces all @b xxx.in files with equivalent 
- at b xxx files. All @c @@FOO@@ variables in the source @b *.in files are 
+When you run configure script, it performs all the checks defined in
+ at b configure.ac and then replaces all @b xxx.in files with equivalent
+ at b xxx files. All @c @@FOO@@ variables in the source @b *.in files are
 replaced with values found during the configuration process. For instance
-the variable @c @@srcdir@@ in @b Makefile.in is replaced in @b Makefile 
-with the source directory path (useful when compiling outside the main 
+the variable @c @@srcdir@@ in @b Makefile.in is replaced in @b Makefile
+with the source directory path (useful when compiling outside the main
 source tree).
 
 This file is generated by autoconf command.
@@ -658,14 +658,14 @@
 
 This script stores the last parameters given to configre command.
 If necessary you can rerun the last given configure script (with given
-parameters) by using command "./config.status -r" or 
+parameters) by using command "./config.status -r" or
 "./config.status --recheck".
 
 This file is generated by configure script.
 
 @subsection config_cache config.cache
 
-This file contains results of the various checks that configure script 
+This file contains results of the various checks that configure script
 performed. In case the configure script failed, you might try to
 delete this file and run the configure script again.
 
@@ -673,8 +673,8 @@
 
 @subsection Makefile Makefile
 
-The @b Makefile contains the actual rules how to build the target 
-libraries and program. It is used by the @c make program. @b Makefile 
+The @b Makefile contains the actual rules how to build the target
+libraries and program. It is used by the @c make program. @b Makefile
 is generated from @b Makefile.in when you run @c autoconf command.
 Ensure that "make dist" and "make install" targets work.
 
@@ -726,7 +726,7 @@
 - 7 SU_DEBUG_7() - media protocol actions (incoming packets, ...)
 - 9 SU_DEBUG_9() - entering/exiting functions, very verbatim progress
 
-In addition to the macros mentioned above, there is also functions for 
+In addition to the macros mentioned above, there is also functions for
 printing logging messages:
 - su_llog(), su_vllog()
 - su_perror(), su_perror2()

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/features/features.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/features/features.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/features/features.c	Tue Dec 23 07:37:03 2008
@@ -43,15 +43,15 @@
  */
 char const * const sofia_sip_name_version = SOFIA_SIP_NAME_VERSION;
 
-/** The name and version of software package providing S/MIME functionality, 
+/** The name and version of software package providing S/MIME functionality,
  *  NULL if none.
  */
 char const * sofia_sip_has_smime;
 
 
-/** The name and version of software package providing TLS functionality, 
- *  NULL if none. 
- * 
+/** The name and version of software package providing TLS functionality,
+ *  NULL if none.
+ *
  * TLS over TCP is used as transport for SIP messages when using SIPS
  * scheme. Using TLS over TCP with SIP is described in @RFC3261.
  */
@@ -61,16 +61,16 @@
 char const * sofia_sip_has_tls;
 #endif
 
-/** The name and version of software package providing DTLS functionality, 
- *  NULL if none. 
+/** The name and version of software package providing DTLS functionality,
+ *  NULL if none.
  *
  * DTLS or TLS over datagram transport (UDP) can be used as transport for
  * SIP messages.
  */
 char const * sofia_sip_has_dtls;
 
-/** The name and version of software package providing TLS over SCTP functionality, 
- *  NULL if none. 
+/** The name and version of software package providing TLS over SCTP functionality,
+ *  NULL if none.
  *
  * TLS over SCTP can be used as transport for SIP messages.
  */
@@ -80,8 +80,8 @@
 #include <sigcomp.h>
 #endif
 
-/** The name and version of software package providing SigComp functionality, 
- *  NULL if none. 
+/** The name and version of software package providing SigComp functionality,
+ *  NULL if none.
  *
  * SigComp can be used to compress SIP messages.
  */
@@ -91,8 +91,8 @@
 char const * sofia_sip_has_sigcomp;
 #endif
 
-/** The name and version of software package providing STUN functionality, 
- *  NULL if none. 
+/** The name and version of software package providing STUN functionality,
+ *  NULL if none.
  *
  * STUN is a protocol used to traverse NATs with UDP.
  */
@@ -103,21 +103,21 @@
 char const * sofia_sip_has_stun;
 #endif
 
-/** The name and version of software package providing TURN functionality, 
- *  NULL if none. 
+/** The name and version of software package providing TURN functionality,
+ *  NULL if none.
  *
  * TURN is a protocol used to traverse NATs or firewalls with TCP or UDP.
  */
 char const * sofia_sip_has_turn;
 
-/** The name and version of software package providing UPnP functionality, 
- *  NULL if none. 
+/** The name and version of software package providing UPnP functionality,
+ *  NULL if none.
  *
  * UPnP (Universal Plug and Play) can be used to traverse NATs or firewalls.
  */
 char const * sofia_sip_has_upnp;
 
-/** The name and version of software package providing SCTP functionality, 
+/** The name and version of software package providing SCTP functionality,
  *  NULL if none.
  *
  * SCTP can be used as transport for SIP messages. The software providing it
@@ -126,7 +126,7 @@
 char const * sofia_sip_has_sctp;
 /* We don't have viable SCTP transport interface */
 
-/** The name and version of software package providing IPv6 functionality, 
+/** The name and version of software package providing IPv6 functionality,
  *  NULL if none.
  *
  * IPv6 can be used to send SIP messages.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/features/features.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/features/features.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/features/features.docs	Tue Dec 23 07:37:03 2008
@@ -22,8 +22,8 @@
 installed @a libsofia-sip-ua.so library. The macro #SOFIA_SIP_NAME_VERSION
 contains the name and release of currently available include files.
 
-The Sofia SIP binary API hides some protocols used under the SIP stack. 
-While the binary API stays the same, the features are not necessarily there. 
+The Sofia SIP binary API hides some protocols used under the SIP stack.
+While the binary API stays the same, the features are not necessarily there.
 These features are mainly related to encryption, compression and underlying
 transports.
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/Doxyfile.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/Doxyfile.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/Doxyfile.in	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 PROJECT_NAME         = "http"
 OUTPUT_DIRECTORY     = ../docs/html/http
 
-INPUT 		     = @srcdir@/http.docs @srcdir@/sofia-sip sofia-sip @srcdir@ . 
+INPUT 		     = @srcdir@/http.docs @srcdir@/sofia-sip sofia-sip @srcdir@ .
 
 @INCLUDE_PATH = . @srcdir@
 @INCLUDE = ../docs/Doxyfile.conf

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -29,12 +29,12 @@
 			sofia-sip/http_parser.h sofia-sip/http_tag_class.h \
 			sofia-sip/http_status.h sofia-sip/http_hclasses.h
 
-BUILT_H = 		sofia-sip/http_protos.h sofia-sip/http_tag.h 
+BUILT_H = 		sofia-sip/http_protos.h sofia-sip/http_tag.h
 BUILT_C = 		http_tag.c http_parser_table.c
 
 BUILT_SOURCES = 	$(BUILT_H) $(BUILT_C) http_tag_ref.c
 
-nobase_include_sofia_HEADERS = $(BUILT_H) $(PUBLIC_H) 
+nobase_include_sofia_HEADERS = $(BUILT_H) $(PUBLIC_H)
 
 libhttp_la_SOURCES = 	$(INTERNAL_H) \
 			http_parser.c http_header.c \
@@ -77,7 +77,7 @@
 
 ${BUILT_H} ${BUILT_C}: ${srcdir}/sofia-sip/http.h ${MSG_PARSER_AWK}
 
-sofia-sip/http_protos.h: ${srcdir}/sofia-sip/http_protos.h.in 
+sofia-sip/http_protos.h: ${srcdir}/sofia-sip/http_protos.h.in
 	@-mkdir sofia-sip 2>/dev/null || true
 	${AWK_HTTP_AWK} PR=$@ TEMPLATE=${srcdir}/sofia-sip/http_protos.h.in ${SS_HTTP_H}
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http.docs	Tue Dec 23 07:37:03 2008
@@ -26,13 +26,13 @@
  *  - @c http_X_t is the structure used to store parsed header,
  *  - @c HTTP_X_INIT() initializes a static instance of http_X_t,
  *  - @c http_X_p() tests if header object is instance of header X,
- *  - @c http_X_make() is a macro that creates a header X object by 
+ *  - @c http_X_make() is a macro that creates a header X object by
          decoding given string,
- *  - @c http_X_dup() duplicates (deeply copies) the header X (macro), 
+ *  - @c http_X_dup() duplicates (deeply copies) the header X (macro),
  *  - @c http_X_copy() is a macro that copies the header X (macro),
- *  - @c #msg_hclass_t http_X_class[] contains the @em header @em class 
+ *  - @c #msg_hclass_t http_X_class[] contains the @em header @em class
  *    for header X.
- * 
+ *
  * In addition to this interface, the parser provider interface is
  * documented in the <a href="../sip/group__sip__parser.html">SIP Parser module</a>.
  * The parser provider interface makes it possible to extend HTTP parser with

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c	Tue Dec 23 07:37:03 2008
@@ -197,7 +197,7 @@
 
   if (msg_firstline_d(s, &status, &phrase) < 0 ||
       http_version_d(&s, &st->st_version) < 0 || *s ||
-      msg_uint32_d(&status, &code) == -1 || 
+      msg_uint32_d(&status, &code) == -1 ||
       status[0])
     return -1;
 
@@ -341,7 +341,7 @@
 #define http_authentication_info_dup_one msg_list_dup_one
 
 msg_hclass_t http_authentication_info_class[] =
-HTTP_HEADER_CLASS(authentication_info, "Authentication-Info", 
+HTTP_HEADER_CLASS(authentication_info, "Authentication-Info",
 		  ai_params, list, authentication_info);
 
 /* ====================================================================== */
@@ -427,7 +427,7 @@
 /**@ingroup http_content_range
  * @typedef typedef struct http_content_range_s http_content_range_t;
  *
- * The structure #http_content_range_t contains representation of 
+ * The structure #http_content_range_t contains representation of
  * @b Content-Range header.
  *
  * The #http_content_range_t is defined as follows:
@@ -652,7 +652,7 @@
 HTTP_HEADER_CLASS(expires, "Expires", d_common, single, default);
 
 /* ====================================================================== */
-/**@HTTP_HEADER http_from From header. 
+/**@HTTP_HEADER http_from From header.
  *
  * @code
  *    From   = "From" ":" mailbox
@@ -773,7 +773,7 @@
 /**@ingroup http_if_modified_since
  * @typedef typedef struct http_if_modified_since_s http_if_modified_since_t;
  *
- * The structure #http_if_modified_since_t contains representation of 
+ * The structure #http_if_modified_since_t contains representation of
  * @b If-Modified-Since header.
  *
  * The #http_if_modified_since_t is defined as follows:
@@ -790,7 +790,7 @@
 #define http_if_modified_since_e http_date_e
 
 msg_hclass_t http_if_modified_since_class[] =
-HTTP_HEADER_CLASS(if_modified_since, "If-Modified-Since", 
+HTTP_HEADER_CLASS(if_modified_since, "If-Modified-Since",
 		  d_common, single, default);
 
 /* ====================================================================== */
@@ -802,7 +802,7 @@
 HTTP_HEADER_CLASS_LIST(if_none_match, "If-None-Match", list);
 
 /* ====================================================================== */
-/**@HTTP_HEADER http_if_range If-Range header. 
+/**@HTTP_HEADER http_if_range If-Range header.
  *
  * The @b If-Range header is used when a client has a partial copy of an
  * entity in its cache, and wishes to have an up-to-date copy of the entire
@@ -813,7 +813,7 @@
  * @code
  *   If-Range = "If-Range" ":" ( entity-tag / HTTP-date )
  * @endcode
- */    
+ */
 
 /** Parse If-Range header */
 issize_t http_if_range_d(su_home_t *home, http_header_t *h, char *s, isize_t slen)
@@ -892,7 +892,7 @@
 /**@ingroup http_if_unmodified_since
  * @typedef typedef http_date_t http_if_unmodified_since_t;
  *
- * The structure #http_if_unmodified_since_t contains representation of 
+ * The structure #http_if_unmodified_since_t contains representation of
  * @b If-Unmodified-Since header.
  *
  * The #http_if_unmodified_since_t is defined as follows:
@@ -909,7 +909,7 @@
 #define http_if_unmodified_since_e http_date_e
 
 msg_hclass_t http_if_unmodified_since_class[] =
-HTTP_HEADER_CLASS(if_unmodified_since, "If-Unmodified-Since", 
+HTTP_HEADER_CLASS(if_unmodified_since, "If-Unmodified-Since",
 		  d_common, single, default);
 
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_extra.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_extra.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_extra.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@CFILE http_extra.c 
+/**@CFILE http_extra.c
  *
  * Extra HTTP headers
  *
@@ -162,7 +162,7 @@
     }
     else {
       s += strcspn(s, ",;" LWS);
-      if (s == v) 
+      if (s == v)
 	return -1;
     }
 
@@ -352,7 +352,7 @@
 
   /* Special cases from Netscape spec */
   if (LOOKING_AT(s, "expires=")) {
-    msg_time_t value; 
+    msg_time_t value;
     msg_date_d((char const **)&rest, &value);
   } else if (LOOKING_AT(s, "path=/")) {
     for (;;) {
@@ -366,8 +366,8 @@
   }
 #undef LOOKING_AT
 
-  if (IS_LWS(*rest)) { 
-    *rest++ = '\0'; skip_lws(&rest); 
+  if (IS_LWS(*rest)) {
+    *rest++ = '\0'; skip_lws(&rest);
   }
 
   return rest - s;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_header.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_header.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_header.c	Tue Dec 23 07:37:03 2008
@@ -88,7 +88,7 @@
       msg_fragment_clear(http->http_content_length->l_common);
     }
   }
-  
+
   if (!http->http_separator)
     http->http_separator = http_separator_create(home);
 
@@ -118,13 +118,13 @@
 
 /** Add a Content-Length and separator to a message */
 int http_message_complete(msg_t *msg, http_t *http)
-{ 
+{
 #if 1
   if (!http->http_content_length) {
     http_content_length_t *l;
     http_payload_t *pl;
     size_t len = 0;
-    
+
     for (pl = http->http_payload; pl; pl = pl->pl_next)
       len += pl->pl_len;
 
@@ -148,8 +148,8 @@
 }
 
 /** Add headers from the request to the response message. */
-int http_complete_response(msg_t *msg, 
-			   int status, char const *phrase, 
+int http_complete_response(msg_t *msg,
+			   int status, char const *phrase,
 			   http_t const *request)
 {
   su_home_t *home = msg_home(msg);
@@ -210,7 +210,7 @@
   return h->sh_class->hc_print(b, bsiz, h, flags);
 }
 
-http_header_t *http_header_format(su_home_t *home, 
+http_header_t *http_header_format(su_home_t *home,
 				  msg_hclass_t *hc,
 				  char const *fmt,
 				  ...)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_parser.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_parser.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_parser.c	Tue Dec 23 07:37:03 2008
@@ -75,7 +75,7 @@
 #define CRLF_TEST(s) \
   (((s)[0]) == '\r' ? (((s)[1]) == '\n') + 1 : ((s)[0])=='\n')
 
-/** Extract the HTTP message body, including separator line. 
+/** Extract the HTTP message body, including separator line.
  *
  * @retval -1    error
  * @retval 0     cannot proceed
@@ -98,7 +98,7 @@
     if (!eos && (bsiz == 0 || (bsiz == 1 && b[0] == '\r')))
       return 0;
 
-    m = CRLF_TEST(b); 
+    m = CRLF_TEST(b);
 
     assert(m > 0 || eos); /* We should be looking at an empty line */
 
@@ -143,7 +143,7 @@
 	 */
 	http->http_transfer_encoding->k_items &&
 	http->http_transfer_encoding->k_items[0] &&
-	strcasecmp(http->http_transfer_encoding->k_items[0], 
+	strcasecmp(http->http_transfer_encoding->k_items[0],
 		   "identity") != 0) {
       http->http_flags |= MSG_FLG_CHUNKS;
 
@@ -162,16 +162,16 @@
     body_len = http->http_content_length->l_length;
   /* We cannot parse multipart/byteranges ... */
   else if (http->http_content_type && http->http_content_type->c_type &&
-	   strcasecmp(http->http_content_type->c_type, "multipart/byteranges") 
+	   strcasecmp(http->http_content_type->c_type, "multipart/byteranges")
 	   == 0)
     return -1;
   else if (MSG_IS_MAILBOX(flags)) /* message fragments */
     body_len = 0;
-  else if (http->http_request) 
+  else if (http->http_request)
     body_len = 0;
   else if (eos)
     body_len = bsiz;
-  else 
+  else
     return 0;			/* XXX */
 
   if (body_len == 0) {
@@ -198,7 +198,7 @@
   return m;
 }
 
-/** Extract a chunk. 
+/** Extract a chunk.
  *
  * @retval -1    error
  * @retval 0     cannot proceed
@@ -210,7 +210,7 @@
   unsigned crlf, chunk_len;
   char *b0 = b, *s;
   union {
-    msg_header_t *header;  
+    msg_header_t *header;
     msg_payload_t *chunk;
   } h = { NULL };
   size_t bsiz0 = bsiz;
@@ -234,15 +234,15 @@
     assert(crlf < bsiz);
 
     /* Skip crlf */
-    b += crlf; bsiz -= crlf;  
+    b += crlf; bsiz -= crlf;
   }
 
   /* Now, looking at the chunk header */
-  n = strcspn(b, CRLF); 
-  if (!eos && n == bsiz) 
+  n = strcspn(b, CRLF);
+  if (!eos && n == bsiz)
     return 0;
   crlf = CRLF_TEST(b + n);
-  
+
   if (n == 0) {
     if (crlf == bsiz && eos) {
       msg_mark_as_complete(msg, MSG_FLG_COMPLETE | MSG_FLG_FRAGS);
@@ -267,7 +267,7 @@
 
     crlf = bsiz > 0 ? CRLF_TEST(b) : 0;
 
-    if ((eos && bsiz == 0) || crlf == 2 || 
+    if ((eos && bsiz == 0) || crlf == 2 ||
 	(crlf == 1 && (bsiz > 1 || b[0] == '\n'))) {
       /* Shortcut - We got empty trailers */
       b += crlf;
@@ -285,7 +285,7 @@
     b += n + crlf, bsiz -= n + crlf;
 
     /* Extract chunk */
-    chunk = msg_extract_payload(msg, http, 
+    chunk = msg_extract_payload(msg, http,
 				&h.header, chunk_len + (b - b0),
 				b0, bsiz0, eos);
 
@@ -294,7 +294,7 @@
       h.chunk->pl_data += (b - b0);
       h.chunk->pl_len -= (b - b0);
     }
-  
+
     return chunk;
   }
 }
@@ -312,12 +312,12 @@
   char const *result;
   int const version_size = sizeof(http_version_1_1) - 1;
 
-  if (strncasecmp(s, http_version_1_1, version_size) == 0 && 
+  if (strncasecmp(s, http_version_1_1, version_size) == 0 &&
       !IS_TOKEN(s[version_size])) {
     result = http_version_1_1;
     s += version_size;
   }
-  else if (strncasecmp(s, http_version_1_0, version_size) == 0 && 
+  else if (strncasecmp(s, http_version_1_0, version_size) == 0 &&
 	   !IS_TOKEN(s[version_size])) {
     result = http_version_1_0;
     s += version_size;
@@ -348,7 +348,7 @@
       memmove(s + l1 + 1, s + n - l2, l2);
       s[l1 + 1 + l2] = 0;
 
-      /* Compare again with compacted version */ 
+      /* Compare again with compacted version */
       if (strcasecmp(s, http_version_1_1) == 0)
 	result = http_version_1_1;
       else if (strcasecmp(s, http_version_1_0) == 0)
@@ -359,10 +359,10 @@
   }
 
   while (IS_LWS(*s)) *s++ = '\0';
-  
+
   *ss = s;
 
-  if (ver) 
+  if (ver)
     *ver = result;
 
   return 0;
@@ -454,7 +454,7 @@
 
 #define MATCH(s, m) (strncasecmp(s, m, n = sizeof(m) - 1) == 0)
 
-  if (c >= 'a' && c <= 'z') 
+  if (c >= 'a' && c <= 'z')
     c += 'A' - 'a';
 
   switch (c) {
@@ -463,7 +463,7 @@
   case 'G': if (MATCH(s, "GET")) code = http_method_get; break;
   case 'H': if (MATCH(s, "HEAD")) code = http_method_head; break;
   case 'O': if (MATCH(s, "OPTIONS")) code = http_method_options; break;
-  case 'P': if (MATCH(s, "POST")) code = http_method_post; 
+  case 'P': if (MATCH(s, "POST")) code = http_method_post;
             else
             if (MATCH(s, "PUT")) code = http_method_put; break;
   case 'T': if (MATCH(s, "TRACE")) code = http_method_trace; break;
@@ -510,7 +510,7 @@
  * query. For each key, a query element (in the form name=value) is searched
  * from the query string. If a query element has a beginning matching with
  * the key, a copy of the rest of the element is returned in corresponding
- * return_value argument. 
+ * return_value argument.
  *
  * @note The @a query string will be modified.
  *
@@ -538,15 +538,15 @@
     valuelen = namelen + strcspn(q + namelen, "&");
 
     q_next = q + valuelen;
-    if (*q_next) 
+    if (*q_next)
       *q_next++ = '\0';
 
-    value = q + namelen; 
+    value = q + namelen;
     has_value = (*value) != '\0'; /* is the part in form of name=value? */
     if (has_value)
       *value++ = '\0';
 
-    name = url_unescape(q, q); 
+    name = url_unescape(q, q);
 
     if (has_value) {
       namelen = strlen(name);
@@ -570,4 +570,4 @@
   }
 
   return N;
-} 
+}

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_parser_table.c.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_parser_table.c.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_parser_table.c.in	Tue Dec 23 07:37:03 2008
@@ -31,7 +31,7 @@
  */
 
 /**@internal
- * @CFILE http_parser_table.c 
+ * @CFILE http_parser_table.c
  * @brief HTTP parser table
  *
  * #AUTO#

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_status.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_status.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_status.c	Tue Dec 23 07:37:03 2008
@@ -79,7 +79,7 @@
 
 char const *http_status_phrase(int status)
 {
-  if (status < 100 || status > 699) 
+  if (status < 100 || status > 699)
     return NULL;
 
   switch (status) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_tag.c.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_tag.c.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_tag.c.in	Tue Dec 23 07:37:03 2008
@@ -1,4 +1,4 @@
-/**@HTTP 
+/**@HTTP
  * @IFILE http_tag.c.in
  *
  * Template for <http_tag.c>.
@@ -35,7 +35,7 @@
  * This file is autogenerated from <http_tag.c.in>.
  *
  * #AUTO#
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  */
 
@@ -58,7 +58,7 @@
 
 tag_typedef_t httptag_http = HTTPMSGTAG_TYPEDEF(http);
 tag_typedef_t httptag_version = STRTAG_TYPEDEF(version);
-tag_typedef_t httptag_header = 
+tag_typedef_t httptag_header =
 	{{ TAG_NAMESPACE, "header", httphdrtag_class, 0 }};
 tag_typedef_t httptag_header_str = STRTAG_TYPEDEF(header_str);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_tag_class.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_tag_class.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/http_tag_class.c	Tue Dec 23 07:37:03 2008
@@ -49,7 +49,7 @@
 #include <sofia-sip/http_tag_class.h>
 #include <sofia-sip/su_tagarg.h>
 
-tag_class_t httphdrtag_class[1] = 
+tag_class_t httphdrtag_class[1] =
   {{
     sizeof(httphdrtag_class),
     /* tc_next */     NULL,
@@ -65,7 +65,7 @@
     /* tc_scan */     msghdrtag_scan,
   }};
 
-tag_class_t httpstrtag_class[1] = 
+tag_class_t httpstrtag_class[1] =
   {{
     sizeof(httpstrtag_class),
     /* tc_next */     NULL,
@@ -81,7 +81,7 @@
     /* tc_scan */     msghdrtag_scan,
   }};
 
-tag_class_t httpmsgtag_class[1] = 
+tag_class_t httpmsgtag_class[1] =
   {{
     sizeof(httpmsgtag_class),
     /* tc_next */     NULL,
@@ -100,7 +100,7 @@
 /** Filter a HTTP header structure. */
 tagi_t *httptag_filter(tagi_t *dst,
 		      tagi_t const f[],
-		      tagi_t const *src, 
+		      tagi_t const *src,
 		      void **bb)
 {
   tagi_t stub[2] = {{ NULL }};
@@ -152,7 +152,7 @@
   }
 }
 
-/** Duplicate headers from taglist and add them to the HTTP message. 
+/** Duplicate headers from taglist and add them to the HTTP message.
  *
  * Return the number of headers added to the HTTP message.
  */
@@ -209,8 +209,8 @@
     else if (tag == httptag_header_str) {
       if (msg_header_add_str(msg, http, (char const *)value) < 0)
 	break;
-    } 
-    else 
+    }
+    else
       continue;
 
     retval++;
@@ -218,7 +218,7 @@
 
   ta_end(ta);
 
-  if (t) 
+  if (t)
     return -1;
 
   return retval;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h	Tue Dec 23 07:37:03 2008
@@ -26,10 +26,10 @@
 /** Defined when <sofia-sip/http.h> has been included. */
 #define HTTP_H
 
-/**@file sofia-sip/http.h 
- * 
+/**@file sofia-sip/http.h
+ *
  * HTTP message, methods, headers.
- * 
+ *
  * @sa <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a>
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
@@ -50,7 +50,7 @@
 SOFIA_BEGIN_DECLS
 
 /* ----------------------------------------------------------------------
- * 1) Constants 
+ * 1) Constants
  */
 
 #define HTTP_NONE ((http_header_t *)MSG_HEADER_NONE)
@@ -161,9 +161,9 @@
 typedef msg_error_t                 http_error_t;
 /** Unknown header. */
 typedef msg_generic_t               http_unknown_t;
-/** Separator line between headers and message contents */ 
+/** Separator line between headers and message contents */
 typedef msg_separator_t             http_separator_t;
-/** Entity-body */ 
+/** Entity-body */
 typedef msg_payload_t               http_payload_t;
 /** Time in seconds since 01-Jan-1900. */
 typedef unsigned long               http_time_t;
@@ -327,7 +327,7 @@
   unsigned                   http_size;	         /**< Size of this structure */
   int                        http_flags;                          /**< Flags */
   http_error_t              *http_error;              /**< Erroneous headers */
-  
+
   http_request_t            *http_request;                /**< Request line  */
   http_status_t             *http_status;                   /**< Status line */
 
@@ -389,19 +389,19 @@
 
   /* === Headers end here */
   http_header_t             *http_unknown;             /**< Unknown headers. */
-  http_separator_t          *http_separator;     
+  http_separator_t          *http_separator;
 				  /**< Separator between message and payload */
   http_payload_t            *http_payload;	    /**< Message entity-body */
 };
 
 /**Union representing any HTTP header.
- * 
+ *
  * Each different header is an array of size 1.
- * 
+ *
  * @deprecated
  */
 union http_header_u {
-  msg_common_t                sh_common[1]; 
+  msg_common_t                sh_common[1];
   struct {
     msg_common_t              shn_common;
     http_header_t            *shn_next;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_hclasses.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_hclasses.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_hclasses.h	Tue Dec 23 07:37:03 2008
@@ -28,9 +28,9 @@
 
 /**@file sofia-sip/http_hclasses.h
  * @brief HTTP header classes.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  */
 
 #ifndef MSG_TYPES_H

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_header.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_header.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_header.h	Tue Dec 23 07:37:03 2008
@@ -26,7 +26,7 @@
 /** Defined when <sofia-sip/http_header.h> has been included.*/
 #define HTTP_HEADER_H
 
-/**@file sofia-sip/http_header.h 
+/**@file sofia-sip/http_header.h
  *
  * HTTP library prototypes.
  *
@@ -85,13 +85,13 @@
 /** HTTP 1.0 */
 SOFIAPUBVAR char const http_version_1_0[];
 
-/** HTTP 1.1 version. */ 
+/** HTTP 1.1 version. */
 SOFIAPUBVAR char const http_version_1_1[];
 
 #define HTTP_VERSION_CURRENT http_version_1_1
 
 /* ----------------------------------------------------------------------
- * 3) Prototypes 
+ * 3) Prototypes
  */
 
 /** HTTP parser description. */
@@ -123,7 +123,7 @@
 
 /** Add required headers to the response message */
 SOFIAPUBFUN int http_complete_response(msg_t *msg,
-				       int status, char const *phrase, 
+				       int status, char const *phrase,
 				       http_t const *request);
 
 /** Return string corresponding to the method. */
@@ -139,9 +139,9 @@
 SOFIAPUBFUN int http_header_remove(msg_t *msg, http_t *http, http_header_t *h);
 SOFIAPUBFUN char const *http_header_name(http_header_t const *h, int compact);
 SOFIAPUBFUN void *http_header_data(http_header_t *h);
-SOFIAPUBFUN http_content_length_t *http_content_length_create(su_home_t *home, 
+SOFIAPUBFUN http_content_length_t *http_content_length_create(su_home_t *home,
 							      uint32_t n);
-SOFIAPUBFUN http_payload_t *http_payload_create(su_home_t *home, 
+SOFIAPUBFUN http_payload_t *http_payload_create(su_home_t *home,
 						void const *data, usize_t len);
 SOFIAPUBFUN http_separator_t *http_separator_create(su_home_t *home);
 #endif
@@ -164,7 +164,7 @@
 					      char const *version);
 
 /** Create an @b Host header object. */
-SOFIAPUBFUN http_host_t *http_host_create(su_home_t *home, 
+SOFIAPUBFUN http_host_t *http_host_create(su_home_t *home,
 					  char const *host,
 					  char const *port);
 
@@ -184,7 +184,7 @@
 				      ...);
 
 /* ----------------------------------------------------------------------
- * 4) Inlined functions 
+ * 4) Inlined functions
  */
 
 #if SU_HAVE_INLINE
@@ -213,13 +213,13 @@
  * @param http HTTP message structure to which header is added
  * @param h   list of header(s) to be added
  */
-su_inline 
+su_inline
 int http_header_insert(msg_t *msg, http_t *http, http_header_t *h)
 {
   return msg_header_insert(msg, (msg_pub_t *)http, (msg_header_t *)h);
 }
 
-/** Remove a header from a HTTP message. */ 
+/** Remove a header from a HTTP message. */
 su_inline
 int http_header_remove(msg_t *msg, http_t *http, http_header_t *h)
 {
@@ -243,19 +243,19 @@
   return h && h != HTTP_NONE ? h->sh_class->hc_size + (char *)h : NULL;
 }
 
-su_inline 
+su_inline
 http_content_length_t *http_content_length_create(su_home_t *home, uint32_t n)
 {
   return msg_content_length_create(home, n);
 }
 
-su_inline 
+su_inline
 http_payload_t *http_payload_create(su_home_t *home, void const *data, isize_t len)
 {
   return msg_payload_create(home, data, len);
 }
 
-su_inline 
+su_inline
 http_separator_t *http_separator_create(su_home_t *home)
 {
   return msg_separator_create(home);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_parser.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_parser.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_parser.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef HTTP_PARSER_H
 /**Defined when <sofia-sip/http_parser.h> has been included.*/
-#define HTTP_PARSER_H 
+#define HTTP_PARSER_H
 /**@file sofia-sip/http_parser.h
  * @brief Typedefs and prototypes used by HTTP parser.
  *
@@ -102,7 +102,7 @@
 					 char const *name);
 
 /** Extract HTTP message body */
-SOFIAPUBFUN issize_t http_extract_body(msg_t *, http_t *, 
+SOFIAPUBFUN issize_t http_extract_body(msg_t *, http_t *,
 				       char b[], isize_t bsiz, int eos);
 
 SOFIA_END_DECLS

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_protos.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_protos.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_protos.h.in	Tue Dec 23 07:37:03 2008
@@ -32,12 +32,12 @@
 /** Defined when <sofia-sip/http_protos.h> has been included. */
 #define HTTP_PROTOS_H
 
-/**@file sofia-sip/http_protos.h 
+/**@file sofia-sip/http_protos.h
  *
  * Macros for each HTTP header.
  *
  * #AUTO#
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  */
 
@@ -61,18 +61,18 @@
 
 /**@addtogroup http_#xxxxxx#*/ /** @{ */
 
-enum { 
+enum {
   /** Hash of #xxxxxxx_xxxxxxx#. @internal*/
-  http_#xxxxxx#_hash = #hash# 
+  http_#xxxxxx#_hash = #hash#
 };
 
 /**Header class for HTTP #xxxxxxx_xxxxxxx#.
- * 
+ *
  * The header class http_#xxxxxx#_class defines how a HTTP
  * #xxxxxxx_xxxxxxx# is parsed and printed.  It also
  * contains methods used by HTTP parser and other functions
  * to manipulate the http_#xxxxxx#_t header structure.
- * 
+ *
  */
 SOFIAPUBVAR msg_hclass_t http_#xxxxxx#_class[];
 
@@ -85,28 +85,28 @@
 SOFIAPUBFUN msg_print_f http_#xxxxxx#_e;
 
 /**Initializer for structure http_#xxxxxx#_t.
- * 
+ *
  * A static http_#xxxxxx#_t structure must be initialized
  * with the HTTP_#XXXXXX#_INIT() macro. For instance,
- * @code 
- * 
+ * @code
+ *
  *  http_#xxxxxx#_t http_#xxxxxx# = HTTP_#XXXXXX#_INIT;
- * 
+ *
  * @endcode
  * @HI
  */
 #define HTTP_#XXXXXX#_INIT() HTTP_HDR_INIT(#xxxxxx#)
 
 /**Initialize a structure http_#xxxxxx#_t.
- * 
+ *
  * An http_#xxxxxx#_t structure can be initialized with the
  * http_#xxxxxx#_init() function/macro. For instance,
  * @code
- * 
+ *
  *  http_#xxxxxx#_t http_#xxxxxx#;
- * 
+ *
  *  http_#xxxxxx#_init(&http_#xxxxxx#);
- * 
+ *
  * @endcode
  * @HI
  */
@@ -121,20 +121,20 @@
 #endif
 
 /**Test if header object is instance of http_#xxxxxx#_t.
- * 
+ *
  * The function http_is_#xxxxxx#() returns true (nonzero) if
  * the header class is an instance of #xxxxxxx_xxxxxxx#
  * object and false (zero) otherwise.
- * 
+ *
  * @param header pointer to the header structure to be tested
- * 
+ *
  * @return
  * The function http_is_x#xxxxxx#() returns true (nonzero) if
  * the header object is an instance of header #xxxxxx# and
  * false (zero) otherwise.
  */
 #if SU_HAVE_INLINE
-su_inline 
+su_inline
 int http_is_#xxxxxx#(http_header_t const *header)
 {
   return header && header->sh_class->hc_hash == http_#xxxxxx#_hash;
@@ -145,27 +145,27 @@
 #endif
 
 /**Duplicate (deep copy) @c http_#xxxxxx#_t.
- * 
+ *
  * The function http_#xxxxxx#_dup() duplicates a header
  * structure @a hdr.  If the header structure @a hdr
  * contains a reference (@c hdr->x_next) to a list of
  * headers, all the headers in the list are duplicated, too.
- * 
+ *
  * @param home  memory home used to allocate new structure
  * @param hdr   header structure to be duplicated
- * 
+ *
  * When duplicating, all parameter lists and non-constant
  * strings attached to the header are copied, too.  The
  * function uses given memory @a home to allocate all the
  * memory areas used to copy the header.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = http_#xxxxxx#_dup(home, http->http_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function http_#xxxxxx#_dup() returns a pointer to the
  * newly duplicated http_#xxxxxx#_t header structure, or NULL
@@ -174,34 +174,34 @@
 #if SU_HAVE_INLINE
 su_inline
 #endif
-http_#xxxxxx#_t *http_#xxxxxx#_dup(su_home_t *home, 
+http_#xxxxxx#_t *http_#xxxxxx#_dup(su_home_t *home,
 				   http_#xxxxxx#_t const *hdr)
      __attribute__((__malloc__));
 
 /**Copy a http_#xxxxxx#_t header structure.
- * 
+ *
  * The function http_#xxxxxx#_copy() copies a header structure @a
  * hdr.  If the header structure @a hdr contains a reference (@c
  * hdr->h_next) to a list of headers, all the headers in that
  * list are copied, too. The function uses given memory @a home
  * to allocate all the memory areas used to copy the header
  * structure @a hdr.
- * 
+ *
  * @param home    memory home used to allocate new structure
  * @param hdr     pointer to the header structure to be duplicated
- * 
+ *
  * When copying, only the header structure and parameter lists
  * attached to it are duplicated.  The new header structure
  * retains all the references to the strings within the old @a
  * header, including the encoding of the old header, if present.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = http_#xxxxxx#_copy(home, http->http_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function http_#xxxxxx#_copy() returns a pointer to
  * newly copied header structure, or NULL upon an error.
@@ -209,23 +209,23 @@
 #if SU_HAVE_INLINE
 su_inline
 #endif
-http_#xxxxxx#_t *http_#xxxxxx#_copy(su_home_t *home, 
+http_#xxxxxx#_t *http_#xxxxxx#_copy(su_home_t *home,
 				    http_#xxxxxx#_t const *hdr)
      __attribute__((__malloc__));
 
 /**Make a header structure http_#xxxxxx#_t.
- * 
+ *
  * The function http_#xxxxxx#_make() makes a new
  * http_#xxxxxx#_t header structure.  It allocates a new
  * header structure, and decodes the string @a s as the
  * value of the structure.
- * 
+ *
  * @param home memory home used to allocate new header structure.
  * @param s    string to be decoded as value of the new header structure
- * 
+ *
  * @note This function is usually implemented as a macro calling
  * http_header_make().
- * 
+ *
  * @return
  * The function http_#xxxxxx#_make() returns a pointer to
  * newly maked http_#xxxxxx#_t header structure, or NULL upon
@@ -238,25 +238,25 @@
      __attribute__((__malloc__));
 
 /**Make a #xxxxxxx_xxxxxxx# from formatting result.
- * 
+ *
  * The function http_#xxxxxx#_format() makes a new
  * #xxxxxxx_xxxxxxx# object using formatting result as its
  * value.  The function first prints the arguments according to
  * the format @a fmt specified.  Then it allocates a new header
  * structure, and uses the formatting result as the header
  * value.
- * 
+ *
  * @param home   memory home used to allocate new header structure.
  * @param fmt    string used as a printf()-style format
  * @param ...    argument list for format
- * 
+ *
  * @note This function is usually implemented as a macro calling
  * msg_header_format().
- * 
+ *
  * @return
  * The function http_#xxxxxx#_format() returns a pointer to newly
  * makes header structure, or NULL upon an error.
- * 
+ *
  * @HIDE
  */
 #if SU_HAVE_INLINE
@@ -273,29 +273,29 @@
 {
   http_header_t *h;
   va_list ap;
-  
+
   va_start(ap, fmt);
   h = http_header_vformat(home, http_#xxxxxx#_class, fmt, ap);
   va_end(ap);
- 
+
   return (http_#xxxxxx#_t *)h;
 }
 
 su_inline
-http_#xxxxxx#_t *http_#xxxxxx#_dup(su_home_t *home, http_#xxxxxx#_t const *o) 
-{ 
+http_#xxxxxx#_t *http_#xxxxxx#_dup(su_home_t *home, http_#xxxxxx#_t const *o)
+{
   return (http_#xxxxxx#_t *)
     msg_header_dup_as(home, http_#xxxxxx#_class, (msg_header_t const *)o);
 }
 
 su_inline
-http_#xxxxxx#_t *http_#xxxxxx#_copy(su_home_t *home, http_#xxxxxx#_t const *o) 
-{ 
+http_#xxxxxx#_t *http_#xxxxxx#_copy(su_home_t *home, http_#xxxxxx#_t const *o)
+{
   return (http_#xxxxxx#_t *)
-    msg_header_copy_as(home, http_#xxxxxx#_class, (msg_header_t const *)o); 
+    msg_header_copy_as(home, http_#xxxxxx#_class, (msg_header_t const *)o);
 }
 
-su_inline 
+su_inline
 http_#xxxxxx#_t *http_#xxxxxx#_make(su_home_t *home, char const *s)
 {
   return (http_#xxxxxx#_t *)http_header_make(home, http_#xxxxxx#_class, s);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_status.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_status.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_status.h	Tue Dec 23 07:37:03 2008
@@ -22,10 +22,10 @@
  *
  */
 
-#ifndef HTTP_STATUS_H 
-#define HTTP_STATUS_H 
+#ifndef HTTP_STATUS_H
+#define HTTP_STATUS_H
 
-/**@file sofia-sip/http_status.h 
+/**@file sofia-sip/http_status.h
  *
  * HTTP status codes.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag.h.in	Tue Dec 23 07:37:03 2008
@@ -105,7 +105,7 @@
 #if SU_INLINE_TAG_CAST
 su_inline
 tag_value_t httptag_http_v(http_t const *v) { return (tag_value_t)v; }
-su_inline 
+su_inline
 tag_value_t httptag_http_vr(http_t const **vp) { return (tag_value_t)vp; }
 #else
 #define httptag_http_v(v)   (tag_value_t)(v)
@@ -131,8 +131,8 @@
 /**Tag list item for header string.
  *
  * The HTTPTAG_HEADER() macro is used to include a tag item containing an
- * unknown HTTP header in the tag list, e.g., 
- * @code 
+ * unknown HTTP header in the tag list, e.g.,
+ * @code
  * http_header_t *hdr;
  *
  * HTTPTAG_HEADER(hdr).
@@ -199,7 +199,7 @@
  *
  * Tag list item for string with #xxxxxxx_xxxxxxx# value.
  *
- * The HTTPTAG_#XXXXXX#_STR() macro is used to include a tag item with a 
+ * The HTTPTAG_#XXXXXX#_STR() macro is used to include a tag item with a
  * string containing value of a http_#xxxxxx#_t header in a tag list.
  *
  * @param s pointer to a string containing http_#xxxxxx#_t value, or NULL.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag_class.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag_class.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag_class.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef HTTP_TAG_CLASS_H
 /**Defined when http_tag_class.h have been included*/
-#define HTTP_TAG_CLASS_H 
+#define HTTP_TAG_CLASS_H
 
 /**@file sofia-sip/http_tag_class.h
  * @brief Tag classes for HTTP headers.
@@ -62,9 +62,9 @@
   {{ TAG_NAMESPACE, #t, httpmsgtag_class, \
      (tag_value_t)HTTP_PROTOCOL_TAG }}
 
-/**@internal Filter HTTP header tag items. */ 
+/**@internal Filter HTTP header tag items. */
 SOFIAPUBFUN tagi_t *httptag_filter(tagi_t *dst, tagi_t const f[],
-				   tagi_t const *src, 
+				   tagi_t const *src,
 				   void **bb);
 
 SOFIA_END_DECLS

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/test_http.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/test_http.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/http/test_http.c	Tue Dec 23 07:37:03 2008
@@ -189,7 +189,7 @@
   for (i = 0; i < n;) {
     /* This prevent msg_recv_iovec() from allocating extra slack */
     int msg_buf_exact(msg_t *, int);
-    msg_buf_exact(msg, 10 + 1);	
+    msg_buf_exact(msg, 10 + 1);
 
     if (msg_recv_iovec(msg, iovec, msg_n_fragments, 10, 0) < 0) {
       perror("msg_recv_iovec");
@@ -1008,7 +1008,7 @@
 			      "CUSTOMER=WILE_E_COYOTE; "
 			      "path=/; "
 			      "expires=Wednesday, 09-Nov-99 23:12:40 GMT");
-    
+
     TEST_1(sc);
     TEST_1(sc->sc_params);
     TEST_S(sc->sc_name, "CUSTOMER=WILE_E_COYOTE");

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/base64.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/base64.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/base64.c	Tue Dec 23 07:37:03 2008
@@ -36,7 +36,7 @@
 #include <string.h>
 #include "sofia-sip/base64.h"
 
-static unsigned char const code[] = 
+static unsigned char const code[] =
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
 #define B64NOP 128
@@ -48,22 +48,22 @@
  * stores the result in the buffer @a buf of @a bsiz bytes.
  *
  * If the @a buf is NULL, the function just returns the length of decoded
- * data. In any case, no decoded data is stored in @a buf beyond @a bsiz. 
+ * data. In any case, no decoded data is stored in @a buf beyond @a bsiz.
  * The function always returns the full length of decodable data.
- * 
+ *
  * @param buf  Buffer to store decoded data
  * @param bsiz Size of @a buf
  * @param b64s Base64-encoded string.
  *
- * @return Length of data that can be decoded in bytes. 
+ * @return Length of data that can be decoded in bytes.
  *
- * @sa <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>, 
+ * @sa <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>,
  * <i>"Multipurpose Internet Mail Extensions (MIME) Part One:
  * Format of Internet Message Bodies"</i>,
  * N. Freed, N. Borenstein, November 1996.
  *
  * @par Example
- * The following example code decodes a string of BASE64 data into a 
+ * The following example code decodes a string of BASE64 data into a
  * memory area allocated from heap:
  * @code
  * int decoder(char const *encoded, void **return_decoded)
@@ -76,7 +76,7 @@
  * }
  * @endcode
  */
-isize_t base64_d(char buf[], isize_t bsiz, char const *b64s) 
+isize_t base64_d(char buf[], isize_t bsiz, char const *b64s)
 {
   static unsigned char decode[256] = "";
   unsigned char const *s = (unsigned char const *)b64s;
@@ -90,7 +90,7 @@
   if (decode['\0'] != B64EOF) {
     /* Prepare decoding table */
     for (i = 1; i < 256; i++)
-      decode[i] = B64NOP; 
+      decode[i] = B64NOP;
 
     for (i = 0; i < 64; i++) {
       decode[code[i]] = (unsigned char)i;
@@ -104,17 +104,17 @@
     if (c != B64NOP)
       len++;
   }
-  
+
   total_len = len = len * 3 / 4;
 
   if (buf == NULL || bsiz == 0)
     return total_len;
 
-  if (len > bsiz) 
+  if (len > bsiz)
     len = bsiz;
-  
+
   for (i = 0, s = (unsigned char const *)b64s; i < len; ) {
-      
+
     while ((b1 = decode[*s++]) == B64NOP)
       ;
     if (b1 != B64EOF)
@@ -126,7 +126,7 @@
     if (b3 != B64EOF)
       while ((b4 = decode[*s++]) == B64NOP)
 	;
-      
+
     if (((b1 | b2 | b3 | b4) & (B64NOP|B64EOF)) == 0) {
       /* Normal case, 4 B64 chars to 3 data bytes */
       w = (b1 << 18) | (b2 << 12) | (b3 << 6) | b4;
@@ -163,8 +163,8 @@
 }
 
 /**Encode data with BASE64.
- * 
- * The function base64_e() encodes @a dsiz bytes of @a data into @a buf. 
+ *
+ * The function base64_e() encodes @a dsiz bytes of @a data into @a buf.
  *
  * @note The function base64_e() uses at most @a bsiz bytes from @a buf.
  *
@@ -183,13 +183,13 @@
  * @return The function base64_e() return length of encoded string,
  * excluding the final NUL.
  *
- * @sa <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>, 
+ * @sa <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>,
  * <i>"Multipurpose Internet Mail Extensions (MIME) Part One:
  * Format of Internet Message Bodies"</i>,
  * N. Freed, N. Borenstein, November 1996.
  *
  */
-isize_t base64_e(char buf[], isize_t bsiz, void *data, isize_t dsiz) 
+isize_t base64_e(char buf[], isize_t bsiz, void *data, isize_t dsiz)
 {
   unsigned char *s = (unsigned char *)buf;
   unsigned char *b = (unsigned char *)data;
@@ -200,7 +200,7 @@
 
   if (bsize == 0)
     s = NULL;
-  
+
   for (i = 0, n = 0; i < dsize; i += 3, n += 4) {
     w = (b[i] << 16) | (b[i+1] << 8) | b[i+2];
 
@@ -211,9 +211,9 @@
 	s[n + 2] = code[(w >> 6) & 63];
 	s[n + 3] = code[(w) & 63];
       } else {
-	if (n + 1 < bsize) 
+	if (n + 1 < bsize)
 	  s[n + 0] = code[(w >> 18) & 63];
-	if (n + 2 < bsize) 
+	if (n + 2 < bsize)
 	  s[n + 1] = code[(w >> 12) & 63];
 	if (n + 3 < bsize)
 	  s[n + 2] = code[(w >> 6) & 63];
@@ -221,8 +221,8 @@
 	s = NULL;
       }
     }
-  }			   
-  
+  }
+
   if (slack) {
     if (s) {
       if (slack == 2)
@@ -230,7 +230,7 @@
       else
 	w = (b[i] << 16);
 
-      if (n + 1 < bsize) 
+      if (n + 1 < bsize)
 	s[n + 0] = code[(w >> 18) & 63];
       if (n + 2 < bsize)
 	s[n + 1] = code[(w >> 12) & 63];

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ipt.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ipt.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ipt.docs	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 /* -*- c -*- */
 
 /**@MODULEPAGE "ipt" - Utility Module
- * 
+ *
  * @section ipt_meta Module Meta Information
  *
  * Utility library for IP Telephony applications.
@@ -14,7 +14,7 @@
  *
  * @section ipt_overview Overview
  *
- * This module contain some routines useful for IPT applications, like 
+ * This module contain some routines useful for IPT applications, like
  * - <sofia-sip/base64.h> BASE64 encoding/decoding, and
  * - <sofia-sip/token64.h> encoding/decoding binary as SIP/HTTP token.
  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/rc4.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/rc4.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/rc4.c	Tue Dec 23 07:37:03 2008
@@ -37,40 +37,40 @@
   const rc4_u8 *seed = (const rc4_u8 *)vseed;
   rc4_u8 *array = state->rc4_array;
 
-  state->rc4_i = 0;     
-  state->rc4_j = 0;     
+  state->rc4_i = 0;
+  state->rc4_j = 0;
 
-  for (i = 0; i < 256; i++)              
-    array[i] = (rc4_u8) i;               
+  for (i = 0; i < 256; i++)
+    array[i] = (rc4_u8) i;
 
-  for (i = 0, j = 0, k = 0; 
-       i < 256; 
+  for (i = 0, j = 0, k = 0;
+       i < 256;
        i++, k++, k >= seed_len ? k = 0 : 0) {
     rc4_u8 a = array[i];
     rc4_u8 b = array[j += a + seed[k]];
 
     array[i] = b;
     array[j] = a;
-  }       
+  }
 }
 
-void rc4(void *buffer, isize_t len, rc4_t *state) { 
+void rc4(void *buffer, isize_t len, rc4_t *state) {
   rc4_u8 *buf = (rc4_u8 *)buffer;
   rc4_u8 *array = state->rc4_array;
-  rc4_u8 i = state->rc4_i;     
+  rc4_u8 i = state->rc4_i;
   rc4_u8 j = state->rc4_j;
-    
-  while (len-- > 0) {               
-    rc4_u8 a = array[++i];	
+
+  while (len-- > 0) {
+    rc4_u8 a = array[++i];
     rc4_u8 b = array[j += a];
 
     array[i] = b;
     array[j] = a;
 
-    *buf++ ^= array[(a + b) & 255];         
-  }               
+    *buf++ ^= array[(a + b) & 255];
+  }
 
-  state->rc4_i = i;     
+  state->rc4_i = i;
   state->rc4_j = j;
 }
 
@@ -90,114 +90,114 @@
 
 rc4_u8 key_3[] = { 0xef, 0x01, 0x23, 0x45, };
 rc4_u8 input_3[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
-rc4_u8 output_3[] = { 0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf, 0xbd, 0x61, }; 
+rc4_u8 output_3[] = { 0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf, 0xbd, 0x61, };
 rc4_u8 key_4[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, };
-rc4_u8 input_4[] = { 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+rc4_u8 input_4[] = {
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
   0x01, };
 
-rc4_u8 output_4[] = { 
-  0x75, 0x95, 0xc3, 0xe6, 0x11, 0x4a, 0x09, 0x78, 0x0c, 0x4a, 0xd4, 
-  0x52, 0x33, 0x8e, 0x1f, 0xfd, 0x9a, 0x1b, 0xe9, 0x49, 0x8f, 
-  0x81, 0x3d, 0x76, 0x53, 0x34, 0x49, 0xb6, 0x77, 0x8d, 0xca, 
-  0xd8, 0xc7, 0x8a, 0x8d, 0x2b, 0xa9, 0xac, 0x66, 0x08, 0x5d, 
-  0x0e, 0x53, 0xd5, 0x9c, 0x26, 0xc2, 0xd1, 0xc4, 0x90, 0xc1, 
-  0xeb, 0xbe, 0x0c, 0xe6, 0x6d, 0x1b, 0x6b, 0x1b, 0x13, 0xb6, 
-  0xb9, 0x19, 0xb8, 0x47, 0xc2, 0x5a, 0x91, 0x44, 0x7a, 0x95, 
-  0xe7, 0x5e, 0x4e, 0xf1, 0x67, 0x79, 0xcd, 0xe8, 0xbf, 0x0a, 
-  0x95, 0x85, 0x0e, 0x32, 0xaf, 0x96, 0x89, 0x44, 0x4f, 0xd3, 
-  0x77, 0x10, 0x8f, 0x98, 0xfd, 0xcb, 0xd4, 0xe7, 0x26, 0x56, 
-  0x75, 0x00, 0x99, 0x0b, 0xcc, 0x7e, 0x0c, 0xa3, 0xc4, 0xaa, 
-  0xa3, 0x04, 0xa3, 0x87, 0xd2, 0x0f, 0x3b, 0x8f, 0xbb, 0xcd, 
-  0x42, 0xa1, 0xbd, 0x31, 0x1d, 0x7a, 0x43, 0x03, 0xdd, 0xa5, 
-  0xab, 0x07, 0x88, 0x96, 0xae, 0x80, 0xc1, 0x8b, 0x0a, 0xf6, 
-  0x6d, 0xff, 0x31, 0x96, 0x16, 0xeb, 0x78, 0x4e, 0x49, 0x5a, 
-  0xd2, 0xce, 0x90, 0xd7, 0xf7, 0x72, 0xa8, 0x17, 0x47, 0xb6, 
-  0x5f, 0x62, 0x09, 0x3b, 0x1e, 0x0d, 0xb9, 0xe5, 0xba, 0x53, 
-  0x2f, 0xaf, 0xec, 0x47, 0x50, 0x83, 0x23, 0xe6, 0x71, 0x32, 
-  0x7d, 0xf9, 0x44, 0x44, 0x32, 0xcb, 0x73, 0x67, 0xce, 0xc8, 
-  0x2f, 0x5d, 0x44, 0xc0, 0xd0, 0x0b, 0x67, 0xd6, 0x50, 0xa0, 
-  0x75, 0xcd, 0x4b, 0x70, 0xde, 0xdd, 0x77, 0xeb, 0x9b, 0x10, 
-  0x23, 0x1b, 0x6b, 0x5b, 0x74, 0x13, 0x47, 0x39, 0x6d, 0x62, 
-  0x89, 0x74, 0x21, 0xd4, 0x3d, 0xf9, 0xb4, 0x2e, 0x44, 0x6e, 
-  0x35, 0x8e, 0x9c, 0x11, 0xa9, 0xb2, 0x18, 0x4e, 0xcb, 0xef, 
-  0x0c, 0xd8, 0xe7, 0xa8, 0x77, 0xef, 0x96, 0x8f, 0x13, 0x90, 
-  0xec, 0x9b, 0x3d, 0x35, 0xa5, 0x58, 0x5c, 0xb0, 0x09, 0x29, 
-  0x0e, 0x2f, 0xcd, 0xe7, 0xb5, 0xec, 0x66, 0xd9, 0x08, 0x4b, 
-  0xe4, 0x40, 0x55, 0xa6, 0x19, 0xd9, 0xdd, 0x7f, 0xc3, 0x16, 
-  0x6f, 0x94, 0x87, 0xf7, 0xcb, 0x27, 0x29, 0x12, 0x42, 0x64, 
-  0x45, 0x99, 0x85, 0x14, 0xc1, 0x5d, 0x53, 0xa1, 0x8c, 0x86, 
-  0x4c, 0xe3, 0xa2, 0xb7, 0x55, 0x57, 0x93, 0x98, 0x81, 0x26, 
-  0x52, 0x0e, 0xac, 0xf2, 0xe3, 0x06, 0x6e, 0x23, 0x0c, 0x91, 
-  0xbe, 0xe4, 0xdd, 0x53, 0x04, 0xf5, 0xfd, 0x04, 0x05, 0xb3, 
-  0x5b, 0xd9, 0x9c, 0x73, 0x13, 0x5d, 0x3d, 0x9b, 0xc3, 0x35, 
-  0xee, 0x04, 0x9e, 0xf6, 0x9b, 0x38, 0x67, 0xbf, 0x2d, 0x7b, 
-  0xd1, 0xea, 0xa5, 0x95, 0xd8, 0xbf, 0xc0, 0x06, 0x6f, 0xf8, 
-  0xd3, 0x15, 0x09, 0xeb, 0x0c, 0x6c, 0xaa, 0x00, 0x6c, 0x80, 
-  0x7a, 0x62, 0x3e, 0xf8, 0x4c, 0x3d, 0x33, 0xc1, 0x95, 0xd2, 
-  0x3e, 0xe3, 0x20, 0xc4, 0x0d, 0xe0, 0x55, 0x81, 0x57, 0xc8, 
-  0x22, 0xd4, 0xb8, 0xc5, 0x69, 0xd8, 0x49, 0xae, 0xd5, 0x9d, 
-  0x4e, 0x0f, 0xd7, 0xf3, 0x79, 0x58, 0x6b, 0x4b, 0x7f, 0xf6, 
-  0x84, 0xed, 0x6a, 0x18, 0x9f, 0x74, 0x86, 0xd4, 0x9b, 0x9c, 
-  0x4b, 0xad, 0x9b, 0xa2, 0x4b, 0x96, 0xab, 0xf9, 0x24, 0x37, 
-  0x2c, 0x8a, 0x8f, 0xff, 0xb1, 0x0d, 0x55, 0x35, 0x49, 0x00, 
-  0xa7, 0x7a, 0x3d, 0xb5, 0xf2, 0x05, 0xe1, 0xb9, 0x9f, 0xcd, 
-  0x86, 0x60, 0x86, 0x3a, 0x15, 0x9a, 0xd4, 0xab, 0xe4, 0x0f, 
-  0xa4, 0x89, 0x34, 0x16, 0x3d, 0xdd, 0xe5, 0x42, 0xa6, 0x58, 
-  0x55, 0x40, 0xfd, 0x68, 0x3c, 0xbf, 0xd8, 0xc0, 0x0f, 0x12, 
-  0x12, 0x9a, 0x28, 0x4d, 0xea, 0xcc, 0x4c, 0xde, 0xfe, 0x58, 
-  0xbe, 0x71, 0x37, 0x54, 0x1c, 0x04, 0x71, 0x26, 0xc8, 0xd4, 
-  0x9e, 0x27, 0x55, 0xab, 0x18, 0x1a, 0xb7, 0xe9, 0x40, 0xb0, 
+rc4_u8 output_4[] = {
+  0x75, 0x95, 0xc3, 0xe6, 0x11, 0x4a, 0x09, 0x78, 0x0c, 0x4a, 0xd4,
+  0x52, 0x33, 0x8e, 0x1f, 0xfd, 0x9a, 0x1b, 0xe9, 0x49, 0x8f,
+  0x81, 0x3d, 0x76, 0x53, 0x34, 0x49, 0xb6, 0x77, 0x8d, 0xca,
+  0xd8, 0xc7, 0x8a, 0x8d, 0x2b, 0xa9, 0xac, 0x66, 0x08, 0x5d,
+  0x0e, 0x53, 0xd5, 0x9c, 0x26, 0xc2, 0xd1, 0xc4, 0x90, 0xc1,
+  0xeb, 0xbe, 0x0c, 0xe6, 0x6d, 0x1b, 0x6b, 0x1b, 0x13, 0xb6,
+  0xb9, 0x19, 0xb8, 0x47, 0xc2, 0x5a, 0x91, 0x44, 0x7a, 0x95,
+  0xe7, 0x5e, 0x4e, 0xf1, 0x67, 0x79, 0xcd, 0xe8, 0xbf, 0x0a,
+  0x95, 0x85, 0x0e, 0x32, 0xaf, 0x96, 0x89, 0x44, 0x4f, 0xd3,
+  0x77, 0x10, 0x8f, 0x98, 0xfd, 0xcb, 0xd4, 0xe7, 0x26, 0x56,
+  0x75, 0x00, 0x99, 0x0b, 0xcc, 0x7e, 0x0c, 0xa3, 0xc4, 0xaa,
+  0xa3, 0x04, 0xa3, 0x87, 0xd2, 0x0f, 0x3b, 0x8f, 0xbb, 0xcd,
+  0x42, 0xa1, 0xbd, 0x31, 0x1d, 0x7a, 0x43, 0x03, 0xdd, 0xa5,
+  0xab, 0x07, 0x88, 0x96, 0xae, 0x80, 0xc1, 0x8b, 0x0a, 0xf6,
+  0x6d, 0xff, 0x31, 0x96, 0x16, 0xeb, 0x78, 0x4e, 0x49, 0x5a,
+  0xd2, 0xce, 0x90, 0xd7, 0xf7, 0x72, 0xa8, 0x17, 0x47, 0xb6,
+  0x5f, 0x62, 0x09, 0x3b, 0x1e, 0x0d, 0xb9, 0xe5, 0xba, 0x53,
+  0x2f, 0xaf, 0xec, 0x47, 0x50, 0x83, 0x23, 0xe6, 0x71, 0x32,
+  0x7d, 0xf9, 0x44, 0x44, 0x32, 0xcb, 0x73, 0x67, 0xce, 0xc8,
+  0x2f, 0x5d, 0x44, 0xc0, 0xd0, 0x0b, 0x67, 0xd6, 0x50, 0xa0,
+  0x75, 0xcd, 0x4b, 0x70, 0xde, 0xdd, 0x77, 0xeb, 0x9b, 0x10,
+  0x23, 0x1b, 0x6b, 0x5b, 0x74, 0x13, 0x47, 0x39, 0x6d, 0x62,
+  0x89, 0x74, 0x21, 0xd4, 0x3d, 0xf9, 0xb4, 0x2e, 0x44, 0x6e,
+  0x35, 0x8e, 0x9c, 0x11, 0xa9, 0xb2, 0x18, 0x4e, 0xcb, 0xef,
+  0x0c, 0xd8, 0xe7, 0xa8, 0x77, 0xef, 0x96, 0x8f, 0x13, 0x90,
+  0xec, 0x9b, 0x3d, 0x35, 0xa5, 0x58, 0x5c, 0xb0, 0x09, 0x29,
+  0x0e, 0x2f, 0xcd, 0xe7, 0xb5, 0xec, 0x66, 0xd9, 0x08, 0x4b,
+  0xe4, 0x40, 0x55, 0xa6, 0x19, 0xd9, 0xdd, 0x7f, 0xc3, 0x16,
+  0x6f, 0x94, 0x87, 0xf7, 0xcb, 0x27, 0x29, 0x12, 0x42, 0x64,
+  0x45, 0x99, 0x85, 0x14, 0xc1, 0x5d, 0x53, 0xa1, 0x8c, 0x86,
+  0x4c, 0xe3, 0xa2, 0xb7, 0x55, 0x57, 0x93, 0x98, 0x81, 0x26,
+  0x52, 0x0e, 0xac, 0xf2, 0xe3, 0x06, 0x6e, 0x23, 0x0c, 0x91,
+  0xbe, 0xe4, 0xdd, 0x53, 0x04, 0xf5, 0xfd, 0x04, 0x05, 0xb3,
+  0x5b, 0xd9, 0x9c, 0x73, 0x13, 0x5d, 0x3d, 0x9b, 0xc3, 0x35,
+  0xee, 0x04, 0x9e, 0xf6, 0x9b, 0x38, 0x67, 0xbf, 0x2d, 0x7b,
+  0xd1, 0xea, 0xa5, 0x95, 0xd8, 0xbf, 0xc0, 0x06, 0x6f, 0xf8,
+  0xd3, 0x15, 0x09, 0xeb, 0x0c, 0x6c, 0xaa, 0x00, 0x6c, 0x80,
+  0x7a, 0x62, 0x3e, 0xf8, 0x4c, 0x3d, 0x33, 0xc1, 0x95, 0xd2,
+  0x3e, 0xe3, 0x20, 0xc4, 0x0d, 0xe0, 0x55, 0x81, 0x57, 0xc8,
+  0x22, 0xd4, 0xb8, 0xc5, 0x69, 0xd8, 0x49, 0xae, 0xd5, 0x9d,
+  0x4e, 0x0f, 0xd7, 0xf3, 0x79, 0x58, 0x6b, 0x4b, 0x7f, 0xf6,
+  0x84, 0xed, 0x6a, 0x18, 0x9f, 0x74, 0x86, 0xd4, 0x9b, 0x9c,
+  0x4b, 0xad, 0x9b, 0xa2, 0x4b, 0x96, 0xab, 0xf9, 0x24, 0x37,
+  0x2c, 0x8a, 0x8f, 0xff, 0xb1, 0x0d, 0x55, 0x35, 0x49, 0x00,
+  0xa7, 0x7a, 0x3d, 0xb5, 0xf2, 0x05, 0xe1, 0xb9, 0x9f, 0xcd,
+  0x86, 0x60, 0x86, 0x3a, 0x15, 0x9a, 0xd4, 0xab, 0xe4, 0x0f,
+  0xa4, 0x89, 0x34, 0x16, 0x3d, 0xdd, 0xe5, 0x42, 0xa6, 0x58,
+  0x55, 0x40, 0xfd, 0x68, 0x3c, 0xbf, 0xd8, 0xc0, 0x0f, 0x12,
+  0x12, 0x9a, 0x28, 0x4d, 0xea, 0xcc, 0x4c, 0xde, 0xfe, 0x58,
+  0xbe, 0x71, 0x37, 0x54, 0x1c, 0x04, 0x71, 0x26, 0xc8, 0xd4,
+  0x9e, 0x27, 0x55, 0xab, 0x18, 0x1a, 0xb7, 0xe9, 0x40, 0xb0,
   0xc0, };
 
 #include <stdio.h>
@@ -210,7 +210,7 @@
   for (i = 0; i < len; i++) {
     printf("0x%02x ", data[i]);
   }
-  
+
   putchar('\n');
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/base64.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/base64.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/base64.h	Tue Dec 23 07:37:03 2008
@@ -34,10 +34,10 @@
  * [A-Za-z0-9+/=]. Base64 is defined as part of MIME mail format, but it is
  * used widely by other text-based protocols as well.
  *
- * @sa <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>, 
+ * @sa <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>,
  * <i>"Multipurpose Internet Mail Extensions (MIME) Part One:
  * Format of Internet Message Bodies"</i>,
- * N. Freed, N. Borenstein, 
+ * N. Freed, N. Borenstein,
  * November 1996.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/rc4.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/rc4.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/rc4.h	Tue Dec 23 07:37:03 2008
@@ -28,9 +28,9 @@
 
 /**@file sofia-sip/rc4.h
  * @brief Arcfour random number generator.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- *  
+ *
  * @date Created: Sun Jun  9 14:32:58 1996 ppessi
  */
 
@@ -45,21 +45,21 @@
 /** Byte. */
 typedef uint8_t rc4_u8;
 
-/** RC4 context. 
- * 
+/** RC4 context.
+ *
  * The RC4 context is accessed and modified through rc4_init() and rc4()
  * functions only.
  */
-typedef struct {      
-  uint8_t rc4_i;        
+typedef struct {
+  uint8_t rc4_i;
   uint8_t rc4_j;
-  uint8_t rc4_array[256];       
+  uint8_t rc4_array[256];
 } rc4_t;
 
 /** Key RC4 context. */
 SOFIAPUBFUN void rc4_init(const void *seed, isize_t seed_len, rc4_t *state);
 
-/** Generate RC4 stream. */ 
+/** Generate RC4 stream. */
 SOFIAPUBFUN void rc4(void *buffer, isize_t len, rc4_t *state);
 
 #if defined(__cplusplus)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/uniqueid.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/uniqueid.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/uniqueid.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef UNIQUEID_H
 /** Defined when <sofia-sip/uniqueid.h> has been included. */
-#define UNIQUEID_H 
+#define UNIQUEID_H
 
 /**@file sofia-sip/uniqueid.h
  *
@@ -38,7 +38,7 @@
  */
 
 /* Compatibility functionality */
-#define guid_t su_guid_t 
+#define guid_t su_guid_t
 #define guid_generate su_guid_generate
 #define guid_sprintf su_guid_sprintf
 #define guid_strlen su_guid_strlen

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/utf8.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/utf8.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/utf8.h	Tue Dec 23 07:37:03 2008
@@ -32,7 +32,7 @@
  *
  * @date Created: Tue Apr 21 15:32:38 1998 pessi
 
- * @sa <a href="ftp://ftp.ietf.org/rfc/rfc2279.txt">RFC 2279</a>, 
+ * @sa <a href="ftp://ftp.ietf.org/rfc/rfc2279.txt">RFC 2279</a>,
  * <i>"UTF-8, a transformation format of ISO 10646"</i>,
  * F. Yergeau. January 1998.
  *
@@ -83,7 +83,7 @@
 int ucs4ncmp(ucs4 const *s1, ucs4 const *s2, size_t n);
 
 /*
- * IS_UCS4_n tests whether UCS4 character should be represented 
+ * IS_UCS4_n tests whether UCS4 character should be represented
  * with 'n' byte utf8 string
  */
 #define IS_UCS4_1(x) ((ucs4)(x) <= 0x7fu)
@@ -172,7 +172,7 @@
 		      (s)[3]=((c>>12)&63)|128,\
 		      (s)[4]=((c>>6)&63)|128,\
 		      (s)[5]=((c)&63)|128)
-     
+
 SOFIA_END_DECLS
 
 #endif /* UTF8_H */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/token64.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/token64.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/token64.c	Tue Dec 23 07:37:03 2008
@@ -22,13 +22,13 @@
  *
  */
 
-/**@internal @file token64.c  
+/**@internal @file token64.c
  *
  * Token encoding.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
- * @date Created: Wed Apr  3 10:45:47 2002 ppessi 
+ * @date Created: Wed Apr  3 10:45:47 2002 ppessi
  */
 
 #include "config.h"
@@ -39,10 +39,10 @@
 
 #include "sofia-sip/token64.h"
 
-static const char code[65] = 
+static const char code[65] =
 "0123456789-abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
-/** Encode data as a SIP/HTTP token. 
+/** Encode data as a SIP/HTTP token.
  *
  * @note
  * A token is case-independent, so this is really not a good idea.
@@ -74,7 +74,7 @@
 
   for (i = 0; i < dlen; i += 3, s += 4) {
     unsigned char h0 = h[i], h1 = h[i + 1], h2 = h[i + 2];
-    
+
     s[0] = code[h0 >> 2];
     s[1] = code[((h0 << 4)|(h1 >> 4)) & 63];
     s[2] = code[((h1 << 4)|(h2 >> 6)) & 63];

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ucs2.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ucs2.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ucs2.c	Tue Dec 23 07:37:03 2008
@@ -36,7 +36,7 @@
 #include "utf8internal.h"
 
 /*
- * Decode utf8 string into ucs2 string, 
+ * Decode utf8 string into ucs2 string,
  * return number of ucs2 characters decoded
  */
 size_t ucs2decode(ucs2 *dst, size_t dst_size, const utf8 *s)
@@ -70,9 +70,9 @@
  * Encode ucs2 string into utf8 string,
  * return number of utf8 bytes encoded including final zero
  *
- * 'quote' may contain an optional quoting table containing 
+ * 'quote' may contain an optional quoting table containing
  * non-zero for all ASCII characters to quote
- * 
+ *
  */
 size_t ucs2encode(utf8 *dst, const ucs2 *s, size_t n, const char quote[128])
 {
@@ -131,7 +131,7 @@
 {
   size_t len = 1;
   ucs2 c;
-  
+
   while (n-- > 0) {
     c = *s++;
     if (c < 0x80u)
@@ -157,7 +157,7 @@
 {
   size_t len = 0;
 
-  if (s) while (*s++) 
+  if (s) while (*s++)
     len++;
 
   return len;
@@ -170,7 +170,7 @@
 {
   int retval = s1 - s2;
 
-  if (s1 && s2) 
+  if (s1 && s2)
     while ((retval = (*s1 - *s2)) && (*s1++) && (*s2++))
       ;
 
@@ -184,7 +184,7 @@
 {
   int retval = 0;
 
-  if (s1 && s2) 
+  if (s1 && s2)
     while (n-- > 0 && (retval = (*s1 - *s2)) && (*s1++) && (*s2++))
       ;
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ucs4.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ucs4.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/ucs4.c	Tue Dec 23 07:37:03 2008
@@ -35,7 +35,7 @@
 #include "utf8internal.h"
 
 /*
- * Decode utf8 string into ucs4 string, 
+ * Decode utf8 string into ucs4 string,
  * return number of ucs4 characters decoded
  */
 size_t ucs4decode(ucs4 *dst, size_t dst_size, const utf8 *s)
@@ -75,9 +75,9 @@
  * Encode ucs4 string into utf8 string,
  * return number of utf8 bytes encoded including final zero
  *
- * 'quote' may contain an optional quoting table containing 
+ * 'quote' may contain an optional quoting table containing
  * non-zero for all ASCII characters to quote
- * 
+ *
  */
 size_t ucs4encode(utf8 *dst, const ucs4 *s, size_t n, const char quote[128])
 {
@@ -151,7 +151,7 @@
 {
   size_t len = 1;
   ucs4 c;
-  
+
   while (n-- > 0) {
     c = *s++;
     if (c < 0x80u)
@@ -183,7 +183,7 @@
 {
   size_t len = 0;
 
-  if (s) while (*s++) 
+  if (s) while (*s++)
     len++;
 
   return len;
@@ -203,7 +203,7 @@
 }
 
 /*
- * Compare UCS4 string prefix 
+ * Compare UCS4 string prefix
  */
 int ucs4ncmp(ucs4 const *s1, ucs4 const *s2, size_t n)
 {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@CFILE utf8.c 
+/**@CFILE utf8.c
  *
  * utf8 string handling.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8internal.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8internal.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8internal.h	Tue Dec 23 07:37:03 2008
@@ -23,9 +23,9 @@
  */
 
 #ifndef UTF8INTERNAL_H
-#define UTF8INTERNAL_H 
+#define UTF8INTERNAL_H
 
-/**@IFILE utf8internal.h 
+/**@IFILE utf8internal.h
  * UTF-8 macros.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8test.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8test.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/ipt/utf8test.c	Tue Dec 23 07:37:03 2008
@@ -38,27 +38,27 @@
 
 int main(int argc, char *argv[])
 {
-  static ucs4 ucs4test0[] = { 
+  static ucs4 ucs4test0[] = {
     0x41u, 0xC1u, 0x841u, 0x10041u, 0x200041u, 0x4000041u, 0
   };
-  static utf8 ucs4test1[] = 
-    "A" 
+  static utf8 ucs4test1[] =
+    "A"
     "\303\201"
     "\340\241\201"
     "\360\220\201\201"
     "\370\210\200\201\201"
     "\374\204\200\200\201\201";
 
-  static ucs2 ucs2test0[] = { 
+  static ucs2 ucs2test0[] = {
     0x41u, 0xC1u, 0x841u, 0
   };
-  static utf8 ucs2test1[] = 
-    "A" 
+  static utf8 ucs2test1[] =
+    "A"
     "\303\201"
     "\340\241\201";
 
   ucs4 ucs4s[1024] = { 0 };
-  ucs2 ucs2s[1024] = { 0 }; 
+  ucs2 ucs2s[1024] = { 0 };
   utf8 utf8s[1024] = { 0 };
 
   size_t len;
@@ -124,7 +124,7 @@
   else puts("OK");
 
   /* UCS2 */
-  
+
   puts("testing ucs2len(ucs2test0)");
 
   len = ucs2len(ucs2test0);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/Doxyfile.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/Doxyfile.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/Doxyfile.in	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 PROJECT_NAME         = "iptsec"
 OUTPUT_DIRECTORY     = ../docs/html/iptsec
 
-INPUT 		     = @srcdir@/iptsec.docs @srcdir@/sofia-sip @srcdir@ . 
+INPUT 		     = @srcdir@/iptsec.docs @srcdir@/sofia-sip @srcdir@ .
 
 @INCLUDE_PATH = . @srcdir@
 @INCLUDE = ../docs/Doxyfile.conf

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c	Tue Dec 23 07:37:03 2008
@@ -57,14 +57,14 @@
 
 #include <assert.h>
 
-static auth_client_t *ca_create(su_home_t *home, 
+static auth_client_t *ca_create(su_home_t *home,
 				char const *scheme,
 				char const *realm);
 
 static void ca_destroy(su_home_t *home, auth_client_t *ca);
 
 static int ca_challenge(auth_client_t *ca,
-			msg_auth_t const *auth, 
+			msg_auth_t const *auth,
 			msg_hclass_t *credential_class,
 			char const *scheme,
 			char const *realm);
@@ -73,9 +73,9 @@
 		   msg_auth_info_t const *ai,
 		   msg_hclass_t *credential_class);
 
-static int ca_credentials(auth_client_t *ca, 
+static int ca_credentials(auth_client_t *ca,
 			  char const *scheme,
-			  char const *realm, 
+			  char const *realm,
 			  char const *user,
 			  char const *pass);
 
@@ -85,19 +85,19 @@
 /** Initialize authenticators.
  *
  * The function auc_challenge() merges the challenge @a ch to the list of
- * authenticators @a auc_list.  
+ * authenticators @a auc_list.
  *
  * @param[in,out] auc_list  list of authenticators to be updated
  * @param[in,out] home      memory home used for allocating authenticators
  * @param[in] ch        challenge to be processed
  * @param[in] crcl      credential class
- * 
+ *
  * @retval 1 when challenge was updated
  * @retval 0 when there was no new challenges
  * @retval -1 upon an error
  */
 int auc_challenge(auth_client_t **auc_list,
-		  su_home_t *home, 
+		  su_home_t *home,
 		  msg_auth_t const *ch,
 		  msg_hclass_t *crcl)
 {
@@ -139,7 +139,7 @@
   return retval;
 }
 
-/** Update authentication client. 
+/** Update authentication client.
  *
  * @retval -1 upon an error
  * @retval 0 when challenge did not match
@@ -147,10 +147,10 @@
  * @retval 2 when challenge did match and updated client
  */
 static
-int ca_challenge(auth_client_t *ca, 
+int ca_challenge(auth_client_t *ca,
 		 msg_auth_t const *ch,
 		 msg_hclass_t *credential_class,
-		 char const *scheme, 
+		 char const *scheme,
 		 char const *realm)
 {
   int stale = 0;
@@ -165,7 +165,7 @@
   if (strcmp(ca->ca_realm, realm))
     return 0;
 
-  if (ca->ca_credential_class && 
+  if (ca->ca_credential_class &&
       ca->ca_credential_class != credential_class)
     return 0;
 
@@ -205,7 +205,7 @@
  * processed.
  *
  * @bug
- * 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
@@ -238,7 +238,7 @@
   return retval;
 }
 
-/** Update authentication client with authentication info. 
+/** Update authentication client with authentication info.
  *
  * @retval -1 upon an error
  * @retval 0 when challenge did not match
@@ -246,7 +246,7 @@
  * @retval 2 when challenge did match and updated client
  */
 static
-int ca_info(auth_client_t *ca, 
+int ca_info(auth_client_t *ca,
 	    msg_auth_info_t const *info,
 	    msg_hclass_t *credential_class)
 {
@@ -262,7 +262,7 @@
     return 0;
 
   if (!ca->ca_auc
-      || (size_t)ca->ca_auc->auc_plugin_size <= 
+      || (size_t)ca->ca_auc->auc_plugin_size <=
          offsetof(auth_client_plugin_t, auc_info)
       || !ca->ca_auc->auc_info)
     return 0;
@@ -283,14 +283,14 @@
  *
  * @todo The authentication data format sucks.
  *
- * @param[in,out] auc_list  list of authenticators 
+ * @param[in,out] auc_list  list of authenticators
  * @param[in,out] home      memory home used for allocations
  * @param[in] data          colon-separated authentication data
- * 
+ *
  * @retval 0 when successful
  * @retval -1 upon an error
  */
-int auc_credentials(auth_client_t **auc_list, su_home_t *home, 
+int auc_credentials(auth_client_t **auc_list, su_home_t *home,
 		    char const *data)
 {
   int retval = 0, match;
@@ -317,7 +317,7 @@
 	retval = -1;
 	break;
       }
-      if (match) 
+      if (match)
 	retval++;
     }
   }
@@ -330,25 +330,25 @@
 /**Feed authentication data to the authenticator.
  *
  * The function auc_credentials() is used to provide the authenticators in
- * with authentication tuple (scheme, realm, user name, secret).  
+ * with authentication tuple (scheme, realm, user name, secret).
  *
  * scheme:"realm":user:pass
  *
  * @todo The authentication data format sucks.
  *
- * @param[in,out] auc_list  list of authenticators 
+ * @param[in,out] auc_list  list of authenticators
  * @param[in] scheme        scheme to use (NULL, if any)
  * @param[in] realm         realm to use (NULL, if any)
- * @param[in] user          username 
+ * @param[in] user          username
  * @param[in] pass          password
- * 
+ *
  * @retval number of updated clients
  * @retval 0 when no client was updated
  * @retval -1 upon an error
  */
-int auc_all_credentials(auth_client_t **auc_list, 
+int auc_all_credentials(auth_client_t **auc_list,
 			char const *scheme,
-			char const *realm, 
+			char const *realm,
 			char const *user,
 			char const *pass)
 {
@@ -363,7 +363,7 @@
       match = ca_credentials(*auc_list, scheme, realm, user, pass);
       if (match < 0)
 	return -1;
-      if (match) 
+      if (match)
 	retval++;
     }
   }
@@ -371,9 +371,9 @@
   return retval;
 }
 
-int ca_credentials(auth_client_t *ca, 
+int ca_credentials(auth_client_t *ca,
 		   char const *scheme,
-		   char const *realm, 
+		   char const *realm,
 		   char const *user,
 		   char const *pass)
 {
@@ -465,21 +465,21 @@
 
   return retval;
 }
-      	      
+
 
 /**Clear authentication data from the authenticator.
  *
  * The function auc_clear_credentials() is used to remove the credentials
  * from the authenticators.
  *
- * @param[in,out] auc_list  list of authenticators 
- * @param[in] scheme    scheme (if non-null, remove only matching credentials) 
+ * @param[in,out] auc_list  list of authenticators
+ * @param[in] scheme    scheme (if non-null, remove only matching credentials)
  * @param[in] realm     realm (if non-null, remove only matching credentials)
  *
  * @retval 0 when successful
  * @retval -1 upon an error
  */
-int auc_clear_credentials(auth_client_t **auc_list, 
+int auc_clear_credentials(auth_client_t **auc_list,
 			  char const *scheme,
 			  char const *realm)
 {
@@ -502,7 +502,7 @@
       retval = -1;
       break;
     }
-    if (match) 
+    if (match)
       retval++;
   }
 
@@ -523,7 +523,7 @@
 }
 
 /** Check if we have all required credentials.
- * 
+ *
  * @retval 1 when authorization can proceed
  * @retval 0 when there is not enough credentials
  *
@@ -553,20 +553,20 @@
  * headers to a request. The authentication headers will contain the
  * credentials generated by the list of authenticators.
  *
- * @param[in,out] auc_list  list of authenticators 
+ * @param[in,out] auc_list  list of authenticators
  * @param[out] msg          message to be authenticated
  * @param[out] pub          headers of the message
  * @param[in] method        request method
  * @param[in] url           request URI
  * @param[in] body          message body (NULL if empty)
- * 
+ *
  * @retval 1 when successful
  * @retval 0 when there is not enough credentials
  * @retval -1 upon an error
  */
 int auc_authorization(auth_client_t **auc_list, msg_t *msg, msg_pub_t *pub,
-		      char const *method, 
-		      url_t const *url, 
+		      char const *method,
+		      url_t const *url,
 		      msg_payload_t const *body)
 {
   auth_client_t *ca;
@@ -616,21 +616,21 @@
  * authentication headers for a request. The list of authentication headers
  * will contain the credentials generated by the list of authenticators.
  *
- * @param[in] auc_list      list of authenticators 
+ * @param[in] auc_list      list of authenticators
  * @param[in] home          memory home used to allocate headers
  * @param[in] method        request method
  * @param[in] url           request URI
  * @param[in] body          message body (NULL if empty)
  * @param[out] return_headers  authorization headers return value
- * 
+ *
  * @retval 1 when successful
  * @retval 0 when there is not enough credentials
  * @retval -1 upon an error
  */
-int auc_authorization_headers(auth_client_t **auc_list, 
+int auc_authorization_headers(auth_client_t **auc_list,
 			      su_home_t *home,
-			      char const *method, 
-			      url_t const *url, 
+			      char const *method,
+			      url_t const *url,
 			      msg_payload_t const *body,
 			      msg_header_t **return_headers)
 {
@@ -666,13 +666,13 @@
 
 static int auc_basic_authorization(auth_client_t *ca,
 				   su_home_t *h,
-				   char const *method, 
-				   url_t const *url, 
+				   char const *method,
+				   url_t const *url,
 				   msg_payload_t const *body,
 				   msg_header_t **);
 
-static const auth_client_plugin_t ca_basic_plugin = 
-{ 
+static const auth_client_plugin_t ca_basic_plugin =
+{
   /* auc_plugin_size: */ sizeof ca_basic_plugin,
   /* auc_size: */        sizeof (auth_client_t),
   /* auc_name: */       "Basic",
@@ -694,15 +694,15 @@
  * @param hc   header class for the header to be created
  * @param user user name
  * @param pass password
- * 
+ *
  * @return
- * The function auc_basic_authorization() returns a pointer to newly created 
+ * The function auc_basic_authorization() returns a pointer to newly created
  * authorization header, or NULL upon an error.
  */
-int auc_basic_authorization(auth_client_t *ca, 
+int auc_basic_authorization(auth_client_t *ca,
 			    su_home_t *home,
-			    char const *method, 
-			    url_t const *url, 
+			    char const *method,
+			    url_t const *url,
 			    msg_payload_t const *body,
 			    msg_header_t **return_headers)
 {
@@ -742,7 +742,7 @@
   userpass[ulen] = ':';
   memcpy(userpass + ulen + 1, pass, plen);
   userpass[uplen] = '\0';
-  
+
   base64_e(base64, b64len + 1, userpass, uplen);
 
   base64[b64len] = '\0';
@@ -767,22 +767,22 @@
   auth_challenge_t cda_ac[1];
 } auth_digest_client_t;
 
-static int auc_digest_challenge(auth_client_t *ca, 
+static int auc_digest_challenge(auth_client_t *ca,
 				msg_auth_t const *ch);
-static int auc_digest_authorization(auth_client_t *ca, 
+static int auc_digest_authorization(auth_client_t *ca,
 				    su_home_t *h,
-				    char const *method, 
-				    url_t const *url, 
+				    char const *method,
+				    url_t const *url,
 				    msg_payload_t const *body,
 				    msg_header_t **);
-static int auc_digest_info(auth_client_t *ca, 
+static int auc_digest_info(auth_client_t *ca,
 			   msg_auth_info_t const *info);
 
-static const auth_client_plugin_t ca_digest_plugin = 
-{ 
+static const auth_client_plugin_t ca_digest_plugin =
+{
   /* auc_plugin_size: */ sizeof ca_digest_plugin,
   /* auc_size: */        sizeof (auth_digest_client_t),
-  /* auc_name: */       "Digest", 
+  /* auc_name: */       "Digest",
   /* auc_challenge: */   auc_digest_challenge,
   /* auc_authorize: */   auc_digest_authorization,
   /* auc_info: */        auc_digest_info,
@@ -866,15 +866,15 @@
  * sip_authorization_class or sip_proxy_authorization_class, as well as
  * http_authorization_class or http_proxy_authorization_class.
  *
- * @retval 1 when authorization headers has been created  
+ * @retval 1 when authorization headers has been created
  * @retval 0 when there is no credentials
  * @retval -1 upon an error
  */
 static
-int auc_digest_authorization(auth_client_t *ca, 
+int auc_digest_authorization(auth_client_t *ca,
 			     su_home_t *home,
-			     char const *method, 
-			     url_t const *url, 
+			     char const *method,
+			     url_t const *url,
 			     msg_payload_t const *body,
 			     msg_header_t **return_headers)
 {
@@ -923,7 +923,7 @@
   auth_digest_sessionkey(ar, sessionkey, pass);
   auth_digest_response(ar, response, sessionkey, method, data, dlen);
 
-  h = msg_header_format(home, hc, 
+  h = msg_header_format(home, hc,
 			"Digest "
 			"username=\"%s\", "
 			"realm=\"%s\", "
@@ -935,21 +935,21 @@
 			"response=\"%s\""
 			"%s%s"
 			"%s%s",
-			ar->ar_username, 
+			ar->ar_username,
 			ar->ar_realm,
 			ar->ar_nonce,
-			cnonce ? "\",  cnonce=\"" : "", 
+			cnonce ? "\",  cnonce=\"" : "",
 			cnonce ? cnonce : "",
-			ar->ar_opaque ? "\",  opaque=\"" : "", 
+			ar->ar_opaque ? "\",  opaque=\"" : "",
 			ar->ar_opaque ? ar->ar_opaque : "",
 			ar->ar_algorithm ? "\", algorithm=" : "",
 			ar->ar_algorithm ? ar->ar_algorithm : "",
 			ar->ar_uri,
 			response,
-			ar->ar_auth || ar->ar_auth_int ? ", qop=" : "", 
-			ar->ar_auth_int ? "auth-int" : 
+			ar->ar_auth || ar->ar_auth_int ? ", qop=" : "",
+			ar->ar_auth_int ? "auth-int" :
 			(ar->ar_auth ? "auth" : ""),
-			cnonce ? ", nc=" : "", 
+			cnonce ? ", nc=" : "",
 			cnonce ? ncount : "");
 
   su_free(home, uri);
@@ -965,7 +965,7 @@
 
 #define MAX_AUC 20
 
-static auth_client_plugin_t const *ca_plugins[MAX_AUC] = 
+static auth_client_plugin_t const *ca_plugins[MAX_AUC] =
 {
   &ca_digest_plugin, &ca_basic_plugin, NULL
 };
@@ -984,7 +984,7 @@
     return errno = EINVAL, -1;
 
   for (i = 0; i < MAX_AUC; i++) {
-    if (ca_plugins[i] == NULL || 
+    if (ca_plugins[i] == NULL ||
 	strcmp(plugin->auc_name, ca_plugins[i]->auc_name) == 0) {
       ca_plugins[i] = plugin;
       return 0;
@@ -1051,10 +1051,10 @@
  * headers to a SIP request. The authentication headers will contain the
  * credentials generated by the list of authenticators.
  *
- * @param[in,out] auc_list  list of authenticators 
+ * @param[in,out] auc_list  list of authenticators
  * @param[in,out] msg       message to be authenticated
  * @param[in,out] sip       sip headers of the message
- * 
+ *
  * @retval 1 when successful
  * @retval 0 when there is not enough credentials
  * @retval -1 upon an error
@@ -1066,14 +1066,14 @@
   if (!rq)
     return 0;
 
-  return auc_authorization(auc_list, msg, (msg_pub_t *)sip, 
-			   rq->rq_method_name, 
+  return auc_authorization(auc_list, msg, (msg_pub_t *)sip,
+			   rq->rq_method_name,
 			   /*
 			     RFC 3261 defines the protection domain based
 			     only on realm, so we do not bother get a
 			     correct URI to auth module.
 			   */
-			   rq->rq_url, 
+			   rq->rq_url,
 			   sip->sip_payload);
 }
 #endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client_ntlm.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client_ntlm.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client_ntlm.c	Tue Dec 23 07:37:03 2008
@@ -63,20 +63,20 @@
   auth_challenge_t ntlm_ac[1];
 } auth_ntlm_client_t;
 
-static int auc_ntlm_challenge(auth_client_t *ca, 
+static int auc_ntlm_challenge(auth_client_t *ca,
 				msg_auth_t const *ch);
-static int auc_ntlm_authorization(auth_client_t *ca, 
+static int auc_ntlm_authorization(auth_client_t *ca,
 				    su_home_t *h,
-				    char const *method, 
-				    url_t const *url, 
+				    char const *method,
+				    url_t const *url,
 				    msg_payload_t const *body,
 				    msg_header_t **);
 
-auth_client_plugin_t const _ntlm_client_plugin = 
-{ 
+auth_client_plugin_t const _ntlm_client_plugin =
+{
   sizeof ca_ntlm_plugin,
   sizeof (auth_ntlm_client_t),
-  "NTLM", 
+  "NTLM",
   auc_ntlm_challenge,
   auc_ntlm_authorization
 };
@@ -142,7 +142,7 @@
  * @param pass 	  password
  * @param ac      challenge structure
  * @param cnonce  client nonce
- * @param nc      client nonce count 
+ * @param nc      client nonce count
  * @param method  request method
  * @param uri     request uri
  * @param data    message body
@@ -152,10 +152,10 @@
  * Returns a pointer to newly created authorization header, or NULL upon an
  * error.
  */
-int auc_ntlm_authorization(auth_client_t *ca, 
+int auc_ntlm_authorization(auth_client_t *ca,
 			     su_home_t *home,
-			     char const *method, 
-			     url_t const *url, 
+			     char const *method,
+			     url_t const *url,
 			     msg_payload_t const *body,
 			     msg_header_t **return_headers)
 {
@@ -201,7 +201,7 @@
   auth_ntlm_sessionkey(ar, sessionkey, pass);
   auth_ntlm_response(ar, response, sessionkey, method, data, dlen);
 
-  h = msg_header_format(home, hc, 
+  h = msg_header_format(home, hc,
 			"NTLM "
 			"username=\"%s\", "
 			"realm=\"%s\", "
@@ -213,21 +213,21 @@
 			"response=\"%s\""
 			"%s%s"
 			"%s%s",
-			ar->ar_username, 
+			ar->ar_username,
 			ar->ar_realm,
 			ar->ar_nonce,
-			cnonce ? "\",  cnonce=\"" : "", 
+			cnonce ? "\",  cnonce=\"" : "",
 			cnonce ? cnonce : "",
-			ar->ar_opaque ? "\",  opaque=\"" : "", 
+			ar->ar_opaque ? "\",  opaque=\"" : "",
 			ar->ar_opaque ? ar->ar_opaque : "",
 			ar->ar_algorithm ? "\", algorithm=" : "",
 			ar->ar_algorithm ? ar->ar_algorithm : "",
 			ar->ar_uri,
 			response,
-			ar->ar_auth || ar->ar_auth_int ? ", qop=" : "", 
-			ar->ar_auth_int ? "auth-int" : 
+			ar->ar_auth || ar->ar_auth_int ? ", qop=" : "",
+			ar->ar_auth_int ? "auth-int" :
 			(ar->ar_auth ? "auth" : ""),
-			cnonce ? ", nc=" : "", 
+			cnonce ? ", nc=" : "",
 			cnonce ? ncount : "");
 
   su_free(home, uri);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_common.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_common.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_common.c	Tue Dec 23 07:37:03 2008
@@ -54,7 +54,7 @@
  * The function auth_get_params() searches for the authentication parameters
  * in @a params. The parameter list @a params is seached for each parameter
  * given in in vararg section, and if it is found, its value is assigned to
- * the given address. 
+ * the given address.
  *
  * @note The field name should contain the equal ("=") sign.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_digest.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_digest.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_digest.c	Tue Dec 23 07:37:03 2008
@@ -59,7 +59,7 @@
  * found, or -1 upon an error.
  */
 issize_t auth_digest_challenge_get(su_home_t *home,
-				   auth_challenge_t *ac0, 
+				   auth_challenge_t *ac0,
 				   char const * const params[])
 {
   ssize_t n;
@@ -70,7 +70,7 @@
 
   ac->ac_size = sizeof(ac);
 
-  assert(ac0); 
+  assert(ac0);
   assert(ac0->ac_size >= (int) sizeof(*ac));
 
   if (ac0 == NULL || params == NULL)
@@ -103,7 +103,7 @@
   auth_struct_copy(ac0, ac, sizeof(ac));
 
   SU_DEBUG_5(("%s(): got "MOD_ZD"\n", "auth_digest_challenge_get", n));
-  
+
   return n;
 }
 
@@ -136,7 +136,7 @@
  * found, or -1 upon an error.
  */
 issize_t auth_digest_response_get(su_home_t *home,
-				  auth_response_t *ar0, 
+				  auth_response_t *ar0,
 				  char const *const params[])
 {
   ssize_t n;
@@ -189,7 +189,7 @@
   if (!quoted)
     /*xyzzy*/;
   else if (quoted[0] == '"') {
-    char const *q; 
+    char const *q;
     size_t n;
 
     for (q = quoted + 1; *q; q += n + 2) {
@@ -204,9 +204,9 @@
     su_md5_strupdate(md5, quoted);
 }
 
-/** Generate A1 hash for digest authentication. 
+/** Generate A1 hash for digest authentication.
  */
-int auth_digest_a1(auth_response_t *ar, 
+int auth_digest_a1(auth_response_t *ar,
 		   auth_hexmd5_t ha1,
 		   char const *secret)
 {
@@ -222,13 +222,13 @@
 
   su_md5_hexdigest(md5, ha1);
 
-  SU_DEBUG_5(("auth_digest_a1() has A1 = MD5(%s:%s:%s) = %s\n", 
+  SU_DEBUG_5(("auth_digest_a1() has A1 = MD5(%s:%s:%s) = %s\n",
 	      ar->ar_username, ar->ar_realm, secret, ha1));
 
   return 0;
 }
 
-int auth_digest_a1sess(auth_response_t *ar, 
+int auth_digest_a1sess(auth_response_t *ar,
 		       auth_hexmd5_t ha1sess,
 		       char const *ha1)
 {
@@ -243,15 +243,15 @@
 
   su_md5_hexdigest(md5, ha1sess);
 
-  SU_DEBUG_5(("auth_sessionkey has A1' = MD5(%s:%s:%s) = %s\n", 
+  SU_DEBUG_5(("auth_sessionkey has A1' = MD5(%s:%s:%s) = %s\n",
 	      ha1, ar->ar_nonce, ar->ar_cnonce, ha1sess));
 
   return 0;
 }
 
-/** Generate MD5 session key for digest authentication. 
+/** Generate MD5 session key for digest authentication.
  */
-int auth_digest_sessionkey(auth_response_t *ar, 
+int auth_digest_sessionkey(auth_response_t *ar,
 			   auth_hexmd5_t ha1,
 			   char const *secret)
 {
@@ -263,7 +263,7 @@
     return -1;
 
   if (ar->ar_md5sess) {
-    auth_hexmd5_t base_ha1; 
+    auth_hexmd5_t base_ha1;
     auth_digest_a1(ar, base_ha1, secret);
     auth_digest_a1sess(ar, ha1, base_ha1);
   } else {
@@ -273,12 +273,12 @@
   return 0;
 }
 
-/** Generate response for digest authentication. 
+/** Generate response for digest authentication.
  *
  */
-int auth_digest_response(auth_response_t *ar, 
+int auth_digest_response(auth_response_t *ar,
 			 auth_hexmd5_t response,
-			 auth_hexmd5_t const ha1, 
+			 auth_hexmd5_t const ha1,
 			 char const *method_name,
 			 void const *data, isize_t dlen)
 {
@@ -314,7 +314,7 @@
   }
   su_md5_hexdigest(md5, HA2);
 
-  SU_DEBUG_5(("A2 = MD5(%s:%s%s%s)\n", method_name, ar->ar_uri, 
+  SU_DEBUG_5(("A2 = MD5(%s:%s%s%s)\n", method_name, ar->ar_uri,
 	      ar->ar_auth_int ? ":" : "", ar->ar_auth_int ? Hentity : ""));
 
   /* Calculate response */
@@ -333,17 +333,17 @@
   }
 
   su_md5_update(md5, ":", 1);
-  su_md5_update(md5, HA2, 32);      
+  su_md5_update(md5, HA2, 32);
   su_md5_hexdigest(md5, response);
 
-  SU_DEBUG_5(("auth_response: %s = MD5(%s:%s%s%s%s%s%s%s:%s) (qop=%s)\n", 
-	      response, ha1, ar->ar_nonce, 
-	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_nc : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_cnonce : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_qop : "", 
+  SU_DEBUG_5(("auth_response: %s = MD5(%s:%s%s%s%s%s%s%s:%s) (qop=%s)\n",
+	      response, ha1, ar->ar_nonce,
+	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_nc : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_cnonce : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_qop : "",
 	      HA2,
 	      ar->ar_qop ? ar->ar_qop : "NONE"));
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module.c	Tue Dec 23 07:37:03 2008
@@ -80,7 +80,7 @@
 static void auth_md5_hmac_key(auth_mod_t *am);
 
 HTABLE_PROTOS_WITH(auth_htable, aht, auth_passwd_t, usize_t, unsigned);
-HTABLE_BODIES_WITH(auth_htable, aht, auth_passwd_t, APW_HASH, 
+HTABLE_BODIES_WITH(auth_htable, aht, auth_passwd_t, APW_HASH,
 		   usize_t, unsigned);
 
 /**Allocate an authentication module instance.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_http.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_http.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_http.c	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 /**@internal
  * @file auth_module_http.c
  * @brief Authenticate HTTP request
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Jari Urpalainen <Jari.Urpalainen at nokia.com>
  *
@@ -43,10 +43,10 @@
 
 #include <sofia-sip/auth_module.h>
 
-static auth_challenger_t http_server_challenger[] = 
+static auth_challenger_t http_server_challenger[] =
   {{ HTTP_401_UNAUTHORIZED, http_www_authenticate_class }};
 
-static auth_challenger_t http_proxy_challenger[] = 
+static auth_challenger_t http_proxy_challenger[] =
   {{ HTTP_407_PROXY_AUTH, http_proxy_authenticate_class }};
 
 const char *auth_mod_check_http(auth_mod_t *am,
@@ -54,22 +54,22 @@
 	                        http_t const *http,
 		                auth_kind_t proxy)
 {
-  msg_auth_t *credentials = 
+  msg_auth_t *credentials =
     proxy ? http->http_proxy_authorization : http->http_authorization;
-  auth_challenger_t const *challenger = 
+  auth_challenger_t const *challenger =
     proxy ? http_proxy_challenger : http_server_challenger;
 
   if (http->http_request) {
     if (!as->as_method)
       as->as_method = http->http_request->rq_method_name;
 #if 0
-    if (!as->as_uri) 
+    if (!as->as_uri)
       as->as_uri = http->http_request->rq_url;
 #endif
   }
 
   if (http->http_payload && !as->as_body)
-    as->as_body = http->http_payload->pl_data, 
+    as->as_body = http->http_payload->pl_data,
       as->as_bodylen = http->http_payload->pl_len;
 
   /* Call real authentication method */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_sip.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_sip.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_sip.c	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 /**@internal
  * @file auth_module_sip.c
  * @brief Authenticate SIP request
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Jari Urpalainen <Jari.Urpalainen at nokia.com>
  *
@@ -45,19 +45,19 @@
 
 #include <sofia-sip/auth_module.h>
 
-static auth_challenger_t sip_server_challenger[] = 
+static auth_challenger_t sip_server_challenger[] =
   {{ SIP_401_UNAUTHORIZED, sip_www_authenticate_class,
      sip_authentication_info_class
     }};
 
-static auth_challenger_t sip_proxy_challenger[] = 
+static auth_challenger_t sip_proxy_challenger[] =
   {{ SIP_407_PROXY_AUTH_REQUIRED, sip_proxy_authenticate_class }};
 
-/** Authenticate an incoming SIP request. 
+/** Authenticate an incoming SIP request.
  *
  * The function auth_mod_check() completes the @a as structure and calls the
  * scheme-specific authentication method performing the actual
- * authentication.  
+ * authentication.
  *
  * A successful authentication is indicated by setting @a as->as_status to
  * 0.  The authentication module sets @a as->as_match as the matching
@@ -86,7 +86,7 @@
     as->as_method = sip->sip_request->rq_method_name;
 
   if (sip->sip_payload)
-    as->as_body = sip->sip_payload->pl_data, 
+    as->as_body = sip->sip_payload->pl_data,
       as->as_bodylen = sip->sip_payload->pl_len;
 
   auth_mod_method(am, as, credentials, challenger);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_ntlm.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_ntlm.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_ntlm.c	Tue Dec 23 07:37:03 2008
@@ -58,7 +58,7 @@
  * found, or -1 upon an error.
  */
 issize_t auth_ntlm_challenge_get(su_home_t *home,
-				auth_challenge_t *ac0, 
+				auth_challenge_t *ac0,
 				char const * const params[])
 {
   ssize_t n;
@@ -68,7 +68,7 @@
 
   ac->ac_size = sizeof(ac);
 
-  assert(ac0); 
+  assert(ac0);
   assert(ac0->ac_size >= sizeof(*ac));
 
   if (ac0 == NULL || params == NULL)
@@ -103,7 +103,7 @@
   auth_struct_copy(ac0, ac, sizeof(ac));
 
   SU_DEBUG_5(("%s(): got %d\n", "auth_ntlm_challenge_get", n));
-  
+
   return n;
 }
 
@@ -119,7 +119,7 @@
  * found, or -1 upon an error.
  */
 issize_t auth_ntlm_response_get(su_home_t *home,
-				auth_response_t *ar0, 
+				auth_response_t *ar0,
 				char const *const params[])
 {
   ssize_t n;
@@ -169,9 +169,9 @@
 
 #if 0
 
-/** Generate A1 hash for digest authentication. 
+/** Generate A1 hash for digest authentication.
  */
-int auth_digest_a1(auth_response_t *ar, 
+int auth_digest_a1(auth_response_t *ar,
 		   auth_hexmd5_t ha1,
 		   char const *secret)
 {
@@ -187,13 +187,13 @@
 
   su_md5_hexdigest(md5, ha1);
 
-  SU_DEBUG_5(("auth_digest_a1() has A1 = MD5(%s:%s:%s) = %s\n", 
+  SU_DEBUG_5(("auth_digest_a1() has A1 = MD5(%s:%s:%s) = %s\n",
 	      ar->ar_username, ar->ar_realm, secret, ha1));
 
   return 0;
 }
 
-int auth_digest_a1sess(auth_response_t *ar, 
+int auth_digest_a1sess(auth_response_t *ar,
 		       auth_hexmd5_t ha1sess,
 		       char const *ha1)
 {
@@ -208,15 +208,15 @@
 
   su_md5_hexdigest(md5, ha1sess);
 
-  SU_DEBUG_5(("auth_sessionkey has A1' = MD5(%s:%s:%s) = %s\n", 
+  SU_DEBUG_5(("auth_sessionkey has A1' = MD5(%s:%s:%s) = %s\n",
 	      ha1, ar->ar_nonce, ar->ar_cnonce, ha1sess));
 
   return 0;
 }
 
-/** Generate MD5 session key for digest authentication. 
+/** Generate MD5 session key for digest authentication.
  */
-int auth_digest_sessionkey(auth_response_t *ar, 
+int auth_digest_sessionkey(auth_response_t *ar,
 			   auth_hexmd5_t ha1,
 			   char const *secret)
 {
@@ -228,7 +228,7 @@
     return -1;
 
   if (ar->ar_md5sess) {
-    auth_hexmd5_t base_ha1; 
+    auth_hexmd5_t base_ha1;
     auth_digest_a1(ar, base_ha1, secret);
     auth_digest_a1sess(ar, ha1, base_ha1);
   } else {
@@ -243,12 +243,12 @@
 
 #if 0
 
-/** Generate response for digest authentication. 
+/** Generate response for digest authentication.
  *
  */
-int auth_digest_response(auth_response_t *ar, 
+int auth_digest_response(auth_response_t *ar,
 			 auth_hexmd5_t response,
-			 auth_hexmd5_t const ha1, 
+			 auth_hexmd5_t const ha1,
 			 char const *method_name,
 			 void const *data, issize_t dlen)
 {
@@ -284,7 +284,7 @@
   }
   su_md5_hexdigest(md5, HA2);
 
-  SU_DEBUG_5(("A2 = MD5(%s:%s%s%s)\n", method_name, ar->ar_uri, 
+  SU_DEBUG_5(("A2 = MD5(%s:%s%s%s)\n", method_name, ar->ar_uri,
 	      ar->ar_auth_int ? ":" : "", ar->ar_auth_int ? Hentity : ""));
 
   /* Calculate response */
@@ -303,17 +303,17 @@
   }
 
   su_md5_update(md5, ":", 1);
-  su_md5_update(md5, HA2, 32);      
+  su_md5_update(md5, HA2, 32);
   su_md5_hexdigest(md5, response);
 
-  SU_DEBUG_5(("auth_response: %s = MD5(%s:%s%s%s%s%s%s%s:%s) (qop=%s)\n", 
-	      response, ha1, ar->ar_nonce, 
-	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_nc : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_cnonce : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "", 
-	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_qop : "", 
+  SU_DEBUG_5(("auth_response: %s = MD5(%s:%s%s%s%s%s%s%s:%s) (qop=%s)\n",
+	      response, ha1, ar->ar_nonce,
+	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_nc : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_cnonce : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ":" : "",
+	      ar->ar_auth ||  ar->ar_auth_int ? ar->ar_qop : "",
 	      HA2,
 	      ar->ar_qop ? ar->ar_qop : "NONE"));
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin.c	Tue Dec 23 07:37:03 2008
@@ -25,9 +25,9 @@
 /**@internal
  * @file auth_plugin.c
  * @brief Plugin interface for authentication verification modules.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Apr 27 15:23:31 2004 ppessi
  */
 
@@ -69,7 +69,7 @@
   auth_scheme_delayed
 };
 
-/** Register an authentication plugin. 
+/** Register an authentication plugin.
  *
  * @retval 0 when successful
  * @retval -1 upon an error
@@ -82,17 +82,17 @@
     if (i == N)
       return -1;
   }
-  
+
   schemes[i] = asch;
 
   return 0;
 }
 
-/**Create an authentication plugin module. 
+/**Create an authentication plugin module.
  *
  * The function auth_mod_create() creates a module used to authenticate the
  * requests.
- * 
+ *
  * @param root pointer to a su_root_t object
  * @param tag,value,... tagged argument list
  *
@@ -123,7 +123,7 @@
     size_t len;
 
     base = strrchr(method, '+');
-    if (base) 
+    if (base)
       len = base++ - method;
     else
       len = strlen(method);
@@ -132,7 +132,7 @@
       ;
     else if (strcasecmp(base, "Basic") == 0)
       bscheme = auth_scheme_basic;
-    else if (strcasecmp(base, "Digest") == 0) 
+    else if (strcasecmp(base, "Digest") == 0)
       bscheme = auth_scheme_digest;
 
     if (base == NULL || bscheme) {
@@ -152,6 +152,6 @@
   }
 
   ta_end(ta);
-  
+
   return am;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_delayed.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_delayed.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_delayed.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@CFILE auth_plugin_delayed.c
  *
- * @brief Plugin for delayed authentication. 
+ * @brief Plugin for delayed authentication.
  *
  * This authentication plugin provides authentication operation that is
  * intentionally delayed. It serves as an example of server-side
@@ -61,7 +61,7 @@
 #include "sofia-sip/auth_module.h"
 #include "sofia-sip/auth_plugin.h"
 
-struct auth_plugin_t 
+struct auth_plugin_t
 {
   su_root_t      *ap_root;
   auth_scheme_t  *ap_base;
@@ -81,7 +81,7 @@
 				msg_auth_t *auth,
 				auth_challenger_t const *ach);
 
-static void delayed_auth_challenge(auth_mod_t *am, 
+static void delayed_auth_challenge(auth_mod_t *am,
 				   auth_status_t *as,
 				   auth_challenger_t const *ach);
 
@@ -89,12 +89,12 @@
 
 static void delayed_auth_destroy(auth_mod_t *am);
 
-auth_scheme_t auth_scheme_delayed[1] = 
+auth_scheme_t auth_scheme_delayed[1] =
   {{
       "Delayed",
       sizeof (struct { auth_mod_t mod[1]; auth_plugin_t plug[1]; }),
       delayed_auth_init,
-      delayed_auth_method, 
+      delayed_auth_method,
       delayed_auth_challenge,
       delayed_auth_cancel,
       delayed_auth_destroy
@@ -118,13 +118,13 @@
 
     retval = 0;
   }
-    
+
   ta_end(ta);
 
   return retval;
 }
 
-struct auth_splugin_t 
+struct auth_splugin_t
 {
   void const      *asp_cookie;
   auth_splugin_t  *asp_next;
@@ -152,7 +152,7 @@
   su_msg_r mamc = SU_MSG_R_INIT;
   auth_splugin_t *asp;
 
-  if (su_msg_create(mamc, 
+  if (su_msg_create(mamc,
 		    su_root_task(ap->ap_root),
 		    su_root_task(ap->ap_root),
 		    delayed_auth_method_recv,
@@ -202,7 +202,7 @@
     asp->asp_as->as_callback(asp->asp_as->as_magic, asp->asp_as);
 }
 
-static void delayed_auth_challenge(auth_mod_t *am, 
+static void delayed_auth_challenge(auth_mod_t *am,
 				   auth_status_t *as,
 				   auth_challenger_t const *ach)
 {
@@ -217,7 +217,7 @@
   auth_plugin_t *ap = AUTH_PLUGIN(am);
 
   (void)ap;			/* xyzzy */
-  
+
   if (as->as_plugin && as->as_plugin->asp_cookie == delayed_asp_cookie)
     as->as_plugin->asp_canceled = 1;
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_ntlm.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_ntlm.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_ntlm.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@CFILE auth_plugin_ntlm.c
  *
- * @brief Plugin for delayed authentication. 
+ * @brief Plugin for delayed authentication.
  *
  * This authentication plugin provides authentication operation that is
  * intentionally delayed. It serves as an example of server-side
@@ -100,14 +100,14 @@
   if (auth_init_default(am, NULL, root, ta_tags(ta)) != -1) {
     retval = 0;
   }
-    
+
   ta_end(ta);
 
   return retval;
 }
 
 
-/** Authenticate a request with @b NTLM authentication scheme. 
+/** Authenticate a request with @b NTLM authentication scheme.
  *
  * This function reads user database before authentication, if needed.
  */
@@ -123,7 +123,7 @@
   }
 }
 
-/** Authenticate a request with @b Ntlm authentication scheme. 
+/** Authenticate a request with @b Ntlm authentication scheme.
  */
 void auth_method_ntlm(auth_mod_t *am,
 		      auth_status_t *as,
@@ -144,7 +144,7 @@
     as->as_status = 0, as->as_phrase = NULL;
     as->as_match = (msg_header_t *)au;
     return;
-  } 
+  }
 
   if (au) {
     auth_response_t ar[1] = {{ sizeof(ar) }};
@@ -161,7 +161,7 @@
 
 
 /** Find a NTLM credential header with matching realm and opaque. */
-msg_auth_t *auth_ntlm_credentials(msg_auth_t *auth, 
+msg_auth_t *auth_ntlm_credentials(msg_auth_t *auth,
 				  char const *realm,
 				  char const *opaque,
 				  char const *gssapidata,
@@ -216,19 +216,19 @@
 
 #define PA "Authorization missing "
 
-  if ((!ar->ar_username && (phrase = PA "username")) || 
-      (!ar->ar_nonce && (phrase = PA "nonce")) || 
-      (!ar->ar_uri && (phrase = PA "URI")) || 
-      (!ar->ar_response && (phrase = PA "response")) || 
+  if ((!ar->ar_username && (phrase = PA "username")) ||
+      (!ar->ar_nonce && (phrase = PA "nonce")) ||
+      (!ar->ar_uri && (phrase = PA "URI")) ||
+      (!ar->ar_response && (phrase = PA "response")) ||
       /* (!ar->ar_opaque && (phrase = PA "opaque")) || */
       /* Check for qop */
-      (ar->ar_qop && 
-       ((ar->ar_auth && 
+      (ar->ar_qop &&
+       ((ar->ar_auth &&
 	 strcasecmp(ar->ar_qop, "auth") &&
 	 strcasecmp(ar->ar_qop, "\"auth\"")) ||
-	(ar->ar_auth_int && 
+	(ar->ar_auth_int &&
 	 strcasecmp(ar->ar_qop, "auth-int") &&
-	 strcasecmp(ar->ar_qop, "\"auth-int\""))) 
+	 strcasecmp(ar->ar_qop, "\"auth-int\"")))
        && (phrase = PA "has invalid qop"))) {
     assert(phrase);
     SU_DEBUG_5(("auth_method_ntlm: 400 %s\n", phrase));
@@ -239,10 +239,10 @@
 
   /* XXX - replace */
 #if 0
-  if (as->as_nonce_issued == 0 /* Already validated nonce */ && 
+  if (as->as_nonce_issued == 0 /* Already validated nonce */ &&
       auth_validate_ntlm_nonce(am, as, ar, now) < 0) {
 #else
-  if (as->as_nonce_issued == 0 /* Already validated nonce */ && 
+  if (as->as_nonce_issued == 0 /* Already validated nonce */ &&
       auth_validate_digest_nonce(am, as, ar, now) < 0) {
 #endif
     as->as_blacklist = am->am_blacklist;
@@ -262,9 +262,9 @@
     a1 = apw->apw_hash;
   else if (apw && apw->apw_pass)
     auth_ntlm_a1(ar, a1buf, apw->apw_pass), a1 = a1buf;
-  else 
+  else
     auth_ntlm_a1(ar, a1buf, "xyzzy"), a1 = a1buf, apw = NULL;
-  
+
   if (ar->ar_md5sess)
     auth_ntlm_a1sess(ar, a1buf, a1), a1 = a1buf;
 #else
@@ -272,19 +272,19 @@
     a1 = apw->apw_hash;
   else if (apw && apw->apw_pass)
     auth_digest_a1(ar, a1buf, apw->apw_pass), a1 = a1buf;
-  else 
+  else
     auth_digest_a1(ar, a1buf, "xyzzy"), a1 = a1buf, apw = NULL;
-  
+
   if (ar->ar_md5sess)
     auth_digest_a1sess(ar, a1buf, a1), a1 = a1buf;
 #endif
 
-  /* XXX - replace with auth_ntlm_response */      
+  /* XXX - replace with auth_ntlm_response */
 #if 0
-  auth_ntlm_response(ar, response, a1, 
+  auth_ntlm_response(ar, response, a1,
 		     as->as_method, as->as_body, as->as_bodylen);
 #else
-  auth_digest_response(ar, response, a1, 
+  auth_digest_response(ar, response, a1,
 		       as->as_method, as->as_body, as->as_bodylen);
 #endif
 
@@ -321,7 +321,7 @@
 }
 
 /** Construct a challenge header for @b Ntlm authentication scheme. */
-void auth_challenge_ntlm(auth_mod_t *am, 
+void auth_challenge_ntlm(auth_mod_t *am,
 			   auth_status_t *as,
 			   auth_challenger_t const *ach)
 {
@@ -337,8 +337,8 @@
   u = as->as_uri;
   d = as->as_pdomain;
 
-  as->as_response = 
-    msg_header_format(as->as_home, ach->ach_header, 
+  as->as_response =
+    msg_header_format(as->as_home, ach->ach_header,
 		      "Ntlm"
 		      " realm=\"%s\","
 		      "%s%s%s"
@@ -346,12 +346,12 @@
 		      " nonce=\"%s\","
 		      "%s%s%s"
 		      "%s"	/* stale */
-		      " algorithm=%s" 
+		      " algorithm=%s"
 		      "%s%s%s",
-		      as->as_realm, 
-		      u ? " uri=\"" : "", u ? u : "", u ? "\"," : "", 
-		      d ? " domain=\"" : "", d ? d : "", d ? "\"," : "", 
-		      nonce, 
+		      as->as_realm,
+		      u ? " uri=\"" : "", u ? u : "", u ? "\"," : "",
+		      d ? " domain=\"" : "", d ? d : "", d ? "\"," : "",
+		      nonce,
 		      am->am_opaque ? " opaque=\"" : "",
 		      am->am_opaque ? am->am_opaque : "",
 		      am->am_opaque ? "\"," : "",
@@ -368,7 +368,7 @@
 }
 
 /** Construct a info header for @b Ntlm authentication scheme. */
-void auth_info_ntlm(auth_mod_t *am, 
+void auth_info_ntlm(auth_mod_t *am,
 		      auth_status_t *as,
 		      auth_challenger_t const *ach)
 {
@@ -385,7 +385,7 @@
     auth_generate_digest_nonce(am, nonce, sizeof nonce, 1, msg_now());
 #endif
 
-    as->as_info = 
+    as->as_info =
       msg_header_format(as->as_home, ach->ach_info, "nextnonce=\"%s\"", nonce);
   }
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_tag.c	Tue Dec 23 07:37:03 2008
@@ -40,14 +40,14 @@
 #include <sofia-sip/url_tag_class.h>
 
 /**@def AUTHTAG_ANY()
- * 
+ *
  * Filter tag matching any AUTHTAG_*().
  */
 tag_typedef_t authtag_any = NSTAG_TYPEDEF(*);
 
 /**@def AUTHTAG_MODULE()
- * 
- * Pointer to an authentication server module (auth_mod_t). 
+ *
+ * Pointer to an authentication server module (auth_mod_t).
  *
  * The tag item AUTHTAG_MODULE() contains pointer to an authentication server
  * module. It is used to pass an already initialized authentication module
@@ -58,11 +58,11 @@
 /**@def AUTHTAG_METHOD()
  *
  * Name of the authentication scheme.
- * 
+ *
  * The tag AUTHTAG_METHOD() specifies the authentication module and scheme
  * to be used by the auth_module. The name can specify a basic
  * authentication module, like "Digest" or "Basic", or an plugin module,
- * like "SGMF+Digest". 
+ * like "SGMF+Digest".
  *
  * @sa See <sofia-sip/auth_plugin.h> for plugin interface.
  */
@@ -87,7 +87,7 @@
  *
  * Opaque data used by authentication server.
  *
- * The tag authtag_opaque is used to pass opaque data to the @b auth_module. 
+ * The tag authtag_opaque is used to pass opaque data to the @b auth_module.
  * The opaque data will be included in all the challenges (however, the data
  * is prefixed with a "." and other opaque data used by the algorithms.
  *
@@ -115,7 +115,7 @@
 /**@def AUTHTAG_QOP()
  *
  * Quality-of-protection used by Digest authentication.
- * 
+ *
  * The tag AUTHTAG_QOP() specifies the qop scheme to be used by the
  * digest authentication.
  */
@@ -124,7 +124,7 @@
 /**@def AUTHTAG_ALGORITHM()
  *
  * Authentication algorithm used by Digest authentication.
- * 
+ *
  * The tag AUTHTAG_ALGORITHM() specifies the qop scheme to be used by the
  * digest authentication.
  */
@@ -133,7 +133,7 @@
 /**@def AUTHTAG_EXPIRES()
  *
  * Nonce expiration time for Digest authentication.
- * 
+ *
  * The tag AUTHTAG_EXPIRES() specifies the time in seconds that a nonce is
  * considered valid. If 0, the nonce lifetime unbounded. The default time is
  * 3600 seconds.
@@ -143,7 +143,7 @@
 /**@def AUTHTAG_NEXT_EXPIRES()
  *
  * Next nonce expiration time for Digest authentication.
- * 
+ *
  * The tag AUTHTAG_NEXT_EXPIRES() specifies the time in seconds that a
  * nextnonce sent in Authentication-Info header is considered valid. If 0,
  * the nonce lifetime is unbounded. The default time is 3600 seconds.
@@ -153,9 +153,9 @@
 /**@def AUTHTAG_MAX_NCOUNT()
  *
  * Max nonce count value.
- * 
+ *
  * The tag AUTHTAG_MAX_NCOUNT() specifies the maximum number of times a
- * nonce should be used. 
+ * nonce should be used.
  *
  * @todo Count actual usages and don't trust "nc" parameter only.
  */
@@ -164,7 +164,7 @@
 /**@def AUTHTAG_BLACKLIST()
  *
  * Blacklist time.
- * 
+ *
  * The tag AUTHTAG_BLACKLIST() specifies the time the server delays its
  * response if it is given bad credentials or malformed nonce. The default
  * time is 5 seconds.
@@ -176,7 +176,7 @@
 /**@def AUTHTAG_FORBIDDEN()
  *
  * Respond with 403 Forbidden.
- * 
+ *
  * When given a true argument, the tag AUTHTAG_FORBIDDEN() specifies that the
  * server responds with 403 Forbidden (instead of 401/407) when it receives
  * bad credentials.
@@ -208,8 +208,8 @@
 /**@def AUTHTAG_REMOTE()
  *
  * Remote authenticator URL.
- * 
- * The tag AUTHTAG_REMOTE() is used to specify URL for remote authenticator. 
+ *
+ * The tag AUTHTAG_REMOTE() is used to specify URL for remote authenticator.
  * The meaning of the URL is specific to the authentication module. The
  * authentication module is selected by AUTHTAG_METHOD().
  */
@@ -217,15 +217,15 @@
 
 /**@def AUTHTAG_ALLOW()
  *
- * Comma-separated list of methods that are not challenged. 
- * 
+ * Comma-separated list of methods that are not challenged.
+ *
  * The tag AUTHTAG_ALLOW() takes its argument a string containing a
  * comma-separated list of methods, for example,
  * @code
  * AUTHTAG_ALLOW("ACK, BYE, CANCEL").
  * @endcode
  *
- * The specified methods are not challenged by the authentication module. 
+ * The specified methods are not challenged by the authentication module.
  * For example, this may include SIP ACK method or SIP methods only used
  * within an already established dialog.
  */
@@ -234,7 +234,7 @@
 /**@def AUTHTAG_MASTER_KEY()
  *
  * Private master key for the authentication module.
- * 
+ *
  * The tag AUTHTAG_MASTER_KEY() specifies a private master key that can be
  * used by the authentication module for various purposes (for instance,
  * validating that nonces are really generated by it).
@@ -244,7 +244,7 @@
 /**@def AUTHTAG_CACHE_USERS()
  *
  * Time to cache user data.
- * 
+ *
  * The tag AUTHTAG_CACHE_USERS() specifies how many seconds the user data is
  * cached locally. Default value is typically 30 minutes.
  */
@@ -253,7 +253,7 @@
 /**@def AUTHTAG_CACHE_ERRORS()
  *
  * Time to cache errors.
- * 
+ *
  * The tag AUTHTAG_CACHE_ERRORS() specifies the lifetime in seconds for
  * errors in the local authentication data cache. Note that the errors
  * generated locally (e.g., because of connectivity problem with

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec.docs	Tue Dec 23 07:37:03 2008
@@ -5,10 +5,10 @@
  * @section iptsec_meta Module Meta Information
  *
  * The iptsec module currently provides interfaces to HTTP
- * Basic and Digest authentication, used by HTTP and SIP protocol elements. 
- * There are both 
- * @ref auth_client "client-side" and 
- * @ref auth_module "server-side" 
+ * Basic and Digest authentication, used by HTTP and SIP protocol elements.
+ * There are both
+ * @ref auth_client "client-side" and
+ * @ref auth_module "server-side"
  * (authentication verification) functionality available.
  *
  * @CONTACT Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -25,13 +25,13 @@
  * operation is simple enough:
  * -# server initializes an #auth_status_t structure with information from
  *    the request
- * -# server calls auth_mod_method() 
- * -# server checks the status from auth_status_t structure, sends an error 
+ * -# server calls auth_mod_method()
+ * -# server checks the status from auth_status_t structure, sends an error
  *    response to the client if authentication fails
  * -# server proceeds serving the authenticated request.
  *
  * If the operation is asynchronous, only a preliminary result is stored in
- * the auth_status_t structure when the call to auth_mod_method() returns. 
+ * the auth_status_t structure when the call to auth_mod_method() returns.
  * In that case, the application can assign a callback function to the
  * structure. The callback function is invoked when the authentication
  * operation is completed. An asynchronous authentication operation can be
@@ -62,7 +62,7 @@
  * -# store the challenge to a list with auc_challenge()
  * -# prompt user and feed credentials (username and password) to the list
  *    with auc_credentials() or auc_all_credentials()
- * -# authorize a request (add credential headers to it) with 
+ * -# authorize a request (add credential headers to it) with
  *    auc_authorization() and resend the request
  *
  * If there are several username/password pairs for multiple authentication

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.c	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 /**@internal @file iptsec_debug.c
  * @brief Debug log for IPTSEC module.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Dec 19 15:55:30 2002 ppessi
  */
 
@@ -51,7 +51,7 @@
  *
  * The IPTSEC_DEBUG environment variable is used to determine the debug
  * logging level for @iptsec module. The default level is 3.
- * 
+ *
  * @sa <sofia-sip/su_debug.h>, #iptsec_log, #SOFIA_DEBUG
  */
 extern IPTSEC_DEBUG;
@@ -62,7 +62,7 @@
 #endif
 
 /** Common log for client and server components.
- * 
+ *
  * The iptsec_log is the log object used by @iptsec module. The level of
  * #iptsec_log is set using #IPTSEC_DEBUG environment variable.
  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.h	Tue Dec 23 07:37:03 2008
@@ -29,9 +29,9 @@
 /**@internal
  * @file iptsec_debug.h
  * @brief Debug log for IPTSEC module.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Dec 19 15:56:35 2002 ppessi
  */
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef AUTH_CLIENT_H
 /** Defined when <sofia-sip/auth_client.h> has been included. */
-#define AUTH_CLIENT_H 
+#define AUTH_CLIENT_H
 
 /**@file sofia-sip/auth_client.h
  *
@@ -49,7 +49,7 @@
 typedef struct auth_client_s auth_client_t;
 
 SOFIAPUBFUN
-int auc_challenge(auth_client_t **auc, su_home_t *home, 
+int auc_challenge(auth_client_t **auc, su_home_t *home,
 		  msg_auth_t const *auth,
 		  msg_hclass_t *crcl);
 
@@ -62,14 +62,14 @@
 	     msg_hclass_t *credential_class);
 
 SOFIAPUBFUN
-int auc_all_credentials(auth_client_t **auc_list, 
+int auc_all_credentials(auth_client_t **auc_list,
 			char const *scheme,
-			char const *realm, 
+			char const *realm,
 			char const *user,
 			char const *pass);
 
 SOFIAPUBFUN
-int auc_clear_credentials(auth_client_t **auc_list, 
+int auc_clear_credentials(auth_client_t **auc_list,
 			  char const *scheme,
 			  char const *realm);
 
@@ -81,15 +81,15 @@
 
 SOFIAPUBFUN
 int auc_authorization(auth_client_t **auc_list, msg_t *msg, msg_pub_t *pub,
-		      char const *method, 
-		      url_t const *url, 
+		      char const *method,
+		      url_t const *url,
 		      msg_payload_t const *body);
 
 SOFIAPUBFUN
-int auc_authorization_headers(auth_client_t **auc_list, 
+int auc_authorization_headers(auth_client_t **auc_list,
 			      su_home_t *home,
-			      char const *method, 
-			      url_t const *url, 
+			      char const *method,
+			      url_t const *url,
 			      msg_payload_t const *body,
 			      msg_header_t **return_headers);
 
@@ -105,4 +105,4 @@
 
 SOFIA_END_DECLS
 
-#endif 
+#endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h	Tue Dec 23 07:37:03 2008
@@ -24,17 +24,17 @@
 
 #ifndef AUTH_CLIENT_PLUGIN_H
 /** Defined when <sofia-sip/auth_client_plugin.h> has been included. */
-#define AUTH_CLIENT_PLUGIN_H 
+#define AUTH_CLIENT_PLUGIN_H
 
 /**@file sofia-sip/auth_client_plugin.h
  * @brief Client-side plugin interface for authentication
- * 
- * @note For extensions in 1.12.6 or later, 
+ *
+ * @note For extensions in 1.12.6 or later,
  * you have to define SOFIA_EXTEND_AUTH_CLIENT to 1
  * before including this file.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Fri May 19 16:18:21 EEST 2006
  */
 
@@ -74,16 +74,16 @@
   int auc_size;			/* Size of the client structure */
 
   char const *auc_name;		/* Name of the autentication scheme */
-  
+
   /** Store challenge */
-  int (*auc_challenge)(auth_client_t *ca, 
+  int (*auc_challenge)(auth_client_t *ca,
 		       msg_auth_t const *ch);
 
   /** Authorize request. */
-  int (*auc_authorize)(auth_client_t *ca, 
+  int (*auc_authorize)(auth_client_t *ca,
 		       su_home_t *h,
-		       char const *method, 
-		       url_t const *url, 
+		       char const *method,
+		       url_t const *url,
 		       msg_payload_t const *body,
 		       msg_header_t **return_headers);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_common.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_common.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_common.h	Tue Dec 23 07:37:03 2008
@@ -26,7 +26,7 @@
 /** Defined when <sofia-sip/auth_common.h> has been included. */
 #define AUTH_COMMON_H
 
-/**@file sofia-sip/auth_common.h 
+/**@file sofia-sip/auth_common.h
  *
  * Functions common for client/server.
  *
@@ -43,7 +43,7 @@
 
 SOFIAPUBFUN issize_t auth_get_params(su_home_t *home,
 				     char const * const params[], ...
- 			          /* char const * name, 
+ 			          /* char const * name,
 				     char const **return_value */);
 
 SOFIAPUBFUN int auth_struct_copy(void *dst, void const *src, isize_t s_size);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_digest.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_digest.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_digest.h	Tue Dec 23 07:37:03 2008
@@ -26,14 +26,14 @@
 /** Defined when <sofia-sip/auth_digest.h> has been included. */
 #define AUTH_DIGEST_H
 
-/**@file sofia-sip/auth_digest.h 
+/**@file sofia-sip/auth_digest.h
  * Datatypes and functions for Digest authentication.
  *
  * The structures and functions here follow the RFC 2617.
  *
  * @sa @RFC2617,
  * <i>"HTTP Authentication: Basic and Digest Access Authentication"</i>,
- * J. Franks et al, 
+ * J. Franks et al,
  * June 1999.
  *
  * @sa @RFC3261 section 22
@@ -96,7 +96,7 @@
  *
  * @code
  *   credentials      = "Digest" digest-response
- *   digest-response  = 1#( username | realm | nonce | digest-uri | 
+ *   digest-response  = 1#( username | realm | nonce | digest-uri |
  *                          response | [ algorithm ] | [cnonce] | [opaque] |
  *                          [message-qop] | [nonce-count] | [auth-param] )
  *   username         = "username" "=" username-value

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_module.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_module.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_module.h	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 #ifndef AUTH_MODULE_H
 /** Defined when <sofia-sip/auth_module.h> has been included. */
-#define AUTH_MODULE_H 
+#define AUTH_MODULE_H
 
-/**@file sofia-sip/auth_module.h  
+/**@file sofia-sip/auth_module.h
  * @brief Authentication verification interface.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
@@ -56,7 +56,7 @@
 /** Authentication operation. */
 typedef struct auth_status_t auth_status_t;
 
-#ifdef  AUTH_MAGIC_T 
+#ifdef  AUTH_MAGIC_T
 typedef AUTH_MAGIC_T auth_magic_t;
 #else
 typedef void auth_magic_t;
@@ -81,10 +81,10 @@
  * authentication operation and all the related data. The application
  * verifying the authentication fills the auth_status_t structure, then
  * calls auth_mod_method() (or auth_mod_challenge()). The operation result
- * is stored in the structure. 
+ * is stored in the structure.
  *
  * If the operation is asynchronous, only a preliminary result is stored in
- * the auth_status_t structure when the call to auth_mod_method() returns. 
+ * the auth_status_t structure when the call to auth_mod_method() returns.
  * In that case, the application @b must assign a callback function to the
  * structure. The callback function is invoked when the authentication
  * operation is completed.
@@ -105,7 +105,7 @@
   url_t const    *as_user_uri;	/* Return user's identity [in/out] */
   char const     *as_ident;	/**< Identities [out] */
   unsigned        as_profile;	/**< User profile (group) [out] */
-  
+
   su_addrinfo_t  *as_source;	/**< Source address [in] */
 
   char const   	 *as_realm;	/**< Authentication realm [in] */
@@ -136,7 +136,7 @@
   /** @} */
 
   /** Pointer to extended state, used exclusively by plugin modules. */
-  auth_splugin_t *as_plugin;	
+  auth_splugin_t *as_plugin;
 };
 
 /** Authentication challenge.
@@ -146,7 +146,7 @@
  * with 401 response code and phrase along with header class for
  * @b WWW-Authenticate header in the @a ach structure.
  */
-typedef struct auth_challenger 
+typedef struct auth_challenger
 {
   int           ach_status;	/**< Response status for challenge response */
   char const   *ach_phrase;	/**< Response phrase for challenge response */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_ntlm.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_ntlm.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_ntlm.h	Tue Dec 23 07:37:03 2008
@@ -24,20 +24,20 @@
 
 #ifndef AUTH_NTLM_H
 /** Defined when <sofia-sip/auth_ntlm.h> has been included. */
-#define AUTH_NTLM_H 
+#define AUTH_NTLM_H
 
-/**@file sofia-sip/auth_ntlm.h 
+/**@file sofia-sip/auth_ntlm.h
  * Datatypes and functions for Ntlm authentication.
  *
  * The structures and functions here follow the RFC 2617.
  *
- * @sa 
- * <a href="ftp://ftp.ietf.org/rfc/rfc2617.txt">RFC 2617</a>, 
+ * @sa
+ * <a href="ftp://ftp.ietf.org/rfc/rfc2617.txt">RFC 2617</a>,
  * <i>"HTTP Authentication: Basic and Ntlm Access Authentication"</i>,
- * J. Franks et al, 
+ * J. Franks et al,
  * June 1999.
  *
- * @sa Section 19 from 
+ * @sa Section 19 from
  * <a href="ftp://ftp.ietf.org/internet-drafts/draft-ietf-sip-rfc2543bis-04.txt>draft-ietf-sip-rfc2543bis-04</a>.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -55,33 +55,33 @@
 
 SOFIA_BEGIN_DECLS
 
-issize_t auth_ntlm_challenge_get(su_home_t *, auth_challenge_t *, 
+issize_t auth_ntlm_challenge_get(su_home_t *, auth_challenge_t *,
 				 char const * const params[]);
-issize_t auth_ntlm_response_get(su_home_t *, auth_response_t *, 
+issize_t auth_ntlm_response_get(su_home_t *, auth_response_t *,
 				char const * const params[]);
 
-int auth_ntlm_a1(auth_response_t *ar, 
+int auth_ntlm_a1(auth_response_t *ar,
 		   auth_hexmd5_t ha1,
 		   char const *secret);
 
-int auth_ntlm_a1sess(auth_response_t *ar, 
+int auth_ntlm_a1sess(auth_response_t *ar,
 		       auth_hexmd5_t ha1sess,
 		       char const *ha1);
 
 int auth_ntlm_sessionkey(auth_response_t *, auth_hexmd5_t ha1,
 			   char const *secret);
 int auth_ntlm_response(auth_response_t *, auth_hexmd5_t response,
-		       auth_hexmd5_t const ha1, 
+		       auth_hexmd5_t const ha1,
 		       char const *method_name, void const *data, issize_t dlen);
 
 /** NTLM scheme */
-msg_auth_t *auth_ntlm_credentials(msg_auth_t *auth, 
+msg_auth_t *auth_ntlm_credentials(msg_auth_t *auth,
 				  char const *realm,
 				  char const *opaque,
 				  char const *gssapidata,
 				  char const *targetname);
 
-void auth_challenge_ntlm(auth_mod_t *am, 
+void auth_challenge_ntlm(auth_mod_t *am,
 			 auth_status_t *as,
 			 auth_challenger_t const *ach);
 
@@ -97,18 +97,18 @@
 		     auth_response_t *ar,
 		     auth_challenger_t const *ach);
 
-int auth_generate_ntlm_nonce(auth_mod_t *am, 
+int auth_generate_ntlm_nonce(auth_mod_t *am,
 			     char buffer[],
 			     size_t buffer_len,
 			     int nextnonce,
 			     msg_time_t now);
 
-int auth_validate_ntlm_nonce(auth_mod_t *am, 
+int auth_validate_ntlm_nonce(auth_mod_t *am,
 			     auth_status_t *as,
 			     auth_response_t *ar,
 			     msg_time_t now);
 
-void auth_info_ntlm(auth_mod_t *am, 
+void auth_info_ntlm(auth_mod_t *am,
 		    auth_status_t *as,
 		    auth_challenger_t const *ach);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_plugin.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_plugin.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_plugin.h	Tue Dec 23 07:37:03 2008
@@ -24,13 +24,13 @@
 
 #ifndef AUTH_PLUGIN_H
 /** Defined when <sofia-sip/auth_plugin.h> has been included. */
-#define AUTH_PLUGIN_H 
+#define AUTH_PLUGIN_H
 
 /**@file sofia-sip/auth_plugin.h
  * @brief Plugin interface for authentication verification modules.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Apr 27 15:22:07 2004 ppessi
  */
 
@@ -77,20 +77,20 @@
 		   tag_type_t tag, tag_value_t value, ...);
 
   /** Check authentication. Invoked by auth_mod_method(). */
-  void (*asch_check)(auth_mod_t *am, 
+  void (*asch_check)(auth_mod_t *am,
 		     auth_status_t *as,
 		     msg_auth_t *auth,
 		     auth_challenger_t const *ch);
 
   /** Create a challenge. Invoked by auth_mod_challenge(). */
-  void (*asch_challenge)(auth_mod_t *am, 
+  void (*asch_challenge)(auth_mod_t *am,
 			 auth_status_t *as,
 			 auth_challenger_t const *ch);
 
-  /** Cancel an asynchronous authentication request. 
+  /** Cancel an asynchronous authentication request.
    * Invoked by auth_mod_cancel().
    */
-  void (*asch_cancel)(auth_mod_t *am, 
+  void (*asch_cancel)(auth_mod_t *am,
 		      auth_status_t *as);
 
   /** Reclaim resources an authentication module.
@@ -161,7 +161,7 @@
   unsigned       am_count;	/**< Nonce counter */
 
   uint8_t        am_master_key[16]; /**< Private master key */
-  
+
   su_md5_t       am_hmac_ipad;	/**< MD5 with inner pad */
   su_md5_t       am_hmac_opad;	/**< MD5 with outer pad */
 
@@ -182,11 +182,11 @@
 
 SOFIAPUBFUN int auth_readdb(auth_mod_t *am);
 
-SOFIAPUBFUN msg_auth_t *auth_mod_credentials(msg_auth_t *auth, 
+SOFIAPUBFUN msg_auth_t *auth_mod_credentials(msg_auth_t *auth,
 					     char const *scheme,
 					     char const *realm);
 
-SOFIAPUBFUN auth_mod_t *auth_mod_alloc(auth_scheme_t *scheme, 
+SOFIAPUBFUN auth_mod_t *auth_mod_alloc(auth_scheme_t *scheme,
 				       tag_type_t, tag_value_t, ...);
 
 #define AUTH_PLUGIN(am) (auth_plugin_t *)((am) + 1)
@@ -211,13 +211,13 @@
 		       auth_challenger_t const *ach);
 
 SOFIAPUBFUN
-void auth_challenge_basic(auth_mod_t *am, 
+void auth_challenge_basic(auth_mod_t *am,
 			  auth_status_t *as,
 			  auth_challenger_t const *ach);
 
 /** Digest scheme */
 SOFIAPUBFUN
-msg_auth_t *auth_digest_credentials(msg_auth_t *auth, 
+msg_auth_t *auth_digest_credentials(msg_auth_t *auth,
 				    char const *realm,
 				    char const *opaque);
 
@@ -228,7 +228,7 @@
 			auth_challenger_t const *ach);
 
 SOFIAPUBFUN
-void auth_info_digest(auth_mod_t *am, 
+void auth_info_digest(auth_mod_t *am,
 		      auth_status_t *as,
 		      auth_challenger_t const *ach);
 
@@ -239,19 +239,19 @@
 		       auth_challenger_t const *ach);
 
 SOFIAPUBFUN
-void auth_challenge_digest(auth_mod_t *am, 
+void auth_challenge_digest(auth_mod_t *am,
 			   auth_status_t *as,
 			   auth_challenger_t const *ach);
 
 SOFIAPUBFUN
-isize_t auth_generate_digest_nonce(auth_mod_t *am, 
+isize_t auth_generate_digest_nonce(auth_mod_t *am,
 				   char buffer[],
 				   size_t buffer_len,
 				   int nextnonce,
 				   msg_time_t now);
 
 SOFIAPUBFUN
-int auth_validate_digest_nonce(auth_mod_t *am, 
+int auth_validate_digest_nonce(auth_mod_t *am,
 			       auth_status_t *as,
 			       auth_response_t *ar,
 			       msg_time_t now);
@@ -260,7 +260,7 @@
 
 /** Init md5 for MD5-based HMAC */
 SOFIAPUBFUN void auth_md5_hmac_init(auth_mod_t *am, su_md5_t *md5);
-SOFIAPUBFUN void auth_md5_hmac_digest(auth_mod_t *am, su_md5_t *md5, 
+SOFIAPUBFUN void auth_md5_hmac_digest(auth_mod_t *am, su_md5_t *md5,
 				      void *hmac, size_t size);
 
 SOFIA_END_DECLS

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/test_auth_digest.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/test_auth_digest.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/iptsec/test_auth_digest.c	Tue Dec 23 07:37:03 2008
@@ -77,7 +77,7 @@
 int tstflags;
 char *argv0;
 
-#define TSTFLAGS tstflags 
+#define TSTFLAGS tstflags
 
 #include <sofia-sip/tstdef.h>
 
@@ -105,14 +105,14 @@
     "algorithm=MD5, "
     "qop=\"auth\"";
 
-  char response[] = 
+  char response[] =
     "DIGEST USERNAME=\"digest\", "
     "REALM=\"garage.sr.ntc.nokia.com\", "
     "NONCE=\"MjAwMS0wMS0yMSAxNTowODo1OA==\", "
     "RESPONSE=\"d9d7f1ae99a013cb05f319f0f678251d\", "
     "URI=\"sip:garage.sr.ntc.nokia.com\"";
 
-  char rfc2617[] = 
+  char rfc2617[] =
     "Digest username=\"Mufasa\", "
     "realm=\"testrealm at host.com\", "
     "nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\", "
@@ -122,7 +122,7 @@
     "algorithm=\"md5\", "
     "uri=\"/dir/index.html\"";
 
-  char indigo[] = 
+  char indigo[] =
     "Digest username=\"user1\", "
     "realm=\"nokia-proxy\", "
     "nonce=\"0YXwH29PCT4lEz8+YJipQg==\", "
@@ -134,7 +134,7 @@
     "qop=auth, "
     "nc=000000002";
 
-  char proxy_authenticate[] = 
+  char proxy_authenticate[] =
     "Digest realm=\"IndigoSw\", "
     "domain=\"indigosw.com aol.com\", "
     "nonce=\"V2VkIEF1ZyAxNSAxNzoxNzozNyBCU1QgMjAwMVtCQDE3OWU4Yg==\", "
@@ -172,12 +172,12 @@
   TEST_SIZE(auth_digest_response_get(home, ar, au->au_params), 10);
 
   TEST0(auth_digest_sessionkey(ar, sessionkey, "Circle Of Life") == 0);
-  if (tstflags & tst_verbatim) 
+  if (tstflags & tst_verbatim)
     printf("%s: sessionkey=\"%s\"\n", name, sessionkey);
   TEST0(strcmp(sessionkey, "939e7578ed9e3c518a452acee763bce9") == 0);
 
   TEST0(auth_digest_response(ar, hresponse, sessionkey, "GET", NULL, 0) == 0);
-  if (tstflags & tst_verbatim) 
+  if (tstflags & tst_verbatim)
     printf("%s: hresponse=\"%s\"\n", name, hresponse);
   TEST0(strcmp(hresponse, "6629fae49393a05397450978507c4ef1") == 0);
 
@@ -195,11 +195,11 @@
   TEST_1(ac->ac_auth_int);
 
   {
-    char challenge[] = 
+    char challenge[] =
       "Digest realm=\"opera.ntc.nokia.com\", "
       "nonce=\"InyiWI+qIdvDKkO2jFK7mg==\"";
 
-    char credentials[] = 
+    char credentials[] =
       "Digest username=\"samuel.privat.saturday at opera.ntc.nokia.com\", "
       "realm=\"opera.ntc.nokia.com\", nonce=\"InyiWI+qIdvDKkO2jFK7mg==\", "
       "algorithm=MD5, uri=\"sip:opera.ntc.nokia.com\", "
@@ -247,12 +247,12 @@
                             opaque="5ccc069c403ebaf9f0171e9517f40e41"
     */
 
-    char challenge[] = 
+    char challenge[] =
       "Digest realm=\"testrealm at host.com\", "
       "nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\", "
       "opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"";
 
-    char rfc2069_cred[] = 
+    char rfc2069_cred[] =
       "Digest username=\"Mufasa\", "
       "realm=\"testrealm at host.com\", "
       "nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\", "
@@ -278,10 +278,10 @@
   }
 
   {
-    char worldcom_chal[] = 
+    char worldcom_chal[] =
       "Digest realm=\"WCOM\", nonce=\"ce2292f3f748fbe239bda9e852e8b986\"";
 
-    char worldcom_cred[] = 
+    char worldcom_cred[] =
       "Digest realm=\"WCOM\", username=\"jari\", "
       "nonce=\"ce2292f3f748fbe239bda9e852e8b986\", "
       "response=\"ea692d202019d41a75c70df4b2401e2f\", "
@@ -304,12 +304,12 @@
   }
 
   {
-    char etri_chal[] = 
+    char etri_chal[] =
       "Digest realm=\"nokia-proxy\", domain=\"sip:194.2.188.133\", "
       "nonce=\"wB7JBwIb/XhtgfGp1VuPoQ==\", opaque=\"wkJxwA==\", "
       ", algorithm=MD5, qop=\"auth\"";
 
-    char etri_cred[] = 
+    char etri_cred[] =
       "Digest username=\"myhuh\", realm=\"nokia-proxy\", "
       "nonce=\"wB7JBwIb/XhtgfGp1VuPoQ==\", uri=\"sip:194.2.188.133\", "
       "response=\"32960a62bdc202171ca5a294dc229a6d\", "
@@ -317,13 +317,13 @@
 
     memset(ac, 0, sizeof(ac)); ac->ac_size = sizeof(ac);
     memset(ar, 0, sizeof(ar)); ar->ar_size = sizeof(ar);
-    
+
     TEST0(pa = sip_proxy_authenticate_make(home, etri_chal));
     TEST_SIZE(auth_digest_challenge_get(home, ac, pa->au_params), 8);
 
     TEST0(pz = sip_proxy_authorization_make(home, etri_cred));
     TEST_SIZE(auth_digest_response_get(home, ar, pz->au_params), 6 /* 8 */);
-    
+
     ar->ar_md5 = ac->ac_md5 || ac->ac_algorithm == NULL;
 
     TEST(auth_digest_sessionkey(ar, sessionkey, "myhuh"), 0);
@@ -332,7 +332,7 @@
   }
 
   {
-    char chal[] = 
+    char chal[] =
       "Digest realm=\"nokia-proxy\", domain=\"sip:10.21.32.63\", "
       "nonce=\"GjbLsrozHC6Lx95C57vGlw==\", opaque=\"HN22wQ==\", algorithm=MD5";
 
@@ -344,13 +344,13 @@
 
     memset(ac, 0, sizeof(ac)); ac->ac_size = sizeof(ac);
     memset(ar, 0, sizeof(ar)); ar->ar_size = sizeof(ar);
-    
+
     TEST0(pa = sip_proxy_authenticate_make(home, chal));
     TEST_SIZE(auth_digest_challenge_get(home, ac, pa->au_params), 6);
 
     TEST0(pz = sip_proxy_authorization_make(home, cred));
     TEST_SIZE(auth_digest_response_get(home, ar, pz->au_params), 8);
-    
+
     ar->ar_md5 = ac->ac_md5 || ac->ac_algorithm == NULL;
 
     TEST(auth_digest_sessionkey(ar, sessionkey, "test1"), 0);
@@ -359,18 +359,18 @@
   }
 
   {
-    char challenge[] = 
+    char challenge[] =
       "Digest realm=\"nokia-proxy\", domain=\"sip:194.2.188.133\", "
       "nonce=\"3wWGOvaWn3n+hFv8PK2ABQ==\", opaque=\"+GNywA==\", "
       "algorithm=MD5, qop=\"auth-int\"";
-    char credentials[] = 
+    char credentials[] =
       "Digest username=\"test\", realm=\"nokia-proxy\", "
       "nonce=\"3wWGOvaWn3n+hFv8PK2ABQ==\", "
       "cnonce=\"11RkhFg9EdaIRD36w0EMVA==\", opaque=\"+GNywA==\", "
       "uri=\"sip:3000 at 194.2.188.133\", algorithm=MD5, "
       "response=\"26e8b9aaacfca2d68770fab1ec04e2c7\", "
       "qop=auth-int, nc=00000001";
-    char data[] = 
+    char data[] =
       "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
       "<presence>\n"
       "<presentity uri=\"sip:3000 at 194.2.188.133\"/>\n"
@@ -389,23 +389,23 @@
 
     memset(ac, 0, sizeof(ac)); ac->ac_size = sizeof(ac);
     memset(ar, 0, sizeof(ar)); ar->ar_size = sizeof(ar);
-    
+
     TEST0(pa = sip_proxy_authenticate_make(home, challenge));
     TEST_SIZE(auth_digest_challenge_get(home, ac, pa->au_params), 8);
 
     TEST0(pz = sip_proxy_authorization_make(home, credentials));
     TEST_SIZE(auth_digest_response_get(home, ar, pz->au_params), 12);
-    
+
     ar->ar_md5 = ac->ac_md5 || ac->ac_algorithm == NULL;
 
     TEST0(!auth_digest_sessionkey(ar, sessionkey, "test"));
-    TEST0(!auth_digest_response(ar, hresponse, sessionkey, "REGISTER", 
+    TEST0(!auth_digest_response(ar, hresponse, sessionkey, "REGISTER",
 				data, strlen(data)));
     TEST_S(hresponse, "26e8b9aaacfca2d68770fab1ec04e2c7");
   }
 
   su_home_deinit(home);
-  
+
   END();
 }
 
@@ -418,7 +418,7 @@
   msg_iovec_t iovec[2];
 
   n = strlen(buffer);
-  if (n == 0) 
+  if (n == 0)
     return NULL;
 
   msg = msg_create(sip_default_mclass(), flags);
@@ -447,10 +447,10 @@
   su_root_break(root);
 }
 
-static 
+static
 void init_as(auth_status_t *as)
 {
-  memset(as, 0, sizeof *as); 
+  memset(as, 0, sizeof *as);
   as->as_home->suh_size = (sizeof *as);
   su_home_init(as->as_home);
   as->as_method = "REGISTER";
@@ -458,14 +458,14 @@
   as->as_phrase = "Infernal Error";
 }
 
-static 
+static
 void deinit_as(auth_status_t *as)
 {
   su_home_deinit(as->as_home);
   memset(as, 0, sizeof *as);
 }
 
-static 
+static
 void reinit_as(auth_status_t *as)
 {
   deinit_as(as); init_as(as);
@@ -475,9 +475,9 @@
 int test_digest_client()
 {
   BEGIN();
-  
+
   {
-    char challenge[] = 
+    char challenge[] =
       PROTOCOL " 401 Unauthorized\r\n"
       "Call-ID:0e3dc2b2-dcc6-1226-26ac-258b5ce429ab\r\n"
       "CSeq:32439043 REGISTER\r\n"
@@ -488,8 +488,8 @@
       "Content-Length:0\r\n"
       "Security-Server:digest\r\n"
       "r\n";
-      
-    char request[] = 
+
+    char request[] =
       "REGISTER sip:ims3.so.noklab.net " PROTOCOL "\r\n"
       "Via: SIP/2.0/UDP 10.21.36.70:23800;rport;branch=z9hG4bKRE18GFwa3AS\r\n"
       "Max-Forwards: 80\r\n"
@@ -515,13 +515,13 @@
     auth_mod_t *am;
     auth_status_t as[1];
     sip_www_authenticate_t *au;
-    auth_challenger_t ach[1] = 
-      {{ 401, "Authorization required", 
+    auth_challenger_t ach[1] =
+      {{ 401, "Authorization required",
 	 sip_www_authenticate_class,
 	 sip_authentication_info_class
 	}};
-    auth_challenger_t pach[1] = 
-      {{ 407, "Proxy Authorization required", 
+    auth_challenger_t pach[1] =
+      {{ 407, "Proxy Authorization required",
 	 sip_proxy_authenticate_class,
 	 sip_proxy_authentication_info_class
 	}};
@@ -530,29 +530,29 @@
 
     TEST_1(m1 = read_message(MSG_DO_EXTRACT_COPY, challenge));
     TEST_1(sip = sip_object(m1));
-    
+
     TEST_1(aucs == NULL);
-    TEST(auc_challenge(&aucs, home, sip->sip_www_authenticate, 
+    TEST(auc_challenge(&aucs, home, sip->sip_www_authenticate,
 		       sip_authorization_class), 1);
     TEST_1(aucs != NULL);
     msg_destroy(m1);
 
-    TEST(auc_all_credentials(&aucs, "DIGEST", "\"ims3.so.noklab.net\"", 
+    TEST(auc_all_credentials(&aucs, "DIGEST", "\"ims3.so.noklab.net\"",
 			     "surf3.private at ims3.so.noklab.net", "1234"), 1);
 
     TEST_1(m2 = read_message(MSG_DO_EXTRACT_COPY, request));
     TEST_1(sip = sip_object(m2));
     TEST_P(sip->sip_authorization, NULL);
     TEST_1(rq = sip->sip_request);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
 			   rq->rq_url, sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
     TEST_S(msg_params_find(sip->sip_authorization->au_params,
 			   "response="),
 	   "\"860f5ecc9990772e16937750ced9594d\"");
 
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
     TEST_S(msg_params_find(sip->sip_authorization->au_params,
@@ -571,7 +571,7 @@
 
     TEST_1(root = su_root_create(NULL));
 
-    TEST_1(am = auth_mod_create(NULL, 
+    TEST_1(am = auth_mod_create(NULL,
 				AUTHTAG_METHOD("Digest"),
 				AUTHTAG_REALM("ims3.so.noklab.net"),
 				AUTHTAG_DB(testpasswd),
@@ -582,7 +582,7 @@
     auth_mod_check_client(am, as, sip->sip_authorization, ach);
     TEST(as->as_status, 401);
 
-    TEST_1(au = sip_authorization_make(home, 
+    TEST_1(au = sip_authorization_make(home,
 				       "Digest username=\"user1\", "
 				       "nonce=\"3wWGOvaWn3n+hFv8PK2ABQ==\", "
 				       "opaque=\"+GNywA==\", "
@@ -602,7 +602,7 @@
       char const *uri = au->au_params[3];
       char const *response = au->au_params[4];
       char const *realm = au->au_params[5];
-      
+
       TEST_S(username, "username=\"user1\"");
       TEST_S(nonce, "nonce=\"3wWGOvaWn3n+hFv8PK2ABQ==\"");
       TEST_S(opaque, "opaque=\"+GNywA==\"");
@@ -653,24 +653,24 @@
     as->as_response = (msg_header_t *)
       sip_www_authenticate_make(as->as_home, "Unknown realm=\"huu haa\"");
     TEST_1(as->as_response);
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
     aucs = NULL;
 
     reinit_as(as);
     auth_mod_check_client(am, as, NULL, ach);
     TEST(as->as_status, 401);
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
     reinit_as(as);
-    
-    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"", 
+
+    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"",
 			     "user1", "secret"), 1);
 
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
 
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
 
@@ -683,7 +683,7 @@
     auth_mod_destroy(am);
     aucs = NULL;
 
-    TEST_1(am = auth_mod_create(NULL, 
+    TEST_1(am = auth_mod_create(NULL,
 				AUTHTAG_METHOD("Digest"),
 				AUTHTAG_REALM("ims3.so.noklab.net"),
 				AUTHTAG_DB(testpasswd),
@@ -713,11 +713,11 @@
       reinit_as(as);
     }
 
-    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"", 
+    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"",
 			     "user1", "secret"), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
 
@@ -750,12 +750,12 @@
       TEST(msg_params_remove((msg_param_t *)au->au_params, "opaque"), 1);
 
       TEST(auc_challenge(&aucs, home, au, sip_authorization_class), 1);
-      TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"", 
+      TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"",
 			       "user1", "secret"), 1);
       msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
 
-      TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			     (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+      TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			     (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			     sip->sip_payload), 1);
 
       TEST_1(sip->sip_authorization);
@@ -774,7 +774,7 @@
     {
       msg_auth_t *au;
 
-      TEST_1(am = auth_mod_create(NULL, 
+      TEST_1(am = auth_mod_create(NULL,
 				  AUTHTAG_METHOD("Digest"),
 				  AUTHTAG_DB(testpasswd),
 				  AUTHTAG_ALGORITHM("MD5-sess"),
@@ -790,12 +790,12 @@
       au = (void *)msg_header_dup(home, as->as_response); TEST_1(au);
 
       TEST(auc_challenge(&aucs, home, au, sip_authorization_class), 1);
-      TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"", 
+      TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"",
 			       "user1", "secret"), 1);
       msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
 
-      TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			     (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+      TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			     (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			     sip->sip_payload), 1);
 
       TEST_1(sip->sip_authorization);
@@ -812,7 +812,7 @@
     {
       char const *nonce1, *nextnonce, *nonce2;
 
-      TEST_1(am = auth_mod_create(NULL, 
+      TEST_1(am = auth_mod_create(NULL,
 				  AUTHTAG_METHOD("Digest"),
 				  AUTHTAG_REALM("ims3.so.noklab.net"),
 				  AUTHTAG_DB(testpasswd),
@@ -823,21 +823,21 @@
 				     if NEXT_EXPIRES in nonzero */
 				  AUTHTAG_NEXT_EXPIRES(900),
 				  TAG_END()));
-      
+
       reinit_as(as);
       auth_mod_check_client(am, as, NULL, ach); TEST(as->as_status, 401);
-      
-      TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+
+      TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 			 sip_authorization_class), 1);
-      TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"", 
+      TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"",
 			       "user1", "secret"), 1);
       msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-      TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			     (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+      TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			     (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			     sip->sip_payload), 1);
       TEST_1(sip->sip_authorization);
       TEST_1(nonce1 = msg_header_find_param(sip->sip_authorization->au_common, "nonce"));
-      
+
       reinit_as(as);
       auth_mod_check_client(am, as, sip->sip_authorization, ach);
       TEST(as->as_status, 0);
@@ -850,8 +850,8 @@
       TEST(auc_info(&aucs, (msg_auth_info_t const *)as->as_info, sip_authorization_class), 1);
 
       msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-      TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			     (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+      TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			     (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			     sip->sip_payload), 1);
       TEST_1(sip->sip_authorization);
       TEST_1(nonce2 = msg_header_find_param(sip->sip_authorization->au_common, "nonce"));
@@ -867,7 +867,7 @@
       auth_mod_destroy(am); aucs = NULL;
     }
 
-    TEST_1(am = auth_mod_create(NULL, 
+    TEST_1(am = auth_mod_create(NULL,
 				AUTHTAG_METHOD("Digest"),
 				AUTHTAG_REALM("ims3.so.noklab.net"),
 				AUTHTAG_DB(testpasswd),
@@ -878,13 +878,13 @@
     reinit_as(as);
     auth_mod_check_client(am, as, NULL, ach); TEST(as->as_status, 401);
 
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
-    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"", 
+    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"",
 			     "user1", "secret"), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
 
@@ -893,7 +893,7 @@
     TEST(as->as_status, 0);
     auth_mod_destroy(am); aucs = NULL;
 
-    TEST_1(am = auth_mod_create(NULL, 
+    TEST_1(am = auth_mod_create(NULL,
 				AUTHTAG_METHOD("Digest"),
 				AUTHTAG_REALM("ims3.so.noklab.net"),
 				AUTHTAG_DB(testpasswd),
@@ -907,13 +907,13 @@
     reinit_as(as);
     auth_mod_check_client(am, as, NULL, ach); TEST(as->as_status, 401);
 
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
-    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"", 
+    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"",
 			     "user1", "secret"), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
 
@@ -924,7 +924,7 @@
     au = (void*)msg_header_copy(msg_home(m2), (void*)sip->sip_authorization);
 
     /* Test with invalid qop (bug #2329) */
-    msg_params_replace(msg_home(m2), (void *)&au->au_params, 
+    msg_params_replace(msg_home(m2), (void *)&au->au_params,
 		       "qop=\"auth,auth-int\"");
     reinit_as(as);
     auth_mod_check_client(am, as, au, ach);
@@ -949,11 +949,11 @@
     TEST_1(au = (void *)as->as_response); TEST_1(au->au_params);
     TEST_S(msg_params_find(au->au_params, "stale="), "true");
 
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
     TEST_S(msg_header_find_param(sip->sip_authorization->au_common, "nc="),
@@ -965,8 +965,8 @@
 
     /* Test nonce count check */
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
     TEST_S(msg_header_find_param(sip->sip_authorization->au_common, "nc="),
@@ -983,15 +983,15 @@
     /* Test anonymous operation */
     reinit_as(as);
     auth_mod_check_client(am, as, NULL, ach); TEST(as->as_status, 401);
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
     reinit_as(as);
 
-    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"", 
+    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"",
 			     "anonymous", ""), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
 
@@ -1000,20 +1000,20 @@
     auth_mod_destroy(am); aucs = NULL;
 
     /* Test empty realm */
-    TEST_1(am = auth_mod_create(root, 
+    TEST_1(am = auth_mod_create(root,
 				AUTHTAG_METHOD("Digest"),
 				AUTHTAG_REALM(""),
 				AUTHTAG_DB(testpasswd),
 				TAG_END()));
     reinit_as(as);
     auth_mod_check_client(am, as, NULL, ach); TEST(as->as_status, 401);
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
     reinit_as(as);
 
     TEST(auc_all_credentials(&aucs, "Digest", "\"\"", "user1", "secret"), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
 			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
@@ -1021,15 +1021,15 @@
     auth_mod_check_client(am, as, sip->sip_authorization, ach);
     TEST(as->as_status, 0);
     aucs = NULL;
-    reinit_as(as); 
+    reinit_as(as);
     auth_mod_check_client(am, as, NULL, pach); TEST(as->as_status, 407);
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_proxy_authorization_class), 1);
     reinit_as(as);
 
     TEST(auc_credentials(&aucs, as->as_home, "Digest:\"\":user1:secret"), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_proxy_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
 			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_proxy_authorization);
@@ -1040,25 +1040,25 @@
     auth_mod_destroy(am); aucs = NULL;
 
     /* Test Basic authentication scheme */
-    TEST_1(am = auth_mod_create(root, 
+    TEST_1(am = auth_mod_create(root,
 				AUTHTAG_METHOD("Basic"),
 				AUTHTAG_REALM("ims3.so.noklab.net"),
 				AUTHTAG_DB(testpasswd),
 				TAG_END()));
 
-    reinit_as(as);    
-    auth_mod_check_client(am, as, NULL, ach); 
+    reinit_as(as);
+    auth_mod_check_client(am, as, NULL, ach);
     TEST(as->as_status, 401);
-    
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
-    reinit_as(as);    
+    reinit_as(as);
 
-    TEST(auc_all_credentials(&aucs, "Basic", "\"ims3.so.noklab.net\"", 
+    TEST(auc_all_credentials(&aucs, "Basic", "\"ims3.so.noklab.net\"",
 			     "user1", "secret"), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
 
@@ -1067,20 +1067,20 @@
 
     aucs = NULL;
 
-    reinit_as(as);    
-    auth_mod_check_client(am, as, NULL, ach); 
+    reinit_as(as);
+    auth_mod_check_client(am, as, NULL, ach);
     TEST(as->as_status, 401);
-    
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
-    reinit_as(as);    
+    reinit_as(as);
 
-    TEST(auc_all_credentials(&aucs, "Basic", "\"ims3.so.noklab.net\"", 
-         "very-long-user-name-that-surely-exceeds-the-static-buffer", 
+    TEST(auc_all_credentials(&aucs, "Basic", "\"ims3.so.noklab.net\"",
+         "very-long-user-name-that-surely-exceeds-the-static-buffer",
          "at-least-when-used-with-the-even-longer-password"), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
 
@@ -1091,7 +1091,7 @@
 
     /* Test asynchronous operation */
     aucs = NULL;
-    TEST_1(am = auth_mod_create(root, 
+    TEST_1(am = auth_mod_create(root,
 				AUTHTAG_METHOD("Delayed+Digest"),
 				AUTHTAG_REALM("ims3.so.noklab.net"),
 				AUTHTAG_DB(testpasswd),
@@ -1107,19 +1107,19 @@
     TEST(as->as_status, 100);
     su_root_run(root);
     TEST(as->as_status, 401);
-    
-    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response, 
+
+    TEST(auc_challenge(&aucs, home, (msg_auth_t *)as->as_response,
 		       sip_authorization_class), 1);
 
     reinit_as(as);
     as->as_callback = test_callback;
     as->as_magic = root;
 
-    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"", 
+    TEST(auc_all_credentials(&aucs, "Digest", "\"ims3.so.noklab.net\"",
 			     "user1", "secret"), 1);
     msg_header_remove(m2, (void *)sip, (void *)sip->sip_authorization);
-    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name, 
-			   (url_t *)"sip:surf3 at ims3.so.noklab.net", 
+    TEST(auc_authorization(&aucs, m2, (msg_pub_t*)sip, rq->rq_method_name,
+			   (url_t *)"sip:surf3 at ims3.so.noklab.net",
 			   sip->sip_payload), 1);
     TEST_1(sip->sip_authorization);
 
@@ -1188,7 +1188,7 @@
   TEST(close(tmpfd), 0);
 
   /* Test file reading operation */
-  am = auth_mod_create(NULL, 
+  am = auth_mod_create(NULL,
 		       AUTHTAG_METHOD("Digest"),
 		       AUTHTAG_REALM("realm"),
 		       AUTHTAG_DB(tmppasswd),
@@ -1201,7 +1201,7 @@
 
   apw = auth_mod_getpass(am, "user2", NULL); TEST_1(apw);
   TEST_S(apw->apw_hash, "4cbc2aff0b5b2b33675c0731c0db1c14");
-  
+
   apw2 = apw;
 
   *am0 = *am;
@@ -1312,7 +1312,7 @@
 
       if (rest == NULL || *rest)
 	usage(1);
-      
+
       su_log_set_level(iptsec_log, level);
     } else {
       usage(1);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -6,7 +6,7 @@
 
 	* Renamed msg_test.c as test_msg.c.
 
-	* Renamed msg_test_class.[hc] as test_class.[hc], 
+	* Renamed msg_test_class.[hc] as test_class.[hc],
 	  msg_test_protos.h(.in) as test_protos.h(.in),
 	  msg_test_table.c(.in) as test_table.c(.in).
 
@@ -40,14 +40,14 @@
 
 	* msg_parser.c: Using header-specific flags to classify parsing
 	errors with msg_extract_errors().
-	
+
 	Added support for apndlist headers.
 
 	* msg_header.h: Added support for apndlist headers.
 
 	* msg_mime.c: Various Accept* headers are now apndlist meaning
 	that they are printed on single line by default.
-	
+
 2005-07-18  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* Initial import of the module to Sofia-SIP tree.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -33,7 +33,7 @@
 INTERNAL_H = msg_internal.h test_class.h
 
 nobase_include_sofia_HEADERS = \
-			$(GENERATED_H) $(PUBLIC_H) 
+			$(GENERATED_H) $(PUBLIC_H)
 
 GENERATED_HC = $(GENERATED_H) msg_mime_table.c test_table.c test_protos.h
 
@@ -55,7 +55,7 @@
 			../bnf/libbnf.la \
 			../url/liburl.la \
 			../ipt/libipt.la \
-			../su/libsu.la 
+			../su/libsu.la
 
 test_msg_LDFLAGS = 	-static
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg.c	Tue Dec 23 07:37:03 2008
@@ -95,7 +95,7 @@
  * destroyed.
  *
  * @param msg   message of which a reference is created
- * 
+ *
  * @return
  * A pointer to a message.
  */
@@ -137,7 +137,7 @@
  * @relatesalso msg_s
  *
  * @param ref pointer to msg object
- * 
+ *
  * @deprecated Use msg_destroy() instead.
  */
 void msg_ref_destroy(msg_t *ref)
@@ -154,7 +154,7 @@
 void msg_destroy(msg_t *msg)
 {
   msg_t *parent;
-  
+
   for (; msg; msg = parent) {
     int refs;
     su_home_mutex_lock(msg->m_home);
@@ -174,9 +174,9 @@
 /**Retrieve public message structure.
  *
  * Get a pointer to the public message structure.
- * 
+ *
  * @param msg pointer to msg object
- * 
+ *
  * @returns
  * A pointer to the public message structure, or NULL if none.
  */
@@ -194,10 +194,10 @@
  *
  * Get a pointer to the public message structure of the
  * given protocol.
- * 
+ *
  * @param msg pointer to msg object
  * @param tag tag of public message structure
- * 
+ *
  * @returns
  * A pointer to the public message structure, or NULL if there is none or
  * the message is not for desired protocol.
@@ -216,9 +216,9 @@
  *
  * Get a pointer to the message class object
  * (factory object for the message).
- * 
+ *
  * @param msg pointer to msg object
- * 
+ *
  * @returns
  * A pointer to the message class, or NULL if none.
  */
@@ -239,7 +239,7 @@
  * Zero the address and addressinfo structures associated with the message.
  *
  * @sa msg_addrinfo(), msg_set_address(), msg_get_address(), msg_addr_copy().
- */ 
+ */
 void msg_addr_zero(msg_t *msg)
 {
   memset(&msg->m_addr, 0, sizeof(&msg->m_addr));
@@ -249,7 +249,7 @@
   msg->m_addrinfo.ai_addr = &msg->m_addr->su_sa;
 }
 
-/** Get pointer to socket address structure. 
+/** Get pointer to socket address structure.
  *
  * @relatesalso msg_s
  *
@@ -269,7 +269,7 @@
  *
  * @param msg pointer to msg object
  * @param su pointer to socket address structure
- * @param return_len return parameter value for length 
+ * @param return_len return parameter value for length
  *                    of socket address structure
  *
  * @sa msg_addrinfo(), msg_set_address(), msg_addr_zero(), msg_addr_copy().
@@ -287,13 +287,13 @@
   return -1;
 }
 
-/** Set message address. 
+/** Set message address.
  *
  * @relatesalso msg_s
  *
  * Copy the supplied socket address to the socket address structure
  * associated with the message.
- * 
+ *
  * @param msg pointer to msg object
  * @param su pointer to socket address structure
  * @param sulen length of socket address structure
@@ -337,7 +337,7 @@
  * Copy the addrinfo and socket address structures from @a src to the @a dst
  * message object.
  *
- * @param dst pointer to destination message object 
+ * @param dst pointer to destination message object
  * @param src pointer to source message object
  *
  * @sa msg_addrinfo(), msg_get_address(), msg_set_address(), msg_addr_zero().
@@ -347,10 +347,10 @@
   dst->m_addrinfo = src->m_addrinfo;
   dst->m_addrinfo.ai_next = NULL;
   dst->m_addrinfo.ai_canonname = NULL;
-  memcpy(dst->m_addrinfo.ai_addr = &dst->m_addr->su_sa, 
+  memcpy(dst->m_addrinfo.ai_addr = &dst->m_addr->su_sa,
 	 src->m_addr, src->m_addrinfo.ai_addrlen);
   if (dst->m_addrinfo.ai_addrlen < sizeof(dst->m_addr))
-    memset((char *)dst->m_addr + dst->m_addrinfo.ai_addrlen, 0, 
+    memset((char *)dst->m_addr + dst->m_addrinfo.ai_addrlen, 0,
 	   sizeof(dst->m_addr) - dst->m_addrinfo.ai_addrlen);
 }
 
@@ -361,9 +361,9 @@
  *
  * If the message parser fails to parse certain headers in the message, it
  * sets the corresponding extract error flags. The flags corresponding to
- * each header are stored in the message parser (msg_mclass_t) structure. 
- * They are set when the header is added to the parser table. 
- * 
+ * each header are stored in the message parser (msg_mclass_t) structure.
+ * They are set when the header is added to the parser table.
+ *
  * The SIP flags are defined in <sofia-sip/sip_headers.h>. For well-known
  * SIP headers, the flags for each header are listed in a separate text file
  * (sip_bad_mask) read by msg_parser.awk.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg.docs	Tue Dec 23 07:37:03 2008
@@ -38,9 +38,9 @@
 is extended by a new header or a parser is created for a completely new
 protocol. It is possible to add new headers to the parser or extend the
 definition of existing ones. The header files used for constructing these
-parsers are as follows: 
-- <sofia-sip/msg_parser.h> parsing functions, macros 
-- <sofia-sip/msg_mclass.h> message factory object definition 
+parsers are as follows:
+- <sofia-sip/msg_parser.h> parsing functions, macros
+- <sofia-sip/msg_mclass.h> message factory object definition
 - <sofia-sip/msg_mclass_hash.h> hashing of header names
 
 @section msg_overview Parsers, Messages and Headers
@@ -54,7 +54,7 @@
 protocol-specific header files include <sofia-sip/sip.h>, <sofia-sip/http.h>, and
 <sofia-sip/msg_mime.h>. For each header, there is defined a @em header @em class
 structure, some standard functions, and tags for including them in tag
-lists. 
+lists.
 
 As a convention, all the identifiers for SIP headers start with prefix @c
 sip and all the macros with @c SIP. Same thing holds for HTTP, too: it
@@ -73,18 +73,18 @@
 header class as follows:
 
  - @c ns_X_t is the structure used to store parsed header,
- - @c ns_hclass_t @c ns_X_class[] contains the @em header @em class 
+ - @c ns_hclass_t @c ns_X_class[] contains the @em header @em class
    for header X,
  - @c NS_X_INIT() initializes a static instance of @c ns_X_t,
  - @c ns_X_init() initializes a dynamic instance of @c ns_X_t,
  - @c ns_is_X() tests if header object is instance of header X,
  - @c ns_X_make() creates a header X object by decoding given string,
- - @c ns_X_format() creates a header X object by decoding given 
+ - @c ns_X_format() creates a header X object by decoding given
    @c printf() list,
- - @c ns_X_dup() duplicates (deeply copies) the header X, 
- - @c ns_X_copy() copies the header X, 
+ - @c ns_X_dup() duplicates (deeply copies) the header X,
+ - @c ns_X_copy() copies the header X,
  - @c NSTAG_X() is used include instance of @c ns_X_t in a tag list, and
- - @c NSTAG_X_STR() is used to include string containing value header 
+ - @c NSTAG_X_STR() is used to include string containing value header
       in a tag list.
 
 The declarations of header tags and the prototypes for these functions can
@@ -111,7 +111,7 @@
 the parser considers any received data, be it a UDP datagram or a TCP
 stream, as a @em byte @em stream. The protocol-specific parsers controls how
 a byte stream is split into separate messages or if it consists of a single
-message only. 
+message only.
 
 The parser engine works by separating stream into fragments, then passing
 the fragment to a suitable parser. A fragment is a piece of message that is
@@ -120,7 +120,7 @@
 message body can consists of multiple fragments known as chunks.)
 
 The parser starts by separating the first line (e.g., request or status
-line) from the byte stream, then passing the line to the suitable parser. 
+line) from the byte stream, then passing the line to the suitable parser.
 After first line comes the message headers. The parser continues parsing
 process by extracting headers, each on their own line, from the stream and
 passing contents of each header to its parser. The message structure is
@@ -195,7 +195,7 @@
   char const         *ac_subtype;   //< Points after first slash in type
   msg_param_t const  *ac_params;    //< List of parameters
   msg_param_t         ac_q;	    //< Value of q parameter
-} 
+}
 msg_accept_t;
 @endcode
 
@@ -205,8 +205,8 @@
 the @c ac_params array. If there is a @e q parameter present, a pointer to
 the @c qvalue is assigned to @c ac_q field.
 
-In the beginning of the header structure there are two boilerplate members. 
-The @c ac_common[1] contains information common to all message fragments. 
+In the beginning of the header structure there are two boilerplate members.
+The @c ac_common[1] contains information common to all message fragments.
 The @c ac_next is a pointer to next header field with the same name, in case
 a message contains multiple @b Accept headers or multiple comma-separated
 header fields are located in a single line.
@@ -217,7 +217,7 @@
 other. The programmer also needs a convenient way to access certain headers
 at the message level, for example, accessing directly the @b Accept header
 instead of going through all headers and examining their name. The
-structured view to the message is provided via a message-specific C struct. 
+structured view to the message is provided via a message-specific C struct.
 In general, its type is msg_pub_t (it provides public view to message). The
 protocol-specific type is #sip_t, #http_t or #msg_multipart_t for
 SIP, HTTP and MIME, respectively.
@@ -283,7 +283,7 @@
 
 The figure below shows the layout of the BYE message above after parsing:
 
- at image html sip-parser2.gif BYE message and its representation in C 
+ at image html sip-parser2.gif BYE message and its representation in C
 @image latex sip-parser2.eps BYE message and its representation in C
 
 The leftmost box represents the message of type #msg_t.  Next box from
@@ -446,7 +446,7 @@
 
 /**@typedef typedef struct msg_s msg_t;
  *
- * Message object. 
+ * Message object.
  *
  * The @a msg_t is the type of a message object used by Sofia signaling
  * protocols and parsers. Its contents are not directly accessible.
@@ -454,7 +454,7 @@
 
 /**@typedef typedef struct msg_common_s msg_common_t;
  *
- * Common part of header. 
+ * Common part of header.
  *
  * The @a msg_common_t is the base type of a message headers used by
  * protocol parsers. Instead of #msg_common_t, most interfaces use

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_auth.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_auth.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_auth.c	Tue Dec 23 07:37:03 2008
@@ -76,9 +76,9 @@
 
 /* ====================================================================== */
 /*
- * auth           = ("Authorization" | "Encryption" | 
+ * auth           = ("Authorization" | "Encryption" |
  *                   "Proxy-Authenticate" | "Proxy-Authorization" |
- *                   "Response-Key" | "WWW-Authenticate") ":" 
+ *                   "Response-Key" | "WWW-Authenticate") ":"
  *                    scheme 1*SP #auth-param
  * scheme         = token
  * auth-param     = token | token "=" token | token "=" quoted-string
@@ -93,12 +93,12 @@
   msg_auth_t *au = (msg_auth_t *)h;
 
   au->au_scheme = s;
-  
+
   skip_token(&s);
   if (!IS_LWS(*s)) return -1;
   *s++ = '\0';			/* NUL-terminate scheme */
 
-  return msg_commalist_d(home, &s, (msg_param_t **)&au->au_params, 
+  return msg_commalist_d(home, &s, (msg_param_t **)&au->au_params,
 			 NULL /* msg_auth_item_scan */);
 }
 
@@ -114,11 +114,11 @@
     MSG_COMMALIST_E(b, end, au->au_params, compact);
   }
   MSG_TERM_E(b, end);
-  
+
   return b - b0;
 }
 
-/**@internal 
+/**@internal
  * Extra size of a msg_auth_t object.
  *
  * This function calculates extra size required by a msg_auth_t object.
@@ -134,7 +134,7 @@
 
   MSG_PARAMS_SIZE(offset, au->au_params);
   offset += MSG_STRING_SIZE(au->au_scheme);
-    
+
   return offset;
 }
 
@@ -150,7 +150,7 @@
 
   b = msg_params_dup(&au->au_params, o->au_params, b, xtra);
   MSG_STRING_DUP(b, au->au_scheme, o->au_scheme);
-    
+
   assert(b <= end); (void)end;
 
   return b;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_basic.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_basic.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_basic.c	Tue Dec 23 07:37:03 2008
@@ -61,7 +61,7 @@
  * @defgroup msg_error Erroneous Headers
  *
  * The erroneous headers are stored in #msg_error_t structure.
- * 
+ *
  * @note Parser may put other headers (like duplicate Content-Length
  * headers) into the list of erroneous headers. If the list of erroneous
  * headers is processed, the header type must be validated first by calling
@@ -111,7 +111,7 @@
  * The unknown headers are handled with #msg_unknown_t structure. The whole
  * unknown header including its name is included in the header value string
  * @a g_value.
- * 
+ *
  * @note It is possible to speed up parsing process by creating a parser
  * which does understand only a minimum number of headers. If such a parser
  * is used, some well-known headers are not regocnized or parser, but they
@@ -139,7 +139,7 @@
   *s++ = '\0';
   skip_lws(&s);
   un->un_value = s;
-					   
+
   return 0;
 }
 
@@ -153,7 +153,7 @@
   MSG_CHAR_E(b, end, ':');
   if (!compact) MSG_CHAR_E(b, end, ' ');
   MSG_STRING_E(b, end, un->un_value);
-  
+
   return b - b0;
 }
 
@@ -184,7 +184,7 @@
  * @defgroup msg_payload Message Body
  *
  * The payload object contains the message body. The message body has no
- * structure, but it is stored in the @a pl_data buffer as a byte array. 
+ * structure, but it is stored in the @a pl_data buffer as a byte array.
  * Multiple payload objects may be linked to a list.
  */
 
@@ -197,7 +197,7 @@
  * @code
  * typedef struct msg_payload_s {
  *   msg_common_t    pl_common[1];      // Common fragment info
- *   msg_header_t   *pl_next;           // Next payload object 
+ *   msg_header_t   *pl_next;           // Next payload object
  *   char           *pl_data;           // Data - may contain zero bytes
  *   usize_t         pl_len;            // Length of message payload
  * } msg_payload_t;
@@ -263,7 +263,7 @@
 
 char *msg_payload_dup_one(msg_header_t *dst,
 			  msg_header_t const *src,
-			  char *b, 
+			  char *b,
 			  isize_t xtra)
 {
   msg_payload_t *pl = dst->sh_payload;
@@ -288,7 +288,7 @@
 /* ====================================================================== */
 
 /**@ingroup msg_headers
- * @defgroup msg_separator Message Separator 
+ * @defgroup msg_separator Message Separator
  *
  * An empty line separates headers from the message body. In order to avoid
  * modifying messages with integrity protection, the separator line has its
@@ -325,7 +325,7 @@
 
   if (len == 0 && slen > 0)
     return -1;
-  
+
   memcpy(h->sh_separator->sep_data, s, len);
   h->sh_separator->sep_data[len] = '\0';
 
@@ -345,7 +345,7 @@
 
 msg_separator_t *msg_separator_create(su_home_t *home)
 {
-  msg_separator_t *sep = 
+  msg_separator_t *sep =
     msg_header_alloc(home, msg_separator_class, 0)->sh_separator;
 
   if (sep)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_date.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_date.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_date.c	Tue Dec 23 07:37:03 2008
@@ -59,7 +59,7 @@
  *
  * First day of the epoch year should be Monday.
  */
-#define EPOCH 1900		
+#define EPOCH 1900
 /** Is this year a leap year? @internal */
 #define LEAP_YEAR(y) ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
 /** Day number of New Year Day of given year. @internal */
@@ -69,25 +69,25 @@
 
 /* ====================================================================== */
 
-static unsigned char const days_per_months[12] = 
+static unsigned char const days_per_months[12] =
   {
     31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
   };
 
 /** Offset of first day of the month with formula day = 30 * month + offset. */
-static signed char const first_day_offset[12] = 
+static signed char const first_day_offset[12] =
   {
     0, 1, -1, 0, 0, 1, 1, 2, 3, 3, 4, 4
   };
 
-static char const wkdays[7 * 4] = 
+static char const wkdays[7 * 4] =
   "Mon\0" "Tue\0" "Wed\0" "Thu\0" "Fri\0" "Sat\0" "Sun";
 
-static char const months[12 * 4] = 
-  "Jan\0" "Feb\0" "Mar\0" "Apr\0" "May\0" "Jun\0" 
+static char const months[12 * 4] =
+  "Jan\0" "Feb\0" "Mar\0" "Apr\0" "May\0" "Jun\0"
   "Jul\0" "Aug\0" "Sep\0" "Oct\0" "Nov\0" "Dec";
 
-/** Parse a month name. 
+/** Parse a month name.
  *
  * @return The function month_d() returns 0..11 if given first three letters
  * of month name, or -1 if no month name matches.
@@ -126,19 +126,19 @@
 
 /* Parse SP 2DIGIT ":" 2DIGIT ":" 2DIGIT SP */
 su_inline
-int time_d(char const **ss, 
+int time_d(char const **ss,
 	   unsigned long *hour, unsigned long *min, unsigned long *sec)
 {
   char const *s = *ss;
-  if (!IS_LWS(*s)) 
-    return -1; 
+  if (!IS_LWS(*s))
+    return -1;
   skip_lws(&s);
   if (!is_digit(*s)) return -1;
   *hour = *s++ - '0'; if (is_digit(*s)) *hour = 10 * (*hour) + *s++ - '0';
-  if (*s++ != ':' || !is_digit(s[0]) || !is_digit(s[1])) 
+  if (*s++ != ':' || !is_digit(s[0]) || !is_digit(s[1]))
     return -1;
   *min = 10 * s[0] + s[1] - 11 * '0'; s += 2;
-  if (*s++ != ':' || !is_digit(s[0]) || !is_digit(s[1])) 
+  if (*s++ != ':' || !is_digit(s[0]) || !is_digit(s[1]))
     return -1;
   *sec = 10 * s[0] + s[1] - 11 * '0'; s += 2;
   if (*s) {
@@ -149,10 +149,10 @@
 }
 
 /**Decode RFC1123-date, RFC822-date or asctime-date.
- * 
- * The function msg_date_d() decodes <HTTP-date>, which may have 
+ *
+ * The function msg_date_d() decodes <HTTP-date>, which may have
  * different formats.
- * 
+ *
  * @code
  * HTTP-date    = rfc1123-date / rfc850-date / asctime-date
  *
@@ -174,7 +174,7 @@
  * wkday        = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"
  * weekday      = "Monday" / "Tuesday" / "Wednesday"
  *              / "Thursday" / "Friday" / "Saturday" / "Sunday"
- * month        = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" 
+ * month        = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun"
  *              / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
  * @endcode
  */
@@ -189,26 +189,26 @@
   if (!IS_TOKEN(*s) || !date)
     return -1;
 
-  wkday = s; skip_token(&s); if (*s == ',') s++; 
+  wkday = s; skip_token(&s); if (*s == ',') s++;
   while (IS_LWS(*s)) s++;
 
   if (is_digit(*s)) {
     day = *s++ - '0'; if (is_digit(*s)) day = 10 * day + *s++ - '0';
-    
+
     if (*s == ' ') {
-      /* rfc1123-date = 
+      /* rfc1123-date =
 	 wkday "," SP 2DIGIT SP month SP 4DIGIT SP time SP "GMT"
        */
       mon = month_d(++s); skip_token(&s);
       if (mon < 0 || !IS_LWS(*s)) return -1;
       s++;
-      if (!is_digit(s[0]) || !is_digit(s[1]) || 
+      if (!is_digit(s[0]) || !is_digit(s[1]) ||
 	  !is_digit(s[2]) || !is_digit(s[3]))
 	return -1;
       year = 1000 * s[0] + 100 * s[1] + 10 * s[2] + s[3] - 1111 * '0'; s += 4;
     }
     else if (*s == '-') {
-      /* rfc822-date = 
+      /* rfc822-date =
 	 weekday "," SP 2DIGIT "-" month "-" 2DIGIT SP time SP "GMT"
        */
 
@@ -216,9 +216,9 @@
       if (mon < 0 || s[3] != '-' ||
 	  !is_digit(s[4]) || !is_digit(s[5]))
 	return -1;
-      year = 10 * s[4] + s[5] - 11 * '0'; 
+      year = 10 * s[4] + s[5] - 11 * '0';
       if (is_digit(s[6]) && is_digit(s[7])) {
-	/* rfc2822-date = 
+	/* rfc2822-date =
 	   weekday "," SP 2DIGIT "-" month "-" 4DIGIT SP time SP "GMT"
 	*/
 	year = year * 100 + 10 * s[6] + s[7] - 11 * '0';
@@ -243,26 +243,26 @@
     }
   }
   else {
-    /* actime-date = 
+    /* actime-date =
        wkday SP month SP ( 2DIGIT | ( SP 1DIGIT )) SP time SP 4DIGIT */
     mon = month_d(s); skip_token(&s);
     if (mon < 0 || !IS_LWS(*s)) return -1; s++;
-    while (IS_LWS(*s)) s++; 
+    while (IS_LWS(*s)) s++;
     if (!is_digit(*s)) return -1;
     day = *s++ - '0'; if (is_digit(*s)) day = 10 * day + *s++ - '0';
     if (time_d(&s, &hour, &min, &sec) < 0) return -1;
-    /* Accept also unix date (if it is GMT) */ 
+    /* Accept also unix date (if it is GMT) */
     if ((s[0] == 'G' && s[1] == 'M' && s[2] == 'T' && s[3] == ' ') ||
 	(s[0] == 'U' && s[1] == 'T' && s[2] == 'C' && s[3] == ' '))
       s += 4;
     else if (s[0] == 'U' && s[1] == 'T' && s[2] == ' ')
       s += 3;
-    if (!is_digit(s[0]) || !is_digit(s[1]) || 
+    if (!is_digit(s[0]) || !is_digit(s[1]) ||
 	!is_digit(s[2]) || !is_digit(s[3]))
       return -1;
     year = 1000 * s[0] + 100 * s[1] + 10 * s[2] + s[3] - 1111 * '0'; s += 4;
   }
-  
+
   if (hour > 24 || min >= 60 || sec >= 60 ||
       (hour == 24 && min > 0 && sec > 0))
     return -1;
@@ -271,7 +271,7 @@
     if (day != 29 || mon != 1 || !LEAP_YEAR(year))
       return -1;
   }
-  
+
   if (year < EPOCH) {
     *date = 0;
   }
@@ -281,17 +281,17 @@
   else {
     int leap_year = LEAP_YEAR(year);
     msg_time_t ydays = YEAR_DAYS(year) - YEAR_DAYS(EPOCH);
-    
+
 #if 0
-    printf("Year %d%s starts %ld = %d - %d days since epoch (%d)\n", 
-	       year, leap_year ? " (leap year)" : "", 
+    printf("Year %d%s starts %ld = %d - %d days since epoch (%d)\n",
+	       year, leap_year ? " (leap year)" : "",
 	   ydays, YEAR_DAYS(year), YEAR_DAYS(EPOCH), EPOCH);
 #endif
-    
-    *date = sec + 60 * 
-      (min + 60 * 
-	   (hour + 24 * 
-	    (day - 1 + mon * 30 + first_day_offset[mon] + 
+
+    *date = sec + 60 *
+      (min + 60 *
+	   (hour + 24 *
+	    (day - 1 + mon * 30 + first_day_offset[mon] +
 	     (leap_year && mon > 2) + ydays)));
   }
   *ss = s;
@@ -301,10 +301,10 @@
 
 
 /**Encode RFC1123-date.
- * 
+ *
  * The function msg_date_e() prints @e http-date in the <rfc1123-date>
  * format. The format is as follows:
- * 
+ *
  * @code
  * rfc1123-date = wkday "," SP date SP time SP "GMT"
  * wkday        = "Mon" | "Tue" | "Wed"
@@ -317,11 +317,11 @@
  * time         = 2DIGIT ":" 2DIGIT ":" 2DIGIT
  *                ; 00:00:00 - 23:59:59
  * @endcode
- * 
+ *
  * @param b         buffer to print the date
  * @param bsiz      size of the buffer
  * @param http_date seconds since 01 Jan 1900.
- * 
+ *
  * @return The function msg_date_e() returns the size of the formatted date.
  */
 issize_t msg_date_e(char b[], isize_t bsiz, msg_time_t http_date)
@@ -349,7 +349,7 @@
   day -= YEAR_DAYS(year);
   leap_year = LEAP_YEAR(year);
 
-  month = 0, days_per_month = 31; 
+  month = 0, days_per_month = 31;
   while (day >= days_per_month) {
     day -= days_per_month;
     month++;
@@ -357,13 +357,13 @@
   }
 
   return snprintf(b, bsiz, "%s, %02ld %s %04ld %02ld:%02ld:%02ld GMT",
-		  wkdays + wkday * 4, day + 1, months + month * 4, 
+		  wkdays + wkday * 4, day + 1, months + month * 4,
 		  year, hour, min, sec);
 }
 
 
 /**Decode a delta-seconds.
- * 
+ *
  * The function msg_delta_d() decodes a <delta-seconds> field.
  *
  * The <delta-seconds> is defined as follows:
@@ -393,9 +393,9 @@
   return snprintf(b, bsiz, "%lu", (unsigned long)delta);
 }
 
-/** Decode a HTTP date or delta 
- * 
- * Decode a @ref msg_date_d() "<http-date>" or 
+/** Decode a HTTP date or delta
+ *
+ * Decode a @ref msg_date_d() "<http-date>" or
  * @ref msg_delta_d() "<delta-seconds>" field.
  */
 issize_t msg_date_delta_d(char const **ss,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c	Tue Dec 23 07:37:03 2008
@@ -22,15 +22,15 @@
  *
  */
 
-/**@internal 
+/**@internal
  * @ingroup msg_parser
  * @file msg_generic.c
  * @brief Functions for generic headers
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Thu Jan 23 20:08:00 2003 ppessi
- * 
+ *
  */
 
 #include "config.h"
@@ -55,17 +55,17 @@
  *
  * The function msg_generic_d() parses a generic header structure.
  *
- * @param[in]     home memory home 
- * @param[in,out] h    header structure 
- * @param[in]     s    string to be parsed 
- * @param[in]     slen length of the string 
+ * @param[in]     home memory home
+ * @param[in,out] h    header structure
+ * @param[in]     s    string to be parsed
+ * @param[in]     slen length of the string
  *
- * @retval 0 when successful, 
+ * @retval 0 when successful,
  * @retval -1 upon an error.
  */
 issize_t msg_generic_d(su_home_t *home,
 		       msg_header_t *h,
-		       char *s, 
+		       char *s,
 		       isize_t slen)
 {
   h->sh_generic->g_string = s;
@@ -80,9 +80,9 @@
  */
 issize_t msg_generic_e(char b[], isize_t bsiz, msg_header_t const *h, int flags)
 {
-  msg_generic_t const *g = h->sh_generic;  
+  msg_generic_t const *g = h->sh_generic;
   size_t n = strlen(g->g_string);
-  
+
   if (bsiz > n)
     strcpy(b, g->g_string);
 
@@ -142,7 +142,7 @@
 /* ====================================================================== */
 /* Comma-separated list */
 
-/** @typedef struct msg_list_s msg_list_t; 
+/** @typedef struct msg_list_s msg_list_t;
  *
  * Type for token list headers.
  *
@@ -157,14 +157,14 @@
 {
   int compact = MSG_IS_COMPACT(flags);
   char *b0 = b, *end = b + bsiz;
-  
+
   MSG_COMMALIST_E(b, end, h->sh_list->k_items, compact);
   MSG_TERM_E(b, end);
 
   return b - b0;
 }
 
-/**@internal 
+/**@internal
  * Extra size of a msg_auth_t object.
  *
  * This function calculates extra size required by a msg_auth_t object.
@@ -182,14 +182,14 @@
 
 char *msg_list_dup_one(msg_header_t *dst,
 		       msg_header_t const *src,
-		       char *b, 
+		       char *b,
 		       isize_t xtra)
 {
   char *end = b + xtra;
   msg_param_t const ** items = (msg_param_t const **)&dst->sh_list->k_items;
 
   b = msg_params_dup(items, src->sh_list->k_items, b, xtra);
-    
+
   assert(b <= end); (void)end;
 
   return b;
@@ -200,8 +200,8 @@
  * @retval 0 when successful
  * @retval -1 upon an error
  */
-int msg_list_append_items(su_home_t *home, 
-			  msg_list_t *k, 
+int msg_list_append_items(su_home_t *home,
+			  msg_list_t *k,
 			  msg_param_t const items[])
 {
   size_t i;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_copy.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_copy.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_copy.c	Tue Dec 23 07:37:03 2008
@@ -23,8 +23,8 @@
  */
 
 /**@ingroup msg_headers
- * @CFILE msg_header_copy.c 
- * 
+ * @CFILE msg_header_copy.c
+ *
  * Copying and duplicating headers structures.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -65,7 +65,7 @@
 /** Copy a vector of parameters */
 su_inline
 char *msg_params_copy(char *b, size_t size,
-		      msg_param_t **dst, 
+		      msg_param_t **dst,
 		      msg_param_t const src[])
 {
   size_t n = msg_params_count(src);
@@ -90,11 +90,11 @@
  * @param hc   header class for the copied header
  * @param src  pointer to a header object
  *
- * @return 
+ * @return
  * The function @c msg_header_copy_as() returns a pointer to the the shallow copy
  * of the header object, or @c NULL upon an error.
  */
-static msg_header_t *msg_header_copy_one_as(su_home_t *home, 
+static msg_header_t *msg_header_copy_one_as(su_home_t *home,
 					    msg_hclass_t *hc,
 					    msg_header_t const *src)
 {
@@ -145,7 +145,7 @@
  * @return The function @c msg_header_copy_as() returns a pointer to the
  * first of the copied msg header object(s), or @c NULL upon an error.
  */
-msg_header_t *msg_header_copy_as(su_home_t *home, 
+msg_header_t *msg_header_copy_as(su_home_t *home,
 				 msg_hclass_t *hc,
 				 msg_header_t const *src)
 {
@@ -161,7 +161,7 @@
     if (!(h = msg_header_copy_one_as(home, hc, src)))
       break;
 
-    if (!rv) 
+    if (!rv)
       rv = h;
     else
       prev->sh_next = h;
@@ -210,7 +210,7 @@
  * @return Return a pointer to the
  * the duplicated msg header object(s), or @c NULL upon an error.
  */
-msg_header_t *msg_header_dup_one(su_home_t *home, 
+msg_header_t *msg_header_dup_one(su_home_t *home,
 				 msg_header_t const *src)
 {
   msg_hclass_t *hc;
@@ -277,7 +277,7 @@
     if (!(h = msg_header_alloc(home, hc, (isize_t)xtra)))
       break;			/* error */
 
-    if (!rv) 
+    if (!rv)
       rv = h;
 
     if (!(end = hc->hc_dup_one(h, src, (char *)h + size, xtra)))
@@ -343,7 +343,7 @@
  */
 char *msg_default_dup_one(msg_header_t *h,
 			  msg_header_t const *src,
-			  char *b, 
+			  char *b,
 			  isize_t xtra)
 {
   memcpy(&h->sh_header_next[1],
@@ -357,9 +357,9 @@
 /* Copying or duplicating all headers in a message */
 
 static int msg_copy_chain(msg_t *msg, msg_t const *copied);
-static int msg_dup_or_copy_all(msg_t *msg, 
+static int msg_dup_or_copy_all(msg_t *msg,
 			       msg_t const *original,
-			       msg_header_t *(*copy_one)(su_home_t *h, 
+			       msg_header_t *(*copy_one)(su_home_t *h,
 							 msg_header_t const *));
 
 
@@ -383,8 +383,8 @@
     msg_t *copy = msg_create(original->m_class, original->m_object->msg_flags);
 
     if (copy) {
-      if (original->m_chain 
-	  ? msg_copy_chain(copy, original) < 0 
+      if (original->m_chain
+	  ? msg_copy_chain(copy, original) < 0
 	  : msg_dup_or_copy_all(copy, original, msg_header_copy_one) < 0) {
 	msg_destroy(copy), copy = NULL;
       }
@@ -412,18 +412,18 @@
   msg_header_t *dh;
   msg_header_t const *sh;
   msg_header_t **hh;
-  
+
   tail = msg->m_tail;
-  
+
   for (sh = original->m_chain; sh; sh = (msg_header_t const *)sh->sh_succ) {
     hh = msg_hclass_offset(msg->m_class, dst, sh->sh_class);
     if (!hh)
       break;
     while (*hh)
       hh = &(*hh)->sh_next;
-      
+
     dh = msg_header_copy_one(home, sh);
-    if (!dh) 
+    if (!dh)
       break;
 
     dh->sh_prev = tail, *tail = dh, tail = &dh->sh_succ;
@@ -468,15 +468,15 @@
   return NULL;
 }
 
-/** Copy a complete message, not keeping the header chain structure. 
+/** Copy a complete message, not keeping the header chain structure.
  *
  * @retval 0 when successful
  * @retval -1 upon an error
  */
 static
-int msg_dup_or_copy_all(msg_t *msg, 
+int msg_dup_or_copy_all(msg_t *msg,
 			msg_t const *original,
-			msg_header_t *(*copy_one)(su_home_t *h, 
+			msg_header_t *(*copy_one)(su_home_t *h,
 						  msg_header_t const *))
 {
   su_home_t *home = msg_home(msg);
@@ -493,7 +493,7 @@
   assert(copy_one);
 
   end = (msg_header_t**)((char *)src + src->msg_size);
-  
+
   for (ssh = &src->msg_request; ssh < end; ssh++) {
     sh = *ssh;
     if (!sh)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_make.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_make.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_make.c	Tue Dec 23 07:37:03 2008
@@ -61,14 +61,14 @@
 #include <assert.h>
 
 /** Make a header from a value string. */
-msg_header_t *msg_header_make(su_home_t *home, 
+msg_header_t *msg_header_make(su_home_t *home,
 			      msg_hclass_t *hc,
 			      char const *s)
 {
   size_t xtra;
   msg_header_t *h;
   int normal = hc->hc_name ||
-    (hc->hc_hash != msg_payload_hash && 
+    (hc->hc_hash != msg_payload_hash &&
      hc->hc_hash != msg_separator_hash &&
      hc->hc_hash != msg_error_hash);
 
@@ -76,7 +76,7 @@
     return NULL;
 
   /* For normal headers, strip LWS from both ends */
-  if (normal) 
+  if (normal)
     skip_lws(&s);
   xtra = strlen(s);
   if (normal)
@@ -91,7 +91,7 @@
     strncpy(b, s, xtra)[xtra] = 0;
 
     if (hc->hc_parse(home, h, b, xtra) == -1) {
-      /* Note: parsing function is responsible to free 
+      /* Note: parsing function is responsible to free
 	 everything it has allocated (like parameter lists) */
       /* XXX - except header structures */
       su_free(home, h), h = NULL;
@@ -102,13 +102,13 @@
 }
 
 /** Make a MSG header with formatting provided. */
-msg_header_t *msg_header_vformat(su_home_t *home, 
+msg_header_t *msg_header_vformat(su_home_t *home,
 				msg_hclass_t *hc,
 				char const *fmt,
 				va_list ap)
 {
   msg_header_t *h;
-  
+
   int n;
   size_t xtra = 64;		/* reasonable default */
 
@@ -121,7 +121,7 @@
     fmt = va_arg(ap, char const *);
     return msg_header_make(home, hc, fmt);
   }
-  
+
   if (!(h = msg_header_alloc(home, hc, xtra)))
     return NULL;
 
@@ -131,7 +131,7 @@
     va_copy(aq, ap);
     n = vsnprintf(MSG_HEADER_DATA(h), xtra, fmt, aq);
     va_end(aq);
-    
+
     if (n >= 0 && (size_t)n < xtra)
       break;
 
@@ -148,13 +148,13 @@
 
     if (xtra > INT_MAX)
       xtra = INT_MAX;
-    
+
     if (!(h = msg_header_alloc(home, hc, xtra)))
       return NULL;
   }
-  
+
   if (hc->hc_parse(home, h, MSG_HEADER_DATA(h), (size_t)n) == -1) {
-    /* Note: parsing function is responsible to free 
+    /* Note: parsing function is responsible to free
        everything it has allocated (like parameter lists) */
     su_free(home, h), h = NULL;
   }
@@ -162,7 +162,7 @@
   return h;
 }
 
-msg_header_t *msg_header_format(su_home_t *home, 
+msg_header_t *msg_header_format(su_home_t *home,
 				msg_hclass_t *hc,
 				char const *fmt,
 				...)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_internal.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_internal.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_internal.h	Tue Dec 23 07:37:03 2008
@@ -24,10 +24,10 @@
 
 #ifndef MSG_INTERNAL_H
 /** Defined when <msg_internal.h> has been included. */
-#define MSG_INTERNAL_H 
+#define MSG_INTERNAL_H
 
-/**@IFILE msg_internal.h 
- * @brief Abstract messages - internal interface 
+/**@IFILE msg_internal.h
+ * @brief Abstract messages - internal interface
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
@@ -131,7 +131,7 @@
 
 su_inline int msg_is_append(msg_header_t const *h)
 {
-  return 
+  return
     h->sh_class->hc_kind == msg_kind_append ||
     h->sh_class->hc_kind == msg_kind_apndlist;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mclass.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mclass.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mclass.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@ingroup msg_parser 
+/**@ingroup msg_parser
  * @CFILE msg_mclass.c
  *
  * Message factory object.
@@ -63,12 +63,12 @@
  * empty is true, the copied message class object will not recognize any
  * headers. This is useful if more fine-grained control of parsing process
  * is required, for instance.
- * 
- * @param[in] old      pointer to the message class object to be copied 
- * @param[in] newsize  size of hash table in the copied object 
- * @param[in] empty    if true, resulting copy does not contain any headers 
- * 
- * @return 
+ *
+ * @param[in] old      pointer to the message class object to be copied
+ * @param[in] newsize  size of hash table in the copied object
+ * @param[in] empty    if true, resulting copy does not contain any headers
+ *
+ * @return
  * The function msg_mclass_clone() returns a pointer to a newly
  * copied message class object, or NULL upon an error.
  * The returned message class object can be freed with free().
@@ -78,7 +78,7 @@
  * A memory allocation failed.
  * @ERROR EINVAL
  * The function was given invalid arguments.
- * 
+ *
  * @note The empty parser can handle request/status line. All headers are
  * put into list of unknown headers (unless they are malformed, and they are
  * put into list of erronous headers). However, SIP, RTSP, and HTTP
@@ -90,7 +90,7 @@
 msg_mclass_t *msg_mclass_clone(msg_mclass_t const *old, int newsize, int empty)
 {
   size_t size, shortsize;
-  msg_mclass_t *mc; 
+  msg_mclass_t *mc;
   int identical;
   unsigned short i;
 
@@ -126,7 +126,7 @@
       memcpy(mc, old, size);
       mc->mc_short = NULL;
     }
-    
+
     if (shortsize) {
       if (empty)
 	mc->mc_short = memset((char *)mc + size, 0, shortsize);
@@ -147,8 +147,8 @@
  * structure" is zero, the function extends the public message structure in
  * order to store newly inserted header there.
  *
- * @param[in,out] mc       pointer to a message class object 
- * @param[in]     hc       pointer to a header class object 
+ * @param[in,out] mc       pointer to a message class object
+ * @param[in]     hc       pointer to a header class object
  * @param[in]     offset   offset of the header in
  *                         @ref msg_pub_t "public message structure"
  *
@@ -156,10 +156,10 @@
  * the public message structure and places the header at the end of message.
  *
  * @return Number of collisions in hash table, or -1 upon an error.
- * 
+ *
  * @deprecated Use msg_mclass_insert_with_mask() instead.
  */
-int msg_mclass_insert_header(msg_mclass_t *mc, 
+int msg_mclass_insert_header(msg_mclass_t *mc,
 			     msg_hclass_t *hc,
 			     unsigned short offset)
 {
@@ -195,13 +195,13 @@
  *
  * @param[in,out] mc       pointer to a message class
  * @param[in]     hc       pointer to a header class
- * @param[in]     offset   offset of the header in 
- *                         @ref msg_pub_t "public message structure" 
- * @param[in]     flags    classification flags for the header 
+ * @param[in]     offset   offset of the header in
+ *                         @ref msg_pub_t "public message structure"
+ * @param[in]     flags    classification flags for the header
  *
  * @return Number of collisions in hash table, or -1 upon an error.
  */
-int msg_mclass_insert_with_mask(msg_mclass_t *mc, 
+int msg_mclass_insert_with_mask(msg_mclass_t *mc,
 				msg_hclass_t *hc,
 				unsigned short offset,
 				unsigned short flags)
@@ -232,8 +232,8 @@
  *
  * @relatesalso msg_mclass_s
  *
- * @param[in,out] mc       pointer to a message class object 
- * @param[in]     hr       header reference object 
+ * @param[in,out] mc       pointer to a message class object
+ * @param[in]     hr       header reference object
  *
  * @return Number of collisions in hash table, or -1 upon an error.
  */
@@ -249,7 +249,7 @@
     return -1;
   }
 
-  if (hr == NULL || (hc = hr->hr_class) == NULL) 
+  if (hr == NULL || (hc = hr->hr_class) == NULL)
     return 0;
 
   /* Add short form */
@@ -260,10 +260,10 @@
     if (compact < 'a' || compact > 'z')
       return -1;
 
-    if (shorts[compact - 'a'].hr_class && 
+    if (shorts[compact - 'a'].hr_class &&
 	shorts[compact - 'a'].hr_class != hc)
       return -1;
-      
+
     shorts[compact - 'a'] = *hr;
   }
 
@@ -281,7 +281,7 @@
 
   mc->mc_hash[j] = hr[0];
   mc->mc_hash_used++;
-  
+
   return collisions;
 }
 
@@ -296,8 +296,8 @@
  * class based on the contents of the header to be parsed. The buffer @a s
  * should point to the first character in the header name.
  *
- * @param[in]  mc   message class object 
- * @param[in]  s    header contents 
+ * @param[in]  mc   message class object
+ * @param[in]  s    header contents
  * @param[out] return_start_of_content start of header content (may be NULL)
  *
  * @return The function msg_find_hclass() returns a pointer to a header
@@ -309,11 +309,11 @@
  * start of the header contents within @a s, or 0 upon an error parsing the
  * header name and following colon.
  *
- * @par 
+ * @par
  * Upon a fatal error, a NULL pointer is returned.
  */
-msg_href_t const *msg_find_hclass(msg_mclass_t const *mc, 
-				  char const *s, 
+msg_href_t const *msg_find_hclass(msg_mclass_t const *mc,
+				  char const *s,
 				  isize_t *return_start_of_content)
 {
   msg_href_t const *hr;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c	Tue Dec 23 07:37:03 2008
@@ -132,7 +132,7 @@
  *                 part. Note that the semantics of a part differ from the
  *                 semantics of a message, as described in the text.>
  *
- *   encapsulation := delimiter transport-padding CRLF 
+ *   encapsulation := delimiter transport-padding CRLF
  *                    body-part
  *
  *   close-delimiter := delimiter "--"
@@ -144,26 +144,26 @@
  * @endcode
  *
  * @par Parsing a Multipart Message
- * 
+ *
  * When a message body contains a multipart entity (in other words, it has a
  * MIME media type of "multipart"), the application can split the multipart
  * entity into body parts
  *
  * The parsing is relatively simple, the application just gives a memory
- * home object, a Content-Type header object and message body object as an 
+ * home object, a Content-Type header object and message body object as an
  * argument to msg_multipart_parse() function:
  * @code
- *    if (sip->sip_content_type && 
+ *    if (sip->sip_content_type &&
  *        strncasecmp(sip->sip_content_type, "multipart/", 10) == 0) {
  *      msg_multipart_t *mp;
  *
  *      if (sip->sip_multipart)
  *        mp = sip->sip_multipart;
  *      else
- *        mp = msg_multipart_parse(msg_home(msg), 
+ *        mp = msg_multipart_parse(msg_home(msg),
  *                                 sip->sip_content_type,
  *                                 (sip_payload_t *)sip->sip_payload);
- * 
+ *
  *      if (mp)
  *        ... processing multipart ...
  *      else
@@ -194,12 +194,12 @@
  *   msg_header_t *h = NULL;
  *   char *b;
  *   size_t len, offset;
- * 
+ *
  *   mp = msg_multipart_create(home, "text/html;level=3", html, strlen(html));
  *   mp->mp_next = msg_multipart_create(home, "image/gif", gif, giflen);
  *
  *   c = sip_content_type_make(home, "multipart/mixed");
- * 
+ *
  *   // Add delimiters to multipart, and boundary parameter to content-type
  *   if (msg_multipart_complete(home, c, mp) < 0)
  *     return -1;		// Error
@@ -209,14 +209,14 @@
  *   if (msg_multipart_serialize(&h, mp) < 0)
  *     return -1;		// Error
  *
- *   // Encode all multipart components 
+ *   // Encode all multipart components
  *   len = msg_multipart_prepare(msg, mp, 0);
  *   if (len < 0)
  *     return -1;		// Error
  *
  *   pl = sip_payload_create(home, NULL, len);
  *
- *   // Copy each element from multipart to pl_data 
+ *   // Copy each element from multipart to pl_data
  *   b = pl->pl_data;
  *   for (offset = 0, h = mp; offset < len; h = h->sh_succ) {
  *     memcpy(b + offset, h->sh_data, h->sh_len);
@@ -292,7 +292,7 @@
 
 
 /** Boundary chars. */
-static char const bchars[] = 
+static char const bchars[] =
 "'()+_,-./:=?"
 "0123456789"
 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -331,7 +331,7 @@
       }
       return boundary;
     }
-  } 
+  }
 
   /* Look for LF -- */
   for (;(p = memmem(p, end - p, LF "--", 3)); p += 3) {
@@ -362,9 +362,9 @@
  * The function msg_multipart_parse() parses a MIME multipart message. The
  * common syntax of multiparts is described in @RFC2046 (section 7).
  *
- * @param[in,out] home home for allocating structures 
- * @param[in]     c    content-type header for multipart 
- * @param[in]     pl   payload structure for multipart 
+ * @param[in,out] home home for allocating structures
+ * @param[in]     c    content-type header for multipart
+ * @param[in]     pl   payload structure for multipart
  *
  * After parsing, the @a pl will contain the plain-text preamble (if any).
  *
@@ -418,7 +418,7 @@
 
   /* Split multipart into parts */
   for (;;) {
-    while (p[0] == ' ') 
+    while (p[0] == ' ')
       p++;
 
     p += p[0] == '\r' ? 1 + (p[1] == '\n') : (p[0] == '\n');
@@ -464,7 +464,7 @@
       break;
     }
 
-    b = next; p = next + m; 
+    b = next; p = next + m;
   }
 
   if (!mp || !mp->mp_close_delim) {
@@ -516,7 +516,7 @@
   blen = strlen(boundary);
 
   for (mp = all; mp; mp = mp->mp_next) {
-    mp->mp_data = boundary; 
+    mp->mp_data = boundary;
     mp->mp_len = blen;
 
     assert(mp->mp_payload || mp->mp_separator);
@@ -546,19 +546,19 @@
 }
 
 /**Add all missing parts to the multipart.
- * 
+ *
  * Add missing components such as boundaries between body parts, separators
  * between body-part headers and data, and close-delimiter after last
  * body-part to the multipart message.
- * 
- * @param[in,out] home home for allocating structures 
- * @param[in,out] c    content-type header for multipart 
- * @param[in,out] mp   pointer to first multipart structure 
+ *
+ * @param[in,out] home home for allocating structures
+ * @param[in,out] c    content-type header for multipart
+ * @param[in,out] mp   pointer to first multipart structure
  *
  * @retval 0 when successful
  * @retval -1 upon an error
  *
- * @ERRORS 
+ * @ERRORS
  * @ERROR EBADMSG
  * The @b Content-Type header @a c is malformed, or multipart message
  * contains a malformed @b Content-Type header.
@@ -635,7 +635,7 @@
 
     if (mp->mp_next == NULL) {
       if (!mp->mp_close_delim)
-	mp->mp_close_delim = msg_payload_format(home, "%.*s--" CR LF, 
+	mp->mp_close_delim = msg_payload_format(home, "%.*s--" CR LF,
 						(int)m, boundary);
       if (!mp->mp_close_delim)
 	return -1;
@@ -813,7 +813,7 @@
   if (!mp || !mp->mp_data)
     return -1;
 
-  if (!mp->mp_common->h_data || 
+  if (!mp->mp_common->h_data ||
       mp->mp_common->h_len != mp->mp_len - 2 ||
       memcmp(mp->mp_common->h_data, mp->mp_data + 2, mp->mp_len - 2)) {
     mp->mp_common->h_data = mp->mp_data + 2;
@@ -833,10 +833,10 @@
   assert(h && msg_is_multipart(h));
 
   msg_payload_init(pl);
-  
+
   result = (msg_multipart_t *)h;
 
-  pl->pl_data = s; 
+  pl->pl_data = s;
   pl->pl_len = slen;
 
   mp = msg_multipart_parse(tmphome, NULL, pl);
@@ -845,14 +845,14 @@
     *result = *mp;
 
     if (result->mp_common->h_succ->sh_prev)
-      result->mp_common->h_succ->sh_prev = 
+      result->mp_common->h_succ->sh_prev =
 	&result->mp_common->h_succ;
 
     su_free(tmphome, mp);
-    
+
     su_home_move(home, tmphome);
   }
-   
+
   su_home_deinit(tmphome);
 
   return mp ? 0 : -1;
@@ -877,7 +877,7 @@
   offset = msg_payload_dup_xtra(h, offset);
 
   for (hh = (msg_header_t const **)&((msg_pub_t *)mp)->msg_request;
-       (char *)hh <= (char *)&mp->mp_close_delim; 
+       (char *)hh <= (char *)&mp->mp_close_delim;
        hh++) {
     for (h = *hh; h; h = h->sh_next) {
       MSG_STRUCT_SIZE_ALIGN(offset);
@@ -899,7 +899,7 @@
   b = msg_payload_dup_one(dst, src, b, xtra);
 
   for (hh = &((msg_pub_t*)mp)->msg_request;
-       (char *)hh <= (char *)&mp->mp_close_delim; 
+       (char *)hh <= (char *)&mp->mp_close_delim;
        hh++) {
     for (h = *hh; h; h = h->sh_next) {
       MSG_STRUCT_ALIGN(b);
@@ -972,8 +972,8 @@
  *
  * The function msg_mediatype_d() parses a mediatype string.
  *
- * @param[in,out] ss    string to be parsed 
- * @param[out]    type  value result for media type 
+ * @param[in,out] ss    string to be parsed
+ * @param[out]    type  value result for media type
  *
  * @retval 0 when successful,
  * @retval -1 upon an error.
@@ -1059,7 +1059,7 @@
  */
 
 msg_hclass_t msg_accept_class[] =
-MSG_HEADER_CLASS(msg_, accept, "Accept", "", ac_params, apndlist, 
+MSG_HEADER_CLASS(msg_, accept, "Accept", "", ac_params, apndlist,
 		 msg_accept, msg_accept);
 
 issize_t msg_accept_d(su_home_t *home, msg_header_t *h, char *s, isize_t slen)
@@ -1136,8 +1136,8 @@
   return b;
 }
 
-/** Update parameter(s) for Accept header. */ 
-int msg_accept_update(msg_common_t *h, 
+/** Update parameter(s) for Accept header. */
+int msg_accept_update(msg_common_t *h,
 		      char const *name, isize_t namelen,
 		      char const *value)
 {
@@ -1223,8 +1223,8 @@
   return b;
 }
 
-/** Update parameter(s) for Accept-* header. */ 
-int msg_accept_any_update(msg_common_t *h, 
+/** Update parameter(s) for Accept-* header. */
+int msg_accept_any_update(msg_common_t *h,
 			  char const *name, isize_t namelen,
 			  char const *value)
 {
@@ -1431,7 +1431,7 @@
  */
 
 /**@ingroup msg_content_disposition
- * @typedef struct msg_content_disposition_s msg_content_disposition_t; 
+ * @typedef struct msg_content_disposition_s msg_content_disposition_t;
  *
  * The structure msg_content_disposition_t contains representation of an @b
  * Content-Disposition header.
@@ -1548,7 +1548,7 @@
  */
 
 /**@ingroup msg_content_encoding
- * @typedef struct msg_list_s msg_content_encoding_t; 
+ * @typedef struct msg_list_s msg_content_encoding_t;
  *
  * The structure msg_content_encoding_t contains representation of an @b
  * Content-Encoding header.
@@ -1715,7 +1715,7 @@
  */
 
 /**@ingroup msg_content_md5
- * @typedef struct msg_generic_s msg_content_md5_t; 
+ * @typedef struct msg_generic_s msg_content_md5_t;
  *
  * The structure msg_content_md5_t contains representation of an @b
  * Content-MD5 header.
@@ -1896,7 +1896,7 @@
  */
 
 /**@ingroup msg_mime_version
- * @typedef struct msg_generic_s msg_mime_version_t; 
+ * @typedef struct msg_generic_s msg_mime_version_t;
  *
  * The structure msg_mime_version_t contains representation of an @b
  * MIME-Version header.
@@ -1935,7 +1935,7 @@
  */
 
 /**@ingroup msg_content_location
- * @typedef struct msg_generic_s msg_content_location_t; 
+ * @typedef struct msg_generic_s msg_content_location_t;
  *
  * The structure msg_content_location_t contains representation of an @b
  * Content-Location header.
@@ -2000,7 +2000,7 @@
  */
 
 /**@ingroup msg_content_transfer_encoding
- * @typedef struct msg_generic_s msg_content_transfer_encoding_t; 
+ * @typedef struct msg_generic_s msg_content_transfer_encoding_t;
  *
  * The structure msg_content_transfer_encoding_t contains representation of
  * an @b Content-Transfer-Encoding header.
@@ -2027,11 +2027,11 @@
 
 /**@ingroup msg_mime
  * @defgroup msg_warning Warning Header
- * 
+ *
  * The Warning response-header field is used to carry additional information
  * about the status of a response. Its syntax is defined in [S20.43]
  * as follows:
- * 
+ *
  * @code
  *    Warning        =  "Warning" HCOLON warning-value *(COMMA warning-value)
  *    warning-value  =  warn-code SP warn-agent SP warn-text
@@ -2045,7 +2045,7 @@
  */
 
 /**@ingroup msg_warning
- * @typedef struct msg_warning_s msg_warning_t; 
+ * @typedef struct msg_warning_s msg_warning_t;
  *
  * The structure msg_warning_t contains representation of an @b
  * Warning header.
@@ -2073,7 +2073,7 @@
     *s = '\0', s += span_lws(s + 1) + 1;
 
   /* Parse protocol */
-  if (!IS_DIGIT(*s))	
+  if (!IS_DIGIT(*s))
     return -1;
   w->w_code = strtoul(s, &s, 10);
   skip_lws(&s);
@@ -2098,7 +2098,7 @@
   int n;
   size_t m;
 
-  n = snprintf(b, bsiz, "%03u %s%s%s ", 
+  n = snprintf(b, bsiz, "%03u %s%s%s ",
 	       w->w_code, w->w_host, port ? ":" : "", port ? port : "");
   if (n < 0)
     return n;
@@ -2122,9 +2122,9 @@
   return offset;
 }
 
-char *msg_warning_dup_one(msg_header_t *dst, 
-			  msg_header_t const *src, 
-			  char *b, 
+char *msg_warning_dup_one(msg_header_t *dst,
+			  msg_header_t const *src,
+			  char *b,
 			  isize_t xtra)
 {
   msg_warning_t *w = (msg_warning_t *)dst;
@@ -2143,6 +2143,6 @@
 
 #define msg_warning_update NULL
 
-msg_hclass_t msg_warning_class[] = 
-  MSG_HEADER_CLASS(msg_, warning, "Warning", "", w_common, append, 
+msg_hclass_t msg_warning_class[] =
+  MSG_HEADER_CLASS(msg_, warning, "Warning", "", w_common, append,
 		   msg_warning, msg_warning);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime_table.c.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime_table.c.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime_table.c.in	Tue Dec 23 07:37:03 2008
@@ -31,8 +31,8 @@
  */
 
 /**@ingroup msg_mime
- * 
- * @CFILE msg_mime_table.c 
+ *
+ * @CFILE msg_mime_table.c
  * @brief Parser table used for testing.
  *
  * #AUTO#

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_name_hash.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_name_hash.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_name_hash.c	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 /**@ingroup test_msg
  * @CFILE msg_name_hash.c
- * 
- * Calculate hash for given header name. 
- * 
+ *
+ * Calculate hash for given header name.
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Tue Aug 20 16:27:01 EEST 2002 ppessi

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.awk
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.awk	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.awk	Tue Dec 23 07:37:03 2008
@@ -49,7 +49,7 @@
   # Initialize these as arrays
   split("", symbols);
   split("", names);
-  split("", comments); 
+  split("", comments);
   split("", hashes);
   split("", NAMES);
   split("", Comments);
@@ -81,7 +81,7 @@
 {
   hash = 0;
 
-  len = length(name); 
+  len = length(name);
 
   for (i = 1; i <= len; i++) {
     c = tolower(substr(name, i, 1));
@@ -112,7 +112,7 @@
 function protos (name, comment, hash, since)
 {
   NAME=toupper(name);
-  sub(/.*[\/][*][*][<][ 	]*/, "", comment); 
+  sub(/.*[\/][*][*][<][ 	]*/, "", comment);
   sub(/[ 	]*[*][\/].*/, "", comment);
   sub(/[ 	]+/, " ", comment);
 
@@ -132,12 +132,12 @@
     if (name2 != name && name2 != tprefix "_" name) {
       print name " mismatch with " comment " (" real ")" > "/dev/stderr";
     }
-    
+
     hash = name_hash(parts[1]);
 
     hashed[name] = hash;
 
-    if (comment !~ /header/) { 
+    if (comment !~ /header/) {
       comment = comment " header";
     }
   }
@@ -149,13 +149,13 @@
   COMMENT = toupper(comment);
 
   # Store the various forms into an array for the footer processing
-  N++; 
-  hashes[N] = hash; 
+  N++;
+  hashes[N] = hash;
   names[N] = name;
-  NAMES[N] = NAME; 
-  comments[N] = comment; 
-  Comments[N] = comment; 
-  COMMENTS[N] = COMMENT; 
+  NAMES[N] = NAME;
+  comments[N] = comment;
+  Comments[N] = comment;
+  COMMENTS[N] = COMMENT;
 
   symbols[name] = comment;
   if (since) {
@@ -165,8 +165,8 @@
   expr = (without_experimental > 0 && do_hash);
   if (expr) {
     printf "%s is experimental\n", Comment;
-  }    
-  
+  }
+
   experimental[N] = expr;
 
   if (PR) {
@@ -190,7 +190,7 @@
   #
   if (p) {
     gsub(/#hash#/, hash, p);
-    gsub(/#xxxxxx#/, name, p); 
+    gsub(/#xxxxxx#/, name, p);
     gsub(/#XXXXXX#/, NAME, p);
     gsub(/#xxxxxxx_xxxxxxx#/, comment, p);
     gsub(/#Xxxxxxx_Xxxxxxx#/, Comment, p);
@@ -203,17 +203,17 @@
       # Remove line with #version#
       gsub(/\n[^#\n]*#version#[^\n]*/, "", p);
     }
-    	    
+
     print p > PR;
   }
 }
 
-# 
+#
 # Repeat each line in the footer containing the magic replacement
 # pattern with an instance of all headers
 #
 function process_footer (text)
-{ 
+{
   if (!match(tolower(text), /#(xxxxxx(x_xxxxxxx)?|hash)#/)) {
     n = length(text);
     while (substr(text, n) == "\n") {
@@ -224,7 +224,7 @@
       print text > PR;
     return;
   }
-  
+
   n = split(text, lines, RS);
 
   for (i = 1; i <= n; i++) {
@@ -247,7 +247,7 @@
 	gsub(/#xxxxxxx_xxxxxxx#/, comments[j], l);
 	gsub(/#Xxxxxxx_Xxxxxxx#/, Comments[j], l);
 	gsub(/#XXXXXXX_XXXXXXX#/, COMMENTS[j], l);
-	gsub(/#xxxxxx#/, names[j], l); 
+	gsub(/#xxxxxx#/, names[j], l);
 	gsub(/#XXXXXX#/, NAMES[j], l);
 	print l > PR;
       }
@@ -272,7 +272,7 @@
     if (line ~ /^#/ || line ~ /^$/)
       continue;
 
-    split(line, tokens,  /[ \t]*=[ \t]*/); 
+    split(line, tokens,  /[ \t]*=[ \t]*/);
     name = tolower(tokens[1]);
     gsub(/-/, "_", name);
     gsub(/,/, " ", name);
@@ -297,7 +297,7 @@
 function templates ()
 {
   if (!auto) {
-    auto = FILENAME; 
+    auto = FILENAME;
 
     if (!prefix) { prefix = module; }
     if (!tprefix) { tprefix = prefix; }
@@ -369,11 +369,11 @@
 
 /^#### EXTRA HEADER LIST STARTS HERE ####$/ { HLIST=1; templates(); }
 HLIST && /^#### DEFAULT HEADER LIST ENDS HERE ####$/ { basic=total; }
-HLIST && /^#### EXPERIMENTAL HEADER LIST STARTS HERE ####$/ { 
+HLIST && /^#### EXPERIMENTAL HEADER LIST STARTS HERE ####$/ {
   without_experimental = total; }
 
-HLIST && /^[a-z]/ { protos($1, $0, 0, $2); 
-  headers[total++] = $1; 
+HLIST && /^[a-z]/ { protos($1, $0, 0, $2);
+  headers[total++] = $1;
   Extra[$1] = extra++;
 }
 /^#### EXTRA HEADER LIST ENDS HERE ####$/ { HLIST=0;  }
@@ -383,14 +383,14 @@
 
 PT && /^ *\/\* === Hash headers end here \*\// { in_header_list=0;}
 
-in_header_list && /^  (sip|rtsp|http|msg|mp)_[a-z_0-9]+_t/ { 
+in_header_list && /^  (sip|rtsp|http|msg|mp)_[a-z_0-9]+_t/ {
   n=$0
-  sub(/;.*$/, "", n);   
+  sub(/;.*$/, "", n);
   sub(/^ *(sip|rtsp|http|msg|mp)_[a-z0-9_]*_t[ 	]*/, "", n);
   sub(/^[*](sip|rtsp|http|msg|mp)_/, "", n);
 
   if ($0 !~ /[\/][*][*][<]/) {
-    getline; 
+    getline;
   }
   if ($0 !~ /[\/][*][*][<]/) {
     printf "msg_protos.awk: header %s is malformed\n", n;
@@ -446,7 +446,7 @@
     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", 
+      printf("  {{ %s_%s_class, msg_offsetof(%s_t, %s_%s) }},\n",
 	     tprefix, unnamed[i], module, prefix, unnamed[i]) > PT;
     }
     if (multipart) {
@@ -456,7 +456,7 @@
       printf("  {{ NULL, 0 }},\n") > PT;
     }
     if (MC_SHORT_SIZE) {
-      printf("  %s_short_forms, \n", module) > PT;      
+      printf("  %s_short_forms, \n", module) > PT;
     }
     else {
       printf("  NULL, \n") > PT;
@@ -488,11 +488,11 @@
 
 	if (i >= ordinary) {
 	  printf("    { %s_%s_class,\n" \
-		 "      msg_offsetof(struct %s, extra[%u])%s }%s\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", 
+	  printf("    { %s_%s_class, msg_offsetof(%s_t, %s_%s)%s }%s\n",
 		 tprefix, n, module, prefix, n, flags, c) > PT;
 	}
 
@@ -520,7 +520,7 @@
     if (multipart)
       protos("multipart", "/**< Multipart payload */", -7);
   }
-    
+
   if (PR) {
     process_footer(footer);
   }
@@ -547,17 +547,17 @@
 
     if (MC_SHORT_SIZE) {
       printf("static msg_href_t const " \
-	     "%s_short_forms[MC_SHORT_SIZE] = \n{\n", 
-	     module) > PT;      
+	     "%s_short_forms[MC_SHORT_SIZE] = \n{\n",
+	     module) > PT;
 
       for (i = 1; i <= MC_SHORT_SIZE; i = i + 1) {
 	c = (i == MC_SHORT_SIZE) ? "" : ",";
 	if (i in shorts) {
 	  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), 
+
+	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;
 	}
@@ -566,7 +566,7 @@
 	    > PT;
 	}
       }
-      printf("};\n\n") > PT;      
+      printf("};\n\n") > PT;
     }
 
     # printf("extern msg_hclass_t msg_multipart_class[];\n\n") > PT;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c	Tue Dec 23 07:37:03 2008
@@ -209,7 +209,7 @@
 	/* realloc and cut down buffer */
 	size_t new_size;
 	void *new_data;
-	
+
 	if (eos)
 	  new_size = mb->mb_commit + 1;
 	else
@@ -324,11 +324,11 @@
  * blocks, so the caller should allocate at least two elements for the I/O
  * vector @a vec.
  *
- * @param[in]  msg     message object 
- * @param[out] vec     I/O vector 
- * @param[in]  veclen  available length of @a vec 
+ * @param[in]  msg     message object
+ * @param[out] vec     I/O vector
+ * @param[in]  veclen  available length of @a vec
  * @param[in]  n       number of possibly available bytes 
- * @param[in]  exact   true if data ends at message boundary 
+ * @param[in]  exact   true if data ends at message boundary
  *
  * @return
  * The length of I/O vector to
@@ -815,7 +815,7 @@
 su_inline int extract_incomplete_chunks(msg_t *, int eos);
 static issize_t extract_first(msg_t *, msg_pub_t *,
 			    char b[], isize_t bsiz, int eos);
-su_inline issize_t extract_next(msg_t *, msg_pub_t *, char *, isize_t bsiz, 
+su_inline issize_t extract_next(msg_t *, msg_pub_t *, char *, isize_t bsiz,
 				  int eos, int copy);
 static issize_t extract_header(msg_t *, msg_pub_t*,
 			     char b[], isize_t bsiz, int eos, int copy);
@@ -992,7 +992,7 @@
 
 /* Extract header or message body */
 su_inline issize_t
-extract_next(msg_t *msg, msg_pub_t *mo, char *b, isize_t bsiz, 
+extract_next(msg_t *msg, msg_pub_t *mo, char *b, isize_t bsiz,
 	     int eos, int copy)
 {
   if (IS_CRLF(b[0]))
@@ -1002,7 +1002,7 @@
 }
 
 /** Extract a header. */
-issize_t msg_extract_header(msg_t *msg, msg_pub_t *mo, 
+issize_t msg_extract_header(msg_t *msg, msg_pub_t *mo,
 			   char b[], isize_t bsiz, int eos)
 {
   return extract_header(msg, mo, b, bsiz, eos, 0);
@@ -1187,16 +1187,16 @@
   return h;
 }
 
-/** Complete this header field and parse next header field. 
+/** Complete this header field and parse next header field.
  *
  * This function completes parsing a multi-field header like @Accept,
- * @Contact, @Via or @Warning. It scans for the next header field and 
+ * @Contact, @Via or @Warning. It scans for the next header field and
  * if one is found, it calls the parsing function recursively.
  *
- * @param home 	 memory home used ot allocate 
+ * @param home 	 memory home used ot allocate
  *             	 new header structures and parameter lists
  * @param prev 	 pointer to header structure already parsed
- * @param s    	 header content to parse; should point to the area after 
+ * @param s    	 header content to parse; should point to the area after
  *             	 current header field (either end of line or to a comma
  *             	 separating header fields)
  * @param slen 	 ignored
@@ -1206,7 +1206,7 @@
  * @retval >= 0 when successful
  * @retval -1 upon an error
  */
-issize_t msg_parse_next_field(su_home_t *home, msg_header_t *prev, 
+issize_t msg_parse_next_field(su_home_t *home, msg_header_t *prev,
 			      char *s, isize_t slen)
 {
   msg_hclass_t *hc = prev->sh_class;
@@ -1224,7 +1224,7 @@
 
   if (*s == 0)
     return 0;
-  
+
   h = msg_header_alloc(home, hc, 0);
   if (!h)
     return -1;
@@ -1764,19 +1764,19 @@
 
 /** Convert a message to a string.
  *
- * A message is encoded and the encoding result is returned as a string. 
+ * A message is encoded and the encoding result is returned as a string.
  * Because the message may contain binary payload (or NUL in headers), the
  * message length is returned separately in @a *return_len, too.
  *
- * Note that the message is serialized as a side effect. 
+ * Note that the message is serialized as a side effect.
  *
  * @param home memory home used to allocate the string
  * @param msg  message to encode
  * @param pub  message object to encode (may be NULL)
  * @param flags flags used when encoding
  * @param return_len return-value parameter for encoded message length
- * 
- * @return Encoding result as a C string. 
+ *
+ * @return Encoding result as a C string.
  *
  * @since New in @VERSION_1_12_4
  *
@@ -1843,7 +1843,7 @@
       b2 = su_realloc(home, b, bsiz);
 
       if (b2 == NULL) {
-	errno = ENOMEM; 
+	errno = ENOMEM;
 	su_free(home, b);
 	return NULL;
       }
@@ -2110,8 +2110,8 @@
  * Headers are either inserted just before the payload, or after the first
  * line, depending on their type.
  *
- * @param[in]     msg  message object 
- * @param[in,out] pub  public message structure 
+ * @param[in]     msg  message object
+ * @param[in,out] pub  public message structure
  * @param prepend if true, add before same type of headers (instead after them)
  * @param head head of chain
  * @param h    header to insert
@@ -2128,7 +2128,7 @@
   msg_header_t **hh;
   msg_header_t **separator;
   msg_header_t **payload;
-  
+
   assert(msg && pub && head && h);
 
   mc = msg->m_class;
@@ -2523,7 +2523,7 @@
   *hh = h;
 }
 
-static int _msg_header_add_list_items(msg_t *msg, 
+static int _msg_header_add_list_items(msg_t *msg,
 				      msg_header_t **hh,
 				      msg_header_t const *src);
 
@@ -2658,7 +2658,7 @@
 }
 
 /* Add list items */
-static int _msg_header_add_list_items(msg_t *msg, 
+static int _msg_header_add_list_items(msg_t *msg,
 				      msg_header_t **hh,
 				      msg_header_t const *src)
 {
@@ -2667,17 +2667,17 @@
 
   if (!s || !*s)
     return 0;
-  
+
   msg_fragment_clear(h->sh_common);
-  
+
   /* Remove empty headers */
   for (hh = &h->sh_next; *hh; *hh = (*hh)->sh_next)
     msg_chain_remove(msg, *hh);
-  
+
   if (msg_header_join_items(msg_home(msg), h->sh_common, src->sh_common, 1)
       < 0)
     return -1;
-  
+
   return 0;
 }
 
@@ -2801,12 +2801,12 @@
 
   return msg_header_parse_str(msg, pub, s);
 }
-  
+
 /**Add string to message.
  *
  * Parse a string containing headers (or a message body, if the string
  * starts with linefeed) and add resulting header objects to the message
- * object. 
+ * object.
  *
  * @param msg  message object
  * @param pub  message header structure where heades are added (may be NULL)
@@ -2816,7 +2816,7 @@
  * @retval -1 upon an error
  *
  * @sa msg_header_add_str(), url_headers_as_string()
- * 
+ *
  * @since New in @VERSION_1_12_4.
  */
 int msg_header_parse_str(msg_t *msg,
@@ -2880,7 +2880,7 @@
 
   assert(msg);
 
-  if (msg == NULL || h == NULL || h == MSG_HEADER_NONE || 
+  if (msg == NULL || h == NULL || h == MSG_HEADER_NONE ||
       h->sh_class == NULL)
     return -1;
   if (pub == NULL)
@@ -2906,7 +2906,7 @@
 {
   msg_header_t **hh, **hh0;
 
-  if (msg == NULL || h == NULL || h == MSG_HEADER_NONE || 
+  if (msg == NULL || h == NULL || h == MSG_HEADER_NONE ||
       h->sh_class == NULL)
     return -1;
   if (pub == NULL)
@@ -2955,7 +2955,7 @@
   msg_header_t **hh, **hh0;
   void const *data;
 
-  if (msg == NULL || h == NULL || h == MSG_HEADER_NONE || 
+  if (msg == NULL || h == NULL || h == MSG_HEADER_NONE ||
       h->sh_class == NULL)
     return -1;
   if (pub == NULL)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c	Tue Dec 23 07:37:03 2008
@@ -102,7 +102,7 @@
  * in @a return_token, and updates the @a ss to the end of token and
  * possible whitespace.
  */
-issize_t msg_token_d(char **ss, char const **return_token) 
+issize_t msg_token_d(char **ss, char const **return_token)
 {
   char *s = *ss;
   size_t n = span_token(s);
@@ -131,7 +131,7 @@
   uint32_t value;
   unsigned digit;
 
-  if (!IS_DIGIT(*s))	
+  if (!IS_DIGIT(*s))
     return -1;
 
   for (value = 0; IS_DIGIT(*s); s++) {
@@ -169,26 +169,26 @@
  * list.
  *
  * The function @b must be passed a scanning function @a scanner. The
- * scanning function scans for a legitimate list item, for example, a token. 
+ * scanning function scans for a legitimate list item, for example, a token.
  * It should also compact the list item, for instance, if the item consists
  * of @c name=value parameter definitions it should remove whitespace around
  * "=" sign. The scanning function returns the length of the scanned item,
  * including any linear whitespace after it.
  *
- * @param[in]     home    memory home for allocating list pointers 
- * @param[in,out] ss      pointer to pointer to string to be parsed 
+ * @param[in]     home    memory home for allocating list pointers
+ * @param[in,out] ss      pointer to pointer to string to be parsed
  * @param[in,out] append_list  pointer to list
  *                             where parsed list items are appended
- * @param[in]     sep     separator character 
+ * @param[in]     sep     separator character
  * @param[in]     scanner pointer to function for scanning a single item
- * 
+ *
  * @retval 0  if successful.
  * @retval -1 upon an error.
  */
-issize_t msg_any_list_d(su_home_t *home, 
-			char **ss, 
+issize_t msg_any_list_d(su_home_t *home,
+			char **ss,
 			msg_param_t **append_list,
-			issize_t (*scanner)(char *s), 
+			issize_t (*scanner)(char *s),
 			int sep)
 {
   char const *stack[MSG_N_PARAMS];
@@ -232,7 +232,7 @@
 	  goto error;
 	list = re_list;
       }
-      
+
       list[n++] = s;
       s += tlen;
     }
@@ -240,7 +240,7 @@
     if (*s == sep) {
       *s++ = '\0';
       skip_lws(&s);
-    } 
+    }
     else if (*s)
       break;
   }
@@ -278,11 +278,11 @@
  * This function compacts the scanned value. It removes the
  * whitespace around equal sign "=" by moving the equal sign character and
  * value towards name.
- * 
- * If there is whitespace within the scanned value or after it, 
+ *
+ * If there is whitespace within the scanned value or after it,
  * NUL-terminates the scanned attribute.
  *
- * @retval > 0 number of characters scanned, 
+ * @retval > 0 number of characters scanned,
  *             including the whitespace within the value
  * @retval -1 upon an error
  */
@@ -313,9 +313,9 @@
       v = s; s += qlen;
     }
     else {
-      v = s; 
+      v = s;
       skip_param(&s);
-      if (s == v) 
+      if (s == v)
 	return -1;
     }
 
@@ -339,16 +339,16 @@
  *  av-pair = token ["=" ( value / quoted-string) ]        ; optional value
  * @endcode
  *
- * @param[in]     home      pointer to a memory home 
- * @param[in,out] ss        pointer to string at the start of parameter list 
+ * @param[in]     home      pointer to a memory home
+ * @param[in,out] ss        pointer to string at the start of parameter list
  * @param[in,out] append_list  pointer to list
  *                             where parsed list items are appended
  *
  * @retval >= 0 if successful
  * @retval -1 upon an error
  */
-issize_t msg_avlist_d(su_home_t *home, 
-		      char **ss, 
+issize_t msg_avlist_d(su_home_t *home,
+		      char **ss,
 		      msg_param_t const **append_list)
 {
   char const *stack[MSG_N_PARAMS];
@@ -369,7 +369,7 @@
     params = stack;
     N = MSG_PARAMS_NUM(1);
   }
-  
+
   for (;;) {
     char *p;
     size_t tlen;
@@ -398,9 +398,9 @@
 	v = s; s += qlen;
       }
       else {
-	v = s; 
+	v = s;
 	skip_param(&s);
-	if (s == v) 
+	if (s == v)
 	  goto error;
       }
       if (p + tlen + 1 != v) {
@@ -440,7 +440,7 @@
   }
   else if (n == N) {
     /* Reallocate params */
-    char **nparams = su_alloc(home, 
+    char **nparams = su_alloc(home,
 			      (N = MSG_PARAMS_NUM(N + 1)) * sizeof(*params));
     if (!nparams) {
       goto error;
@@ -467,8 +467,8 @@
  *  *(";" token [ "=" (token | quoted-string)]).
  * @endcode
  *
- * @param[in]     home      pointer to a memory home 
- * @param[in,out] ss        pointer to string at the start of parameter list 
+ * @param[in]     home      pointer to a memory home
+ * @param[in,out] ss        pointer to string at the start of parameter list
  * @param[in,out] append_list  pointer to list
  *                             where parsed list items are appended
  *
@@ -477,8 +477,8 @@
  *
  * @sa msg_avlist_d()
  */
-issize_t msg_params_d(su_home_t *home, 
-		      char **ss, 
+issize_t msg_params_d(su_home_t *home,
+		      char **ss,
 		      msg_param_t const **append_list)
 {
   if (**ss == ';') {
@@ -487,7 +487,7 @@
     return msg_avlist_d(home, ss, append_list);
   }
 
-  if (IS_LWS(**ss)) { 
+  if (IS_LWS(**ss)) {
     *(*ss)++ = '\0'; skip_lws(ss);
   }
 
@@ -501,7 +501,7 @@
   char *end = b + bsiz, *b0 = b;
   msg_param_t p;
 
-  if (pparams) 
+  if (pparams)
     for (i = 0; (p = pparams[i]); i++) {
       if (p[0]) {
 	MSG_CHAR_E(b, end, ';');
@@ -537,13 +537,13 @@
     MSG_STRING_DUP(b, pp[i], s[i]);
   }
   pp[i] = NULL;
- 
+
   assert(b <= end); (void)end;
- 
+
   *d = (msg_param_t const *)pp;
 
   return b;
-} 
+}
 
 
 /** Parse a comma-separated list.
@@ -565,18 +565,18 @@
  * By default, the scanning function accepts tokens, quoted strings or
  * separators (except comma, of course).
  *
- * @param[in]     home    memory home for allocating list pointers 
- * @param[in,out] ss      pointer to pointer to string to be parsed 
+ * @param[in]     home    memory home for allocating list pointers
+ * @param[in,out] ss      pointer to pointer to string to be parsed
  * @param[in,out] append_list  pointer to list
  *                             where parsed list items are appended
- * @param[in]     scanner pointer to function scanning a single item 
+ * @param[in]     scanner pointer to function scanning a single item
  *                        (optional)
- * 
+ *
  * @retval 0  if successful.
  * @retval -1 upon an error.
  */
-issize_t msg_commalist_d(su_home_t *home, 
-			 char **ss, 
+issize_t msg_commalist_d(su_home_t *home,
+			 char **ss,
 			 msg_param_t **append_list,
 			 issize_t (*scanner)(char *s))
 {
@@ -603,7 +603,7 @@
 {
   size_t tlen;
   char *s, *p;
-  
+
   s = p = start;
 
   if (s[0] == ',')
@@ -613,22 +613,22 @@
     /* Grab next section - token, quoted string, or separator character */
     char c = *s;
 
-    if (IS_TOKEN(c)) 
+    if (IS_TOKEN(c))
       tlen = span_token(s);
     else if (c == '"')
       tlen = span_quoted(s);
     else /* if (IS_SEPARATOR(c)) */
       tlen = 1;
-    
+
     if (tlen == 0)
       return -1;
 
     if (p != s)
       memmove(p, s, tlen);	/* Move section to end of paramexter */
     p += tlen; s += tlen;
-    
+
     skip_lws(&s);		/* Skip possible LWS */
-    
+
     if (*s == '\0' || *s == ',') {		/* Test for possible end */
       if (p != s) *p = '\0';
       return s - start;
@@ -661,15 +661,15 @@
 
   if (return_comment)
     *return_comment = s;
-      
+
   while (level) switch (*s++) {
   case '(': level++; break;
   case ')': level--; break;
   case '\0': /* ERROR */ return -1;
   }
-      
+
   assert(s[-1] == ')');
-      
+
   s[-1] = '\0';
   skip_lws(&s);
   *ss = s;
@@ -730,12 +730,12 @@
  * string via @a ss, and pointers to which parsed host and port are assigned
  * via @a hhost and @a pport, respectively. The value-result parameter @a
  * *pport must be initialized to default value (e.g., NULL).
- * 
+ *
  * @param ss    pointer to pointer to string to be parsed
  * @param return_host value-result parameter for @e host
  * @param return_port value-result parameter for @e port
 
- * @return 
+ * @return
  * Returns zero when successful, and a negative value upon an error. The
  * parsed values for host and port are assigned via @a return_host and @a
  * return_port, respectively. The function also updates the pointer @a *ss,
@@ -747,15 +747,15 @@
  * NUL-terminated.  The calling function @b must NUL terminate the value by
  * setting the @a **ss to NUL after first examining its value.
  */
-int msg_hostport_d(char **ss, 
-		   char const **return_host, 
+int msg_hostport_d(char **ss,
+		   char const **return_host,
 		   char const **return_port)
 {
   char *host, *s = *ss;
   char *port = NULL;
 
   /* Host name */
-  host = s; 
+  host = s;
   if (s[0] != '[') {
     skip_token(&s); if (host == s) return -1;
   }
@@ -785,7 +785,7 @@
 
   *return_host = host;
   *return_port = port;
-  
+
   *ss = s;
 
   return 0;
@@ -816,7 +816,7 @@
 }
 
 /**Modify a parameter value or list item in a header.
- * 
+ *
  * A header parameter @a param can be just a C-string (@a is_item > 0), or
  * it can have internal format <i>name [ "=" value]</i>. In the latter case,
  * the value part following = is ignored when replacing or removing the
@@ -834,11 +834,11 @@
  *                  - 1 add
  *
  * @retval 1 if parameter was replaced or removed successfully
- * @retval 0 if parameter was added successfully, 
+ * @retval 0 if parameter was added successfully,
  *           or there was nothing to remove
  * @retval -1 upon an error
  */
-static 
+static
 int msg_header_param_modify(su_home_t *home, msg_common_t *h,
 			    char const *param,
 			    int is_item,
@@ -855,12 +855,12 @@
 
   plen = is_item > 0 ? strlen(param) : strcspn(param, "=");
   n = 0;
-  
+
   if (params) {
     /* Existing list, try to replace or remove  */
     for (; params[n]; n++) {
       char const *maybe = params[n];
-      
+
       if (remove_replace_add > 0)
 	continue;
 
@@ -877,7 +877,7 @@
       }
     }
   }
-  
+
   /* Not found? */
   if (!params || !params[n]) {
     if (remove_replace_add < 0)
@@ -885,22 +885,22 @@
     else
       remove_replace_add = 1;	/* Add instead of replace */
   }
-  
+
   if (remove_replace_add < 0) { /* Remove */
-    for (; params[n]; n++) 
+    for (; params[n]; n++)
       params[n] = params[n + 1];
   }
   else {
     if (remove_replace_add > 0) { /* Add */
       size_t m_before = MSG_PARAMS_NUM(n + 1);
       size_t m_after =  MSG_PARAMS_NUM(n + 2);
-      
+
       assert(!params || !params[n]);
-      
+
       if (m_before != m_after || !params) {
 	msg_param_t *p;
 	/* XXX - we should know when to do realloc */
-	p = su_alloc(home, m_after * sizeof(*p)); 
+	p = su_alloc(home, m_after * sizeof(*p));
 	if (!p) return -1;
 	if (n > 0)
 	  memcpy(p, params, n * sizeof(p[0]));
@@ -908,25 +908,25 @@
       }
       params[n + 1] = NULL;
     }
-    
+
     params[n] = param;	/* Add .. or replace */
   }
-  
+
   msg_fragment_clear(h);
 
   if (h->h_class->hc_update) {
     /* Update shortcuts */
     size_t namelen;
     char const *name, *value;
-    
+
     name = param;
     namelen = strcspn(name, "=");
-    
+
     if (remove_replace_add < 0)
       value = NULL;
     else
       value = param + namelen + (name[namelen] == '=');
-    
+
     h->h_class->hc_update(h, name, namelen, value);
   }
 
@@ -958,21 +958,21 @@
  * @retval 0 if parameter was added
  * @retval -1 upon an error
  *
- * @sa msg_header_replace_param(), msg_header_remove_param(), 
+ * @sa msg_header_replace_param(), msg_header_remove_param(),
  * msg_header_update_params(),
- * #msg_common_t, #msg_header_t, 
+ * #msg_common_t, #msg_header_t,
  * #msg_hclass_t, msg_hclass_t::hc_params, msg_hclass_t::hc_update
  */
 int msg_header_add_param(su_home_t *home, msg_common_t *h, char const *param)
 {
-  return msg_header_param_modify(home, h, param, 
-				 0 /* case-insensitive name=value */, 
+  return msg_header_param_modify(home, h, param,
+				 0 /* case-insensitive name=value */,
 				 1 /* add */);
 }
 
 
 
-/** Replace or add a parameter to a header. 
+/** Replace or add a parameter to a header.
  *
  * A header parameter @a param is a string of format <i>name "=" value</i>
  * or just name. The value part following "=" is ignored when selecting a
@@ -994,17 +994,17 @@
  * @retval 1 if parameter was replaced
  * @retval -1 upon an error
  *
- * @sa msg_header_add_param(), msg_header_remove_param(), 
+ * @sa msg_header_add_param(), msg_header_remove_param(),
  * msg_header_update_params(),
- * #msg_common_t, #msg_header_t, 
+ * #msg_common_t, #msg_header_t,
  * #msg_hclass_t, msg_hclass_t::hc_params, msg_hclass_t::hc_update
  */
-int msg_header_replace_param(su_home_t *home, 
-			     msg_common_t *h, 
+int msg_header_replace_param(su_home_t *home,
+			     msg_common_t *h,
 			     char const *param)
 {
-  return msg_header_param_modify(home, h, param, 
-				 0 /* case-insensitive name=value */, 
+  return msg_header_param_modify(home, h, param,
+				 0 /* case-insensitive name=value */,
 				 0 /* replace */);
 }
 
@@ -1028,13 +1028,13 @@
  *
  * @sa msg_header_add_param(), msg_header_replace_param(),
  * msg_header_update_params(),
- * #msg_common_t, #msg_header_t, 
+ * #msg_common_t, #msg_header_t,
  * #msg_hclass_t, msg_hclass_t::hc_params, msg_hclass_t::hc_update
  */
 int msg_header_remove_param(msg_common_t *h, char const *name)
 {
-  return msg_header_param_modify(NULL, h, name, 
-				 0 /* case-insensitive name=value */, 
+  return msg_header_param_modify(NULL, h, name,
+				 0 /* case-insensitive name=value */,
 				 -1 /* remove */);
 }
 
@@ -1053,7 +1053,7 @@
  *
  * @sa msg_header_add_param(), msg_header_replace_param(),
  * msg_header_update_params(),
- * #msg_common_t, #msg_header_t, 
+ * #msg_common_t, #msg_header_t,
  * #msg_hclass_t, msg_hclass_t::hc_params, msg_hclass_t::hc_update
  */
 int msg_header_update_params(msg_common_t *h, int clear)
@@ -1065,7 +1065,7 @@
   msg_param_t const *params;
   size_t n;
   char const *p, *v;
-  
+
   if (h == NULL)
     return errno = EFAULT, -1;
 
@@ -1107,13 +1107,13 @@
  *
  * @since New in @VERSION_1_12_4
  *
- * @sa msg_header_replace_item(), msg_header_remove_item(), 
+ * @sa msg_header_replace_item(), msg_header_remove_item(),
  * @Allow, @AllowEvents
  */
 char const *msg_header_find_item(msg_common_t const *h, char const *item)
 {
   if (h && h->h_class->hc_params) {
-    char const * const * items = 
+    char const * const * items =
       *(char const * const * const *)
       ((char *)h + h->h_class->hc_params);
 
@@ -1148,22 +1148,22 @@
  * @since New in @VERSION_1_12_4.
  *
  * @sa msg_header_remove_item(), @Allow, @AllowEvents,
- * msg_header_replace_param(), msg_header_remove_param(), 
+ * msg_header_replace_param(), msg_header_remove_param(),
  * #msg_common_t, #msg_header_t, #msg_list_t
  * #msg_hclass_t, msg_hclass_t::hc_params
  */
-int msg_header_replace_item(su_home_t *home, 
-			    msg_common_t *h, 
+int msg_header_replace_item(su_home_t *home,
+			    msg_common_t *h,
 			    char const *item)
 {
-  return msg_header_param_modify(home, h, item, 
-				 1 /* string item */, 
+  return msg_header_param_modify(home, h, item,
+				 1 /* string item */,
 				 0 /* replace */);
 }
 
 /**Remove an item from a header.
  *
- * This function treats a #msg_header_t as set of C strings. The @a item is a 
+ * This function treats a #msg_header_t as set of C strings. The @a item is a
  * C string. If identical string is found from the list, it is removed.
  *
  * The shortcuts, if any, to item values are updated accordingly.
@@ -1178,14 +1178,14 @@
  * @since New in @VERSION_1_12_4.
  *
  * @sa msg_header_replace_item(), @Allow, @AllowEvents,
- * msg_header_replace_param(), msg_header_remove_param(), 
+ * msg_header_replace_param(), msg_header_remove_param(),
  * #msg_common_t, #msg_header_t, #msg_list_t
  * #msg_hclass_t, msg_hclass_t::hc_params
  */
 int msg_header_remove_item(msg_common_t *h, char const *name)
 {
-  return msg_header_param_modify(NULL, h, name, 
-				 1 /* item */, 
+  return msg_header_param_modify(NULL, h, name,
+				 1 /* item */,
 				 -1 /* remove */);
 }
 
@@ -1193,11 +1193,11 @@
 /** Find a parameter from a parameter list.
  *
  * Searches for given parameter @a token from the parameter list. If
- * parameter is found, it returns a non-NULL pointer to the parameter value. 
+ * parameter is found, it returns a non-NULL pointer to the parameter value.
  * If there is no value for the parameter (the parameter is of form "name"
  * or "name="), the returned pointer points to a NUL character.
  *
- * @param params list (or vector) of parameters 
+ * @param params list (or vector) of parameters
  * @param token  parameter name (with or without "=" sign)
  *
  * @return
@@ -1230,7 +1230,7 @@
  * parameter is found, it returns a non-NULL pointer to the item containing
  * the parameter.
  *
- * @param params list (or vector) of parameters 
+ * @param params list (or vector) of parameters
  * @param token  parameter name (with or without "=" sign)
  *
  * @return
@@ -1259,7 +1259,7 @@
   return NULL;
 }
 
-/** Replace or add a parameter from a list. 
+/** Replace or add a parameter from a list.
  *
  * A non-NULL parameter list must have been created by msg_params_d()
  * or by msg_params_dup().
@@ -1275,7 +1275,7 @@
  * @retval -1 upon an error
  */
 int msg_params_replace(su_home_t *home,
-		       msg_param_t **inout_params, 
+		       msg_param_t **inout_params,
 		       msg_param_t param)
 {
   msg_param_t *params;
@@ -1297,7 +1297,7 @@
 
       if (!(strncasecmp(maybe, param, n))) {
 	if (maybe[n] == '=' || maybe[n] == 0) {
-	  params[i] = param;	
+	  params[i] = param;
 	  return 1;
 	}
       }
@@ -1308,7 +1308,7 @@
   return msg_params_add(home, inout_params, param);
 }
 
-/** Remove a parameter from a list. 
+/** Remove a parameter from a list.
  *
  * @retval 1 if parameter was removed
  * @retval 0 if parameter was not found
@@ -1369,7 +1369,7 @@
  * @param inout_params   pointer to pointer to parameter list
  * @param param     parameter to be added
  *
- * @retval 0 if parameter was added 
+ * @retval 0 if parameter was added
  * @retval -1 upon an error
  */
 int msg_params_add(su_home_t *home,
@@ -1377,7 +1377,7 @@
 		   msg_param_t param)
 {
   size_t n, m_before, m_after;
-  msg_param_t *p = *inout_params;  
+  msg_param_t *p = *inout_params;
 
   if (param == NULL)
     return -1;
@@ -1388,9 +1388,9 @@
 
   m_before = MSG_PARAMS_NUM(n + 1);
   m_after =  MSG_PARAMS_NUM(n + 2);
-  
+
   if (m_before != m_after || !p) {
-    p = su_alloc(home, m_after * sizeof(*p)); 
+    p = su_alloc(home, m_after * sizeof(*p));
     assert(p); if (!p) return -1;
     if (n)
       memcpy(p, *inout_params, n * sizeof(*p));
@@ -1403,7 +1403,7 @@
   return 0;
 }
 
-static 
+static
 int msg_param_prune(msg_param_t const d[], msg_param_t p, unsigned prune)
 {
   size_t i, nlen;
@@ -1414,10 +1414,10 @@
     nlen = 0;
 
   for (i = 0; d[i]; i++) {
-    if ((prune == 1 && 
-	 strncasecmp(p, d[i], nlen) == 0 
+    if ((prune == 1 &&
+	 strncasecmp(p, d[i], nlen) == 0
 	 && (d[i][nlen] == '=' || d[i][nlen] == '\0'))
-	|| 
+	||
 	(prune == 2 && strcasecmp(p, d[i]) == 0)
 	||
 	(prune == 3 && strcmp(p, d[i]) == 0))
@@ -1436,10 +1436,10 @@
  * @param home    memory home
  * @param dst     pointer to pointer to destination parameter list
  * @param src     source list
- * @param prune   prune duplicates 
+ * @param prune   prune duplicates
  * @param dup     duplicate parameters in src list
  *
- * @par Pruning 
+ * @par Pruning
  * <table>
  * <tr><td>0<td>do not prune</tr>
  * <tr><td>1<td>prune parameters with identical names</tr>
@@ -1458,7 +1458,7 @@
 			 int dup)
 {
   size_t n, m, n_before, n_after, pruned, total = 0;
-  msg_param_t *d = *dst;  
+  msg_param_t *d = *dst;
 
   if (prune > 3)
     return -1;
@@ -1483,9 +1483,9 @@
   }
 
   n_after = MSG_PARAMS_NUM(n + m - pruned + 1);
-  
+
   if (n_before != n_after || !d) {
-    d = su_alloc(home, n_after * sizeof(*d)); 
+    d = su_alloc(home, n_after * sizeof(*d));
     assert(d); if (!d) return -1;
     if (n)
       memcpy(d, *dst, n * sizeof(*d));
@@ -1503,7 +1503,7 @@
       d[n++] = su_strdup(home, src[m]);	/* XXX */
     else
       d[n++] = src[m];
-  }  
+  }
 
   d[n] = NULL;
 
@@ -1605,12 +1605,12 @@
 
   for (m = 0; m < M; m++) {
     d[N++] = memcpy(dup, temp[m], len[m] + 1);
-    
+
     if (update)
       update(dst, dup, len[m], dup + len[m]);
 
     dup += len[m] + 1;
-  }  
+  }
 
   d[N] = NULL;
 
@@ -1627,7 +1627,7 @@
 }
 
 /**Compare parameter lists.
- * 
+ *
  * Compares parameter lists.
  *
  * @param a pointer to a parameter list
@@ -1658,7 +1658,7 @@
 }
 
 
-/** Unquote string 
+/** Unquote string
  *
  * Duplicates the string @a q in unquoted form.
  */
@@ -1681,7 +1681,7 @@
       break;
     m = strcspn(q + n + 2, "\"\\");
     total += m + 1;
-    n += m + 2; 
+    n += m + 2;
   }
 
   if (!(d = su_alloc(home, total + 1)))
@@ -1689,16 +1689,16 @@
 
   for (n = 0;;) {
     m = strcspn(q, "\"\\");
-    memcpy(d + n, q, m); 
+    memcpy(d + n, q, m);
     n += m, q += m;
     if (q[0] == '\0' || q[0] == '"' || q[1] == '\0')
       break;
-    d[n++] = q[1]; 
+    d[n++] = q[1];
     q += 2;
   }
   assert(total == n);
   d[n] = '\0';
-  
+
   return d;
 }
 
@@ -1742,7 +1742,7 @@
   if (b && b + 1 < end)
     *b = '"';
   b++;
-  
+
   for (;*s;) {
     size_t n = strcspn(s, "\"\\");
 
@@ -1783,7 +1783,7 @@
 
   if (hash == 0)
     hash = (unsigned long)-1;
-  
+
   return hash;
 }
 
@@ -1798,14 +1798,14 @@
 }
 
 
-/** Encode a message to the buffer. 
+/** Encode a message to the buffer.
  *
  * The function msg_encode_e encodes a message to a given buffer.
  * It returns the length of the message to be encoded, even if the
  * buffer is too small (just like snprintf() is supposed to do).
  *
  * @param b        buffer (may be NULL)
- * @param size     size of buffer 
+ * @param size     size of buffer
  * @param mo       public message structure (#sip_t, #http_t)
  * @param flags    see #
  */
@@ -1837,7 +1837,7 @@
 /** Encode header contents. */
 issize_t msg_header_field_e(char b[], isize_t bsiz, msg_header_t const *h, int flags)
 {
-  assert(h); assert(h->sh_class); 
+  assert(h); assert(h->sh_class);
 
   return h->sh_class->hc_print(b, bsiz, h, flags);
 }
@@ -1846,7 +1846,7 @@
 msg_header_t **
 msg_header_offset(msg_t const *msg, msg_pub_t const *mo, msg_header_t const *h)
 {
-  if (h == NULL || h->sh_class == NULL) 
+  if (h == NULL || h->sh_class == NULL)
     return NULL;
 
   return msg_hclass_offset(msg->m_class, mo, h->sh_class);
@@ -1871,7 +1871,7 @@
 
   if (hh)
     return *hh;
-  else 
+  else
     return NULL;
 }
 
@@ -1880,7 +1880,7 @@
 /** Generates a random token.
  *
  */
-issize_t msg_random_token(char token[], isize_t tlen, 
+issize_t msg_random_token(char token[], isize_t tlen,
 			  void const *rmemp, isize_t rsize)
 {
   uint32_t random = 0, rword;
@@ -1889,7 +1889,7 @@
   size_t i;
   ssize_t n;
 
-  static char const token_chars[33] = 
+  static char const token_chars[33] =
     /* Create aesthetically pleasing raNDom capS LooK */
     "aBcDeFgHjKmNpQrStUvXyZ0123456789";
 
@@ -1908,7 +1908,7 @@
     else
       return rsize / 5 * 8;
   }
-    
+
   for (i = 0, n = 0; i < tlen;) {
     if (n < 5) {
       if (rsize == 0)
@@ -1931,7 +1931,7 @@
     if (n < 0 || (n == 0 && rsize == 0))
       break;
   }
-  
+
   token[i] = 0;
 
   return i;
@@ -1955,7 +1955,7 @@
  * @param flags message flags (see #msg_flg_user)
  * @param data message text
  * @param len size of message text (if -1, use strlen(data))
- * 
+ *
  * @retval A pointer to a freshly allocated and parsed message.
  *
  * Upon parsing error, the header structure may be left incomplete. The
@@ -1973,7 +1973,7 @@
 
   if (len == -1)
     len = strlen(data);
-  if (len == 0) 
+  if (len == 0)
     return NULL;
 
   msg = msg_create(mc, flags);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c	Tue Dec 23 07:37:03 2008
@@ -58,9 +58,9 @@
 
   assert(t);
 
-  if (!t) { 
-    if (size) b[0] = 0; 
-    return 0; 
+  if (!t) {
+    if (size) b[0] = 0;
+    return 0;
   }
 
   h = (msg_header_t const *)t->t_value;
@@ -103,7 +103,7 @@
   char *b;
   size_t size;
 
-  assert(src); assert(*bb); 
+  assert(src); assert(*bb);
 
   dst->t_tag = src->t_tag;
   dst->t_value = 0L;
@@ -149,8 +149,8 @@
 
 
 /** Convert a string to a header structure based on to the tag. */
-int msghdrtag_scan(tag_type_t tt, su_home_t *home, 
-		   char const *s, 
+int msghdrtag_scan(tag_type_t tt, su_home_t *home,
+		   char const *s,
 		   tag_value_t *return_value)
 {
   msg_hclass_t *hc = (msg_hclass_t *)tt->tt_magic;
@@ -158,19 +158,19 @@
   int retval;
 
   h = msg_header_make(home, hc, s);
-  
+
   if (h)
     *return_value = (tag_value_t)h, retval = 1;
   else
     *return_value = (tag_value_t)NULL, retval = -1;
-  
+
   return retval;
 }
 
 
 tagi_t *msgstrtag_filter(tagi_t *dst,
 			 tagi_t const f[],
-			 tagi_t const *src, 
+			 tagi_t const *src,
 			 void **bb);
 
 int msgobjtag_snprintf(tagi_t const *t, char b[], size_t size)
@@ -179,9 +179,9 @@
 
   assert(t);
 
-  if (!t || !t->t_value) { 
-    if (size) b[0] = 0; 
-    return 0; 
+  if (!t || !t->t_value) {
+    if (size) b[0] = 0;
+    return 0;
   }
 
   mo = (msg_pub_t *)t->t_value;
@@ -230,7 +230,7 @@
   msg_header_t const *o;
   char *b;
 
-  assert(src); assert(*bb); 
+  assert(src); assert(*bb);
 
   omo = (msg_pub_t const *)src->t_value;
 
@@ -320,7 +320,7 @@
   msg_header_t const *o;
   char *b;
 
-  assert(src); assert(*bb); 
+  assert(src); assert(*bb);
 
   omo = (msg_pub_t const *)src->t_value;
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg.h	Tue Dec 23 07:37:03 2008
@@ -55,7 +55,7 @@
 
 SOFIAPUBFUN msg_t *msg_ref_create(msg_t *);
 SOFIAPUBFUN void msg_ref_destroy(msg_t *);
-     
+
 SOFIAPUBFUN msg_pub_t *msg_public(msg_t const *msg, void *tag);
 SOFIAPUBFUN msg_pub_t *msg_object(msg_t const *msg);
 SOFIAPUBFUN msg_mclass_t const *msg_mclass(msg_t const *msg);
@@ -103,9 +103,9 @@
   /** Cache a copy of headers when parsing. */
   MSG_FLG_EXTRACT_COPY = (1<<2),
   /** Print comma-separated lists instead of separate headers */
-  MSG_FLG_COMMA_LISTS = (1<<3),	
+  MSG_FLG_COMMA_LISTS = (1<<3),
 
-  /**Use mailbox format when parsing - in mailbox format 
+  /**Use mailbox format when parsing - in mailbox format
    * message has no body unless Content-Length header is present.
    */
   MSG_FLG_MAILBOX = (1<<4),

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_addr.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_addr.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_addr.h	Tue Dec 23 07:37:03 2008
@@ -24,10 +24,10 @@
 
 #ifndef MSG_ADDR_H
 /** Defined when <sofia-sip/msg_addr.h> has been included. */
-#define MSG_ADDR_H 
+#define MSG_ADDR_H
 
 
-/**@file sofia-sip/msg_addr.h 
+/**@file sofia-sip/msg_addr.h
  * @brief Addressing and I/O interface for messages.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -66,8 +66,8 @@
   msg_n_fragments = 8
 };
 
-/** I/O vector type. 
- * @sa msg_recv_iovec(), msg_iovec(), #su_iovec_s, su_vsend(), su_vrecv(). 
+/** I/O vector type.
+ * @sa msg_recv_iovec(), msg_iovec(), #su_iovec_s, su_vsend(), su_vrecv().
  */
 typedef struct su_iovec_s msg_iovec_t;
 #define mv_base siv_base
@@ -88,8 +88,8 @@
 
 SOFIAPUBFUN void msg_clear_committed(msg_t *msg);
 
-SOFIAPUBFUN issize_t msg_buf_external(msg_t *msg, 
-				      usize_t N, 
+SOFIAPUBFUN issize_t msg_buf_external(msg_t *msg,
+				      usize_t N,
 				      usize_t blocksize);
 
 SOFIA_END_DECLS

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_buffer.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_buffer.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_buffer.h	Tue Dec 23 07:37:03 2008
@@ -27,10 +27,10 @@
 #define MSG_BUFFER_H
 
 /**@file sofia-sip/msg_buffer.h
- * @brief Internal buffer management functions. 
- * 
+ * @brief Internal buffer management functions.
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Fri Nov  8 12:23:00 2002 ppessi
  *
  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_date.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_date.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_date.h	Tue Dec 23 07:37:03 2008
@@ -24,16 +24,16 @@
 
 #ifndef MSG_DATE_H
 /** Defined when <sofia-sip/msg_date.h> has been included. */
-#define MSG_DATE_H 
+#define MSG_DATE_H
 
 /**@ingroup msg_parser
- * @file sofia-sip/msg_date.h 
+ * @file sofia-sip/msg_date.h
  * @brief Types and functions for handling dates and times.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Thu Jun  8 19:28:55 2000 ppessi
- * 
+ *
  */
 
 #ifndef SU_TYPES_H

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h	Tue Dec 23 07:37:03 2008
@@ -33,7 +33,7 @@
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Mon Aug 27 15:44:27 2001 ppessi
- * 
+ *
  */
 
 #include <stdarg.h>
@@ -203,13 +203,13 @@
 
 #ifdef SU_HAVE_INLINE
 /** Clear encoded data from header structure. */
-su_inline void msg_fragment_clear(msg_common_t *h) 
+su_inline void msg_fragment_clear(msg_common_t *h)
 {
   h->h_data = NULL, h->h_len = 0;
 }
 
 /** Pointer to header parameters. */
-su_inline 
+su_inline
 msg_param_t **msg_header_params(msg_common_t const *h)
 {
   if (h && h->h_class->hc_params) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass.h	Tue Dec 23 07:37:03 2008
@@ -41,20 +41,20 @@
 
 SOFIA_BEGIN_DECLS
 
-enum { 
+enum {
   /** Default size of hash table */
-  MC_HASH_SIZE = 127, 
+  MC_HASH_SIZE = 127,
   /** Size of short form table */
-  MC_SHORT_SIZE = 'Z' - 'A' + 1 
+  MC_SHORT_SIZE = 'Z' - 'A' + 1
 };
 
 /**Header reference.
  *
- * A header reference object contains a pointer to a 
- * @ref msg_hclass_s "header class" 
+ * A header reference object contains a pointer to a
+ * @ref msg_hclass_s "header class"
  * and a offset to the header objects within the @ref msg_pub_t "public
  * message structure".
- * 
+ *
  * The @a hr_flags field is used to provide classification of headers. For
  * instance, the msg_extract_errors() returns bitwise or of all hr_flags
  * belonging to headers with parsing errors.
@@ -102,7 +102,7 @@
   unsigned      mc_flags;	/**< Default flags */
   unsigned      mc_msize;	/**< Size of public message structure */
   /** Function extracting the message contents. */
-  issize_t    (*mc_extract_body)(msg_t *msg, msg_pub_t *pub, 
+  issize_t    (*mc_extract_body)(msg_t *msg, msg_pub_t *pub,
 				 char b[], isize_t bsiz, int eos);
 
   msg_href_t    mc_request[1];	/**< Request line reference */
@@ -117,7 +117,7 @@
   short         mc_hash_size;	/**< Size of parsing table  */
   short         mc_hash_used;	/**< Number of headers in parsing table */
   /** Hash table for parsing containing reference for each header. */
-  msg_href_t    mc_hash[MC_HASH_SIZE]; 
+  msg_href_t    mc_hash[MC_HASH_SIZE];
 };
 
 enum { msg_mclass_copy = 0, msg_mclass_empty = 1 };
@@ -128,12 +128,12 @@
 SOFIAPUBFUN int msg_mclass_insert(msg_mclass_t *mc, msg_href_t const *hr);
 
 SOFIAPUBFUN
-int msg_mclass_insert_header(msg_mclass_t *mc, 
+int msg_mclass_insert_header(msg_mclass_t *mc,
 			     msg_hclass_t *hc,
 			     unsigned short offset);
 
 SOFIAPUBFUN
-int msg_mclass_insert_with_mask(msg_mclass_t *mc, 
+int msg_mclass_insert_with_mask(msg_mclass_t *mc,
 				msg_hclass_t *hc,
 				unsigned short offset,
 				unsigned short mask);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass_hash.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass_hash.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass_hash.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef MSG_MCLASS_HASH_H
 /** Defined when <sofia-sip/msg_mclass_hash.h> has been included. */
-#define MSG_MCLASS_HASH_H 
+#define MSG_MCLASS_HASH_H
 
 /**@ingroup msg_parser
  * @file sofia-sip/msg_mclass_hash.h
@@ -34,7 +34,7 @@
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Tue Aug 21 16:03:45 2001 ppessi
- * 
+ *
  */
 
 #include <sofia-sip/su_config.h>
@@ -49,7 +49,7 @@
 #define MC_HASH(s, n)     (msg_header_name_hash(s, NULL) % (unsigned)(n))
 
 /** Hash header name */
-su_inline 
+su_inline
 unsigned short msg_header_name_hash(char const *s, isize_t *llen)
 {
   unsigned short hash = 0;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef MSG_MIME_H
 /** Defined when <sofia-sip/msg_mime.h> has been included. */
-#define MSG_MIME_H 
+#define MSG_MIME_H
 
 /**@ingroup msg_mime
  * @file sofia-sip/msg_mime.h
@@ -34,7 +34,7 @@
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Fri Aug 16 19:18:26 EEST 2002 ppessi
- * 
+ *
  */
 
 #ifndef URL_H
@@ -58,7 +58,7 @@
 typedef msg_accept_any_t      	    msg_accept_encoding_t;
 typedef msg_accept_any_t     	    msg_accept_language_t;
 
-typedef struct msg_content_disposition_s 
+typedef struct msg_content_disposition_s
                                     msg_content_disposition_t;
 typedef msg_list_t	      	    msg_content_encoding_t;
 typedef msg_generic_t               msg_content_id_t;
@@ -100,7 +100,7 @@
   char const         *aa_q;	    /**< Value of q parameter */
 };
 
-/**@ingroup msg_content_disposition 
+/**@ingroup msg_content_disposition
  * @brief Structure for @b Content-Disposition header.
  */
 struct msg_content_disposition_s
@@ -208,12 +208,12 @@
 				      char const *content_type,
 				      void const *data,
 				      isize_t dlen);
-SOFIAPUBFUN 
-msg_multipart_t *msg_multipart_parse(su_home_t *home, 
+SOFIAPUBFUN
+msg_multipart_t *msg_multipart_parse(su_home_t *home,
 				     msg_content_type_t const *c,
 				     msg_payload_t *pl);
 SOFIAPUBFUN
-int msg_multipart_complete(su_home_t *home, 
+int msg_multipart_complete(su_home_t *home,
 			   msg_content_type_t *c,
 			   msg_multipart_t *mp);
 SOFIAPUBFUN msg_header_t *msg_multipart_serialize(msg_header_t **head0,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime_protos.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime_protos.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime_protos.h.in	Tue Dec 23 07:37:03 2008
@@ -30,7 +30,7 @@
 
 #ifndef MSG_MIME_PROTOS_H
 /** Defined when <sofia-sip/msg_mime_protos.h> has been included. */
-#define MSG_MIME_PROTOS_H 
+#define MSG_MIME_PROTOS_H
 
 /**@ingroup msg_mime
  * @file sofia-sip/msg_mime_protos.h
@@ -64,13 +64,13 @@
 
 /* Declare internal prototypes for #xxxxxxx_xxxxxxx# */
 
-/**@addtogroup msg_#xxxxxx# 
- * @{ 
+/**@addtogroup msg_#xxxxxx#
+ * @{
  */
 
-enum { 
+enum {
   /** Hash of #xxxxxxx_xxxxxxx#. @internal */
-  msg_#xxxxxx#_hash = #hash# 
+  msg_#xxxxxx#_hash = #hash#
 };
 
 /** Parse a #xxxxxxx_xxxxxxx#. @internal */
@@ -83,43 +83,43 @@
 MSG_DLL msg_dup_f msg_#xxxxxx#_dup_one;
 
 /**Header class for #xxxxxxx_xxxxxxx#.
- * 
- * The header class msg_#xxxxxx#_class defines how a 
+ *
+ * The header class msg_#xxxxxx#_class defines how a
  * #xxxxxxx_xxxxxxx# header is parsed and printed.  It also
  * contains methods used by message parser and other functions
  * to manipulate the #msg_#xxxxxx#_t header structure.
- * 
+ *
  */
 #ifndef msg_#xxxxxx#_class
 MSG_DLL extern msg_hclass_t msg_#xxxxxx#_class[];
 #endif
 
 /**Initializer for an #msg_#xxxxxx#_t structure.
- * 
+ *
  * A static msg_#xxxxxx#_t structure must be initialized
  * with the MSG_#XXXXXX#_INIT() macro. For instance,
- * @code 
- * 
+ * @code
+ *
  *  msg_#xxxxxx#_t msg_#xxxxxx# = MSG_#XXXXXX#_INIT;
- * 
+ *
  * @endcode
  * @HI
  */
 #define MSG_#XXXXXX#_INIT() MSG_HDR_INIT(#xxxxxx#)
 
 /**Initialize an #msg_#xxxxxx#_t structure.
- * 
+ *
  * An #msg_#xxxxxx#_t structure can be initialized with the
  * msg_#xxxxxx#_init() function/macro. For instance,
  * @code
- * 
+ *
  *  msg_#xxxxxx#_t msg_#xxxxxx#;
- * 
+ *
  *  msg_#xxxxxx#_init(&msg_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
- * @param x pointer to #msg_#xxxxxx#_t structure 
+ *
+ * @param x pointer to #msg_#xxxxxx#_t structure
  */
 #if SU_HAVE_INLINE
 su_inline msg_#xxxxxx#_t *msg_#xxxxxx#_init(msg_#xxxxxx#_t x[1])
@@ -132,13 +132,13 @@
 #endif
 
 /**Test if header object is an instance of #msg_#xxxxxx#_t.
- * 
+ *
  * The function msg_is_#xxxxxx#() returns true (nonzero) if
  * the header class is an instance of #xxxxxxx_xxxxxxx#
  * object and false (zero) otherwise.
- * 
+ *
  * @param header pointer to the header structure to be tested
- * 
+ *
  * @return The function msg_is_#xxxxxx#() returns true (nonzero) if the
  * header object is an instance of header #xxxxxxx_xxxxxxx# and false (zero)
  * otherwise.
@@ -155,27 +155,27 @@
 #define msg_#xxxxxx#_p(h) msg_is_#xxxxxx#((h))
 
 /**Duplicate (deep copy) #msg_#xxxxxx#_t.
- * 
+ *
  * The function msg_#xxxxxx#_dup() duplicates a header structure @a
  * header. If the header structure @a header contains a reference
  * (@c header->x_next) to a list of headers, all the headers in the
  * list are duplicated, too.
- * 
+ *
  * @param home   memory home used to allocate new structure
  * @param header header structure to be duplicated
- * 
+ *
  * When duplicating, all parameter lists and non-constant strings
  * attached to the header are copied, too. The function uses given
  * memory @a home to allocate all the memory areas used to copy the
  * header.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = msg_#xxxxxx#_dup(home, msg->msg_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_dup() returns a pointer to the
  * newly duplicated #msg_#xxxxxx#_t header structure, or NULL
@@ -184,44 +184,44 @@
 #if SU_HAVE_INLINE
 su_inline
 #endif
-msg_#xxxxxx#_t *msg_#xxxxxx#_dup(su_home_t *home, 
+msg_#xxxxxx#_t *msg_#xxxxxx#_dup(su_home_t *home,
 				 msg_#xxxxxx#_t const *header);
 
 #if SU_HAVE_INLINE
 su_inline
-msg_#xxxxxx#_t *msg_#xxxxxx#_dup(su_home_t *home, 
+msg_#xxxxxx#_t *msg_#xxxxxx#_dup(su_home_t *home,
 				 msg_#xxxxxx#_t const *header)
 {
   return (msg_#xxxxxx#_t *)
-    msg_header_dup_as(home, msg_#xxxxxx#_class, (msg_header_t const *)header); 
+    msg_header_dup_as(home, msg_#xxxxxx#_class, (msg_header_t const *)header);
 }
 #endif
 
 
 /**Copy an #msg_#xxxxxx#_t header structure.
- * 
+ *
  * The function msg_#xxxxxx#_copy() copies a header structure @a
  * header. If the header structure @a header contains a reference
  * (@c header->h_next) to a list of headers, all the headers in that
  * list are copied, too. The function uses given memory @a home to
  * allocate all the memory areas used to copy the header structure
  * @a header.
- * 
+ *
  * @param home    memory home used to allocate new structure
  * @param header  pointer to the header structure to be duplicated
- * 
+ *
  * When copying, only the header structure and parameter lists
  * attached to it are duplicated. The new header structure retains
  * all the references to the strings within the old @a header,
  * including the encoding of the old header, if present.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = msg_#xxxxxx#_copy(home, msg->msg_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_copy() returns a pointer to
  * newly copied header structure, or NULL upon an error.
@@ -229,32 +229,32 @@
 #if SU_HAVE_INLINE
 su_inline
 #endif
-msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home, 
+msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home,
 				  msg_#xxxxxx#_t const *header);
 
 #if SU_HAVE_INLINE
 su_inline
-msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home, 
+msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home,
 				  msg_#xxxxxx#_t const *header)
 {
   return (msg_#xxxxxx#_t *)
-    msg_header_copy_as(home, msg_#xxxxxx#_class, (msg_header_t const *)header); 
+    msg_header_copy_as(home, msg_#xxxxxx#_class, (msg_header_t const *)header);
 }
 #endif
 
 
 /**Make a header structure #msg_#xxxxxx#_t.
- * 
+ *
  * The function msg_#xxxxxx#_make() makes a new #msg_#xxxxxx#_t header
  * structure. It allocates a new header structure, and decodes the string @a
  * s as the value of the structure.
- * 
+ *
  * @param home memory home used to allocate new header structure.
  * @param s    string to be decoded as value of the new header structure
- * 
+ *
  * @note This function may be implemented as a macro calling
  * msg_header_make().
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_make() returns a pointer to newly maked
  * #msg_#xxxxxx#_t header structure, or NULL upon an error.
@@ -270,24 +270,24 @@
 
 
 /**Make a #xxxxxxx_xxxxxxx# from formatting result.
- * 
+ *
  * The function msg_#xxxxxx#_format() makes a new #xxxxxxx_xxxxxxx# object
  * using snprintf-formatted result as its value. The function first
  * prints the arguments according to the format @a fmt specified. Then it
  * allocates a new header structure, and uses the formatting result as the
  * header value.
- * 
+ *
  * @param home   memory home used to allocate new header structure.
  * @param fmt    string used as a printf()-style format
  * @param ...    argument list for format
- * 
+ *
  * @note This function may be implemented as a macro calling
  * msg_header_format().
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_format() returns a pointer to newly
  * makes header structure, or NULL upon an error.
- * 
+ *
  * @HIDE
  */
 #if SU_HAVE_INLINE
@@ -301,11 +301,11 @@
 {
   msg_header_t *h;
   va_list ap;
-  
+
   va_start(ap, fmt);
   h = msg_header_vformat(home, msg_#xxxxxx#_class, fmt, ap);
   va_end(ap);
- 
+
   return (msg_#xxxxxx#_t*)h;
 }
 #endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_parser.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_parser.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_parser.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef MSG_PARSER_H
 /** Defined when <sofia-sip/msg_parser.h> has been included. */
-#define MSG_PARSER_H 
+#define MSG_PARSER_H
 
 /**@ingroup msg_parser
  * @file sofia-sip/msg_parser.h
@@ -101,8 +101,8 @@
 				   char b[], isize_t bsiz, int eos);
 SOFIAPUBFUN issize_t msg_extract_separator(msg_t *msg, msg_pub_t *mo,
 					   char b[], isize_t bsiz, int eos);
-SOFIAPUBFUN issize_t msg_extract_payload(msg_t *msg, msg_pub_t *mo, 
-					 msg_header_t **return_payload, 
+SOFIAPUBFUN issize_t msg_extract_payload(msg_t *msg, msg_pub_t *mo,
+					 msg_header_t **return_payload,
 					 usize_t body_len,
 					 char b[], isize_t bsiz, int eos);
 
@@ -113,9 +113,9 @@
 SOFIAPUBFUN int msg_firstline_d(char *s, char **ss2, char **ss3);
 
 SOFIAPUBFUN isize_t msg_default_dup_xtra(msg_header_t const *header, isize_t offset);
-SOFIAPUBFUN char *msg_default_dup_one(msg_header_t *dst, 
+SOFIAPUBFUN char *msg_default_dup_one(msg_header_t *dst,
 				      msg_header_t const *src,
-				      char *b, 
+				      char *b,
 				      isize_t xtra);
 
 SOFIAPUBFUN issize_t msg_numeric_d(su_home_t *, msg_header_t *h, char *s, isize_t slen);
@@ -133,7 +133,7 @@
 SOFIAPUBFUN isize_t msg_generic_dup_xtra(msg_header_t const *h, isize_t offset);
 SOFIAPUBFUN char *msg_generic_dup_one(msg_header_t *dst,
 				      msg_header_t const *src,
-				      char *b, 
+				      char *b,
 				      isize_t xtra);
 
 SOFIAPUBFUN isize_t msg_unknown_dup_xtra(msg_header_t const *h, isize_t offset);
@@ -159,7 +159,7 @@
 SOFIAPUBFUN issize_t msg_auth_d(su_home_t *, msg_header_t *h, char *s, isize_t slen);
 SOFIAPUBFUN issize_t msg_auth_e(char b[], isize_t bsiz, msg_header_t const *h, int f);
 SOFIAPUBFUN isize_t msg_auth_dup_xtra(msg_header_t const *h, isize_t offset);
-SOFIAPUBFUN char *msg_auth_dup_one(msg_header_t *dst, msg_header_t const *src, 
+SOFIAPUBFUN char *msg_auth_dup_one(msg_header_t *dst, msg_header_t const *src,
 				   char *b, isize_t xtra);
 
 /* ---------------------------------------------------------------------------
@@ -189,7 +189,7 @@
 #define MSG_TERM_E(p, e) ((p) < (e) ? (p)[0] = '\0' : '\0')
 
 /** Encode a character. @HI */
-#define MSG_CHAR_E(p, e, c) (++(p) < (e) ? ((p)[-1]=(c)) : (c)) 
+#define MSG_CHAR_E(p, e, c) (++(p) < (e) ? ((p)[-1]=(c)) : (c))
 
 /** Calculate separator and string length. @HI */
 #define MSG_STRING_LEN(s, sep_size) ((s) ? (strlen(s) + sep_size) : 0)
@@ -214,7 +214,7 @@
 SOFIAPUBFUN issize_t msg_token_scan(char *start);
 SOFIAPUBFUN issize_t msg_attribute_value_scanner(char *s);
 
-SOFIAPUBFUN issize_t msg_any_list_d(su_home_t *, char **ss, 
+SOFIAPUBFUN issize_t msg_any_list_d(su_home_t *, char **ss,
 				    msg_param_t **append_list,
 				    issize_t (*scanner)(char *s),
 				    int sep);
@@ -269,7 +269,7 @@
 #define MSG_PARAMS_SIZE(rv, params) (rv = msg_params_dup_xtra(params, rv))
 
 /** Duplicate a parameter list */
-SOFIAPUBFUN char *msg_params_dup(msg_param_t const **d, msg_param_t const *s, 
+SOFIAPUBFUN char *msg_params_dup(msg_param_t const **d, msg_param_t const *s,
 				 char *b, isize_t xtra);
 
 /** Count number of parameters in the list */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_protos.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_protos.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_protos.h.in	Tue Dec 23 07:37:03 2008
@@ -30,7 +30,7 @@
 
 #ifndef MSG_PROTOS_H
 /** Defined when <sofia-sip/msg_protos.h> has been included. */
-#define MSG_PROTOS_H 
+#define MSG_PROTOS_H
 
 /**@ingroup msg_headers
  * @file sofia-sip/msg_protos.h
@@ -58,13 +58,13 @@
 
 /* Declare internal prototypes for #xxxxxxx_xxxxxxx# */
 
-/**@addtogroup msg_#xxxxxx# 
- * @{ 
+/**@addtogroup msg_#xxxxxx#
+ * @{
  */
 
-enum { 
+enum {
   /** Hash of #xxxxxxx_xxxxxxx#. @internal */
-  msg_#xxxxxx#_hash = #hash# 
+  msg_#xxxxxx#_hash = #hash#
 };
 
 /** Parse a #xxxxxxx_xxxxxxx#. @internal */
@@ -74,41 +74,41 @@
 MSG_DLL msg_print_f msg_#xxxxxx#_e;
 
 /**Header class for #xxxxxxx_xxxxxxx#.
- * 
- * The header class msg_#xxxxxx#_class defines how a 
+ *
+ * The header class msg_#xxxxxx#_class defines how a
  * #xxxxxxx_xxxxxxx# header is parsed and printed.  It also
  * contains methods used by message parser and other functions
  * to manipulate the msg_#xxxxxx#_t header structure.
- * 
+ *
  */
 MSG_DLL extern msg_hclass_t msg_#xxxxxx#_class[];
 
 /**Initializer for structure msg_#xxxxxx#_t.
- * 
+ *
  * A static msg_#xxxxxx#_t structure must be initialized
  * with the MSG_#XXXXXX#_INIT() macro. For instance,
- * @code 
- * 
+ * @code
+ *
  *  msg_#xxxxxx#_t msg_#xxxxxx# = MSG_#XXXXXX#_INIT;
- * 
+ *
  * @endcode
  * @HI
  */
 #define MSG_#XXXXXX#_INIT() MSG_HDR_INIT(#xxxxxx#)
 
 /**Initialize a structure msg_#xxxxxx#_t.
- * 
+ *
  * An msg_#xxxxxx#_t structure can be initialized with the
  * msg_#xxxxxx#_init() function/macro. For instance,
  * @code
- * 
+ *
  *  msg_#xxxxxx#_t msg_#xxxxxx#;
- * 
+ *
  *  msg_#xxxxxx#_init(&msg_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
- * @param x pointer to msg_#xxxxxx#_t structure 
+ *
+ * @param x pointer to msg_#xxxxxx#_t structure
  */
 #if SU_HAVE_INLINE
 su_inline msg_#xxxxxx#_t *msg_#xxxxxx#_init(msg_#xxxxxx#_t x[1])
@@ -121,13 +121,13 @@
 #endif
 
 /**Test if header object is instance of msg_#xxxxxx#_t.
- * 
+ *
  * The function msg_is_#xxxxxx#() returns true (nonzero) if
  * the header class is an instance of #xxxxxxx_xxxxxxx#
  * object and false (zero) otherwise.
- * 
+ *
  * @param header pointer to the header structure to be tested
- * 
+ *
  * @return
  * The function msg_is_#xxxxxx#() returns true (nonzero) if
  * the header object is an instance of header #xxxxxx# and
@@ -144,27 +144,27 @@
 #endif
 
 /**Duplicate (deep copy) @c msg_#xxxxxx#_t.
- * 
+ *
  * The function msg_#xxxxxx#_dup() duplicates a header structure @a
  * header. If the header structure @a header contains a reference
  * (@c header->x_next) to a list of headers, all the headers in the
  * list are duplicated, too.
- * 
+ *
  * @param home   memory home used to allocate new structure
  * @param header header structure to be duplicated
- * 
+ *
  * When duplicating, all parameter lists and non-constant strings
  * attached to the header are copied, too. The function uses given
  * memory @a home to allocate all the memory areas used to copy the
  * header.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = msg_#xxxxxx#_dup(home, msg->msg_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_dup() returns a pointer to the
  * newly duplicated msg_#xxxxxx#_t header structure, or NULL
@@ -173,45 +173,45 @@
 #if SU_HAVE_INLINE
 su_inline
 #endif
-msg_#xxxxxx#_t *msg_#xxxxxx#_dup(su_home_t *home, 
+msg_#xxxxxx#_t *msg_#xxxxxx#_dup(su_home_t *home,
 				 msg_#xxxxxx#_t const *header)
      __attribute__((__malloc__));
 
 #if SU_HAVE_INLINE
 su_inline
-msg_#xxxxxx#_t *msg_#xxxxxx#_dup(su_home_t *home, 
+msg_#xxxxxx#_t *msg_#xxxxxx#_dup(su_home_t *home,
 				 msg_#xxxxxx#_t const *header)
 {
   return (msg_#xxxxxx#_t *)
-    msg_header_dup_as(home, msg_#xxxxxx#_class, (msg_header_t const *)header); 
+    msg_header_dup_as(home, msg_#xxxxxx#_class, (msg_header_t const *)header);
 }
 #endif
 
 
 /**Copy a msg_#xxxxxx#_t header structure.
- * 
+ *
  * The function msg_#xxxxxx#_copy() copies a header structure @a
  * header. If the header structure @a header contains a reference
  * (@c header->h_next) to a list of headers, all the headers in that
  * list are copied, too. The function uses given memory @a home to
  * allocate all the memory areas used to copy the header structure
  * @a header.
- * 
+ *
  * @param home    memory home used to allocate new structure
  * @param header  pointer to the header structure to be duplicated
- * 
+ *
  * When copying, only the header structure and parameter lists
  * attached to it are duplicated. The new header structure retains
  * all the references to the strings within the old @a header,
  * including the encoding of the old header, if present.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = msg_#xxxxxx#_copy(home, msg->msg_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_copy() returns a pointer to
  * newly copied header structure, or NULL upon an error.
@@ -219,33 +219,33 @@
 #if SU_HAVE_INLINE
 su_inline
 #endif
-msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home, 
+msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home,
 				  msg_#xxxxxx#_t const *header)
      __attribute__((__malloc__));
 
 #if SU_HAVE_INLINE
 su_inline
-msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home, 
+msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home,
 				  msg_#xxxxxx#_t const *header)
 {
   return (msg_#xxxxxx#_t *)
-    msg_header_copy_as(home, msg_#xxxxxx#_class, (msg_header_t const *)header); 
+    msg_header_copy_as(home, msg_#xxxxxx#_class, (msg_header_t const *)header);
 }
 #endif
 
 /**Make a header structure msg_#xxxxxx#_t.
- * 
+ *
  * The function msg_#xxxxxx#_make() makes a new
  * msg_#xxxxxx#_t header structure.  It allocates a new
  * header structure, and decodes the string @a s as the
  * value of the structure.
- * 
+ *
  * @param home memory home used to allocate new header structure.
  * @param s    string to be decoded as value of the new header structure
- * 
+ *
  * @note This function is usually implemented as a macro calling
  * msg_header_make().
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_make() returns a pointer to
  * newly maked msg_#xxxxxx#_t header structure, or NULL upon
@@ -262,25 +262,25 @@
 #endif
 
 /**Make a #xxxxxxx_xxxxxxx# from formatting result.
- * 
+ *
  * The function msg_#xxxxxx#_format() makes a new
  * #xxxxxxx_xxxxxxx# object using formatting result as its
  * value.  The function first prints the arguments according to
  * the format @a fmt specified.  Then it allocates a new header
  * structure, and uses the formatting result as the header
  * value.
- * 
+ *
  * @param home   memory home used to allocate new header structure.
  * @param fmt    string used as a printf()-style format
  * @param ...    argument list for format
- * 
+ *
  * @note This function is usually implemented as a macro calling
  * msg_header_format().
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_format() returns a pointer to newly
  * makes header structure, or NULL upon an error.
- * 
+ *
  * @HIDE
  */
 #if SU_HAVE_INLINE
@@ -294,11 +294,11 @@
 {
   msg_header_t *h;
   va_list ap;
-  
+
   va_start(ap, fmt);
   h = msg_header_vformat(home, msg_#xxxxxx#_class, fmt, ap);
   va_end(ap);
- 
+
   return (msg_#xxxxxx#_t*)h;
 }
 #endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_tag_class.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_tag_class.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_tag_class.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef MSG_TAG_CLASS_H
 /** Defined when <sofia-sip/msg_tag_class.h> has been included */
-#define MSG_TAG_CLASS_H 
+#define MSG_TAG_CLASS_H
 
 /**@file sofia-sip/msg_tag_class.h
  * @brief Functions for constructing per-protocol tag classes.
@@ -44,15 +44,15 @@
 SOFIAPUBFUN size_t msghdrtag_xtra(tagi_t const *t, size_t offset);
 SOFIAPUBFUN tagi_t *msghdrtag_dup(tagi_t *dst, tagi_t const *src,
 				  void **inout_buffer);
-SOFIAPUBFUN int msghdrtag_scan(tag_type_t tt, su_home_t *home, 
-			       char const *s, 
+SOFIAPUBFUN int msghdrtag_scan(tag_type_t tt, su_home_t *home,
+			       char const *s,
 			       tag_value_t *return_value);
-SOFIAPUBFUN tagi_t *msghdrtag_filter(tagi_t *dst, tagi_t const f[], 
-				     tagi_t const *src, 
+SOFIAPUBFUN tagi_t *msghdrtag_filter(tagi_t *dst, tagi_t const f[],
+				     tagi_t const *src,
 				     void **inout_buffer);
 
 SOFIAPUBFUN tagi_t *msgstrtag_filter(tagi_t *dst, tagi_t const f[],
-				     tagi_t const *src, 
+				     tagi_t const *src,
 				     void **inout_buffer);
 
 SOFIAPUBFUN int msgobjtag_snprintf(tagi_t const *t, char b[], size_t size);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_types.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_types.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_types.h	Tue Dec 23 07:37:03 2008
@@ -28,9 +28,9 @@
 
 /**@file sofia-sip/msg_types.h
  * @brief Types for messages and common headers
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Jan 23 15:43:17 2003 ppessi
  *
  */
@@ -65,15 +65,15 @@
 #endif
 
 #ifndef MSG_PUB_T
-#ifdef MSG_OBJ_T 
+#ifdef MSG_OBJ_T
 #define MSG_PUB_T MSG_OBJ_T
 #else
 #define MSG_PUB_T struct msg_pub_s
 #endif
 #endif
 
-/**Public protocol-specific message structure for accessing the message. 
- * 
+/**Public protocol-specific message structure for accessing the message.
+ *
  * This type can be either #sip_t, #http_t, or #msg_multipart_t, depending
  * on the message. The base structure used by msg module is defined in
  * struct #msg_pub_s.
@@ -104,7 +104,7 @@
 
 #define MSG_HEADER_N 16377
 
-/** Common part of the header objects (or message fragments). 
+/** Common part of the header objects (or message fragments).
  *
  * This structure is also known as #msg_common_t or #sip_common_t.
  */
@@ -132,7 +132,7 @@
 
 #define msg_ident msg_common->h_class
 
-/** Numeric header. 
+/** Numeric header.
  *
  * A numeric header has value range of a 32-bit, 0..4294967295. The @a
  * x_value field is unsigned long, however.
@@ -143,7 +143,7 @@
   unsigned long  x_value;	    /**< Numeric header value */
 };
 
-/** Generic header. 
+/** Generic header.
  *
  * A generic header does not have any internal structure. Its value is
  * represented as a string.
@@ -154,8 +154,8 @@
   char const    *g_string;	    /**< Header value */
 };
 
-/** List header. 
- * 
+/** List header.
+ *
  * A list header consists of comma-separated list of tokens.
  */
 struct msg_list_s {
@@ -164,7 +164,7 @@
   msg_param_t       *k_items;	    /**< List of items */
 };
 
-/** Authentication header. 
+/** Authentication header.
  *
  * An authentication header has authentication scheme name and
  * comma-separated list of parameters as its value.
@@ -244,13 +244,13 @@
 
 /* ====================================================================== */
 
-/**Define how to handle existing headers 
- * when a new header is added to a message. 
+/**Define how to handle existing headers
+ * when a new header is added to a message.
  */
 typedef enum {
   msg_kind_single,		/**< Only one header is allowed */
   msg_kind_append,		/**< New header is appended */
-  msg_kind_list,		/**< A token list header, 
+  msg_kind_list,		/**< A token list header,
 				 * new header is combined with old one. */
   msg_kind_apndlist,		/**< A complex list header. */
   msg_kind_prepend		/**< New header is prepended */
@@ -259,17 +259,17 @@
 struct su_home_s;
 
 typedef issize_t msg_parse_f(struct su_home_s *, msg_header_t *, char *, isize_t);
-typedef issize_t msg_print_f(char buf[], isize_t bufsiz, 
+typedef issize_t msg_print_f(char buf[], isize_t bufsiz,
 			     msg_header_t const *, int flags);
-typedef char *msg_dup_f(msg_header_t *dst, msg_header_t const *src, 
+typedef char *msg_dup_f(msg_header_t *dst, msg_header_t const *src,
 			char *buf, isize_t bufsiz);
 typedef isize_t msg_xtra_f(msg_header_t const *h, isize_t offset);
 
 typedef int msg_update_f(msg_common_t *, char const *name, isize_t namelen,
 			 char const *value);
 
-/** Factory object for a header. 
- * 
+/** Factory object for a header.
+ *
  * The #msg_hclass_t object, "header class", defines how a header is
  * handled. It has parsing and printing functions, functions used to copy
  * header objects, header name and other information used when parsing,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_class.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_class.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_class.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@ingroup test_msg
  * @file test_class.c
- * 
+ *
  * Message class for testing parser and transports.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -65,7 +65,7 @@
 static msg_dup_f msg_request_dup_one;
 
 msg_hclass_t msg_request_class[] =
-MSG_HEADER_CLASS(msg_, request, NULL, "", rq_common, 
+MSG_HEADER_CLASS(msg_, request, NULL, "", rq_common,
 		 single_critical, msg_request, msg_generic);
 
 /** Decode a request line */
@@ -133,7 +133,7 @@
 static msg_dup_f msg_status_dup_one;
 
 msg_hclass_t msg_status_class[1] =
-MSG_HEADER_CLASS(msg_, status, NULL, "", st_common, 
+MSG_HEADER_CLASS(msg_, status, NULL, "", st_common,
 		 single_critical, msg_status, msg_generic);
 
 /** Parse status line */
@@ -162,7 +162,7 @@
   if (status > 999 || status < 100)
     status = 0;
 
-  return snprintf(b, bsiz, "%s %03u %s" CRLF, 
+  return snprintf(b, bsiz, "%s %03u %s" CRLF,
 		  st->st_version, status, st->st_phrase);
 }
 
@@ -201,19 +201,19 @@
   MSG_HEADER_CLASS(msg_, auth, "Auth", "", au_params,
 		   append, msg_auth, msg_generic);
 
-/** Extract the message body, including separator line. 
+/** Extract the message body, including separator line.
  *
- * @param[in,out] msg  message object 
- * @param[in,out] pub  public message structure 
- * @param[in]     b    buffer containing unparsed data 
- * @param[in]     bsiz buffer size 
+ * @param[in,out] msg  message object
+ * @param[in,out] pub  public message structure
+ * @param[in]     b    buffer containing unparsed data
+ * @param[in]     bsiz buffer size
  * @param[in]     eos  true if buffer contains whole message
  *
  * @retval -1     error
  * @retval 0      message is incomplete
  * @retval other  number of bytes extracted
  */
-issize_t msg_test_extract_body(msg_t *msg, msg_pub_t *pub, 
+issize_t msg_test_extract_body(msg_t *msg, msg_pub_t *pub,
 			       char b[], isize_t bsiz, int eos)
 {
   msg_test_t *tst = (msg_test_t *)pub;
@@ -249,14 +249,14 @@
 
   if ((m = msg_extract_payload(msg, (msg_pub_t *)tst, NULL, body_len, b, bsiz, eos) ) == -1)
     return -1;
-  
+
   tst->msg_flags |= MSG_FLG_FRAGS;
   if (bsiz >= body_len)
     tst->msg_flags |= MSG_FLG_COMPLETE;
   return m;
 }
 
-msg_href_t const msg_content_length_href[1] = 
+msg_href_t const msg_content_length_href[1] =
   {{
     msg_content_length_class,
     offsetof(msg_test_t, msg_content_length)
@@ -269,11 +269,11 @@
 
 tagi_t *tsttag_filter(tagi_t *dst,
 		      tagi_t const f[],
-		      tagi_t const *src, 
+		      tagi_t const *src,
 		      void **bb);
 
 /** Tag class for test header tags. @HIDE */
-tag_class_t tsthdrtag_class[1] = 
+tag_class_t tsthdrtag_class[1] =
   {{
     sizeof(tsthdrtag_class),
     /* tc_next */     NULL,
@@ -290,7 +290,7 @@
   }};
 
 /** Tag class for TST header string tags. @HIDE */
-tag_class_t tststrtag_class[1] = 
+tag_class_t tststrtag_class[1] =
   {{
     sizeof(tststrtag_class),
     /* tc_next */     NULL,
@@ -307,7 +307,7 @@
   }};
 
 /** Tag class for TST message tags. @HIDE */
-tag_class_t tstmsgtag_class[1] = 
+tag_class_t tstmsgtag_class[1] =
   {{
     sizeof(tstmsgtag_class),
     /* tc_next */     NULL,
@@ -322,7 +322,7 @@
     /* tc_ref_set */  t_ptr_ref_set,
   }};
 
-tag_typedef_t tsttag_header = 
+tag_typedef_t tsttag_header =
 	{{ TAG_NAMESPACE, "header", tsthdrtag_class, 0 }};
 
 tag_typedef_t tsttag_header_str = STRTAG_TYPEDEF(header_str);
@@ -330,7 +330,7 @@
 /** Filter a TST header structure. */
 tagi_t *tsttag_filter(tagi_t *dst,
 		      tagi_t const f[],
-		      tagi_t const *src, 
+		      tagi_t const *src,
 		      void **bb)
 {
   tagi_t stub[2] = {{ NULL }};
@@ -348,7 +348,7 @@
       msg_hclass_offset(mc, (msg_pub_t *)tst, hc);
     msg_header_t const *h;
 
-    if (tst == NULL || 
+    if (tst == NULL ||
 	(char *)hh >= ((char *)tst + tst->msg_size) ||
 	(char *)hh < (char const *)&tst->msg_request)
       return dst;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_class.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_class.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_class.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef TEST_CLASS_H
 /** Defined when <test_class.h> has been included. */
-#define TEST_CLASS_H 
+#define TEST_CLASS_H
 
 /**@ingroup test_msg
  * @file test_class.h
@@ -65,16 +65,16 @@
 typedef struct msg_status_s  msg_status_t;
 
 /** Request line. */
-struct msg_request_s { 
+struct msg_request_s {
   msg_common_t     rq_common[1];   /**< Common fragment info */
   msg_header_t    *rq_next;	   /**< Link to next header */
   char const      *rq_method_name; /**< Method name */
   url_t            rq_url[1];	   /**< RequestURI */
   char const      *rq_version;     /**< Protocol version */
-}; 
+};
 
 /** Status line. */
-struct msg_status_s { 
+struct msg_status_s {
   msg_common_t   st_common[1];	/**< Common fragment info */
   msg_header_t *st_next;	/**< Link to next (dummy) */
   char const    *st_version;	/**< Protocol version */
@@ -107,7 +107,7 @@
   msg_accept_language_t  *msg_accept_language;	/**< Accept-Language */
   msg_mime_version_t     *msg_mime_version;	/**< MIME-Version */
   msg_content_md5_t      *msg_content_md5;	/**< Content-MD5 */
-  msg_content_encoding_t *msg_content_encoding; 
+  msg_content_encoding_t *msg_content_encoding;
 						/**< Content-Encoding */
   msg_content_length_t   *msg_content_length;	/**< Content-Length */
 
@@ -140,7 +140,7 @@
   msg_content_id_t          sh_content_id[1];
   msg_content_md5_t         sh_content_md5[1];
   msg_content_language_t    sh_content_language[1];
-  msg_content_length_t      sh_content_length[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];

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c	Tue Dec 23 07:37:03 2008
@@ -138,7 +138,7 @@
 static int addr_test(void)
 {
   BEGIN();
-  
+
   /* It *will* fail. */
   /* TEST(sizeof(socklen_t), sizeof(msg_addrlen(NULL))); */
 
@@ -268,7 +268,7 @@
 
     msg_param_t const *p = NULL;
     char *master = ";0", *list, *end;
-    
+
     for (i = 1; i < 256; i++) {
       master = su_sprintf(home, "%s; %u", master, i); TEST_1(master);
       list = end = su_strdup(home, master);
@@ -294,7 +294,7 @@
 
     msg_list_t k1[1] = {{{{ 0 }}}};
     char list1[] = "foo, bar, baz  zi  \"baz\"";
-    
+
     TEST_1(msg_list_d(home, (msg_header_t *)k1, list1, strlen(list1)) >= 0);
     TEST_1(k1->k_items);
     TEST_S(k1->k_items[0], "foo");
@@ -310,7 +310,7 @@
     su_home_t home[1] = { SU_HOME_INIT(home) };
     msg_list_t k2[1] = {{{{ 0 }}}};
     char list2[] = "one, two, three, four, five, six, seven, eight";
-    
+
     TEST_1(
 	  msg_list_d(home, (msg_header_t *)k2, list2, strlen(list2)) >= 0);
     TEST_1(k2->k_items);
@@ -319,33 +319,33 @@
 
     su_home_deinit(home);
   }
-    
+
   {
     /* Test that list longer than MSG_PARAMS_N is handled correctly */
     su_home_t home[1] = { SU_HOME_INIT(home) };
     msg_list_t k3[1] = {{{{ 0 }}}};
     char list3[] = "one, two, three, four, five, six, seven, eight, nine";
-    
+
     TEST_1(
 	  msg_list_d(home, (msg_header_t *)k3, list3, strlen(list3)) >= 0);
     TEST_1(k3->k_items);
     TEST_1(k3->k_items[7]);
     TEST_1(k3->k_items[8]);
     TEST_1(k3->k_items[9] == NULL);
-  
+
     su_home_deinit(home);
   }
 
   {
     /* Test that long lists are handled correctly */
     su_home_t home[1] = { SU_HOME_INIT(home) };
-    
+
     msg_param_t *k = NULL;
     char *s;
     char list1[] = "one, two, three, four, five, six, seven, eight";
     char list2[] = "one, two, three, four, five, six, seven, eight";
     char list3[] = "one, two, three, four, five, six, seven, eight";
-    char list4[] = "one, two, three, four, five, six, seven, eight, nine";    
+    char list4[] = "one, two, three, four, five, six, seven, eight, nine";
 
     s = list1; TEST_1(msg_commalist_d(home, &s, &k, msg_token_scan) >= 0);
     TEST_1(k);
@@ -366,7 +366,7 @@
 
     msg_param_t *p = NULL;
     char *master = "0", *list, *end;
-    
+
     for (i = 1; i < 256; i++) {
       master = su_sprintf(home, "%s, %u", master, i); TEST_1(master);
       list = end = su_strdup(home, master);
@@ -389,7 +389,7 @@
   {
     /* Test that errors in lists are handled correctly */
     su_home_t home[1] = { SU_HOME_INIT(home) };
-    
+
     msg_param_t *k = NULL;
     char *s;
     char list1[] = "one, two, three, four, five, six, seven, foo=\"eight";
@@ -409,7 +409,7 @@
 
     msg_list_t k4[1] = {{{{ 0 }}}};
     char list4[] = ", ,\t,\r\n\t,  ,   ";
-    
+
     TEST_1(
 	  msg_list_d(home, (msg_header_t *)k4, list4, strlen(list4)) >= 0);
     TEST_1(k4->k_items == NULL);
@@ -423,7 +423,7 @@
     msg_auth_t au[1] = {{{{ 0 }}}};
     char s[] = "Basic foo = \"bar==\" ,, bar=baari,"
       "baz=\"bof,\\\\ \\\" baff\", base\t64/ - is== ,,";
-    
+
     TEST_1(msg_auth_d(home, (msg_header_t *)au, s, strlen(s)) >= 0);
     TEST_S(au->au_scheme, "Basic");
     TEST_1(au->au_params);
@@ -441,7 +441,7 @@
     su_home_t home[1] = { SU_HOME_INIT(home) };
 
     msg_content_type_t *c;
-    
+
     c = msg_content_type_format(home, "%s/%s;%s;%s;%s;%s;%s;%s",
 				"text", "plain",
 				"charset=iso-8859-15",
@@ -487,7 +487,7 @@
   int i, j, hash = 0;
   msg_mclass_t const *mc = msg_test_mclass;
   msg_hclass_t *hc;
-  
+
   BEGIN();
 
   for (i = 0; i < mc->mc_hash_size; i++) {
@@ -517,12 +517,12 @@
   return msg_make(msg_test_mclass, MSG_DO_EXTRACT_COPY, buffer, -1);
 }
 
-/**Check if header chain contains any loops. 
+/**Check if header chain contains any loops.
  *
  * @return
  * Return 0 if no loop, -1 otherwise.
  */
-static 
+static
 int msg_chain_loop(msg_header_t const *h)
 {
   msg_header_t const *h2;
@@ -542,7 +542,7 @@
   return 0;
 }
 
-/** Check header chain consistency. 
+/** Check header chain consistency.
  *
  * @return
  * Return 0 if consistent, number of errors otherwise.
@@ -552,7 +552,7 @@
 {
   if (msg_chain_loop(h))
     return -1;
-  
+
   for (; h; h = h->sh_succ) {
     if (h->sh_succ && h->sh_succ->sh_prev != &h->sh_succ)
       return -1;
@@ -606,14 +606,14 @@
 
   TEST_1(separator = msg_separator_make(home, "\r\n"));
   TEST(msg_header_insert(msg, (msg_pub_t *)tst, (msg_header_t *)separator), 0);
-  TEST_P(tst->msg_separator, separator); 
+  TEST_P(tst->msg_separator, separator);
   TEST_P(separator->sep_common->h_succ, tst->msg_payload);
 
   /* Try to add a new payload */
   TEST_1(payload = msg_payload_make(home, "foofaa\r\n"));
   TEST(msg_header_insert(msg, (msg_pub_t *)tst, (msg_header_t *)payload), 0);
   /* It is appended */
-  TEST_P(tst->msg_payload->pl_next, payload); 
+  TEST_P(tst->msg_payload->pl_next, payload);
   TEST_P(tst->msg_payload->pl_common->h_succ, payload);
 
   {
@@ -622,10 +622,10 @@
     msg_param_t foo = "foo=bar";
 
     vs = NULL;
-    MSG_PARAM_MATCH(vs, foo, "foo"); 
+    MSG_PARAM_MATCH(vs, foo, "foo");
     TEST_S(vs, "bar");
     vs = NULL;
-    MSG_PARAM_MATCH(vs, foo, "fo"); 
+    MSG_PARAM_MATCH(vs, foo, "fo");
     TEST_P(vs, NULL);
     vi = 0;
     MSG_PARAM_MATCH_P(vi, foo, "foo");
@@ -670,14 +670,14 @@
     TEST_1(se = fi->aa_next);
 
     TEST_S(en->aa_value, "en");
-    TEST_M(en->aa_common->h_data, 
+    TEST_M(en->aa_common->h_data,
 	   "Accept-Language: en;q=0.8, fi, se ; q = 0.6" CRLF,
 	   en->aa_common->h_len);
 
-    TEST_P((char *)en->aa_common->h_data + en->aa_common->h_len, 
+    TEST_P((char *)en->aa_common->h_data + en->aa_common->h_len,
 	   fi->aa_common->h_data);
     TEST(fi->aa_common->h_len, 0);
-    TEST_P((char *)en->aa_common->h_data + en->aa_common->h_len, 
+    TEST_P((char *)en->aa_common->h_data + en->aa_common->h_len,
 	   se->aa_common->h_data);
     TEST(se->aa_common->h_len, 0);
 
@@ -689,9 +689,9 @@
     TEST_P(fi->aa_next, de);
     TEST_P(de->aa_next, NULL);
 
-    TEST_P(en->aa_common->h_succ, fi); 
+    TEST_P(en->aa_common->h_succ, fi);
     TEST_P(en->aa_common->h_prev, &deflate->aa_common->h_succ);
-    TEST_P(fi->aa_common->h_succ, de); 
+    TEST_P(fi->aa_common->h_succ, de);
     TEST_P(fi->aa_common->h_prev, &en->aa_common->h_succ);
     TEST_P(de->aa_common->h_succ, NULL);
     TEST_P(de->aa_common->h_prev, &fi->aa_common->h_succ);
@@ -700,21 +700,21 @@
     TEST_P(se->aa_common->h_succ, NULL);
     TEST_P(se->aa_common->h_prev, NULL);
 
-    TEST_1(sv = msg_accept_language_make(msg_home(msg), 
+    TEST_1(sv = msg_accept_language_make(msg_home(msg),
 					 "sv;q=0.6,sv_FI;q=0.7"));
     TEST_1(sv_fi = sv->aa_next);
 
     TEST(msg_header_replace(msg, (msg_pub_t *)tst, (void *)fi, (void *)sv), 0);
 
     TEST_P(en->aa_next, sv);
-    TEST_P(sv->aa_next->aa_next, de); 
+    TEST_P(sv->aa_next->aa_next, de);
     TEST_P(de->aa_next, NULL);
 
-    TEST_P(en->aa_common->h_succ, sv); 
+    TEST_P(en->aa_common->h_succ, sv);
     TEST_P(en->aa_common->h_prev, &deflate->aa_common->h_succ);
-    TEST_P(sv->aa_common->h_succ, sv_fi); 
+    TEST_P(sv->aa_common->h_succ, sv_fi);
     TEST_P(sv->aa_common->h_prev, &en->aa_common->h_succ);
-    TEST_P(sv_fi->aa_common->h_succ, de); 
+    TEST_P(sv_fi->aa_common->h_succ, de);
     TEST_P(sv_fi->aa_common->h_prev, &sv->aa_common->h_succ);
     TEST_P(de->aa_common->h_succ, NULL);
     TEST_P(de->aa_common->h_prev, &sv_fi->aa_common->h_succ);
@@ -727,7 +727,7 @@
 		 "Foo: bar" CRLF
 		 "Content-Length: 6" CRLF
 		 CRLF
-		 "test" CRLF 
+		 "test" CRLF
 		 "extra stuff" CRLF);
   TEST_1(orig);
   otst = msg_test_public(orig);
@@ -743,7 +743,7 @@
 
   TEST(msg_header_insert(msg, (msg_pub_t *)tst, (void *)request), 0);
 
-  TEST_1(location = 
+  TEST_1(location =
 	 msg_content_location_make(home, "http://localhost:8080/wife"));
 
   TEST(msg_header_insert(msg, (msg_pub_t *)tst, (void *)location), 0);
@@ -751,14 +751,14 @@
   TEST(msg_serialize(msg, (msg_pub_t *)tst), 0);
   TEST_1(msg_prepare(msg) > 0);
 
-  TEST_1(language = 
+  TEST_1(language =
 	 msg_content_language_make(home, "se-FI, fi-FI, sv-FI"));
   TEST(msg_header_insert(msg, (msg_pub_t *)tst, (void *)language), 0);
 
   TEST_1(se = msg_accept_language_make(home, "se, fi, sv"));
   TEST_1(se->aa_next);  TEST_1(se->aa_next->aa_next);
   TEST(msg_header_insert(msg, (msg_pub_t *)tst, (void *)se), 0);
-  
+
   TEST(msg_serialize(msg, (msg_pub_t *)tst), 0);
   TEST_1(msg_prepare(msg) > 0);
 
@@ -789,9 +789,9 @@
     char const encoded[] = "Accept-Language: se, fi, sv\r\n";
     TEST_SIZE(se->aa_common->h_len, strlen(encoded));
     TEST_M(se->aa_common->h_data, encoded, se->aa_common->h_len);
-    TEST_P((char *)se->aa_common->h_data + se->aa_common->h_len, 
+    TEST_P((char *)se->aa_common->h_data + se->aa_common->h_len,
 	   se->aa_next->aa_common->h_data);
-    TEST_P((char *)se->aa_common->h_data + se->aa_common->h_len, 
+    TEST_P((char *)se->aa_common->h_data + se->aa_common->h_len,
 	   se->aa_next->aa_next->aa_common->h_data);
   }
 
@@ -804,7 +804,7 @@
 
     /* Bug #1726034 */
     for (i = 0; i < 15; i++)
-      strcpy(body + i * 66, 
+      strcpy(body + i * 66,
 	     "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 	     "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n");
     pl = msg_payload_make(msg_home(msg), body);
@@ -812,7 +812,7 @@
     TEST(msg_header_insert(msg, (msg_pub_t *)tst, (void *)pl), 0);
 
     s = msg_as_string(msg_home(msg), msg, NULL, 0, &size);
-    TEST_S(s, 
+    TEST_S(s,
 "GET a-wife HTTP/1.1" CRLF
 "Foo: bar" CRLF
 "Content-Length: 6" CRLF
@@ -854,7 +854,7 @@
 
   TEST_1(home = su_home_new(sizeof *home));
 
-  TEST_1((w = msg_warning_make(home, 
+  TEST_1((w = msg_warning_make(home,
 			       "399 host:5060 \"Ok\", "
 			       "399 [::1]:39999 \"foo\\\" bar\"")));
   TEST(w->w_code, 399);
@@ -980,8 +980,8 @@
   TEST_1(la->k_next->k_common->h_data);
   TEST_1(la->k_next->k_items == NULL);
 
-  TEST(msg_header_add_make(msg, (msg_pub_t *)tst, 
-			   msg_content_language_class, 
+  TEST(msg_header_add_make(msg, (msg_pub_t *)tst,
+			   msg_content_language_class,
 			   "en-gb"), 0);
   TEST_P(la, tst->msg_content_language);
   TEST_P(la->k_common->h_data, NULL);
@@ -998,19 +998,19 @@
 
   TEST_1(separator = msg_separator_make(home, "\r\n"));
   TEST(msg_header_insert(msg, (msg_pub_t *)tst, (msg_header_t *)separator), 0);
-  TEST_P(tst->msg_separator, separator); 
+  TEST_P(tst->msg_separator, separator);
   TEST_P(separator->sep_common->h_succ, tst->msg_payload);
 
   /* Try to add a new payload */
   TEST_1(payload = msg_payload_make(home, "foofaa\r\n"));
   TEST(msg_header_insert(msg, (msg_pub_t *)tst, (msg_header_t *)payload), 0);
   /* The new payload should be appended */
-  TEST_P(tst->msg_payload->pl_next, payload); 
+  TEST_P(tst->msg_payload->pl_next, payload);
   TEST_P(tst->msg_payload->pl_common->h_succ, payload);
 
   /* Try to add a new header */
-  TEST_1(l = msg_content_length_create(home, 
-				       tst->msg_payload->pl_len + 
+  TEST_1(l = msg_content_length_create(home,
+				       tst->msg_payload->pl_len +
 				       payload->pl_len));
   TEST(msg_header_insert(msg, (msg_pub_t *)tst, (msg_header_t *)l), 0);
   /* The new header should be last before separator */
@@ -1056,7 +1056,7 @@
   msg_common_t *h, *h_succ;
   msg_iovec_t iovec[8];
 
-  char const s[] = 
+  char const s[] =
     "GET /a-life HTTP/1.1" CRLF
     "Content-Length: 6" CRLF
     "Content-Type: *" CRLF
@@ -1078,10 +1078,10 @@
   TEST_1(copy = msg_test_public(msg));
   TEST_1(copy->msg_request);
   TEST_1(tst0->msg_request);
-  TEST_S(copy->msg_request->rq_url->url_path, 
+  TEST_S(copy->msg_request->rq_url->url_path,
 	 tst0->msg_request->rq_url->url_path);
   TEST_S(copy->msg_request->rq_url->url_path, "a-life");
-  TEST_P(copy->msg_request->rq_url->url_path, 
+  TEST_P(copy->msg_request->rq_url->url_path,
 	 tst0->msg_request->rq_url->url_path);
 
   msg_destroy(msg);
@@ -1090,10 +1090,10 @@
   TEST_1(dup = msg_test_public(msg));
   TEST_1(dup->msg_request);
   TEST_1(tst0->msg_request);
-  TEST_S(dup->msg_request->rq_url->url_path, 
+  TEST_S(dup->msg_request->rq_url->url_path,
 	 tst0->msg_request->rq_url->url_path);
   TEST_S(dup->msg_request->rq_url->url_path, "a-life");
-  TEST_1(dup->msg_request->rq_url->url_path != 
+  TEST_1(dup->msg_request->rq_url->url_path !=
 	 tst0->msg_request->rq_url->url_path);
 
   msg_destroy(msg);
@@ -1156,7 +1156,7 @@
   msg_content_id_t *cid;
   msg_content_transfer_encoding_t *cte;
 
-  char const s[] = 
+  char const s[] =
     "GET /a-life HTTP/1.1" CRLF
     "Accept: text/html;level=4;q=1" CRLF
     "Accept: text / plain;q=0.9" CRLF
@@ -1175,13 +1175,13 @@
     /* "Content-Length: 305" CRLF */
     "Content-MD5: LLO7gLaGqGt4BI6HouiWng==" CRLF
     CRLF
-    "test" CRLF			
+    "test" CRLF
     CRLF			/* 1 */
-    "--LaGqGt4BI6Ho" "  " CRLF	
+    "--LaGqGt4BI6Ho" "  " CRLF
     CRLF			/* 2 */
     "part 1" CRLF		/* 3 */
     CRLF			/* 4 */
-    "--LaGqGt4BI6Ho" CRLF	
+    "--LaGqGt4BI6Ho" CRLF
     "Content-Type: text/plain ; charset = iso-8859-1" CRLF /* 5 */
     "Content-ID: <m7ZvEEm49xdTT0WCDUgnww at localhost>" CRLF /* 6 */
     "Content-Transfer-Encoding: quoted-unreadable" CRLF	/* 7 */
@@ -1191,10 +1191,10 @@
     "Content-Type: text/html" CRLF /* 11 */
     "Content-ID: <4SP77aQZ9z6Top2dvLqKPQ at localhost>" CRLF /* 12 */
     CRLF			/* 13 */
-#define BODY3 "<html><body>part 3</body></html>" CRLF 
+#define BODY3 "<html><body>part 3</body></html>" CRLF
     BODY3			/* 14 */
     CRLF			/* 15 */
-    "--LaGqGt4BI6Ho--" CRLF;	
+    "--LaGqGt4BI6Ho--" CRLF;
 
   BEGIN();
 
@@ -1240,7 +1240,7 @@
   TEST_1(mp->mp_data);
   TEST(memcmp(mp->mp_data, CRLF "--" "LaGqGt4BI6Ho" CRLF, mp->mp_len), 0);
   TEST_1(mp->mp_common->h_data);
-  TEST_M(mp->mp_common->h_data, CRLF "--" "LaGqGt4BI6Ho" "  " CRLF, 
+  TEST_M(mp->mp_common->h_data, CRLF "--" "LaGqGt4BI6Ho" "  " CRLF,
 	 mp->mp_common->h_len);
 
   TEST_1(pl = mp->mp_payload); TEST_1(pl->pl_data);
@@ -1254,7 +1254,7 @@
 
   TEST_1(c = mp->mp_content_type);
   TEST_S(c->c_type, "text/plain"); TEST_S(c->c_subtype, "plain");
-  TEST_1(c->c_params);   TEST_1(c->c_params[0]); 
+  TEST_1(c->c_params);   TEST_1(c->c_params[0]);
   TEST_S(c->c_params[0], "charset=iso-8859-1");
 
   TEST_1(cid = mp->mp_content_id);
@@ -1265,7 +1265,7 @@
   TEST_1(pl = mp->mp_payload); TEST_1(pl->pl_data);
   TEST_SIZE(strlen("part 2"), pl->pl_len);
   TEST(memcmp(pl->pl_data, "part 2", pl->pl_len), 0);
-  
+
   TEST_1(mp = mp->mp_next);
 
   TEST_1(mp->mp_data);
@@ -1295,7 +1295,7 @@
 
   TEST(n, 15);
 
-  head = NULL; 
+  head = NULL;
   TEST_1(h = msg_multipart_serialize(&head, mp0));
   TEST_P(h, mpX->mp_close_delim);
   TEST_1(!msg_chain_errors((msg_header_t *)mp0));
@@ -1306,15 +1306,15 @@
 
   TEST(n, 15);
 
-  /* Add a new part to multipart */   
-  mpnew = su_zalloc(home, sizeof(*mpnew)); TEST_1(mpnew); 
+  /* Add a new part to multipart */
+  mpnew = su_zalloc(home, sizeof(*mpnew)); TEST_1(mpnew);
   removed = mpX->mp_close_delim;
   mpX->mp_next = mpnew; mpX = mpnew;
   mpnew->mp_content_type = msg_content_type_make(home, "multipart/mixed");
   TEST_1(mpnew->mp_content_type);
   TEST(msg_multipart_complete(msg_home(msg), tst->msg_content_type, mp0), 0);
 
-  head = NULL; 
+  head = NULL;
   TEST_1(h = msg_multipart_serialize(&head, mp0));
   TEST_P((void *)h, mpX->mp_close_delim);
   TEST_1(!msg_chain_errors((msg_header_t *)mp0));
@@ -1355,14 +1355,14 @@
   TEST(n, 19);
 
   /* Add an recursive multipart */
-  mpnew = su_zalloc(home, sizeof(*mpnew)); TEST_1(mpnew); 
+  mpnew = su_zalloc(home, sizeof(*mpnew)); TEST_1(mpnew);
   mpX->mp_multipart = mpnew;
   mpnew->mp_content_type = msg_content_type_make(home, "text/plain");
   TEST_1(mpnew->mp_content_type);
   TEST(msg_multipart_complete(msg_home(msg), tst->msg_content_type, mp0), 0);
   TEST_1(mpnew->mp_close_delim);
 
-  head = NULL; 
+  head = NULL;
   TEST_1(h = msg_multipart_serialize(&head, mp0));
   TEST_P(h, mpX->mp_close_delim);
 
@@ -1393,7 +1393,7 @@
   msg_payload_t *pl;
   char const *end;
 
-  char const s[] = 
+  char const s[] =
     "GET /a-life HTTP/1.1" CRLF
     "Accept: text/html;level=4;q=1" CRLF
     "Accept: text / plain;q=0.9" CRLF
@@ -1411,13 +1411,13 @@
     "Content-Type: multipart/alternative ; boundary=\"LaGqGt4BI6Ho\"" CRLF
     "Content-MD5: LLO7gLaGqGt4BI6HouiWng==" CRLF
     CRLF
-    "test" CRLF			
+    "test" CRLF
     CRLF			/* 1 */
-    "--LaGqGt4BI6Ho" "  " CRLF	
+    "--LaGqGt4BI6Ho" "  " CRLF
     CRLF			/* 2 */
     "part 1" CRLF		/* 3 */
     CRLF			/* 4 */
-    "--LaGqGt4BI6Ho" CRLF	
+    "--LaGqGt4BI6Ho" CRLF
     "Content-Type: text/plain;charset=iso-8859-1" CRLF /* 5 */
     "Content-ID: <m7ZvEEm49xdTT0WCDUgnww at localhost>" CRLF /* 6 */
     "Content-Transfer-Encoding: quoted-unreadable" CRLF	/* 7 */
@@ -1427,10 +1427,10 @@
     "Content-Type: text/html" CRLF /* 11 */
     "Content-ID: <4SP77aQZ9z6Top2dvLqKPQ at localhost>" CRLF /* 12 */
     CRLF			/* 13 */
-#define BODY3 "<html><body>part 3</body></html>" CRLF 
+#define BODY3 "<html><body>part 3</body></html>" CRLF
     BODY3			/* 14 */
     CRLF			/* 15 */
-    "--LaGqGt4BI6Ho--" CRLF;	
+    "--LaGqGt4BI6Ho--" CRLF;
 
   char const part1[] = "This is text\n";
   char const part2[] = "<html><body>This is html</body></html>";
@@ -1465,19 +1465,19 @@
     su_home_t h0[1] = { SU_HOME_INIT(h0) };
 
     pl = msg_payload_dup(h0, tst->msg_payload); TEST_1(pl);
-  
+
     mp = msg_multipart_parse(home, c, pl); TEST_1(mp);
 
-    for (n = 0, h = (msg_header_t *)mp; h; h = h->sh_succ, n++) 
+    for (n = 0, h = (msg_header_t *)mp; h; h = h->sh_succ, n++)
       h->sh_data = NULL, h->sh_len = 0;
     TEST(n, 15);
-    
+
     n = msg_multipart_prepare(msg, mp, 0);
-    
+
     TEST_1(end = strstr(s, "--LaGqGt4BI6Ho  "));
     len = strlen(end);
     TEST(len, n);
-    
+
     TEST_1(mp = msg_multipart_dup(h0, mp));
 
     su_home_check(h0);
@@ -1489,20 +1489,20 @@
     su_home_t h0[1] = { SU_HOME_INIT(h0) };
 
     pl = msg_payload_dup(h0, tst->msg_payload); TEST_1(pl);
-  
+
     mp = msg_multipart_parse(h0, NULL, pl);
     TEST_1(mp);
 
-    for (n = 0, h = (msg_header_t *)mp; h; h = h->sh_succ, n++) 
+    for (n = 0, h = (msg_header_t *)mp; h; h = h->sh_succ, n++)
       h->sh_data = NULL, h->sh_len = 0;
     TEST(n, 15);
-    
+
     n = msg_multipart_prepare(msg, mp, 0);
-    
+
     TEST_1(end = strstr(s, "--LaGqGt4BI6Ho  "));
     len = strlen(end);
     TEST(len, n);
-    
+
     TEST_1(mp = msg_multipart_dup(h0, mp));
 
     su_home_check(h0);
@@ -1514,7 +1514,7 @@
     su_home_t h0[1] = { SU_HOME_INIT(h0) };
 
     pl = msg_payload_dup(h0, tst->msg_payload); TEST_1(pl);
-  
+
     n = strstr(pl->pl_data, "--LaGqGt4BI6Ho") - (char *)pl->pl_data;
     pl->pl_data = n + (char *)pl->pl_data; pl->pl_len -= n;
 
@@ -1522,14 +1522,14 @@
 
     mp = msg_multipart_parse(h0, NULL, pl); TEST_1(mp);
 
-    for (n = 0, h = (msg_header_t *)mp; h; h = h->sh_succ, n++) 
+    for (n = 0, h = (msg_header_t *)mp; h; h = h->sh_succ, n++)
       h->sh_data = NULL, h->sh_len = 0;
     TEST(n, 15);
-    
+
     n = msg_multipart_prepare(msg, mp, 0);
 
     TEST(len, n);
-    
+
     TEST_1(mp = msg_multipart_dup(h0, mp));
 
     su_home_check(h0);
@@ -1542,7 +1542,7 @@
     char *b;
 
     pl = msg_payload_dup(h0, tst->msg_payload); TEST_1(pl);
-  
+
     /* Remove CRs */
     b = pl->pl_data, len = pl->pl_len;
     for (n = m = 0; n < len; n++) {
@@ -1550,14 +1550,14 @@
 	m++;
     }
     pl->pl_len = m;
-    
+
     mp = msg_multipart_parse(h0, NULL, pl);
     TEST_1(mp);
-    
-    for (n = 0, h = (msg_header_t *)mp; h; h = h->sh_succ, n++) 
+
+    for (n = 0, h = (msg_header_t *)mp; h; h = h->sh_succ, n++)
       h->sh_data = NULL, h->sh_len = 0;
     TEST(n, 15);
-    
+
     n = msg_multipart_prepare(msg, mp, 0);
     TEST_1(n > 0);
 
@@ -1571,10 +1571,10 @@
   TEST_1(c = msg_content_type_make(home, "multipart/related"));
 
   TEST_1(mp = msg_multipart_create(home, "text/plain", part1, strlen(part1)));
-  TEST_1(mp->mp_next = 
+  TEST_1(mp->mp_next =
 	 msg_multipart_create(home, "text/html", part2, strlen(part2)));
-  TEST_1(mp->mp_next->mp_next = 
-	 msg_multipart_create(home, "application/octet-stream", 
+  TEST_1(mp->mp_next->mp_next =
+	 msg_multipart_create(home, "application/octet-stream",
 			      part3, sizeof part3));
 
   TEST(msg_multipart_complete(home, c, mp), 0);
@@ -1605,7 +1605,7 @@
   msg_accept_encoding_t *aen;
   msg_accept_language_t *ala;
 
-  char const s[] = 
+  char const s[] =
     "GET /a-life HTTP/1.1" CRLF
     "Accept-Language: fi" CRLF
     "Accept-Encoding: z0" CRLF
@@ -1629,7 +1629,7 @@
   TEST(msg_header_remove(msg, (msg_pub_t *)tst, (msg_header_t *)ala), 0);
   TEST_S(ala->aa_value, "de");
 
-  TEST_1(ala = tst->msg_accept_language); 
+  TEST_1(ala = tst->msg_accept_language);
   TEST_1(ala = ala->aa_next); TEST_S(ala->aa_value, "se");
   /* Make sure that cached encoding of se is reset */
   TEST_1(ala->aa_common->h_data == NULL);
@@ -1642,12 +1642,12 @@
   TEST_1(aen = tst->msg_accept_encoding->aa_next->aa_next);
   TEST(msg_header_remove_all(msg, (msg_pub_t *)tst, (msg_header_t *)aen), 0);
 
-  TEST_1(aen = tst->msg_accept_encoding); 
+  TEST_1(aen = tst->msg_accept_encoding);
   TEST_1(aen = aen->aa_next); TEST_S(aen->aa_value, "z1");
   /* Make sure that cached encoding of z1 is reset */
   TEST_1(aen->aa_common->h_data == NULL);
   TEST_1(aen->aa_common->h_len == 0);
-  TEST_1(aen->aa_next == NULL); 
+  TEST_1(aen->aa_next == NULL);
 
   TEST_1(aen->aa_common->h_succ == (void *)ala);
   TEST_1(ala->aa_next->aa_common);
@@ -1708,7 +1708,7 @@
   TEST_S(token, "aaaaaaaaaaaaa");
   TEST_SIZE(msg_random_token(token, 32, zeros, 12), 20);
   TEST_S(token, "aaaaaaaaaaaaaaaaaaaa");
-  
+
   END();
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_protos.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_protos.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_protos.h.in	Tue Dec 23 07:37:03 2008
@@ -1,4 +1,4 @@
-/**-*- c -*- 
+/**-*- c -*-
  * @ingroup msg
  * @internal @file test_protos.h.in
  *
@@ -31,15 +31,15 @@
 
 #ifndef TEST_PROTOS_H
 /** Defined when <test_protos.h> has been included. */
-#define TEST_PROTOS_H 
+#define TEST_PROTOS_H
 
 /**@ingroup test_msg
  * @file test_protos.h
  *
  * Prototypes and macros for dummy testing protocol headers.
- * 
+ *
  * #AUTO#
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  */
 
@@ -85,8 +85,8 @@
 /**Tag list item for header string.
  *
  * The TSTTAG_HEADER_STR() macro is used to include a tag item containing a
- * header string in the tag list, e.g., 
- * @code 
+ * header string in the tag list, e.g.,
+ * @code
  * TSTTAG_HEADER_STR("Priority: urgent").
  * @endcode
  *
@@ -134,7 +134,7 @@
 #if HAVE_INLINE
 su_inline
 tag_value_t tsttag_tst_v(msg_test_t const *v) { return (tag_value_t)v; }
-su_inline 
+su_inline
 tag_value_t tsttag_tst_vr(msg_test_t const **vp) { return (tag_value_t)vp; }
 #else
 #define tsttag_tst_v(v)   (tag_value_t)(v)
@@ -153,8 +153,8 @@
 
 
 /**Header class for #xxxxxxx_xxxxxxx#.
- * 
- * The header class msg_#xxxxxx#_class defines how a 
+ *
+ * The header class msg_#xxxxxx#_class defines how a
  * #xxxxxxx_xxxxxxx# is parsed and printed.  It also
  * contains methods used by message parser and other functions
  * to manipulate the msg_#xxxxxx#_t header structure.
@@ -162,28 +162,28 @@
 extern msg_hclass_t msg_#xxxxxx#_class[];
 
 /**Initializer for structure msg_#xxxxxx#_t.
- * 
+ *
  * A static msg_#xxxxxx#_t structure must be initialized
  * with the MSG_#XXXXXX#_INIT() macro. For instance,
- * @code 
- * 
+ * @code
+ *
  *  msg_#xxxxxx#_t msg_#xxxxxx# = MSG_#XXXXXX#_INIT;
- * 
+ *
  * @endcode
  * @HI
  */
 #define MSG_#XXXXXX#_INIT() MSG_HDR_INIT(#xxxxxx#)
 
 /**Initialize a structure msg_#xxxxxx#_t.
- * 
+ *
  * An msg_#xxxxxx#_t structure can be initialized with the
  * msg_#xxxxxx#_init() function/macro. For instance,
  * @code
- * 
+ *
  *  msg_#xxxxxx#_t msg_#xxxxxx#;
- * 
+ *
  *  msg_#xxxxxx#_init(&msg_#xxxxxx#);
- * 
+ *
  * @endcode
  * @HI
  */
@@ -198,13 +198,13 @@
 #endif
 
 /**Test if header object is instance of msg_#xxxxxx#_t.
- * 
+ *
  * The function msg_is_#xxxxxx#() returns true (nonzero) if
  * the header class is an instance of #xxxxxxx_xxxxxxx#
  * object and false (zero) otherwise.
- * 
+ *
  * @param header pointer to the header structure to be tested
- * 
+ *
  * @return
  * The function msg_is_x#xxxxxx#() returns true (nonzero) if
  * the header object is an instance of header #xxxxxx# and
@@ -222,27 +222,27 @@
 #define msg_#xxxxxx#_p(h) msg_is_#xxxxxx#((h))
 
 /**Duplicate (deep copy) @c msg_#xxxxxx#_t.
- * 
+ *
  * The function msg_#xxxxxx#_dup() duplicates a header
  * structure @a hdr.  If the header structure @a hdr
  * contains a reference (@c hdr->x_next) to a list of
  * headers, all the headers in the list are duplicated, too.
- * 
+ *
  * @param home  memory home used to allocate new structure
  * @param hdr   header structure to be duplicated
- * 
+ *
  * When duplicating, all parameter lists and non-constant
  * strings attached to the header are copied, too.  The
  * function uses given memory @a home to allocate all the
  * memory areas used to copy the header.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = msg_#xxxxxx#_dup(home, tst->msg_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_dup() returns a pointer to the
  * newly duplicated msg_#xxxxxx#_t header structure, or NULL
@@ -251,49 +251,49 @@
 msg_#xxxxxx#_t *msg_#xxxxxx#_dup(su_home_t *home, msg_#xxxxxx#_t const *hdr);
 
 /**Copy a msg_#xxxxxx#_t header structure.
- * 
+ *
  * The function msg_#xxxxxx#_copy() copies a header structure @a
  * hdr.  If the header structure @a hdr contains a reference (@c
  * hdr->h_next) to a list of headers, all the headers in that
  * list are copied, too. The function uses given memory @a home
  * to allocate all the memory areas used to copy the header
  * structure @a hdr.
- * 
+ *
  * @param home    memory home used to allocate new structure
  * @param hdr     pointer to the header structure to be duplicated
- * 
+ *
  * When copying, only the header structure and parameter lists
  * attached to it are duplicated.  The new header structure
  * retains all the references to the strings within the old @a
  * header, including the encoding of the old header, if present.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = msg_#xxxxxx#_copy(home, tst->msg_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_copy() returns a pointer to
  * newly copied header structure, or NULL upon an error.
  */
-msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home, 
+msg_#xxxxxx#_t *msg_#xxxxxx#_copy(su_home_t *home,
 				  msg_#xxxxxx#_t const *hdr);
 
 /**Make a header structure msg_#xxxxxx#_t.
- * 
+ *
  * The function msg_#xxxxxx#_make() makes a new
  * msg_#xxxxxx#_t header structure.  It allocates a new
  * header structure, and decodes the string @a s as the
  * value of the structure.
- * 
+ *
  * @param home memory home used to allocate new header structure.
  * @param s    string to be decoded as value of the new header structure
- * 
+ *
  * @note This function is usually implemented as a macro calling
  * msg_header_make().
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_make() returns a pointer to
  * newly maked msg_#xxxxxx#_t header structure, or NULL upon
@@ -309,25 +309,25 @@
 #endif
 
 /**Make a #xxxxxxx_xxxxxxx# from formatting result.
- * 
+ *
  * The function msg_#xxxxxx#_format() makes a new
  * #xxxxxxx_xxxxxxx# object using formatting result as its
  * value.  The function first prints the arguments according to
  * the format @a fmt specified.  Then it allocates a new header
  * structure, and uses the formatting result as the header
  * value.
- * 
+ *
  * @param home   memory home used to allocate new header structure.
  * @param fmt    string used as a printf()-style format
  * @param ...    argument list for format
- * 
+ *
  * @note This function is usually implemented as a macro calling
  * msg_header_format().
- * 
+ *
  * @return
  * The function msg_#xxxxxx#_format() returns a pointer to newly
  * makes header structure, or NULL upon an error.
- * 
+ *
  * @HIDE
  */
 #if SU_HAVE_INLINE
@@ -341,11 +341,11 @@
 {
   msg_header_t *h;
   va_list ap;
-  
+
   va_start(ap, fmt);
   h = msg_header_vformat(home, msg_#xxxxxx#_class, fmt, ap);
   va_end(ap);
- 
+
   return (msg_#xxxxxx#_t *)h;
 }
 #endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_table.c.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_table.c.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/msg/test_table.c.in	Tue Dec 23 07:37:03 2008
@@ -31,8 +31,8 @@
  */
 
 /**@ingroup test_msg
- * 
- * @CFILE test_table.c 
+ *
+ * @CFILE test_table.c
  * @brief Parser table used for testing.
  *
  * #AUTO#

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/Doxyfile.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/Doxyfile.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/Doxyfile.in	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 PROJECT_NAME         = "nea"
 OUTPUT_DIRECTORY     = ../docs/html/nea
 
-INPUT 		     = @srcdir@/nea.docs @srcdir@/sofia-sip @srcdir@ . 
+INPUT 		     = @srcdir@/nea.docs @srcdir@/sofia-sip @srcdir@ .
 
 @INCLUDE_PATH = . @srcdir@
 @INCLUDE = ../docs/Doxyfile.conf

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
 
 noinst_LTLIBRARIES = 	libnea.la
 
-TESTS = 
+TESTS =
 
 # ----------------------------------------------------------------------
 # Rules for building the targets
@@ -49,7 +49,7 @@
 			../msg/libmsg.la \
 			../url/liburl.la \
 			../bnf/libbnf.la \
-			../su/libsu.la 
+			../su/libsu.la
 
 # ----------------------------------------------------------------------
 # Install and distribution rules

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea.c	Tue Dec 23 07:37:03 2008
@@ -66,7 +66,7 @@
   sip_to_t         *nea_to;		/**< The other end of subscription :) */
   nea_notify_f      nea_callback;	/**< Notify callback  */
   nea_magic_t      *nea_context;	/**< Application context */
-   
+
   sip_contact_t    *nea_contact;	/**< */
   sip_expires_t    *nea_expires;	/**< Proposed expiration time */
 
@@ -84,12 +84,12 @@
 
 static int process_nea_request(nea_t *nea,
 			       nta_leg_t *leg,
-			       nta_incoming_t *ireq, 
+			       nta_incoming_t *ireq,
 			       sip_t const *sip);
 
-static int handle_notify(nta_leg_magic_t *lmagic, 
+static int handle_notify(nta_leg_magic_t *lmagic,
 			 nta_leg_t *leg,
-			 nta_incoming_t *ireq, 
+			 nta_incoming_t *ireq,
 			 sip_t const *sip);
 
 static int response_to_subscribe(nea_t *nea,
@@ -126,13 +126,13 @@
 
   ta_start(ta, tag, value);
 
-  have_to = 
+  have_to =
     tl_find(ta_args(ta), siptag_to) || tl_find(ta_args(ta), siptag_to_str);
-  have_from = 
+  have_from =
     tl_find(ta_args(ta), siptag_from) || tl_find(ta_args(ta), siptag_from_str);
   have_contact =
-    tl_find(ta_args(ta), siptag_contact) || 
-    tl_find(ta_args(ta), siptag_contact_str);    
+    tl_find(ta_args(ta), siptag_contact) ||
+    tl_find(ta_args(ta), siptag_contact_str);
 
   if (have_to && (nea = su_home_new(sizeof(nea_t)))) {
     su_home_t      *home = nea->nea_home;
@@ -145,7 +145,7 @@
     nea->nea_callback = no_callback;
     nea->nea_context = context;
 
-    if (!have_from) 
+    if (!have_from)
       from = sip_from_create(home, (url_string_t*)m->m_url);
     else
       from = NULL;
@@ -155,7 +155,7 @@
 			     ta_tags(ta));
 
     /* Get and remove Expires header from tag list */
-    tl_gets(nea->nea_args, 
+    tl_gets(nea->nea_args,
 	    SIPTAG_EXPIRES_REF(expires),
 	    SIPTAG_EXPIRES_STR_REF(expires_str),
 	    SIPTAG_TO_REF(to),
@@ -175,8 +175,8 @@
     else
       nea->nea_expires = sip_expires_create(home, EXPIRES_DEFAULT);
 
-    tl_tremove(nea->nea_args, 
-	       SIPTAG_EXPIRES(0), 
+    tl_tremove(nea->nea_args,
+	       SIPTAG_EXPIRES(0),
 	       SIPTAG_EXPIRES_STR(0),
 	       TAG_END());
 
@@ -189,7 +189,7 @@
 
     if (nea->nea_timer) {
       /* Create leg for NOTIFY requests */
-      nea->nea_leg = nta_leg_tcreate(nea->nea_agent, 
+      nea->nea_leg = nta_leg_tcreate(nea->nea_agent,
 				     process_nea_request, nea,
 				     TAG_IF(!have_from, SIPTAG_FROM(from)),
 				     TAG_NEXT(nea->nea_args));
@@ -208,7 +208,7 @@
 
     if (!nea->nea_leg ||
 	!nea->nea_oreq ||
-	!nea->nea_timer) 
+	!nea->nea_timer)
       nea_destroy(nea), nea = NULL;
   }
 
@@ -217,7 +217,7 @@
 }
 
 
-int nea_update(nea_t *nea, 
+int nea_update(nea_t *nea,
 	       tag_type_t tag,
 	       tag_value_t value,
 	       ...)
@@ -234,22 +234,22 @@
   /* XXX - hack, previous request still waiting for response */
   if (!nea->nea_leg || nea->nea_oreq)
     return -1;
-    
+
   ta_start(ta, tag, value);
-  
+
   tl_gets(ta_args(ta),
 	  SIPTAG_CONTENT_TYPE_REF(ct),
 	  SIPTAG_CONTENT_TYPE_STR_REF(cts),
 	  SIPTAG_PAYLOAD_REF(pl),
 	  SIPTAG_EXPIRES_REF(expires),
 	  TAG_NULL());
-  
+
   if (!pl || (!ct && !cts)) {
     ta_end(ta);
     return -1;
   }
 
-  tl_tremove(nea->nea_args, 
+  tl_tremove(nea->nea_args,
 	     SIPTAG_CONTENT_TYPE(0),
 	     SIPTAG_CONTENT_TYPE_STR(0),
 	     SIPTAG_PAYLOAD(0),
@@ -268,17 +268,17 @@
 				       response_to_subscribe, nea,
 				       NULL,
 				       SIP_METHOD_SUBSCRIBE,
-				       NULL, 
+				       NULL,
 				       SIPTAG_TO(nea->nea_to),
 				       SIPTAG_PAYLOAD(pl),
-				       TAG_IF(ct, SIPTAG_CONTENT_TYPE(ct)), 
+				       TAG_IF(ct, SIPTAG_CONTENT_TYPE(ct)),
 				       TAG_IF(cts, SIPTAG_CONTENT_TYPE_STR(cts)),
 				       SIPTAG_EXPIRES(nea->nea_expires),
 				       TAG_NEXT(nea->nea_args));
 
   ta_end(ta);
 
-  if (!nea->nea_oreq) 
+  if (!nea->nea_oreq)
     return -1;
 
   return 0;
@@ -329,16 +329,16 @@
 
 
 /* Function called by NTA to handle incoming requests belonging to the leg */
-int process_nea_request(nea_t *nea, 
+int process_nea_request(nea_t *nea,
 			nta_leg_t *leg,
-			nta_incoming_t *ireq, 
+			nta_incoming_t *ireq,
 			sip_t const *sip)
 {
 
   switch (sip->sip_request->rq_method) {
   case sip_method_notify:
     return handle_notify(nea, leg, ireq, sip);
-  case sip_method_ack:  
+  case sip_method_ack:
     return 400;
   default:
     nta_incoming_treply(ireq, SIP_405_METHOD_NOT_ALLOWED,
@@ -370,12 +370,12 @@
     sip_time_t now = sip_now();
     if (!nea->nea_notify_received) {
       nea->nea_deadline = now +
-	sip_contact_expires(NULL, sip->sip_expires, sip->sip_date, 
+	sip_contact_expires(NULL, sip->sip_expires, sip->sip_date,
 			    EXPIRES_DEFAULT, now);
       if (sip->sip_to->a_tag && !nea->nea_dialog) {
 	nea->nea_dialog = 1;
 	nta_leg_rtag(nea->nea_leg, sip->sip_to->a_tag);
-	nta_leg_client_route(nea->nea_leg, 
+	nta_leg_client_route(nea->nea_leg,
 			     sip->sip_record_route, sip->sip_contact);
       }
     }
@@ -432,14 +432,14 @@
   if (nea->nea_oreq || !error) {
     su_time_t now = su_now();
     now.tv_sec = nea->nea_deadline;
-    su_timer_set_at(nea->nea_timer, 
-		    nea_expires_renew, 
+    su_timer_set_at(nea->nea_timer,
+		    nea_expires_renew,
 		    nea,
 		    now);
   }
   else
     nea->nea_callback(nea, nea->nea_context, NULL);
-    
+
   return 0;
 }
 
@@ -454,16 +454,16 @@
 
   if (status >= 200)
     nta_outgoing_destroy(orq), nea->nea_oreq = NULL;
-  if (status >= 300) 
+  if (status >= 300)
     nea->nea_callback(nea, nea->nea_context, NULL);
 
   return 0;
 }
 
 /** handle notifications */
-int handle_notify(nea_t *nea, 
+int handle_notify(nea_t *nea,
 		  nta_leg_t *leg,
-		  nta_incoming_t *irq, 
+		  nta_incoming_t *irq,
 		  sip_t const *sip)
 {
   sip_subscription_state_t *ss = sip->sip_subscription_state;
@@ -475,9 +475,9 @@
 
     if (ss == NULL)
       phrase = "NOTIFY Has No Subscription-State Header";
-    else if (sip->sip_event == NULL) 
+    else if (sip->sip_event == NULL)
       phrase = "Event Header Missing";
-      
+
     if (phrase) {
       nta_incoming_treply(irq, 400, phrase, TAG_END());
       nta_incoming_destroy(irq);
@@ -511,7 +511,7 @@
   if (!nea->nea_dialog) {
     nea->nea_dialog = 1;
     nta_leg_rtag(nea->nea_leg, sip->sip_from->a_tag);
-    nta_leg_server_route(nea->nea_leg, 
+    nta_leg_server_route(nea->nea_leg,
 			 sip->sip_record_route, sip->sip_contact);
   }
 
@@ -541,9 +541,9 @@
       return 200;
     }
   }
-  else if (strcasecmp(ss->ss_substate, "pending") == 0) 
+  else if (strcasecmp(ss->ss_substate, "pending") == 0)
     nea->nea_state = nea_pending;
-  else if (strcasecmp(ss->ss_substate, "active") == 0) 
+  else if (strcasecmp(ss->ss_substate, "active") == 0)
     nea->nea_state = nea_active;
   else
     nea->nea_state = nea_extended;
@@ -557,8 +557,8 @@
   {
     su_time_t now = su_now();
     now.tv_sec = nea->nea_deadline;
-    su_timer_set_at(nea->nea_timer, 
-		    nea_expires_renew, 
+    su_timer_set_at(nea->nea_timer,
+		    nea_expires_renew,
 		    nea,
 		    now);
   }
@@ -574,7 +574,7 @@
 
   /* re-subscribe if expires soon */
   if (nea->nea_state == nea_terminated ||
-      nea->nea_deadline == 0 || 
+      nea->nea_deadline == 0 ||
       nea->nea_deadline > now + NEA_TIMER_DELTA)
     return;
 
@@ -592,6 +592,6 @@
 			 NULL,
 			 SIPTAG_EXPIRES(nea->nea_expires),
 			 TAG_NEXT(nea->nea_args));
-    
+
   return;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea.docs	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 /* -*- c -*- */
 
 /**@MODULEPAGE "nea" - SIP Events Module
- * 
+ *
  * @section nea_meta Module Meta Information
  *
  * Sofia Event API provides an interface to different events used in SIP
@@ -40,9 +40,9 @@
  * {
  *   presentity_t *pr = su_home_clone(p->p_home, sizeof (*pr));
  *   ...
- *   pr->pr_nes = 
+ *   pr->pr_nes =
  *     nea_server_create(agent, root,
- * 		       m->m_url, 
+ * 		       m->m_url,
  * 		       MAX_SUBSCRIBERS,
  * 		       event_callback, pr,
  * 		       SIPTAG_CONTACT(m),
@@ -51,7 +51,7 @@
  * ...
  * }
  * @endcode
- * 
+ *
  * @section nea_event_create Creating Events
  *
  * Next, events are created. The function nea_event_create () defines
@@ -65,7 +65,7 @@
  * #define XPIDF_MIME_TYPE "application/xpidf+xml"
  * #define PIDF_MIME_TYPE "application/cpim-pidf+xml"
 
- * ne = nea_event_create(pr->pr_nes, presence_callback, ep, 
+ * ne = nea_event_create(pr->pr_nes, presence_callback, ep,
  * 		       PRESENCE_PACKAGE, NULL,
  * 		       PIDF_MIME_TYPE,
  * 		       PIDF_MIME_TYPE "," XPIDF_MIME_TYPE);
@@ -83,16 +83,16 @@
  *
  * After the update, subscribers of the event are notified (with SIP
  * NOTIFY) of the changed payload with nea_server_update ().
- * 
+ *
  * @code
  * nea_server_update(pr->pr_nes, home, event, 1,
  *		   SIPTAG_CONTENT_TYPE(ct),
  * 		   SIPTAG_PAYLOAD(pl),
  * 		   TAG_END());
- 
+
  * nea_server_notify(pr->pr_nes, event);
  * @endcode
- * 
+ *
  * Obtaining the event's payload and removing it is presented in the
  * example below. The event is defined as a part of the @a package_t
  * structure. Function nea_payloads_get() is used to return a payload

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_debug.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_debug.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_debug.c	Tue Dec 23 07:37:03 2008
@@ -66,7 +66,7 @@
  *
  * The NEA_DEBUG environment variable is used to determine the debug
  * logging level for @b nea module. The default level is 3.
- * 
+ *
  * @sa <sofia-sip/su_debug.h>, nea_log, SOFIA_DEBUG
  */
 extern char const NEA_DEBUG[];
@@ -75,8 +75,8 @@
 #define SU_DEBUG 3
 #endif
 
-/**Debug log for @b nea module. 
- * 
+/**Debug log for @b nea module.
+ *
  * The nea_log is the log object used by @b nea module. The level of
  * #nea_log is set using #NEA_DEBUG environment variable.
  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_event.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_event.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_event.c	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 /**@internal
  * @file nea_event.c
  * @brief Default MIME type for certain events.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Thu Dec 11 20:28:46 2003 ppessi

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c	Tue Dec 23 07:37:03 2008
@@ -71,7 +71,7 @@
   su_home_t                 nes_home[1];
   su_root_t                *nes_root;
   su_timer_t               *nes_timer;
-  
+
   nta_agent_t              *nes_agent;
   nta_leg_t                *nes_leg;
 
@@ -106,8 +106,8 @@
   nea_new_event_f          *nes_callback;
   nea_smagic_t             *nes_context;
 
-  /** Events.  
-   * Each subscriber will be added to one of these. */ 
+  /** Events.
+   * Each subscriber will be added to one of these. */
   nea_event_t              *nes_events;
 };
 
@@ -178,11 +178,11 @@
 struct nea_sub_s {
   nea_sub_t        *s_next;
   nea_sub_t       **s_prev;
-  
+
   nta_leg_t        *s_leg;
   nta_incoming_t   *s_irq;
   nta_outgoing_t   *s_oreq;
-  
+
   nea_server_t     *s_nes;
 
   sip_contact_t    *s_local;	/**< Local contact */
@@ -204,7 +204,7 @@
   unsigned          s_reported :1 ; /**< Made watcher report upon un-SUBSCRIBE */
 
   unsigned          s_processing : 1;
-  unsigned          s_rejected : 1; 
+  unsigned          s_rejected : 1;
   unsigned          s_pending_flush : 1;
   unsigned          s_garbage : 1;
   unsigned          s_fake : 1; /**< Do not send real information to user */
@@ -242,7 +242,7 @@
 static
 int nea_server_callback(nea_sub_t *nes_as_sub,
 			nta_leg_t *leg,
-			nta_incoming_t *irq, 
+			nta_incoming_t *irq,
 			sip_t const *sip);
 
 static int nea_sub_process_incoming(nea_sub_t *s,
@@ -255,9 +255,9 @@
 				     nta_incoming_t *irq,
 				     sip_t const *sip);
 
-static int nea_sub_notify(nea_server_t *nes, 
-			  nea_sub_t *s, 
-			  sip_time_t now, 
+static int nea_sub_notify(nea_server_t *nes,
+			  nea_sub_t *s,
+			  sip_time_t now,
 			  tag_type_t tag, tag_value_t value, ...);
 
 static int response_to_notify(nea_sub_t *s,
@@ -268,8 +268,8 @@
 			    su_timer_t *timer,
 			    su_timer_arg_t *arg);
 
-static int nea_view_queue(nea_server_t *nes, 
-			  nea_event_view_t *evv, 
+static int nea_view_queue(nea_server_t *nes,
+			  nea_event_view_t *evv,
 			  nea_event_queue_t *evq);
 
 /** Assign an event view to subscriber. */
@@ -283,7 +283,7 @@
   s->s_throttle = evv->evv_throttle;
 }
 
-su_inline 
+su_inline
 void nea_subnode_init(nea_subnode_t *sn, nea_sub_t *s, sip_time_t now)
 {
   sn->sn_state = s->s_state;
@@ -312,18 +312,18 @@
  * The function nea_server_create() initializes an event server object and
  * registers it with @b nta. An event server object takes care of all events
  * for a particular URI (@em eventity).
- * 
+ *
  * @param agent       pointer to an @b nta agent object
  * @param root        pointer to an @b root object
  * @param url         url of the server to be created
  * @param max_subs    maximum number of subscriptions
- * @param callback    authorization function, 
+ * @param callback    authorization function,
  *                    or @c NULL if no authorization is required
  * @param context     server context (pointer to application data)
  * @param tag, value, ... optional list of tag parameters
  *
  * @TAGS
- * The function nea_server_create() takes the following tag values as its 
+ * The function nea_server_create() takes the following tag values as its
  * arguments:
  * <dl>
  *
@@ -339,26 +339,26 @@
  *
  * <dt>NEATAG_MINSUB()
  * <dd>Minimum duration of a subscription.
- * 
+ *
  * <dt>NEATAG_THROTTLE()
  * <dd>Default value for event throttle (by default, 5 seconds).
  * Throttle determines the minimum interval betweeen notifications. Note
  * that the notification indicating that the subscription has terminated
  * will be sent regardless of throttle.
- * 
+ *
  * The default throttle value is used if the subscriber does not include
  * a throttle parameter in @ref sip_event "Event" header of SUBSCRIBE request.
- * 
+ *
  * <dt>NEATAG_MINTHROTTLE()
  * <dd>Minimum allowed throttle value (by default, 5 seconds).
- * 
+ *
  * <dt>NEATAG_EVENTLIST()
  * <dd>If true, the subscribers must support eventlists. If SIPTAG_REQUIRE()
  * is given, it must contain the "eventlist" feature.
  *
  * <dt>NEATAG_DIALOG()
  * <dd>Give an optional NTA destination leg to event server.
- * 
+ *
  * <dt>SIPTAG_REQUIRE()/SIPTAG_REQUIRE_STR()
  * <dd>The @b Require header for the event server. The subscribers must
  * indicate support the specified features.
@@ -384,8 +384,8 @@
   char const *contact_str = NULL;
   char const *server_str = NULL;
   char const *rq_str = NULL;
-  unsigned 
-    min_expires = 15 * 60, 
+  unsigned
+    min_expires = 15 * 60,
     expires = NEA_DEFAULT_EXPIRES,
     max_expires = 24 * 60 * 60;
   nta_leg_t *leg = NONE;
@@ -397,7 +397,7 @@
 
     ta_start(ta, tag, value);
 
-    tl_gets(ta_args(ta), 
+    tl_gets(ta_args(ta),
 	    SIPTAG_CONTACT_REF(contact),
 	    SIPTAG_CONTACT_STR_REF(contact_str),
 	    SIPTAG_ALLOW_EVENTS_REF(allow_events),
@@ -428,7 +428,7 @@
     SU_DEBUG_5(("nea_server_create(): invalid expiration range\n"));
     return NULL;
   }
-  
+
   nes = su_home_new(sizeof(nea_server_t));
 
   if (nes) {
@@ -453,10 +453,10 @@
 
     nes->nes_allow_methods = sip_allow_make(home, "SUBSCRIBE");
 
-    nes->nes_server = 
-      su_sprintf(home, "%s%snea/" NEA_VERSION_STR " %s", 
+    nes->nes_server =
+      su_sprintf(home, "%s%snea/" NEA_VERSION_STR " %s",
 		 server_str ? server_str : "",
-		 server_str ? " " : "", 
+		 server_str ? " " : "",
 		 nta_agent_version(agent));
 
     if (contact)
@@ -471,15 +471,15 @@
       if (leg != NULL)
 	nta_leg_bind(leg, nea_server_callback, (nea_sub_t*)nes);
     } else {
-      nes->nes_leg = nta_leg_tcreate(agent, 
-				     nea_server_callback, 
-				     (nea_sub_t*)nes, 
+      nes->nes_leg = nta_leg_tcreate(agent,
+				     nea_server_callback,
+				     (nea_sub_t*)nes,
 				     NTATAG_NO_DIALOG(1),
 				     NTATAG_METHOD("SUBSCRIBE"),
 				     URLTAG_URL(url),
 				     TAG_END());
     }
-				     
+
     nes->nes_eventlist = eventlist; /* Every event is a list */
     if (eventlist && rq == NULL && rq_str == NULL)
       rq_str = "eventlist";
@@ -489,9 +489,9 @@
     else if (rq_str)
       nes->nes_require = sip_require_make(nes->nes_home, rq_str);
 
-    nes->nes_timer = su_timer_create(su_root_task(nes->nes_root), 
+    nes->nes_timer = su_timer_create(su_root_task(nes->nes_root),
 				     nes->nes_min_throttle
-				     ? 500L * nes->nes_min_throttle 
+				     ? 500L * nes->nes_min_throttle
 				     : 500L);
 
     if (nes->nes_allow_events &&
@@ -515,8 +515,8 @@
 
 /** Invoke the new event callback.
  *
- * The function nes_event_callback() calls the callback provided by the 
- * application using the notifier object. 
+ * The function nes_event_callback() calls the callback provided by the
+ * application using the notifier object.
  *
  * @param nes pointer to notifier object
  * @param ev  pointer to event view
@@ -528,9 +528,9 @@
  * has been destroyed by the callback function, 0 otherwise.
  */
 static
-int nes_new_event_callback(nea_server_t *nes, 
-			   nea_event_t **ev_p, 
-			   nea_event_view_t **view_p, 
+int nes_new_event_callback(nea_server_t *nes,
+			   nea_event_t **ev_p,
+			   nea_event_view_t **view_p,
 			   nta_incoming_t *irq,
 			   sip_t const *sip)
 {
@@ -556,7 +556,7 @@
     SU_DEBUG_5(("nea_server_shutdown(%p) while in callback\n", (void *)nes));
     return 100;
   }
-  
+
   SU_DEBUG_5(("nea_server_shutdown(%p)\n", (void *)nes));
 
   in_callback = nes->nes_in_callback; nes->nes_in_callback = 1;
@@ -567,16 +567,16 @@
     if (s->s_pending_flush)
       continue;
     if (s->s_oreq == NULL)
-      nea_sub_auth(s, nea_terminated, 
+      nea_sub_auth(s, nea_terminated,
 		   TAG_IF(retry_after, NEATAG_REASON("probation")),
 		   TAG_IF(!retry_after, NEATAG_REASON("deactivated")),
 		   TAG_IF(retry_after, NEATAG_RETRY_AFTER(retry_after)),
 		   TAG_END());
     else
       status = 180;
-  }    
+  }
 
-  nes->nes_in_callback = in_callback;   
+  nes->nes_in_callback = in_callback;
 
   return 200;
 }
@@ -591,16 +591,16 @@
     nes->nes_pending_destroy = 1;
     return;
   }
-  
+
   SU_DEBUG_5(("nea_server_destroy(%p)\n", (void *)nes));
-  
+
   nta_leg_destroy(nes->nes_leg), nes->nes_leg = NULL;
-  
+
   while (nes->nes_subscribers)
     nea_sub_destroy(nes->nes_subscribers);
-  
+
   su_timer_destroy(nes->nes_timer), nes->nes_timer = NULL;
-  
+
   su_home_unref(nes->nes_home);
 }
 
@@ -611,10 +611,10 @@
  * A nea event server has typed content that is delivered to the
  * subscribers. Different content types are each assigned a separate primary
  * view. There can be also primary views with "fake" content, content
- * delivered to politely blocked subscribers. 
+ * delivered to politely blocked subscribers.
  *
  * In addition to primary views, there can be secondary views, views
- * assigned to a single subscriber only. 
+ * assigned to a single subscriber only.
  *
  * @TAGS
  * The following tagged arguments are accepted:
@@ -629,7 +629,7 @@
  * <dt>NEATAG_FAKE(fak)
  * <dd>If @a fake is true, 'fake' view is updated.
  *
- * <dt>NEATAG_VIEW(view) 
+ * <dt>NEATAG_VIEW(view)
  * <dd>If included in tagged arguments, @a view is * updated. Used when
  * updating secondary view.
  *
@@ -642,8 +642,8 @@
  * <dd>Application-provided @a context pointer.
  * The @a context pointer is returned by nea_view_magic() function.
  *
- * <dt>NEATAG_RELIABLE(reliable) 
- * <dd>The @a reliable flag determines how overlapping updates are handled. 
+ * <dt>NEATAG_RELIABLE(reliable)
+ * <dd>The @a reliable flag determines how overlapping updates are handled.
  * If @a reliable is true, all updates are delivered to the subscribers.
  *
  * <dt>NEATAG_THROTTLE(throttl)
@@ -651,10 +651,10 @@
  * determines the minimum interval in seconds betweeen notifications. Note
  * that the notification indicating that the subscription has terminated
  * will be sent regardless of throttle.
- * 
+ *
  * The default throttle value is used if the subscriber does not include
  * a throttle parameter in @ref sip_event "Event" header of SUBSCRIBE request.
- * 
+ *
  * <dt>NEATAG_MINTHROTTLE()
  * <dd>Minimum allowed throttle value for updated event view.
  *
@@ -684,7 +684,7 @@
 	  NEATAG_FAKE_REF(fake),
 	  NEATAG_VIEW_REF(evv),
 	  TAG_NULL());
-  
+
   updated = nea_view_update(nes, ev, &evv, 0, fake, ta_tags(ta));
 
   ta_end(ta);
@@ -733,7 +733,7 @@
 	  NEATAG_THROTTLE_REF(throttle),
 	  NEATAG_MINTHROTTLE_REF(min_throttle),
 	  TAG_NULL());
-  
+
   ta_end(ta);
 
   if (min_throttle < throttle)
@@ -754,7 +754,7 @@
     for (i = 0; (evv = ev->ev_views[i]); i++)
       if (str0casecmp(cts, evv->evv_content_type->c_type) == 0)
 	break;
-    
+
     if (private && evv == NULL) /* No private view without primary view. */
       return -1;
 
@@ -762,7 +762,7 @@
       return -1;
 
     primary_p = eevv = ev->ev_views + i;
-    
+
     /* Search for fakeness/eventlist/private view */
     if (evv && (private || evv->evv_private || evv->evv_fake != (unsigned)fake)) {
       for (eevv = &evv->evv_next; (evv = *eevv); eevv = &evv->evv_next) {
@@ -773,7 +773,7 @@
       }
     }
   }
-   
+
   /* New event view, allocate and link to chain */
   if (!evv) {
     sip_content_type_t *new_ct;
@@ -781,20 +781,20 @@
     evv = su_zalloc(home, sizeof (*evv));
     if (!evv)
       return -1;
-    
+
     new_pl = pl ? sip_payload_dup(home, pl)
       : sip_payload_make(home, pls);
-    
-    new_ct = ct ? sip_content_type_dup(home, ct) 
+
+    new_ct = ct ? sip_content_type_dup(home, ct)
       : sip_content_type_make(home, cts);
-    
+
     if ((!new_pl && pl) || !new_ct) {
       su_free(home, evv); su_free(home, new_pl);
       return -1;
     }
 
     *evvp = *eevv = evv;
-      
+
     evv->evv_primary = *primary_p;
     evv->evv_private = private != 0;
     evv->evv_fake = fake != 0;
@@ -808,13 +808,13 @@
     assert(evv->evv_content_type);
   }
   else {
-    if (pl && 
-	evv->evv_payload && 
+    if (pl &&
+	evv->evv_payload &&
 	evv->evv_payload->pl_len == pl->pl_len &&
 	memcmp(evv->evv_payload->pl_data, pl->pl_data, pl->pl_len) == 0)
       return 0;
-    if (!pl && pls && evv->evv_payload && 
-	evv->evv_payload->pl_len == strlen(pls) && 
+    if (!pl && pls && evv->evv_payload &&
+	evv->evv_payload->pl_len == strlen(pls) &&
 	memcmp(evv->evv_payload->pl_data, pls, evv->evv_payload->pl_len) == 0)
       return 0;
     if (!pl && !pls && !evv->evv_payload)
@@ -826,7 +826,7 @@
 
     if (!new_pl && (pl || pls))
       return -1;
-    
+
     evv->evv_payload = new_pl;
   }
 
@@ -861,7 +861,7 @@
   ta_start(ta, tag, value);
 
   nea_view_update(nes, ev, &evv, 1, 0, ta_tags(ta));
-			 
+
   ta_end(ta);
 
   return evv;
@@ -935,8 +935,8 @@
 
 /** Queue an old notification if needed. */
 static
-int nea_view_queue(nea_server_t *nes, 
-		   nea_event_view_t *evv, 
+int nea_view_queue(nea_server_t *nes,
+		   nea_event_view_t *evv,
 		   nea_event_queue_t *evq)
 {
   nea_sub_t *s = NULL;
@@ -953,7 +953,7 @@
 	continue;
       break;			/* This  */
     }
-  
+
   if (s) {
     nea_event_queue_t *evq0 = su_alloc(nes->nes_home, sizeof *evq);
 
@@ -963,7 +963,7 @@
     *evq0 = *evq, evq = evq0;
 
     /* evq should be copy of old head but with changed payload  */
-    assert(evq->evq_next == evv->evv_head->evq_next); 
+    assert(evq->evq_next == evv->evv_head->evq_next);
 
     evv->evv_head->evq_next = evq;     /* insert to the queue */
 
@@ -977,7 +977,7 @@
 
 /** Remove old unneeded notifications. */
 static
-int nea_view_dequeue(nea_server_t *nes, 
+int nea_view_dequeue(nea_server_t *nes,
 		     nea_event_t *ev)
 {
   int i;
@@ -1011,7 +1011,7 @@
 
 /** Notify watchers.
  *
- * @return 
+ * @return
  * The function nea_server_notify() returns number of subscribers that the
  * notification could be sent, or -1 upon an error.
  */
@@ -1045,11 +1045,11 @@
     if (ev == NULL)
       for (ev = nes->nes_events; ev; ev = ev->ev_next) {
 	nea_view_dequeue(nes, ev);
-	SU_DEBUG_3(("nea_server(): notified %u, throttling at %u\n", 
+	SU_DEBUG_3(("nea_server(): notified %u, throttling at %u\n",
 		    notified, ev->ev_throttling));
       }
     else {
-      SU_DEBUG_3(("nea_server(): notified %u, throttling at %u\n", 
+      SU_DEBUG_3(("nea_server(): notified %u, throttling at %u\n",
 		  notified, ev->ev_throttling));
       nea_view_dequeue(nes, ev);
     }
@@ -1087,7 +1087,7 @@
 	nea_sub_destroy(*ss);
 	continue;
       }
-    } 
+    }
     ss = &((*ss)->s_next);
   }
 }
@@ -1127,7 +1127,7 @@
     nes->nes_subscribers = s;
 
     /* Copy default values */
-    s->s_throttle = nes->nes_throttle;	
+    s->s_throttle = nes->nes_throttle;
   }
 
   return s;
@@ -1180,9 +1180,9 @@
     su_free(home, del->s_local), del->s_local = NULL;
     su_free(home, del->s_remote), del->s_remote = NULL;
 
-    if (del->s_oreq) 
+    if (del->s_oreq)
       nta_outgoing_destroy(del->s_oreq), del->s_oreq = NULL;
-    if (del->s_leg) 
+    if (del->s_leg)
       nta_leg_destroy(del->s_leg), del->s_leg = NULL;
     if (del->s_from)
       su_free(home, del->s_from), del->s_from = NULL;
@@ -1198,14 +1198,14 @@
 nea_event_t *nea_event_create(nea_server_t *nes,
 			      nea_watcher_f *callback,
 			      nea_emagic_t *context,
-			      char const *name, 
+			      char const *name,
 			      char const *subname,
 			      char const *default_content_type,
 			      char const *accept)
 {
-  return nea_event_tcreate(nes, callback, context, 
-			   name, subname, 
-			   SIPTAG_CONTENT_TYPE_STR(default_content_type), 
+  return nea_event_tcreate(nes, callback, context,
+			   name, subname,
+			   SIPTAG_CONTENT_TYPE_STR(default_content_type),
 			   SIPTAG_ACCEPT_STR(accept),
 			   TAG_END());
 }
@@ -1214,7 +1214,7 @@
 nea_event_t *nea_event_tcreate(nea_server_t *nes,
 			       nea_watcher_f *callback,
 			       nea_emagic_t *context,
-			       char const *name, 
+			       char const *name,
 			       char const *subname,
 			       tag_type_t tag, tag_value_t value, ...)
 {
@@ -1253,7 +1253,7 @@
     sip_supported_t const *k = NULL;
     sip_require_t const *rq = NULL;
     char const *ct_str = NULL, *ac_str = NULL, *k_str = NULL, *rq_str = NULL;
-    
+
     unsigned throttle = nes->nes_throttle, min_throttle = nes->nes_min_throttle;
     int eventlist = nes->nes_eventlist;
 
@@ -1274,11 +1274,11 @@
 
     ev->ev_callback = callback;
     ev->ev_magic = context;
-    ev->ev_event = sip_event_format(nes->nes_home, "%s%s%s", 
-				    name, 
-				    subname ? "." : "", 
+    ev->ev_event = sip_event_format(nes->nes_home, "%s%s%s",
+				    name,
+				    subname ? "." : "",
 				    subname ? subname : "");
- 
+
     ev->ev_reliable = reliable != 0;
     ev->ev_throttle = throttle;
     ev->ev_min_throttle = min_throttle;
@@ -1294,15 +1294,15 @@
 
     if (ev->ev_event) {
 #define sip_allow_events_find(k, i) sip_params_find(k->k_items, i)
-      if (!sip_allow_events_find(nes->nes_allow_events, 
+      if (!sip_allow_events_find(nes->nes_allow_events,
 				 ev->ev_event->o_type))
-	sip_allow_events_add(nes->nes_home, nes->nes_allow_events, 
+	sip_allow_events_add(nes->nes_home, nes->nes_allow_events,
 			     ev->ev_event->o_type);
     }
 
     if (ct)
       ev->ev_default = sip_accept_make(nes->nes_home, ct->c_type);
-    else 
+    else
       ev->ev_default = sip_accept_make(nes->nes_home, ct_str);
 
     if (ac == NULL && ac_str == NULL)
@@ -1319,7 +1319,7 @@
       ev->ev_supported = sip_supported_make(nes->nes_home, k_str);
 
     ev->ev_prev = pev;
-    *pev = ev; 
+    *pev = ev;
   }
 
   ta_end(ta);
@@ -1370,8 +1370,8 @@
 
 /** Invoke the event callback.
  *
- * The function nes_watcher_callback() calls the callback provided by the 
- * application using the notifier object. 
+ * The function nes_watcher_callback() calls the callback provided by the
+ * application using the notifier object.
  *
  * @param nes pointer to notifier object
  * @param ev  pointer to event view
@@ -1383,9 +1383,9 @@
  * has been destroyed by the callback function, 0 otherwise.
  */
 static
-int nes_watcher_callback(nea_server_t *nes, 
-			 nea_event_t *ev, 
-			 nea_sub_t *s, 
+int nes_watcher_callback(nea_server_t *nes,
+			 nea_event_t *ev,
+			 nea_sub_t *s,
 			 sip_t const *sip,
 			 sip_time_t now)
 {
@@ -1395,7 +1395,7 @@
       nea_subnode_t sn[1];
 
       nea_subnode_init(sn, s, now);
-      
+
       if (sn->sn_expires == 0  || sn->sn_state == nea_terminated)
 	s->s_reported = 1;
 
@@ -1405,12 +1405,12 @@
 
     if (nes->nes_in_list)
       return 0;
-    
+
     if (nes->nes_pending_destroy) {
       nea_server_destroy(nes);
       return -2;
     }
-    
+
     if (sip == NULL && nes->nes_pending_flush) {
       int flushed = s->s_pending_flush;
       nea_server_pending_flush(nes);
@@ -1429,18 +1429,18 @@
  *
  * The function nea_server_add() is called when the notifier receives a
  * SUBSCRIBE request without existing event dialog.
- * 
+ *
  * @param nes pointer to notifier
- * @param local_target optional contact header 
+ * @param local_target optional contact header
  * @param msg pointer to request message
  * @param sip pointer to SIP view to request message
  *
- * @return 
+ * @return
  * The function nea_server_add() returns 0 if successful, -1 upon an
  * error.
- *  
+ *
  */
-int nea_server_add(nea_server_t *nes, 
+int nea_server_add(nea_server_t *nes,
 		   sip_contact_t const *local_target,
 		   msg_t *msg, sip_t *sip)
 {
@@ -1480,7 +1480,7 @@
 static
 int nea_server_callback(nea_sub_t *nes_as_sub,
 			nta_leg_t *leg,
-			nta_incoming_t *irq, 
+			nta_incoming_t *irq,
 			sip_t const *sip)
 {
   return nea_server_add_irq((nea_server_t *)nes_as_sub, leg, NULL, irq, sip);
@@ -1490,7 +1490,7 @@
 int nea_server_add_irq(nea_server_t *nes,
 		       nta_leg_t *leg,
 		       sip_contact_t const *local_target,
-		       nta_incoming_t *irq, 
+		       nta_incoming_t *irq,
 		       sip_t const *sip)
 {
   nea_sub_t *s = nea_sub_create(nes);
@@ -1506,10 +1506,10 @@
 
   if (leg == NULL || leg == nes->nes_leg) {
     url_t target[1];
-    
+
     *target = *local_target->m_url;
 
-    s->s_leg = nta_leg_tcreate(nes->nes_agent, nea_sub_process_incoming, s, 
+    s->s_leg = nta_leg_tcreate(nes->nes_agent, nea_sub_process_incoming, s,
 			       SIPTAG_FROM(sip->sip_to),
 			       SIPTAG_TO(sip->sip_from),
 			       SIPTAG_CALL_ID(sip->sip_call_id),
@@ -1519,7 +1519,7 @@
   else {
     nta_leg_bind(s->s_leg = leg, nea_sub_process_incoming, s);
   }
-  
+
   if (s->s_leg) {
     if (sip->sip_to->a_tag == NULL) {
       nta_leg_tag(s->s_leg, NULL);
@@ -1568,7 +1568,7 @@
     break;
 
   default:
-    nta_incoming_treply(irq, 
+    nta_incoming_treply(irq,
 			retval = SIP_405_METHOD_NOT_ALLOWED,
 			SIPTAG_ALLOW_STR("SUBSCRIBE"),
 			TAG_END());
@@ -1579,7 +1579,7 @@
 
   if (s->s_irq)
     nta_incoming_destroy(irq), s->s_irq = NULL;
-  
+
   if (s->s_pending_flush || s->s_state == nea_embryonic)
     nea_sub_destroy(s);
 
@@ -1624,7 +1624,7 @@
   int once, what, supported_eventlist, require_eventlist;
 
   if (sip->sip_payload && !sip->sip_content_type) {
-    nta_incoming_treply(irq, 400, "Missing Content-Type", 
+    nta_incoming_treply(irq, 400, "Missing Content-Type",
 			SIPTAG_SERVER_STR(nes->nes_server),
 			SIPTAG_ALLOW_EVENTS(nes->nes_allow_events),
 			SIPTAG_ALLOW(nes->nes_allow_methods),
@@ -1632,16 +1632,16 @@
     return 0;
   }
 
-  if (sip->sip_expires && 
-      sip->sip_expires->ex_delta > 0 && 
+  if (sip->sip_expires &&
+      sip->sip_expires->ex_delta > 0 &&
       sip->sip_expires->ex_delta < nes->nes_min_expires) {
-    sip_min_expires_t me[1]; 
+    sip_min_expires_t me[1];
 
     sip_min_expires_init(me);
 
     me->me_delta = nes->nes_min_expires;
 
-    nta_incoming_treply(irq, 423, "Subscription Interval Too Small", 
+    nta_incoming_treply(irq, 423, "Subscription Interval Too Small",
 			SIPTAG_ACCEPT(accept),
 			SIPTAG_MIN_EXPIRES(me),
 			SIPTAG_SERVER_STR(nes->nes_server),
@@ -1653,13 +1653,13 @@
 
   /* Check features */
   if (nes->nes_require) {
-    unsupported = sip_has_unsupported2(nes->nes_home, 
+    unsupported = sip_has_unsupported2(nes->nes_home,
 				       sip->sip_supported,
 				       sip->sip_require,
 				       nes->nes_require);
 
     if (unsupported) {
-      nta_incoming_treply(irq, SIP_421_EXTENSION_REQUIRED, 
+      nta_incoming_treply(irq, SIP_421_EXTENSION_REQUIRED,
 			  SIPTAG_REQUIRE(nes->nes_require),
 			  SIPTAG_UNSUPPORTED(unsupported),
 			  SIPTAG_SERVER_STR(nes->nes_server),
@@ -1676,12 +1676,12 @@
   require_eventlist = sip_has_feature(sip->sip_require, "eventlist");
   supported_eventlist = supported_eventlist || require_eventlist;
 
-  if (s->s_id && (!sip->sip_event || 
+  if (s->s_id && (!sip->sip_event ||
 		  str0cmp(s->s_id->o_type, sip->sip_event->o_type) != 0 ||
 		  str0cmp(s->s_id->o_id, sip->sip_event->o_id))) {
     /* Multiple subscriptions per dialog are not supported. */
-    return nta_incoming_treply(irq, 501, 
-			       "Multiple subscriptions not implemented", 
+    return nta_incoming_treply(irq, 501,
+			       "Multiple subscriptions not implemented",
 			       SIPTAG_SERVER_STR(nes->nes_server),
 			       TAG_NULL());
   }
@@ -1709,13 +1709,13 @@
 
     if (!ev && !require_eventlist)
       ev = ev_maybe;
-          
+
     if (ev || once)
       break;
 
     /* Ask the application either to
-       1) add a new event or assing us an event/payload (0), 
-       2) take care of transaction (positive), or 
+       1) add a new event or assing us an event/payload (0),
+       2) take care of transaction (positive), or
        3) drop request (negative).
     */
     if ((what = nes_new_event_callback(nes, &ev, &evv, irq, sip)) < 0)
@@ -1727,7 +1727,7 @@
   }
 
   if (ev_maybe == NULL && ev == NULL) {
-    nta_incoming_treply(irq, SIP_489_BAD_EVENT, 
+    nta_incoming_treply(irq, SIP_489_BAD_EVENT,
 			SIPTAG_SERVER_STR(nes->nes_server),
 			SIPTAG_ALLOW_EVENTS(nes->nes_allow_events),
 			SIPTAG_ALLOW(nes->nes_allow_methods),
@@ -1739,7 +1739,7 @@
     unsupported = sip_has_unsupported(nes->nes_home, ev->ev_supported,
 				      sip->sip_require);
 
-    nta_incoming_treply(irq, SIP_420_BAD_EXTENSION, 
+    nta_incoming_treply(irq, SIP_420_BAD_EXTENSION,
 			SIPTAG_UNSUPPORTED(unsupported),
 			SIPTAG_REQUIRE(ev->ev_require),
 			SIPTAG_SUPPORTED(ev->ev_supported),
@@ -1775,12 +1775,12 @@
 	  /* Sort the accept list by Q values */
 	  for (a = a0, accept = NULL; a; a = a_next) {
 	    a_next = a->ac_next;
-	    
-	    for (aa = (sip_accept_t **)&accept; 
-		 *aa && sip_q_value((*aa)->ac_q) >= sip_q_value(a->ac_q); 
+
+	    for (aa = (sip_accept_t **)&accept;
+		 *aa && sip_q_value((*aa)->ac_q) >= sip_q_value(a->ac_q);
 		 aa = &(*aa)->ac_next)
 	      ;
-	    
+
 	    a->ac_next = *aa; *aa = a; 	/* Insert */
 	  }
 	}
@@ -1795,11 +1795,11 @@
 
       if (ac->ac_type == NULL || ac->ac_subtype == NULL)
 	continue;
-      
+
       /* Check all supported content types v. accept */
       for (i = 0; (evv = ev->ev_views[i]); i++) {
 	assert(evv->evv_content_type && evv->evv_content_type->c_type);
-	
+
 	if (strcmp(ac->ac_type, "*/*") == 0)
 	  break;
 
@@ -1807,7 +1807,7 @@
 
 	if ((strcasecmp(ac->ac_type, type) == 0) ||
 	    (strcasecmp(ac->ac_subtype, "*") == 0 &&
-	     strncasecmp(ac->ac_type, type, 
+	     strncasecmp(ac->ac_type, type,
 			 ac->ac_subtype - ac->ac_type) == 0)) {
 	  if (evv_maybe == NULL)
 	    evv_maybe = evv;
@@ -1820,17 +1820,17 @@
 
     /* Free the sorted Accept list */
     for (a = a0; a; a = a_next)
-      a_next = a->ac_next, su_free(home, a); 
+      a_next = a->ac_next, su_free(home, a);
 
     if (!evv)
       evv = evv_maybe;
-  
+
     if (evv || once)
       break;
 
     /* Ask the application either to
-       1) add a new event view or assign us an event view (0), 
-       2) take care of transaction (positive), or 
+       1) add a new event view or assign us an event view (0),
+       2) take care of transaction (positive), or
        3) drop request (negative).
     */
     if ((what = nes_new_event_callback(nes, &ev, &evv, irq, sip)) < 0)
@@ -1846,7 +1846,7 @@
 		ev->ev_event->o_type, SIP_406_NOT_ACCEPTABLE));
 
     /* There is no media acceptable to watcher */
-    return nta_incoming_treply(irq, SIP_406_NOT_ACCEPTABLE, 
+    return nta_incoming_treply(irq, SIP_406_NOT_ACCEPTABLE,
 			       SIPTAG_ACCEPT(ev->ev_accept),
 			       SIPTAG_SERVER_STR(nes->nes_server),
 			       SIPTAG_ALLOW_EVENTS(nes->nes_allow_events),
@@ -1859,7 +1859,7 @@
     evv = s->s_view;
 
   /* Set throttle */
-  if (sip->sip_event && 
+  if (sip->sip_event &&
       (throttle = sip_params_find(sip->sip_event->o_params, "throttle="))) {
     proposed_throttle = strtoul(throttle, NULL, 10);
 
@@ -1902,7 +1902,7 @@
   s->s_updated = evv->evv_updated - 1;  /* Force notify */
 
   if (nes->nes_202_before_notify) {
-    nta_incoming_treply(irq, SIP_202_ACCEPTED, 
+    nta_incoming_treply(irq, SIP_202_ACCEPTED,
 			SIPTAG_SERVER_STR(nes->nes_server),
 			SIPTAG_ALLOW_EVENTS(nes->nes_allow_events),
 			SIPTAG_ALLOW(nes->nes_allow_methods),
@@ -1923,8 +1923,8 @@
     return -1;
   }
 
-  
-  
+
+
   evv = s->s_view;  /* Callback can change event view */
 
   if (s->s_state == nea_embryonic)
@@ -1935,11 +1935,11 @@
 
   if (irq) {
     if (s->s_rejected)
-      nta_incoming_treply(irq, SIP_403_FORBIDDEN, 
+      nta_incoming_treply(irq, SIP_403_FORBIDDEN,
 			  SIPTAG_SERVER_STR(nes->nes_server),
 			  TAG_END());
     else if (s->s_state == nea_active)
-      nta_incoming_treply(irq, SIP_200_OK, 
+      nta_incoming_treply(irq, SIP_200_OK,
 			  SIPTAG_REQUIRE(ev->ev_require),
 			  SIPTAG_SUPPORTED(ev->ev_supported),
 			  SIPTAG_EXPIRES(expires),
@@ -1949,7 +1949,7 @@
 			  SIPTAG_ALLOW(nes->nes_allow_methods),
 			  TAG_END());
     else
-      nta_incoming_treply(irq, SIP_202_ACCEPTED, 
+      nta_incoming_treply(irq, SIP_202_ACCEPTED,
 			  SIPTAG_REQUIRE(ev->ev_require),
 			  SIPTAG_SUPPORTED(ev->ev_supported),
 			  SIPTAG_EXPIRES(expires),
@@ -1964,7 +1964,7 @@
 }
 
 /* ----------------------------------------------------------------- */
-/**Notify subscriber 
+/**Notify subscriber
  *
  * The function nea_sub_notify() sends a notification to the subscriber. The
  * event type is specified by subscriber event, payload type and payload in
@@ -1973,12 +1973,12 @@
  *
  * @param nes pointer to the notifier object
  * @param s   pointer to the subscription object
- * @param now current SIP time (if 0, no body is sent, 
+ * @param now current SIP time (if 0, no body is sent,
  *            but updated Subscription-State header only
  * @param tag,value,... tag list
  *
  */
-int nea_sub_notify(nea_server_t *nes, nea_sub_t *s, 
+int nea_sub_notify(nea_server_t *nes, nea_sub_t *s,
 		   sip_time_t now,
 		   tag_type_t tag, tag_value_t value, ...)
 {
@@ -1999,7 +1999,7 @@
 
   assert(s->s_view); assert(ev);
 
-  if (suppress && s->s_view->evv_updated == s->s_updated) 
+  if (suppress && s->s_view->evv_updated == s->s_updated)
     return 0;
 
   if (now == 0)
@@ -2007,7 +2007,7 @@
 
   if (s->s_notified + s->s_throttle > now &&
       /* Do not throttle state termination notification */
-      substate != nea_terminated && 
+      substate != nea_terminated &&
       (long)(s->s_expires - now) > 0) {
     if (ev->ev_throttling > s->s_updated && !s->s_fake)
       ev->ev_throttling = s->s_updated;
@@ -2034,7 +2034,7 @@
 
     sip_subscription_state_init(ss);
 
-    tl_gets(ta_args(ta), 
+    tl_gets(ta_args(ta),
 	    NEATAG_REASON_REF(reason),
 	    NEATAG_FAKE_REF(fake), /* XXX - semantics??? */
 	    NEATAG_RETRY_AFTER_REF(retry_after),
@@ -2042,10 +2042,10 @@
 
     if (substate == nea_terminated) {
       if (reason)
-	snprintf(reason_buf, sizeof(reason_buf), 
+	snprintf(reason_buf, sizeof(reason_buf),
 		 "reason=%s", reason), params[i++] = reason_buf;
       if (retry_after != (unsigned)-1)
-	snprintf(retry_after_buf, sizeof(retry_after_buf), 
+	snprintf(retry_after_buf, sizeof(retry_after_buf),
 		 "retry-after=%u", retry_after), params[i++] = retry_after_buf;
     }
     else if ((long)(s->s_expires - now) <= 0) {
@@ -2065,10 +2065,10 @@
     case nea_pending:  ss->ss_substate = "pending"; break;
     case nea_active:   ss->ss_substate = "active"; break;
     case nea_terminated: ss->ss_substate = "terminated"; break;
-      /* Do not send notifys for embryonic subscriptions */      
+      /* Do not send notifys for embryonic subscriptions */
     case nea_embryonic:
       ta_end(ta);
-      return 0; 
+      return 0;
     }
 
     callback = substate != nea_terminated ? response_to_notify : NULL;
@@ -2082,9 +2082,9 @@
 
     n_evq = evq->evq_payload ? evq : evv->evv_primary->evv_head;
 
-    s->s_oreq = 
-      nta_outgoing_tcreate(s->s_leg, 
-			   callback, s, NULL, 
+    s->s_oreq =
+      nta_outgoing_tcreate(s->s_leg,
+			   callback, s, NULL,
 			   SIP_METHOD_NOTIFY, NULL,
 			   SIPTAG_SUBSCRIPTION_STATE(ss),
 			   SIPTAG_REQUIRE(ev->ev_require),
@@ -2092,11 +2092,11 @@
 			   SIPTAG_USER_AGENT_STR(nes->nes_server),
 			   SIPTAG_CONTACT(s->s_local),
 			   SIPTAG_EVENT(s->s_id),
-			   TAG_IF(!suppress, 
+			   TAG_IF(!suppress,
 				  SIPTAG_CONTENT_TYPE(n_evq->evq_content_type)),
 			   TAG_IF(!suppress,
 				  SIPTAG_PAYLOAD(n_evq->evq_payload)),
-			   ta_tags(ta)); 
+			   ta_tags(ta));
 
 
     notified = s->s_oreq != 0;
@@ -2123,8 +2123,8 @@
 
 /* ----------------------------------------------------------------- */
 /**Process responses to the NOTIFY.
- * 
- * The response_to_notify() processes the responses to the NOTIFY request. 
+ *
+ * The response_to_notify() processes the responses to the NOTIFY request.
  * If there was an error with delivering the NOTIFY, the subscription is
  * considered terminated.
  *
@@ -2172,7 +2172,7 @@
  *
  * @param nes notifier
  * @param ev  event
- * 
+ *
  * The function nea_server_active() returns number of active subscribers.
  */
 int nea_server_active(nea_server_t *nes, nea_event_t const *ev)
@@ -2182,7 +2182,7 @@
 
   /* Count the number of subscribers watching this event */
   for (s = nes->nes_subscribers; s ; s = s->s_next)
-    if (!s->s_pending_flush && s->s_state == nea_active 
+    if (!s->s_pending_flush && s->s_state == nea_active
 	&& (ev == NULL || ev == s->s_event))
       n++;
 
@@ -2198,7 +2198,7 @@
  *
  * @param nes notifier
  * @param ev  event view
- * 
+ *
  * The function nea_server_active() returns number of active subscribers.
  */
 int nea_server_non_embryonic(nea_server_t *nes, nea_event_t const *ev)
@@ -2208,7 +2208,7 @@
 
   /* Count the number of subscribers watching this event */
   for (s = nes->nes_subscribers; s ; s = s->s_next)
-    if (!s->s_pending_flush && s->s_state != nea_embryonic 
+    if (!s->s_pending_flush && s->s_state != nea_embryonic
 	&& (ev == NULL || ev == s->s_event))
       n++;
 
@@ -2248,7 +2248,7 @@
  * @retval 0 if successful
  * @retval -1 upon an error
  */
-int nea_sub_auth(nea_sub_t *s, 
+int nea_sub_auth(nea_sub_t *s,
 		 nea_state_t state,
 		 tag_type_t tag, tag_value_t value, ...)
 {
@@ -2289,9 +2289,9 @@
   }
 
   tl_gets(ta_args(ta), NEATAG_REASON_REF(reason), TAG_END());
-  
+
   rejected = reason && strcasecmp(reason, "rejected") == 0;
-  
+
   if (state == nea_terminated && embryonic && rejected && s->s_irq)
     retval = 0, s->s_rejected = 1;
   else
@@ -2303,7 +2303,7 @@
 }
 
 /** Obtain a list of subscribers */
-nea_subnode_t const **nea_server_get_subscribers(nea_server_t *nes, 
+nea_subnode_t const **nea_server_get_subscribers(nea_server_t *nes,
 						 nea_event_t const *ev)
 {
   nea_sub_t *s;
@@ -2315,13 +2315,13 @@
   if (n == 0)
     return NULL;
 
-  sn_list = su_zalloc(nes->nes_home, 
+  sn_list = su_zalloc(nes->nes_home,
 		      (n + 1) * sizeof(sn) + n * sizeof(*sn));
   if (sn_list) {
     sn = (nea_subnode_t *)(sn_list + n + 1);
 
     for (i = 0, s = nes->nes_subscribers; s; s = s->s_next) {
-      if (!s->s_pending_flush && s->s_state != nea_embryonic 
+      if (!s->s_pending_flush && s->s_state != nea_embryonic
 	  && (ev == NULL || ev == s->s_event)) {
 	assert(i < n);
 	nea_subnode_init(sn, s, now);
@@ -2338,7 +2338,7 @@
 }
 
 /** Free a list of subscriptions. */
-void nea_server_free_subscribers(nea_server_t *nes, 
+void nea_server_free_subscribers(nea_server_t *nes,
 				 nea_subnode_t const **sn_list)
 {
   if (sn_list) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/sofia-sip/nea.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/sofia-sip/nea.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nea/sofia-sip/nea.h	Tue Dec 23 07:37:03 2008
@@ -67,19 +67,19 @@
 /** Event view. */
 typedef struct nea_event_view_s nea_event_view_t;
 
-#ifndef NEA_SMAGIC_T 
+#ifndef NEA_SMAGIC_T
 #define NEA_SMAGIC_T            struct nea_smagic_t
 #endif
 /** NEA server context */
 typedef NEA_SMAGIC_T nea_smagic_t;
 
-#ifndef NEA_EMAGIC_T 
+#ifndef NEA_EMAGIC_T
 #define NEA_EMAGIC_T            struct nea_emagic_t
 #endif
 /** NEA server event context */
 typedef NEA_EMAGIC_T nea_emagic_t;
 
-#ifndef NEA_EVMAGIC_T 
+#ifndef NEA_EVMAGIC_T
 #define NEA_EVMAGIC_T           struct nea_evmagic_t
 #endif
 /** Event view context */
@@ -88,7 +88,7 @@
 /** Description of subscription */
 typedef struct nea_subnode_t {
   nea_state_t          sn_state;       	/**< Subscription state */
-  unsigned             sn_fake;	       	/**< True if subscriber is given 
+  unsigned             sn_fake;	       	/**< True if subscriber is given
 				       	 *   fake contents.
 				       	 */
   unsigned             sn_eventlist;    /**< Subscriber supports eventlist */
@@ -98,7 +98,7 @@
   sip_contact_t const *sn_contact;     	/**< Contact of subscriber */
 
   /** Content-Type of SUBSCRIBE body (filter). */
-  sip_content_type_t const *sn_content_type; 
+  sip_content_type_t const *sn_content_type;
   sip_payload_t const *sn_payload;      /**< Body of subscribe*/
 
   unsigned             sn_expires;     	/**< When subscription expires */
@@ -123,7 +123,7 @@
  *
  * @retval 1 application takes care of responding to request
  * @retval 0 application has added new event or payload format
- * @retval -1 nea server rejects request 
+ * @retval -1 nea server rejects request
  */
 typedef int (nea_new_event_f)(nea_smagic_t *context,
 			      nea_server_t *nes,
@@ -166,7 +166,7 @@
 int nea_server_add_irq(nea_server_t *nes,
 		       nta_leg_t *leg,
 		       sip_contact_t const *local_target,
-		       nta_incoming_t *irq, 
+		       nta_incoming_t *irq,
 		       sip_t const *sip);
 
 /** QAUTH callback function type.
@@ -189,7 +189,7 @@
 nea_event_t *nea_event_create(nea_server_t *nes,
 			      nea_watcher_f *callback,
 			      nea_emagic_t *context,
-			      char const *name, 
+			      char const *name,
 			      char const *subname,
 			      char const *default_content_type,
 			      char const *accept);
@@ -199,7 +199,7 @@
 nea_event_t *nea_event_tcreate(nea_server_t *nes,
 			       nea_watcher_f *callback,
 			       nea_emagic_t *context,
-			       char const *name, 
+			       char const *name,
 			       char const *subname,
 			       tag_type_t, tag_value_t, ...);
 
@@ -215,10 +215,10 @@
 /** Get number of (non-embryonic) subscribers. */
 int nea_server_non_embryonic(nea_server_t *nes, nea_event_t const *ev);
 
-/** Obtain a list of subscriptions. 
+/** Obtain a list of subscriptions.
  */
 SOFIAPUBFUN
-nea_subnode_t const **nea_server_get_subscribers(nea_server_t *nes, 
+nea_subnode_t const **nea_server_get_subscribers(nea_server_t *nes,
 						 nea_event_t const *ev);
 
 /** Free a list of subscriptions. */
@@ -227,12 +227,12 @@
 
 /** Notify subscribers */
 SOFIAPUBFUN
-int nea_server_notify(nea_server_t *nes, 
+int nea_server_notify(nea_server_t *nes,
 		      nea_event_t *ev);
 
 /** Notify a subscriber */
 SOFIAPUBFUN
-int nea_server_notify_one(nea_server_t *nes, 
+int nea_server_notify_one(nea_server_t *nes,
 			  nea_event_t *ev,
 			  nea_sub_t *ns);
 
@@ -257,12 +257,12 @@
 #if 0
 /** Do a remote qauth.
  *
- * The function nea_server_qauth() is given as q_callback pointer 
+ * The function nea_server_qauth() is given as q_callback pointer
  * to nea_server_create() if remote authentication from url is desired.
  */
-void nea_server_qauth(nea_server_t *nes, 
+void nea_server_qauth(nea_server_t *nes,
 		      nea_emagic_t *context,
-		      nea_sub_t *subscriber, 
+		      nea_sub_t *subscriber,
 		      sip_t const *sip);
 #endif
 
@@ -329,7 +329,7 @@
 /** NEA Event Watcher */
 typedef struct nea_s     nea_t;
 
-#ifndef NEA_MAGIC_T 
+#ifndef NEA_MAGIC_T
 #define NEA_MAGIC_T struct nea_magic_t
 #endif
 
@@ -337,7 +337,7 @@
 typedef NEA_MAGIC_T          nea_magic_t;
 
 /** Event notification callback type.
- * 
+ *
  * This callback is called also when initial or refresh subscribe transaction
  * completes with the transaction result in @a sip.
  */
@@ -360,7 +360,7 @@
 
 /** Update SUBSCRIBE payload (filter rules) */
 SOFIAPUBFUN
-int nea_update(nea_t *nea, 
+int nea_update(nea_t *nea,
 	       tag_type_t tag,
 	       tag_value_t value,
 	       ...);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/Doxyfile.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/Doxyfile.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/Doxyfile.in	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 PROJECT_NAME         = "nta"
 OUTPUT_DIRECTORY     = ../docs/html/nta
 
-INPUT 		     = @srcdir@/nta.docs @srcdir@/sofia-sip @srcdir@ . 
+INPUT 		     = @srcdir@/nta.docs @srcdir@/sofia-sip @srcdir@ .
 
 @INCLUDE_PATH = . @srcdir@
 @INCLUDE = ../docs/Doxyfile.conf

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -27,7 +27,7 @@
 dist_noinst_SCRIPTS =	run_test_nta_api run_test_nta
 
 TESTS =			run_test_nta_api run_test_nta
-TESTS_ENVIRONMENT =	$(SHELL) 
+TESTS_ENVIRONMENT =	$(SHELL)
 
 # ----------------------------------------------------------------------
 # Rules for building the targets
@@ -37,7 +37,7 @@
 nobase_include_sofia_HEADERS = \
 			sofia-sip/nta.h sofia-sip/nta_stateless.h \
 			sofia-sip/nta_tport.h sofia-sip/nta_tag.h \
-			sofia-sip/sl_utils.h 
+			sofia-sip/sl_utils.h
 
 libnta_la_SOURCES = 	nta.c nta_check.c nta_tag.c nta_tag_ref.c \
 			nta_internal.h \
@@ -68,7 +68,7 @@
 
 EXTRA_DIST =		nta.docs sl_utils.docs \
 			agent.pem cafile.pem \
-			invite.msc $(BUILT_SOURCES) 
+			invite.msc $(BUILT_SOURCES)
 
 # ----------------------------------------------------------------------
 # Sofia specific rules

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/invite.msc
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/invite.msc	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/invite.msc	Tue Dec 23 07:37:03 2008
@@ -86,14 +86,14 @@
  |        |nta_leg_destroy            |          |
  |        |---------------------------|--------->|
  |        |             ¦             |          X
- |        X             ¦             |          
+ |        X             ¦             |
 
 
 User Agent Server Accepting a Call
 ----------------------------------
 
                     APP ¦ NTA
-User                  	¦	     NTA 
+User                  	¦	     NTA
 Agent                 	¦	    agent
  |                      ¦             |                INVITE
  |			¦             |<----------------------

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@CFILE nta.c
  * @brief Sofia SIP Transaction API implementation
- * 
+ *
  * This source file has been divided into sections as follows:
  * 1) agent
  * 2) tport handling
@@ -37,9 +37,9 @@
  * 9) resolving URLs for client transactions
  * 10) 100rel reliable responses (reliable)
  * 11) SigComp handling and public transport interface
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Jun 13 02:57:51 2000 ppessi
  */
 
@@ -67,13 +67,20 @@
 #include <sofia-sip/sip_status.h>
 
 #include <sofia-sip/hostdomain.h>
+#include <sofia-sip/url_tag.h>
 
 #include <sofia-sip/msg_addr.h>
 #include <sofia-sip/msg_parser.h>
 
+/* Resolver context type */
+#define SRES_CONTEXT_T    nta_outgoing_t
+
+/* We are customer of tport_t */
+#define TP_AGENT_T        nta_agent_t
+#define TP_MAGIC_T        sip_via_t
+#define TP_CLIENT_T       nta_outgoing_t
+
 #include "nta_internal.h"
-#include "sofia-sip/nta_stateless.h"
-#include "sofia-sip/url_tag.h"
 
 #include <stddef.h>
 #include <stdlib.h>
@@ -95,6 +102,461 @@
 
 #define NONE ((void *)-1)
 
+/* ------------------------------------------------------------------------- */
+
+/** Resolving order */
+enum nta_res_order_e
+{
+  nta_res_ip6_ip4,
+  nta_res_ip4_ip6,
+  nta_res_ip6_only,
+  nta_res_ip4_only
+};
+
+HTABLE_DECLARE_WITH(leg_htable, lht, nta_leg_t, size_t, hash_value_t);
+HTABLE_DECLARE_WITH(outgoing_htable, oht, nta_outgoing_t, size_t, hash_value_t);
+HTABLE_DECLARE_WITH(incoming_htable, iht, nta_incoming_t, size_t, hash_value_t);
+
+typedef struct outgoing_queue_t {
+  nta_outgoing_t **q_tail;
+  nta_outgoing_t  *q_head;
+  size_t           q_length;
+  unsigned         q_timeout;
+} outgoing_queue_t;
+
+typedef struct incoming_queue_t {
+  nta_incoming_t **q_tail;
+  nta_incoming_t  *q_head;
+  size_t           q_length;
+  unsigned         q_timeout;
+} incoming_queue_t;
+
+struct nta_agent_s
+{
+  su_home_t             sa_home[1];
+  su_root_t            *sa_root;
+  su_timer_t           *sa_timer;
+  nta_agent_magic_t    *sa_magic;
+  nta_message_f        *sa_callback;
+
+  nta_update_magic_t   *sa_update_magic;
+  nta_update_tport_f   *sa_update_tport;
+
+  su_time_t             sa_now;	 /**< Timestamp in microsecond resolution. */
+  uint32_t              sa_next; /**< Timestamp for next agent_timer. */
+  uint32_t              sa_millisec; /**< Timestamp in milliseconds. */
+
+  msg_mclass_t const   *sa_mclass;
+  uint32_t sa_flags;		/**< SIP message flags */
+  unsigned sa_preload;		/**< Memory preload for SIP messages. */
+
+  tport_t              *sa_tports;
+  sip_contact_t        *sa_contact;
+  sip_via_t            *sa_vias;   /**< @Via headers for all transports */
+  sip_via_t            *sa_public_vias;   /**< @Vias for public transports */
+  sip_contact_t        *sa_aliases;/**< List of aliases for agent */
+
+  uint64_t              sa_branch; /**< Generator for branch parameters */
+  uint64_t              sa_tags;   /**< Generator for tag parameters */
+
+#if HAVE_SOFIA_SRESOLV
+  sres_resolver_t      *sa_resolver; /**< DNS resolver */
+  enum nta_res_order_e  sa_res_order;  /** Resolving order (AAAA/A) */
+#endif
+
+  url_t   *sa_default_proxy;	/**< Default outbound proxy */
+  unsigned sa_bad_req_mask;     /**< Request error mask */
+  unsigned sa_bad_resp_mask;	/**< Response error mask */
+  size_t   sa_maxsize;		/**< Maximum size of incoming messages */
+  size_t   sa_max_proceeding;	/**< Maximum size of proceeding queue */
+
+  unsigned sa_udp_mtu;		/**< Maximum size of outgoing UDP requests */
+
+  unsigned sa_t1;  /**< SIP T1 - initial retransmit interval (500 ms) */
+  unsigned sa_t2;  /**< SIP T2 - maximum retransmit interval (4000 ms) */
+  unsigned sa_t4;  /**< SIP T4 - clear message time (5000 ms) */
+
+
+  unsigned sa_t1x64; /**< SIP T1X64 - transaction lifetime (32 s) */
+
+  unsigned sa_progress;		/**< Progress timer.
+				   Interval between retransmitting
+				   provisional responses. */
+
+  unsigned sa_timer_c;		/**< SIP timer C.
+				   Maximum interval between receiving
+				   provisional responses. */
+
+  unsigned sa_graylist;		/**< Graylisting period */
+  unsigned sa_blacklist;	/**< Blacklisting period */
+
+  unsigned sa_drop_prob : 10;	/**< NTA is used to test packet drop */
+  unsigned sa_is_a_uas : 1;	/**< NTA is acting as an User Agent server */
+  unsigned sa_is_stateless : 1;	/**< Process requests statelessly
+				 *   unless they match existing dialog.
+				 */
+  unsigned sa_user_via:1;	/**< Let application provide @Via headers */
+  unsigned sa_extra_100:1;	/**< Allow NTA to return "100 Trying" response
+				 * even if application has not responded.
+				 */
+  unsigned sa_pass_100:1;	/**< Pass the "100 Trying"
+				 * provisional responses to the application
+				 */
+  unsigned sa_timeout_408:1;	/**< A "408 Request Timeout" message
+				 * is generated when outgoing request expires.
+				 */
+  unsigned sa_pass_408:1;	/**< A "408 Request Timeout" responses
+				 * are passed to client.
+				 */
+  unsigned sa_merge_482 : 1;	/**< A "482 Request Merged" response is returned
+				 * to merged requests.
+				 */
+  unsigned sa_cancel_2543 : 1;  /**< Send a CANCEL to an INVITE without
+				 * waiting for an provisional response.
+				 */
+  unsigned sa_cancel_487 : 1;	/**< Return 487 response automatically when
+				 * a CANCEL is received.
+				 */
+
+  unsigned sa_invite_100rel:1;	/**< Include 100rel in INVITE requests. */
+  unsigned sa_timestamp : 1;	/**< Insert @Timestamp in requests. */
+
+  unsigned sa_tport_ip4 : 1;	/**< Transports support IPv4. */
+  unsigned sa_tport_ip6 : 1;	/**< Transports support IPv6. */
+  unsigned sa_tport_udp : 1;	/**< Transports support UDP. */
+  unsigned sa_tport_tcp : 1;	/**< Transports support TCP. */
+  unsigned sa_tport_sctp : 1;	/**< Transports support SCTP. */
+  unsigned sa_tport_tls : 1;	/**< Transports support TLS. */
+
+  unsigned sa_use_naptr : 1;	/**< Use NAPTR lookup */
+  unsigned sa_use_srv : 1;	/**< Use SRV lookup */
+
+  unsigned sa_tport_threadpool:1; /**< Transports use threadpool */
+
+  unsigned sa_rport:1;		/**< Use rport at client */
+  unsigned sa_server_rport:2;	/**< Use rport at server */
+  unsigned sa_tcp_rport:1;	/**< Use rport with tcp, too */
+  unsigned sa_tls_rport:1;	/**< Use rport with tls, too */
+
+  unsigned sa_auto_comp:1;	/**< Automatically create compartments */
+  unsigned sa_in_timer:1;	/**< Set when executing timers */
+  unsigned sa_use_timer_c:1;	/**< Application has set value for timer C */
+
+  unsigned :0;
+
+#if HAVE_SMIME
+  sm_object_t          *sa_smime;
+#else
+  void                 *sa_smime;
+#endif
+
+  /** @MaxForwards */
+  sip_max_forwards_t    sa_max_forwards[1];
+
+  /** Name of SigComp algorithm */
+  char const           *sa_algorithm;
+  /** Options for SigComp. */
+  char const           *sa_sigcomp_options;
+  char const* const    *sa_sigcomp_option_list;
+  char const           *sa_sigcomp_option_free;
+
+  nta_compressor_t     *sa_compressor;
+
+  /* Statistics */
+  struct {
+    usize_t as_recv_msg;
+    usize_t as_recv_request;
+    usize_t as_recv_response;
+    usize_t as_bad_message;
+    usize_t as_bad_request;
+    usize_t as_bad_response;
+    usize_t as_drop_request;
+    usize_t as_drop_response;
+    usize_t as_client_tr;
+    usize_t as_server_tr;
+    usize_t as_dialog_tr;
+    usize_t as_acked_tr;
+    usize_t as_canceled_tr;
+    usize_t as_trless_request;
+    usize_t as_trless_to_tr;
+    usize_t as_trless_response;
+    usize_t as_trless_200;
+    usize_t as_merged_request;
+    usize_t as_sent_msg;
+    usize_t as_sent_request;
+    usize_t as_sent_response;
+    usize_t as_retry_request;
+    usize_t as_retry_response;
+    usize_t as_recv_retry;
+    usize_t as_tout_request;
+    usize_t as_tout_response;
+  }                  sa_stats[1];
+
+  /** Hash of dialogs. */
+  leg_htable_t          sa_dialogs[1];
+  /** Default leg */
+  nta_leg_t            *sa_default_leg;
+  /** Hash of legs without dialogs. */
+  leg_htable_t          sa_defaults[1];
+  /** Hash table for outgoing transactions */
+  outgoing_htable_t     sa_outgoing[1];
+  nta_outgoing_t       *sa_default_outgoing;
+  /** Hash table for incoming transactions */
+  incoming_htable_t     sa_incoming[1];
+  nta_incoming_t       *sa_default_incoming;
+
+  /* Queues (states) for outgoing client transactions */
+  struct {
+    /** Queue for retrying client transactions */
+    nta_outgoing_t   *re_list;
+    nta_outgoing_t  **re_t1;	        /**< Special place for T1 timer */
+    size_t            re_length;	/**< Length of sa_out.re_list */
+
+    outgoing_queue_t  delayed[1];
+    outgoing_queue_t  resolving[1];
+
+    outgoing_queue_t  trying[1];	/* Timer F/E */
+    outgoing_queue_t  completed[1];	/* Timer K */
+    outgoing_queue_t  terminated[1];
+
+    /* Special queues (states) for outgoing INVITE transactions */
+    outgoing_queue_t  inv_calling[1];	/* Timer B/A */
+    outgoing_queue_t  inv_proceeding[1]; /* Timer C */
+    outgoing_queue_t  inv_completed[1];	/* Timer D */
+
+    /* Temporary queue for transactions waiting to be freed */
+    outgoing_queue_t *free;
+  } sa_out;
+
+  /* Queues (states) for incoming server transactions */
+  struct {
+    /** Queue for retransmitting response of server transactions */
+    nta_incoming_t   *re_list;
+    nta_incoming_t  **re_t1;	        /**< Special place for T1 timer */
+    size_t            re_length;        /**< Length of sa_in.re_list */
+
+    incoming_queue_t  proceeding[1];	/**< Request received */
+    incoming_queue_t  preliminary[1];   /**< 100rel sent  */
+    incoming_queue_t  completed[1];	/**< Final answer sent (non-invite). */
+    incoming_queue_t  inv_completed[1];	/**< Final answer sent (INVITE). */
+    incoming_queue_t  inv_confirmed[1];	/**< Final answer sent, ACK recvd. */
+    incoming_queue_t  terminated[1];	/**< Terminated, ready to free. */
+    incoming_queue_t  final_failed[1];
+  } sa_in;
+
+  /* Special task for freeing memory */
+  su_clone_r          sa_terminator;
+};
+
+struct nta_leg_s
+{
+  su_home_t         leg_home[1];
+  hash_value_t      leg_hash;
+
+  unsigned leg_dialog : 1;
+  unsigned leg_stateless : 1;   /**< Process requests statelessly */
+#ifdef NTA_STRICT_ROUTING
+  unsigned leg_contact_set : 1;
+#else
+  unsigned leg_loose_route : 1; /**< Topmost route in set is LR */
+#endif
+  unsigned leg_local_is_to : 1; /**< Backwards-compatibility. */
+  unsigned leg_tagged : 1;	/**< Tagged after creation.
+				 *
+				 * Request missing @To tag matches
+				 * a tagged leg even after tagging.
+				 */
+  unsigned:0;
+  nta_request_f    *leg_callback;
+  nta_leg_magic_t  *leg_magic;
+  nta_agent_t      *leg_agent;
+
+  url_t const      *leg_url;	/**< Match incoming requests. */
+  char const       *leg_method;	/**< Match incoming requests. */
+
+  uint32_t	    leg_seq;    /**< Sequence number for next transaction */
+  uint32_t	    leg_rseq;   /**< Remote sequence number */
+  sip_call_id_t	   *leg_id;	/**< Call ID */
+  sip_from_t   	   *leg_remote;	/**< Remote address (@To/@From) */
+  sip_to_t     	   *leg_local;	/**< Local address (@From/@To) */
+
+  sip_route_t      *leg_route;  /**< @Route for outgoing requests. */
+  sip_contact_t    *leg_target; /**< Remote destination (from @Contact). */
+};
+
+struct nta_incoming_s
+{
+  su_home_t            *irq_home;
+  hash_value_t          irq_hash;
+  nta_agent_t          *irq_agent;
+  nta_ack_cancel_f     *irq_callback;
+  nta_incoming_magic_t *irq_magic;
+
+  /* Timeout/state queue */
+  nta_incoming_t      **irq_prev;
+  nta_incoming_t       *irq_next;
+  incoming_queue_t     *irq_queue;
+
+  /* Retry queue */
+  nta_incoming_t      **irq_rprev;
+  nta_incoming_t       *irq_rnext;
+
+  sip_method_t        	irq_method;
+  sip_request_t        *irq_rq;
+  sip_from_t           *irq_from;
+  sip_to_t             *irq_to;
+  char const           *irq_tag;
+  sip_cseq_t           *irq_cseq;
+  sip_call_id_t        *irq_call_id;
+  sip_via_t            *irq_via;
+  sip_record_route_t   *irq_record_route;
+  char const           *irq_branch;
+
+  uint32_t              irq_rseq;
+
+  sip_timestamp_t      *irq_timestamp;
+  su_time_t             irq_received;
+
+  uint32_t       	irq_timeout;    /**< Timer H, I, J */
+  uint32_t       	irq_retry;      /**< Timer G */
+  unsigned short      	irq_interval;	/**< Next timer  */
+
+  short               	irq_status;
+
+  unsigned irq_retries:8;
+  unsigned irq_default:1;	/**< Default transaction */
+  unsigned irq_canceled:1;	/**< Transaction is canceled */
+  unsigned irq_completed:1;	/**< Transaction is completed */
+  unsigned irq_confirmed:1;	/**< Response has been acked */
+  unsigned irq_terminated:1;	/**< Transaction is terminated */
+  unsigned irq_final_failed:1;	/**< Sending final response failed */
+  unsigned irq_destroyed :1;	/**< Transaction is destroyed */
+  unsigned irq_in_callback:1;	/**< Callback is being invoked */
+  unsigned irq_reliable_tp:1;	/**< Transport is reliable */
+  unsigned irq_sigcomp_zap:1;	/**< Reset SigComp */
+  unsigned irq_must_100rel:1;	/**< 100rel is required */
+  unsigned irq_tag_set:1;	/**< Tag is not from request */
+  unsigned :0;
+
+  tp_name_t             irq_tpn[1];
+  tport_t              *irq_tport;
+  struct sigcomp_compartment *irq_cc;
+  msg_t		       *irq_request;
+  msg_t		       *irq_request2;       /**< ACK/CANCEL */
+  msg_t		       *irq_response;
+
+  nta_reliable_t       *irq_reliable;       /**< List of reliable responses */
+};
+
+struct nta_reliable_s
+{
+  nta_reliable_t       *rel_next;
+  nta_incoming_t       *rel_irq;
+  nta_prack_f          *rel_callback;
+  nta_reliable_magic_t *rel_magic;
+  uint32_t              rel_rseq;
+  unsigned short        rel_status;
+  unsigned              rel_pracked:1;
+  unsigned              rel_precious:1;
+  msg_t                *rel_response;
+  msg_t                *rel_unsent;
+};
+
+typedef struct sipdns_resolver sipdns_resolver_t;
+
+struct nta_outgoing_s
+{
+  hash_value_t          orq_hash;    /**< Hash value */
+  nta_agent_t          *orq_agent;
+  nta_response_f       *orq_callback;
+  nta_outgoing_magic_t *orq_magic;
+
+  /* Timeout/state queue */
+  nta_outgoing_t      **orq_prev;
+  nta_outgoing_t       *orq_next;
+  outgoing_queue_t     *orq_queue;
+
+  /* Retry queue */
+  nta_outgoing_t      **orq_rprev;
+  nta_outgoing_t       *orq_rnext;
+
+  sip_method_t        	orq_method;
+  char const           *orq_method_name;
+  url_t const          *orq_url;        /**< Original RequestURI */
+
+  sip_from_t const     *orq_from;
+  sip_to_t const       *orq_to;
+  char const           *orq_tag;        /**< Tag from final response. */
+
+  sip_cseq_t const     *orq_cseq;
+  sip_call_id_t const  *orq_call_id;
+
+  msg_t		       *orq_request;
+  msg_t                *orq_response;
+
+  su_time_t             orq_sent;       /**< When request was sent? */
+  unsigned              orq_delay;      /**< RTT estimate */
+
+  uint32_t		orq_retry;	/**< Timer A, E */
+  uint32_t		orq_timeout;	/**< Timer B, D, F, K */
+
+  unsigned short      	orq_interval;	/**< Next timer A/E */
+
+  unsigned short      	orq_status;
+  unsigned char         orq_retries;    /**< Number of tries this far */
+  unsigned orq_default:1;	        /**< This is default transaction */
+  unsigned orq_inserted:1;
+  unsigned orq_resolved:1;
+  unsigned orq_prepared:1; /**< outgoing_prepare() called */
+  unsigned orq_canceled:1;
+  unsigned orq_terminated:1;
+  unsigned orq_destroyed:1;
+  unsigned orq_completed:1;
+  unsigned orq_delayed:1;
+  unsigned orq_stripped_uri:1;
+  unsigned orq_user_tport:1;	/**< Application provided tport - don't retry */
+  unsigned orq_try_tcp_instead:1;
+  unsigned orq_try_udp_instead:1;
+  unsigned orq_reliable:1; /**< Transport is reliable */
+  unsigned orq_ack_error:1; /**< ACK is sent by NTA */
+
+  /* Attributes */
+  unsigned orq_user_via:1;
+  unsigned orq_stateless:1;
+  unsigned orq_pass_100:1;
+  unsigned orq_sigcomp_new:1;	/**< Create compartment if needed */
+  unsigned orq_sigcomp_zap:1;	/**< Reset SigComp after completing */
+  unsigned orq_must_100rel:1;
+  unsigned orq_timestamp:1;	/**< Insert @Timestamp header. */
+  unsigned orq_100rel:1;	/**< Support 100rel */
+  unsigned:0;	/* pad */
+
+#if HAVE_SOFIA_SRESOLV
+  sipdns_resolver_t    *orq_resolver;
+#endif
+  enum nta_res_order_e  orq_res_order;  /**< AAAA/A first? */
+
+  url_t                *orq_route;      /**< Route URL */
+  tp_name_t             orq_tpn[1];     /**< Where to send request */
+  char const           *orq_scheme;     /**< Transport URL type */
+
+  tport_t              *orq_tport;
+  struct sigcomp_compartment *orq_cc;
+  tagi_t               *orq_tags;       /**< Tport tag items */
+  int                   orq_pending;    /**< Request is pending in tport */
+
+  char const           *orq_branch;	/**< Transaction branch */
+  char const           *orq_via_branch;	/**< @Via branch */
+
+  int                  *orq_status2b;   /**< Delayed response */
+
+  nta_outgoing_t       *orq_cancel;     /**< CANCEL transaction */
+
+  uint32_t              orq_rseq;       /**< Latest incoming rseq */
+};
+
+/* ------------------------------------------------------------------------- */
+
 /* Internal tags */
 
 /* Delay sending of request */
@@ -135,8 +597,8 @@
 					   tport_t const *tport,
 					   tp_client_t *via);
 
-static int complete_response(msg_t *response, 
-			     int status, char const *phrase, 
+static int complete_response(msg_t *response,
+			     int status, char const *phrase,
 			     msg_t *request);
 
 static int mreply(nta_agent_t *agent,
@@ -208,10 +670,10 @@
 static void incoming_free(nta_incoming_t *irq);
 su_inline void incoming_cut_off(nta_incoming_t *irq);
 su_inline void incoming_reclaim(nta_incoming_t *irq);
-static void incoming_queue_init(incoming_queue_t *, 
+static void incoming_queue_init(incoming_queue_t *,
 				unsigned timeout);
-static void incoming_queue_adjust(nta_agent_t *sa, 
-				  incoming_queue_t *queue, 
+static void incoming_queue_adjust(nta_agent_t *sa,
+				  incoming_queue_t *queue,
 				  unsigned timeout);
 
 static nta_incoming_t *incoming_find(nta_agent_t const *agent,
@@ -252,10 +714,10 @@
 				       tp_name_t const *tpn,
 				       msg_t *msg,
 				       tag_type_t tag, tag_value_t value, ...);
-static void outgoing_queue_init(outgoing_queue_t *, 
+static void outgoing_queue_init(outgoing_queue_t *,
 				unsigned timeout);
-static void outgoing_queue_adjust(nta_agent_t *sa, 
-				  outgoing_queue_t *queue, 
+static void outgoing_queue_adjust(nta_agent_t *sa,
+				  outgoing_queue_t *queue,
 				  unsigned timeout);
 static void outgoing_free(nta_outgoing_t *orq);
 su_inline void outgoing_cut_off(nta_outgoing_t *orq);
@@ -290,7 +752,7 @@
  *
  * The NTA_DEBUG environment variable is used to determine the default
  * debug logging level. The normal level is 3.
- * 
+ *
  * @sa <sofia-sip/su_debug.h>, #su_log_global, #SOFIA_DEBUG
  */
 #ifdef DOXYGEN
@@ -301,8 +763,8 @@
 #define SU_DEBUG 3
 #endif
 
-/**Debug log for @b nta module. 
- * 
+/**Debug log for @b nta module.
+ *
  * The nta_log is the log object used by @b nta module. The level of
  * nta_log is set using #NTA_DEBUG environment variable.
  */
@@ -354,13 +816,14 @@
  * NTATAG_DEBUG_DROP_PROB(), NTATAG_DEFAULT_PROXY(),
  * NTATAG_EXTRA_100(), NTATAG_GRAYLIST(),
  * NTATAG_MAXSIZE(), NTATAG_MAX_FORWARDS(), NTATAG_MERGE_482(), NTATAG_MCLASS()
- * NTATAG_PASS_100(), NTATAG_PASS_408(), NTATAG_PRELOAD(), NTATAG_PROGRESS(), 
- * NTATAG_REL100(), 
+ * NTATAG_PASS_100(), NTATAG_PASS_408(), NTATAG_PRELOAD(), NTATAG_PROGRESS(),
+ * NTATAG_REL100(),
  * NTATAG_SERVER_RPORT(),
  * NTATAG_SIPFLAGS(),
  * NTATAG_SIP_T1X64(), NTATAG_SIP_T1(), NTATAG_SIP_T2(), NTATAG_SIP_T4(),
  * NTATAG_STATELESS(),
  * NTATAG_TAG_3261(), NTATAG_TCP_RPORT(), NTATAG_TIMEOUT_408(),
+ * NTATAG_TLS_RPORT(),
  * NTATAG_TIMER_C(), NTATAG_MAX_PROCEEDING(),
  * NTATAG_UA(), NTATAG_UDP_MTU(), NTATAG_USER_VIA(),
  * NTATAG_USE_NAPTR(), NTATAG_USE_SRV() and NTATAG_USE_TIMESTAMP().
@@ -368,9 +831,9 @@
  * @note The value from following tags are stored, but they currently do nothing:
  * NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_OPTIONS(), NTATAG_SMIME()
  *
- * @note It is possible to provide @c (url_string_t*)-1 as @a contact_url. 
+ * @note It is possible to provide @c (url_string_t*)-1 as @a contact_url.
  * In that case, no server sockets are bound.
- * 
+ *
  * @retval handle to the agent when successful,
  * @retval NULL upon an error.
  *
@@ -399,15 +862,15 @@
     agent->sa_flags = MSG_DO_CANONIC;
 
     agent->sa_maxsize         = 2 * 1024 * 1024; /* 2 MB */
-    agent->sa_bad_req_mask    = 
+    agent->sa_bad_req_mask    =
       /*
-       * Bit-wise not of these - what is left is suitable for UAs with 
-       * 100rel, timer, events, publish 
+       * Bit-wise not of these - what is left is suitable for UAs with
+       * 100rel, timer, events, publish
        */
-      (unsigned) ~(sip_mask_response | sip_mask_proxy | sip_mask_registrar | 
+      (unsigned) ~(sip_mask_response | sip_mask_proxy | sip_mask_registrar |
 		   sip_mask_pref | sip_mask_privacy);
-    agent->sa_bad_resp_mask   = 
-      (unsigned) ~(sip_mask_request | sip_mask_proxy | sip_mask_registrar | 
+    agent->sa_bad_resp_mask   =
+      (unsigned) ~(sip_mask_request | sip_mask_proxy | sip_mask_registrar |
 		   sip_mask_pref | sip_mask_privacy);
     agent->sa_t1 	      = NTA_SIP_T1;
     agent->sa_t2 	      = NTA_SIP_T2;
@@ -445,14 +908,14 @@
       agent->sa_mclass = sip_default_mclass();
 
     agent->sa_in.re_t1 = &agent->sa_in.re_list;
-    
+
     incoming_queue_init(agent->sa_in.proceeding, 0);
     incoming_queue_init(agent->sa_in.preliminary, agent->sa_t1x64); /* P1 */
     incoming_queue_init(agent->sa_in.inv_completed, agent->sa_t1x64); /* H */
     incoming_queue_init(agent->sa_in.inv_confirmed, agent->sa_t4); /* I */
     incoming_queue_init(agent->sa_in.completed, agent->sa_t1x64); /* J */
     incoming_queue_init(agent->sa_in.terminated, 0);
-    incoming_queue_init(agent->sa_in.final_failed, 0); 
+    incoming_queue_init(agent->sa_in.final_failed, 0);
 
     agent->sa_out.re_t1 = &agent->sa_out.re_list;
 
@@ -460,7 +923,7 @@
     outgoing_queue_init(agent->sa_out.resolving, 0);
     outgoing_queue_init(agent->sa_out.trying, agent->sa_t1x64); /* F */
     outgoing_queue_init(agent->sa_out.completed, agent->sa_t4); /* K */
-    outgoing_queue_init(agent->sa_out.terminated, 0); 
+    outgoing_queue_init(agent->sa_out.terminated, 0);
     /* Special queues (states) for outgoing INVITE transactions */
     outgoing_queue_init(agent->sa_out.inv_calling, agent->sa_t1x64); /* B */
     timer_c = (agent->sa_use_timer_c || !agent->sa_is_a_uas)
@@ -547,7 +1010,7 @@
 
     for (i = 0, lht = agent->sa_defaults; i < lht->lht_size; i++) {
       if ((leg = lht->lht_table[i])) {
-	SU_DEBUG_3(("%s: destroying leg for <" 
+	SU_DEBUG_3(("%s: destroying leg for <"
 		    URL_PRINT_FORMAT ">\n",
 		    __func__, URL_PRINT_ARGS(leg->leg_url)));
 	leg_free(agent, leg);
@@ -851,7 +1314,7 @@
     now = agent->sa_now, ms = agent->sa_millisec;
   else
     now = su_now(), ms = su_time_ms(now);
-  
+
   next = ms + offset; if (next == 0) next = 1;
 
   if (agent->sa_in_timer)	/* Currently executing timer */
@@ -863,8 +1326,8 @@
       SU_DEBUG_9(("nta: timer %s to %ld ms\n", "shortened", (long)offset));
     else
       SU_DEBUG_9(("nta: timer %s to %ld ms\n", "set", (long)offset));
-      
-    su_timer_set_at(agent->sa_timer, agent_timer, agent, 
+
+    su_timer_set_at(agent->sa_timer, agent_timer, agent,
 		    add_milliseconds(now, offset));
     agent->sa_next = next;
   }
@@ -879,7 +1342,7 @@
 {
   if (agent && agent->sa_millisec != 0)
     return agent->sa_now;
-  else 
+  else
     return su_now();
 }
 
@@ -891,7 +1354,7 @@
 #ifdef TPTAG_THRPSIZE
   if (agent->sa_tport_threadpool) {
     su_home_threadsafe(agent->sa_home);
-    return su_clone_start(agent->sa_root, 
+    return su_clone_start(agent->sa_root,
 			  agent->sa_terminator,
 			  NULL,
 			  NULL,
@@ -916,7 +1379,7 @@
  * NTA keeps transactions alive, does NTA apply proxy or user-agent logic to
  * INVITE transactions, or how the @Via headers are generated.
  *
- * @note 
+ * @note
  * Setting the parameters NTATAG_MAXSIZE(), NTATAG_UDP_MTU(), NTATAG_MAX_PROCEEDING(),
  * NTATAG_SIP_T1X64(), NTATAG_SIP_T1(), NTATAG_SIP_T2(), NTATAG_SIP_T4() to
  * 0 selects the default value.
@@ -928,13 +1391,14 @@
  * NTATAG_DEBUG_DROP_PROB(), NTATAG_DEFAULT_PROXY(),
  * NTATAG_EXTRA_100(), NTATAG_GRAYLIST(),
  * NTATAG_MAXSIZE(), NTATAG_MAX_FORWARDS(), NTATAG_MERGE_482(), NTATAG_MCLASS()
- * NTATAG_PASS_100(), NTATAG_PASS_408(), NTATAG_PRELOAD(), NTATAG_PROGRESS(), 
- * NTATAG_REL100(), 
+ * NTATAG_PASS_100(), NTATAG_PASS_408(), NTATAG_PRELOAD(), NTATAG_PROGRESS(),
+ * NTATAG_REL100(),
  * NTATAG_SERVER_RPORT(),
  * NTATAG_SIPFLAGS(),
  * NTATAG_SIP_T1X64(), NTATAG_SIP_T1(), NTATAG_SIP_T2(), NTATAG_SIP_T4(),
  * NTATAG_STATELESS(),
  * NTATAG_TAG_3261(), NTATAG_TCP_RPORT(), NTATAG_TIMEOUT_408(),
+ * NTATAG_TLS_RPORT(),
  * NTATAG_TIMER_C(), NTATAG_MAX_PROCEEDING(),
  * NTATAG_UA(), NTATAG_UDP_MTU(), NTATAG_USER_VIA(),
  * NTATAG_USE_NAPTR(), NTATAG_USE_SRV() and NTATAG_USE_TIMESTAMP().
@@ -999,6 +1463,7 @@
   int rport           = agent->sa_rport;
   int server_rport    = agent->sa_server_rport;
   int tcp_rport       = agent->sa_tcp_rport;
+  int tls_rport       = agent->sa_tls_rport;
   unsigned preload         = agent->sa_preload;
   unsigned threadpool      = agent->sa_tport_threadpool;
   char const *sigcomp = agent->sa_sigcomp_options;
@@ -1045,6 +1510,7 @@
 #endif
 	      NTATAG_STATELESS_REF(stateless),
 	      NTATAG_TCP_RPORT_REF(tcp_rport),
+	      NTATAG_TLS_RPORT_REF(tls_rport),
 	      NTATAG_TIMEOUT_408_REF(timeout_408),
 	      NTATAG_UA_REF(ua),
 	      NTATAG_UDP_MTU_REF(udp_mtu),
@@ -1127,7 +1593,7 @@
   if (maxsize > UINT32_MAX) maxsize = UINT32_MAX;
   agent->sa_maxsize = maxsize;
 
-  if (max_proceeding == 0) max_proceeding = SIZE_MAX;
+  if (max_proceeding == 0) max_proceeding = UINT32_MAX;
   agent->sa_max_proceeding = max_proceeding;
 
   if (max_forwards == 0) max_forwards = 70; /* Default value */
@@ -1214,13 +1680,14 @@
   agent->sa_flags = flags & MSG_FLG_USERMASK;
   agent->sa_rport = rport != 0;
   agent->sa_tcp_rport = tcp_rport != 0;
+  agent->sa_tls_rport = tls_rport != 0;
   agent->sa_preload = preload;
   agent->sa_tport_threadpool = threadpool;
 
   return n;
 }
 
-static 
+static
 void agent_set_udp_params(nta_agent_t *self, usize_t udp_mtu)
 {
   tport_t *tp;
@@ -1243,23 +1710,23 @@
  * INVITE transactions, or how the @Via headers are generated.
  *
  * @TAGS
- * NTATAG_ALIASES_REF(), NTATAG_BLACKLIST_REF(), 
+ * NTATAG_ALIASES_REF(), NTATAG_BLACKLIST_REF(),
  * NTATAG_CANCEL_2543_REF(), NTATAG_CANCEL_487_REF(),
- * NTATAG_CLIENT_RPORT_REF(), NTATAG_CONTACT_REF(), 
+ * NTATAG_CLIENT_RPORT_REF(), NTATAG_CONTACT_REF(),
  * NTATAG_DEBUG_DROP_PROB_REF(), NTATAG_DEFAULT_PROXY_REF(),
  * NTATAG_EXTRA_100_REF(), NTATAG_GRAYLIST_REF(),
  * NTATAG_MAXSIZE_REF(), NTATAG_MAX_FORWARDS_REF(), NTATAG_MCLASS_REF(),
  * NTATAG_MERGE_482_REF(), NTATAG_MAX_PROCEEDING_REF(),
  * NTATAG_PASS_100_REF(), NTATAG_PASS_408_REF(), NTATAG_PRELOAD_REF(),
  * NTATAG_PROGRESS_REF(),
- * NTATAG_REL100_REF(), 
- * NTATAG_SERVER_RPORT_REF(), 
+ * NTATAG_REL100_REF(),
+ * NTATAG_SERVER_RPORT_REF(),
  * NTATAG_SIGCOMP_ALGORITHM_REF(), NTATAG_SIGCOMP_OPTIONS_REF(),
  * NTATAG_SIPFLAGS_REF(),
  * NTATAG_SIP_T1_REF(), NTATAG_SIP_T1X64_REF(), NTATAG_SIP_T2_REF(),
  * NTATAG_SIP_T4_REF(), NTATAG_SMIME_REF(), NTATAG_STATELESS_REF(),
  * NTATAG_TAG_3261_REF(), NTATAG_TIMEOUT_408_REF(), NTATAG_TIMER_C_REF(),
- * NTATAG_UA_REF(), NTATAG_UDP_MTU_REF(), NTATAG_USER_VIA_REF(), 
+ * NTATAG_UA_REF(), NTATAG_UDP_MTU_REF(), NTATAG_USER_VIA_REF(),
  * NTATAG_USE_NAPTR_REF(), NTATAG_USE_SRV_REF(),
  * and NTATAG_USE_TIMESTAMP_REF().
  *
@@ -1366,7 +1833,7 @@
  * NTATAG_S_SENT_REQUEST_REF(),
  * NTATAG_S_SENT_RESPONSE_REF(),
  * NTATAG_S_SERVER_TR_REF(),
- * NTATAG_S_TOUT_REQUEST_REF(), 
+ * NTATAG_S_TOUT_REQUEST_REF(),
  * NTATAG_S_TOUT_RESPONSE_REF(),
  * NTATAG_S_TRLESS_200_REF(),
  * NTATAG_S_TRLESS_REQUEST_REF(),
@@ -1459,7 +1926,7 @@
   /* XXX - use a cryptographically safe func here? */
   sa->sa_branch += NTA_BRANCH_PRIME;
 
-  msg_random_token(branch, sizeof(branch) - 1, 
+  msg_random_token(branch, sizeof(branch) - 1,
 		   &sa->sa_branch, sizeof(sa->sa_branch));
 
   return su_sprintf(home, "branch=z9hG4bK%s", branch);
@@ -1469,13 +1936,13 @@
 
 /**
  * Calculate branch value for stateless operation.
- * 
+ *
  * XXX - should include HMAC of previous @Via line.
  */
 static
-char const *stateless_branch(nta_agent_t *sa, 
+char const *stateless_branch(nta_agent_t *sa,
 			     msg_t *msg,
-			     sip_t const *sip, 
+			     sip_t const *sip,
 			     tp_name_t const *tpn)
 {
   su_md5_t md5[1];
@@ -1542,7 +2009,7 @@
 /**For each transport, we have name used by tport module, SRV prefixes used
  * for resolving, and NAPTR service/conversion.
  */
-static 
+static
 struct sipdns_tport {
   char name[6];			/**< Named used by tport module */
   char port[6];			/**< Default port number */
@@ -1678,14 +2145,14 @@
   if (url->url_type == url_sip) {
     tpn->tpn_proto = "*";
     tports = tports_sip;
-    if (!tpn->tpn_port || !tpn->tpn_port[0]) 
+    if (!tpn->tpn_port || !tpn->tpn_port[0])
       tpn->tpn_port = SIP_DEFAULT_SERV;
   }
   else {
     assert(url->url_type == url_sips);
     tpn->tpn_proto = "*";
     tports = tports_sips;
-    if (!tpn->tpn_port || !tpn->tpn_port[0]) 
+    if (!tpn->tpn_port || !tpn->tpn_port[0])
       tpn->tpn_port = SIPS_DEFAULT_SERV;
   }
 
@@ -1712,8 +2179,8 @@
     if (url_param(url->url_params, "comp", comp, sizeof(comp)) > 0)
       tpn->tpn_comp = comp;
 
-    if (tpn->tpn_comp && 
-	(nta_compressor_vtable == NULL || 
+    if (tpn->tpn_comp &&
+	(nta_compressor_vtable == NULL ||
 	 strcasecmp(tpn->tpn_comp, nta_compressor_vtable->ncv_name) != 0)) {
       SU_DEBUG_1(("nta(%p): comp=%s not supported for " URL_PRINT_FORMAT "\n",
 		  (void *)self, tpn->tpn_comp, URL_PRINT_ARGS(url)));
@@ -1781,7 +2248,7 @@
 static
 int agent_create_master_transport(nta_agent_t *self, tagi_t *tags)
 {
-  self->sa_tports = 
+  self->sa_tports =
     tport_tcreate(self, nta_agent_class, self->sa_root,
 		  TPTAG_SDWN_ERROR(0),
 		  TPTAG_IDLE(1800000),
@@ -1872,14 +2339,14 @@
 	maddr = 0;
 	port = 0;
       }
-	
+
       if (strncasecmp(tpn->tpn_proto, "tls", 3)
 	  ? port == SIP_DEFAULT_PORT
 	  : port == SIPS_DEFAULT_PORT)
 	port = 0;
 
       snprintf(sport, sizeof sport, ":%u", port);
-      
+
       comp = tpn->tpn_comp;
 
       SU_DEBUG_9(("nta: agent_init_via: "
@@ -1933,7 +2400,7 @@
 
     while (via->v_next && via->v_next->v_common->h_data == tp)
       via = via->v_next, new_via = new_via->v_next, dup_via = dup_via->v_next;
-    
+
     via = via->v_next;
     /* Break the link in via list between transports */
     vv = &new_via->v_next, new_via = *vv, *vv = NULL;
@@ -1952,7 +2419,7 @@
     agent_set_udp_params(self, self->sa_udp_mtu);
 
   v = self->sa_vias;
-  self->sa_vias = new_vias; 
+  self->sa_vias = new_vias;
   msg_header_free(self->sa_home, (void *)v);
 
   v = self->sa_public_vias;
@@ -2003,7 +2470,7 @@
 
   v2 = v1->v_next;
 
-  if (v2 && 
+  if (v2 &&
       strcasecmp(v1->v_host, v2->v_host) == 0 &&
       str0casecmp(v1->v_port, v2->v_port) == 0) {
     char const *p1 = v1->v_protocol, *p2 = v2->v_protocol;
@@ -2017,7 +2484,7 @@
       tp = NULL;
   }
 
-  self->sa_contact = 
+  self->sa_contact =
     sip_contact_create_from_via_with_transport(self->sa_home, v1, NULL, tp);
 
   if (!self->sa_contact)
@@ -2038,7 +2505,7 @@
 
 /** Insert @Via to a request message */
 static
-int outgoing_insert_via(nta_outgoing_t *orq, 
+int outgoing_insert_via(nta_outgoing_t *orq,
 			sip_via_t const *via)
 {
   nta_agent_t *self = orq->orq_agent;
@@ -2062,9 +2529,10 @@
   else
     return -1;
 
-  if (!v->v_rport && 
+  if (!v->v_rport &&
       ((self->sa_rport && v->v_protocol == sip_transport_udp) ||
-       (self->sa_tcp_rport && v->v_protocol == sip_transport_tcp)))
+       (self->sa_tcp_rport && v->v_protocol == sip_transport_tcp) ||
+       (self->sa_tls_rport && v->v_protocol == sip_transport_tls)))
     msg_header_add_param(msg_home(msg), v->v_common, "rport");
 
   if (!orq->orq_tpn->tpn_comp)
@@ -2082,14 +2550,14 @@
     clear = 1, v->v_protocol = via->v_protocol;
 
   /* XXX - should we do this? */
-  if (!user_via &&
+  if ((!user_via || !v->v_host) &&
       via->v_host != v->v_host &&
       str0cmp(via->v_host, v->v_host))
     clear = 1, v->v_host = via->v_host;
 
-  if ((!user_via ||
+  if ((!user_via || !v->v_port ||
        /* Replace port in user Via only if we use udp and no rport */
-       (v->v_protocol == sip_transport_udp && !v->v_rport && 
+       (v->v_protocol == sip_transport_udp && !v->v_rport &&
 	!orq->orq_stateless)) &&
       via->v_port != v->v_port &&
       str0cmp(via->v_port, v->v_port))
@@ -2101,7 +2569,7 @@
   return 0;
 }
 
-/** Get destination name from @Via. 
+/** Get destination name from @Via.
  *
  * If @a using_rport is non-null, try rport.
  * If *using_rport is non-zero, try rport even if <protocol> is not UDP.
@@ -2149,7 +2617,7 @@
     return -1;
   }
 
-  if (url->url_type != url_sip && 
+  if (url->url_type != url_sip &&
       url->url_type != url_sips &&
       url->url_type != url_im &&
       url->url_type != url_pres) {
@@ -2215,7 +2683,7 @@
   }
   else {
     /* XXX - we should do something else? */
-    SU_DEBUG_3(("%s(%p): %s\n", "nta", (void *)self, 
+    SU_DEBUG_3(("%s(%p): %s\n", "nta", (void *)self,
 		"transport address updated"));
   }
 }
@@ -2288,7 +2756,7 @@
 
   if (agent->sa_drop_prob && !tport_is_reliable(tport)) {
     if ((unsigned)su_randint(0, 1000) < agent->sa_drop_prob) {
-      SU_DEBUG_5(("nta: %s (%u) is %s\n", 
+      SU_DEBUG_5(("nta: %s (%u) is %s\n",
 		  method_name, cseq, "dropped simulating packet loss"));
       agent->sa_stats->as_drop_request++;
       msg_destroy(msg);
@@ -2299,16 +2767,16 @@
   stream = tport_is_stream(tport);
 
   /* Try to use compression on reverse direction if @Via has comp=sigcomp  */
-  if (stream && 
+  if (stream &&
       sip->sip_via && sip->sip_via->v_comp &&
       tport_can_send_sigcomp(tport) &&
-      tport_name(tport)->tpn_comp == NULL && 
+      tport_name(tport)->tpn_comp == NULL &&
       tport_has_compression(tport_parent(tport), sip->sip_via->v_comp)) {
     tport_set_compression(tport, sip->sip_via->v_comp);
   }
 
   if (sip->sip_flags & MSG_FLG_TOOLARGE) {
-    SU_DEBUG_5(("nta: %s (%u) is %s\n", 
+    SU_DEBUG_5(("nta: %s (%u) is %s\n",
 		method_name, cseq, sip_413_Request_too_large));
     agent->sa_stats->as_bad_request++;
     mreply(agent, NULL, SIP_413_REQUEST_TOO_LARGE, msg,
@@ -2325,11 +2793,11 @@
     errors = sip->sip_error != NULL;
 
   if (errors ||
-      (sip->sip_flags & MSG_FLG_ERROR) /* Fatal error */ || 
+      (sip->sip_flags & MSG_FLG_ERROR) /* Fatal error */ ||
       (insane = (sip_sanity_check(sip) < 0))) {
     sip_header_t const *h;
     char const *badname = NULL, *phrase;
-    
+
     agent->sa_stats->as_bad_message++;
     agent->sa_stats->as_bad_request++;
 
@@ -2342,12 +2810,12 @@
 
       if (h->sh_class == sip_error_class)
 	bad = h->sh_error->er_name;
-      else 
+      else
 	bad = h->sh_class->hc_name;
 
       if (bad)
 	SU_DEBUG_5(("nta: %s has bad %s header\n", method_name, bad));
-      
+
       if (!badname)
 	badname = bad;
     }
@@ -2363,7 +2831,7 @@
 	phrase = sip_400_Bad_request;
 
       SU_DEBUG_5(("nta: %s (%u) is %s\n", method_name, cseq, phrase));
-	
+
       mreply(agent, reply, 400, phrase, msg,
 	     tport, 1, stream, NULL,
 	     TAG_END());
@@ -2400,7 +2868,7 @@
   }
 
   /* First, try existing incoming requests */
-  irq = incoming_find(agent, sip, sip->sip_via, 
+  irq = incoming_find(agent, sip, sip->sip_via,
 		      agent->sa_merge_482 &&
 		      !sip->sip_to->a_tag &&
 		      method != sip_method_ack
@@ -2442,7 +2910,7 @@
     if (rel) {
       SU_DEBUG_5(("nta: %s (%u) is going to %s (%u)\n",
 		  method_name, cseq,
-		  rel->rel_irq->irq_cseq->cs_method_name, 
+		  rel->rel_irq->irq_cseq->cs_method_name,
 		  rel->rel_irq->irq_cseq->cs_seq));
       reliable_recv(rel, msg, sip, tport);
       return;
@@ -2453,10 +2921,10 @@
   url->url_params = NULL;
   agent_aliases(agent, url, tport); /* canonize urls */
 
-  if ((leg = leg_find(agent, 
-		      method_name, url, 
+  if ((leg = leg_find(agent,
+		      method_name, url,
 		      sip->sip_call_id,
-		      sip->sip_from->a_tag, 
+		      sip->sip_from->a_tag,
 		      sip->sip_to->a_tag))) {
     /* Try existing dialog */
     SU_DEBUG_5(("nta: %s (%u) %s\n",
@@ -2490,14 +2958,14 @@
   else if (agent->sa_callback) {
     /* Stateless processing for request */
     agent->sa_stats->as_trless_request++;
-    SU_DEBUG_5(("nta: %s (%u) %s\n", 
+    SU_DEBUG_5(("nta: %s (%u) %s\n",
 		method_name, cseq, "to message callback"));
     (void)agent->sa_callback(agent->sa_magic, agent, msg, sip);
   }
   else {
     agent->sa_stats->as_trless_request++;
     SU_DEBUG_5(("nta: %s (%u) %s\n",
-		method_name, cseq, 
+		method_name, cseq,
 		"not processed by application: returning 501"));
     if (method != sip_method_ack)
       mreply(agent, NULL, SIP_501_NOT_IMPLEMENTED, msg,
@@ -2569,7 +3037,7 @@
       hostport[rlen] = '\0';
     }
 
-    msg_header_replace_param(msg_home(msg), v->v_common, 
+    msg_header_replace_param(msg_home(msg), v->v_common,
 			     su_strdup(msg_home(msg), received));
     SU_DEBUG_5(("nta: Via check: %s\n", received));
   }
@@ -2580,7 +3048,7 @@
   else if (v->v_rport) {
     rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
     msg_header_replace_param(msg_home(msg), v->v_common, rport);
-  } 
+  }
   else if (tport_is_tcp(tport)) {
     rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
     msg_header_replace_param(msg_home(msg), v->v_common, rport);
@@ -2588,12 +3056,12 @@
   else if (agent->sa_server_rport == 2) {
     rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
     msg_header_replace_param(msg_home(msg), v->v_common, rport);
-  } 
+  }
 
   return 0;
 }
 
-/** @internal Handle aliases of local node. 
+/** @internal Handle aliases of local node.
  *
  * Return true if @a url is modified.
  */
@@ -2687,7 +3155,7 @@
   agent->sa_stats->as_recv_msg++;
   agent->sa_stats->as_recv_response++;
 
-  SU_DEBUG_5(("nta: received %03d %s for %s (%u)\n", 
+  SU_DEBUG_5(("nta: received %03d %s for %s (%u)\n",
 	      status, phrase, method, cseq));
 
   if (agent->sa_drop_prob && !tport_is_reliable(tport)) {
@@ -2705,7 +3173,7 @@
   else
     errors = sip->sip_error != NULL;
 
-  if (errors || 
+  if (errors ||
       sip_sanity_check(sip) < 0) {
     sip_header_t const *h;
 
@@ -2750,7 +3218,7 @@
   /* XXX - should check if msg should be discarded based on via? */
 
   if ((orq = outgoing_find(agent, msg, sip, sip->sip_via))) {
-    SU_DEBUG_5(("nta: %03d %s %s\n", 
+    SU_DEBUG_5(("nta: %03d %s %s\n",
 		status, phrase, "is going to a transaction"));
     if (outgoing_recv(orq, status, msg, sip) == 0)
       return;
@@ -2759,7 +3227,7 @@
   agent->sa_stats->as_trless_response++;
 
   if ((orq = agent->sa_default_outgoing)) {
-    SU_DEBUG_5(("nta: %03d %s %s\n", status, phrase, 
+    SU_DEBUG_5(("nta: %03d %s %s\n", status, phrase,
 		"to the default transaction"));
     outgoing_default_recv(orq, status, msg, sip);
     return;
@@ -2778,7 +3246,7 @@
       && 200 <= sip->sip_status->st_status
       && sip->sip_status->st_status < 300
       /* Exactly one Via header, belonging to us */
-      && sip->sip_via && !sip->sip_via->v_next 
+      && sip->sip_via && !sip->sip_via->v_next
       && agent_has_via(agent, sip->sip_via)) {
     agent->sa_stats->as_trless_200++;
 #if nomore /* sf.net bug #1750691. Let UAS to cope with it. */
@@ -2867,7 +3335,7 @@
 /** Check if the headers are from response generated locally by NTA. */
 int  nta_sip_is_internal(sip_t const *sip)
 {
-  return 
+  return
     sip == NULL		/* No message generated */
     || (sip->sip_flags & NTA_INTERNAL_MSG) == NTA_INTERNAL_MSG;
 }
@@ -2878,7 +3346,7 @@
   return msg_get_flags(msg, NTA_INTERNAL_MSG) == NTA_INTERNAL_MSG;
 }
 
-/** Check if the message is internally generated by NTA. 
+/** Check if the message is internally generated by NTA.
  *
  * @deprecated Use nta_msg_is_internal() instead
  */
@@ -2887,7 +3355,7 @@
 /* ====================================================================== */
 /* 5) Stateless operation */
 
-/**Forward a request or response message. 
+/**Forward a request or response message.
  *
  * @note
  * The ownership of @a msg is taken over by the function even if the
@@ -2907,8 +3375,8 @@
     return -1;
   }
 
-  what = 
-    sip->sip_status ? "nta_msg_tsend(response)" : 
+  what =
+    sip->sip_status ? "nta_msg_tsend(response)" :
     sip->sip_request ? "nta_msg_tsend(request)" :
     "nta_msg_tsend()";
 
@@ -2932,7 +3400,7 @@
 	    /* NTATAG_INCOMPLETE_REF(incomplete), */
 	    TAG_END());
 
-    if (!sip->sip_separator && 
+    if (!sip->sip_separator &&
 	!(sip->sip_separator = sip_separator_create(msg_home(msg))))
       SU_DEBUG_3(("%s: cannot create sip_separator\n", what));
     else if (msg_serialize(msg, (msg_pub_t *)sip) != 0)
@@ -2967,7 +3435,7 @@
   }
   else {
     /* Send request */
-    if (outgoing_create(agent, NULL, NULL, u, NULL, msg_ref_create(msg), 
+    if (outgoing_create(agent, NULL, NULL, u, NULL, msg_ref_create(msg),
 			NTATAG_STATELESS(1),
 			ta_tags(ta)))
       retval = 0;
@@ -3127,7 +3595,7 @@
       }
     }
 
-    if (tport_tsend(tport, reply, tpn, 
+    if (tport_tsend(tport, reply, tpn,
 		    IF_SIGCOMP_TPTAG_COMPARTMENT(cc)
 		    TPTAG_MTU(INT_MAX),
 		    TPTAG_SDWN_AFTER(sdwn_after),
@@ -3151,8 +3619,8 @@
 
 /** Add headers from the request to the response message. */
 static
-int complete_response(msg_t *response, 
-		      int status, char const *phrase, 
+int complete_response(msg_t *response,
+		      int status, char const *phrase,
 		      msg_t *request)
 {
   su_home_t *home = msg_home(response);
@@ -3173,7 +3641,7 @@
   if (!response_sip->sip_to)
     response_sip->sip_to = sip_to_dup(home, request_sip->sip_to);
   if (!response_sip->sip_call_id)
-    response_sip->sip_call_id = 
+    response_sip->sip_call_id =
       sip_call_id_dup(home, request_sip->sip_call_id);
   if (!response_sip->sip_cseq)
     response_sip->sip_cseq = sip_cseq_dup(home, request_sip->sip_cseq);
@@ -3252,7 +3720,7 @@
     /* Append r-uri */
     *sip_route_init(r0)->r_url = *ruri->us_url;
     r->r_next = sip_route_dup(home, r0);
-    
+
     /* Use topmost route as request-uri */
     ruri = (url_string_t const *)route->r_url;
     route = route->r_next;
@@ -3292,7 +3760,7 @@
   else
     msg_header_insert(bmsg, (msg_pub_t *)bsip, (msg_header_t *)rq);
 
-  if (!(bye = nta_outgoing_mcreate(agent, NULL, NULL, NULL, bmsg, 
+  if (!(bye = nta_outgoing_mcreate(agent, NULL, NULL, NULL, bmsg,
 				   NTATAG_STATELESS(1),
 				   TAG_END())))
     goto err;
@@ -3374,7 +3842,7 @@
     request_uri = (url_string_t *)sip->sip_request->rq_url;
 
   to = sip->sip_to ? sip->sip_to : leg->leg_remote;
-  
+
   if (!request_uri && to) {
     if (method != sip_method_register)
       request_uri = (url_string_t *)to->a_url;
@@ -3391,7 +3859,7 @@
 
   if (method || method_name) {
     sip_request_t *rq = sip->sip_request;
-    int use_headers = 
+    int use_headers =
       request_uri == original || (url_t *)request_uri == rq->rq_url;
 
     if (!rq
@@ -3406,11 +3874,11 @@
 	return -1;
     }
 
-    /* @RFC3261 table 1 (page 152): 
-     * Req-URI cannot contain method parameter or headers 
+    /* @RFC3261 table 1 (page 152):
+     * Req-URI cannot contain method parameter or headers
      */
     if (rq->rq_url->url_params) {
-      rq->rq_url->url_params = 
+      rq->rq_url->url_params =
 	url_strip_param_string((char *)rq->rq_url->url_params, "method");
       sip_fragment_clear(rq->rq_common);
     }
@@ -3466,10 +3934,10 @@
   method_name = sip->sip_request->rq_method_name;
 
   if (!leg->leg_id && sip->sip_cseq)
-    seq = sip->sip_cseq->cs_seq; 
+    seq = sip->sip_cseq->cs_seq;
   else if (method == sip_method_ack || method == sip_method_cancel)
     /* Dangerous - we may do PRACK/UPDATE meanwhile */
-    seq = sip->sip_cseq ? sip->sip_cseq->cs_seq : leg->leg_seq; 
+    seq = sip->sip_cseq ? sip->sip_cseq->cs_seq : leg->leg_seq;
   else if (leg->leg_seq)
     seq = ++leg->leg_seq;
   else if (sip->sip_cseq) /* Obtain initial value from existing CSeq header */
@@ -3484,10 +3952,10 @@
       sip->sip_call_id = sip_call_id_create(home, NULL);
   }
 
-  if ((!sip->sip_cseq || 
+  if ((!sip->sip_cseq ||
        seq != sip->sip_cseq->cs_seq ||
        method != sip->sip_cseq->cs_method ||
-       (method == sip_method_unknown && 
+       (method == sip_method_unknown &&
 	strcmp(method_name, sip->sip_cseq->cs_method_name) != 0)) &&
       (!(cseq = sip_cseq_create(home, seq, method, method_name)) ||
        msg_header_insert(msg, (msg_pub_t *)sip, (msg_header_t *)cseq) < 0))
@@ -3576,7 +4044,7 @@
  *     nta_leg_client_route(), nta_leg_server_route(),
  *     nta_leg_destroy(), nta_outgoing_tcreate(), and nta_request_f().
  *
- * @TAGS 
+ * @TAGS
  * NTATAG_NO_DIALOG(), NTATAG_STATELESS(), NTATAG_METHOD(),
  * URLTAG_URL(), SIPTAG_CALL_ID(), SIPTAG_CALL_ID_STR(), SIPTAG_FROM(),
  * SIPTAG_FROM_STR(), SIPTAG_TO(), SIPTAG_TO_STR(), SIPTAG_ROUTE(),
@@ -3648,7 +4116,7 @@
 
   if (from) {
     /* Now this is kludge */
-    leg->leg_local_is_to = sip_is_to((sip_header_t*)from); 
+    leg->leg_local_is_to = sip_is_to((sip_header_t*)from);
     leg->leg_local = sip_to_dup(home, from);
   }
   else if (from_str)
@@ -3682,7 +4150,7 @@
     url_t *changed = url_hdup(home, url);
     su_free(home, url);
     url = changed;
-  }	
+  }
 
   leg->leg_rseq = rseq;
   leg->leg_seq = seq;
@@ -3716,7 +4184,7 @@
 	what = "Missing local dialog address";
       else if (leg->leg_local)
 	what = "Missing remote dialog address";
-      else 
+      else
 	what = "Missing dialog addresses";
       goto err;
     }
@@ -3909,7 +4377,7 @@
  * @param leg leg to be tagged
  * @param tag tag to be added (if NULL, a tag generated by @b NTA is added)
  *
- * @return 
+ * @return
  * Pointer to tag if successful, NULL otherwise.
  */
 char const *nta_leg_tag(nta_leg_t *leg, char const *tag)
@@ -3920,7 +4388,7 @@
   if (tag && strchr(tag, '='))
     tag = strchr(tag, '=') + 1;
 
-  /* If there already is a tag, 
+  /* If there already is a tag,
      return NULL if it does not match with new one */
   if (leg->leg_local->a_tag) {
     if (!tag && str0casecmp(tag, leg->leg_local->a_tag))
@@ -3928,7 +4396,7 @@
     else
       return leg->leg_local->a_tag;
   }
-  
+
   if (tag) {
     if (sip_to_tag(leg->leg_home, leg->leg_local, tag) < 0)
       return NULL;
@@ -3957,12 +4425,12 @@
 
 /** Add a remote tag to the leg.
  *
- * @note No remote tag is ever generated. 
+ * @note No remote tag is ever generated.
  *
  * @param leg leg to be tagged
  * @param tag tag to be added (@b must be non-NULL)
  *
- * @return 
+ * @return
  * Pointer to tag if successful, NULL otherwise.
  */
 char const *nta_leg_rtag(nta_leg_t *leg, char const *tag)
@@ -3975,7 +4443,7 @@
 
   if (leg && leg->leg_remote)
     return leg->leg_remote->a_tag;
-  else 
+  else
     return NULL;
 }
 
@@ -4023,8 +4491,8 @@
 }
 
 /** Return route components. */
-int nta_leg_get_route(nta_leg_t *leg, 
-		      sip_route_t const **return_route, 
+int nta_leg_get_route(nta_leg_t *leg,
+		      sip_route_t const **return_route,
 		      sip_contact_t const **return_target)
 {
   if (!leg)
@@ -4054,12 +4522,12 @@
     return NULL;
   if (!leg->leg_dialog || !leg->leg_local || !leg->leg_remote || !leg->leg_id)
     return NULL;
-  
+
   from_tag = leg->leg_local->a_tag; if (!from_tag) from_tag = "0";
   to_tag = leg->leg_remote->a_tag; if (!to_tag) to_tag = "0";
 
   return sip_replaces_format(home, "%s;from-tag=%s;to-tag=%s%s",
-			     leg->leg_id->i_id, from_tag, to_tag, 
+			     leg->leg_id->i_id, from_tag, to_tag,
 			     early_only ? ";early-only" : "");
 }
 
@@ -4257,8 +4725,8 @@
  * @param request_uri  if non-NULL, and there is destination URI
  *                     associated with the dialog, these URIs must match
  * @param call_id      if non-NULL, must match with @CallID header contents
- * @param remote_tag   if there is remote tag 
- *                     associated with dialog, @a remote_tag must match 
+ * @param remote_tag   if there is remote tag
+ *                     associated with dialog, @a remote_tag must match
  * @param remote_uri   ignored
  * @param local_tag    if non-NULL and there is local tag associated with leg,
  *                     it must math
@@ -4290,7 +4758,7 @@
   else if (URL_IS_STRING(request_uri)) {
     /* accept a string as URL */
     to_be_freed = url = url_hdup(NULL, request_uri);
-  } 
+  }
   else {
     *url0 = *request_uri, url = url0;
   }
@@ -4305,10 +4773,10 @@
   if (local_tag && local_tag[0] == '\0')
     local_tag = NULL;
 
-  leg = leg_find(agent, 
-		 NULL, url, 
-		 call_id, 
-		 remote_tag, 
+  leg = leg_find(agent,
+		 NULL, url,
+		 call_id,
+		 remote_tag,
 		 local_tag);
 
   if (to_be_freed) su_free(NULL, to_be_freed);
@@ -4581,8 +5049,8 @@
 HTABLE_BODIES_WITH(incoming_htable, iht, nta_incoming_t, HTABLE_HASH_IRQ,
 		   size_t, hash_value_t);
 
-static void incoming_insert(nta_agent_t *agent, 
-			    incoming_queue_t *queue, 
+static void incoming_insert(nta_agent_t *agent,
+			    incoming_queue_t *queue,
 			    nta_incoming_t *irq);
 
 su_inline int incoming_is_queued(nta_incoming_t const *irq);
@@ -4602,14 +5070,14 @@
 su_inline int incoming_final_failed(nta_incoming_t *irq, msg_t *);
 static void incoming_retransmit_reply(nta_incoming_t *irq, tport_t *tport);
 
-/** Create a default server transaction. 
+/** Create a default server transaction.
  *
  * The default server transaction is used by a proxy to forward responses
  * statelessly.
  *
  * @param agent pointer to agent object
  *
- * @retval pointer to default server transaction object 
+ * @retval pointer to default server transaction object
  * @retval NULL if failed
  */
 nta_incoming_t *nta_incoming_default(nta_agent_t *agent)
@@ -4639,11 +5107,11 @@
 
   irq->irq_default = 1;
   agent->sa_default_incoming = irq;
-    
+
   return irq;
 }
 
-/** Create a server transaction. 
+/** Create a server transaction.
  *
  * Create a server transaction for a request message. This function is used
  * when an element processing requests statelessly wants to process a
@@ -4660,10 +5128,10 @@
  * function fails.
  *
  * @TAGS
- * @TAG NTATAG_TPORT() specifies the transport used to receive the request 
+ * @TAG NTATAG_TPORT() specifies the transport used to receive the request
  *      and also default transport for sending the response.
  *
- * @retval nta_incoming_t pointer to the newly created server transaction 
+ * @retval nta_incoming_t pointer to the newly created server transaction
  * @retval NULL if failed
  */
 nta_incoming_t *nta_incoming_create(nta_agent_t *agent,
@@ -4690,9 +5158,9 @@
     return msg_destroy(msg), NULL;
 
   ta_start(ta, tag, value);
-  
-  tl_gets(ta_args(ta), 
-	  NTATAG_TPORT_REF(tport), 
+
+  tl_gets(ta_args(ta),
+	  NTATAG_TPORT_REF(tport),
 	  TAG_END());
   ta_end(ta);
 
@@ -4727,7 +5195,7 @@
     incoming_queue_t *queue;
     sip_method_t method = sip->sip_request->rq_method;
 
-    irq->irq_request = msg; 
+    irq->irq_request = msg;
     irq->irq_home = home = msg_home(msg_ref_create(msg));
     irq->irq_agent = agent;
 
@@ -4751,7 +5219,7 @@
     case sip_method_publish:
       break;
     default:
-      irq->irq_record_route = 
+      irq->irq_record_route =
 	sip_record_route_copy(home, sip->sip_record_route);
     }
     irq->irq_branch  = sip->sip_via->v_branch;
@@ -4807,7 +5275,7 @@
       else {
 	queue = agent->sa_in.completed;	/* Timer J */
       }
-    } 
+    }
     else {
       queue = agent->sa_in.proceeding;
 	/* RFC 4320 (nit-actions-03):
@@ -4822,7 +5290,7 @@
    period of time in which Timer E reaches T2 had this been a UDP hop is
    one reasonable compromise.
 
-	 */	
+	 */
       if (agent->sa_extra_100 && irq->irq_reliable_tp)
 	incoming_set_timer(irq, agent->sa_t2 / 2); /* T2 / 2 */
 
@@ -4841,7 +5309,7 @@
  * Insert incoming transaction to hash table.
  */
 static void
-incoming_insert(nta_agent_t *agent, 
+incoming_insert(nta_agent_t *agent,
 		incoming_queue_t *queue,
 		nta_incoming_t *irq)
 {
@@ -4867,8 +5335,8 @@
   char const *method_name = sip->sip_request->rq_method_name;
 
   /* RFC-3261 section 12.2.2 (page 76) */
-  if (leg->leg_dialog && 
-      irq->irq_agent->sa_is_a_uas && 
+  if (leg->leg_dialog &&
+      irq->irq_agent->sa_is_a_uas &&
       method != sip_method_ack) {
     uint32_t seq = sip->sip_cseq->cs_seq;
 
@@ -4920,8 +5388,8 @@
 
 /** Change the timeout value of a queue */
 static void
-incoming_queue_adjust(nta_agent_t *sa, 
-		      incoming_queue_t *queue, 
+incoming_queue_adjust(nta_agent_t *sa,
+		      incoming_queue_t *queue,
 		      uint32_t timeout)
 {
   nta_incoming_t *irq;
@@ -4950,13 +5418,13 @@
 }
 
 /** @internal
- * Insert an incoming transaction into a queue. 
+ * Insert an incoming transaction into a queue.
  *
  * Insert a server transaction into a queue, and sets the corresponding
  * timeout at the same time.
  */
 su_inline
-void incoming_queue(incoming_queue_t *queue, 
+void incoming_queue(incoming_queue_t *queue,
 		    nta_incoming_t *irq)
 {
   if (irq->irq_queue == queue) {
@@ -4972,7 +5440,7 @@
   irq->irq_timeout = set_timeout(irq->irq_agent, queue->q_timeout);
 
   irq->irq_queue = queue;
-  irq->irq_prev = queue->q_tail; 
+  irq->irq_prev = queue->q_tail;
   *queue->q_tail = irq;
   queue->q_tail = &irq->irq_next;
   queue->q_length++;
@@ -5003,7 +5471,7 @@
 void incoming_set_timer(nta_incoming_t *irq, uint32_t interval)
 {
   nta_incoming_t **rq;
-  
+
   assert(irq);
 
   if (interval == 0) {
@@ -5012,7 +5480,7 @@
   }
 
   if (irq->irq_rprev) {
-    if ((*irq->irq_rprev = irq->irq_rnext)) 
+    if ((*irq->irq_rprev = irq->irq_rnext))
       irq->irq_rnext->irq_rprev = irq->irq_rprev;
     if (irq->irq_agent->sa_in.re_t1 == &irq->irq_rnext)
       irq->irq_agent->sa_in.re_t1 = irq->irq_rprev;
@@ -5044,12 +5512,12 @@
 void incoming_reset_timer(nta_incoming_t *irq)
 {
   if (irq->irq_rprev) {
-    if ((*irq->irq_rprev = irq->irq_rnext)) 
+    if ((*irq->irq_rprev = irq->irq_rnext))
       irq->irq_rnext->irq_rprev = irq->irq_rprev;
     if (irq->irq_agent->sa_in.re_t1 == &irq->irq_rnext)
       irq->irq_agent->sa_in.re_t1 = irq->irq_rprev;
     irq->irq_agent->sa_in.re_length--;
-  } 
+  }
 
   irq->irq_interval = 0, irq->irq_retry = 0;
   irq->irq_rnext = NULL, irq->irq_rprev = NULL;
@@ -5121,11 +5589,11 @@
 
   su_free(home, irq);
 
-  msg_destroy((msg_t *)home); 
+  msg_destroy((msg_t *)home);
 }
 
 /** Queue request to be freed */
-su_inline 
+su_inline
 void incoming_free_queue(incoming_queue_t *q, nta_incoming_t *irq)
 {
   incoming_cut_off(irq);
@@ -5133,7 +5601,7 @@
 }
 
 /** Reclaim memory used by queue of requests */
-static 
+static
 void incoming_reclaim_queued(su_root_magic_t *rm,
 			     su_msg_r msg,
 			     union sm_arg_u *u)
@@ -5322,7 +5790,7 @@
   return irq && irq->irq_callback == callback ? irq->irq_magic : NULL;
 }
 
-/** When received. 
+/** When received.
  *
  * Return timestamp from the reception of the initial request.
  *
@@ -5395,15 +5863,15 @@
       continue;
 
     if (is_uas_ack &&
-	irq->irq_method == sip_method_invite && 
+	irq->irq_method == sip_method_invite &&
 	200 <= irq->irq_status && irq->irq_status < 300 &&
 	str0casecmp(irq->irq_tag, to->a_tag) == 0) {
       *return_ack = irq;
-      return NULL;		
+      return NULL;
     }
 
     if (magic_branch) {
-      /* RFC3261 17.2.3: 
+      /* RFC3261 17.2.3:
        *
        * The request matches a transaction if branch and sent-by in topmost
        * the method of the request matches the one that created the
@@ -5415,8 +5883,8 @@
 	  strcasecmp(irq->irq_via->v_branch + 7, magic_branch) == 0 &&
 	  strcasecmp(irq->irq_via->v_host, v->v_host) == 0 &&
 	  str0cmp(irq->irq_via->v_port, v->v_port) == 0) {
-	if (irq->irq_method == cseq->cs_method && 
-	    strcmp(irq->irq_cseq->cs_method_name, 
+	if (irq->irq_method == cseq->cs_method &&
+	    strcmp(irq->irq_cseq->cs_method_name,
 		   cseq->cs_method_name) == 0)
 	  return irq;
 	if (return_ack && irq->irq_method == sip_method_invite)
@@ -5428,8 +5896,8 @@
     else {
       /* No magic branch */
 
-      /* INVITE request matches a transaction if 
-	 the Request-URI, To tag, From tag, Call-ID, CSeq, and 
+      /* INVITE request matches a transaction if
+	 the Request-URI, To tag, From tag, Call-ID, CSeq, and
 	 top Via header match */
 
       /* From tag, Call-ID, and CSeq number has been matched above */
@@ -5445,7 +5913,7 @@
       else {
 	/* Match CSeq */
 	if (irq->irq_method == cseq->cs_method &&
-	    strcmp(irq->irq_cseq->cs_method_name, 
+	    strcmp(irq->irq_cseq->cs_method_name,
 		   cseq->cs_method_name) == 0) {
 	  /* Match To tag  */
 	  if (!str0casecmp(irq->irq_to->a_tag, to->a_tag))
@@ -5462,12 +5930,12 @@
 	else if (return_cancel && irq->irq_method != sip_method_ack)
 	  return *return_cancel = irq, NULL;
       }
-    }    
+    }
 
     /* RFC3261 - section 8.2.2.2 Merged Requests */
     if (return_merge) {
-      if (irq->irq_cseq->cs_method == cseq->cs_method && 
-	  strcmp(irq->irq_cseq->cs_method_name, 
+      if (irq->irq_cseq->cs_method == cseq->cs_method &&
+	  strcmp(irq->irq_cseq->cs_method_name,
 		 cseq->cs_method_name) == 0)
 	*return_merge = irq, return_merge = NULL;
     }
@@ -5478,7 +5946,7 @@
 
 /** Process retransmitted requests. */
 su_inline
-int 
+int
 incoming_recv(nta_incoming_t *irq, msg_t *msg, sip_t *sip, tport_t *tport)
 {
   nta_agent_t *agent = irq->irq_agent;
@@ -5543,7 +6011,7 @@
   } else if (irq->irq_queue == agent->sa_in.proceeding ||
 	     irq->irq_queue == agent->sa_in.preliminary)
     return -1;
-  else 
+  else
     assert(irq->irq_queue == agent->sa_in.inv_confirmed ||
 	   irq->irq_queue == agent->sa_in.terminated);
 
@@ -5560,7 +6028,7 @@
   nta_agent_t *agent = irq->irq_agent;
 
   /* According to the RFC 3261, this INVITE has been destroyed */
-  if (irq->irq_method == sip_method_invite && 
+  if (irq->irq_method == sip_method_invite &&
       200 <= irq->irq_status && irq->irq_status < 300) {
     mreply(agent, NULL, SIP_481_NO_TRANSACTION, msg,
 	   tport, 0, 0, NULL,
@@ -5600,7 +6068,7 @@
 
 /** Merge request */
 static
-void request_merge(nta_agent_t *agent, 
+void request_merge(nta_agent_t *agent,
 		   msg_t *msg, sip_t *sip, tport_t *tport,
 		   char const *to_tag)
 {
@@ -5671,7 +6139,7 @@
 			    tag_type_t tag, tag_value_t value, ...)
 {
   int retval = -1;
-  
+
   if (irq) {
     ta_list ta;
     ta_start(ta, tag, value);
@@ -5698,15 +6166,15 @@
     return retval;
 
   for (t = tags; t; t = tl_next(t)) {
-    tag_type_t tt = t->t_tag; 
+    tag_type_t tt = t->t_tag;
 
-    if (ntatag_comp == tt) 
+    if (ntatag_comp == tt)
       comp = (char const *)t->t_value, retval++;
 
     else if (ntatag_sigcomp_close == tt)
       irq->irq_sigcomp_zap = t->t_value != 0, retval++;
 
-    else if (tptag_compartment == tt) 
+    else if (tptag_compartment == tt)
       cc = (void *)t->t_value, retval++;
   }
 
@@ -5725,7 +6193,7 @@
     irq->irq_tpn->tpn_comp = NULL;
   }
 
-  return retval; 
+  return retval;
 }
 
 su_inline
@@ -5735,17 +6203,17 @@
   if (!nta_compressor_vtable)
     return 0;
 
-  if (irq->irq_cc == NULL 
+  if (irq->irq_cc == NULL
       || irq->irq_tpn->tpn_comp
       || tport_delivered_with_comp(tport, msg, NULL) != -1) {
     struct sigcomp_compartment *cc;
 
     cc = agent_compression_compartment(irq->irq_agent, tport, irq->irq_tpn,
 				       create_if_needed);
-    
+
     if (cc)
       agent_accept_compressed(irq->irq_agent, msg, cc);
-    
+
     irq->irq_cc = cc;
   }
 
@@ -5753,7 +6221,7 @@
 }
 
 /** Add essential headers to the response message */
-static int nta_incoming_response_headers(nta_incoming_t *irq, 
+static int nta_incoming_response_headers(nta_incoming_t *irq,
 					 msg_t *msg,
 					 sip_t *sip)
 {
@@ -5789,13 +6257,13 @@
  * @param tag,value,... taged argument list
  *
  * Generate status structure based on @a status and @a phrase.
- * Add essential headers to the response message: 
- * @From, @To, @CallID, @CSeq, @Via, and optionally 
+ * Add essential headers to the response message:
+ * @From, @To, @CallID, @CSeq, @Via, and optionally
  * @RecordRoute.
  */
 int nta_incoming_complete_response(nta_incoming_t *irq,
 				   msg_t *msg,
-				   int status, 
+				   int status,
 				   char const *phrase,
 				   tag_type_t tag, tag_value_t value, ...)
 {
@@ -5866,7 +6334,7 @@
     if (nta_incoming_response_headers(irq, msg, sip) < 0)
       msg_destroy(msg), msg = NULL;
   }
-  
+
   return msg;
 }
 
@@ -5932,7 +6400,7 @@
  * @retval 0 when succesful
  * @retval -1 upon an error
  */
-int nta_incoming_mreply(nta_incoming_t *irq, msg_t *msg) 
+int nta_incoming_mreply(nta_incoming_t *irq, msg_t *msg)
 {
   sip_t *sip = sip_object(msg);
 
@@ -5998,12 +6466,12 @@
   int retry_without_rport = 0;
   tp_name_t *tpn, default_tpn[1];
 
-  if (status == 408 && 
-      irq->irq_method != sip_method_invite && 
+  if (status == 408 &&
+      irq->irq_method != sip_method_invite &&
       !agent->sa_pass_408 &&
       !irq->irq_default) {
     /* RFC 4320 nit-actions-03 Action 2:
-       
+
    A transaction-stateful SIP element MUST NOT send a response with
    Status-Code of 408 to a non-INVITE request.  As a consequence, an
    element that can not respond before the transaction expires will not
@@ -6063,7 +6531,7 @@
 	SU_DEBUG_5(("%s: tport_tsend: %s%s\n",
 		    __func__, su_strerror(err),
 		    err == EPIPE ? "(retrying)" : ""));
-	
+
 	if (err != EPIPE && err != ECONNREFUSED)
 	  break;
 	tport_decref(&irq->irq_tport);
@@ -6099,13 +6567,13 @@
 
     if (status < 200) {
       queue = agent->sa_in.proceeding;
-      
-      if (irq->irq_method == sip_method_invite && status > 100 && 
+
+      if (irq->irq_method == sip_method_invite && status > 100 &&
 	  agent->sa_progress != UINT_MAX && agent->sa_is_a_uas) {
 	/* Retransmit preliminary responses in regular intervals */
 	incoming_set_timer(irq, agent->sa_progress); /* N2 */
       }
-    } 
+    }
     else {
       irq->irq_completed = 1;
 
@@ -6126,7 +6594,7 @@
 	tport_decref(&irq->irq_tport);
       }
       else if (status >= 300 || agent->sa_is_a_uas) {
-	if (status < 300 || !irq->irq_reliable_tp) 
+	if (status < 300 || !irq->irq_reliable_tp)
 	  incoming_set_timer(irq, agent->sa_t1); /* G */
 	queue = agent->sa_in.inv_completed; /* H */
       }
@@ -6175,7 +6643,7 @@
   }
 
   /* We could not send final response. */
-  return incoming_final_failed(irq, msg); 
+  return incoming_final_failed(irq, msg);
 }
 
 
@@ -6213,20 +6681,20 @@
     msg = reliable_response(irq);
   else
     msg = irq->irq_response;
-  
+
   if (msg && tport) {
     irq->irq_retries++;
 
     if (irq->irq_retries == 2 && irq->irq_tpn->tpn_comp) {
       irq->irq_tpn->tpn_comp = NULL;
-      
+
       if (irq->irq_cc) {
 	agent_close_compressor(irq->irq_agent, irq->irq_cc);
 	nta_compartment_decref(&irq->irq_cc);
       }
     }
 
-    tport = tport_tsend(tport, msg, irq->irq_tpn, 
+    tport = tport_tsend(tport, msg, irq->irq_tpn,
 			IF_SIGCOMP_TPTAG_COMPARTMENT(irq->irq_cc)
 			TPTAG_MTU(INT_MAX), TAG_END());
     irq->irq_agent->sa_stats->as_sent_msg++;
@@ -6263,11 +6731,11 @@
   uint32_t now = sa->sa_millisec;
   nta_incoming_t *irq, *irq_next;
   size_t retransmitted = 0, timeout = 0, terminated = 0, destroyed = 0;
-  size_t unconfirmed = 
-    sa->sa_in.inv_completed->q_length + 
+  size_t unconfirmed =
+    sa->sa_in.inv_completed->q_length +
     sa->sa_in.preliminary->q_length;
-  size_t unterminated = 
-    sa->sa_in.inv_confirmed->q_length + 
+  size_t unterminated =
+    sa->sa_in.inv_confirmed->q_length +
     sa->sa_in.completed->q_length;
   size_t total = sa->sa_incoming->iht_used;
 
@@ -6297,7 +6765,7 @@
 	incoming_set_timer(irq, 2U * irq->irq_interval); /* G */
       else
 	incoming_set_timer(irq, sa->sa_t2); /* G */
-    } 
+    }
     else if (irq->irq_method == sip_method_invite && irq->irq_status >= 100) {
       if (irq->irq_queue == sa->sa_in.preliminary) {
 	/* Timer P1 - PRACK timer */
@@ -6352,7 +6820,7 @@
   }
 
   /* Timeouts.
-   * For each state the request is in, there is always a queue of its own 
+   * For each state the request is in, there is always a queue of its own
    */
   while ((irq = sa->sa_in.preliminary->q_head)) {
     assert(irq->irq_status < 200);
@@ -6379,7 +6847,7 @@
     assert(irq->irq_method == sip_method_invite);
 
     if ((int32_t)(irq->irq_timeout - now) > 0 ||
-	timeout >= timer_max_timeout || 
+	timeout >= timer_max_timeout ||
 	terminated >= timer_max_terminate)
       break;
 
@@ -6390,7 +6858,7 @@
     irq->irq_terminated = 1;
     incoming_reset_timer(irq);
     if (!irq->irq_destroyed) {
-      timeout++; 
+      timeout++;
       incoming_queue(sa->sa_in.terminated, irq);
       /* report timeout error to user */
       incoming_call_callback(irq, NULL, NULL);
@@ -6399,7 +6867,7 @@
       terminated++;
       incoming_free_queue(rq, irq);
     }
-  } 
+  }
 
   while ((irq = sa->sa_in.inv_confirmed->q_head)) {
     assert(irq->irq_timeout);
@@ -6409,7 +6877,7 @@
     if ((int32_t)(irq->irq_timeout - now) > 0 ||
 	terminated >= timer_max_terminate)
       break;
-    
+
     /* Timer I */
     SU_DEBUG_5(("nta: timer %s fired, %s %u response\n",
 		"I", "terminate", irq->irq_status));
@@ -6460,9 +6928,9 @@
 		MOD_ZU"/"MOD_ZU" tout, "
 		MOD_ZU"/"MOD_ZU" term, "
 		MOD_ZU"/"MOD_ZU" free\n",
-		retransmitted, unconfirmed, 
+		retransmitted, unconfirmed,
 		timeout, unconfirmed,
-		terminated, unterminated, 
+		terminated, unterminated,
 		destroyed, total));
 }
 
@@ -6486,8 +6954,8 @@
 
       if (su_msg_send(m) == SU_SUCCESS)
 	q->q_length = 0;
-    }    
-  } 
+    }
+  }
 
   if (q->q_length > 0)
     incoming_reclaim_queued(NULL, NULL, (void *)q);
@@ -6513,25 +6981,25 @@
 static void outgoing_try_udp_instead(nta_outgoing_t *orq);
 static void outgoing_tport_error(nta_agent_t *agent, nta_outgoing_t *orq,
 				 tport_t *tp, msg_t *msg, int error);
-static void outgoing_print_tport_error(nta_outgoing_t *orq, 
+static void outgoing_print_tport_error(nta_outgoing_t *orq,
 				       int level, char *todo,
 				       tp_name_t const *, msg_t *, int error);
 static void outgoing_insert(nta_agent_t *sa, nta_outgoing_t *orq);
 static void outgoing_destroy(nta_outgoing_t *orq);
 su_inline int outgoing_is_queued(nta_outgoing_t const *orq);
-su_inline void outgoing_queue(outgoing_queue_t *queue, 
+su_inline void outgoing_queue(outgoing_queue_t *queue,
 				  nta_outgoing_t *orq);
 su_inline void outgoing_remove(nta_outgoing_t *orq);
 su_inline void outgoing_set_timer(nta_outgoing_t *orq, uint32_t interval);
 su_inline void outgoing_reset_timer(nta_outgoing_t *orq);
-static size_t outgoing_timer_dk(outgoing_queue_t *q, 
-				char const *timer, 
+static size_t outgoing_timer_dk(outgoing_queue_t *q,
+				char const *timer,
 				uint32_t now);
-static size_t outgoing_timer_bf(outgoing_queue_t *q, 
-				char const *timer, 
+static size_t outgoing_timer_bf(outgoing_queue_t *q,
+				char const *timer,
 				uint32_t now);
-static size_t outgoing_timer_c(outgoing_queue_t *q, 
-			       char const *timer, 
+static size_t outgoing_timer_c(outgoing_queue_t *q,
+			       char const *timer,
 			       uint32_t now);
 
 static void outgoing_ack(nta_outgoing_t *orq, sip_t *sip);
@@ -6563,13 +7031,13 @@
 static int outgoing_try_another(nta_outgoing_t *orq);
 #else
 #define outgoing_other_destinations(orq) (0)
-#define outgoing_try_another(orq) (0) 
+#define outgoing_try_another(orq) (0)
 #endif
 
 /** Create a default outgoing transaction.
  *
  * The default outgoing transaction is used when agent receives responses
- * not belonging to any transaction. 
+ * not belonging to any transaction.
  *
  * @sa nta_leg_default(), nta_incoming_default().
  */
@@ -6588,7 +7056,7 @@
   orq = su_zalloc(agent->sa_home, sizeof *orq);
   if (!orq)
     return NULL;
-    
+
   orq->orq_agent     = agent;
   orq->orq_callback  = callback;
   orq->orq_magic     = magic;
@@ -6637,7 +7105,7 @@
  * NTATAG_STATELESS(), NTATAG_DELAY_SENDING(), NTATAG_BRANCH_KEY(),
  * NTATAG_ACK_BRANCH(), NTATAG_DEFAULT_PROXY(), NTATAG_PASS_100(),
  * NTATAG_USE_TIMESTAMP(), NTATAG_USER_VIA(), TPTAG_IDENT(), NTATAG_TPORT(). All
- * SIP tags from <sofia-sip/sip_tag.h> can be used to manipulate the request message. 
+ * SIP tags from <sofia-sip/sip_tag.h> can be used to manipulate the request message.
  * SIP tags after SIPTAG_END() are ignored, however.
  */
 nta_outgoing_t *nta_outgoing_tcreate(nta_leg_t *leg,
@@ -6710,7 +7178,7 @@
  * Returns a pointer to newly created outgoing transaction object if
  * successful, and NULL otherwise.
  *
- * @note The caller is responsible for destroying the request message @a msg 
+ * @note The caller is responsible for destroying the request message @a msg
  * upon failure.
  *
  * @note If NTATAG_STATELESS(1) tag is given and the @a callback is NULL,
@@ -6725,7 +7193,7 @@
  * NTATAG_STATELESS(), NTATAG_DELAY_SENDING(), NTATAG_BRANCH_KEY(),
  * NTATAG_ACK_BRANCH(), NTATAG_DEFAULT_PROXY(), NTATAG_PASS_100(),
  * NTATAG_USE_TIMESTAMP(), NTATAG_USER_VIA(), TPTAG_IDENT(), NTATAG_TPORT(). All
- * SIP tags from <sofia-sip/sip_tag.h> can be used to manipulate the request message. 
+ * SIP tags from <sofia-sip/sip_tag.h> can be used to manipulate the request message.
  * SIP tags after SIPTAG_END() are ignored, however.
  */
 nta_outgoing_t *nta_outgoing_mcreate(nta_agent_t *agent,
@@ -6836,8 +7304,8 @@
 
   ta_start(ta, tag, value);
 
-  tl_gets(ta_args(ta), 
-	  NTATAG_CANCEL_408_REF(cancel_408), 
+  tl_gets(ta_args(ta),
+	  NTATAG_CANCEL_408_REF(cancel_408),
 	  NTATAG_CANCEL_2543_REF(cancel_2543),
 	  TAG_END());
 
@@ -6848,7 +7316,7 @@
 
   ta_end(ta);
 
-  if ((cancel_2543 || cancel_408) && 
+  if ((cancel_2543 || cancel_408) &&
       !orq->orq_stateless && !orq->orq_destroyed)
     outgoing_reply(orq, SIP_487_REQUEST_CANCELLED, 1);
 
@@ -6880,7 +7348,7 @@
  *
  * @param orq       outgoing client transaction
  * @param callback  callback function (may be NULL)
- * @param magic     application context pointer 
+ * @param magic     application context pointer
  *                  (given as argument to @a callback)
  *
  * @NEW_1_12_9
@@ -6912,7 +7380,7 @@
     return;
 
   if (orq->orq_destroyed) {
-    SU_DEBUG_1(("%s(%p): %s\n", "nta_outgoing_destroy", (void *)orq, 
+    SU_DEBUG_1(("%s(%p): %s\n", "nta_outgoing_destroy", (void *)orq,
 		"already destroyed"));
     return;
   }
@@ -6948,7 +7416,7 @@
  */
 uint32_t nta_outgoing_cseq(nta_outgoing_t const *orq)
 {
-  return orq != NULL && orq != NONE && orq->orq_cseq 
+  return orq != NULL && orq != NONE && orq->orq_cseq
     ? orq->orq_cseq->cs_seq : 0;
 }
 
@@ -6958,7 +7426,7 @@
 int nta_outgoing_status(nta_outgoing_t const *orq)
 {
   /* Return 500 Internal server error for invalid handles. */
-  return orq != NULL && orq != NONE ? orq->orq_status : 500; 
+  return orq != NULL && orq != NONE ? orq->orq_status : 500;
 }
 
 /** Get the RTT delay measured using @Timestamp header. */
@@ -7028,7 +7496,7 @@
  * @param route_url   optional URL used to route transaction requests
  * @param msg         request message
  * @param tpn         (optional) transport name
- * @param msg         request message to 
+ * @param msg         request message to
  * @param tag, value, ... tagged arguments
  *
  * @return
@@ -7106,24 +7574,24 @@
 
   /* tl_gets() is a bit too slow here... */
   for (t = ta_args(ta); t; t = tl_next(t)) {
-    tag_type_t tt = t->t_tag; 
+    tag_type_t tt = t->t_tag;
 
-    if (ntatag_stateless == tt) 
-      stateless = t->t_value != 0; 
-    else if (ntatag_delay_sending == tt) 
-      delay_sending = t->t_value != 0; 
-    else if (ntatag_branch_key == tt) 
-      branch = (void *)t->t_value; 
-    else if (ntatag_pass_100 == tt) 
-      pass_100 = t->t_value != 0; 
-    else if (ntatag_use_timestamp == tt) 
-      use_timestamp = t->t_value != 0; 
-    else if (ntatag_user_via == tt) 
-      user_via = t->t_value != 0; 
-    else if (ntatag_ack_branch == tt) 
-      ack_branch = (void *)t->t_value; 
-    else if (ntatag_default_proxy == tt) 
-      route_url = (void *)t->t_value; 
+    if (ntatag_stateless == tt)
+      stateless = t->t_value != 0;
+    else if (ntatag_delay_sending == tt)
+      delay_sending = t->t_value != 0;
+    else if (ntatag_branch_key == tt)
+      branch = (void *)t->t_value;
+    else if (ntatag_pass_100 == tt)
+      pass_100 = t->t_value != 0;
+    else if (ntatag_use_timestamp == tt)
+      use_timestamp = t->t_value != 0;
+    else if (ntatag_user_via == tt)
+      user_via = t->t_value != 0;
+    else if (ntatag_ack_branch == tt)
+      ack_branch = (void *)t->t_value;
+    else if (ntatag_default_proxy == tt)
+      route_url = (void *)t->t_value;
     else if (tptag_ident == tt)
       tp_ident = (void *)t->t_value;
     else if (ntatag_comp == tt)
@@ -7182,7 +7650,7 @@
     invalid = nta_tpn_by_url(home, orq->orq_tpn, &scheme, &port, route_url);
 
     if (override_tport) {	/* Use transport protocol name from transport  */
-      if (strcmp(orq->orq_tpn->tpn_proto, "*") == 0) 
+      if (strcmp(orq->orq_tpn->tpn_proto, "*") == 0)
 	orq->orq_tpn->tpn_proto = tport_name(override_tport)->tpn_proto;
     }
 
@@ -7244,7 +7712,7 @@
 	orq->orq_branch = su_strdup(home, ack_branch);
       else
 	orq->orq_branch = su_sprintf(home, "branch=%s", ack_branch);
-    } 
+    }
     else if (!stateless && agent->sa_is_a_uas) {
       /*
        * ACK redirect further 2XX messages to it.
@@ -7252,14 +7720,14 @@
        * Use orq_branch from INVITE, but put a different branch in topmost Via.
        */
       nta_outgoing_t *invite = outgoing_find(agent, msg, sip, NULL);
-      
+
       if (invite) {
 	sip_t const *inv = sip_object(invite->orq_request);
 
 	orq->orq_branch = su_strdup(home, invite->orq_branch);
 
 	/* @RFC3261 section 13.2.2.4 -
-	 * The ACK MUST contain the same credentials as the INVITE. 
+	 * The ACK MUST contain the same credentials as the INVITE.
 	 */
 	if (!sip->sip_proxy_authorization && !sip->sip_authorization) {
 	  if (inv->sip_proxy_authorization)
@@ -7297,7 +7765,7 @@
   agent->sa_stats->as_client_tr++;
   orq->orq_hash = NTA_HASH(sip->sip_call_id, sip->sip_cseq->cs_seq);
 
-  if (orq->orq_user_tport) 
+  if (orq->orq_user_tport)
     outgoing_send_via(orq, override_tport);
   else if (resolved)
     outgoing_prepare_send(orq);
@@ -7306,14 +7774,14 @@
     outgoing_resolve(orq);
 #endif
 
-  if (stateless && 
-      orq->orq_status >= 200 && 
+  if (stateless &&
+      orq->orq_status >= 200 &&
       callback == outgoing_default_cb) {
     void *retval;
 
-    if (orq->orq_status < 300) 
+    if (orq->orq_status < 300)
       retval = (void *)-1;	/* NONE */
-    else 
+    else
       retval = NULL, orq->orq_request = NULL;
 
     outgoing_free(orq);
@@ -7365,7 +7833,7 @@
     outgoing_reply(orq, 503, "No transport", 1);
   }
 }
-  
+
 /** Send request using given transport */
 static void
 outgoing_send_via(nta_outgoing_t *orq, tport_t *tp)
@@ -7471,7 +7939,7 @@
       cc = orq->orq_cc, orq->orq_cc = NULL;
     }
     else {
-      cc = agent_compression_compartment(agent, orq->orq_tport, tpn, 
+      cc = agent_compression_compartment(agent, orq->orq_tport, tpn,
 					 orq->orq_sigcomp_new);
     }
 
@@ -7484,7 +7952,7 @@
       orq->orq_pending = 0;
     }
 
-    tp = tport_tsend(orq->orq_tport, msg, tpn, 
+    tp = tport_tsend(orq->orq_tport, msg, tpn,
 		     tag, value,
 		     IF_SIGCOMP_TPTAG_COMPARTMENT(cc)
 		     TAG_NEXT(orq->orq_tags));
@@ -7542,7 +8010,7 @@
 
   if (orq->orq_pending) {
     assert(orq->orq_tport);
-    tport_release(orq->orq_tport, orq->orq_pending, 
+    tport_release(orq->orq_tport, orq->orq_pending,
 		  orq->orq_request, NULL, orq, 0);
     orq->orq_pending = 0;
   }
@@ -7553,7 +8021,7 @@
   }
 
   if (orq->orq_method != sip_method_ack) {
-    orq->orq_pending = tport_pend(tp, orq->orq_request, 
+    orq->orq_pending = tport_pend(tp, orq->orq_request,
 				  outgoing_tport_error, orq);
     if (orq->orq_pending < 0)
       orq->orq_pending = 0;
@@ -7636,7 +8104,7 @@
   *tpn = *orq->orq_tpn;
   tpn->tpn_proto = "udp";
   orq->orq_try_udp_instead = 1;
-  
+
   tp = tport_by_name(orq->orq_agent->sa_tports, tpn);
   if (tp && tp != orq->orq_tport) {
     sip_t *sip = sip_object(orq->orq_request);
@@ -7663,14 +8131,14 @@
 
   if (orq->orq_pending) {
     assert(orq->orq_tport);
-    tport_release(orq->orq_tport, orq->orq_pending, orq->orq_request, 
+    tport_release(orq->orq_tport, orq->orq_pending, orq->orq_request,
 		  NULL, orq, 0);
     orq->orq_pending = 0;
   }
 
   if (error == EPIPE && orq->orq_retries++ == 0) {
     /* XXX - we should retry only if the transport is not newly created */
-    outgoing_print_tport_error(orq, 5, "retrying once after ", 
+    outgoing_print_tport_error(orq, 5, "retrying once after ",
 			       tpn, msg, error);
     outgoing_send(orq, 1);
     return;
@@ -7678,7 +8146,7 @@
   else if (error == ECONNREFUSED && orq->orq_try_tcp_instead) {
     /* RFC3261, 18.1.1 */
     if (strcasecmp(tpn->tpn_proto, "tcp") == 0 && msg_size(msg) <= 65535) {
-      outgoing_print_tport_error(orq, 5, "retrying with UDP after ", 
+      outgoing_print_tport_error(orq, 5, "retrying with UDP after ",
 				 tpn, msg, error);
       outgoing_try_udp_instead(orq);
       outgoing_remove(orq);	/* Reset state - this is no resend! */
@@ -7688,7 +8156,7 @@
   }
 
   if (outgoing_other_destinations(orq)) {
-    outgoing_print_tport_error(orq, 5, "trying alternative server after ", 
+    outgoing_print_tport_error(orq, 5, "trying alternative server after ",
 			       tpn, msg, error);
     outgoing_try_another(orq);
     return;
@@ -7707,11 +8175,11 @@
   su_sockaddr_t const *su = msg_addr(msg);
   char addr[SU_ADDRSIZE];
 
-  su_llog(nta_log, level, 
+  su_llog(nta_log, level,
 	  "nta: %s (%u): %s%s (%u) with %s/[%s]:%u\n",
 	  orq->orq_method_name, orq->orq_cseq->cs_seq,
-	  todo, su_strerror(error), error, 
-	  tpn->tpn_proto, 
+	  todo, su_strerror(error), error,
+	  tpn->tpn_proto,
 	  su_inet_ntop(su->su_family, SU_ADDR(su), addr, sizeof(addr)),
 	  htons(su->su_port));
 }
@@ -7791,8 +8259,8 @@
 
 /** Change the timeout value of a queue */
 static void
-outgoing_queue_adjust(nta_agent_t *sa, 
-		      outgoing_queue_t *queue, 
+outgoing_queue_adjust(nta_agent_t *sa,
+		      outgoing_queue_t *queue,
 		      unsigned timeout)
 {
   nta_outgoing_t *orq;
@@ -7822,13 +8290,13 @@
 }
 
 /** @internal
- * Insert an outgoing transaction into a queue. 
+ * Insert an outgoing transaction into a queue.
  *
  * Insert a client transaction into a queue and set the corresponding
  * timeout at the same time.
  */
 su_inline
-void outgoing_queue(outgoing_queue_t *queue, 
+void outgoing_queue(outgoing_queue_t *queue,
 		    nta_outgoing_t *orq)
 {
   if (orq->orq_queue == queue) {
@@ -7845,7 +8313,7 @@
   orq->orq_timeout = set_timeout(orq->orq_agent, queue->q_timeout);
 
   orq->orq_queue = queue;
-  orq->orq_prev = queue->q_tail; 
+  orq->orq_prev = queue->q_tail;
   *queue->q_tail = orq;
   queue->q_tail = &orq->orq_next;
   queue->q_length++;
@@ -7880,7 +8348,7 @@
 void outgoing_set_timer(nta_outgoing_t *orq, uint32_t interval)
 {
   nta_outgoing_t **rq;
-  
+
   assert(orq);
 
   if (interval == 0) {
@@ -7890,7 +8358,7 @@
 
   if (orq->orq_rprev) {
     /* Remove transaction from retry dequeue, re-insert it later. */
-    if ((*orq->orq_rprev = orq->orq_rnext)) 
+    if ((*orq->orq_rprev = orq->orq_rnext))
       orq->orq_rnext->orq_rprev = orq->orq_rprev;
     if (orq->orq_agent->sa_out.re_t1 == &orq->orq_rnext)
       orq->orq_agent->sa_out.re_t1 = orq->orq_rprev;
@@ -7923,12 +8391,12 @@
 void outgoing_reset_timer(nta_outgoing_t *orq)
 {
   if (orq->orq_rprev) {
-    if ((*orq->orq_rprev = orq->orq_rnext)) 
+    if ((*orq->orq_rprev = orq->orq_rnext))
       orq->orq_rnext->orq_rprev = orq->orq_rprev;
     if (orq->orq_agent->sa_out.re_t1 == &orq->orq_rnext)
       orq->orq_agent->sa_out.re_t1 = orq->orq_rprev;
     orq->orq_agent->sa_out.re_length--;
-  } 
+  }
 
   orq->orq_interval = 0, orq->orq_retry = 0;
   orq->orq_rnext = NULL, orq->orq_rprev = NULL;
@@ -7963,7 +8431,7 @@
   outgoing_reset_timer(orq);
 
   if (orq->orq_pending) {
-    tport_release(orq->orq_tport, orq->orq_pending, 
+    tport_release(orq->orq_tport, orq->orq_pending,
 		  orq->orq_request, NULL, orq, 0);
   }
   orq->orq_pending = 0;
@@ -7989,12 +8457,12 @@
 #if HAVE_SOFIA_SRESOLV
   if (orq->orq_resolver)
     outgoing_destroy_resolver(orq);
-#endif  
+#endif
   su_free(orq->orq_agent->sa_home, orq);
 }
 
 /** Queue request to be freed */
-su_inline 
+su_inline
 void outgoing_free_queue(outgoing_queue_t *q, nta_outgoing_t *orq)
 {
   outgoing_cut_off(orq);
@@ -8002,7 +8470,7 @@
 }
 
 /** Reclaim memory used by queue of requests */
-static 
+static
 void outgoing_reclaim_queued(su_root_magic_t *rm,
 			     su_msg_r msg,
 			     union sm_arg_u *u)
@@ -8050,7 +8518,7 @@
   }
 }
 
-/** @internal Outgoing transaction timer routine. 
+/** @internal Outgoing transaction timer routine.
  *
  */
 static void outgoing_timer(nta_agent_t *sa)
@@ -8061,9 +8529,9 @@
   size_t retransmitted = 0, terminated = 0, timeout = 0, destroyed;
   size_t total = sa->sa_outgoing->oht_used;
   size_t trying = sa->sa_out.re_length;
-  size_t pending = sa->sa_out.trying->q_length + 
+  size_t pending = sa->sa_out.trying->q_length +
     sa->sa_out.inv_calling->q_length;
-  size_t completed = sa->sa_out.completed->q_length + 
+  size_t completed = sa->sa_out.completed->q_length +
     sa->sa_out.inv_completed->q_length;
 
   outgoing_queue_init(sa->sa_out.free = rq, 0);
@@ -8082,7 +8550,7 @@
 	 * Timer N3: try to use UDP if trying to send via TCP
 	 * but no connection is established within SIP T4
 	 */
-	SU_DEBUG_5(("nta: timer %s fired, %s %s (%u)\n", "N3", 
+	SU_DEBUG_5(("nta: timer %s fired, %s %s (%u)\n", "N3",
 		    "try UDP instead", orq->orq_method_name, orq->orq_cseq->cs_seq));
 	outgoing_try_udp_instead(orq);
       }
@@ -8128,7 +8596,7 @@
 		MOD_ZU"/"MOD_ZU" free\n",
 		retransmitted, trying,
 		timeout, pending,
-		terminated, completed, 
+		terminated, completed,
 		destroyed, total));
   }
 }
@@ -8163,8 +8631,8 @@
 
 /** Handle timers B and F */
 static
-size_t outgoing_timer_bf(outgoing_queue_t *q, 
-			 char const *timer, 
+size_t outgoing_timer_bf(outgoing_queue_t *q,
+			 char const *timer,
 			 uint32_t now)
 {
   nta_outgoing_t *orq;
@@ -8176,9 +8644,9 @@
       break;
 
     timeout++;
-    
+
     SU_DEBUG_5(("nta: timer %s fired, %s %s (%u)\n",
-		timer, 
+		timer,
 		orq->orq_method != sip_method_ack ? "timeout" : "terminating",
 		orq->orq_method_name, orq->orq_cseq->cs_seq));
 
@@ -8195,8 +8663,8 @@
 
 /** Handle timer C */
 static
-size_t outgoing_timer_c(outgoing_queue_t *q, 
-			char const *timer, 
+size_t outgoing_timer_c(outgoing_queue_t *q,
+			char const *timer,
 			uint32_t now)
 {
   nta_outgoing_t *orq;
@@ -8210,9 +8678,9 @@
       break;
 
     timeout++;
-    
+
     SU_DEBUG_5(("nta: timer %s fired, %s %s (%u)\n",
-		timer, "CANCEL and timeout", 
+		timer, "CANCEL and timeout",
 		orq->orq_method_name, orq->orq_cseq->cs_seq));
 
     nta_outgoing_tcancel(orq, NULL, NULL, TAG_NULL());
@@ -8246,7 +8714,7 @@
     outgoing_timeout(cancel, now);
 }
 
-/** Complete a client transaction. 
+/** Complete a client transaction.
  *
  * @return True if transaction was free()d.
  */
@@ -8273,8 +8741,8 @@
 
 /** Handle timers D and K */
 static
-size_t outgoing_timer_dk(outgoing_queue_t *q, 
-			 char const *timer, 
+size_t outgoing_timer_dk(outgoing_queue_t *q,
+			 char const *timer,
 			 uint32_t now)
 {
   nta_outgoing_t *orq;
@@ -8292,7 +8760,7 @@
 
     outgoing_terminate(orq);
   }
-  
+
   return terminated;
 }
 
@@ -8336,10 +8804,10 @@
 
       if (su_msg_send(m) == SU_SUCCESS)
 	q->q_length = 0;
-    }    
+    }
   }
-  
-  if (q->q_length) 
+
+  if (q->q_length)
     outgoing_reclaim_queued(NULL, NULL, (void*)q);
 
   return destroyed;
@@ -8349,7 +8817,7 @@
  *
  * Return an outgoing request object based on a message and the @Via line
  * given as argument. This function is used when doing loop checking: if we
- * have sent the request and it has been routed back to us. 
+ * have sent the request and it has been routed back to us.
  *
  * @param agent
  * @param msg
@@ -8474,7 +8942,7 @@
     else
       outgoing_reply(cancel, SIP_481_NO_TRANSACTION, 0);
 
-    if (status < 300 && orq->orq_destroyed && 
+    if (status < 300 && orq->orq_destroyed &&
 	orq->orq_method == sip_method_invite) {
       outgoing_terminate(orq);      /* We can now kill transaction */
       if (status == 100) {
@@ -8486,7 +8954,7 @@
   }
 
   if (orq->orq_pending) {
-    tport_release(orq->orq_tport, orq->orq_pending, orq->orq_request, 
+    tport_release(orq->orq_tport, orq->orq_pending, orq->orq_request,
 		  msg, orq, status < 200);
     if (status >= 200)
       orq->orq_pending = 0;
@@ -8561,16 +9029,16 @@
 
       if (status < 200) {
 	/* @RFC3261 17.1.2.1:
-	 * retransmissions continue for unreliable transports, 
-	 * but at an interval of T2 
+	 * retransmissions continue for unreliable transports,
+	 * but at an interval of T2
 	 */
 	if (!orq->orq_reliable)
 	  outgoing_set_timer(orq, sa->sa_t2);
-      } 
+      }
       else if (!outgoing_complete(orq)) {
 	if (orq->orq_sigcomp_zap && orq->orq_tport && orq->orq_cc)
 	  agent_zap_compressor(orq->orq_agent, orq->orq_cc);
-      } 
+      }
       else /* outgoing_complete */ {
 	msg_destroy(msg);
 	return 0;
@@ -8772,7 +9240,7 @@
   if (tags) {
     sip_add_tl(msg, sip, TAG_NEXT(tags));
     /* Bug sf.net # 173323:
-     * Ensure that request-URI, topmost Via, From, To, Call-ID, CSeq, 
+     * Ensure that request-URI, topmost Via, From, To, Call-ID, CSeq,
      * Max-Forward, Route, Accept-Contact, Reject-Contact and
      * Request-Disposition are copied from original request
      */
@@ -8846,7 +9314,7 @@
   assert(status == 202 || status >= 400);
 
   if (orq->orq_pending)
-    tport_release(orq->orq_tport, orq->orq_pending, 
+    tport_release(orq->orq_tport, orq->orq_pending,
 		  orq->orq_request, NULL, orq, 0);
   orq->orq_pending = 0;
 
@@ -8861,7 +9329,7 @@
       outgoing_trying(orq);	/* Timer F */
     return 0;
   }
-    
+
   if (orq->orq_destroyed) {
     if (orq->orq_status < 200)
       orq->orq_status = status;
@@ -8873,7 +9341,7 @@
     ;
   else if (orq->orq_queue == NULL ||
 	   orq->orq_queue == orq->orq_agent->sa_out.resolving ||
-	   orq->orq_queue == orq->orq_agent->sa_out.delayed) 
+	   orq->orq_queue == orq->orq_agent->sa_out.delayed)
     outgoing_trying(orq);
 
   /** Insert a dummy Via header */
@@ -8886,7 +9354,7 @@
   if (!orq->orq_stateless &&
       !(orq->orq_callback == outgoing_default_cb) &&
       !(status == 408 &&
-	orq->orq_method != sip_method_invite && 
+	orq->orq_method != sip_method_invite &&
 	!orq->orq_agent->sa_timeout_408)) {
     char const *to_tag;
 
@@ -8895,7 +9363,7 @@
     if (complete_response(msg, status, phrase, orq->orq_request) < 0) {
       assert(!"complete message");
       return -1;
-    } 
+    }
 
     sip = sip_object(msg); assert(sip->sip_flags & NTA_INTERNAL_MSG);
     to_tag = nta_agent_newtag(msg_home(msg), "tag=%s", agent);
@@ -9010,8 +9478,8 @@
 
   uint16_t sr_a_aaaa1, sr_a_aaaa2;     /**< Order of A and/or AAAA queries. */
 
-  unsigned 
-    sr_use_naptr:1, 
+  unsigned
+    sr_use_naptr:1,
     sr_use_srv:1,
     sr_use_a_aaaa:1;
 };
@@ -9033,7 +9501,7 @@
 
 static int outgoing_resolve_next(nta_outgoing_t *orq);
 static int outgoing_resolving(nta_outgoing_t *orq);
-static int outgoing_resolving_error(nta_outgoing_t *, 
+static int outgoing_resolving_error(nta_outgoing_t *,
 				    int status, char const *phrase);
 static void outgoing_graylist(nta_outgoing_t *orq, struct sipdns_query *sq);
 static int outgoing_query_naptr(nta_outgoing_t *orq, char const *domain);
@@ -9080,7 +9548,7 @@
   if (!sr) {
     outgoing_resolving_error(orq, SIP_500_INTERNAL_SERVER_ERROR);
     return;
-  } 
+  }
 
   *sr->sr_tpn = *orq->orq_tpn;
   sr->sr_use_srv = orq->orq_agent->sa_use_srv;
@@ -9097,7 +9565,7 @@
      an attempt should fail, based on the definition of failure in Section
      4.3, the next SHOULD be tried, and if that should fail, the next
      SHOULD be tried, and so on.
-     
+
      This is a change from RFC 2543.  Previously, if the port was
      explicit, but with a value of 5060, SRV records were used.  Now, A
      or AAAA records will be used.
@@ -9130,7 +9598,7 @@
 	if (strcasecmp(tpn->tpn_proto, sipdns_tports[j].name) == 0)
 	  break;
 
-      assert(j < SIPDNS_TRANSPORTS); 
+      assert(j < SIPDNS_TRANSPORTS);
       if (j == SIPDNS_TRANSPORTS)
 	/* Someone added transport but did not update sipdns_tports */
 	continue;
@@ -9142,7 +9610,7 @@
       sr->sr_tports[i] = sipdns_tports + j;
 
       if (strcmp(tpname, "*")) /* Looking for only one transport */
-	break;	
+	break;
     }
 
     /* Nothing found */
@@ -9168,7 +9636,7 @@
   case nta_res_ip4_only:
     sr->sr_a_aaaa1 = sres_type_a, sr->sr_a_aaaa2 = sres_type_a;
     break;
-  }    
+  }
 
   outgoing_resolve_next(orq);
 }
@@ -9219,7 +9687,7 @@
     outgoing_make_a_aaaa_query(orq);	/* A/AAAA */
   else
     return outgoing_resolving_error(orq, SIPDNS_503_ERROR);
-  
+
   return 1;
 }
 
@@ -9232,7 +9700,7 @@
   if (!sr)
     return 0;
 
-  if (sr->sr_use_a_aaaa || sr->sr_use_srv || sr->sr_use_naptr) 
+  if (sr->sr_use_a_aaaa || sr->sr_use_srv || sr->sr_use_naptr)
     return 1;
 
   if (sr->sr_results && sr->sr_results[1])
@@ -9264,7 +9732,7 @@
   else if (orq->orq_agent->sa_graylist == 0)
     /* PP: priority hacking disabled */
     ;
-  /* NetModule hack: 
+  /* NetModule hack:
    * Move server that did not work to end of queue in sres cache
    *
    * the next request does not try to use the server that is currently down
@@ -9296,18 +9764,18 @@
 
   /* Don't know how to graylist but SRV records */
   if (sq->sq_otype != sres_type_srv)
-    return;			
+    return;
 
   SU_DEBUG_5(("nta: graylisting %s:%s;transport=%s\n", target, sq->sq_port, proto));
 
-  for (sq = sr->sr_head; sq; sq = sq->sq_next) 
+  for (sq = sr->sr_head; sq; sq = sq->sq_next)
     if (sq->sq_otype == sres_type_srv && sq->sq_priority > maxprio)
       maxprio = sq->sq_priority;
 
   for (sq = sr->sr_done; sq; sq = sq->sq_next)
     if (sq->sq_otype == sres_type_srv && sq->sq_priority > maxprio)
       maxprio = sq->sq_priority;
-  
+
   for (sq = sr->sr_done; sq; sq = sq->sq_next) {
     int modified;
 
@@ -9316,8 +9784,8 @@
 
     /* modify the SRV record(s) corresponding to the latest A/AAAA record */
     modified = sres_set_cached_srv_priority(
-      orq->orq_agent->sa_resolver, 
-      sq->sq_domain, 
+      orq->orq_agent->sa_resolver,
+      sq->sq_domain,
       target,
       sq->sq_port[0] ? (uint16_t)strtoul(sq->sq_port, NULL, 10) : 0,
       orq->orq_agent->sa_graylist,
@@ -9335,7 +9803,7 @@
 su_inline void outgoing_cancel_resolver(nta_outgoing_t *orq)
 {
   struct sipdns_resolver *sr = orq->orq_resolver;
-  
+
   assert(orq->orq_resolver);
 
   if (sr->sr_query)    /* Cancel resolver query */
@@ -9362,12 +9830,12 @@
 int outgoing_resolving(nta_outgoing_t *orq)
 {
   struct sipdns_resolver *sr = orq->orq_resolver;
-  
+
   assert(orq->orq_resolver);
 
   if (!sr->sr_query) {
     return outgoing_resolving_error(orq, SIPDNS_503_ERROR);
-  } 
+  }
   else {
     outgoing_queue(orq->orq_agent->sa_out.resolving, orq);
     return 0;
@@ -9375,8 +9843,8 @@
 }
 
 /** Return 503 response */
-static 
-int outgoing_resolving_error(nta_outgoing_t *orq, int status, char const *phrase) 
+static
+int outgoing_resolving_error(nta_outgoing_t *orq, int status, char const *phrase)
 {
   orq->orq_resolved = 1;
   outgoing_reply(orq, status, phrase, 0);
@@ -9390,10 +9858,10 @@
   struct sipdns_resolver *sr = orq->orq_resolver;
   su_home_t *home = msg_home(orq->orq_request);
   struct sipdns_query *sq;
-  char const *host; 
+  char const *host;
   int i;
   size_t hlen;
- 
+
   sr->sr_use_srv = 0;
 
   host = sr->sr_tpn->tpn_host;
@@ -9553,19 +10021,19 @@
       break;
 
     /* Check if NAPTR matches our target */
-    if (strncasecmp(na->na_services, "SIP+", 4) && 
+    if (strncasecmp(na->na_services, "SIP+", 4) &&
 	strncasecmp(na->na_services, "SIPS+", 5))
       /* Not a SIP/SIPS service */
       continue;
 
     /* Use NAPTR results, don't try extra SRV/A/AAAA records */
-    sr->sr_use_srv = 0, sr->sr_use_a_aaaa = 0;		
-    
+    sr->sr_use_srv = 0, sr->sr_use_a_aaaa = 0;
+
     /* Check if we have a transport mathing with service */
     for (j = 0; sr->sr_tports[j]; j++) {
       /*
-       * Syntax of services is actually more complicated 
-       * but comparing the values in the transport list 
+       * Syntax of services is actually more complicated
+       * but comparing the values in the transport list
        * match with those values that make any sense
        */
       if (strcasecmp(na->na_services, sr->sr_tports[j]->service) != 0)
@@ -9587,7 +10055,7 @@
     if (!sr->sr_tports[j])
       continue;
 
-    /* OK, we found matching NAPTR */ 
+    /* OK, we found matching NAPTR */
     order = na->na_order;
 
     /*
@@ -9608,7 +10076,7 @@
     if (sq == NULL)
       continue;
 
-    *tail = sq, tail = &sq->sq_next;    
+    *tail = sq, tail = &sq->sq_next;
     sq->sq_otype = sres_type_naptr;
     sq->sq_priority = na->na_prefer;
     sq->sq_weight = j;
@@ -9619,7 +10087,7 @@
 
   sres_free_answers(orq->orq_agent->sa_resolver, answers);
 
-  /* RFC2915: 
+  /* RFC2915:
      Preference [...] specifies the order in which NAPTR
      records with equal "order" values SHOULD be processed, low
      numbers being processed before high numbers. */
@@ -9646,7 +10114,7 @@
 
 /* Query SRV records */
 static
-int outgoing_query_srv(nta_outgoing_t *orq, 
+int outgoing_query_srv(nta_outgoing_t *orq,
 		       struct sipdns_query *sq)
 {
   struct sipdns_resolver *sr = orq->orq_resolver;
@@ -9689,7 +10157,7 @@
 
   sr->sr_query = NULL;
 
-  sq0 = sr->sr_current; 
+  sq0 = sr->sr_current;
   assert(sq0 && sq0->sq_type == sres_type_srv);
   assert(sq0->sq_domain); assert(sq0->sq_proto);
 
@@ -9761,8 +10229,8 @@
   }
 
   /* This is not needed anymore (?) */
-  sr->sr_current = NULL; 
-  sq0->sq_next = sr->sr_done; sr->sr_done = sq0; 
+  sr->sr_current = NULL;
+  sq0->sq_next = sr->sr_done; sr->sr_done = sq0;
 
   outgoing_resolve_next(orq);
 }
@@ -9782,7 +10250,7 @@
 				sres_type_aaaa, sq->sq_domain);
 
   SU_DEBUG_5(("nta: for \"%s\" query \"%s\" %s%s\n",
-              orq->orq_tpn->tpn_host, sq->sq_domain, "AAAA", 
+              orq->orq_tpn->tpn_host, sq->sq_domain, "AAAA",
               answers ? " (cached)" : ""));
 
   if (answers) {
@@ -9836,7 +10304,7 @@
     su_inet_ntop(AF_INET6, &aaaa->aaaa_addr, addr, sizeof(addr));
 
     if (j == 0)
-      SU_DEBUG_5(("nta(%p): %s IN AAAA %s\n", (void *)orq, 
+      SU_DEBUG_5(("nta(%p): %s IN AAAA %s\n", (void *)orq,
 		  aaaa->aaaa_record->r_name, addr));
     else
       SU_DEBUG_5(("nta(%p):  AAAA %s\n", (void *)orq, addr));
@@ -9949,11 +10417,11 @@
 		sq->sq_domain, sq->sq_type == sres_type_a ? "A" : "AAAA"));
 
     /*
-     * Three possible policies: 
+     * Three possible policies:
      * 1) try each host for AAAA/A, then A/AAAA
      * 2) try everything first for AAAA/A, then everything for A/AAAA
      * 3) try one SRV record results for AAAA/A, then for A/AAAA,
-     *    then next SRV record 
+     *    then next SRV record
      */
 
     /* We use now policy #1 */
@@ -9968,7 +10436,7 @@
       outgoing_graylist(orq, sq);
   }
 
-  if (rlen > 1) 
+  if (rlen > 1)
     sr->sr_results = results;
   else
     sr->sr_current = NULL;
@@ -10047,7 +10515,7 @@
 
   ta_start(ta, tag, value);
 
-  if (0 > nta_incoming_complete_response(irq, msg, status, phrase, 
+  if (0 > nta_incoming_complete_response(irq, msg, status, phrase,
 					 ta_tags(ta)))
     msg_destroy(msg);
   else if (!(retval = reliable_mreply(irq, callback, rmagic, msg, sip)))
@@ -10060,7 +10528,7 @@
 
 /** Respond reliably with @a msg.
  *
- * @note 
+ * @note
  * The stack takes over the ownership of @a msg. (It is destroyed even if
  * sending the response fails.)
  *
@@ -10105,7 +10573,7 @@
   nta_agent_t *agent;
 
   agent = irq->irq_agent;
-  
+
   if (callback == NULL)
     callback = nta_reliable_destroyed;
 
@@ -10176,7 +10644,7 @@
 
   incoming_queue(sa->sa_in.preliminary, irq); /* P1 */
   incoming_set_timer(irq, sa->sa_t1); /* P2 */
-  
+
   return 0;
 }
 
@@ -10260,7 +10728,7 @@
 
       /* Found matching INVITE */
       for (rel = irq->irq_reliable; rel; rel = rel->rel_next)
-	if (rel->rel_rseq == rack->ra_response) 
+	if (rel->rel_rseq == rack->ra_response)
 	  return (nta_reliable_t  *)rel;
 
       return NULL;
@@ -10311,7 +10779,7 @@
     }
     nta_incoming_treply(pr_irq, status, "OK", TAG_END());
     nta_incoming_destroy(pr_irq);
-  } 
+  }
 
   /* If there are queued unsent reliable responses, send them all. */
   while (irq->irq_reliable && irq->irq_reliable->rel_rseq == 0) {
@@ -10327,7 +10795,7 @@
       if (reliable_send(irq, rel, msg_ref_create(msg), sip) < 0) {
 	assert(!"send reliable response");
       }
-    } 
+    }
     else {
       /*
        * XXX
@@ -10388,8 +10856,8 @@
  *  process incoming PRACK requests
  */
 int nta_reliable_leg_prack(nta_reliable_magic_t *magic,
-			   nta_reliable_t *rel, 
-			   nta_incoming_t *irq, 
+			   nta_reliable_t *rel,
+			   nta_incoming_t *irq,
 			   sip_t const *sip)
 {
   nta_agent_t *agent;
@@ -10398,7 +10866,7 @@
   url_t url[1];
   int retval;
 
-  if (irq == NULL || sip == NULL || rel == NULL || 
+  if (irq == NULL || sip == NULL || rel == NULL ||
       sip_object(irq->irq_request) != sip)
     return 500;
 
@@ -10407,14 +10875,14 @@
   *url = *sip->sip_request->rq_url; url->url_params = NULL;
   agent_aliases(agent, url, irq->irq_tport); /* canonize urls */
 
-  if ((leg = leg_find(irq->irq_agent, 
-		      method_name, url, 
+  if ((leg = leg_find(irq->irq_agent,
+		      method_name, url,
 		      sip->sip_call_id,
-		      sip->sip_from->a_tag,  
+		      sip->sip_from->a_tag,
 		      sip->sip_to->a_tag))) {
     /* Use existing dialog */
     SU_DEBUG_5(("nta: %s (%u) %s\n",
-		method_name, sip->sip_cseq->cs_seq, 
+		method_name, sip->sip_cseq->cs_seq,
 		"PRACK processed by default callback, too"));
     retval = leg->leg_callback(leg->leg_magic, leg, irq, sip);
   }
@@ -10578,9 +11046,9 @@
   tagged->orq_response     = msg_ref_create(orq->orq_response);
   tagged->orq_cancel       = NULL;
 
-  tagged->orq_pending = tport_pend(orq->orq_tport, 
-				   orq->orq_request, 
-				   outgoing_tport_error, 
+  tagged->orq_pending = tport_pend(orq->orq_tport,
+				   orq->orq_request,
+				   outgoing_tport_error,
 				   tagged);
   if (tagged->orq_pending < 0)
     tagged->orq_pending = 0;
@@ -10654,7 +11122,7 @@
 		  __func__, resp->sip_status->st_status));
       return NULL;
     }
-    
+
     if (!resp->sip_rseq) {
       SU_DEBUG_1(("%s: %u response missing RSeq\n",
 		__func__, resp->sip_status->st_status));
@@ -10706,7 +11174,7 @@
       sip_route_init(r0)->r_url[0] = resp->sip_contact->m_url[0];
       route = sip_route_dup(home, r0);
     }
-    
+
     /* Reverse record route */
     if (resp->sip_record_route) {
       sip_route_t *r, *r_next;
@@ -10740,7 +11208,7 @@
     ;
   else if (route && sip_add_dup(msg, sip, (sip_header_t *)route) < 0)
     ;
-  else if (!sip->sip_rack) 
+  else if (!sip->sip_rack)
     SU_DEBUG_1(("%s: RAck header missing\n", __func__));
   else if (nta_msg_request_complete(msg, leg,
 				    SIP_METHOD_PRACK,
@@ -10768,7 +11236,7 @@
   return orq ? orq->orq_rseq : 0;
 }
 
-/** Set @RSeq value stored with client transaction. 
+/** Set @RSeq value stored with client transaction.
  *
  * @return 0 if rseq was set successfully
  * @return -1 if rseq is invalid or orq is NULL.
@@ -10776,7 +11244,7 @@
 int nta_outgoing_setrseq(nta_outgoing_t *orq, uint32_t rseq)
 {
   if (orq && orq->orq_rseq <= rseq) {
-    orq->orq_rseq = rseq;      
+    orq->orq_rseq = rseq;
     return 0;
   }
 
@@ -10841,7 +11309,7 @@
 struct sigcomp_compartment *
 nta_incoming_compartment(nta_incoming_t *irq)
 {
-  if (nta_compressor_vtable && irq && irq->irq_cc) 
+  if (nta_compressor_vtable && irq && irq->irq_cc)
     return nta_compressor_vtable->ncv_compartment_ref(irq->irq_cc);
   else
     return NULL;
@@ -10860,7 +11328,7 @@
 struct sigcomp_compartment *
 nta_outgoing_compartment(nta_outgoing_t *orq)
 {
-  if (nta_compressor_vtable && orq && orq->orq_cc) 
+  if (nta_compressor_vtable && orq && orq->orq_cc)
     return nta_compressor_vtable->ncv_compartment_ref(orq->orq_cc);
   else
     return NULL;
@@ -10879,7 +11347,7 @@
 void
 nta_compartment_decref(struct sigcomp_compartment **pcc)
 {
-  if (nta_compressor_vtable && pcc && *pcc) 
+  if (nta_compressor_vtable && pcc && *pcc)
     nta_compressor_vtable->ncv_compartment_unref(*pcc), *pcc = NULL;
 }
 
@@ -10887,7 +11355,7 @@
 /** Get compartment for connection, create it when needed. */
 static
 struct sigcomp_compartment *
-agent_compression_compartment(nta_agent_t *sa, 
+agent_compression_compartment(nta_agent_t *sa,
 			      tport_t *tp,
 			      tp_name_t const *tpn,
 			      int new_if_needed)
@@ -10979,24 +11447,24 @@
   for (i = oht->oht_size; i-- > 0;)
     /* while */ if (oht->oht_table[i]) {
       nta_outgoing_t *orq = oht->oht_table[i];
-      
+
       if (orq->orq_pending && orq->orq_tport)
-	tport_release(orq->orq_tport, orq->orq_pending, orq->orq_request, 
+	tport_release(orq->orq_tport, orq->orq_pending, orq->orq_request,
 		      NULL, orq, 0);
-      
+
       orq->orq_pending = 0;
       tport_unref(orq->orq_tport), orq->orq_tport = NULL;
     }
-  
-  
+
+
   for (i = iht->iht_size; i-- > 0;)
     /* while */ if (iht->iht_table[i]) {
       nta_incoming_t *irq = iht->iht_table[i];
       tport_unref(irq->irq_tport), irq->irq_tport = NULL;
-    }  
-  
+    }
+
   tport_destroy(agent->sa_tports), agent->sa_tports = NULL;
-  
+
   msg_header_free(agent->sa_home, (void *)agent->sa_vias);
   agent->sa_vias = NULL;
   msg_header_free(agent->sa_home, (void *)agent->sa_public_vias);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta.docs	Tue Dec 23 07:37:03 2008
@@ -17,28 +17,28 @@
  * @LICENSE LGPL
  *
  * @section nta_objects NTA Objects
- * 
+ *
  * The NTA deals with a few kinds of objects: @e agent (#nta_agent_t), @e
  * call @e legs (#nta_leg_t), @e outgoing @e client @e requests
  * (#nta_outgoing_t), and @e incoming @e server @e requests
  * (#nta_incoming_t).
- * 
+ *
  * NTA also uses SIP message objects #msg_t and #sip_t for handling
  * messages, as defined in <sofia-sip/msg.h> and <sofia-sip/sip.h>,
  * respectively. The various SIP headers are also defined in
  * <sofia-sip/sip.h>.
- * 
+ *
  * @section nta_agent_t Creating an NTA Agent
- * 
+ *
  * Most of the SIP entities, like @e user @e agent or @e proxy, consist of a
  * SIP server and a SIP client working together.  The NTA provides a simple
  * interface to SIP server and client with the #nta_agent_t objects.
- * 
+ *
  * The #nta_agent_t object is created by calling nta_agent_create(). The
  * object listens for incoming connections, receives messages, parses them,
  * and pass them to the application. It also takes care of resolving the
  * domain names and sending the messages.
- * 
+ *
  * The agent needs a #su_root_t object to schedule its execution. A root
  * object is used to wait for the network events, schedule the timer
  * routines, and pass messages asyncronously. A root object can be created
@@ -46,61 +46,61 @@
  * own thread, or its main loop can be executed by an application thread by
  * calling the function su_root_run(). The main loop can be terminated by
  * calling the function su_root_break().
- * 
+ *
  * A simple agent could be created as follows:
  * @code
  *  registrar->reg_root = su_root_create(NULL);
- * 
+ *
  *  if (registrar->reg_root) {
  *    registrar->reg_agent = nta_agent_create(registrar->reg_root,
  *                                            (url_string_t*)argv[1],
  *                                            NULL,
  *                                            NULL,
  *                                            NULL);
- * 
+ *
  *    if (registrar->reg_agent) {
  *      su_root_run(registrar->reg_root);
  *      nta_agent_destroy(registrar->reg_agent);
  *    }
- * 
+ *
  *    su_root_destroy(registrar->reg_root);
  *  }
  * @endcode
- * 
+ *
  * @section nta_server SIP Server Action
- * 
+ *
  * A SIP server responds to the transactions sent by a client. The SIP
  * server can operate in two modes; it can be stateless or stateful. This
  * section describes how a stateful SIP server uses NTA.
- * 
+ *
  * @subsection nta_leg_t The NTA Legs
- * 
+ *
  * A leg is required for stateful transaction processing.  A default
  * leg is created like this:
  * @code
  * default_leg = nta_leg_tcreate(agent, process_requests, context,
- *                               URLTAG_URL(url), 
+ *                               URLTAG_URL(url),
  *                               NTATAG_NO_DIALOG(1),
  *                               TAG_END());
- * @endcode			       
- * 
+ * @endcode
+ *
  * The @a url parameter is used to specify which URLs match to the leg. If
  * it is given, only requests with requestURI matching are processed by the
  * leg. The nta_leg_tcreate() is a @ref tagarg "tagarg" function, taking a
  * tagged argument list as its arguments.
- * 
+ *
  * Other, ordinary legs can be used to match incoming requests with existing
  * dialogs, calls or transaction contexts, or to provide outgoing requests
  * with consistent headers. When a call leg is created, it is provided with
  * @From and @To headers, and optionally with other headers like
  * @CallID, @Route, or @CSeq.
- * 
+ *
  * A new call leg can be created as follows:
  * @code
  * call_leg = nta_leg_tcreate(agent,
  *                            process_call_requests, call_context,
  *                            SIPTAG_CALL_ID(sip->sip_call_id),
- *                            SIPTAG_TO(sip->sip_from),   
+ *                            SIPTAG_TO(sip->sip_from),
  *                            SIPTAG_FROM(sip->sip_to),
  *                            TAG_END());
  * @endcode
@@ -112,9 +112,9 @@
  * @note An existing leg can be used in any direction, however.  If the leg
  * was created for an incoming INVITE transaction, it is also possible to
  * use the leg for an outgoing BYE transaction.
- * 
+ *
  * @subsection nta_leg_tag Tagging the Call Leg
- * 
+ *
  * All the SIP UAS elements are required to tag the @To header in their
  * final responses. The function nta_leg_tag() adds a tag to the leg's local
  * address. Local address is used as the @To header in the reply messages,
@@ -126,34 +126,34 @@
  *   if (!nta_leg_tag(leg, nta_incoming_tag(irq, NULL)))
  *    nta_incoming_treply(irq, SIP_500_INTERNAL_SERVER_ERROR, TAG_END());
  * @endcode
- * 
+ *
  * @subsection nta_incoming_t Incoming Transactions
- * 
+ *
  * An incoming transaction object (nta_incoming_t) is created by NTA for
  * each unique incoming request message. When NTA has created the incoming
- * transaction object, it invokes the callback function provided with 
- * nta_leg_tcreate().  
- * 
+ * transaction object, it invokes the callback function provided with
+ * nta_leg_tcreate().
+ *
  * The simplest way to reply to the request is to return a valid status code
  * from the callback function. Valid status codes are in range of 100 to
  * 699, inclusive.  If no automatic response is desired, the callback
  * function should return 0.
- * 
+ *
  * @note If the status code is final, the incoming transaction object will
  * be destroyed immediately after the callback function returns. It can not
  * be used afterwards.
- * 
+ *
  * @note It is not possible to respond with a 2xx status code to an incoming
  * INVITE transaction by returning the status code from the callback.
- * 
+ *
  * Valid return values for callback function are as follows:
  * @li 0, 100 .. 699 for requests other than INVITE, and
  * @li 0, 100 .. 199, 300..699 for INVITE requests.
- * 
+ *
  * All other return codes are interpreted as 500, that is, a @e 500 @e
  * Internal @e Server @e Error reply message is sent back to the client and
  * the request is immediately destroyed.
- * 
+ *
  * The simple registrar/redirect server may have a incoming request callback
  * as follows:
  * @code
@@ -163,20 +163,20 @@
  * 	     	       sip_t const *sip)
  * {
  *   sip_contact_t *m;
- * 
+ *
  *   switch (sip->sip_request->rq_method) {
  *   case sip_method_register:
  *     return registrar_add(server, leg, reply, sip);
- * 
+ *
  *   case sip_method_ack:
  *     return 500;
- * 
+ *
  *   case sip_method_cancel:
  *     return 200;
- * 
+ *
  *   default:
  *     if (registrar_find(server, sip->sip_request->rq_url, &m) {
- *       nta_incoming_treply(irq, SIP_302_MOVED_TEMPORARILY, 
+ *       nta_incoming_treply(irq, SIP_302_MOVED_TEMPORARILY,
  *                           SIPTAG_CONTACT(m), TAG_END());
  *       return 302;
  *     }
@@ -187,37 +187,37 @@
  *   }
  * }
  * @endcode
- * 
+ *
  * The default reply message will contain the status line with default
  * phrase, then @Via, @To, @From, @CallID, @CSeq, and @ContentLength headers.
  * If a more complex response message is required, the application should
- * respond using the function nta_incoming_treply(): 
+ * respond using the function nta_incoming_treply():
  * @code
- * nta_incoming_treply(reply, SIP_200_OK, 
+ * nta_incoming_treply(reply, SIP_200_OK,
  *                     SIPTAG_CONTACT(contact),
  *                     SIPTAG_CONTENT_TYPE_STR("application/sdp"),
  *                     SIPTAG_PAYLOAD(sdp),
  *                     TAG_END());
  * @endcode
- * 
+ *
  * The nta_incoming_treply() is a @ref tagarg "tagarg" function, taking a
  * tagged argument list as its argument.
- * 
+ *
  * @note It is possible to send provisional replies (containing 1xx status
  * codes) several times with nta_incoming_treply(), but only one final
  * reply (containing status codes 2xx..6xx) can be sent. However, with
  * INVITE requests, a proxy can send a final 2xx reply even after an error
  * reply (3xx..6xx).
- * 
+ *
  * @section nta_100rel Reliable Provisional Responses - "100rel"
- * 
+ *
  * The <A href="../specs/rfc3262.txt"><B>100rel</B></A> SIP extension
  * provides reliable provisional responses, provisional responses that are
  * retransmitted until a special acknowledgement request, PRACK, is
  * received. In addition the PRACK method, the extension defines two
  * headers, @RSeq and @RAck, that are used to identify different
  * response messages. PRACK method is usable on INVITE requests only.
- * 
+ *
  * Using reliable responses is negotiated using the "100rel" option tag. The
  * UAC (party sending the INVITE) can include the option tag to the
  * @Supported or @Require header. In the first case, the UAC just
@@ -236,11 +236,11 @@
  * functions nta_reliable_treply() or nta_reliable_mreply(). These functions
  * return a pointer to a special object, nta_reliable_t, that is used to
  * keep track of unacknowledged responses and respond to the the PRACK
- * acknowledgement request. 
- * 
+ * acknowledgement request.
+ *
  * Both the functions nta_reliable_treply () and nta_reliable_mreply() take
  * a callback funtion pointer and an application context pointer as their
- * arguments. The callback function is similar to the leg callback function. 
+ * arguments. The callback function is similar to the leg callback function.
  * The callback is invoked when a corresponding PRACK request is received,
  * or when there is a timeout.
  *
@@ -252,7 +252,7 @@
  * nta_incoming_treply()/nta_incoming_mreply() functions, the @b nta creates
  * a reliable response object for each provisional response in behalf of
  * application. As the application can not provide a PRACK callback function
- * to @b nta, the PRACK requests are not delivered to the application. 
+ * to @b nta, the PRACK requests are not delivered to the application.
  *
  * @subsection early_dialog UAC Receives a Reliable Response
  *
@@ -261,7 +261,7 @@
  * early @e dialog with the UAS. In another view, a reliable response is
  * used to establish the early dialog. UAC establishes a leg object for the
  * early dialog by calling nta_leg_tcreate() with the parameters derived
- * from the response message. 
+ * from the response message.
  *
  * @code
  * int invite_callback(call_t *call,
@@ -269,30 +269,30 @@
  * 		    sip_t const *sip)
  * {
  *   int status = sip->sip_status->st_status;
- * 
- *   if (!call->has_dialog && 
+ *
+ *   if (!call->has_dialog &&
  *       (status >= 200 || (status > 100 && sip->sip_rseq))) {
- *     nta_leg_t *early = 
+ *     nta_leg_t *early =
  *       nta_leg_tcreate(call->nta_agent, mid_dialog_request, call,
  * 		      SIPTAG_TO(sip->sip_to),
  * 		      SIPTAG_FROM(sip->sip_from),
  * 		      SIPTAG_CALL_ID(sip->sip_call_id),
  * 		      SIPTAG_CSEQ(sip->sip_cseq),
  * 		      TAG_END());
- * 
- *     nta_leg_client_route(early, 
+ *
+ *     nta_leg_client_route(early,
  * 			 sip->sip_record_route,
  * 			 sip->sip_contact);
- * 
+ *
  *     fork = call_fork(call, leg = early);
- * 
+ *
  *     if (!fork) {
  *       handle error;
  *     }
  *     call = fork;
- *   }				       
+ *   }
  * @endcode
- * 
+ *
  * The original dialog object and client transaction object are used to
  * process other call forks. For instance, if the early dialog is
  * established with an announcement server it will never lead to an fully
@@ -306,14 +306,14 @@
  * transaction object by calling nta_outgoing_prack()
  *
  * @section nta_client SIP Client Action
- * 
+ *
  * A SIP client initiates the transactions. In some cases, a SIP client is
  * also required to invoke additional transactions, like @b ACK or @b
  * CANCEL, to finalize the original transaction. This section describes how
  * a SIP client uses NTA to make transactions.
- * 
+ *
  * @subsection client_nta_leg_t Creating the Call Leg
- * 
+ *
  * If the client does not have a suitable call leg, it must create it by
  * calling the function nta_leg_tcreate():
  * @code
@@ -324,15 +324,15 @@
  *                                SIPTAG_TO(to),
  *                                TAG_END());
  * @endcode
- * 
+ *
  * The @p callback function and @p context pointer are used for incoming
  * transactions, and they may be @c NULL if no such transactions are
  * expected.  If the callback is @c NULL, NTA responds to incoming
  * transactions with status @e 403 @e Forbidden.
- * 
+ *
  * The @a call_id may be @c NULL or left out. In that case, NTA generates a
  * new call ID.
- * 
+ *
  * The @a from and @a to are used in outgoing transactions. They are also
  * used to select which incoming messages belong to this leg.
  *
@@ -341,11 +341,11 @@
  *
  * The additional parameters (after @a to) are included in outgoing messages
  * using this leg. Currently, only @c SIPTAG_ROUTE() is supported.
- * 
+ *
  * @note Additional tagged parameters are ignored.
- * 
+ *
  * @subsection nta_outgoing_t Outgoing requests
- * 
+ *
  * The outgoing request is created and sent by nta_outgoing_tcreate(). It
  * can be used as follows:
  * @code
@@ -356,31 +356,31 @@
  *                             SIPTAG_CONTACT(my_contact),
  *                             TAG_END());
  * @endcode
- * 
+ *
  * NTA invokes the callback function response_to_register() each time a
  * provisional answer is received, and when a final answer is received.
- * 
+ *
  * @note There may be multiple final answers to the INVITE request.
- * 
+ *
  * If NTA does not receive answer in timely manner, it will generate a
- * @e 408 @e Timeout response and hand that back to the application. 
- * 
+ * @e 408 @e Timeout response and hand that back to the application.
+ *
  * @note After a provisional answer to the INVITE request, no timeout will
  * occur inside NTA.  Application must itself timeout the INVITE
  * transactions if any answer has been received.
- * 
+ *
  * The request can be destroyed with NTA function nta_outgoing_destroy().
  * If no final answer has been received, the request is cancelled when it is
  * destroyed, too.  The application can also cancel the outgoing request by
  * calling nta_outgoing_cancel().
- * 
+ *
  * @subsection nta_ack Acknowledging Answers to INVITE
- * 
+ *
  * The final answers to the INVITE request must be acknowledged. NTA takes
  * care of acknowledging automatically the 3xx..6xx answers; the appliction
  * must explicitly create a separate acknowledge transaction to final 2xx
- * answers. 
- * 
+ * answers.
+ *
  * The final answer can be acknowledged like this:
  * @code
  *  url = sip->sip_contact ? sip->sip_contact->m_url : original_url;
@@ -391,10 +391,10 @@
  *                             SIPTAG_PAYLOAD(sdp),
  *                             TAG_END());
  * @endcode
- * 
- * @note The ACK transaction should be sent to the @Contact specified in the 
- * 2xx reply.  
- * 
+ *
+ * @note The ACK transaction should be sent to the @Contact specified in the
+ * 2xx reply.
+ *
  * <a name="nta_register_f"></a>
  * @section nta_stateless_callback Stateless Processing of SIP Messages
  *
@@ -427,27 +427,27 @@
  * parsed contents (@a sip) the callback function gets the
  * application-specific context pointer (in this case, @a registrar) and a
  * pointer to the NTA agent (@a agent) as its arguments:
- * 
- * @code 
+ *
+ * @code
  * int process_message(nta_agent_context_t *registrar,
  * 		       nta_agent_t *agent,
  * 		       msg_t *msg,
  * 		       sip_t *sip);
  * @endcode
- * 
+ *
  * The application has three functions that can be used to process the
  * messages in stateless manner:
  * @li nta_msg_discard() ignores and destroys the message,
  * @li nta_msg_tsend() forwards a request or response message, and
  * @li nta_msg_treply() replies to a request message in a stateless way.
- * 
+ *
  * Additionally, it is possible to process a request message statefully with
  * nta_incoming_create().
  *
  * The functionality of the stateless callback function can vary greatly,
  * depending the purpose of the application. An user-agent, a proxy or a
  * registrar/redirect server each have very different callback functions.
- * 
+ *
  * A simple redirect server could have a message callback function as
  * follows.
  *
@@ -459,15 +459,15 @@
  * {
  *   sip_contact_t *m;
  *   sip_unsupported_t *u;
- * 
+ *
  * @endcode
  *
  * The incoming response messages are simply ignored. The @b ACK requests can
  * safely be discarded, too, because the redirect server keeps no state.
- * 
+ *
  * @code
  *   if (!sip->sip_request || sip->sip_request->rq_method == sip_method_ack) {
- *     nta_msg_discard(agent, msg); 
+ *     nta_msg_discard(agent, msg);
  *     return 0;
  *   }
  * @endcode
@@ -477,7 +477,7 @@
  * @code
  *   u = sip_unsupported(msg_home(msg), sip->sip_require, r->r_supported);
  *   if (u) {
- *     nta_msg_treply(agent, msg, SIP_420_BAD_EXTENSION, 
+ *     nta_msg_treply(agent, msg, SIP_420_BAD_EXTENSION,
  *                    SIPTAG_SUPPORTED(r->r_supported),
  *                    SIPTAG_UNSUPPORTED(u),
  *                    TAG_END());
@@ -495,17 +495,17 @@
  *   }
  * @endcode
  *
- *  All other requests are answered normally with a 302 response. 
+ *  All other requests are answered normally with a 302 response.
  *  The location service is
  *  searched for the request uri, and if a matching address was found, a
  *  list of active bindings is returned to the client.
  * @code
  *   m = location_find(redirect, sip->sip_request->rq_url);
  *   if (m) {
- *     nta_msg_treply(agent, msg, SIP_302_MOVED_TEMPORARILY, 
+ *     nta_msg_treply(agent, msg, SIP_302_MOVED_TEMPORARILY,
  *                    SIPTAG_CONTACT(m),
  *                    TAG_END());
- *   } 
+ *   }
  * @endcode
  *
  *   Otherwise, @e 404 @e Not @e Found is sent:
@@ -513,22 +513,22 @@
  *   else {
  *     nta_msg_treply(agent, msg, SIP_404_NOT_FOUND, TAG_END());
  *   }
- * 
+ *
  *   return 0;
  * }
  * @endcode
- * 
+ *
  */
 
 /**@page internal NTA Semantics and Internal Data Flows
- * 
+ *
  * NTA implements simple state machines at transaction level. The figure
  * below illustrates how a message is processed by NTA.
- * 
- * @image html nta-receiving-message.gif "NTA processing incoming messages." 
- * @image latex nta-receiving-message.eps "NTA processing incoming messages." 
- * 
- * 
+ *
+ * @image html nta-receiving-message.gif "NTA processing incoming messages."
+ * @image latex nta-receiving-message.eps "NTA processing incoming messages."
+ *
+ *
  */
 
 int invite_callback(call_t *call,
@@ -538,9 +538,9 @@
   int status = sip->sip_status->st_status;
   nta_leg_t *leg = call->leg;
 
-  if (!call->has_dialog && 
+  if (!call->has_dialog &&
       (status >= 200 || (status > 100 && sip->sip_rseq))) {
-    nta_leg_t *early = 
+    nta_leg_t *early =
       nta_leg_tcreate(call->nta_agent, mid_dialog_request, call,
 		      SIPTAG_TO(sip->sip_to),
 		      SIPTAG_FROM(sip->sip_from),
@@ -548,7 +548,7 @@
 		      SIPTAG_CSEQ(sip->sip_cseq),
 		      TAG_END());
 
-    nta_leg_client_route(early, 
+    nta_leg_client_route(early,
 			 sip->sip_record_route,
 			 sip->sip_contact);
 
@@ -558,16 +558,16 @@
       handle error;
     }
     call = fork;
-  }				       
-  
+  }
+
   if (status > 100 && status < 200 && sip->sip_rseq) {
-    nta_outgoing_t *prack = 
+    nta_outgoing_t *prack =
       nta_outgoing_prack(leg, orq, NULL, NULL, NULL,
-			 sip, 
+			 sip,
 			 TAG_END());
     nta_outgoing_destroy(prack);
     return 0;
   }
-  
+
   ...
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h	Tue Dec 23 07:37:03 2008
@@ -24,551 +24,46 @@
 
 #ifndef NTA_INTERNAL_H
 /** Defined when <nta_internal.h> has been included. */
-#define NTA_INTERNAL_H 
+#define NTA_INTERNAL_H
 
 /**@internal @file nta_internal.h
  *
- * @brief Internals of NTA objects.
+ * @brief NTA internal interfaces.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Tue Jul 18 09:18:32 2000 ppessi
  */
 
-/* Resolver context type */
-#define SRES_CONTEXT_T    nta_outgoing_t
+SOFIA_BEGIN_DECLS
 
-/* We are customer of tport_t */
-#define TP_AGENT_T        nta_agent_t
-#define TP_MAGIC_T        sip_via_t 
-#define TP_CLIENT_T       nta_outgoing_t
+/** A sip_flag telling that this message is internally generated. */
+#define NTA_INTERNAL_MSG (1<<15)
 
 #include <sofia-sip/nta.h>
 #include <sofia-sip/nta_tport.h>
+#include <sofia-sip/nta_stateless.h>
 #include <sofia-sip/tport.h>
-
 #if HAVE_SOFIA_SRESOLV
 #include <sofia-sip/sresolv.h>
 #endif
-
 #include <sofia-sip/htable.h>
 
-#if HAVE_SMIME
-#include "smimec.h"
-#endif
-
-SOFIA_BEGIN_DECLS
-
-/** A sip_flag telling that this message is internally generated. */
-#define NTA_INTERNAL_MSG (1<<15)
-
-/** Resolving order */
-enum nta_res_order_e
-{
-  nta_res_ip6_ip4,
-  nta_res_ip4_ip6,
-  nta_res_ip6_only,
-  nta_res_ip4_only
-};
-
-HTABLE_DECLARE_WITH(leg_htable, lht, nta_leg_t, size_t, hash_value_t);
-HTABLE_DECLARE_WITH(outgoing_htable, oht, nta_outgoing_t, size_t, hash_value_t);
-HTABLE_DECLARE_WITH(incoming_htable, iht, nta_incoming_t, size_t, hash_value_t);
-
-typedef struct outgoing_queue_t {
-  nta_outgoing_t **q_tail;
-  nta_outgoing_t  *q_head;
-  size_t           q_length;
-  unsigned         q_timeout;
-} outgoing_queue_t;
-
-typedef struct incoming_queue_t {
-  nta_incoming_t **q_tail;
-  nta_incoming_t  *q_head;
-  size_t           q_length;
-  unsigned         q_timeout;
-} incoming_queue_t;
-
 typedef struct nta_compressor nta_compressor_t;
 
-struct nta_agent_s
-{
-  su_home_t             sa_home[1];
-  su_root_t            *sa_root;
-  su_timer_t           *sa_timer;
-  nta_agent_magic_t    *sa_magic;
-  nta_message_f        *sa_callback;     
-
-  nta_update_magic_t   *sa_update_magic;
-  nta_update_tport_f   *sa_update_tport;
-
-  su_time_t             sa_now;	 /**< Timestamp in microsecond resolution. */
-  uint32_t              sa_next; /**< Timestamp for next agent_timer. */
-  uint32_t              sa_millisec; /**< Timestamp in milliseconds. */
-
-  uint32_t              sa_nw_updates; /* Shall we enable network detector? */
-
-  uint32_t              sa_flags;	/**< Message flags */
-  msg_mclass_t const   *sa_mclass;
-
-  sip_contact_t        *sa_contact;
-  sip_via_t            *sa_vias;   /**< @Via headers for all transports */
-  sip_via_t            *sa_public_vias;   /**< @Vias for public transports */
-  sip_contact_t        *sa_aliases;/**< List of aliases for agent */
-
-  uint64_t              sa_branch; /**< Counter for generating branch parameter */
-  uint64_t              sa_tags;   /**< Counter for generating tag parameters */
-
-  char const           *sa_2543_tag; /**< Fixed tag added to @To when responding */
-
-#if HAVE_SOFIA_SRESOLV
-  sres_resolver_t      *sa_resolver; /**< DNS resolver */
-#endif
-
-  tport_t              *sa_tports;
-  
-  /* Default outbound proxy */
-  url_t                *sa_default_proxy;
-
-#if HAVE_SMIME
-  sm_object_t          *sa_smime;
-#else
-  void                 *sa_smime;
-#endif
-
-
-  /** Request error mask */
-  unsigned              sa_bad_req_mask;
-  /** Response error mask */
-  unsigned              sa_bad_resp_mask;
-
-  /** Maximum size of incoming messages */
-  size_t                sa_maxsize;
-  
-  /** Maximum size of proceeding queue */
-  size_t                sa_max_proceeding;
-  
-  /** Maximum size of outgoing UDP requests */
-  unsigned              sa_udp_mtu;
-
-  /** SIP T1 - initial interval of retransmissions (500 ms) */
-  unsigned              sa_t1;
-  /** SIP T2 - maximum interval of retransmissions (4000 ms) */
-  unsigned              sa_t2;
-  /** SIP T4 - clear message time (5000 ms) */
-  unsigned              sa_t4;
-
-  /** SIP T1X64 - transaction lifetime (32 s) */
-  unsigned              sa_t1x64;
-
-  /** Progress timer - interval between provisional responses sent */
-  unsigned              sa_progress;
-
-  /** SIP timer C - interval between provisional responses receivedxs */
-  unsigned              sa_timer_c;
-
-  /** Graylisting period */
-  unsigned              sa_graylist;
-  /** Blacklisting period */
-  unsigned              sa_blacklist;
-
-    /** NTA is used to test packet drop */
-  unsigned              sa_drop_prob : 10;
-  /** NTA is acting as an User Agent server */
-  unsigned              sa_is_a_uas : 1;
-  /** Process requests outside dialog statelessly */
-  unsigned              sa_is_stateless : 1;
-  /** Let application provide @Via headers */
-  unsigned              sa_user_via:1;
-  /** Respond with "100 Trying" if application has not responded. */
-  unsigned              sa_extra_100:1;
-  /** The "100 Trying" provisional answers are passed to the application */
-  unsigned              sa_pass_100:1;
-  /** If true, a "408 Request Timeout" message is generated when outgoing
-      request expires. */
-  unsigned              sa_timeout_408:1;
-  /** If true, a "408 Request Timeout" responses are passed to client. */
-  unsigned              sa_pass_408:1;
-  /** If true, a "482 Request Merged" response is sent to merged requests. */
-  unsigned              sa_merge_482 : 1;
-  /** If true, send a CANCEL to an INVITE without an provisional response. */
-  unsigned              sa_cancel_2543 : 1;
-  /** If true, reply with 487 response when a CANCEL is received. */
-  unsigned              sa_cancel_487 : 1;
-  /** If true, use unique tags. */
-  unsigned              sa_tag_3261 : 1;
-  /** If true, include 100rel in INVITE requests. */
-  unsigned              sa_invite_100rel : 1;
-  /** If true, insert @Timestamp in requests. */
-  unsigned              sa_timestamp : 1;
-
-  /** If true, transports support IPv4. */
-  unsigned              sa_tport_ip4 : 1;
-  /** If true, transports support IPv6. */
-  unsigned              sa_tport_ip6 : 1;
-  /** If true, transports support UDP. */
-  unsigned              sa_tport_udp : 1;
-  /** If true, transports support TCP. */
-  unsigned              sa_tport_tcp : 1;
-  /** If true, transports support SCTP. */
-  unsigned              sa_tport_sctp : 1;
-  /** If true, transports support TLS. */
-  unsigned              sa_tport_tls : 1;
-
-  /** If true, use NAPTR lookup */
-  unsigned              sa_use_naptr : 1;
-  /** If true, use SRV lookup */
-  unsigned              sa_use_srv : 1;
-
-  /** If true, transports use threadpool */
-  unsigned              sa_tport_threadpool : 1;
-
-  /** If true, use rport at client */
-  unsigned              sa_rport:1;
-  /** If true, use rport at server */
-  unsigned              sa_server_rport:2;
-  /** If true, use rport with tcp, too */
-  unsigned              sa_tcp_rport:1;
-
-  /** If true, automatically create compartments */
-  unsigned              sa_auto_comp:1;
-
-  /** Set when executing timer */
-  unsigned              sa_in_timer:1;
-  
-  /** Set if application has set value for timer C */
-  unsigned              sa_use_timer_c:1;
-
-  unsigned              :0;
-
-  /** Messages memory preload. */
-  unsigned              sa_preload;
-
-  /** Name of SigComp algorithm */
-  char const           *sa_algorithm;
-  /** Options for SigComp. */
-  char const           *sa_sigcomp_options;
-  char const* const    *sa_sigcomp_option_list;
-  char const           *sa_sigcomp_option_free;
-
-  nta_compressor_t     *sa_compressor;
-
-  /** Resolving order (AAAA/A) */
-  enum nta_res_order_e  sa_res_order;
-
-  /** @MaxForwards */
-
-  sip_max_forwards_t    sa_max_forwards[1];
-
-  /* Statistics */
-  struct {
-    usize_t as_recv_msg;
-    usize_t as_recv_request;
-    usize_t as_recv_response;
-    usize_t as_bad_message;
-    usize_t as_bad_request;
-    usize_t as_bad_response;
-    usize_t as_drop_request;
-    usize_t as_drop_response;
-    usize_t as_client_tr;
-    usize_t as_server_tr;
-    usize_t as_dialog_tr;
-    usize_t as_acked_tr;
-    usize_t as_canceled_tr;
-    usize_t as_trless_request;
-    usize_t as_trless_to_tr;
-    usize_t as_trless_response;
-    usize_t as_trless_200;
-    usize_t as_merged_request;
-    usize_t as_sent_msg;
-    usize_t as_sent_request;
-    usize_t as_sent_response;
-    usize_t as_retry_request;
-    usize_t as_retry_response;
-    usize_t as_recv_retry;
-    usize_t as_tout_request;
-    usize_t as_tout_response;
-  }                  sa_stats[1];
-
-  /** Hash of dialogs. */
-  leg_htable_t          sa_dialogs[1];
-  /** Default leg */
-  nta_leg_t            *sa_default_leg;
-  /** Hash of legs without dialogs. */
-  leg_htable_t          sa_defaults[1];
-  /** Hash table for outgoing transactions */
-  outgoing_htable_t     sa_outgoing[1];
-  nta_outgoing_t       *sa_default_outgoing;
-  /** Hash table for incoming transactions */
-  incoming_htable_t     sa_incoming[1]; 
-  nta_incoming_t       *sa_default_incoming;
-
-  /* Queues (states) for outgoing client transactions */
-  struct {
-    /** Queue for retrying client transactions */
-    nta_outgoing_t   *re_list;
-    nta_outgoing_t  **re_t1;	        /**< Special place for T1 timer */
-    size_t            re_length;	/**< Length of sa_out.re_list */
-
-    outgoing_queue_t  delayed[1]; 
-    outgoing_queue_t  resolving[1]; 
-
-    outgoing_queue_t  trying[1];	/* Timer F/E */
-    outgoing_queue_t  completed[1];	/* Timer K */
-    outgoing_queue_t  terminated[1];
-
-    /* Special queues (states) for outgoing INVITE transactions */
-    outgoing_queue_t  inv_calling[1];	/* Timer B/A */
-    outgoing_queue_t  inv_proceeding[1]; /* Timer C */
-    outgoing_queue_t  inv_completed[1];	/* Timer D */
-
-    /* Temporary queue for transactions waiting to be freed */
-    outgoing_queue_t *free;
-  } sa_out;
-
-  /* Queues (states) for incoming server transactions */
-  struct {
-    /** Queue for retransmitting response of server transactions */
-    nta_incoming_t   *re_list;
-    nta_incoming_t  **re_t1;	        /**< Special place for T1 timer */
-    size_t            re_length;
-
-    incoming_queue_t  proceeding[1];	/**< Request received */
-    incoming_queue_t  preliminary[1];   /**< 100rel sent  */
-    incoming_queue_t  completed[1];	/**< Final answer sent (non-invite). */
-    incoming_queue_t  inv_completed[1];	/**< Final answer sent (INVITE). */
-    incoming_queue_t  inv_confirmed[1];	/**< Final answer sent, ACK recvd. */
-    incoming_queue_t  terminated[1];	/**< Terminated, ready to free. */
-    incoming_queue_t  final_failed[1];   
-  } sa_in;
-
-  /* Special task for freeing memory */
-  su_clone_r          sa_terminator;
-};
-
-struct nta_leg_s
-{
-  su_home_t         leg_home[1];
-  hash_value_t      leg_hash;
-  unsigned          leg_dialog : 1;
-  unsigned          leg_stateless : 1;   /**< Process requests statelessly */
-#ifdef NTA_STRICT_ROUTING
-  unsigned          leg_contact_set : 1;
-#else
-  unsigned          leg_loose_route : 1; /**< Topmost route in set is LR */
-#endif
-  unsigned          leg_local_is_to : 1; /**< Backwards-compatibility. */
-  unsigned          leg_tagged : 1; /**< Tagged after creation.
-				     *
-				     * Request missing To tag matches it
-				     * even after tagging.
-				     */
-  unsigned:0;
-  nta_request_f    *leg_callback;
-  nta_leg_magic_t  *leg_magic;
-  nta_agent_t      *leg_agent;
-  /** Leg URL.
-   *
-   * This is the URL used to match incoming requests.
-   */
-  url_t const      *leg_url;
-  char const       *leg_method;	/**< Method for this dialog. */
-
-  uint32_t	    leg_seq;    /**< Sequence number for next transaction */
-  uint32_t	    leg_rseq;   /**< Remote sequence number */
-  sip_call_id_t	   *leg_id;	/**< Call ID */
-  sip_from_t   	   *leg_remote;	/**< Remote address (@To/@From) */
-  sip_to_t     	   *leg_local;	/**< Local address (@From/@To) */
-
-  sip_route_t      *leg_route;  /**< @Route for outgoing requests. */
-  sip_contact_t    *leg_target; /**< Remote destination (from @Contact). */
-};
-
-#define leg_has_id(leg) ((leg)->leg_id != NULL)
-
-struct nta_incoming_s
-{
-  su_home_t            *irq_home;
-  hash_value_t          irq_hash;
-  nta_agent_t          *irq_agent;
-  nta_ack_cancel_f     *irq_callback;
-  nta_incoming_magic_t *irq_magic;
-
-  /* Timeout/state queue */
-  nta_incoming_t      **irq_prev;
-  nta_incoming_t       *irq_next;
-  incoming_queue_t     *irq_queue;
-  
-  /* Retry queue */
-  nta_incoming_t      **irq_rprev;
-  nta_incoming_t       *irq_rnext;
-
-  sip_method_t        	irq_method;
-  sip_request_t        *irq_rq;
-  sip_from_t           *irq_from;
-  sip_to_t             *irq_to;
-  char const           *irq_tag;
-  sip_cseq_t           *irq_cseq;
-  sip_call_id_t        *irq_call_id;
-  sip_via_t            *irq_via;
-  sip_record_route_t   *irq_record_route;
-  char const           *irq_branch;
-
-  uint32_t              irq_rseq;
-
-  sip_timestamp_t      *irq_timestamp;
-  su_time_t             irq_received;
-
-  uint32_t       	irq_timeout;    /**< Timer H, I, J */
-  uint32_t       	irq_retry;      /**< Timer G */
-  unsigned short      	irq_interval;	/**< Next timer  */
-
-  short               	irq_status;
-
-  unsigned              irq_retries : 8;
-  unsigned              irq_default : 1;    /**< Default transaction */
-  unsigned              irq_canceled : 1;   /**< Transaction is canceled */
-  unsigned              irq_completed : 1;  /**< Transaction is completed */
-  unsigned              irq_confirmed : 1;  /**< Response has been acked */
-  unsigned              irq_terminated :1;  /**< Transaction is terminated */
-  unsigned              irq_final_failed:1; /**< Sending final response failed */
-  unsigned              irq_destroyed :1;   /**< Transaction is destroyed */
-  unsigned              irq_in_callback:1;  /**< Callback is being invoked */
-  unsigned              irq_reliable_tp:1;  /**< Transport is reliable */
-  unsigned              irq_sigcomp_zap:1;  /**< Reset SigComp */
-  unsigned              irq_must_100rel:1;  /**< 100rel is required */
-  unsigned              irq_tag_set:1;      /**< Tag is not from request */
-  unsigned              :0;
-
-  tp_name_t             irq_tpn[1];
-  tport_t              *irq_tport;
-  struct sigcomp_compartment *irq_cc;
-  msg_t		       *irq_request;
-  msg_t		       *irq_request2;       /**< ACK/CANCEL */
-  msg_t		       *irq_response;
-
-  nta_reliable_t       *irq_reliable;       /**< List of reliable responses */
-};
-
-struct nta_reliable_s
-{
-  nta_reliable_t       *rel_next;
-  nta_incoming_t       *rel_irq;
-  nta_prack_f          *rel_callback;
-  nta_reliable_magic_t *rel_magic;
-  uint32_t              rel_rseq;
-  unsigned short        rel_status;
-  unsigned              rel_pracked : 1;
-  unsigned              rel_precious : 1;
-  msg_t                *rel_response;
-  msg_t                *rel_unsent;
-};
-
-typedef struct sipdns_resolver sipdns_resolver_t;
-
-struct nta_outgoing_s
-{
-  hash_value_t          orq_hash;    /**< Hash value */
-  nta_agent_t          *orq_agent;
-  nta_response_f       *orq_callback;
-  nta_outgoing_magic_t *orq_magic;
-
-  /* Timeout/state queue */
-  nta_outgoing_t      **orq_prev;
-  nta_outgoing_t       *orq_next;
-  outgoing_queue_t     *orq_queue;
-  
-  /* Retry queue */
-  nta_outgoing_t      **orq_rprev;
-  nta_outgoing_t       *orq_rnext;
-
-  sip_method_t        	orq_method;
-  char const           *orq_method_name;
-  url_t const          *orq_url;        /**< Original RequestURI */
-
-  sip_from_t const     *orq_from;
-  sip_to_t const       *orq_to;
-  char const           *orq_tag;        /**< Tag from final response. */
-
-  sip_cseq_t const     *orq_cseq;
-  sip_call_id_t const  *orq_call_id;
-
-  msg_t		       *orq_request;
-  msg_t                *orq_response;
-
-  su_time_t             orq_sent;       /**< When request was sent? */
-  unsigned              orq_delay;      /**< RTT estimate */
-
-  uint32_t		orq_retry;	/**< Timer A, E */
-  uint32_t		orq_timeout;	/**< Timer B, D, F, K */
-
-  unsigned short      	orq_interval;	/**< Next timer A/E */
-
-  unsigned short      	orq_status;
-  unsigned char         orq_retries;    /**< Number of tries this far */
-  unsigned orq_default : 1;	        /**< This is default transaction */
-  unsigned orq_inserted : 1;
-  unsigned orq_resolved : 1;
-  unsigned orq_prepared : 1; /**< outgoing_prepare() called */
-  unsigned orq_canceled : 1;
-  unsigned orq_terminated : 1;
-  unsigned orq_destroyed : 1;
-  unsigned orq_completed : 1;
-  unsigned orq_delayed : 1;
-  unsigned orq_stripped_uri : 1;
-  unsigned orq_user_tport : 1;	/**< Application provided tport - don't retry */
-  unsigned orq_try_tcp_instead : 1;
-  unsigned orq_try_udp_instead : 1;
-  unsigned orq_reliable : 1; /**< Transport is reliable */
-  unsigned orq_ack_error : 1; /**< ACK is sent by NTA */
-  /* Attributes */
-  unsigned orq_user_via : 1;
-  unsigned orq_stateless : 1;
-  unsigned orq_pass_100 : 1;
-  unsigned orq_sigcomp_new:1;	/**< Create compartment if needed */
-  unsigned orq_sigcomp_zap:1;	/**< Reset SigComp after completing */
-  unsigned orq_must_100rel : 1;
-  unsigned orq_timestamp : 1;	/**< Insert @Timestamp header. */
-  unsigned orq_100rel:1;	/**< Support 100rel */
-  unsigned : 0;	/* pad */
-
-#if HAVE_SOFIA_SRESOLV
-  sipdns_resolver_t    *orq_resolver;
-#endif
-  enum nta_res_order_e  orq_res_order;  /**< AAAA/A first? */
-
-  url_t                *orq_route;      /**< Route URL */
-  tp_name_t             orq_tpn[1];     /**< Where to send request */
-  char const           *orq_scheme;     /**< Transport URL type */
-
-  tport_t              *orq_tport;
-  struct sigcomp_compartment *orq_cc;
-  tagi_t               *orq_tags;       /**< Tport tag items */
-  int                   orq_pending;    /**< Request is pending in tport */
-
-  char const           *orq_branch;	/**< Transaction branch */
-  char const           *orq_via_branch;	/**< @Via branch */
-
-  int                  *orq_status2b;   /**< Delayed response */
-
-  nta_outgoing_t       *orq_cancel;     /**< CANCEL transaction */
-
-  uint32_t              orq_rseq;       /**< Latest incoming rseq */
-};
-
 /* Virtual function table for plugging in SigComp */
 typedef struct
 {
   int ncv_size;
   char const *ncv_name;
 
-  nta_compressor_t *(*ncv_init_agent)(nta_agent_t *sa, 
+  nta_compressor_t *(*ncv_init_agent)(nta_agent_t *sa,
 				     char const * const *options);
 
   void (*ncv_deinit_agent)(nta_agent_t *sa, nta_compressor_t *);
 
   struct sigcomp_compartment *(*ncv_compartment)(nta_agent_t *sa,
-						 tport_t *tport, 
+						 tport_t *tport,
 						 nta_compressor_t *msc,
 						 tp_name_t const *tpn,
 						 char const * const *options,
@@ -589,10 +84,10 @@
     (struct sigcomp_compartment *);
 
   void (*ncv_compartment_unref)(struct sigcomp_compartment *);
- 
+
 } nta_compressor_vtable_t;
 
-extern nta_compressor_vtable_t *nta_compressor_vtable;
+SOFIAPUBVAR nta_compressor_vtable_t *nta_compressor_vtable;
 
 SOFIAPUBFUN nta_compressor_t *nta_agent_init_sigcomp(nta_agent_t *sa);
 SOFIAPUBFUN void nta_agent_deinit_sigcomp(nta_agent_t *sa);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 /**@CFILE nta_tag.c
  * @brief Tags for Nokia SIP Transaction API
  *
- * @note This file is used to automatically generate 
+ * @note This file is used to automatically generate
  * nta_tag_ref.c and nta_tag_dll.c
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -51,7 +51,7 @@
 
 /**@def NTATAG_MCLASS(x)
  *
- * Message class used by NTA. 
+ * Message class used by NTA.
  *
  * The nta can use a custom or extended parser created with
  * msg_mclass_clone().
@@ -76,15 +76,15 @@
 
 /**@def NTATAG_BAD_REQ_MASK(x)
  *
- * Mask for bad request messages. 
- * 
+ * 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. 
+ * 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()
@@ -104,22 +104,22 @@
  *   @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. 
- * 
+ * Mask for bad response messages.
+ *
  * If an incoming response has erroneous headers matching with the mask, nta
- * drops the response message. 
+ * 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()
@@ -139,7 +139,7 @@
  * - @ref sip_status \"status line\"", @From, @To, @CSeq, @CallID,
  *   @ContentLength, @Via, @ContentType, @ContentDisposition,
  *   @ContentEncoding, @Supported, @Contact, @Require, @RecordRoute, @RAck,
- *   @RSeq, @Event, @Expires, @SubscriptionState, @SessionExpires, 
+ *   @RSeq, @Event, @Expires, @SubscriptionState, @SessionExpires,
  *   @MinSE, @SIPETag, and @SIPIfMatch.
  */
 tag_typedef_t ntatag_bad_resp_mask = UINTTAG_TYPEDEF(bad_resp_mask);
@@ -183,9 +183,9 @@
  */
 tag_typedef_t ntatag_target = SIPHDRTAG_NAMED_TYPEDEF(target, contact);
 
-/** @def NTATAG_ALIASES(x) 
+/** @def NTATAG_ALIASES(x)
  *
- * Aliases used by NTA. 
+ * Aliases used by NTA.
  * @deprecated
  */
 tag_typedef_t ntatag_aliases = SIPHDRTAG_NAMED_TYPEDEF(aliases, contact);
@@ -208,7 +208,7 @@
  *
  * @par Default Value
  *    - None (i.e., all requests methods match with the leg)
- * 
+ *
  */
 tag_typedef_t ntatag_method = STRTAG_TYPEDEF(method);
 
@@ -230,7 +230,7 @@
  *    string
  *
  * @par Value
- * - The "branch" ID to to insert into topmost @Via header of the 
+ * - The "branch" ID to to insert into topmost @Via header of the
  *   request to be sent
  *
  * @par Default Value
@@ -244,7 +244,7 @@
 
 /**@def NTATAG_ACK_BRANCH(x)
  *
- * Branch of the transaction to ACK. 
+ * 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
@@ -269,7 +269,7 @@
 
 /**@def NTATAG_COMP(x)
  *
- * Compression algorithm. 
+ * Compression algorithm.
  *
  * Set compression algorithm for request as described in @RFC3486.
  *
@@ -302,7 +302,7 @@
 
 /**@def NTATAG_MSG(x)
  *
- * Pass a SIP message to treply()/tcreate() functions. 
+ * Pass a SIP message to treply()/tcreate() functions.
  *
  * @par Used with
  *    nta_outgoing_tcreate(), nta_incoming_treply()
@@ -327,7 +327,7 @@
  * or response message(s).
  *
  * @par Used with
- *    nta_outgoing_tcreate(), nta_outgoing_mcreate(), nta_outgoing_tcancel(), 
+ *    nta_outgoing_tcreate(), nta_outgoing_mcreate(), nta_outgoing_tcancel(),
  *    nta_incoming_create(), nta_msg_tsend(), nta_msg_mreply()
  *
  * @par Parameter type
@@ -345,9 +345,9 @@
 
 /**@def NTATAG_SMIME(x)
  *
- * Provide S/MIME context to NTA. 
+ * Provide S/MIME context to NTA.
  *
- * @todo S/MIME is not implemented. 
+ * @todo S/MIME is not implemented.
  */
 tag_typedef_t ntatag_smime = PTRTAG_TYPEDEF(smime);
 
@@ -367,7 +367,7 @@
  *   - uint32_t
  *
  * @par Values
- *    - Remote command sequence number 
+ *    - Remote command sequence number
  *
  * @par Default Value
  *    - Initially 0, then determined by the received requests
@@ -377,7 +377,7 @@
 
 /**@def NTATAG_MAXSIZE(x)
  *
- * Maximum size of incoming message. 
+ * 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
@@ -388,7 +388,7 @@
  *    nta_agent_create(), nta_agent_set_params()
  *
  * @par Parameter type
- *    - #usize_t 
+ *    - #usize_t
  *
  * @par Values
  *    - Maximum acceptable size of an incoming request message.
@@ -402,10 +402,10 @@
 
 /**@def NTATAG_MAX_PROCEEDING(x)
  *
- * Maximum size of proceeding queue. 
+ * Maximum size of proceeding queue.
  *
  * If the size of the proceedng message queue would exceed the
- * given limit, the stack will automatically respond with <i>503 
+ * given limit, the stack will automatically respond with <i>503
  * Service Unavailable</i>.
  *
  * @par Used with
@@ -413,7 +413,7 @@
  *    nta_agent_create(), nta_agent_set_params()
  *
  * @par Parameter type
- *    - #usize_t 
+ *    - #usize_t
  *
  * @par Values
  *    - Maximum acceptable size of a queue (size_t).
@@ -423,7 +423,7 @@
 
 /**@def NTATAG_UDP_MTU(x)
  *
- * Maximum size of outgoing UDP request. 
+ * 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
@@ -450,7 +450,7 @@
 
 /**@def NTATAG_MAX_FORWARDS(x)
  *
- * Default value for @MaxForwards header. 
+ * 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
@@ -475,7 +475,7 @@
 
 /**@def NTATAG_SIP_T1(x)
  *
- * Initial retransmission interval (in milliseconds) 
+ * 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
@@ -489,7 +489,7 @@
  *    unsigned int
  *
  * @par Values
- *    - Value of SIP T1 in milliseconds 
+ *    - Value of SIP T1 in milliseconds
  *
  * @par Default Value
  *    - #NTA_SIP_T1 or 500 (milliseconds)
@@ -500,13 +500,13 @@
 
 /**@def NTATAG_SIP_T1X64(x)
  *
- * Transaction timeout (defaults to T1 * 64). 
+ * 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. 
+ * 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
@@ -529,11 +529,11 @@
 
 /**@def NTATAG_SIP_T2(x)
  *
- * Maximum retransmission interval (in milliseconds) 
+ * 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. 
+ * 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.
  *
@@ -545,7 +545,7 @@
  *    unsigned int
  *
  * @par Values
- *    - Value of SIP T2 in milliseconds 
+ *    - Value of SIP T2 in milliseconds
  *
  * @par Default Value
  *    - #NTA_SIP_T2 or 4000 (milliseconds)
@@ -556,7 +556,7 @@
 
 /**@def NTATAG_SIP_T4(x)
  *
- * Transaction lifetime (in milliseconds) 
+ * 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
@@ -696,11 +696,11 @@
 
 /**@def NTATAG_DEBUG_DROP_PROB(x)
  *
- * Packet drop probability for debugging. 
+ * 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 .. 
+ * transport (such as UDP) with the given probability. The range is in 0 ..
  * 1000, 500 means p=0.5.
  *
  * @par Used with
@@ -733,7 +733,7 @@
  *    nta_agent_add_tport()
  *
  * @par Parameter type
- *    string 
+ *    string
  *
  * @par Values
  *    - semicolon-separated parameter-value pairs, passed to the SigComp plugin
@@ -771,7 +771,7 @@
 
 /**@def NTATAG_SIGCOMP_AWARE(x)
  *
- * Indicate that the application is SigComp-aware. 
+ * Indicate that the application is SigComp-aware.
  *
  * @note This tag is has no effect without a SigComp plugin.
  *
@@ -794,7 +794,7 @@
 
 /**@def NTATAG_SIGCOMP_ALGORITHM(x)
  *
- * Specify SigComp algorithm.  
+ * Specify SigComp algorithm.
  *
  * @note This tag is has no effect without a SigComp plugin.
  *
@@ -804,7 +804,7 @@
  *    nta_agent_add_tport()
  *
  * @par Parameter type
- *    string 
+ *    string
  *
  * @par Values
  *    - opaque string passed to the SigComp plugin
@@ -827,7 +827,7 @@
  * - 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 
+ * - 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()
@@ -844,12 +844,12 @@
  *          or false (zero or NULL pointer)
  *
  * @par Values
- *    - true - act as an UA 
- *    - false - act as an proxy 
+ *    - 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);
@@ -964,7 +964,7 @@
  * 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	
+ * @par Used with
  *    nua_create(), nua_set_params(),
  *    nta_agent_create(), nta_agent_set_params()
  *
@@ -985,7 +985,7 @@
 
 /**@def NTATAG_TIMEOUT_408(x)
  *
- * Generate "408 Request Timeout" response when request times out. 
+ * 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
@@ -1013,12 +1013,12 @@
 
 /**@def NTATAG_PASS_408(x)
  *
- * Pass "408 Request Timeout" responses to the client. 
+ * 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). 
+ * NTATAG_PASS_408(1).
  *
  * Note that unlike NTATAG_PASS_100(), this tags changes the way server side
  * works.
@@ -1032,7 +1032,7 @@
  *          or false (zero or NULL pointer)
  *
  * @par Values
- *    - true - pass superfluous 408 responses 
+ *    - true - pass superfluous 408 responses
  *    - false - discard superfluous 408 responses
  *
  * @sa @RFC4320, NTATAG_EXTRA_100(), NTATAG_TIMEOUT_408()
@@ -1042,7 +1042,7 @@
 
 /**@def NTATAG_MERGE_482(x)
  *
- * Merge requests, send 482 to other requests. 
+ * 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
@@ -1111,7 +1111,7 @@
 
 /**@def NTATAG_CANCEL_408(x)
  *
- * Do not send a CANCEL but just timeout the request. 
+ * 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
@@ -1142,7 +1142,7 @@
  * 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
@@ -1166,7 +1166,7 @@
 
 /**@def NTATAG_TAG_3261(x)
  *
- * When responding to requests, use unique tags. 
+ * 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
@@ -1190,7 +1190,7 @@
 
 /**@def NTATAG_REL100(x)
  *
- * Include rel100 in INVITE requests. 
+ * Include rel100 in INVITE requests.
  *
  * Include feature tag "100rel" in @Supported header of the INVITE requests.
  *
@@ -1217,14 +1217,14 @@
 
 /**@def NTATAG_USE_TIMESTAMP(x)
  *
- * Use @Timestamp header. 
+ * 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(), 
+ *    nua_create(),
  *    nta_agent_create(),
  *    nta_agent_set_params(),
  *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
@@ -1244,14 +1244,14 @@
 
 /**@def NTATAG_SIPFLAGS(x)
  *
- * Set SIP parser flags. 
+ * 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 
+ * - MSG_FLG_COMPACT - use compact form
  *                     (single-letter header names, minimum whitespace)
- * - MSG_FLG_EXTRACT_COPY - cache printable copy of headers when parsing. 
+ * - 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.
@@ -1261,7 +1261,7 @@
  *    nta_agent_create(), nta_agent_set_params()
  *
  * @par Parameter type
- *    unsigned int 
+ *    unsigned int
  *
  * @par Values
  *    - Bitwise OR of SIP parser flags (enum #msg_flg_user)
@@ -1272,13 +1272,13 @@
 
 /**@def NTATAG_CLIENT_RPORT(x)
  *
- * Enable client-side "rport". 
+ * 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. 
+ * @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.
@@ -1298,7 +1298,7 @@
  *
  * @note The NTATAG_RPORT() is a synonym for this.
  *
- * @sa @RFC3581, NTATAG_SERVER_RPORT(), NTATAG_TCP_RPORT(), @Via
+ * @sa @RFC3581, NTATAG_SERVER_RPORT(), NTATAG_TCP_RPORT(), NTATAG_TLS_RPORT(), @Via
  */
 tag_typedef_t ntatag_client_rport = BOOLTAG_TYPEDEF(client_rport);
 
@@ -1333,14 +1333,14 @@
  *    - 1 - use "rport" parameter (default)
  *    - 0 - do not use "rport" parameter
  *
- * @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_TCP_RPORT(), @Via
+ * @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_TCP_RPORT(), NTATAG_TLS_RPORT(), @Via
  */
 tag_typedef_t ntatag_server_rport = INTTAG_TYPEDEF(server_rport);
 
 
 /**@def NTATAG_TCP_RPORT(x)
  *
- * Use rport with TCP, too. 
+ * Use rport with TCP, too.
  *
  * @par Used with
  *    nua_create(), nua_set_params(),
@@ -1351,21 +1351,42 @@
  *          or false (zero or NULL pointer)
  *
  * @par Values
- *    - true - include rport parameter in the TCP via line on client side 
+ *    - 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_TLS_RPORT(x)
+ *
+ * Use rport with TLS, 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 TLS via line on client side
+ *    - false - do not include rport parameter in the TLS via line
+ *      on client side
+ *
+ * @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_SERVER_RPORT(), @Via
+ */
+tag_typedef_t ntatag_tls_rport = BOOLTAG_TYPEDEF(tls_rport);
+
 /**@def NTATAG_PRELOAD(x)
  *
- * Preload by N bytes. 
+ * 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. 
- * 
+ * 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.
  *
@@ -1385,7 +1406,7 @@
 
 /**@def NTATAG_USE_NAPTR(x)
  *
- * If true, try to use NAPTR records when resolving. 
+ * If true, try to use NAPTR records when resolving.
  *
  * The application can disable NTA from using NAPTR records when resolving
  * SIP URIs.
@@ -1433,7 +1454,7 @@
 
 /**@def NTATAG_RSEQ(x)
  *
- * @RSeq value for nta_outgoing_prack(). 
+ * @RSeq value for nta_outgoing_prack().
  *
  * @par Used with
  *    nta_outgoing_prack()
@@ -1576,7 +1597,7 @@
  *
  * Return number of bad SIP messages that has been received.
  *
- * @sa nta_agent_get_stats(), NTATAG_S_RECV_MSG_REF(), 
+ * @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);
@@ -1612,7 +1633,7 @@
  *
  * @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);
@@ -1626,7 +1647,7 @@
  *
  * @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);
@@ -1651,7 +1672,7 @@
  *
  * Get number of server transactions created.
  *
- * Return 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(),

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/portbind.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/portbind.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/portbind.c	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 /**@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>
- * 
+ *
  * @date Created: Thu Mar 25 12:12:25 2004 ppessi
  */
 
@@ -123,7 +123,7 @@
     else if (strcmp(opt, "4") == 0)
       o_ip4 = 0;
 #endif
-    else 
+    else
       usage(1);
   }
 
@@ -166,7 +166,7 @@
     names[N] = pent->p_name, protos[N] = pent->p_proto, types[N++] = SOCK_RAW;
   }
 
-  if (o_tcp) 
+  if (o_tcp)
     names[N] = "TCP", protos[N] = IPPROTO_TCP, types[N++] = SOCK_STREAM;
   if (o_udp)
     names[N] = "UDP", protos[N] = IPPROTO_UDP, types[N++] = SOCK_DGRAM;
@@ -186,7 +186,7 @@
 #endif
 
     if (s == INVALID_SOCKET) {
-      fprintf(stderr, "%s: socket(AF_INET%s, 0, %s): %s\n", 
+      fprintf(stderr, "%s: socket(AF_INET%s, 0, %s): %s\n",
 	      name, af == AF_INET ? "" : "6", names[n], strerror(errno));
       exit(1);
     }
@@ -212,7 +212,7 @@
 	  continue;
 	}
       }
-	
+
       fprintf(stderr, "%s: bind(%s): %s\n", name, o_port, strerror(errno));
       exit(1);
     }
@@ -221,7 +221,7 @@
       struct sockaddr_storage ss[1];
       struct sockaddr *sa = (void *)ss;
       struct sockaddr_in *sin = (void *)ss;
-      
+
       salen = sizeof *ss;
       if (getsockname(s, sa, &salen) == -1) {
 	fprintf(stderr, "%s: getsockname(): %s\n", name, strerror(errno));

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/run_test_nta
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/run_test_nta	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/run_test_nta	Tue Dec 23 07:37:03 2008
@@ -70,7 +70,7 @@
 port=$(./portbind $v6flag $((port + 1))) bind=$port
 port=$(./portbind $v6flag $((port + 1))) contact=$port
 
-# Disable IPv6 resolver for now 
+# Disable IPv6 resolver for now
 if false && eval $ipv6 ; then
     listen="listen-on-v6 port $bind { any; };"
     ns=$me6
@@ -151,11 +151,11 @@
 ; No sensible NAPTR match (and we get 503)
 na503   NAPTR 20 15 "S" "SIP+D2F" "" a2
 
-; No SIP NAPTR match 
+; No SIP NAPTR match
 nona   NAPTR 20 15 "S" "ZIP+D2U" "" a2
 _sip._udp.nona   SRV 1 10 $contact ip4
 
-; No SIP SRV match 
+; No SIP SRV match
 nosrv	NAPTR 20 1 "s" "SIP+D2U" "" _sip._udp.nosrv
         NAPTR 20 2 "s" "SIP+D2U" "" _sip._udp.srv
 
@@ -189,7 +189,7 @@
 named -f -c $namedfile &
 pid=$!
 while ! test -r $pidfile && kill -0 $!
-do 
+do
     sleep 1
 done
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_read_payload.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_read_payload.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_read_payload.c	Tue Dec 23 07:37:03 2008
@@ -22,13 +22,13 @@
  *
  */
 
-/**@ingroup sl_utils 
+/**@ingroup sl_utils
  * @CFILE sl_read_payload.c
  *
  * @brief Functions for reading SIP message payload from a file.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- *  
+ *
  * @date Created: Thu Sep  5 00:44:34 2002 ppessi
  */
 
@@ -112,10 +112,10 @@
 
   if (buf == NULL) {
     perror(who);
-    su_free(home, pl); 
+    su_free(home, pl);
     return NULL;
   }
-  
+
   if (used < size)
     buf[used] = '\0';
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils.docs	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 /* -*- c -*- */
 
 /**@defgroup sl_utils SIP Library Utilities - "sl_utils"
- * 
+ *
  * SIP library utilities provide some simple utility functions for printing
  * and managing SIP headers or messages.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_log.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_log.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_log.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@ingroup sl_utils
  *
- * @CFILE sl_utils_log.c  
+ * @CFILE sl_utils_log.c
  * @brief Implementation of SIP library utility logging functions.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -45,7 +45,7 @@
 #include <sofia-sip/sip_header.h>
 #include "sofia-sip/sl_utils.h"
 
-/**Log a SIP message. 
+/**Log a SIP message.
  *
  * The function sl_message_log() logs shorthand information identifying
  * the SIP message to the given @a log at level @a level.  The shorthand
@@ -60,8 +60,8 @@
  */
 void sl_sip_log(su_log_t *log,
 		int level,
-		char const *prefix, 
-		sip_t const *sip, 
+		char const *prefix,
+		sip_t const *sip,
 		int details)
 {
   sip_cseq_t const *cs = sip->sip_cseq;
@@ -70,7 +70,7 @@
     log = su_log_default;
 
   assert(cs);
-  
+
   if (sip->sip_request) {
     su_llog(log, level,
 	    "%s%s "URL_FORMAT_STRING" (CSeq %d %s)\n",
@@ -114,19 +114,19 @@
     sl_to_log(log, level, "\tTo: %s\n", sip->sip_to);
 }
 
-/**Log a @From header. 
+/**Log a @From header.
  *
  * The function sl_from_log() logs the contents of @a from header to
  * the output @a log.  The @a fmt specifies the output format, where %s
  * is replaced with header contents. If @a fmt is @c NULL, only the header
  * contents are logged.
- * 
+ *
  * @param log      output log
  * @param level    logging level of output
- * @param fmt      output format 
+ * @param fmt      output format
  * @param from     @From header
  */
-void sl_from_log(su_log_t *log, int level, 
+void sl_from_log(su_log_t *log, int level,
 		 char const *fmt, sip_from_t const *from)
 {
   sip_addr_t a[1];
@@ -137,7 +137,7 @@
   memcpy(a, from, sizeof a);
   a->a_params = NULL;
   if (!a->a_display) a->a_display = "";
-    
+
   sl_header_log(log, level, fmt, (sip_header_t *)a);
 }
 
@@ -147,10 +147,10 @@
  * log @a log with given @a level.  The @a fmt specifies the output format,
  * where %s is replaced with header contents. If @a fmt is @c NULL, only the
  * header contents are logged.
- * 
+ *
  * @param log      output log
  * @param level    logging level of output
- * @param fmt      output format 
+ * @param fmt      output format
  * @param to       @To header
  */
 void sl_to_log(su_log_t *log, int level, char const *fmt, sip_to_t const *to)
@@ -158,51 +158,51 @@
   sl_from_log(log, level, fmt, (sip_from_t const *)to);
 }
 
-/**Log a @Contact header. 
+/**Log a @Contact header.
  *
  * The function sl_contact_log() logs the contents of @a contact header
  * to the log @a log with given @a level.  The @a fmt specifies the output
  * format, where %s is replaced with header contents. If @a fmt is @c NULL,
  * only the header contents are logged.
- * 
+ *
  * @param log      output log
  * @param level    logging level of output
- * @param fmt      output format 
+ * @param fmt      output format
  * @param contact  @Contact header
  */
-void sl_contact_log(su_log_t *log, int level, 
+void sl_contact_log(su_log_t *log, int level,
 		     char const *fmt, sip_contact_t const *m)
 {
   sl_from_log(log, level, fmt, (sip_from_t const *)m);
 }
 
-/**Log an @Allow header(s). 
+/**Log an @Allow header(s).
  *
  * The function sl_allow_log() logs the contents of @a allow header to
  * the log @a log with given @a level.  The @a fmt specifies the output
  * format, where %s is replaced with header contents. If @a fmt is @c NULL,
  * only the header contents are logged.
- * 
+ *
  * @param log      output log
  * @param level    logging level of output
- * @param fmt      output format 
+ * @param fmt      output format
  * @param allow    @Allow header
  *
  */
-void sl_allow_log(su_log_t *log, int level, 
+void sl_allow_log(su_log_t *log, int level,
 		  char const *fmt, sip_allow_t const *allow)
 {
   sl_header_log(log, level, fmt, (sip_header_t *)allow);
 }
 
 
-/**Log a @Via header. 
+/**Log a @Via header.
  *
  * The function sl_via_log() logs the contents of @a via header to
  * the @a log.  The @a fmt specifies the output format, where %s
  * is replaced with header contents. If @a fmt is @c NULL, only the header
  * contents are logged.
- * 
+ *
  * @param log  output log
  * @param fmt  format used when logging
  * @param v    via header
@@ -213,21 +213,21 @@
 }
 
 
-/**Log message payload. 
+/**Log message payload.
  *
  * The function sl_payload_log() logs the contents of @a payload object
  * to the output @a log.  Each line in the payload is prepended with the
  * @a prefix.  If @a prefix is @c NULL, only the header contents are logged.
  * For each line in payload, only first 70 charactes are logged, rest is
  * replaced with "...".
- * 
+ *
  * @param log      output log
  * @param level    logging level of output
- * @param prefix   prefix appended to each payload line 
+ * @param prefix   prefix appended to each payload line
  * @param pl       payload object
  */
-void sl_payload_log(su_log_t *log, int level, 
-		    char const *prefix, 
+void sl_payload_log(su_log_t *log, int level,
+		    char const *prefix,
 		    sip_payload_t const *pl)
 {
   char *s = pl->pl_data, *end = pl->pl_data + pl->pl_len;
@@ -252,14 +252,14 @@
   }
 }
 
-/** Log a header. 
+/** Log a header.
  *
  * Logs the contents of an header to the output @a stream. The @a fmt
- * specifies the output format, where %s is replaced with header contents. 
+ * specifies the output format, where %s is replaced with header contents.
  * If @a fmt is @c NULL, only the header contents are logged.
- * 
+ *
  * @param stream   output stream
- * @param fmt      output format 
+ * @param fmt      output format
  * @param h        a SIP header object
  */
 void sl_header_log(su_log_t *log, int level, char const *fmt,
@@ -275,7 +275,7 @@
   if ((size_t)len >= sizeof b) {
     s = malloc(len + 1); if (!s) return;
     sip_header_field_e(s, len + 1, h, 0);
-  }    
+  }
   s[len] = '\0';
 
   if (fmt == NULL)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_print.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_print.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_print.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@ingroup sl_utils
  *
- * @CFILE sl_utils_print.c  
+ * @CFILE sl_utils_print.c
  * @brief Implementation of SIP library utility print functions.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -42,7 +42,7 @@
 #include <sofia-sip/sip_header.h>
 #include "sofia-sip/sl_utils.h"
 
-/**Print a SIP message. 
+/**Print a SIP message.
  *
  * The function sl_message_log() prints shorthand information identifying
  * the SIP message to the given output @a stream.  The shorthand information
@@ -54,7 +54,7 @@
  * @param sip      message to be logged.
  * @param details  flag specifying if detailed output is desired.
  */
-void sl_message_log(FILE *stream, 
+void sl_message_log(FILE *stream,
 		    char const *prefix, sip_t const *sip, int details)
 {
   sip_cseq_t const *cs = sip->sip_cseq;
@@ -63,7 +63,7 @@
     stream = stdout;
 
   assert(cs);
-  
+
   if (sip->sip_request) {
     fprintf(stream,
 	    "%s%s "URL_FORMAT_STRING" (CSeq %d %s)\n",
@@ -100,18 +100,18 @@
     sl_to_print(stream, "\tTo: %s\n", sip->sip_to);
 }
 
-/** Print @From header. 
+/** Print @From header.
  *
  * The function sl_from_print() prints the contents of @a from header to
  * the output @a stream.  The @a fmt specifies the output format, where %s
  * is replaced with header contents. If @a fmt is @c NULL, only the header
  * contents are printed.
- * 
+ *
  * @param stream   output stream
- * @param fmt      output format 
+ * @param fmt      output format
  * @param from     header object
- * 
- * @return 
+ *
+ * @return
  * The function sl_from_print() returns number of bytes printed,
  * or -1 upon an error.
  */
@@ -125,7 +125,7 @@
   memcpy(a, from, sizeof a);
   a->a_params = NULL;
   if (!a->a_display) a->a_display = "";
-    
+
   return sl_header_print(stream, fmt, (sip_header_t *)a);
 }
 
@@ -135,12 +135,12 @@
  * the output @a stream.  The @a fmt specifies the output format, where %s
  * is replaced with header contents. If @a fmt is @c NULL, only the header
  * contents are printed.
- * 
+ *
  * @param stream   output stream
- * @param fmt      output format 
+ * @param fmt      output format
  * @param to       header object
- * 
- * @return 
+ *
+ * @return
  * The function sl_to_print() returns number of bytes printed,
  * or -1 upon an error.
  */
@@ -149,18 +149,18 @@
   return sl_from_print(stream, fmt, (sip_from_t const *)to);
 }
 
-/** Print @Contact header. 
+/** Print @Contact header.
  *
  * The function sl_contact_print() prints the contents of @a contact
  * header to the output @a stream.  The @a fmt specifies the output format,
  * where %s is replaced with header contents. If @a fmt is @c NULL, only the
  * header contents are printed.
- * 
+ *
  * @param stream   output stream
- * @param fmt      output format 
+ * @param fmt      output format
  * @param contact  header object
- * 
- * @return 
+ *
+ * @return
  * The function sl_contact_print() returns number of bytes printed,
  * or -1 upon an error.
 */
@@ -170,18 +170,18 @@
   return sl_from_print(stream, fmt, (sip_from_t const *)m);
 }
 
-/** Print @Allow header(s). 
+/** Print @Allow header(s).
  *
  * The function sl_allow_print() prints the contents of @a allow header to
  * the output @a stream.  The @a fmt specifies the output format, where %s
  * is replaced with header contents. If @a fmt is @c NULL, only the header
  * contents are printed.
- * 
+ *
  * @param stream   output stream
- * @param fmt      output format 
+ * @param fmt      output format
  * @param allow    header object
- * 
- * @return 
+ *
+ * @return
  * The function sl_allow_print() returns number of bytes printed,
  * or -1 upon an error.
 */
@@ -193,25 +193,25 @@
 }
 
 
-/** Print message payload. 
+/** Print message payload.
  *
  * The function sl_payload_print() prints the contents of @a payload
  * object to the output @a stream.  The @a fmt specifies the output format,
  * where %s is replaced with header contents. If @a fmt is @c NULL, only the
  * header contents are printed.
- * 
+ *
  * @param stream   output stream
- * @param prefix   prefix appended to each payload line 
+ * @param prefix   prefix appended to each payload line
  * @param pl       payload object
- * 
- * @return 
+ *
+ * @return
  * The function sl_payload_print() returns number of bytes printed,
  * or -1 upon an error.
 */
 issize_t sl_payload_print(FILE *stream, char const *prefix, sip_payload_t const *pl)
 {
   char *s = pl->pl_data, *end = pl->pl_data + pl->pl_len;
-  size_t n, total = 0, crlf = 1; 
+  size_t n, total = 0, crlf = 1;
 
   while (s < end && *s != '\0') {
     n = strncspn(s, end - s, "\r\n");
@@ -228,18 +228,18 @@
   return (issize_t)total;
 }
 
-/** Print @Via header. 
+/** Print @Via header.
  *
  * The function sl_via_print() prints the contents of @a via header to
  * the output @a stream.  The @a fmt specifies the output format, where %s
  * is replaced with header contents. If @a fmt is @c NULL, only the header
  * contents are printed.
- * 
+ *
  * @param stream   output stream
- * @param fmt      output format 
+ * @param fmt      output format
  * @param v        header object
- * 
- * @return 
+ *
+ * @return
  * The function sl_via_print() returns number of bytes printed,
  * or -1 upon an error.
  */
@@ -257,17 +257,17 @@
   return -1;
 }
 
-/** Print a header. 
+/** Print a header.
  *
  * Prints the contents of an header to the output @a stream. The @a fmt
- * specifies the output format, where %s is replaced with header contents. 
+ * specifies the output format, where %s is replaced with header contents.
  * If @a fmt is @c NULL, only the header contents are printed.
- * 
+ *
  * @param stream   output stream
- * @param fmt      output format 
+ * @param fmt      output format
  * @param v        header object
- * 
- * @return 
+ *
+ * @return
  * Number of bytes logged, or -1 upon an error.
  */
 issize_t sl_header_print(FILE *stream, char const *fmt, sip_header_t const *h)
@@ -282,7 +282,7 @@
   if ((size_t)len >= sizeof b) {
     s = malloc(len + 1); if (!s) return -1;
     sip_header_field_e(s, len + 1, h, 0);
-  }    
+  }
   s[len] = '\0';
 
   if (fmt != NULL && strcmp(fmt, "%s") != 0)
@@ -292,6 +292,6 @@
 
   if (s != b)
     free(s);
-  
+
   return len;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h	Tue Dec 23 07:37:03 2008
@@ -48,7 +48,7 @@
 SOFIA_BEGIN_DECLS
 
 /* ----------------------------------------------------------------------
- * 1) Types 
+ * 1) Types
  */
 
 /** NTA agent */
@@ -95,7 +95,7 @@
 typedef NTA_INCOMING_MAGIC_T  nta_incoming_magic_t;
 
 /* ----------------------------------------------------------------------
- * 2) Constants 
+ * 2) Constants
  */
 
 /** NTA API version number */
@@ -122,7 +122,7 @@
 			  msg_t *msg,
 			  sip_t *sip);
 
-SOFIAPUBFUN 
+SOFIAPUBFUN
 nta_agent_t *nta_agent_create(su_root_t *root,
 			      url_string_t const *name,
 			      nta_message_f *callback,
@@ -148,12 +148,12 @@
 SOFIAPUBFUN char const *nta_agent_newtag(su_home_t *,
 					 char const *fmt, nta_agent_t *);
 
-SOFIAPUBFUN int nta_agent_set_params(nta_agent_t *agent, 
+SOFIAPUBFUN int nta_agent_set_params(nta_agent_t *agent,
 				     tag_type_t tag, tag_value_t value, ...);
-SOFIAPUBFUN int nta_agent_get_params(nta_agent_t *agent, 
+SOFIAPUBFUN int nta_agent_get_params(nta_agent_t *agent,
 				     tag_type_t tag, tag_value_t value, ...);
 
-SOFIAPUBFUN int nta_agent_get_stats(nta_agent_t *agent, 
+SOFIAPUBFUN int nta_agent_get_stats(nta_agent_t *agent,
 				    tag_type_t tag, tag_value_t value, ...);
 
 /* ----------------------------------------------------------------------
@@ -164,9 +164,9 @@
 
 SOFIAPUBFUN int nta_msg_complete(msg_t *msg);
 
-SOFIAPUBFUN int nta_msg_request_complete(msg_t *msg, 
-					 nta_leg_t *leg, 
-					 sip_method_t method, 
+SOFIAPUBFUN int nta_msg_request_complete(msg_t *msg,
+					 nta_leg_t *leg,
+					 sip_method_t method,
 					 char const *method_name,
 					 url_string_t const *req_url);
 
@@ -176,13 +176,13 @@
 /* ----------------------------------------------------------------------
  * 5) Leg-level prototypes
  */
-typedef int nta_request_f(nta_leg_magic_t *lmagic, 
+typedef int nta_request_f(nta_leg_magic_t *lmagic,
 			  nta_leg_t *leg,
-			  nta_incoming_t *irq, 
+			  nta_incoming_t *irq,
 			  sip_t const *sip);
 
-SOFIAPUBFUN 
-nta_leg_t *nta_leg_tcreate(nta_agent_t *agent,  
+SOFIAPUBFUN
+nta_leg_t *nta_leg_tcreate(nta_agent_t *agent,
 			   nta_request_f *req_callback,
 			   nta_leg_magic_t *magic,
 			   tag_type_t tag, tag_value_t value, ...);
@@ -217,18 +217,18 @@
 SOFIAPUBFUN uint32_t nta_leg_get_rseq(nta_leg_t const *leg);
 
 /** Set UAC route. */
-SOFIAPUBFUN int nta_leg_client_route(nta_leg_t *leg, 
-				     sip_record_route_t const *route, 
+SOFIAPUBFUN int nta_leg_client_route(nta_leg_t *leg,
+				     sip_record_route_t const *route,
 				     sip_contact_t const *contact);
 
 /** Set UAS route */
-SOFIAPUBFUN int nta_leg_server_route(nta_leg_t *leg, 
-				     sip_record_route_t const *route, 
+SOFIAPUBFUN int nta_leg_server_route(nta_leg_t *leg,
+				     sip_record_route_t const *route,
 				     sip_contact_t const *contact);
 
 /** Get route */
-SOFIAPUBFUN int nta_leg_get_route(nta_leg_t *leg, 
-				  sip_route_t const **return_route, 
+SOFIAPUBFUN int nta_leg_get_route(nta_leg_t *leg,
+				  sip_route_t const **return_route,
 				  sip_contact_t const **return_target);
 
 /** Get leg by destination */
@@ -237,7 +237,7 @@
 
 /** Get leg by dialog */
 SOFIAPUBFUN
-nta_leg_t *nta_leg_by_dialog(nta_agent_t const *agent, 
+nta_leg_t *nta_leg_by_dialog(nta_agent_t const *agent,
 			     url_t const *request_uri,
 			     sip_call_id_t const *call_id,
 			     char const *from_tag,
@@ -258,7 +258,7 @@
 nta_leg_t *nta_leg_by_call_id(nta_agent_t *sa, const char *call_id);
 
 /* ----------------------------------------------------------------------
- * 6) Prototypes for incoming transactions 
+ * 6) Prototypes for incoming transactions
  */
 
 SOFIAPUBFUN
@@ -271,19 +271,19 @@
 SOFIAPUBFUN nta_incoming_t *nta_incoming_default(nta_agent_t *agent);
 
 typedef int nta_ack_cancel_f(nta_incoming_magic_t *imagic,
-			     nta_incoming_t *irq, 
+			     nta_incoming_t *irq,
 			     sip_t const *sip);
 
-SOFIAPUBFUN void nta_incoming_bind(nta_incoming_t *irq, 
+SOFIAPUBFUN void nta_incoming_bind(nta_incoming_t *irq,
 				   nta_ack_cancel_f *callback,
 				   nta_incoming_magic_t *imagic);
 
 SOFIAPUBFUN
-nta_incoming_magic_t *nta_incoming_magic(nta_incoming_t *irq, 
+nta_incoming_magic_t *nta_incoming_magic(nta_incoming_t *irq,
 					 nta_ack_cancel_f *callback);
 
 SOFIAPUBFUN
-nta_incoming_t *nta_incoming_find(nta_agent_t const *agent, 
+nta_incoming_t *nta_incoming_find(nta_agent_t const *agent,
 				  sip_t const *sip,
 				  sip_via_t const *v);
 
@@ -307,7 +307,7 @@
 SOFIAPUBFUN
 int nta_incoming_complete_response(nta_incoming_t *irq,
 				   msg_t *msg,
-				   int status, 
+				   int status,
 				   char const *phrase,
 				   tag_type_t tag, tag_value_t value, ...);
 
@@ -315,8 +315,8 @@
 msg_t *nta_incoming_create_response(nta_incoming_t *irq, int status, char const *phrase);
 
 SOFIAPUBFUN
-int nta_incoming_treply(nta_incoming_t *ireq, 
-			int status, char const *phrase, 
+int nta_incoming_treply(nta_incoming_t *ireq,
+			int status, char const *phrase,
 			tag_type_t tag, tag_value_t value, ...);
 
 SOFIAPUBFUN int nta_incoming_mreply(nta_incoming_t *irq, msg_t *msg);
@@ -378,7 +378,7 @@
 nta_outgoing_t *nta_outgoing_mcreate(nta_agent_t *agent,
 				     nta_response_f *callback,
 				     nta_outgoing_magic_t *magic,
-				     url_string_t const *route_url, 
+				     url_string_t const *route_url,
 				     msg_t *msg,
 				     tag_type_t tag, tag_value_t value, ...);
 
@@ -405,7 +405,7 @@
 SOFIAPUBFUN msg_t *nta_outgoing_getrequest(nta_outgoing_t *orq);
 
 SOFIAPUBFUN
-nta_outgoing_t *nta_outgoing_tagged(nta_outgoing_t *orq, 
+nta_outgoing_t *nta_outgoing_tagged(nta_outgoing_t *orq,
 				    nta_response_f *callback,
 				    nta_outgoing_magic_t *magic,
 				    char const *to_tag,
@@ -414,7 +414,7 @@
 SOFIAPUBFUN int nta_outgoing_cancel(nta_outgoing_t *);
 
 SOFIAPUBFUN
-nta_outgoing_t *nta_outgoing_tcancel(nta_outgoing_t *orq, 
+nta_outgoing_t *nta_outgoing_tcancel(nta_outgoing_t *orq,
 				     nta_response_f *callback,
 				     nta_outgoing_magic_t *magic,
 				     tag_type_t, tag_value_t, ...);
@@ -424,7 +424,7 @@
 SOFIAPUBFUN
 nta_outgoing_t *nta_outgoing_find(nta_agent_t const *sa,
 				  msg_t const *msg,
-				  sip_t const *sip, 
+				  sip_t const *sip,
 				  sip_via_t const *v);
 
 SOFIAPUBFUN int nta_tport_keepalive(nta_outgoing_t *orq);
@@ -464,19 +464,19 @@
 
 typedef int nta_prack_f(nta_reliable_magic_t *rmagic,
 			nta_reliable_t *rel,
-			nta_incoming_t *prack, 
+			nta_incoming_t *prack,
 			sip_t const *sip);
 
 SOFIAPUBFUN
 nta_reliable_t *nta_reliable_treply(nta_incoming_t *ireq,
 				    nta_prack_f *callback,
 				    nta_reliable_magic_t *rmagic,
-				    int status, char const *phrase, 
-				    tag_type_t tag, 
+				    int status, char const *phrase,
+				    tag_type_t tag,
 				    tag_value_t value, ...);
 
 SOFIAPUBFUN
-nta_reliable_t *nta_reliable_mreply(nta_incoming_t *irq, 
+nta_reliable_t *nta_reliable_mreply(nta_incoming_t *irq,
 				    nta_prack_f *callback,
 				    nta_reliable_magic_t *rmagic,
 				    msg_t *msg);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_stateless.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_stateless.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_stateless.h	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 #ifndef NTA_STATELESS_H
 /** Defined when <sofia-sip/nta_stateless.h> has been included. */
-#define NTA_STATELESS_H 
+#define NTA_STATELESS_H
 
-/**@file sofia-sip/nta_stateless.h   
+/**@file sofia-sip/nta_stateless.h
  * @brief NTA functions for stateless SIP processing.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -46,18 +46,18 @@
  *			      sip_t *sip);
  *
  * Callback for incoming messages.
- * 
+ *
  * The typedef nta_message_f() defines prototype for the callback functions
  * invoked by NTA when it has received an incoming message that will be
  * processed statelessly.
- * 
+ *
  * The application can either discard the message by calling
  * nta_msg_discard(), forward it by calling nta_msg_tsend() or reply to the
  * message by calling nta_msg_treply(). When application wants to process a
  * request statefully, it passes the message to a leg with the function
  * nta_leg_stateful(). A new leg can be created by calling the function
  * nta_leg_tcreate().
- * 
+ *
  * @par Prototype
  * @code
  * int message_callback(nta_agent_magic_t *context,
@@ -65,7 +65,7 @@
  *                      msg_t *msg,
  *                      sip_t *sip);
  * @endcode
- * 
+ *
  * @param context agent context
  * @param agent   agent handle
  * @param msg     received message
@@ -90,7 +90,7 @@
 
 /** Reply to a request message. */
 SOFIAPUBFUN
-int nta_msg_treply(nta_agent_t *self, 
+int nta_msg_treply(nta_agent_t *self,
 		   msg_t *msg,
 		   int status, char const *phrase,
 		   tag_type_t tag, tag_value_t value, ...);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tag.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tag.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tag.h	Tue Dec 23 07:37:03 2008
@@ -26,7 +26,7 @@
 /** Defined when <sofia-sip/nta_tag.h> has been included. */
 #define NTA_TAG_H
 
-/**@file sofia-sip/nta_tag.h   
+/**@file sofia-sip/nta_tag.h
  * @brief NTA tags
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -142,7 +142,7 @@
 
 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;
 #define NTATAG_MAXSIZE(x) ntatag_maxsize, tag_usize_v((x))
 
@@ -341,13 +341,13 @@
 
 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;
 #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;
 #define NTATAG_CLIENT_RPORT(x) ntatag_client_rport, tag_bool_v((x))
 
@@ -369,6 +369,12 @@
 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_tls_rport;
+#define NTATAG_TLS_RPORT(x) ntatag_tls_rport, tag_bool_v((x))
+
+NTA_DLL extern tag_typedef_t ntatag_tls_rport_ref;
+#define NTATAG_TLS_RPORT_REF(x) ntatag_tls_rport_ref, tag_bool_vr(&(x))
+
 NTA_DLL extern tag_typedef_t ntatag_preload;
 #define NTATAG_PRELOAD(x) ntatag_preload, tag_uint_v((x))
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tport.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tport.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tport.h	Tue Dec 23 07:37:03 2008
@@ -29,11 +29,11 @@
 /**
  * @file sofia-sip/nta_tport.h
  * @brief Transport and SigComp handling
- *  
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Oct  7 20:04:39 2004 ppessi
- * 
+ *
  */
 
 #ifndef NTA_H

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/sl_utils.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/sl_utils.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/sl_utils.h	Tue Dec 23 07:37:03 2008
@@ -24,10 +24,10 @@
 
 #ifndef SL_UTILS_H
 /** Defined when <sofia-sip/sl_utils.h> has been included. */
-#define SL_UTILS_H 
+#define SL_UTILS_H
 
-/**@ingroup sl_utils 
- * 
+/**@ingroup sl_utils
+ *
  * @file sofia-sip/sl_utils.h @brief Prototypes for SIP helper functions.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -57,7 +57,7 @@
 SOFIAPUBFUN sip_payload_t *sl_fread_payload(su_home_t *home, FILE *);
 
 /* Printing functions */
-SOFIAPUBFUN void 
+SOFIAPUBFUN void
 sl_message_log(FILE *, char const *prefix, sip_t const *, int details);
 SOFIAPUBFUN issize_t
 sl_header_print(FILE *, char const *fmt, sip_header_t const *h),
@@ -69,7 +69,7 @@
 sl_via_print(FILE *, char const *fmt, sip_via_t const *v);
 
 /* Logging functions */
-SOFIAPUBFUN void 
+SOFIAPUBFUN void
 sl_sip_log(su_log_t*, int lvl, char const *, sip_t const *, int details),
 sl_header_log(su_log_t *, int lvl, char const *, sip_header_t const *h),
 sl_from_log(su_log_t *, int lvl, char const *, sip_from_t const *from),

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/test_nta.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/test_nta.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/test_nta.c	Tue Dec 23 07:37:03 2008
@@ -200,14 +200,14 @@
 static int test_fix_467(agent_t *ag);
 
 static int test_for_ack(agent_t *ag,
-			nta_incoming_t *irq, 
+			nta_incoming_t *irq,
 			sip_t const *sip);
 static int test_for_ack_or_timeout(agent_t *ag,
-				   nta_incoming_t *irq, 
+				   nta_incoming_t *irq,
 				   sip_t const *sip);
 
 static int wait_for_ack_or_cancel(agent_t *ag,
-				  nta_incoming_t *irq, 
+				  nta_incoming_t *irq,
 				  sip_t const *sip);
 
 int agent_callback(agent_t *ag,
@@ -218,14 +218,14 @@
   if (tstflags & tst_verbatim) {
     if (sip->sip_request) {
       printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	     name, __func__, sip->sip_request->rq_method_name, 
+	     name, __func__, sip->sip_request->rq_method_name,
 	     URL_PRINT_ARGS(sip->sip_request->rq_url),
 	     sip->sip_request->rq_version);
     }
     else {
-      printf("%s: %s: %s %03d %s\n", name, __func__, 
-	     sip->sip_status->st_version, 
-	     sip->sip_status->st_status, 
+      printf("%s: %s: %s %03d %s\n", name, __func__,
+	     sip->sip_status->st_version,
+	     sip->sip_status->st_status,
 	     sip->sip_status->st_phrase);
     }
   }
@@ -245,14 +245,14 @@
 
   if (leg == ag->ag_default_leg)
     match = "ag_default_leg";
-  else if (leg == ag->ag_server_leg) 
+  else if (leg == ag->ag_server_leg)
     match = "ag_server_leg";
   else if (leg == ag->ag_alice_leg)
     match = "ag_alice_leg";
   else if (leg == ag->ag_bob_leg)
     match = "ag_bob_leg";
 
-  printf("%s: %s: %smatched with %s\n", name, func, 
+  printf("%s: %s: %smatched with %s\n", name, func,
 	 always ? "mis" : "", match);
 }
 
@@ -261,14 +261,14 @@
 {
   if (leg == ag->ag_default_leg)
     ag->ag_default_leg = NULL;
-  else if (leg == ag->ag_server_leg) 
+  else if (leg == ag->ag_server_leg)
     ag->ag_server_leg = NULL;
   else if (leg == ag->ag_alice_leg)
     ag->ag_alice_leg = NULL;
   else if (leg == ag->ag_bob_leg)
     ag->ag_bob_leg = NULL;
-  else 
-    printf("%s:%u: %s: did not exist\n", 
+  else
+    printf("%s:%u: %s: did not exist\n",
 	   __FILE__, __LINE__, __func__);
 
   nta_leg_destroy(leg);
@@ -282,7 +282,7 @@
 {
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -320,7 +320,7 @@
 {
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -336,7 +336,7 @@
 {
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -407,9 +407,9 @@
 
   if (tstflags & tst_verbatim) {
     if (sip)
-      printf("%s: %s: response %s %03d %s\n", name, ctx->c_name, 
-	     sip->sip_status->st_version, 
-	     sip->sip_status->st_status, 
+      printf("%s: %s: response %s %03d %s\n", name, ctx->c_name,
+	     sip->sip_status->st_version,
+	     sip->sip_status->st_status,
 	     sip->sip_status->st_phrase);
     else
       printf("%s: %s: callback %03d\n", name, ctx->c_name,
@@ -439,7 +439,7 @@
 }
 
 /** Deinit client. Return nonzero if client checks failed. */
-static 
+static
 int client_deinit(client_t *c)
 {
   int errors = c->c_errors;
@@ -449,14 +449,14 @@
 
   if (c->c_orq) nta_outgoing_destroy(c->c_orq), c->c_orq = NULL;
 
-  c->c_errors = 0; 
+  c->c_errors = 0;
   c->c_status = 0;
 
   return errors;
 }
 
 
-static 
+static
 void nta_test_run(agent_t *ag)
 {
   for (ag->ag_running = 1; ag->ag_running;) {
@@ -469,7 +469,7 @@
 
 
 /** Run client test. Return nonzero if client checks failed. */
-static 
+static
 int client_run_with(client_t *c, int expected, void (*runner)(client_t *c))
 {
   int resulting;
@@ -489,7 +489,7 @@
   return 0;
 }
 
-static 
+static
 void until_final_received(client_t *c)
 {
   for (c->c_final = 0; !c->c_final; ) {
@@ -500,7 +500,7 @@
   }
 }
 
-static 
+static
 int client_run(client_t *c, int expected)
 {
   return client_run_with(c, expected, until_final_received);
@@ -519,13 +519,13 @@
   }
 }
 
-static 
+static
 int client_run_until_acked(client_t *c, int expected)
 {
   return client_run_with(c, expected, until_server_acked);
 }
 
-void 
+void
 until_server_canceled(client_t *c)
 {
   agent_t *ag = c->c_ag;
@@ -538,7 +538,7 @@
   }
 }
 
-static 
+static
 int client_run_until_canceled(client_t *c, int expected)
 {
   return client_run_with(c, expected, until_server_canceled);
@@ -552,7 +552,7 @@
   char const *contact = "sip:*:*;comp=sigcomp";
   su_sockaddr_t su;
   socklen_t sulen, sulen0;
-  su_socket_t s; 
+  su_socket_t s;
   int af, err = -1;
 
   BEGIN();
@@ -607,7 +607,7 @@
   }
   TEST_1(bind(s, &su.su_sa, sulen) < 0 ? (perror("bind"), 0) : 1);
   ag->ag_down_socket = s;
-  
+
   /* Create agent */
   ag->ag_agent = nta_agent_create(ag->ag_root,
 				  (url_string_t *)contact,
@@ -680,7 +680,7 @@
     TEST_1(ag->ag_alice = sip_from_dup(ag->ag_home, from));
   }
   {
-    char const data[] = 
+    char const data[] =
       "v=0\r\n"
       "o=- 425432 423412 IN IP4 127.0.0.1\r\n"
       "s= \r\n"
@@ -694,7 +694,7 @@
   {
     sip_contact_t *m;
 
-    ag->ag_aliases = 
+    ag->ag_aliases =
       sip_contact_make(ag->ag_home, "sip:127.0.0.1, sip:localhost, sip:[::1]");
     TEST_1(ag->ag_aliases);
     TEST_1(ag->ag_aliases->m_next);
@@ -709,43 +709,43 @@
     m->m_next = ag->ag_aliases;
     ag->ag_aliases = m;
 
-    err = nta_agent_set_params(ag->ag_agent, 
+    err = nta_agent_set_params(ag->ag_agent,
 			       NTATAG_ALIASES(ag->ag_aliases),
 			       NTATAG_REL100(1),
-			       NTATAG_UA(1), 
-			       NTATAG_MERGE_482(1), 
+			       NTATAG_UA(1),
+			       NTATAG_MERGE_482(1),
 			       NTATAG_USE_NAPTR(1),
 			       NTATAG_USE_SRV(1),
 			       NTATAG_MAX_FORWARDS(20),
 			       TAG_END());
     TEST(err, 7);
 
-    err = nta_agent_set_params(ag->ag_agent, 
+    err = nta_agent_set_params(ag->ag_agent,
 			       NTATAG_ALIASES(ag->ag_aliases),
 			       NTATAG_DEFAULT_PROXY("sip:127.0.0.1"),
 			       TAG_END());
     TEST(err, 2);
 
-    err = nta_agent_set_params(ag->ag_agent, 
+    err = nta_agent_set_params(ag->ag_agent,
 			       NTATAG_ALIASES(ag->ag_aliases),
 			       NTATAG_DEFAULT_PROXY(NULL),
 			       TAG_END());
     TEST(err, 2);
 
-    err = nta_agent_set_params(ag->ag_agent, 
+    err = nta_agent_set_params(ag->ag_agent,
 			       NTATAG_DEFAULT_PROXY("tel:+35878008000"),
 			       TAG_END());
     TEST(err, -1);
 
   }
-  
+
   {
     url_t url[1];
 
     /* Create the server leg */
     *url = *ag->ag_aliases->m_url;
     url->url_user = "%";
-    ag->ag_server_leg = nta_leg_tcreate(ag->ag_agent, 
+    ag->ag_server_leg = nta_leg_tcreate(ag->ag_agent,
 					leg_callback_200,
 					ag,
 					NTATAG_NO_DIALOG(1),
@@ -755,14 +755,14 @@
   }
 
   END();
-}  
+}
 
 int test_reinit(agent_t *ag)
 {
   BEGIN();
   /* Create a new default leg */
   nta_leg_destroy(ag->ag_default_leg), ag->ag_default_leg = NULL;
-  TEST_1(ag->ag_default_leg = nta_leg_tcreate(ag->ag_agent, 
+  TEST_1(ag->ag_default_leg = nta_leg_tcreate(ag->ag_agent,
 					      leg_callback_200,
 					      ag,
 					      NTATAG_NO_DIALOG(1),
@@ -795,7 +795,7 @@
   free(ag->ag_mclass), ag->ag_mclass = NULL;
 
   END();
-}  
+}
 
 static
 int readfile(FILE *f, void **contents)
@@ -804,13 +804,13 @@
   char *buffer = NULL;
   long size;
   size_t len;
-  
+
   /* Read whole file in */
   if (fseek(f, 0, SEEK_END) < 0 ||
       (size = ftell(f)) < 0 ||
       fseek(f, 0, SEEK_SET) < 0 ||
       (long)(len = (size_t)size) != size) {
-    fprintf(stderr, "%s: unable to determine file size (%s)\n", 
+    fprintf(stderr, "%s: unable to determine file size (%s)\n",
 	    __func__, strerror(errno));
     return -1;
   }
@@ -832,7 +832,7 @@
 
 #if HAVE_DIRENT_H
 #include <dirent.h>
-#endif 
+#endif
 
 static int test_bad_messages(agent_t *ag)
 {
@@ -860,13 +860,13 @@
   }
 
   if (dir == NULL) {
-    fprintf(stderr, "test_nta: cannot find sip torture messages\n"); 
-    fprintf(stderr, "test_nta: tried %s\n", name); 
+    fprintf(stderr, "test_nta: cannot find sip torture messages\n");
+    fprintf(stderr, "test_nta: tried %s\n", name);
   }
 
   offset = strlen(name);
 
-  TEST_1(ag->ag_default_leg = nta_leg_tcreate(ag->ag_agent, 
+  TEST_1(ag->ag_default_leg = nta_leg_tcreate(ag->ag_agent,
 					      leg_callback_500,
 					      ag,
 					      NTATAG_NO_DIALOG(1),
@@ -882,10 +882,10 @@
   memset(hints, 0, sizeof hints);
   hints->ai_socktype = SOCK_DGRAM;
   hints->ai_protocol = IPPROTO_UDP;
-  
+
   TEST(su_getaddrinfo(host, port, hints, &ai), 0); TEST_1(ai);
   s = su_socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); TEST_1(s != -1);
-  memset(su, 0, sulen = ai->ai_addrlen); 
+  memset(su, 0, sulen = ai->ai_addrlen);
   su->su_len = sizeof su; su->su_family = ai->ai_family;
   TEST_1(bind(s, &su->su_sa, sulen) == 0);
   TEST_1(getsockname(s, &su->su_sa, &sulen) == 0);
@@ -945,7 +945,7 @@
   END();
 }
 
-static unsigned char const code[] = 
+static unsigned char const code[] =
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
 #include <sofia-sip/su_uniqueid.h>
@@ -957,7 +957,7 @@
   if (pl) {
     size_t i;
     char *data = (char *)pl->pl_data;
-    
+
     for (i = 0; i < size; i++) {
       if ((i & 63) != 63)
 	data[i] = code[su_randint(0, 63)];
@@ -969,15 +969,15 @@
   return pl;
 }
 
-static 
+static
 int client_check_to_tag(client_t *ctx, nta_outgoing_t *orq, sip_t const *sip)
 {
-  if (sip) 
+  if (sip)
     TEST_1(sip->sip_to && sip->sip_to->a_tag);
   return 0;
 }
 
-static 
+static
 int check_magic_branch(client_t *ctx, nta_outgoing_t *orq, sip_t const *sip)
 {
   if (sip) {
@@ -1069,7 +1069,7 @@
 
   url->url_params = "transport=udp";
 
-  TEST_1(nta_agent_add_tport(ag->ag_agent, (url_string_t *)url, 
+  TEST_1(nta_agent_add_tport(ag->ag_agent, (url_string_t *)url,
 			     TAG_END()) == 0);
 
   TEST_1(v = nta_agent_via(ag->ag_agent));
@@ -1103,7 +1103,7 @@
 
   {
     /* Test 0.1
-     * Send a message from default leg to default leg 
+     * Send a message from default leg to default leg
      */
     char const p_acid[] = "P-Access-Network-Info: IEEE-802.11g\n";
     url_t url[1];
@@ -1113,8 +1113,8 @@
     url->url_params = NULL;
     ag->ag_expect_leg = ag->ag_default_leg;
 
-    ctx->c_orq = 
-      nta_outgoing_tcreate(ag->ag_default_leg, 
+    ctx->c_orq =
+      nta_outgoing_tcreate(ag->ag_default_leg,
 			   outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1144,15 +1144,15 @@
     url_t url[1];
     sip_t *sip;
     client_t ctx[1] = {{ ag, "Test 0.1.2", check_via_without_sigcomp }};
-    
+
     *url = *ag->ag_contact->m_url;
     /* Test that method parameter is stripped and headers in query are used */
     url->url_params = "method=MESSAGE;user=IP";
     url->url_headers = "organization=United%20Testers";
     ag->ag_expect_leg = ag->ag_default_leg;
 
-    ctx->c_orq = 
-      nta_outgoing_tcreate(ag->ag_default_leg, 
+    ctx->c_orq =
+      nta_outgoing_tcreate(ag->ag_default_leg,
 			   outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1171,7 +1171,7 @@
     TEST_1(sip->sip_organization);
     TEST_S(sip->sip_organization->g_string, "United Testers");
     TEST_S(sip->sip_request->rq_url->url_params, "user=IP");
-    
+
     nta_leg_bind(ag->ag_default_leg, leg_callback_200, ag);
   }
 
@@ -1195,7 +1195,7 @@
 
     ag->ag_expect_leg = ag->ag_server_leg;
 
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1218,7 +1218,7 @@
 
   /* Test 0.2
    * Send a message from Bob to Alice
-   * This time specify a TCP URI, and include a large payload 
+   * This time specify a TCP URI, and include a large payload
    * of 512 kB
    */
   if (tcp) {
@@ -1236,7 +1236,7 @@
     TEST_1(pl = test_payload(ag->ag_home, size));
 
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   NULL,
 			   SIP_METHOD_MESSAGE,
@@ -1257,16 +1257,16 @@
   if (tcp_tport) {
     /* Test 0.2.1 - always use transport connection from NTATAG_TPORT()
      *
-     * Test bug reported by geaaru 
+     * Test bug reported by geaaru
      * - NTATAG_TPORT() is not used if NTATAG_DEFAULT_PROXY() is given
      */
     client_t ctx[1] = {{ ag, "Test 0.2.1", save_and_check_tcp }};
     url_t url[1];
     sip_payload_t *pl;
     tport_t *used_tport = NULL;
-    
+
     ctx->c_extra = &used_tport;
-    
+
     *url = *ag->ag_aliases->m_url;
     url->url_user = "alice";
 
@@ -1275,7 +1275,7 @@
     TEST_1(pl = test_payload(ag->ag_home, 512));
 
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   NULL,
 			   SIP_METHOD_MESSAGE,
@@ -1311,7 +1311,7 @@
     url_t url[1];
     sip_payload_t *pl;
     tport_t *used_tport = NULL;
-    
+
     ctx->c_extra = &used_tport;
     TEST_1(tport_is_primary(tcp_tport));
 
@@ -1324,7 +1324,7 @@
     url->url_params = NULL;	/* No sigcomp */
 
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   (url_string_t *)url,
 			   SIP_METHOD_MESSAGE,
@@ -1363,7 +1363,7 @@
     TEST_1(pl = test_payload(ag->ag_home, size));
 
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1395,7 +1395,7 @@
     TEST_1(pl = test_payload(ag->ag_home, size));
 
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1436,7 +1436,7 @@
 
     su_free(ag->ag_home, ag->ag_in_via), ag->ag_in_via = NULL;
 
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1474,7 +1474,7 @@
     TEST_1(pl = test_payload(ag->ag_home, size));
 
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1495,7 +1495,7 @@
 
   if (udp) {
     /* Test 0.6
-     * Send a message from default leg to server leg 
+     * Send a message from default leg to server leg
      * using a prefilled Via header
      */
     client_t ctx[1] = {{ ag, "Test 0.6", check_magic_branch }};
@@ -1505,19 +1505,19 @@
     sip_via_init(via);
 
     via->v_protocol = sip_transport_udp;
-    
+
     via->v_host = ag->ag_contact->m_url->url_host;
     via->v_port = ag->ag_contact->m_url->url_port;
-    
+
     sip_via_add_param(ag->ag_home, via, "branch=MagicalBranch");
 
-    nta_agent_set_params(ag->ag_agent, 
+    nta_agent_set_params(ag->ag_agent,
 			 NTATAG_ALIASES(ag->ag_aliases),
 			 NTATAG_USER_VIA(1),
 			 TAG_END());
 
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1531,13 +1531,13 @@
     TEST_1(!client_run(ctx, 200));
     TEST_P(ag->ag_latest_leg, ag->ag_server_leg);
 
-    nta_agent_set_params(ag->ag_agent, 
+    nta_agent_set_params(ag->ag_agent,
 			 NTATAG_USER_VIA(0),
 			 TAG_END());
   }
 
   /* Test 0.7
-   * Send a message from Bob to Alice using SCTP 
+   * Send a message from Bob to Alice using SCTP
    */
   if (sctp) {
     url_t url[1];
@@ -1557,7 +1557,7 @@
     TEST_1(pl = test_payload(ag->ag_home, size));
 
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1580,7 +1580,7 @@
     usize_t size = 128 * 1024;
     client_t ctx[1] = {{ ag, "Test 0.8" }};
 
-    nta_agent_set_params(ag->ag_agent, 
+    nta_agent_set_params(ag->ag_agent,
 			 NTATAG_MAXSIZE(65536),
 			 TAG_END());
 
@@ -1591,7 +1591,7 @@
 
     ag->ag_expect_leg = ag->ag_server_leg;
     ag->ag_latest_leg = NULL;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1606,7 +1606,7 @@
     TEST_1(!client_run(ctx, 413));
     TEST_P(ag->ag_latest_leg, NULL);
 
-    nta_agent_set_params(ag->ag_agent, 
+    nta_agent_set_params(ag->ag_agent,
 			 NTATAG_MAXSIZE(2 * 1024 * 1024),
 			 TAG_END());
   }
@@ -1619,10 +1619,10 @@
     printf("%s: starting MESSAGE timeout test, completing in 4 seconds\n",
 	   name);
 
-    nta_agent_set_params(ag->ag_agent, 
+    nta_agent_set_params(ag->ag_agent,
 			 NTATAG_TIMEOUT_408(1),
-			 NTATAG_SIP_T1(25), 
-			 NTATAG_SIP_T1X64(64 * 25), 
+			 NTATAG_SIP_T1(25),
+			 NTATAG_SIP_T1X64(64 * 25),
 			 NTATAG_SIP_T2(8 * 25),
 			 NTATAG_SIP_T4(10 * 25),
 			 TAG_END());
@@ -1633,7 +1633,7 @@
 
     ag->ag_expect_leg = ag->ag_server_leg;
     ag->ag_latest_leg = NULL;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1654,7 +1654,7 @@
 			 NTATAG_SIP_T4(NTA_SIP_T4),
 			 TAG_END());
   }
-  
+
 
   END();
 }
@@ -1666,7 +1666,7 @@
 {
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -1685,7 +1685,7 @@
 {
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -1711,14 +1711,14 @@
     client_t ctx[1] = {{ ag, "Test 3.1" }};
 
     /* Test 3.1
-     * Check that when a incoming request is destroyed in callback, 
+     * Check that when a incoming request is destroyed in callback,
      * a 500 response is sent
      */
     ag->ag_expect_leg = ag->ag_default_leg;
     nta_leg_bind(ag->ag_default_leg, leg_callback_destroy, ag);
-    
-    ctx->c_orq = 
-      nta_outgoing_tcreate(ag->ag_default_leg, 
+
+    ctx->c_orq =
+      nta_outgoing_tcreate(ag->ag_default_leg,
 			   outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1738,9 +1738,9 @@
     client_t ctx[1] = {{ ag, "Test 3.2" }};
 
     nta_leg_bind(ag->ag_default_leg, leg_callback_save, ag);
-    
-    ctx->c_orq = 
-      nta_outgoing_tcreate(ag->ag_default_leg, 
+
+    ctx->c_orq =
+      nta_outgoing_tcreate(ag->ag_default_leg,
 			   outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1778,9 +1778,9 @@
 
   nta_leg_bind(ag->ag_default_leg, leg_callback_200, ag);
 
-  nta_agent_set_params(ag->ag_agent, 
-		       NTATAG_SIP_T1(8 * 25), 
-		       NTATAG_SIP_T1X64(64 * 25), 
+  nta_agent_set_params(ag->ag_agent,
+		       NTATAG_SIP_T1(8 * 25),
+		       NTATAG_SIP_T1X64(64 * 25),
 		       NTATAG_SIP_T4(10 * 25),
 		       TAG_END());
 
@@ -1805,7 +1805,7 @@
      */
     client_t ctx[1] = {{ ag, "Test 1.1" }};
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1826,7 +1826,7 @@
     client_t ctx[1] = {{ ag, "Test 1.2" }};
     url->url_host = "srv.example.org";
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1847,7 +1847,7 @@
     client_t ctx[1] = {{ ag, "Test 1.3" }};
     url->url_host = "ipv.example.org";
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1868,7 +1868,7 @@
     client_t ctx[1] = {{ ag, "Test 1.4.1" }};
     url->url_host = "down.example.org";
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1890,7 +1890,7 @@
     client_t ctx[1] = {{ ag, "Test 1.4.2" }};
     url->url_host = "na503.example.org";
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1911,7 +1911,7 @@
     client_t ctx[1] = {{ ag, "Test 1.4.3" }};
     url->url_host = "nona.example.org";
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1934,7 +1934,7 @@
     client_t ctx[1] = {{ ag, "Test 1.4.4" }};
     url->url_host = "nosrv.example.org";
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1949,7 +1949,7 @@
   }
 
   {
-    /* Test 1.5.1 
+    /* Test 1.5.1
      * Send a message to sip:srv.example.org;transport=tcp
      * Test outgoing_make_srv_query()
      */
@@ -1957,7 +1957,7 @@
     url->url_host = "srv.example.org";
     url->url_params = "transport=tcp";
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -1982,7 +1982,7 @@
     url->url_host = "srv.example.org";
     url->url_params = "transport=udp";
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -2007,7 +2007,7 @@
     url->url_host = "srv2.example.org";
     url->url_params = "transport=udp";
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -2032,7 +2032,7 @@
     url->url_host = "srv.example.org";
     url->url_port = ag->ag_contact->m_url->url_port;
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -2056,7 +2056,7 @@
     url->url_host = "a.example.org";
     url->url_port = ag->ag_contact->m_url->url_port;
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -2081,7 +2081,7 @@
 
     url->url_host = "na.example.org";
     ag->ag_expect_leg = ag->ag_default_leg;
-    TEST_1(ctx->c_orq = 
+    TEST_1(ctx->c_orq =
 	   nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 				ag->ag_obp,
 				SIP_METHOD_MESSAGE,
@@ -2106,7 +2106,7 @@
     url->url_host = "down2.example.org";
     url->url_port = ag->ag_contact->m_url->url_port;
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -2142,15 +2142,15 @@
 
   nta_leg_bind(ag->ag_default_leg, leg_callback_200, ag);
 
-  nta_agent_set_params(ag->ag_agent, 
+  nta_agent_set_params(ag->ag_agent,
 		       NTATAG_MAXSIZE(2 * 1024 * 1024),
 		       TAG_END());
 
   BEGIN();
 
   {
-    /* 
-     * Send a message from default leg to default leg 
+    /*
+     * Send a message from default leg to default leg
      *
      * We are now using url with an explicit port that does not match with
      * our own port number.
@@ -2162,7 +2162,7 @@
     url2->url_port = "9";	/* discard service */
 
     ag->ag_expect_leg = ag->ag_default_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   (url_string_t *)url,
 			   SIP_METHOD_MESSAGE,
@@ -2192,7 +2192,7 @@
    * Alice to Bob.
    */
 
-  ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent, 
+  ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent,
 				     leg_callback_200,
 				     ag,
 				     SIPTAG_FROM(ag->ag_alice),
@@ -2208,7 +2208,7 @@
 
     /* Send message from Alice to Bob establishing the dialog */
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_alice_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_MESSAGE,
@@ -2231,7 +2231,7 @@
 
 
     ag->ag_expect_leg = ag->ag_alice_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_bob_leg, outgoing_callback, ctx,
 			   NULL,
 			   SIP_METHOD_MESSAGE,
@@ -2246,7 +2246,7 @@
     /* Send again message from Alice to Bob */
     client_t ctx[1] = {{ ag, "Test 2.3" }};
     ag->ag_expect_leg = ag->ag_bob_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_alice_leg, outgoing_callback, ctx,
 			   NULL,
 			   SIP_METHOD_MESSAGE,
@@ -2256,14 +2256,14 @@
     TEST_1(!client_run(ctx, 200));
     TEST_P(ag->ag_latest_leg, ag->ag_bob_leg);
   }
-  
+
   {
     /* Send message from Bob to Alice
-     * This time, however, specify request URI 
+     * This time, however, specify request URI
      */
     client_t ctx[1] = {{ ag, "Test 2.4" }};
     ag->ag_expect_leg = ag->ag_alice_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_bob_leg, outgoing_callback, ctx,
 			   NULL,
 			   SIP_METHOD_MESSAGE,
@@ -2289,7 +2289,7 @@
   ssize_t n;
 
   memset(b, 0, size);
-  
+
   for (;;) {
     su_root_step(ag->ag_root, 10L);
     if (su_wait(ag->ag_sink_wait, 1, 0) == 0) {
@@ -2306,14 +2306,14 @@
   BEGIN();
 
   /*
-   * Test merging: send two messages with same 
+   * Test merging: send two messages with same
    * from tag/call-id/cseq number to nta,
    * expect 200 and 408.
    */
 
   char const rfc3261prefix[] = "z9hG4bK";
 
-  char const template[] = 
+  char const template[] =
     "%s " URL_PRINT_FORMAT " SIP/2.0\r\n"
     "Via: SIP/2.0/UDP 127.0.0.1:%s;branch=%s.%p\r\n"
     "Via: SIP/2.0/TCP fake.address.for.via.example.net;branch=z9hG4bK.%p\r\n"
@@ -2357,9 +2357,9 @@
 
     *u1 = *ag->ag_m_bob->m_url;
     snprintf(m1, sizeof m1,
-	     template, 
+	     template,
 	     "MESSAGE", URL_PRINT_ARGS(u1),
-	     /* Via */ ag->ag_sink_port, rfc3261prefix, (void *)m1, 
+	     /* Via */ ag->ag_sink_port, rfc3261prefix, (void *)m1,
 	     /* 2nd Via */ (void *)ag,
 	     /* CSeq */ 13, "MESSAGE",
 	     /* Call-ID */ (void *)ag,
@@ -2370,7 +2370,7 @@
     *u2 = *ag->ag_m_bob->m_url;
 
     snprintf(m2, sizeof m2,
-	     template, 
+	     template,
 	     "MESSAGE", URL_PRINT_ARGS(u2),
 	     /* Via */ ag->ag_sink_port, rfc3261prefix, (void *)m2,
 	     /* 2nd Via */ (void *)ag,
@@ -2398,7 +2398,7 @@
 
   {
     /*
-     * Check that request with same call-id, cseq and from-tag 
+     * Check that request with same call-id, cseq and from-tag
      * are not merged if the method is different.
      */
     nta_leg_bind(ag->ag_server_leg, leg_callback_200, ag);
@@ -2407,9 +2407,9 @@
 
     *u1 = *ag->ag_m_bob->m_url;
     snprintf(m1, sizeof m1,
-	     template, 
+	     template,
 	     "MESSAGE", URL_PRINT_ARGS(u1),
-	     /* Via */ ag->ag_sink_port, rfc3261prefix, (void *)m1, 
+	     /* Via */ ag->ag_sink_port, rfc3261prefix, (void *)m1,
 	     /* 2nd Via */ (void *)ag,
 	     /* CSeq */ 14, "MESSAGE",
 	     /* Call-ID */ (void *)ag,
@@ -2420,7 +2420,7 @@
     *u2 = *ag->ag_m_bob->m_url;
 
     snprintf(m2, sizeof m2,
-	     template, 
+	     template,
 	     "OPTIONS", URL_PRINT_ARGS(u2),
 	     /* Via */ ag->ag_sink_port, rfc3261prefix, (void *)m2,
 	     /* 2nd Via */ (void *)ag,
@@ -2450,9 +2450,9 @@
     /* test with rfc2543 */
 
     snprintf(m1, sizeof m1,
-	     template, 
+	     template,
 	     "MASSAGE", URL_PRINT_ARGS(u1),
-	     /* Via */ ag->ag_sink_port, "0.", (void *)0, 
+	     /* Via */ ag->ag_sink_port, "0.", (void *)0,
 	     /* 2nd Via */ (void *)ag,
 	     /* CSeq */ 14, "MASSAGE",
 	     /* Call-ID */ (void *)(ag + 1),
@@ -2463,7 +2463,7 @@
     u2->url_user = "bob+2";
 
     snprintf(m2, sizeof m2,
-	     template, 
+	     template,
 	     "MASSAGE", URL_PRINT_ARGS(u2),
 	     /* Via */ ag->ag_sink_port, "0.", (void *)0,
 	     /* 2nd Via */ (void *)ag,
@@ -2493,9 +2493,9 @@
     /* test with to-tag */
 
     snprintf(m1, sizeof m1,
-	     template, 
+	     template,
 	     "MESSAGE", URL_PRINT_ARGS(u1),
-	     /* Via */ ag->ag_sink_port, rfc3261prefix, (void *)m1, 
+	     /* Via */ ag->ag_sink_port, rfc3261prefix, (void *)m1,
 	     /* 2nd Via */ (void *)ag,
 	     /* CSeq */ 15, "MESSAGE",
 	     /* Call-ID */ (void *)(ag + 2),
@@ -2506,7 +2506,7 @@
     u2->url_user = "bob+2";
 
     snprintf(m2, sizeof m2,
-	     template, 
+	     template,
 	     "MESSAGE", URL_PRINT_ARGS(u2),
 	     /* Via */ ag->ag_sink_port, rfc3261prefix, (void *)m2,
 	     /* 2nd Via */ (void *)ag,
@@ -2536,9 +2536,9 @@
     /* test with rfc2543 and to-tag */
 
     snprintf(m1, sizeof m1,
-	     template, 
+	     template,
 	     "MESSAGE", URL_PRINT_ARGS(u1),
-	     /* Via */ ag->ag_sink_port, "0.", (void *)0, 
+	     /* Via */ ag->ag_sink_port, "0.", (void *)0,
 	     /* 2nd Via */ (void *)ag,
 	     /* CSeq */ 15, "MESSAGE",
 	     /* Call-ID */ (void *)(ag + 2),
@@ -2547,7 +2547,7 @@
     l1 = strlen(m1);
 
     snprintf(m2, sizeof m2,
-	     template, 
+	     template,
 	     "MESSAGE", URL_PRINT_ARGS(u2),
 	     /* Via */ ag->ag_sink_port, "0.", (void *)0,
 	     /* 2nd Via */ (void *)ag,
@@ -2575,7 +2575,7 @@
 
   {
     /* test INVITE/CANCEL with rfc2543 */
-    char const template2[] = 
+    char const template2[] =
       "%s " URL_PRINT_FORMAT " SIP/2.0\r\n"
       "Via: SIP/2.0/UDP 127.0.0.1:%s;x-kuik=%p\r\n"
       "CSeq: %u %s\r\n"
@@ -2588,9 +2588,9 @@
     nta_leg_bind(ag->ag_server_leg, new_leg_callback_180, ag);
 
     snprintf(m1, sizeof m1,
-	     template2, 
+	     template2,
 	     "INVITE", URL_PRINT_ARGS(u1),
-	     /* Via */ ag->ag_sink_port, m1, 
+	     /* Via */ ag->ag_sink_port, m1,
 	     /* CSeq */ 15, "INVITE",
 	     /* Call-ID */ (void *)(ag + 2),
 	     /* From tag */ "2.6.1",
@@ -2606,7 +2606,7 @@
     nta_incoming_bind(ag->ag_irq, wait_for_ack_or_cancel, ag);
 
     snprintf(m2, sizeof m2,
-	     template2, 
+	     template2,
 	     "CANCEL", URL_PRINT_ARGS(u1),
 	     /* Via */ ag->ag_sink_port, m1,
 	     /* CSeq */ 15, "CANCEL",
@@ -2629,7 +2629,7 @@
     TEST_1(nta_incoming_status(ag->ag_irq) == 487);
 
     snprintf(m2, sizeof m2,
-	     template2, 
+	     template2,
 	     "ACK", URL_PRINT_ARGS(u1),
 	     /* Via */ ag->ag_sink_port, m1,
 	     /* CSeq */ 15, "ACK",
@@ -2651,7 +2651,7 @@
 
 static
 int wait_for_ack_or_cancel(agent_t *ag,
-			   nta_incoming_t *irq, 
+			   nta_incoming_t *irq,
 			   sip_t const *sip)
 {
   sip_method_t method;
@@ -2671,7 +2671,7 @@
     ag->ag_irq = NULL;
     ag->ag_running = 0;
   }
-  
+
   return 0;
 }
 
@@ -2681,7 +2681,7 @@
 
 static
 int test_for_ack(agent_t *ag,
-		 nta_incoming_t *irq, 
+		 nta_incoming_t *irq,
 		 sip_t const *sip)
 {
   sip_method_t method;
@@ -2695,7 +2695,7 @@
   ag->ag_irq = NULL;
 
   TEST(method, sip_method_ack);
-  
+
   ag->ag_running = 0;
 
   END();
@@ -2709,13 +2709,13 @@
 {
   sip_method_t method = sip ? sip->sip_request->rq_method : sip_method_unknown;
 
-  nta_incoming_treply(ag->ag_irq, 
-		      SIP_200_OK, 
+  nta_incoming_treply(ag->ag_irq,
+		      SIP_200_OK,
 		      SIPTAG_CONTACT(ag->ag_m_alice),
 		      TAG_END());
 
   TEST(method, sip_method_prack);
-		     
+
   return 200;
 }
 
@@ -2728,7 +2728,7 @@
 
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -2752,11 +2752,11 @@
     nta_incoming_bind(irq, test_for_ack, ag);
     nta_incoming_treply(irq, SIP_100_TRYING, TAG_END());
 
-    nta_agent_set_params(ag->ag_agent, 
+    nta_agent_set_params(ag->ag_agent,
 			 NTATAG_DEBUG_DROP_PROB(ag->ag_drop),
 			 TAG_END());
 
-    ag->ag_reliable = 
+    ag->ag_reliable =
       nta_reliable_treply(irq,
 			  NULL, NULL,
 			  SIP_183_SESSION_PROGRESS,
@@ -2765,14 +2765,14 @@
 			  SIPTAG_CONTACT(ag->ag_m_alice),
 			  TAG_END());
     TEST_1(ag->ag_reliable);
-    ag->ag_reliable = 
+    ag->ag_reliable =
       nta_reliable_treply(irq,
 			  NULL, NULL,
 			  184, "Next",
 			  SIPTAG_CONTACT(ag->ag_m_alice),
 			  TAG_END());
     TEST_1(ag->ag_reliable);
-    ag->ag_reliable = 
+    ag->ag_reliable =
       nta_reliable_treply(irq,
 			  test_for_prack, ag,
 			  185, "Last",
@@ -2781,7 +2781,7 @@
     TEST_1(ag->ag_reliable);
     ag->ag_irq = irq;
     return 0;
-  } 
+  }
 
   if (sip->sip_request->rq_method == sip_method_bye) {
     leg_zap(ag, leg);
@@ -2802,7 +2802,7 @@
 
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -2834,15 +2834,15 @@
     TEST_1(nta_leg_tag(ag->ag_bob_leg, NULL));
     TEST_1(nta_leg_get_tag(ag->ag_bob_leg));
     TEST_1(nta_incoming_tag(irq, nta_leg_get_tag(ag->ag_bob_leg)));
-    TEST(nta_leg_server_route(ag->ag_bob_leg, 
-			      sip->sip_record_route, 
+    TEST(nta_leg_server_route(ag->ag_bob_leg,
+			      sip->sip_record_route,
 			      sip->sip_contact), 0);
   }
 
   if (sip->sip_request->rq_method != sip_method_invite) {
     return 200;
   } else {
-    nta_incoming_bind(irq, test_for_ack, ag); 
+    nta_incoming_bind(irq, test_for_ack, ag);
 #if 1
     nta_incoming_treply(irq,
 			SIP_180_RINGING,
@@ -2877,7 +2877,7 @@
   return 0;
 }
 
-static 
+static
 int check_prack_sending(client_t *ctx, nta_outgoing_t *orq, sip_t const *sip)
 {
   agent_t *ag = ctx->c_ag;
@@ -2888,10 +2888,10 @@
       nta_outgoing_t *prack = NULL;
 
       TEST_1(sip->sip_rseq);
-      
+
       prack = nta_outgoing_prack(ag->ag_call_leg, orq, NULL, NULL,
 				 NULL,
-				 sip, 
+				 sip,
 				 TAG_END());
       nta_outgoing_destroy(prack);
       TEST_1(prack != NULL);
@@ -2901,7 +2901,7 @@
 }
 
 
-static 
+static
 int check_leg_tagging(client_t *ctx, nta_outgoing_t *orq, sip_t const *sip)
 {
   agent_t *ag = ctx->c_ag;
@@ -2909,8 +2909,8 @@
 
   if (200 <= status && status < 300) {
     TEST_1(nta_leg_rtag(ag->ag_call_leg, sip->sip_to->a_tag));
-    
-    TEST(nta_leg_client_route(ag->ag_call_leg, 
+
+    TEST(nta_leg_client_route(ag->ag_call_leg,
 			      sip->sip_record_route,
 			      sip->sip_contact), 0);
   }
@@ -2919,7 +2919,7 @@
 }
 
 
-static 
+static
 int check_tu_ack(client_t *ctx, nta_outgoing_t *orq, sip_t const *sip)
 {
   agent_t *ag = ctx->c_ag;
@@ -2946,7 +2946,7 @@
 {
   agent_t *ag = ctx->c_ag;
   int status = ctx->c_status;
-  
+
   if (status >= 300)
     ag->ag_call_leg = NULL;
 
@@ -3006,21 +3006,21 @@
      *
      * Alice sends a INVITE to Bob, then Bob sends 200 Ok.
      */
-    ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent, 
+    ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent,
 				       alice_leg_callback,
 				       ag,
 				       SIPTAG_FROM(ag->ag_alice),
 				       SIPTAG_TO(ag->ag_bob),
 				       TAG_END());
     TEST_1(ag->ag_alice_leg);
-  
+
     TEST_1(nta_leg_tag(ag->ag_alice_leg, NULL));
     nta_leg_bind(ag->ag_server_leg, bob_leg_callback, ag);
-  
+
     /* Send INVITE */
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
-      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg, 
+    ctx->c_orq =
+      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg,
 			   outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_INVITE,
@@ -3036,7 +3036,7 @@
     TEST_1(ctx->c_orq);
     /* Try to CANCEL it immediately */
     TEST_1(nta_outgoing_cancel(ctx->c_orq) == 0);
-    /* As Bob immediately answers INVITE with 200 Ok, 
+    /* As Bob immediately answers INVITE with 200 Ok,
        cancel should be answered with 481 and 200 Ok is returned to INVITE. */
     TEST_1(!client_run(ctx, 200));
 
@@ -3068,8 +3068,8 @@
      * waits for PRACKs, then sends 200, waits for ACK.
      */
     ag->ag_expect_leg = ag->ag_alice_leg;
-    ctx->c_orq = 
-      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_bob_leg, 
+    ctx->c_orq =
+      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_bob_leg,
 			   outgoing_callback, ctx,
 			   NULL,
 			   SIP_METHOD_INVITE,
@@ -3087,13 +3087,13 @@
   {
     client_t ctx[1] = {{ ag, "Hangup" }};
 
-    nta_agent_set_params(ag->ag_agent, 
+    nta_agent_set_params(ag->ag_agent,
 			 NTATAG_DEBUG_DROP_PROB(0),
 			 TAG_END());
 
     /* Send BYE from Bob to Alice */
     old_leg = ag->ag_expect_leg = ag->ag_alice_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_bob_leg, outgoing_callback, ctx,
 			   NULL,
 			   SIP_METHOD_BYE,
@@ -3121,7 +3121,7 @@
 /* Test early dialogs, PRACK */
 
 int test_for_ack_or_timeout(agent_t *ag,
-			    nta_incoming_t *irq, 
+			    nta_incoming_t *irq,
 			    sip_t const *sip)
 {
   BEGIN();
@@ -3159,7 +3159,7 @@
 
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -3188,16 +3188,16 @@
     TEST_1(nta_leg_tag(ag->ag_bob_leg, NULL));
     TEST_1(nta_leg_get_tag(ag->ag_bob_leg));
     TEST_1(nta_incoming_tag(irq, nta_leg_get_tag(ag->ag_bob_leg)));
-    TEST(nta_leg_server_route(ag->ag_bob_leg, 
-			      sip->sip_record_route, 
+    TEST(nta_leg_server_route(ag->ag_bob_leg,
+			      sip->sip_record_route,
 			      sip->sip_contact), 0);
   }
 
   if (sip->sip_request->rq_method != sip_method_invite) {
     return 200;
-  } 
+  }
 
-  nta_incoming_bind(irq, test_for_ack_or_timeout, ag); 
+  nta_incoming_bind(irq, test_for_ack_or_timeout, ag);
   nta_incoming_treply(irq,
 		      SIP_183_SESSION_PROGRESS,
 		      SIPTAG_CONTENT_TYPE(ag->ag_content_type),
@@ -3225,7 +3225,7 @@
 int check_orq_tagging(client_t *ctx,
 		      nta_outgoing_t *orq,
 		      sip_t const *sip)
-{   
+{
   agent_t *ag = ctx->c_ag;
   int status = ctx->c_status;
   invite_client_t *ic = (invite_client_t *)ctx;
@@ -3235,21 +3235,21 @@
     TEST_1(sip->sip_to->a_tag);
 
     TEST_1(orq == ctx->c_orq);
-  
+
     TEST_1(ic); TEST_1(ic->ic_orq == NULL);
     TEST_1(ic->ic_tag == NULL);
-  
+
     ic->ic_orq = orq;
     ic->ic_tag = su_strdup(ag->ag_home, sip->sip_to->a_tag); TEST_1(ic->ic_tag);
     ic->ic_tag_status = status;
-    
+
     TEST_S(nta_leg_rtag(ag->ag_call_leg, ic->ic_tag), ic->ic_tag);
-  
-    TEST(nta_leg_client_route(ag->ag_call_leg, 
+
+    TEST(nta_leg_client_route(ag->ag_call_leg,
 			      sip->sip_record_route,
 			      sip->sip_contact), 0);
-  
-    orq = nta_outgoing_tagged(orq, 
+
+    orq = nta_outgoing_tagged(orq,
 			      outgoing_callback,
 			      ctx,
 			      ic->ic_tag,
@@ -3289,7 +3289,7 @@
     return 200;
   }
   else if (ag->ag_irq) {
-    nta_incoming_treply(ag->ag_irq, 
+    nta_incoming_treply(ag->ag_irq,
 			504, "Reliable Response Timeout",
 			TAG_END());
     nta_incoming_destroy(ag->ag_irq);
@@ -3309,7 +3309,7 @@
 
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -3338,8 +3338,8 @@
     TEST_1(nta_leg_tag(ag->ag_bob_leg, NULL));
     TEST_1(nta_leg_get_tag(ag->ag_bob_leg));
     TEST_1(nta_incoming_tag(irq, nta_leg_get_tag(ag->ag_bob_leg)));
-    TEST(nta_leg_server_route(ag->ag_bob_leg, 
-			      sip->sip_record_route, 
+    TEST(nta_leg_server_route(ag->ag_bob_leg,
+			      sip->sip_record_route,
 			      sip->sip_contact), 0);
   }
 
@@ -3388,7 +3388,7 @@
 
     ag->ag_expect_leg = ag->ag_server_leg;
     ag->ag_latest_leg = NULL;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_PRACK,
@@ -3403,14 +3403,14 @@
     TEST_P(ag->ag_latest_leg, NULL);
   }
 
-  ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent, 
+  ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent,
 				     alice_leg_callback,
 				     ag,
 				     SIPTAG_FROM(ag->ag_alice),
 				     SIPTAG_TO(ag->ag_bob),
 				     TAG_END());
   TEST_1(ag->ag_alice_leg);
-  
+
   TEST_1(nta_leg_tag(ag->ag_alice_leg, NULL));
 
   /* Send INVITE */
@@ -3421,8 +3421,8 @@
 
     nta_leg_bind(ag->ag_server_leg, bob_leg_callback2, ag);
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
-      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg, 
+    ctx->c_orq =
+      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg,
 			   outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_INVITE,
@@ -3447,7 +3447,7 @@
 
     /* Send BYE from Bob to Alice */
     old_leg = ag->ag_expect_leg = ag->ag_alice_leg;
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_bob_leg, outgoing_callback, ctx,
 			   NULL,
 			   SIP_METHOD_BYE,
@@ -3469,14 +3469,14 @@
   ag->ag_call_leg = NULL;
 
   /* Test CANCELing a call after receiving 100rel response */
-  ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent, 
+  ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent,
 				     alice_leg_callback,
 				     ag,
 				     SIPTAG_FROM(ag->ag_alice),
 				     SIPTAG_TO(ag->ag_bob),
 				     TAG_END());
   TEST_1(ag->ag_alice_leg);
-  
+
   TEST_1(nta_leg_tag(ag->ag_alice_leg, NULL));
 
   {
@@ -3490,8 +3490,8 @@
     /* Send INVITE */
     nta_leg_bind(ag->ag_server_leg, bob_leg_callback3, ag);
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
-      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg, 
+    ctx->c_orq =
+      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg,
 			   outgoing_callback, ctx,
 			   ag->ag_obp,
 			   SIP_METHOD_INVITE,
@@ -3515,20 +3515,20 @@
   if (EXPENSIVE_CHECKS) {
     printf("%s: starting 100rel timeout test, test will complete in 4 seconds\n",
 	   name);
-  
+
     TEST(nta_agent_set_params(ag->ag_agent,
 			      NTATAG_SIP_T1(25),
 			      NTATAG_SIP_T1X64(64 * 25),
 			      TAG_END()), 2);
 
-    ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent, 
+    ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent,
 				       alice_leg_callback,
 				       ag,
 				       SIPTAG_FROM(ag->ag_alice),
 				       SIPTAG_TO(ag->ag_bob),
 				       TAG_END());
     TEST_1(ag->ag_alice_leg);
-  
+
     TEST_1(nta_leg_tag(ag->ag_alice_leg, NULL));
 
     {
@@ -3536,15 +3536,15 @@
 	{{{{ ag, "Call 3",  NULL, checks_for_invite, invite_client_deinit }}}};
       client_t *ctx = ic->ic_client;
 
-      /* Send INVITE, 
+      /* Send INVITE,
        * send precious provisional response
-       * do not send PRACK, 
+       * do not send PRACK,
        * timeout (after 64 * t1 ~ 3.2 seconds),
        */
       nta_leg_bind(ag->ag_server_leg, bob_leg_callback2, ag);
       ag->ag_expect_leg = ag->ag_server_leg;
-      ctx->c_orq = 
-	nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg, 
+      ctx->c_orq =
+	nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg,
 			     outgoing_callback, ctx,
 			     ag->ag_obp,
 			     SIP_METHOD_INVITE,
@@ -3556,7 +3556,7 @@
 			     SIPTAG_PAYLOAD(sdp),
 			     TAG_END());
       TEST_1(ctx->c_orq);
-  
+
       nta_test_run(ag);
       TEST(ctx->c_status, 503);
       TEST_P(ctx->c_orq, NULL);
@@ -3564,16 +3564,16 @@
       TEST_1(ag->ag_bob_leg == NULL);
     }
 
-    TEST(nta_agent_set_params(ag->ag_agent, 
-			      NTATAG_SIP_T1(500), 
-			      NTATAG_SIP_T1X64(64 * 500), 
+    TEST(nta_agent_set_params(ag->ag_agent,
+			      NTATAG_SIP_T1(500),
+			      NTATAG_SIP_T1X64(64 * 500),
 			      TAG_END()), 2);
   }
 
   if (EXPENSIVE_CHECKS || 1) {
     /*
-     * client sends INVITE, 
-     * server sends provisional response, 
+     * client sends INVITE,
+     * server sends provisional response,
      * client PRACKs it,
      * client timeouts after timer C
      */
@@ -3584,12 +3584,12 @@
 
     printf("%s: starting timer C, test will complete in 1 seconds\n",
 	   name);
-  
+
     TEST(nta_agent_set_params(ag->ag_agent,
 			      NTATAG_TIMER_C(1000),
 			      TAG_END()), 1);
 
-    TEST_1(ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent, 
+    TEST_1(ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent,
 					      alice_leg_callback,
 					      ag,
 					      SIPTAG_FROM(ag->ag_alice),
@@ -3599,8 +3599,8 @@
 
     nta_leg_bind(ag->ag_server_leg, bob_leg_callback3, ag);
     ag->ag_expect_leg = ag->ag_server_leg;
-    TEST_1(ctx->c_orq = 
-	   nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg, 
+    TEST_1(ctx->c_orq =
+	   nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg,
 				outgoing_callback, ic->ic_client,
 				ag->ag_obp,
 				SIP_METHOD_INVITE,
@@ -3615,13 +3615,13 @@
     /* Run until 1) server gets CANCEL and 2) client gets 408 */
     TEST_1(!client_run_until_canceled(ctx, 408));
 
-    TEST_1(ag->ag_canceled != 0); 
+    TEST_1(ag->ag_canceled != 0);
     TEST_P(ag->ag_latest_leg, ag->ag_server_leg);
     TEST_1(ag->ag_bob_leg);
     nta_leg_destroy(ag->ag_bob_leg), ag->ag_bob_leg = NULL;
 
     TEST(nta_agent_set_params(ag->ag_agent,
-			      NTATAG_TIMER_C(185 * 1000), 
+			      NTATAG_TIMER_C(185 * 1000),
 			      TAG_END()), 1);
 
     nta_leg_destroy(ag->ag_bob_leg), ag->ag_bob_leg = NULL;
@@ -3641,7 +3641,7 @@
 
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -3665,10 +3665,10 @@
     nta_incoming_bind(irq, test_for_ack, ag);
     nta_incoming_treply(irq, SIP_100_TRYING, TAG_END());
 
-    nta_agent_set_params(ag->ag_agent, 
+    nta_agent_set_params(ag->ag_agent,
 			 NTATAG_DEBUG_DROP_PROB(ag->ag_drop),
 			 TAG_END());
-    ag->ag_reliable = 
+    ag->ag_reliable =
       nta_reliable_treply(irq,
 			  NULL, NULL,
 			  SIP_183_SESSION_PROGRESS,
@@ -3677,14 +3677,14 @@
 			  SIPTAG_CONTACT(ag->ag_m_alice),
 			  TAG_END());
     TEST_1(ag->ag_reliable);
-    ag->ag_reliable = 
+    ag->ag_reliable =
       nta_reliable_treply(irq,
 			  NULL, NULL,
 			  184, "Next",
 			  SIPTAG_CONTACT(ag->ag_m_alice),
 			  TAG_END());
     TEST_1(ag->ag_reliable);
-    ag->ag_reliable = 
+    ag->ag_reliable =
       nta_reliable_treply(irq,
 			  NULL, NULL,
 			  185, "Last",
@@ -3694,7 +3694,7 @@
     TEST(nta_incoming_treply(irq, SIP_200_OK, TAG_END()), 0);
     ag->ag_irq = irq;
     return 0;
-  } 
+  }
 
   if (sip->sip_request->rq_method == sip_method_bye) {
     leg_zap(ag, leg);
@@ -3721,14 +3721,14 @@
 
   BEGIN();
 
-  ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent, 
+  ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent,
 				     alice_leg_callback2,
 				     ag,
 				     SIPTAG_FROM(ag->ag_alice),
 				     SIPTAG_TO(ag->ag_bob),
 				     TAG_END());
   TEST_1(ag->ag_alice_leg);
-  
+
   TEST_1(nta_leg_tag(ag->ag_alice_leg, NULL));
   ag->ag_bob_leg = NULL;
 
@@ -3740,8 +3740,8 @@
     /* Send INVITE */
     nta_leg_bind(ag->ag_server_leg, bob_leg_callback2, ag);
     ag->ag_expect_leg = ag->ag_server_leg;
-    ctx->c_orq = 
-      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg, 
+    ctx->c_orq =
+      nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg,
 			   outgoing_callback, ic->ic_client,
 			   ag->ag_obp,
 			   SIP_METHOD_INVITE,
@@ -3766,7 +3766,7 @@
     client_t ctx[1] = {{ ag, "Hangup" }};
 
     /* Send BYE from Bob to Alice */
-    ctx->c_orq = 
+    ctx->c_orq =
       nta_outgoing_tcreate(ag->ag_bob_leg, outgoing_callback, ctx,
 			   NULL,
 			   SIP_METHOD_BYE,
@@ -3803,7 +3803,7 @@
 #endif
 
 static
-char const nta_test_usage[] = 
+char const nta_test_usage[] =
   "usage: %s OPTIONS\n"
   "where OPTIONS are\n"
   "   -v | --verbose    be verbose\n"
@@ -3882,7 +3882,7 @@
 
       if (rest == NULL || *rest)
 	usage(1);
-      
+
       su_log_set_level(nta_log, level);
       su_log_set_level(tport_log, level);
     }
@@ -3942,7 +3942,7 @@
   do { fflush(stdout);							\
     if (retval && quit_on_single_failure) { su_deinit(); return retval; } \
   } while(0)
-  
+
   retval |= test_init(ag, argv[i]); SINGLE_FAILURE_CHECK();
   if (retval == 0) {
     retval |= test_bad_messages(ag); SINGLE_FAILURE_CHECK();

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c	Tue Dec 23 07:37:03 2008
@@ -143,14 +143,14 @@
 
 
 static int incoming_callback_1(agent_t *ag,
-			       nta_incoming_t *irq, 
+			       nta_incoming_t *irq,
 			       sip_t const *sip)
 {
   return 0;
 }
 
 static int incoming_callback_2(agent_t *ag,
-			       nta_incoming_t *irq, 
+			       nta_incoming_t *irq,
 			       sip_t const *sip)
 {
   return 0;
@@ -173,10 +173,10 @@
   BEGIN();
   msg_t *msg;
   char const *tag;
-  
+
   if (tstflags & tst_verbatim) {
     printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
-	   name, __func__, sip->sip_request->rq_method_name, 
+	   name, __func__, sip->sip_request->rq_method_name,
 	   URL_PRINT_ARGS(sip->sip_request->rq_url),
 	   sip->sip_request->rq_version);
   }
@@ -188,7 +188,7 @@
   TEST_VOID(nta_incoming_bind(irq, incoming_callback_1, ag));
   TEST_P(nta_incoming_magic(irq, incoming_callback_1), ag);
   TEST_P(nta_incoming_magic(irq, incoming_callback_2), 0);
-  
+
   TEST_1(tag = nta_incoming_tag(irq, "tag=foofaa"));
   TEST_S(nta_incoming_gettag(irq), tag);
   TEST_S(tag, "foofaa");
@@ -199,9 +199,9 @@
   TEST_S(nta_incoming_method_name(irq), "MESSAGE");
   TEST_1(nta_incoming_url(irq) != NULL);
   TEST_1(nta_incoming_cseq(irq) != 0);
-  
+
   TEST(nta_incoming_set_params(irq, TAG_END()), 0);
-  
+
   TEST_1(msg = nta_incoming_getrequest(irq)); msg_destroy(msg);
   TEST_P(nta_incoming_getrequest_ackcancel(irq), NULL);
   TEST_P(nta_incoming_getresponse(irq), NULL);
@@ -225,9 +225,9 @@
   int status = sip->sip_status->st_status;
 
   if (tstflags & tst_verbatim) {
-    printf("%s: %s: %s %03d %s\n", name, __func__, 
-	   sip->sip_status->st_version, 
-	   sip->sip_status->st_status, 
+    printf("%s: %s: %s %03d %s\n", name, __func__,
+	   sip->sip_status->st_version,
+	   sip->sip_status->st_status,
 	   sip->sip_status->st_phrase);
   }
 
@@ -246,14 +246,14 @@
   TEST_S(nta_outgoing_method_name(orq), "MESSAGE");
   TEST(nta_outgoing_cseq(orq), sip->sip_cseq->cs_seq);
   TEST_1(nta_outgoing_delay(orq) < UINT_MAX);
-  
+
   TEST_1(msg = nta_outgoing_getresponse(orq));
   msg_destroy(msg);
-  
+
   TEST_1(msg = nta_outgoing_getrequest(orq));
   msg_destroy(msg);
 
-  nta_outgoing_destroy(orq);	
+  nta_outgoing_destroy(orq);
   /* Call it twice */
   nta_outgoing_destroy(orq);
 
@@ -262,7 +262,7 @@
   END();
 }
 
-void 
+void
 nta_test_run(agent_t *ag)
 {
   time_t now = time(NULL);
@@ -307,7 +307,7 @@
 					 NTATAG_PRELOAD(2048),
 					 TAG_END()));
   /* Create a default leg */
-  TEST_1(ag->ag_default_leg = nta_leg_tcreate(ag->ag_agent, 
+  TEST_1(ag->ag_default_leg = nta_leg_tcreate(ag->ag_agent,
 					     leg_callback,
 					     ag,
 					     NTATAG_NO_DIALOG(1),
@@ -352,7 +352,7 @@
   }
 
   {
-    char const data[] = 
+    char const data[] =
       "v=0\r\n"
       "o=- 425432 423412 IN IP4 127.0.0.1\r\n"
       "s= \r\n"
@@ -366,7 +366,7 @@
   {
     sip_contact_t *m;
 
-    ag->ag_aliases = 
+    ag->ag_aliases =
       sip_contact_make(ag->ag_home, "sip:127.0.0.1, sip:localhost, sip:[::1]");
     TEST_1(ag->ag_aliases);
     TEST_1(ag->ag_aliases->m_next);
@@ -381,38 +381,38 @@
     m->m_next = ag->ag_aliases;
     ag->ag_aliases = m;
 
-    TEST(nta_agent_set_params(ag->ag_agent, 
+    TEST(nta_agent_set_params(ag->ag_agent,
 			      NTATAG_ALIASES(ag->ag_aliases),
 			      NTATAG_REL100(1),
-			      NTATAG_UA(1), 
+			      NTATAG_UA(1),
 			      NTATAG_USE_NAPTR(1),
 			      NTATAG_USE_SRV(1),
 			      TAG_END()),
 	 5);
 
-    TEST(nta_agent_set_params(ag->ag_agent, 
+    TEST(nta_agent_set_params(ag->ag_agent,
 			      NTATAG_ALIASES(ag->ag_aliases),
 			      NTATAG_DEFAULT_PROXY("sip:127.0.0.1"),
 			      TAG_END()), 2);
 
-    TEST(nta_agent_set_params(ag->ag_agent, 
+    TEST(nta_agent_set_params(ag->ag_agent,
 			      NTATAG_ALIASES(ag->ag_aliases),
 			      NTATAG_DEFAULT_PROXY(NULL),
 			      TAG_END()), 2);
 
-    TEST(nta_agent_set_params(ag->ag_agent, 
+    TEST(nta_agent_set_params(ag->ag_agent,
 			      NTATAG_DEFAULT_PROXY("tel:+35878008000"),
 			      TAG_END()), -1);
 
   }
-  
+
   {
     url_t url[1];
 
     /* Create the server leg */
     *url = *ag->ag_aliases->m_url;
     url->url_user = "%";
-    TEST_1(ag->ag_server_leg = nta_leg_tcreate(ag->ag_agent, 
+    TEST_1(ag->ag_server_leg = nta_leg_tcreate(ag->ag_agent,
 					       leg_callback,
 					       ag,
 					       NTATAG_NO_DIALOG(1),
@@ -421,7 +421,7 @@
   }
 
   END();
-}  
+}
 
 int api_test_deinit(agent_t *ag)
 {
@@ -443,7 +443,7 @@
   free(ag->ag_mclass), ag->ag_mclass = NULL;
 
   END();
-}  
+}
 
 static int api_test_destroy(agent_t *ag)
 {
@@ -468,12 +468,12 @@
 				  NULL,
 				  NULL,
 				  TAG_END()));
-    TEST_1(leg = nta_leg_tcreate(nta, NULL, NULL, 
+    TEST_1(leg = nta_leg_tcreate(nta, NULL, NULL,
 				 NTATAG_NO_DIALOG(1),
 				 TAG_END()));
     /* This creates a delayed response message */
     orq = nta_outgoing_tcreate(leg, outgoing_callback, ag, NULL,
-			       SIP_METHOD_MESSAGE, 
+			       SIP_METHOD_MESSAGE,
 			       URL_STRING_MAKE("sip:foo.bar;transport=none"),
 			       SIPTAG_FROM_STR("<sip:bar.foo>"),
 			       SIPTAG_TO_STR("<sip:foo.bar>"),
@@ -482,7 +482,7 @@
 
     TEST_VOID(nta_outgoing_destroy(orq));
     TEST_VOID(nta_leg_destroy(leg));
-    TEST_VOID(nta_agent_destroy(nta)); 
+    TEST_VOID(nta_agent_destroy(nta));
   }
 
   TEST_VOID(su_root_destroy(root));
@@ -573,9 +573,9 @@
 			    NTATAG_USE_NAPTR_REF(use_naptr),
 			    NTATAG_USE_SRV_REF(use_srv),
 			    NTATAG_USE_TIMESTAMP_REF(use_timestamp),
-			    TAG_END()), 
+			    TAG_END()),
        /* Number of parameters */ 33);
-  
+
   TEST_P(mclass, sip_default_mclass());
   TEST_P(aliases, NULL);
   TEST_1(contact != (void *)-1 && contact != NULL);
@@ -611,32 +611,32 @@
   TEST_1(use_timestamp != -1);
   TEST_1(user_via == 0);
 
-  TEST(nta_agent_set_params(NULL, 
+  TEST(nta_agent_set_params(NULL,
 			    NTATAG_PRELOAD(2048),
 			    TAG_END()), -1);
-  TEST(nta_agent_get_params(NULL, 
+  TEST(nta_agent_get_params(NULL,
 			    NTATAG_PRELOAD_REF(preload),
 			    TAG_END()), -1);
 
-  TEST(nta_agent_set_params(nta, 
+  TEST(nta_agent_set_params(nta,
 			    NTATAG_PRELOAD(2048),
 			    TAG_END()), 1);
-  TEST(nta_agent_get_params(nta, 
+  TEST(nta_agent_get_params(nta,
 			    NTATAG_PRELOAD_REF(preload),
 			    TAG_END()), 1);
   TEST(preload, 2048);
 
-  TEST(nta_agent_set_params(nta, 
+  TEST(nta_agent_set_params(nta,
 			    NTATAG_SIGCOMP_OPTIONS("sip"),
 			    TAG_END()), 1);
-  TEST(nta_agent_set_params(nta, 
+  TEST(nta_agent_set_params(nta,
 			    NTATAG_SIGCOMP_OPTIONS(","),
 			    TAG_END()), -1);
-  TEST(nta_agent_set_params(nta, 
+  TEST(nta_agent_set_params(nta,
 			    NTATAG_SIGCOMP_OPTIONS("sip;dms=16384"),
 			    TAG_END()), 1);
   s = NONE;
-  TEST(nta_agent_get_params(nta, 
+  TEST(nta_agent_get_params(nta,
 			    NTATAG_SIGCOMP_OPTIONS_REF(s),
 			    TAG_END()), 1);
   TEST_S(s, "sip;dms=16384");
@@ -767,7 +767,7 @@
   TEST_1(m = nta_agent_contact(agent));
   TEST_S(m->m_url->url_params, "transport=tcp");
 
-  TEST_1(nta_agent_add_tport(agent, (url_string_t *)url, 
+  TEST_1(nta_agent_add_tport(agent, (url_string_t *)url,
 			     TPTAG_SERVER(0), TAG_END()) == 0);
   TEST_1(v = nta_agent_public_via(agent)); TEST_1(!v->v_next);
   TEST(strcasecmp(v->v_protocol, sip_transport_tcp), 0);
@@ -794,9 +794,9 @@
 
   TEST_1(agent = nta_agent_create(ag->ag_root, NONE, NULL, NULL, TAG_END()));
   TEST_1(nta_agent_add_tport(agent, (url_string_t *)url, TAG_END()) == 0);
-  TEST_1(v = nta_agent_via(agent)); 
+  TEST_1(v = nta_agent_via(agent));
   TEST(strcasecmp(v->v_protocol, sip_transport_tcp), 0);
-  TEST_1(v = v->v_next);  
+  TEST_1(v = v->v_next);
   TEST(strcasecmp(v->v_protocol, sip_transport_udp), 0);
   TEST_1(m = nta_agent_contact(agent));
   TEST_1(!m->m_url->url_params);
@@ -806,7 +806,7 @@
 
   TEST_1(agent = nta_agent_create(ag->ag_root, NONE, NULL, NULL, TAG_END()));
   TEST_1(nta_agent_add_tport(agent, (url_string_t *)url, TAG_END()) == 0);
-  TEST_1(v = nta_agent_via(agent)); 
+  TEST_1(v = nta_agent_via(agent));
   TEST(strcasecmp(v->v_protocol, sip_transport_udp), 0);
   TEST_1(v = v->v_next);
   TEST(strcasecmp(v->v_protocol, sip_transport_tcp), 0);
@@ -824,15 +824,15 @@
 #if 0
   {
     /* Test 0.1
-     * Send a message from default leg to default leg 
+     * Send a message from default leg to default leg
      */
     char const p_acid[] = "P-Access-Network-Info: IEEE-802.11g\n";
     msg_t *msg;
 
     ag->ag_expect_leg = ag->ag_default_leg;
 
-    TEST_1(ag->ag_orq = 
-	  nta_outgoing_tcreate(ag->ag_default_leg, 
+    TEST_1(ag->ag_orq =
+	  nta_outgoing_tcreate(ag->ag_default_leg,
 			       outgoing_callback, ag,
 			       ag->ag_obp,
 			       SIP_METHOD_MESSAGE,
@@ -865,6 +865,90 @@
 }
 
 
+/* Test that NULL host and/or port fields of user supplied Via header are
+   filled in automaticaly */
+int api_test_user_via_fillin(agent_t *ag)
+{
+  su_home_t home[1];
+  su_root_t *root;
+  nta_agent_t *nta;
+  nta_leg_t *leg;
+  nta_outgoing_t *orq0, *orq1;
+  msg_t *msg0, *msg1;
+  sip_t *sip0, *sip1;
+  sip_via_t *via0, *via1;
+  sip_via_t via[1];
+  static char *via_params[] = { "param1=value1", "param2=value2" };
+  int i;
+
+  BEGIN();
+
+  memset(home, 0, sizeof home);
+  su_home_init(home);
+
+  TEST_1(root = su_root_create(NULL));
+
+  TEST_1(nta = nta_agent_create(root,
+  			  (url_string_t *)"sip:*:*",
+  			  NULL,
+  			  NULL,
+  			  TAG_END()));
+  TEST_1(leg = nta_leg_tcreate(nta, NULL, NULL, 
+  			 NTATAG_NO_DIALOG(1),
+  			 TAG_END()));
+
+  /* This creates a delayed response message */
+  orq0 = nta_outgoing_tcreate(leg, outgoing_callback, ag, NULL,
+  		       SIP_METHOD_MESSAGE, 
+  		       URL_STRING_MAKE("sip:foo.bar;transport=none"),
+  		       SIPTAG_FROM_STR("<sip:bar.foo>"),
+  		       SIPTAG_TO_STR("<sip:foo.bar>"),
+  		       TAG_END());
+  TEST_1(orq0);
+  TEST_1(msg0 = nta_outgoing_getrequest(orq0));
+  TEST_1(sip0 = sip_object(msg0));
+  TEST_1(via0 = sip0->sip_via);
+
+  /* create user Via template to be filled in by NTA */
+  sip_via_init(via);
+  via->v_protocol = "*";
+  for (i = 0; i < sizeof(via_params)/sizeof(via_params[0]); i++)
+      sip_via_add_param(home,via,via_params[i]); /* add param to the template */
+
+  /* This creates a delayed response message */
+  orq1 = nta_outgoing_tcreate(leg, outgoing_callback, ag, NULL,
+  		       SIP_METHOD_MESSAGE, 
+  		       URL_STRING_MAKE("sip:foo.bar;transport=none"),
+  		       SIPTAG_FROM_STR("<sip:bar.foo>"),
+  		       SIPTAG_TO_STR("<sip:foo.bar>"),
+               NTATAG_USER_VIA(1),
+               SIPTAG_VIA(via),
+  		       TAG_END());
+  TEST_1(orq1);
+  TEST_1(msg1 = nta_outgoing_getrequest(orq1));
+  TEST_1(sip1 = sip_object(msg1));
+  TEST_1(via1 = sip1->sip_via);
+
+  /* check that template has been filled correctly */
+  TEST_S(via0->v_protocol,via1->v_protocol);
+  TEST_S(via0->v_host,via1->v_host);
+  TEST_S(via0->v_port,via1->v_port);
+  /* check that the parameter has been preserved */
+  for (i = 0; i < sizeof(via_params)/sizeof(via_params[0]); i++)
+    TEST_S(via1->v_params[i],via_params[i]);
+
+  TEST_VOID(nta_outgoing_destroy(orq0));
+  TEST_VOID(nta_outgoing_destroy(orq1));
+  TEST_VOID(nta_leg_destroy(leg));
+  TEST_VOID(nta_agent_destroy(nta)); 
+
+  TEST_VOID(su_root_destroy(root));
+  TEST_VOID(su_home_deinit(home));
+
+  END();
+}
+
+
 int outgoing_default(agent_t *ag,
 		     nta_outgoing_t *orq,
 		     sip_t const *sip)
@@ -887,7 +971,7 @@
   TEST_S(nta_outgoing_method_name(orq), "*");
   TEST(nta_outgoing_cseq(orq), 0);
   TEST_1(nta_outgoing_delay(orq) == UINT_MAX);
-  
+
   TEST_1(msg = nta_outgoing_getresponse(orq));
   if (ag->ag_response == NULL)
     ag->ag_response = msg;
@@ -916,7 +1000,7 @@
   TEST_VOID(nta_incoming_bind(irq, incoming_callback_1, ag));
   TEST_P(nta_incoming_magic(irq, incoming_callback_1), ag);
   TEST_P(nta_incoming_magic(irq, incoming_callback_2), 0);
-  
+
   TEST_P(nta_incoming_tag(irq, NULL), NULL);
   TEST_P(nta_incoming_gettag(irq), NULL);
 
@@ -929,18 +1013,18 @@
   TEST(nta_incoming_received(irq, &nano), nano / 1000000000);
 
   TEST(nta_incoming_set_params(irq, TAG_END()), 0);
-  
+
   TEST_P(nta_incoming_getrequest(irq), NULL);
   TEST_P(nta_incoming_getrequest_ackcancel(irq), NULL);
   TEST_P(nta_incoming_getresponse(irq), NULL);
-  
+
   TEST(nta_incoming_complete_response(irq, NULL, SIP_200_OK, TAG_END()), -1);
 
   TEST(nta_incoming_treply(irq, SIP_200_OK, TAG_END()), -1);
   TEST(nta_incoming_mreply(irq, NULL), -1);
-  
+
   TEST_VOID(nta_incoming_destroy(irq));
-  
+
   TEST_1(orq = nta_outgoing_default(nta, outgoing_default, ag));
 
   TEST(nta_outgoing_status(orq), 0);
@@ -960,7 +1044,7 @@
   TEST_P(nta_outgoing_tcancel(orq, NULL, NULL, TAG_END()), NULL);
 
   TEST_VOID(nta_outgoing_destroy(orq));
-  
+
   TEST_1(irq = nta_incoming_default(nta));
   TEST_1(orq = nta_outgoing_default(nta, outgoing_default, ag));
 
@@ -968,7 +1052,7 @@
   via->v_next = NULL;
 
   TEST_1(nta_incoming_treply
-	 (irq, 
+	 (irq,
 	  SIP_200_OK,
 	  SIPTAG_VIA(via),
 	  SIPTAG_CALL_ID_STR("oishciucnkrcoihciunskcisj"),
@@ -985,7 +1069,7 @@
 
   TEST_VOID(nta_outgoing_destroy(orq));
   TEST_VOID(nta_incoming_destroy(irq));
-  
+
   END();
 }
 
@@ -1054,7 +1138,7 @@
 
     TEST_1(msg = nta_msg_create(nta, 0));
     TEST(nta_msg_complete(msg), -1);
-    TEST(nta_msg_request_complete(msg, NULL, 
+    TEST(nta_msg_request_complete(msg, NULL,
 				  sip_method_unknown, "FOO", NULL), -1);
     TEST(nta_is_internal_msg(NULL), 0);
     TEST(nta_is_internal_msg(msg), 0);
@@ -1084,7 +1168,7 @@
 
   TEST_VOID(nta_incoming_bind(NULL, NULL, NULL));
   TEST_P(nta_incoming_magic(NULL, NULL), NULL);
-  
+
   TEST_P(nta_incoming_find(NULL, NULL, NULL), NULL);
   TEST_P(nta_incoming_find(nta, NULL, NULL), NULL);
 
@@ -1111,14 +1195,14 @@
   TEST(nta_incoming_mreply(NULL, NULL), -1);
 
   TEST_VOID(nta_incoming_destroy(NULL));
-  
-  TEST_P(nta_outgoing_tcreate(NULL, outgoing_callback, ag, 
+
+  TEST_P(nta_outgoing_tcreate(NULL, outgoing_callback, ag,
 			    URL_STRING_MAKE("sip:localhost"),
 			    SIP_METHOD_MESSAGE,
 			    URL_STRING_MAKE("sip:localhost"),
 			    TAG_END()), NULL);
 
-  TEST_P(nta_outgoing_mcreate(NULL, outgoing_callback, ag, 
+  TEST_P(nta_outgoing_mcreate(NULL, outgoing_callback, ag,
 			    URL_STRING_MAKE("sip:localhost"),
 			    NULL,
 			    TAG_END()), NULL);
@@ -1166,7 +1250,7 @@
   TEST_P(nta_reliable_mreply(NULL, NULL, NULL, NULL), NULL);
   TEST_VOID(nta_reliable_destroy(NULL));
 
-  TEST_VOID(nta_agent_destroy(nta)); 
+  TEST_VOID(nta_agent_destroy(nta));
   TEST_VOID(su_root_destroy(root));
   TEST_VOID(su_home_deinit(home));
 
@@ -1196,17 +1280,17 @@
 				NULL,
 				TAG_END()));
 
-  TEST_1(dst = nta_leg_tcreate(nta, NULL, NULL, 
+  TEST_1(dst = nta_leg_tcreate(nta, NULL, NULL,
 				NTATAG_NO_DIALOG(1),
 				URLTAG_URL("sip:joe at localhost"),
 				TAG_END()));
 
-  TEST_1(defdst = nta_leg_tcreate(nta, NULL, NULL, 
+  TEST_1(defdst = nta_leg_tcreate(nta, NULL, NULL,
 				  NTATAG_NO_DIALOG(1),
 				  TAG_END()));
 
-  TEST_1(dialog1 = 
-	 nta_leg_tcreate(nta, NULL, NULL, 
+  TEST_1(dialog1 =
+	 nta_leg_tcreate(nta, NULL, NULL,
 			 URLTAG_URL("sip:pc.al.us"),
 			 SIPTAG_CALL_ID_STR("foobarbaz"),
 			 /* local */
@@ -1219,8 +1303,8 @@
   TEST_1(a2 = sip_from_make(home, "<sip:joe.boy at al.us>;tag=al"));
   TEST_1(i = sip_call_id_make(home, "foobarbaz"));
 
-  TEST_1(dialog2 = 
-	 nta_leg_tcreate(nta, NULL, NULL, 
+  TEST_1(dialog2 =
+	 nta_leg_tcreate(nta, NULL, NULL,
 			 SIPTAG_CALL_ID(i),
 			 /* local */
 			 SIPTAG_FROM(a2),
@@ -1228,81 +1312,81 @@
 			 SIPTAG_TO(a1),
 			 TAG_END()));
 
-  TEST_1(!nta_leg_by_dialog(nta, NULL, NULL, 
+  TEST_1(!nta_leg_by_dialog(nta, NULL, NULL,
 			    a1->a_tag, a1->a_url, a2->a_tag, a2->a_url));
-  TEST_1(!nta_leg_by_dialog(NULL, NULL, i, 
+  TEST_1(!nta_leg_by_dialog(NULL, NULL, i,
 			    a1->a_tag, a1->a_url, a2->a_tag, a2->a_url));
-  TEST_1(!nta_leg_by_dialog(nta, (void *)"sip:no.such.url", i, 
+  TEST_1(!nta_leg_by_dialog(nta, (void *)"sip:no.such.url", i,
 			    a2->a_tag, a2->a_url, a1->a_tag, a1->a_url));
-  TEST_1(!nta_leg_by_dialog(nta, a2->a_url, i, 
+  TEST_1(!nta_leg_by_dialog(nta, a2->a_url, i,
 			    a2->a_tag, a2->a_url, a1->a_tag, a1->a_url));
 
-  TEST_P(leg = nta_leg_by_dialog(nta, NULL, i, 
-				 /* local */ a1->a_tag, a1->a_url, 
+  TEST_P(leg = nta_leg_by_dialog(nta, NULL, i,
+				 /* local */ a1->a_tag, a1->a_url,
 				 /* remote */ a2->a_tag, a2->a_url),
 	 dialog2);
-  TEST_P(leg = nta_leg_by_dialog(nta, (void *)"sip:no.such.url", i, 
-				 /* local */ a1->a_tag, a1->a_url, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (void *)"sip:no.such.url", i,
+				 /* local */ a1->a_tag, a1->a_url,
 				 /* remote */ a2->a_tag, a2->a_url),
 	 dialog2);
-  TEST_P(leg = nta_leg_by_dialog(nta, a2->a_url, i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, a2->a_url, i,
 				 a1->a_tag, a1->a_url, a2->a_tag, a2->a_url),
 	 dialog2);
 
-  TEST_P(leg = nta_leg_by_dialog(nta, NULL, i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, NULL, i,
 				 a2->a_tag, a2->a_url, a1->a_tag, a1->a_url),
 	 dialog1);
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, a2->a_url, a1->a_tag, a1->a_url),
 	 dialog1);
   /* local tag is required because there is tag */
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, a2->a_url, "xyzzy", a1->a_url),
 	 NULL);
   /* local URI is ignored because we have tag */
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, a2->a_url, a1->a_tag, a2->a_url),
 	 dialog1);
 
   /* remote tag is ignored because there is no tag */
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 "xyzzy", a2->a_url, a1->a_tag, a1->a_url),
 	 dialog1);
 #if nomore
   /* remote url is required */
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, a1->a_url, a1->a_tag, a1->a_url),
 	 NULL);
 #endif
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, NULL, a1->a_tag, a1->a_url),
 	 dialog1);
 
   /* local url is used if there is no local tag */ /* XXX - not really */
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, a2->a_url, NULL, NULL),
 	 NULL);
 
   nta_leg_tag(dialog1, "al");
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, a2->a_url, a1->a_tag, a1->a_url),
 	 dialog1);
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, a2->a_url, "xyzzy", a1->a_url),
 	 NULL);
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, a2->a_url, a1->a_tag, a1->a_url),
 	 dialog1);
-  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i, 
+  TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
 				 a2->a_tag, a2->a_url, NULL, a1->a_url),
 	 NULL);
-		
+
   nta_leg_destroy(defdst);
   nta_leg_destroy(dst);
   nta_leg_destroy(dialog1);
   nta_leg_destroy(dialog2);
-	    
-  TEST_VOID(nta_agent_destroy(nta)); 
+
+  TEST_VOID(nta_agent_destroy(nta));
   TEST_VOID(su_root_destroy(root));
   TEST_VOID(su_home_deinit(home));
 
@@ -1371,7 +1455,7 @@
 
       if (rest == NULL || *rest)
 	usage(1);
-      
+
       su_log_set_level(nta_log, level);
       su_log_set_level(tport_log, level);
     }
@@ -1426,8 +1510,9 @@
     retval |= api_test_tport(ag); SINGLE_FAILURE_CHECK();
     retval |= api_test_dialogs(ag); SINGLE_FAILURE_CHECK();
     retval |= api_test_default(ag); SINGLE_FAILURE_CHECK();
+    retval |= api_test_user_via_fillin(ag); SINGLE_FAILURE_CHECK();
   }
-  retval |= api_test_deinit(ag); fflush(stdout); 
+  retval |= api_test_deinit(ag); fflush(stdout);
 
   su_home_deinit(ag->ag_home);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/Doxyfile.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/Doxyfile.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/Doxyfile.in	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 PROJECT_NAME         = "nth"
 OUTPUT_DIRECTORY     = ../docs/html/nth
 
-INPUT 		     = @srcdir@/nth.docs @srcdir@/sofia-sip @srcdir@ . 
+INPUT 		     = @srcdir@/nth.docs @srcdir@/sofia-sip @srcdir@ .
 
 @INCLUDE_PATH = . @srcdir@
 @INCLUDE = ../docs/Doxyfile.conf

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/http-client.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/http-client.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/http-client.c	Tue Dec 23 07:37:03 2008
@@ -32,7 +32,7 @@
 #include "config.h"
 
 /**@page http_client Make HTTP request
- * 
+ *
  * @par Name    
  * http-client - HTTP request tool
  *
@@ -41,10 +41,10 @@
  * <tt>http-client [OPTIONS] url</tt>
  *
  * @par Description
- * 
+ *
  * The @em http-client utility sends a HTTP request to an HTTP server or proxy.
  *
- * @par 
+ * @par
  *
  * The @em http-client tool will print out status line and interesting
  * headers from the response. The message body is also printed.
@@ -142,7 +142,7 @@
   return 0;
 }
 
-static 
+static
 char *read_file(FILE *stream)
 {
   int n;
@@ -179,7 +179,7 @@
   return buf;
 }
 
-char const _usage[] = 
+char const _usage[] =
 "usage: %s [OPTIONS] url\n"
 "       where OPTIONS are as follows\n"
 "       --method=name\n"
@@ -206,15 +206,15 @@
   su_home_t *home;
   context_t context[1] = {{{SU_HOME_INIT(context)}}};
   http_method_t method;
-  char 
-    *o_proxy = NULL, 
+  char
+    *o_proxy = NULL,
     *o_user = NULL,
     *o_max_forwards = NULL,
     *o_method_name = "GET",
     *o_user_agent = "http-client/1.0 " "nth/" NTH_VERSION;
-  int 
+  int
     o_pipe = 0, o_extra = 0;
-   
+
   char *extra = NULL;
   char *v;
 
@@ -239,7 +239,7 @@
     else if (MATCH(v, "--pipe"))     { o_pipe = 1;         continue; }
     else if (MATCH(v, "--extra"))    { o_extra = 1;        continue; }
     else if (MATCH(v, "--help"))     { usage(0);           continue; }
-    else 
+    else
       usage(1);
   }
 
@@ -259,8 +259,8 @@
   su_home_init(home = context->c_home);
 
   if (o_extra) {
-    if (isatty(0)) 
-      fprintf(stderr, 
+    if (isatty(0))
+      fprintf(stderr,
 	      "Type extra HTTP headers, empty line then HTTP message body "
 	      "(^D when complete):\n");
     fflush(stderr);
@@ -271,8 +271,8 @@
   context->c_root = su_root_create(context);
 
   if (context->c_root) {
-    context->c_engine = 
-      nth_engine_create(context->c_root, 
+    context->c_engine =
+      nth_engine_create(context->c_root,
 			NTHTAG_ERROR_MSG(0),
 			TAG_END());
 
@@ -280,7 +280,7 @@
       while ((v = argv++[1])) {
 	nth_client_t *clnt;
 	clnt = nth_client_tcreate(context->c_engine,
-				  response, context, 
+				  response, context,
 				  method, o_method_name,
 				  URL_STRING_MAKE(v),
 				  NTHTAG_PROXY(o_proxy),
@@ -294,7 +294,7 @@
       }
 
       if (context->c_pending)
-	su_root_run(context->c_root); 
+	su_root_run(context->c_root);
 
       nth_engine_destroy(context->c_engine), context->c_engine = NULL;
     }
@@ -320,7 +320,7 @@
   } else {
     status = nth_client_status(clnt);
     fprintf(stderr, "HTTP/1.1 %u Error\n", status);
-  } 
+  }
 
   if (http && (c->c_pre || status >= 200)) {
     http_header_t *h = (http_header_t *)http->http_status;
@@ -335,9 +335,9 @@
 	header_print(stdout, NULL, h);
       else if (h->sh_class->hc_name[0]) {
 	snprintf(hname, sizeof hname, "%s: %%s\n", h->sh_class->hc_name);
-	header_print(stdout, hname, h); 
+	header_print(stdout, hname, h);
       } else {
-	header_print(stdout, "%s\n", h); 
+	header_print(stdout, "%s\n", h);
       }
     }
 
@@ -364,7 +364,7 @@
 
     //if (user && pass &&
     if (
-	auc_challenge(&c->c_auth, c->c_home, 
+	auc_challenge(&c->c_auth, c->c_home,
 		      http->http_www_authenticate,
 		      http_authorization_class) > 0) {
       char const *scheme = NULL;
@@ -375,7 +375,7 @@
 				"realm=");
       if (auc_all_credentials(&c->c_auth, scheme, realm, user, pass)
 	  >= 0)
-	newclnt = nth_client_tcreate(c->c_engine, 
+	newclnt = nth_client_tcreate(c->c_engine,
 				     NULL, NULL, HTTP_NO_METHOD, NULL,
 				     NTHTAG_AUTHENTICATION(&c->c_auth),
 				     NTHTAG_TEMPLATE(clnt),
@@ -385,11 +385,11 @@
 
   if (status == 302 && http->http_location) {
     url_t loc[1];
-    
+
     *loc = *http->http_location->loc_url;
 
     newclnt = nth_client_tcreate(c->c_engine, NULL, NULL,
-				 HTTP_NO_METHOD, 
+				 HTTP_NO_METHOD,
 				 (url_string_t *)loc,
 				 NTHTAG_TEMPLATE(clnt),
 				 TAG_END());
@@ -398,7 +398,7 @@
 
   if (newclnt)
     c->c_pending++;
-  
+
   nth_client_destroy(clnt);
   if (c->c_pending-- == 1)
     su_root_break(c->c_root);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth.docs	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 /* -*- c -*- */
 
 /**@MODULEPAGE "nth" - HTTP Transactions Module
- * 
+ *
  * @section nth_meta Module Meta Information
  *
  * NTH provides interface to simple HTTP transaction engines for both HTTP

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_client.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_client.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_client.c	Tue Dec 23 07:37:03 2008
@@ -24,16 +24,16 @@
 
 /**@CFILE nth_client.c
  * @brief HTTP Client implementhtion
- * 
+ *
  * Copyright (c) 2002 Nokia Research Center.  All rights reserved.
- * 
+ *
  * This source file has been divided into following sections:
  * 1) engine
  * 2) tport handling
  * 3) client transactions
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Jun 13 02:57:51 2000 ppessi
  */
 
@@ -141,7 +141,7 @@
   /* Attributes */
   unsigned hc_streaming:1;		/**< Enable streaming */
   unsigned hc_error_msg:1;
-  unsigned /* pad */:0;				
+  unsigned /* pad */:0;
 
   url_string_t const *hc_route_url;
   tp_name_t hc_tpn[1];			/**< Where to send requests */
@@ -531,7 +531,7 @@
   if (msg_size(msg))
     SU_DEBUG_3(("nth client: received extra data ("MOD_ZU" bytes) "
 		"from %s/%s:%s\n",
-		(size_t)msg_size(msg), 
+		(size_t)msg_size(msg),
 		tpn->tpn_proto, tpn->tpn_host, tpn->tpn_port));
   else
     SU_DEBUG_3(("nth client: received extra data from %s/%s:%s\n",
@@ -649,7 +649,7 @@
 	    NTHTAG_AUTHENTICATION_REF(auc),
 	    NTHTAG_MESSAGE_REF(msg),
 	    NTHTAG_EXPIRES_REF(expires),
-	    HTTPTAG_VERSION_REF(version), 
+	    HTTPTAG_VERSION_REF(version),
 	    TAG_END());
 
     if (msg == none) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 /**@internal @file nth_server.c
  * @brief HTTP server.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Sat Oct 19 01:37:36 2002 ppessi
  */
 
@@ -55,7 +55,7 @@
 /* We are customer of tport_t */
 #define TP_STACK_T   server_t
 #define TP_MAGIC_T   void
-                                     
+
 #include <sofia-sip/tport.h>
 #include <sofia-sip/htable.h>
 
@@ -78,7 +78,7 @@
 
 HTABLE_DECLARE(hc_htable, hct, nth_client_t);
 
-struct server_s 
+struct server_s
 {
   su_home_t          srv_home[1];
   su_root_t         *srv_root;
@@ -109,7 +109,7 @@
   http_server_t     *srv_server;      /**< Server header */
 };
 
-struct nth_site_s 
+struct nth_site_s
 {
   nth_site_t          *site_next, **site_prev;
 
@@ -143,7 +143,7 @@
   char const           *req_method_name;
   url_t const          *req_url;         /**< RequestURI  */
   char const           *req_version;
-  
+
   tport_t              *req_tport;
   msg_t		       *req_request;
   msg_t                *req_response;
@@ -171,7 +171,7 @@
  *
  * The NTH_DEBUG environment variable is used to determine the debug
  * logging level for @b nth module. The default level is 1.
- * 
+ *
  * @sa <sofia-sip/su_debug.h>, nth_server_log, SOFIA_DEBUG
  */
 extern char const NTH_DEBUG[];
@@ -180,8 +180,8 @@
 #define SU_DEBUG 1
 #endif
 
-/**Debug log for @b nth module. 
- * 
+/**Debug log for @b nth module.
+ *
  * The nth_server_log is the log object used by @b nth module. The level of
  * #nth_server_log is set using #NTH_DEBUG environment variable.
  */
@@ -211,11 +211,11 @@
 static nth_site_t *site_get_subdir(nth_site_t *parent, char const *path, char const **res);
 static void server_tport_error(server_t *srv, tport_t *tport,
 			       int errcode, char const *remote);
-static msg_t *server_msg_create(server_t *srv, int flags, 
+static msg_t *server_msg_create(server_t *srv, int flags,
 				char const data[], usize_t dlen,
 				tport_t const *tp, tp_client_t *tpc);
 
-static void server_reply(server_t *srv, tport_t *tport, 
+static void server_reply(server_t *srv, tport_t *tport,
 			 msg_t *request, msg_t *response,
 			 int status, char const *phrase);
 
@@ -232,13 +232,13 @@
  * 5) Site functions
  */
 
-/** Create a http site object. 
+/** Create a http site object.
  *
  * The function nth_site_create() allocates and initializes a web site
- * object. A web site object can be either 
+ * object. A web site object can be either
  * - a primary http server (@a parent is NULL),
- * - a virtual http server (@a address contains hostpart), or 
- * - a site within a server 
+ * - a virtual http server (@a address contains hostpart), or
+ * - a site within a server
  *   (@a address does not have hostpart, only path part).
  *
  * @param parent pointer to parent site
@@ -259,7 +259,7 @@
  *
  * @since Support for multiple sites was added to @VERSION_1_12_4
  */
-nth_site_t *nth_site_create(nth_site_t *parent,  
+nth_site_t *nth_site_create(nth_site_t *parent,
 			    nth_request_f *callback,
 			    nth_site_magic_t *magic,
 			    url_string_t const *address,
@@ -307,7 +307,7 @@
 
   if (!url || !callback)
     return NULL;
-  
+
   is_host = url->url_host != NULL;
   is_path = url->url_path != NULL;
 
@@ -329,7 +329,7 @@
       errno = EINVAL;
       goto error;
     }
-      
+
     srv = parent->site_server; assert(srv);
     if (is_host) {
       prev = site_get_host(&srv->srv_sites, url->url_host, url->url_port);
@@ -340,7 +340,7 @@
 	errno = EEXIST;
 	goto error;
       }
-    } 
+    }
     else {
       size_t i, j;
 
@@ -370,7 +370,7 @@
       prev = site_get_rslot(parent, path, &path);
 
       if (!prev || path[0] == '\0') {
-	SU_DEBUG_3(("nth_site_create(): directory \"%s\" already exists\n", 
+	SU_DEBUG_3(("nth_site_create(): directory \"%s\" already exists\n",
 		    url->url_path));
 	errno = EEXIST;
 	goto error;
@@ -396,7 +396,7 @@
 
   if (srv && (site = su_zalloc(srv->srv_home, (sizeof *site) + usize))) {
     site->site_url = (url_t *)(site + 1);
-    url_dup((void *)(site->site_url + 1), usize - sizeof(*url), 
+    url_dup((void *)(site->site_url + 1), usize - sizeof(*url),
 	    site->site_url, url);
 
     assert(prev);
@@ -423,7 +423,7 @@
     site->site_wildcard = wildcard;
     site->site_callback = callback;
     site->site_magic = magic;
-    
+
     if (parent)
       site->site_auth = parent->site_auth;
 
@@ -457,8 +457,8 @@
 }
 
 
-void nth_site_bind(nth_site_t *site, 
-		   nth_request_f *callback, 
+void nth_site_bind(nth_site_t *site,
+		   nth_request_f *callback,
 		   nth_site_magic_t *magic)
 {
   if (site) {
@@ -517,7 +517,7 @@
 	      TAG_IF(master, NTHTAG_MFLAGS_REF(mflags)),
 	      NTHTAG_AUTH_MODULE_REF(am),
 	      TAG_END());
-  
+
   if (n > 0) {
     if (mclass)
       server->srv_mclass = mclass;
@@ -558,13 +558,13 @@
 	       TAG_IF(master, NTHTAG_MCLASS(mclass)),
 	       TAG_IF(master, NTHTAG_MFLAGS(server->srv_mflags)),
 	       TAG_END());
-  
+
   ta_end(ta);
 
   return n;
 }
 
-int nth_site_get_stats(nth_site_t const *site, 
+int nth_site_get_stats(nth_site_t const *site,
 		       tag_type_t tag, tag_value_t value, ...)
 {
   int n;
@@ -577,7 +577,7 @@
 
   n = tl_tgets(ta_args(ta),
 	       TAG_END());
-  
+
   ta_end(ta);
 
   return n;
@@ -606,7 +606,7 @@
  * When a resource
  */
 static
-nth_site_t **site_get_rslot(nth_site_t *parent, char *path, 
+nth_site_t **site_get_rslot(nth_site_t *parent, char *path,
 			    char **return_rest)
 {
   nth_site_t *site, **prev;
@@ -626,7 +626,7 @@
       continue;
     if (path[len] == '\0') {
       if (site->site_isdir)
-	return *return_rest = path, prev; 
+	return *return_rest = path, prev;
       return errno = EEXIST, NULL;
     }
     if (path[len] != '/' || site->site_path[len] != '/')
@@ -662,7 +662,7 @@
 
   if (path[0] == '\0')
     return *return_rest = path, parent;
-  
+
   for (site = parent->site_kids; site; site = site->site_next) {
     cmp = strncmp(path, site->site_path, len = site->site_path_len);
     if (cmp > 0)
@@ -711,7 +711,7 @@
   ta_list ta;
 
   ta_start(ta, tag, value);
-  tl_gets(ta_args(ta), 
+  tl_gets(ta_args(ta),
 	  NTHTAG_ROOT_REF(root),
 	  NTHTAG_MCLASS_REF(mclass),
 	  TPTAG_REUSE_REF(persistent),
@@ -719,7 +719,7 @@
 	  HTTPTAG_SERVER_STR_REF(server_str),
 	  TAG_END());
 
-  if (!root || !url || 
+  if (!root || !url ||
       (url->url_type != url_http && url->url_type != url_https)
       || !(srv = su_home_new(sizeof(*srv)))) {
     ta_end(ta);
@@ -731,7 +731,7 @@
   tpn->tpn_host =  url->url_host;
   tpn->tpn_port = url_port(url);
 
-  srv->srv_tports = tport_tcreate(srv, nth_server_class, root, 
+  srv->srv_tports = tport_tcreate(srv, nth_server_class, root,
 				  TPTAG_IDLE(600000),
 				  TPTAG_TIMEOUT(300000),
 				  ta_tags(ta));
@@ -757,9 +757,9 @@
 		     TAG_END());
   }
   else {
-    SU_DEBUG_1(("nth_server_create: cannot bind transports " 
+    SU_DEBUG_1(("nth_server_create: cannot bind transports "
 		URL_FORMAT_STRING "\n",
-		URL_PRINT_ARGS(url))); 
+		URL_PRINT_ARGS(url)));
     server_destroy(srv), srv = NULL;
   }
 
@@ -843,7 +843,7 @@
   } else if (http && http->http_flags & MSG_FLG_TOOLARGE) {
     server_reply(srv, tport, request, response, HTTP_413_ENTITY_TOO_LARGE);
     return;
-  } else if (!http || !http->http_request || 
+  } else if (!http || !http->http_request ||
 	     (http->http_flags & MSG_FLG_ERROR)) {
     server_reply(srv, tport, request, response, HTTP_400_BAD_REQUEST);
     return;
@@ -933,7 +933,7 @@
 }
 
 /** Respond without creating a request structure */
-static void server_reply(server_t *srv, tport_t *tport, 
+static void server_reply(server_t *srv, tport_t *tport,
 			 msg_t *request, msg_t *response,
 			 int status, char const *phrase)
 {
@@ -947,23 +947,23 @@
     status = 500, phrase = http_500_internal_server;
 
   http = http_object(request);
-  
+
   if (http && http->http_request)
     req_version = http->http_request->rq_version;
 
-  close = status >= 200 && 
+  close = status >= 200 &&
     (!srv->srv_persistent
      || status == 400
-     || (http && http->http_request && 
+     || (http && http->http_request &&
 	 http->http_request->rq_version != http_version_1_1)
-     || (http && http->http_connection && 
+     || (http && http->http_connection &&
 	 msg_params_find(http->http_connection->k_items, "close")));
 
   msg_destroy(request);
 
   http = http_object(response);
 
-  pl = http_payload_format(msg_home(response), 
+  pl = http_payload_format(msg_home(response),
 			   "<html>\n"
 			   "<head><title>%u %s</title></head>\n"
 			   "<body><h2>%u %s</h2></body>\n"
@@ -976,7 +976,7 @@
     st->st_version = http_version_1_1;
     st->st_status = status;
     st->st_phrase = phrase;
-    
+
     http_add_tl(response, http,
 		HTTPTAG_STATUS(st),
 		HTTPTAG_SERVER(srv->srv_server),
@@ -992,8 +992,8 @@
     close = 1;
   }
 
-  if (tport_tqsend(tport, response, NULL, 
-		   TPTAG_CLOSE_AFTER(close), 
+  if (tport_tqsend(tport, response, NULL,
+		   TPTAG_CLOSE_AFTER(close),
 		   TAG_END()) == -1) {
     SU_DEBUG_3(("server_reply(): cannot queue response\n"));
     tport_shutdown(tport, 2);
@@ -1004,7 +1004,7 @@
 
 /** Create a new message for transport */
 static
-msg_t *server_msg_create(server_t *srv, int flags, 
+msg_t *server_msg_create(server_t *srv, int flags,
 			 char const data[], usize_t dlen,
 			 tport_t const *tp, tp_client_t *tpc)
 {
@@ -1014,7 +1014,7 @@
 }
 
 /* ----------------------------------------------------------------------
- * 6) Server transactions 
+ * 6) Server transactions
  */
 
 struct auth_info
@@ -1044,12 +1044,12 @@
   int status;
 
   req = su_zalloc(srv->srv_home, size);
-  
+
   if (req == NULL) {
     server_reply(srv, tport, request, response, HTTP_500_INTERNAL_SERVER);
     return;
   }
-  
+
   if (am)
     as = auth_status_init(req + 1, sizeof *as), ai = (void *)(as + 1);
   else
@@ -1066,27 +1066,27 @@
   req->req_response = response;
 
   req->req_status = 100;
-  req->req_close = 
+  req->req_close =
     !srv->srv_persistent
     || http->http_request->rq_version != http_version_1_1
-    || (http->http_connection && 
+    || (http->http_connection &&
 	msg_params_find(http->http_connection->k_items, "close"));
 
   if (am) {
-    static auth_challenger_t const http_server_challenger[] = 
+    static auth_challenger_t const http_server_challenger[] =
       {{ HTTP_401_UNAUTHORIZED, http_www_authenticate_class }};
 
     req->req_as = as;
 
     as->as_method = http->http_request->rq_method_name;
     as->as_uri = path;
-    
+
     if (http->http_payload) {
       as->as_body = http->http_payload->pl_data;
       as->as_bodylen = http->http_payload->pl_len;
     }
 
-    auth_mod_check_client(am, as, 
+    auth_mod_check_client(am, as,
 			  http->http_authorization,
 			  http_server_challenger);
 
@@ -1143,13 +1143,13 @@
 
   if (as->as_status != 0) {
     assert(as->as_status >= 300);
-    nth_request_treply(req, status = as->as_status, as->as_phrase, 
-		       HTTPTAG_HEADER((http_header_t *)as->as_response), 
+    nth_request_treply(req, status = as->as_status, as->as_phrase,
+		       HTTPTAG_HEADER((http_header_t *)as->as_response),
 		       TAG_END());
   }
   else {
     req->req_in_callback = 1;
-    status = ai->site->site_callback(ai->site->site_magic, 
+    status = ai->site->site_callback(ai->site->site_magic,
 				     ai->site,
 				     ai->req,
 				     ai->http,
@@ -1178,7 +1178,7 @@
 
   req->req_destroyed = 1;
 
-  if (req->req_in_callback) 
+  if (req->req_in_callback)
     return;
 
   if (req->req_as)
@@ -1193,7 +1193,7 @@
 /** Return request authentication status.
  *
  * @param req pointer to HTTP request object
- * 
+ *
  * @retval Status code
  *
  * @since New in @VERSION_1_12_4
@@ -1206,7 +1206,7 @@
 /** Return request authentication status.
  *
  * @param req pointer to HTTP request object
- * 
+ *
  * @retval Pointer to authentication status struct
  *
  * @note The authentication status struct is freed when the #nth_request_t
@@ -1236,8 +1236,8 @@
   return retval;
 }
 
-int nth_request_treply(nth_request_t *req, 
-		       int status, char const *phrase, 
+int nth_request_treply(nth_request_t *req,
+		       int status, char const *phrase,
 		       tag_type_t tag, tag_value_t value, ...)
 {
   msg_t *response, *next = NULL;
@@ -1261,14 +1261,14 @@
 
   http_add_tl(response, http,
 	      HTTPTAG_SERVER(req->req_server->srv_server),
-	      HTTPTAG_HEADER(as_info), 
+	      HTTPTAG_HEADER(as_info),
 	      ta_tags(ta));
 
   if (http->http_payload && !http->http_content_length) {
     http_content_length_t *l;
     http_payload_t *pl;
     size_t len = 0;
-    
+
     for (pl = http->http_payload; pl; pl = pl->pl_next)
       len += pl->pl_len;
 
@@ -1282,12 +1282,12 @@
 
   if (req->req_method == http_method_head && http->http_payload) {
     http_payload_t *pl;
-    
+
     for (pl = http->http_payload; pl; pl = pl->pl_next)
       msg_header_remove(response, (msg_pub_t *)http, (msg_header_t *)pl);
   }
 
-  http_complete_response(response, status, phrase, 
+  http_complete_response(response, status, phrase,
 			 http_object(req->req_request));
 
   if (!http->http_date) {
@@ -1303,9 +1303,9 @@
   else {
     req_close = req->req_close;
 
-    close = (http->http_connection && 
+    close = (http->http_connection &&
 	     msg_params_find(http->http_connection->k_items, "close"));
-    
+
     if (req_close && !close && status >= 200) {
       close = 1;
       http_add_tl(response, http, HTTPTAG_CONNECTION_STR("close"), TAG_END());
@@ -1314,13 +1314,13 @@
 
   msg_serialize(response, (msg_pub_t *)http);
 
-  retval = tport_tqsend(req->req_tport, response, next, 
+  retval = tport_tqsend(req->req_tport, response, next,
 			TAG_IF(close, TPTAG_CLOSE_AFTER(1)),
 			ta_tags(ta));
 
  fail:
   ta_end(ta);
-  
+
   if (retval == 0)
     req->req_status = status;
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/nth_tag.c	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 /**@CFILE nth_tag.c
  * @brief Tags for HTTP Transaction API
  *
- * @note This file is used to automatically generate 
+ * @note This file is used to automatically generate
  * nth_tag_ref.c and nth_tag_dll.c
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth.h	Tue Dec 23 07:37:03 2008
@@ -31,10 +31,10 @@
  */
 
 /* ----------------------------------------------------------------------
- * 1) Types 
+ * 1) Types
  */
 
-#ifndef NTH_H_TYPES 
+#ifndef NTH_H_TYPES
 #define NTH_H_TYPES
 
 /** NTH engine */
@@ -74,7 +74,7 @@
 #define NTH_H
 
 /* ----------------------------------------------------------------------
- * 2) Constants 
+ * 2) Constants
  */
 
 /** Version number */
@@ -108,11 +108,11 @@
 					tag_type_t tag, tag_value_t value, ...);
 NTH_DLL void nth_engine_destroy(nth_engine_t *engine);
 
-NTH_DLL int nth_engine_set_params(nth_engine_t *engine, 
+NTH_DLL int nth_engine_set_params(nth_engine_t *engine,
 				  tag_type_t tag, tag_value_t value, ...);
-NTH_DLL int nth_engine_get_params(nth_engine_t const *engine, 
+NTH_DLL int nth_engine_get_params(nth_engine_t const *engine,
 				  tag_type_t tag, tag_value_t value, ...);
-NTH_DLL int nth_engine_get_stats(nth_engine_t const *engine, 
+NTH_DLL int nth_engine_get_stats(nth_engine_t const *engine,
 				 tag_type_t tag, tag_value_t value, ...);
 
 NTH_DLL msg_t *nth_engine_msg_create(nth_engine_t *he, int flags);
@@ -147,15 +147,15 @@
  * 5) Server side prototypes
  */
 
-typedef int nth_request_f(nth_site_magic_t *lmagic, 
+typedef int nth_request_f(nth_site_magic_t *lmagic,
 			  nth_site_t *server,
-			  nth_request_t *req, 
+			  nth_request_t *req,
 			  http_t const *http,
 			  char const *path);
 
 char const *nth_site_server_version(void);
 
-NTH_DLL nth_site_t *nth_site_create(nth_site_t *parent,  
+NTH_DLL nth_site_t *nth_site_create(nth_site_t *parent,
 				    nth_request_f *req_callback,
 				    nth_site_magic_t *magic,
 				    url_string_t const *address,
@@ -166,13 +166,13 @@
 
 NTH_DLL nth_site_magic_t *nth_site_magic(nth_site_t const *site);
 
-NTH_DLL void nth_site_bind(nth_site_t *site, 
-			   nth_request_f *callback, 
+NTH_DLL void nth_site_bind(nth_site_t *site,
+			   nth_request_f *callback,
 			   nth_site_magic_t *);
 
 NTH_DLL su_time_t nth_site_access_time(nth_site_t const *site);
 
-NTH_DLL int nth_site_set_params(nth_site_t *site, 
+NTH_DLL int nth_site_set_params(nth_site_t *site,
 				tag_type_t tag, tag_value_t value, ...);
 NTH_DLL int nth_site_get_params(nth_site_t const *site,
 				tag_type_t tag, tag_value_t value, ...);
@@ -182,15 +182,15 @@
 NTH_DLL url_t const *nth_site_url(nth_site_t const *site);
 
 /* ----------------------------------------------------------------------
- * 6) Prototypes for server transactions 
+ * 6) Prototypes for server transactions
  */
 
 NTH_DLL int nth_request_status(nth_request_t const *req);
 NTH_DLL http_method_t nth_request_method(nth_request_t const *req);
 NTH_DLL msg_t *nth_request_message(nth_request_t *req);
 
-NTH_DLL int nth_request_treply(nth_request_t *ireq, 
-			       int status, char const *phrase, 
+NTH_DLL int nth_request_treply(nth_request_t *ireq,
+			       int status, char const *phrase,
 			       tag_type_t tag, tag_value_t value, ...);
 
 NTH_DLL void nth_request_destroy(nth_request_t *req);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth_tag.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth_tag.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth_tag.h	Tue Dec 23 07:37:03 2008
@@ -28,9 +28,9 @@
 
 /**@file sofia-sip/nth_tag.h
  * @brief Tags for @b nth, HTTP engine module.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- *  
+ *
  * @date Created: Sun Oct 13 22:23:48 2002 ppessi
  */
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/test_nth.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/test_nth.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nth/test_nth.c	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 /**@file test_nth.c
  * @brief Tests for nth module
- *  
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Oct 22 20:52:37 2002 ppessi
  */
 
@@ -85,7 +85,7 @@
 static int test_requests(tester_t *t);
 static int init_engine(tester_t *t);
 
-struct site 
+struct site
 {
   site_t       *s_next, *s_parent;
   tester_t     *s_tester;
@@ -125,9 +125,9 @@
   site_t       *t_master;
 };
 
-static int test_site(site_t *t, 
+static int test_site(site_t *t,
 		     nth_site_t *server,
-		     nth_request_t *req, 
+		     nth_request_t *req,
 		     http_t const *http,
 		     char const *path);
 
@@ -155,15 +155,15 @@
 
   ta_start(ta, tag, value);
 
-  s->s_tags = tl_adup(t->t_home, ta_args(ta)); 
+  s->s_tags = tl_adup(t->t_home, ta_args(ta));
   if (s->s_tags)
     s->s_ns = nth_site_create(pns, test_site, s,
-			      (url_string_t *)s->s_url, 
+			      (url_string_t *)s->s_url,
 			      NTHTAG_ROOT(t->t_root),
 			      ta_tags(ta));
 
   ta_end(ta);
-  
+
   if (s->s_ns == NULL)
     return NULL;
 
@@ -179,14 +179,14 @@
   BEGIN();
 
   t->t_root = su_root_create(t); TEST_1(t->t_root);
-  t->t_mclass = msg_mclass_clone(http_default_mclass(), 0, 0); 
+  t->t_mclass = msg_mclass_clone(http_default_mclass(), 0, 0);
   TEST_1(t->t_mclass);
 
   t->t_addr->su_len = (sizeof t->t_addr->su_sin);
   s = su_socket(t->t_addr->su_family = AF_INET, SOCK_STREAM, 0);
   TEST_1(s != INVALID_SOCKET);
   TEST_1(su_inet_pton(AF_INET, "127.0.0.1", &t->t_addr->su_sin.sin_addr) >= 0);
-  TEST_1(bind(s, &t->t_addr->su_sa, 
+  TEST_1(bind(s, &t->t_addr->su_sa,
 	      t->t_addrlen = (sizeof t->t_addr->su_sin)) != -1);
   TEST_1(getsockname(s, &t->t_addr->su_sa, &t->t_addrlen) != -1);
   TEST_1(t->t_addr->su_port != 0);
@@ -227,7 +227,7 @@
 
   BEGIN();
 
-  s = nth_engine_version(); 
+  s = nth_engine_version();
   TEST_1(s); TEST_1(strlen(s)); TEST_S(s, "sofia-http-client/" NTH_CLIENT_VERSION);
 
   TEST_1(nth_engine_create(NULL, TAG_END()) == NULL);
@@ -235,9 +235,9 @@
   TEST_VOID(nth_engine_destroy(NULL));
   TEST_1(nth_engine_get_params(NULL, TAG_END()) == -1);
   TEST_1(nth_engine_set_params(NULL, TAG_END()) == -1);
-  TEST_1(!nth_client_tcreate(NULL, NULL, NULL, 
-			     HTTP_METHOD_OPTIONS, 
-			     URL_STRING_MAKE("*"), 
+  TEST_1(!nth_client_tcreate(NULL, NULL, NULL,
+			     HTTP_METHOD_OPTIONS,
+			     URL_STRING_MAKE("*"),
 			     TAG_END()));
   TEST(nth_client_status(NULL), 400);
   TEST(nth_client_method(NULL), http_method_invalid);
@@ -247,7 +247,7 @@
   TEST_P(nth_client_response(NULL), NULL);
   TEST_VOID(nth_client_destroy(NULL));
 
-  t->t_engine = nth_engine_create(t->t_root, 
+  t->t_engine = nth_engine_create(t->t_root,
 				  NTHTAG_ERROR_MSG(2),
 				  NTHTAG_MCLASS(t->t_mclass),
 				  NTHTAG_MFLAGS(MSG_DO_CANONIC|MSG_DO_COMPACT),
@@ -255,7 +255,7 @@
 				  NTHTAG_PROXY("http://localhost:8888"),
 				  TAG_END());
   TEST_1(t->t_engine);
-  
+
   {
     int error_msg = -1;
     msg_mclass_t const *mclass = (void *)-1;
@@ -266,14 +266,14 @@
 
     char *proxy_str;
 
-    TEST(nth_engine_get_params(t->t_engine, 
+    TEST(nth_engine_get_params(t->t_engine,
 			       NTHTAG_ERROR_MSG_REF(error_msg),
 			       NTHTAG_MCLASS_REF(mclass),
 			       NTHTAG_MFLAGS_REF(mflags),
 			       NTHTAG_EXPIRES_REF(expires),
 			       NTHTAG_STREAMING_REF(streaming),
 			       NTHTAG_PROXY_REF(proxy),
-			       TAG_END()), 
+			       TAG_END()),
 	 6);
 
     TEST(error_msg, 1);
@@ -287,14 +287,14 @@
 
     proxy = URL_STRING_MAKE("http://127.0.0.1:80");
 
-    TEST(nth_engine_set_params(t->t_engine, 
+    TEST(nth_engine_set_params(t->t_engine,
 			       NTHTAG_ERROR_MSG(0),
 			       NTHTAG_MCLASS(http_default_mclass()),
 			       NTHTAG_MFLAGS(0),
 			       NTHTAG_EXPIRES(10000),
 			       NTHTAG_STREAMING(2),
 			       NTHTAG_PROXY(proxy),
-			       TAG_END()), 
+			       TAG_END()),
 	 6);
 
     error_msg = -1;
@@ -304,14 +304,14 @@
     streaming = -1;
     proxy = (void *)-1;
 
-    TEST(nth_engine_get_params(t->t_engine, 
+    TEST(nth_engine_get_params(t->t_engine,
 			       NTHTAG_ERROR_MSG_REF(error_msg),
 			       NTHTAG_MCLASS_REF(mclass),
 			       NTHTAG_MFLAGS_REF(mflags),
 			       NTHTAG_EXPIRES_REF(expires),
 			       NTHTAG_STREAMING_REF(streaming),
 			       NTHTAG_PROXY_REF(proxy),
-			       TAG_END()), 
+			       TAG_END()),
 	 6);
 
     TEST(error_msg, 0);
@@ -319,13 +319,13 @@
     TEST(mflags, 0);
     TEST(expires, 10000);
     TEST(streaming, 1);
-    TEST_1(proxy != NULL); 
+    TEST_1(proxy != NULL);
     TEST_1(proxy_str = url_as_string(t->t_home, proxy->us_url));
     TEST_S(proxy_str, "http://127.0.0.1:80");
   }
 
   TEST_1(nth_engine_get_stats(NULL, TAG_END()) == -1);
-  
+
   {
     msg_t *msg;
     http_t *http;
@@ -349,9 +349,9 @@
   END();
 }
 
-static int site_check_all(site_t *t, 
+static int site_check_all(site_t *t,
 			  nth_site_t *server,
-			  nth_request_t *req, 
+			  nth_request_t *req,
 			  http_t const *http,
 			  char const *path);
 
@@ -360,12 +360,12 @@
 {
   char const *v;
   site_t s[1];
-  
+
   BEGIN();
 
   memset(s, 0, sizeof s);
 
-  v = nth_site_server_version(); 
+  v = nth_site_server_version();
   TEST_1(v); TEST_1(strlen(v)); TEST_S(v, "nth/" NTH_SERVER_VERSION);
 
   /* Fails because no parent site, no root */
@@ -374,8 +374,8 @@
 			  TAG_END()));
 
   /* Fails because url specifies both host and path */
-  TEST_1(!nth_site_create(NULL, site_check_all, s, 
-			  URL_STRING_MAKE("http://127.0.0.1:8888/foo/"), 
+  TEST_1(!nth_site_create(NULL, site_check_all, s,
+			  URL_STRING_MAKE("http://127.0.0.1:8888/foo/"),
 			  NTHTAG_ROOT(t->t_root), TAG_END()));
 
   TEST_VOID(nth_site_destroy(NULL));
@@ -393,9 +393,9 @@
   END();
 }
 
-static int test_site(site_t *s, 
+static int test_site(site_t *s,
 		     nth_site_t *ns,
-		     nth_request_t *req, 
+		     nth_request_t *req,
 		     http_t const *http,
 		     char const *path)
 {
@@ -411,9 +411,9 @@
 }
 
 
-static int site_check_all(site_t *s, 
+static int site_check_all(site_t *s,
 			  nth_site_t *ns,
-			  nth_request_t *req, 
+			  nth_request_t *req,
 			  http_t const *http,
 			  char const *path)
 {
@@ -462,45 +462,45 @@
   auth_mod_t *am;
   int temp;
 
-  TEST_1(t->t_master = m = 
+  TEST_1(t->t_master = m =
 	 site_create(t, NULL,
-		     su_sprintf(t->t_home, "HTTP://127.0.0.1:%u", 
+		     su_sprintf(t->t_home, "HTTP://127.0.0.1:%u",
 				htons(t->t_addr->su_port)),
-		     HTTP_200_OK, 
+		     HTTP_200_OK,
 		     HTTPTAG_CONTENT_TYPE_STR("text/html"),
 		     HTTPTAG_PAYLOAD_STR("<html><body>Hello</body></html>\n"),
 		     TPTAG_CERTIFICATE(t->t_pem),
 		     TAG_END()));
 
   TEST_1(site_create(t, m, "/sub/sub",
-		     HTTP_200_OK, 
+		     HTTP_200_OK,
 		     HTTPTAG_CONTENT_TYPE_STR("text/html"),
 		     HTTPTAG_PAYLOAD_STR
 		     ("<html><body>sub/sub</body></html>\n"),
 		     TAG_END()));
 
   TEST_1(site_create(t, m, "/sub/",
-		     HTTP_200_OK, 
+		     HTTP_200_OK,
 		     HTTPTAG_CONTENT_TYPE_STR("text/html"),
 		     HTTPTAG_PAYLOAD_STR("<html><body>sub/</body></html>\n"),
 		     TAG_END()));
 
   TEST_1(site_create(t, m, "/sub/sub/",
-		     HTTP_200_OK, 
+		     HTTP_200_OK,
 		     HTTPTAG_CONTENT_TYPE_STR("text/html"),
 		     HTTPTAG_PAYLOAD_STR
 		     ("<html><body>sub/sub/</body></html>\n"),
 		     TAG_END()));
 
-  TEST_1(sub2 = 
+  TEST_1(sub2 =
 	 site_create(t, m, "/sub2/",
-		     HTTP_200_OK, 
+		     HTTP_200_OK,
 		     HTTPTAG_CONTENT_TYPE_STR("text/html"),
 		     HTTPTAG_PAYLOAD_STR("<html><body>sub2/</body></html>\n"),
 		     TAG_END()));
 
   TEST_1(site_create(t, sub2, "sub/",
-		     HTTP_200_OK, 
+		     HTTP_200_OK,
 		     HTTPTAG_CONTENT_TYPE_STR("text/html"),
 		     HTTPTAG_PAYLOAD_STR
 		     ("<html><body>sub2/sub/</body></html>\n"),
@@ -519,15 +519,15 @@
 
   TEST_1(close(temp) == 0);
 
-  am = auth_mod_create(t->t_root, 
-		       AUTHTAG_METHOD("Digest"), 
+  am = auth_mod_create(t->t_root,
+		       AUTHTAG_METHOD("Digest"),
 		       AUTHTAG_REALM("auth"),
 		       AUTHTAG_DB(passwd_name),
 		       TAG_END());
   TEST_1(am);
 
   TEST_1(site_create(t, m, "auth/",
-		     HTTP_200_OK, 
+		     HTTP_200_OK,
 		     HTTPTAG_CONTENT_TYPE_STR("text/html"),
 		     HTTPTAG_PAYLOAD_STR
 		     ("<html><body>auth/</body></html>\n"),
@@ -537,15 +537,15 @@
   auth_mod_unref(am);
 
 
-  am = auth_mod_create(t->t_root, 
-		       AUTHTAG_METHOD("Delayed+Basic"), 
+  am = auth_mod_create(t->t_root,
+		       AUTHTAG_METHOD("Delayed+Basic"),
 		       AUTHTAG_REALM("auth2"),
 		       AUTHTAG_DB(passwd_name),
 		       TAG_END());
   TEST_1(am);
 
   TEST_1(site_create(t, m, "auth2/",
-		     HTTP_200_OK, 
+		     HTTP_200_OK,
 		     HTTPTAG_CONTENT_TYPE_STR("text/html"),
 		     HTTPTAG_PAYLOAD_STR
 		     ("<html><body>auth/</body></html>\n"),
@@ -604,12 +604,12 @@
   END();
 }
 
-int sspace(char const *buffer) 
+int sspace(char const *buffer)
 {
-  int m = strcspn(buffer, " "); 
+  int m = strcspn(buffer, " ");
 
-  if (buffer[m]) 
-    m += 1 + strcspn(buffer + m + 1, " "); 
+  if (buffer[m])
+    m += 1 + strcspn(buffer + m + 1, " ");
 
   return m;
 }
@@ -624,7 +624,7 @@
   BEGIN();
 
   {
-    static char const get[] = 
+    static char const get[] =
       "GET / HTTP/1.1" CRLF
       "Host: 127.0.0.1" CRLF
       "User-Agent: Test-Tool" CRLF
@@ -638,7 +638,7 @@
   }
 
   {
-    static char const get[] = 
+    static char const get[] =
       "GET / HTTP/1.1" CRLF
       "Host: 127.0.0.1" CRLF
       "User-Agent: Test-Tool" CRLF
@@ -652,7 +652,7 @@
   }
 
   {
-    static char const request[] = 
+    static char const request[] =
       "GET %s HTTP/1.1" CRLF
       "Host: 127.0.0.1" CRLF
       "User-Agent: Test-Tool" CRLF
@@ -724,7 +724,7 @@
   }
 
   {
-    static char const get[] = 
+    static char const get[] =
       "GET /auth2/ HTTP/1.1" CRLF
       "Host: 127.0.0.1" CRLF
       "User-Agent: Test-Tool" CRLF
@@ -739,7 +739,7 @@
   }
 
   {
-    static char const kuik[] = 
+    static char const kuik[] =
       "kuik" CRLF CRLF;
 
     TEST(send_request(t, kuik, -1, 0, buffer, sizeof(buffer), &m), 0);
@@ -748,7 +748,7 @@
   }
 
   {
-    static char const kuik[] = 
+    static char const kuik[] =
       "POST / HTTP/1.1" CRLF
       "Host: 127.0.0.1" CRLF
       "Content-Length: 4294967296" CRLF
@@ -760,7 +760,7 @@
   }
 
   {
-    static char const get[] = 
+    static char const get[] =
       "GET / HTTP/10.10" CRLF
       "Host: 127.0.0.1" CRLF
       "User-Agent: Test-Tool" CRLF
@@ -774,7 +774,7 @@
   }
 
   {
-    static char const get[] = 
+    static char const get[] =
       "GET /" CRLF;
 
     TEST(send_request(t, get, -1, 1, buffer, sizeof(buffer) - 1, &m), 0);
@@ -785,7 +785,7 @@
 
   if (0)
   {
-    static char const post[] = 
+    static char const post[] =
       "POST /foo HTTP/1.1" CRLF
       "Host: 127.0.0.1" CRLF
       "User-Agent: Test-Tool" CRLF
@@ -816,20 +816,20 @@
   BEGIN();
   su_socket_t s;
 
-  t->t_engine = nth_engine_create(t->t_root, 
+  t->t_engine = nth_engine_create(t->t_root,
 				  NTHTAG_STREAMING(0),
 				  TAG_END());
   TEST_1(t->t_engine);
 
   t->t_sink = s = su_socket(AF_INET, SOCK_STREAM, 0); TEST_1(s != -1);
-  TEST(bind(s, &t->t_sinkaddr->su_sa, 
+  TEST(bind(s, &t->t_sinkaddr->su_sa,
 	    t->t_sinkaddrlen = (sizeof t->t_sinkaddr->su_sin)),
        0);
   TEST_1(getsockname(s, &t->t_sinkaddr->su_sa, &t->t_sinkaddrlen) != -1);
   TEST(listen(t->t_sink, 5), 0);
-  
+
   TEST_1(t->t_sinkuri = (url_string_t *)
-	 su_sprintf(t->t_home, "HTTP://127.0.0.1:%u", 
+	 su_sprintf(t->t_home, "HTTP://127.0.0.1:%u",
 		    htons(t->t_sinkaddr->su_port)));
 
   END();
@@ -883,7 +883,7 @@
   while (client->c_status == 0) su_root_step(t->t_root, 1);
   TEST(client->c_status, 408);
   nth_client_destroy(hc);
-	 
+
   END();
 }
 #if HAVE_ALARM
@@ -956,7 +956,7 @@
   retval |= init_engine(t);
   retval |= test_client(t);
   retval |= deinit_test(t);
- 
+
   su_deinit();
 
   return retval;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -16,7 +16,7 @@
 
 	* Fixed call state events with UPDATE in nua.
 
-	Fixed the order the nua_i_update and nua_i_state events are sent. 
+	Fixed the order the nua_i_update and nua_i_state events are sent.
 	Now we are using session-timer headers in responses, too.
 
 	* Added NUTAG_ALLOW() and NUTAG_ALLOW_REF() to nua.
@@ -67,7 +67,7 @@
 
   * Fixed response to 401.
   We are now not terminating call when application is expected to authenticate
-  request. Should we add 
+  request. Should we add
 
     M ./libsofia-sip-ua/nua/nua_stack.c -10 +28
 
@@ -208,7 +208,7 @@
 
 2005-10-10  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
-  * Fixed basic call test run. 
+  * Fixed basic call test run.
 
     M ./libsofia-sip-ua/nua/test_nua.c -8 +11
 
@@ -217,7 +217,7 @@
     M ./libsofia-sip-ua/nua/nua_common.c -1 +1
     M ./libsofia-sip-ua/nua/nua_stack.c -1 +1
     M ./libsofia-sip-ua/nua/test_nua.c -2 +2
-	
+
   * Running a basic call test case.
 
     M ./libsofia-sip-ua/nua/test_nua.c -24 +109
@@ -259,11 +259,11 @@
 
     M ./libsofia-sip-ua/nua/nua.docs -1 +355
 
-  * Used picture-mode here. 
+  * Used picture-mode here.
 
     M ./libsofia-sip-ua/nua/nua.docs -227 +227
 
-  * Fixed nua_set_hparams() documentation. 
+  * Fixed nua_set_hparams() documentation.
 
     M ./libsofia-sip-ua/nua/nua.c -1 +1
 
@@ -444,7 +444,7 @@
   * Do not pass soa handle to application.
 
     M ./libsofia-sip-ua/nua/nua_stack.c -3 +3
-	
+
 2005-09-23  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* nua_stack.c: Fix delivering nua_i_active.
@@ -457,7 +457,7 @@
 
 	* nua_tag.h: Removed NUTAG_MEDIA_SUBSYSTEM.
 
-	* nua.h: Added nua_i_state_change event. Removed 
+	* nua.h: Added nua_i_state_change event. Removed
 	nua_i_media_update (replaced by nua_i_state_change).
 
 2005-09-21  Kai Vehmanen  <kai.vehmanen at nokia.com>
@@ -466,15 +466,15 @@
 	code related to old media subsystem interface (HAVE_MSS).
 	Added nua_i_media_update event. Removed code related
 	to ring-tone generation (HAVE_HERBIE).
-	
+
 2005-09-20  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* nua.h, nua.c: Removed implementation for obsolete media
-	param functions. Added dummy implementations that print 
+	param functions. Added dummy implementations that print
 	a warning to users of the removed interfaces.
 
 	* nua_stack.c: Removed obsolete media param code.
-	
+
 2005-07-18  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* Initial import of the module to Sofia-SIP tree.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/check_register.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/check_register.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/check_register.c	Tue Dec 23 07:37:03 2008
@@ -265,6 +265,10 @@
   m = s2_wait_for_request(SIP_METHOD_REGISTER);
   fail_if(!m);
   fail_if(!m->sip->sip_authorization);
+  /* should not unregister the previous contact
+   * as it has not been successfully registered */
+  fail_if(!m->sip->sip_contact);
+  fail_if(m->sip->sip_contact->m_next);
   s2_save_register(m);
 
   s2_respond_to(m, NULL,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c	Tue Dec 23 07:37:03 2008
@@ -326,7 +326,7 @@
   fail_unless(s2_check_callstate(nua_callstate_terminated));
 }
 
-static void 
+static void
 bye_by_nua_challenged(nua_handle_t *nh,
 		      tag_type_t tag, tag_value_t value, ...)
 {
@@ -358,7 +358,7 @@
 }
 
 
-static void 
+static void
 cancel_by_nua(nua_handle_t *nh,
 	      struct message *invite,
 	      struct dialog *dialog,
@@ -383,7 +383,7 @@
   fail_unless(s2_check_event(nua_r_invite, 487));
 }
 
-static void 
+static void
 bye_to_nua(nua_handle_t *nh,
 	   tag_type_t tag, tag_value_t value, ...)
 {
@@ -1077,6 +1077,71 @@
 }
 END_TEST
 
+START_TEST(call_2_3_3)
+{
+  nua_handle_t *nh;
+  struct message *response;
+
+  s2_case("2.3.3", "Handling re-INVITE without SDP gracefully",
+	  "NUA receives INVITE, "
+	  "re-INVITE without SDP (w/o NUTAG_REFRESH_WITHOUT_SDP(), "
+	  "re-INVITE without SDP (using NUTAG_REFRESH_WITHOUT_SDP(), "
+	  "sends BYE.");
+
+  nh = invite_to_nua(
+    TAG_END());
+
+  s2_request_to(dialog, SIP_METHOD_INVITE, NULL,
+		SIPTAG_USER_AGENT_STR("evil (evil) evil"),
+		TAG_END());
+
+  nua_respond(nh, SIP_200_OK, TAG_END());
+
+  fail_unless(s2_check_callstate(nua_callstate_completed));
+
+  response = s2_wait_for_response(200, SIP_METHOD_INVITE);
+
+  fail_if(!response);
+  s2_update_dialog(dialog, response);
+  fail_if(!response->sip->sip_content_type);
+  s2_free_message(response);
+
+  fail_if(s2_request_to(dialog, SIP_METHOD_ACK, NULL, TAG_END()));
+
+  fail_unless(s2_check_event(nua_i_ack, 200));
+  fail_unless(s2_check_callstate(nua_callstate_ready));
+
+  s2_fast_forward(10);
+
+  nua_set_hparams(nh, NUTAG_REFRESH_WITHOUT_SDP(1), TAG_END());
+  fail_unless(s2_check_event(nua_r_set_params, 200));
+
+  s2_request_to(dialog, SIP_METHOD_INVITE, NULL,
+		SIPTAG_USER_AGENT_STR("evil (evil) evil"),
+		TAG_END());
+
+  nua_respond(nh, SIP_200_OK, TAG_END());
+
+  fail_unless(s2_check_callstate(nua_callstate_completed));
+
+  response = s2_wait_for_response(200, SIP_METHOD_INVITE);
+
+  fail_if(!response);
+  s2_update_dialog(dialog, response);
+  fail_if(response->sip->sip_content_type);
+  s2_free_message(response);
+
+  fail_if(s2_request_to(dialog, SIP_METHOD_ACK, NULL, TAG_END()));
+
+  fail_unless(s2_check_event(nua_i_ack, 200));
+  fail_unless(s2_check_callstate(nua_callstate_ready));
+
+  bye_by_nua(nh, TAG_END());
+
+  nua_handle_destroy(nh);
+}
+END_TEST
+
 
 TCase *session_timer_tcase(void)
 {
@@ -1085,6 +1150,7 @@
   {
     tcase_add_test(tc, call_2_3_1);
     tcase_add_test(tc, call_2_3_2);
+    tcase_add_test(tc, call_2_3_3);
   }
   return tc;
 }
@@ -1498,7 +1564,7 @@
 
   invite = s2_wait_for_request(SIP_METHOD_INVITE);
   fail_if(!invite);
-  respond_with_sdp(invite, dialog, SIP_500_INTERNAL_SERVER_ERROR, 
+  respond_with_sdp(invite, dialog, SIP_500_INTERNAL_SERVER_ERROR,
 		   SIPTAG_RETRY_AFTER_STR("8"),
 		   TAG_END());
   s2_free_message(invite);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua.c	Tue Dec 23 07:37:03 2008
@@ -99,14 +99,14 @@
  *   (but see also NUTAG_INITIAL_ROUTE()).
  * - NUTAG_URL() (and NUTAG_SIPS_URL(), listing URIs describing
  *   transports)
- * - NUTAG_CERTIFICATE_DIR(), specifying the location of the 
+ * - NUTAG_CERTIFICATE_DIR(), specifying the location of the
  *   root and client/server certificate files
- * - NUTAG_SIP_PARSER(), providing customized parser used to 
+ * - 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. 
+ *   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

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua.docs	Tue Dec 23 07:37:03 2008
@@ -338,7 +338,7 @@
 that uses services of NUA. The example is not complete but should present
 all relevant details of the basic use of NUA.
 
-On sourceforge.net there is available an example application 
+On sourceforge.net there is available an example application
 <a href="http://sourceforge.net/project/showfiles.php?group_id=143636&package_id=179933">
 sofisip_cli.c</a> that can be studied for more complete example.
 
@@ -591,7 +591,7 @@
           NUTAG_CALLSTATE_REF(state),
           NUTAG__REF(state),
 
-  
+
     state = (nua_callstate_t)t->t_value;
 
   printf("call %s\n", nua_callstate_name(state));
@@ -935,7 +935,7 @@
 SOATAG_ACTIVE_VIDEO() are informational tags used to indicate what is the
 status of these media.
 
-The #nua_i_state event is not sent, however, if the change is invoked by 
+The #nua_i_state event is not sent, however, if the change is invoked by
 application calling API functions like nua_bye() and there is no change in
 SDP offer/answer status.
 
@@ -2089,7 +2089,7 @@
  * #nua_r_unregister  \n
  * #nua_r_unsubscribe \n
  * #nua_r_update
- * 
+ *
  * @sa nua_event_is_incoming_request(), nua_event_name()
  */
 
@@ -2175,7 +2175,7 @@
  * @param tags   empty
  *
  * @since Experimental in @VERSION_1_12_2.
- * 
+ *
  * @END_NUA_EVENT
  */
 
@@ -2276,7 +2276,7 @@
  * @param hmagic operation magic associated with the notifier
  * @param sip    NULL
  * @param tags   empty
- * 
+ *
  * @sa nua_terminate(), nua_handle_destroy()
  *
  * @END_NUA_EVENT

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c	Tue Dec 23 07:37:03 2008
@@ -23,12 +23,12 @@
  */
 
 /**@CFILE nua_common.c
- * @brief Function common to both stack and application side.  
- * 
+ * @brief Function common to both stack and application side.
+ *
  * @author Pekka.Pessi at nokia.com
- * 
+ *
  * @date Created: Tue Apr 26 13:23:17 2005 ppessi
- * 
+ *
  */
 
 #include "config.h"
@@ -76,7 +76,7 @@
 static void nh_destructor(void *arg);
 
 /**@internal
- * Create an operation handle 
+ * Create an operation handle
  *
  * Allocates a new operation handle and associated storage.
  *
@@ -88,7 +88,7 @@
  * @retval NULL    Creation failed
  *
  * @par Related tags:
- *     Creates a copy of the provided tags which will 
+ *     Creates a copy of the provided tags which will
  *     be used with every operation.
  *
  * @par Events:
@@ -120,7 +120,7 @@
 		  (void *)nua, (void *)nh));
       su_home_unref(nh->nh_home), nh = NULL;
     }
-    
+
     if (nh && su_home_is_threadsafe(nua->nua_home)) {
       if (su_home_threadsafe(nh->nh_home) < 0) {
 	su_home_unref(nh->nh_home);
@@ -128,13 +128,13 @@
       }
     }
 
-    if (nh && _handle_lifetime) {      
+    if (nh && _handle_lifetime) {
       /* This far, we have nothing real to destruct but
-       * when _NUA_HANDLE_DEBUG is set, we add destructor 
+       * when _NUA_HANDLE_DEBUG is set, we add destructor
        * and get more entertaining debugging output */
       if (_handle_lifetime == 1 && !getenv("_NUA_HANDLE_DEBUG")) {
 	_handle_lifetime = 0;
-      } 
+      }
       else {
 	_handle_lifetime = 2;
 	SU_DEBUG_0(("nh_handle_create(%p)\n", (void *)nh));
@@ -222,7 +222,7 @@
   return (nua_handle_t *)su_home_ref(nh->nh_home);
 }
 
-/** Destroy reference to handle. 
+/** Destroy reference to handle.
  *
  * The handles use reference counting for memory management. In addition to
  * the memory management, there is protocol state associated with the
@@ -301,7 +301,7 @@
   }
 }
 
-/** Get name for a NUA event. 
+/** Get name for a NUA event.
  *
  * @sa #nua_event_e, #nua_event_t, nua_callstate_name(), nua_substate_name()
  */
@@ -374,7 +374,7 @@
 }
 
 /** Return name of call state.
- * 
+ *
  * @sa enum #nua_callstate, nua_event_name(), nua_substate_name()
  */
 char const *nua_callstate_name(enum nua_callstate state)
@@ -395,7 +395,7 @@
   }
 }
 
-/** Return name of subscription state. @NEW_1_12_5. 
+/** Return name of subscription state. @NEW_1_12_5.
  *
  * @sa enum #nua_substate, nua_event_name(), nua_callstate_name()
  */
@@ -424,7 +424,7 @@
     return nua_substate_terminated;
   else if (strcasecmp(sip_substate, "pending") == 0)
     return nua_substate_pending;
-  else /* if (strcasecmp(sip_substate, "active") == 0) */ 
+  else /* if (strcasecmp(sip_substate, "active") == 0) */
     return nua_substate_active;
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c	Tue Dec 23 07:37:03 2008
@@ -59,7 +59,7 @@
 /* ======================================================================== */
 /* Dialog handling */
 
-static void nua_dialog_usage_remove_at(nua_owner_t*, nua_dialog_state_t*, 
+static void nua_dialog_usage_remove_at(nua_owner_t*, nua_dialog_state_t*,
 				       nua_dialog_usage_t**,
 				       nua_client_request_t *cr,
 				       nua_server_request_t *sr);
@@ -75,9 +75,9 @@
  * @param sip  SIP message containing response used to update dialog
  * @param rtag if true, set remote tag within the leg
  */
-void nua_dialog_uas_route(nua_owner_t *own, 
+void nua_dialog_uas_route(nua_owner_t *own,
 			  nua_dialog_state_t *ds,
-			  sip_t const *sip, 
+			  sip_t const *sip,
 			  int rtag)
 {
   int established = nua_dialog_is_established(ds);
@@ -105,7 +105,7 @@
  * @param sip  SIP message containing response used to update dialog
  * @param rtag if true, set remote tag within the leg
  */
-void nua_dialog_uac_route(nua_owner_t *own, 
+void nua_dialog_uac_route(nua_owner_t *own,
 			  nua_dialog_state_t *ds,
 			  sip_t const *sip,
 			  int rtag)
@@ -126,7 +126,7 @@
 }
 
 /**@internal Store information from remote endpoint. */
-void nua_dialog_store_peer_info(nua_owner_t *own, 
+void nua_dialog_store_peer_info(nua_owner_t *own,
 				nua_dialog_state_t *ds,
 				sip_t const *sip)
 {
@@ -190,7 +190,7 @@
 		   nua_dialog_state_t *ds)
 {
   /* zap peer info */
-  nua_dialog_store_peer_info(own, ds, NULL); 
+  nua_dialog_store_peer_info(own, ds, NULL);
   /* Local Contact */
   msg_header_free(own, (msg_header_t *)ds->ds_ltarget), ds->ds_ltarget = NULL;
   /* Leg */
@@ -216,7 +216,7 @@
 
 /** @internal Get dialog usage slot. */
 nua_dialog_usage_t **
-nua_dialog_usage_at(nua_dialog_state_t const *ds, 
+nua_dialog_usage_at(nua_dialog_state_t const *ds,
 		    nua_usage_class const *kind,
 		    sip_event_t const *event)
 {
@@ -257,7 +257,7 @@
 }
 
 /** @internal Get a dialog usage */
-nua_dialog_usage_t *nua_dialog_usage_get(nua_dialog_state_t const *ds, 
+nua_dialog_usage_t *nua_dialog_usage_get(nua_dialog_state_t const *ds,
 					 nua_usage_class const *kind,
 					 sip_event_t const *event)
 {
@@ -270,11 +270,11 @@
   if (du == NULL)
     return "<NULL>";
   return du->du_class->usage_name(du);
-} 
+}
 
 /** @internal Add dialog usage */
-nua_dialog_usage_t *nua_dialog_usage_add(nua_owner_t *own, 
-					 struct nua_dialog_state *ds, 
+nua_dialog_usage_t *nua_dialog_usage_add(nua_owner_t *own,
+					 struct nua_dialog_state *ds,
 					 nua_usage_class const *uclass,
 					 sip_event_t const *event)
 {
@@ -286,9 +286,9 @@
     du = *prev_du;
     if (du) {		/* Already exists */
       SU_DEBUG_5(("nua(%p): adding already existing %s usage%s%s\n",
-		  (void *)own, nua_dialog_usage_name(du), 
+		  (void *)own, nua_dialog_usage_name(du),
 		  event ? "  with event " : "", event ? event->o_type : ""));
-      
+
       if (prev_du != &ds->ds_usage) {
 	/* Move as a first usage in the list */
 	*prev_du = du->du_next;
@@ -305,7 +305,7 @@
 
     if (du) {
       su_home_ref(own);
-      du->du_dialog = ds; 
+      du->du_dialog = ds;
       du->du_class = uclass;
       du->du_event = o;
 
@@ -314,9 +314,9 @@
 	su_free(own, du);
 	return NULL;
       }
-	
+
       SU_DEBUG_5(("nua(%p): adding %s usage%s%s\n",
-		  (void *)own, nua_dialog_usage_name(du), 
+		  (void *)own, nua_dialog_usage_name(du),
 		  o ? " with event " : "", o ? o->o_type :""));
 
       du->du_next = ds->ds_usage, ds->ds_usage = du;
@@ -331,7 +331,7 @@
 }
 
 /** @internal Remove dialog usage. */
-void nua_dialog_usage_remove(nua_owner_t *own, 
+void nua_dialog_usage_remove(nua_owner_t *own,
 			     nua_dialog_state_t *ds,
 			     nua_dialog_usage_t *du,
 			     nua_client_request_t *cr,
@@ -350,9 +350,9 @@
   nua_dialog_usage_remove_at(own, ds, at, cr, sr);
 }
 
-/** @internal Remove dialog usage. 
+/** @internal Remove dialog usage.
  *
- * Zap dialog state (leg, tag and route) if no usages remain. 
+ * Zap dialog state (leg, tag and route) if no usages remain.
 */
 static void
 nua_dialog_usage_remove_at(nua_owner_t *own,
@@ -372,7 +372,7 @@
     o = du->du_event;
 
     SU_DEBUG_5(("nua(%p): removing %s usage%s%s\n",
-		(void *)own, nua_dialog_usage_name(du), 
+		(void *)own, nua_dialog_usage_name(du),
 		o ? " with event " : "", o ? o->o_type :""));
     du->du_class->usage_remove(own, ds, du, cr0, sr0);
 
@@ -423,7 +423,7 @@
     char buffer[160];
     size_t l = 0, N = sizeof buffer;
     ssize_t n;
-    
+
     buffer[0] = '\0';
 
     for (du = ds->ds_usage; du; du = du->du_next) {
@@ -441,9 +441,9 @@
 	l += 2;
       }
     }
-    
+
     SU_DEBUG_3(("nua(%p): handle with %s%s%s\n", (void *)own,
-		ds->ds_has_session ? "session and " : "", 
+		ds->ds_has_session ? "session and " : "",
 		ds->ds_has_events ? "events " : "",
 		buffer));
   }
@@ -486,7 +486,7 @@
 }
 
 /**@internal
- * Set refresh value suitably. 
+ * Set refresh value suitably.
  *
  * The refresh time is set either around half of the @a delta interval or,
  * if @a delta is less than 5 minutes but longer than 90 seconds, 30..60
@@ -512,7 +512,7 @@
 }
 
 /**@internal Set refresh in range min..max seconds in the future. */
-void nua_dialog_usage_set_refresh_range(nua_dialog_usage_t *du, 
+void nua_dialog_usage_set_refresh_range(nua_dialog_usage_t *du,
 					unsigned min, unsigned max)
 {
   sip_time_t now = sip_now(), target;
@@ -546,7 +546,7 @@
   SU_DEBUG_7(("nua(): refresh %s after %lu seconds\n",
 	      nua_dialog_usage_name(du), target - sip_now()));
   du->du_refresh = target;
-} 
+}
 
 /**@internal Do not refresh. */
 void nua_dialog_usage_reset_refresh(nua_dialog_usage_t *du)
@@ -560,7 +560,7 @@
 /** @internal Refresh usage. */
 void nua_dialog_usage_refresh(nua_owner_t *owner,
 			      nua_dialog_state_t *ds,
-			      nua_dialog_usage_t *du, 
+			      nua_dialog_usage_t *du,
 			      sip_time_t now)
 {
   assert(du && du->du_class->usage_refresh);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h	Tue Dec 23 07:37:03 2008
@@ -26,7 +26,7 @@
 /** Defined when <nua_dialog.h> has been included. */
 #define NUA_DIALOG_H
 
-/**@IFILE nua_dialog.h 
+/**@IFILE nua_dialog.h
  * @brief Dialog and dialog usage handling
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -42,7 +42,7 @@
 #endif
 
 typedef struct {
-  sip_method_t sm_method; 
+  sip_method_t sm_method;
   char const *sm_method_name;
 
   int sm_event;
@@ -80,7 +80,7 @@
   nua_dialog_usage_t *sr_usage;	/**< Backpointer to usage */
 
   nta_incoming_t *sr_irq;	/**< Server transaction object */
-  
+
   struct {
     msg_t *msg;			/**< Request message */
     sip_t const *sip;		/**< Headers in request message */
@@ -116,6 +116,7 @@
 
   unsigned sr_offer_sent:2;	/**< We have offered SDP (reliably, if >1) */
   unsigned sr_answer_recv:1;	/**< We have received SDP answer */
+
   unsigned :0;
 
   char const *sr_sdp;		/**< SDP received from client */
@@ -133,7 +134,7 @@
 
 #define SR_HAS_SAVED_SIGNAL(sr) ((sr)->sr_signal[0] != NULL)
 
-su_inline 
+su_inline
 int sr_status(nua_server_request_t *sr, int status, char const *phrase)
 {
   return (void)(sr->sr_phrase = phrase), (sr->sr_status = status);
@@ -160,7 +161,7 @@
 		      msg_t **return_msg,
 		      tagi_t const *tags);
 
-  /**@a crm_init is called when a client request is sent first time. 
+  /**@a crm_init is called when a client request is sent first time.
    *
    * @retval 1 when request has been responded
    * @retval 0 when request should be sent in normal fashion
@@ -278,9 +279,9 @@
   uint32_t            cr_seq;
 
   unsigned            cr_refs;	 /**< References to client request */
-  
+
   /* Flags used with offer-answer */
-  unsigned short      cr_answer_recv;   /**< Recv answer in response 
+  unsigned short      cr_answer_recv;   /**< Recv answer in response
 					 *  with this status.
 					 */
   unsigned cr_offer_sent:1;	/**< Sent offer in this request */
@@ -305,7 +306,7 @@
   unsigned cr_restarting:1;	/**< Request is being restarted */
   unsigned cr_reporting:1;	/**< Reporting in progress */
   unsigned cr_terminating:1;	/**< Request terminates the usage */
-  signed int cr_terminated:2;	/**< Response terminated usage (1) or 
+  signed int cr_terminated:2;	/**< Response terminated usage (1) or
 				    whole dialog (-1) */
   unsigned cr_graceful:1;	/**< Graceful termination required */
 };
@@ -347,11 +348,11 @@
   sip_to_t const *ds_remote;		/**< Remote address */
   nta_leg_t      *ds_leg;
   sip_contact_t  *ds_ltarget;	        /**< Local target */
-  char const     *ds_remote_tag;	/**< Remote tag (if any). 
-					 * Should be non-NULL 
+  char const     *ds_remote_tag;	/**< Remote tag (if any).
+					 * Should be non-NULL
 					 * if dialog is established.
 					 */
-  
+
   struct nua_dialog_peer_info {
     sip_allow_t      *nr_allow;
     sip_accept_t     *nr_accept;
@@ -364,10 +365,10 @@
 /* Virtual function pointer table for dialog usage. */
 typedef struct {
   unsigned usage_size, usage_class_size;
-  int (*usage_add)(nua_owner_t *, 
+  int (*usage_add)(nua_owner_t *,
 		   nua_dialog_state_t *ds,
 		   nua_dialog_usage_t *du);
-  void (*usage_remove)(nua_owner_t *, 
+  void (*usage_remove)(nua_owner_t *,
 		       nua_dialog_state_t *ds,
 		       nua_dialog_usage_t *du,
 		       nua_client_request_t *cr,
@@ -382,7 +383,7 @@
 			  sip_t const *sip);
   void (*usage_refresh)(nua_owner_t *, nua_dialog_state_t *ds,
 			nua_dialog_usage_t *, sip_time_t now);
-  int (*usage_shutdown)(nua_owner_t *, nua_dialog_state_t *ds, 
+  int (*usage_shutdown)(nua_owner_t *, nua_dialog_state_t *ds,
 			nua_dialog_usage_t *);
 } nua_usage_class;
 
@@ -428,16 +429,16 @@
 
 char const *nua_dialog_usage_name(nua_dialog_usage_t const *du);
 
-nua_dialog_usage_t *nua_dialog_usage_add(nua_owner_t *, 
+nua_dialog_usage_t *nua_dialog_usage_add(nua_owner_t *,
 					 struct nua_dialog_state *ds,
 					 nua_usage_class const *uclass,
 					 sip_event_t const *event);
 
-nua_dialog_usage_t *nua_dialog_usage_get(nua_dialog_state_t const *ds, 
+nua_dialog_usage_t *nua_dialog_usage_get(nua_dialog_state_t const *ds,
 					 nua_usage_class const *uclass,
 					 sip_event_t const *event);
 
-void nua_dialog_usage_remove(nua_owner_t *, 
+void nua_dialog_usage_remove(nua_owner_t *,
 			     nua_dialog_state_t *ds,
 			     nua_dialog_usage_t *du,
 			     nua_client_request_t *cr,
@@ -463,17 +464,17 @@
 
 void nua_dialog_usage_set_refresh(nua_dialog_usage_t *du, unsigned delta);
 
-void nua_dialog_usage_set_refresh_range(nua_dialog_usage_t *du, 
+void nua_dialog_usage_set_refresh_range(nua_dialog_usage_t *du,
 					unsigned min, unsigned max);
 
-void nua_dialog_usage_set_refresh_at(nua_dialog_usage_t *du, 
+void nua_dialog_usage_set_refresh_at(nua_dialog_usage_t *du,
 				     sip_time_t target);
 
 void nua_dialog_usage_reset_refresh(nua_dialog_usage_t *du);
 
 void nua_dialog_usage_refresh(nua_owner_t *owner,
 			      nua_dialog_state_t *ds,
-			      nua_dialog_usage_t *du, 
+			      nua_dialog_usage_t *du,
 			      sip_time_t now);
 
 int nua_dialog_usage_shutdown(nua_owner_t *owner,
@@ -513,12 +514,12 @@
 		      nua_client_methods_t const *methods,
 		      tagi_t const *tags);
 
-int nua_client_tcreate(nua_owner_t *nh, 
+int nua_client_tcreate(nua_owner_t *nh,
 		       int event,
 		       nua_client_methods_t const *methods,
 		       tag_type_t tag, tag_value_t value, ...);
 
-su_inline 
+su_inline
 void *nua_private_client_request(nua_client_request_t const *cr)
 {
   return (void *)(cr + 1);
@@ -654,14 +655,14 @@
   nua_refer_server_methods,	/**< REFER */
   nua_publish_server_methods;	/**< PUBLISH */
 
-/** Return true if we have not sent final response to request */ 
-su_inline 
+/** Return true if we have not sent final response to request */
+su_inline
 int nua_server_request_is_pending(nua_server_request_t const *sr)
 {
   return sr && sr->sr_response.msg;
 }
 
-su_inline 
+su_inline
 int nua_server_request_status(nua_server_request_t const *sr)
 {
   return sr ? nta_incoming_status(sr->sr_irq) : 500;
@@ -694,7 +695,7 @@
 
 int nua_server_report(nua_server_request_t *sr);
 
-int nua_base_server_treport(nua_server_request_t *sr, 
+int nua_base_server_treport(nua_server_request_t *sr,
 			    tag_type_t tag, tag_value_t value, ...);
 int nua_base_server_report(nua_server_request_t *sr, tagi_t const *tags);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c	Tue Dec 23 07:37:03 2008
@@ -54,8 +54,8 @@
 /* Event server */
 
 static
-nea_event_t *nh_notifier_event(nua_handle_t *nh, 
-			       su_home_t *home, 
+nea_event_t *nh_notifier_event(nua_handle_t *nh,
+			       su_home_t *home,
 			       sip_event_t const *event,
 			       tagi_t const *tags);
 
@@ -81,8 +81,8 @@
 
   nua_stack_init_handle(nua, nh, tags);
 
-  tl_gets(tags, 
-	  NUTAG_URL_REF(url), 
+  tl_gets(tags,
+	  NUTAG_URL_REF(url),
 	  SIPTAG_EVENT_REF(event),
 	  SIPTAG_EVENT_STR_REF(event_s),
 	  SIPTAG_CONTENT_TYPE_STR_REF(ct_s),
@@ -93,16 +93,16 @@
   if (!event && !event_s)
     status = 400, phrase = "Missing Event";
 
-  else if (!ct && !ct_s) 
+  else if (!ct && !ct_s)
     status = 400, phrase = "Missing Content-Type";
 
   else if (!nh->nh_notifier &&
-	   !(nh->nh_notifier = 
+	   !(nh->nh_notifier =
 	     nea_server_create(nua->nua_nta, nua->nua_root,
 			       url->us_url,
-			       NH_PGET(nh, max_subscriptions), 
+			       NH_PGET(nh, max_subscriptions),
 			       NULL, nh,
-			       TAG_NEXT(tags)))) 
+			       TAG_NEXT(tags))))
     status = 900, phrase = nua_internal_error;
 
   else if (!event && !(event = sip_event_make(home, event_s)))
@@ -117,12 +117,12 @@
   else if (nea_server_notify(nh->nh_notifier, ev) < 0)
     status = 900, phrase = "Error when notifying watchers";
 
-  else 
-    nua_stack_tevent(nua, nh, NULL, e, status = SIP_200_OK, 
+  else
+    nua_stack_tevent(nua, nh, NULL, e, status = SIP_200_OK,
 		     SIPTAG_EVENT(event),
 		     SIPTAG_CONTENT_TYPE(ct),
 		     TAG_END());
-	     
+
   if (status != 200)
     nua_stack_event(nua, nh, NULL, e, status, phrase, NULL);
 
@@ -132,8 +132,8 @@
 
 /* Create a event view for notifier */
 static
-nea_event_t *nh_notifier_event(nua_handle_t *nh, 
-			       su_home_t *home, 
+nea_event_t *nh_notifier_event(nua_handle_t *nh,
+			       su_home_t *home,
 			       sip_event_t const *event,
 			       tagi_t const *tags)
 {
@@ -150,13 +150,13 @@
     if (o_subtype)
       *o_subtype++ = '\0';
 
-    tl_gets(tags, 
+    tl_gets(tags,
 	    SIPTAG_ACCEPT_REF(accept),
 	    SIPTAG_ACCEPT_STR_REF(accept_s),
 	    SIPTAG_CONTENT_TYPE_REF(ct),
 	    SIPTAG_CONTENT_TYPE_STR_REF(ct_s),
 	    TAG_END());
-      
+
     /*
      * XXX - We really should build accept header when we add new content
      * types
@@ -168,7 +168,7 @@
     if (accept_s == NULL && ct_s)
       accept_s = ct_s;
 
-    ev = nea_event_create(nh->nh_notifier, 
+    ev = nea_event_create(nh->nh_notifier,
 			  authorize_watcher, nh,
 			  o_type, o_subtype,
 			  ct ? ct->c_type : ct_s,
@@ -196,8 +196,8 @@
 
   /* OK. In nhp (nua_handle_preferences_t) structure we have the
      current default action (or state) for incoming
-     subscriptions. 
-     Action can now be modified by the application with NUTAG_SUBSTATE(). 
+     subscriptions.
+     Action can now be modified by the application with NUTAG_SUBSTATE().
   */
   irq = nea_sub_get_request(sn->sn_subscriber);
   msg = nta_incoming_getrequest(irq);
@@ -220,7 +220,7 @@
       what = "active";
     }
 
-    SU_DEBUG_7(("nua(%p): authorize_watcher: %s\n", (void *)nh, what)); 
+    SU_DEBUG_7(("nua(%p): authorize_watcher: %s\n", (void *)nh, what));
     nea_sub_auth(sn->sn_subscriber, substate,
 		 TAG_IF(substate == nua_substate_pending,
 			NEATAG_FAKE(1)),
@@ -231,8 +231,8 @@
   else if (sn->sn_state == nea_terminated || sn->sn_expires == 0) {
     substate = nua_substate_terminated;
     nea_server_flush(nes, NULL);
-    SU_DEBUG_7(("nua(%p): authorize_watcher: %s\n", 
-		(void *)nh, "watcher is removed")); 
+    SU_DEBUG_7(("nua(%p): authorize_watcher: %s\n",
+		(void *)nh, "watcher is removed"));
   }
 
   nua_stack_tevent(nua, nh, msg, nua_i_subscription, status, phrase,
@@ -269,7 +269,7 @@
 /** @internal Shutdown notifier object */
 int nh_notifier_shutdown(nua_handle_t *nh,
 			 nea_event_t *ev,
-			 tag_type_t t, 
+			 tag_type_t t,
 			 tag_value_t v, ...)
 {
   nea_server_t *nes = nh->nh_notifier;
@@ -286,17 +286,17 @@
     ta_list ta;
 
     ta_start(ta, t, v);
-    
+
     for (i = 0; subs[i]; i++)
       nea_sub_auth(subs[i]->sn_subscriber, nea_terminated, ta_tags(ta));
-    
+
     ta_end(ta);
 
     busy++;
   }
 
   nea_server_free_subscribers(nes, subs);
-  
+
   nea_server_flush(nh->nh_notifier, NULL);
 
   if (ev == NULL)
@@ -323,7 +323,7 @@
     return;
   }
 
-  tl_gets(tags, 
+  tl_gets(tags,
 	  SIPTAG_EVENT_REF(event),
 	  SIPTAG_EVENT_STR_REF(event_s),
 	  SIPTAG_CONTENT_TYPE_REF(ct),
@@ -332,15 +332,15 @@
 	  SIPTAG_PAYLOAD_STR_REF(pl_s),
 	  TAG_END());
 
-  nev = nea_event_get(nh->nh_notifier, 
+  nev = nea_event_get(nh->nh_notifier,
 		      event ? event->o_type : event_s);
 
   if (nev && (pl || pl_s) && (ct || ct_s)) {
     nea_server_update(nh->nh_notifier, nev, TAG_NEXT(tags));
   }
 
-  nh_notifier_shutdown(nh, NULL, 
-		       NEATAG_REASON("noresource"), 
+  nh_notifier_shutdown(nh, NULL,
+		       NEATAG_REASON("noresource"),
 		       TAG_NEXT(tags));
 
   nua_stack_event(nua, nh, NULL, e, SIP_200_OK, NULL);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_extension.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_extension.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_extension.c	Tue Dec 23 07:37:03 2008
@@ -45,7 +45,7 @@
 
 #include "nua_stack.h"
 
-/**Send a request message with an extension method. 
+/**Send a request message with an extension method.
  *
  * Send a request message with the request method specified with
  * NUTAG_METHOD().
@@ -53,7 +53,7 @@
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * Note that it is possible to send a request with any method (except
@@ -91,9 +91,9 @@
   NULL,				/* crm_complete */
 };
 
-int 
+int
 nua_stack_method(nua_t *nua, nua_handle_t *nh, nua_event_t e, tagi_t const *tags)
-{ 
+{
   return nua_client_create(nh, e, &nua_method_client_methods, tags);
 }
 
@@ -109,7 +109,7 @@
  * @param nh     operation handle associated with the method
  * @param hmagic application context associated with the handle
  * @param sip    response to the extension request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive method in @a phrase parameters)
  * @param tags   empty
  *
@@ -148,11 +148,11 @@
  * @END_NUA_EVENT
  */
 
-nua_server_methods_t const nua_extension_server_methods = 
+nua_server_methods_t const nua_extension_server_methods =
   {
     SIP_METHOD_UNKNOWN,
     nua_i_method,		/* Event */
-    { 
+    {
       1,			/* Do create dialog */
       0,			/* Can be an initial request */
       1,			/* Perhaps a target refresh request? */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_message.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_message.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_message.c	Tue Dec 23 07:37:03 2008
@@ -51,14 +51,14 @@
 /**@fn void nua_message( \
  *       nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
  *
- * Send an instant message. 
+ * Send an instant message.
  *
  * Send an instant message using SIP MESSAGE method.
  *
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -72,7 +72,7 @@
  * @sa #nua_i_message, @RFC3428
  */
 
-static int nua_message_client_init(nua_client_request_t *cr, 
+static int nua_message_client_init(nua_client_request_t *cr,
 				   msg_t *, sip_t *,
 				   tagi_t const *tags);
 
@@ -95,16 +95,16 @@
 
 };
 
-int 
+int
 nua_stack_message(nua_t *nua,
 		  nua_handle_t *nh,
 		  nua_event_t e,
 		  tagi_t const *tags)
-{ 
+{
   return nua_client_create(nh, e, &nua_message_client_methods, tags);
 }
 
-static int nua_message_client_init(nua_client_request_t *cr, 
+static int nua_message_client_init(nua_client_request_t *cr,
 				   msg_t *msg, sip_t *sip,
 				   tagi_t const *tags)
 {
@@ -125,7 +125,7 @@
  * @param nh     operation handle associated with the message
  * @param hmagic application context associated with the handle
  * @param sip    response to MESSAGE request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
@@ -159,11 +159,11 @@
 int nua_message_server_init(nua_server_request_t *sr);
 int nua_message_server_params(nua_server_request_t *, tagi_t const *);
 
-nua_server_methods_t const nua_message_server_methods = 
+nua_server_methods_t const nua_message_server_methods =
   {
     SIP_METHOD_MESSAGE,
     nua_i_message,		/* Event */
-    { 
+    {
       0,			/* Do not create dialog */
       0,			/* Can be initial request */
       0,			/* Perhaps a target refresh request? */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c	Tue Dec 23 07:37:03 2008
@@ -70,10 +70,10 @@
 };
 
 static char const *nua_notify_usage_name(nua_dialog_usage_t const *du);
-static int nua_notify_usage_add(nua_handle_t *nh, 
+static int nua_notify_usage_add(nua_handle_t *nh,
 				   nua_dialog_state_t *ds,
 				   nua_dialog_usage_t *du);
-static void nua_notify_usage_remove(nua_handle_t *nh, 
+static void nua_notify_usage_remove(nua_handle_t *nh,
 				    nua_dialog_state_t *ds,
 				    nua_dialog_usage_t *du,
 				    nua_client_request_t *cr,
@@ -103,8 +103,8 @@
   return "notify";
 }
 
-static 
-int nua_notify_usage_add(nua_handle_t *nh, 
+static
+int nua_notify_usage_add(nua_handle_t *nh,
 			 nua_dialog_state_t *ds,
 			 nua_dialog_usage_t *du)
 {
@@ -113,15 +113,15 @@
   return 0;
 }
 
-static 
-void nua_notify_usage_remove(nua_handle_t *nh, 
+static
+void nua_notify_usage_remove(nua_handle_t *nh,
 			     nua_dialog_state_t *ds,
 			     nua_dialog_usage_t *du,
 			     nua_client_request_t *cr,
 			     nua_server_request_t *sr)
 {
-  ds->ds_has_events--;	
-  ds->ds_has_notifys--;	
+  ds->ds_has_events--;
+  ds->ds_has_notifys--;
 }
 
 /* ====================================================================== */
@@ -173,14 +173,14 @@
  * subscriber terminates the subscription, it times out or the application
  * terminates the usage with nua_notify() call containing the tag
  * NUTAG_SUBSTATE(nua_substate_terminated) or @SubscriptionState header with
- * state "terminated" and/or expiration time 0. 
+ * state "terminated" and/or expiration time 0.
  *
  * When the subscriber terminates the subscription, the application is
  * notified of an termination by a #nua_i_subscribe event with
  * NUTAG_SUBSTATE(nua_substate_terminated) tag. When the subscription times
  * out, nua automatically initiates a NOTIFY transaction. When it is
  * terminated, the application is sent a #nua_r_notify event with
- * NUTAG_SUBSTATE(nua_substate_terminated) tag. 
+ * NUTAG_SUBSTATE(nua_substate_terminated) tag.
  *
  * @sa @RFC3265, nua_notify(), NUTAG_SUBSTATE(), @SubscriptionState,
  * @Event, nua_subscribe(), #nua_r_subscribe, #nua_i_refer, nua_refer()
@@ -193,11 +193,11 @@
 static int nua_subscribe_server_respond(nua_server_request_t*, tagi_t const *);
 static int nua_subscribe_server_report(nua_server_request_t*, tagi_t const *);
 
-nua_server_methods_t const nua_subscribe_server_methods = 
+nua_server_methods_t const nua_subscribe_server_methods =
   {
     SIP_METHOD_SUBSCRIBE,
     nua_i_subscribe,		/* Event */
-    { 
+    {
       1,			/* Create dialog */
       0,			/* Initial request */
       1,			/* Target refresh request  */
@@ -218,7 +218,7 @@
   sip_t const *sip = sr->sr_request.sip;
   sip_event_t *o = sip->sip_event;
   char const *event = o ? o->o_type : NULL;
-  
+
   if (sr->sr_initial || !nua_dialog_usage_get(ds, nua_notify_usage, o)) {
     if (event && str0cmp(event, "refer") == 0)
       /* refer event subscription should be initiated with REFER */
@@ -246,7 +246,7 @@
   sip_time_t now = sip_now();
 
   assert(nh && nh->nh_nua->nua_dhandle != nh);
-  
+
   du = nua_dialog_usage_get(ds, nua_notify_usage, o);
 
   if (du == NULL) {
@@ -271,7 +271,7 @@
     nu->nu_requested = SIP_TIME_MAX - 1;
 
 #if SU_HAVE_EXPERIMENTAL
-  nu->nu_etags = 
+  nu->nu_etags =
     sip_suppress_body_if_match(sip) ||
     sip_suppress_notify_if_match(sip) ||
     sip_has_feature(sr->sr_request.sip->sip_supported, "etags");
@@ -294,7 +294,7 @@
   sip_t *sip = sr->sr_response.sip;
 
   if (200 <= sr->sr_status && sr->sr_status < 300) {
-    sip_expires_t ex[1]; 
+    sip_expires_t ex[1];
 
     sip_expires_init(ex);
 
@@ -304,7 +304,7 @@
       if (nu->nu_requested) {
 	if (sip->sip_expires) {
 	  /* Expires in response can only shorten the expiration time */
-	  if (nu->nu_requested > now + sip->sip_expires->ex_delta) 
+	  if (nu->nu_requested > now + sip->sip_expires->ex_delta)
 	    nu->nu_requested = now + sip->sip_expires->ex_delta;
 	}
 	else {
@@ -357,14 +357,14 @@
     sip_t const *sip = sr->sr_request.sip;
     sip_suppress_notify_if_match_t *snim = sip_suppress_notify_if_match(sip);
     sip_suppress_body_if_match_t *sbim = sip_suppress_body_if_match(sip);
-    
+
     if (!nu->nu_tag)
       notify = 1;
     else if (snim && !strcasecmp(snim->snim_tag, nu->nu_tag))
       notify = 0;
     else if (sbim && !strcasecmp(snim->snim_tag, nu->nu_tag))
       notify = 1, nu->nu_no_body = 1;
-    else 
+    else
 #endif
       notify = 1;
 
@@ -375,12 +375,12 @@
 
   if (retval >= 2 || du == NULL)
     return retval;
-  
+
   if (notify) {
     /* Send NOTIFY (and terminate subscription, when needed) */
     nua_dialog_usage_refresh(nh, ds, du, sip_now());
   }
-  
+
   return retval;
 }
 
@@ -399,7 +399,7 @@
  *
  * @bug If the @Event is not given by application, stack uses the @Event
  * header from the first subscription usage on handle.
- * 
+ *
  * If there is no active <i>notifier dialog usage</i> or no notifier dialog
  * usage matches the @Event header given by the application the nua_notify()
  * request is rejected locally by the stack with status code 481. The local
@@ -413,7 +413,7 @@
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -428,7 +428,7 @@
  * @sa @RFC3265, #nua_i_subscribe, #nua_i_refer, NUTAG_ALLOW_EVENTS()
  */
 
-static int nua_notify_client_init(nua_client_request_t *cr, 
+static int nua_notify_client_init(nua_client_request_t *cr,
 				  msg_t *, sip_t *,
 				  tagi_t const *tags);
 static int nua_notify_client_init_etag(nua_client_request_t *cr,
@@ -480,7 +480,7 @@
   sip_event_t const *o = sip->sip_event;
   sip_subscription_state_t *ss = sip->sip_subscription_state;
   sip_time_t now = sip_now();
-    
+
   if (o == NULL && nh->nh_ds->ds_has_notifys == 1)
     o = NONE;
 
@@ -519,7 +519,7 @@
       /* We can change the lifetime of unsolicited subscription at will */
       if (nu->nu_requested == 0)
 	nu->nu_expires = nu->nu_requested = now + expires;
-      /* Notifier can only shorten the subscribed time */ 
+      /* Notifier can only shorten the subscribed time */
       else if (nu->nu_requested >= now + expires)
 	nu->nu_expires = nu->nu_requested = now + expires;
     }
@@ -617,7 +617,7 @@
 
     sip_suppress_body_if_match_t *sbim;
     sip_suppress_notify_if_match_t *snim;
-    
+
     if (cr->cr_usage->du_ready) {
       snim = sip_suppress_notify_if_match(sip);
 
@@ -643,7 +643,7 @@
 			      msg_t *msg, sip_t *sip,
 			      tagi_t const *tags)
 {
-  nua_dialog_usage_t *du = cr->cr_usage; 
+  nua_dialog_usage_t *du = cr->cr_usage;
   struct notifier_usage *nu = nua_dialog_usage_private(du);
   su_home_t *home = msg_home(msg);
   sip_time_t now = sip_now();
@@ -674,7 +674,7 @@
     if (nu->nu_substate == nua_substate_terminated)
       expires = nu->nu_expires > now ? "noresource" : "timeout";
 
-    ss = sip_subscription_state_format(home, "%s;%s", 
+    ss = sip_subscription_state_format(home, "%s;%s",
 				       nua_substate_name(nu->nu_substate),
 				       expires);
 
@@ -737,8 +737,8 @@
  * @param phrase a short textual description of @a status code
  * @param nh     operation handle associated with the subscription
  * @param hmagic application context associated with the handle
- * @param sip    response to @b NOTIFY request or NULL upon an error 
- *               (status code is in @a status and 
+ * @param sip    response to @b NOTIFY request or NULL upon an error
+ *               (status code is in @a status and
  *               descriptive message in @a phrase parameters)
  * @param tags   NUTAG_SUBSTATE() indicating subscription state
  *               SIPTAG_EVENT() indicating subscription event
@@ -762,7 +762,7 @@
   if (nu && !cr->cr_terminated)
     substate = nu->nu_substate;
 
-  nua_stack_tevent(nh->nh_nua, nh, 
+  nua_stack_tevent(nh->nh_nua, nh,
 		   nta_outgoing_getresponse(orq),
 		   cr->cr_event,
 		   status, phrase,
@@ -816,7 +816,7 @@
   nua_dialog_usage_remove(nh, ds, du, NULL, NULL);
 }
 
-/** @interal Shut down NOTIFY usage. 
+/** @interal Shut down NOTIFY usage.
  *
  * @retval >0  shutdown done
  * @retval 0   shutdown in progress
@@ -836,8 +836,8 @@
       return 0;
   }
   else {
-    if (nua_client_tcreate(nh, nua_r_notify, 
-			   &nua_notify_client_methods, 
+    if (nua_client_tcreate(nh, nua_r_notify,
+			   &nua_notify_client_methods,
 			   SIPTAG_EVENT(du->du_event),
 			   NUTAG_SUBSTATE(nua_substate_terminated),
 			   TAG_END()) >= 0)
@@ -857,11 +857,11 @@
 static int nua_refer_server_respond(nua_server_request_t*, tagi_t const *);
 static int nua_refer_server_report(nua_server_request_t*, tagi_t const *);
 
-nua_server_methods_t const nua_refer_server_methods = 
+nua_server_methods_t const nua_refer_server_methods =
   {
     SIP_METHOD_REFER,
     nua_i_refer,		/* Event */
-    { 
+    {
       1,			/* Create dialog */
       0,			/* Initial request */
       1,			/* Target refresh request  */
@@ -914,7 +914,7 @@
 
   if (sr->sr_status < 200 || nu == NULL) {
   }
-  else if (sr->sr_status < 300 && 
+  else if (sr->sr_status < 300 &&
 	   /* Application included Refer-Sub: false in response */
 	   (rs == NULL || str0casecmp("false", rs->rs_value))) {
     sr->sr_usage->du_ready = 1;
@@ -942,7 +942,7 @@
  * REFER. The @ReferredBy structure contained in the tag is constructed from
  * the @From header if the @ReferredBy header was not present in the REFER
  * request.
- * 
+ *
  * The application can let the nua to send NOTIFYs from the call it
  * initiates with nua_invite() if it includes in the nua_invite() arguments
  * both the NUTAG_NOTIFY_REFER() with the handle with which nua_i_refer was
@@ -956,8 +956,8 @@
  * @param sip    incoming REFER request
  * @param tags   NUTAG_REFER_EVENT() \n
  *               SIPTAG_REFERRED_BY()
- *  
- * @sa nua_refer(), #nua_r_refer, @ReferTo, NUTAG_REFER_EVENT(), 
+ *
+ * @sa nua_refer(), #nua_r_refer, @ReferTo, NUTAG_REFER_EVENT(),
  * SIPTAG_REFERRED_BY(), @ReferredBy, NUTAG_NOTIFY_REFER(),
  * NUTAG_REFER_WITH_ID(), @RFC3515.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_options.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_options.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_options.c	Tue Dec 23 07:37:03 2008
@@ -54,7 +54,7 @@
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -78,7 +78,7 @@
  * @param nh     operation handle associated with the incoming OPTIONS request
  * @param hmagic application context associated with the handle
  * @param sip    response to OPTIONS request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
@@ -109,6 +109,6 @@
 		      nua_handle_t *nh,
 		      nua_event_t e,
 		      tagi_t const *tags)
-{ 
+{
   return nua_client_create(nh, e, &nua_options_client_methods, tags);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c	Tue Dec 23 07:37:03 2008
@@ -84,7 +84,7 @@
   a->nhp_set_.set_unsigned[1] |= b->nhp_set_.set_unsigned[1];
 }
 
-static int nhp_set_tags(su_home_t *home, 
+static int nhp_set_tags(su_home_t *home,
 			nua_handle_preferences_t *nhp,
 			nua_global_preferences_t *ngp,
 			tagi_t const *tags);
@@ -127,7 +127,7 @@
 "MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE";
 
 /** @internal Set default parameters */
-int nua_stack_set_defaults(nua_handle_t *nh, 
+int nua_stack_set_defaults(nua_handle_t *nh,
 			   nua_handle_preferences_t *nhp)
 {
   su_home_t *home = (su_home_t *)nh;
@@ -222,7 +222,7 @@
     sip_contact_t const *m;
 
     m = nua_stack_get_contact(nua->nua_registrations);
-    
+
     if (m) {
       f0->a_display = m->m_display;
       *f0->a_url = *m->m_url;
@@ -233,7 +233,7 @@
 
   if (!f)
     return -1;
-  
+
   nua->nua_from_is_set = set;
   *nua->nua_from = *f;
   return 0;
@@ -269,7 +269,7 @@
  *
  * @par Related tags:
  *   NUTAG_ALLOW(), SIPTAG_ALLOW(), and SIPTAG_ALLOW_STR() \n
- *   NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and 
+ *   NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and
  *                         SIPTAG_ALLOW_EVENTS_STR() \n
  *   NUTAG_AUTOACK() \n
  *   NUTAG_AUTOALERT() \n
@@ -301,6 +301,7 @@
  *   NUTAG_PROXY() (aka NTATAG_DEFAULT_PROXY()) \n
  *   NUTAG_REFER_EXPIRES() \n
  *   NUTAG_REFER_WITH_ID() \n
+ *   NUTAG_REFRESH_WITHOUT_SDP() \n
  *   NUTAG_REGISTRAR() \n
  *   NUTAG_RETRY_COUNT() \n
  *   NUTAG_SERVICE_ROUTE_ENABLE() \n
@@ -323,7 +324,7 @@
  *
  * nua_set_params() also accepts any soa tags, defined in
  * <sofia-sip/soa_tag.h>, and nta tags, defined in <sofia-sip/nta_tag.h>.
- * 
+ *
  * @par Events:
  *     #nua_r_set_params
  *
@@ -335,7 +336,7 @@
  * @par
  * When multiple tags for the same header are specified, the behaviour
  * depends on the header type. If only a single header field can be included
- * in a SIP message, the latest non-NULL value is used, e.g., @Organization. 
+ * in a SIP message, the latest non-NULL value is used, e.g., @Organization.
  * However, if the SIP header can consist of multiple lines or header fields
  * separated by comma, in this case, @Allow and @Supported, all the tagged
  * values are concatenated.
@@ -390,7 +391,7 @@
  *
  * @par Tags Used to Set Handle-Specific Parameters:
  *   NUTAG_ALLOW(), SIPTAG_ALLOW(), and SIPTAG_ALLOW_STR() \n
- *   NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and 
+ *   NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and
  *                         SIPTAG_ALLOW_EVENTS_STR() \n
  *   NUTAG_AUTH_CACHE() \n
  *   NUTAG_AUTOACK() \n
@@ -422,6 +423,7 @@
  *   NUTAG_PROXY() (aka NTATAG_DEFAULT_PROXY()) \n
  *   NUTAG_REFER_EXPIRES() \n
  *   NUTAG_REFER_WITH_ID() \n
+ *   NUTAG_REFRESH_WITHOUT_SDP() \n
  *   NUTAG_REGISTRAR() \n
  *   NUTAG_RETRY_COUNT() \n
  *   NUTAG_SERVICE_ROUTE_ENABLE() \n
@@ -437,9 +439,9 @@
  * Any soa tags are also considered as handle-specific parameters. They are
  * defined in <sofia-sip/soa_tag.h>.
  *
- * The global parameters that can not be set by nua_set_hparams() include 
+ * The global parameters that can not be set by nua_set_hparams() include
  * NUTAG_DETECT_NETWORK_UPDATES(), NUTAG_SMIME_* tags, and all NTA tags.
- * 
+ *
  * @par Events:
  *     #nua_r_set_params
  */
@@ -453,12 +455,12 @@
  * @param nh     NULL when responding to nua_set_params(),
  *               operation handle when responding to nua_set_hparams()
  * @param hmagic NULL when responding to nua_set_params(),
- *               application contact associated with the operation handle 
+ *               application contact associated with the operation handle
  *               when responding to nua_set_hparams()
  * @param sip    NULL
  * @param tags   None
  *
- * @sa nua_set_params(), nua_set_hparams(), 
+ * @sa nua_set_params(), nua_set_hparams(),
  * #nua_r_get_params, nua_get_params(), nua_get_hparams()
  *
  * @END_NUA_EVENT
@@ -468,7 +470,7 @@
 			 tagi_t const *tags)
 {
   nua_handle_t *dnh = nua->nua_dhandle;
-  
+
   int status;
   char const *phrase;
 
@@ -486,8 +488,8 @@
     *tmp = *nhp; NHP_UNSET_ALL(tmp);
 
     /*
-     * Supported features, allowed methods and events are merged 
-     * with previous or default settings. 
+     * Supported features, allowed methods and events are merged
+     * with previous or default settings.
      *
      * Here we just copy pointers from default settings. However when saving
      * settings we have to be extra careful so that we
@@ -495,20 +497,20 @@
      * 2) do not free pointer if the setting has been modified
      * See NHP_ZAP_OVERRIDEN() below for gorier details.
      */
-    if (!NHP_ISSET(nhp, supported)) 
+    if (!NHP_ISSET(nhp, supported))
       tmp->nhp_supported = dnhp->nhp_supported;
-    if (!NHP_ISSET(nhp, allow)) 
+    if (!NHP_ISSET(nhp, allow))
       tmp->nhp_allow = dnhp->nhp_allow;
-    if (!NHP_ISSET(nhp, allow_events)) 
+    if (!NHP_ISSET(nhp, allow_events))
       tmp->nhp_allow_events = dnhp->nhp_allow_events;
-    if (!NHP_ISSET(nhp, appl_method)) 
+    if (!NHP_ISSET(nhp, appl_method))
       tmp->nhp_appl_method = dnhp->nhp_appl_method;
-    
+
     if (nh == dnh) /* nua_set_params() call, save stack-wide params, too */
       ngp = gtmp, *gtmp = *nua->nua_prefs;
 
     /* Set and save parameters to tmp */
-    if (!nh->nh_used_ptags && 
+    if (!nh->nh_used_ptags &&
 	nhp_set_tags(tmphome, tmp, NULL, nh->nh_ptags) < 0)
       status = 900, phrase = "Error storing default handle parameters";
     else if (nhp_set_tags(tmphome, tmp, ngp, tags) < 0)
@@ -531,9 +533,9 @@
 
       if (dnh->nh_soa)
 	nh->nh_soa = soa_clone(dnh->nh_soa, nua->nua_root, nh);
-      else  
+      else
 	nh->nh_soa = soa_create(soa_name, nua->nua_root, nh);
-      
+
       if (!nh->nh_soa)
 	status = 900, phrase = "Error Creating SOA Object";
       else if (soa_set_params(nh->nh_soa, TAG_NEXT(nh->nh_ptags)) < 0)
@@ -544,8 +546,8 @@
       soa_destroy(nh->nh_soa), nh->nh_soa = NULL;
     }
 
-    if (status == 200 && tags && nh->nh_soa &&	
-	soa_set_params(nh->nh_soa, TAG_NEXT(tags)) < 0) 
+    if (status == 200 && tags && nh->nh_soa &&
+	soa_set_params(nh->nh_soa, TAG_NEXT(tags)) < 0)
       status = 900, phrase = "Error Setting SOA Parameters";
   }
 
@@ -598,7 +600,7 @@
  * @param ngp  structure to store global preferences
  * @param tags list of tags to parse
  */
-static int nhp_set_tags(su_home_t *home, 
+static int nhp_set_tags(su_home_t *home,
 			nua_handle_preferences_t *nhp,
 			nua_global_preferences_t *ngp,
 			tagi_t const *tags)
@@ -770,6 +772,10 @@
     else if (tag == nutag_update_refresh) {
       NHP_SET(nhp, update_refresh, value != 0);
     }
+    /* NUTAG_REFRESH_WITHOUT_SDP(refresh_without_sdp) */
+    else if (tag == nutag_refresh_without_sdp) {
+      NHP_SET(nhp, refresh_without_sdp, value != 0);
+    }
     /* NUTAG_ENABLEMESSAGE(message_enable) */
     else if (tag == nutag_enablemessage) {
       NHP_SET(nhp, message_enable, value != 0);
@@ -828,12 +834,12 @@
     /* SIPTAG_SUPPORTED_STR(supported_str) */
     /* SIPTAG_SUPPORTED(supported) */
     else if (tag == nutag_supported ||
-	     tag == siptag_supported || 
+	     tag == siptag_supported ||
 	     tag == siptag_supported_str) {
       int ok;
       sip_supported_t *supported = NULL;
 
-      ok = nhp_merge_lists(home, 
+      ok = nhp_merge_lists(home,
 			   sip_supported_class, &supported, nhp->nhp_supported,
 			   NHP_ISSET(nhp, supported), /* already set by tags */
 			   tag == siptag_supported, /* dup it, don't make */
@@ -853,7 +859,7 @@
       int ok;
       msg_list_t *allow = NULL;
 
-      ok = nhp_merge_lists(home, 
+      ok = nhp_merge_lists(home,
 			   sip_allow_class,
 			   &allow,
 			   (msg_list_t const *)nhp->nhp_allow,
@@ -875,9 +881,9 @@
       int ok;
       sip_allow_events_t *allow_events = NULL;
 
-      ok = nhp_merge_lists(home, 
+      ok = nhp_merge_lists(home,
 			   sip_allow_events_class,
-			   &allow_events, 
+			   &allow_events,
 			   nhp->nhp_allow_events,
 			   NHP_ISSET(nhp, allow_events), /* already set */
 			   tag == siptag_allow_events, /* dup it, don't make */
@@ -902,7 +908,7 @@
 			     &appl_method,
 			     (msg_list_t const *)nhp->nhp_appl_method,
 			     /* already set by tags? */
-			     NHP_ISSET(nhp, appl_method), 
+			     NHP_ISSET(nhp, appl_method),
 			     0, /* dup it, don't make */
 			     1, /* merge with old value */
 			     t->t_value);
@@ -1036,7 +1042,7 @@
     return 0;
   }
 
-  if (already_parsed) 
+  if (already_parsed)
     elems = (void *)msg_header_dup_as(home, hc, (msg_header_t *)value);
   else
     elems = (void *)msg_header_make(home, hc, (char const *)value);
@@ -1065,8 +1071,8 @@
   if (msg_params_join(home, (msg_param_t **)&list->k_items, elems->k_items,
 		      2 /* prune */, 0 /* don't dup */) < 0)
     return -1;
-  
-  *return_new_list = 
+
+  *return_new_list =
     (msg_list_t *)msg_header_dup_as(home, hc, (msg_header_t *)list);
   if (!*return_new_list)
     return -1;
@@ -1083,9 +1089,9 @@
  * @retval 0 - no changes in parameters
  * @retval -1 - an error
  */
-static 
+static
 int nhp_save_params(nua_handle_t *nh,
-		    su_home_t *tmphome, 
+		    su_home_t *tmphome,
 		    nua_global_preferences_t *gsrc,
 		    nua_handle_preferences_t *src)
 {
@@ -1112,12 +1118,12 @@
 
   /* Move allocations from tmphome to home */
   su_home_move(nh->nh_home, tmphome);
-  
+
   /* Copy parameters that are set from src to dst */
   nhp_or_set(dst, src);
 
   /* Handle pointer items. Free changed ones and zap unset ones. */
-  /* Note that pointer items where !NHP_ISSET(old, pref) are not freed 
+  /* Note that pointer items where !NHP_ISSET(old, pref) are not freed
      (because they were just on loan from the default preference set) */
 #define NHP_ZAP_OVERRIDEN(old, dst, free, pref)				\
   (((NHP_ISSET(old, pref) &&						\
@@ -1142,7 +1148,7 @@
   NHP_ZAP_OVERRIDEN(old, dst, msg_header_free, initial_route);
 
   nh->nh_prefs = dst;
-  
+
   return memcmp(dst, old, sizeof *dst) != 0;
 }
 
@@ -1239,17 +1245,17 @@
   else if (to_str)
     p_to = sip_to_make(tmphome, to_str);
   else if (url)
-    p_to = sip_to_create(tmphome, url), 
+    p_to = sip_to_create(tmphome, url),
       p_to ? sip_aor_strip((url_t*)p_to->a_url) : 0;
   else
     p_to = SIP_NONE;
-  
+
   if (p_to == NULL || p_from == NULL) {
     su_home_deinit(tmphome);
     return -1;
   }
 
-  nh->nh_tags = 
+  nh->nh_tags =
     tl_filtered_tlist(nh->nh_home, tagfilter,
 		      TAG_IF(p_from != SIP_NONE, SIPTAG_FROM(p_from)),
 		      TAG_IF(p_from != SIP_NONE, TAG_FILTER(nua_handle_tags_filter)),
@@ -1257,7 +1263,7 @@
 		      TAG_IF(p_to != SIP_NONE, TAG_FILTER(nua_handle_tags_filter)),
 		      TAG_NEXT(tags));
 
-  nh->nh_ptags = 
+  nh->nh_ptags =
     tl_filtered_tlist(nh->nh_home, paramfilter, TAG_NEXT(tags));
 
   error = nh->nh_tags == NULL || nh->nh_ptags == NULL;
@@ -1270,7 +1276,7 @@
 
   if (nh->nh_ptags && nh->nh_ptags->t_tag == NULL)
     su_free(nh->nh_home, nh->nh_ptags), nh->nh_ptags = NULL;
-    
+
   if (identity)
     nh->nh_identity = nua_handle_ref(identity);
 
@@ -1287,12 +1293,12 @@
   if (!t || !t->t_tag)
     return 0;
 
-  if (t->t_tag == nutag_url || 
+  if (t->t_tag == nutag_url ||
       t->t_tag == nutag_sips_url ||
       t->t_tag == nutag_identity)
     return 0;
 
-  ns = t->t_tag->tt_ns; 
+  ns = t->t_tag->tt_ns;
   if (!ns)
     return 0;
 
@@ -1311,12 +1317,12 @@
 
   if (tag == tag_filter)
     return 0;
-  
+
   /* Accept @From or @To only when they are followed by
      TAG_FILTER(nua_handle_tags_filter) */
   if (tag == siptag_from || tag == siptag_to) {
     t = tl_next(t);
-    return t && t->t_tag == tag_filter && 
+    return t && t->t_tag == tag_filter &&
       t->t_value == (tag_value_t)nua_handle_tags_filter;
   }
 
@@ -1371,7 +1377,7 @@
     return n;
 
   /* XXX - all other S/MIME parameters? */
-  return sm_set_params(nua->sm, smime_enable, smime_opt, 
+  return sm_set_params(nua->sm, smime_enable, smime_opt,
 		       smime_protection_mode, smime_path);
 #endif
 
@@ -1404,7 +1410,7 @@
  */
 
 /**@fn void nua_get_hparams(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...)
- * 
+ *
  * Get values of handle-specific parameters in #nua_r_get_params event.
  *
  * Application will specify either expilicit list of tags it is interested
@@ -1443,7 +1449,7 @@
  * @param nh     NULL when responding to nua_get_params(),
  *               operation handle when responding to nua_get_hparams()
  * @param hmagic NULL when responding to nua_get_params(),
- *               application contact associated with the operation handle 
+ *               application contact associated with the operation handle
  *               when responding to nua_get_hparams()
  * @param sip    NULL
  * @param tags
@@ -1478,6 +1484,7 @@
  *   NUTAG_PATH_ENABLE() \n
  *   NUTAG_REFER_EXPIRES() \n
  *   NUTAG_REFER_WITH_ID() \n
+ *   NUTAG_REFRESH_WITHOUT_SDP() \n
  *   NUTAG_REGISTRAR() \n
  *   NUTAG_RETRY_COUNT() \n
  *   NUTAG_SERVICE_ROUTE_ENABLE() \n
@@ -1588,7 +1595,7 @@
   TAG_IF(nhp->nhp_set.nhb_##pref, TAG(nhp->nhp_##pref))
 
   /* Include tag in the list returned to user
-   * if it has been earlier set (by user) 
+   * if it has been earlier set (by user)
    * but always include in the default parameters */
 #define TIFD(TAG, pref) \
   TAG_IF(nh == dnh || nhp->nhp_set.nhb_##pref, TAG(nhp->nhp_##pref))
@@ -1639,6 +1646,7 @@
      TIF(NUTAG_MIN_SE, min_se),
      TIFD(NUTAG_SESSION_REFRESHER, refresher),
      TIF(NUTAG_UPDATE_REFRESH, update_refresh),
+     TIF(NUTAG_REFRESH_WITHOUT_SDP, refresh_without_sdp),
 
      TIF(NUTAG_ENABLEMESSAGE, message_enable),
      TIF(NUTAG_ENABLEMESSENGER, win_messenger_enable),

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h	Tue Dec 23 07:37:03 2008
@@ -26,7 +26,7 @@
 /** Defined when <nua_params.h> has been included. */
 #define NUA_PARAMS_H
 
-/**@internal @file nua_params.h 
+/**@internal @file nua_params.h
  * @brief Parameters and their handling
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -37,7 +37,7 @@
 
 #include <nua_types.h>
 
-/**@internal @brief 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
@@ -69,7 +69,7 @@
   unsigned         nhp_auto_ack:1; /**< Automatically ACK a final response */
   unsigned         :0;
 
-  /** INVITE timeout. 
+  /** INVITE timeout.
    *
    * If no response is received in nhp_invite_timeout seconds,
    * INVITE client transaction times out
@@ -80,9 +80,12 @@
   /** Default Min-SE Delta value */
   unsigned         nhp_min_se;
   /** no (preference), local or remote */
-  enum nua_session_refresher nhp_refresher; 
+  enum nua_session_refresher nhp_refresher;
   unsigned         nhp_update_refresh:1; /**< Use UPDATE to refresh */
-  
+
+  /**< Accept refreshes without SDP */
+  unsigned         nhp_refresh_without_sdp:1;
+
   /* Messaging preferences */
   unsigned     	   nhp_message_enable : 1;
   /** Be bug-compatible with Windows Messenger */
@@ -128,8 +131,8 @@
   char const         *nhp_instance;
 
   /** Outbound OPTIONS */
-  char const         *nhp_outbound; 
-  
+  char const         *nhp_outbound;
+
   sip_allow_t        *nhp_appl_method;
 
   /** Initial route set */
@@ -140,11 +143,11 @@
 
   union { struct {
     /* A bit for each feature set by application */
-    /* NOTE: 
+    /* NOTE:
        Some compilers behave weird if there are bitfields
-       together with width > 32 
-       So there should be a padding field (unsigned:0;) 
-       every 32 bits. 
+       together with width > 32
+       So there should be a padding field (unsigned:0;)
+       every 32 bits.
     */
     unsigned nhb_retry_count:1;
     unsigned nhb_max_subscriptions:1;
@@ -162,8 +165,9 @@
 
     unsigned nhb_session_timer:1;
     unsigned nhb_min_se:1;
-    unsigned nhb_refresher:1; 
+    unsigned nhb_refresher:1;
     unsigned nhb_update_refresh:1;
+    unsigned nhb_refresh_without_sdp:1;
     unsigned nhb_message_enable:1;
     unsigned nhb_win_messenger_enable:1;
     unsigned nhb_message_auto_respond:1;
@@ -179,9 +183,9 @@
     unsigned nhb_keepalive:1;
     unsigned nhb_keepalive_stream:1;
     unsigned nhb_registrar:1;
+    unsigned :0;		/* at most 32 bits before this point */
 
     unsigned nhb_allow:1;
-    unsigned :0;		/* at most 32 bits before this point */
     unsigned nhb_supported:1;
 
     unsigned nhb_allow_events:1;
@@ -198,7 +202,7 @@
     unsigned nhb_initial_route:1;
     unsigned nhb_proxy:1;
     unsigned :0;
-  } set_bits; 
+  } set_bits;
     unsigned set_unsigned[2];
   } nhp_set_;
 };
@@ -218,7 +222,7 @@
     unsigned ngp_detect_network_updates:1;
     unsigned ngp_shutdown_events:1;
     unsigned :0;
-  } set_bits; 
+  } set_bits;
     unsigned set_unsigned[2];
   } ngp_set_;
 };
@@ -246,7 +250,7 @@
 #define NH_PGET(nh, pref)						\
   NHP_GET((nh)->nh_prefs, (nh)->nh_dprefs, pref)
 
-/* Get preference from handle, if exists and set, 
+/* Get preference from handle, if exists and set,
    otherwise from default handle */
 #define NUA_PGET(nua, nh, pref)						\
   NHP_GET((nh) ? (nh)->nh_prefs : (nua)->nua_dhandle->nh_prefs,		\

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c	Tue Dec 23 07:37:03 2008
@@ -168,7 +168,7 @@
  * @param nh     operation handle associated with the publication
  * @param hmagic application context associated with the handle
  * @param sip    response to PUBLISH request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
@@ -206,8 +206,8 @@
  *
  * @par Events:
  *    #nua_r_unpublish
- * 
- * @sa #nua_r_unpublish, @RFC3903, @SIPIfMatch, 
+ *
+ * @sa #nua_r_unpublish, @RFC3903, @SIPIfMatch,
  * #nua_i_publish, nua_publish(), #nua_r_publish
  */
 
@@ -223,7 +223,7 @@
  * @param nh     operation handle associated with the publication
  * @param hmagic application context associated with the handle
  * @param sip    response to PUBLISH request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
@@ -369,7 +369,7 @@
     ;
   else if (status == 412)
     restarting = phrase;
-  else if (200 <= status && status < 300 && 
+  else if (200 <= status && status < 300 &&
 	   sip->sip_expires && sip->sip_expires->ex_delta == 0)
     restarting = "Immediate re-PUBLISH";
 
@@ -473,7 +473,7 @@
  *
  * In order to receive #nua_i_publish events, the application must enable
  * both the PUBLISH method with NUTAG_ALLOW() tag and the acceptable SIP
- * events with nua_set_params() tag NUTAG_ALLOW_EVENTS(). 
+ * events with nua_set_params() tag NUTAG_ALLOW_EVENTS().
  *
  * The nua_response() call responding to a PUBLISH request must have
  * NUTAG_WITH() (or NUTAG_WITH_THIS()/NUTAG_WITH_SAVED()) tag. Note that
@@ -495,8 +495,8 @@
  * @param tags   empty
  *
  * @sa @RFC3903, nua_respond(),
- * @Expires, @SIPETag, @SIPIfMatch, @Event, 
- * nua_subscribe(), #nua_i_subscribe, 
+ * @Expires, @SIPETag, @SIPIfMatch, @Event,
+ * nua_subscribe(), #nua_i_subscribe,
  * nua_notifier(), #nua_i_subscription,
  *
  * @since First used in @VERSION_1_12_4
@@ -506,11 +506,11 @@
 
 int nua_publish_server_init(nua_server_request_t *sr);
 
-nua_server_methods_t const nua_publish_server_methods = 
+nua_server_methods_t const nua_publish_server_methods =
   {
     SIP_METHOD_PUBLISH,
     nua_i_publish,		/* Event */
-    { 
+    {
       0,			/* Do not create dialog */
       0,			/* Initial request */
       0,			/* Not a target refresh request  */
@@ -528,7 +528,7 @@
   sip_allow_events_t *allow_events = NH_PGET(sr->sr_owner, allow_events);
   sip_event_t *o = sr->sr_request.sip->sip_event;
   char const *event = o ? o->o_type : NULL;
-  
+
   if (!allow_events)
     return SR_STATUS1(sr, SIP_501_NOT_IMPLEMENTED);
   else if (!event || !msg_header_find_param(allow_events->k_common, event))

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c	Tue Dec 23 07:37:03 2008
@@ -76,7 +76,7 @@
 /* Registrations and contacts */
 
 int nua_registration_from_via(nua_registration_t **list,
-			      nua_handle_t *nh, 
+			      nua_handle_t *nh,
 			      sip_via_t const *via,
 			      int public);
 
@@ -150,7 +150,7 @@
   unsigned nr_by_stack:1;
 
   unsigned:0;
-  
+
   int nr_error_report_id;	/**< ID used to ask for error reports from tport */
 
   sip_route_t *nr_route;	/**< Outgoing Service-Route */
@@ -285,8 +285,8 @@
   };
 
 /**@fn void nua_register(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
- * 
- * Send SIP REGISTER request to the registrar. 
+ *
+ * Send SIP REGISTER request to the registrar.
  *
  * Request status will be delivered to the application using #nua_r_register
  * event. When successful the registration will be updated periodically.
@@ -306,7 +306,7 @@
  *
  * @par Events:
  *     #nua_r_register, #nua_i_outbound
- * 
+ *
  * @par Generating Contact Header
  *
  * If the application did not specify the Contact header in the tags,
@@ -314,10 +314,10 @@
  * for the host and port number for the Contact URI from the transport
  * socket. The diplay name is taken from NUTAG_M_DISPLAY(), URL username
  * part is taken from NUTAG_M_USERNAME(), URI parameters from
- * NUTAG_M_PARAMS(), and Contact header parameters from NUTAG_M_FEATURES(). 
+ * NUTAG_M_PARAMS(), and Contact header parameters from NUTAG_M_FEATURES().
  * If NUTAG_CALLEE_CAPS(1) is specified, additional Contact header
  * parameters are generated based on SDP capabilities and SIP @Allow header.
- * 
+ *
  * Note that @b nua may append a identifier of its own to the @Contact URI
  * username. Such nua-generated identifier trailer always starts with "="
  * (equal sign), rest of the nua-generated identifier may contain any
@@ -349,7 +349,7 @@
  * by NUTAG_M_USERNAME() and the non-transport parameters of the request URI
  * set by NUTAG_M_PARAMS() when determining to which registration the
  * incoming request belongs.
- * 
+ *
  * For example, a request line correspoding to the @Contact in above example
  * may look like:
  * @code
@@ -363,17 +363,17 @@
  *
  * Normally, @b nua will start start a protocol engine for outbound
  * connections used for NAT and firewall traversal and connectivity checks
- * when registering. 
+ * when registering.
  *
  * @note If the application provides @b nua with a
  * @Contact header of its own (or includes a SIPTAG_CONTACT(NULL) tag in
  * nua_register() tags), the outbound protocol engine is not started. It is
  * assumed that the application knows better what it is doing when it sets
- * the @Contact, or it is using experimental CPL upload as specified in 
+ * the @Contact, or it is using experimental CPL upload as specified in
  * <a href="http://www.ietf.org/internet-drafts/draft-lennox-sip-reg-payload-01.txt">
  * draft-lennox-sip-reg-payload-01.txt</a>.
  *
- * First, outbound engine will probe for NATs in between UA and registrar. 
+ * First, outbound engine will probe for NATs in between UA and registrar.
  * It will send a REGISTER request as usual. Upon receiving the response it
  * checks for the presence of "received" and "rport" parameters in the Via
  * header returned by registrar. The presence of NAT is determined from the
@@ -416,14 +416,14 @@
  *
  * You can disable this kind of NAT traversal by setting "no-natify" into
  * NUTAG_OUTBOUND() options string.
- * 
+ *
  * @par GRUU and Service-Route
  *
  * After a successful response to the REGISTER request has been received,
  * nua_register() will update the information about the registration based
  * on it. If there is a "gruu" parameter included in the response,
  * nua_register() will save it and use the gruu URI in the Contact header
- * fields of dialog-establishing messages, such as INVITE or SUBSCRIBE. 
+ * fields of dialog-establishing messages, such as INVITE or SUBSCRIBE.
  * Also, if the registrar has included a Service-Route header in the
  * response, and the service route feature has not been disabled using
  * NUTAG_SERVICE_ROUTE_ENABLE(), the route URIs from the Service-Route
@@ -444,8 +444,8 @@
  * You can disable validation by inserting "no-validate" into
  * NUTAG_OUTBOUND() string.
  *
- * The keepalive mechanism depends on the network features detected earlier. 
- * If @a outbound extension is used, the STUN keepalives will be used. 
+ * The keepalive mechanism depends on the network features detected earlier.
+ * If @a outbound extension is used, the STUN keepalives will be used.
  * Otherwise, NUA stack will repeatedly send OPTIONS requests to itself. In
  * order to save bandwidth, it will include Max-Forwards: 0 in the
  * keep-alive requests, however. The keepalive interval is determined by
@@ -462,18 +462,18 @@
  *
  * As alternative to OPTIONS/STUN keepalives, the client can propose
  * a more frequent registration refresh interval with
- * NUTAG_M_FEATURES() (e.g. NUTAG_M_FEATURES("expires=120") given as 
+ * NUTAG_M_FEATURES() (e.g. NUTAG_M_FEATURES("expires=120") given as
  * parameter to nua_register()).
- * 
- * @sa #nua_r_register, nua_unregister(), #nua_r_unregister, 
+ *
+ * @sa #nua_r_register, nua_unregister(), #nua_r_unregister,
  * #nua_i_register,
  * @RFC3261 section 10,
  * @Expires, @Contact, @CallID, @CSeq,
  * @Path, @RFC3327, @ServiceRoute, @RFC3608, @RFC3680,
  *     NUTAG_REGISTRAR(), NUTAG_INSTANCE(), NUTAG_OUTBOUND(),
- *     NUTAG_KEEPALIVE(), NUTAG_KEEPALIVE_STREAM(), 
+ *     NUTAG_KEEPALIVE(), NUTAG_KEEPALIVE_STREAM(),
  *     SIPTAG_CONTACT(), SIPTAG_CONTACT_STR(), NUTAG_M_USERNAME(),
- *     NUTAG_M_DISPLAY(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES(), 
+ *     NUTAG_M_DISPLAY(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES(),
  */
 
 /** @NUA_EVENT nua_r_register
@@ -481,8 +481,8 @@
  * Response to an outgoing REGISTER.
  *
  * The REGISTER may be sent explicitly by nua_register() or implicitly by
- * NUA state machines. 
- * 
+ * NUA state machines.
+ *
  * When REGISTER request has been restarted the @a status may be 100 even
  * while the real response status returned is different.
  *
@@ -494,23 +494,23 @@
  * @param nh     operation handle associated with the registration
  * @param hmagic application context associated with the registration
  * @param sip    response message to REGISTER request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
  * @sa nua_register(), nua_unregister(), #nua_r_unregister,
  * @Contact, @CallID, @CSeq, @RFC3261 section 10,
  * @Path, @RFC3327, @ServiceRoute, @RFC3608, @RFC3680
- * 
+ *
  * @END_NUA_EVENT
  */
 
 /**@fn void nua_unregister(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
- * Unregister. 
+ * Unregister.
  *
- * Send a REGISTER request with expiration time 0. This removes the 
- * registration from the registrar. If the handle was earlier used 
- * with nua_register() the periodic updates will be terminated. 
+ * Send a REGISTER request with expiration time 0. This removes the
+ * registration from the registrar. If the handle was earlier used
+ * with nua_register() the periodic updates will be terminated.
  *
  * If a SIPTAG_CONTACT_STR() with argument "*" is used, all the
  * registrations will be removed from the registrar otherwise only the
@@ -534,9 +534,9 @@
  * @Expires, @Contact, @CallID, @CSeq, @RFC3261 section 10,
  * @Path, @RFC3327, @ServiceRoute, @RFC3608, @RFC3680,
  *     NUTAG_REGISTRAR(), NUTAG_INSTANCE(), NUTAG_OUTBOUND(),
- *     NUTAG_KEEPALIVE(), NUTAG_KEEPALIVE_STREAM(), 
+ *     NUTAG_KEEPALIVE(), NUTAG_KEEPALIVE_STREAM(),
  *     SIPTAG_CONTACT(), SIPTAG_CONTACT_STR(), NUTAG_M_USERNAME(),
- *     NUTAG_M_DISPLAY(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES(), 
+ *     NUTAG_M_DISPLAY(), NUTAG_M_PARAMS(), NUTAG_M_FEATURES(),
  */
 
 /** @NUA_EVENT nua_r_unregister
@@ -551,14 +551,14 @@
  * @param nh     operation handle associated with the registration
  * @param hmagic application context associated with the registration
  * @param sip    response message to REGISTER request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
  * @sa nua_unregister(), nua_register(), #nua_r_register,
  * @Contact, @CallID, @CSeq, @RFC3261 section 10,
  * @Path, @RFC3327, @ServiceRoute, @RFC3608, @RFC3680
- * 
+ *
  * @END_NUA_EVENT
  */
 
@@ -692,7 +692,7 @@
       for (m = sip->sip_contact; m; m = m->m_next)
 	if (!m->m_expires || strtoul(m->m_expires, NULL, 10) != 0)
 	  break;
-      
+
       if (m == NULL)
 	unreg = 1;	/* All contacts have expires=0 */
     }
@@ -754,7 +754,7 @@
       outbound_get_contacts(nr->nr_ob, &m, &previous);
 
       sip_add_dup(msg, sip, (sip_header_t *)m);
-      /* previous is an outdated contact generated by stack 
+      /* previous is an outdated contact generated by stack
        * and it is now unregistered */
       if (previous)
 	sip_add_dup(msg, sip, (sip_header_t *)previous);
@@ -780,10 +780,10 @@
       /* Remove the expire parameters from contacts */
       msg_header_remove_param(m->m_common, "expires");
     }
-    else if (nr && nr->nr_min_expires && 
+    else if (nr && nr->nr_min_expires &&
 	     strtoul(m->m_expires, 0, 10) < nr->nr_min_expires) {
-      if (min_expires == NULL) 
-	min_expires = su_sprintf(msg_home(msg), "expires=%lu", 
+      if (min_expires == NULL)
+	min_expires = su_sprintf(msg_home(msg), "expires=%lu",
 				 nr->nr_min_expires);
       msg_header_replace_param(msg_home(msg), m->m_common, min_expires);
     }
@@ -815,7 +815,7 @@
 				       req, sip);
 
     restart = retry >= ob_reregister_now;
-    
+
     if (retry == ob_reregister)
       /* outbound restarts REGISTER later */;
 
@@ -835,7 +835,7 @@
   /* Restart only if nua_base_client_check_restart() did not try to restart */
   if (restart && retry_count == cr->cr_retry_count)
     return nua_client_restart(cr, 100, "Outbound NAT Detected");
-  
+
   return 0;
 }
 
@@ -874,7 +874,7 @@
     }
 #endif
 
-    /* XXX - if store/remove, remove 
+    /* XXX - if store/remove, remove
        Content-Disposition
        Content-Type
        body
@@ -886,7 +886,7 @@
     reqdelta = req->sip_expires ? req->sip_expires->ex_delta : 0;
 
     for (m = sip->sip_contact; m; m = m->m_next) {
-      if (m->m_url->url_type != url_sip && 
+      if (m->m_url->url_type != url_sip &&
 	  m->m_url->url_type != url_sips)
 	continue;
 
@@ -901,7 +901,7 @@
 
 	if (mdelta == 0)
 	  mdelta = 3600;
-	  
+
 	delta = sip_contact_expires(m, sip->sip_expires, sip->sip_date,
 				    mdelta, now);
 	if (delta > 0 && delta < mindelta)
@@ -975,7 +975,7 @@
 
       if (tport_is_secondary(tport)) {
 	tport_set_params(tport, TPTAG_SDWN_ERROR(1), TAG_END());
-	nr->nr_error_report_id = 
+	nr->nr_error_report_id =
 	  tport_pend(tport, NULL, nua_register_connection_closed, nr);
       }
     }
@@ -1033,7 +1033,7 @@
 
   tpn = tport_name(nr->nr_tport);
 
-  SU_DEBUG_5(("nua_register(%p): tport to %s/%s:%s%s%s closed %s\n", 
+  SU_DEBUG_5(("nua_register(%p): tport to %s/%s:%s%s%s closed %s\n",
 	      du->du_dialog->ds_owner,
 	      tpn->tpn_proto, tpn->tpn_host, tpn->tpn_port,
 	      tpn->tpn_comp ? ";comp=" : "",
@@ -1162,13 +1162,13 @@
     contact1 = contact2, contact2 = NULL;
 
   if (contact1 &&
-      (url_is_string(contact1) 
+      (url_is_string(contact1)
        ? strncasecmp(contact1->us_str, "sips:", 5) == 0
        : contact1->us_url->url_type == url_sips))
     name1 = "sips";
 
-  if (contact2 && 
-      (url_is_string(contact2) 
+  if (contact2 &&
+      (url_is_string(contact2)
        ? strncasecmp(contact2->us_str, "sips:", 5) == 0
        : contact2->us_url->url_type == url_sips))
     name2 = "sips";
@@ -1205,7 +1205,7 @@
 	nta_agent_add_tport(nua->nua_nta, contact2,
 			    TPTAG_IDENT(name2),
 			    TPTAG_CERTIFICATE(certificate_dir),
-			    TAG_NEXT(nua->nua_args)) < 0) 
+			    TAG_NEXT(nua->nua_args)) < 0)
       return -1;
   }
 
@@ -1238,7 +1238,7 @@
   case NUA_NW_DETECT_ONLY_INFO:
     nua_stack_event(nua, NULL, NULL, nua_i_network_changed, SIP_200_OK, NULL);
     break;
-    
+
   case NUA_NW_DETECT_TRY_FULL:
 
     /* 1) Shutdown all tports */
@@ -1254,7 +1254,7 @@
 		      SIP_200_OK, NULL);
 
     break;
-    
+
   default:
     break;
   }
@@ -1270,7 +1270,7 @@
 				    nua->nua_api_root,
 				    nua_network_changed_cb,
 				    nua);
-  
+
   if (!snc)
     return -1;
 
@@ -1394,13 +1394,13 @@
     }
 
     /* if more than one candidate, ignore local entries */
-    if (v && (*vv || nr_items > 0) && 
+    if (v && (*vv || nr_items > 0) &&
 	host_is_local(v->v_host)) {
-      SU_DEBUG_9(("nua_register: ignoring contact candidate %s:%s.\n", 
+      SU_DEBUG_9(("nua_register: ignoring contact candidate %s:%s.\n",
 		  v->v_host, v->v_port ? v->v_port : ""));
       continue;
     }
-     
+
     nr = su_zalloc(home, sizeof *nr);
     if (!nr)
       break;
@@ -1494,7 +1494,7 @@
 	continue;
       if (nr->nr_ip6 && ip4)
 	continue;
-      if (sips_uri ? nr->nr_secure : !nr->nr_secure) 
+      if (sips_uri ? nr->nr_secure : !nr->nr_secure)
 	return (nua_registration_t *)nr;
       if (!registered && nr->nr_aor)
 	registered = nr;
@@ -1528,7 +1528,7 @@
 	namewise = nr;
     }
 
-    if (!sipswise && ((sips_aor || sips_uri) ? 
+    if (!sipswise && ((sips_aor || sips_uri) ?
 		      nr->nr_secure : !nr->nr_secure))
       sipswise = nr;
     if (!registered)
@@ -1545,8 +1545,8 @@
     return (nua_registration_t *)sipswise;
   if (registered)
     return (nua_registration_t *)registered;
-    
-  /* XXX - 
+
+  /* XXX -
      should we do some policing whether sips_aor or sips_uri can be used
      with sip contact?
   */
@@ -1572,7 +1572,7 @@
 }
 
 nua_registration_t *
-nua_registration_for_response(nua_registration_t const *list, 
+nua_registration_for_response(nua_registration_t const *list,
 			      sip_t const *sip,
 			      sip_record_route_t const *record_route,
 			      sip_contact_t const *remote_contact)
@@ -1583,7 +1583,7 @@
 
   if (sip)
     aor = sip->sip_to;
-  
+
   if (record_route)
     uri = record_route->r_url;
   else if (sip && sip->sip_record_route)
@@ -1647,8 +1647,8 @@
   if (nr == NULL)
     nr = nua_registration_for_request(nh->nh_nua->nua_registrations, sip);
 
-  return nua_registration_add_contact_and_route(nh, nr, msg, sip, 
-						add_contact, 
+  return nua_registration_add_contact_and_route(nh, nr, msg, sip,
+						add_contact,
 						add_service_route);
 }
 
@@ -1678,13 +1678,13 @@
     nr = nua_registration_for_response(nh->nh_nua->nua_registrations, sip,
 				       record_route, remote_contact);
 
-  return nua_registration_add_contact_and_route(nh, nr, msg, sip, 
+  return nua_registration_add_contact_and_route(nh, nr, msg, sip,
 						1,
 						0);
 }
 
 /** Add a Contact (and Route) header to request */
-static 
+static
 int nua_registration_add_contact_and_route(nua_handle_t *nh,
 					   nua_registration_t *nr,
 					   msg_t *msg,
@@ -1825,7 +1825,7 @@
     return -1;
 
   uri = nr->nr_aor ? nr->nr_aor->a_url : NULL;
-    
+
   previous = nr->nr_contact;
 
   if (application_contact) {
@@ -1836,7 +1836,7 @@
   }
   else {
     nua_registration_t *nr0;
-    
+
     nr0 = nua_registration_by_aor(*nr->nr_list, NULL, uri, 1);
 
     if (nr0 && nr0->nr_via) {
@@ -1920,12 +1920,12 @@
  * @param phrase a short textual description of @a status code
  * @param nh     operation handle associated with the outbound engine
  * @param hmagic application context associated with the handle
- * @param sip    NULL or response message to an keepalive message or 
+ * @param sip    NULL or response message to an keepalive message or
  *               registration probe
  *               (error code and message are in status an phrase parameters)
  * @param tags   empty
  *
- * @sa NUTAG_OUTBOUND(), NUTAG_KEEPALIVE(), NUTAG_KEEPALIVE_STREAM(), 
+ * @sa NUTAG_OUTBOUND(), NUTAG_KEEPALIVE(), NUTAG_KEEPALIVE_STREAM(),
  * nua_register(), #nua_r_register, nua_unregister(), #nua_r_unregister
  *
  * @END_NUA_EVENT
@@ -1967,7 +1967,7 @@
 }
 
 /** @internal Callback for obtaining credentials for keepalive */
-static int nua_stack_outbound_credentials(nua_handle_t *nh, 
+static int nua_stack_outbound_credentials(nua_handle_t *nh,
 					  auth_client_t **auc)
 {
   return auc_copy_credentials(auc, nh->nh_auth);
@@ -2011,6 +2011,7 @@
   if (sip_transport_has_tls(v->v_protocol) ||
       sip_transport_has_tls(transport)) {
     url.url_type = url_sips;
+    url.url_scheme = url_scheme(url_sips);
     if (port && strcmp(port, SIPS_DEFAULT_SERV) == 0)
       port = NULL;
     if (port || host_is_ip_address(host))
@@ -2080,12 +2081,12 @@
     su_strlst_append(l, s[0] == ';' ? "" : ";");
     su_strlst_append(l, s);
   }
-  
+
   va_end(va);
 
   if (!in_dialog) {
     s = NH_PGET(nh, m_features);
-    if (s) 
+    if (s)
       s[0] == ';' ? "" : su_strlst_append(l, ";"), su_strlst_append(l, s);
 
     if (NH_PGET(nh, callee_caps)) {
@@ -2106,7 +2107,7 @@
 
       if (nh->nh_soa) {
 	char **media = soa_media_features(nh->nh_soa, 0, home);
-	
+
 	while (*media) {
 	  if (su_strlst_len(l))
 	    su_strlst_append(l, ";");
@@ -2117,8 +2118,8 @@
   }
 
   m = sip_contact_make(home, su_strlst_join(l, su_strlst_home(l), ""));
-  
+
   su_strlst_destroy(l);
-  
+
   return m;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_registrar.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_registrar.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_registrar.c	Tue Dec 23 07:37:03 2008
@@ -93,11 +93,11 @@
  * @END_NUA_EVENT
  */
 
-nua_server_methods_t const nua_register_server_methods = 
+nua_server_methods_t const nua_register_server_methods =
   {
     SIP_METHOD_REGISTER,
     nua_i_register,		/* Event */
-    { 
+    {
       0,			/* Do not create dialog */
       0,			/* Initial request */
       0,			/* Not a target refresh request  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	Tue Dec 23 07:37:03 2008
@@ -70,14 +70,14 @@
 If a re-INVITE transaction fails, the result depends on the status code in
 failure. The call can return to the ready state, be terminated immediately,
 or be terminated gracefully. The proper action to take is determined with
-sip_response_terminates_dialog().			   
+sip_response_terminates_dialog().
 
 @sa @ref nua_call_model, #nua_i_state, nua_invite(), #nua_i_invite
-							   
- at par Session State Diagram				   
-							   
- at code							   
-  			 +----------+			   
+
+ at par Session State Diagram
+
+ at code
+  			 +----------+
   			 |          |---------------------+
   			 |   Init   |                     |
   			 |          |----------+          |
@@ -124,16 +124,16 @@
                       +->|Terminated|<--------------+
                          |          |
                          +----------+
-                              | 
+                              |
                               V
                          +----------+
         		 |          |
                          |   Init   |
 			 |          |
           		 +----------+
- at endcode			      
-*/			      
-			      
+ at endcode
+*/
+
 /* ---------------------------------------------------------------------- */
 /* Session event usage */
 
@@ -141,10 +141,10 @@
 typedef struct nua_session_usage
 {
   enum nua_callstate ss_state;		/**< Session status (enum nua_callstate) */
-  
+
   unsigned        ss_100rel:1;	        /**< Use 100rel, send 183 */
   unsigned        ss_alerting:1;	/**< 180 is sent/received */
-  
+
   unsigned        ss_update_needed:2;	/**< Send an UPDATE (do O/A if > 1) */
 
   unsigned        ss_precondition:1;	/**< Precondition required */
@@ -171,6 +171,9 @@
 
   /* Offer-Answer status */
   char const     *ss_oa_recv, *ss_oa_sent;
+
+  /**< Version of user SDP from latest successful O/A */
+  int ss_sdp_version;
 } nua_session_usage_t;
 
 static char const Offer[] = "offer", Answer[] = "answer";
@@ -270,7 +273,7 @@
       continue;
 
     if (cr->cr_status < 200) {
-      nua_stack_event(nh->nh_nua, nh, 
+      nua_stack_event(nh->nh_nua, nh,
 		      NULL,
 		      cr->cr_event,
 		      SIP_481_NO_TRANSACTION,
@@ -288,8 +291,8 @@
       ss->ss_state != nua_callstate_init &&
       !ss->ss_reporting) {
     int status = 0; char const *phrase = "Terminated";
-    
-    if (cr0) 
+
+    if (cr0)
       status = cr0->cr_status, phrase = cr0->cr_phrase ? cr0->cr_phrase : phrase;
     else if (sr0)
       status = sr0->sr_status, phrase = sr0->sr_phrase;
@@ -406,11 +409,11 @@
 
 /**@fn void nua_invite(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
  *
- * Place a call using SIP @b INVITE method. 
+ * Place a call using SIP @b INVITE method.
  *
  * The INVITE method is used to initiate a call between two parties. The
  * call is also known as <i>SIP session</i>.
- * 
+ *
  * At SIP level the session is represented as @e Dialog, which is a
  * peer-to-peer association between two SIP User-Agents. The dialog is
  * established by a successful 2XX response to the INVITE. The dialog is
@@ -430,7 +433,7 @@
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Events:
@@ -466,11 +469,11 @@
  * @par
  * When multiple tags for the same header are specified, the behaviour
  * depends on the header type. If only a single header field can be included
- * in a SIP message, the latest non-NULL value is used, e.g., @Subject. 
+ * in a SIP message, the latest non-NULL value is used, e.g., @Subject.
  * However, if the SIP header can consist of multiple lines or header fields
  * separated by comma, e.g., @Accept, all the tagged
  * values are concatenated.
- * 
+ *
  * @par
  * However, if a tag value is #SIP_NONE (-1 casted as a void pointer), the
  * values from previous tags are ignored.
@@ -487,10 +490,10 @@
  * For initial INVITE requests, values from tags are used. If NUTAG_URL() is
  * given, it is used as target URI. Otherwise, if SIPTAG_TO() is given, it
  * is used as target URI. If neither is given, the complete request line
- * already specified using SIPTAG_REQUEST() or SIPTAG_REQUEST_STR() is used. 
+ * already specified using SIPTAG_REQUEST() or SIPTAG_REQUEST_STR() is used.
  * If none of the tags above are given, an internal error is returned to the
  * application. At this point, the target URI is stored in the request line,
- * together with method name ("INVITE") and protocol version ("SIP/2.0"). 
+ * together with method name ("INVITE") and protocol version ("SIP/2.0").
  * The initial dialog information is also created: @CallID, @CSeq headers
  * are generated, if they do not exist, and an unique tag is added to @From
  * header.
@@ -518,14 +521,14 @@
  * For in-dialog INVITE (re-INVITE), the request URI is taken from the
  * @Contact header received from the remote party during the dialog
  * establishment. Also, the @CallID and @CSeq headers and @From and @To tags
- * are generated based on the dialog information and added to the request. 
+ * are generated based on the dialog information and added to the request.
  * If the dialog has a route (set by @RecordRoute headers), it is added to
  * the request, too.
  *
  * @par
  * @MaxForwards header (with default value set by NTATAG_MAX_FORWARDS()) is
  * also added now, if it does not exist.
- * 
+ *
  * @par
  * The INVITE request message created by nua_invite() operation is saved as
  * a template for automatic re-INVITE requests sent by the session timer
@@ -537,8 +540,8 @@
  *
  * @par Tags Related to SIP Headers and Request-URI
  *    NUTAG_URL(), SIPTAG_REQUEST(), SIPTAG_REQUEST_STR() \n
- *    NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(), 
- *    SIPTAG_ROUTE(), SIPTAG_ROUTE_STR(), 
+ *    NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(),
+ *    SIPTAG_ROUTE(), SIPTAG_ROUTE_STR(),
  *    NUTAG_SERVICE_ROUTE_ENABLE() \n
  *    SIPTAG_MAX_FORWARDS(), SIPTAG_MAX_FORWARDS_STR() \n
  *    SIPTAG_PROXY_REQUIRE(), SIPTAG_PROXY_REQUIRE_STR() \n
@@ -571,7 +574,7 @@
  *    SIPTAG_AUTHORIZATION(), SIPTAG_AUTHORIZATION_STR() \n
  *    SIPTAG_REFERRED_BY(), SIPTAG_REFERRED_BY_STR() \n
  *    SIPTAG_REPLACES(), SIPTAG_REPLACES_STR() \n
- *    NUTAG_SESSION_TIMER(), NUTAG_SESSION_REFRESHER(), 
+ *    NUTAG_SESSION_TIMER(), NUTAG_SESSION_REFRESHER(),
  *    SIPTAG_SESSION_EXPIRES(), SIPTAG_SESSION_EXPIRES_STR() \n
  *    NUTAG_MIN_SE(), SIPTAG_MIN_SE(), SIPTAG_MIN_SE_STR() \n
  *    SIPTAG_SECURITY_CLIENT(), SIPTAG_SECURITY_CLIENT_STR() \n
@@ -593,7 +596,7 @@
  * @par
  * The SDP description of the
  * @ref soa_session_t "soa media session" is included in the INVITE request
- * as a message body. 
+ * as a message body.
  * The SDP in the message body of the 1XX or 2XX response message is
  * interpreted as an answer, given to the @ref soa_session_t "soa media
  * session" object for processing.
@@ -605,8 +608,8 @@
  *    NUTAG_MEDIA_ENABLE(), \n
  *    NUTAG_INCLUDE_EXTRA_SDP(), \n
  *    SOATAG_HOLD(), SOATAG_AF(), SOATAG_ADDRESS(),
- *    SOATAG_ORDERED_USER(), SOATAG_REUSE_REJECTED(), 
- *    SOATAG_RTP_SELECT(), SOATAG_RTP_SORT(), SOATAG_RTP_MISMATCH(), 
+ *    SOATAG_ORDERED_USER(), SOATAG_REUSE_REJECTED(),
+ *    SOATAG_RTP_SELECT(), SOATAG_RTP_SORT(), SOATAG_RTP_MISMATCH(),
  *    SOATAG_AUDIO_AUX(), \n
  *    SOATAG_USER_SDP() or SOATAG_USER_SDP_STR() \n
  *
@@ -620,10 +623,10 @@
  * SIP level, that is, the SIP PRACK and UPDATE requests are sent if
  * "precondition" is added to the @Require header in the INVITE request.
  *
- * Optionally 
+ * Optionally
  * - uses early media if NUTAG_EARLY_MEDIA() tag is used with non zero-value
  * - media parameters can be set by SOA tags
- * - nua_invite() can be used to change status of an existing call: 
+ * - nua_invite() can be used to change status of an existing call:
  *   - #SOATAG_HOLD tag can be used to list the media that will be put on hold,
  *     the value "*" sets all the media beloginging to the session on hold
  *
@@ -642,7 +645,7 @@
  *     nua_authenticate() \n
  *     nua_prack() \n
  *     nua_update() \n
- *     nua_info() \n 
+ *     nua_info() \n
  *     nua_cancel() \n
  *     nua_bye() \n
  *     #nua_i_invite, nua_respond()
@@ -652,7 +655,7 @@
  *    NUTAG_REFER_PAUSE() \n
  */
 
-static int nua_invite_client_init(nua_client_request_t *cr, 
+static int nua_invite_client_init(nua_client_request_t *cr,
 				  msg_t *msg, sip_t *sip,
 				  tagi_t const *tags);
 static int nua_invite_client_request(nua_client_request_t *cr,
@@ -703,7 +706,7 @@
   return nua_client_create(nh, e, &nua_invite_client_methods, tags);
 }
 
-static int nua_invite_client_init(nua_client_request_t *cr, 
+static int nua_invite_client_init(nua_client_request_t *cr,
 				  msg_t *msg, sip_t *sip,
 				  tagi_t const *tags)
 {
@@ -712,11 +715,11 @@
   nua_session_usage_t *ss;
 
   cr->cr_usage = du = nua_dialog_usage_for_session(nh->nh_ds);
-  /* Errors returned by nua_invite_client_init() 
+  /* Errors returned by nua_invite_client_init()
      do not change the session state */
-  cr->cr_neutral = 1;	
-  
-  if (nh_is_special(nh) || 
+  cr->cr_neutral = 1;
+
+  if (nh_is_special(nh) ||
       nua_stack_set_handle_special(nh, nh_has_invite, nua_i_error))
     return nua_client_return(cr, 900, "Invalid handle for INVITE", msg);
   else if (nh_referral_check(nh, tags) < 0)
@@ -748,7 +751,7 @@
 
   session_timer_preferences(ss->ss_timer,
 			    sip,
-			    NH_PGET(nh, supported),		     
+			    NH_PGET(nh, supported),
 			    NH_PGET(nh, session_timer),
 			    NUA_PISSET(nh->nh_nua, nh, session_timer),
 			    NH_PGET(nh, refresher),
@@ -767,7 +770,7 @@
   int offer_sent = 0, retval;
   sip_time_t invite_timeout;
 
-  if (du == NULL)		/* Call terminated */ 
+  if (du == NULL)		/* Call terminated */
     return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
 
   ss = NUA_DIALOG_USAGE_PRIVATE(du);
@@ -833,7 +836,7 @@
       ss->ss_oa_sent = Offer;
 
     if (!cr->cr_restarting) /* Restart logic calls nua_invite_client_report */
-      signal_call_state_change(nh, ss, 0, "INVITE sent", 
+      signal_call_state_change(nh, ss, 0, "INVITE sent",
 			       nua_callstate_calling);
   }
 
@@ -858,7 +861,7 @@
 
     session_timer_set(ss);
   }
-  
+
   return nua_session_client_response(cr, status, phrase, sip);
 }
 
@@ -882,7 +885,7 @@
 
       nua_dialog_uac_route(nh, nh->nh_ds, sip, 1);
       nua_dialog_store_peer_info(nh, nh->nh_ds, sip);
-      
+
       /* Tag the INVITE request */
       tagged = nta_outgoing_tagged(cr->cr_orq,
 				   nua_client_orq_response, cr,
@@ -895,18 +898,18 @@
 	ss->ss_reason = "SIP;cause=500;text=\"Cannot Create Early Dialog\"";
       }
     }
-  
+
     if (!rseq) {
       SU_DEBUG_5(("nua(%p): 100rel missing RSeq\n", (void *)nh));
     }
     else if (nta_outgoing_rseq(cr->cr_orq) > rseq->rs_response) {
-      SU_DEBUG_5(("nua(%p): 100rel bad RSeq %u (got %u)\n", (void *)nh, 
+      SU_DEBUG_5(("nua(%p): 100rel bad RSeq %u (got %u)\n", (void *)nh,
 		  (unsigned)rseq->rs_response,
 		  nta_outgoing_rseq(cr->cr_orq)));
       return 1;    /* Do not send event */
     }
     else if (nta_outgoing_setrseq(cr->cr_orq, rseq->rs_response) < 0) {
-      SU_DEBUG_1(("nua(%p): cannot set RSeq %u\n", (void *)nh, 
+      SU_DEBUG_1(("nua(%p): cannot set RSeq %u\n", (void *)nh,
 		  (unsigned)rseq->rs_response));
       cr->cr_graceful = 1;
       ss->ss_reason = "SIP;cause=400;text=\"Bad RSeq\"";
@@ -964,11 +967,14 @@
       /* XXX */
       sdp = NULL;
     }
-    else if (soa_activate(nh->nh_soa, NULL) < 0)
+    else if (soa_activate(nh->nh_soa, NULL) < 0) {
       /* XXX - what about errors? */
       LOG3("error activating media after");
-    else
+    }
+    else {
+      ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
       LOG5("processed SDP");
+    }
   }
   else if (cr->cr_method != sip_method_invite) {
     /* If non-invite request did not have offer, ignore SDP in response */
@@ -986,7 +992,7 @@
       cr->cr_graceful = 1;
       ss->ss_reason = "SIP;cause=400;text=\"Malformed Session Description\"";
     }
-    else 
+    else
       LOG5("got SDP");
   }
 
@@ -1016,7 +1022,7 @@
 
   nh_referral_respond(nh, status, phrase); /* XXX - restarting after 401/407 */
 
-  nua_stack_event(nh->nh_nua, nh, 
+  nua_stack_event(nh->nh_nua, nh,
 		  nta_outgoing_getresponse(orq),
 		  cr->cr_event,
 		  status, phrase,
@@ -1054,7 +1060,7 @@
   else if (status < 200) {
     next_state = nua_callstate_proceeding;
 
-    if (sip && sip->sip_rseq && 
+    if (sip && sip->sip_rseq &&
 	!SIP_IS_ALLOWED(NH_PGET(nh, appl_method), sip_method_prack)) {
       sip_rack_t rack[1];
 
@@ -1064,7 +1070,7 @@
       rack->ra_method      = sip->sip_cseq->cs_method;
       rack->ra_method_name = sip->sip_cseq->cs_method_name;
 
-      error = nua_client_tcreate(nh, nua_r_prack, &nua_prack_client_methods, 
+      error = nua_client_tcreate(nh, nua_r_prack, &nua_prack_client_methods,
 				 SIPTAG_RACK(rack),
 				 TAG_END());
       if (error < 0) {
@@ -1120,7 +1126,7 @@
     if (ss->ss_state > nua_callstate_proceeding || status >= 200)
       error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
     else
-      error = nua_client_create(nh, nua_r_cancel, 
+      error = nua_client_create(nh, nua_r_cancel,
 				&nua_cancel_client_methods, tags);
 
     if (error) {
@@ -1148,7 +1154,7 @@
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -1156,7 +1162,7 @@
  *
  * @par Events:
  *    #nua_i_media_error \n
- *    #nua_i_state  (#nua_i_active, #nua_i_terminated) 
+ *    #nua_i_state  (#nua_i_active, #nua_i_terminated)
  *
  * @sa NUTAG_AUTOACK(), @ref nua_call_model, #nua_i_state
  */
@@ -1190,8 +1196,8 @@
     ss->ss_reporting = 1;	/* We report terminated state here if BYE fails */
     error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
     ss->ss_reporting = 0;
-    signal_call_state_change(nh, ss, 500, "Internal Error", 
-			     error 
+    signal_call_state_change(nh, ss, 500, "Internal Error",
+			     error
 			     ? nua_callstate_terminated
 			     : nua_callstate_terminating);
   }
@@ -1248,11 +1254,11 @@
 
   wa = sip_authorization(sip);
   pa = sip_proxy_authorization(sip);
-  
+
   msg_destroy(msg);
 
   msg = nta_msg_create(nh->nh_nua->nua_nta, 0);
-  sip = sip_object(msg);  
+  sip = sip_object(msg);
   if (!msg)
     return -1;
 
@@ -1309,7 +1315,9 @@
       ;
     else if (nh->nh_soa && soa_is_complete(nh->nh_soa)) {
       /* signal SOA that O/A round(s) is (are) complete */
-	soa_activate(nh->nh_soa, NULL);
+      if (soa_activate(nh->nh_soa, NULL) >= 0) {
+	ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+      }
     }
     else if (nh->nh_soa == NULL
 	     /* NUA does not necessarily know dirty details */
@@ -1331,7 +1339,7 @@
 	reason = "SIP;cause=488;text=\"Incomplete offer/answer\"";
       }
     }
-    
+
     proxy_is_set = NH_PISSET(nh, proxy);
     proxy = NH_PGET(nh, proxy);
 
@@ -1398,12 +1406,12 @@
 
 /**@fn void nua_cancel(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
  *
- * Cancel an INVITE operation 
+ * Cancel an INVITE operation
  *
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -1450,7 +1458,7 @@
   nua_handle_t *nh = cr->cr_owner;
   nua_dialog_usage_t *du = nua_dialog_usage_for_session(nh->nh_ds);
 
-  if (!du || !du->du_cr || !du->du_cr->cr_orq || 
+  if (!du || !du->du_cr || !du->du_cr->cr_orq ||
       nta_outgoing_status(du->du_cr->cr_orq) >= 200) {
     return nua_client_return(cr, 481, "No transaction to CANCEL", msg);
   }
@@ -1477,12 +1485,12 @@
  * The CANCEL may be sent explicitly by nua_cancel() or implicitly by NUA
  * state machine.
  *
- * @param status response status code 
+ * @param status response status code
  * @param phrase a short textual description of @a status code
  * @param nh     operation handle associated with the call
  * @param hmagic application context associated with the call
  * @param sip    response to CANCEL request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
@@ -1501,25 +1509,25 @@
   nua_client_request_t const *cr = du->du_cr;
   nua_server_request_t const *sr;
 
-  if (ss->ss_state >= nua_callstate_terminating || 
+  if (ss->ss_state >= nua_callstate_terminating ||
       /* INVITE is in progress or being authenticated */
       (cr && (cr->cr_orq || cr->cr_wait_for_cred)))
     return;
 
   /* UPDATE has been queued */
-  for (cr = ds->ds_cr; cr; cr = cr->cr_next) 
+  for (cr = ds->ds_cr; cr; cr = cr->cr_next)
     if (cr->cr_method == sip_method_update)
       return;
 
   /* INVITE or UPDATE in progress on server side */
   for (sr = ds->ds_sr; sr; sr = sr->sr_next)
-    if (sr->sr_usage == du && 
-	(sr->sr_method == sip_method_invite || 
+    if (sr->sr_usage == du &&
+	(sr->sr_method == sip_method_invite ||
 	 sr->sr_method == sip_method_update))
       return;
 
   if (ss->ss_timer->refresher == nua_remote_refresher) {
-    ss->ss_reason = "SIP;cause=408;text=\"Session timeout\""; 
+    ss->ss_reason = "SIP;cause=408;text=\"Session timeout\"";
     nua_stack_bye(nh->nh_nua, nh, nua_r_bye, NULL);
     return;
   }
@@ -1534,7 +1542,7 @@
   }
 }
 
-/** @interal Shut down session usage. 
+/** @interal Shut down session usage.
  *
  * @retval >0  shutdown done
  * @retval 0   shutdown in progress
@@ -1601,21 +1609,21 @@
   default:
     break;
   }
-  
+
   nua_dialog_usage_remove(nh, ds, du, NULL, NULL);
 
   return 200;
 }
 
 /**@fn void nua_prack(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
- * Send a PRACK request. 
+ * Send a PRACK request.
  *
  * PRACK is used to acknowledge receipt of 100rel responses. See @RFC3262.
  *
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -1639,7 +1647,7 @@
  * @param nh     operation handle associated with the call
  * @param hmagic application context associated with the call
  * @param sip    response to @b PRACK or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
@@ -1648,7 +1656,7 @@
  * @END_NUA_EVENT
  */
 
-static int nua_prack_client_init(nua_client_request_t *cr, 
+static int nua_prack_client_init(nua_client_request_t *cr,
 				 msg_t *msg, sip_t *sip,
 				 tagi_t const *tags);
 static int nua_prack_client_request(nua_client_request_t *cr,
@@ -1687,7 +1695,7 @@
   return nua_client_create(nh, e, &nua_prack_client_methods, tags);
 }
 
-static int nua_prack_client_init(nua_client_request_t *cr, 
+static int nua_prack_client_init(nua_client_request_t *cr,
 				 msg_t *msg, sip_t *sip,
 				 tagi_t const *tags)
 {
@@ -1724,7 +1732,7 @@
     rseq = sip->sip_rack->ra_response;
 
   if (cri->cr_offer_recv && !cri->cr_answer_sent) {
-    if (nh->nh_soa == NULL) 
+    if (nh->nh_soa == NULL)
       /* It is up to application to handle SDP */
       answer_sent = session_get_description(sip, NULL, NULL);
     else if (sip->sip_payload)
@@ -1741,7 +1749,9 @@
     }
     else {
       answer_sent = 1;
-      soa_activate(nh->nh_soa, NULL);
+      if (soa_activate(nh->nh_soa, NULL) >= 0) {
+	ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+      }
     }
   }
   else if (nh->nh_soa == NULL) {
@@ -1770,12 +1780,12 @@
     cr->cr_offer_sent = offer_sent;
     cr->cr_answer_sent = answer_sent;
 
-    if (offer_sent) 
+    if (offer_sent)
       ss->ss_oa_sent = Offer;
     else if (answer_sent)
       ss->ss_oa_sent = Answer;
 
-    if (cr->cr_restarting) 
+    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() */;
@@ -1806,7 +1816,7 @@
   nua_session_usage_t *ss = nua_dialog_usage_private(du);
   int acked = 0;
 
-  nua_stack_event(nh->nh_nua, nh, 
+  nua_stack_event(nh->nh_nua, nh,
 		  nta_outgoing_getresponse(orq),
 		  cr->cr_event,
 		  status, phrase,
@@ -1823,7 +1833,7 @@
     else if (nua_invite_client_should_ack(du->du_cr)) {
       /* There is an un-ACK-ed INVITE there */
       assert(du->du_cr->cr_method == sip_method_invite);
-      if (NH_PGET(nh, auto_ack) || 
+      if (NH_PGET(nh, auto_ack) ||
 	  /* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */
 	  (ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) {
 	/* There should be no UPDATE with offer/answer
@@ -1848,7 +1858,7 @@
   else if (ss->ss_update_needed && 200 <= status && status < 300 &&
       !SIP_IS_ALLOWED(NH_PGET(nh, appl_method), sip_method_update))
     nua_client_create(nh, nua_r_update, &nua_update_client_methods, NULL);
-  
+
   return 1;
 }
 
@@ -1857,7 +1867,7 @@
 
 /** @NUA_EVENT nua_i_invite
  *
- * Indication of incoming call or re-INVITE request. 
+ * Indication of incoming call or re-INVITE request.
  *
  * @param status statuscode of response sent automatically by stack
  * @param phrase a short textual description of @a status code
@@ -1890,7 +1900,7 @@
  * to a #soa_session_t object. The #nua_i_state event sent to the
  * application immediately after #nua_i_invite will contain the parsing
  * results in SOATAG_REMOTE_SDP() and SOATAG_REMOTE_SDP_STR() tags.
- * 
+ *
  * Note that currently the parser within @nua does not handle MIME
  * multipart. The SDP Offer/Answer engine can get confused if the SDP offer
  * is included in a MIME multipart, therefore such an @b INVITE is rejected
@@ -1935,8 +1945,8 @@
  *
  * @sa nua_respond(), @ref nua_uas_call_model, #nua_i_state,
  * NUTAG_MEDIA_ENABLE(), SOATAG_USER_SDP(), SOATAG_USER_SDP_STR(),
- * @RFC3262, NUTAG_EARLY_ANSWER(), NUTAG_EARLY_MEDIA(), 
- * NUTAG_ONLY183_100REL(), 
+ * @RFC3262, NUTAG_EARLY_ANSWER(), NUTAG_EARLY_MEDIA(),
+ * NUTAG_ONLY183_100REL(),
  * NUTAG_INCLUDE_EXTRA_SDP(),
  * #nua_i_prack, #nua_i_update, nua_update(),
  * nua_invite(), #nua_r_invite
@@ -1964,9 +1974,11 @@
 static int nua_invite_server_report(nua_server_request_t *sr, tagi_t const *);
 
 static int
-  process_ack_or_cancel(nua_server_request_t *, nta_incoming_t *, 
+  process_ack_or_cancel(nua_server_request_t *, nta_incoming_t *,
 			sip_t const *),
   process_ack(nua_server_request_t *, nta_incoming_t *, sip_t const *),
+  process_ack_error(nua_server_request_t *sr, msg_t *ackmsg,
+		    int status, char const *phrase, char const *reason),
   process_cancel(nua_server_request_t *, nta_incoming_t *, sip_t const *),
   process_timeout(nua_server_request_t *, nta_incoming_t *),
   process_prack(nua_server_request_t *,
@@ -1974,11 +1986,11 @@
 		nta_incoming_t *irq,
 		sip_t const *sip);
 
-nua_server_methods_t const nua_invite_server_methods = 
+nua_server_methods_t const nua_invite_server_methods =
   {
     SIP_METHOD_INVITE,
     nua_i_invite,		/* Event */
-    { 
+    {
       1,			/* Create dialog */
       0,			/* Initial request */
       1,			/* Target refresh request  */
@@ -1992,8 +2004,8 @@
   };
 
 
-/** @internal Preprocess incoming invite - sure we have a valid request. 
- * 
+/** @internal Preprocess incoming invite - sure we have a valid request.
+ *
  * @return 0 if request is valid, or error statuscode otherwise
  */
 static int
@@ -2010,9 +2022,9 @@
 
   if (nua_session_server_init(sr))
     return sr->sr_status;
-    
+
   if (sr->sr_usage) {
-    /* Existing session - check for overlap and glare */ 
+    /* Existing session - check for overlap and glare */
 
     nua_server_request_t const *sr0;
     nua_client_request_t const *cr;
@@ -2028,7 +2040,7 @@
       if (sr->sr_sdp && sr0->sr_offer_recv && !sr0->sr_answer_sent)
 	break;
     }
-    
+
     if (sr0) {
       /* Overlapping invites - RFC 3261 14.2 */
       return nua_server_retry_after(sr, 500, "Overlapping Requests", 0, 10);
@@ -2136,9 +2148,9 @@
     soa_init_offer_answer(nh->nh_soa);
 
   if (sr->sr_sdp) {
-    if (nh->nh_soa && 
+    if (nh->nh_soa &&
 	soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
-      SU_DEBUG_5(("nua(%p): %s server: error parsing SDP\n", (void *)nh, 
+      SU_DEBUG_5(("nua(%p): %s server: error parsing SDP\n", (void *)nh,
 		  "INVITE"));
       return SR_STATUS(sr, 400, "Bad Session Description");
     }
@@ -2173,7 +2185,7 @@
   if (NH_PGET(nh, auto_answer) ||
       /* Auto-answer to re-INVITE unless auto_answer is set to 0 on handle */
       (ss->ss_state == nua_callstate_ready &&
-       /* Auto-answer requires enabled media (soa). 
+       /* Auto-answer requires enabled media (soa).
 	* XXX - if the re-INVITE modifies the media we should not auto-answer.
 	*/
        nh->nh_soa &&
@@ -2204,10 +2216,10 @@
   nua_handle_t *nh = sr->sr_owner;
   nua_dialog_usage_t *du = sr->sr_usage;
   nua_session_usage_t *ss = nua_dialog_usage_private(du);
-  msg_t *msg = sr->sr_response.msg; 
-  sip_t *sip = sr->sr_response.sip; 
+  msg_t *msg = sr->sr_response.msg;
+  sip_t *sip = sr->sr_response.sip;
 
-  int reliable = 0, offer = 0, answer = 0, early_answer = 0, extra = 0;
+  int reliable = 0, maybe_answer = 0, offer = 0, answer = 0, extra = 0;
 
   enter;
 
@@ -2217,14 +2229,17 @@
     return nua_base_server_respond(sr, tags);
   }
 
-  if (nua_invite_server_is_100rel(sr, tags)) {
-    reliable = 1, early_answer = 1;
+  if (200 <= sr->sr_status && sr->sr_status < 300) {
+    reliable = 1, maybe_answer = 1;
+  }
+  else if (nua_invite_server_is_100rel(sr, tags)) {
+    reliable = 1, maybe_answer = 1;
   }
   else if (!nh->nh_soa || sr->sr_status >= 300) {
     if (sr->sr_neutral)
       return nua_base_server_respond(sr, tags);
   }
-  else if (tags && 100 < sr->sr_status && sr->sr_status < 200 && 
+  else if (tags && 100 < sr->sr_status && sr->sr_status < 200 &&
 	   !NHP_ISSET(nh->nh_prefs, early_answer)) {
     sdp_session_t const *user_sdp = NULL;
     char const *user_sdp_str = NULL;
@@ -2234,10 +2249,10 @@
 	    SOATAG_USER_SDP_STR_REF(user_sdp_str),
 	    TAG_END());
 
-    early_answer = user_sdp || user_sdp_str;
+    maybe_answer = user_sdp || user_sdp_str;
   }
   else {
-    early_answer = NH_PGET(nh, early_answer);
+    maybe_answer = NH_PGET(nh, early_answer);
   }
 
   if (!nh->nh_soa) {
@@ -2259,11 +2274,12 @@
     tagi_t const *t = tl_find_last(tags, nutag_include_extra_sdp);
     extra = t && t->t_value;
   }
-  else if (sr->sr_offer_recv && !sr->sr_answer_sent && early_answer) {
-    /* Generate answer */ 
+  else if (sr->sr_offer_recv && !sr->sr_answer_sent && maybe_answer) {
+    /* Generate answer */
     if (soa_generate_answer(nh->nh_soa, NULL) >= 0 &&
 	soa_activate(nh->nh_soa, NULL) >= 0) {
       answer = 1;      /* signal that O/A answer sent (answer to invite) */
+      /* ss_sdp_version is updated only after answer is sent reliably */
     }
     /* We have an error! */
     else if (sr->sr_status >= 200) {
@@ -2271,11 +2287,11 @@
       int wcode;
       char const *text;
       char const *host = "invalid.";
-      
+
       sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
-      
+
       wcode = soa_get_warning(nh->nh_soa, &text);
-      
+
       if (wcode) {
 	if (sip->sip_contact)
 	  host = sip->sip_contact->m_url->url_host;
@@ -2288,12 +2304,16 @@
       /* 1xx - we don't have to send answer */
     }
   }
-  else if (sr->sr_offer_recv && sr->sr_answer_sent == 1 && early_answer) {
+  else if (sr->sr_offer_recv && sr->sr_answer_sent == 1 && maybe_answer) {
     /* The answer was sent unreliably, keep sending it */
     answer = 1;
   }
   else if (!sr->sr_offer_recv && !sr->sr_offer_sent && reliable) {
-    /* Generate offer */
+    if (200 <= sr->sr_status && nua_callstate_ready <= ss->ss_state &&
+	NH_PGET(nh, refresh_without_sdp))
+      /* This is a re-INVITE without SDP - do not try to send offer in 200 */;
+    else
+      /* Generate offer */
     if (soa_generate_offer(nh->nh_soa, 0, NULL) < 0)
       sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
     else
@@ -2307,6 +2327,10 @@
       sr->sr_offer_sent = 1 + reliable, ss->ss_oa_sent = Offer;
     else if (answer)
       sr->sr_answer_sent = 1 + reliable, ss->ss_oa_sent = Answer;
+
+    if (answer && reliable && nh->nh_soa) {
+      ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+    }
   }
 
   if (reliable && sr->sr_status < 200) {
@@ -2320,7 +2344,7 @@
   if (200 <= sr->sr_status && sr->sr_status < 300) {
     session_timer_preferences(ss->ss_timer,
 			      sip,
-			      NH_PGET(nh, supported),		     
+			      NH_PGET(nh, supported),
 			      NH_PGET(nh, session_timer),
 			      NUA_PISSET(nh->nh_nua, nh, session_timer),
 			      NH_PGET(nh, refresher),
@@ -2330,7 +2354,7 @@
       session_timer_add_headers(ss->ss_timer, 0, msg, sip);
   }
 
-  return nua_base_server_respond(sr, tags);  
+  return nua_base_server_respond(sr, tags);
 }
 
 /** Check if the response should be sent reliably.
@@ -2340,16 +2364,15 @@
 int nua_invite_server_is_100rel(nua_server_request_t *sr, tagi_t const *tags)
 {
   nua_handle_t *nh = sr->sr_owner;
-  sip_t const *sip = sr->sr_response.sip;
   sip_require_t *require = sr->sr_request.sip->sip_require;
   sip_supported_t *supported = sr->sr_request.sip->sip_supported;
 
   if (sr->sr_status >= 200)
-    return 1;
+    return 0;
   else if (sr->sr_status == 100)
     return 0;
 
-  if (sip_has_feature(sip->sip_require, "100rel"))
+  if (sip_has_feature(sr->sr_response.sip->sip_require, "100rel"))
     return 1;
 
   if (require == NULL && supported == NULL)
@@ -2392,9 +2415,9 @@
   }
 
   retval = nua_base_server_report(sr, tags), sr = NULL; /* destroys sr */
-  
+
   if (retval >= 2 || ss == NULL) {
-    /* Session has been terminated. */ 
+    /* Session has been terminated. */
     if (!initial && !neutral) {
 #if 0
       signal_call_state_change(nh, NULL, status, phrase,
@@ -2460,8 +2483,8 @@
 
 /** @NUA_EVENT nua_i_ack
  *
- * Final response to INVITE has been acknowledged by UAC with ACK. 
- * 
+ * Final response to INVITE has been acknowledged by UAC with ACK.
+ *
  * @note This event is only sent after 2XX response.
  *
  * @param nh     operation handle associated with the call
@@ -2470,10 +2493,10 @@
  * @param tags   empty
  *
  * @sa #nua_i_invite, #nua_i_state, @ref nua_uas_call_model, nua_ack()
- * 
+ *
  * @END_NUA_EVENT
  */
-
+static
 int process_ack(nua_server_request_t *sr,
 		nta_incoming_t *irq,
 		sip_t const *sip)
@@ -2489,7 +2512,6 @@
   if (sr->sr_offer_sent && !sr->sr_answer_recv) {
     char const *sdp;
     size_t len;
-    int error;
 
     if (session_get_description(sip, &sdp, &len))
       recv = Answer;
@@ -2501,30 +2523,43 @@
 
     if (nh->nh_soa == NULL)
       ;
-    else if (recv == NULL ||
-	     soa_set_remote_sdp(nh->nh_soa, NULL, sdp, len) < 0 ||
-	     soa_process_answer(nh->nh_soa, NULL) < 0 ||
-	     soa_activate(nh->nh_soa, NULL) < 0) {
-      int status; char const *phrase, *reason;
+    else if (recv == NULL ) {
+      if (ss->ss_state >= nua_callstate_ready &&
+	  soa_get_user_version(nh->nh_soa) == ss->ss_sdp_version &&
+	  soa_process_reject(nh->nh_soa, NULL) >= 0) {
+	url_t const *m;
 
-      status = soa_error_as_sip_response(nh->nh_soa, &phrase);
-      reason = soa_error_as_sip_reason(nh->nh_soa);
+	/* The re-INVITE was a refresh and re-INVITEr ignored our offer */
+	ss->ss_oa_sent = NULL;
 
-      nua_stack_event(nh->nh_nua, nh, msg,
-		      nua_i_ack, status, phrase, NULL);
-      nua_stack_event(nh->nh_nua, nh, NULL,
-		      nua_i_media_error, status, phrase, NULL);
+	if (sr->sr_request.sip->sip_contact)
+	  m = sr->sr_request.sip->sip_contact->m_url;
+	else
+	  m = sr->sr_request.sip->sip_from->a_url;
 
-      ss->ss_reporting = 1;	/* We report terminated state here if BYE fails */
-      error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
-      ss->ss_reporting = 0;
+	SU_DEBUG_3(("nua(%p): re-INVITEr ignored offer in our %u response "
+		    "(Contact: <" URL_PRINT_FORMAT  ">)\n",
+		    (void *)nh, sr->sr_status, URL_PRINT_ARGS(m)));
+	if (sr->sr_request.sip->sip_user_agent)
+	  SU_DEBUG_3(("nua(%p): re-INVITE: \"User-Agent: %s\"\n", (void *)nh,
+		      sr->sr_request.sip->sip_user_agent->g_string));
+      }
+      else
+	return process_ack_error(sr, msg, 488, "Offer-Answer error",
+				 "SIP;cause=488;text=\"No answer to offer\"");
+    }
+    else if (soa_set_remote_sdp(nh->nh_soa, NULL, sdp, len) >= 0 &&
+	     soa_process_answer(nh->nh_soa, NULL) >= 0 &&
+	     soa_activate(nh->nh_soa, NULL) >= 0) {
+      ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+    }
+    else {
+      int status; char const *phrase, *reason;
 
-      signal_call_state_change(nh, ss, 488, "Offer-Answer Error",
-			       error
-			       ? nua_callstate_terminated
-			       : nua_callstate_terminating);
+      status = soa_error_as_sip_response(nh->nh_soa, &phrase);
+      reason = soa_error_as_sip_reason(nh->nh_soa);
 
-      return 0;
+      return process_ack_error(sr, msg, status, phrase, reason);
     }
   }
 
@@ -2540,6 +2575,38 @@
   return 0;
 }
 
+static int
+process_ack_error(nua_server_request_t *sr,
+		  msg_t *ackmsg,
+		  int status,
+		  char const *phrase,
+		  char const *reason)
+{
+  nua_handle_t *nh = sr->sr_owner;
+  nua_session_usage_t *ss = nua_dialog_usage_private(sr->sr_usage);
+  int error;
+
+  nua_stack_event(nh->nh_nua, nh, ackmsg,
+		  nua_i_ack, status, phrase, NULL);
+  nua_stack_event(nh->nh_nua, nh, NULL,
+		  nua_i_media_error, status, phrase, NULL);
+
+  if (reason) ss->ss_reason = reason;
+  ss->ss_reporting = 1;
+  error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
+  ss->ss_reporting = 0;
+
+  signal_call_state_change(nh, ss,
+			   488, "Offer-Answer Error",
+			   /* We report terminated state if BYE failed */
+			   error
+			   ? nua_callstate_terminated
+			   : nua_callstate_terminating);
+
+  return 0;
+}
+
+
 /** @NUA_EVENT nua_i_cancel
  *
  * Incoming INVITE has been cancelled by the client.
@@ -2601,7 +2668,7 @@
   if (nua_server_request_is_pending(sr)) {
     /* PRACK timeout */
     SR_STATUS1(sr, SIP_504_GATEWAY_TIME_OUT);
-    nua_server_trespond(sr, 
+    nua_server_trespond(sr,
 			SIPTAG_REASON_STR(reason),
 			TAG_END());
     if (nua_server_report(sr) >= 2)
@@ -2642,7 +2709,7 @@
  * @param tags   empty
  *
  * @sa nua_prack(), #nua_r_prack, @RFC3262, NUTAG_EARLY_MEDIA()
- * 
+ *
  * @END_NUA_EVENT
  */
 
@@ -2650,11 +2717,11 @@
 int nua_prack_server_respond(nua_server_request_t *sr, tagi_t const *tags);
 int nua_prack_server_report(nua_server_request_t *sr, tagi_t const *tags);
 
-nua_server_methods_t const nua_prack_server_methods = 
+nua_server_methods_t const nua_prack_server_methods =
   {
     SIP_METHOD_PRACK,
     nua_i_prack,		/* Event */
-    { 
+    {
       0,			/* Do not create dialog */
       1,			/* In-dialog request */
       1,			/* Target refresh request  */
@@ -2677,7 +2744,7 @@
   nua_dialog_usage_t *du;
 
   nta_reliable_destroy(rel);
-  if (irq == NULL)  
+  if (irq == NULL)
     /* Final response interrupted 100rel, we did not actually receive PRACK */
     return 200;
 
@@ -2720,7 +2787,7 @@
 
   if (sri == NULL)
     return SR_STATUS(sr, 481, "No Such Preliminary Response");
-  
+
   if (nua_session_server_init(sr))
     return sr->sr_status;
 
@@ -2729,7 +2796,7 @@
     char const *offeranswer;
 
     /* XXX - check for overlap? */
-    
+
     if (sri->sr_offer_sent && !sri->sr_answer_recv)
       sr->sr_answer_recv = 1, sri->sr_answer_recv = 1, offeranswer = Answer;
     else
@@ -2741,7 +2808,7 @@
 	soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
       SU_DEBUG_5(("nua(%p): %s server: error parsing %s\n", (void *)nh,
 		  "PRACK", offeranswer));
-      return 
+      return
 	sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
     }
   }
@@ -2753,7 +2820,7 @@
 {
   nua_handle_t *nh = sr->sr_owner;
 
-  if (sr->sr_status < 200 || 300 <= sr->sr_status) 
+  if (sr->sr_status < 200 || 300 <= sr->sr_status)
     return nua_base_server_respond(sr, tags);
 
   if (sr->sr_sdp) {
@@ -2767,8 +2834,8 @@
     }
     else if ((sr->sr_offer_recv && soa_generate_answer(nh->nh_soa, NULL) < 0) ||
 	     (sr->sr_answer_recv && soa_process_answer(nh->nh_soa, NULL) < 0)) {
-      SU_DEBUG_5(("nua(%p): %s server: %s %s\n", 
-		  (void *)nh, "PRACK", 
+      SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
+		  (void *)nh, "PRACK",
 		  "error processing",
 		  sr->sr_offer_recv ? Offer : Answer));
       sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
@@ -2798,7 +2865,7 @@
   if (retval >= 2 || ss == NULL) {
 #if 0
     signal_call_state_change(nh, NULL,
-			     status, phrase, 
+			     status, phrase,
 			     nua_callstate_terminated);
 #endif
     return retval;
@@ -2807,10 +2874,12 @@
   if (offer_recv_or_answer_sent) {
     /* signal offer received, answer sent */
     signal_call_state_change(nh, ss,
-			     status, phrase, 
+			     status, phrase,
 			     ss->ss_state);
-    if (nh->nh_soa)
+    if (nh->nh_soa) {
       soa_activate(nh->nh_soa, NULL);
+      ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+    }
   }
 
   if (status < 200 || 300 <= status)
@@ -2819,15 +2888,15 @@
   assert(sri);
 
   if (sri == NULL) {
-    
+
   }
   else if (SR_HAS_SAVED_SIGNAL(sri)) {
     nua_signal_data_t const *e;
-    
+
     e = nua_signal_data(sri->sr_signal);
 
     sri->sr_application = SR_STATUS(sri, e->e_status, e->e_phrase);
-    
+
     nua_server_params(sri, e->e_tags);
     nua_server_respond(sri, e->e_tags);
     nua_server_report(sri);
@@ -2959,15 +3028,15 @@
 
 /**@fn void nua_info(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
  *
- * Send an INFO request. 
+ * Send an INFO request.
  *
- * INFO is used to send call related information like DTMF 
+ * INFO is used to send call related information like DTMF
  * digit input events. See @RFC2976.
  *
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -2979,7 +3048,7 @@
  * @sa #nua_i_info
  */
 
-static int nua_info_client_init(nua_client_request_t *cr, 
+static int nua_info_client_init(nua_client_request_t *cr,
 				msg_t *msg, sip_t *sip,
 				tagi_t const *tags);
 
@@ -3011,7 +3080,7 @@
   return nua_client_create(nh, e, &nua_info_client_methods, tags);
 }
 
-static int nua_info_client_init(nua_client_request_t *cr, 
+static int nua_info_client_init(nua_client_request_t *cr,
 				msg_t *msg, sip_t *sip,
 				tagi_t const *tags)
 {
@@ -3049,7 +3118,7 @@
  * @param nh     operation handle associated with the call
  * @param hmagic application context associated with the call
  * @param sip    response to @b INFO or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
@@ -3070,15 +3139,15 @@
  * @param tags   empty
  *
  * @sa nua_info(), #nua_r_info, @RFC2976
- * 
+ *
  * @END_NUA_EVENT
  */
 
-nua_server_methods_t const nua_info_server_methods = 
+nua_server_methods_t const nua_info_server_methods =
   {
     SIP_METHOD_INFO,
     nua_i_info,			/* Event */
-    { 
+    {
       0,			/* Do not create dialog */
       1,			/* In-dialog request */
       0,			/* Not a target refresh request  */
@@ -3096,8 +3165,8 @@
 
 /**@fn void nua_update(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
  *
- * Update a session. 
- * 
+ * Update a session.
+ *
  * Update a session using SIP UPDATE method. See @RFC3311.
  *
  * Update method can be used when the session has been established with
@@ -3108,7 +3177,7 @@
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -3122,7 +3191,7 @@
  * @sa @ref nua_call_model, @RFC3311, nua_update(), #nua_i_update
  */
 
-static int nua_update_client_init(nua_client_request_t *cr, 
+static int nua_update_client_init(nua_client_request_t *cr,
 				  msg_t *msg, sip_t *sip,
 				  tagi_t const *tags);
 static int nua_update_client_request(nua_client_request_t *cr,
@@ -3161,7 +3230,7 @@
   return nua_client_create(nh, e, &nua_update_client_methods, tags);
 }
 
-static int nua_update_client_init(nua_client_request_t *cr, 
+static int nua_update_client_init(nua_client_request_t *cr,
 				  msg_t *msg, sip_t *sip,
 				  tagi_t const *tags)
 {
@@ -3183,7 +3252,7 @@
   nua_server_request_t *sr;
   nua_client_request_t *cri;
   int offer_sent = 0, retval;
-  
+
   if (du == NULL)		/* Call terminated */
     return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
 
@@ -3225,7 +3294,7 @@
   /* Add session timer headers */
   session_timer_preferences(ss->ss_timer,
 			    sip,
-			    NH_PGET(nh, supported),		     
+			    NH_PGET(nh, supported),
 			    NH_PGET(nh, session_timer),
 			    NUA_PISSET(nh->nh_nua, nh, session_timer),
 			    NH_PGET(nh, refresher),
@@ -3299,7 +3368,7 @@
  * @param nh     operation handle associated with the call
  * @param hmagic application context associated with the call
  * @param sip    response to UPDATE request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
@@ -3318,7 +3387,7 @@
   nua_dialog_usage_t *du = cr->cr_usage;
   nua_session_usage_t *ss = nua_dialog_usage_private(du);
 
-  nua_stack_event(nh->nh_nua, nh, 
+  nua_stack_event(nh->nh_nua, nh,
 		  nta_outgoing_getresponse(orq),
 		  cr->cr_event,
 		  status, phrase,
@@ -3336,7 +3405,7 @@
       /* There is an un-ACK-ed INVITE there */
       assert(du->du_cr->cr_method == sip_method_invite);
 
-      if (NH_PGET(nh, auto_ack) || 
+      if (NH_PGET(nh, auto_ack) ||
 	  /* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */
 	  (ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) {
 	if (nua_invite_client_ack(du->du_cr, NULL) > 0)
@@ -3360,11 +3429,11 @@
 int nua_update_server_respond(nua_server_request_t *sr, tagi_t const *tags);
 int nua_update_server_report(nua_server_request_t *, tagi_t const *);
 
-nua_server_methods_t const nua_update_server_methods = 
+nua_server_methods_t const nua_update_server_methods =
   {
     SIP_METHOD_UPDATE,
     nua_i_update,		/* Event */
-    { 
+    {
       0,			/* Do not create dialog */
       1,			/* In-dialog request */
       1,			/* Target refresh request  */
@@ -3429,7 +3498,7 @@
 	soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
       SU_DEBUG_5(("nua(%p): %s server: error parsing %s\n", (void *)nh,
 		  "UPDATE", Offer));
-      return 
+      return
 	sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
     }
 
@@ -3455,7 +3524,7 @@
       sr->sr_answer_sent = 1, ss ? ss->ss_oa_sent = Answer : Answer;
     }
     else if (soa_generate_answer(nh->nh_soa, NULL) < 0) {
-      SU_DEBUG_5(("nua(%p): %s server: %s %s\n", 
+      SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
 		  (void *)nh, "UPDATE", "error processing", Offer));
       sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
     }
@@ -3469,13 +3538,14 @@
     }
     else {
       sr->sr_answer_sent = 1, ss->ss_oa_sent = Answer;
+      ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
     }
   }
 
   if (200 <= sr->sr_status && sr->sr_status < 300) {
     session_timer_preferences(ss->ss_timer,
 			      sip,
-			      NH_PGET(nh, supported),		     
+			      NH_PGET(nh, supported),
 			      NH_PGET(nh, session_timer),
 			      NUA_PISSET(nh->nh_nua, nh, session_timer),
 			      NH_PGET(nh, refresher),
@@ -3527,7 +3597,7 @@
 
   if (retval >= 2 || ss == NULL) {
 #if 0
-    signal_call_state_change(nh, NULL, status, phrase, 
+    signal_call_state_change(nh, NULL, status, phrase,
 			     nua_callstate_terminated);
 #endif
     return retval;
@@ -3536,7 +3606,7 @@
   if (offer_recv_or_answer_sent) {
     /* signal offer received, answer sent */
     enum nua_callstate state = ss->ss_state;
-    
+
     if (state == nua_callstate_ready && status < 200)
       state = nua_callstate_received;
 
@@ -3545,13 +3615,13 @@
 
   if (200 <= status && status < 300
       && ss->ss_state < nua_callstate_ready
-      && ss->ss_precondition 
+      && ss->ss_precondition
       && !ss->ss_alerting
       && NH_PGET(nh, auto_alert))  {
     nua_server_request_t *sri;
-    
+
     for (sri = nh->nh_ds->ds_sr; sri; sri = sr->sr_next)
-      if (sri->sr_method == sip_method_invite && 
+      if (sri->sr_method == sip_method_invite &&
 	  nua_server_request_is_pending(sri))
 	break;
 
@@ -3572,13 +3642,13 @@
  *
  * Hangdown a call.
  *
- * Hangdown a call using SIP BYE method. Also the media session 
- * associated with the call is terminated. 
+ * Hangdown a call using SIP BYE method. Also the media session
+ * associated with the call is terminated.
  *
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -3589,7 +3659,7 @@
  *    #nua_i_media_error
  */
 
-static int nua_bye_client_init(nua_client_request_t *cr, 
+static int nua_bye_client_init(nua_client_request_t *cr,
 			       msg_t *msg, sip_t *sip,
 			       tagi_t const *tags);
 static int nua_bye_client_request(nua_client_request_t *cr,
@@ -3624,7 +3694,7 @@
 {
   nua_session_usage_t *ss = nua_session_usage_for_dialog(nh->nh_ds);
 
-  if (ss && 
+  if (ss &&
       nua_callstate_calling <= ss->ss_state &&
       ss->ss_state <= nua_callstate_proceeding)
     return nua_client_create(nh, e, &nua_cancel_client_methods, tags);
@@ -3632,7 +3702,7 @@
     return nua_client_create(nh, e, &nua_bye_client_methods, tags);
 }
 
-static int nua_bye_client_init(nua_client_request_t *cr, 
+static int nua_bye_client_init(nua_client_request_t *cr,
 			       msg_t *msg, sip_t *sip,
 			       tagi_t const *tags)
 {
@@ -3708,12 +3778,12 @@
  * @param nh     operation handle associated with the call
  * @param hmagic application context associated with the call
  * @param sip    response to BYE request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   empty
  *
  * @sa nua_bye(), @ref nua_call_model, #nua_i_state, #nua_r_invite()
- * 
+ *
  * @END_NUA_EVENT
  */
 
@@ -3726,7 +3796,7 @@
   nua_handle_t *nh = cr->cr_owner;
   nua_dialog_usage_t *du = cr->cr_usage;
 
-  nua_stack_event(nh->nh_nua, nh, 
+  nua_stack_event(nh->nh_nua, nh,
 		  nta_outgoing_getresponse(orq),
 		  cr->cr_event,
 		  status, phrase,
@@ -3751,7 +3821,7 @@
 
     nua_client_bind(cr, NULL);
 
-    signal_call_state_change(nh, ss, status, "to BYE", 
+    signal_call_state_change(nh, ss, status, "to BYE",
 			     nua_callstate_terminated);
 
     for (cri = du->du_dialog->ds_cr; cri; cri = cri->cr_next) {
@@ -3787,11 +3857,11 @@
 int nua_bye_server_init(nua_server_request_t *sr);
 int nua_bye_server_report(nua_server_request_t *sr, tagi_t const *tags);
 
-nua_server_methods_t const nua_bye_server_methods = 
+nua_server_methods_t const nua_bye_server_methods =
   {
     SIP_METHOD_BYE,
     nua_i_bye,			/* Event */
-    { 
+    {
       0,			/* Do not create dialog */
       1,			/* In-dialog request */
       0,			/* Not a target refresh request  */
@@ -3879,7 +3949,7 @@
  *
  * @brief Call state has changed.
  *
- * This event will be sent whenever the call state changes. 
+ * This event will be sent whenever the call state changes.
  *
  * In addition to basic changes of session status indicated with enum
  * ::nua_callstate, the @RFC3264 SDP Offer/Answer negotiation status is also
@@ -3907,7 +3977,7 @@
  * @param nh     operation handle associated with the call
  * @param hmagic application context associated with the call
  * @param sip    NULL
- * @param tags   NUTAG_CALLSTATE(), 
+ * @param tags   NUTAG_CALLSTATE(),
  *               SOATAG_LOCAL_SDP(), SOATAG_LOCAL_SDP_STR(),
  *               NUTAG_OFFER_SENT(), NUTAG_ANSWER_SENT(),
  *               SOATAG_REMOTE_SDP(), SOATAG_REMOTE_SDP_STR(),
@@ -3916,7 +3986,7 @@
  *               SOATAG_ACTIVE_IMAGE(), SOATAG_ACTIVE_CHAT().
  *
  * @sa @ref nua_call_model, #nua_i_active, #nua_i_terminated,
- * nua_invite(), #nua_r_invite, #nua_i_invite, nua_respond(), 
+ * nua_invite(), #nua_r_invite, #nua_i_invite, nua_respond(),
  * NUTAG_MEDIA_ENABLE(),
  * NUTAG_AUTOALERT(), NUTAG_AUTOANSWER(), NUTAG_EARLY_MEDIA(),
  * NUTAG_EARLY_ANSWER(), NUTAG_INCLUDE_EXTRA_SDP(),
@@ -4005,14 +4075,14 @@
 	next_state = ss->ss_state;
       else if (ss->ss_state == nua_callstate_terminating)
 	return;
-      else 
+      else
 	ss->ss_state = next_state = nua_callstate_terminated;
     }
     else if (next_state > ss_state)
       ss->ss_state = next_state;
   }
 
-  if (next_state == nua_callstate_init) 
+  if (next_state == nua_callstate_init)
     next_state = nua_callstate_terminated;
 
   if (ss && ss->ss_state == nua_callstate_ready)
@@ -4095,7 +4165,7 @@
  *
  * @deprecated Use #nua_i_state instead.
  *
- * @sa @ref nua_call_model, #nua_i_state, #nua_i_terminated, 
+ * @sa @ref nua_call_model, #nua_i_state, #nua_i_terminated,
  * #nua_i_invite
  *
  * @END_NUA_EVENT
@@ -4152,7 +4222,7 @@
   return t->local.supported;
 }
 
-/** Set session timer preferences  */ 
+/** Set session timer preferences  */
 static
 void session_timer_preferences(struct session_timer *t,
 			       sip_t const *sip,
@@ -4190,7 +4260,7 @@
 	t->local.min_se = sip->sip_min_se->min_delta;
       if (t->local.expires != 0 && t->local.min_se > t->local.expires)
 	t->local.expires = t->local.min_se;
-  
+
       return nua_client_restart(cr, 100, "Re-Negotiating Session Timer");
     }
   }
@@ -4231,7 +4301,7 @@
     /* Include extension parameters, if any */
     if (request->sip_min_se)
       min_se->min_params = request->sip_min_se->min_params;
-    
+
     sip_add_dup(msg, sip, (sip_header_t *)min_se);
 
     return 422;
@@ -4240,7 +4310,7 @@
   return 0;
 }
 
-/** Store session timer parameters in request from uac / response from uas */ 
+/** Store session timer parameters in request from uac / response from uas */
 static
 void session_timer_store(struct session_timer *t,
 			 sip_t const *sip)
@@ -4279,7 +4349,7 @@
 }
 
 /** Add timer feature and Session-Expires/Min-SE headers to request/response
- * 
+ *
  */
 static int
 session_timer_add_headers(struct session_timer *t,
@@ -4307,7 +4377,7 @@
 
   if (uas) {
     session_timer_negotiate(t);
-    
+
     refresher = t->refresher;
     expires = t->interval;
   }
@@ -4370,7 +4440,7 @@
     t->interval = t->local.expires;
   if (t->local.defaults != 0 && t->interval > t->local.defaults)
     t->interval = t->local.defaults;
-    
+
   if (t->interval != 0) {
     if (t->interval < t->local.min_se)
       t->interval = t->local.min_se;
@@ -4412,7 +4482,7 @@
        interval is RECOMMENDED. */
     unsigned interval = t->interval;
 
-    interval -= 32 > interval / 6 ? interval / 3 : 32 + interval / 3;
+    interval -= 32 > interval / 3 ? interval / 3 : 32;
 
     nua_dialog_usage_set_refresh_range(du, interval, interval);
     t->timer_set = 1;
@@ -4582,11 +4652,11 @@
 
 int nua_options_server_respond(nua_server_request_t *sr, tagi_t const *tags);
 
-nua_server_methods_t const nua_options_server_methods = 
+nua_server_methods_t const nua_options_server_methods =
   {
     SIP_METHOD_OPTIONS,
     nua_i_options,		/* Event */
-    { 
+    {
       0,			/* Do not create dialog */
       0,			/* Initial request */
       0,			/* Not a target refresh request  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	Tue Dec 23 07:37:03 2008
@@ -92,7 +92,7 @@
 typedef struct nua_ee_data {
   nua_t *ee_nua;
   nua_event_data_t ee_data[1];
-} nua_ee_data_t;		
+} nua_ee_data_t;
 
 /** @internal Linked stack frames from nua event callback */
 struct nua_event_frame_s {
@@ -170,7 +170,7 @@
   dnh->nh_prefs = (void *)(dnh + 1);
   dnh->nh_valid = nua_valid_handle_cookie;
   dnh->nh_nua = nua;
-  nua_handle_ref(dnh); dnh->nh_ref_by_stack = 1; 
+  nua_handle_ref(dnh); dnh->nh_ref_by_stack = 1;
   nua_handle_ref(dnh); dnh->nh_ref_by_user = 1;
   nh_append(nua, dnh);
   dnh->nh_identity = dnh;
@@ -201,7 +201,7 @@
 				       TAG_END());
 
   if (nua->nua_nta == NULL ||
-      dnh->nh_ds->ds_leg == NULL || 
+      dnh->nh_ds->ds_leg == NULL ||
       nta_agent_set_params(nua->nua_nta, NTATAG_UA(1), TAG_END()) < 0 ||
       nua_stack_init_transport(nua, nua->nua_args) < 0) {
     SU_DEBUG_1(("nua: initializing SIP stack failed\n"));
@@ -295,7 +295,7 @@
   if ((event > nua_r_authenticate && event <= nua_r_ack)
       || event < nua_i_error
       || (nh && !nh->nh_valid)
-      || (nua->nua_shutdown && event != nua_r_shutdown && 
+      || (nua->nua_shutdown && event != nua_r_shutdown &&
 	  !nua->nua_prefs->ngp_shutdown_events)) {
     if (msg)
       msg_destroy(msg);
@@ -380,7 +380,7 @@
     if (!nh->nh_ref_by_user) {
       /* Application must now call nua_handle_destroy() */
       nh->nh_ref_by_user = 1;
-      nua_handle_ref(nh);	
+      nua_handle_ref(nh);
     }
   }
   else if (!nh->nh_valid) {	/* Handle has been destroyed */
@@ -398,7 +398,7 @@
 
   if (nua->nua_callback) {
     nua_event_frame_t frame[1];
-    
+
     su_msg_save(frame->nf_saved, sumsg);
     frame->nf_next = nua->nua_current, nua->nua_current = frame;
 
@@ -429,9 +429,9 @@
   return NULL;
 }
 
-/** Get request message from saved nua event. @NEW_1_12_4. 
+/** Get request message from saved nua event. @NEW_1_12_4.
  *
- * @sa nua_save_event(), nua_respond(), NUTAG_WITH_SAVED(), 
+ * @sa nua_save_event(), nua_respond(), NUTAG_WITH_SAVED(),
  */
 msg_t *nua_saved_event_request(nua_saved_event_t const *saved)
 {
@@ -514,7 +514,7 @@
     e->e_phrase = phrase;
 
     su_msg_deinitializer(sumsg, nua_event_deinit);
-      
+
     retval = su_msg_send_to(sumsg, nua->nua_server, nua_stack_signal);
 
     if (retval == 0){
@@ -649,7 +649,7 @@
   case nua_r_respond:
     nua_stack_respond(nua, nh, e->e_status, e->e_phrase, tags);
     break;
-  case nua_r_destroy: 
+  case nua_r_destroy:
     nua_stack_destroy_handle(nua, nh, tags);
     su_msg_destroy(nua->nua_signal);
     return;
@@ -1102,7 +1102,7 @@
   return 0;
 }
 
-sip_replaces_t *nua_stack_handle_make_replaces(nua_handle_t *nh, 
+sip_replaces_t *nua_stack_handle_make_replaces(nua_handle_t *nh,
 					       su_home_t *home,
 					       int early_only)
 {
@@ -1184,7 +1184,7 @@
 /** @NUA_EVENT nua_r_authenticate
  *
  * Response to nua_authenticate(). Under normal operation, this event is
- * never sent but rather the unauthenticated operation is completed. 
+ * never sent but rather the unauthenticated operation is completed.
  * However, if there is no operation to authentication or if there is an
  * authentication error the #nua_r_authenticate event is sent to the
  * application with the status code as follows:
@@ -1195,16 +1195,16 @@
  *   There was internal problem updating authenticator.
  * - <i>904 No matching challenge</i>:\n
  *   There was no challenge matching with the credentials provided by
- *   nua_authenticate(), e.g., their realm did not match with the one 
+ *   nua_authenticate(), e.g., their realm did not match with the one
  *   received with the challenge.
- * 
- * @param status status code from authentication 
+ *
+ * @param status status code from authentication
  * @param phrase a short textual description of @a status code
  * @param nh     operation handle authenticated
  * @param hmagic application context associated with the handle
  * @param sip    NULL
  * @param tags   empty
- * 
+ *
  * @sa nua_terminate(), nua_handle_destroy()
  *
  * @END_NUA_EVENT
@@ -1223,14 +1223,14 @@
       nua_client_restart_request(cr, cr->cr_terminating, tags);
     }
     else {
-      nua_stack_event(nua, nh, NULL, e, 
+      nua_stack_event(nua, nh, NULL, e,
 		      202, "No operation to restart",
 		      NULL);
     }
   }
   else if (cr && cr->cr_wait_for_cred) {
     cr->cr_waiting = cr->cr_wait_for_cred = 0;
-    
+
     if (status < 0)
       nua_client_response(cr, 900, "Operation cannot add credentials", NULL);
     else
@@ -1349,7 +1349,7 @@
   }
   else if (initial && sip->sip_to->a_tag) {
     /* RFC 3261 section 12.2.2:
-       
+
        If the UAS wishes to reject the request because it does not wish to
        recreate the dialog, it MUST respond to the request with a 481
        (Call/Transaction Does Not Exist) status code and pass that to the
@@ -1465,7 +1465,7 @@
     return 0;
 
   return 501;
-}		 
+}
 
 #undef nua_base_server_init
 #undef nua_base_server_preprocess
@@ -1506,7 +1506,7 @@
 }
 
 /**@fn void nua_respond(nua_handle_t *nh, int status, char const *phrase, tag_type_t tag, tag_value_t value, ...);
- * 
+ *
  * Respond to a request with given status code and phrase.
  *
  * The stack returns a SIP response message with given status code and
@@ -1526,7 +1526,7 @@
  * @param phrase          free text (default response phrase is used if NULL)
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Responses by Protocol Engine
@@ -1642,7 +1642,7 @@
 
 #undef nua_base_server_params
 
-int nua_base_server_params(nua_server_request_t *sr, tagi_t const *tags) 
+int nua_base_server_params(nua_server_request_t *sr, tagi_t const *tags)
 {
   return 0;
 }
@@ -1714,7 +1714,7 @@
 	   sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, supported)) < 0)
     ;
   else if (!sip->sip_user_agent && NH_PGET(nh, user_agent) &&
-	   sip_add_make(msg, sip, sip_user_agent_class, 
+	   sip_add_make(msg, sip, sip_user_agent_class,
 			NH_PGET(nh, user_agent)) < 0)
     ;
   else if (!sip->sip_organization && NH_PGET(nh, organization) &&
@@ -1724,10 +1724,10 @@
   else if (!sip->sip_allow && NH_PGET(nh, allow) &&
 	   sip_add_dup(msg, sip, (void *)NH_PGET(nh, allow)) < 0)
     ;
-  else if (!sip->sip_allow_events && 
+  else if (!sip->sip_allow_events &&
 	   NH_PGET(nh, allow_events) &&
 	   (method == sip_method_publish || method == sip_method_subscribe ||
-	    method == sip_method_options || method == sip_method_refer || 
+	    method == sip_method_options || method == sip_method_refer ||
 	    (sr->sr_initial &&
 	     (method == sip_method_invite ||
 	      method == sip_method_notify))) &&
@@ -1735,8 +1735,8 @@
     ;
   else if (!sip->sip_contact && sr->sr_status < 300 && sr->sr_add_contact &&
 	   (user_contact = 0,
-	    ds->ds_ltarget 
-	    ? sip_add_dup(msg, sip, (sip_header_t *)ds->ds_ltarget) 
+	    ds->ds_ltarget
+	    ? sip_add_dup(msg, sip, (sip_header_t *)ds->ds_ltarget)
 	    : nua_registration_add_contact_to_response(nh, msg, sip, NULL, m))
 	   < 0)
     ;
@@ -1748,7 +1748,7 @@
 
     sr->sr_terminating = (term < 0) ? -1 : (term > 0 || sr->sr_terminating);
 
-    if (sr->sr_target_refresh && sr->sr_status < 300 && !sr->sr_terminating && 
+    if (sr->sr_target_refresh && sr->sr_status < 300 && !sr->sr_terminating &&
 	user_contact && sip->sip_contact) {
       /* Save Contact given by application */
       ltarget = sip_contact_dup(nh->nh_home, sip->sip_contact);
@@ -1756,7 +1756,7 @@
 
     retval = sr->sr_methods->sm_respond(sr, next_tags);
 
-    if (sr->sr_status < 200) 
+    if (sr->sr_status < 200)
       sr->sr_response.msg = next.msg, sr->sr_response.sip = next.sip;
     else if (next.msg)
       msg_destroy(next.msg);
@@ -1767,9 +1767,9 @@
       if (sr->sr_status < 300) {
 	nua_dialog_state_t *ds = nh->nh_ds;
 	msg_header_free(nh->nh_home, (msg_header_t *)ds->ds_ltarget);
-	ds->ds_ltarget = ltarget;	
+	ds->ds_ltarget = ltarget;
       }
-      else 
+      else
 	msg_header_free(nh->nh_home, (msg_header_t *)ltarget);
     }
 
@@ -1807,7 +1807,7 @@
 		      (msg_header_t *)sip->sip_status);
     nta_incoming_complete_response(sr->sr_irq, response,
 				   sr->sr_status,
-				   sr->sr_phrase,    
+				   sr->sr_phrase,
 				   TAG_END());
   }
 
@@ -1927,17 +1927,17 @@
  * exception is the client requests bound to a dialog usage: they are saved
  * and re-used when the dialog usage is refreshed (and sometimes when the
  * usage is terminated).
- * 
+ *
  * The client request is subclassed and its behaviour modified using virtual
  * function table in #nua_client_methods_t.
- * 
+ *
  * The first three methods (crm_template(), crm_init(), crm_send()) are
  * called when the request is sent first time.
- * 
+ *
  * The crm_template() is called if a template request message is needed (for
  * example, in case of unregister, unsubscribe and unpublish, the template
  * message is taken from the request establishing the usage).
- * 
+ *
  * The crm_init() is called when the template message and dialog leg has
  * been created and populated by the tags procided by the application. Its
  * parameters msg and sip are pointer to the template request message that
@@ -1966,7 +1966,7 @@
  *
  * @par Terminating Dialog Usages and Dialogs
  *
- * The response is marked as terminating with nua_client_set_terminating(). 
+ * The response is marked as terminating with nua_client_set_terminating().
  * When a terminating request completes the dialog usage is removed and the
  * dialog is destroyed (unless there is an another active usage).
  */
@@ -1985,7 +1985,7 @@
  * @retval > 0 if error event has been sent
  * @retval < 0 upon an error
  */
-int nua_client_create(nua_handle_t *nh, 
+int nua_client_create(nua_handle_t *nh,
 		      int event,
 		      nua_client_methods_t const *methods,
 		      tagi_t const * const tags)
@@ -2004,7 +2004,7 @@
 
   cr = su_zalloc(home, sizeof *cr + methods->crm_extra);
   if (!cr) {
-    return nua_stack_event(nh->nh_nua, nh, 
+    return nua_stack_event(nh->nh_nua, nh,
 			   NULL,
 			   event,
 			   NUA_ERROR_AT(__FILE__, __LINE__),
@@ -2052,7 +2052,7 @@
   return nua_client_init_request(cr);
 }
 
-int nua_client_tcreate(nua_handle_t *nh, 
+int nua_client_tcreate(nua_handle_t *nh,
 		       int event,
 		       nua_client_methods_t const *methods,
 		       tag_type_t tag, tag_value_t value, ...)
@@ -2203,7 +2203,7 @@
 nua_client_request_destroy(nua_client_request_t *cr)
 {
   nua_handle_t *nh;
-  
+
   if (cr == NULL)
     return;
 
@@ -2237,7 +2237,7 @@
   nua_handle_unref(nh);
 }
 
-/** Bind client request to a dialog usage */ 
+/** Bind client request to a dialog usage */
 int nua_client_bind(nua_client_request_t *cr, nua_dialog_usage_t *du)
 {
   assert(cr);
@@ -2301,7 +2301,7 @@
   tagi_t const *t;
   int has_contact = 0;
   int error = 0;
-  
+
   if (!cr->cr_method_name)
     return nua_client_return(cr, NUA_ERROR_AT(__FILE__, __LINE__), NULL);
 
@@ -2382,7 +2382,7 @@
 
   if (cr->cr_method == sip_method_register && url == NULL)
     url = (url_string_t const *)NH_PGET(nh, registrar);
-  
+
   if ((t = cr->cr_tags)) {
     if (sip_add_tagis(msg, sip, &t) < 0)
       return nua_client_return(cr, NUA_ERROR_AT(__FILE__, __LINE__), msg);
@@ -2403,11 +2403,11 @@
    */
 
   if (!ds->ds_leg) {
-    if (ds->ds_remote_tag && ds->ds_remote_tag[0] && 
+    if (ds->ds_remote_tag && ds->ds_remote_tag[0] &&
 	sip_to_tag(nh->nh_home, sip->sip_to, ds->ds_remote_tag) < 0)
       return nua_client_return(cr, NUA_ERROR_AT(__FILE__, __LINE__), msg);
 
-    if (sip->sip_from == NULL && 
+    if (sip->sip_from == NULL &&
 	sip_add_dup(msg, sip, (sip_header_t *)nua->nua_from) < 0)
       return nua_client_return(cr, NUA_ERROR_AT(__FILE__, __LINE__), msg);
 
@@ -2475,7 +2475,7 @@
   if (nh->nh_tags) {
     tagi_t const *t = nh->nh_tags;
 
-    /* Use the From header from the dialog. 
+    /* Use the From header from the dialog.
        If From is set, it is always first tag in the handle */
     if (ds->ds_leg && t->t_tag == siptag_from)
       t++;
@@ -2619,8 +2619,8 @@
     if (initial_route) {
       initial_route = sip_route_dup(msg_home(msg), initial_route);
       if (!initial_route) return -1;
-      msg_header_prepend(msg, (msg_pub_t*)sip, 
-			 /* This should be 
+      msg_header_prepend(msg, (msg_pub_t*)sip,
+			 /* This should be
 			    (msg_header_t **)&sip->sip_route
 			  * but directly casting pointer &sip->sip_route gives
 			  * spurious type-punning warning */
@@ -2629,14 +2629,14 @@
     }
   }
 
-  
+
   /**
    * For in-dialog requests, the request URI is taken from the @Contact
-   * header received from the remote party during dialog establishment, 
+   * header received from the remote party during dialog establishment,
    * and the NUTAG_URL() is ignored.
    *
    * Also, the @CallID and @CSeq headers and @From and @To tags are
-   * generated based on the dialog information and added to the request. 
+   * generated based on the dialog information and added to the request.
    * If the dialog has a route, it is added to the request, too.
    */
   if (nta_msg_request_complete(msg, leg, method, name, url) < 0)
@@ -2659,15 +2659,15 @@
    */
   if (!sip->sip_allow)
     sip_add_dup(msg, sip, (sip_header_t*)NH_PGET(nh, allow));
-  
+
   if (!sip->sip_supported && NH_PGET(nh, supported))
     sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, supported));
-  
+
   if (method == sip_method_register && NH_PGET(nh, path_enable) &&
       !sip_has_feature(sip->sip_supported, "path") &&
       !sip_has_feature(sip->sip_require, "path"))
     sip_add_make(msg, sip, sip_supported_class, "path");
-  
+
   if (!sip->sip_organization && NH_PGET(nh, organization))
     sip_add_make(msg, sip, sip_organization_class, NH_PGET(nh, organization));
 
@@ -2704,7 +2704,7 @@
   if (cr->cr_method != sip_method_register) {
     if (cr->cr_contactize && cr->cr_has_contact) {
       sip_contact_t *ltarget = sip_contact_dup(nh->nh_home, sip->sip_contact);
-      if (ds->ds_ltarget) 
+      if (ds->ds_ltarget)
 	msg_header_free(nh->nh_home, (msg_header_t *)ds->ds_ltarget);
       ds->ds_ltarget = ltarget;
     }
@@ -2728,7 +2728,7 @@
   return nua_base_client_request(cr, msg, sip, NULL);
 }
 
-/**Add tags to request message and send it, 
+/**Add tags to request message and send it,
  *
  * @retval 0 success
  * @retval -1 if error occurred, but event has not been sent
@@ -2764,7 +2764,7 @@
   url_string_t * proxy = NH_PGET(nh, proxy);
 
   if (nh->nh_auth) {
-    if (cr->cr_challenged || 
+    if (cr->cr_challenged ||
 	NH_PGET(nh, auth_cache) == nua_auth_cache_dialog) {
       if (auc_authorize(&nh->nh_auth, msg, sip) < 0)
 	return nua_client_return(cr, 900, "Cannot add credentials", msg);
@@ -2895,7 +2895,7 @@
       terminated = 0, graceful = 1;
 
     if (terminated < 0)
-      cr->cr_terminated = terminated;      
+      cr->cr_terminated = terminated;
     else if (cr->cr_terminating || terminated)
       cr->cr_terminated = 1;
     else if (graceful)
@@ -2908,7 +2908,7 @@
     else
       nua_base_client_response(cr, status, phrase, sip, NULL);
     cr->cr_phrase = NULL;
-  }  
+  }
   else {
     if (cr->cr_methods->crm_recv)
       retval = cr->cr_methods->crm_recv(cr, status, phrase, sip);
@@ -2951,7 +2951,7 @@
 				  char const *phrase,
 				  sip_t const *sip)
 {
-  nua_handle_t *nh = cr->cr_owner; 
+  nua_handle_t *nh = cr->cr_owner;
   nta_outgoing_t *orq;
 
   if (status == 302 || status == 305) {
@@ -2983,7 +2983,7 @@
 
   if (status == 423) {
     unsigned my_expires = 0;
-    
+
     if (cr->cr_sip->sip_expires)
       my_expires = cr->cr_sip->sip_expires->ex_delta;
 
@@ -3024,7 +3024,7 @@
 	SU_DEBUG_7(("nua(%p): bad credentials, clearing them\n", (void *)nh));
 	auc_clear_credentials(&nh->nh_auth, NULL, NULL);
       }
-      else if (auc_has_authorization(&nh->nh_auth)) 
+      else if (auc_has_authorization(&nh->nh_auth))
 	return nua_client_restart(cr, 100, "Request Authorized by Cache");
 
       orq = cr->cr_orq, cr->cr_orq = NULL;
@@ -3039,8 +3039,8 @@
     }
   }
 
-  if (500 <= status && status < 600 && 
-      sip->sip_retry_after && 
+  if (500 <= status && status < 600 &&
+      sip->sip_retry_after &&
       sip->sip_retry_after->af_delta < 32) {
     su_timer_t *timer;
     char phrase[18];		/* Retry After XXXX\0 */
@@ -3055,7 +3055,7 @@
 
     cr->cr_timer = timer;	/* This takes over reference from orq */
 
-    snprintf(phrase, sizeof phrase, "Retry After %u", 
+    snprintf(phrase, sizeof phrase, "Retry After %u",
 	     (unsigned)sip->sip_retry_after->af_delta);
 
     orq = cr->cr_orq, cr->cr_orq = NULL;
@@ -3073,7 +3073,7 @@
 static
 void nua_client_restart_after(su_root_magic_t *magic,
 			      su_timer_t *timer,
-			      nua_client_request_t *cr) 
+			      nua_client_request_t *cr)
 {
   cr->cr_waiting = 0;
   su_timer_destroy(cr->cr_timer), cr->cr_timer = NULL;
@@ -3165,7 +3165,7 @@
 /**@internal
  * Relay response event to the application.
  *
- * @todo 
+ * @todo
  * If handle has already been marked as destroyed by nua_handle_destroy(),
  * release the handle with nh_destroy().
  *
@@ -3194,7 +3194,7 @@
 /**@internal
  * Relay response event to the application.
  *
- * @todo 
+ * @todo
  * If handle has already been marked as destroyed by nua_handle_destroy(),
  * release the handle with nh_destroy().
  *
@@ -3220,7 +3220,7 @@
       auc_info(&nh->nh_auth,
 	       sip->sip_authentication_info,
 	       sip_authorization_class);
-    if (sip->sip_proxy_authentication_info) 
+    if (sip->sip_proxy_authentication_info)
       auc_info(&nh->nh_auth,
 	       sip->sip_proxy_authentication_info,
 	       sip_proxy_authorization_class);
@@ -3288,8 +3288,8 @@
     return cr->cr_methods->crm_report(cr, status, phrase, sip, orq, tags);
 
   nh = cr->cr_owner;
-  
-  nua_stack_event(nh->nh_nua, nh, 
+
+  nua_stack_event(nh->nh_nua, nh,
 		  nta_outgoing_getresponse(orq),
 		  cr->cr_event,
 		  status, phrase,
@@ -3316,8 +3316,8 @@
   for (; cr; cr = cr->cr_next) {
     if (cr->cr_method == sip_method_cancel)
       continue;
-    
-    if (invite 
+
+    if (invite
 	? cr->cr_method == sip_method_invite
 	: cr->cr_method != sip_method_invite)
       break;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 #ifndef NUA_STACK_H
 /** Defined when <nua_stack.h> has been included. */
 #define NUA_STACK_H
-/**@IFILE nua_stack.h 
+/**@IFILE nua_stack.h
  * @brief Sofia-SIP User Agent Engine - internal stack interface
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -103,10 +103,10 @@
   TAG_IF((include) && (soa) && soa_is_remote_chat_active(soa) >= 0,	\
 	 SOATAG_ACTIVE_CHAT(soa_is_remote_chat_active(soa)))
 
-/** @internal @brief NUA handle. 
+/** @internal @brief NUA handle.
  *
  */
-struct nua_handle_s 
+struct nua_handle_s
 {
   su_home_t       nh_home[1];	/**< Memory home  */
   nua_handle_t   *nh_next;
@@ -205,7 +205,7 @@
 
   unsigned             nua_from_is_set;
   unsigned :0;
-  
+
   /**< Local SIP address. Contents are kept around for ever. */
   sip_from_t           nua_from[1];
 
@@ -261,12 +261,12 @@
 #endif
 
 su_inline nua_t *nua_stack_ref(nua_t *nua)
-{ 
+{
   return (nua_t *)su_home_ref(nua->nua_home);
 }
 
 su_inline void nua_stack_unref(nua_t *nua)
-{ 
+{
   su_home_unref(nua->nua_home);
 }
 
@@ -289,25 +289,25 @@
 				     nta_incoming_t *irq,
 				     sip_t const *sip);
 
-void nua_stack_post_signal(nua_handle_t *nh, nua_event_t event, 
+void nua_stack_post_signal(nua_handle_t *nh, nua_event_t event,
 			   tag_type_t tag, tag_value_t value, ...);
 
-typedef int nua_stack_signal_handler(nua_t *, 
-				     nua_handle_t *, 
-				     nua_event_t, 
+typedef int nua_stack_signal_handler(nua_t *,
+				     nua_handle_t *,
+				     nua_event_t,
 				     tagi_t const *);
 
 void nua_move_signal(nua_saved_signal_t a[1], nua_saved_signal_t b[1]);
 nua_signal_data_t const *nua_signal_data(nua_saved_signal_t const saved[1]);
 void nua_destroy_signal(nua_saved_signal_t saved[1]);
 
-nua_stack_signal_handler 
+nua_stack_signal_handler
   nua_stack_set_params, nua_stack_get_params,
-  nua_stack_register, 
-  nua_stack_invite, nua_stack_ack, nua_stack_cancel, 
+  nua_stack_register,
+  nua_stack_invite, nua_stack_ack, nua_stack_cancel,
   nua_stack_bye, nua_stack_info, nua_stack_update,
   nua_stack_prack,
-  nua_stack_options, nua_stack_publish, nua_stack_message, 
+  nua_stack_options, nua_stack_publish, nua_stack_message,
   nua_stack_subscribe, nua_stack_notify, nua_stack_refer,
   nua_stack_method;
 
@@ -358,7 +358,7 @@
 
 nua_handle_t *nh_validate(nua_t *nua, nua_handle_t *maybe);
 
-sip_replaces_t *nua_stack_handle_make_replaces(nua_handle_t *handle, 
+sip_replaces_t *nua_stack_handle_make_replaces(nua_handle_t *handle,
 					       su_home_t *home,
 					       int early_only);
 
@@ -386,7 +386,7 @@
 sip_contact_t const *nua_stack_get_contact(nua_registration_t const *nr);
 
 int nua_registration_add_contact_to_request(nua_handle_t *nh,
-					    msg_t *msg, 
+					    msg_t *msg,
 					    sip_t *sip,
 					    int add_contact,
 					    int add_service_route);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c	Tue Dec 23 07:37:03 2008
@@ -69,10 +69,10 @@
 };
 
 static char const *nua_subscribe_usage_name(nua_dialog_usage_t const *du);
-static int nua_subscribe_usage_add(nua_handle_t *nh, 
+static int nua_subscribe_usage_add(nua_handle_t *nh,
 				   nua_dialog_state_t *ds,
 				   nua_dialog_usage_t *du);
-static void nua_subscribe_usage_remove(nua_handle_t *nh, 
+static void nua_subscribe_usage_remove(nua_handle_t *nh,
 				       nua_dialog_state_t *ds,
 				       nua_dialog_usage_t *du,
 				       nua_client_request_t *cr,
@@ -102,8 +102,8 @@
   return "subscribe";
 }
 
-static 
-int nua_subscribe_usage_add(nua_handle_t *nh, 
+static
+int nua_subscribe_usage_add(nua_handle_t *nh,
 			   nua_dialog_state_t *ds,
 			   nua_dialog_usage_t *du)
 {
@@ -113,15 +113,15 @@
   return 0;
 }
 
-static 
-void nua_subscribe_usage_remove(nua_handle_t *nh, 
+static
+void nua_subscribe_usage_remove(nua_handle_t *nh,
 			       nua_dialog_state_t *ds,
 			       nua_dialog_usage_t *du,
 				nua_client_request_t *cr,
 				nua_server_request_t *sr)
 {
-  ds->ds_has_events--;	
-  ds->ds_has_subscribes--;	
+  ds->ds_has_events--;
+  ds->ds_has_subscribes--;
 }
 
 /* ====================================================================== */
@@ -129,17 +129,17 @@
 
 /**@fn void nua_subscribe(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
  *
- *  Subscribe to a SIP event. 
+ *  Subscribe to a SIP event.
  *
- * Subscribe a SIP event using the SIP SUBSCRIBE request. If the 
- * SUBSCRBE is successful a subscription state is established and 
+ * Subscribe a SIP event using the SIP SUBSCRIBE request. If the
+ * SUBSCRBE is successful a subscription state is established and
  * the subscription is refreshed regularly. The refresh requests will
  * generate #nua_r_subscribe events.
  *
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -155,17 +155,17 @@
 
 /**@fn void nua_unsubscribe(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
  *
- * Unsubscribe an event. 
+ * Unsubscribe an event.
  *
- * Unsubscribe an active or pending subscription with SUBSCRIBE request 
- * containing Expires: header with value 0. The dialog associated with 
- * subscription will be destroyed if there is no other subscriptions or 
+ * Unsubscribe an active or pending subscription with SUBSCRIBE request
+ * containing Expires: header with value 0. The dialog associated with
+ * subscription will be destroyed if there is no other subscriptions or
  * call using this dialog.
  *
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -173,12 +173,12 @@
  *    Header tags defined in <sofia-sip/sip_tag.h> except SIPTAG_EXPIRES() or SIPTAG_EXPIRES_STR()
  *
  * @par Events:
- *    #nua_r_unsubscribe 
+ *    #nua_r_unsubscribe
  *
  * @sa NUTAG_SUBSTATE(), @RFC3265
  */
 
-static int nua_subscribe_client_init(nua_client_request_t *cr, 
+static int nua_subscribe_client_init(nua_client_request_t *cr,
 				     msg_t *, sip_t *,
 				     tagi_t const *tags);
 static int nua_subscribe_client_request(nua_client_request_t *cr,
@@ -231,7 +231,7 @@
       /* Add Event header */
       sip_add_dup(msg, sip, (sip_header_t *)du->du_event);
   }
-  else if (cr->cr_event == nua_r_subscribe) {	
+  else if (cr->cr_event == nua_r_subscribe) {
     /* Create dialog usage */
     du = nua_dialog_usage_add(nh, nh->nh_ds, nua_subscribe_usage, o);
     /* Note that we allow SUBSCRIBE without event */
@@ -246,7 +246,7 @@
 					msg_t *msg, sip_t *sip,
 					tagi_t const *tags)
 {
-  nua_dialog_usage_t *du = cr->cr_usage; 
+  nua_dialog_usage_t *du = cr->cr_usage;
   sip_time_t expires = 0;
 
   if (cr->cr_event == nua_r_destroy || !du || du->du_shutdown)
@@ -275,7 +275,7 @@
 #endif
 
     nua_dialog_usage_reset_refresh(du); /* during SUBSCRIBE transaction */
-    
+
     if (cr->cr_terminating || cr->cr_event != nua_r_subscribe)
       expires = eu->eu_delta = 0;
     else if (sip->sip_expires)
@@ -318,7 +318,7 @@
  * @param nh     operation handle associated with the subscription
  * @param hmagic application context associated with the handle
  * @param sip    response to SUBSCRIBE request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   NUTAG_SUBSTATE()
  *
@@ -339,7 +339,7 @@
  * @param nh     operation handle associated with the subscription
  * @param hmagic application context associated with the handle
  * @param sip    response to SUBSCRIBE request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags   NUTAG_SUBSTATE()
  *
@@ -368,9 +368,9 @@
     du->du_ready = 1;
 
     if (eu->eu_substate != nua_substate_terminated)
-      /* If there is no @Expires header, 
+      /* If there is no @Expires header,
 	 use default value stored in eu_delta */
-      delta = sip_contact_expires(NULL, sip->sip_expires, sip->sip_date, 
+      delta = sip_contact_expires(NULL, sip->sip_expires, sip->sip_date,
 				  eu->eu_delta, now);
     else
       delta = 0;
@@ -379,14 +379,14 @@
       delta = eu->eu_delta;
 
     if (win_messenger_enable && !nua_dialog_is_established(nh->nh_ds)) {
-      /* Notify from messanger does not match with dialog tag */ 
+      /* Notify from messanger does not match with dialog tag */
       nh->nh_ds->ds_remote_tag = su_strdup(nh->nh_home, "");
     }
 
     if (delta > 0) {
       nua_dialog_usage_set_refresh(du, delta);
       eu->eu_expires = du->du_refquested + delta;
-    } 
+    }
     else {
       if (eu->eu_substate == nua_substate_terminated) {
 	if (!eu->eu_notified)
@@ -396,7 +396,7 @@
       if (eu->eu_substate != nua_substate_terminated) {
 	/* Wait 32 seconds for NOTIFY. */
 	delta = 64 * NTA_SIP_T1 / 1000;
-	
+
 	eu->eu_final_wait = 1;
 
 	if (!eu->eu_notified && win_messenger_enable)
@@ -405,7 +405,7 @@
 	nua_dialog_usage_set_refresh_range(du, delta, delta);
       }
       else {
-	nua_dialog_usage_reset_refresh(du); 
+	nua_dialog_usage_reset_refresh(du);
       }
 
       eu->eu_expires = du->du_refquested;
@@ -418,7 +418,7 @@
       cr->cr_terminated = 1;
   }
 
-  return nua_base_client_tresponse(cr, status, phrase, sip, 
+  return nua_base_client_tresponse(cr, status, phrase, sip,
 				   NUTAG_SUBSTATE(substate),
 				   SIPTAG_EVENT(du ? du->du_event : NULL),
 				   TAG_END());
@@ -432,9 +432,9 @@
 {
   nua_client_request_t *cr = du->du_cr;
   struct event_usage *eu = nua_dialog_usage_private(du);
-  
+
   assert(eu);
-  
+
   if (eu->eu_final_wait) {
     /* Did not receive NOTIFY for fetch */
     sip_event_t const *o = du->du_event;
@@ -445,7 +445,7 @@
 		id ? "; id=" : "", id ? id : ""));
 
     nua_stack_tevent(nh->nh_nua, nh,  NULL,
-		     nua_i_notify, 408, "Fetch Timeouts without NOTIFY", 
+		     nua_i_notify, 408, "Fetch Timeouts without NOTIFY",
 		     NUTAG_SUBSTATE(nua_substate_terminated),
 		     SIPTAG_EVENT(du->du_event),
 		     TAG_END());
@@ -494,7 +494,7 @@
     if (nua_client_resend_request(cr, 1) >= 0)
       return 0;
   }
-  
+
   nua_dialog_usage_remove(nh, ds, du, NULL, NULL);
   return 200;
 }
@@ -514,7 +514,7 @@
  * @param tags   NUTAG_SUBSTATE() indicating the subscription state
  *
  * @sa nua_subscribe(), nua_unsubscribe(), @RFC3265, #nua_i_subscribe
- * 
+ *
  * @END_NUA_EVENT
  */
 
@@ -522,11 +522,11 @@
 int nua_notify_server_preprocess(nua_server_request_t *sr);
 int nua_notify_server_report(nua_server_request_t *, tagi_t const *);
 
-nua_server_methods_t const nua_notify_server_methods = 
+nua_server_methods_t const nua_notify_server_methods =
   {
     SIP_METHOD_NOTIFY,
     nua_i_notify,		/* Event */
-    { 
+    {
       /* create_dialog: */ 1,	/* Do create dialog */
       /* in_dialog: */ 0,	/* Not always in-dialog request */
       /* target_refresh: */ 1,	/* Target refresh request  */
@@ -546,15 +546,15 @@
     nua_dialog_state_t *ds = sr->sr_owner->nh_ds;
 
     /* Check for forked subscription. */
-    if (ds->ds_remote_tag && ds->ds_remote_tag[0] && 
+    if (ds->ds_remote_tag && ds->ds_remote_tag[0] &&
 	str0cmp(ds->ds_remote_tag, sr->sr_request.sip->sip_from->a_tag)) {
       sip_contact_t const *m = NULL;
 
       m = nua_stack_get_contact(sr->sr_owner->nh_nua->nua_registrations);
-      
+
       if (m) {
 	sip_warning_t w[1];
-	
+
 	sip_warning_init(w)->w_code = 399;
 	w->w_host = m->m_url->url_host;
 	w->w_port = m->m_url->url_port;
@@ -593,17 +593,17 @@
     if (!du)
       return SR_STATUS1(sr, SIP_500_INTERNAL_SERVER_ERROR);
   }
-  
+
   sr->sr_usage = du;
   eu = nua_dialog_usage_private(du); assert(eu);
   eu->eu_notified++;
-  if (!o || !o->o_id) 
+  if (!o || !o->o_id)
     eu->eu_no_id = 1;
 
   if (subs == NULL) {
     /* Compatibility */
     unsigned long delta = eu->eu_delta;
-    if (sip->sip_expires) 
+    if (sip->sip_expires)
       delta = sip->sip_expires->ex_delta;
 
     if (delta == 0)
@@ -616,7 +616,7 @@
     reason = subs->ss_reason;
 
     if (str0casecmp(reason, "deactivated") == 0 ||
-	str0casecmp(reason, "probation") == 0) 
+	str0casecmp(reason, "probation") == 0)
       substate = nua_substate_embryonic;
   }
   else if (strcasecmp(subs->ss_substate, what = "pending") == 0) {
@@ -632,7 +632,7 @@
   if (!solicited)
     eu->eu_unsolicited = 1;
 
-  SU_DEBUG_5(("nua(%p): %s: %s (%s)\n", 
+  SU_DEBUG_5(("nua(%p): %s: %s (%s)\n",
 	      (void *)sr->sr_owner, "nua_notify_server_preprocess",
 	      what, reason ? reason : ""));
 
@@ -672,7 +672,7 @@
       if (subs && subs->ss_reason) {
 	if (str0casecmp(subs->ss_reason, "deactivated") == 0) {
 	  retry = 0;		/* retry immediately */
-	} 
+	}
 	else if (str0casecmp(subs->ss_reason, "probation") == 0) {
 	  retry = 30;
 	  if (subs->ss_retry_after)
@@ -686,11 +686,11 @@
       sr->sr_terminating = 1;
     }
   }
-  
+
   retval = nua_base_server_treport(sr, /* can destroy sr */
 				   NUTAG_SUBSTATE(substate),
 				   SIPTAG_EVENT(o),
-				   TAG_NEXT(tags)); 
+				   TAG_NEXT(tags));
 
   if (retval != 1 || du == NULL)
     return retval;
@@ -719,9 +719,9 @@
 
 /**@fn void nua_refer(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
  *
- * Transfer a call. 
- * 
- * Send a REFER request asking the recipient to transfer the call. 
+ * Transfer a call.
+ *
+ * Send a REFER request asking the recipient to transfer the call.
  *
  * The REFER request also establishes an implied subscription to the "refer"
  * event. The "refer" event can have an "id" parameter, which has the value
@@ -745,7 +745,7 @@
  * @param nh              Pointer to operation handle
  * @param tag, value, ... List of tagged parameters
  *
- * @return 
+ * @return
  *    nothing
  *
  * @par Related Tags:
@@ -776,7 +776,7 @@
  * @param nh     operation handle associated with the REFER request
  * @param hmagic application context associated with the handle
  * @param sip    response to REFER request or NULL upon an error
- *               (status code is in @a status and 
+ *               (status code is in @a status and
  *                descriptive message in @a phrase parameters)
  * @param tags    NUTAG_REFER_EVENT() \n
  *                NUTAG_SUBSTATE()
@@ -787,7 +787,7 @@
  * @END_NUA_EVENT
  */
 
-static int nua_refer_client_init(nua_client_request_t *cr, 
+static int nua_refer_client_init(nua_client_request_t *cr,
 				 msg_t *, sip_t *,
 				 tagi_t const *tags);
 static int nua_refer_client_request(nua_client_request_t *cr,
@@ -901,15 +901,15 @@
 				     int status, char const *phrase,
 				     sip_t const *sip)
 {
-  nua_dialog_usage_t *du = cr->cr_usage; 
+  nua_dialog_usage_t *du = cr->cr_usage;
   enum nua_substate substate = nua_substate_terminated;
 
   if (du) {
     struct event_usage *eu = nua_dialog_usage_private(du);
 
     if (status < 200) {
-      substate = eu->eu_substate;      
-    } 
+      substate = eu->eu_substate;
+    }
     else if (status < 300) {
       sip_refer_sub_t const *rs = sip_refer_sub(sip);
 
@@ -920,8 +920,8 @@
 	substate = eu->eu_substate;
     }
   }
-  
-  return nua_base_client_tresponse(cr, status, phrase, sip, 
+
+  return nua_base_client_tresponse(cr, status, phrase, sip,
 				   NUTAG_SUBSTATE(substate),
 				   SIPTAG_EVENT(du ? du->du_event : NULL),
 				   TAG_END());

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c	Tue Dec 23 07:37:03 2008
@@ -182,7 +182,8 @@
  * UPDATE requests.
  * Settings:
  * - NUTAG_MIN_SE(), NUTAG_SESSION_REFRESHER(),
- *   NUTAG_SESSION_TIMER(), NUTAG_UPDATE_REFRESH()
+ *   NUTAG_SESSION_TIMER(), NUTAG_UPDATE_REFRESH(),
+ *   NUTAG_REFRESH_WITHOUT_SDP(),
  * - "timer" in NUTAG_SUPPORTED()/SIPTAG_SUPPORTED()
  * Specifications:
  * - @RFC4028
@@ -462,15 +463,15 @@
  *    int (boolean: nonzero is true, zero is false)
  *
  * @par Values
- *    - 0 (false) - include 100rel in all preliminary responses 
+ *    - 0 (false) - include 100rel in all preliminary responses
  *    - 1 (true) - include 100rel only in 183 responses
  *
- * @note 
+ * @note
  * This tag takes only effect when NUTAG_EARLY_MEDIA(1) has been used, too.
  *
  * Corresponding tag taking reference parameter is NUTAG_ONLY183_100REL_REF().
  *
- * @sa 
+ * @sa
  */
 tag_typedef_t nutag_only183_100rel = BOOLTAG_TYPEDEF(only183_100rel);
 
@@ -527,7 +528,7 @@
  *
  * @par Values
  *    - 0 (false) - do not include extra SDP on 200 OK
- *    - 1 (true) - include SDP in 200 OK even if it has been sent 
+ *    - 1 (true) - include SDP in 200 OK even if it has been sent
  *                 a 100rel response, too
  *
  * Corresponding tag taking reference parameter is
@@ -954,6 +955,11 @@
  * @SessionExpires header sends a re-INVITE requests (or an UPDATE
  * request if NUTAG_UPDATE_REFRESH(1) parameter tag has been set).
  *
+ * Some SIP user-agents use INVITE without SDP offer to refresh session.
+ * By default, NUA sends an offer in 200 OK to such an INVITE and expects
+ * an answer back in ACK. If NUTAG_REFRESH_WITHOUT_SDP(1) tag is used,
+ * no SDP offer is sent in 200 OK if re-INVITE was received without SDP.
+ *
  * @par When to Use NUTAG_SESSION_TIMER()?
  *
  * The session time extension is enabled ("timer" feature tag is included in
@@ -1106,7 +1112,7 @@
  * 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
+ * NUTAG_SESSION_REFRESHER(), @RFC4028, @SessionExpires, @MinSE
  */
 tag_typedef_t nutag_update_refresh = BOOLTAG_TYPEDEF(update_refresh);
 
@@ -1115,6 +1121,45 @@
  */
 
 
+/**@def NUTAG_REFRESH_WITHOUT_SDP(x)
+ *
+ * Do not send offer in response if re-INVITE was received without SDP.
+ *
+ * Some SIP user-agents use INVITE without SDP offer to refresh session.
+ * By default, NUA sends an offer in 200 OK to such an INVITE and expects
+ * an answer back in ACK.
+ *
+ * If NUTAG_REFRESH_WITHOUT_SDP(1) tag is used, no SDP offer is sent in 200
+ * OK if re-INVITE was received without SDP.
+ *
+ * @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
+ *    int (boolean: nonzero is true, zero is false)
+ *
+ * @par Values
+ *    - 1 (true, do not try to send offer in response to re-INVITE)
+ *    - 0 (false, always use SDP offer-answer in re-INVITEs)
+ *
+ * Corresponding tag taking reference parameter is NUTAG_REFRESH_WITHOUT_SDP_REF().
+ *
+ * @sa #nua_r_update, NUTAG_SESSION_TIMER(), NUTAG_MIN_SE_REF(),
+ * NUTAG_SESSION_REFRESHER(), NUTAG_UPDATE_REFRESH(), @RFC4028,
+ * @SessionExpires, @MinSE
+ */
+tag_typedef_t nutag_refresh_without_sdp = BOOLTAG_TYPEDEF(refresh_without_sdp);
+
+/**@def NUTAG_REFRESH_WITHOUT_SDP_REF(x)
+ * Reference tag for NUTAG_REFRESH_WITHOUT_SDP_REF().
+ */
+
+
 /**@def NUTAG_REFER_EXPIRES()
  *
  * Default lifetime for implicit subscriptions created by REFER.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_types.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_types.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/nua_types.h	Tue Dec 23 07:37:03 2008
@@ -26,7 +26,7 @@
 /** Defined when <nua_types.h> has been included. */
 #define NUA_TYPES_H
 
-/**@internal @file nua_types.h 
+/**@internal @file nua_types.h
  * @brief Internal types for nua.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -42,8 +42,8 @@
 
 typedef struct nua_dialog_state nua_dialog_state_t;
 typedef struct nua_dialog_usage nua_dialog_usage_t;
-typedef struct nua_server_request nua_server_request_t; 
-typedef struct nua_client_request nua_client_request_t; 
+typedef struct nua_server_request nua_server_request_t;
+typedef struct nua_client_request nua_client_request_t;
 typedef struct nua_dialog_peer_info nua_dialog_peer_info_t;
 
 #ifndef NUA_SAVED_SIGNAL_T

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c	Tue Dec 23 07:37:03 2008
@@ -102,7 +102,7 @@
   /* The registration state machine. */
   /** Initial REGISTER containing ob_rcontact has been sent */
   unsigned ob_registering:1;
-  /** 2XX response to REGISTER containg ob_rcontact has been received */
+  /** 2XX response to REGISTER containing ob_rcontact has been received */
   unsigned ob_registered:1;
   /** The registration has been validated:
    *  We have successfully sent OPTIONS to ourselves.
@@ -200,7 +200,7 @@
     return NULL;
 
   ob = su_home_clone((su_home_t *)owner, sizeof *ob);
-  
+
   if (ob) {
     su_md5_t md5[1];
     uint8_t digest[SU_MD5_DIGEST_SIZE];
@@ -224,7 +224,7 @@
     su_md5_update(md5, (void *)guid, sizeof guid);
     su_md5_digest(md5, digest);
     token64_e(ob->ob_cookie, sizeof ob->ob_cookie, digest, sizeof digest);
-    
+
     if (instance && !ob->ob_instance)
       su_home_unref(ob->ob_home), ob = NULL;
   }
@@ -310,7 +310,7 @@
   su_free(NULL, options);
 
   if (invalid) {
-    SU_DEBUG_1(("outbound(%p): invalid options \"%s\"\n", 
+    SU_DEBUG_1(("outbound(%p): invalid options \"%s\"\n",
 		(void *)ob->ob_owner, options));
     return -1;
   }
@@ -354,21 +354,13 @@
 /* ---------------------------------------------------------------------- */
 
 /** Obtain contacts for REGISTER */
-int outbound_get_contacts(outbound_t *ob, 
-			  sip_contact_t **return_current_contact, 
+int outbound_get_contacts(outbound_t *ob,
+			  sip_contact_t **return_current_contact,
 			  sip_contact_t **return_previous_contact)
 {
   if (ob) {
     if (ob->ob_contacts)
       *return_current_contact = ob->ob_rcontact;
-    else {
-      sip_contact_t *contact = *return_current_contact;
-      if (contact) {
-	if (ob->ob_rcontact)
-	  msg_header_free_all(ob->ob_home, (msg_header_t*)ob->ob_rcontact);
-	ob->ob_rcontact = sip_contact_dup(ob->ob_home, contact);
-      }
-    }
     *return_previous_contact = ob->ob_previous;
   }
   return 0;
@@ -396,27 +388,31 @@
   if (terminating) {
     ob->ob_registering = ob->ob_registered = 0;
     return 0;			/* Cleanup is done separately */
-  }  
+  }
 
   if (!response || !request)
     return 0;
 
   assert(request->sip_request); assert(response->sip_status);
-  
-  reregister = outbound_check_for_nat(ob, request, response);
-  if (reregister)
-    return reregister;
 
   status = response->sip_status->st_status;
 
   if (status < 300) {
-    if (request->sip_contact && response->sip_contact)
+    if (request->sip_contact && response->sip_contact) {
+      if (ob->ob_rcontact != NULL)
+        msg_header_free(ob->ob_home, (msg_header_t *)ob->ob_rcontact);
+      ob->ob_rcontact = sip_contact_dup(ob->ob_home, request->sip_contact);
       ob->ob_registered = ob->ob_registering;
-    else
+    } else
       ob->ob_registered = 0;
+  }
 
-    if (ob->ob_previous)
-      msg_header_free(ob->ob_home, (void *)ob->ob_previous);
+  reregister = outbound_check_for_nat(ob, request, response);
+  if (reregister)
+    return reregister;
+
+  if (ob->ob_previous && status < 300) {
+    msg_header_free(ob->ob_home, (void *)ob->ob_previous);
     ob->ob_previous = NULL;
   }
 
@@ -449,7 +445,7 @@
   if (!ob->ob_by_stack)
     return ob_no_nat;
 
-  /* Application does not want us to do any NAT traversal */ 
+  /* Application does not want us to do any NAT traversal */
   if (!ob->ob_prefs.natify)
     return ob_no_nat;
 
@@ -615,7 +611,7 @@
   }
 
   gruu = (char *)msg_header_find_param(m->m_common, "pub-gruu=");
-  
+
   if (gruu == NULL || gruu[0] == '\0')
     gruu = (char *)msg_header_find_param(m->m_common, "gruu=");
 
@@ -692,7 +688,7 @@
 
   ob->ob_keepalive.interval = interval;
 
-  if (!ob->ob_validated && ob->ob_keepalive.sipstun 
+  if (!ob->ob_validated && ob->ob_keepalive.sipstun
       && 0 /* Stun is disabled for now */) {
     nta_tport_keepalive(register_transaction);
   }
@@ -754,7 +750,7 @@
       s = su_strdup(msg_home(msg), s);
       msg_header_add_param(msg_home(msg), ac->cp_common, s);
     }
-    
+
     if (features)
       msg_header_insert(msg, NULL, (void *)ac);
     else
@@ -917,36 +913,36 @@
 
     if (status < 300 && ob->ob_keepalive.validated) {
       loglevel = 5;
-      if (ob->ob_validated) 
+      if (ob->ob_validated)
 	loglevel = 99;		/* only once */
       ob->ob_validated = ob->ob_once_validated = 1;
     }
-    else if (status == 401 || status == 407 || status == 403) 
+    else if (status == 401 || status == 407 || status == 403)
       loglevel = 5, failed = 1;
     else
       loglevel = 3, failed = 1;
-      
+
     if (loglevel >= SU_LOG->log_level) {
       sip_contact_t const *m = ob->ob_rcontact;
 
       if  (m)
-	su_llog(SU_LOG, loglevel,       
+	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,       
+	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", 
+	su_llog(SU_LOG, loglevel, "outbound(%p): FAILED with %u %s\n",
 		(void *)ob->ob_owner, status, phrase);
     }
 
-    if (failed) 
+    if (failed)
       ob->ob_oo->oo_probe_error(ob->ob_owner, ob, status, phrase, TAG_END());
   }
   else if (status == 408) {
@@ -1027,7 +1023,7 @@
 /** Check if request should be processed by outbound */
 int outbound_targeted_request(sip_t const *sip)
 {
-  return 
+  return
     sip && sip->sip_request &&
     sip->sip_request->rq_method == sip_method_options &&
     sip->sip_accept &&
@@ -1036,7 +1032,7 @@
 }
 
 /** Answer to the connectivity probe OPTIONS */
-int outbound_process_request(outbound_t *ob, 
+int outbound_process_request(outbound_t *ob,
 			     nta_incoming_t *irq,
 			     sip_t const *sip)
 {
@@ -1045,7 +1041,7 @@
     return 0;
 
   if (ob->ob_keepalive.validating) {
-    SU_DEBUG_5(("outbound(%p): registration check OPTIONS received\n", 
+    SU_DEBUG_5(("outbound(%p): registration check OPTIONS received\n",
 		(void *)ob->ob_owner));
     ob->ob_keepalive.validated = 1;
   }
@@ -1063,7 +1059,7 @@
 /**@internal
  * Create contacts for outbound.
  *
- * There are two contacts: 
+ * There are two contacts:
  * one suitable for registrations (ob_rcontact) and another that can be used
  * in dialogs (ob_dcontact).
  */
@@ -1071,7 +1067,6 @@
 {
   su_home_t *home = ob->ob_home;
   sip_contact_t *rcontact, *dcontact;
-  int reg_id = 0;
   char reg_id_param[20] = "";
   sip_contact_t *previous_previous, *previous_rcontact, *previous_dcontact;
   sip_via_t *v, v0[1], *previous_via;
@@ -1082,16 +1077,16 @@
 
   v = v0; *v0 = *via; v0->v_next = NULL;
 
-  dcontact = ob->ob_oo->oo_contact(ob->ob_owner, home, 1, 
+  dcontact = ob->ob_oo->oo_contact(ob->ob_owner, home, 1,
 				   v, v->v_protocol, NULL);
 
   if (ob->ob_instance && ob->ob_reg_id != 0)
     snprintf(reg_id_param, sizeof reg_id_param, ";reg-id=%u", ob->ob_reg_id);
 
   rcontact = ob->ob_oo->oo_contact(ob->ob_owner, home, 0,
-				   v, v->v_protocol, 
+				   v, v->v_protocol,
 				   ob->ob_instance, reg_id_param, NULL);
-    
+
   v = sip_via_dup(home, v);
 
   if (!rcontact || !dcontact || !v) {
@@ -1110,8 +1105,10 @@
     previous_dcontact = ob->ob_dcontact;
     previous_via = ob->ob_via;
 
-    if (ob->ob_registering &&
-        (reg_id == 0 || ob->ob_info.outbound < outbound_feature_supported))
+    if (ob->ob_registered
+        /* && (ob->ob_reg_id == 0 || ob->ob_info.outbound < outbound_feature_supported)
+         * XXX - multiple connections not yet supported
+	 */)
       previous_rcontact = NULL, ob->ob_previous = ob->ob_rcontact;
     else
       previous_rcontact = ob->ob_rcontact, ob->ob_previous = NULL;
@@ -1171,14 +1168,14 @@
   if (terminating) {
     if (ob->ob_by_stack && application_contact == NULL)
       return 0;
-    
+
     if (ob->ob_contacts)
       previous = ob->ob_rcontact;
   }
   else if (application_contact) {
     rcontact = sip_contact_dup(home, application_contact);
 
-    if (!ob->ob_rcontact || 
+    if (!ob->ob_rcontact ||
 	url_cmp_all(ob->ob_rcontact->m_url, application_contact->m_url)) {
       contact_uri_changed = 1;
       previous = ob->ob_contacts ? ob->ob_rcontact : NULL;
@@ -1188,10 +1185,10 @@
     return 0;    /* Xyzzy - nothing happens */
   }
   else if (v) {
-    char const *tport = !v->v_next ? v->v_protocol : NULL; 
+    char const *tport = !v->v_next ? v->v_protocol : NULL;
     char reg_id_param[20];
 
-    dcontact = ob->ob_oo->oo_contact(ob->ob_owner, home, 1, 
+    dcontact = ob->ob_oo->oo_contact(ob->ob_owner, home, 1,
 				     v, tport, NULL);
     if (!dcontact)
       return -1;
@@ -1200,18 +1197,18 @@
       snprintf(reg_id_param, sizeof reg_id_param, ";reg-id=%u", ob->ob_reg_id);
 
     rcontact = ob->ob_oo->oo_contact(ob->ob_owner, home, 0,
-				     v, v->v_protocol, 
+				     v, v->v_protocol,
 				     ob->ob_instance, reg_id_param, NULL);
     if (!rcontact)
       return -1;
 
-    if (!ob->ob_rcontact || 
+    if (!ob->ob_rcontact ||
 	url_cmp_all(ob->ob_rcontact->m_url, rcontact->m_url)) {
       contact_uri_changed = 1;
       previous = ob->ob_contacts ? ob->ob_rcontact : NULL;
     }
   }
-    
+
   ob->ob_by_stack = application_contact == NULL;
 
   ob->ob_contacts = rcontact != NULL;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/outbound.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/outbound.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/outbound.h	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 #ifndef OUTBOUND_H
 /** Defined when <outbound.h> has been included. */
 #define OUTBOUND_H
-/**@IFILE outbound.h 
+/**@IFILE outbound.h
  *
  * @brief Interface to SIP NAT traversal and outbound
  *
@@ -73,8 +73,8 @@
 int outbound_set_proxy(outbound_t *ob,
 		       url_string_t *proxy);
 
-int outbound_get_contacts(outbound_t *ob, 
-			  sip_contact_t **return_current_contact, 
+int outbound_get_contacts(outbound_t *ob,
+			  sip_contact_t **return_current_contact,
 			  sip_contact_t **return_previous_contact);
 
 int outbound_start_registering(outbound_t *ob);
@@ -110,7 +110,7 @@
 
 int outbound_targeted_request(sip_t const *sip);
 
-int outbound_process_request(outbound_t *ob, 
+int outbound_process_request(outbound_t *ob,
 			     nta_incoming_t *irq,
 			     sip_t const *sip);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua.h	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@file sofia-sip/nua.h  
+/**@file sofia-sip/nua.h
  * @brief Sofia-SIP User Agent Library API
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -53,13 +53,13 @@
 
 SOFIA_BEGIN_DECLS
 
-#ifndef NUA_MAGIC_T 
+#ifndef NUA_MAGIC_T
 #define NUA_MAGIC_T void
 #endif
 /** Application context for NUA agent. */
 typedef NUA_MAGIC_T nua_magic_t;
 
-#ifndef NUA_HMAGIC_T 
+#ifndef NUA_HMAGIC_T
 #define NUA_HMAGIC_T void
 #endif
 /** Application context for NUA handle. */
@@ -112,9 +112,9 @@
   nua_i_media_error,		/**< Offer-answer error indication */
 
   /* Responses */
-  nua_r_set_params,		/**< Answer to nua_set_params() or 
+  nua_r_set_params,		/**< Answer to nua_set_params() or
 				 * nua_get_hparams(). */
-  nua_r_get_params,		/**< Answer to nua_get_params() or 
+  nua_r_get_params,		/**< Answer to nua_get_params() or
 				 * nua_get_hparams(). */
   nua_r_shutdown,		/**< Answer to nua_shutdown() */
   nua_r_notifier,		/**< Answer to nua_notifier() */
@@ -140,7 +140,7 @@
   nua_r_unsubscribe,		/**< Answer to outgoing un-SUBSCRIBE */
   nua_r_notify,			/**< Answer to outgoing NOTIFY */
   nua_r_method,			/**< Answer to unknown outgoing method */
- 
+
   nua_r_authenticate,		/**< Answer to nua_authenticate() */
 
   /* Internal events: nua hides them from application */
@@ -152,7 +152,7 @@
 
   /* NOTE: Post 1.12 release events come here (below) to keep ABI
      compatibility! */
-  nua_i_network_changed,        /**< Local IP(v6) address has changed. 
+  nua_i_network_changed,        /**< Local IP(v6) address has changed.
 				   @NEW_1_12_2 */
   nua_i_register		/**< Incoming REGISTER. @NEW_1_12_4. */
 } nua_event_t;
@@ -269,16 +269,16 @@
 /** Convert string to enum nua_substate. @NEW_1_12_5. */
 SOFIAPUBFUN enum nua_substate nua_substate_make(char const *sip_substate);
 
-/** Send SIP REGISTER request to the registrar. */ 
+/** Send SIP REGISTER request to the registrar. */
 SOFIAPUBFUN void nua_register(nua_handle_t *nh, tag_type_t, tag_value_t, ...);
 
-/** Unregister. */ 
+/** Unregister. */
 SOFIAPUBFUN void nua_unregister(nua_handle_t *nh, tag_type_t, tag_value_t, ...);
 
 /** Place a call using SIP INVITE method. */
 SOFIAPUBFUN void nua_invite(nua_handle_t *nh, tag_type_t, tag_value_t, ...);
 
-/** Acknowledge a succesfull response to INVITE request. */ 
+/** Acknowledge a succesfull response to INVITE request. */
 SOFIAPUBFUN void nua_ack(nua_handle_t *nh, tag_type_t, tag_value_t, ...);
 
 /** Acknowledge a reliable preliminary response to INVITE request. */
@@ -320,7 +320,7 @@
 /** Transfer a call. */
 SOFIAPUBFUN void nua_refer(nua_handle_t *, tag_type_t, tag_value_t, ...);
 
-/** Update a call */ 
+/** Update a call */
 SOFIAPUBFUN void nua_update(nua_handle_t *, tag_type_t, tag_value_t, ...);
 
 /** Hangdown a call. */
@@ -342,9 +342,9 @@
 SOFIAPUBFUN void nua_method(nua_handle_t *, tag_type_t, tag_value_t, ...);
 
 /** Respond to a request with given status code and phrase. */
-SOFIAPUBFUN void nua_respond(nua_handle_t *nh, 
+SOFIAPUBFUN void nua_respond(nua_handle_t *nh,
 			     int status, char const *phrase,
-			     tag_type_t, tag_value_t, 
+			     tag_type_t, tag_value_t,
 			     ...);
 
 /** Check if event can be responded with nua_respond() */
@@ -377,7 +377,7 @@
 /** Get current request message. */
 SOFIAPUBFUN  msg_t *nua_current_request(nua_t const *nua);
 
-SOFIAPUBFUN sip_replaces_t *nua_handle_make_replaces(nua_handle_t *nh, 
+SOFIAPUBFUN sip_replaces_t *nua_handle_make_replaces(nua_handle_t *nh,
 						     su_home_t *home,
 						     int early_only);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h	Tue Dec 23 07:37:03 2008
@@ -183,6 +183,12 @@
 #define NUTAG_UPDATE_REFRESH_REF(x) nutag_update_refresh_ref, tag_bool_vr((&(x)))
 SOFIAPUBVAR tag_typedef_t nutag_update_refresh_ref;
 
+#define NUTAG_REFRESH_WITHOUT_SDP(x) nutag_refresh_without_sdp, tag_bool_v((x))
+SOFIAPUBVAR tag_typedef_t nutag_refresh_without_sdp;
+#define NUTAG_REFRESH_WITHOUT_SDP_REF(x) \
+  nutag_refresh_without_sdp_ref, tag_bool_vr((&(x)))
+SOFIAPUBVAR tag_typedef_t nutag_refresh_without_sdp_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))

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.c	Tue Dec 23 07:37:03 2008
@@ -62,8 +62,8 @@
 /* -- Module prototypes ------------------------------------------------- */
 
 static msg_t *s2_msg(int flags);
-static int s2_complete_response(msg_t *response, 
-				int status, char const *phrase, 
+static int s2_complete_response(msg_t *response,
+				int status, char const *phrase,
 				msg_t *request);
 static char *s2_generate_tag(su_home_t *home);
 
@@ -132,7 +132,7 @@
 
   e->prev = NULL, e->next = NULL;
 
-  return e; 
+  return e;
 }
 
 void s2_free_event(struct event *e)
@@ -163,7 +163,7 @@
 
     su_root_step(s2->root, 100);
   }
-} 
+}
 
 struct event *s2_wait_for_event(nua_event_t event, int status)
 {
@@ -180,7 +180,7 @@
 
     su_root_step(s2->root, 100);
   }
-} 
+}
 
 int s2_check_event(nua_event_t event, int status)
 {
@@ -206,7 +206,7 @@
   return retval;
 }
 
-static void 
+static void
 s2_nua_callback(nua_event_t event,
 		int status, char const *phrase,
 		nua_t *nua, nua_magic_t *_t,
@@ -218,7 +218,7 @@
 
   if (event == nua_i_active || event == nua_i_terminated)
     return;
-  
+
   e = calloc(1, sizeof *e);
   nua_save_event(nua, e->event);
   e->nh = nua_handle_ref(nh);
@@ -241,7 +241,7 @@
 
   m->prev = NULL, m->next = NULL;
 
-  return m; 
+  return m;
 }
 
 void
@@ -294,10 +294,10 @@
 
       if (method == sip_method_unknown && name == NULL)
 	break;
-      
+
       if (m->sip->sip_cseq == NULL)
 	continue;
-      
+
       if (m->sip->sip_cseq->cs_method != method)
 	continue;
       if (name == NULL)
@@ -311,7 +311,7 @@
 
     su_root_step(s2->root, 100);
   }
-} 
+}
 
 int
 s2_check_response(int status, sip_method_t method, char const *name)
@@ -335,9 +335,9 @@
 
     su_root_step(s2->root, 100);
   }
-  
+
   return NULL;
-} 
+}
 
 struct message *
 s2_wait_for_request(sip_method_t method, char const *name)
@@ -358,9 +358,9 @@
 
     su_root_step(s2->root, 100);
   }
-  
+
   return NULL;
-} 
+}
 
 int
 s2_check_request(sip_method_t method, char const *name)
@@ -425,7 +425,7 @@
 
   *tpn = *tport_name(m->tport);
 
-  rport = su_sprintf(home, "rport=%u", 
+  rport = su_sprintf(home, "rport=%u",
 		     ntohs(((su_sockaddr_t *)
 			    msg_addrinfo(m->msg)->ai_addr)->su_port));
 
@@ -433,7 +433,7 @@
       sip->sip_via->v_rport &&
       sip->sip_via->v_rport[0] == '\0') {
     msg_header_add_param(home, sip->sip_via->v_common, rport);
-  }    
+  }
 
   tpn->tpn_port = rport + strlen("rport=");
 
@@ -446,9 +446,9 @@
 }
 
 /** Add headers from the request to the response message. */
-static int 
-s2_complete_response(msg_t *response, 
-		     int status, char const *phrase, 
+static int
+s2_complete_response(msg_t *response,
+		     int status, char const *phrase,
 		     msg_t *request)
 {
   su_home_t *home = msg_home(response);
@@ -469,7 +469,7 @@
   if (!response_sip->sip_to)
     response_sip->sip_to = sip_to_dup(home, request_sip->sip_to);
   if (!response_sip->sip_call_id)
-    response_sip->sip_call_id = 
+    response_sip->sip_call_id =
       sip_call_id_dup(home, request_sip->sip_call_id);
   if (!response_sip->sip_cseq)
     response_sip->sip_cseq = sip_cseq_dup(home, request_sip->sip_cseq);
@@ -496,11 +496,11 @@
   return 0;
 }
 
-/* Send request (updating dialog). 
+/* Send request (updating dialog).
  *
  * Return zero upon success, nonzero upon failure.
  */
-int 
+int
 s2_request_to(struct dialog *d,
 	      sip_method_t method, char const *name,
 	      tport_t *tport,
@@ -546,7 +546,7 @@
 
   if (!d->local && sip->sip_from)
     d->local = sip_from_dup(d->home, sip->sip_from);
-  if (!d->contact && sip->sip_contact) 
+  if (!d->contact && sip->sip_contact)
     d->contact = sip_contact_dup(d->home, sip->sip_contact);
   if (!d->remote && sip->sip_to)
     d->remote = sip_to_dup(d->home, sip->sip_to);
@@ -558,7 +558,7 @@
     d->call_id = sip_call_id_dup(d->home, sip->sip_call_id);
   if (!d->lseq && sip->sip_cseq)
     d->lseq = sip->sip_cseq->cs_seq;
-  
+
   if (!d->local)
     d->local = sip_from_dup(d->home, s2->local);
   if (!d->contact)
@@ -643,7 +643,7 @@
     }
   }
 
-  sip_add_tl(msg, sip, 
+  sip_add_tl(msg, sip,
 	     TAG_IF(!sip->sip_from, SIPTAG_FROM(d->local)),
 	     TAG_IF(!sip->sip_contact, SIPTAG_CONTACT(d->contact)),
 	     TAG_IF(!sip->sip_to, SIPTAG_TO(d->remote)),
@@ -670,7 +670,7 @@
   }
 
   return tport ? 0 : -1;
-  
+
  error:
   ta_end(ta);
   return -1;
@@ -809,7 +809,7 @@
 
 /* ---------------------------------------------------------------------- */
 /* tport interface */
-static void 
+static void
 s2_stack_recv(struct tester *s2,
 	      tport_t *tp,
 	      msg_t *msg,
@@ -844,16 +844,16 @@
 	       int errcode,
 	       char const *remote)
 {
-  fprintf(stderr, "%s(%p): error %d (%s) from %s\n", 
+  fprintf(stderr, "%s(%p): error %d (%s) from %s\n",
 	  "nua_tester_error",
-	  (void *)tp, errcode, su_strerror(errcode), 
+	  (void *)tp, errcode, su_strerror(errcode),
 	  remote ? remote : "<unknown destination>");
 }
 
 static msg_t *
 s2_stack_alloc(struct tester *s2, int flags,
 	       char const data[], usize_t size,
-	       tport_t const *tport, 
+	       tport_t const *tport,
 	       tp_client_t *tpc)
 {
   return msg_create(s2->mclass, flags | s2->flags);
@@ -890,7 +890,7 @@
 
   s2->local = sip_from_format(s2->home, "Bob <sip:bob@%s>",
 			     hostname ? hostname : "example.net");
-  
+
   if (hostname == NULL)
     hostname = "127.0.0.1";
 
@@ -952,8 +952,8 @@
 
   if (protocols == NULL)
     protocols = default_protocols;
-  
-  bound = tport_tbind(s2->master, tpn, protocols, 
+
+  bound = tport_tbind(s2->master, tpn, protocols,
 		      TPTAG_SERVER(1),
 		      ta_tags(ta));
   assert(bound != -1);
@@ -979,7 +979,7 @@
 
     v = sip_via_format(s2->home, "SIP/2.0/%s %s:%s",
 		       tpn->tpn_proto,
-		       tpn->tpn_host, 
+		       tpn->tpn_host,
 		       tpn->tpn_port);
     assert(v != NULL);
     if (strncasecmp(tpn->tpn_proto, "tls", 3)) {
@@ -988,11 +988,11 @@
 			     tpn->tpn_port,
 			     tpn->tpn_proto);
       if (s2->udp.contact == NULL && strcasecmp(tpn->tpn_proto, "udp") == 0) {
-	s2->udp.tport = tport_ref(tp); 
+	s2->udp.tport = tport_ref(tp);
 	s2->udp.contact = m;
       }
       if (s2->tcp.contact == NULL && strcasecmp(tpn->tpn_proto, "tcp") == 0) {
-	s2->tcp.tport = tport_ref(tp); 
+	s2->tcp.tport = tport_ref(tp);
 	s2->tcp.contact = m;
       }
     }
@@ -1007,7 +1007,7 @@
 			     tpn->tpn_host,
 			     tpn->tpn_port);
       if (s2->tls.contact == NULL) {
-	s2->tls.tport = tport_ref(tp); 
+	s2->tls.tport = tport_ref(tp);
 	s2->tls.contact = m;
       }
     }
@@ -1519,7 +1519,7 @@
 		NULL);
 
   ta_start(ta, tag, value);
-  s2->nua = 
+  s2->nua =
     nua_create(s2->root,
 	       s2_nua_callback,
 	       s2,
@@ -1534,7 +1534,7 @@
 #endif
 	       ta_tags(ta));
   ta_end(ta);
-  
+
   return s2->nua;
 }
 
@@ -1600,7 +1600,7 @@
     struct message *m;
 
     nua_unregister(nh, TAG_END());
-    
+
     m = s2_wait_for_request(SIP_METHOD_REGISTER); assert(m);
     s2_save_register(m);
     s2_respond_to(m, NULL,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.h	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  */
 
 #ifndef S2TESTER_H
-#define S2TESTER_H 
+#define S2TESTER_H
 
 #define TP_STACK_T struct tester
 #define SU_ROOT_MAGIC_T struct tester

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -17,7 +17,7 @@
 	* sdp_print.c (sdp_printing_error): Fixed return
 	for success to be NULL as defined in function
 	documentation.
-	
+
 2005-09-29  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
   * Added SDPTAG_TYPEDEF().

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -53,7 +53,8 @@
 			tests/message-7.sdp \
 			tests/message-8.sdp \
 			tests/message-9.sdp \
-			tests/message-10.sdp
+			tests/message-10.sdp \
+			tests/message-11.sdp
 
 # ----------------------------------------------------------------------
 # Sofia specific rules

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/errata
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/errata	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/errata	Tue Dec 23 07:37:03 2008
@@ -6,7 +6,7 @@
   but example (RTP/AVP!) contains also "/"
 
 * bwtype is restricted to alpha-numeric, but the RFC text discusses
-  extensions like b=x-y:100 
+  extensions like b=x-y:100
 
 * att-field is restricted to alpha-numeric, but the RFC text discusses
   extensions like a=x-nokia-foo

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/run_test_sdp
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/run_test_sdp	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/run_test_sdp	Tue Dec 23 07:37:03 2008
@@ -12,12 +12,12 @@
 if test -r $tests/message-1.sdp ; then
 
 for n in 1 2 3 4 5 6 7 8 9 10 11;
-do 
+do
     echo -n "$n: "
     "$test_sdp" < "$tests/message-$n.sdp" && echo OK
 done
 
-else 
+else
     echo "sdp run-tests: no tests found in $tests, skipping."
     exit 77
 fi

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c	Tue Dec 23 07:37:03 2008
@@ -99,37 +99,37 @@
 static size_t list_xtra_all(xtra_f *xtra, void const *v);
 static void *list_dup_all(dup_f *dup, char **bb, void const *vsrc);
 
-static size_t session_xtra(sdp_session_t const *o); 
+static size_t session_xtra(sdp_session_t const *o);
 static sdp_session_t *session_dup(char **pp, sdp_session_t const *o);
 
-static size_t origin_xtra(sdp_origin_t const *o); 
+static size_t origin_xtra(sdp_origin_t const *o);
 static sdp_origin_t *origin_dup(char **pp, sdp_origin_t const *o);
 
-static size_t connection_xtra(sdp_connection_t const *o); 
+static size_t connection_xtra(sdp_connection_t const *o);
 static sdp_connection_t *connection_dup(char **pp, sdp_connection_t const *o);
 
-static size_t bandwidth_xtra(sdp_bandwidth_t const *o); 
+static size_t bandwidth_xtra(sdp_bandwidth_t const *o);
 static sdp_bandwidth_t *bandwidth_dup(char **pp, sdp_bandwidth_t const *o);
 
-static size_t time_xtra(sdp_time_t const *o); 
+static size_t time_xtra(sdp_time_t const *o);
 static sdp_time_t *time_dup(char **pp, sdp_time_t const *o);
 
-static size_t repeat_xtra(sdp_repeat_t const *o); 
+static size_t repeat_xtra(sdp_repeat_t const *o);
 static sdp_repeat_t *repeat_dup(char **pp, sdp_repeat_t const *o);
 
-static size_t zone_xtra(sdp_zone_t const *o); 
+static size_t zone_xtra(sdp_zone_t const *o);
 static sdp_zone_t *zone_dup(char **pp, sdp_zone_t const *o);
 
-static size_t key_xtra(sdp_key_t const *o); 
+static size_t key_xtra(sdp_key_t const *o);
 static sdp_key_t *key_dup(char **pp, sdp_key_t const *o);
 
-static size_t attribute_xtra(sdp_attribute_t const *o); 
+static size_t attribute_xtra(sdp_attribute_t const *o);
 static sdp_attribute_t *attribute_dup(char **pp, sdp_attribute_t const *o);
 
-static size_t list_xtra(sdp_list_t const *o); 
+static size_t list_xtra(sdp_list_t const *o);
 static sdp_list_t *list_dup(char **pp, sdp_list_t const *o);
 
-static size_t rtpmap_xtra(sdp_rtpmap_t const *o); 
+static size_t rtpmap_xtra(sdp_rtpmap_t const *o);
 static sdp_rtpmap_t *rtpmap_dup(char **pp, sdp_rtpmap_t const *o);
 
 static size_t media_xtra(sdp_media_t const *o);
@@ -182,12 +182,12 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_origin_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_origin_t *sdp_origin_dup(su_home_t *h, sdp_origin_t const *o)
-{ 
+{
   SDP_DUP(origin, o);
 }
 
@@ -202,12 +202,12 @@
  * @note The duplicated list is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_connection_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_connection_t *sdp_connection_dup(su_home_t *h, sdp_connection_t const *c)
-{ 
+{
   SDP_LIST_DUP(connection, c);
 }
 
@@ -222,12 +222,12 @@
  * @note The duplicated list is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_bandwidth_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_bandwidth_t *sdp_bandwidth_dup(su_home_t *h, sdp_bandwidth_t const *b)
-{ 
+{
   SDP_LIST_DUP(bandwidth, b);
 }
 
@@ -242,12 +242,12 @@
  * @note The duplicated list is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_time_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_time_t *sdp_time_dup(su_home_t *h, sdp_time_t const *t)
-{ 
+{
   SDP_LIST_DUP(time, t);
 }
 
@@ -262,12 +262,12 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_repeat_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_repeat_t *sdp_repeat_dup(su_home_t *h, sdp_repeat_t const *r)
-{ 
+{
   SDP_DUP(repeat, r);
 }
 
@@ -282,12 +282,12 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_zone_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_zone_t *sdp_zone_dup(su_home_t *h, sdp_zone_t const *z)
-{ 
+{
   SDP_DUP(zone, z);
 }
 
@@ -302,12 +302,12 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_key_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_key_t *sdp_key_dup(su_home_t *h, sdp_key_t const *k)
-{ 
+{
   SDP_DUP(key, k);
 }
 
@@ -322,12 +322,12 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_attribute_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_attribute_t *sdp_attribute_dup(su_home_t *h, sdp_attribute_t const *a)
-{ 
+{
   SDP_LIST_DUP(attribute, a);
 }
 
@@ -342,12 +342,12 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_list_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_list_t *sdp_list_dup(su_home_t *h, sdp_list_t const *l)
-{ 
+{
   SDP_LIST_DUP(list, l);
 }
 
@@ -362,12 +362,12 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_rtpmap_t structure is
  * returned, otherwise NULL is returned.
  */
 sdp_rtpmap_t *sdp_rtpmap_dup(su_home_t *h, sdp_rtpmap_t const *rm)
-{ 
+{
   SDP_LIST_DUP(rtpmap, rm);
 }
 
@@ -384,11 +384,11 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_media_t structure is
  * returned, otherwise NULL is returned.
  */
-sdp_media_t *sdp_media_dup(su_home_t *h, sdp_media_t const *m, 
+sdp_media_t *sdp_media_dup(su_home_t *h, sdp_media_t const *m,
 			   sdp_session_t *sdp)
 {
   sdp_media_t *rv; size_t size; char *p, *end;
@@ -412,11 +412,11 @@
  * @note The duplicated list is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to a newly allocated list of sdp_media_t
  * structures is returned, otherwise NULL is returned.
  */
-sdp_media_t *sdp_media_dup_all(su_home_t *h, sdp_media_t const *m, 
+sdp_media_t *sdp_media_dup_all(su_home_t *h, sdp_media_t const *m,
 			       sdp_session_t *sdp)
 {
   sdp_media_t *rv; size_t size; char *p, *end;
@@ -441,14 +441,14 @@
  * @param dst_c Connection description used instead of duplicate of @a src_c.
  * @param src_c Connection description not to be duplicated
 
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_media_t structure is
  * returned, otherwise NULL is returned.
  *
  * @deprecated
  * This function is deprecated. Use sdp_media_dup() instead.
  */
-sdp_media_t *sdp_media_dup_ex(su_home_t *home, 
+sdp_media_t *sdp_media_dup_ex(su_home_t *home,
 			      sdp_media_t const *src,
 			      sdp_session_t *sdp,
 			      sdp_connection_t *dst_c,
@@ -479,7 +479,7 @@
   char *p;
   sdp_origin_t *o;
 
-  p = *pp; 
+  p = *pp;
   STRUCT_DUP(p, o, src);
   STR_DUP(p, o, src, o_username);
   PTR_DUP(p, o, src, o_address, connection_dup);
@@ -502,8 +502,8 @@
   char *p;
   sdp_connection_t *c;
 
-  p = *pp; 
-  STRUCT_DUP(p, c, src); 
+  p = *pp;
+  STRUCT_DUP(p, c, src);
   c->c_next = NULL;
   STR_DUP(p, c, src, c_address);
 
@@ -666,12 +666,12 @@
   LST_XTRA(rv, m->m_bandwidths, bandwidth_xtra);
   PTR_XTRA(rv, m->m_key, key_xtra);
   LST_XTRA(rv, m->m_attributes, attribute_xtra);
-  
+
   return rv;
 }
 
 static
-sdp_media_t *media_dup(char **pp, 
+sdp_media_t *media_dup(char **pp,
 		       sdp_media_t const *src,
 		       sdp_session_t *sdp)
 {
@@ -692,11 +692,11 @@
   PTR_DUP(p, m, src, m_key, key_dup);
   LST_DUP(p, m, src, m_attributes, attribute_dup);
 
-  /* note! we must not implicitly use 'src->m_session' as it 
+  /* note! we must not implicitly use 'src->m_session' as it
            might point to a temporary session */
   m->m_session = sdp;
-    
-  m->m_rejected = src->m_rejected; 
+
+  m->m_rejected = src->m_rejected;
   m->m_mode = src->m_mode;
 
   assert((size_t)(p - *pp) == media_xtra(src));
@@ -730,7 +730,7 @@
 }
 
 static
-sdp_media_t *media_dup_ex(char **pp, 
+sdp_media_t *media_dup_ex(char **pp,
 			  sdp_media_t const *src,
 			  sdp_session_t *sdp,
 			  sdp_connection_t *dst_c,
@@ -759,12 +759,12 @@
     LST_DUP(p, m, src, m_bandwidths, bandwidth_dup);
     PTR_DUP(p, m, src, m_key, key_dup);
     LST_DUP(p, m, src, m_attributes, attribute_dup);
-    
-    /* note! we must not implicitly use 'src->m_session' as it 
+
+    /* note! we must not implicitly use 'src->m_session' as it
        might point to a temporary session */
     m->m_session = sdp;
-    
-    m->m_rejected = src->m_rejected; 
+
+    m->m_rejected = src->m_rejected;
     m->m_mode = src->m_mode;
 
     assert(m);
@@ -793,7 +793,7 @@
 }
 
 static
-sdp_media_t *media_dup_all(char **pp, 
+sdp_media_t *media_dup_all(char **pp,
 			   sdp_media_t const *src,
 			   sdp_session_t *sdp)
 {
@@ -827,7 +827,7 @@
   char *p;
   sdp_list_t *l;
 
-  p = *pp; 
+  p = *pp;
   STRUCT_DUP(p, l, src);
   l->l_next = NULL;
   STR_DUP(p, l, src, l_text);
@@ -853,7 +853,7 @@
   char *p;
   sdp_rtpmap_t *rm;
 
-  p = *pp; 
+  p = *pp;
   STRUCT_DUP(p, rm, src);
   rm->rm_next = NULL;
   STR_DUP(p, rm, src, rm_encoding);
@@ -954,7 +954,7 @@
   char *p;
   sdp_session_t *sdp;
 
-  p = *pp; 
+  p = *pp;
   STRUCT_DUP(p, sdp, src);
   sdp->sdp_next = NULL;
 
@@ -988,13 +988,13 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_session_t structure is
  * returned, otherwise NULL is returned.
  */
 
 sdp_session_t *sdp_session_dup(su_home_t *h, sdp_session_t const *sdp)
-{ 
+{
   SDP_DUP(session, sdp);
 }
 
@@ -1026,7 +1026,7 @@
   char *p;
   sdp_session_t *sdp;
 
-  p = *pp; 
+  p = *pp;
   STRUCT_DUP(p, sdp, src);
   sdp->sdp_next = NULL;
 
@@ -1044,7 +1044,7 @@
   STR_DUP(p, sdp, src, sdp_charset);
 
   sdp->sdp_media = NULL;
-  
+
   assert((size_t)(p - *pp) == session_without_media_xtra(src));
   *pp = p;
   return sdp;
@@ -1065,14 +1065,14 @@
  * @note The duplicated structure is allocated using a single call to
  * su_alloc() and it can be freed with su_free().
  *
- * @return 
+ * @return
  * If successful, a pointer to newly allocated sdp_session_t structure is
  * returned, otherwise NULL is returned.
  */
 
-sdp_session_t *sdp_session_dup_without_media(su_home_t *h, 
+sdp_session_t *sdp_session_dup_without_media(su_home_t *h,
 					     sdp_session_t const *sdp)
-{ 
+{
   SDP_DUP(session_without_media, sdp);
 }
 
@@ -1085,7 +1085,7 @@
 {
   sdp_session_t const *sdp = (sdp_session_t *)t->t_value;
 
-  if (sdp) 
+  if (sdp)
     return STRUCT_ALIGN(offset) + session_xtra(sdp);
   else
     return 0;
@@ -1097,7 +1097,7 @@
   sdp_session_t const *srcsdp;
   char *b;
 
-  assert(src); assert(*bb); 
+  assert(src); assert(*bb);
 
   b = *bb;
   b += STRUCT_ALIGN(b);
@@ -1121,9 +1121,9 @@
 
   assert(t);
 
-  if (!t || !t->t_value) { 
-    if (size && b) b[0] = 0; 
-    return 0; 
+  if (!t || !t->t_value) {
+    if (size && b) b[0] = 0;
+    return 0;
   }
 
   sdp = (sdp_session_t const *)t->t_value;
@@ -1131,14 +1131,14 @@
   print = sdp_print(NULL, sdp, b, size, 0);
 
   retval = sdp_message_size(print);
-  
+
   sdp_printer_free(print);
 
   return (int)retval;
 }
 
 /** Tag class for SDP tags. @HIDE */
-tag_class_t sdptag_session_class[1] = 
+tag_class_t sdptag_session_class[1] =
   {{
     sizeof(sdptag_session_class),
     /* tc_next */     NULL,
@@ -1157,7 +1157,7 @@
 /* ---------------------------------------------------------------------- */
 
 /* Compare two string pointers */
-su_inline 
+su_inline
 int str0cmp(char const *a, char const *b)
 {
   if (a == NULL) a = "";
@@ -1166,7 +1166,7 @@
 }
 
 /* Compare two string pointers ignoring case. */
-su_inline 
+su_inline
 int str0casecmp(char const *a, char const *b)
 {
   if (a == NULL) a = "";
@@ -1174,16 +1174,16 @@
   return strcasecmp(a, b);
 }
 
-/** Compare two session descriptions 
+/** Compare two session descriptions
  */
 int sdp_session_cmp(sdp_session_t const *a, sdp_session_t const *b)
 {
-  int rv; 
+  int rv;
   sdp_bandwidth_t const *ab, *bb;
   sdp_attribute_t const *aa, *ba;
   sdp_media_t const *am, *bm;
- 
-  if ((rv = (a != NULL) - (b != NULL))) 
+
+  if ((rv = (a != NULL) - (b != NULL)))
     return rv;
   if (a == b)
     return 0;
@@ -1204,8 +1204,8 @@
   if ((rv = sdp_connection_cmp(a->sdp_connection, b->sdp_connection)))
     return rv;
 
-  for (ab = a->sdp_bandwidths, bb = b->sdp_bandwidths; 
-       ab || bb; 
+  for (ab = a->sdp_bandwidths, bb = b->sdp_bandwidths;
+       ab || bb;
        ab = ab->b_next, bb = bb->b_next)
     if ((rv = sdp_bandwidth_cmp(a->sdp_bandwidths, b->sdp_bandwidths)))
       return rv;
@@ -1215,14 +1215,14 @@
   if ((rv = sdp_key_cmp(a->sdp_key, b->sdp_key)))
     return rv;
 
-  for (aa = a->sdp_attributes, ba = b->sdp_attributes; 
-       aa || bb; 
+  for (aa = a->sdp_attributes, ba = b->sdp_attributes;
+       aa || bb;
        aa = aa->a_next, ba = ba->a_next)
     if ((rv = sdp_attribute_cmp(aa, ba)))
       return rv;
 
-  for (am = a->sdp_media, bm = b->sdp_media; 
-       am || bm; 
+  for (am = a->sdp_media, bm = b->sdp_media;
+       am || bm;
        am = am->m_next, bm = bm->m_next)
     if ((rv = sdp_media_cmp(am, bm)))
       return rv;
@@ -1230,13 +1230,13 @@
   return 0;
 }
 
-/** Compare two origin fields 
+/** Compare two origin fields
  */
 int sdp_origin_cmp(sdp_origin_t const *a, sdp_origin_t const *b)
 {
   int rv;
 
-  if ((rv = (a != NULL) - (b != NULL))) 
+  if ((rv = (a != NULL) - (b != NULL)))
     return rv;
   if (a == b)
     return 0;
@@ -1252,7 +1252,7 @@
   return 0;
 }
 
-/** Compare two connection fields 
+/** Compare two connection fields
  */
 int sdp_connection_cmp(sdp_connection_t const *a, sdp_connection_t const *b)
 {
@@ -1285,7 +1285,7 @@
 
   if (a->b_modifier != b->b_modifier)
     return a->b_modifier < b->b_modifier ? -1 : 1;
-  if (a->b_modifier == sdp_bw_x && 
+  if (a->b_modifier == sdp_bw_x &&
       (rv = strcmp(a->b_modifier_name, b->b_modifier_name)))
     return rv;
 
@@ -1298,9 +1298,9 @@
 /** Compare two time fields */
 int sdp_time_cmp(sdp_time_t const *a, sdp_time_t const *b)
 {
-  int rv; 
+  int rv;
 
-  if ((rv = (a != NULL) - (b != NULL))) 
+  if ((rv = (a != NULL) - (b != NULL)))
     return rv;
   if (a == b)
     return 0;
@@ -1319,7 +1319,7 @@
 int sdp_repeat_cmp(sdp_repeat_t const *a, sdp_repeat_t const *b)
 {
   int i, n;
-  
+
   if (a == b)
     return 0;
   if ((a != NULL) != (b != NULL))
@@ -1329,12 +1329,12 @@
     return a->r_interval < b->r_interval ? -1 : 1;
   if (a->r_duration != b->r_duration)
     return a->r_duration < b->r_duration ? -1 : 1;
-  n = a->r_number_of_offsets < b->r_number_of_offsets 
+  n = a->r_number_of_offsets < b->r_number_of_offsets
     ? a->r_number_of_offsets : b->r_number_of_offsets;
   for (i = 0; i < n; i++)
     if (a->r_offsets[i] != b->r_offsets[i])
       return a->r_offsets[i] < b->r_offsets[i] ? -1 : 1;
-  
+
   if (a->r_number_of_offsets != b->r_number_of_offsets)
     return a->r_number_of_offsets < b->r_number_of_offsets ? -1 : 1;
 
@@ -1345,7 +1345,7 @@
 int sdp_zone_cmp(sdp_zone_t const *a, sdp_zone_t const *b)
 {
   int i, n;
-  
+
   if (a == b)
     return 0;
   if ((a != NULL) != (b != NULL))
@@ -1379,7 +1379,7 @@
 
   if (a->k_method != b->k_method)
     return a->k_method < b->k_method ? -1 : 1;
-  if (a->k_method == sdp_key_x && 
+  if (a->k_method == sdp_key_x &&
       (rv = str0cmp(a->k_method_name, b->k_method_name)))
     return rv;
   return str0cmp(a->k_material, b->k_material);
@@ -1427,7 +1427,7 @@
       a_param = a->rm_params;
     if (b->rm_params)
       b_param = b->rm_params;
-    
+
     rv = strcasecmp(a_param, b_param);
 
     if (rv)
@@ -1457,7 +1457,7 @@
 /** Compare two media (m=) fields */
 int sdp_media_cmp(sdp_media_t const *a, sdp_media_t const *b)
 {
-  int rv; 
+  int rv;
 
   sdp_connection_t const *ac, *bc;
   sdp_bandwidth_t const *ab, *bb;
@@ -1466,7 +1466,7 @@
 
   if (a == b)
     return 0;
-  if ((rv = (a != NULL) - (b != NULL))) 
+  if ((rv = (a != NULL) - (b != NULL)))
     return rv;
 
   if (a->m_type != b->m_type)
@@ -1493,8 +1493,8 @@
   if (a->m_mode != b->m_mode)
     return a->m_mode < b->m_mode ? -1 : 1;
 
-  for (arm = a->m_rtpmaps, brm = b->m_rtpmaps; 
-       arm || brm; 
+  for (arm = a->m_rtpmaps, brm = b->m_rtpmaps;
+       arm || brm;
        arm = arm->rm_next, brm = brm->rm_next)
     if ((rv = sdp_rtpmap_cmp(arm, brm)))
       return rv;
@@ -1505,14 +1505,14 @@
   if ((rv = str0cmp(a->m_information, b->m_information)))
     return rv;
 
-  for (ac = a->m_connections, bc = b->m_connections; 
-       ac || bc; 
+  for (ac = a->m_connections, bc = b->m_connections;
+       ac || bc;
        ac = ac->c_next, bc = bc->c_next)
   if ((rv = sdp_connection_cmp(ac, bc)))
     return rv;
 
-  for (ab = a->m_bandwidths, bb = b->m_bandwidths; 
-       ab || bb; 
+  for (ab = a->m_bandwidths, bb = b->m_bandwidths;
+       ab || bb;
        ab = ab->b_next, bb = bb->b_next)
     if ((rv = sdp_bandwidth_cmp(a->m_bandwidths, b->m_bandwidths)))
       return rv;
@@ -1520,8 +1520,8 @@
   if ((rv = sdp_key_cmp(a->m_key, b->m_key)))
     return rv;
 
-  for (aa = a->m_attributes, ba = b->m_attributes; 
-       aa || bb; 
+  for (aa = a->m_attributes, ba = b->m_attributes;
+       aa || bb;
        aa = aa->a_next, ba = ba->a_next)
     if ((rv = sdp_attribute_cmp(aa, ba)))
       return rv;
@@ -1556,8 +1556,8 @@
 }
 
 /** Find named attribute from given lists (a or a2). */
-sdp_attribute_t *sdp_attribute_find2(sdp_attribute_t const *a, 
-				     sdp_attribute_t const *a2, 
+sdp_attribute_t *sdp_attribute_find2(sdp_attribute_t const *a,
+				     sdp_attribute_t const *a2,
 				     char const *name)
 {
   for (; a; a = a->a_next) {
@@ -1607,7 +1607,7 @@
     name = "sendrecv";
   else
     return NULL;
-  
+
   a = su_salloc(home, sizeof(*a));
   if (a)
     a->a_name = name;
@@ -1615,7 +1615,7 @@
   return a;
 }
 
-/** Find a mapped attribute. 
+/** Find a mapped attribute.
  *
  * A mapped attribute has form 'a=<name>:<pt> <value>' where pt is a RTP
  * payload type, integer in range 0..127. For example, "a=atmmap" [@RFC3108]
@@ -1627,7 +1627,7 @@
  * @param pt payload type number (must be 0..127)
  * @param return_result return value parameter for mapped attribute value
  *
- * @return Pointer to a matching attribute structure, or NULL. 
+ * @return Pointer to a matching attribute structure, or NULL.
  *
  * If a matching attribute is found, @a return_result will point to part of
  * the attribute after the payload type and whitespace.
@@ -1670,7 +1670,7 @@
 }
 
 /** Append a (list of) attribute(s) to a list of attributes. */
-void sdp_attribute_append(sdp_attribute_t **list, 
+void sdp_attribute_append(sdp_attribute_t **list,
 			  sdp_attribute_t const *a)
 {
   assert(list);
@@ -1684,13 +1684,13 @@
   *list = (sdp_attribute_t *)a;
 }
 
-/**Replace or append a attribute within a list of attributes. 
+/**Replace or append a attribute within a list of attributes.
  *
  * @retval 1 if replaced existing attribute
  * @retval 0 if attribute was appended
  * @retval -1 upon an error
  */
-int sdp_attribute_replace(sdp_attribute_t **list, 
+int sdp_attribute_replace(sdp_attribute_t **list,
 			  sdp_attribute_t *a,
 			  sdp_attribute_t **return_replaced)
 {
@@ -1712,7 +1712,7 @@
   }
 
   replaced = *list, *list = a;
-  
+
   if (replaced) {
     a->a_next = replaced->a_next;
     replaced->a_next = NULL;
@@ -1727,7 +1727,7 @@
 }
 
 /** Remove a named attribute from a list of attributes. */
-sdp_attribute_t *sdp_attribute_remove(sdp_attribute_t **list, 
+sdp_attribute_t *sdp_attribute_remove(sdp_attribute_t **list,
 				      char const *name)
 {
   sdp_attribute_t *a;
@@ -1876,7 +1876,7 @@
     return 1;
 
   if (!aparam) aparam = "1"; if (!bparam) bparam = "1";
-  
+
   if (strcasecmp(aparam, bparam))
     return 0;
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.docs	Tue Dec 23 07:37:03 2008
@@ -69,7 +69,7 @@
    show_critical_error(sdp_printing_error(printer));
  }
  sdp_printer_free(printer);
- at endcode 
+ at endcode
 
 @section sdp_example Example
 
@@ -79,7 +79,7 @@
 @a buf.
 
 @code
-size_t increment_sdp_version(char buf[], size_t bsize, 
+size_t increment_sdp_version(char buf[], size_t bsize,
                              char const *original, size_t osize)
 {
   su_home_t home[1] = { SU_HOME_INIT(home) };
@@ -89,7 +89,7 @@
 
   if (sdp_session(parser)) {
     sdp_session_t *sdp = sdp_session(parser);
-    
+
     sdp->sdp_origin->o_version++;
 
     printer = sdp_print(home, sdp, buf, bsize, 0);
@@ -98,19 +98,19 @@
       retval = sdp_message_size(printer);
     }
     else {
-      fprintf(stderr, "increment_sdp_version: %s\n", 
+      fprintf(stderr, "increment_sdp_version: %s\n",
               sdp_printing_error(printer));
     }
 
     sdp_printer_free(printer);
   }
   else {
-    fprintf(stderr, "increment_sdp_version: %s\n", 
+    fprintf(stderr, "increment_sdp_version: %s\n",
             sdp_parsing_error(parser));
   }
 
   sdp_parser_free(parser);
-      
+
   su_home_deinit(home);
 
   return retval;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c	Tue Dec 23 07:37:03 2008
@@ -23,7 +23,7 @@
  */
 
 /**@ingroup sdp_parser
- * @CFILE sdp_parse.c 
+ * @CFILE sdp_parse.c
  * @brief Simple SDP parser interface.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -46,7 +46,7 @@
 #include <limits.h>
 #include <assert.h>
 
-/** @typedef struct sdp_parser_s sdp_parser_t; 
+/** @typedef struct sdp_parser_s sdp_parser_t;
  *
  * SDP parser handle.
  *
@@ -105,7 +105,7 @@
  * The function sdp_parse() parses an SDP message @a msg of size @a
  * msgsize. Parsing is done according to the given @a flags. The SDP message
  * may not contain a NUL.
- * 
+ *
  * The parsing result is stored to an #sdp_session_t structure.
  *
  * @param home    memory home
@@ -115,7 +115,7 @@
  *
  * The following flags are used by parser:
  *
- * @li #sdp_f_strict Parser should accept only messages conforming strictly 
+ * @li #sdp_f_strict Parser should accept only messages conforming strictly
  *                   to the specification.
  * @li #sdp_f_anynet Parser accepts unknown network or address types.
  * @li #sdp_f_insane Do not run sanity check.
@@ -139,7 +139,7 @@
 
   if (msgsize == -1 || msg == NULL) {
     p = su_home_clone(home, sizeof(*p));
-    if (p) 
+    if (p)
       parsing_error(p, "invalid input message");
     else
       p = (sdp_parser_t*)&no_mem_error;
@@ -172,7 +172,7 @@
     p->pr_session_mode = sdp_sendrecv;
 
     parse_message(p);
-    
+
     return p;
   }
 
@@ -216,7 +216,7 @@
  *
  * @param p SDP parser
  *
- * @return 
+ * @return
  * The function sdp_parsing_error() returns a C string describing parsing
  * error, or NULL if no error occurred.
  */
@@ -230,7 +230,7 @@
  * The function sdp_parser_free() frees an SDP parser object along with
  * the memory blocks associated with it.
  *
- * @param p pointer to the SDP parser to be freed 
+ * @param p pointer to the SDP parser to be freed
  */
 void sdp_parser_free(sdp_parser_t *p)
 {
@@ -271,7 +271,7 @@
 static void parse_session_attr(sdp_parser_t *p, char *r, sdp_attribute_t **result);
 static void parse_media(sdp_parser_t *p, char *r, sdp_media_t **result);
 static void parse_payload(sdp_parser_t *p, char *r, sdp_rtpmap_t **result);
-static void parse_media_attr(sdp_parser_t *p, char *r, sdp_media_t *m, 
+static void parse_media_attr(sdp_parser_t *p, char *r, sdp_media_t *m,
 			     sdp_attribute_t **result);
 static int parse_rtpmap(sdp_parser_t *p, char *r, sdp_media_t *m);
 static int parse_fmtp(sdp_parser_t *p, char *r, sdp_media_t *m);
@@ -279,13 +279,13 @@
 
 static void parse_descs(sdp_parser_t *p, char *r, char *m, sdp_media_t **result);
 
-static int parse_ul(sdp_parser_t *p, char **r, unsigned long *result, 
+static int parse_ul(sdp_parser_t *p, char **r, unsigned long *result,
 		    unsigned long max_value);
-static int parse_ull(sdp_parser_t *p, char **r, uint64_t *result, 
+static int parse_ull(sdp_parser_t *p, char **r, uint64_t *result,
 		     uint64_t max_value);
 static void parse_alloc_error(sdp_parser_t *p, const char *typename);
 static char *next(char **message, const char *sep, const char *strip);
-static char *token(char **message, const char *sep, const char *legal, 
+static char *token(char **message, const char *sep, const char *legal,
 		   const char *strip);
 #if 0
 static void check_mandatory(sdp_parser_t *p, sdp_session_t *sdp);
@@ -301,7 +301,7 @@
  */
 #define PARSE_ALLOC(p, t, v) \
  t *v = su_salloc(p->pr_home, sizeof(*v)); \
- if (!v && (parse_alloc_error(p, #t), 1)) return; 
+ if (!v && (parse_alloc_error(p, #t), 1)) return;
 
 /* -------------------------------------------------------------------------
  * Macro PARSE_CHECK_REST
@@ -314,10 +314,10 @@
     return
 
 /* -------------------------------------------------------------------------
- * Function parse_message() - parse an SDP message 
+ * Function parse_message() - parse an SDP message
  *
  * Description:
- *   This function parses an SDP message, which is copied into the 
+ *   This function parses an SDP message, which is copied into the
  *   p->pr_message. The p->pr_message is modified during the parsing,
  *   and parts of it are returned in p->pr_session.
  *
@@ -384,7 +384,7 @@
   for (;
        record && p->pr_ok;
        record = next(&message, CRLF, strip)) {
-    field = record[0]; 
+    field = record[0];
 
     rest = record + 2; rest += strspn(rest, strip);
 
@@ -476,9 +476,9 @@
 
 int sdp_connection_is_inaddr_any(sdp_connection_t const *c)
 {
-  return 
-    c && 
-    c->c_nettype == sdp_net_in && 
+  return
+    c &&
+    c->c_nettype == sdp_net_in &&
     ((c->c_addrtype == sdp_addr_ip4 && strcmp(c->c_address, "0.0.0.0")) ||
      (c->c_addrtype == sdp_addr_ip6 && strcmp(c->c_address, "::")));
 }
@@ -506,7 +506,7 @@
       parsing_error(p, "Incorrect version");
     return;
   }
-  
+
   /* Go through all media and set mode */
   for (m = sdp->sdp_media; m; m = m->m_next) {
     if (m->m_port == 0) {
@@ -534,13 +534,13 @@
     return;
 }
 
-/** Validates that all mandatory fields exist 
+/** Validates that all mandatory fields exist
  *
  * Checks that all necessary fields (v=, o=) exists in the parsed sdp. If
- * strict, check that all mandatory fields (c=, o=, s=, t=) are present. 
+ * strict, check that all mandatory fields (c=, o=, s=, t=) are present.
  * This function also goes through all media, marks rejected media as such,
  * and updates the mode accordingly.
- * 
+ *
  * @retval 0 if parsed SDP description is valid
  * @retval -1 if some SDP line is missing
  * @retval -2 if c= line is missing
@@ -626,7 +626,7 @@
    sess-version =        1*(DIGIT)
                          ;0 is a new session
 
-			 
+
    */
   PARSE_ALLOC(p, sdp_origin_t, o);
 
@@ -873,7 +873,7 @@
     c->c_ttl = 0;
     c->c_groups = 1;
   }
-  else 
+  else
     parsing_error(p, "invalid address");
 }
 
@@ -916,7 +916,7 @@
 
   if (STRICT(p))
     PARSE_CHECK_REST(p, r, "b");
-  
+
   {
     PARSE_ALLOC(p, sdp_bandwidth_t, b);
     *result = b;
@@ -974,7 +974,7 @@
  * @param p      pointer to SDP parser object
  * @param r      pointer to record data
  * @param result pointer to which parsed record is assigned
- * 
+ *
  */
 static void parse_repeat(sdp_parser_t *p, char *d, sdp_repeat_t **result)
 {
@@ -1013,7 +1013,7 @@
     return;
   }
   if (!(r = su_salloc(p->pr_home, offsetof(sdp_repeat_t, r_offsets[N - 1])))) {
-    parse_alloc_error(p, "sdp_repeat_t"); 
+    parse_alloc_error(p, "sdp_repeat_t");
     return;
   }
 
@@ -1035,7 +1035,7 @@
 
     while (is_space(*d))
       d++;
-  } 
+  }
 
   *result = r;
 }
@@ -1090,7 +1090,7 @@
     return;
   }
   if (!(z = su_salloc(p->pr_home, offsetof(sdp_zone_t, z_adjustments[N])))) {
-    parse_alloc_error(p, "sdp_zone_t"); 
+    parse_alloc_error(p, "sdp_zone_t");
     return;
   }
 
@@ -1109,7 +1109,7 @@
 
     z->z_adjustments[n].z_at = at;
     z->z_adjustments[n].z_offset = offset;
-  } 
+  }
 
   *result = z;
 }
@@ -1205,7 +1205,7 @@
 
   if (*r)
     value = r;
-  else 
+  else
     PARSE_CHECK_REST(p, r, "a");
 
   if (strcasecmp(name, "charset") == 0) {
@@ -1213,7 +1213,7 @@
     return;
   }
 
-  if (p->pr_mode_manual) 
+  if (p->pr_mode_manual)
     ;
   else if (strcasecmp(name, "inactive") == 0)
     p->pr_session_mode = sdp_inactive;
@@ -1316,10 +1316,10 @@
     parsing_error(p, "m= missing protocol");
     return;
   }
-  
+
   if (!STRICT(p) && strcasecmp(s, "RTP") == 0)
     m->m_proto = sdp_proto_rtp, m->m_proto_name = "RTP/AVP";
-  else 
+  else
     sdp_media_transport(m, s);
 
   /* RTP format list */
@@ -1331,7 +1331,7 @@
   /* "normal" format list */
   if (*r) {
     sdp_list_t **fmt = &m->m_format;
-    
+
     while (r && *r) {
       PARSE_ALLOC(p, sdp_list_t, l);
       *fmt = l;
@@ -1374,15 +1374,16 @@
     m->m_proto = sdp_proto_rtp, m->m_proto_name = "RTP/AVP";
   else if (strcasecmp(s, "RTP/SAVP") == 0)
     m->m_proto = sdp_proto_srtp, m->m_proto_name = "RTP/SAVP";
-  else if (strcasecmp(s, "UDPTL") == 0)
-    m->m_proto = sdp_proto_udptl, m->m_proto_name = "UDPTL";
+  else if (strcasecmp(s, "udptl") == 0)
+    /* Lower case - be compatible with people living by T.38 examples */
+    m->m_proto = sdp_proto_udptl, m->m_proto_name = "udptl";
   else if (strcasecmp(s, "UDP") == 0)
     m->m_proto = sdp_proto_udp, m->m_proto_name = "UDP";
   else if (strcasecmp(s, "TCP") == 0)
     m->m_proto = sdp_proto_tcp, m->m_proto_name = "TCP";
   else if (strcasecmp(s, "TLS") == 0)
     m->m_proto = sdp_proto_tls, m->m_proto_name = "TLS";
-  else 
+  else
     m->m_proto = sdp_proto_x, m->m_proto_name = s;
 }
 
@@ -1560,10 +1561,10 @@
 
   if (*r)
     value = r;
-  else 
+  else
     PARSE_CHECK_REST(p, r, "a");
 
-  if (p->pr_mode_manual) 
+  if (p->pr_mode_manual)
     ;
   else if (strcasecmp(name, "inactive") == 0) {
     m->m_mode = sdp_inactive;
@@ -1637,11 +1638,11 @@
     return -2;
   }
 
-  if (*r == '/') 
+  if (*r == '/')
     params = ++r;
   else
     params = 0;
-    
+
   rm->rm_predef = 0;
   rm->rm_encoding = encoding;
   rm->rm_rate = rate;
@@ -1690,12 +1691,12 @@
  * Parameters:
  *   p      - pointer to SDP parser object
  *   record - pointer to first media field
- *   message - pointer to rest 
+ *   message - pointer to rest
  *   medias - pointer to which parsed media structures are assigned
  */
-static void parse_descs(sdp_parser_t *p, 
-			char *record, 
-			char *message, 
+static void parse_descs(sdp_parser_t *p,
+			char *record,
+			char *message,
 			sdp_media_t **medias)
 {
   char *rest;
@@ -1709,7 +1710,7 @@
     strip = SPACE TAB;		/* skip initial whitespace */
   else
     strip = "";
-  
+
   for (;
        record && p->pr_ok;
        record = next(&message, CRLF, strip)) {
@@ -1767,10 +1768,10 @@
 /*
  * parse_ul: parse an unsigned long
  */
-static int parse_ul(sdp_parser_t *p, char **r, 
+static int parse_ul(sdp_parser_t *p, char **r,
 		    unsigned long *result, unsigned long max)
 {
-  char *ul = *r; 
+  char *ul = *r;
 
   ul += strspn(ul, SPACE TAB);
 
@@ -1790,12 +1791,12 @@
 /*
  * parse_ull: parse an unsigned long long
  */
-static int parse_ull(sdp_parser_t *p, char **r, 
+static int parse_ull(sdp_parser_t *p, char **r,
 		     uint64_t *result, uint64_t max)
 {
   unsigned longlong ull;
 
-  char *s = *r; 
+  char *s = *r;
 
   s += strspn(s, SPACE TAB);
 
@@ -1810,9 +1811,9 @@
   return -1;
 }
 
-static char *token(char **message, 
-		   const char *sep, 
-		   const char *legal, 
+static char *token(char **message,
+		   const char *sep,
+		   const char *legal,
 		   const char *strip)
 {
   size_t n;
@@ -1823,7 +1824,7 @@
 
   if (legal)
     n = strspn(retval, legal);
-  else 
+  else
     n = strcspn(retval, sep);
 
   if (n == 0)
@@ -1872,8 +1873,8 @@
 {
   int n;
   va_list ap;
-  va_start(ap, fmt); 
-  
+  va_start(ap, fmt);
+
   memset(p->pr_error, 0, sizeof(p->pr_error));
   n = vsnprintf(p->pr_error, sizeof(p->pr_error), fmt, ap);
   va_end(ap);
@@ -1885,6 +1886,6 @@
 
 static void parse_alloc_error(sdp_parser_t *p, const char *typename)
 {
-  parsing_error(p, "memory exhausted (while allocating memory for %s)", 
+  parsing_error(p, "memory exhausted (while allocating memory for %s)",
 		typename);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@ingroup sdp_printer 
+/**@ingroup sdp_printer
  *
  * @CFILE sdp_print.c  Simple SDP printer interface.
  *
@@ -81,7 +81,7 @@
 static struct sdp_printer_s printer_memory_error = {
   sizeof(printer_memory_error),
   NULL,
-  "memory exhausted", 
+  "memory exhausted",
   sizeof(printer_memory_error.pr_buffer),
   sizeof(printer_memory_error.pr_buffer)
 };
@@ -90,14 +90,14 @@
 
 /** Print a SDP description.
  *
- * Encode the contents of the SDP session structure #sdp_session_t 
+ * Encode the contents of the SDP session structure #sdp_session_t
  * to the @a msgbuf. The @a msgbuf has size @a msgsize
  * bytes. If @a msgbuf is @c NULL, the sdp_print() function allocates the
  * required buffer from the @a home heap.
  *
  * @param home     Memory home (may be NULL).
  * @param session  SDP session description structure to be encoded.
- * @param msgbuf   Buffer to which encoding is stored (may be NULL). 
+ * @param msgbuf   Buffer to which encoding is stored (may be NULL).
  * @param msgsize  Size of @a msgbuf.
  * @param flags    Flags specifying the encoding options.
  *
@@ -117,17 +117,17 @@
  *
  * @li #sdp_f_mode_manual - Do not generate mode attributes
  *
- * @return 
+ * @return
  * Always return a handle to an #sdp_printer_t object.
  *
  * @sa #sdp_printer_t, #sdp_session_t, sdp_printing_error(),
  * sdp_message(), sdp_message_size(), sdp_printer_free(),
  * sdp_parse().
  */
-sdp_printer_t *sdp_print(su_home_t *home, 
-			 sdp_session_t const *session, 
-			 char msgbuf[], 
-			 isize_t msgsize, 
+sdp_printer_t *sdp_print(su_home_t *home,
+			 sdp_session_t const *session,
+			 char msgbuf[],
+			 isize_t msgsize,
 			 int flags)
 {
   sdp_printer_t *p = su_salloc(home, sizeof(*p));
@@ -186,10 +186,10 @@
 /** @brief Get encoded SDP message.
  *
  * Return a pointer to a C string containing the SDP message.
- * 
+ *
  * @param p Pointer to an #sdp_printer_t object.
  *
- * @return 
+ * @return
  * Return a pointer to a C string containing the encoded SDP message, or
  * NULL upon an error.
  */
@@ -207,7 +207,7 @@
  *
  * @param p Pointer to an #sdp_printer_t object.
  *
- * @return 
+ * @return
  * Number of bytes in SDP message excluding final NUL or 0 upon an error.
  */
 isize_t sdp_message_size(sdp_printer_t *p)
@@ -253,10 +253,10 @@
 static void print_key(sdp_printer_t *p, sdp_key_t const *k);
 static void print_attributes(sdp_printer_t *p, sdp_attribute_t const *a);
 static void print_charset(sdp_printer_t *p, sdp_text_t *charset);
-static void print_media(sdp_printer_t *p, sdp_session_t const *, 
+static void print_media(sdp_printer_t *p, sdp_session_t const *,
 			sdp_media_t const *m);
 
-static void print_text_list(sdp_printer_t*, 
+static void print_text_list(sdp_printer_t*,
 			    const char *, sdp_list_t const *l);
 
 static void sdp_printf(sdp_printer_t *p, const char *fmt, ...);
@@ -319,7 +319,7 @@
     return;
   }
 
-  sdp_printf(p, "o=%s "LLU" "LLU" ", 
+  sdp_printf(p, "o=%s "LLU" "LLU" ",
 	     o->o_username,
 	     (ull)o->o_id,
 	     (ull)o->o_version);
@@ -411,7 +411,7 @@
     sdp_printf(p, "%s%s%s", nettype, c->c_address);
   else
     sdp_printf(p, "%s", c->c_address);
-    
+
   if (c->c_mcast || c->c_ttl) {
     sdp_printf(p, "/%u", c->c_ttl);
     if (c->c_groups > 1)
@@ -424,13 +424,13 @@
 {
   for (; b ; b = b->b_next) {
     char const *name;
-    
+
     switch (b->b_modifier) {
     case sdp_bw_ct: name = "CT"; break;
     case sdp_bw_as: name = "AS"; break;
     default:        name = b->b_modifier_name; break;
     }
-    
+
     sdp_printf(p, "b=%s:%lu" CRLF, name, b->b_value);
   }
 }
@@ -463,9 +463,9 @@
 
   for (i = 0; i < z->z_number_of_adjustments; i++) {
     int negative = z->z_adjustments[i].z_offset < 0L;
-    sdp_printf(p, "%s%lu %s", 
+    sdp_printf(p, "%s%lu %s",
 	       i > 0 ? " " : "",
-	       z->z_adjustments[i].z_at, 
+	       z->z_adjustments[i].z_at,
 	       negative ? "-" : "");
     if (negative)
       print_typed_time(p, -z->z_adjustments[i].z_offset);
@@ -523,7 +523,7 @@
     return;
   }
 
-  sdp_printf(p, "k=%s%s%s" CRLF, method, 
+  sdp_printf(p, "k=%s%s%s" CRLF, method,
 	     have_material ? ":" : "",
 	     have_material ? k->k_material : "");
 }
@@ -537,7 +537,7 @@
   }
 }
 
-static void 
+static void
 print_attributes_without_mode(sdp_printer_t *p, sdp_attribute_t const *a)
 {
   for (;a; a = a->a_next) {
@@ -559,7 +559,7 @@
   sdp_printf(p, "a=charset%s%s" CRLF, charset ? ":" : "", charset ? charset : "");
 }
 
-static void print_media(sdp_printer_t *p, 
+static void print_media(sdp_printer_t *p,
 			sdp_session_t const *sdp,
 			sdp_media_t const *m)
 {
@@ -582,21 +582,21 @@
     case sdp_media_image  :     media = "image"; break;
     default:                    media = m->m_type_name;
     }
-    
+
     switch (m->m_proto) {
     case sdp_proto_tcp:   proto = "tcp"; break;
     case sdp_proto_udp:   proto = "udp"; break;
     case sdp_proto_rtp:   proto = "RTP/AVP"; break;
     case sdp_proto_srtp:  proto = "RTP/SAVP"; break;
-    case sdp_proto_udptl: proto = "UDPTL"; break;
+    case sdp_proto_udptl: proto = "udptl"; break;
     case sdp_proto_tls:   proto = "tls"; break;
     default:              proto = m->m_proto_name; break;
     }
-    
+
     if (m->m_number_of_ports <= 1)
       sdp_printf(p, "m=%s %u %s", media, m->m_port, proto);
     else
-      sdp_printf(p, "m=%s %u/%u %s", 
+      sdp_printf(p, "m=%s %u/%u %s",
 		 media, m->m_port, m->m_number_of_ports, proto);
 
     if (m->m_rtpmaps) {
@@ -625,7 +625,7 @@
     if (m->m_connections)
 #ifdef nomore
     if (m->m_connections != sdp->sdp_connection)
-#endif      
+#endif
       print_connection_list(p, m->m_connections);
     if (m->m_bandwidths)
       print_bandwidths(p, m->m_bandwidths);
@@ -636,10 +636,10 @@
       if (!rm->rm_predef || p->pr_all_rtpmaps)
 	sdp_printf(p, "a=rtpmap:%u %s/%lu%s%s" CRLF,
 		   rm->rm_pt, rm->rm_encoding, rm->rm_rate,
-		   rm->rm_params ? "/" : "", 
+		   rm->rm_params ? "/" : "",
 		   rm->rm_params ? rm->rm_params : "");
       if (rm->rm_fmtp)
-	sdp_printf(p, "a=fmtp:%u %s" CRLF, 
+	sdp_printf(p, "a=fmtp:%u %s" CRLF,
 		   rm->rm_pt, rm->rm_fmtp);
     }
 
@@ -670,7 +670,7 @@
   }
 }
 
-static void print_text_list(sdp_printer_t *p, 
+static void print_text_list(sdp_printer_t *p,
 			    const char *fmt, sdp_list_t const *l)
 {
   for (;l; l = l->l_next) {
@@ -698,11 +698,11 @@
 
   while (p->pr_ok) {
     int n;
-    
-    va_start(ap, fmt); 
+
+    va_start(ap, fmt);
     n = vsnprintf(p->pr_buffer + p->pr_used, p->pr_bsiz - p->pr_used, fmt, ap);
     va_end(ap);
-    
+
     if (n > -1 && (size_t)n < p->pr_bsiz - p->pr_used) {
       p->pr_used += n;
       break;
@@ -716,7 +716,7 @@
 	}
 	p->pr_owns_buffer = 0;
       }
-      else if (p->pr_may_realloc) {	
+      else if (p->pr_may_realloc) {
 	char *buffer;
 	size_t size;
 	if (p->pr_bsiz < SDP_BLOCK)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_tag.c	Tue Dec 23 07:37:03 2008
@@ -25,11 +25,11 @@
 /**@internal
  * @file sdp_tag.c
  * @brief SDP Tags
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- *  
+ *
  * @date Created: Mon May 12 12:11:30 2003 ppessi
- * 
+ *
  */
 
 #include "config.h"
@@ -43,5 +43,5 @@
 tag_typedef_t sdptag_any = NSTAG_TYPEDEF(*);
 
 tag_typedef_t sdptag_session = {{
-  TAG_NAMESPACE, "session", sdptag_session_class 
+  TAG_NAMESPACE, "session", sdptag_session_class
 }};

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp.h	Tue Dec 23 07:37:03 2008
@@ -98,7 +98,7 @@
   sdp_media_t       *sdp_media;         /**< Media descriptors */
 };
 
-/** Session description identification */ 
+/** Session description identification */
 struct sdp_origin_s
 {
   int               o_size;		/**< sizeof sdp_origin_t */
@@ -150,7 +150,7 @@
 {
   int              b_size;		/**< Size fo sdp_bandwidth_t */
   sdp_bandwidth_t *b_next;		/**< Next bw description in list */
-  sdp_bandwidth_e  b_modifier;		/**< Meaning of value 
+  sdp_bandwidth_e  b_modifier;		/**< Meaning of value
 					     (total, or per application).  */
   sdp_text_t      *b_modifier_name;     /**< Modifier if not well-known */
   unsigned long    b_value;		/**< Bandwidth in kilobits per second */
@@ -197,7 +197,7 @@
   sdp_key_clear,			/**< Key is included untransformed */
   sdp_key_base64,			/**< Key is encoded with base64 */
   sdp_key_uri,				/**< URI used to obtain a key */
-  sdp_key_prompt			/**< No key is included, 
+  sdp_key_prompt			/**< No key is included,
 					     prompt user for key */
 } sdp_key_method_e;
 
@@ -249,19 +249,19 @@
 
 /** Session mode. @note Identical to rtp_mode_t. */
 typedef enum {
-  sdp_inactive = 0, 
-  sdp_sendonly = 1, 
-  sdp_recvonly = 2, 
+  sdp_inactive = 0,
+  sdp_sendonly = 1,
+  sdp_recvonly = 2,
   sdp_sendrecv = sdp_sendonly | sdp_recvonly
 } sdp_mode_t;
 
 /** Media announcement.
- * 
+ *
  * This structure describes one media type, e.g., audio.  The description
  * contains the transport address (IP address and port) used for the group,
  * the transport protocol used, the media formats or RTP payload types, and
  * optionally media-specific bandwidth specification, encryption key and
- * attributes. 
+ * attributes.
  *
  * There is a pointer (m_user) for the application data, too.
  */
@@ -286,9 +286,9 @@
   sdp_attribute_t  *m_attributes;	/**< Media attributes */
 
   void             *m_user;	        /**< User data. */
-  
+
   /** Rejected media */
-  unsigned          m_rejected : 1;     
+  unsigned          m_rejected : 1;
   /** Inactive, recvonly, sendonly, sendrecv */
   /* sdp_mode_t */ unsigned m_mode : 2;
   unsigned          : 0;
@@ -303,7 +303,7 @@
 };
 
 /** Mapping from RTP payload to codec.
- * 
+ *
  * The sdp_rtpmap_t() structure defines a mapping from an RTP payload to a
  * particular codec.  In case of well-known payloads, the sdp_rtpmap_t()
  * structure may be predefined, that is, generated by SDP parser without
@@ -437,8 +437,8 @@
 						 char const *name);
 
 /** Find named attribute from given lists. */
-SOFIAPUBFUN sdp_attribute_t *sdp_attribute_find2(sdp_attribute_t const *a, 
-						 sdp_attribute_t const *a2, 
+SOFIAPUBFUN sdp_attribute_t *sdp_attribute_find2(sdp_attribute_t const *a,
+						 sdp_attribute_t const *a2,
 						 char const *name);
 
 /** Get session mode from attribute list. */
@@ -446,26 +446,26 @@
 					  sdp_mode_t defmode);
 
 /** Get session mode from attribute list. */
-SOFIAPUBFUN sdp_attribute_t *sdp_attribute_by_mode(su_home_t *, 
+SOFIAPUBFUN sdp_attribute_t *sdp_attribute_by_mode(su_home_t *,
 						   sdp_mode_t mode);
 
 /** Find a mapped attribute. */
-SOFIAPUBFUN 
+SOFIAPUBFUN
 sdp_attribute_t *sdp_attribute_mapped_find(sdp_attribute_t const *a,
 					   char const *name,
 					   int pt, char **return_result);
 
 /** Append a attribute to a list of attributes. */
-SOFIAPUBFUN void sdp_attribute_append(sdp_attribute_t **list, 
+SOFIAPUBFUN void sdp_attribute_append(sdp_attribute_t **list,
 				      sdp_attribute_t const *a);
 
 /** Replace a attribute within a list of attributes. */
-SOFIAPUBFUN int sdp_attribute_replace(sdp_attribute_t **list, 
+SOFIAPUBFUN int sdp_attribute_replace(sdp_attribute_t **list,
 				      sdp_attribute_t *a,
 				      sdp_attribute_t **return_replaced);
 
 /** Remove a named attribute from a list of attributes. */
-SOFIAPUBFUN sdp_attribute_t *sdp_attribute_remove(sdp_attribute_t **list, 
+SOFIAPUBFUN sdp_attribute_t *sdp_attribute_remove(sdp_attribute_t **list,
 						  char const *name);
 
 /* Return 1 if m= line struct matches with given type and name */
@@ -505,8 +505,8 @@
   /** Accept only conforming SDP */
   sdp_f_strict = 1,
   /** Accept any network type. */
-  sdp_f_anynet = 2,		
-  /** Reallocate message. */ 
+  sdp_f_anynet = 2,
+  /** Reallocate message. */
   sdp_f_realloc = 4,
   /** Include well-known rtpmaps in message, too */
   sdp_f_all_rtpmaps = 8,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp_tag.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp_tag.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp_tag.h	Tue Dec 23 07:37:03 2008
@@ -26,7 +26,7 @@
 /** Defined when <sofia-sip/sdp_tag.h> has been included. */
 #define SDP_TAG_H
 
-/**@file sofia-sip/sdp_tag.h   
+/**@file sofia-sip/sdp_tag.h
  * @brief SDP tags
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -65,12 +65,12 @@
 
 #if SU_HAVE_INLINE
 su_inline
-tag_value_t sdptag_session_v(struct sdp_session_s const *v) { 
-  return (tag_value_t)v; 
+tag_value_t sdptag_session_v(struct sdp_session_s const *v) {
+  return (tag_value_t)v;
 }
 su_inline
-tag_value_t sdptag_session_vr(struct sdp_session_s const **vp) { 
-  return (tag_value_t)vp; 
+tag_value_t sdptag_session_vr(struct sdp_session_s const **vp) {
+  return (tag_value_t)vp;
 }
 #else
 #define sdptag_session_v(v)   (tag_value_t)(v)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/test_sdp.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/test_sdp.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/test_sdp.c	Tue Dec 23 07:37:03 2008
@@ -62,7 +62,7 @@
   char buffer[2048];
   int  n;
   su_home_t *home = su_home_create();
-  int exitcode = 1; 
+  int exitcode = 1;
   FILE *f;
 
   if (argv[1] && strcmp(argv[1], "-"))
@@ -124,7 +124,7 @@
       perror("test_sdp");
     }
     else {
-      fprintf(stderr, "test_sdp: maximum length of sdp messages is %u bytes\n", 
+      fprintf(stderr, "test_sdp: maximum length of sdp messages is %u bytes\n",
 	      (unsigned)sizeof(buffer));
     }
     exit(1);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/torture_sdp.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/torture_sdp.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sdp/torture_sdp.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@internal
  *
- * @CFILE sdp_torture.c  
+ * @CFILE sdp_torture.c
  *
  * Torture testing sdp module.
  *
@@ -59,10 +59,10 @@
 
 FILE *null;
 
-static char const e0_msg[] = 
+static char const e0_msg[] =
 "foo";
 
-static char const e1_msg[] = 
+static char const e1_msg[] =
     "v=1\n"
     "s=/sdp_torture\n"
     "o=sdp_torture 0 0 IN IP4 0.0.0.0\n"
@@ -102,7 +102,7 @@
   END();
 }
 
-static char const s0_msg[] = 
+static char const s0_msg[] =
     "v=0\n"
     "s=/sdp_torture\n"
     "o=sdp_torture 0 0 IN IP4 0.0.0.0\n"
@@ -136,7 +136,7 @@
 
   su_home_check(home2);
   TEST_1(home2);
-  
+
   TEST_1((parser = sdp_parse(home, s0_msg, sizeof(s0_msg), sdp_f_config)));
   TEST_1((sdp_src = sdp_session(parser)));
   TEST_1(sdp_src->sdp_media);
@@ -179,7 +179,7 @@
   /* destroy the first home instance */
   su_home_check(home);
   su_home_unref(home);
-    
+
   /* access all cloned data by printing it */
   printer = sdp_print(home2, sdp_target, buffer, sizeof(buffer), 0);
   if (printer != NULL) {
@@ -188,7 +188,7 @@
     if (tstflags & tst_verbatim) {
       printf("sdp_torture.c: parsed SDP message:\"%s\".\n", msg);
     }
-      
+
     sdp_printer_free(printer);
   }
 
@@ -224,7 +224,7 @@
   END();
 }
 
-static char const s1_msg[] = 
+static char const s1_msg[] =
   "v=0\r\n"
   "o=- 2435697 2435697 IN IP4 172.21.137.44\r\n"
   "s=-\r\n"
@@ -238,7 +238,7 @@
   "a=fmtp:97 mode-set=\"0,1,2,3,4\"\r\n"
   "a=ptime:400\r\n";
 
-static char const s2_msg[] = 
+static char const s2_msg[] =
   "v=0\r\n"
   "o=- 308519342 2 IN IP4 172.168.1.55\r\n"
   "s=-\r\n"
@@ -413,7 +413,7 @@
 	   &sdp_rtpmap_cn_reserved);
     TEST_1(!rm->rm_next);
   }
-  
+
   TEST_1((parser = sdp_parse(home, s2_msg, sizeof (s2_msg), 0)));
   TEST_1((sdp = sdp_session(parser)));
   TEST_1(m = sdp->sdp_media);
@@ -438,7 +438,7 @@
   END();
 }
 
-static char const s3_msg[] = 
+static char const s3_msg[] =
   "v=0\r\n"
   "o=- 2435697 2435697 IN IP4 172.21.137.44\r\n"
   "s=-\r\n"
@@ -461,7 +461,7 @@
   su_home_check(home); TEST_1(home);
 
   TEST_1((parser = sdp_parse(home, s3_msg, sizeof(s3_msg) - 1, 0)));
-  
+
   TEST_1(sdp_sanity_check(parser) == 0);
 
   su_home_unref(home);
@@ -469,7 +469,7 @@
   END();
 }
 
-static char const pint_msg[] = 
+static char const pint_msg[] =
   "v=0\r\n"
   "o=- 2353687640 2353687640 IN IP4 128.3.4.5\r\n"
   "s=marketing\r\n"
@@ -479,7 +479,7 @@
   "m=audio 1 voice -\r\n"
   ;
 
-static char const pint_torture_msg[] = 
+static char const pint_torture_msg[] =
   "v=0\r\n"
   "o=- 2353687640 2353687640 IN IP4 128.3.4.5\r\n"
   "s=marketing\r\n"
@@ -514,7 +514,7 @@
   TEST_1((parser = sdp_parse(home, pint_torture_msg, sizeof(pint_torture_msg) - 1,
 			     sdp_f_anynet)));
   TEST_1((sdp = sdp_session(parser)));
-  
+
   su_home_check(home);
   su_home_unref(home);
 
@@ -555,16 +555,16 @@
 }
 
 static
-sdp_rtpmap_t const rm0[1] = 
-  {{ 
+sdp_rtpmap_t const rm0[1] =
+  {{
       sizeof(rm0), NULL, "AMR", 8000, "1",
       "mode-set=4,5,6 interleaving crc use-redundancy=1",
       0, 96, 0
   }};
 
 static
-sdp_rtpmap_t const rm1[1] = 
-  {{ 
+sdp_rtpmap_t const rm1[1] =
+  {{
       sizeof(rm1), (sdp_rtpmap_t *)rm0, "PCMA", 8000, "1",
       NULL,
       1, 8, 0,
@@ -605,7 +605,7 @@
 
 static sdp_attribute_t const a0[1] =
   {{ sizeof(a0), NULL, "foo", "2"}};
-static sdp_attribute_t const a1[1] = 
+static sdp_attribute_t const a1[1] =
   {{ sizeof(a1), (sdp_attribute_t *)a0, "bar", "1" }};
 
 static int test_attribute(void)
@@ -648,12 +648,12 @@
   replaced = (void *)-1;
   TEST(sdp_attribute_replace(&list, NULL, &replaced), -1);
   TEST_P(replaced, NULL);
-  TEST(sdp_attribute_replace(&list, a, &replaced), 0); 
+  TEST(sdp_attribute_replace(&list, a, &replaced), 0);
   TEST_P(replaced, NULL);
-  TEST(sdp_attribute_replace(&list, a_new, &replaced), 1); 
+  TEST(sdp_attribute_replace(&list, a_new, &replaced), 1);
   TEST_P(replaced, a);
 
-  TEST_VOID(sdp_attribute_append(&list, a)); 
+  TEST_VOID(sdp_attribute_append(&list, a));
 
   TEST_P(sdp_attribute_remove(&list, "bAr"), a_new);
   TEST_P(sdp_attribute_remove(&list, "BAR"), a);
@@ -672,7 +672,7 @@
   END();
 }
 
-static char const media_msg[] = 
+static char const media_msg[] =
 "v=0\n"
 "s=/sdp_torture\n"
 "o=sdp_torture 0 0 IN IP4 1.2.3.4\n"
@@ -689,13 +689,13 @@
 "c=IN IP4 2.3.4.5\n";
 
 static sdp_media_t const m0[1] =
-  {{ sizeof(m0), 
-     NULL, 
+  {{ sizeof(m0),
+     NULL,
      NULL,
      sdp_media_audio,
-     NULL, 
-     1234, 
-     5, 
+     NULL,
+     1234,
+     5,
      sdp_proto_udp,
      "udp",
   }};
@@ -781,20 +781,20 @@
   TEST_1(sdp_time_cmp(t1, t1) == 0);
   TEST_1(sdp_time_cmp(t1, t2) == 0);
   TEST_1(sdp_time_cmp(t2, t1) == 0);
-  TEST_1((t = t->t_next)); *t1 = *t; t1->t_next = NULL; 
+  TEST_1((t = t->t_next)); *t1 = *t; t1->t_next = NULL;
   TEST_1(sdp_time_cmp(t1, t2) > 0);
   TEST_1(sdp_time_cmp(t2, t1) < 0);
-  TEST_1((t = t->t_next)); *t2 = *t; t2->t_next = NULL; 
+  TEST_1((t = t->t_next)); *t2 = *t; t2->t_next = NULL;
   TEST_1(t2->t_zone); TEST_1(t2->t_repeat);
   TEST_1(sdp_time_cmp(t2, t2) == 0);
   TEST_1(sdp_time_cmp(t1, t2) > 0);
   TEST_1(sdp_time_cmp(t2, t1) < 0);
-  TEST_1((t = t->t_next)); *t1 = *t; t1->t_next = NULL; 
+  TEST_1((t = t->t_next)); *t1 = *t; t1->t_next = NULL;
   TEST_1(t1->t_zone); TEST_1(t1->t_repeat);
   TEST_1(sdp_time_cmp(t1, t1) == 0);
   TEST_1(sdp_time_cmp(t2, t2) == 0);
   TEST_1(sdp_time_cmp(t1, t2) == 0);
-  
+
   sdp_parser_free(parser);
 
   END();
@@ -829,9 +829,9 @@
 
   TEST_1(home = su_home_create());
 
-  /* 
+  /*
    * Allocate an SDP structure using su_salloc().
-   * su_salloc() puts memory area size to the beginning of structure 
+   * su_salloc() puts memory area size to the beginning of structure
    * and zeroes rest of the structure.
    */
   TEST_1(sdp = su_salloc(home, sizeof(*sdp)));
@@ -850,7 +850,7 @@
   o->o_id = rand();
   o->o_version = 1;
   o->o_address = c;
-  
+
   c->c_nettype = sdp_net_in;
   c->c_addrtype = sdp_addr_ip4;
   c->c_address = "172.21.40.40";
@@ -860,10 +860,10 @@
   m->m_port = 5004;
   m->m_proto = sdp_proto_rtp; m->m_proto_name = "RTP/AVP";
   m->m_rtpmaps = rm;
-  
+
   rm->rm_predef = 1;
   rm->rm_pt = 8;
-  rm->rm_encoding = "PCMA"; 
+  rm->rm_encoding = "PCMA";
   rm->rm_rate = 8000;
 
   TEST_1(m1 = su_salloc(home, sizeof(*m1)));

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/ADD-A-HEADER
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/ADD-A-HEADER	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/ADD-A-HEADER	Tue Dec 23 07:37:03 2008
@@ -23,7 +23,7 @@
     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.
 
@@ -50,16 +50,16 @@
   * 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 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 #### 
+   - 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 
+   - 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:
@@ -79,10 +79,10 @@
       + sip_example_dup_xtra(), sip_example_dup_one()
 
   * If you added a .c file, add to the Makefile.am
-    - remember to run autogen.sh unless you have given --enable-maintainer-mode 
+    - remember to run autogen.sh unless you have given --enable-maintainer-mode
       to configure script
 
-  * Run "make check" after you are ready 
+  * Run "make check" after you are ready
 
   * Run "make check" after you are ready. Really.
 
@@ -95,10 +95,10 @@
     - There is an example package sofia-sip-2543.tar.gz, available from
       sofia-sip.sourceforge.net
 
-      See the extension package for 1) 
+      See the extension package for 1)
 
-    - Create a header template for your header just like 
-      sofia-sip/rfc2543.h.in (found in <sofia-sip/rfc2543.h> package), 
+    - Create a header template for your header just like
+      sofia-sip/rfc2543.h.in (found in <sofia-sip/rfc2543.h> package),
       e.g, sip_example.h.in:
 
 ---8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<---
@@ -107,11 +107,11 @@
  * Template for <sip_example.h>.
  */
 
-#ifndef SIP_EXAMPLE_H 
+#ifndef SIP_EXAMPLE_H
 /** Defined when <sip_example.h> has been included. */
-#define SIP_EXAMPLE_H 
+#define SIP_EXAMPLE_H
 
-/**@file sip_example.h 
+/**@file sip_example.h
 *
  * @brief Example header.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 2006-01-25  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-	* Doxyfile (INPUT): Missing sip_dll.c broke refdoc 
-	build. Now changed so that individual are not listed 
+	* Doxyfile (INPUT): Missing sip_dll.c broke refdoc
+	build. Now changed so that individual are not listed
 	anymore in INPUT.
 
 2006-01-10  Kai Vehmanen  <kai.vehmanen at nokia.com>
@@ -52,7 +52,7 @@
 
 	* sip_basic.c: Not encoding comment in Contact. Always using
 	name-addr form for Route headers.
- 
+
 2005-07-18  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* Initial import of the module to Sofia-SIP tree.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/Doxyfile.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/Doxyfile.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/Doxyfile.in	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 PROJECT_NAME         = "sip"
 OUTPUT_DIRECTORY     = ../docs/html/sip
 
-INPUT 		     = @srcdir@/sofia-sip sofia-sip @srcdir@/sip.docs @srcdir@/sip_parser.docs @srcdir@ . 
+INPUT 		     = @srcdir@/sofia-sip sofia-sip @srcdir@/sip.docs @srcdir@/sip_parser.docs @srcdir@ .
 
 @INCLUDE_PATH = . @srcdir@
 @INCLUDE = ../docs/Doxyfile.conf

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/GRAMMAR
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/GRAMMAR	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/GRAMMAR	Tue Dec 23 07:37:03 2008
@@ -1,19 +1,19 @@
 /* SIP grammar from RFC3261
- * 
+ *
  *    alphanum  =  ALPHA / DIGIT
- * 
+ *
  *    reserved    =  ";" / "/" / "?" / ":" / "@" / "&" / "=" / "+"
  *                   / "$" / ","
  *    unreserved  =  alphanum / mark
  *    mark        =  "-" / "_" / "." / "!" / "~" / "*" / "'"
  *                   / "(" / ")"
  *    escaped     =  "%" HEXDIG HEXDIG
- * 
+ *
  *    LWS  =  [*WSP CRLF] 1*WSP ; linear whitespace
  *    SWS  =  [LWS] ; sep whitespace
- * 
+ *
  *    HCOLON  =  *( SP / HTAB ) ":" SWS
- * 
+ *
  *    TEXT-UTF8-TRIM  =  1*TEXT-UTF8char *(*LWS TEXT-UTF8char)
  *    TEXT-UTF8char   =  %x21-7E / UTF8-NONASCII
  *    UTF8-NONASCII   =  %xC0-DF 1UTF8-CONT
@@ -22,9 +22,9 @@
  *                    /  %xF8-Fb 4UTF8-CONT
  *                    /  %xFC-FD 5UTF8-CONT
  *    UTF8-CONT       =  %x80-BF
- * 
+ *
  *    LHEX  =  DIGIT / %x61-66 ;lowercase a-f
- * 
+ *
  *    token       =  1*(alphanum / "-" / "." / "!" / "%" / "*"
  *                   / "_" / "+" / "`" / "'" / "~" )
  *    separators  =  "(" / ")" / "<" / ">" / "@" /
@@ -37,7 +37,7 @@
  *                   ":" / "\" / DQUOTE /
  *                   "/" / "[" / "]" / "?" /
  *                   "{" / "}" )
- * 
+ *
  *    STAR    =  SWS "*" SWS ; asterisk
  *    SLASH   =  SWS "/" SWS ; slash
  *    EQUAL   =  SWS "=" SWS ; equal
@@ -50,18 +50,18 @@
  *    COLON   =  SWS ":" SWS ; colon
  *    LDQUOT  =  SWS DQUOTE; open double quotation mark
  *    RDQUOT  =  DQUOTE SWS ; close double quotation mark
- * 
+ *
  *    comment  =  LPAREN *(ctext / quoted-pair / comment) RPAREN
  *    ctext    =  %x21-27 / %x2A-5B / %x5D-7E / UTF8-NONASCII
  *                / LWS
- * 
+ *
  *    quoted-string  =  SWS DQUOTE *(qdtext / quoted-pair ) DQUOTE
  *    qdtext         =  LWS / %x21 / %x23-5B / %x5D-7E
  *                      / UTF8-NONASCII
- * 
+ *
  *    quoted-pair  =  "\" (%x00-09 / %x0B-0C
  *                    / %x0E-7F)
- * 
+ *
  *    SIP-URI          =  "sip:" [ userinfo ] hostport
  *                        uri-parameters [ headers ]
  *    SIPS-URI         =  "sips:" [ userinfo ] hostport
@@ -84,7 +84,7 @@
  *    hexseq         =  hex4 *( ":" hex4)
  *    hex4           =  1*4HEXDIG
  *    port           =  1*DIGIT
- * 
+ *
  *    uri-parameters    =  *( ";" uri-parameter)
  *    uri-parameter     =  transport-param / user-param / method-param
  *                         / ttl-param / maddr-param / lr-param / other-param
@@ -103,13 +103,13 @@
  *    pvalue            =  1*paramchar
  *    paramchar         =  param-unreserved / unreserved / escaped
  *    param-unreserved  =  "[" / "]" / "/" / ":" / "&" / "+" / "$"
- * 
+ *
  *    headers         =  "?" header *( "&" header )
  *    header          =  hname "=" hvalue
  *    hname           =  1*( hnv-unreserved / unreserved / escaped )
  *    hvalue          =  *( hnv-unreserved / unreserved / escaped )
  *    hnv-unreserved  =  "[" / "]" / "/" / "?" / ":" / "+" / "$"
- * 
+ *
  *    SIP-message    =  Request / Response
  *    Request        =  Request-Line
  *                      *( message-header )
@@ -137,7 +137,7 @@
  *                      / ";" / ":" / "@" / "&" / "=" / "+" )
  *    query          =  *uric
  *    SIP-Version    =  "SIP" "/" 1*DIGIT "." 1*DIGIT
- * 
+ *
  *    message-header  =  (Accept
  *                    /  Accept-Encoding
  *                    /  Accept-Language
@@ -183,7 +183,7 @@
  *                    /  Warning
  *                    /  WWW-Authenticate
  *                    /  extension-header) CRLF
- * 
+ *
  *    INVITEm           =  %x49.4E.56.49.54.45 ; INVITE in caps
  *    ACKm              =  %x41.43.4B ; ACK in caps
  *    OPTIONSm          =  %x4F.50.54.49.4F.4E.53 ; OPTIONS in caps
@@ -198,7 +198,7 @@
  *                         *( message-header )
  *                         CRLF
  *                         [ message-body ]
- * 
+ *
  *    Status-Line     =  SIP-Version SP Status-Code SP Reason-Phrase CRLF
  *    Status-Code     =  Informational
  *                   /   Redirection
@@ -210,21 +210,21 @@
  *    extension-code  =  3DIGIT
  *    Reason-Phrase   =  *(reserved / unreserved / escaped
  *                       / UTF8-NONASCII / UTF8-CONT / SP / HTAB)
- * 
+ *
  *    Informational  =  "100"  ;  Trying
  *                  /   "180"  ;  Ringing
  *                  /   "181"  ;  Call Is Being Forwarded
  *                  /   "182"  ;  Queued
  *                  /   "183"  ;  Session Progress
- * 
+ *
  *    Success  =  "200"  ;  OK
- * 
+ *
  *    Redirection  =  "300"  ;  Multiple Choices
  *                /   "301"  ;  Moved Permanently
  *                /   "302"  ;  Moved Temporarily
  *                /   "305"  ;  Use Proxy
  *                /   "380"  ;  Alternative Service
- * 
+ *
  *    Client-Error  =  "400"  ;  Bad Request
  *                 /   "401"  ;  Unauthorized
  *                 /   "402"  ;  Payment Required
@@ -253,7 +253,7 @@
  *                 /   "488"  ;  Not Acceptable Here
  *                 /   "491"  ;  Request Pending
  *                 /   "493"  ;  Undecipherable
- * 
+ *
  *    Server-Error  =  "500"  ;  Internal Server Error
  *                 /   "501"  ;  Not Implemented
  *                 /   "502"  ;  Bad Gateway
@@ -261,12 +261,12 @@
  *                 /   "504"  ;  Server Time-out
  *                 /   "505"  ;  SIP Version not supported
  *                 /   "513"  ;  Message Too Large
- * 
+ *
  *    Global-Failure  =  "600"  ;  Busy Everywhere
  *                   /   "603"  ;  Decline
  *                   /   "604"  ;  Does not exist anywhere
  *                   /   "606"  ;  Not Acceptable
- * 
+ *
  *    Accept         =  "Accept" HCOLON
  *                       [ accept-range *(COMMA accept-range) ]
  *    accept-range   =  media-range *(SEMI accept-param)
@@ -280,23 +280,23 @@
  *                      / ( "1" [ "." 0*3("0") ] )
  *    generic-param  =  token [ EQUAL gen-value ]
  *    gen-value      =  token / host / quoted-string
- * 
+ *
  *    Accept-Encoding  =  "Accept-Encoding" HCOLON
  *                         [ encoding *(COMMA encoding) ]
  *    encoding         =  codings *(SEMI accept-param)
  *    codings          =  content-coding / "*"
  *    content-coding   =  token
- * 
+ *
  *    Accept-Language  =  "Accept-Language" HCOLON
  *                         [ language *(COMMA language) ]
  *    language         =  language-range *(SEMI accept-param)
  *    language-range   =  ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) / "*" )
- * 
+ *
  *    Alert-Info   =  "Alert-Info" HCOLON alert-param *(COMMA alert-param)
  *    alert-param  =  LAQUOT absoluteURI RAQUOT *( SEMI generic-param )
- * 
+ *
  *    Allow  =  "Allow" HCOLON [Method *(COMMA Method)]
- * 
+ *
  *    Authorization     =  "Authorization" HCOLON credentials
  *    credentials       =  ("Digest" LWS digest-response)
  *                         / other-response
@@ -323,7 +323,7 @@
  *    other-response    =  auth-scheme LWS auth-param
  *                         *(COMMA auth-param)
  *    auth-scheme       =  token
- * 
+ *
  *    Authentication-Info  =  "Authentication-Info" HCOLON ainfo
  *                            *(COMMA ainfo)
  *    ainfo                =  nextnonce / message-qop
@@ -332,29 +332,29 @@
  *    nextnonce            =  "nextnonce" EQUAL nonce-value
  *    response-auth        =  "rspauth" EQUAL response-digest
  *    response-digest      =  LDQUOT *LHEX RDQUOT
- * 
+ *
  *    Call-ID  =  ( "Call-ID" / "i" ) HCOLON callid
  *    callid   =  word [ "@" word ]
- * 
+ *
  *    Call-Info   =  "Call-Info" HCOLON info *(COMMA info)
  *    info        =  LAQUOT absoluteURI RAQUOT *( SEMI info-param)
  *    info-param  =  ( "purpose" EQUAL ( "icon" / "info"
  *                   / "card" / token ) ) / generic-param
- * 
+ *
  *    Contact        =  ("Contact" / "m" ) HCOLON
  *                      ( STAR / (contact-param *(COMMA contact-param)))
  *    contact-param  =  (name-addr / addr-spec) *(SEMI contact-params)
  *    name-addr      =  [ display-name ] LAQUOT addr-spec RAQUOT
  *    addr-spec      =  SIP-URI / SIPS-URI / absoluteURI
  *    display-name   =  *(token LWS)/ quoted-string
- * 
+ *
  *    contact-params     =  c-p-q / c-p-expires
  *                          / contact-extension
  *    c-p-q              =  "q" EQUAL qvalue
  *    c-p-expires        =  "expires" EQUAL delta-seconds
  *    contact-extension  =  generic-param
  *    delta-seconds      =  1*DIGIT
- * 
+ *
  *    Content-Disposition   =  "Content-Disposition" HCOLON
  *                             disp-type *( SEMI disp-param )
  *    disp-type             =  "render" / "session" / "icon" / "alert"
@@ -365,16 +365,16 @@
  *                             / other-handling )
  *    other-handling        =  token
  *    disp-extension-token  =  token
- * 
+ *
  *    Content-Encoding  =  ( "Content-Encoding" / "e" ) HCOLON
  *                         content-coding *(COMMA content-coding)
- * 
+ *
  *    Content-Language  =  "Content-Language" HCOLON
  *                         language-tag *(COMMA language-tag)
  *    language-tag      =  primary-tag *( "-" subtag )
  *    primary-tag       =  1*8ALPHA
  *    subtag            =  1*8ALPHA
- * 
+ *
  *    Content-Length  =  ( "Content-Length" / "l" ) HCOLON 1*DIGIT
  *    Content-Type     =  ( "Content-Type" / "c" ) HCOLON media-type
  *    media-type       =  m-type SLASH m-subtype *(SEMI m-parameter)
@@ -390,9 +390,9 @@
  *    m-parameter      =  m-attribute EQUAL m-value
  *    m-attribute      =  token
  *    m-value          =  token / quoted-string
- * 
+ *
  *    CSeq  =  "CSeq" HCOLON 1*DIGIT LWS Method
- * 
+ *
  *    Date          =  "Date" HCOLON SIP-date
  *    SIP-date      =  rfc1123-date
  *    rfc1123-date  =  wkday "," SP date1 SP time SP "GMT"
@@ -405,32 +405,32 @@
  *    month         =  "Jan" / "Feb" / "Mar" / "Apr"
  *                     / "May" / "Jun" / "Jul" / "Aug"
  *                     / "Sep" / "Oct" / "Nov" / "Dec"
- * 
+ *
  *    Error-Info  =  "Error-Info" HCOLON error-uri *(COMMA error-uri)
  *    error-uri   =  LAQUOT absoluteURI RAQUOT *( SEMI generic-param )
- * 
+ *
  *    Expires     =  "Expires" HCOLON delta-seconds
  *    From        =  ( "From" / "f" ) HCOLON from-spec
  *    from-spec   =  ( name-addr / addr-spec )
  *                   *( SEMI from-param )
  *    from-param  =  tag-param / generic-param
  *    tag-param   =  "tag" EQUAL token
- * 
+ *
  *    In-Reply-To  =  "In-Reply-To" HCOLON callid *(COMMA callid)
- * 
+ *
  *    Max-Forwards  =  "Max-Forwards" HCOLON 1*DIGIT
- * 
+ *
  *    MIME-Version  =  "MIME-Version" HCOLON 1*DIGIT "." 1*DIGIT
- * 
+ *
  *    Min-Expires  =  "Min-Expires" HCOLON delta-seconds
- * 
+ *
  *    Organization  =  "Organization" HCOLON [TEXT-UTF8-TRIM]
- * 
+ *
  *    Priority        =  "Priority" HCOLON priority-value
  *    priority-value  =  "emergency" / "urgent" / "normal"
  *                       / "non-urgent" / other-priority
  *    other-priority  =  token
- * 
+ *
  *    Proxy-Authenticate  =  "Proxy-Authenticate" HCOLON challenge
  *    challenge           =  ("Digest" LWS digest-cln *(COMMA digest-cln))
  *                           / other-challenge
@@ -453,53 +453,53 @@
  *    qop-options         =  "qop" EQUAL LDQUOT qop-value
  *                           *("," qop-value) RDQUOT
  *    qop-value           =  "auth" / "auth-int" / token
- * 
+ *
  *    Proxy-Authorization  =  "Proxy-Authorization" HCOLON credentials
- * 
+ *
  *    Proxy-Require  =  "Proxy-Require" HCOLON option-tag
  *                      *(COMMA option-tag)
  *    option-tag     =  token
- * 
+ *
  *    Record-Route  =  "Record-Route" HCOLON rec-route *(COMMA rec-route)
  *    rec-route     =  name-addr *( SEMI rr-param )
  *    rr-param      =  generic-param
- * 
+ *
  *    Reply-To      =  "Reply-To" HCOLON rplyto-spec
  *    rplyto-spec   =  ( name-addr / addr-spec )
  *                     *( SEMI rplyto-param )
  *    rplyto-param  =  generic-param
  *    Require       =  "Require" HCOLON option-tag *(COMMA option-tag)
- * 
+ *
  *    Retry-After  =  "Retry-After" HCOLON delta-seconds
  *                    [ comment ] *( SEMI retry-param )
- * 
+ *
  *    retry-param  =  ("duration" EQUAL delta-seconds)
  *                    / generic-param
- * 
+ *
  *    Route        =  "Route" HCOLON route-param *(COMMA route-param)
  *    route-param  =  name-addr *( SEMI rr-param )
- * 
+ *
  *    Server           =  "Server" HCOLON server-val *(LWS server-val)
  *    server-val       =  product / comment
  *    product          =  token [SLASH product-version]
  *    product-version  =  token
- * 
+ *
  *    Subject  =  ( "Subject" / "s" ) HCOLON [TEXT-UTF8-TRIM]
- * 
+ *
  *    Supported  =  ( "Supported" / "k" ) HCOLON
  *                  [option-tag *(COMMA option-tag)]
- * 
+ *
  *    Timestamp  =  "Timestamp" HCOLON 1*(DIGIT)
  *                   [ "." *(DIGIT) ] [ LWS delay ]
  *    delay      =  *(DIGIT) [ "." *(DIGIT) ]
- * 
+ *
  *    To        =  ( "To" / "t" ) HCOLON ( name-addr
  *                 / addr-spec ) *( SEMI to-param )
  *    to-param  =  tag-param / generic-param
- * 
+ *
  *    Unsupported  =  "Unsupported" HCOLON option-tag *(COMMA option-tag)
  *    User-Agent  =  "User-Agent" HCOLON server-val *(LWS server-val)
- * 
+ *
  *    Via               =  ( "Via" / "v" ) HCOLON via-parm *(COMMA via-parm)
  *    via-parm          =  sent-protocol LWS sent-by *( SEMI via-params )
  *    via-params        =  via-ttl / via-maddr
@@ -518,7 +518,7 @@
  *                         / other-transport
  *    sent-by           =  host [ COLON port ]
  *    ttl               =  1*3DIGIT ; 0 to 255
- * 
+ *
  *    Warning        =  "Warning" HCOLON warning-value *(COMMA warning-value)
  *    warning-value  =  warn-code SP warn-agent SP warn-text
  *    warn-code      =  3DIGIT
@@ -527,9 +527,9 @@
  *                      ;  the Warning header, for use in debugging
  *    warn-text      =  quoted-string
  *    pseudonym      =  token
- * 
+ *
  *    WWW-Authenticate  =  "WWW-Authenticate" HCOLON challenge
- * 
+ *
  *    extension-header  =  header-name HCOLON header-value
  *    header-name       =  token
  *    header-value      =  *(TEXT-UTF8char / UTF8-CONT / LWS)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/run-tests
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/run-tests	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/run-tests	Tue Dec 23 07:37:03 2008
@@ -36,8 +36,8 @@
 rc=0
 
 for n in "$@";
-do 
-    if "$msg_test" < "$n" > /dev/null ; then 
+do
+    if "$msg_test" < "$n" > /dev/null ; then
 	true
     else
 	echo "$n: ERROR"; rc=1

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/run_test_sip_msg
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/run_test_sip_msg	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/run_test_sip_msg	Tue Dec 23 07:37:03 2008
@@ -41,20 +41,20 @@
 test=./test_sip_msg
 
 # These are messages that the parser should pass
-good="-t test1.txt test2.txt test3.txt test4.txt 
-      -u test5.txt -t test6.txt test7.txt -u test8.txt -t test9.txt 
-      test14.txt test20.txt test23.txt test24.txt test31.txt 
+good="-t test1.txt test2.txt test3.txt test4.txt
+      -u test5.txt -t test6.txt test7.txt -u test8.txt -t test9.txt
+      test14.txt test20.txt test23.txt test24.txt test31.txt
       own1.txt own2.txt own3.txt own4.txt own5.txt own6.txt"
 # These are messages that the parser should fail
-bad="test10.txt test11.txt test12.txt test13.txt test15.txt 
-     test16.txt test17.txt test18.txt test19.txt 
-     test21.txt test22.txt 
+bad="test10.txt test11.txt test12.txt test13.txt test15.txt
+     test16.txt test17.txt test18.txt test19.txt
+     test21.txt test22.txt
      test26.txt test29.txt test33.txt
-     test35.txt 
+     test35.txt
      test40.txt"
 # These are ugly messages that parser should pass
-ugly="-t test25.txt -u test27.txt test28.txt -t test30.txt 
-      -u test32.txt test34.txt -t test36.txt -u test37.txt 
+ugly="-t test25.txt -u test27.txt test28.txt -t test30.txt
+      -u test32.txt test34.txt -t test36.txt -u test37.txt
       test38.txt test39.txt test41.txt test42.txt"
 
 # These are messages that parser should pass, but it does not
@@ -64,12 +64,12 @@
 
 flag=-t
 for n in $good $ugly;
-do 
+do
     if test $n = -t ; then
 	flag=$n
     elif test $n = -u ; then
 	flag=
-    elif "$test" $flag < "$srcdir/tests/$n" > /dev/null ; then 
+    elif "$test" $flag < "$srcdir/tests/$n" > /dev/null ; then
 	echo "PASS: $n"
     else
 	echo "ERROR: $n"; rc=1
@@ -77,8 +77,8 @@
 done
 
 for n in $bad;
-do 
-    if "$test" -t < "$srcdir/tests/$n" > /dev/null 2>/dev/null ; then 
+do
+    if "$test" -t < "$srcdir/tests/$n" > /dev/null 2>/dev/null ; then
 	echo "ERROR: $n (no error detected)"; rc=1
     else
 	echo "PASS: $n"

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip.docs	Tue Dec 23 07:37:03 2008
@@ -44,7 +44,7 @@
  * that drives the parsing process and invokes the SIP parser for each
  * header. As there are no framing between SIP messages, the parser
  * considers any received data, be it a UDP datagram or a TCP stream, as a
- * @em message @em stream, which may consist of one or more SIP messages. 
+ * @em message @em stream, which may consist of one or more SIP messages.
  * The parser works by first separating stream into fragments, then building
  * a complete message based on parsing result. After a message is completed,
  * it can be given to the message stream customer (typically a protocol
@@ -57,7 +57,7 @@
  * one-by-one from the message. After the parser encounters an empty line
  * separating the headers and the message body (payload), it invokes a
  * function parsing the separator and payload fragment(s). When the message
- * is complete, the parser can hand the message over to the protocol engine. 
+ * is complete, the parser can hand the message over to the protocol engine.
  * Then it is ready to start again with first fragment of the next message.
  *
  * @image html sip-parser.gif Separating byte stream to messages
@@ -70,7 +70,7 @@
  * fragment chain, and a whole other stuff is held by the generic message
  * type, #msg_t, defined in <sofia-sip/msg.h>. The internal structure of #msg_t is
  * known only within @b msg module and it is hidden from other modules.
- * 
+ *
  * The abstract message module @b msg also drives the reverse process,
  * invoking the encoding method of each fragment so that the whole outgoing
  * SIP message is encoded properly.
@@ -96,7 +96,7 @@
  * For instance, the @From header has following syntax:
  *
  * @code
- * from           = ("From" | "f") ":" 
+ * from           = ("From" | "f") ":"
  *                  ( name-addr | addr-spec ) *( ";" addr-params )
  * name-addr      = [ display-name ] "<" addr-spec ">"
  * addr-spec      = SIP-URL | URI
@@ -134,7 +134,7 @@
  * access certain headers at the SIP message level, for example, accessing
  * directly the @From header instead of going through all headers and
  * examining their name. The structured view to the SIP message is provided
- * via a C struct with type #sip_t. 
+ * via a C struct with type #sip_t.
  *
  * In other words, a single message is represented by two types, first type
  * (#msg_t) is private to the msg module and inaccessable by an application
@@ -151,7 +151,7 @@
  *   int                 sip_flags;
  *
  *   sip_error_t        *sip_error;	   // Erroneous headers
- * 
+ *
  *   sip_request_t      *sip_request;      // Request line
  *   sip_status_t       *sip_status;       // Status line
  *
@@ -210,11 +210,11 @@
  * pointers to the headers according to their type. If there are multiple
  * headers of the same type (like there are two @Via headers in the above
  * message), the headers are put into a single-linked list.
- * 
+ *
  * Each fragment has pointers to successing and preceding fragment. It also
  * contains pointer to the corresponding data within the I/O buffer and its
  * length.
- * 
+ *
  * The main purpose of the fragment chain is to preserve the original order
  * of the headers.  If there were an third @Via header after @CSeq in the
  * message, the fragment representing it would be after the @CSeq header in
@@ -238,7 +238,7 @@
 
 /**@ingroup sip_headers
  * @defgroup sip_header_x SIP Header X - Conventions
- * 
+ *
  * For a SIP header X, there are types, functions, macros and global data
  * declared in <sofia-sip/sip_protos.h> and <sofia-sip/sip_hclass.h> as
  * follows:
@@ -247,13 +247,13 @@
  *  - sip_X_init() initializes a dynamic instance of #sip_X_t,
  *  - sip_is_X() tests if header object is instance of header X,
  *  - sip_X_make() creates a header X object by decoding given string,
- *  - sip_X_format() creates a header X object by decoding given 
+ *  - sip_X_format() creates a header X object by decoding given
  *    printf() list,
- *  - sip_X_dup() duplicates (deeply copies) the header X, 
+ *  - sip_X_dup() duplicates (deeply copies) the header X,
  *  - sip_X_copy() copies the header X,
- *  - #msg_hclass_t #sip_X_class[] contains the @em header @em class 
+ *  - #msg_hclass_t #sip_X_class[] contains the @em header @em class
  *    for header X.
- * 
+ *
  * All header structures contain the common part, a #sip_common_t structure
  * (@a X_common[]), a link to the next header in list (@a X_next), and
  * various fields describing the header value (in this case, @a X_value).
@@ -264,7 +264,7 @@
  *   struct msg_common_s {
  *     msg_header_t       *h_succ;   // Pointer to succeeding fragment
  *     msg_header_t      **h_prev;   // Pointer to preceeding fragment
- *     msg_hclass_t       *h_class;  // Header class 
+ *     msg_hclass_t       *h_class;  // Header class
  *     void const         *h_data;   // Encoded data
  *     usize_t             h_len;    // Encoding length (including CRLF)
  *   } X_common[1];
@@ -295,7 +295,7 @@
  * parameters. The content of parameters is not parsed, they are just
  * separated from each other and then stored in an dynamically allocated
  * array of string pointers. Pointer to the array is stored to @a X_params.
- * 
+ *
  * For more complex header structures, see #sip_contact_t or #sip_rack_t.
  *
  * @{
@@ -318,18 +318,18 @@
 
 /**@var msg_hclass_t sip_X_class[];
  * @brief Header class for SIP X.
- * 
+ *
  * The header class sip_X_class defines how a SIP
  * X is parsed and printed.  It also
  * contains methods used by SIP parser and other functions
  * to manipulate the sip_X_t header structure.
- * 
+ *
  */
 SIP_DLL extern msg_hclass_t sip_X_class[];
 
-enum { 
+enum {
  /** Hash of X. @internal */
- sip_X_hash = hash 
+ sip_X_hash = hash
 };
 
 /** Parse a X. @internal */
@@ -339,28 +339,28 @@
 msg_print_f sip_X_e;
 
 /**Initializer for structure sip_X_t.
- * 
+ *
  * A static sip_X_t structure must be initialized
  * with the SIP_X_INIT() macro. For instance,
- * @code 
- * 
+ * @code
+ *
  *  sip_X_t sip_X = SIP_X_INIT;
- * 
+ *
  * @endcode
  * @HI
  */
 #define SIP_X_INIT() SIP_HDR_INIT(X)
 
 /**Initialize a structure sip_X_t.
- * 
+ *
  * An sip_X_t structure can be initialized with the
  * sip_X_init() function/macro. For instance,
  * @code
- * 
+ *
  *  sip_X_t sip_X;
- * 
+ *
  *  sip_X_init(&sip_X);
- * 
+ *
  * @endcode
  * @HI
  */
@@ -375,13 +375,13 @@
 #endif
 
 /**Test if header object is instance of sip_X_t.
- * 
+ *
  * The function sip_is_X() returns true (nonzero) if
  * the header class is an instance of X
  * object and false (zero) otherwise.
- * 
+ *
  * @param header pointer to the header structure to be tested
- * 
+ *
  * @return
  * The function sip_is_X() returns true (nonzero) if
  * the header object is an instance of header X and
@@ -399,27 +399,27 @@
 #define sip_X_p(h) sip_is_X((h))
 
 /**Duplicate (deep copy) @c sip_X_t.
- * 
+ *
  * The function sip_X_dup() duplicates a header
  * structure @a hdr.  If the header structure @a hdr
  * contains a reference (@c hdr->x_next) to a list of
  * headers, all the headers in the list are duplicated, too.
- * 
+ *
  * @param home  memory home used to allocate new structure
  * @param hdr   header structure to be duplicated
- * 
+ *
  * When duplicating, all parameter lists and non-constant
  * strings attached to the header are copied, too.  The
  * function uses given memory @a home to allocate all the
  * memory areas used to copy the header.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   X = sip_X_dup(home, sip->sip_X);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function sip_X_dup() returns a pointer to the
  * newly duplicated sip_X_t header structure, or NULL
@@ -428,29 +428,29 @@
 sip_X_t *sip_X_dup(su_home_t *home, sip_X_t const *hdr);
 
 /**Copy a sip_X_t header structure.
- * 
+ *
  * The function sip_X_copy() copies a header structure @a
  * hdr.  If the header structure @a hdr contains a reference (@c
  * hdr->h_next) to a list of headers, all the headers in that
  * list are copied, too. The function uses given memory @a home
  * to allocate all the memory areas used to copy the header
  * structure @a hdr.
- * 
+ *
  * @param home    memory home used to allocate new structure
  * @param hdr     pointer to the header structure to be duplicated
- * 
+ *
  * When copying, only the header structure and parameter lists
  * attached to it are duplicated.  The new header structure
  * retains all the references to the strings within the old @a
  * header, including the encoding of the old header, if present.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   X = sip_X_copy(home, sip->sip_X);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * The function sip_X_copy() returns a pointer to
  * newly copied header structure, or NULL upon an error.
@@ -458,18 +458,18 @@
 sip_X_t *sip_X_copy(su_home_t *home, sip_X_t const *hdr);
 
 /**Make a header structure sip_X_t.
- * 
+ *
  * The function sip_X_make() makes a new
  * sip_X_t header structure.  It allocates a new
  * header structure, and decodes the string @a s as the
  * value of the structure.
- * 
+ *
  * @param home memory home used to allocate new header structure.
  * @param s    string to be decoded as value of the new header structure
- * 
+ *
  * @note This function is usually implemented as a macro calling
  * sip_header_make().
- * 
+ *
  * @return
  * The function sip_X_make() returns a pointer to
  * newly maked sip_X_t header structure, or NULL upon
@@ -485,25 +485,25 @@
 #endif
 
 /**Make a X from formatting result.
- * 
+ *
  * The function sip_X_format() makes a new
  * X object using formatting result as its
  * value.  The function first prints the arguments according to
  * the format @a fmt specified.  Then it allocates a new header
  * structure, and uses the formatting result as the header
  * value.
- * 
+ *
  * @param home   memory home used to allocate new header structure.
  * @param fmt    string used as a printf()-style format
  * @param ...    argument list for format
- * 
+ *
  * @note This function is usually implemented as a macro calling
  * msg_header_format().
- * 
+ *
  * @return
  * The function sip_X_format() returns a pointer to newly
  * makes header structure, or NULL upon an error.
- * 
+ *
  * @HIDE
  */
 #if SU_HAVE_INLINE
@@ -517,11 +517,11 @@
 {
   sip_header_t *h;
   va_list ap;
-  
+
   va_start(ap, fmt);
   h = sip_header_vformat(home, sip_X_class, fmt, ap);
   va_end(ap);
- 
+
   return h->sh_X;
 }
 #endif
@@ -534,7 +534,7 @@
  * leading and trailing whitespace has been removed from the string @a s.
  *
  * @param home   memory home used to allocate new header structure.
- * @param h      sip_X_t header structure 
+ * @param h      sip_X_t header structure
  * @param s      string to be decoded
  * @param bsiz   length of string @a s
  *
@@ -555,15 +555,15 @@
  * @param bsiz   size of the encoding buffer
  * @param h      header to be encoded.
  * @param flags  flags controlling the encoding
- * 
- * @note 
+ *
+ * @note
  * The encoding buffer size @b must be @b bigger than, not equal to,
  * the actual encoding result.
  *
  * @return
  * The function sip_X_e() returns the number of characters required for the
  * encoding.
- * 
+ *
  */
 int sip_X_e(char buf[], int bsiz, sip_header_t const *h, int flags);
 
@@ -577,7 +577,7 @@
 
 /**@defgroup sip_tag SIP Tags
  *
- * SIP headers in tag item lists and tagged argument lists. 
+ * SIP headers in tag item lists and tagged argument lists.
  *
  * The include file <sofia-sip/sip_tag.h> defines tags and tag items for including SIP
  * headers in tag item lists or tagged argument lists. For each header,
@@ -592,7 +592,7 @@
  * @code
  * sip_payload_t *payload;
  * ...
- * sip_add_tl(msg, sip, 
+ * sip_add_tl(msg, sip,
  *            SIPTAG_CONTENT_TYPE_STR("text/plain"),
  *            SIPTAG_USER_AGENT(agent->user_agent),
  *            SIPTAG_PAYLOAD(payload),

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip.doxyaliases
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip.doxyaliases	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip.doxyaliases	Tue Dec 23 07:37:03 2008
@@ -69,6 +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\"" \  
+ "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/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_bad_mask
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_bad_mask	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_bad_mask	Tue Dec 23 07:37:03 2008
@@ -15,7 +15,7 @@
 #
 
 #
-# When updating this file, please update 
+# When updating this file, please update
 # NTATAG_BAD_RESP_MASK()/NTATAG_BAD_REQ_MASK() documentation, too.
 #
 
@@ -55,7 +55,7 @@
 
 #
 # Headers that must be valid in UA, proxy or registrar
-# 
+#
 Contact = sip_mask_ua | sip_mask_proxy | sip_mask_registrar
 Require = sip_mask_ua | sip_mask_registrar | sip_mask_timer
 Record-Route = sip_mask_ua | sip_mask_proxy

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c	Tue Dec 23 07:37:03 2008
@@ -64,7 +64,7 @@
  *
  * The request line is first line in a SIP request message.  Its syntax defined
  * in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Request-Line   =  Method SP Request-URI SP SIP-Version CRLF
  *    Request-URI    =  SIP-URI / SIPS-URI / absoluteURI
@@ -117,7 +117,7 @@
 static msg_dup_f sip_request_dup_one;
 #define sip_request_update NULL
 
-msg_hclass_t sip_request_class[] = 
+msg_hclass_t sip_request_class[] =
 SIP_HEADER_CLASS(request, NULL, "", rq_common, single_critical, request);
 
 /**Parse @ref sip_request "request line" from a a SIP message. */
@@ -181,7 +181,7 @@
 
 /**@ingroup sip_request
  *
- * Create a @ref sip_request "request line" object. 
+ * Create a @ref sip_request "request line" object.
  *
  * Create a request line object with
  * method enum @a method, method name @a name, request URI @a uri, and
@@ -201,7 +201,7 @@
  *   rq = sip_request_create(home, SIP_METHOD_OPTIONS, requestURI, NULL);
  * @endcode
 
- * @note 
+ * @note
  * If you provide an non-NULL @a version string, it is not copied. The
  * version string @b MUST remain constant.
  */
@@ -210,7 +210,7 @@
 				  url_string_t const *uri,
 				  char const *version)
 {
-  size_t xtra; 
+  size_t xtra;
   sip_request_t *rq;
 
   if (method)
@@ -231,7 +231,7 @@
 
     rq->rq_method      = method;
     rq->rq_method_name = name;
-    if (!method) 
+    if (!method)
       MSG_STRING_DUP(b, rq->rq_method_name, name);
 
     URL_DUP(b, end, rq->rq_url, uri->us_url);
@@ -249,7 +249,7 @@
  *
  * The status line is first line in a response message.  It is defined in
  * @RFC3261 as follows:
- * 
+ *
  * @code
  *    Status-Line     =  SIP-Version SP Status-Code SP Reason-Phrase CRLF
  *    Status-Code     =  Informational
@@ -270,7 +270,7 @@
 /**@ingroup sip_status
  * @typedef typedef struct sip_status_s sip_status_t;
  *
- * The structure #sip_status_t contains representation of SIP 
+ * The structure #sip_status_t contains representation of SIP
  * @ref sip_status "status line".
  *
  * The #sip_status_t is defined as follows:
@@ -292,7 +292,7 @@
 #define sip_status_insert msg_status_insert
 #define sip_status_update NULL
 
-msg_hclass_t sip_status_class[] = 
+msg_hclass_t sip_status_class[] =
 SIP_HEADER_CLASS(status, NULL, "", st_common, single_critical, status);
 
 /** Parse status line */
@@ -366,7 +366,7 @@
  * @param phrase  status phrase (may be NULL)
  * @param version version string (defaults to "SIP/2.0" if NULL)
  *
- * @note 
+ * @note
  * If you provide an non-NULL @a version string, it is not copied. The
  * string @b MUST remain constant.
  *
@@ -426,29 +426,29 @@
 
 #define sip_payload_d 	     msg_payload_d
 #define sip_payload_e 	     msg_payload_e
-#define sip_payload_dup_xtra msg_payload_dup_xtra 
+#define sip_payload_dup_xtra msg_payload_dup_xtra
 #define sip_payload_dup_one  msg_payload_dup_one
 #define sip_payload_update   NULL
 
-msg_hclass_t sip_payload_class[] = 
+msg_hclass_t sip_payload_class[] =
 SIP_HEADER_CLASS(payload, NULL, "", pl_common, single, payload);
 
 /**@ingroup sip_payload
  *
- * Create a @ref sip_payload "SIP payload" structure. 
+ * Create a @ref sip_payload "SIP payload" structure.
  *
  * Create a new SIP payload structure. it
  * copies the given data to the the payload data, and NUL terminates it (it
  * allocates one extra byte for NUL).  If a NULL pointer is given as @a data,
  * sip_payload_create() allocates and zeroes a data buffer of @a len bytes.
  *
- * @param home memory home 
- * @param data payload data 
+ * @param home memory home
+ * @param data payload data
  * @param len  payload length
  *
  * @return A pointer to newly created
  * payload structure, if successful, and NULL upon an error.
- */ 
+ */
 sip_payload_t *sip_payload_create(su_home_t *home, void const *data, isize_t len)
 {
   msg_hclass_t *hc = sip_payload_class;
@@ -504,11 +504,11 @@
 #define sip_separator_e msg_separator_e
 #define sip_separator_insert msg_separator_insert
 
-msg_hclass_t sip_separator_class[] = 
+msg_hclass_t sip_separator_class[] =
 SIP_HEADER_CLASS(separator, NULL, "", sep_common, single, any);
 
 /**@ingroup sip_separator
- * 
+ *
  * Create a @ref sip_separator "SIP separator line" structure.
  */
 sip_separator_t *sip_separator_create(su_home_t *home)
@@ -529,7 +529,7 @@
  * The unknown headers are handled with #sip_unknown_t structure. The
  * unknown header name is stored in @a un_name field and the header field
  * following the colon is stored in @a un_value field.
- * 
+ *
  * @note It is possible to speed up parsing process by creating a parser
  * which does understand only a minimum number of headers. If such a parser
  * is used, some well-known headers are regarded as unknown and put into
@@ -544,19 +544,19 @@
  * The #sip_unknown_t is defined as follows:
  * @code
  * typedef struct msg_unknown_s {
- *   msg_common_t    un_common[1];  // Common fragment info 
- *   msg_unknown_t  *un_next;       // Link to next unknown header 
- *   char const     *un_name;       // Header name 
- *   char const     *un_value;      // Header field value 
+ *   msg_common_t    un_common[1];  // Common fragment info
+ *   msg_unknown_t  *un_next;       // Link to next unknown header
+ *   char const     *un_name;       // Header name
+ *   char const     *un_value;      // Header field value
  * } sip_unknown_t;
  * @endcode
  */
 
-#define sip_unknown_dup_xtra msg_unknown_dup_xtra 
+#define sip_unknown_dup_xtra msg_unknown_dup_xtra
 #define sip_unknown_dup_one  msg_unknown_dup_one
 #define sip_unknown_update NULL
 
-msg_hclass_t sip_unknown_class[] = 
+msg_hclass_t sip_unknown_class[] =
 SIP_HEADER_CLASS(unknown, "", "", un_common, append, unknown);
 
 issize_t sip_unknown_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -574,7 +574,7 @@
 /**@SIP_HEADER sip_error Erroneous Headers
  *
  * The erroneous headers are stored in #sip_error_t structure.
- * 
+ *
  * @note Other headers (like duplicate @ContentLength headers) may be put
  * into the list of erroneous headers (@c sip->sip_error). If the list of
  * erroneous headers is processed, the header type must be validated first
@@ -588,8 +588,8 @@
  * The #sip_error_t is defined as follows:
  * @code
  * typedef struct msg_error_s {
- *   msg_common_t    er_common[1];  // Common fragment info 
- *   msg_error_t    *er_next;       // Link to next header 
+ *   msg_common_t    er_common[1];  // Common fragment info
+ *   msg_error_t    *er_next;       // Link to next header
  *   char const     *er_name;       // Name of bad header (if any)
  * } sip_error_t;
  * @endcode
@@ -611,7 +611,7 @@
 
 /* ====================================================================== */
 /*
- * addr           = ("To" | "t" | "From" | "f") ":" 
+ * addr           = ("To" | "t" | "From" | "f") ":"
  *                  ( name-addr | addr-spec ) *( ";" addr-params )
  * name-addr      = [ display-name ] "<" addr-spec ">"
  * addr-spec      = SIP-URL | URI
@@ -631,7 +631,7 @@
  * @param inout_s        pointer to pointer to string to be parsed
  * @param return_display value-result parameter for @e display-name
  * @param return_url     value-result parameter for @e addr-spec
- * @param return_params  value-result paramater for @e parameters 
+ * @param return_params  value-result paramater for @e parameters
  * @param return_comment value-result parameter for @e comment
  *
  * @note After succesful call to the function @c sip_name_addr_d(), *ss
@@ -658,7 +658,7 @@
 
   if (*s == '\0')		/* Empty string */
     return -1;
-  
+
   if (return_display && *s == '"') {
     /* Quoted string */
     if (msg_quoted_d(&s, &display) == -1)
@@ -669,24 +669,24 @@
       return -1;
     s++[0] = '\0';		/* NUL terminate quoted string... */
     n = strcspn(s, ">");
-    addr_spec = s; s += n; 
+    addr_spec = s; s += n;
     if (*s) *s++ = '\0'; else return -1;
-  } 
+  }
   else {
-    if (return_display) 
+    if (return_display)
       n = span_token_lws(s);
     else
       n = 0;
 
     if (s[n] == '<') {
       /* OK, we got a display name */
-      display = s; s += n + 1; 
+      display = s; s += n + 1;
       /* NUL terminate display name */
       while (n > 0 && IS_LWS(display[n - 1]))
 	n--;
       if (n > 0)
 	display[n] = '\0';
-      else 
+      else
 	display = "";
 
       n = strcspn(s, ">");
@@ -696,7 +696,7 @@
       /* addr-spec only */
       addr_spec = s;
       /**@sa
-       * Discussion about comma, semicolon and question mark in 
+       * Discussion about comma, semicolon and question mark in
        * @RFC3261 section 20.10.
        */
       if (return_params)
@@ -714,8 +714,8 @@
 
   if (return_display)
     *return_display = display;
-  
-  /* Now, url may still not be NUL terminated, e.g., if 
+
+  /* Now, url may still not be NUL terminated, e.g., if
    * it is like "Contact: url:foo,sip:bar,sip:zunk"
    */
   c = *s; *s = '\0';		/* terminate temporarily */
@@ -753,7 +753,7 @@
  * @param params   pointer to parameter list (may be NULL)
  * @param comment  comment string encoded after others (may be NULL)
  *
- * @return 
+ * @return
  * Returns number of characters in encoding, excluding the
  * final NUL.
  *
@@ -761,9 +761,9 @@
  * The encoding result may be incomplete if the buffer size is not large
  * enough to store the whole encoding result.
  */
-issize_t sip_name_addr_e(char b[], isize_t bsiz, 
-			 int flags, 
-			 char const *display, 
+issize_t sip_name_addr_e(char b[], isize_t bsiz,
+			 int flags,
+			 char const *display,
 			 int brackets, url_t const url[],
 			 msg_param_t const params[],
 			 char const *comment)
@@ -772,8 +772,8 @@
   char const *u;
   char *b0 = b, *end = b + bsiz;
 
-  brackets = brackets || display || 
-    (url && (url->url_params || 
+  brackets = brackets || display ||
+    (url && (url->url_params ||
 	     url->url_headers ||
 	     ((u = url->url_user) && u[strcspn(u, ";,?")]) ||
 	     ((u = url->url_password) && u[strcspn(u, ",")])));
@@ -798,7 +798,7 @@
   }
 
   MSG_TERM_E(b, end);
-    
+
   return b - b0;
 }
 
@@ -867,12 +867,12 @@
 {
   sip_addr_t *a = (sip_addr_t *)h;
   char const *comment = NULL;
-  if (sip_name_addr_d(home, 
-		      &s, 
-		      &a->a_display, 
-		      a->a_url, 
+  if (sip_name_addr_d(home,
+		      &s,
+		      &a->a_display,
+		      a->a_url,
 		      &a->a_params,
-		      &comment) == -1 
+		      &comment) == -1
       || *s /* XXX - something extra? */)
     return -1;
 
@@ -887,7 +887,7 @@
 
   return sip_name_addr_e(b, bsiz,
 			 flags,
-			 a->a_display, 
+			 a->a_display,
 			 MSG_IS_CANONIC(flags), a->a_url,
 			 a->a_params,
 			 NULL);
@@ -909,7 +909,7 @@
 {
   sip_addr_t const *a = (sip_addr_t const *)h;
 
-  return sip_name_addr_xtra(a->a_display, 
+  return sip_name_addr_xtra(a->a_display,
 			    a->a_url,
 			    a->a_params,
 			    offset);
@@ -955,7 +955,7 @@
   sip_header_t *h;
 
   n = url_xtra(us->us_url);
-  h = sip_header_alloc(home, hc, n);    
+  h = sip_header_alloc(home, hc, n);
 
   if (h) {
     sip_addr_t *a = (sip_to_t *)h;
@@ -1009,7 +1009,7 @@
  * The @b Call-ID header uniquely identifies a particular invitation or all
  * registrations of a particular client. It is defined in @RFC3261 as
  * follows:
- * 
+ *
  * @code
  *    Call-ID  =  ( "Call-ID" / "i" ) HCOLON callid
  *    callid   =  word [ "@" word ]
@@ -1042,16 +1042,16 @@
 static msg_dup_f sip_call_id_dup_one;
 #define sip_call_id_update NULL
 
-msg_hclass_t sip_call_id_class[] = 
+msg_hclass_t sip_call_id_class[] =
 SIP_HEADER_CLASS(call_id, "Call-ID", "i", i_common, single, call_id);
 
 issize_t sip_call_id_d(su_home_t *home,
 		       sip_header_t *h,
-		       char *s, 
+		       char *s,
 		       isize_t slen)
 {
   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);
 
@@ -1106,7 +1106,7 @@
 
 /**@ingroup sip_call_id
  *
- * Create a @CallID header object. 
+ * Create a @CallID header object.
  *
  * Create a Call-ID header object with a new unique value. It uses
  * su_guid_generate() function to generate the value. If the local host name
@@ -1127,7 +1127,7 @@
   size_t xtra = su_guid_strlen + 1 + (domain ? strlen(domain) + 1 : 0);
 
   i = (sip_call_id_t *)sip_header_alloc(home, sip_call_id_class, xtra);
-  
+
   if (i) {
     char *b;
     su_guid_t guid[1];
@@ -1158,11 +1158,11 @@
 
 /* ====================================================================== */
 
-/**@SIP_HEADER sip_cseq CSeq Header 
+/**@SIP_HEADER sip_cseq CSeq Header
  *
  * The CSeq header (command sequence) uniquely identifies transactions
  * within a dialog.  It is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    CSeq              =  "CSeq" HCOLON 1*DIGIT LWS Method
  *    Method            =  INVITEm / ACKm / OPTIONSm / BYEm
@@ -1195,7 +1195,7 @@
 static msg_dup_f sip_cseq_dup_one;
 #define sip_cseq_update NULL
 
-msg_hclass_t sip_cseq_class[] = 
+msg_hclass_t sip_cseq_class[] =
 SIP_HEADER_CLASS(cseq, "CSeq", "", cs_common, single, cseq);
 
 issize_t sip_cseq_d(su_home_t *home,
@@ -1253,9 +1253,9 @@
   return b;
 }
 
-/**@ingroup sip_cseq 
+/**@ingroup sip_cseq
  *
- * Create a @CSeq header object. 
+ * Create a @CSeq header object.
  *
  * Create a @CSeq header object with the
  * sequence number @a seq, method enum @a method and method name @a
@@ -1295,7 +1295,7 @@
   xtra = (method ? 0 : (strlen(method_name) + 1));
 
   cs = (sip_cseq_t *)sip_header_alloc(home, sip_cseq_class, xtra);
-  
+
   if (cs) {
     cs->cs_seq = seq;
     cs->cs_method = method;
@@ -1312,7 +1312,7 @@
  *
  * The Contact header contain a list of URLs used to redirect future
  * requests.  Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Contact            =  ("Contact" / "m" ) HCOLON
  *                          ( STAR / (contact-param *(COMMA contact-param)))
@@ -1351,10 +1351,10 @@
  *   char const         *m_comment;     // Comment
  *
  *   char const         *m_q;           // Priority
- *   char const         *m_expires;     // Expiration time 
+ *   char const         *m_expires;     // Expiration time
  * } sip_contact_t;
  * @endcode
- * 
+ *
  * @note The <comment> field @ref sip_contact_s::m_comment "m_comment" is
  * deprecated: it is parsed but not included in encoding.
  */
@@ -1398,7 +1398,7 @@
   while (*s == ',')   /* Ignore empty entries (comma-whitespace) */
     *s = '\0', s += span_lws(s + 1) + 1;
 
-  if (sip_name_addr_d(home, &s, &m->m_display, m->m_url, 
+  if (sip_name_addr_d(home, &s, &m->m_display, m->m_url,
 		      &m->m_params, &m->m_comment) == -1)
     return -1;
 
@@ -1414,7 +1414,7 @@
   assert(sip_is_contact(h));
 
   return sip_name_addr_e(b, bsiz, flags,
-			 m->m_display, always_lt_gt, m->m_url, 
+			 m->m_display, always_lt_gt, m->m_url,
 			 m->m_params,
 			 NULL /* m->m_comment */);
 }
@@ -1446,7 +1446,7 @@
 }
 
 /** Update parameter in #sip_contact_t */
-static int sip_contact_update(msg_common_t *h, 
+static int sip_contact_update(msg_common_t *h,
 			      char const *name, isize_t namelen,
 			      char const *value)
 {
@@ -1460,7 +1460,7 @@
     /* XXX - check for invalid value? */
     m->m_q = value;
   }
-  else if (namelen == strlen("expires") && 
+  else if (namelen == strlen("expires") &&
 	   !strncasecmp(name, "expires", namelen)) {
     m->m_expires = value;
   }
@@ -1468,7 +1468,7 @@
   return 0;
 }
 
-/**@ingroup sip_contact 
+/**@ingroup sip_contact
  *
  * Add a parameter to a @Contact header object
  *
@@ -1524,8 +1524,8 @@
  * @endcode
  */
 
-msg_hclass_t sip_content_length_class[] = 
-SIP_HEADER_CLASS(content_length, "Content-Length", "l", l_common, 
+msg_hclass_t sip_content_length_class[] =
+SIP_HEADER_CLASS(content_length, "Content-Length", "l", l_common,
 		 single_critical, any);
 
 issize_t sip_content_length_d(su_home_t *home,
@@ -1547,9 +1547,9 @@
   return snprintf(b, bsiz, "%lu", (unsigned long)l->l_length);
 }
 
-/**@ingroup sip_content_length 
+/**@ingroup sip_content_length
  *
- * Create a @ContentLength header object. 
+ * Create a @ContentLength header object.
  *
  * Create a @ContentLength
  * header object with the value @a n.  The memory for the header is
@@ -1566,7 +1566,7 @@
 {
   sip_content_length_t *l = (sip_content_length_t *)
     sip_header_alloc(home, sip_content_length_class, 0);
-  
+
   if (l)
     l->l_length = n;
 
@@ -1580,7 +1580,7 @@
  * The Date header field reflects the time when the request or response was
  * first sent.  Its syntax is defined in @RFC3261 and @RFC2616 section 14.18 as
  * follows:
- * 
+ *
  * @code
  *    Date          =  "Date" HCOLON SIP-date
  *    SIP-date      =  rfc1123-date
@@ -1614,7 +1614,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_date_class[] = 
+msg_hclass_t sip_date_class[] =
 SIP_HEADER_CLASS(date, "Date", "", d_common, single, any);
 
 issize_t sip_date_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -1635,7 +1635,7 @@
 }
 
 /**@ingroup sip_date
- * @brief Create an @Date header object. 
+ * @brief Create an @Date header object.
  *
  * Create a @Date header object with
  * the date @a date.  If @date is 0, current time (as returned by sip_now())
@@ -1651,7 +1651,7 @@
 sip_date_t *sip_date_create(su_home_t *home, sip_time_t date)
 {
   sip_date_t *d = (sip_date_t *)sip_header_alloc(home, sip_date_class, 0);
-  
+
   if (d) {
     if (date == 0)
       date = sip_now();
@@ -1667,11 +1667,11 @@
  *
  * The Expires header field gives the date and time after which the message
  * content expires.  Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Expires     =  "Expires" HCOLON delta-seconds
  * @endcode
- * 
+ *
  * Note that the first SIP revision (@RFC2543) also allowed absolute time in
  * Expires.
  *
@@ -1695,15 +1695,15 @@
  * @endcode
  */
 
-msg_hclass_t sip_expires_class[] = 
+msg_hclass_t sip_expires_class[] =
 SIP_HEADER_CLASS(expires, "Expires", "", ex_common, single, any);
 
 issize_t sip_expires_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
 {
   sip_expires_t *expires = (sip_expires_t *)h;
 
-  if (msg_date_delta_d((char const **)&s, 
-		       &expires->ex_date, 
+  if (msg_date_delta_d((char const **)&s,
+		       &expires->ex_date,
 		       &expires->ex_delta) < 0 || *s)
     return -1;
   else
@@ -1721,7 +1721,7 @@
 }
 
 /**@ingroup sip_expires
- * @brief Create an @Expires header object. 
+ * @brief Create an @Expires header object.
  *
  * Create an @Expires header object with the expiration time @a delta.
  *
@@ -1749,7 +1749,7 @@
  *
  * The From header indicates the initiator of the request.  It is defined in
  * @RFC3261 as follows:
- * 
+ *
  * @code
  *    From        =  ( "From" / "f" ) HCOLON from-spec
  *    from-spec   =  ( name-addr / addr-spec )
@@ -1776,13 +1776,13 @@
  *   url_t              a_url[1];       // URL
  *   msg_param_t const *a_params;       // List of from-param
  *   char const        *a_comment;      // Comment
- *   char const        *a_tag;          // Tag parameter 
+ *   char const        *a_tag;          // Tag parameter
  * } sip_from_t;
  * @endcode
  *
  */
 
-msg_hclass_t sip_from_class[] = 
+msg_hclass_t sip_from_class[] =
 SIP_HEADER_CLASS(from, "From", "f", a_params, single, addr);
 
 issize_t sip_from_d(su_home_t *home,
@@ -1844,10 +1844,10 @@
  * be provided either as a single token ("deadbeer") or as in parameter form
  * ("tag=deadbeer"). In both cases the tag is duplicated using the memory
  * home @a home.
- * 
- * @param home memory home used to allocate new tag 
+ *
+ * @param home memory home used to allocate new tag
  * @param from @From header to modify
- * @param tag  tag token or parameter to be added 
+ * @param tag  tag token or parameter to be added
  *
  * @retval 0 when successful
  * @retval -1 upon an error.
@@ -1870,7 +1870,7 @@
  * The Max-Forwards header is used to limit the number of proxies or
  * gateways that can forward the request.  The Max-Forwards syntax is
  * defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Max-Forwards  =  "Max-Forwards" HCOLON 1*DIGIT
  * @endcode
@@ -1895,8 +1895,8 @@
  * @endcode
  */
 
-msg_hclass_t sip_max_forwards_class[] = 
-SIP_HEADER_CLASS(max_forwards, "Max-Forwards", "", mf_common, 
+msg_hclass_t sip_max_forwards_class[] =
+SIP_HEADER_CLASS(max_forwards, "Max-Forwards", "", mf_common,
 		 single, any);
 
 issize_t sip_max_forwards_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -1917,7 +1917,7 @@
  * The Min-Expires header is used to limit the number of proxies or
  * gateways that can forward the request.  The Min-Expires syntax is
  * defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Min-Expires  =  "Min-Expires" HCOLON delta-seconds
  * @endcode
@@ -1941,8 +1941,8 @@
  * @endcode
  */
 
-msg_hclass_t sip_min_expires_class[] = 
-SIP_HEADER_CLASS(min_expires, "Min-Expires", "", me_common, 
+msg_hclass_t sip_min_expires_class[] =
+SIP_HEADER_CLASS(min_expires, "Min-Expires", "", me_common,
 		 single, any);
 
 issize_t sip_min_expires_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -1960,12 +1960,12 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_retry_after Retry-After Header
- * 
+ *
  * The Retry-After response-header field @RFC3261 section 20.33 can be used to
  * indicate how long the service is expected to be unavailable or when the
  * called party anticipates being available again. Its syntax is defined in
  * @RFC3261 as follows:
- * 
+ *
  * @code
  *      Retry-After  =  "Retry-After" HCOLON delta-seconds
  *                      [ comment ] *( SEMI retry-param )
@@ -1977,9 +1977,9 @@
  */
 
 /**@ingroup sip_retry_after
- * @typedef struct sip_retry_after_s sip_retry_after_t; 
+ * @typedef struct sip_retry_after_s sip_retry_after_t;
  *
- * The structure #sip_retry_after_t contains representation of an 
+ * The structure #sip_retry_after_t contains representation of an
  * @RetryAfter header.
  *
  * The #sip_retry_after_t is defined as follows:
@@ -1999,7 +1999,7 @@
 static msg_dup_f sip_retry_after_dup_one;
 static msg_update_f sip_retry_after_update;
 
-msg_hclass_t sip_retry_after_class[] = 
+msg_hclass_t sip_retry_after_class[] =
 SIP_HEADER_CLASS(retry_after, "Retry-After", "", af_params, single,
 		 retry_after);
 
@@ -2031,7 +2031,7 @@
   b += snprintf(b, bsiz, "%lu", af->af_delta);
 
   if (af->af_comment) {
-    if (!compact) 
+    if (!compact)
       MSG_CHAR_E(b, end, ' ');
     MSG_CHAR_E(b, end, '(');
     MSG_STRING_E(b, end, af->af_comment);
@@ -2042,9 +2042,9 @@
 
   if (af->af_params)
     MSG_PARAMS_E(b, end, af->af_params, f);
-    
+
   MSG_TERM_E(b, end);
-    
+
   return b - b0;
 }
 
@@ -2098,7 +2098,7 @@
 
 /**Parse a @Route or a @RecordRoute header.
  *
- * @retval 0 when successful, 
+ * @retval 0 when successful,
  * @retval -1 upon an error.
  */
 issize_t sip_any_route_d(su_home_t *home,
@@ -2113,7 +2113,7 @@
   while (*s == ',')   /* Ignore empty entries (comma-whitespace) */
     *s = '\0', s += span_lws(s + 1) + 1;
 
-  if (sip_name_addr_d(home, &s, &r->r_display, 
+  if (sip_name_addr_d(home, &s, &r->r_display,
 		      r->r_url, &r->r_params, NULL) < 0)
     return -1;
 
@@ -2124,14 +2124,14 @@
 {
   sip_route_t const *r = (sip_route_t *)h;
 
-  return sip_name_addr_e(b, bsiz, flags, 
+  return sip_name_addr_e(b, bsiz, flags,
 			 r->r_display, 1, r->r_url, r->r_params, NULL);
 }
 
 isize_t sip_any_route_dup_xtra(sip_header_t const *h, isize_t offset)
 {
   sip_route_t const *r = (sip_route_t *)h;
-  return sip_name_addr_xtra(r->r_display, 
+  return sip_name_addr_xtra(r->r_display,
 			    r->r_url,
 			    r->r_params,
 			    offset);
@@ -2152,7 +2152,7 @@
 #define sip_any_route_update NULL
 
 
-/** Create a route. 
+/** Create a route.
  *
  * Create a route or record-route entry
  * from two URLs; first one provides the URL, second maddr parameter and
@@ -2170,8 +2170,8 @@
 {
   sip_header_t *h;
   sip_route_t *rr;
-  url_t url[1]; 
-  size_t xtra, n, n_url, n_params, n_addr; 
+  url_t url[1];
+  size_t xtra, n, n_url, n_params, n_addr;
   char *b, *param;
 
   *url = *rq_url;
@@ -2183,10 +2183,10 @@
 
   n_params = maddr && maddr->url_params ? strlen(maddr->url_params) : 0;
 
-  if (maddr && (!maddr->url_params || 
+  if (maddr && (!maddr->url_params ||
 		!url_param(maddr->url_params, "maddr", NULL, 0)))
     n_addr = (n_params != 0) + strlen("maddr=") + strlen(maddr->url_host);
-  else 
+  else
     n_addr = 0;
 
   xtra = n_url + n_params + n_addr + (n_params || n_addr);
@@ -2220,9 +2220,9 @@
 
 /**@SIP_HEADER sip_route Route Header
  *
- * The Route headers is used to store the route set of a transaction.  
+ * The Route headers is used to store the route set of a transaction.
  * The Route header is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Route        =  "Route" HCOLON route-param *(COMMA route-param)
  *    route-param  =  name-addr *( SEMI rr-param )
@@ -2248,7 +2248,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_route_class[] = 
+msg_hclass_t sip_route_class[] =
 SIP_HEADER_CLASS(route, "Route", "", r_params, append, any_route);
 
 issize_t sip_route_d(su_home_t *home,
@@ -2265,7 +2265,7 @@
   return sip_any_route_e(b, bsiz, h, flags);
 }
 
-/**@ingroup sip_route 
+/**@ingroup sip_route
  * @brief Create a @Route header object.
  *
  * Creates a route entry from two URLs; first one provides the URL, second
@@ -2279,11 +2279,11 @@
  * Returns a pointer to newly created @Route header object when successful,
  * or NULL upon an error.
  */
-sip_route_t *sip_route_create(su_home_t *home, 
-			      url_t const *url, 
+sip_route_t *sip_route_create(su_home_t *home,
+			      url_t const *url,
 			      url_t const *maddr)
 {
-  return sip_any_route_create(home, sip_route_class, url, maddr);  
+  return sip_any_route_create(home, sip_route_class, url, maddr);
 }
 
 /* ====================================================================== */
@@ -2292,8 +2292,8 @@
  *
  * The Record-Route headers are used to establish a route for transactions
  * belonging to a session.  The Record-Route header is defined in @RFC3261
- * as follows: 
- * 
+ * as follows:
+ *
  * @code
  *    Record-Route  =  "Record-Route" HCOLON rec-route *(COMMA rec-route)
  *    rec-route     =  name-addr *( SEMI rr-param )
@@ -2321,7 +2321,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_record_route_class[] = 
+msg_hclass_t sip_record_route_class[] =
 SIP_HEADER_CLASS(record_route, "Record-Route", "",
 		 r_params, prepend, any_route);
 
@@ -2339,9 +2339,9 @@
   return sip_any_route_e(b, bsiz, h, flags);
 }
 
-/** @ingroup sip_record_route 
+/** @ingroup sip_record_route
  *
- * Create a record-route. 
+ * Create a record-route.
  *
  * Create a record-route entry from two URLs; first one provides the URL,
  * second maddr parameter and port.
@@ -2367,7 +2367,7 @@
  *
  * The To header field specifies the "logical" recipient of the
  * request.  It is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    To        =  ( "To" / "t" ) HCOLON ( name-addr
  *                 / addr-spec ) *( SEMI to-param )
@@ -2391,13 +2391,13 @@
  *   url_t              a_url[1];       // URL
  *   msg_param_t const *a_params;       // List of to-params
  *   char const        *a_comment;      // Comment
- *   char const        *a_tag;          // Tag parameter 
+ *   char const        *a_tag;          // Tag parameter
  * } sip_to_t;
  * @endcode
  *
  */
 
-msg_hclass_t sip_to_class[] = 
+msg_hclass_t sip_to_class[] =
 SIP_HEADER_CLASS(to, "To", "t", a_params, single, addr);
 
 issize_t sip_to_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -2458,7 +2458,7 @@
  * headers can be used to prevent request looping and ensure replies take
  * the same path as the requests.  The Via syntax is defined in @RFC3261
  * as follows:
- * 
+ *
  * @code
  *    Via               =  ( "Via" / "v" ) HCOLON via-parm *(COMMA via-parm)
  *    via-parm          =  sent-protocol LWS sent-by *( SEMI via-params )
@@ -2514,7 +2514,7 @@
  *   char const         *v_port;        // Port number
  *   msg_param_t const  *v_params;      // List of via-params
  *   char const         *v_comment;     // Comment
- * 
+ *
  *   char const         *v_ttl;         // "ttl" parameter
  *   char const         *v_maddr;       // "maddr" parameter
  *   char const         *v_received;    // "received" parameter
@@ -2529,7 +2529,7 @@
 static msg_dup_f sip_via_dup_one;
 static msg_update_f sip_via_update;
 
-msg_hclass_t sip_via_class[] = 
+msg_hclass_t sip_via_class[] =
 SIP_HEADER_CLASS(via, "Via", "v", v_params, prepend, via);
 
 issize_t sip_via_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -2570,14 +2570,14 @@
   MSG_CHAR_E(b, end, ' ');
   MSG_STRING_E(b, end, v->v_host);
   if (v->v_port) {
-    MSG_CHAR_E(b, end, ':');	
+    MSG_CHAR_E(b, end, ':');
     MSG_STRING_E(b, end, v->v_port);
   }
   MSG_PARAMS_E(b, end, v->v_params, flags);
 #if 0
   /* Comment is deprecated in @RFC3265 - accept it, but do not send */
   if (v->v_comment) {
-    if (!MSG_IS_COMPACT(flags)) 
+    if (!MSG_IS_COMPACT(flags))
       MSG_CHAR_E(b, end, ' ');
     MSG_CHAR_E(b, end, '(');
     MSG_STRING_E(b, end, v->v_comment);
@@ -2585,7 +2585,7 @@
   }
 #endif
   MSG_TERM_E(b, end);
-    
+
   return b - b0;
 }
 
@@ -2602,7 +2602,7 @@
   return offset;
 }
 
-/** Duplicate one #sip_via_t object */ 
+/** Duplicate one #sip_via_t object */
 char *sip_via_dup_one(sip_header_t *dst, sip_header_t const *src,
 		      char *b, isize_t xtra)
 {
@@ -2621,7 +2621,7 @@
   return b;
 }
 
-static int sip_via_update(msg_common_t *h, 
+static int sip_via_update(msg_common_t *h,
 			  char const *name, isize_t namelen,
 			  char const *value)
 {
@@ -2685,7 +2685,7 @@
 
 /**@ingroup sip_via
  *
- * Create a @Via object. 
+ * Create a @Via object.
  *
  * Create a new @Via header object with
  * given parameters.  If @a transport is NULL, the default transport
@@ -2701,10 +2701,10 @@
  * @return
  * A pointer to newly created
  * @Via header object when successful or NULL upon an error.
- */ 
+ */
 sip_via_t *sip_via_create(su_home_t *home,
                           char const *host,
-                          char const *port, 
+                          char const *port,
                           char const *transport,
                           /* char const *params */
                           ...)
@@ -2728,8 +2728,8 @@
     char const *param;
     va_start(params, transport);
 
-    for (param = va_arg(params, char const *); 
-         param; 
+    for (param = va_arg(params, char const *);
+         param;
          param = va_arg(params, char const *)) {
       if ((param = su_strdup(home, param))) {
 	if (msg_header_replace_param(home, v->v_common, param) < 0)
@@ -2746,7 +2746,7 @@
 /**@ingroup sip_via
  *
  * Get port number corresponding to a @Via line.
- * 
+ *
  * If @a using_rport is non-null, try rport.
  * If *using_rport is non-zero, try rport even if <protocol> is not UDP.
  * If <protocol> is UDP, set *using_rport to zero.
@@ -2760,7 +2760,7 @@
     char const *port;
 
     if (v->v_rport && !v->v_maddr /* multicast */) {
-      if (v->v_protocol == sip_transport_udp || 
+      if (v->v_protocol == sip_transport_udp ||
 	  strcasecmp(v->v_protocol, sip_transport_udp) == 0)
 	port = v->v_rport, *using_rport = 0;
       else if (*using_rport)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_caller_prefs.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_caller_prefs.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_caller_prefs.c	Tue Dec 23 07:37:03 2008
@@ -70,14 +70,14 @@
  * @endcode
  *
  *
- * The parsed Request-Disposition header 
+ * The parsed Request-Disposition header
  * is stored in #sip_request_disposition_t structure.
  */
 
 /**@ingroup sip_request_disposition
  * @typedef typedef struct sip_request_disposition_s sip_request_disposition_t;
  *
- * The structure #sip_request_disposition_t contains representation of 
+ * The structure #sip_request_disposition_t contains representation of
  * @RequestDisposition header.
  *
  * The #sip_request_disposition_t is defined as follows:

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_event.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_event.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_event.c	Tue Dec 23 07:37:03 2008
@@ -56,7 +56,7 @@
  * The Event header is used to indicate the which event or class of events
  * the message contains or subscribes. Its syntax is defined in @RFC3265 as
  * follows:
- * 
+ *
  * @code
  *   Event             =  ( "Event" / "o" ) HCOLON event-type
  *                         *( SEMI event-param )
@@ -72,7 +72,7 @@
  */
 
 /**@ingroup sip_event
- * @typedef struct sip_event_s sip_event_t; 
+ * @typedef struct sip_event_s sip_event_t;
  *
  * The structure #sip_event_t contains representation of an @Event header.
  *
@@ -93,7 +93,7 @@
 static msg_dup_f sip_event_dup_one;
 static msg_update_f sip_event_update;
 
-msg_hclass_t sip_event_class[] = 
+msg_hclass_t sip_event_class[] =
 SIP_HEADER_CLASS(event, "Event", "o", o_params, single, event);
 
 issize_t sip_event_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -134,7 +134,7 @@
   return offset;
 }
 
-/** Duplicate one #sip_event_t object */ 
+/** Duplicate one #sip_event_t object */
 char *sip_event_dup_one(sip_header_t *dst, sip_header_t const *src,
 			char *b, isize_t xtra)
 {
@@ -150,7 +150,7 @@
 }
 
 /** Update parameters in @Event header. */
-static int sip_event_update(msg_common_t *h, 
+static int sip_event_update(msg_common_t *h,
 			   char const *name, isize_t namelen,
 			   char const *value)
 {
@@ -173,9 +173,9 @@
  * The Allow-Events header is used to indicate which events or classes of
  * events the notifier supports. Its syntax is defined in @RFC3265 as
  * follows:
- * 
+ *
  * @code
- *    Allow-Events = ( "Allow-Events" / "u" ) HCOLON event-type 
+ *    Allow-Events = ( "Allow-Events" / "u" ) HCOLON event-type
  *                                           *(COMMA event-type)
  * @endcode
  *
@@ -190,9 +190,9 @@
  */
 
 /**@ingroup sip_allow_events
- * @typedef struct msg_list_s sip_allow_events_t; 
+ * @typedef struct msg_list_s sip_allow_events_t;
  *
- * The structure #sip_allow_events_t contains representation of an 
+ * The structure #sip_allow_events_t contains representation of an
  * @AllowEvents header.
  *
  * The #sip_allow_events_t is defined as follows:
@@ -206,7 +206,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_allow_events_class[] = 
+msg_hclass_t sip_allow_events_class[] =
 SIP_HEADER_CLASS_LIST(allow_events, "Allow-Events", "u", list);
 
 issize_t sip_allow_events_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -220,14 +220,14 @@
   return msg_list_e(b, bsiz, h, f);
 }
 
-/** Append an event to a @AllowEvents header. 
+/** Append an event to a @AllowEvents header.
  *
  * @note This function @b does @b duplicate @p event.
  *
  * @deprecated Use msg_header_replace_item() directly.
  */
-int sip_allow_events_add(su_home_t *home, 
-			 sip_allow_events_t *ae, 
+int sip_allow_events_add(su_home_t *home,
+			 sip_allow_events_t *ae,
 			 char const *event)
 {
   event = su_strdup(home, event);
@@ -243,7 +243,7 @@
  * The Subscription-State header is used to indicate in which state a
  * subscription is. Its syntax is defined in @RFC3265 section 4.2.4 as
  * follows:
- * 
+ *
  * @code
  *    Subscription-State   = "Subscription-State" HCOLON substate-value
  *                           *( SEMI subexp-params )
@@ -271,7 +271,7 @@
 /**@ingroup sip_subscription_state
  * @typedef struct sip_subscription_state_s sip_subscription_state_t;
  *
- * The structure #sip_subscription_state_t contains representation of an 
+ * The structure #sip_subscription_state_t contains representation of an
  * @SubscriptionState header.
  *
  * The #sip_subscription_state_t is defined as follows:
@@ -281,9 +281,9 @@
  *   sip_common_t       ss_common[1];
  *   sip_unknown_t     *ss_next;
  *   // Subscription state: "pending", "active" or "terminated"
- *   char const        *ss_substate;        
+ *   char const        *ss_substate;
  *   msg_param_t const *ss_params;      // List of parameters
- *   char const        *ss_reason;      // Reason of terminating 
+ *   char const        *ss_reason;      // Reason of terminating
  *   char const        *ss_expires;     // Subscription lifetime in seconds
  *   char const        *ss_retry_after; // Value of retry-after parameter
  * } sip_subscription_state_t;
@@ -294,24 +294,24 @@
 static msg_dup_f sip_subscription_state_dup_one;
 static msg_update_f sip_subscription_state_update;
 
-msg_hclass_t sip_subscription_state_class[] = 
-SIP_HEADER_CLASS(subscription_state, "Subscription-State", "", 
-		 ss_params, single, 
+msg_hclass_t sip_subscription_state_class[] =
+SIP_HEADER_CLASS(subscription_state, "Subscription-State", "",
+		 ss_params, single,
 		 subscription_state);
 
-issize_t sip_subscription_state_d(su_home_t *home, sip_header_t *h, 
+issize_t sip_subscription_state_d(su_home_t *home, sip_header_t *h,
 				  char *s, isize_t slen)
 {
    sip_subscription_state_t *ss = h->sh_subscription_state;
    ss->ss_substate = s;
-   
+
    s += span_token(s); /* forwards the pointer to the end of substate-value */
    if (s == ss->ss_substate)
      return -1;
-   if (IS_LWS(*s)) { 
+   if (IS_LWS(*s)) {
      *s = '\0'; s += span_lws(s + 1) + 1;
    }
-   
+
    /* check if parameters are present and if so parse them */
    if (*s  == ';') {
      if ( msg_params_d(home, &s, &ss->ss_params) < 0)
@@ -327,34 +327,34 @@
 {
   char *end = b + bsiz, *b0 = b;
   sip_subscription_state_t const *ss = h->sh_subscription_state;
-   
+
   assert(sip_is_subscription_state(h));
-   
+
   MSG_STRING_E(b, end, ss->ss_substate);
-  MSG_PARAMS_E(b, end, ss->ss_params, flags);   
+  MSG_PARAMS_E(b, end, ss->ss_params, flags);
 
-  return b - b0;   
+  return b - b0;
 }
 
 isize_t sip_subscription_state_dup_xtra(sip_header_t const *h, isize_t offset)
 {
    sip_subscription_state_t const *ss = h->sh_subscription_state;
-   
+
    /* Calculates memory size occupied */
    MSG_PARAMS_SIZE(offset, ss->ss_params);
    offset += MSG_STRING_SIZE(ss->ss_substate);
-   
-   return offset;   
+
+   return offset;
 }
 
-/** Duplicate one #sip_subscription_state_t object */ 
+/** Duplicate one #sip_subscription_state_t object */
 char *sip_subscription_state_dup_one(sip_header_t *dst, sip_header_t const *src,
 				     char *b, isize_t xtra)
 {
   sip_subscription_state_t *ss_dst = dst->sh_subscription_state;
   sip_subscription_state_t const *ss_src = src->sh_subscription_state;
   char *end = b + xtra;
-   
+
   b = msg_params_dup(&ss_dst->ss_params, ss_src->ss_params, b, xtra);
   MSG_STRING_DUP(b, ss_dst->ss_substate, ss_src->ss_substate);
   assert(b <= end); (void)end;
@@ -362,7 +362,7 @@
   return b;
 }
 
-static int sip_subscription_state_update(msg_common_t *h, 
+static int sip_subscription_state_update(msg_common_t *h,
 					 char const *name, isize_t namelen,
 					 char const *value)
 {
@@ -399,7 +399,7 @@
  * The Publication header is used to indicate the which publication or class
  * of publications the message contains. Its syntax is defined
  * in (draft-niemi-simple-publish-00.txt) as follows:
- * 
+ *
  * @code
  *   Publication          =  ( "Publication") HCOLON publish-package
  *                         *( SEMI publish-param )
@@ -418,7 +418,7 @@
 /**@ingroup sip_publication
  * @brief Structure for Publication header.
  */
-struct sip_publication_s 
+struct sip_publication_s
 {
   sip_common_t        pub_common;	    /**< Common fragment info */
   sip_error_t        *pub_next;	            /**< Link to next (dummy) */
@@ -431,8 +431,8 @@
 static msg_xtra_f sip_publication_dup_xtra;
 static msg_dup_f sip_publication_dup_one;
 
-msg_hclass_t sip_publication_class[] = 
-SIP_HEADER_CLASS(publication, "Publication", "", pub_params, single, 
+msg_hclass_t sip_publication_class[] =
+SIP_HEADER_CLASS(publication, "Publication", "", pub_params, single,
 		 publication);
 
 su_inline void sip_publication_update(sip_publication_t *pub);
@@ -475,7 +475,7 @@
   return offset;
 }
 
-/** Duplicate one #sip_publication_t object */ 
+/** Duplicate one #sip_publication_t object */
 char *sip_publication_dup_one(sip_header_t *dst, sip_header_t const *src,
 			char *b, isize_t xtra)
 {
@@ -512,9 +512,9 @@
  * The Allow-Publication header is used to indicate which publications or classes of
  * publications the server supports.  Its syntax is defined in [niemi]
  * (draft-niemi-simple-publish-00.txt) as follows:
- * 
+ *
  * @code
- *   Allow-Publications   = "Allow-Publications" HCOLON publish-type 
+ *   Allow-Publications   = "Allow-Publications" HCOLON publish-type
  *                          * ( COMMA publish-type )
  * @endcode
  *
@@ -523,7 +523,7 @@
  * is stored in #sip_allow_publications_t structure.
  */
 
-msg_hclass_t sip_allow_publications_class[] = 
+msg_hclass_t sip_allow_publications_class[] =
 SIP_HEADER_CLASS_LIST(allow_publications, "Allow-Publications", "", list);
 
 issize_t sip_allow_publications_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -538,8 +538,8 @@
 }
 
 /** Append an publication to a Allow-Publications header. */
-int sip_allow_publications_add(su_home_t *home, 
-			       sip_allow_publications_t *ae, 
+int sip_allow_publications_add(su_home_t *home,
+			       sip_allow_publications_t *ae,
 			       char const *e)
 {
   e = su_strdup(home, e);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra.c	Tue Dec 23 07:37:03 2008
@@ -24,13 +24,13 @@
 
 /**@CFILE sip_extra.c
  * @brief Non-critical SIP headers
- * 
+ *
  * This file contains implementation of @CallInfo, @ErrorInfo,
  * @Organization, @Priority, @RetryAfter, @Server, @Subject,
  * @Timestamp, and @UserAgent headers.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
- * 
+ *
  * @date Created: Tue Jun 13 02:57:51 2000 ppessi
  */
 
@@ -66,17 +66,17 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_call_info Call-Info Header
- * 
+ *
  * The Call-Info header provides additional information about the caller or
  * callee. Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Call-Info   =  "Call-Info" HCOLON info *(COMMA info)
  *    info        =  LAQUOT absoluteURI RAQUOT *( SEMI info-param)
  *    info-param  =  ( "purpose" EQUAL ( "icon" / "info"
  *                   / "card" / token ) ) / generic-param
  * @endcode
- * 
+ *
  *
  * The parsed Call-Info header is stored in #sip_call_info_t structure.
  */
@@ -84,7 +84,7 @@
 /**@ingroup sip_call_info
  * @typedef struct sip_call_info_s sip_call_info_t;
  *
- * The structure #sip_call_info_t contains representation of an 
+ * The structure #sip_call_info_t contains representation of an
  * @CallInfo header.
  *
  * The #sip_call_info_t is defined as follows:
@@ -130,10 +130,10 @@
 
 /** @internal
  * Update parameter in a @CallInfo object.
- * 
+ *
  */
 static
-int sip_call_info_update(msg_common_t *h, 
+int sip_call_info_update(msg_common_t *h,
 			  char const *name, isize_t namelen,
 			  char const *value)
 {
@@ -142,7 +142,7 @@
   if (name == NULL) {
     ci->ci_purpose = NULL;
   }
-  else if (namelen == strlen("purpose") && 
+  else if (namelen == strlen("purpose") &&
 	   !strncasecmp(name, "purpose", namelen)) {
     ci->ci_purpose = value;
   }
@@ -153,15 +153,15 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_error_info Error-Info Header
- * 
+ *
  * The Error-Info header provides a pointer to additional information about
  * the error status response. Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Error-Info  =  "Error-Info" HCOLON error-uri *(COMMA error-uri)
  *    error-uri   =  LAQUOT absoluteURI RAQUOT *( SEMI generic-param )
  * @endcode
- * 
+ *
  *
  * The parsed Error-Info header is stored in #sip_error_info_t structure.
  */
@@ -169,7 +169,7 @@
 /**@ingroup sip_error_info
  * @typedef struct sip_error_info_s sip_error_info_t;
  *
- * The structure #sip_error_info_t contains representation of an 
+ * The structure #sip_error_info_t contains representation of an
  * @ErrorInfo header.
  *
  * The #sip_error_info_t is defined as follows:
@@ -184,7 +184,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_error_info_class[] = 
+msg_hclass_t sip_error_info_class[] =
 SIP_HEADER_CLASS(error_info, "Error-Info", "",
 		 ei_params, append, info);
 
@@ -377,11 +377,11 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_in_reply_to In-Reply-To Header
- * 
- * The @b In-Reply-To request header field enumerates the 
+ *
+ * The @b In-Reply-To request header field enumerates the
  * @ref sip_call_id "Call-IDs" that this call references or returns.
  * Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    In-Reply-To  =  "In-Reply-To" HCOLON callid *(COMMA callid)
  * @endcode
@@ -392,8 +392,8 @@
 /**@ingroup sip_in_reply_to
  * @typedef struct msg_list_s sip_in_reply_to_t;
  *
- * The structure #sip_in_reply_to_t contains representation of SIP 
- * @InReplyTo header. 
+ * The structure #sip_in_reply_to_t contains representation of SIP
+ * @InReplyTo header.
  *
  * The #sip_in_reply_to_t is defined as follows:
  * @code
@@ -406,7 +406,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_in_reply_to_class[] = 
+msg_hclass_t sip_in_reply_to_class[] =
 SIP_HEADER_CLASS_LIST(in_reply_to, "In-Reply-To", "", list);
 
 issize_t sip_in_reply_to_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -423,23 +423,23 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_organization Organization Header
- * 
+ *
  * The Organization header field conveys the name of the organization to
  * which the entity issuing the request or response belongs. Its syntax is
  * defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Organization  =  "Organization" HCOLON [TEXT-UTF8-TRIM]
  * @endcode
- * 
+ *
  *
  * The parsed Organization header is stored in #sip_organization_t structure.
  */
 
 /**@ingroup sip_organization
- * @typedef struct msg_generic_s sip_organization_t; 
+ * @typedef struct msg_generic_s sip_organization_t;
  *
- * The structure #sip_organization_t contains representation of a SIP 
+ * The structure #sip_organization_t contains representation of a SIP
  * @Organization header.
  *
  * The #sip_organization_t is defined as follows:
@@ -453,7 +453,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_organization_class[] = 
+msg_hclass_t sip_organization_class[] =
 SIP_HEADER_CLASS_G(organization, "Organization", "", single);
 
 issize_t sip_organization_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -470,25 +470,25 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_priority Priority Header
- * 
+ *
  * The Priority request-header field indicates the urgency of the request as
  * perceived by the client. Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Priority        =  "Priority" HCOLON priority-value
  *    priority-value  =  "emergency" / "urgent" / "normal"
  *                       / "non-urgent" / other-priority
  *    other-priority  =  token
  * @endcode
- * 
+ *
  *
  * The parsed Priority header is stored in #sip_priority_t structure.
  */
 
 /**@ingroup sip_priority
- * @typedef struct msg_generic_s sip_priority_t; 
+ * @typedef struct msg_generic_s sip_priority_t;
  *
- * The structure #sip_priority_t contains representation of a SIP 
+ * The structure #sip_priority_t contains representation of a SIP
  * @Priority header.
  *
  * The #sip_priority_t is defined as follows:
@@ -502,13 +502,13 @@
  * @endcode
  */
 
-msg_hclass_t sip_priority_class[] = 
+msg_hclass_t sip_priority_class[] =
 SIP_HEADER_CLASS_G(priority, "Priority", "", single);
 
 issize_t sip_priority_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
 {
   sip_priority_t *priority = (sip_priority_t *)h;
-  
+
   if (msg_token_d(&s, &priority->g_string) < 0)
     return -1;
 
@@ -527,11 +527,11 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_server Server Header
- * 
+ *
  * The Server response-header field contains information about the software
  * used by the user agent server to handle the request. Its syntax is
  * defined in @RFC2616 section 14.38 and @RFC3261 as follows:
- * 
+ *
  * @code
  *    Server           =  "Server" HCOLON server-val *(LWS server-val)
  *    server-val       =  product / comment
@@ -543,9 +543,9 @@
  */
 
 /**@ingroup sip_server
- * @typedef struct msg_generic_s sip_server_t; 
+ * @typedef struct msg_generic_s sip_server_t;
  *
- * The structure #sip_server_t contains representation of a SIP 
+ * The structure #sip_server_t contains representation of a SIP
  * @Server header.
  *
  * The #sip_server_t is defined as follows:
@@ -559,7 +559,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_server_class[] = 
+msg_hclass_t sip_server_class[] =
 SIP_HEADER_CLASS_G(server, "Server", "", single);
 
 issize_t sip_server_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -576,21 +576,21 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_subject Subject Header
- * 
+ *
  * The Subject header provides a summary or indicates the nature of the
  * request. Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Subject  =  ( "Subject" / "s" ) HCOLON [TEXT-UTF8-TRIM]
  * @endcode
- * 
+ *
  * The parsed Subject header is stored in #sip_subject_t structure.
  */
 
 /**@ingroup sip_subject
- * @typedef struct msg_generic_s sip_subject_t; 
+ * @typedef struct msg_generic_s sip_subject_t;
  *
- * The structure #sip_subject_t contains representation of a SIP 
+ * The structure #sip_subject_t contains representation of a SIP
  * @Subject header.
  *
  * The #sip_subject_t is defined as follows:
@@ -604,7 +604,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_subject_class[] = 
+msg_hclass_t sip_subject_class[] =
 SIP_HEADER_CLASS_G(subject, "Subject", "s", single);
 
 issize_t sip_subject_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -621,24 +621,24 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_timestamp Timestamp Header
- * 
+ *
  * The @b Timestamp header describes when the client sent the request to the
  * server, and it is used by the client to adjust its retransmission
  * intervals. Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Timestamp  =  "Timestamp" HCOLON 1*(DIGIT)
  *                   [ "." *(DIGIT) ] [ LWS delay ]
  *    delay      =  *(DIGIT) [ "." *(DIGIT) ]
  * @endcode
- * 
+ *
  * The parsed Timestamp header is stored in #sip_timestamp_t structure.
  */
 
 /**@ingroup sip_timestamp
- * @typedef struct sip_timestamp_s sip_timestamp_t; 
+ * @typedef struct sip_timestamp_s sip_timestamp_t;
  *
- * The structure #sip_timestamp_t contains representation of a SIP 
+ * The structure #sip_timestamp_t contains representation of a SIP
  * @Timestamp header.
  *
  * The #sip_timestamp_t is defined as follows:
@@ -660,7 +660,7 @@
 				   isize_t xtra);
 #define sip_timestamp_update NULL
 
-msg_hclass_t sip_timestamp_class[] = 
+msg_hclass_t sip_timestamp_class[] =
 SIP_HEADER_CLASS(timestamp, "Timestamp", "", ts_common, single,
 		 timestamp);
 
@@ -669,7 +669,7 @@
   sip_timestamp_t *ts = (sip_timestamp_t*)h;
 
   ts->ts_stamp = s;
-  s += span_digit(s); 
+  s += span_digit(s);
   if (s == ts->ts_stamp)
     return -1;
   if (*s == '.') { s += span_digit(s + 1) + 1; }
@@ -685,7 +685,7 @@
     *s++ = '\0';
   else
     return -1;
-  
+
   return 0;
 }
 
@@ -703,7 +703,7 @@
   }
 
   MSG_TERM_E(b, end);
-    
+
   return b - b0;
 }
 
@@ -739,25 +739,25 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_user_agent User-Agent Header
- * 
+ *
  * The User-Agent header contains information about the client user agent
  * originating the request. Its syntax is defined in [H14.43, S10.45] as
  * follows:
- * 
+ *
  * @code
  *    User-Agent       =  "User-Agent" HCOLON server-val *(LWS server-val)
  *    server-val       =  product / comment
  *    product          =  token [SLASH product-version]
  *    product-version  =  token
  * @endcode
- * 
+ *
  * The parsed User-Agent header is stored in #sip_user_agent_t structure.
  */
 
 /**@ingroup sip_user_agent
- * @typedef struct msg_generic_s sip_user_agent_t; 
+ * @typedef struct msg_generic_s sip_user_agent_t;
  *
- * The structure #sip_user_agent_t contains representation of a SIP 
+ * The structure #sip_user_agent_t contains representation of a SIP
  * @UserAgent header.
  *
  * The #sip_user_agent_t is defined as follows:
@@ -771,7 +771,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_user_agent_class[] = 
+msg_hclass_t sip_user_agent_class[] =
 SIP_HEADER_CLASS_G(user_agent, "User-Agent", "", single);
 
 issize_t sip_user_agent_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -788,10 +788,10 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_etag SIP-ETag Header
- * 
+ *
  * The @b SIP-ETag header field identifies the published event state. Its
  * syntax is defined in @RFC3903 as follows:
- * 
+ *
  * @code
  *      SIP-ETag           = "SIP-ETag" HCOLON entity-tag
  *      entity-tag         = token
@@ -801,9 +801,9 @@
  */
 
 /**@ingroup sip_etag
- * @typedef struct msg_generic_s sip_etag_t; 
+ * @typedef struct msg_generic_s sip_etag_t;
  *
- * The structure #sip_etag_t contains representation of a SIP 
+ * The structure #sip_etag_t contains representation of a SIP
  * @SIPETag header.
  *
  * The #sip_etag_t is defined as follows:
@@ -817,7 +817,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_etag_class[] = 
+msg_hclass_t sip_etag_class[] =
 SIP_HEADER_CLASS_G(etag, "SIP-ETag", "", single);
 
 issize_t sip_etag_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -835,11 +835,11 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_if_match SIP-If-Match Header
- * 
+ *
  * The @b SIP-If-Match header field identifies the specific entity of event
  * state that the request is refreshing, modifying or removing. Its syntax
  * is defined in @RFC3903 as follows:
- * 
+ *
  * @code
  *      SIP-If-Match       = "SIP-If-Match" HCOLON entity-tag
  *      entity-tag         = token
@@ -849,9 +849,9 @@
  */
 
 /**@ingroup sip_if_match
- * @typedef struct msg_generic_s sip_if_match_t; 
+ * @typedef struct msg_generic_s sip_if_match_t;
  *
- * The structure #sip_if_match_t contains representation of a SIP 
+ * The structure #sip_if_match_t contains representation of a SIP
  * @SIPIfMatch header.
  *
  * The #sip_if_match_t is defined as follows:
@@ -865,7 +865,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_if_match_class[] = 
+msg_hclass_t sip_if_match_class[] =
 SIP_HEADER_CLASS_G(if_match, "SIP-If-Match", "", single);
 
 issize_t sip_if_match_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -943,11 +943,11 @@
  *
  * @sa @RFC3265, draft-niemi-sip-subnot-etags-01.txt
  *
- * @EXP_1_12_5. 
- * In order to use @b Suppress-Body-If-Match header, 
+ * @EXP_1_12_5.
+ * In order to use @b Suppress-Body-If-Match header,
  * initialize the SIP parser with, e.g.,
  * sip_update_default_mclass(sip_extend_mclass(NULL)).
- * 
+ *
  * @note
  * The #sip_t structure does not contain a @a
  * sip_suppress_body_if_match field, but sip_suppress_body_if_match()
@@ -1015,11 +1015,11 @@
  *
  * @sa @RFC3265, draft-niemi-sip-subnot-etag-01
  *
- * @EXP_1_12_5. 
- * In order to use @b Suppress-Notify-If-Match header, 
+ * @EXP_1_12_5.
+ * In order to use @b Suppress-Notify-If-Match header,
  * initialize the SIP parser with, e.g.,
  * sip_update_default_mclass(sip_extend_mclass(NULL)).
- * 
+ *
  * @note
  * The #sip_t struct does not contain @a sip_suppress_notify_if_match field,
  * but sip_suppress_notify_if_match() function should be used for accessing
@@ -1175,12 +1175,12 @@
 }
 
 /** Calculate size of extra data required for duplicating one
- *  sip_remote_party_id_t header. 
+ *  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, 
+  return sip_name_addr_xtra(rpid->rpid_display,
 			    rpid->rpid_url,
 			    rpid->rpid_params,
 			    offset);
@@ -1200,7 +1200,7 @@
 			   b, xtra);
 }
 
-static int sip_remote_party_id_update(msg_common_t *h, 
+static int sip_remote_party_id_update(msg_common_t *h,
 				      char const *name, isize_t namelen,
 				      char const *value)
 {
@@ -1248,7 +1248,7 @@
  *
  * @sa @RFC3325, @PPreferredIdentity
  *
- * @NEW_1_12_7. In order to use @b P-Asserted-Identity header, 
+ * @NEW_1_12_7. In order to use @b P-Asserted-Identity header,
  * initialize the SIP parser before calling nta_agent_create() or
  * nua_create() with, e.g.,
  * sip_update_default_mclass(sip_extend_mclass(NULL)).
@@ -1318,7 +1318,7 @@
 {
   sip_p_asserted_identity_t const *paid = (sip_p_asserted_identity_t *)h;
 
-  return sip_name_addr_xtra(paid->paid_display, 
+  return sip_name_addr_xtra(paid->paid_display,
 			    paid->paid_url,
 			    NULL,
 			    offset);
@@ -1402,4 +1402,4 @@
   return sip_p_asserted_identity_e(b, bsiz, h, f);
 }
 
-#endif 
+#endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra_headers.txt
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra_headers.txt	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra_headers.txt	Tue Dec 23 07:37:03 2008
@@ -4,7 +4,7 @@
 # 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: 
+# The line format is:
 # C-name @SINCE sip_t-like-comment
 #
 # Put all experimental things after EXPERIMENTAL HEADER LIST STARTS HERE...

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_feature.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_feature.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_feature.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@CFILE sip_feature.c 
+/**@CFILE sip_feature.c
  *
  * @brief Feature-related SIP header handling
  *
@@ -52,7 +52,7 @@
  * The Allow header lists the set of methods supported by the user agent
  * generating the message.  Its syntax is defined in @RFC3261 as
  * follows:
- * 
+ *
  * @code
  *    Allow  =  "Allow" HCOLON [Method *(COMMA Method)]
  * @endcode
@@ -67,7 +67,7 @@
  */
 
 /**@ingroup sip_allow
- * @typedef struct msg_list_s sip_allow_t; 
+ * @typedef struct msg_list_s sip_allow_t;
  *
  * The structure #sip_allow_t contains representation of an @Allow header.
  *
@@ -89,7 +89,7 @@
 #define sip_allow_dup_one  msg_list_dup_one
 static msg_update_f sip_allow_update;
 
-msg_hclass_t sip_allow_class[] = 
+msg_hclass_t sip_allow_class[] =
 SIP_HEADER_CLASS(allow, "Allow", "", k_items, list, allow);
 
 issize_t sip_allow_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -106,7 +106,7 @@
   return msg_list_e(b, bsiz, h, f);
 }
 
-static int sip_allow_update(msg_common_t *h, 
+static int sip_allow_update(msg_common_t *h,
 			  char const *name, isize_t namelen,
 			  char const *value)
 {
@@ -118,7 +118,7 @@
   else {
     sip_method_t method = sip_method_code(name);
 
-    if (method >= 0 && method < 32) 
+    if (method >= 0 && method < 32)
       k->k_bitmap |= 1 << method;
   }
 
@@ -152,7 +152,7 @@
  * The Proxy-Require header is used to indicate proxy-sensitive features
  * that @b MUST be supported by the proxy.  Its syntax is defined in @RFC3261
  * as follows:
- * 
+ *
  * @code
  *    Proxy-Require  =  "Proxy-Require" HCOLON option-tag *(COMMA option-tag)
  * @endcode
@@ -162,9 +162,9 @@
  */
 
 /**@ingroup sip_proxy_require
- * @typedef struct msg_list_s sip_proxy_require_t; 
+ * @typedef struct msg_list_s sip_proxy_require_t;
  *
- * The structure #sip_proxy_require_t contains representation of an 
+ * The structure #sip_proxy_require_t contains representation of an
  * @ProxyRequire header.
  *
  * The #sip_proxy_require_t is defined as follows:
@@ -178,7 +178,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_proxy_require_class[] = 
+msg_hclass_t sip_proxy_require_class[] =
 SIP_HEADER_CLASS_LIST(proxy_require, "Proxy-Require", "", list);
 
 issize_t sip_proxy_require_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -199,9 +199,9 @@
  *
  * The Require header is used by clients to tell user agent servers about
  * options that the client expects the server to support in order to
- * properly process the request.  Its syntax is defined in @RFC3261 
+ * properly process the request.  Its syntax is defined in @RFC3261
  * as follows:
- * 
+ *
  * @code
  *    Require       =  "Require" HCOLON option-tag *(COMMA option-tag)
  * @endcode
@@ -210,9 +210,9 @@
  */
 
 /**@ingroup sip_require
- * @typedef struct msg_list_s sip_require_t; 
+ * @typedef struct msg_list_s sip_require_t;
  *
- * The structure #sip_require_t contains representation of an 
+ * The structure #sip_require_t contains representation of an
  * @Require header.
  *
  * The #sip_require_t is defined as follows:
@@ -226,7 +226,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_require_class[] = 
+msg_hclass_t sip_require_class[] =
 SIP_HEADER_CLASS_LIST(require, "Require", "", list);
 
 issize_t sip_require_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -247,7 +247,7 @@
  *
  * The Supported header enumerates all the capabilities of the client or
  * server.  Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Supported  =  ( "Supported" / "k" ) HCOLON
  *                  [option-tag *(COMMA option-tag)]
@@ -258,9 +258,9 @@
  */
 
 /**@ingroup sip_supported
- * @typedef struct msg_list_s sip_supported_t; 
+ * @typedef struct msg_list_s sip_supported_t;
  *
- * The structure #sip_supported_t contains representation of an 
+ * The structure #sip_supported_t contains representation of an
  * @Supported header.
  *
  * The #sip_supported_t is defined as follows:
@@ -275,7 +275,7 @@
  */
 
 
-msg_hclass_t sip_supported_class[] = 
+msg_hclass_t sip_supported_class[] =
 SIP_HEADER_CLASS_LIST(supported, "Supported", "k", list);
 
 issize_t sip_supported_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -296,7 +296,7 @@
  *
  * The Unsupported header lists the features not supported by the server.
  * Its syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Unsupported  =  "Unsupported" HCOLON [option-tag *(COMMA option-tag)]
  * @endcode
@@ -306,9 +306,9 @@
  */
 
 /**@ingroup sip_unsupported
- * @typedef struct msg_list_s sip_unsupported_t; 
+ * @typedef struct msg_list_s sip_unsupported_t;
  *
- * The structure #sip_unsupported_t contains representation of an 
+ * The structure #sip_unsupported_t contains representation of an
  * @Unsupported header.
  *
  * The #sip_unsupported_t is defined as follows:
@@ -322,7 +322,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_unsupported_class[] = 
+msg_hclass_t sip_unsupported_class[] =
 SIP_HEADER_CLASS_LIST(unsupported, "Unsupported", "", list);
 
 issize_t sip_unsupported_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -341,13 +341,13 @@
  *
  * @retval NULL if all the required features are supported
  * @retval pointer to a @Unsupported header or
- *         #SIP_NONE if @a home is NULL  
+ *         #SIP_NONE if @a home is NULL
  */
 sip_unsupported_t *sip_has_unsupported(su_home_t *home,
-				       sip_supported_t const *support, 
+				       sip_supported_t const *support,
 				       sip_require_t const *require)
 {
-  return sip_has_unsupported_any(home, support, NULL, NULL, 
+  return sip_has_unsupported_any(home, support, NULL, NULL,
 				 require, NULL, NULL);
 }
 
@@ -364,24 +364,24 @@
 		     sip_require_t const *support_by_require,
 		     sip_require_t const *require)
 {
-  return 
-    sip_has_unsupported_any(home, 
-			    support, support_by_require, NULL, 
+  return
+    sip_has_unsupported_any(home,
+			    support, support_by_require, NULL,
 			    require, NULL, NULL);
 }
 
 
 /** Check if required features are not supported.
  *
- * The supported features can be listed in @Supported, @Require or 
+ * The supported features can be listed in @Supported, @Require or
  * @ProxyRequire headers (in @a supported, @a by_require, or @a
  * by_proxy_require parameters, respectively)
  *
  * @param home (optional) home pointer for allocating @Unsupported header
  * @param supported @Supported features (may be NULL) [IN]
- * @param by_require  supported features listed by 
- *                    @Require (may be NULL) [IN] 
- * @param by_proxy_require supported features listed 
+ * @param by_require  supported features listed by
+ *                    @Require (may be NULL) [IN]
+ * @param by_proxy_require supported features listed
  *                         by @ProxyRequire (may be NULL) [IN]
  *
  * @param require   list of required features (may be NULL) [IN]
@@ -390,7 +390,7 @@
  *
  * @retval NULL if all the required features are supported
  * @retval pointer to a @Unsupported header or
- *         #SIP_NONE if @a home is NULL 
+ *         #SIP_NONE if @a home is NULL
  */
 sip_unsupported_t *
 sip_has_unsupported_any(su_home_t *home,
@@ -446,11 +446,11 @@
 
       if (feature) {
 	if (home) {
-	  if (unsupported == NULL) 
+	  if (unsupported == NULL)
 	    unsupported = sip_unsupported_make(home, feature);
 	  else
-	    msg_params_add(home, 
-			   (msg_param_t **)&unsupported->k_items, 
+	    msg_params_add(home,
+			   (msg_param_t **)&unsupported->k_items,
 			   feature);
 	}
 	else {
@@ -463,7 +463,7 @@
       }
     }
   }
-  
+
   return unsupported;
 }
 
@@ -471,7 +471,7 @@
 int sip_has_feature(msg_list_t const *supported, char const *feature)
 {
   size_t i;
-  
+
   if (!feature || !feature[0])
     return 1;			/* Empty feature is always supported */
 
@@ -498,7 +498,7 @@
  * syntax very similar to the @RecordRoute header field. It is used in
  * conjunction with SIP REGISTER requests and with 200 class messages in
  * response to REGISTER (REGISTER responses).
- * 
+ *
  * @code
  *    Path        =  "Path" HCOLON path-value *(COMMA path-value)
  *    path-value  =  name-addr *( SEMI rr-param )
@@ -547,7 +547,7 @@
  * contain a route vector that will direct requests through a specific
  * sequence of proxies. A registrar may use a Service-Route header field to
  * inform a UA of a service route that, if used by the UA, will provide
- * services from a proxy or set of proxies associated with that registrar. 
+ * services from a proxy or set of proxies associated with that registrar.
  * The Service-Route header field may be included by a registrar in the
  * response to a REGISTER request. The syntax for the Service-Route header
  * field is:
@@ -565,7 +565,7 @@
 /**@ingroup sip_service_route
  * @typedef typedef struct sip_route_s sip_service_route_t;
  *
- * The structure #sip_service_route_t contains representation of SIP 
+ * The structure #sip_service_route_t contains representation of SIP
  * @ServiceRoute header.
  *
  * The #sip_service_route_t is defined as follows:
@@ -581,7 +581,7 @@
  */
 
 msg_hclass_t sip_service_route_class[] =
-SIP_HEADER_CLASS(service_route, "Service-Route", "", 
+SIP_HEADER_CLASS(service_route, "Service-Route", "",
 		 r_params, append, any_route);
 
 issize_t sip_service_route_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_header.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_header.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_header.c	Tue Dec 23 07:37:03 2008
@@ -85,7 +85,7 @@
   return msg_header_d(home, msg, b);
 }
 
-/** Encode a SIP header. 
+/** Encode a SIP header.
  *
  * @deprecated Use msg_header_e() instead.
  */
@@ -94,7 +94,7 @@
   return msg_header_e(b, bsiz, (msg_header_t const *)h, flags);
 }
 
-sip_header_t *sip_header_format(su_home_t *home, 
+sip_header_t *sip_header_format(su_home_t *home,
 				msg_hclass_t *hc,
 				char const *fmt,
 				...)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_mime.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_mime.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_mime.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@CFILE sip_mime.c 
+/**@CFILE sip_mime.c
  *
  * MIME-related SIP headers
  *
@@ -54,7 +54,7 @@
  * The @b Accept request-header field can be used to specify certain media
  * types which are acceptable for the response. Its syntax is defined in
  * [H14.1, S10.6] as follows:
- * 
+ *
  * @code
  *    Accept         =  "Accept" HCOLON
  *                       [ accept-range *(COMMA accept-range) ]
@@ -97,7 +97,7 @@
 #define sip_accept_dup_one  msg_accept_dup_one
 #define sip_accept_update   msg_accept_update
 
-msg_hclass_t sip_accept_class[] = 
+msg_hclass_t sip_accept_class[] =
 SIP_HEADER_CLASS(accept, "Accept", "", ac_params, apndlist, accept);
 
 issize_t sip_accept_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -118,9 +118,9 @@
  * The Accept-Disposition header field is used to indicate what content
  * disposition types are acceptable to a client or server.  Its syntax is
  * defined in draft-lennox-sip-reg-payload-01.txt section 3.2 as follows:
- * 
+ *
  * @code
- *    Accept-Disposition = "Accept-Disposition" ":" 
+ *    Accept-Disposition = "Accept-Disposition" ":"
  *                         #( (disposition-type | "*") *( ";" generic-param ) )
  * @endcode
  *
@@ -129,8 +129,8 @@
  * is stored in #sip_accept_disposition_t structure.
  */
 
-msg_hclass_t sip_accept_disposition_class[] = 
-SIP_HEADER_CLASS(accept_disposition, "Accept-Disposition", "", 
+msg_hclass_t sip_accept_disposition_class[] =
+SIP_HEADER_CLASS(accept_disposition, "Accept-Disposition", "",
 		 ad_params, apndlist, accept_disposition);
 
 issize_t sip_accept_disposition_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -163,7 +163,7 @@
   MSG_STRING_E(b, end, ad->ad_type);
   MSG_PARAMS_E(b, end, ad->ad_params, flags);
   MSG_TERM_E(b, end);
-    
+
   return b - b0;
 }
 #endif
@@ -175,7 +175,7 @@
  * The Accept-Encoding header is similar to Accept, but restricts the
  * content-codings that are acceptable in the response.  Its syntax is
  * defined in [H14.3, S10.7] as follows:
- * 
+ *
  * @code
  *    Accept-Encoding  =  "Accept-Encoding" HCOLON
  *                         [ encoding *(COMMA encoding) ]
@@ -202,7 +202,7 @@
  *   sip_accept_encoding_t *aa_next;   // Pointer to next @AcceptEncoding header
  *   char const            *aa_value;  // Encoding token
  *   msg_param_t const     *aa_params; // List of parameters
- *   char const            *aa_q;      // Value of q parameter 
+ *   char const            *aa_q;      // Value of q parameter
  * } sip_accept_encoding_t;
  * @endcode
  */
@@ -211,8 +211,8 @@
 #define sip_accept_encoding_dup_one  msg_accept_any_dup_one
 #define sip_accept_encoding_update   msg_accept_any_update
 
-msg_hclass_t sip_accept_encoding_class[] = 
-SIP_HEADER_CLASS(accept_encoding, "Accept-Encoding", "", 
+msg_hclass_t sip_accept_encoding_class[] =
+SIP_HEADER_CLASS(accept_encoding, "Accept-Encoding", "",
 		 aa_params, apndlist, accept_encoding);
 
 issize_t sip_accept_encoding_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -242,7 +242,7 @@
  * the server in which language it would prefer to receive reason phrases,
  * session descriptions or status responses carried as message bodies.  Its
  * syntax is defined in [H14.4, S10.8] as follows:
- * 
+ *
  * @code
  *    Accept-Language  =  "Accept-Language" HCOLON
  *                         [ language *(COMMA language) ]
@@ -268,7 +268,7 @@
  *   sip_accept_language_t *aa_next;   // Pointer to next <language>
  *   char const            *aa_value;  // Language-range
  *   msg_param_t const     *aa_params; // List of accept-parameters
- *   char const            *aa_q;      // Value of q parameter 
+ *   char const            *aa_q;      // Value of q parameter
  * } sip_accept_language_t;
  * @endcode
  */
@@ -277,8 +277,8 @@
 #define sip_accept_language_dup_one  msg_accept_any_dup_one
 #define sip_accept_language_update   msg_accept_any_update
 
-msg_hclass_t sip_accept_language_class[] = 
-SIP_HEADER_CLASS(accept_language, "Accept-Language", "", 
+msg_hclass_t sip_accept_language_class[] =
+SIP_HEADER_CLASS(accept_language, "Accept-Language", "",
 		 aa_params, apndlist, accept_language);
 
 issize_t sip_accept_language_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -307,7 +307,7 @@
  * in the case of multipart messages, a message body part is to be
  * interpreted by the UAC or UAS.  Its syntax is defined in @RFC3261
  * as follows:
- * 
+ *
  * @code
  *    Content-Disposition   =  "Content-Disposition" HCOLON
  *                             disp-type *( SEMI disp-param )
@@ -320,7 +320,7 @@
  *    other-handling        =  token
  *    disp-extension-token  =  token
  * @endcode
- * 
+ *
  * The Content-Disposition header was extended by
  * draft-lennox-sip-reg-payload-01.txt section 3.1 as follows:
  *
@@ -342,7 +342,7 @@
  */
 
 /**@ingroup sip_content_disposition
- * @typedef struct msg_content_disposition_s sip_content_disposition_t; 
+ * @typedef struct msg_content_disposition_s sip_content_disposition_t;
  *
  * The structure #sip_content_disposition_t contains representation of an
  * @ContentDisposition header.
@@ -366,11 +366,11 @@
 static msg_dup_f sip_content_disposition_dup_one;
 #define sip_content_disposition_update msg_content_disposition_update
 
-msg_hclass_t sip_content_disposition_class[] = 
+msg_hclass_t sip_content_disposition_class[] =
 SIP_HEADER_CLASS(content_disposition, "Content-Disposition", "", cd_params,
 		 single, content_disposition);
 
-issize_t sip_content_disposition_d(su_home_t *home, sip_header_t *h, 
+issize_t sip_content_disposition_d(su_home_t *home, sip_header_t *h,
 				   char *s, isize_t slen)
 {
   return msg_content_disposition_d(home, h, s, slen);
@@ -388,9 +388,9 @@
   return msg_content_disposition_dup_xtra(h, offset);
 }
 
-/** Duplicate one #sip_content_disposition_t object */ 
+/** Duplicate one #sip_content_disposition_t object */
 static
-char *sip_content_disposition_dup_one(sip_header_t *dst, 
+char *sip_content_disposition_dup_one(sip_header_t *dst,
 				      sip_header_t const *src,
 				      char *b, isize_t xtra)
 {
@@ -405,7 +405,7 @@
  * The Content-Encoding header indicates what additional content codings
  * have been applied to the entity-body.  Its syntax is defined in @RFC3261
  * as follows:
- * 
+ *
  * @code
  * Content-Encoding  =  ( "Content-Encoding" / "e" ) HCOLON
  *                      content-coding *(COMMA content-coding)
@@ -417,7 +417,7 @@
  */
 
 /**@ingroup sip_content_encoding
- * @typedef struct msg_list_s sip_content_encoding_t; 
+ * @typedef struct msg_list_s sip_content_encoding_t;
  *
  * The structure #sip_content_encoding_t contains representation of an
  * @ContentEncoding header.
@@ -433,7 +433,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_content_encoding_class[] = 
+msg_hclass_t sip_content_encoding_class[] =
 SIP_HEADER_CLASS_LIST(content_encoding, "Content-Encoding", "e", list);
 
 issize_t sip_content_encoding_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -454,7 +454,7 @@
  * the intended audience for the enclosed entity. Note that this might not
  * be equivalent to all the languages used within the entity-body. Its
  * syntax is defined in @RFC3261 as follows:
- * 
+ *
  * @code
  *    Content-Language  =  "Content-Language" HCOLON
  *                         language-tag *(COMMA language-tag)
@@ -483,7 +483,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_content_language_class[] = 
+msg_hclass_t sip_content_language_class[] =
 SIP_HEADER_CLASS_LIST(content_language, "Content-Language", "", list);
 
 issize_t sip_content_language_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -503,7 +503,7 @@
  * The Content-Type header indicates the media type of the message-body sent
  * to the recipient.  Its syntax is defined in [H3.7, S] as
  * follows:
- * 
+ *
  * @code
  * Content-Type     =  ( "Content-Type" / "c" ) HCOLON media-type
  * media-type       =  m-type SLASH m-subtype *(SEMI m-parameter)
@@ -548,8 +548,8 @@
 static msg_dup_f sip_content_type_dup_one;
 #define sip_content_type_update NULL
 
-msg_hclass_t sip_content_type_class[] = 
-SIP_HEADER_CLASS(content_type, "Content-Type", "c", c_params, 
+msg_hclass_t sip_content_type_class[] =
+SIP_HEADER_CLASS(content_type, "Content-Type", "c", c_params,
 		 single, content_type);
 
 issize_t sip_content_type_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -568,7 +568,7 @@
   return msg_content_type_dup_xtra((msg_header_t *)h, offset);
 }
 
-/** Duplicate one #sip_content_type_t object */ 
+/** Duplicate one #sip_content_type_t object */
 static
 char *sip_content_type_dup_one(sip_header_t *dst, sip_header_t const *src,
 			       char *b, isize_t xtra)
@@ -585,7 +585,7 @@
  * MIME-Version header indicates what version of the MIME protocol was used
  * to construct the message.  Its syntax is defined in [H19.4.1, S10.28]
  * as follows:
- * 
+ *
  * @code
  *    MIME-Version  =  "MIME-Version" HCOLON 1*DIGIT "." 1*DIGIT
  * @endcode
@@ -594,7 +594,7 @@
  */
 
 /**@ingroup sip_mime_version
- * @typedef struct msg_generic_s sip_mime_version_t; 
+ * @typedef struct msg_generic_s sip_mime_version_t;
  *
  * The structure #sip_mime_version_t contains representation of an
  * @MIMEVersion header.
@@ -610,7 +610,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_mime_version_class[] = 
+msg_hclass_t sip_mime_version_class[] =
 SIP_HEADER_CLASS_G(mime_version, "MIME-Version", "", single);
 
 issize_t sip_mime_version_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -626,11 +626,11 @@
 /* ====================================================================== */
 
 /**@SIP_HEADER sip_warning Warning Header
- * 
+ *
  * The Warning response-header field is used to carry additional information
  * about the status of a response. Its syntax is defined in @RFC3261 as
  * follows:
- * 
+ *
  * @code
  *    Warning        =  "Warning" HCOLON warning-value *(COMMA warning-value)
  *    warning-value  =  warn-code SP warn-agent SP warn-text
@@ -646,7 +646,7 @@
  */
 
 /**@ingroup sip_warning
- * @typedef struct msg_warning_s sip_warning_t; 
+ * @typedef struct msg_warning_s sip_warning_t;
  *
  * The structure #sip_warning_t contains representation of an
  * @Warning header.
@@ -669,7 +669,7 @@
 #define sip_warning_dup_one msg_warning_dup_one
 #define sip_warning_update NULL
 
-msg_hclass_t sip_warning_class[] = 
+msg_hclass_t sip_warning_class[] =
 SIP_HEADER_CLASS(warning, "Warning", "", w_common, append, warning);
 
 issize_t sip_warning_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c	Tue Dec 23 07:37:03 2008
@@ -152,7 +152,7 @@
   return mclass;
 }
 
-/** Extract the SIP message body, including separator line. 
+/** Extract the SIP message body, including separator line.
  *
  * @param msg  message object [IN]
  * @param sip  public SIP message structure [IN/OUT]
@@ -162,13 +162,13 @@
  *
  * @retval -1 error
  * @retval 0  cannot proceed
- * @retval m 
+ * @retval m
  */
 issize_t sip_extract_body(msg_t *msg, sip_t *sip, char b[], isize_t bsiz, int eos)
 {
   ssize_t m = 0;
   size_t body_len;
-  
+
   if (!(sip->sip_flags & MSG_FLG_BODY)) {
     /* We are looking at a potential empty line */
     m = msg_extract_separator(msg, (msg_pub_t *)sip, b, bsiz, eos);
@@ -203,10 +203,10 @@
     return bsiz;
   }
 
-  if ((m = msg_extract_payload(msg, (msg_pub_t *)sip, 
+  if ((m = msg_extract_payload(msg, (msg_pub_t *)sip,
 			       NULL, body_len, b, bsiz, eos)) == -1)
     return -1;
-  
+
   sip->sip_flags |= MSG_FLG_FRAGS;
   if (bsiz >= body_len)
     sip->sip_flags |= MSG_FLG_COMPLETE;
@@ -216,7 +216,7 @@
 
 /** Parse SIP version.
  *
- * Parse a SIP version string. Update the 
+ * Parse a SIP version string. Update the
  * pointer at @a ss to first non-LWS character after the version string.
  *
  * @param ss   string to be parsed [IN/OUT]
@@ -231,7 +231,7 @@
   char const *result;
   size_t const version_size = sizeof(sip_version_2_0) - 1;
 
-  if (strncasecmp(s, sip_version_2_0, version_size) == 0 && 
+  if (strncasecmp(s, sip_version_2_0, version_size) == 0 &&
       !IS_TOKEN(s[version_size])) {
     result = sip_version_2_0;
     s += version_size;
@@ -259,7 +259,7 @@
       memmove(s + l1 + 1, s + n - l2, l2);
       s[l1 + 1 + l2] = 0;
 
-      /* Compare again with compacted version */ 
+      /* Compare again with compacted version */
       if (strcasecmp(s, sip_version_2_0) == 0)
 	result = sip_version_2_0;
     }
@@ -268,10 +268,10 @@
   }
 
   while (IS_WS(*s)) *s++ = '\0';
-  
+
   *ss = s;
 
-  if (ver) 
+  if (ver)
     *ver = result;
 
   return 0;
@@ -344,7 +344,7 @@
 
 /**Parse a SIP method name.
  *
- * Parse a SIP method name and return a code corresponding to the method. 
+ * Parse a SIP method name and return a code corresponding to the method.
  * The address of the first non-LWS character after method name is stored in
  * @a *ss.
  *
@@ -375,11 +375,11 @@
   switch (c) {
   case 'A': if (MATCH(s, "ACK")) code = sip_method_ack; break;
   case 'B': if (MATCH(s, "BYE")) code = sip_method_bye; break;
-  case 'C': 
-    if (MATCH(s, "CANCEL")) 
-      code = sip_method_cancel; 
+  case 'C':
+    if (MATCH(s, "CANCEL"))
+      code = sip_method_cancel;
     break;
-  case 'I': 
+  case 'I':
     if (MATCH(s, "INVITE"))
       code = sip_method_invite;
     else if (MATCH(s, "INFO"))
@@ -388,19 +388,19 @@
   case 'M': if (MATCH(s, "MESSAGE")) code = sip_method_message; break;
   case 'N': if (MATCH(s, "NOTIFY")) code = sip_method_notify; break;
   case 'O': if (MATCH(s, "OPTIONS")) code = sip_method_options; break;
-  case 'P': 
-    if (MATCH(s, "PRACK")) code = sip_method_prack; 
-    else if (MATCH(s, "PUBLISH")) code = sip_method_publish; 
+  case 'P':
+    if (MATCH(s, "PRACK")) code = sip_method_prack;
+    else if (MATCH(s, "PUBLISH")) code = sip_method_publish;
     break;
-  case 'R': 
-    if (MATCH(s, "REGISTER")) 
-      code = sip_method_register; 
+  case 'R':
+    if (MATCH(s, "REGISTER"))
+      code = sip_method_register;
     else if (MATCH(s, "REFER"))
-      code = sip_method_refer; 
+      code = sip_method_refer;
     break;
-  case 'S': 
-    if (MATCH(s, "SUBSCRIBE")) 
-      code = sip_method_subscribe; 
+  case 'S':
+    if (MATCH(s, "SUBSCRIBE"))
+      code = sip_method_subscribe;
     break;
   case 'U':
     if (MATCH(s, "UPDATE"))
@@ -410,7 +410,7 @@
 
 #undef MATCH
 
-  if (IS_NON_WS(s[n])) 
+  if (IS_NON_WS(s[n]))
     /* Unknown method */
     code = sip_method_unknown;
 
@@ -467,14 +467,14 @@
        !TRANSPORT_MATCH(sip_transport_tcp) &&
        !TRANSPORT_MATCH(sip_transport_sctp) &&
        !TRANSPORT_MATCH(sip_transport_tls))) {
-    /* Protocol name */ 
+    /* Protocol name */
     transport = pn = s;
     skip_token(&s);
     pn_len = s - pn;
     skip_lws(&s);
     if (pn_len == 0 || *s++ != '/') return -1;
     skip_lws(&s);
-    
+
     /* Protocol version */
     pv = s;
     skip_token(&s);
@@ -482,13 +482,13 @@
     skip_lws(&s);
     if (pv_len == 0 || *s++ != '/') return -1;
     skip_lws(&s);
-    
+
     /* Transport protocol */
     pt = s;
     skip_token(&s);
     pt_len = s - pt;
     if (pt_len == 0) return -1;
-    
+
     /* Remove whitespace between protocol name and version */
     if (pn + pn_len + 1 != pv) {
       pn[pn_len] = '/';
@@ -500,7 +500,7 @@
       pv[pv_len] = '/';
       pt = memmove(pv + pv_len + 1, pt, pt_len);
       pt[pt_len] = '\0';
-      
+
       /* extra whitespace? */
       if (!strcasecmp(transport, sip_transport_udp))
 	transport = sip_transport_udp;
@@ -580,9 +580,9 @@
   return rv;
 }
 
-/**Add message separator, then test if message is complete. 
+/**Add message separator, then test if message is complete.
  *
- * Add sip_content_length and sip_separator if they are missing. 
+ * Add sip_content_length and sip_separator if they are missing.
  * The test that all necessary message components ( @From, @To,
  * @CSeq, @CallID, @ContentLength and message separator are present.
  *
@@ -622,7 +622,7 @@
     if (mplen == -1)
       return -1;
     len = (size_t)mplen;
-  } 
+  }
 
   if (sip->sip_payload)
     len += sip->sip_payload->pl_len;
@@ -640,14 +640,14 @@
       sip_fragment_clear(sip->sip_content_length->l_common);
     }
   }
-  
-  if (!sip->sip_cseq || 
+
+  if (!sip->sip_cseq ||
       !sip->sip_call_id ||
       !sip->sip_to ||
       !sip->sip_from ||
       !sip->sip_separator ||
       !sip->sip_content_length)
     return -1;
-  
+
   return 0;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.docs	Tue Dec 23 07:37:03 2008
@@ -7,7 +7,7 @@
  * new parser is added.
  *
  * The @b sip module contains interface to the SIP headers and message
- * objects. The interface is abstracted using objects known as 
+ * objects. The interface is abstracted using objects known as
  * @ref msg_hclass_s "header classes" and @ref msg_mclass_s "message classes".
  *
  * The @ref msg_mclass_s "message class" defines how a message is handled:
@@ -15,14 +15,14 @@
  * classes. It also contains function pointers used by the parser to handle
  * message body and other details that vary between protocols.
  *
- * A @ref msg_hclass_s "header class" defines how a single header is parsed. 
+ * A @ref msg_hclass_s "header class" defines how a single header is parsed.
  * Each header has its own header class. There are also header classes for
  * message elements that are not really headers, like @ref sip_request
- * "request" and @ref sip_status "status line", 
- * @ref sip_separator "separator between headers" and 
+ * "request" and @ref sip_status "status line",
+ * @ref sip_separator "separator between headers" and
  * @ref sip_payload "message body"
  * (which is also known as payload). There is also a header classes
- * for @ref sip_unknown "unknown headers" and 
+ * for @ref sip_unknown "unknown headers" and
  * @ref sip_error "headers that contained parsing errors".
  *
  *
@@ -33,18 +33,18 @@
  *
  * Create a header template for your header just like sip_rfc2543.h.in,
  * e.g, sip_example.h.in:
- * 
+ *
  *@code
 /**@file sip_example.h.in
  *
  * Template for <sofia-sip/sip_example.h>.
  */
 
-#ifndef SIP_EXAMPLE_H 
+#ifndef SIP_EXAMPLE_H
 /** Defined when <sofia-sip/sip_example.h> has been included. */
-#define SIP_EXAMPLE_H 
+#define SIP_EXAMPLE_H
 
-/**@file sofia-sip/sip_example.h 
+/**@file sofia-sip/sip_example.h
 *
  * @brief Example header.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser_table.c.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser_table.c.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser_table.c.in	Tue Dec 23 07:37:03 2008
@@ -29,7 +29,7 @@
  *
  */
 
-/**@CFILE sip_parser_table.c 
+/**@CFILE sip_parser_table.c
  * @brief SIP parser table
  *
  * #AUTO#

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_prack.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_prack.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_prack.c	Tue Dec 23 07:37:03 2008
@@ -55,7 +55,7 @@
  * The RAck header indicates the sequence number of the provisional response
  * which is being acknowledged.  Its syntax is defined in
  * @RFC3262 section 10 as follows:
- * 
+ *
  * @code
  *    RAck          =  "RAck" HCOLON response-num LWS CSeq-num LWS Method
  *    response-num  =  1*DIGIT
@@ -91,7 +91,7 @@
 static msg_dup_f sip_rack_dup_one;
 #define sip_rack_update NULL
 
-msg_hclass_t sip_rack_class[] = 
+msg_hclass_t sip_rack_class[] =
 SIP_HEADER_CLASS(rack, "RAck", "", ra_common, single, rack);
 
 issize_t sip_rack_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -121,7 +121,7 @@
 
   assert(sip_is_rack(h));
 
-  return snprintf(b, bsiz, "%u %u %s", 
+  return snprintf(b, bsiz, "%u %u %s",
 		  ra->ra_response, ra->ra_cseq, ra->ra_method_name);
 }
 
@@ -135,7 +135,7 @@
     return offset;
 }
 
-/** Duplicate one #sip_rack_t object */ 
+/** Duplicate one #sip_rack_t object */
 char *sip_rack_dup_one(sip_header_t *dst, sip_header_t const *src,
 			char *b, isize_t xtra)
 {
@@ -162,9 +162,9 @@
 
 /**@SIP_HEADER sip_rseq RSeq Header
  *
- * The RSeq header identifies provisional responses within a transaction. 
+ * The RSeq header identifies provisional responses within a transaction.
  * Its syntax is defined in @RFC3262 section 10 as follows:
- * 
+ *
  * @code
  *    RSeq          =  "RSeq" HCOLON response-num
  *    response-num  =  1*DIGIT
@@ -189,7 +189,7 @@
  * @endcode
  */
 
-msg_hclass_t sip_rseq_class[] = 
+msg_hclass_t sip_rseq_class[] =
 SIP_HEADER_CLASS(rseq, "RSeq", "", rs_common, single, any);
 
 issize_t sip_rseq_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_pref_util.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_pref_util.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_pref_util.c	Tue Dec 23 07:37:03 2008
@@ -23,7 +23,7 @@
  */
 
 /**@CFILE sip_pref_util.c
- * 
+ *
  * SIP callercaps and callerprefs utility functions.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
@@ -48,8 +48,8 @@
 static double parse_number(char const *str, char **return_end);
 
 /** Parse a single preference */
-int sip_prefs_parse(union sip_pref *sp, 
-		    char const **in_out_s, 
+int sip_prefs_parse(union sip_pref *sp,
+		    char const **in_out_s,
 		    int *return_negation)
 {
   char const *s;
@@ -66,7 +66,7 @@
     return 0;
 
   if (old_type == sp_init) {
-    if (s[0] == '\0' || 
+    if (s[0] == '\0' ||
 	strcasecmp(s, "TRUE") == 0 ||
 	strcasecmp(s, "\"TRUE\"") == 0) {
       /* Boolean */
@@ -76,7 +76,7 @@
       *return_negation = 0;
       *in_out_s = s + strlen(s);
       return 1;
-    } else if (strcasecmp(s, "FALSE") == 0 || 
+    } else if (strcasecmp(s, "FALSE") == 0 ||
 	       strcasecmp(s, "\"FALSE\"") == 0) {
       /* Boolean */
       sp->sp_type = sp_literal;
@@ -88,7 +88,7 @@
     } else if (s[0] == '"' && s[1] != '\0') {
       for (s++; IS_LWS(s[0]); s++);
     } else
-      old_type = sp_error;      
+      old_type = sp_error;
   } else if (!s[0]) {
     sp->sp_type = sp_init;
     return 0;
@@ -106,7 +106,7 @@
     char s0, *e;
 
     for (s++; IS_LWS(s[0]); s++);
-    
+
     s0 = s[0];
 
     if (s0 == '=')
@@ -150,9 +150,9 @@
   else
     old_type = sp_error;
 
-  if (old_type != sp_init && old_type != sp->sp_type) 
+  if (old_type != sp_init && old_type != sp->sp_type)
     sp->sp_type = sp_error;
-    
+
   *in_out_s = s;
 
   return sp->sp_type != sp_error;
@@ -199,7 +199,7 @@
 
 
 /** Return true if preferences match */
-int sip_prefs_match(union sip_pref const *a, 
+int sip_prefs_match(union sip_pref const *a,
 		    union sip_pref const *b)
 {
   if (!a || !b)
@@ -208,20 +208,20 @@
     return 0;
   switch (a->sp_type) {
   default:
-  case sp_error: 
+  case sp_error:
     return 0;
   case sp_literal:
-    return 
+    return
       a->sp_literal.spl_length == b->sp_literal.spl_length &&
       strncasecmp(a->sp_literal.spl_value, b->sp_literal.spl_value,
 		  a->sp_literal.spl_length) == 0;
   case sp_string:
-    return 
+    return
       a->sp_string.sps_length == b->sp_string.sps_length &&
       strncmp(a->sp_string.sps_value, b->sp_string.sps_value,
 	      a->sp_string.sps_length) == 0;
   case sp_range:
-    return 
+    return
       a->sp_range.spr_lower <= b->sp_range.spr_upper &&
       a->sp_range.spr_upper >= b->sp_range.spr_lower;
   }
@@ -260,7 +260,7 @@
 
   memset(np, 0, sizeof np);
 
-  /* Usually nvalue is from Accept/Reject-Contact, 
+  /* Usually nvalue is from Accept/Reject-Contact,
      pvalue is from Contact */
   while (sip_prefs_parse(np, &nvalue, &n_negated)) {
     memset(pp, 0, sizeof pp);
@@ -291,7 +291,7 @@
   return 0;
 }
 
-/** Check if the parameter is a valid feature tag. 
+/** Check if the parameter is a valid feature tag.
  *
  * A feature tag is a parameter starting with a single plus, or a well-known
  * feature tag listed in @RFC3841: "audio", "automata", "application",
@@ -377,7 +377,7 @@
 }
 
 /**Check if @Contact matches by @AcceptContact.
- * 
+ *
  * Matching @AcceptContact and @Contact headers is done as explained in
  * @RFC3841 section 7.2.4. The caller score can be calculated from the
  * returned S and N values.
@@ -393,9 +393,9 @@
  *
  * @param m   pointer to @Contact header structure
  * @param cp   pointer to @AcceptContact header structure
- * @param return_N   return-value parameter for number of 
+ * @param return_N   return-value parameter for number of
  *                   feature tags in @AcceptContact
- * @param return_S   return-value parameter for number of 
+ * @param return_S   return-value parameter for number of
  *                   matching feature tags
  * @param return_error   return-value parameter for parsing error
  *
@@ -428,7 +428,7 @@
  * sip_contact_is_immune(), sip_contact_immunize(), sip_is_callerpref(),
  * sip_prefs_matching().
  */
-int sip_contact_accept(sip_contact_t const *m, 
+int sip_contact_accept(sip_contact_t const *m,
 		       sip_accept_contact_t const *cp,
 		       unsigned *return_S,
 		       unsigned *return_N,
@@ -459,9 +459,9 @@
       eq = strcspn(acc, "=");
       acc += eq + (acc[eq] == '=');
 
-      if (!sip_prefs_matching(cap, acc, return_error)) 
+      if (!sip_prefs_matching(cap, acc, return_error))
 	return 0;
-      
+
       S++;
     }
   }
@@ -469,7 +469,7 @@
   *return_S = S; /* Matched feature tags */
   *return_N = N; /* Number of feature tags in @AcceptContact */
 
-  return 1; 
+  return 1;
 }
 
 
@@ -484,7 +484,7 @@
  * @sa sip_contact_score(), sip_contact_accept(), sip_contact_immunize(),
  * sip_contact_is_immune(), @RFC3841, @RejectContact, @Contact
  */
-int sip_contact_reject(sip_contact_t const *m, 
+int sip_contact_reject(sip_contact_t const *m,
 		       sip_reject_contact_t const *reject)
 {
   unsigned S, N;
@@ -506,7 +506,7 @@
  *
  * @retval pointer to immunized copy if successful
  * @retval NULL upon an error
- * 
+ *
  * @sa @RFC3841, sip_is_callerpref(), sip_contact_score(),
  * sip_contact_accept(), sip_contact_reject(), @Contact
  */
@@ -541,7 +541,7 @@
 /** Calculate score for contact.
  *
  * The caller preference score is an integer in range of 0 to 1000.
- * 
+ *
  * @retval -1 if the contact is rejected
  * @retval 1000 if contact is immune to caller preferences
  * @retval 0..1000 reflecting @RFC3841 score in 0.000 - 1.000.
@@ -563,14 +563,14 @@
     return 1000;		/* Immune */
 
   for (; rc; rc = rc->cp_next)
-    if (sip_contact_reject(m, rc)) 
+    if (sip_contact_reject(m, rc))
       break;
   if (rc)
     return -1;			/* Rejected */
 
   for (; ac; ac = ac->cp_next) {
     unsigned S, N;
-	
+
     if (!sip_contact_accept(m, ac, &S, &N, &error)) {
       if (ac->cp_require)
 	return 0;		/* Discarded */
@@ -586,11 +586,11 @@
 	return 0;		/* Dropped */
     }
 
-    if (S > 0 && N > 0) 
+    if (S > 0 && N > 0)
       S_total += sip_q_value(ac->cp_q) * (scale * S / N + (2 * S >= N));
   }
 
-  if (!M) 
+  if (!M)
     return 0;
 
   S_total /= M;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_reason.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_reason.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_reason.c	Tue Dec 23 07:37:03 2008
@@ -52,7 +52,7 @@
  * The Reason header is used to indicate why a SIP request was issued or why
  * a provisional response was sent. It can be used with HRPF scenarios. It
  * is defined in @RFC3326 as follows:
- * 
+ *
  * @code
  *   Reason            =  "Reason" HCOLON reason-value *(COMMA reason-value)
  *   reason-value      =  protocol *(SEMI reason-params)
@@ -64,7 +64,7 @@
  *   reason-text       =  "text" EQUAL quoted-string
  *   reason-extension  =  generic-param
  * @endcode
- * 
+ *
  * The parsed Reason header is stored in #sip_reason_t structure.
  */
 
@@ -77,12 +77,12 @@
  * @code
  * typedef struct sip_reason_s
  * {
- *   sip_common_t        re_common[1]; // Common fragment info 
- *   sip_reason_t       *re_next;      // Link to next <reason-value> 
- *   char const         *re_protocol;  // Protocol 
- *   msg_param_t const  *re_params;    // List of reason parameters 
- *   char const         *re_cause;     // Value of cause parameter 
- *   char const         *re_text;      // Value of text parameter 
+ *   sip_common_t        re_common[1]; // Common fragment info
+ *   sip_reason_t       *re_next;      // Link to next <reason-value>
+ *   char const         *re_protocol;  // Protocol
+ *   msg_param_t const  *re_params;    // List of reason parameters
+ *   char const         *re_cause;     // Value of cause parameter
+ *   char const         *re_text;      // Value of text parameter
  * } sip_reason_t;
  * @endcode
  */
@@ -91,7 +91,7 @@
 static msg_dup_f sip_reason_dup_one;
 static msg_update_f sip_reason_update;
 
-msg_hclass_t sip_reason_class[] = 
+msg_hclass_t sip_reason_class[] =
 SIP_HEADER_CLASS(reason, "Reason", "", re_params, append, reason);
 
 issize_t sip_reason_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -103,9 +103,9 @@
     *s = '\0', s += span_lws(s + 1) + 1;
 
   re->re_protocol = s;
-  if ((n = span_token(s)) == 0) 
+  if ((n = span_token(s)) == 0)
     return -1;
-  s += n; while (IS_LWS(*s)) *s++ = '\0'; 
+  s += n; while (IS_LWS(*s)) *s++ = '\0';
   if (*s == ';' && msg_params_d(home, &s, &re->re_params) < 0)
     return -1;
 
@@ -134,7 +134,7 @@
   return offset;
 }
 
-/** Duplicate one #sip_reason_t object */ 
+/** Duplicate one #sip_reason_t object */
 char *sip_reason_dup_one(sip_header_t *dst, sip_header_t const *src,
 			char *b, isize_t xtra)
 {
@@ -150,7 +150,7 @@
 }
 
 /** Update parameter values for @Reason header */
-static int sip_reason_update(msg_common_t *h, 
+static int sip_reason_update(msg_common_t *h,
 			     char const *name, isize_t namelen,
 			     char const *value)
 {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_refer.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_refer.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_refer.c	Tue Dec 23 07:37:03 2008
@@ -280,7 +280,7 @@
   return b;
 }
 
-static int sip_referred_by_update(msg_common_t *h, 
+static int sip_referred_by_update(msg_common_t *h,
 			   char const *name, isize_t namelen,
 			   char const *value)
 {
@@ -338,10 +338,10 @@
  * {
  *   sip_common_t        rp_common[1];   // Common fragment info
  *   sip_error_t        *rp_next;	 // Dummy link to next
- *   char const         *rp_call_id;     // @CallID of dialog to replace 
- *   msg_param_t const  *rp_params;      // List of parameters 
- *   char const         *rp_to_tag;      // Value of "to-tag" parameter 
- *   char const         *rp_from_tag;    // Value of "from-tag" parameter 
+ *   char const         *rp_call_id;     // @CallID of dialog to replace
+ *   msg_param_t const  *rp_params;      // List of parameters
+ *   char const         *rp_to_tag;      // Value of "to-tag" parameter
+ *   char const         *rp_from_tag;    // Value of "from-tag" parameter
  *   unsigned            rp_early_only;  // early-only parameter
  * } sip_replaces_t;
  * @endcode
@@ -414,7 +414,7 @@
 }
 
 /** Update parameters in @Replaces header. */
-static int sip_replaces_update(msg_common_t *h, 
+static int sip_replaces_update(msg_common_t *h,
 			       char const *name, isize_t namelen,
 			       char const *value)
 {
@@ -456,7 +456,7 @@
  *  exten           = generic-param
  *
  * The parsed Refer-Sub header is stored in #sip_refer_sub_t structure.
- * 
+ *
  * @NEW_1_12_5. Note that #sip_t does not contain @a sip_refer_sub field,
  * but sip_refer_sub() accessor function should be used for accessing @b
  * Refer-Sub header structure.
@@ -478,10 +478,10 @@
  *   sip_common_t        rs_common[1];   // Common fragment info
  *   sip_error_t        *rs_next;	 // Dummy link to next
  *   char const         *rs_value;       // "true" or "false"
- *   msg_param_t const  *rs_params;      // List of extension parameters 
+ *   msg_param_t const  *rs_params;      // List of extension parameters
  * } sip_refer_sub_t;
  * @endcode
- * 
+ *
  * @NEW_1_12_5.
  */
 
@@ -502,7 +502,7 @@
   if (msg_token_d(&s, &rs->rs_value) < 0)
     return -1;
 
-  if (strcasecmp(rs->rs_value, "false") && 
+  if (strcasecmp(rs->rs_value, "false") &&
       strcasecmp(rs->rs_value, "true"))
     return -1;
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c	Tue Dec 23 07:37:03 2008
@@ -28,7 +28,7 @@
  *
  * This file contains implementation of headers related to HTTP authentication
  * (@RFC2617):
- * @ref sip_authorization "Authorization", 
+ * @ref sip_authorization "Authorization",
  * @ref sip_authentication_info "Authentication-Info",
  * @ref sip_proxy_authenticate "Proxy-Authenticate",
  * @ref sip_proxy_authentication_info "Proxy-Authentication-Info",
@@ -42,7 +42,7 @@
  * @ref sip_security_verify "Security-Verify" headers.
  *
  * The implementation of @ref sip_privacy "Privacy" header (@RFC3323) is
- * also here. 
+ * also here.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
  *
@@ -118,9 +118,9 @@
  * The #sip_authorization_t is defined as follows:
  * @code
  * typedef struct msg_auth_s {
- *   msg_common_t       au_common[1];  // Common fragment info 
- *   msg_auth_t        *au_next;       // Link to next header 
- *   char const        *au_scheme;     // Auth-scheme like "Basic" or "Digest" 
+ *   msg_common_t       au_common[1];  // Common fragment info
+ *   msg_auth_t        *au_next;       // Link to next header
+ *   char const        *au_scheme;     // Auth-scheme like "Basic" or "Digest"
  *   msg_param_t const *au_params;     // Comma-separated parameters
  * } sip_authorization_t;
  * @endcode
@@ -188,9 +188,9 @@
  * The #sip_proxy_authenticate_t is defined as follows:
  * @code
  * typedef struct msg_auth_s {
- *   msg_common_t       au_common[1];  // Common fragment info 
- *   msg_auth_t        *au_next;       // Link to next header 
- *   char const        *au_scheme;     // Auth-scheme like "Basic" or "Digest" 
+ *   msg_common_t       au_common[1];  // Common fragment info
+ *   msg_auth_t        *au_next;       // Link to next header
+ *   char const        *au_scheme;     // Auth-scheme like "Basic" or "Digest"
  *   msg_param_t const *au_params;     // Comma-separated parameters
  * } sip_proxy_authenticate_t;
  * @endcode
@@ -244,9 +244,9 @@
  * The #sip_proxy_authorization_t is defined as follows:
  * @code
  * typedef struct msg_auth_s {
- *   msg_common_t       au_common[1];  // Common fragment info 
- *   msg_auth_t        *au_next;       // Link to next header 
- *   char const        *au_scheme;     // Auth-scheme like "Basic" or "Digest" 
+ *   msg_common_t       au_common[1];  // Common fragment info
+ *   msg_auth_t        *au_next;       // Link to next header
+ *   char const        *au_scheme;     // Auth-scheme like "Basic" or "Digest"
  *   msg_param_t const *au_params;     // Comma-separated parameters
  * } sip_proxy_authorization_t;
  * @endcode
@@ -299,9 +299,9 @@
  * The #sip_www_authenticate_t is defined as follows:
  * @code
  * typedef struct msg_auth_s {
- *   msg_common_t       au_common[1];  // Common fragment info 
- *   msg_auth_t        *au_next;       // Link to next header 
- *   char const        *au_scheme;     // Auth-scheme like "Basic" or "Digest" 
+ *   msg_common_t       au_common[1];  // Common fragment info
+ *   msg_auth_t        *au_next;       // Link to next header
+ *   char const        *au_scheme;     // Auth-scheme like "Basic" or "Digest"
  *   msg_param_t const *au_params;     // Comma-separated parameters
  * } sip_www_authenticate_t;
  * @endcode
@@ -441,7 +441,7 @@
   return msg_list_d(home, (msg_header_t *)h, s, slen);
 }
 
-issize_t sip_proxy_authentication_info_e(char b[], isize_t bsiz, 
+issize_t sip_proxy_authentication_info_e(char b[], isize_t bsiz,
 					 sip_header_t const *h, int f)
 {
   assert(sip_is_proxy_authentication_info(h)); /* This is soo popular */
@@ -455,7 +455,7 @@
 typedef struct sip_security_agree_s sip_security_agree_t;
 #define sh_security_agree sh_security_client
 
-static 
+static
 issize_t sip_security_agree_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
 {
   sip_security_agree_t *sa = (sip_security_agree_t *)h;
@@ -465,16 +465,16 @@
   while (*s == ',')   /* Ignore empty entries (comma-whitespace) */
     *s = '\0', s += span_lws(s + 1) + 1;
 
-  if ((n = span_token(s)) == 0) 
+  if ((n = span_token(s)) == 0)
     return -1;
-  sa->sa_mec = s; s += n; while (IS_LWS(*s)) *s++ = '\0'; 
+  sa->sa_mec = s; s += n; while (IS_LWS(*s)) *s++ = '\0';
   if (*s == ';' && msg_params_d(home, &s, &sa->sa_params) < 0)
     return -1;
 
   return msg_parse_next_field(home, h, s, slen);
 }
 
-static 
+static
 issize_t sip_security_agree_e(char b[], isize_t bsiz, sip_header_t const *h, int f)
 {
   char *end = b + bsiz, *b0 = b;
@@ -486,7 +486,7 @@
   return b - b0;
 }
 
-static 
+static
 isize_t sip_security_agree_dup_xtra(sip_header_t const *h, isize_t offset)
 {
   sip_security_agree_t const *sa = h->sh_security_agree;
@@ -497,8 +497,8 @@
   return offset;
 }
 
-/** Duplicate one sip_security_agree_t object */ 
-static 
+/** Duplicate one sip_security_agree_t object */
+static
 char *sip_security_agree_dup_one(sip_header_t *dst, sip_header_t const *src,
 				 char *b, isize_t xtra)
 {
@@ -513,7 +513,7 @@
   return b;
 }
 
-static int sip_security_agree_update(msg_common_t *h, 
+static int sip_security_agree_update(msg_common_t *h,
 				     char const *name, isize_t namelen,
 				     char const *value)
 {
@@ -589,8 +589,8 @@
  * @code
  * typedef struct sip_security_agree_s
  * {
- *   sip_common_t        sa_common[1]; // Common fragment info 
- *   sip_security_client_t *sa_next;   // Link to next mechanism 
+ *   sip_common_t        sa_common[1]; // Common fragment info
+ *   sip_security_client_t *sa_next;   // Link to next mechanism
  *   char const         *sa_mec;       // Security mechanism
  *   msg_param_t const  *sa_params;    // List of mechanism parameters
  *   char const         *sa_q;         // Value of q (preference) parameter
@@ -601,8 +601,8 @@
  * @endcode
  */
 
-msg_hclass_t sip_security_client_class[] = 
-SIP_HEADER_CLASS(security_client, "Security-Client", "", 
+msg_hclass_t sip_security_client_class[] =
+SIP_HEADER_CLASS(security_client, "Security-Client", "",
 		 sa_params, append, security_agree);
 
 issize_t sip_security_client_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -638,8 +638,8 @@
  * @code
  * typedef struct sip_security_agree_s
  * {
- *   sip_common_t        sa_common[1]; // Common fragment info 
- *   sip_security_server_t *sa_next;   // Link to next mechanism 
+ *   sip_common_t        sa_common[1]; // Common fragment info
+ *   sip_security_server_t *sa_next;   // Link to next mechanism
  *   char const         *sa_mec;       // Security mechanism
  *   msg_param_t const  *sa_params;    // List of mechanism parameters
  *   char const         *sa_q;         // Value of q (preference) parameter
@@ -650,8 +650,8 @@
  * @endcode
  */
 
-msg_hclass_t sip_security_server_class[] = 
-SIP_HEADER_CLASS(security_server, "Security-Server", "", 
+msg_hclass_t sip_security_server_class[] =
+SIP_HEADER_CLASS(security_server, "Security-Server", "",
 		 sa_params, append, security_agree);
 
 issize_t sip_security_server_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -687,8 +687,8 @@
  * @code
  * typedef struct sip_security_agree_s
  * {
- *   sip_common_t        sa_common[1]; // Common fragment info 
- *   sip_security_verify_t *sa_next;   // Link to next mechanism 
+ *   sip_common_t        sa_common[1]; // Common fragment info
+ *   sip_security_verify_t *sa_next;   // Link to next mechanism
  *   char const         *sa_mec;       // Security mechanism
  *   msg_param_t const  *sa_params;    // List of mechanism parameters
  *   char const         *sa_q;         // Value of q (preference) parameter
@@ -700,8 +700,8 @@
  */
 
 
-msg_hclass_t sip_security_verify_class[] = 
-SIP_HEADER_CLASS(security_verify, "Security-Verify", "", 
+msg_hclass_t sip_security_verify_class[] =
+SIP_HEADER_CLASS(security_verify, "Security-Verify", "",
 		 sa_params, append, security_agree);
 
 issize_t sip_security_verify_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -718,10 +718,10 @@
 /* RFC 3323 */
 
 /**@SIP_HEADER sip_privacy Privacy Header
- * 
+ *
  * The Privacy header is used by User-Agent to request privacy services from
  * the network. Its syntax is defined in @RFC3323 as follows:
- * 
+ *
  * @code
  *    Privacy-hdr  =  "Privacy" HCOLON priv-value *(";" priv-value)
  *    priv-value   =   "header" / "session" / "user" / "none" / "critical"
@@ -740,9 +740,9 @@
  * The #sip_privacy_t is defined as follows:
  * @code
  * typedef struct sip_privacy_s {
- *   sip_common_t       priv_common[1];	// Common fragment info 
- *   sip_error_t       *priv_next;     	// Dummy link 
- *   msg_param_t const *priv_values;   	// List of privacy values 
+ *   sip_common_t       priv_common[1];	// Common fragment info
+ *   sip_error_t       *priv_next;     	// Dummy link
+ *   msg_param_t const *priv_values;   	// List of privacy values
  * } sip_privacy_t;
  * @endcode
  */
@@ -752,10 +752,10 @@
 
 #define sip_privacy_update NULL
 
-msg_hclass_t sip_privacy_class[] = 
+msg_hclass_t sip_privacy_class[] =
 SIP_HEADER_CLASS(privacy, "Privacy", "", priv_values, single, privacy);
 
-static 
+static
 issize_t sip_privacy_token_scan(char *start)
 {
   char *s = start;
@@ -811,7 +811,7 @@
   }
 
   MSG_TERM_E(b, end);
-    
+
   return b - b0;
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_session.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_session.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_session.c	Tue Dec 23 07:37:03 2008
@@ -52,9 +52,9 @@
 
 /**@SIP_HEADER sip_session_expires Session-Expires Header
  *
- * The Session-Expires header is used to convey the lifetime of the session. 
+ * The Session-Expires header is used to convey the lifetime of the session.
  * Its syntax is defined in @RFC4028 as follows:
- * 
+ *
  * @code
  *      Session-Expires  =  ("Session-Expires" | "x") HCOLON delta-seconds
  *                           *(SEMI se-params)
@@ -78,7 +78,7 @@
  *  sip_common_t    x_common[1];
  *  sip_unknown_t  *x_next;
  *  unsigned long   x_delta; //Delta Seconds
- *  msg_param_t    *x_params; 
+ *  msg_param_t    *x_params;
  *  char const     *x_refresher; //Who will send the refresh UAS or UAC
  * } sip_session_expires_t;
  * @endcode
@@ -89,7 +89,7 @@
 static msg_update_f sip_session_expires_update;
 
 msg_hclass_t sip_session_expires_class[] =
-SIP_HEADER_CLASS(session_expires, "Session-Expires", "x", x_params, single, 
+SIP_HEADER_CLASS(session_expires, "Session-Expires", "x", x_params, single,
 		 session_expires);
 
 issize_t sip_session_expires_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
@@ -113,7 +113,7 @@
   sip_session_expires_t const *o = h->sh_session_expires;
 
   n = snprintf(b, bsiz, "%lu", o->x_delta);
-  b += n; 
+  b += n;
   MSG_PARAMS_E(b, end, o->x_params, flags);
 
   return b - b0;
@@ -124,11 +124,11 @@
   sip_session_expires_t const *o = h->sh_session_expires;
 
   MSG_PARAMS_SIZE(offset, o->x_params);
-   
+
   return offset;
 }
 
-/** Duplicate one #sip_session_expires_t object */ 
+/** Duplicate one #sip_session_expires_t object */
 char *sip_session_expires_dup_one(sip_header_t *dst, sip_header_t const *src,
 				  char *b, isize_t xtra)
 {
@@ -144,7 +144,7 @@
 }
 
 /** Update parameters in @SessionExpires header. */
-static int sip_session_expires_update(msg_common_t *h, 
+static int sip_session_expires_update(msg_common_t *h,
 				      char const *name, isize_t namelen,
 				      char const *value)
 {
@@ -153,7 +153,7 @@
   if (name == NULL) {
     x->x_refresher = NULL;
   }
-  else if (namelen == strlen("refresher") && 
+  else if (namelen == strlen("refresher") &&
 	   !strncasecmp(name, "refresher", namelen)) {
     x->x_refresher = value;
   }
@@ -167,7 +167,7 @@
  *
  * The Min-SE header is used to indicate the minimum value for the session
  * interval. Its syntax is defined in @RFC4028 as follows:
- * 
+ *
  * @code
  *      MMin-SE  =  "Min-SE" HCOLON delta-seconds *(SEMI generic-param)
  * @endcode
@@ -221,7 +221,7 @@
   sip_min_se_t const *o = (sip_min_se_t *)h;
 
   n = snprintf(b, bsiz, "%lu", o->min_delta);
-  b += n; 
+  b += n;
   MSG_PARAMS_E(b, end, o->min_params, flags);
 
   return b - b0;
@@ -232,11 +232,11 @@
   sip_min_se_t const *o = (sip_min_se_t *)h;
 
   MSG_PARAMS_SIZE(offset, o->min_params);
-   
+
   return offset;
 }
 
-/** Duplicate one #sip_min_se_t object */ 
+/** Duplicate one #sip_min_se_t object */
 char *sip_min_se_dup_one(sip_header_t *dst, sip_header_t const *src,
 			char *b, isize_t xtra)
 {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_status.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_status.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_status.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@ingroup sip_status_codes
  * @CFILE sip_status.c
- * 
+ *
  * SIP status codes and standard phrases.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
@@ -37,22 +37,22 @@
 #include <stddef.h>
 #include <sofia-sip/sip_status.h>
 
-char const 
+char const
   sip_100_Trying[] =                   "Trying",
   sip_180_Ringing[] =                  "Ringing",
   sip_181_Call_is_being_forwarded[] =  "Call Is Being Forwarded",
   sip_182_Queued[] =                   "Queued",
   sip_183_Session_progress[] =         "Session Progress",
-  
+
   sip_200_OK[] =                       "OK",
   sip_202_Accepted[] =                 "Accepted",
-  
+
   sip_300_Multiple_choices[] =         "Multiple Choices",
   sip_301_Moved_permanently[] =        "Moved Permanently",
   sip_302_Moved_temporarily[] =        "Moved Temporarily",
   sip_305_Use_proxy[] =                "Use Proxy",
   sip_380_Alternative_service[] =      "Alternative Service",
-  
+
   sip_400_Bad_request[] =              "Bad Request",
   sip_401_Unauthorized[] =             "Unauthorized",
   sip_402_Payment_required[] =         "Payment Required",
@@ -75,7 +75,7 @@
   sip_421_Extension_required[] =       "Extension Required",
   sip_422_Session_timer[] =            "Session Interval Too Small",
   sip_423_Interval_too_brief[] =       "Interval Too Brief",
-  
+
   sip_480_Temporarily_unavailable[] =  "Temporarily Unavailable",
   sip_481_No_transaction[] =           "Call/Transaction Does Not Exist",
   sip_482_Loop_detected[] =            "Loop Detected",
@@ -114,13 +114,13 @@
  * empty string "" is returned.
  *
  * @param status well-known status code in range 100..699
- * 
+ *
  * @return
  * A response message corresponding to status code, or NULL upon an error.
  */
 char const *sip_status_phrase(int status)
 {
-  if (status < 100 || status > 699) 
+  if (status < 100 || status > 699)
     return NULL;
 
   switch (status) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_tag.c.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_tag.c.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_tag.c.in	Tue Dec 23 07:37:03 2008
@@ -87,7 +87,7 @@
 };
 
 /** List of all string tags for SIP headers  */
-tag_type_t sip_tag_str_list[] = 
+tag_type_t sip_tag_str_list[] =
 {
   siptag_#xxxxxx#_str,
   NULL

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_tag_class.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_tag_class.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_tag_class.c	Tue Dec 23 07:37:03 2008
@@ -23,7 +23,7 @@
  */
 
 /**@SIP_TAG
- * 
+ *
  * @CFILE sip_tag_class.c  SIP Tag classes
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
@@ -54,7 +54,7 @@
  * Tags in this class are not automatically added to the message with
  * sip_add_tl() or sip_add_tagis().
  */
-tag_class_t sipexthdrtag_class[1] = 
+tag_class_t sipexthdrtag_class[1] =
   {{
     sizeof(siphdrtag_class),
     /* tc_next */     NULL,
@@ -72,7 +72,7 @@
 
 
 /** Tag class for SIP header tags. @HIDE */
-tag_class_t siphdrtag_class[1] = 
+tag_class_t siphdrtag_class[1] =
   {{
     sizeof(siphdrtag_class),
     /* tc_next */     NULL,
@@ -89,7 +89,7 @@
   }};
 
 /** Tag class for SIP header string tags. @HIDE */
-tag_class_t sipstrtag_class[1] = 
+tag_class_t sipstrtag_class[1] =
   {{
     sizeof(sipstrtag_class),
     /* tc_next */     NULL,
@@ -106,7 +106,7 @@
   }};
 
 /** Tag class for SIP message tags. @HIDE */
-tag_class_t sipmsgtag_class[1] = 
+tag_class_t sipmsgtag_class[1] =
   {{
     sizeof(sipmsgtag_class),
     /* tc_next */     NULL,
@@ -125,16 +125,16 @@
 /** Filter a for SIP header tag.
  *
  * @param[in] dst tag list for filtering result. May be NULL.
- * @param[in] f   filter tag 
- * @param[in] src tag item from source list. 
- * @param[in,out] bb pointer to pointer of mempory area used to dup 
+ * @param[in] f   filter tag
+ * @param[in] src tag item from source list.
+ * @param[in,out] bb pointer to pointer of mempory area used to dup
  *                   the filtering result
  *
  * This function is also used to calculate size for filtering result.
  */
 tagi_t *siptag_filter(tagi_t *dst,
 		      tagi_t const f[],
-		      tagi_t const *src, 
+		      tagi_t const *src,
 		      void **bb)
 {
   tagi_t stub[2] = {{ NULL }};
@@ -154,7 +154,7 @@
       return dst;
 
     hh = (sip_header_t const **)
-      msg_hclass_offset((msg_mclass_t *)sip->sip_common->h_class, 
+      msg_hclass_offset((msg_mclass_t *)sip->sip_common->h_class,
 			(msg_pub_t *)sip, hc);
 
     /* Is header present in the SIP message? */
@@ -242,7 +242,7 @@
 	    msg_header_remove(msg, (msg_pub_t *)sip, *hh);
 	}
 	continue;
-      } 
+      }
 
       if (tag == siptag_header)
 	hc = h->sh_class;
@@ -288,13 +288,13 @@
  *
  * @par Example
  * @code
- * url->url_headers = 
+ * url->url_headers =
  *   sip_headers_as_url_query(home, SIPTAG_REPLACES(replaces), TAG_END());
  * @endcode
- * 
+ *
  * @since New in @VERSION_1_12_4.
  *
- * @sa 
+ * @sa
  * url_query_as_header_string(), sip_url_query_as_taglist(),
  * nta_msg_request_complete(),
  * @RFC3261 section 19.1.1 "Headers", #url_t, url_s#url_headers
@@ -383,12 +383,12 @@
     for (;*n; n++)
       if (isupper(*n))
 	*n = tolower(*n);
-    
+
     slen = strlen(s); elen = url_esclen(s, HNV_RESERVED);
 
     if ((size_t)elen == slen)
       return su_strlst_append(l, s);
-    
+
     escaped = su_alloc(lhome, elen + 1);
     if (escaped)
       return su_strlst_append(l, url_escape(escaped, s, HNV_RESERVED));
@@ -403,9 +403,9 @@
  * Unknown headers are encoded as SIPTAG_HEADER_STR().
  *
  * @param home memory home used to alloate string (if NULL, malloc() it)
- * @param query query part from SIP URL 
+ * @param query query part from SIP URL
  * @param parser optional SIP parser used
- * 
+ *
  * @sa sip_add_tl(), sip_add_tagis(), SIPTAG_HEADER_STR(),
  * sip_headers_as_url_query(), url_query_as_header_string(),
  * @RFC3261 section 19.1.1 "Headers", #url_t, url_s#url_headers

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_time.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_time.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_time.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@CFILE sip_time.c 
+/**@CFILE sip_time.c
  * @brief SIP time handling
  *
  * Functions for handling time and dates in SIP.
@@ -53,7 +53,7 @@
 
 /**@ingroup sip_expires
  *
- * Calculate the expiration time for a SIP @Contact. 
+ * Calculate the expiration time for a SIP @Contact.
  *
  * @param m     @Contact header
  * @param ex    @Expires header
@@ -66,8 +66,8 @@
  *
  * @note If @a now is 0, the function gets the current time using sip_now().
  *
- * @return 
- *   The expiration time in seconds. 
+ * @return
+ *   The expiration time in seconds.
  */
 sip_time_t sip_contact_expires(sip_contact_t const *m,
 			       sip_expires_t const *ex,
@@ -92,7 +92,7 @@
   }
 
   if (time) {
-    if (date) 
+    if (date)
       now = date->d_time;
     else if (now == 0)
       now = sip_now();

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_util.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_util.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sip_util.c	Tue Dec 23 07:37:03 2008
@@ -23,7 +23,7 @@
  */
 
 /**@CFILE sip_util.c
- * 
+ *
  * SIP utility functions.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
@@ -59,7 +59,7 @@
 #include <limits.h>
 #include <ctype.h>
 
-/** 
+/**
  * Compare two SIP addresses ( @From or @To headers).
  *
  * @retval nonzero if matching.
@@ -68,12 +68,12 @@
 int sip_addr_match(sip_addr_t const *a, sip_addr_t const *b)
 {
   return
-    (a->a_tag == NULL || b->a_tag == NULL || 
+    (a->a_tag == NULL || b->a_tag == NULL ||
      strcmp(a->a_tag, b->a_tag) == 0)
     &&
-    str0casecmp(a->a_host, b->a_host) == 0 
+    str0casecmp(a->a_host, b->a_host) == 0
     &&
-    str0cmp(a->a_user, b->a_user) == 0 
+    str0cmp(a->a_user, b->a_user) == 0
     &&
     str0cmp(a->a_url->url_scheme, b->a_url->url_scheme);
 }
@@ -142,14 +142,14 @@
  * parameter is included in the URI unless the transport protocol is UDP.
  *
  * @param home      memory home
- * @param v         @Via header field structure 
+ * @param v         @Via header field structure
  *                  (with <sent-protocol> and <sent-by> parameters)
  * @param user      username for @Contact URI (may be NULL)
  *
  * @retval contact header structure
  * @retval NULL upon an error
  *
- * @sa sip_contact_create_from_via_with_transport(), 
+ * @sa sip_contact_create_from_via_with_transport(),
  *     sip_contact_string_from_via()
  */
 sip_contact_t *
@@ -297,12 +297,12 @@
 }
 
 /**Perform sanity check on a SIP message
- * 
- * Check that the SIP message has all the mandatory fields. 
+ *
+ * Check that the SIP message has all the mandatory fields.
  *
  * @param sip SIP message to be checked
  *
- * @return 
+ * @return
  * When the SIP message fulfills the minimum requirements, return zero,
  * otherwise a negative status code.
  */
@@ -331,7 +331,7 @@
 	return -1;
       break;
 
-    case url_tel: 
+    case url_tel:
       if (!ruri->url_user || strlen(ruri->url_user) == 0)
 	return -1;
       break;
@@ -354,7 +354,7 @@
  * string is modified when parsing. The home is used to allocate extra
  * memory required when parsing, e.g., for parameter list or when there
  * string contains multiple header fields.
- * 
+ *
  * @deprecated
  * Use msg_header_make() or header-specific make functions, e.g.,
  * sip_via_make().
@@ -370,9 +370,9 @@
 
     for (n = slen; n >= 1 && IS_LWS(s[n - 1]); n--)
       ;
-    
+
     s[n] = '\0';
-    
+
     assert(SIP_HDR_TEST(h));
 
     return h->sh_class->hc_parse(home, h, s, slen);
@@ -416,9 +416,9 @@
     if (n > -1 && n + 1 <= len)
       break;
     if (n > -1)			/* glibc >2.1 */
-      len = n + 1;		
+      len = n + 1;
     else			/* glibc 2.0 */
-      len *= 2;			
+      len *= 2;
   }
 
   return rv;
@@ -434,7 +434,7 @@
     return h->sh_class->hc_dxtra(h, h->sh_class->hc_size);
 }
 
-/** Duplicate a url or make a url out of string. 
+/** Duplicate a url or make a url out of string.
  * @deprecated Use url_hdup() instead.
  */
 url_t *sip_url_dup(su_home_t *home, url_t const *o)
@@ -443,13 +443,13 @@
 }
 
 /**Calculate Q value.
- * 
+ *
  * Convert q-value string @a q to numeric value
  * in range (0..1000).  Q values are used, for instance, to describe
  * relative priorities of registered contacts.
  *
  * @param q q-value string <code>("1" | "." 1,3DIGIT)</code>
- * 
+ *
  * @return An integer in range 0 .. 1000.
  */
 unsigned sip_q_value(char const *q)
@@ -466,7 +466,7 @@
     return 1000;
   if (q[0] == '\0')
     return 0;
-  if (q[0] != '.')      
+  if (q[0] != '.')
     return 500;    /* Garbage... */
 
   if (q[1] >= '0' && q[1] <= '9') {
@@ -478,7 +478,7 @@
 	if (q[4] > '5' && q[4] <= '9')
 	  /* Round upwards */
 	  value += 1;
-	else if (q[4] == '5') 
+	else if (q[4] == '5')
 	  value += value & 1; /* Round to even */
       }
     }
@@ -490,7 +490,7 @@
 
 /**@ingroup sip_route
  *
- * Get first route header and remove it from its fragment chain. 
+ * Get first route header and remove it from its fragment chain.
  *
  */
 sip_route_t *sip_route_remove(msg_t *msg, sip_t *sip)
@@ -505,14 +505,14 @@
 
 /**@ingroup sip_route
  *
- * Get last route header and remove it from its fragment chain. 
+ * Get last route header and remove it from its fragment chain.
  *
  */
 sip_route_t *sip_route_pop(msg_t *msg, sip_t *sip)
 {
   sip_route_t *r;
 
-  for (r = sip->sip_route; r; r = r->r_next) 
+  for (r = sip->sip_route; r; r = r->r_next)
     if (r->r_next == NULL) {
       msg_header_remove(msg, (msg_pub_t *)sip, (msg_header_t *)r);
       return r;
@@ -524,13 +524,13 @@
 
 /**@ingroup sip_route
  *
- * Get first route header and rewrite the RequestURI. 
+ * Get first route header and rewrite the RequestURI.
  */
 sip_route_t *sip_route_follow(msg_t *msg, sip_t *sip)
 {
   if (sip->sip_route) {
-    /* XXX - in case of outbound proxy, route may contain our address */ 
-      
+    /* XXX - in case of outbound proxy, route may contain our address */
+
     sip_route_t *r = sip_route_remove(msg, sip);
     sip_request_t *rq = sip->sip_request;
 
@@ -546,12 +546,12 @@
 }
 
 /**@ingroup sip_route
- * 
+ *
  * Check if route header has lr param.
  *
  * "lr" param can be either URL or header parameter.
  */
-int 
+int
 sip_route_is_loose(sip_route_t const *r)
 {
   if (!r)
@@ -566,7 +566,7 @@
  *
  * Reverse a route header (@Route, @RecordRoute, @Path, @ServiceRoute).
  */
-sip_route_t *sip_route_reverse_as(su_home_t *home, 
+sip_route_t *sip_route_reverse_as(su_home_t *home,
 				  msg_hclass_t *hc,
 				  sip_route_t const *route)
 {
@@ -580,8 +580,8 @@
     *r->r_url = *route->r_url;
     /* Fix broken (Record-)Routes without <> */
     if (r->r_url->url_params == NULL
-	&& r->r_params 
-	&& r->r_params[0] 
+	&& r->r_params
+	&& r->r_params[0]
 	&& (r->r_params[0][0] == 'l' || r->r_params[0][0] == 'L')
 	&& (r->r_params[0][1] == 'r' || r->r_params[0][1] == 'R')
 	&& (r->r_params[0][2] == '=' || r->r_params[0][2] == 0))
@@ -590,7 +590,7 @@
     else
       r->r_params = route->r_params;
     tmp = (sip_route_t *)msg_header_dup_as(home, hc, (msg_header_t *)r);
-    if (!tmp) 
+    if (!tmp)
       goto error;
     tmp->r_next = reverse;
     reverse = tmp;
@@ -606,7 +606,7 @@
 
 /**@ingroup sip_route
  *
- * Reverse a @Route header. 
+ * Reverse a @Route header.
  *
  * Reverse A route header like @RecordRoute or @Path.
  */
@@ -634,8 +634,8 @@
     *r->r_url = *route->r_url;
     /* Fix broken (Record-)Routes without <> */
     if (r->r_url->url_params == NULL
-	&& r->r_params 
-	&& r->r_params[0] 
+	&& r->r_params
+	&& r->r_params[0]
 	&& (r->r_params[0][0] == 'l' || r->r_params[0][0] == 'L')
 	&& (r->r_params[0][1] == 'r' || r->r_params[0][1] == 'R')
 	&& (r->r_params[0][2] == '=' || r->r_params[0][2] == 0))
@@ -658,7 +658,7 @@
 
 /**@ingroup sip_route
  *
- * Fix and duplicate a @Route header. 
+ * Fix and duplicate a @Route header.
  *
  * Copy a route header like @RecordRoute or @Path as @Route.
  *
@@ -698,14 +698,14 @@
 
   for (r = route; r; r = r->r_next) {
     /* Keep track of first header structure on this header line */
-    if (!h 
+    if (!h
 	|| (char *)h->sh_data + h->sh_len != r->r_common->h_data
 	|| r->r_common->h_len)
       h = (sip_header_t *)r;
 
     if (r->r_url->url_params == NULL
-	&& r->r_params 
-	&& r->r_params[0] 
+	&& r->r_params
+	&& r->r_params[0]
 	&& (r->r_params[0][0] == 'l' || r->r_params[0][0] == 'L')
 	&& (r->r_params[0][1] == 'r' || r->r_params[0][1] == 'R')
 	&& (r->r_params[0][2] == '=' || r->r_params[0][2] == 0)) {
@@ -723,7 +723,7 @@
 
 /**@ingroup sip_via
  *
- * Get first via header and remove it from its fragment chain. 
+ * Get first via header and remove it from its fragment chain.
  */
 sip_via_t *sip_via_remove(msg_t *msg, sip_t *sip)
 {
@@ -731,7 +731,7 @@
 
   if (sip == NULL)
     return NULL;
-  
+
   for (v = sip->sip_via; v; v = v->v_next) {
     sip_fragment_clear(v->v_common);
 
@@ -762,12 +762,12 @@
   return total;
 }
 
-/** 
+/**
  * Remove extra parameters from an AOR URL.
  *
  * The extra parameters listed in the @RFC3261 table 1 include port number,
  * method, maddr, ttl, transport, lr and headers.
- * 
+ *
  * @note The funtion modifies the @a url and the strings attached to it.
  *
  * @retval 0 when successful
@@ -783,9 +783,9 @@
 
   if (url->url_params)
     url_strip_transport(url);
-    
+
   if (url->url_params)
-    url->url_params = 
+    url->url_params =
       url_strip_param_string((char *)url->url_params, "lr");
 
   return 0;
@@ -809,7 +809,7 @@
   for (;;s = s->sa_next, v = v->sa_next) {
     if (s == NULL || v == NULL)
       return (s == NULL) - (v == NULL);
-    
+
     if ((retval = str0cmp(s->sa_mec, v->sa_mec)))
       return retval;
 
@@ -827,7 +827,7 @@
     }
 
     for (i = 0, j = 0;; i++, j++) {
-      if (digest && v_params[j] && 
+      if (digest && v_params[j] &&
 	  strncasecmp(v_params[j], "d-ver=", 6) == 0) {
 	if (return_d_ver)
 	  *return_d_ver = v_params[j] + strlen("d-ver=");
@@ -835,8 +835,8 @@
       }
 
       retval = str0cmp(s_params[i], v_params[j]);
-      
-      if (retval || s_params[i] == NULL || v_params[j] == NULL) 
+
+      if (retval || s_params[i] == NULL || v_params[j] == NULL)
 	break;
     }
 
@@ -845,7 +845,7 @@
   }
 }
 
-/** Select best mechanism from @SecurityClient header. 
+/** Select best mechanism from @SecurityClient header.
  *
  * @note We assume that @SecurityServer header in @a s is sorted by
  * preference.
@@ -871,11 +871,11 @@
 
 /**Checks if the response with given response code terminates dialog or
  * dialog usage.
- * 
+ *
  * @return -1 if the response with given code terminates whole dialog.
  * @return 1 if the response terminates the dialog usage.
  * @return 0 if the response does not terminate dialog or dialog usage.
- * 
+ *
  * @return
  * The @a *return_graceful_terminate_usage is set to 1, if application
  * should gracefully terminate its dialog usage. It is set to 0, if no
@@ -892,25 +892,25 @@
   enum { no_effect, terminate_usage = 1, terminate_dialog = -1 };
   int dummy;
 
-  if (!return_graceful_terminate_usage) 
+  if (!return_graceful_terminate_usage)
     return_graceful_terminate_usage = &dummy;
 
   if (response_code < 300)
     return *return_graceful_terminate_usage = 0;
 
-  /*  
+  /*
       3xx responses: Redirection mid-dialog is not well understood in SIP,
       but whatever effect it has impacts the entire dialog and all of
       its usages equally.  In our example scenario, both the
       subscription and the invite usage would be redirected by this
       single response.
   */
-  if (response_code < 400) 
+  if (response_code < 400)
     return *return_graceful_terminate_usage = 0;
 
   if (response_code < 500) switch (response_code) {
   default:
-  case 400: /** @par 400 and unrecognized 4xx responses 
+  case 400: /** @par 400 and unrecognized 4xx responses
 
       These responses affect only the NOTIFY transaction, not the
       subscription, the dialog it resides in (beyond affecting the local
@@ -921,16 +921,16 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 401: 
+  case 401:
   case 407: /** @par 401 Unauthorized and 407 Proxy Authentication Required
 
       This request, not the subscription or dialog, is being challenged. The
       usages and dialog are not terminated.
-    */ 
+    */
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 402: /** @par 402 Payment Required 
+  case 402: /** @par 402 Payment Required
 
       This is a reserved response code. If encountered, it should be
       treated as an unrecognized 4xx.
@@ -938,7 +938,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 403: /** @par 403 Forbidden 
+  case 403: /** @par 403 Forbidden
 
       This response terminates the subscription, but has no effect on
       any other usages of the dialog. In our example scenario, the
@@ -948,8 +948,8 @@
     */
     *return_graceful_terminate_usage = 0;
     return 0;
-    
-  case 404: /** @par 404 Not Found 
+
+  case 404: /** @par 404 Not Found
 
       This response destroys the dialog and all usages sharing it. The
       Request-URI that is being 404ed is the remote target set by the
@@ -958,7 +958,7 @@
     */
     return terminate_dialog;
 
-  case 405: /** @par 405 Method Not Allowed 
+  case 405: /** @par 405 Method Not Allowed
 
       In our example scenario, this response destroys the subscription,
       but not the invite usage or the dialog. It's an aberrant case for
@@ -977,9 +977,9 @@
       return 0;
     }
 
-  case 406: /** @par 406 Not Acceptable 
+  case 406: /** @par 406 Not Acceptable
 
-      These responses concern details of the message in the transaction. 
+      These responses concern details of the message in the transaction.
       Subsequent requests in this same usage may succeed. Neither the
       usage nor dialog is terminated, other usages sharing this dialog
       are unaffected.
@@ -987,7 +987,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 408: /** @par 408 Request Timeout 
+  case 408: /** @par 408 Request Timeout
 
       Receiving a 408 will have the same effect on
       usages and dialogs as a real transaction timeout as described in
@@ -995,7 +995,7 @@
     */
     return terminate_usage;
 
-  case 410: /** @par 410 Gone 
+  case 410: /** @par 410 Gone
 
       This response destroys the dialog and all usages sharing
       it.  The Request-URI that is being rejected is the remote target
@@ -1007,13 +1007,13 @@
     */
     return terminate_dialog;
 
-  case 412: /* Conditional Request Failed: */ 
+  case 412: /* Conditional Request Failed: */
   case 413: /* Request Entity Too Large: */
   case 414: /* Request-URI Too Long: */
   case 415: /* Unsupported Media Type: */
-    /** @par 412, 413, 414 and 415 
+    /** @par 412, 413, 414 and 415
 
-      These responses concern details of the message in the transaction. 
+      These responses concern details of the message in the transaction.
       Subsequent requests in this same usage may succeed. Neither the usage
       nor dialog is terminated, other usages sharing this dialog are
       unaffected.
@@ -1021,7 +1021,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 416: /** @par 416 Unsupported URI Scheme 
+  case 416: /** @par 416 Unsupported URI Scheme
 
       Similar to 404 and 410, this response
       came to a request whose Request-URI was provided by the peer in a
@@ -1038,7 +1038,7 @@
       @CSeq.  No other usages of the dialog are affected.
     */
 
-  case 420: /* Bad Extension */ 
+  case 420: /* Bad Extension */
   case 421: /* Extension Required */
 
     /** @par 420 Bad Extension and 421 Extension Required
@@ -1060,7 +1060,7 @@
       usages are unaffected.
     */
 
-  case 423: /** @par 423 Interval Too Brief 
+  case 423: /** @par 423 Interval Too Brief
 
       This response won't happen in our example
       scenario, but if it came in response to a re-SUBSCRIBE, the
@@ -1075,11 +1075,11 @@
       affected by a change in its local @CSeq.  No other usages of the
       dialog are affected. */
 
-  case 429: /** @par 429 Provide Referrer Identity 
+  case 429: /** @par 429 Provide Referrer Identity
 
       This response won't be returned to a NOTIFY as in our example
       scenario, but when it is returned to a REFER, it is objecting to
-      the REFER request itself, not any usage the REFER occurs within. 
+      the REFER request itself, not any usage the REFER occurs within.
       The usage is unaffected. Any other usages sharing this dialog are
       unaffected. The dialog is only affected by a change in its local
       @CSeq.
@@ -1087,7 +1087,7 @@
 
   case 436: case 437: case 438:
     /** @par 436 Bad Identity-Info, 437 Unsupported Certificate, 438 Invalid \
-     *  Identity Header 
+     *  Identity Header
      *
      * These responses object to the request, not the usage.
      * The usage is not affected.  The dialog is only affected by a
@@ -1110,7 +1110,7 @@
     return terminate_usage;
 
 
-  case 481: /** @par 481 Call/Transaction Does Not Exist 
+  case 481: /** @par 481 Call/Transaction Does Not Exist
 
       This response indicates that the peer has lost its copy of the dialog
       state. The dialog and any usages sharing it are destroyed.
@@ -1136,7 +1136,7 @@
     return terminate_usage;
 
 
-  case 482: /** @par 482 Loop Detected 
+  case 482: /** @par 482 Loop Detected
 
       This response is aberrant mid-dialog.  It will
       only occur if the @RecordRoute header field was improperly
@@ -1144,12 +1144,12 @@
       initial usage, or if a mid-dialog request forks and merges (which
       should never happen).  Future requests using this dialog state
       will also fail.  The dialog and any usages sharing it are
-      destroyed.  
+      destroyed.
     */
     return terminate_dialog;
 
 
-  case 483: /** @par 483 Too Many Hops 
+  case 483: /** @par 483 Too Many Hops
 
       Similar to 482, receiving this mid-dialog is
       aberrant.  Unlike 482, recovery may be possible by increasing
@@ -1158,7 +1158,7 @@
       than it used for an initial request).  If the request isn't tried
       with an increased @MaxForwards, then the agent should attempt to
       gracefully terminate this usage and all other usages that share
-      its dialog.  
+      its dialog.
     */
     *return_graceful_terminate_usage = 1;
     return 0;
@@ -1174,7 +1174,7 @@
     */
     return terminate_dialog;
 
-  case 486: /** @par 486 Busy Here 
+  case 486: /** @par 486 Busy Here
 
       This response is non-sensical in our example scenario,
       or in any scenario where this response comes inside an established
@@ -1190,7 +1190,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 487: /** @par 487 Request Terminated 
+  case 487: /** @par 487 Request Terminated
 
       This response speaks to the disposition of a
       particular request (transaction).  The usage in which that request
@@ -1201,7 +1201,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 488: /** @par 488 Not Acceptable Here 
+  case 488: /** @par 488 Not Acceptable Here
 
       This response is objecting to the request,
       not the usage.  The usage is not affected.  The dialog is only
@@ -1211,7 +1211,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 489: /** @par 489 Bad Event 
+  case 489: /** @par 489 Bad Event
 
       In our example scenario, @RFC3265 declares that the
       subscription usage in which the NOTIFY is sent is terminated.  The
@@ -1224,7 +1224,7 @@
     *return_graceful_terminate_usage = 0;
     return method == sip_method_notify ? terminate_usage : no_effect;
 
-  case 491: /** @par 491 Request Pending 
+  case 491: /** @par 491 Request Pending
 
       This response addresses in-dialog request glare.
       Its affect is scoped to the request.  The usage in which the
@@ -1235,7 +1235,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 493: /** @par 493 Undecipherable 
+  case 493: /** @par 493 Undecipherable
 
       This response objects to the request, not the
       usage.  The usage is not affected.  The dialog is only affected by
@@ -1245,7 +1245,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 494: /** @par 494 Security Agreement Required 
+  case 494: /** @par 494 Security Agreement Required
 
       This response is objecting to the
       request, not the usage.  The usage is not affected.  The dialog is
@@ -1278,7 +1278,7 @@
     /* Do not change *return_graceful_terminate_usage */
     return 0;
 
-  case 501: /** @par 501 Not Implemented 
+  case 501: /** @par 501 Not Implemented
 
       This would be a degenerate response in our
       example scenario since the NOTIFY is being sent as part of an
@@ -1294,7 +1294,7 @@
     /* Do not change *return_graceful_terminate_usage */
     return 0;
 
-  case 502: /** @par 502 Bad Gateway 
+  case 502: /** @par 502 Bad Gateway
 
       This response is aberrant mid-dialog. It will only occur if the
       @RecordRoute header field was improperly constructed by the
@@ -1304,7 +1304,7 @@
     */
     return terminate_dialog;
 
-  case 503: /** @par 503 Service Unavailable 
+  case 503: /** @par 503 Service Unavailable
 
       As per @RFC3263, the logic handling locating SIP servers for
       transactions may handle 503 requests (effectively sequentially
@@ -1321,7 +1321,7 @@
     /* Do not change *return_graceful_terminate_usage */
     return 0;
 
-  case 504: /** @par 504 Server Time-out 
+  case 504: /** @par 504 Server Time-out
 
       It is not obvious under what circumstances this
       response would be returned to a request in an existing dialog.  If
@@ -1342,7 +1342,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 580: /** @par 580 Precondition Failure 
+  case 580: /** @par 580 Precondition Failure
 
       This response is objecting to the request,
       not the usage.  The usage is not affected.  The dialog is only
@@ -1360,7 +1360,7 @@
 
       Unlike 400 Bad Request, a 600 response code says something about
       the recipient user, not the request that was made. This end user
-      is stating an unwillingness to communicate. 
+      is stating an unwillingness to communicate.
 
       If the response contains a @RetryAfter header field value, the
       user is indicating willingness to communicate later and the
@@ -1378,7 +1378,7 @@
     /* Do not change graceful_terminate */
     return 0;
 
-  case 603: /** @par 603 Decline 
+  case 603: /** @par 603 Decline
 
       This response declines the action indicated by the
       associated request.  It can be used, for example, to decline a
@@ -1389,7 +1389,7 @@
     *return_graceful_terminate_usage = 0;
     return 0;
 
-  case 604: /** @par 604 Does Not Exist Anywhere 
+  case 604: /** @par 604 Does Not Exist Anywhere
 
       Like 404, this response destroys the
       dialog and all usages sharing it.  The Request-URI that is being
@@ -1399,7 +1399,7 @@
     */
     return terminate_dialog;
 
-  case 606: /** @par 606 Not Acceptable 
+  case 606: /** @par 606 Not Acceptable
 
       This response is objecting to aspects of the
       associated request, not the usage the request appears in.  The

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h	Tue Dec 23 07:37:03 2008
@@ -26,8 +26,8 @@
 /** Defined when <sofia-sip/sip.h> has been included. */
 #define SIP_H
 
-/**@file sofia-sip/sip.h 
- * 
+/**@file sofia-sip/sip.h
+ *
  * SIP objects.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
@@ -185,7 +185,7 @@
 typedef msg_list_t	     	    sip_require_t;
 typedef struct sip_retry_after_s    sip_retry_after_t;
 typedef struct sip_route_s     	    sip_route_t;
-typedef struct sip_rseq_s           sip_rseq_t;     
+typedef struct sip_rseq_s           sip_rseq_t;
 typedef struct msg_generic_s        sip_server_t;
 typedef struct sip_session_expires_s
                                     sip_session_expires_t;
@@ -256,7 +256,7 @@
   sip_rack_t                *sip_rack;          /**< RAck */
 
   /* Caller Preferences */
-  sip_request_disposition_t *sip_request_disposition; 
+  sip_request_disposition_t *sip_request_disposition;
                                                 /**< Request-Disposition (d) */
   sip_accept_contact_t      *sip_accept_contact;/**< Accept-Contact (a) */
   sip_reject_contact_t      *sip_reject_contact;/**< Reject-Contact (j) */
@@ -288,7 +288,7 @@
   /* RFC 3265 */
   sip_event_t               *sip_event;	        /**< Event (o) */
   sip_allow_events_t        *sip_allow_events;  /**< Allow-Events (u) */
-  sip_subscription_state_t  *sip_subscription_state; 
+  sip_subscription_state_t  *sip_subscription_state;
 				/**< Subscription-State */
 
   sip_proxy_authenticate_t  *sip_proxy_authenticate;
@@ -297,7 +297,7 @@
 				/**< Proxy-Authentication-Info */
   sip_proxy_authorization_t *sip_proxy_authorization;
 				/**< Proxy-Authorization */
-  sip_authorization_t       *sip_authorization;       
+  sip_authorization_t       *sip_authorization;
 				/**< Authorization */
   sip_www_authenticate_t    *sip_www_authenticate;
 				/**< WWW-Authenticate */
@@ -333,17 +333,17 @@
   /* Entity headers */
   sip_mime_version_t        *sip_mime_version;	/**< MIME-Version */
   sip_content_type_t        *sip_content_type;	/**< Content-Type (c) */
-  sip_content_encoding_t    *sip_content_encoding; 
+  sip_content_encoding_t    *sip_content_encoding;
 				/**< Content-Encoding (e) */
   sip_content_language_t    *sip_content_language; /**< Content-Language */
-  sip_content_disposition_t *sip_content_disposition; 
+  sip_content_disposition_t *sip_content_disposition;
 				/**< Content-Disposition */
   sip_content_length_t      *sip_content_length;/**< Content-Length (l) */
 
   /* === Headers end here */
 
   sip_unknown_t             *sip_unknown;       /**< Unknown headers */
-  sip_separator_t           *sip_separator;     
+  sip_separator_t           *sip_separator;
 				/**< Separator between headers and payload */
   sip_payload_t             *sip_payload;	/**< Message payload */
   msg_multipart_t           *sip_multipart;     /**< Multipart MIME payload */
@@ -386,7 +386,7 @@
   url_t              a_url[1];	    /**< URL */
   msg_param_t const *a_params;	    /**< Parameter table  */
   char const        *a_comment;	    /**< Comment */
- 
+
   char const        *a_tag;	    /**< Tag parameter */
 };
 
@@ -416,7 +416,7 @@
   msg_common_t       k_common[1];   /**< Common fragment info */
   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. 
+  uint32_t           k_bitmap;	    /**< Bitmap of allowed methods.
 				       @NEW_1_12_5. */
 };
 
@@ -432,10 +432,10 @@
   msg_param_t const  *ai_params;    /**< List of authentication info */
 };
 
-/**@ingroup sip_call_id 
+/**@ingroup sip_call_id
  * @brief Structure for @CallID (and @InReplyTo) header fields.
  */
-struct sip_call_id_s {		
+struct sip_call_id_s {
   sip_common_t   i_common[1];	    /**< Common fragment info */
   sip_call_id_t *i_next;	    /**< Link to next (In-Reply-To) */
   char const    *i_id;		    /**< ID value */
@@ -531,7 +531,7 @@
 /**@ingroup sip_event
  * @brief Structure for @Event header.
  */
-struct sip_event_s 
+struct sip_event_s
 {
   sip_common_t        o_common[1];  /**< Common fragment info */
   sip_error_t        *o_next;	    /**< Link to next (dummy) */
@@ -686,7 +686,7 @@
   msg_param_t const  *r_params;	    /**< List of route parameters */
 };
 
-/**@ingroup sip_rseq 
+/**@ingroup sip_rseq
  * @brief Structure for @RSeq header.
  */
 struct sip_rseq_s
@@ -696,7 +696,7 @@
   unsigned long       rs_response;	/**< Sequence number of response */
 };
 
-/**@ingroup sip_session_expires 
+/**@ingroup sip_session_expires
  * @brief Structure for @SessionExpires header.
  */
 struct sip_session_expires_s
@@ -709,7 +709,7 @@
 					 * parameter: UAS or UAC */
 };
 
-/**@ingroup sip_min_se 
+/**@ingroup sip_min_se
  * @brief Structure for @MinSE header.
  */
 struct sip_min_se_s
@@ -720,7 +720,7 @@
   msg_param_t const  *min_params;	/**< List of extension parameters */
 };
 
-/**@ingroup sip_subscription_state 
+/**@ingroup sip_subscription_state
  * @brief Structure for @SubscriptionState header.
  */
 struct sip_subscription_state_s
@@ -728,7 +728,7 @@
   sip_common_t        ss_common[1];   /**< Common fragment info */
   sip_error_t        *ss_next;	      /**< Dummy link to next */
   /** Subscription state: "pending", "active" or "terminated" */
-  char const         *ss_substate; 
+  char const         *ss_substate;
   msg_param_t const  *ss_params;      /**< List of parameters */
   char const         *ss_reason;      /**< Reason for termination  */
   char const         *ss_expires;     /**< Subscription lifetime */
@@ -738,7 +738,7 @@
 /**@ingroup sip_timestamp
  * @brief Structure for @Timestamp header.
  */
-struct sip_timestamp_s 
+struct sip_timestamp_s
 {
   sip_common_t        ts_common[1]; /**< Common fragment info */
   sip_error_t        *ts_next;	    /**< Dummy link to next */
@@ -773,7 +773,7 @@
 struct sip_security_agree_s
 {
   sip_common_t        sa_common[1]; /**< Common fragment info */
-  struct sip_security_agree_s 
+  struct sip_security_agree_s
                      *sa_next;	    /**< Link to next mechanism */
   char const         *sa_mec;	    /**< Security mechanism */
   msg_param_t const  *sa_params;    /**< List of mechanism parameters */
@@ -798,7 +798,7 @@
  */
 union sip_header_u
 {
-  sip_common_t               sh_common[1]; 
+  sip_common_t               sh_common[1];
   struct
   {
     sip_common_t             shn_common;
@@ -832,7 +832,7 @@
   sip_cseq_t                 sh_cseq[1];
   sip_rseq_t                 sh_rseq[1];
   sip_rack_t                 sh_rack[1];
-                             
+
   sip_subject_t              sh_subject[1];
   sip_priority_t             sh_priority[1];
 
@@ -851,7 +851,7 @@
   sip_accept_t               sh_accept[1];
   sip_accept_encoding_t      sh_accept_encoding[1];
   sip_accept_language_t      sh_accept_language[1];
-                             
+
   sip_allow_t                sh_allow[1];
   sip_require_t              sh_require[1];
   sip_proxy_require_t        sh_proxy_require[1];
@@ -864,8 +864,8 @@
 
   sip_proxy_authenticate_t   sh_proxy_authenticate[1];
   sip_proxy_authentication_info_t sh_proxy_authentication_info[1];
-  sip_proxy_authorization_t  sh_proxy_authorization[1]; 
-                             
+  sip_proxy_authorization_t  sh_proxy_authorization[1];
+
   sip_authorization_t        sh_authorization[1];
   sip_www_authenticate_t     sh_www_authenticate[1];
   sip_authentication_info_t  sh_authentication_info[1];
@@ -882,7 +882,7 @@
   sip_request_disposition_t  sh_request_disposition[1];
   sip_accept_contact_t       sh_accept_contact[1];
   sip_reject_contact_t       sh_reject_contact[1];
-   
+
   sip_session_expires_t      sh_session_expires[1];
   sip_min_se_t               sh_min_se[1];
 
@@ -899,7 +899,7 @@
 
   sip_etag_t                 sh_etag[1];
   sip_if_match_t             sh_if_match[1];
-    
+
   /* Entity headers */
   sip_mime_version_t         sh_mime_version[1];
   sip_content_type_t         sh_content_type[1];

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_hclasses.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_hclasses.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_hclasses.h.in	Tue Dec 23 07:37:03 2008
@@ -1,11 +1,11 @@
-/** -*- C -*- 
+/** -*- C -*-
  *
  * @file sofia-sip/sip_hclasses.h.in
  *
  * Template for <sip_hclasses.h>.
  */
 
-/* 
+/*
  * This file is part of the Sofia-SIP package
  *
  * Copyright (C) 2005 Nokia Corporation.
@@ -35,9 +35,9 @@
 
 /**@file sofia-sip/sip_hclasses.h
  * @brief Declarations of SIP header classes.
- * 
+ *
  * #AUTO#
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Thu Jan 23 19:26:31 2003 ppessi
@@ -50,18 +50,18 @@
 SOFIA_BEGIN_DECLS
 
 
-enum { 
-  /**@ingroup sip_#xxxxxx# @internal 
+enum {
+  /**@ingroup sip_#xxxxxx# @internal
    *
    * Hash of @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#".
    *
    * @since New in #version#.
    */
-  sip_#xxxxxx#_hash = #hash# 
+  sip_#xxxxxx#_hash = #hash#
 };
 
 /**Header class for @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#".
- * 
+ *
  * The header class sip_#xxxxxx#_class defines how a SIP
  * @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" is parsed and printed.
  * It also contains methods used by SIP parser and other functions to

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_header.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_header.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_header.h	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 #ifndef SIP_HEADER_H
 /**Defined when <sofia-sip/sip_header.h> has been included.*/
-#define SIP_HEADER_H 
+#define SIP_HEADER_H
 
-/**@file sofia-sip/sip_header.h 
+/**@file sofia-sip/sip_header.h
  *
  * SIP parser library prototypes.
  *
@@ -96,7 +96,7 @@
 			       msg_hclass_t *hc, sip_header_t const *o);
 
 /** Add duplicates of headers to the SIP message. */
-SOFIAPUBFUN int sip_add_headers(msg_t *msg, sip_t *sip, 
+SOFIAPUBFUN int sip_add_headers(msg_t *msg, sip_t *sip,
 				void const *extra, va_list headers);
 
 /** Add duplicates of headers from taglist to the SIP message. */
@@ -127,11 +127,11 @@
 
 /* Use __attribute__ to allow argument checking for sip_header_format() */
 #if !defined(__GNUC__) && !defined(__attribute__)
-#define __attribute__(x) 
+#define __attribute__(x)
 #endif
 
 /** Make a SIP header with formatting provided. */
-SOFIAPUBFUN sip_header_t *sip_header_format(su_home_t *home, 
+SOFIAPUBFUN sip_header_t *sip_header_format(su_home_t *home,
 					    msg_hclass_t *hc,
 					    char const *fmt,
 					    ...)
@@ -154,15 +154,15 @@
 SOFIAPUBVAR char const sip_method_name_notify[];
 SOFIAPUBVAR char const sip_method_name_refer[];
 
-/** @internal UDP transport version string. */ 
+/** @internal UDP transport version string. */
 SOFIAPUBVAR char const sip_transport_udp[];
-/** @internal TCP transport version string. */ 
+/** @internal TCP transport version string. */
 SOFIAPUBVAR char const sip_transport_tcp[];
-/** @internal SCTP transport version string. */ 
+/** @internal SCTP transport version string. */
 SOFIAPUBVAR char const sip_transport_sctp[];
-/** @internal TLS transport version string. */ 
+/** @internal TLS transport version string. */
 SOFIAPUBVAR char const sip_transport_tls[];
-/** @internal SIP version string. */ 
+/** @internal SIP version string. */
 SOFIAPUBVAR char const sip_version_2_0[];
 
 #define SIP_VERSION_CURRENT sip_version_2_0
@@ -217,12 +217,12 @@
 					      char const *domain);
 
 /** Create a @CSeq header object.  */
-SOFIAPUBFUN sip_cseq_t *sip_cseq_create(su_home_t *, uint32_t seq, 
+SOFIAPUBFUN sip_cseq_t *sip_cseq_create(su_home_t *, uint32_t seq,
 					unsigned method, char const *name);
 
 /** Create a @Contact header object. */
-SOFIAPUBFUN sip_contact_t * sip_contact_create(su_home_t *, 
-					       url_string_t const *url, 
+SOFIAPUBFUN sip_contact_t * sip_contact_create(su_home_t *,
+					       url_string_t const *url,
 					       char const *param,
 					       /* char const *params, */
 					       ...);
@@ -245,7 +245,7 @@
 SOFIAPUBFUN sip_expires_t *sip_expires_create(su_home_t *, sip_time_t delta);
 
 /** Create a @Route header object. */
-SOFIAPUBFUN sip_route_t *sip_route_create(su_home_t *home, url_t const *url, 
+SOFIAPUBFUN sip_route_t *sip_route_create(su_home_t *home, url_t const *url,
 					  url_t const *maddr);
 
 /** Create a @RecordRoute header object. */
@@ -263,10 +263,10 @@
 
 SOFIAPUBFUN int sip_to_tag(su_home_t *, sip_to_t *to, char const *tag);
 
-/** Create a @Via object. */ 
+/** Create a @Via object. */
 SOFIAPUBFUN sip_via_t *sip_via_create(su_home_t *h,
 				      char const *host,
-				      char const *port, 
+				      char const *port,
 				      char const *transport,
 				      /* char const *params */
 				      ...);
@@ -277,7 +277,7 @@
 {
   char const *tp = v->v_protocol;
   if (tp) {
-    tp = strchr(tp, '/'); 
+    tp = strchr(tp, '/');
     if (tp) {
       tp = strchr(tp + 1, '/');
       if (tp)
@@ -297,12 +297,12 @@
 
 /**@ingroup sip_payload
  *
- * Initialize a SIP payload structure with pointer to data and its length. 
+ * Initialize a SIP payload structure with pointer to data and its length.
  *
  * The SIP_PAYLOAD_INIT2() macro initializes a #sip_payload_t header
  * structure with a pointer to data and its length in octets. For
  * instance,
- * @code 
+ * @code
  *  sip_payload_t txt_payload = SIP_PAYLOAD_INIT2(txt, strlen(txt));
  * @endcode
  *
@@ -310,7 +310,7 @@
  * from heap is not required, for instance, when the resulting payload
  * structure is immediately copied.
  *
- * @HIDE 
+ * @HIDE
  */
 #define SIP_PAYLOAD_INIT2(data, length) \
   {{{ 0, 0, sip_payload_class, data, length }, NULL, data, length }}
@@ -321,7 +321,7 @@
 /** Check that a required feature is supported. */
 SOFIAPUBFUN
 sip_unsupported_t *sip_has_unsupported(su_home_t *,
-				       sip_supported_t const *support, 
+				       sip_supported_t const *support,
 				       sip_require_t const *require);
 
 SOFIAPUBFUN
@@ -349,7 +349,7 @@
 int sip_has_feature(msg_list_t const *supported, char const *feature);
 
 /** Return true if the method is listed in @Allow header. */
-SOFIAPUBFUN int sip_is_allowed(sip_allow_t const *allow, 
+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. */
@@ -404,7 +404,7 @@
    *
    * @MinExpires, @Authorization, @Path, @Supported, @Contact, @Require, and
    * @Expires.
-   * 
+   *
    */
   sip_mask_registrar = (1 << 4),
 
@@ -419,7 +419,7 @@
   /** Bit marking essential headers for SIP events.
    *
    * @Event, @Expires, and @SubscriptionState.
-   * 
+   *
    * @sa @RFC3265.
    */
   sip_mask_events = (1 << 6),
@@ -427,7 +427,7 @@
   /** Bit marking essential headers for session timer extension.
    *
    * @SessionExpires, and @MinSE.
-   * 
+   *
    * @RFC4028
    */
   sip_mask_timer = (1 << 7),
@@ -435,7 +435,7 @@
   /** Bit marking essential headers for privacy extension.
    *
    * @Privacy.
-   * 
+   *
    * @sa @RFC3323
    */
   sip_mask_privacy = (1 << 8),
@@ -443,7 +443,7 @@
   /** Bit marking essential headers for caller preference extension.
    *
    * @RequestDisposition, @AcceptContact, and @RejectContact.
-   * 
+   *
    * @sa @RFC3841.
    */
   sip_mask_pref = (1 << 9),
@@ -451,13 +451,13 @@
   /** Bit marking essential headers for PUBLISH servers and clients.
    *
    * @SIPETag, and @SIPIfMatch.
-   * 
+   *
    * @sa @RFC3903.
    */
   sip_mask_publish = (1 << 10)
 
   /* NOTE:
-   * When adding bits, please update nta_agent_create() and 
+   * When adding bits, please update nta_agent_create() and
    * NTATAG_BAD_RESP_MASK()/NTATAG_BAD_REQ_MASK() documentation.
    */
 };
@@ -482,15 +482,15 @@
 /** Calculate the size of a SIP header and associated memory areas. */
 SOFIAPUBFUN isize_t sip_header_size(sip_header_t const *h);
 
-/** Duplicate (deep copy) a SIP header or whole list. */ 
+/** Duplicate (deep copy) a SIP header or whole list. */
 SOFIAPUBFUN sip_header_t *sip_header_dup(su_home_t *, sip_header_t const *);
 
 /** Copy a SIP header or whole list. */
 SOFIAPUBFUN sip_header_t *sip_header_copy(su_home_t *, sip_header_t const *o);
 
 /** Add an event to @AllowEvents header. */
-SOFIAPUBFUN int sip_allow_events_add(su_home_t *, 
-				     sip_allow_events_t *ae, 
+SOFIAPUBFUN int sip_allow_events_add(su_home_t *,
+				     sip_allow_events_t *ae,
 				     char const *e);
 
 /** Add a parameter to a @Contact header object. */
@@ -501,7 +501,7 @@
 
 SOFIAPUBFUN int sip_from_add_param(su_home_t *, sip_from_t *, char const *);
 
-/** Add a parameter to a @Via header object. */ 
+/** Add a parameter to a @Via header object. */
 SOFIAPUBFUN int sip_via_add_param(su_home_t *, sip_via_t *, char const *);
 
 #define sip_from_make_url     sip_from_create
@@ -510,4 +510,4 @@
 
 SOFIA_END_DECLS
 
-#endif 
+#endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h	Tue Dec 23 07:37:03 2008
@@ -24,10 +24,10 @@
 
 #ifndef SIP_PARSER_H
 /** Defined when <sofia-sip/sip_parser.h> has been included.*/
-#define SIP_PARSER_H 
+#define SIP_PARSER_H
 
 
-/**@ingroup sip_parser 
+/**@ingroup sip_parser
  * @file sofia-sip/sip_parser.h
  *
  * SIP parser provider interface.
@@ -130,11 +130,11 @@
 				     msg_param_t const **return_params,
 				     char const **return_comment);
 
-SOFIAPUBFUN issize_t sip_name_addr_e(char b[], isize_t bsiz, 
-				     int flags, 
-				     char const *display, 
+SOFIAPUBFUN issize_t sip_name_addr_e(char b[], isize_t bsiz,
+				     int flags,
+				     char const *display,
 				     int always_ltgt, url_t const url[],
-				     msg_param_t const params[], 
+				     msg_param_t const params[],
 				     char const *comment);
 
 SOFIAPUBFUN isize_t sip_name_addr_xtra(char const *display, url_t const *addr,
@@ -143,7 +143,7 @@
 
 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 **d_params,
 				    msg_param_t const params[],
 				    char *b, isize_t xtra);
 
@@ -167,7 +167,7 @@
 #define sip_generic_dup_one	msg_generic_dup_one
 
 
-#define	sip_auth_d              msg_auth_d         
+#define	sip_auth_d              msg_auth_d
 #define	sip_auth_e              msg_auth_e
 
 #define sip_header_dup_as	msg_header_dup_as
@@ -205,12 +205,12 @@
 
 SOFIAPUBFUN int sip_generic_xtra(sip_generic_t const *g);
 
-SOFIAPUBFUN sip_generic_t *sip_generic_dup(su_home_t *home, 
-					   msg_hclass_t *hc, 
+SOFIAPUBFUN sip_generic_t *sip_generic_dup(su_home_t *home,
+					   msg_hclass_t *hc,
 					   sip_generic_t const *u);
 
 SOFIAPUBFUN sip_generic_t *sip_generic_copy(su_home_t *home,
-					    msg_hclass_t *hc, 
+					    msg_hclass_t *hc,
 					    sip_generic_t const *o);
 
 SOFIA_END_DECLS

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_protos.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_protos.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_protos.h.in	Tue Dec 23 07:37:03 2008
@@ -30,14 +30,14 @@
 
 #ifndef SIP_PROTOS_H
 /** Defined when <sofia-sip/sip_protos.h> has been included. */
-#define SIP_PROTOS_H 
-  
+#define SIP_PROTOS_H
+
 /**@file sofia-sip/sip_protos.h
- * 
+ *
  * SIP prototypes and macros for each header.
- * 
+ *
  * #AUTO#
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
  *
  */
@@ -86,7 +86,7 @@
   return msg_header_insert(msg, (msg_pub_t *)sip, (msg_header_t *)h);
 }
 
-/** Remove a header from a SIP message. */ 
+/** Remove a header from a SIP message. */
 su_inline
 int sip_header_remove(msg_t *msg, sip_t *sip, sip_header_t *h)
 {
@@ -131,22 +131,22 @@
 
 /**Access a SIP @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#"
  * structure #sip_#xxxxxx#_t from #sip_t.
- * 
+ *
  * @since New in #version#.
  */
 #define sip_#xxxxxx#(sip) \
   ((sip_#xxxxxx#_t *)msg_header_access((msg_pub_t*)(sip), sip_#xxxxxx#_class))
 
 /**Initializer for structure #sip_#xxxxxx#_t.
- * 
+ *
  * A static #sip_#xxxxxx#_t structure for
  * @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" must be initialized with
- * the SIP_#XXXXXX#_INIT() macro. 
+ * the SIP_#XXXXXX#_INIT() macro.
  * For instance,
- * @code 
- * 
+ * @code
+ *
  *  sip_#xxxxxx#_t sip_#xxxxxx# = SIP_#XXXXXX#_INIT;
- * 
+ *
  * @endcode
  * @HI
  *
@@ -155,16 +155,16 @@
 #define SIP_#XXXXXX#_INIT() SIP_HDR_INIT(#xxxxxx#)
 
 /**Initialize a structure #sip_#xxxxxx#_t.
- * 
+ *
  * An #sip_#xxxxxx#_t structure for
  * @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" can be initialized with the
  * sip_#xxxxxx#_init() function/macro. For instance,
  * @code
- * 
+ *
  *  sip_#xxxxxx#_t sip_#xxxxxx#;
- * 
+ *
  *  sip_#xxxxxx#_init(&sip_#xxxxxx#);
- * 
+ *
  * @endcode
  * @HI
  *
@@ -181,14 +181,14 @@
 #endif
 
 /**Test if header object is instance of #sip_#xxxxxx#_t.
- * 
+ *
  * Check if the header class is an instance of
  * @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" object and return true (nonzero),
  * otherwise return false (zero).
- * 
+ *
  * @param header pointer to the header structure to be tested
- * 
- * @retval 1 (true) if the @a header is an instance of header #xxxxxx# 
+ *
+ * @retval 1 (true) if the @a header is an instance of header #xxxxxx#
  * @retval 0 (false) otherwise
  *
  * @since New in #version#.
@@ -206,27 +206,27 @@
 
 
 /**Duplicate a list of @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" header structures #sip_#xxxxxx#_t.
- * 
+ *
  * Duplicate a header
  * structure @a hdr.  If the header structure @a hdr
  * contains a reference (@c hdr->x_next) to a list of
  * headers, all the headers in the list are duplicated, too.
- * 
+ *
  * @param home  memory home used to allocate new structure
  * @param hdr   header structure to be duplicated
- * 
+ *
  * When duplicating, all parameter lists and non-constant
  * strings attached to the header are copied, too.  The
  * function uses given memory @a home to allocate all the
  * memory areas used to copy the header.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = sip_#xxxxxx#_dup(home, sip->sip_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * A pointer to the
  * newly duplicated #sip_#xxxxxx#_t header structure, or NULL
@@ -237,42 +237,42 @@
 #if SU_HAVE_INLINE
 su_inline
 #endif
-sip_#xxxxxx#_t *sip_#xxxxxx#_dup(su_home_t *home, sip_#xxxxxx#_t const *hdr) 
+sip_#xxxxxx#_t *sip_#xxxxxx#_dup(su_home_t *home, sip_#xxxxxx#_t const *hdr)
      __attribute__((__malloc__));
 
 #if SU_HAVE_INLINE
 su_inline
 sip_#xxxxxx#_t *sip_#xxxxxx#_dup(su_home_t *home, sip_#xxxxxx#_t const *hdr)
-{ 
+{
   return (sip_#xxxxxx#_t *)
     msg_header_dup_as(home, sip_#xxxxxx#_class, (msg_header_t const *)hdr);
 }
 #endif
 
 /**Copy a list of @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" header structures #sip_#xxxxxx#_t.
- * 
+ *
  * The function sip_#xxxxxx#_copy() copies a header structure @a
  * hdr.  If the header structure @a hdr contains a reference (@c
  * hdr->h_next) to a list of headers, all the headers in that
  * list are copied, too. The function uses given memory @a home
  * to allocate all the memory areas used to copy the list of header
  * structure @a hdr.
- * 
+ *
  * @param home    memory home used to allocate new structure
  * @param hdr     pointer to the header structure to be copied
- * 
+ *
  * When copying, only the header structure and parameter lists attached to
  * it are duplicated. The new header structure retains all the references to
  * the strings within the old @a hdr header, including the encoding of the
  * old header, if present.
- * 
+ *
  * @par Example
  * @code
- * 
+ *
  *   #xxxxxx# = sip_#xxxxxx#_copy(home, sip->sip_#xxxxxx#);
- * 
+ *
  * @endcode
- * 
+ *
  * @return
  * A pointer to newly copied header structure, or NULL upon an error.
  *
@@ -281,28 +281,28 @@
 #if SU_HAVE_INLINE
 su_inline
 #endif
-sip_#xxxxxx#_t *sip_#xxxxxx#_copy(su_home_t *home, sip_#xxxxxx#_t const *hdr) 
+sip_#xxxxxx#_t *sip_#xxxxxx#_copy(su_home_t *home, sip_#xxxxxx#_t const *hdr)
      __attribute__((__malloc__));
 
 #if SU_HAVE_INLINE
 su_inline
-sip_#xxxxxx#_t *sip_#xxxxxx#_copy(su_home_t *home, sip_#xxxxxx#_t const *hdr) 
-{ 
+sip_#xxxxxx#_t *sip_#xxxxxx#_copy(su_home_t *home, sip_#xxxxxx#_t const *hdr)
+{
   return (sip_#xxxxxx#_t *)
-    msg_header_copy_as(home, sip_#xxxxxx#_class, (msg_header_t const *)hdr); 
+    msg_header_copy_as(home, sip_#xxxxxx#_class, (msg_header_t const *)hdr);
 }
 #endif
 
 /**Make a @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" structure #sip_#xxxxxx#_t.
- * 
+ *
  * The function sip_#xxxxxx#_make() makes a new
  * #sip_#xxxxxx#_t header structure.  It allocates a new
  * header structure, and decodes the string @a s as the
  * value of the structure.
- * 
+ *
  * @param home memory home used to allocate new header structure.
  * @param s    string to be decoded as value of the new header structure
- * 
+ *
  * @return
  * A pointer to newly maked #sip_#xxxxxx#_t header structure, or NULL upon an
  * error.
@@ -310,7 +310,7 @@
  * @since New in #version#.
  */
 #if SU_HAVE_INLINE
-su_inline 
+su_inline
 #endif
 sip_#xxxxxx#_t *sip_#xxxxxx#_make(su_home_t *home, char const *s)
      __attribute__((__malloc__));
@@ -323,20 +323,20 @@
 #endif
 
 /**Make a @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" from formatting result.
- * 
- * Make a new #sip_#xxxxxx#_t object using formatting result as its value. 
+ *
+ * Make a new #sip_#xxxxxx#_t object using formatting result as its value.
  * The function first prints the arguments according to the format @a fmt
  * specified. Then it allocates a new header structure, and parses the
  * formatting result to the structure #sip_#xxxxxx#_t.
- * 
+ *
  * @param home   memory home used to allocate new header structure.
  * @param fmt    string used as a printf()-style format
  * @param ...    argument list for format
- * 
+ *
  * @return
  * A pointer to newly
  * makes header structure, or NULL upon an error.
- * 
+ *
  * @HIDE
  *
  * @since New in #version#.
@@ -352,11 +352,11 @@
 {
   sip_header_t *h;
   va_list ap;
-  
+
   va_start(ap, fmt);
   h = sip_header_vformat(home, sip_#xxxxxx#_class, fmt, ap);
   va_end(ap);
- 
+
   return (sip_#xxxxxx#_t *)h;
 }
 #endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_status.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_status.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_status.h	Tue Dec 23 07:37:03 2008
@@ -24,10 +24,10 @@
 
 #ifndef SIP_STATUS_H
 /** Defined when <sofia-sip/sip_status.h> has been included. */
-#define SIP_STATUS_H 
+#define SIP_STATUS_H
 
 /**@addtogroup sip_status_codes
- * @{ 
+ * @{
  */
 /**@file sofia-sip/sip_status.h
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in	Tue Dec 23 07:37:03 2008
@@ -107,7 +107,7 @@
 #if SU_INLINE_TAG_CAST
 su_inline
 tag_value_t siptag_sip_v(sip_t const *v) { return (tag_value_t)v; }
-su_inline 
+su_inline
 tag_value_t siptag_sip_vr(sip_t const **vp) { return (tag_value_t)vp; }
 #else
 #define siptag_sip_v(v)   (tag_value_t)(v)
@@ -117,8 +117,8 @@
 /**Tag list item for header string.
  *
  * The SIPTAG_HEADER() macro is used to include a tag item containing an
- * unknown SIP header in the tag list, e.g., 
- * @code 
+ * unknown SIP header in the tag list, e.g.,
+ * @code
  * sip_header_t *hdr;
  *
  * SIPTAG_HEADER(hdr).
@@ -190,7 +190,7 @@
  *
  * @param x pointer to a #sip_#xxxxxx#_t structure, or NULL.
  *
- * The corresponding tag taking reference parameter is 
+ * The corresponding tag taking reference parameter is
  * SIPTAG_#XXXXXX#_REF().
  *
  * @since New in #version#.
@@ -202,7 +202,7 @@
 SOFIAPUBVAR tag_typedef_t siptag_#xxxxxx#;
 
 /**@ingroup sip_#xxxxxx#
- * Tag list item for reference to a 
+ * Tag list item for reference to a
  * @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" pointer.
  */
 #define SIPTAG_#XXXXXX#_REF(x) siptag_#xxxxxx#_ref, siptag_#xxxxxx#_vr(&(x))
@@ -212,17 +212,17 @@
  *
  * Tag list item for string with @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" value.
  *
- * The SIPTAG_#XXXXXX#_STR() macro is used to include a tag item with a 
+ * The SIPTAG_#XXXXXX#_STR() macro is used to include a tag item with a
  * string containing value of a #sip_#xxxxxx#_t header in a tag list.
  *
- * @param s pointer to a string containing 
+ * @param s pointer to a string containing
  *    @ref sip_#xxxxxx# "#xxxxxxx_xxxxxxx#" value, or NULL.
  *
  * The string in SIPTAG_#XXXXXX#_STR() can be converted to a
  * #sip_#xxxxxx#_t header structure by giving the string @a s has
  * second argument to function sip_#xxxxxx#_make().
  *
- * The corresponding tag taking reference parameter is 
+ * The corresponding tag taking reference parameter is
  * SIPTAG_#XXXXXX#_STR_REF().
  *
  * @since New in #version#.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag_class.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag_class.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag_class.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef SIP_TAG_CLASS_H
 /** Defined when <sip_tag_class.h> have been included */
-#define SIP_TAG_CLASS_H 
+#define SIP_TAG_CLASS_H
 
 
 /**@SIP_TAG @{ */
@@ -81,9 +81,9 @@
 SOFIAPUBVAR tag_class_t sipexthdrtag_class[1];
 
 
-/**@internal Filter SIP header tag items. */ 
+/**@internal Filter SIP header tag items. */
 SOFIAPUBFUN tagi_t *siptag_filter(tagi_t *dst, tagi_t const f[],
-				  tagi_t const *src, 
+				  tagi_t const *src,
 				  void **bb);
 
 SOFIA_END_DECLS

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_util.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_util.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_util.h	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 #ifndef SIP_UTIL_H
 /** Defined when <sofia-sip/sip_util.h> has been included. */
-#define SIP_UTIL_H 
+#define SIP_UTIL_H
 
-/**@file sofia-sip/sip_util.h 
+/**@file sofia-sip/sip_util.h
  * @brief SIP utility functions
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
@@ -50,7 +50,7 @@
 
 SOFIAPUBFUN
 sip_contact_t *
-sip_contact_create_from_via_with_transport(su_home_t *home, 
+sip_contact_create_from_via_with_transport(su_home_t *home,
 					   sip_via_t const *v,
 					   char const *user,
 					   char const *transport);
@@ -78,7 +78,7 @@
 
 SOFIAPUBFUN url_t *sip_url_dup(su_home_t *sh, url_t const *o);
 
-/**Add optional prefix and string to argument list if @a s is non-NULL. 
+/**Add optional prefix and string to argument list if @a s is non-NULL.
  * @HIDE
  */
 #define SIP_STRLOG(prefix, s) ((s) ? (prefix) : ""), ((s) ? (s) : "")
@@ -111,13 +111,13 @@
 
 /** Check callerprefs. */
 SOFIAPUBFUN int sip_prefs_matching(char const *pvalue,
-				   char const *nvalue, 		       
+				   char const *nvalue,
 				   int *return_parse_error);
 SOFIAPUBFUN int sip_is_callerpref(char const *param);
 
 /** Type of the SIP media tag */
-enum sp_type { 
-  sp_error = -1, 
+enum sp_type {
+  sp_error = -1,
   sp_init,
   sp_literal,
   sp_string,
@@ -133,7 +133,7 @@
 
   /** Literal (tag="foo"). */
   struct sp_literal {
-    enum sp_type spl_type; 
+    enum sp_type spl_type;
     char const *spl_value;
     usize_t spl_length;
   } sp_literal;
@@ -155,8 +155,8 @@
 };
 
 /** Parse a single preference */
-SOFIAPUBFUN int sip_prefs_parse(union sip_pref *sp, 
-				char const **in_out_s, 
+SOFIAPUBFUN int sip_prefs_parse(union sip_pref *sp,
+				char const **in_out_s,
 				int *return_negation);
 
 /** Match preferences */
@@ -170,13 +170,13 @@
  */
 #define sip_contact_immune(m) sip_contact_is_immune(m)
 
-SOFIAPUBFUN sip_contact_t *sip_contact_immunize(su_home_t *home, 
+SOFIAPUBFUN sip_contact_t *sip_contact_immunize(su_home_t *home,
 						sip_contact_t const *m);
 
-SOFIAPUBFUN int sip_contact_reject(sip_contact_t const *m, 
+SOFIAPUBFUN int sip_contact_reject(sip_contact_t const *m,
 				   sip_reject_contact_t const *rc);
 
-SOFIAPUBFUN int sip_contact_accept(sip_contact_t const *m, 
+SOFIAPUBFUN int sip_contact_accept(sip_contact_t const *m,
 				   sip_accept_contact_t const *cp,
 				   unsigned *return_S,
 				   unsigned *return_N,
@@ -195,7 +195,7 @@
 					    sip_security_verify_t const *v,
 					    char const **return_d_ver);
 
-SOFIAPUBFUN 
+SOFIAPUBFUN
 sip_security_client_t const *
 sip_security_client_select(sip_security_client_t const *client,
 			   sip_security_server_t const *server);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/test_date.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/test_date.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/test_date.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@internal
  *
- * @CFILE test_date.c  
+ * @CFILE test_date.c
  *
  * Tester for SIP date parser
  *
@@ -46,7 +46,7 @@
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
+  fprintf(stderr,
 	  "usage: test_date [SIP-date] "
 	  "[YYYYy][DDd][HHh][MMm][SS[s]]\n");
   exit(exitcode);
@@ -70,7 +70,7 @@
       fprintf(stderr, "test_date: %s is not valid time\n", s);
       exit(1);
     }
-      
+
     if ((s = av[2])) {
       for (delta = 0; *s; ) {
 	t2 = 0;
@@ -96,7 +96,7 @@
     char buf[80];
 
     msg_date_e(buf, sizeof(buf), t);
-    
+
     if (verbatim)
       printf("%08lx is %s\n", t, buf);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/test_sip_msg.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/test_sip_msg.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/test_sip_msg.c	Tue Dec 23 07:37:03 2008
@@ -75,7 +75,7 @@
   for (i = 0; i < N; i++) {
     /* Verify each header entry */
     msg_hclass_t *hc = mc->mc_hash[i].hr_class;
-    
+
     if (hc == NULL)
       continue;
 
@@ -94,7 +94,7 @@
 char * url_print(url_t *url, char buf[1024])
 {
   url_e(buf, 1024, url);
-  
+
   return buf;
 }
 
@@ -118,11 +118,11 @@
     }
     fputs(buf, f);
     if (quoted_url) fputs(">", f);
-    
+
     if (m->m_params)
       for (p = m->m_params; *p; p++)
 	fprintf(f, " ;%s", *p);
-    
+
     if (m->m_comment)
       fprintf(f, " (%s)", m->m_comment);
   }
@@ -140,7 +140,7 @@
 
     fprintf(f, "%s %s", v->v_protocol, v->v_host);
     if (v->v_port)
-      fprintf(f, ":%s", v->v_port);      
+      fprintf(f, ":%s", v->v_port);
 
     if (v->v_params)
       for (p = v->v_params; *p; p++)
@@ -158,7 +158,7 @@
   size_t n;
   int m, tcp;
   sip_t *sip;
-  int exitcode = 0; 
+  int exitcode = 0;
   msg_mclass_t const *sip_mclass = sip_default_mclass();
   msg_t *msg = msg_create(sip_mclass, MSG_FLG_EXTRACT_COPY);
   msg_iovec_t iovec[1];
@@ -248,13 +248,13 @@
 	    sip->sip_status->st_version,
 	    sip->sip_status->st_status,
 	    sip->sip_status->st_phrase);
-  
+
   if (sip->sip_cseq)
     fprintf(stdout, "\tCSeq: %u %s (%d)\n",
 	    sip->sip_cseq->cs_seq,
 	    sip->sip_cseq->cs_method_name,
 	    sip->sip_cseq->cs_method);
-  
+
   if (sip->sip_call_id)
     fprintf(stdout, "\tCall-ID: %s (%x)\n",
 	    sip->sip_call_id->i_id,
@@ -264,7 +264,7 @@
     fprintf(stdout, "\tFrom: %s@%s%s%s\n",
 	    sip->sip_from->a_user ? sip->sip_from->a_user : "[nobody]",
 	    sip->sip_from->a_host ? sip->sip_from->a_host : "[nowhere]",
-	    sip->sip_from->a_tag ? " ;tag=" : "",	
+	    sip->sip_from->a_tag ? " ;tag=" : "",
 	    sip->sip_from->a_tag ? sip->sip_from->a_tag : "");
 
   if (sip->sip_to)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@ingroup sip_test @internal
  *
- * @CFILE torture_sip.c  
+ * @CFILE torture_sip.c
  *
  * Unit-testing functions for SIP.
  *
@@ -111,7 +111,7 @@
 
   TEST_1(test_mclass = msg_mclass_clone(def0, 0, 0));
 
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  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"
@@ -136,12 +136,12 @@
 
   msg_destroy(msg);
 
-  TEST_1(msg_mclass_insert_header(test_mclass, 
+  TEST_1(msg_mclass_insert_header(test_mclass,
 				  sip_p_asserted_identity_class, 0) > 0);
-  TEST_1(msg_mclass_insert_header(test_mclass, 
+  TEST_1(msg_mclass_insert_header(test_mclass,
 				  sip_p_preferred_identity_class, 0) > 0);
 
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  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"
@@ -165,7 +165,7 @@
   TEST_1(!sip_remote_party_id(sip));
 
   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>")));
@@ -179,7 +179,7 @@
   /* Now with extensions */
   TEST_1(test_mclass = msg_mclass_clone(def1, 0, 0));
 
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  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"
@@ -211,10 +211,10 @@
     su_home_t *home = su_home_clone(NULL, sizeof *home);
 
     char *s;
-    char const canonic[] = 
+    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[] = 
+    char const canonic2[] =
       "Jaska Jokunen <sip:jaska.jokunen at example.com>;"
       "screen=yes;party=called;id-type=user;privacy=\"name,uri-network\"";
 
@@ -242,7 +242,7 @@
     TEST_S(d->rpid_display, rpid->rpid_display);
 
     su_home_check(home);
-    
+
     su_home_zap(home);
   }
 
@@ -313,7 +313,7 @@
   TEST_P(t[0].t_tag, siptag_from);    TEST_1(f = (void *)t[0].t_value);
   TEST_P(t[1].t_tag, siptag_accept);  TEST_1(ac = (void *)t[1].t_value);
   TEST_P(t[2].t_tag, siptag_payload); TEST_1(body = (void *)t[2].t_value);
-  TEST_P(t[3].t_tag, siptag_accept); 
+  TEST_P(t[3].t_tag, siptag_accept);
 
   s = "xyzzy=foo";
 
@@ -339,7 +339,7 @@
   msg_t *msg, *msg0;
   sip_t *sip;
 
-  msg0 = read_message(MSG_DO_EXTRACT_COPY, 
+  msg0 = read_message(MSG_DO_EXTRACT_COPY,
     "MESSAGE sip:foo at bar SIP/2.0\r\n"
     "To: Joe User <sip:foo at bar>\r\n"
     "From: \"Bar Owner\" <sip:bar at foo>;tag=foobar\r\n"
@@ -357,11 +357,11 @@
   TEST_1(l = sip_content_length_make(msg_home(msg), "6"));
   TEST_1(pl = sip_payload_make(msg_home(msg), "hello!"));
 
-  TEST_1(msg_header_replace(msg, NULL, 
-			    (void *)sip->sip_content_length, 
+  TEST_1(msg_header_replace(msg, NULL,
+			    (void *)sip->sip_content_length,
 			    (void *)l) >= 0);
-  TEST_1(msg_header_replace(msg, NULL, 
-			    (void *)sip->sip_payload, 
+  TEST_1(msg_header_replace(msg, NULL,
+			    (void *)sip->sip_payload,
 			    (void *)pl) >= 0);
 
   TEST(msg_serialize(msg, NULL), 0);
@@ -440,7 +440,7 @@
   BEGIN();
 
   TEST_1(home);
-  
+
   {
     sip_request_t *rq, *rq1;
 
@@ -452,7 +452,7 @@
 
     su_free(home, rq);
     su_free(home, rq1);
-    
+
     rq = sip_request_make(home, "invite sip:joe at example.com SIP/2.0");
     TEST_1(rq);
     TEST(rq->rq_method, sip_method_unknown);
@@ -463,22 +463,22 @@
     su_free(home, rq);
     su_free(home, rq1);
 
-    TEST_1(!sip_request_create(home, sip_method_unknown, NULL, 
+    TEST_1(!sip_request_create(home, sip_method_unknown, NULL,
 			       (void *)"sip:joe at example.com", NULL));
-    TEST_1(rq = sip_request_create(home, sip_method_unknown, "invite", 
+    TEST_1(rq = sip_request_create(home, sip_method_unknown, "invite",
 				   (void *)"sip:joe at example.com", NULL));
     TEST(rq->rq_method, sip_method_unknown);
     TEST_S(rq->rq_method_name, "invite");
     su_free(home, rq);
 
-    TEST_1(rq = sip_request_create(home, sip_method_unknown, "INVITE", 
+    TEST_1(rq = sip_request_create(home, sip_method_unknown, "INVITE",
 				   (void *)"sip:joe at example.com", NULL));
     TEST(rq->rq_method, sip_method_invite);
     TEST_S(rq->rq_method_name, "INVITE");
 
     su_free(home, rq);
 
-    TEST_1(rq = sip_request_create(home, sip_method_invite, "foobar", 
+    TEST_1(rq = sip_request_create(home, sip_method_invite, "foobar",
 				   (void *)"sip:joe at example.com", NULL));
     TEST(rq->rq_method, sip_method_invite);
     TEST_S(rq->rq_method_name, "INVITE");
@@ -548,8 +548,8 @@
     TEST_1(params);
     TEST_1(comment);
 
-    TEST_SIZE(sip_name_addr_e(ebuf, sizeof(ebuf), 0, display, 0, url, 
-			      params, comment), 
+    TEST_SIZE(sip_name_addr_e(ebuf, sizeof(ebuf), 0, display, 0, url,
+			      params, comment),
 	      strlen(na) - 1);
     TEST_1(strncmp(na, ebuf, strlen(na) - 1) == 0);
 
@@ -648,7 +648,7 @@
 
     TEST_1(!sip_cseq_create(home, 123456789, sip_method_unknown, NULL));
 
-    TEST_1(cs = sip_cseq_create(home, 123456789, sip_method_unknown, 
+    TEST_1(cs = sip_cseq_create(home, 123456789, sip_method_unknown,
 				"invite"));
     TEST(cs->cs_seq, 123456789);
     TEST(cs->cs_method, sip_method_unknown);
@@ -663,9 +663,9 @@
     sip_contact_t *m, *m0;
 
     TEST_1(!sip_contact_make(home, ",,"));
-    
-    TEST_1(m = sip_contact_create(home, (void *)"sip:joe at bar", 
-				  "q=0.2", 
+
+    TEST_1(m = sip_contact_create(home, (void *)"sip:joe at bar",
+				  "q=0.2",
 				  "+message",
 				  NULL));
     TEST_S(m->m_q, "0.2");
@@ -681,7 +681,7 @@
 
     TEST_S(m->m_q, "0.5");
     TEST_S(m->m_expires, "0");
-    
+
     TEST_1(!sip_contact_create(home, (void *)"sip:joe@[baa",
 			       "audio", "video", NULL));
 
@@ -717,7 +717,7 @@
     TEST_1(ex = sip_expires_make(home, "4294967297")); /* XXX */
     su_free(home, ex);
 
-    TEST_1(ex = sip_expires_make(home, "Wed, 25 Mar 2004 14:49:29 GMT")); 
+    TEST_1(ex = sip_expires_make(home, "Wed, 25 Mar 2004 14:49:29 GMT"));
     su_free(home, ex);
 
     TEST_1(ex = sip_expires_create(home, 3600));
@@ -769,7 +769,7 @@
     TEST_1(sip_route_fix(r));
     TEST_1(url_has_param(r->r_url, "lr"));
 
-    su_free(home, r); 
+    su_free(home, r);
     TEST_1(r = sip_route_create(home, r0->r_url, r0->r_url));
 
     su_free(home, r); su_free(home, r0);
@@ -796,9 +796,9 @@
     TEST_1(!sip_via_make(home, "SIP// host:5060 (foo),"));
     TEST_1(!sip_via_make(home, "SIP/2.0/TCP host:5060 (foo) bar,"));
     TEST_1(!sip_via_make(home, "SIP/2.0/TCP [3ffe::1:5060 (foo),"));
-    
-    TEST_1(v = sip_via_create(home, "bar.com", 
-			      "50600", 
+
+    TEST_1(v = sip_via_create(home, "bar.com",
+			      "50600",
 			      "SIP/2.0/UDP",
 			      "hidden",
 			      "rport=50601",
@@ -819,7 +819,7 @@
     TEST_S(v->v_branch, "1");
     TEST_S(v->v_rport, "50601");
     TEST_S(v->v_comp, "sigcomp");
-    
+
     TEST_1(v0 = sip_via_dup(home, v));
 
     TEST(msg_header_add_param(home, v->v_common, "rport"), 0);
@@ -844,8 +844,8 @@
     su_free(home, v);
     su_free(home, v0);
 
-    TEST_1(v = sip_via_create(home, "bar.com", 
-			      "50600", 
+    TEST_1(v = sip_via_create(home, "bar.com",
+			      "50600",
 			      NULL,
 			      "rport=50601",
 			      "branch=1",
@@ -859,7 +859,7 @@
   {
     sip_call_info_t *ci, *ci0;
 
-    TEST_1(ci = sip_call_info_make(home, 
+    TEST_1(ci = sip_call_info_make(home,
 				   "<http://www.nokia.com>;purpose=info"));
     TEST_S(ci->ci_purpose, "info");
     TEST_1(ci0 = sip_call_info_dup(home, ci));
@@ -941,7 +941,7 @@
   for (i = 0; i < N; i++) {
     /* Verify each header entry */
     hc = mc->mc_hash[i].hr_class;
-    
+
     if (hc == NULL)
       continue;
 
@@ -969,7 +969,7 @@
   msg_iovec_t iovec[2];
 
   n = strlen(buffer);
-  if (n == 0) 
+  if (n == 0)
     return NULL;
 
   msg = msg_create(test_mclass, flags);
@@ -996,7 +996,7 @@
 
   TEST_1(home = su_home_new(sizeof *home));
 
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  msg = read_message(MSG_DO_EXTRACT_COPY,
     "SUBSCRIBE sip:foo at bar SIP/2.0\r\n"
     "To: Joe User <sip:foo at bar>\r\n"
     "From: \"Bar Owner\" <sip:bar at foo>;tag=foobar\r\n"
@@ -1073,7 +1073,7 @@
   msg_destroy(msg), msg = NULL;
 
   /* Note: this should be canonic! */
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  msg = read_message(MSG_DO_EXTRACT_COPY,
     "SIP/2.0 200 Ok\r\n"
     "To: Joe User <sip:foo at bar>;tag=deadbeef\r\n"
     "From: sip:bar at foo;tag=foobar\r\n"
@@ -1094,7 +1094,7 @@
     "Subscription-State: active;expires=1800\r\n"
     "Call-Info: <http://www.bar.com/xcap/joe/>;purpose=xcap\r\n"
     "Error-Info: <http://www.bar.com/xcap/joe/errors>;param=xcap\r\n"
-    "Server: None\r\n"		     
+    "Server: None\r\n"
     "Timestamp: 3289129810.798259 0.084054\r\n"
     "SIP-ETag: foobar\r\n"
     "SIP-If-Match: foobar\r\n"
@@ -1104,8 +1104,8 @@
     "Warning: 399 presence.bar:5060 \"Unimplemented filter\"\r\n"
     "RSeq: 421414\r\n"
     "Refer-To: <sip:hsdf at cdwf.xcfw.com?Subject=test&Organization=Bar>\r\n"
-    "Alert-Info: <http://alert.example.org/test.mp3>\r\n"		     
-    "Reply-To: Bob <sip:bob at example.com>\r\n"		     
+    "Alert-Info: <http://alert.example.org/test.mp3>\r\n"
+    "Reply-To: Bob <sip:bob at example.com>\r\n"
     "WWW-Authenticate: Digest realm=\"foo\"\r\n"
     "Proxy-Authenticate: Digest realm=\"foo\"\r\n"
     "Security-Server: tls;q=0.2\r\n"
@@ -1141,7 +1141,7 @@
   su_home_check(home);
   su_home_zap(home);
 
-  msg = read_message(0, 
+  msg = read_message(0,
 		     "SIP/2.0 200 Ok\r\n"
 		     "Via: SIP/2.0/UDP 135.180.130.133\r\n"
 		     "Via: SIP/2.0/UDP 135.180.130.130:5060\r\n"
@@ -1153,7 +1153,7 @@
 		     "Record-Route: <sip:135.180.130.130;lr>\r\n"
 		     "Content-Length: 0\r\n"
 		     "\r\n");
-		    
+
   sip = sip_object(msg);
 
   TEST_1(msg); TEST_1(sip); TEST_1(!sip->sip_error);
@@ -1164,7 +1164,7 @@
 
   TEST_1(c = sip->sip_status->st_common);
   TEST_M(c->h_data, "SIP/2.0 200 Ok\r\n", c->h_len);
-  
+
   TEST_1(c = sip->sip_to->a_common);
   TEST_M(c->h_data, "t:Joe User<sip:foo at bar>;tag=deadbeef\r\n", c->h_len);
 
@@ -1201,16 +1201,16 @@
 int tag_test(void)
 {
   su_home_t *home = su_home_new(sizeof(*home));
-  sip_request_t *request = 
+  sip_request_t *request =
     sip_request_make(home, "INVITE sip:joe at example.com SIP/2.0");
-  sip_to_t *to = sip_to_make(home, 
+  sip_to_t *to = sip_to_make(home,
 			     "Joe User <sip:joe.user at example.com;param=1>"
 			     ";tag=12345678");
   sip_via_t *via = sip_via_make(home,
 				"SIP/2.0/UDP sip.example.com"
 				";maddr=128.12.9.254"
 				";branch=289412978y641.321312");
-  url_t *url = url_hdup(home, 
+  url_t *url = url_hdup(home,
     (url_t *)"sip:test:pass at example.com;baz=1?foo&bar");
 
   tagi_t *lst, *dup;
@@ -1224,15 +1224,15 @@
   TEST_1(home && request && to && via);
 
   lst = tl_list(SIPTAG_REQUEST(request),
-		SIPTAG_TO(to), 
+		SIPTAG_TO(to),
 		SIPTAG_VIA(via),
 		URLTAG_URL(url),
 		TAG_NULL());
 
   xtra = 0;
-  xtra += XTRA(xtra, request); 
-  xtra += XTRA(xtra, to); 
-  xtra += XTRA(xtra, via); 
+  xtra += XTRA(xtra, request);
+  xtra += XTRA(xtra, to);
+  xtra += XTRA(xtra, via);
   xtra += SU_ALIGN(xtra) + sizeof(*url) + url_xtra(url);
 
   TEST_SIZE(tl_len(lst), 5 * sizeof(tagi_t));
@@ -1255,7 +1255,7 @@
   TEST_1(request->rq_common->h_class == sip_request_class);
   TEST_S(request->rq_method_name, "INVITE");
   TEST_S(request->rq_version, "SIP/2.0");
-  
+
   TEST_1(t_scan(siptag_to, home, "Example <sip:example.org>;tag=foo", &v));
   TEST_1(to = (void *)v);
   TEST_1(to->a_common->h_class == sip_to_class);
@@ -1283,7 +1283,7 @@
 
   home = su_home_new(sizeof *home);
 
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  msg = read_message(MSG_DO_EXTRACT_COPY,
 "SIP/2.0 401 Unauthorized\r\n"
 "Via: SIP/2.0/UDP srlab.sr.ntc.nokia.com:5060;maddr=192.168.102.5\r\n"
 "Via: SIP/2.0/UDP 172.21.9.155\r\n"
@@ -1297,7 +1297,7 @@
 "Proxy-Authenticate: Digest realm=\"IndigoSw\", domain=\"sip:indigosw.com\", "
 "nonce=\"V2VkIEF1ZyAxNSAxODoxMzozMiBCU1QgMjAwMVtCQDJkYjE5ZA==\", "
 "opaque=\"NzA3ZjJhYzU4MGY3MzU0MQ==\", stale=false, "
-"algorithm=md5, algorithm=sha1, qop=\"auth\"\r\n" 
+"algorithm=md5, algorithm=sha1, qop=\"auth\"\r\n"
 /* , qop=\"auth, auth-int\"\r */
 "\r\n");
 
@@ -1323,21 +1323,21 @@
 
   TEST_P(sip->sip_content_length->l_common->h_succ, sip->sip_separator);
 
-  lst = tl_list(SIPTAG_VIA(sip->sip_via), 
-		SIPTAG_RECORD_ROUTE(sip->sip_record_route), 
-		TAG_SKIP(2), 
-		SIPTAG_CSEQ(sip->sip_cseq), 
-		SIPTAG_PAYLOAD(sip->sip_payload), 
+  lst = tl_list(SIPTAG_VIA(sip->sip_via),
+		SIPTAG_RECORD_ROUTE(sip->sip_record_route),
+		TAG_SKIP(2),
+		SIPTAG_CSEQ(sip->sip_cseq),
+		SIPTAG_PAYLOAD(sip->sip_payload),
 		TAG_NULL());
-  filter1 = tl_list(SIPTAG_VIA(0), 
+  filter1 = tl_list(SIPTAG_VIA(0),
 		    TAG_NULL());
-  filter2 = tl_list(SIPTAG_CALL_ID(0), 
+  filter2 = tl_list(SIPTAG_CALL_ID(0),
 		    SIPTAG_FROM(0),
 		    SIPTAG_ROUTE(0),
 		    SIPTAG_CSEQ(0),
 		    TAG_NULL());
-  filter3 = tl_list(SIPTAG_CSEQ(0), 
-		    SIPTAG_CONTENT_LENGTH(0), 
+  filter3 = tl_list(SIPTAG_CSEQ(0),
+		    SIPTAG_CONTENT_LENGTH(0),
 		    TAG_NULL());
   filter4 = tl_list(SIPTAG_STATUS(0),
 		    SIPTAG_VIA(0),
@@ -1381,23 +1381,23 @@
   b3 = tl_afilter(home, filter3, lst);
 
   TEST_SIZE(tl_len(b3), 3 * sizeof(tagi_t));
-  TEST_SIZE(tl_xtra(b3, 0), 
+  TEST_SIZE(tl_xtra(b3, 0),
 	    sizeof(sip_content_length_t) + sizeof(sip_cseq_t));
 
   b4 = tl_afilter(home, filter4, lst);
   TEST_SIZE(tl_len(b4), 11 * sizeof(tagi_t));
   xtra = 0;
-  xtra += XTRA(xtra, sip->sip_status); 
-  xtra += XTRA(xtra, sip->sip_via); 
-  xtra += XTRA(xtra, sip->sip_via->v_next); 
+  xtra += XTRA(xtra, sip->sip_status);
+  xtra += XTRA(xtra, sip->sip_via);
+  xtra += XTRA(xtra, sip->sip_via->v_next);
   xtra += XTRA(xtra, sip->sip_record_route);
-  xtra += XTRA(xtra, sip->sip_from); 
-  xtra += XTRA(xtra, sip->sip_to); 
-  xtra += XTRA(xtra, sip->sip_call_id); 
-  xtra += XTRA(xtra, sip->sip_cseq); 
-  xtra += XTRA(xtra, sip->sip_www_authenticate); 
-  xtra += XTRA(xtra, sip->sip_proxy_authenticate); 
-  xtra += XTRA(xtra, sip->sip_content_length); 
+  xtra += XTRA(xtra, sip->sip_from);
+  xtra += XTRA(xtra, sip->sip_to);
+  xtra += XTRA(xtra, sip->sip_call_id);
+  xtra += XTRA(xtra, sip->sip_cseq);
+  xtra += XTRA(xtra, sip->sip_www_authenticate);
+  xtra += XTRA(xtra, sip->sip_proxy_authenticate);
+  xtra += XTRA(xtra, sip->sip_content_length);
   TEST_SIZE(tl_xtra(b4, 0), xtra);
 
   tl_vfree(filter1); tl_vfree(filter2); tl_vfree(filter3); tl_vfree(filter4);
@@ -1406,10 +1406,10 @@
   su_home_check(home);
 
   su_free(home, b4);
-  su_free(home, b3); 
-  su_free(home, b2); 
+  su_free(home, b3);
+  su_free(home, b2);
   su_free(home, dup);
-  su_free(home, b1); 
+  su_free(home, b1);
 
   su_home_check(home);
 
@@ -1425,7 +1425,7 @@
 {
   BEGIN();
   {
-    struct { int status; char const *phrase; } const errors[] = 
+    struct { int status; char const *phrase; } const errors[] =
       {
 	{ SIP_100_TRYING },
 	{ SIP_180_RINGING },
@@ -1507,10 +1507,10 @@
   sip_request_t        sip_request[1] = { SIP_REQUEST_INIT() };
   sip_status_t         sip_status[1]  = { SIP_STATUS_INIT() };
   sip_header_t         sip_unknown[1]  = { SIP_UNKNOWN_INIT() };
-  sip_separator_t      sip_separator[1] = { SIP_SEPARATOR_INIT() };     
+  sip_separator_t      sip_separator[1] = { SIP_SEPARATOR_INIT() };
   sip_payload_t        sip_payload[1] = { SIP_PAYLOAD_INIT() };
   sip_via_t            sip_via[1] = { SIP_VIA_INIT() };
-  sip_route_t          sip_route[1] = { SIP_ROUTE_INIT() };		
+  sip_route_t          sip_route[1] = { SIP_ROUTE_INIT() };
   sip_record_route_t   sip_record_route[1] = { SIP_RECORD_ROUTE_INIT() };
   sip_max_forwards_t   sip_max_forwards[1] = { SIP_MAX_FORWARDS_INIT() };
   sip_from_t           sip_from[1] = { SIP_FROM_INIT() };
@@ -1518,26 +1518,26 @@
   sip_call_id_t        sip_call_id[1] = { SIP_CALL_ID_INIT() };
   sip_cseq_t           sip_cseq[1] = { SIP_CSEQ_INIT() };
   sip_contact_t        sip_contact[1] = { SIP_CONTACT_INIT() };
-						
+
   sip_expires_t        sip_expires[1] = { SIP_EXPIRES_INIT() };
   sip_date_t           sip_date[1] = { SIP_DATE_INIT() };
   sip_retry_after_t    sip_retry_after[1] = { SIP_RETRY_AFTER_INIT() };
   sip_timestamp_t      sip_timestamp[1] = { SIP_TIMESTAMP_INIT() };
   sip_subject_t        sip_subject[1] = { SIP_SUBJECT_INIT() };
   sip_priority_t       sip_priority[1] = { SIP_PRIORITY_INIT() };
-		           		
+
   sip_call_info_t      sip_call_info[1] = { SIP_CALL_INFO_INIT() };
   sip_organization_t   sip_organization[1] = { SIP_ORGANIZATION_INIT() };
   sip_server_t         sip_server[1] = { SIP_SERVER_INIT() };
   sip_user_agent_t     sip_user_agent[1] = { SIP_USER_AGENT_INIT() };
   sip_in_reply_to_t    sip_in_reply_to[1] = { SIP_IN_REPLY_TO_INIT() };
-		           		
+
   sip_accept_t         sip_accept[1] = { SIP_ACCEPT_INIT() };
   sip_accept_encoding_t sip_accept_encoding[1] = { SIP_ACCEPT_ENCODING_INIT() };
   sip_accept_language_t sip_accept_language[1] = { SIP_ACCEPT_LANGUAGE_INIT() };
-   
+
   sip_session_expires_t sip_session_expires[1] = { SIP_SESSION_EXPIRES_INIT() };
-  sip_min_se_t sip_min_se[1] = { SIP_MIN_SE_INIT() };   
+  sip_min_se_t sip_min_se[1] = { SIP_MIN_SE_INIT() };
 
   sip_allow_t          sip_allow[1] = { SIP_ALLOW_INIT() };
   sip_require_t        sip_require[1] = { SIP_REQUIRE_INIT() };
@@ -1557,7 +1557,7 @@
   sip_www_authenticate_t sip_www_authenticate[1] = { SIP_WWW_AUTHENTICATE_INIT() };
   sip_error_info_t     sip_error_info[1] = { SIP_ERROR_INFO_INIT() };
   sip_warning_t        sip_warning[1] = { SIP_WARNING_INIT() };
-		       
+
   sip_mime_version_t   sip_mime_version[1] = { SIP_MIME_VERSION_INIT() };
   sip_content_type_t   sip_content_type[1] = { SIP_CONTENT_TYPE_INIT() };
   sip_content_encoding_t sip_content_encoding[1] = { SIP_CONTENT_ENCODING_INIT() };
@@ -1568,7 +1568,7 @@
 
   home = su_home_new(sizeof *home);
 
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  msg = read_message(MSG_DO_EXTRACT_COPY,
     "INVITE sip:John_Smith at tct.hut.fi SIP/2.0\r\n"
     "To: John Smith <sip:John_Smith at tct.hut.fi:5066;user=ip;maddr=131.228.16.2>\r\n"
     "  ; tag = deadbeef\r\n"
@@ -1600,24 +1600,24 @@
   TEST_1(sip->sip_via->v_next->v_next == NULL);
   TEST_1(sip_sanity_check(sip) == 0);
 
-  TEST_1(r = sip->sip_route); TEST_1(r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data); 
+  TEST_1(r = sip->sip_route); TEST_1(r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data);
   TEST_1(!r->r_next);
 
   TEST_1(r = sip_route_fix(sip->sip_route)); TEST_1(!r->r_common->h_data);
   TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data);
-  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data); 
-  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data); 
+  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data);
+  TEST_1(r = r->r_next); TEST_1(!r->r_common->h_data);
   TEST_1(!r->r_next);
 
   /* Quiet lots of warnings */
@@ -1641,21 +1641,21 @@
   TEST_P(msg_header_offset(msg, sip, sip_call_id), &sip->sip_call_id);
   TEST_P(msg_header_offset(msg, sip, sip_cseq), &sip->sip_cseq);
   TEST_P(msg_header_offset(msg, sip, sip_contact), &sip->sip_contact);
-						
+
   TEST_P(msg_header_offset(msg, sip, sip_expires), &sip->sip_expires);
   TEST_P(msg_header_offset(msg, sip, sip_date), &sip->sip_date);
   TEST_P(msg_header_offset(msg, sip, sip_retry_after), &sip->sip_retry_after);
   TEST_P(msg_header_offset(msg, sip, sip_timestamp), &sip->sip_timestamp);
   TEST_P(msg_header_offset(msg, sip, sip_subject), &sip->sip_subject);
   TEST_P(msg_header_offset(msg, sip, sip_priority), &sip->sip_priority);
-		           		
+
   TEST_P(msg_header_offset(msg, sip, sip_call_info), &sip->sip_call_info);
   TEST_P(msg_header_offset(msg, sip, sip_organization),
 	 &sip->sip_organization);
   TEST_P(msg_header_offset(msg, sip, sip_server), &sip->sip_server);
   TEST_P(msg_header_offset(msg, sip, sip_user_agent), &sip->sip_user_agent);
   TEST_P(msg_header_offset(msg, sip, sip_in_reply_to), &sip->sip_in_reply_to);
-		           		
+
   TEST_P(msg_header_offset(msg, sip, sip_accept), &sip->sip_accept);
   TEST_P(msg_header_offset(msg, sip, sip_accept_encoding),
 	 &sip->sip_accept_encoding);
@@ -1664,8 +1664,8 @@
 
   TEST_P(msg_header_offset(msg, sip, sip_session_expires),
 	 &sip->sip_session_expires);
-  TEST_P(msg_header_offset(msg, sip, sip_min_se), &sip->sip_min_se);   
-   
+  TEST_P(msg_header_offset(msg, sip, sip_min_se), &sip->sip_min_se);
+
   TEST_P(msg_header_offset(msg, sip, sip_allow), &sip->sip_allow);
   TEST_P(msg_header_offset(msg, sip, sip_require), &sip->sip_require);
   TEST_P(msg_header_offset(msg, sip, sip_proxy_require),
@@ -1689,7 +1689,7 @@
 	 &sip->sip_www_authenticate);
   TEST_P(msg_header_offset(msg, sip, sip_error_info), &sip->sip_error_info);
   TEST_P(msg_header_offset(msg, sip, sip_warning), &sip->sip_warning);
-		       
+
   TEST_P(msg_header_offset(msg, sip, sip_mime_version), &sip->sip_mime_version);
   TEST_P(msg_header_offset(msg, sip, sip_content_type), &sip->sip_content_type);
   TEST_P(msg_header_offset(msg, sip, sip_content_encoding),
@@ -1706,7 +1706,7 @@
   TEST_SIZE(sip_payload_class->hc_params, 0);
   TEST_SIZE(sip_via_class->hc_params, offsetof(sip_via_t, v_params));
   TEST_SIZE(sip_route_class->hc_params, offsetof(sip_route_t, r_params));
-  TEST_SIZE(sip_record_route_class->hc_params, 
+  TEST_SIZE(sip_record_route_class->hc_params,
 	    offsetof(sip_record_route_t, r_params));
 
   TEST_SIZE(sip_max_forwards_class->hc_params, 0);
@@ -1715,73 +1715,73 @@
   TEST_SIZE(sip_call_id_class->hc_params, 0);
   TEST_SIZE(sip_cseq_class->hc_params, 0);
   TEST_SIZE(sip_contact_class->hc_params, offsetof(sip_contact_t, m_params));
-						
+
   TEST_SIZE(sip_expires_class->hc_params, 0);
   TEST_SIZE(sip_date_class->hc_params, 0);
-  TEST_SIZE(sip_retry_after_class->hc_params, 
+  TEST_SIZE(sip_retry_after_class->hc_params,
 	    offsetof(sip_retry_after_t, af_params));
   TEST_SIZE(sip_timestamp_class->hc_params, 0);
   TEST_SIZE(sip_subject_class->hc_params, 0);
   TEST_SIZE(sip_priority_class->hc_params, 0);
-		           		
-  TEST_SIZE(sip_call_info_class->hc_params, 
+
+  TEST_SIZE(sip_call_info_class->hc_params,
 	    offsetof(sip_call_info_t, ci_params));
   TEST_SIZE(sip_organization_class->hc_params, 0);
   TEST_SIZE(sip_server_class->hc_params, 0);
   TEST_SIZE(sip_user_agent_class->hc_params, 0);
 
-  TEST_SIZE(sip_in_reply_to_class->hc_params, 
+  TEST_SIZE(sip_in_reply_to_class->hc_params,
 	    offsetof(sip_in_reply_to_t, k_items));
   TEST_SIZE(sip_accept_class->hc_params, offsetof(sip_accept_t, ac_params));
-  TEST_SIZE(sip_accept_encoding_class->hc_params, 
+  TEST_SIZE(sip_accept_encoding_class->hc_params,
 	    offsetof(sip_accept_encoding_t, aa_params));
-  TEST_SIZE(sip_accept_language_class->hc_params, 
+  TEST_SIZE(sip_accept_language_class->hc_params,
 	    offsetof(sip_accept_language_t, aa_params));
-   
+
   TEST_SIZE(sip_session_expires_class->hc_params,
 	    offsetof(sip_session_expires_t, x_params));
   TEST_SIZE(sip_min_se_class->hc_params, offsetof(sip_min_se_t, min_params));
 
   TEST_SIZE(sip_allow_class->hc_params, offsetof(sip_allow_t, k_items));
   TEST_SIZE(sip_require_class->hc_params, offsetof(sip_require_t, k_items));
-  TEST_SIZE(sip_proxy_require_class->hc_params, 
+  TEST_SIZE(sip_proxy_require_class->hc_params,
 	    offsetof(sip_proxy_require_t, k_items));
-  TEST_SIZE(sip_supported_class->hc_params, 
+  TEST_SIZE(sip_supported_class->hc_params,
 	    offsetof(sip_supported_t, k_items));
-  TEST_SIZE(sip_unsupported_class->hc_params, 
+  TEST_SIZE(sip_unsupported_class->hc_params,
 	    offsetof(sip_unsupported_t, k_items));
 
 #if SIP_HAVE_ENCRYPTION
-  TEST_SIZE(sip_encryption_class->hc_params, 
+  TEST_SIZE(sip_encryption_class->hc_params,
 	    offsetof(sip_encryption_t, au_params));
 #endif
 #if SIP_HAVE_RESPONSE_KEY
-  TEST_SIZE(sip_response_key_class->hc_params, 
+  TEST_SIZE(sip_response_key_class->hc_params,
 	    offsetof(sip_response_key_t, au_params));
 #endif
-  TEST_SIZE(sip_proxy_authenticate_class->hc_params,  
+  TEST_SIZE(sip_proxy_authenticate_class->hc_params,
 	    offsetof(sip_proxy_authenticate_t, au_params));
-  TEST_SIZE(sip_proxy_authorization_class->hc_params,  
+  TEST_SIZE(sip_proxy_authorization_class->hc_params,
 	    offsetof(sip_proxy_authorization_t, au_params));
-  TEST_SIZE(sip_authorization_class->hc_params,  
+  TEST_SIZE(sip_authorization_class->hc_params,
 	    offsetof(sip_authorization_t, au_params));
-  TEST_SIZE(sip_www_authenticate_class->hc_params,  
+  TEST_SIZE(sip_www_authenticate_class->hc_params,
 	    offsetof(sip_www_authenticate_t, au_params));
 
-  TEST_SIZE(sip_error_info_class->hc_params, 
+  TEST_SIZE(sip_error_info_class->hc_params,
 	    offsetof(sip_error_info_t, ei_params));
-  TEST_SIZE(sip_alert_info_class->hc_params, 
+  TEST_SIZE(sip_alert_info_class->hc_params,
 	    offsetof(sip_alert_info_t, ai_params));
-  TEST_SIZE(sip_reply_to_class->hc_params, 
+  TEST_SIZE(sip_reply_to_class->hc_params,
 	    offsetof(sip_reply_to_t, rplyto_params));
   TEST_SIZE(sip_warning_class->hc_params, 0);
-		       
+
   TEST_SIZE(sip_mime_version_class->hc_params, 0);
-  TEST_SIZE(sip_content_type_class->hc_params, 
+  TEST_SIZE(sip_content_type_class->hc_params,
 	    offsetof(sip_content_type_t, c_params));
-  TEST_SIZE(sip_content_encoding_class->hc_params, 
+  TEST_SIZE(sip_content_encoding_class->hc_params,
 	    offsetof(sip_content_encoding_t, k_items));
-  TEST_SIZE(sip_content_disposition_class->hc_params, 
+  TEST_SIZE(sip_content_disposition_class->hc_params,
 	    offsetof(sip_content_disposition_t, cd_params));
   TEST_SIZE(sip_content_length_class->hc_params, 0);
 
@@ -1796,10 +1796,10 @@
 {
   sip_header_t *sh = (sip_header_t *)h;
   unsigned n;
-  
+
   for (n = 0; sh; sh = sh->sh_next)
     n++;
-  
+
   return n;
 }
 
@@ -1830,7 +1830,7 @@
 
   home = su_home_new(sizeof *home);
 
-  TEST_1(msg = read_message(MSG_DO_EXTRACT_COPY, 
+  TEST_1(msg = read_message(MSG_DO_EXTRACT_COPY,
     "MESSAGE sip:John_Smith at tct.hut.fi SIP/2.0\r\n"
     "To: John Smith <sip:John_Smith at tct.hut.fi:5066;user=ip;maddr=131.228.16.2>\r\n"
     "  ; tag = deadbeef\r\n"
@@ -1928,9 +1928,9 @@
       TEST_1(v->v_branch == v0->v_branch);
   }
   TEST_1(v == NULL && v0 == NULL);
-  
+
   v0 = sip->sip_via;
-  
+
   TEST_1(v = sip_via_dup(home, v0));
   TEST(len(v->v_common), len(v0->v_common));
   for (; v && v0; v = v->v_next, v0 = v0->v_next) {
@@ -1951,7 +1951,7 @@
 
   msg_header_remove(msg, (msg_pub_t *)sip, (msg_header_t *)sip->sip_payload);
 
-  TEST(sip_add_tl(msg, sip, 
+  TEST(sip_add_tl(msg, sip,
 		  SIPTAG_FROM(SIP_NONE),
 		  SIPTAG_VIA(SIP_NONE),
 		  SIPTAG_VIA_STR("SIP/2.0/SCTP foo.bar.com:5060;branch=foo"),
@@ -1997,7 +1997,7 @@
   TEST_P(x, sip->sip_path->r_next);
 
   TEST_1(x = sip->sip_service_route);
-  TEST_1(sip_add_make(msg, sip, sip_service_route_class, 
+  TEST_1(sip_add_make(msg, sip, sip_service_route_class,
 		      "<sip:135.180.130.133>") == 0);
   TEST_P(x, sip->sip_service_route);
   TEST_1(sip->sip_service_route->r_next);
@@ -2005,7 +2005,7 @@
   /* Detect parsing errors */
   TEST_1(!sip_cseq_make(home, "21874624876976 INVITE"));
   TEST_1(!sip_cseq_make(home, "218746INVITE"));
-  
+
   msg_destroy(msg), msg = NULL;
 
   su_home_unref(home), home = NULL;
@@ -2023,7 +2023,7 @@
 
   home = su_home_new(sizeof *home);
 
-  TEST_1(msg = read_message(MSG_DO_EXTRACT_COPY, 
+  TEST_1(msg = read_message(MSG_DO_EXTRACT_COPY,
     "MESSAGE <sip:John_Smith at tct.hut.fi> SIP/2.0\r\n"
     "To: John Smith <sip:John_Smith at tct.hut.fi:5066;user=ip;maddr=131.228.16.2>\r\n"
     "  ; tag = deadbeef\r\n"
@@ -2066,7 +2066,7 @@
 
   home = su_home_new(sizeof *home);
 
-  TEST_1(msg = read_message(0, 
+  TEST_1(msg = read_message(0,
     "MESSAGE sip:John_Smith at tct.hut.fi SIP/2.0\r\n"
     "To: John Smith <sip:John_Smith at tct.hut.fi:5066;user=ip;maddr=131.228.16.2>\r\n"
     "From: <sip:joe at doe.org>;tag=foobar\r\n"
@@ -2141,7 +2141,7 @@
   su_home_t *home;
   sip_rack_t *rack, *rack0;
   sip_rseq_t *rseq, *rseq0;
-  
+
   BEGIN();
 
   TEST_1(home = su_home_create());
@@ -2156,7 +2156,7 @@
   TEST_1(rack0 = sip_rack_dup(home, rack));
   TEST_P(rack0->ra_method_name, rack->ra_method_name);
   TEST_1(rseq0 = sip_rseq_dup(home, rseq));
-  
+
   TEST_1(rack = sip_rack_make(home, "4\r\n\t5\r\n\tEXTRA"));
   TEST(rack->ra_response, 4);
   TEST(rack->ra_cseq, 5);
@@ -2164,13 +2164,13 @@
   TEST_S(rack->ra_method_name, "EXTRA");
   TEST_1(rseq = sip_rseq_make(home, "  6  "));
   TEST(rseq->rs_response, 6);
-  
+
   TEST_1(rack0 = sip_rack_dup(home, rack));
   TEST_1(rack0->ra_method_name != rack->ra_method_name);
   TEST_1(rseq0 = sip_rseq_dup(home, rseq));
 
   su_home_unref(home);
-  
+
   END();
 }
 
@@ -2204,7 +2204,7 @@
   TEST_1(aa = sip_accept_encoding_make(home, "gzip;q=1.0,deflate;q=1.0"));
   TEST_S(aa->aa_value, "gzip"); TEST_S(aa->aa_q, "1.0");
   TEST_1(aa->aa_next);
-  TEST_S(aa->aa_next->aa_value, "deflate"); 
+  TEST_S(aa->aa_next->aa_value, "deflate");
   TEST_1(aa = sip_accept_encoding_make(home, ","));
   TEST_S(aa->aa_value, ""); TEST_1(!aa->aa_next);
   TEST_1(aa = sip_accept_encoding_make(home, ""));
@@ -2214,7 +2214,7 @@
   TEST_1(aa = sip_accept_language_make(home, "fi;q=1.0,sv;q=1.0"));
   TEST_S(aa->aa_value, "fi"); TEST_S(aa->aa_q, "1.0");
   TEST_1(aa->aa_next);
-  TEST_S(aa->aa_next->aa_value, "sv"); 
+  TEST_S(aa->aa_next->aa_value, "sv");
   TEST_1(aa = sip_accept_language_make(home, ","));
   TEST_S(aa->aa_value, ""); TEST_1(!aa->aa_next);
   TEST_1(aa = sip_accept_language_make(home, ""));
@@ -2293,8 +2293,8 @@
 	  "opaque=\"423767123y723742376423762376423784623782a794e58\",\n"
 	  "stale=FALSE,algorithm=MD5"));
   TEST_S(www->au_scheme, "Digest");
-  TEST_1(www->au_params && www->au_params[0] && www->au_params[1] && www->au_params[2] && 
-	 www->au_params[3] && www->au_params[4] && www->au_params[5] && 
+  TEST_1(www->au_params && www->au_params[0] && www->au_params[1] && www->au_params[2] &&
+	 www->au_params[3] && www->au_params[4] && www->au_params[5] &&
 	 !www->au_params[6]);
   TEST_1(s = sip_header_as_string(home, (sip_header_t *)www));
   TEST_1(strlen(s) >= 128);
@@ -2387,7 +2387,7 @@
 
   END();
 }
-   
+
 int test_refer(void)
 {
   sip_refer_to_t *r, *r0;
@@ -2399,7 +2399,7 @@
 
   BEGIN();
 
-  char const m[] = 
+  char const m[] =
     "REFER sip:10.3.3.104 SIP/2.0\r\n"
     "Via: SIP/2.0/UDP 10.3.3.8;branch=z9hG4bKb8389b4c1BA8899\r\n"
     "From: \"Anthony Minessale\" <sip:polycom500 at 10.3.3.104>;tag=5AA04E0-66CFC37F\r\n"
@@ -2425,9 +2425,9 @@
   TEST_1(home = su_home_create());
 
   /* Check that Refer-Sub has now been added to our parser */
-  TEST_1(msg_mclass_insert_with_mask(test_mclass, sip_refer_sub_class, 
+  TEST_1(msg_mclass_insert_with_mask(test_mclass, sip_refer_sub_class,
 				     0, 0) == -1);
-  
+
   msg = read_message(0, m); TEST_1(msg); TEST_1(sip = sip_object(msg));
   TEST_1(sip->sip_refer_to);
   TEST_S(sip->sip_refer_to->r_url->url_headers,
@@ -2441,10 +2441,10 @@
   TEST_1(veclen = msg_iovec(msg, NULL, ISIZE_MAX));
   TEST_1(iovec = su_zalloc(msg_home(home), veclen * (sizeof iovec[0])));
   TEST_SIZE(msg_iovec(msg, iovec, veclen), veclen);
-  
+
   for (i = 0, size = 0; i < veclen; i++)
     size += iovec[i].mv_len;
-  
+
   TEST_1(back = su_zalloc(msg_home(msg), size + 1));
 
   for (i = 0, size = 0; i < veclen; i++) {
@@ -2452,7 +2452,7 @@
     size += iovec[i].mv_len;
   }
   back[size] = '\0';
-  
+
   TEST_S(back, m);
 
   TEST_1(r = r0 = sip_refer_to_make(home, "http://example.com;foo=bar"));
@@ -2474,7 +2474,7 @@
   TEST_P(r->r_params, NULL);
   TEST_S(sip_header_as_string(home, (sip_header_t*)r), s0);
 
-  TEST_1(r = r0 = sip_refer_to_make(home, 
+  TEST_1(r = r0 = sip_refer_to_make(home,
 				    "Web Site <http://example.com>;foo=bar"));
   TEST_S(r->r_display, "Web Site");
   TEST(r->r_url->url_type, url_http);
@@ -2497,7 +2497,7 @@
     TEST_1(r = r0 = sip_refer_to_make(home, s));
     msg_fragment_clear(r->r_common);
     TEST_1(str = sip_header_as_string(home, (void *)r));
-    TEST_S(str, 
+    TEST_S(str,
 	   "<"
 	   "sip:2000 at 10.3.3.104?Replaces=7d84c014-321368da-efa90f41%4010.3.3.8"
 	   "%3Bto-tag%3DpaNKgBB9vQe3D%3Bfrom-tag%3D93AC8D50-7CF6DAAF"
@@ -2505,15 +2505,15 @@
   }
 
   su_home_unref(home);
-    
+
   TEST_1(home = su_home_create());
-  TEST_1(b = b0 = sip_referred_by_make(home, 
+  TEST_1(b = b0 = sip_referred_by_make(home,
 				      "sip:joe at example.edu;param=value"));
   TEST_P(b->b_display, NULL);
   TEST_1(b->b_params);
   TEST_P(b->b_cid, NULL);
 
-  TEST_1(b = sip_referred_by_make(home, 
+  TEST_1(b = sip_referred_by_make(home,
 				  "John Doe <sip:joe at example.edu>"
 				  ";cid=\"foo at bar\""));
   TEST_S(b->b_display, "John Doe");
@@ -2533,7 +2533,7 @@
   TEST_S(b->b_cid, "cid:8u432658725");
   TEST(msg_header_remove_param(b->b_common, "cid"), 1);
   TEST_P(b->b_cid, NULL);
-  
+
   /* XXX */
 #define WORD ALPHA DIGIT "-.!%*_+`'~()<>:\\\"/[]?{}"
   rp = sip_replaces_make(home, WORD "@" WORD ";to-tag=foo;from-tag=bar"
@@ -2586,10 +2586,10 @@
   TEST_1(s->k_items); TEST_S(s->k_items[0], "foo");
 
   TEST_1(u = sip_has_unsupported(home, s, pr));
-  TEST_1(u->k_items); 
-  TEST_S(u->k_items[0], "bar");  
-  TEST_S(u->k_items[1], "dig");  
-  TEST_P(u->k_items[2], NULL);  
+  TEST_1(u->k_items);
+  TEST_S(u->k_items[0], "bar");
+  TEST_S(u->k_items[1], "dig");
+  TEST_P(u->k_items[2], NULL);
 
   TEST_1(u1 = sip_has_unsupported(home, s, r));
   TEST_1(u1->k_items); TEST_S(u1->k_items[0], "dig"); TEST_1(!u1->k_items[1]);
@@ -2622,7 +2622,7 @@
 				 sip_time_t def,
 				 sip_time_t now);
 
-  
+
   END();
 }
 #endif
@@ -2670,7 +2670,7 @@
   TEST(sip_allow_events_add(home, ae, "event8"), 0);
   TEST_S(ae->k_items[8], "event8");
 
-  TEST_1((ss = 
+  TEST_1((ss =
 	 sip_subscription_state_make(home, "terminated ; reason=timeout")));
   TEST_S(ss->ss_substate, "terminated");
   TEST_S(ss->ss_reason, "timeout");
@@ -2686,12 +2686,12 @@
   TEST_S(ss->ss_expires, "200");
   TEST_S(ss->ss_retry_after, "10");
 
-  TEST_1((ss = 
+  TEST_1((ss =
 	 sip_subscription_state_make(home, "active;expires=2")));
   TEST_S(ss->ss_substate, "active");
   TEST_S(ss->ss_expires, "2");
 
-  TEST_1((ss = 
+  TEST_1((ss =
 	  sip_subscription_state_make(home, "terminated;retry-after=3600")));
   TEST_S(ss->ss_substate, "terminated");
   TEST_P(ss->ss_expires, NULL);
@@ -2702,7 +2702,7 @@
   TEST_P(ss->ss_expires, NULL);
   TEST_S(ss->ss_retry_after, "3600");
 
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  msg = read_message(MSG_DO_EXTRACT_COPY,
     "SIP/2.0 202 Accepted\r\n"
     "To: <sip:foo at bar>;tag=deadbeef\r\n"
     "From: <sip:bar at foo>;\r\n"
@@ -2772,11 +2772,11 @@
   TEST_1(p = sip_path_make(home, "<sip:foo@[baa::1]:5060>;lr"));
   TEST_1(p0 = sip_path_dup(home, p));
 
-  su_free(home, p); 
+  su_free(home, p);
   su_free(home, p0);
 
   TEST_1(!sip_service_route_make(home, "<sip:foo@[bar:50>;lr"));
-  TEST_1(!sip_service_route_make(home, 
+  TEST_1(!sip_service_route_make(home,
 				 "<sip:foo@[baa::1]>;lr bar, sip:foo"));
 
   TEST_1(sr = sip_service_route_make(home, "<sip:foo@[baa::1]:5060>;lr"));
@@ -2784,7 +2784,7 @@
   su_free(home, sr);
 
   TEST_1(sr = sip_service_route_make(home, "sip:foo@[baa::1]:5060;lr"));
-  
+
   su_free(home, sr);
   su_free(home, sr0);
 
@@ -2856,9 +2856,9 @@
   TEST_1(!sip_is_callerpref(NULL));
   TEST_1(sip_is_callerpref("+"));
   TEST_1(sip_is_callerpref("+foo"));
-  
+
   /* Booleans (treated as literals) */
-  s = "TRUE"; 
+  s = "TRUE";
   negate = 2; memset(sp, 0, sizeof sp);
   TEST_1(sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_literal);
@@ -2866,8 +2866,8 @@
   TEST_1(sip_prefs_match(sp, sp));
   TEST_1(!sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_init);
-  
-  s = "FALSE"; 
+
+  s = "FALSE";
   negate = 2; memset(sp, 0, sizeof sp);
   TEST_1(sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_literal);
@@ -2875,11 +2875,11 @@
   TEST_1(sip_prefs_match(sp, sp));
   TEST_1(!sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_init);
-  
+
   s = "\"!TRUE,!FALSE\""; negate = 0;
   TEST_1(sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_literal); TEST_1(negate);
-  
+
   /* Literal */
   s = "\" !oukki , doukki  \""; negate = 0; memset(sp, 0, sizeof sp);
 
@@ -2887,7 +2887,7 @@
   TEST(sp->sp_type, sp_literal);
   TEST_SIZE(sp->sp_literal.spl_length, 5);
   TEST_M(sp->sp_literal.spl_value, "oukki", 5); TEST_1(negate);
-  
+
   TEST_1(sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_literal);
   TEST_SIZE(sp->sp_literal.spl_length, 6);
@@ -2897,19 +2897,19 @@
   TEST(sp->sp_type, sp_init);
 
   /* Strings */
-  s = "\" !<oukki> , <douK\\\"ki  >\""; 
+  s = "\" !<oukki> , <douK\\\"ki  >\"";
   negate = 0; memset(sp, 0, sizeof sp);
 
   TEST_1(sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_string);
   TEST_SIZE(sp->sp_string.sps_length, 5);
   TEST_M(sp->sp_string.sps_value, "oukki", 5); TEST_1(negate);
-  
+
   TEST_1(sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_string);
   TEST_SIZE(sp->sp_string.sps_length, 10);
   TEST_M(sp->sp_string.sps_value, "douK\\\"ki  ", 10); TEST_1(!negate);
-  
+
   TEST_1(!sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_init);
 
@@ -2925,7 +2925,7 @@
   TEST_1(negate);
 
   *a = *sp;
-    
+
   TEST_1(sip_prefs_parse(sp, &s, &negate));
   TEST(sp->sp_type, sp_range);
   TEST_D(sp->sp_range.spr_lower, -DBL_MAX);
@@ -3007,15 +3007,15 @@
 
   error = 12;
 
-  TEST_1(sip_prefs_matching("\"INVITE,MESSAGE,SUBSCRIBE\"", 
-			    "\"INVITE\"", &error)); 
-  TEST_1(!sip_prefs_matching("\"INVITE,MESSAGE,SUBSCRIBE\"", 
-			     "\"BYE\"", &error)); 
+  TEST_1(sip_prefs_matching("\"INVITE,MESSAGE,SUBSCRIBE\"",
+			    "\"INVITE\"", &error));
+  TEST_1(!sip_prefs_matching("\"INVITE,MESSAGE,SUBSCRIBE\"",
+			     "\"BYE\"", &error));
   TEST(error, 12);
-  TEST_1(sip_prefs_matching("\"INVITE,MESSAGE,SUBSCRIBE\"", 
-			     "\"invite\"", &error)); 
-  TEST_1(sip_prefs_matching("\"!INVITE,MESSAGE,SUBSCRIBE\"", 
-			     "\"foo\"", &error)); 
+  TEST_1(sip_prefs_matching("\"INVITE,MESSAGE,SUBSCRIBE\"",
+			     "\"invite\"", &error));
+  TEST_1(sip_prefs_matching("\"!INVITE,MESSAGE,SUBSCRIBE\"",
+			     "\"foo\"", &error));
   TEST_1(sip_prefs_matching("TRUE", "", &error));
   TEST_1(sip_prefs_matching("", "", &error));
   TEST_1(!sip_prefs_matching("FALSE", "", &error));
@@ -3031,32 +3031,32 @@
   TEST_1(sip_prefs_matching("\"!<INVITE>\"", "\"<invite>\"", &error));
   TEST_1(!sip_prefs_matching("\"INVITE\"", "\"!INVITE\"", &error));
   TEST_1(sip_prefs_matching("\"!INVITE\"", "\"INVITE,MESSAGE\"", &error));
-  TEST_1(sip_prefs_matching("\"!INVITE,!MESSAGE\"", 
+  TEST_1(sip_prefs_matching("\"!INVITE,!MESSAGE\"",
 			     "\"INVITE,MESSAGE\"", &error));
   TEST_1(sip_prefs_matching("\"!MESSAGE\"", "\"INVITE,MESSAGE\"", &error));
-  TEST_1(!sip_prefs_matching("\"<foo>,<bar>\"", 
-			     "\"<FOO>,<BAR>\"", &error)); 
-  TEST_1(!sip_prefs_matching("\"<FOO>,<BAR>\"", "\"foo,bar\"", &error)); 
-  TEST_1(sip_prefs_matching("\"#=1\"", "\"#<=2\"", &error)); 
-  TEST_1(sip_prefs_matching("\"#1:2\"", "\"#<=2\"", &error)); 
-  TEST_1(!sip_prefs_matching("\"#1:2\"", "\"!#>=1,!#<=2\"", &error)); 
-  TEST_1(!sip_prefs_matching("\"#=0,#=1\"", "\"<FOO>,<BAR>\"", &error)); 
+  TEST_1(!sip_prefs_matching("\"<foo>,<bar>\"",
+			     "\"<FOO>,<BAR>\"", &error));
+  TEST_1(!sip_prefs_matching("\"<FOO>,<BAR>\"", "\"foo,bar\"", &error));
+  TEST_1(sip_prefs_matching("\"#=1\"", "\"#<=2\"", &error));
+  TEST_1(sip_prefs_matching("\"#1:2\"", "\"#<=2\"", &error));
+  TEST_1(!sip_prefs_matching("\"#1:2\"", "\"!#>=1,!#<=2\"", &error));
+  TEST_1(!sip_prefs_matching("\"#=0,#=1\"", "\"<FOO>,<BAR>\"", &error));
   TEST(error, 12);
 
   error = 12;
-  TEST_1(!sip_prefs_matching("\"<foo>,#=1\"", "\"<FOO>,<BAR>\"", &error)); 
+  TEST_1(!sip_prefs_matching("\"<foo>,#=1\"", "\"<FOO>,<BAR>\"", &error));
   TEST(error, -1);
 
   error = 12;
-  TEST_1(!sip_prefs_matching("\"<FOO>,<BAR>\"", "\"<foo>,#=1\"", &error)); 
+  TEST_1(!sip_prefs_matching("\"<FOO>,<BAR>\"", "\"<foo>,#=1\"", &error));
   TEST(error, -1);
 
   error = 12;
-  TEST_1(!sip_prefs_matching("\"<foo>,bar\"", "\"<FOO>,<BAR>\"", &error)); 
+  TEST_1(!sip_prefs_matching("\"<foo>,bar\"", "\"<FOO>,<BAR>\"", &error));
   TEST(error, -1);
 
   error = 12;
-  TEST_1(!sip_prefs_matching("\"<FOO>,<BAR>\"", "\"<foo>,#12:12\"", &error)); 
+  TEST_1(!sip_prefs_matching("\"<FOO>,<BAR>\"", "\"<foo>,#12:12\"", &error));
   TEST(error, -1);
 
   {
@@ -3083,7 +3083,7 @@
     TEST_1(!sip_is_callerpref("+methods=\"foo\""));
   }
 
-  TEST_1(m = sip_contact_make(home, 
+  TEST_1(m = sip_contact_make(home,
 			      "<sip:1 at domain>;video;audio;type=\"<video/H263>\","
 			      "<sip:2 at domain>;video=FALSE;audio;text,"
 			      "<sip:3 at domain>;text;audio=FALSE"));
@@ -3106,37 +3106,37 @@
 
   TEST_1(sip_contact_accept(m0, ac, &S, &N, &error)); TEST(S, 2); TEST(N, 2);
   TEST_1(!sip_contact_accept(m1, ac, &S, &N, &error));
-  TEST_1(!sip_contact_accept(m2, ac, &S, &N, &error)); 
+  TEST_1(!sip_contact_accept(m2, ac, &S, &N, &error));
 
-  TEST_1(ac = sip_accept_contact_make(home, 
+  TEST_1(ac = sip_accept_contact_make(home,
 				      "Joe the Luser "
 				      "<sip:127.0.0.1:5060>;video;audio"));
   TEST_S(ac->cp_params[0], "video");
   TEST_S(ac->cp_params[1], "audio");
   TEST_P(ac->cp_params[2], NULL);
 
-  TEST_1(ac = sip_accept_contact_make(home, 
+  TEST_1(ac = sip_accept_contact_make(home,
 				      "video;audio;explicit"));
   TEST_S(ac->cp_params[0], "video");
   TEST_S(ac->cp_params[1], "audio");
   TEST_S(ac->cp_params[2], "explicit");
   TEST_P(ac->cp_params[3], NULL);
 
-  TEST_1(ac = sip_accept_contact_make(home, 
+  TEST_1(ac = sip_accept_contact_make(home,
 				      "video = foo ;audio;explicit"));
   TEST_S(ac->cp_params[0], "video=foo");
   TEST_S(ac->cp_params[1], "audio");
   TEST_S(ac->cp_params[2], "explicit");
   TEST_P(ac->cp_params[3], NULL);
 
-  TEST_1(ac = sip_accept_contact_make(home, 
+  TEST_1(ac = sip_accept_contact_make(home,
 				      "video = \"bar\" ;audio;explicit"));
   TEST_S(ac->cp_params[0], "video=\"bar\"");
   TEST_S(ac->cp_params[1], "audio");
   TEST_S(ac->cp_params[2], "explicit");
   TEST_P(ac->cp_params[3], NULL);
-  
-  TEST_1(cp = sip_accept_contact_make(home, 
+
+  TEST_1(cp = sip_accept_contact_make(home,
 				     "*;audio;video;require;explicit;q=1.0,"
 				     "*;audio;require;q=0.8"
 				     ));
@@ -3156,8 +3156,8 @@
 
   TEST_1(sip_contact_accept(m0, ac, &S, &N, &error)); TEST(S, 2); TEST(N, 2);
   /* Explicit has short-circuit evaluation */
-  TEST_1(!sip_contact_accept(m1, ac, &S, &N, &error)); 
-  TEST_1(!sip_contact_accept(m2, ac, &S, &N, &error)); 
+  TEST_1(!sip_contact_accept(m1, ac, &S, &N, &error));
+  TEST_1(!sip_contact_accept(m2, ac, &S, &N, &error));
 
   TEST_1(ac = ac->cp_next);
 
@@ -3174,7 +3174,7 @@
 
   TEST_P(ac->cp_next, NULL);
 
-  TEST_1(rejc = sip_reject_contact_make(home, 
+  TEST_1(rejc = sip_reject_contact_make(home,
 					"*;type=\"<video/H263>\";video=TRUE"));
   TEST_S(rejc->cp_params[0], "type=\"<video/H263>\"");
   TEST_S(rejc->cp_params[1], "video=TRUE");
@@ -3184,7 +3184,7 @@
   TEST_1(!sip_contact_reject(m2, rejc));
 
   TEST_1(!sip_contact_immune(m0));
-  m0 = sip_contact_immunize(home, m0); TEST_1(m0); 
+  m0 = sip_contact_immunize(home, m0); TEST_1(m0);
   TEST_1(sip_contact_immune(m0));
 
   TEST_1(!sip_contact_immune(m1));
@@ -3237,7 +3237,7 @@
   int S;
   sip_contact_t *m, *m1, *m2, *m3, *m4, *m5;
 
-  char const contact[] = 
+  char const contact[] =
     "sip:u1 at h.example.com;audio;video;methods=\"INVITE,BYE\";q=0.2,"
     "sip:u2 at h.example.com;audio=\"FALSE\";"
     "methods=\"INVITE\";actor=\"msg-taker\";q=0.2,"
@@ -3246,10 +3246,10 @@
     "sip:u4 at h.example.com;audio;methods=\"INVITE,OPTIONS\";q=0.2,"
     "sip:u5 at h.example.com;q=0.5";
 
-  char const reject[] = 
+  char const reject[] =
     "*;actor=\"msg-taker\";video";
 
-  char const accept[] = 
+  char const accept[] =
     "*;audio;require,"
     "*;video;explicit,"
     "*;methods=\"BYE\";class=\"business\";q=1.0";
@@ -3291,7 +3291,7 @@
   TEST_S(re->re_cause, "200");
   TEST_S(re->re_text, "\"Ok\"");
 
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  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"
@@ -3307,7 +3307,7 @@
 
   sip = sip_object(msg);
 
-  TEST_1(msg); 
+  TEST_1(msg);
   TEST_1(sip);
   TEST_1(re = sip->sip_reason);
   TEST_S(re->re_protocol, "SIP");
@@ -3341,7 +3341,7 @@
 
   /* Not a token */
   TEST_1(!sip_reason_make(home, "\"nSIP\";cause=200;text=\"Ok\""));
-  /* Empty list */ 
+  /* Empty list */
   TEST_1(!sip_reason_make(home, ","));
   /* no protocol token */
   TEST_1(!sip_reason_make(home, "cause=16;text=\"call cleared\""));
@@ -3368,7 +3368,7 @@
 
   TEST_1(home = su_home_create());
 
-  TEST_1((w = sip_warning_make(home, 
+  TEST_1((w = sip_warning_make(home,
 			       "399 host:5060 \"Ok\", "
 			       "399 [::1]:39999 \"foo\\\" bar\"")));
   TEST(w->w_code, 399);
@@ -3383,7 +3383,7 @@
   TEST_S(w->w_text, "foo\" bar");
   TEST_1(w->w_next == NULL);
 
-  TEST_S(sip_header_as_string(home, (sip_header_t *)w), 
+  TEST_S(sip_header_as_string(home, (sip_header_t *)w),
 	 "399 [::1]:39999 \"foo\\\" bar\"");
 
   su_home_unref(home);
@@ -3406,7 +3406,7 @@
 
   BEGIN();
 
-  msg = read_message(MSG_DO_EXTRACT_COPY, 
+  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"
@@ -3419,7 +3419,7 @@
   sip = sip_object(msg);
 
   TEST_1(home = msg_home(msg));
-  
+
   TEST_1(sac = sip_security_client_make(home, "digest;q=0.5,ipsec-3gpp"));
   TEST_S(sac->sa_mec, "digest");
   TEST_S(sac->sa_q, "0.5");
@@ -3458,7 +3458,7 @@
 
   END();
 }
- 
+
 
 static int test_utils(void)
 {
@@ -3492,23 +3492,23 @@
   TEST_S(f->a_url->url_params, "test=1");
 
   TEST_1(secs = sip_security_server_make(home, "Digest"));
-  TEST_1(secv = 
-	 sip_security_verify_make(home, 
+  TEST_1(secv =
+	 sip_security_verify_make(home,
 				  "Digest;"
 				  "d-ver=\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\""));
-  
+
   TEST_1(sip_security_verify_compare(secs, secv, &d_ver) == 0);
   TEST_S(d_ver, "\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"");
 
-  TEST_1(secs = 
-	 sip_security_server_make(home, 
+  TEST_1(secs =
+	 sip_security_server_make(home,
 				  "TLS;q=1,"
 				  "Digest;q=0.1;"
 				  "d-alg=MD5;d-qop=\"auth,auth-int\","
 				  "Digest;d-alg=AKA-MD5;q=0.9"
 				  ));
-  TEST_1(secv = 
-	 sip_security_verify_make(home, 
+  TEST_1(secv =
+	 sip_security_verify_make(home,
 				  "TLS;q=1,"
 				  "Digest ; q = 0.1;"
 				  "d-ver=\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\";"
@@ -3521,12 +3521,12 @@
   TEST_1(sip_security_verify_compare(secs->sa_next, secv, &d_ver) != 0);
   TEST_1(sip_security_verify_compare(secs, secv->sa_next, &d_ver) != 0);
   d_ver = "kuik";
-  TEST_1(sip_security_verify_compare(secs->sa_next, secv->sa_next, &d_ver) 
+  TEST_1(sip_security_verify_compare(secs->sa_next, secv->sa_next, &d_ver)
 	 == 0);
   TEST_S(d_ver, "\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"");
   d_ver = "kuik";
-  TEST_1(sip_security_verify_compare(secs->sa_next->sa_next, 
-				     secv->sa_next->sa_next, &d_ver) 
+  TEST_1(sip_security_verify_compare(secs->sa_next->sa_next,
+				     secv->sa_next->sa_next, &d_ver)
 	 == 0);
   TEST_1(d_ver == NULL);
 
@@ -3535,15 +3535,15 @@
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
-	  "usage: %s [-v] [-a]\n", 
+  fprintf(stderr,
+	  "usage: %s [-v] [-a]\n",
 	  name);
   exit(exitcode);
 }
 
 char *lastpart(char *path)
 {
-  if (strchr(path, '/')) 
+  if (strchr(path, '/'))
     return strrchr(path, '/') + 1;
   else
     return path;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/validator.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/validator.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sip/validator.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@internal @IFILE validator.c  
+/**@internal @IFILE validator.c
  *
  * SIP parser tester. This uses output from tport dump where messages are
  * separated with Control-K ('\v') from each other.
@@ -74,7 +74,7 @@
   unsigned o_very_verbose : 1;	/**< Be very verbose */
   unsigned o_requests : 1;	/**< Only requests */
   unsigned o_responses : 1;	/**< Only responses */
-  unsigned o_decode : 1;	/**< Only try to decode, 
+  unsigned o_decode : 1;	/**< Only try to decode,
 				   print error if unknown headers */
   unsigned o_print : 1;		/**< Print whole message */
   unsigned o_times : 1;		/**< Generate timing information */
@@ -107,7 +107,7 @@
 {
   if (h->bsize > 1)
     n /= h->bsize;
-    
+
   if (n < h->N)
     return &h->buckets[n];
   else
@@ -119,7 +119,7 @@
 {
   size_t i;
   assert(h->N == n->N); assert(h->bsize == n->bsize);
-  
+
   for (i = 0; i <= h->N; i++) {
     if (n->buckets[i]) {
       h->buckets[i] /= n->buckets[i];
@@ -165,8 +165,8 @@
 
 void usage(void)
 {
-  fprintf(stderr, 
-	  "usage: %s [-vdp]\n", 
+  fprintf(stderr,
+	  "usage: %s [-vdp]\n",
 	  name);
   exit(2);
 }
@@ -175,7 +175,7 @@
 {
   char *p = strrchr(path, '/');
 
-  if (p) 
+  if (p)
     return p + 1;
   else
     return path;
@@ -204,23 +204,23 @@
     else if (argv[1][1] == 0) {
       argv++; break;
     }
-    else if (strcmp(argv[1], "-v") == 0) 
+    else if (strcmp(argv[1], "-v") == 0)
       o->o_very_verbose = o->o_verbose, o->o_verbose = 1;
-    else if (strcmp(argv[1], "-d") == 0) 
+    else if (strcmp(argv[1], "-d") == 0)
       o->o_decode = 1;		/* Decode only */
-    else if (strcmp(argv[1], "-p") == 0) 
+    else if (strcmp(argv[1], "-p") == 0)
       o->o_print = 1;
-    else if (strcmp(argv[1], "-q") == 0) 
+    else if (strcmp(argv[1], "-q") == 0)
       o->o_requests = 1;
-    else if (strcmp(argv[1], "-Q") == 0) 
+    else if (strcmp(argv[1], "-Q") == 0)
       o->o_responses = 1;
-    else if (strcmp(argv[1], "-t") == 0) 
+    else if (strcmp(argv[1], "-t") == 0)
       o->o_times = 1;
-    else if (strcmp(argv[1], "-m") == 0) 
+    else if (strcmp(argv[1], "-m") == 0)
       o->o_memstats = 1;
-    else if (strcmp(argv[1], "-s") == 0) 
+    else if (strcmp(argv[1], "-s") == 0)
       o->o_vsipstats = o->o_sipstats, o->o_sipstats = 1;
-    else if (strcmp(argv[1], "-h") == 0) 
+    else if (strcmp(argv[1], "-h") == 0)
       o->o_histogram = 1;
     else
       usage();
@@ -246,7 +246,7 @@
     validate_file(0, "", ctx);
 
   report(ctx);
-  
+
   exit(0);
 }
 
@@ -289,11 +289,11 @@
   errno = EINVAL;
   perror("mmap not implemented");
   return -1;
-#endif    
+#endif
 
 }
 
-su_inline 
+su_inline
 void nul_terminate(char *b, off_t size)
 {
   char *end;
@@ -320,9 +320,9 @@
       return 1;			/* status */
 
     linelen = strcspn(b, "\r\n");
-    
-    if (linelen > plen + 1 && 
-	b[linelen - plen - 1] == ' ' && 
+
+    if (linelen > plen + 1 &&
+	b[linelen - plen - 1] == ' ' &&
 	strncmp(b + linelen - plen, protocol, plen) == 0)
       return 1;			/* request */
 
@@ -334,7 +334,7 @@
 int validate_dump(char *b, off_t size, context_t *ctx)
 {
   size_t n = 0, N = 0;
-  struct message { 
+  struct message {
     char *b;
     int   size;
   } *msgs = NULL;
@@ -352,7 +352,7 @@
     if (o->o_responses &&
 	memcmp(b, SIP_VERSION_CURRENT, strlen(SIP_VERSION_CURRENT)) != 0)
       ;
-    else if (o->o_requests && 
+    else if (o->o_requests &&
 	memcmp(b, SIP_VERSION_CURRENT, strlen(SIP_VERSION_CURRENT)) == 0)
       ;
     else {
@@ -361,7 +361,7 @@
 
       if (n == N) {
 	N *= 2; if (n == N) N = 16;
-      
+
 	msgs = realloc(msgs, sizeof(*msgs) * N);
 	if (msgs == NULL) {
 	  perror("realloc");
@@ -370,13 +370,13 @@
       }
       msgs[n].b = b; msgs[n].size = msize;
       n++;
-      
+
       ctx->bytes += msize;
-      
+
       if (msize > maxsize)
 	maxsize = msize;
     }
-    
+
     b += msize; if (*b) *b++ = '\0';
   }
 
@@ -408,16 +408,16 @@
 
     if (o->o_memstats)
       su_home_init_stats(msg_home(msg));
-    
+
     msg_buf_set(msg, msgs[n].b, msgs[n].size + 1);
     msg_buf_commit(msg, msgs[n].size, 1);
-    
+
     su_home_preload(msg_home(msg), 1, msgs[n].size + 384);
 
     m = msg_extract(msg);
 
     if (m < 0) {
-      fprintf(stderr, "%s%sparsing error in message "MOD_ZU"\n", 
+      fprintf(stderr, "%s%sparsing error in message "MOD_ZU"\n",
 	      ctx->name, ctx->sep, n);
       ctx->errors++;
     }
@@ -434,7 +434,7 @@
 
     msg_destroy(msg);
   }
-  
+
   time1 = su_nanocounter();
 
   if (o->o_times) {
@@ -470,7 +470,7 @@
 	   (ull)hs->hs_frees.hsf_number, (ull)hs->hs_frees.hsf_bytes,
 	   (ull)hs->hs_frees.hsf_rbytes);
   if (hs->hs_rehash || hs->hs_clones)
-    printf("\t"LLU" rehashes, "LLU" clones\n", 
+    printf("\t"LLU" rehashes, "LLU" clones\n",
 	   (ull)hs->hs_rehash, (ull)hs->hs_clones);
 }
 
@@ -506,11 +506,11 @@
 void report_sipstat(char const *what, sipstat_t const *sss)
 {
   printf("%s: "LLU" with %.1f headers (total "LLU")\n",
-	 what, (ull)sss->number, (double)sss->headers / sss->number, 
+	 what, (ull)sss->number, (double)sss->headers / sss->number,
 	 (ull)sss->headers);
   if (sss->payloads)
     printf("\t"LLU" with body of %.1f bytes (total "LLU")\n",
-	   (ull)sss->payloads, (double)sss->pl_bytes / sss->payloads, 
+	   (ull)sss->payloads, (double)sss->pl_bytes / sss->payloads,
 	   (ull)sss->payloads);
 }
 
@@ -541,7 +541,7 @@
   sss->number++;
 
   /* Count headers */
-  for (n = 0, h = h->sh_succ; h && !sip_is_separator((sip_header_t *)h); h = h->sh_succ) 
+  for (n = 0, h = h->sh_succ; h && !sip_is_separator((sip_header_t *)h); h = h->sh_succ)
     n++;
 
   sss->headers += n;
@@ -574,7 +574,7 @@
   for (i = h->N - 1; i >= 0 && h->buckets[i] == 0.0; i--)
     ;
   max_i = i;
-  
+
   if (min_i >= max_i)
     return;
 
@@ -600,7 +600,7 @@
   if (ctx->hist_msgsize)
     report_histogram("Message size", ctx->hist_msgsize);
 
-  if (o->o_times && ctx->files > 1) 
+  if (o->o_times && ctx->files > 1)
     printf("total "LLU" messages in %g seconds (%g msg/sec)\n",
 	   (ull)n, ctx->time, (double)n / ctx->time);
 
@@ -620,7 +620,7 @@
 
     *hs = *ctx->hs;
     report_memstats("total", hs);
-    
+
     /* Calculate mean */
     hs->hs_clones /= n; hs->hs_rehash /= n;
     hs->hs_allocs.hsa_number /= n; hs->hs_allocs.hsa_bytes /= n;
@@ -632,7 +632,7 @@
 
     report_memstats("mean", hs);
 
-    printf("\testimator fails %.1f%% times (mean slack %.0f bytes)\n", 
+    printf("\testimator fails %.1f%% times (mean slack %.0f bytes)\n",
 	   100 * (double)ctx->est_fail / (ctx->est_fail + ctx->est_succ),
 	   (double)ctx->est_slack / ctx->est_succ);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -17,7 +17,7 @@
 2005-10-15  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
   * Updated API of soa_get_local_sdp() and friends.
-  
+
   Added parameter for returning SDP C structure to soa_get_capability_sdp(),
   soa_get_remote_sdp(), soa_get_user_sdp(), and soa_get_local_sdp().
 
@@ -62,11 +62,11 @@
     M ./libsofia-sip-ua/soa/test_soa.c -2 +2
 
 2005-10-12  Pekka Pessi  <Pekka.Pessi at nokia.com>
-	
+
   * Updated SOA_VALID_ACTIONS().
 
     M ./libsofia-sip-ua/soa/soa.c -1 +13
-  	      
+
   * Added soa_name.
 
     M ./libsofia-sip-ua/soa/soa.c +1

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/Doxyfile.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/Doxyfile.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/Doxyfile.in	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 PROJECT_NAME         = "soa"
 OUTPUT_DIRECTORY     = ../docs/html/soa
 
-INPUT 		     = @srcdir@/soa.docs @srcdir@/sofia-sip/soa.h 
+INPUT 		     = @srcdir@/soa.docs @srcdir@/sofia-sip/soa.h
 INPUT               += @srcdir@/sofia-sip/soa_add.h @srcdir@/soa.c
 INPUT		    += @srcdir@/sofia-sip/soa_tag.h @srcdir@/soa_tag.c
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -35,7 +35,7 @@
 			sofia-sip/soa_add.h sofia-sip/soa_tag.h
 
 libsoa_la_SOURCES = 	soa.c soa_static.c \
-			soa_tag.c soa_tag_ref.c 
+			soa_tag.c soa_tag_ref.c
 
 COVERAGE_INPUT = 	$(libsoa_la_SOURCES) $(include_sofia_HEADERS)
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa.c	Tue Dec 23 07:37:03 2008
@@ -72,13 +72,13 @@
 /* Internal prototypes */
 su_inline int soa_media_is_ready(soa_session_t const *ss);
 
-enum soa_sdp_kind { 
+enum soa_sdp_kind {
   soa_capability_sdp_kind,
   soa_user_sdp_kind,
   soa_remote_sdp_kind
 };
 
-static int soa_set_sdp(soa_session_t *ss, 
+static int soa_set_sdp(soa_session_t *ss,
 		       enum soa_sdp_kind what,
 		       sdp_session_t const *sdp0,
 		       char const *sdp_str, issize_t str_len);
@@ -247,7 +247,7 @@
     return (void)su_seterrno(EFAULT), NULL;
 
   namelen = strlen(name) + 1;
-  
+
   ss = su_home_new(actions->sizeof_soa_session + namelen);
   if (ss) {
     ss->ss_root = root;
@@ -520,7 +520,7 @@
     }
   }
 
-  if (af < SOA_AF_ANY || af > SOA_AF_IP6_IP4) 
+  if (af < SOA_AF_ANY || af > SOA_AF_IP6_IP4)
     af = ss->ss_af;
 
   if (rtp_select < SOA_RTP_SELECT_SINGLE || rtp_select > SOA_RTP_SELECT_ALL)
@@ -533,7 +533,7 @@
   srtp_confidentiality = srtp_confidentiality != 0;
   srtp_integrity = srtp_integrity != 0;
 
-  change_session 
+  change_session
     =  af != (int)ss->ss_af
     || rtp_select != (int)ss->ss_rtp_select
     || rtp_sort != (int)ss->ss_rtp_sort
@@ -705,8 +705,8 @@
 
 
 /** Base bethod for getting list of parameters. */
-tagi_t *soa_base_get_paramlist(soa_session_t const *ss, 
-			       tag_type_t tag, tag_value_t value, 
+tagi_t *soa_base_get_paramlist(soa_session_t const *ss,
+			       tag_type_t tag, tag_value_t value,
 			       ...)
 {
   ta_list ta;
@@ -714,7 +714,7 @@
 
   if (ss == NULL)
     return NULL;
-  
+
   ta_start(ta, tag, value);
 
   params = tl_llist(
@@ -739,7 +739,7 @@
 			  SOATAG_REMOTE_SDP_STR(ss->ss_remote->ssd_unparsed)),
 
 		   SOATAG_AF(ss->ss_af),
-		   TAG_IF(ss->ss_address, 
+		   TAG_IF(ss->ss_address,
 			  SOATAG_ADDRESS(ss->ss_address)),
 
 		   SOATAG_SRTP_ENABLE(ss->ss_srtp_enable),
@@ -755,7 +755,7 @@
 
 #include <sofia-sip/sip_status.h>
 
-/** Convert @soa error to a SIP response code and phrase. */ 
+/** Convert @soa error to a SIP response code and phrase. */
 int soa_error_as_sip_response(soa_session_t *ss,
 			      char const **return_phrase)
 {
@@ -773,7 +773,7 @@
   return ss->ss_status;
 }
 
-/** Convert @soa error to a SIP @Reason header. */ 
+/** Convert @soa error to a SIP @Reason header. */
 char const *soa_error_as_sip_reason(soa_session_t *ss)
 {
   char const *phrase;
@@ -789,7 +789,7 @@
   status = soa_error_as_sip_response(ss, &phrase);
 
   reason = su_sprintf(ss->ss_home, "SIP;cause=%u;text=\"%s\"", status, phrase);
-  
+
   if (ss->ss_reason)
     su_free(ss->ss_home, reason);
 
@@ -815,7 +815,7 @@
 /** Return SDP description of capabilities.
  *
  * @param ss  pointer to @soa session
- * @param return_sdp      return value for capability SDP structure 
+ * @param return_sdp      return value for capability SDP structure
  * @param return_sdp_str  return value for capability SDP string
  * @param return_len  return value for length of capability SDP string
  *
@@ -823,8 +823,8 @@
  * @retval 1 if description is returned
  * @retval -1 upon an error
  *
- * @sa @RFC3261 section 11, soa_set_capability_sdp(), 
- * SOATAG_CAPS_SDP(), SOATAG_CAPS_SDP_STR(), 
+ * @sa @RFC3261 section 11, soa_set_capability_sdp(),
+ * SOATAG_CAPS_SDP(), SOATAG_CAPS_SDP_STR(),
  * nua_options(), #nua_i_options
  */
 int soa_get_capability_sdp(soa_session_t const *ss,
@@ -858,10 +858,10 @@
 }
 
 
-/** Set capability SDP. 
+/** Set capability SDP.
  *
  * Capability SDP is used instead of user SDP when generating OPTIONS
- * responses describing media capabilities. 
+ * responses describing media capabilities.
  *
  * @param ss  pointer to @soa session
  * @param sdp pointer to SDP session structure
@@ -874,10 +874,10 @@
  * @retval -1 upon an error
  *
  * @sa @RFC3261 section 11, soa_get_capability_sdp(),
- * SOATAG_CAPS_SDP(), SOATAG_CAPS_SDP_STR(), 
+ * SOATAG_CAPS_SDP(), SOATAG_CAPS_SDP_STR(),
  * nua_options(), #nua_i_options
  */
-int soa_set_capability_sdp(soa_session_t *ss, 
+int soa_set_capability_sdp(soa_session_t *ss,
 			   struct sdp_session_s const *sdp,
 			   char const *str, issize_t len)
 {
@@ -888,7 +888,7 @@
 }
 
 /** Set capabilities */
-int 
+int
 soa_base_set_capability_sdp(soa_session_t *ss,
 			    sdp_session_t *_sdp,
 			    char const *str0, isize_t len0)
@@ -947,12 +947,12 @@
  *
  * @param ss  pointer to @soa session
  * @param return_sdp SDP  session structure return value
- * @param return_sdp_str  return value for pointer to string 
+ * @param return_sdp_str  return value for pointer to string
  *                        containing the user SDP session description
  * @param return_len  return value for user SDP session description string
- *                    length 
+ *                    length
  *
- * Any of the parameters @a return_sdp, @a return_sdp_str, or @a return_len 
+ * Any of the parameters @a return_sdp, @a return_sdp_str, or @a return_len
  * may be NULL.
  *
  * @retval 0 if there is no description to return
@@ -1008,9 +1008,9 @@
 {
   assert(ss != NULL);
   return ss ? (int)ss->ss_user_version : -1;
-} 
+}
 
-/**Store user SDP to soa session. 
+/**Store user SDP to soa session.
  *
  * User SDP is used as basis for SDP Offer/Answer negotiation. It can be
  * very minimal, consisting just m= line containing media name, transport
@@ -1039,7 +1039,7 @@
  * soa_generate_answer(), soa_get_local_sdp(), soa_set_capability_sdp(),
  * soa_set_remote_sdp()
  */
-int soa_set_user_sdp(soa_session_t *ss, 
+int soa_set_user_sdp(soa_session_t *ss,
 		     struct sdp_session_s const *sdp,
 		     char const *str, issize_t len)
 {
@@ -1050,7 +1050,7 @@
 }
 
 /** Set user SDP (base version). */
-int soa_base_set_user_sdp(soa_session_t *ss, 
+int soa_base_set_user_sdp(soa_session_t *ss,
 			  sdp_session_t *sdp, char const *str0, isize_t len0)
 {
   ++ss->ss_user_version;
@@ -1064,12 +1064,12 @@
  *
  * @param ss  pointer to @soa session
  * @param return_sdp SDP  session structure return value
- * @param return_sdp_str  return value for pointer to string 
+ * @param return_sdp_str  return value for pointer to string
  *                        containing the user SDP session description
  * @param return_len  return value for user SDP session descrioption string
- *                    length 
+ *                    length
  *
- * Any of the parameters @a return_sdp, @a return_sdp_str, or @a return_len 
+ * Any of the parameters @a return_sdp, @a return_sdp_str, or @a return_len
  * may be NULL.
  *
  * @retval 0 if there is no description to return
@@ -1125,11 +1125,11 @@
 {
   assert(ss != NULL);
   return ss->ss_remote_version;
-} 
+}
 
 /** Set remote SDP (offer or answer).
  *
- * <i>Remote SDP</i> is an SDP offer or answer received from the remote end. 
+ * <i>Remote SDP</i> is an SDP offer or answer received from the remote end.
  * It is used together with <i>User SDP</i> as basis for SDP Offer/Answer
  * negotiation in soa_generate_answer() or soa_process_answer(). Remote SDP
  * can be set using soa_set_params() and SOATAG_REMOTE_SDP() or
@@ -1158,7 +1158,7 @@
  * soa_clear_remote_sdp(), soa_init_offer_answer(), soa_get_local_sdp(),
  * soa_set_user_sdp(), soa_set_capability_sdp().
  */
-int soa_set_remote_sdp(soa_session_t *ss, 
+int soa_set_remote_sdp(soa_session_t *ss,
 		       struct sdp_session_s const *sdp,
 		       char const *str, issize_t len)
 {
@@ -1178,11 +1178,11 @@
 
   if (!new_version)
     return 0;
-    
+
   soa_set_activity(ss, sdp->sdp_media, soa_activity_remote);
 
   ss->ss_remote_version++;
-  
+
   return soa_description_set(ss, ss->ss_remote, sdp, str0, len0);
 }
 
@@ -1236,12 +1236,12 @@
  *
  * @param ss  pointer to @soa session
  * @param return_sdp SDP  session structure return value
- * @param return_sdp_str  return value for pointer to string 
+ * @param return_sdp_str  return value for pointer to string
  *                        containing the user SDP session description
  * @param return_len  return value for user SDP session descrioption string
- *                    length 
+ *                    length
  *
- * Any of the parameters @a return_sdp, @a return_sdp_str, or @a return_len 
+ * Any of the parameters @a return_sdp, @a return_sdp_str, or @a return_len
  * may be NULL.
  *
  * @retval 0 if there is no description to return
@@ -1398,7 +1398,7 @@
  * SOATAG_LOCAL_SDP() or SOATAG_LOCAL_SDP_STR().
  *
  * The user SDP has been stored to the soa session with soa_set_user_sdp()
- * or with soa_set_params() tags SOATAG_USER_SDP() or SOATAG_USER_SDP_STR(). 
+ * or with soa_set_params() tags SOATAG_USER_SDP() or SOATAG_USER_SDP_STR().
  * There are various other parameters directing the generation of offer, set
  * by soa_set_params().
  *
@@ -1566,7 +1566,7 @@
   return 0;
 }
 
-/** Complete offer-answer after receiving answer. 
+/** Complete offer-answer after receiving answer.
  *
  * The SDP offer/answer negotiation is completed after receiving answer from
  * remote end. The answer is combined with the offer, and the application
@@ -1597,7 +1597,7 @@
   if (ss->ss_in_progress)
     return su_seterrno(EALREADY), -1;
 
-  /** @ERROR EPROTO We have not sent an offer 
+  /** @ERROR EPROTO We have not sent an offer
       or already have received answer. */
   if (!ss->ss_offer_sent || ss->ss_answer_recv)
     return su_seterrno(EPROTO), -1;
@@ -1647,7 +1647,7 @@
   return 0;
 }
 
-/** Process rejection of offer. 
+/** Process rejection of offer.
  *
  * If the SDP offer was rejected (e.g., an offer in re-INVITE asked remote
  * end to add video to the session but the request was rejected), the
@@ -1678,7 +1678,7 @@
   if (ss->ss_in_progress)
     return su_seterrno(EALREADY), -1;
 
-  /** @ERROR EPROTO We have not sent an offer 
+  /** @ERROR EPROTO We have not sent an offer
       or already have received answer. */
   if (!ss->ss_offer_sent || ss->ss_answer_recv)
     return su_seterrno(EPROTO), -1;
@@ -1713,7 +1713,7 @@
   return 0;
 }
 
-/** Activate session. 
+/** Activate session.
  *
  * Mark soa session as active.
  *
@@ -1982,7 +1982,7 @@
 
 /**
  * Parses and stores session description
- * 
+ *
  * @param ss instance pointer
  * @param what caps, local or remote
  * @param sdp0 new sdp (parsed)
@@ -1990,7 +1990,7 @@
  * @param str_len length on unparsed data
  **/
 static
-int soa_set_sdp(soa_session_t *ss, 
+int soa_set_sdp(soa_session_t *ss,
 		enum soa_sdp_kind what,
 		sdp_session_t const *sdp0,
 		char const *sdp_str, issize_t str_len)
@@ -2037,17 +2037,17 @@
     if (what == soa_remote_sdp_kind) {
       *sdp = *ssd->ssd_sdp;
       /* Calls soa_static_set_remote_sdp() by default */
-      return ss->ss_actions->soa_set_remote_sdp(ss, new_version, 
+      return ss->ss_actions->soa_set_remote_sdp(ss, new_version,
 						sdp, sdp_str, str_len);
       /* XXX - should check changes by soa_set_remote_sdp */
     }
     return 0;
-  } 
+  }
 
   if (sdp0) {
     /* note: case 1 - src in parsed form */
     *sdp = *sdp0;
-  } 
+  }
   else /* if (sdp_str) */ {
     /* note: case 2 - src in unparsed form */
     parser = sdp_parse(ss->ss_home, sdp_str, str_len, flags | sdp_f_anynet);
@@ -2059,7 +2059,7 @@
 
     *sdp = *sdp_session(parser);
   }
- 
+
   switch (what) {
   case soa_capability_sdp_kind:
     /* Calls soa_static_set_capability_sdp() by default */
@@ -2110,7 +2110,7 @@
     sdp_str0_new = su_strndup(ss->ss_home, sdp_str, str_len);
   else
     sdp_str0_new = sdp_str_new;
-  
+
   if (sdp_new && printer && sdp_str_new && sdp_str0_new) {
     tbf1 = ssd->ssd_sdp, tbf2 = ssd->ssd_printer;
     tbf3 = (void *)ssd->ssd_str, tbf4 = (void *)ssd->ssd_unparsed;
@@ -2118,14 +2118,14 @@
     ssd->ssd_sdp = sdp_new;
     ssd->ssd_printer = printer;
     ssd->ssd_str = sdp_str_new;
-    ssd->ssd_unparsed = sdp_str0_new;      
+    ssd->ssd_unparsed = sdp_str0_new;
 
     retval = 1;
   }
   else {
     tbf1 = sdp_new, tbf2 = printer, tbf3 = sdp_str_new, tbf4 = sdp_str0_new;
   }
-  
+
   su_free(ss->ss_home, tbf1);
   sdp_printer_free(tbf2);
   if (tbf3 != tbf4)
@@ -2136,7 +2136,7 @@
 
 
 /** Duplicate a session descriptions. */
-int soa_description_dup(su_home_t *home, 
+int soa_description_dup(su_home_t *home,
 			struct soa_description *ssd,
 			struct soa_description const *ssd0)
 {
@@ -2154,7 +2154,7 @@
 }
 
 /** Free session descriptions. */
-void soa_description_free(soa_session_t *ss, 
+void soa_description_free(soa_session_t *ss,
 			  struct soa_description *ssd)
 {
   void *tbf1, *tbf2, *tbf3, *tbf4;
@@ -2257,12 +2257,12 @@
     /* Use the application-specified address -
      * do not check that it is found from the local address list */
     c->c_nettype = sdp_net_in;
-    
+
     if (host_is_ip4_address(address))
       c->c_addrtype = sdp_addr_ip4;
     else
       c->c_addrtype = sdp_addr_ip6;
-    
+
     if (!host_is_ip6_reference(address)) {
       c->c_address = strcpy(buffer, address);
     }
@@ -2270,7 +2270,7 @@
       /* Remove brackets [] around the reference */
       size_t len = strlen(address + 1);
       c->c_address = memcpy(buffer, address + 1, len - 1);
-      buffer[len - 1] = '\0'; 
+      buffer[len - 1] = '\0';
     }
     return 0;
   }
@@ -2299,7 +2299,7 @@
   }
 
   for (res = NULL; res == NULL;) {
-    if ((error = su_getlocalinfo(hints, &res)) < 0 
+    if ((error = su_getlocalinfo(hints, &res)) < 0
 	&& error != ELI_NOADDRESS) {
       SU_DEBUG_1(("%s: su_localinfo: %s\n", __func__,
 		  su_gli_strerror(error)));

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa.docs	Tue Dec 23 07:37:03 2008
@@ -15,7 +15,7 @@
 
 SIP uses SDP and a negotiation procedure known as "SDP
 Offer-Answer Model" to establish the multimedia sessions. The
-SDP Offer-Answer negotiation is specified in 
+SDP Offer-Answer negotiation is specified in
 <a href="http://ietf.org/rfc/rfc3264.txt">RFC 3264</a>.
 
 The soa engine is implemented in object-oriented manner. The default soa
@@ -32,17 +32,17 @@
 -# modifying session (section 8)
 -# indicating capabilities (section 9)
 
-The offerer indicates its capabilities in the offer: 
+The offerer indicates its capabilities in the offer:
 - the media streams it wants to establish
-- transport addresses it uses to receive by media streams 
-  (IP addresses, port numbers, transport protocols) 
+- transport addresses it uses to receive by media streams
+  (IP addresses, port numbers, transport protocols)
 - the codecs used by particular streams
 - codec parameters (for instance, codec profile used by H.263)
 
 The answerer indicates which parts of the offer are acceptable to
 it in the answer:
 - the media streams it agrees to establish
-- transport addresses answerer uses to receive by media streams 
+- transport addresses answerer uses to receive by media streams
 - the codecs and codec parameters used by particular streams
 
 Note that the capabilites indicate what the party generating the
@@ -57,24 +57,24 @@
 as session <i>preconditions</i> is defined
 <a href="http://ietf.org/rfc/rfc3312.txt">RFC 3312</a>.
 Another example of two-phase negotiation is presented in RFC
-3264 section 10.2, showing how a single codec can be selected. 
+3264 section 10.2, showing how a single codec can be selected.
 
- at section soa_motivation SOA Design 
+ at section soa_motivation SOA Design
 
 Why to have simple interface? Is it not simple enough to include SDP offer
 with your INVITE, and act on SDP answer in 200 OK?
 
 Our design goal is to allow application to follow the simple call
 model, regardless of the underlying complications - early
-sessions, preconditions, session timers, 3rd party call control. 
+sessions, preconditions, session timers, 3rd party call control.
 In other words, we would like a have a simple "cooked" interface
 toward naive applications even if the underlying call follows the
 byzantine call model chosen by 3GPP.
 
 @section soa_with_sip Using SDP Offer/Answer with SIP
 
-Using SDP Offer/Answer with SIP is specified in 
-<a href="http://ietf.org/rfc/rfc3261.txt">RFC 3261</a>, 
+Using SDP Offer/Answer with SIP is specified in
+<a href="http://ietf.org/rfc/rfc3261.txt">RFC 3261</a>,
 <a href="http://ietf.org/rfc/rfc3262.txt">RFC 3262 (100rel and PRACK)</a>, and
 <a href="http://ietf.org/rfc/rfc3211.txt">RFC 3311 (UPDATE)</a>.
 
@@ -90,7 +90,7 @@
 
 PRACK may only be sent when an unacknowledged 100rel (reliable 1XX
 series response) is received. UPDATE may be sent during early or
-established dialog. 
+established dialog.
 
 Only one INVITE request may be pending within a dialog. Only one
 non-INVITE request may be pending within a dialog (in one
@@ -120,13 +120,13 @@
 - if offer was sent in INVITE, first session description in any
   non-error response to INVITE is treated as the answer
 - if offer was sent in 2XX response, session description in
-  ACK is answer 
+  ACK is answer
 - if offer was sent in 100rel response, session description in
-  PRACK is answer 
-- if offer was sent in PRACK or UPDATE, session description in 
+  PRACK is answer
+- if offer was sent in PRACK or UPDATE, session description in
   2XX response is answer
 
-Rules for situations when endpoint MUST ignore the SDP: 
+Rules for situations when endpoint MUST ignore the SDP:
 - If offer was sent in INVITE, only the first session description in
   any non-error (1XX or 2XX) response to INVITE is processed, rest
   are ignored
@@ -146,7 +146,7 @@
 
 Rules for resolving glare (both endpoints trying to send offer at the same
 time):
-- if a offer is received while UAS has generated an offer, 
+- if a offer is received while UAS has generated an offer,
   it must be rejected (with SIP 491 response).
 
 @section soa_use_cases SOA and SDP Offer/Answer Scenarios
@@ -154,11 +154,11 @@
 Note that due to limitations in space
 - soa_set_params() is referred as @c set_params
 - soa_set_remote_sdp() is referred as @c set_remote
-- soa_generate_offer() followed by soa_get_session_sdp() 
-  is referred as @c gen_offer  
-- soa_generate_answer() followed by soa_get_session_sdp() 
-  is referred as @c gen_answer 
-- soa_process_answer() is referred as @c proc_answer 
+- soa_generate_offer() followed by soa_get_session_sdp()
+  is referred as @c gen_offer
+- soa_generate_answer() followed by soa_get_session_sdp()
+  is referred as @c gen_answer
+- soa_process_answer() is referred as @c proc_answer
 
 @subsection soa_uc_basic_out Basic Call Out
 
@@ -228,7 +228,7 @@
 	|		|		|			|
 </pre>
 
- at subsection soa_uc_basic_3p 3rd Party Call In 
+ at subsection soa_uc_basic_3p 3rd Party Call In
 
 The 3rd-party call model just reverses the O/A roles of callee and caller.
 
@@ -442,10 +442,10 @@
 @page soa_sdp_oa_use_cases Use Cases for SIP and SDP Offer/Answer
 
 This page contains a list of use cases or call scenarios for SIP and SDP
-Offer/Answer. 
+Offer/Answer.
 
 There are a few call scenarios that we expect to see when dealing with more
-telephone-like side of SIP: 
+telephone-like side of SIP:
 - calling to existing PSTN networks (early session)
 - doing resource reservations
 - calling to 3G IMS
@@ -531,9 +531,9 @@
 
 @section soa_use_case_4 Case #4: UPDATE with Offer
 
-This is a call model with two rounds of offer/answer and 100rel. 
+This is a call model with two rounds of offer/answer and 100rel.
 It can be used, for instance, when the endpoints have to make sure
-that there are enough network capacity for the call to succeed. 
+that there are enough network capacity for the call to succeed.
 They can establish a new radio bearer, for instance, before
 progressing with the call. The initial offer would contain SDP
 attribute "inactive", the second "sendrev":
@@ -542,9 +542,9 @@
 	A		        B
 	|			|
 	|----INVITE (offer)---->|
-	|			| 
-	|			| 
-	|<----183 (answer)------| 
+	|			|
+	|			|
+	|<----183 (answer)------|
 	|--------PRACK--------->|
 	|<-----200/PRACK--------|
 	|			|
@@ -594,7 +594,7 @@
 </pre>
 
 
- at section soa_use_case_6 Case #6: Callee Making 2nd Offer 
+ at section soa_use_case_6 Case #6: Callee Making 2nd Offer
 
 Alternative 2 to above: two rounds of offer/answer and 100rel, but
 now it is B who wants to do two rounds and initiates second
@@ -636,9 +636,9 @@
         	A		        B
         	|			|
         	|----INVITE (offer)---->|
-        	|			| 
-        	|			| 
-        	|<----183 (answer)------| 
+        	|			|
+        	|			|
+        	|<----183 (answer)------|
         	|-----PRACK(offer2)---->|
         	|<--200/PRACK(answer2)--|
         	|			|
@@ -718,7 +718,7 @@
 
 @section soa_use_case_10 Case #10: Upgrade Session with Re-INVITE
 
-The session is upgraded: a new media is added to the session. 
+The session is upgraded: a new media is added to the session.
 
 <pre>
 	A		        B
@@ -775,7 +775,7 @@
 
 /** @typedef struct soa_session soa_session_t;
 
- at brief "soa" session object. 
+ at brief "soa" session object.
 
 The @soa session object is responsible for
 @ref soa_with_sip "SDP offer/answer negotiation"
@@ -796,7 +796,7 @@
 @code
 int soa_set_params(soa_session_t *ss,
                    tag_type_t tag, tag_value_t value, ...);
-int soa_get_params(soa_session_t const *ss, 
+int soa_get_params(soa_session_t const *ss,
                    tag_type_t tag, tag_value_t value, ...);
 
 tagi_t *soa_get_paramlist(soa_session_t const *ss,
@@ -805,7 +805,7 @@
 
 @par Functions used to obtain status information from "soa" session objects:
 @code
-int soa_error_as_sip_response(soa_session_t *soa, 
+int soa_error_as_sip_response(soa_session_t *soa,
                               char const **return_phrase);
 
 char const *soa_error_as_sip_reason(soa_session_t *soa);
@@ -814,9 +814,9 @@
 @endcode
 
 
- at par Functions used to store and retrieve SDP descriptions: 
+ at par Functions used to store and retrieve SDP descriptions:
 @code
-int soa_set_capability_sdp(soa_session_t *ss, 
+int soa_set_capability_sdp(soa_session_t *ss,
                            struct sdp_session_s const *sdp,
                            char const *str, issize_t len);
 
@@ -825,7 +825,7 @@
                            char const **return_sdp_str,
                            isize_t *return_len);
 
-int soa_set_remote_sdp(soa_session_t *ss, 
+int soa_set_remote_sdp(soa_session_t *ss,
                        struct sdp_session_s const *sdp,
                        char const *str, issize_t len);
 
@@ -838,7 +838,7 @@
 
 int soa_get_remote_version(soa_session_t const *ss);
 
-int soa_set_user_sdp(soa_session_t *ss, 
+int soa_set_user_sdp(soa_session_t *ss,
                      struct sdp_session_s const *sdp,
                      char const *str, issize_t len);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c	Tue Dec 23 07:37:03 2008
@@ -35,11 +35,11 @@
  *    a) generating offer (upgrade with user-SDP)
  *    b) generating answer (upgrade with remote-SDP, rejects with user-SDP)
  *  2. session exists
- *    a) generating offer: 
+ *    a) generating offer:
  *       upgrades with user-SDP
- *    b) generating answer: 
+ *    b) generating answer:
  *       upgrades with remote-SDP, rejects with user-SDP
- *    c) processing answer: 
+ *    c) processing answer:
  *       rejects with user-SDP, no upgrades
  *
  * Upgrading session with user SDP:
@@ -101,16 +101,16 @@
 static int soa_static_set_params(soa_session_t *ss, tagi_t const *tags);
 static int soa_static_get_params(soa_session_t const *ss, tagi_t *tags);
 static tagi_t *soa_static_get_paramlist(soa_session_t const *ss,
-					tag_type_t tag, tag_value_t value, 
+					tag_type_t tag, tag_value_t value,
 					...);
-static int soa_static_set_capability_sdp(soa_session_t *ss, 
+static int soa_static_set_capability_sdp(soa_session_t *ss,
 				       sdp_session_t *sdp,
 				       char const *, isize_t);
-static int soa_static_set_remote_sdp(soa_session_t *ss, 
+static int soa_static_set_remote_sdp(soa_session_t *ss,
 				   int new_version,
 				   sdp_session_t *sdp,
 				   char const *, isize_t);
-static int soa_static_set_user_sdp(soa_session_t *ss, 
+static int soa_static_set_user_sdp(soa_session_t *ss,
 				   sdp_session_t *sdp,
 				   char const *, isize_t);
 static int soa_static_generate_offer(soa_session_t *ss, soa_callback_f *);
@@ -122,7 +122,7 @@
 static int soa_static_deactivate(soa_session_t *ss, char const *option);
 static void soa_static_terminate(soa_session_t *ss, char const *option);
 
-struct soa_session_actions const soa_default_actions = 
+struct soa_session_actions const soa_default_actions =
   {
     (sizeof soa_default_actions),
     sizeof (struct soa_static_session),
@@ -213,7 +213,7 @@
 }
 
 static tagi_t *soa_static_get_paramlist(soa_session_t const *ss,
-					tag_type_t tag, tag_value_t value, 
+					tag_type_t tag, tag_value_t value,
 					...)
 {
   soa_static_session_t *sss = (soa_static_session_t *)ss;
@@ -237,28 +237,28 @@
   return tl;
 }
 
-static int soa_static_set_capability_sdp(soa_session_t *ss, 
+static int soa_static_set_capability_sdp(soa_session_t *ss,
 					 sdp_session_t *sdp,
-					 char const *sdp_str, 
+					 char const *sdp_str,
 					 isize_t sdp_len)
 {
   return soa_base_set_capability_sdp(ss, sdp, sdp_str, sdp_len);
 }
 
 
-static int soa_static_set_remote_sdp(soa_session_t *ss, 
+static int soa_static_set_remote_sdp(soa_session_t *ss,
 				     int new_version,
 				     sdp_session_t *sdp,
-				     char const *sdp_str, 
+				     char const *sdp_str,
 				     isize_t sdp_len)
 {
   return soa_base_set_remote_sdp(ss, new_version, sdp, sdp_str, sdp_len);
 }
 
 
-static int soa_static_set_user_sdp(soa_session_t *ss, 
+static int soa_static_set_user_sdp(soa_session_t *ss,
 				   sdp_session_t *sdp,
-				   char const *sdp_str, 
+				   char const *sdp_str,
 				   isize_t sdp_len)
 {
   return soa_base_set_user_sdp(ss, sdp, sdp_str, sdp_len);
@@ -266,7 +266,7 @@
 
 /** Generate a rejected m= line */
 static
-sdp_media_t *soa_sdp_make_rejected_media(su_home_t *home, 
+sdp_media_t *soa_sdp_make_rejected_media(su_home_t *home,
 					 sdp_media_t const *m,
 					 sdp_session_t *sdp,
 					 int include_all_codecs)
@@ -317,7 +317,7 @@
   return expanded;
 }
 
-/** Check if @a session should be upgraded with @a remote */ 
+/** Check if @a session should be upgraded with @a remote */
 int soa_sdp_upgrade_is_needed(sdp_session_t const *session,
 			      sdp_session_t const *remote)
 {
@@ -328,7 +328,7 @@
   if (!session)
     return 1;
 
-  for (rm = remote->sdp_media, lm = session->sdp_media; 
+  for (rm = remote->sdp_media, lm = session->sdp_media;
        rm && lm ; rm = rm->m_next, lm = lm->m_next) {
     if (rm->m_rejected)
       continue;
@@ -394,12 +394,12 @@
 
 /** Find first matching media in table @a mm.
  *
- * - if allow_rtp_mismatch == 0, search for a matching codec 
+ * - if allow_rtp_mismatch == 0, search for a matching codec
  * - if allow_rtp_mismatch == 1, prefer m=line with matching codec
  * - if allow_rtp_mismatch > 1, ignore codecs
  */
 static
-int soa_sdp_matching_mindex(soa_session_t *ss, 
+int soa_sdp_matching_mindex(soa_session_t *ss,
 			    sdp_media_t *mm[],
 			    sdp_media_t const *with,
 			    int *return_codec_mismatch)
@@ -425,11 +425,11 @@
 
     if (!sdp_media_match_with(mm[i], with))
       continue;
-    
+
     if (!rtp)
       break;
 
-    if (soa_sdp_media_matching_rtpmap(with->m_rtpmaps, 
+    if (soa_sdp_media_matching_rtpmap(with->m_rtpmaps,
 				      mm[i]->m_rtpmaps,
 				      auxiliary))
       break;
@@ -445,11 +445,11 @@
 }
 
 /** Set payload types in @a l_m according to the values in @a r_m.
- * 
+ *
  * @retval number of common codecs
  */
 static
-int soa_sdp_set_rtpmap_pt(sdp_media_t *l_m, 
+int soa_sdp_set_rtpmap_pt(sdp_media_t *l_m,
 			  sdp_media_t const *r_m)
 {
   sdp_rtpmap_t *lrm, **next_lrm;
@@ -489,7 +489,7 @@
       lrm->rm_any = 1;
     }
   }
-  
+
   if (local_codecs == common_codecs)
     return common_codecs;
 
@@ -511,7 +511,7 @@
       next_lrm = &lrm->rm_next;
       continue;
     }
-    
+
     lrm->rm_any = 0;
 
     pt = lrm->rm_pt;
@@ -520,7 +520,7 @@
       for (pt = 96; pt < 128; pt++)
         if (!dynamic_pt[pt])
           break;
-      
+
       if (pt == 128) {
         for (pt = 0; pt < 128; pt++)
           if (!sdp_rtpmap_well_known[pt] && !dynamic_pt[pt])
@@ -544,7 +544,7 @@
     }
 
     dynamic_pt[pt] = 1;
-  
+
     next_lrm = &lrm->rm_next;
   }
 
@@ -557,7 +557,7 @@
  * @return Number of common codecs
  */
 static
-int soa_sdp_sort_rtpmap(sdp_rtpmap_t **inout_list, 
+int soa_sdp_sort_rtpmap(sdp_rtpmap_t **inout_list,
 			sdp_rtpmap_t const *rrm,
 			char const *auxiliary)
 {
@@ -611,7 +611,7 @@
  * @return Number of common codecs
  */
 static
-int soa_sdp_select_rtpmap(sdp_rtpmap_t **inout_list, 
+int soa_sdp_select_rtpmap(sdp_rtpmap_t **inout_list,
 			  sdp_rtpmap_t const *rrm,
 			  char const *auxiliary,
 			  int select_single)
@@ -628,7 +628,7 @@
   for (left = inout_list; *left; ) {
     if (auxiliary && soa_sdp_is_auxiliary_codec(*left, auxiliary))
       /* Insert into list of auxiliary codecs */
-      *next_aux = *left, *left = (*left)->rm_next, 
+      *next_aux = *left, *left = (*left)->rm_next,
 	next_aux = &(*next_aux)->rm_next;
     else if (!(select_single && common_codecs > 0)
 	     && sdp_rtpmap_find_matching(rrm, (*left)))
@@ -645,7 +645,7 @@
 }
 
 
-/** Sort and select rtpmaps  */ 
+/** Sort and select rtpmaps  */
 static
 int soa_sdp_media_upgrade_rtpmaps(soa_session_t *ss,
 				  sdp_media_t *sm,
@@ -660,7 +660,7 @@
   if (rm->m_type == sdp_media_audio)
     auxiliary = sss->sss_audio_aux;
 
-  if (ss->ss_rtp_sort == SOA_RTP_SORT_REMOTE || 
+  if (ss->ss_rtp_sort == SOA_RTP_SORT_REMOTE ||
       (ss->ss_rtp_sort == SOA_RTP_SORT_DEFAULT &&
        rm->m_mode == sdp_recvonly)) {
     soa_sdp_sort_rtpmap(&sm->m_rtpmaps, rm->m_rtpmaps, auxiliary);
@@ -679,7 +679,7 @@
 }
 
 
-/** Sort and select rtpmaps within session */ 
+/** Sort and select rtpmaps within session */
 static
 int soa_sdp_session_upgrade_rtpmaps(soa_session_t *ss,
 				    sdp_session_t *session,
@@ -688,8 +688,8 @@
   sdp_media_t *sm;
   sdp_media_t const *rm;
 
-  for (sm = session->sdp_media, rm = remote->sdp_media; 
-       sm && rm; 
+  for (sm = session->sdp_media, rm = remote->sdp_media;
+       sm && rm;
        sm = sm->m_next, rm = rm->m_next) {
     if (!sm->m_rejected && sdp_media_uses_rtp(sm))
       soa_sdp_media_upgrade_rtpmaps(ss, sm, rm);
@@ -698,7 +698,7 @@
   return 0;
 }
 
-/** Upgrade m= lines within session */ 
+/** Upgrade m= lines within session */
 static
 int soa_sdp_upgrade(soa_session_t *ss,
 		    su_home_t *home,
@@ -737,7 +737,7 @@
   if (!s_media || !o_media || !u_media || !r_media)
     return -1;
 
-  um = sdp_media_dup_all(home, user->sdp_media, session); 
+  um = sdp_media_dup_all(home, user->sdp_media, session);
   if (!um && user->sdp_media)
     return -1;
 
@@ -819,7 +819,7 @@
 	for (i = 0; i < Ns; i++) {
 	  if (s_media[i])
 	    continue;
-	  s_media[i] = 
+	  s_media[i] =
 	    soa_sdp_make_rejected_media(home, o_media[i], session, 0);
 	}
       }
@@ -905,7 +905,7 @@
   return NULL;
 }
 
-/** Check if @a session contains media that are rejected by @a remote. */ 
+/** Check if @a session contains media that are rejected by @a remote. */
 static
 int soa_sdp_reject_is_needed(sdp_session_t const *session,
 			     sdp_session_t const *remote)
@@ -917,7 +917,7 @@
   if (!session)
     return 0;
 
-  for (sm = session->sdp_media, rm = remote->sdp_media; 
+  for (sm = session->sdp_media, rm = remote->sdp_media;
        sm && rm; sm = sm->m_next, rm = rm->m_next) {
     if (rm->m_rejected) {
       if (!sm->m_rejected)
@@ -937,7 +937,7 @@
   return 0;
 }
 
-/** If m= line is rejected by remote mark m= line rejected within session */ 
+/** If m= line is rejected by remote mark m= line rejected within session */
 static
 int soa_sdp_reject(su_home_t *home,
 		   sdp_session_t *session,
@@ -983,7 +983,7 @@
  * @sa soatag_hold
  *
  * @retval 1 if session was changed (or to be changed, if @a dryrun is nonzero)
- */ 
+ */
 static
 int soa_sdp_mode_set(sdp_session_t const *user,
 		     int const *s2u,
@@ -1129,7 +1129,7 @@
   if (local && remote) switch (action) {
   case generate_answer:
   case process_answer:
-    if (sdp_media_count(remote, sdp_media_any, "*", 0, 0) < 
+    if (sdp_media_count(remote, sdp_media_any, "*", 0, 0) <
 	sdp_media_count(local, sdp_media_any, "*", 0, 0)) {
       SU_DEBUG_5(("%s: remote %s is truncated: expanding\n",
 		  by, action == generate_answer ? "offer" : "answer"));
@@ -1140,7 +1140,7 @@
   default:
     break;
   }
-  
+
   /* Step A: Create local SDP session (based on user-supplied SDP) */
   if (local == NULL) switch (action) {
   case generate_offer:
@@ -1156,7 +1156,7 @@
       /* o->o_address = local->sdp_origin->o_address; */
     }
     if (!o->o_address)
-      o->o_address = c0; 
+      o->o_address = c0;
     local->sdp_origin = o;
 
     if (soa_init_sdp_origin(ss, o, c_address) < 0) {
@@ -1179,7 +1179,7 @@
       break;
     if (local != local0)
       *local0 = *local, local = local0;
-    SU_DEBUG_7(("soa_static(%p, %s): %s\n", (void *)ss, by, 
+    SU_DEBUG_7(("soa_static(%p, %s): %s\n", (void *)ss, by,
 		"upgrade with local description"));
     if (soa_sdp_upgrade(ss, tmphome, local, user, NULL, &u2s, &s2u) < 0)
       goto internal_error;
@@ -1226,7 +1226,7 @@
 	} while (0)
 	DUP_LOCAL(local);
       }
-      SU_DEBUG_7(("soa_static(%p, %s): %s\n", (void *)ss, by, 
+      SU_DEBUG_7(("soa_static(%p, %s): %s\n", (void *)ss, by,
 		  "marking rejected media"));
       soa_sdp_reject(tmphome, local, remote);
     }
@@ -1269,7 +1269,7 @@
       SU_DEBUG_7(("soa_static(%p, %s): %s\n", (void *)ss, by,
 		  "upgrade codecs with remote description"));
       if (local != local0) {
-	*local0 = *local, local = local0; 
+	*local0 = *local, local = local0;
 	DUP_LOCAL(local);
       }
       soa_sdp_session_upgrade_rtpmaps(ss, local, remote);
@@ -1281,7 +1281,7 @@
     break;
   }
 
-  /* Step F: Update c= line */ 
+  /* Step F: Update c= line */
   switch (action) {
   case generate_offer:
   case generate_answer:
@@ -1290,12 +1290,12 @@
 	local->sdp_connection)
       break;
 
-    if (local->sdp_connection == NULL || 
-	(user->sdp_connection != NULL && 
+    if (local->sdp_connection == NULL ||
+	(user->sdp_connection != NULL &&
 	 sdp_connection_cmp(local->sdp_connection, user->sdp_connection))) {
       sdp_media_t *m;
 
-      /* Every m= line (even rejected one) must have a c= line 
+      /* Every m= line (even rejected one) must have a c= line
        * or there must be a c= line at session level
        */
       if (user->sdp_connection)
@@ -1309,7 +1309,7 @@
 
       if (m) {
 	if (local != local0) {
-	  *local0 = *local, local = local0; 
+	  *local0 = *local, local = local0;
 	  DUP_LOCAL(local);
 	}
 	local->sdp_connection = c;
@@ -1324,7 +1324,7 @@
   soa_description_free(ss, ss->ss_previous);
 
   if (u2s) {
-    u2s = u2s_alloc(ss->ss_home, u2s); 
+    u2s = u2s_alloc(ss->ss_home, u2s);
     s2u = u2s_alloc(ss->ss_home, s2u);
     if (!u2s || !s2u)
       goto internal_error;
@@ -1379,7 +1379,7 @@
 	ss->ss_previous_user_version = 0;
 	ss->ss_previous_remote_version = 0;
       }
-      
+
       su_free(ss->ss_home, u2s), su_free(ss->ss_home, s2u);
 
       goto internal_error;
@@ -1444,7 +1444,7 @@
 {
   /* NOTE:
    * - local SDP might have changed
-   * - remote SDP might have been updated 
+   * - remote SDP might have been updated
    */
 
   if (offer_answer_step(ss, generate_answer, "soa_generate_answer") < 0)
@@ -1459,7 +1459,7 @@
   /* NOTE:
    * - both local and remote information is available
    * - local SDP might have changed
-   * - remote SDP might have been updated 
+   * - remote SDP might have been updated
    */
   if (offer_answer_step(ss, process_answer, "soa_process_answer") < 0)
     return -1;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c	Tue Dec 23 07:37:03 2008
@@ -58,7 +58,7 @@
   if (!t || !t->t_tag)
     return 0;
 
-  ns = t->t_tag->tt_ns; 
+  ns = t->t_tag->tt_ns;
   if (!ns)
     return 0;
 
@@ -66,7 +66,7 @@
 }
 
 /**@def SOATAG_ANY()
- * 
+ *
  * Filter tag matching any SOATAG_*() item.
  */
 tag_typedef_t soatag_any = NSTAG_TYPEDEF(*);
@@ -218,7 +218,7 @@
  *
  * User SDP is used as basis for SDP Offer/Answer negotiation. It can be
  * very minimal, listing just m= lines with the port numbers and RTP payload
- * numbers of supported codecs, like 
+ * numbers of supported codecs, like
  * @code
  *   SOATAG_USER_SDP_STR("m=audio 5004 RTP/AVP 0 8")
  * @endcode
@@ -256,7 +256,7 @@
  *      #SOA_AF_ANY,
  *      #SOA_AF_IP4_ONLY, #SOA_AF_IP6_ONLY,
  *      #SOA_AF_IP4_IP6,  #SOA_AF_IP6_IP4
- *    } 
+ *    }
  *
  * @par Values
  *    - #SOA_AF_ANY       (0) any address family (default)
@@ -303,7 +303,7 @@
  *    soa_set_params(), soa_get_params(), soa_get_paramlist() \n
  *
  * @par Parameter type
- *    enum { 
+ *    enum {
  *      #SOA_RTP_SELECT_SINGLE, #SOA_RTP_SELECT_COMMON, #SOA_RTP_SELECT_ALL
  *    } \n
  *    (int in range 0..2)
@@ -330,7 +330,7 @@
  * The named audio codecs are considered auxiliary, that is, they are
  * considered as common codec only when they are the only codec listed on
  * the media line.
- * 
+ *
  * When generating answer or second offer soa includes auxiliary audio
  * codecs in the list of codecs even if it is selecting only one codec or
  * common codecs.
@@ -358,10 +358,10 @@
 /**@def SOATAG_RTP_SORT(x)
  *
  * When selecting the common codecs, soa can either select first local codec
- * supported by remote end, or first remote codec supported by local codecs. 
+ * supported by remote end, or first remote codec supported by local codecs.
  * The preference is indicated with ordering: the preferred codec is
  * first and so on.
- * 
+ *
  * The auxiliary audio codecs (specified with SOATAG_AUDIO_AUX()) are listed
  * after other codecs.
  *
@@ -415,14 +415,14 @@
 
 
 /**@def SOATAG_ACTIVE_AUDIO(x)
- * 
+ *
  * Audio session status.
  *
  * @par Used with
  *
  * @par Parameter type
- *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED, 
- *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY, 
+ *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED,
+ *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY,
  *           #SOA_ACTIVE_RECVONLY, #SOA_ACTIVE_SENDRECV }
  *
  * @par Values
@@ -438,14 +438,14 @@
 tag_typedef_t soatag_active_audio = INTTAG_TYPEDEF(active_audio);
 
 /**@def SOATAG_ACTIVE_VIDEO(x)
- * 
+ *
  * Video session status
  *
  * @par Used with
  *
  * @par Parameter type
- *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED, 
- *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY, 
+ *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED,
+ *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY,
  *           #SOA_ACTIVE_RECVONLY, #SOA_ACTIVE_SENDRECV }
  *
  * @par Values
@@ -460,7 +460,7 @@
 tag_typedef_t soatag_active_video = INTTAG_TYPEDEF(active_video);
 
 /**@def SOATAG_ACTIVE_IMAGE(x)
- * 
+ *
  * Active image session status
  *
  * @par Used with
@@ -468,8 +468,8 @@
  *    #nua_i_state \n
  *
  * @par Parameter type
- *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED, 
- *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY, 
+ *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED,
+ *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY,
  *           #SOA_ACTIVE_RECVONLY, #SOA_ACTIVE_SENDRECV }
  *
  * @par Values
@@ -480,8 +480,8 @@
  *    - #SOA_ACTIVE_SENDRECV  (3)
  *
  * @par Parameter type
- *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED, 
- *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY, 
+ *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED,
+ *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY,
  *           #SOA_ACTIVE_RECVONLY, #SOA_ACTIVE_SENDRECV }
  *
  * @par Values
@@ -496,7 +496,7 @@
 tag_typedef_t soatag_active_image = INTTAG_TYPEDEF(active_image);
 
 /**@def SOATAG_ACTIVE_CHAT(x)
- * 
+ *
  * Active chat session status.
  *
  * @par Used with
@@ -504,8 +504,8 @@
  *    #nua_i_state \n
  *
  * @par Parameter type
- *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED, 
- *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY, 
+ *    enum { #SOA_ACTIVE_DISABLED, #SOA_ACTIVE_REJECTED,
+ *           #SOA_ACTIVE_INACTIVE, #SOA_ACTIVE_SENDONLY,
  *           #SOA_ACTIVE_RECVONLY, #SOA_ACTIVE_SENDRECV }
  *
  * @par Values
@@ -520,7 +520,7 @@
 tag_typedef_t soatag_active_chat = INTTAG_TYPEDEF(active_chat);
 
 /**@def SOATAG_SRTP_ENABLE(x)
- *  
+ *
  * Enable SRTP
  *
  * @par Used with
@@ -533,7 +533,7 @@
  *    @c !=0 enable \n
  *    @c 0 disable
  *
- * Corresponding tag taking reference parameter is 
+ * Corresponding tag taking reference parameter is
  * SOATAG_SRTP_ENABLE_REF()
  *
  * @todo SRTP functionality is not implemented.
@@ -541,7 +541,7 @@
 tag_typedef_t soatag_srtp_enable = BOOLTAG_TYPEDEF(srtp_enable);
 
 /**@def SOATAG_SRTP_CONFIDENTIALITY(x)
- *  
+ *
  * Enable SRTP confidentiality negotiation.
  *
  * @par Used with
@@ -554,16 +554,16 @@
  *    @c != 0 enable SRTP confidentiality \n
  *    @c 0 disable SRTP conidentiality
  *
- * Corresponding tag taking reference parameter is 
+ * Corresponding tag taking reference parameter is
  * SOATAG_SRTP_CONFIDENTIALITY_REF()
  *
  * @todo SRTP functionality is not implemented.
  */
-tag_typedef_t soatag_srtp_confidentiality = 
+tag_typedef_t soatag_srtp_confidentiality =
   BOOLTAG_TYPEDEF(srtp_confidentiality);
 
 /**@def SOATAG_SRTP_INTEGRITY(x)
- *  
+ *
  * Enable SRTP integrity protection
  *
  * @par Used with
@@ -576,7 +576,7 @@
  *    @c !=0 enable \n
  *    @c 0 disable
  *
- * Corresponding tag taking reference parameter is 
+ * Corresponding tag taking reference parameter is
  * SOATAG_SRTP_INTEGRITY_REF()
  *
  * @todo SRTP functionality is not implemented.
@@ -585,12 +585,12 @@
 
 /**@def SOATAG_HOLD(x)
  *
- * Hold media stream or streams. 
+ * Hold media stream or streams.
  *
  * The hold media stream will have the attribute a=sendonly (meaning that
  * some hold announcements or pause music is sent to the held party but that
  * the held party should not generate any media) or a=inactive (meaning that
- * no media is sent). 
+ * no media is sent).
  *
  * When putting a SIP session on hold with sendonly, the application can
  * include, e.g., SOATAG_HOLD("audio") or SOATAG_HOLD("video") or
@@ -636,7 +636,7 @@
  *   - true (1) - update session with m= line in user SDP based on their order
  *
  * The default value is false and session are updated based on media types.
- * 
+ *
  *
  * Corresponding tag taking a reference parameter is SOATAG_RTP_SELECT_REF().
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa.h	Tue Dec 23 07:37:03 2008
@@ -62,20 +62,20 @@
 
 SOFIAPUBFUN int soa_set_params(soa_session_t *ss,
 			       tag_type_t tag, tag_value_t value, ...);
-SOFIAPUBFUN int soa_get_params(soa_session_t const *ss, 
+SOFIAPUBFUN int soa_get_params(soa_session_t const *ss,
 			       tag_type_t tag, tag_value_t value, ...);
 
 SOFIAPUBFUN tagi_t *soa_get_paramlist(soa_session_t const *ss,
 				      tag_type_t tag, tag_value_t value, ...);
 
-SOFIAPUBFUN int soa_error_as_sip_response(soa_session_t *soa, 
+SOFIAPUBFUN int soa_error_as_sip_response(soa_session_t *soa,
 					  char const **return_phrase);
 
 SOFIAPUBFUN char const *soa_error_as_sip_reason(soa_session_t *soa);
 
 SOFIAPUBFUN int soa_get_warning(soa_session_t *ss, char const **return_phrase);
 
-SOFIAPUBFUN int soa_set_capability_sdp(soa_session_t *ss, 
+SOFIAPUBFUN int soa_set_capability_sdp(soa_session_t *ss,
 				       struct sdp_session_s const *sdp,
 				       char const *str, issize_t len);
 
@@ -84,7 +84,7 @@
 				       char const **return_sdp_str,
 				       isize_t *return_len);
 
-SOFIAPUBFUN int soa_set_remote_sdp(soa_session_t *ss, 
+SOFIAPUBFUN int soa_set_remote_sdp(soa_session_t *ss,
 				   struct sdp_session_s const *sdp,
 				   char const *str, issize_t len);
 
@@ -97,7 +97,7 @@
 
 SOFIAPUBFUN int soa_get_remote_version(soa_session_t const *ss);
 
-SOFIAPUBFUN int soa_set_user_sdp(soa_session_t *ss, 
+SOFIAPUBFUN int soa_set_user_sdp(soa_session_t *ss,
 				 struct sdp_session_s const *sdp,
 				 char const *str, issize_t len);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_session.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_session.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_session.h	Tue Dec 23 07:37:03 2008
@@ -57,7 +57,7 @@
   void (*soa_deinit)(soa_session_t *ss);
   int (*soa_set_params)(soa_session_t *ss, tagi_t const *tags);
   int (*soa_get_params)(soa_session_t const *ss, tagi_t *tags);
-  tagi_t *(*soa_get_paramlist)(soa_session_t const *ss, 
+  tagi_t *(*soa_get_paramlist)(soa_session_t const *ss,
 			       tag_type_t, tag_value_t, ...);
   char **(*soa_media_features)(soa_session_t *, int live, su_home_t *);
   char const * const *(*soa_sip_require)(soa_session_t const *ss);
@@ -98,10 +98,10 @@
 SOFIAPUBFUN int soa_base_remote_sip_features(soa_session_t *ss,
 					     char const * const *support,
 					     char const * const *required);
-SOFIAPUBFUN int soa_base_set_capability_sdp(soa_session_t *ss, 
+SOFIAPUBFUN int soa_base_set_capability_sdp(soa_session_t *ss,
 					    sdp_session_t *sdp,
 					    char const *, isize_t);
-SOFIAPUBFUN int soa_base_set_remote_sdp(soa_session_t *ss, 
+SOFIAPUBFUN int soa_base_set_remote_sdp(soa_session_t *ss,
 					int new_version,
 					sdp_session_t *sdp, char const *, isize_t);
 SOFIAPUBFUN int soa_base_set_user_sdp(soa_session_t *ss,
@@ -120,7 +120,7 @@
 SOFIAPUBFUN int soa_base_deactivate(soa_session_t *ss, char const *option);
 SOFIAPUBFUN void soa_base_terminate(soa_session_t *ss, char const *option);
 
-struct soa_description 
+struct soa_description
 {
   sdp_session_t  *ssd_sdp;	/**< Session description  */
   char const     *ssd_unparsed;	/**< Original session description as string */
@@ -205,7 +205,7 @@
   int             ss_status;	/**< Status from last media operation */
   char const     *ss_phrase;	/**< Phrase from last media operation */
   char           *ss_reason;	/**< Reason generated by media operation */
-  
+
 
   /* Media parameters */
   char const     *ss_address;
@@ -240,26 +240,26 @@
 
 enum soa_activity { soa_activity_local, soa_activity_remote, soa_activity_session };
 
-SOFIAPUBFUN void soa_set_activity(soa_session_t *ss, 
-				  sdp_media_t const *m, 
+SOFIAPUBFUN void soa_set_activity(soa_session_t *ss,
+				  sdp_media_t const *m,
 				  enum soa_activity activity);
 
-SOFIAPUBFUN int soa_description_set(soa_session_t *ss, 
+SOFIAPUBFUN int soa_description_set(soa_session_t *ss,
 				    struct soa_description *ssd,
 				    sdp_session_t *sdp,
 				    char const *sdp_str,
 				    isize_t sdp_len);
 
-SOFIAPUBFUN void soa_description_free(soa_session_t *, 
+SOFIAPUBFUN void soa_description_free(soa_session_t *,
 				      struct soa_description *ssd);
 
-SOFIAPUBFUN int soa_description_dup(su_home_t *, 
+SOFIAPUBFUN int soa_description_dup(su_home_t *,
 				    struct soa_description *ssd,
 				    struct soa_description const *ssd0);
 
 SOFIAPUBFUN int soa_init_sdp_origin(soa_session_t *ss,
 				    sdp_origin_t *o, char buf[64]);
-SOFIAPUBFUN int soa_init_sdp_connection(soa_session_t *, 
+SOFIAPUBFUN int soa_init_sdp_connection(soa_session_t *,
 					sdp_connection_t *, char buf[64]);
 
 /* ====================================================================== */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_tag.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_tag.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_tag.h	Tue Dec 23 07:37:03 2008
@@ -48,7 +48,7 @@
 SOFIAPUBVAR tag_typedef_t soatag_any;
 
 /**
- * Media states 
+ * Media states
  */
 enum {
   SOA_ACTIVE_REJECTED = -8, /**< Media rejected in negotiation */
@@ -164,7 +164,7 @@
 SOFIAPUBVAR tag_typedef_t soatag_rtp_select_ref;
 
 /** Parameter type for SOATAG_RTP_SELECT() */
-enum { 
+enum {
   SOA_RTP_SELECT_SINGLE,	/**< Select the best common codec */
   SOA_RTP_SELECT_COMMON,	/**< Select all common codecs */
   SOA_RTP_SELECT_ALL		/**< Select all local codecs */
@@ -183,7 +183,7 @@
 /** Parameter type for SOATAG_RTP_SORT() */
 enum {
   SOA_RTP_SORT_DEFAULT,		/**< Select codecs by local preference
-				 *  when media is recvonly, 
+				 *  when media is recvonly,
 				 * remote preference othewise.
 				 */
   SOA_RTP_SORT_LOCAL,		/**< Select codecs by local preference. */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c	Tue Dec 23 07:37:03 2008
@@ -72,7 +72,7 @@
 
 #define NONE ((void*)-1)
 
-struct context 
+struct context
 {
   su_home_t home[1];
   su_root_t *root;
@@ -130,11 +130,11 @@
   TEST_1(soa_get_user_sdp(NULL, NULL, NULL, NULL) < 0);
   TEST_1(soa_get_local_sdp(NULL, NULL, NULL, NULL) < 0);
 
-  TEST_1(-1 == soa_generate_offer(NULL, 0, test_api_completed)); 
+  TEST_1(-1 == soa_generate_offer(NULL, 0, test_api_completed));
 
-  TEST_1(-1 == soa_generate_answer(NULL, test_api_completed)); 
+  TEST_1(-1 == soa_generate_answer(NULL, test_api_completed));
 
-  TEST_1(-1 == soa_process_answer(NULL, test_api_completed)); 
+  TEST_1(-1 == soa_process_answer(NULL, test_api_completed));
 
   TEST_1(-1 == soa_process_reject(NULL, test_api_completed));
 
@@ -162,7 +162,7 @@
 int test_soa_tags(struct context *ctx)
 {
   BEGIN();
-  
+
   su_home_t home[1] = { SU_HOME_INIT(home) };
   tagi_t *t;
 
@@ -194,7 +194,7 @@
 
   ctx->root = su_root_create(ctx); TEST_1(ctx->root);
 
-  ctx->asynch.a = soa_create("asynch", ctx->root, ctx); 
+  ctx->asynch.a = soa_create("asynch", ctx->root, ctx);
   TEST_1(!ctx->asynch.a);
 
 #if 0
@@ -205,7 +205,7 @@
 
   TEST_1(soa_find("asynch"));
 
-  ctx->asynch.a = soa_create("asynch", ctx->root, ctx); 
+  ctx->asynch.a = soa_create("asynch", ctx->root, ctx);
   TEST_1(ctx->asynch.a);
 
   ctx->asynch.b = soa_create("asynch", ctx->root, ctx);
@@ -214,7 +214,7 @@
 
   /* Create asynchronous endpoints */
 
-  ctx->a = soa_create("static", ctx->root, ctx); 
+  ctx->a = soa_create("static", ctx->root, ctx);
   TEST_1(!ctx->a);
 
   TEST_1(!soa_find("static"));
@@ -349,7 +349,7 @@
 {
   BEGIN();
   int n;
-  
+
   soa_session_t *a, *b;
 
   char const *caps = NONE, *offer = NONE, *answer = NONE;
@@ -359,19 +359,19 @@
 
   su_home_t home[1] = { SU_HOME_INIT(home) };
 
-  char const a_caps[] = 
+  char const a_caps[] =
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
     "c=IN IP4 127.0.0.2\r\n"
     "m=audio 0 RTP/AVP 0 8\r\n";
 
-  char const b_caps[] = 
+  char const b_caps[] =
     "m=audio 5004 RTP/AVP 96 8\n"
     "m=rtpmap:96 GSM/8000\n";
 
-  TEST(soa_set_capability_sdp(ctx->a, 0, "m=audio 0 RTP/AVP 0 8", -1), 
+  TEST(soa_set_capability_sdp(ctx->a, 0, "m=audio 0 RTP/AVP 0 8", -1),
        1);
-  TEST(soa_set_capability_sdp(ctx->a, 0, a_caps, strlen(a_caps)), 
+  TEST(soa_set_capability_sdp(ctx->a, 0, a_caps, strlen(a_caps)),
        1);
   TEST(soa_get_capability_sdp(ctx->a, NULL, &caps, &capslen), 1);
 
@@ -402,7 +402,7 @@
 		     SOATAG_AF(SOA_AF_IP4_ONLY),
 		     SOATAG_ADDRESS("1.2.3.4"),
 		     TAG_END());
-  
+
   n = soa_generate_answer(b, test_completed); TEST(n, 0);
 
   TEST_1(soa_is_complete(b));
@@ -498,7 +498,7 @@
   TEST(soa_is_audio_active(b), SOA_ACTIVE_INACTIVE);
   TEST(soa_is_remote_audio_active(b), SOA_ACTIVE_INACTIVE);
 
-  /* 'A' will release hold. */ 
+  /* 'A' will release hold. */
   TEST(soa_set_params(a, SOATAG_HOLD(NULL), TAG_END()), 1);
 
   TEST(soa_generate_offer(a, 1, test_completed), 0);
@@ -540,7 +540,7 @@
       c = sdp->sdp_connection;
     TEST_1(c);
     c->c_address = "0.0.0.0";
-    
+
     TEST_1(p = sdp_print(home, sdp, NULL, 0, sdp_f_realloc));
     TEST_1(sdp_message(p));
     offer = sdp_message(p); offerlen = strlen(offer);
@@ -562,10 +562,10 @@
   TEST(soa_is_audio_active(b), SOA_ACTIVE_RECVONLY);
   TEST(soa_is_remote_audio_active(b), SOA_ACTIVE_RECVONLY);
 
-  /* 'A' will propose adding video. */ 
-  /* 'B' will reject. */ 
+  /* 'A' will propose adding video. */
+  /* 'B' will reject. */
   TEST(soa_set_params(a,
-		      SOATAG_HOLD(NULL),  /* 'A' will release hold. */ 
+		      SOATAG_HOLD(NULL),  /* 'A' will release hold. */
 		      SOATAG_USER_SDP_STR("m=audio 5008 RTP/AVP 0 8\r\ni=x\r\n"
 					  "m=video 5006 RTP/AVP 34\r\n"),
 		      TAG_END()), 2);
@@ -596,7 +596,7 @@
     sdp_session_t const *l = NULL, *u = NULL, *r = NULL;
     sdp_media_t const *m;
 
-    TEST(soa_get_params(b, 
+    TEST(soa_get_params(b,
 			SOATAG_LOCAL_SDP_REF(l),
 			SOATAG_USER_SDP_REF(u),
 			SOATAG_REMOTE_SDP_REF(r),
@@ -611,7 +611,7 @@
 
   /* 'B' will now propose adding video. */
   /* 'A' will accept. */
-  TEST(soa_set_params(b, 
+  TEST(soa_set_params(b,
 		      SOATAG_USER_SDP_STR("m=audio 5004 RTP/AVP 0 8\r\n"
 					  "m=video 5006 RTP/AVP 34\r\n"),
 		      TAG_END()), 1);
@@ -636,14 +636,14 @@
   TEST(soa_is_audio_active(a), SOA_ACTIVE_SENDRECV);
   TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_SENDRECV);
   TEST(soa_is_video_active(a), SOA_ACTIVE_SENDRECV);
-  
+
   TEST_VOID(soa_terminate(a, NULL));
 
   TEST(soa_is_audio_active(a), SOA_ACTIVE_DISABLED);
   TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_DISABLED);
 
   TEST_VOID(soa_terminate(b, NULL));
-  
+
   TEST_VOID(soa_destroy(a));
   TEST_VOID(soa_destroy(b));
 
@@ -656,7 +656,7 @@
 {
   BEGIN();
   int n;
-  
+
   soa_session_t *a, *b;
 
   char const *offer = NONE, *answer = NONE;
@@ -666,7 +666,7 @@
   sdp_media_t const *m;
   sdp_rtpmap_t const *rm;
 
-  char const a_caps[] = 
+  char const a_caps[] =
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
     "c=IN IP4 127.0.0.2\r\n"
@@ -674,7 +674,7 @@
     "a=rtpmap:97 GSM/8000\n"
     ;
 
-  char const b_caps[] = 
+  char const b_caps[] =
     "m=audio 5004 RTP/AVP 96 97\n"
     "a=rtpmap:96 G7231/8000\n"
     "a=rtpmap:97 G729/8000\n";
@@ -791,7 +791,7 @@
   /* Re-O/A: add a common codec */
 
   /* Accept media without common codecs */
-  TEST_1(soa_set_params(a, SOATAG_RTP_MISMATCH(0), 
+  TEST_1(soa_set_params(a, SOATAG_RTP_MISMATCH(0),
 			SOATAG_USER_SDP_STR(
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
@@ -799,11 +799,11 @@
     "m=audio 5008 RTP/AVP 0 8 96 3 127\r\n"
     "a=rtpmap:96 G729/8000\n"
     "a=rtpmap:127 CN/8000\n"
-    ),			
+    ),
 			SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE),
 			SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL),
 			TAG_END()));
-  TEST_1(soa_set_params(b, SOATAG_RTP_MISMATCH(0), 
+  TEST_1(soa_set_params(b, SOATAG_RTP_MISMATCH(0),
 			SOATAG_USER_SDP_STR(
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
@@ -813,7 +813,7 @@
     "a=rtpmap:97 G729/8000\n"
     "a=rtpmap:111 telephone-event/8000\n"
     "a=fmtp:111 0-15\n"
-    ),			
+    ),
 			SOATAG_AUDIO_AUX("cn telephone-event"),
 			SOATAG_RTP_SORT(SOA_RTP_SORT_LOCAL),
 			SOATAG_RTP_SELECT(SOA_RTP_SELECT_COMMON),
@@ -865,7 +865,7 @@
   /* ---------------------------------------------------------------------- */
   /* Re-O/A: prune down to single codec. */
 
-  TEST_1(soa_set_params(a, 
+  TEST_1(soa_set_params(a,
 			SOATAG_USER_SDP_STR(
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
@@ -874,7 +874,7 @@
     "a=rtpmap:96 G729/8000\n"
     "a=rtpmap:97 GSM/8000\n"
     "a=rtpmap:127 CN/8000\n"
-    ),			
+    ),
 			SOATAG_RTP_MISMATCH(0),
 			SOATAG_RTP_SELECT(SOA_RTP_SELECT_COMMON),
 			TAG_END()));
@@ -911,8 +911,8 @@
   TEST_S(rm->rm_encoding, "CN");
   TEST_1(!rm->rm_next);
 
-  /* Answering end matches payload types 
-     then sorts by local preference, 
+  /* Answering end matches payload types
+     then sorts by local preference,
      then select best codec => GSM with pt 97 */
   TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
   TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 97);
@@ -1181,7 +1181,7 @@
 
   TEST_VOID(soa_terminate(a, NULL));
   TEST_VOID(soa_terminate(b, NULL));
-  
+
   TEST_VOID(soa_destroy(a));
   TEST_VOID(soa_destroy(b));
 
@@ -1295,7 +1295,7 @@
 {
   BEGIN();
   int n;
-  
+
   soa_session_t *a, *b;
 
   char const *offer = NONE, *answer = NONE;
@@ -1304,14 +1304,14 @@
   sdp_session_t const *a_sdp, *b_sdp;
   sdp_media_t const *m;
 
-  char const a_caps[] = 
+  char const a_caps[] =
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
     "c=IN IP4 127.0.0.2\r\n"
     "m=audio 5008 RTP/AVP 0 8\r\n"
     ;
 
-  char const b_caps[] = 
+  char const b_caps[] =
     "m=audio 5004 RTP/AVP 0 8\n"
     "a=rtpmap:96 G7231/8000\n"
     "a=rtpmap:97 G729/8000\n"
@@ -1369,7 +1369,7 @@
     "a=T38FaxTranscodingJBIG:0\r\n"
     "a=T38FaxRateManagement:transferredTCF\r\n"
     "a=T38FaxMaxDatagram:400\r\n"
-    ),			
+    ),
 			TAG_END()));
 
   n = soa_generate_offer(a, 1, test_completed); TEST(n, 0);
@@ -1392,21 +1392,21 @@
   TEST_1(m = a_sdp->sdp_media); TEST_1(!m->m_rejected);
   TEST(m->m_type, sdp_media_image);
   TEST(m->m_proto, sdp_proto_udptl);
-  TEST_1(m->m_format); 
-  TEST_S(m->m_format->l_text, "t38"); 
+  TEST_1(m->m_format);
+  TEST_S(m->m_format->l_text, "t38");
 
   TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
   TEST(m->m_type, sdp_media_image);
   TEST(m->m_proto, sdp_proto_udptl);
-  TEST_1(m->m_format); 
-  TEST_S(m->m_format->l_text, "t38"); 
+  TEST_1(m->m_format);
+  TEST_S(m->m_format->l_text, "t38");
 
   TEST(soa_is_audio_active(a), SOA_ACTIVE_DISABLED);
   TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_DISABLED);
 
   TEST_VOID(soa_terminate(a, NULL));
   TEST_VOID(soa_terminate(b, NULL));
-  
+
   TEST_VOID(soa_destroy(a));
   TEST_VOID(soa_destroy(b));
 
@@ -1571,7 +1571,7 @@
 {
   BEGIN();
   int n;
-  
+
   soa_session_t *a, *b;
 
   char const *offer = NONE, *answer = NONE;
@@ -1579,7 +1579,7 @@
 
   sdp_session_t const *b_sdp;
 
-  char const a_caps[] = 
+  char const a_caps[] =
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
     "c=IN IP4 127.0.0.2\r\n"
@@ -1587,7 +1587,7 @@
     "a=rtpmap:97 GSM/8000\n"
     ;
 
-  char const b_caps[] = 
+  char const b_caps[] =
     "m=audio 0 RTP/AVP 96 97\n"
     "a=rtpmap:96 G7231/8000\n"
     "a=rtpmap:97 G729/8000\n";
@@ -1620,7 +1620,7 @@
 
   TEST_VOID(soa_terminate(a, NULL));
   TEST_VOID(soa_terminate(b, NULL));
-  
+
   TEST_VOID(soa_destroy(a));
   TEST_VOID(soa_destroy(b));
 
@@ -1632,7 +1632,7 @@
 {
   BEGIN();
   int n;
-  
+
   soa_session_t *a, *b;
 
   char const *offer = NONE, *answer = NONE;
@@ -1641,7 +1641,7 @@
   sdp_session_t const *a_sdp, *b_sdp;
   sdp_media_t const *m;
 
-  char const a_caps[] = 
+  char const a_caps[] =
     "v=0\r\n"
     "o=a 432432423423 2 IN IP4 127.0.0.2\r\n"
     "c=IN IP4 127.0.0.2\r\n"
@@ -1657,7 +1657,7 @@
     "a=rtpmap:96 G7231/8000\n"
     "a=rtpmap:97 G729/8000\n";
 
-  char const a_caps2[] = 
+  char const a_caps2[] =
     "v=0\r\n"
     "o=a 432432423423 2 IN IP4 127.0.0.2\r\n"
     "c=IN IP4 127.0.0.2\r\n"
@@ -1671,14 +1671,14 @@
     "a=T38FaxRateManagement:transferredTCF\r\n"
     "a=T38FaxMaxDatagram:400\r\n";
 
-  char const b_caps[] = 
+  char const b_caps[] =
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
     "c=IN IP4 127.0.0.2\r\n"
     "m=audio 5008 RTP/AVP 0 8\r\n"
     ;
 
-  char const b_caps2[] = 
+  char const b_caps2[] =
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
     "c=IN IP4 127.0.0.2\r\n"
@@ -1759,22 +1759,22 @@
   TEST_1(m = m->m_next);
   TEST(m->m_type, sdp_media_image);
   TEST(m->m_proto, sdp_proto_udptl);
-  TEST_1(m->m_format); 
-  TEST_S(m->m_format->l_text, "t38"); 
+  TEST_1(m->m_format);
+  TEST_S(m->m_format->l_text, "t38");
 
   TEST_1(m = b_sdp->sdp_media); TEST_1(m->m_rejected);
   TEST_1(m = m->m_next);
   TEST(m->m_type, sdp_media_image);
   TEST(m->m_proto, sdp_proto_udptl);
-  TEST_1(m->m_format); 
-  TEST_S(m->m_format->l_text, "t38"); 
+  TEST_1(m->m_format);
+  TEST_S(m->m_format->l_text, "t38");
 
   TEST(soa_is_audio_active(a), SOA_ACTIVE_DISABLED);
   TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_DISABLED);
 
   TEST_VOID(soa_terminate(a, NULL));
   TEST_VOID(soa_terminate(b, NULL));
-  
+
   TEST_VOID(soa_destroy(a));
   TEST_VOID(soa_destroy(b));
 
@@ -1788,25 +1788,25 @@
 
 #if 0				/* This has never been implemented */
   int n;
-  
+
   char const *caps = NONE, *offer = NONE, *answer = NONE;
   isize_t capslen = -1, offerlen = -1, answerlen = -1;
 
-  char const a[] = 
+  char const a[] =
     "v=0\r\n"
     "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
     "c=IN IP4 127.0.0.2\r\n"
     "m=audio 5004 RTP/AVP 0 8\r\n";
 
-  char const b[] = 
+  char const b[] =
     "v=0\n"
     "o=right 93298573265 321974 IN IP4 127.0.0.3\n"
     "c=IN IP4 127.0.0.3\n"
     "m=audio 5006 RTP/AVP 96\n"
     "m=rtpmap:96 GSM/8000\n";
 
-  n = soa_set_capability_sdp(ctx->asynch.a, 0, 
-			     "m=audio 5004 RTP/AVP 0 8", -1); 
+  n = soa_set_capability_sdp(ctx->asynch.a, 0,
+			     "m=audio 5004 RTP/AVP 0 8", -1);
   TEST(n, 1);
 
   n = soa_set_capability_sdp(ctx->asynch.a, 0, a, strlen(a)); TEST(n, 1);
@@ -1819,7 +1819,7 @@
 
   n = soa_generate_offer(ctx->asynch.a, 1, test_completed); TEST(n, 1);
 
-  su_root_run(ctx->root); TEST(ctx->completed, ctx->asynch.a); 
+  su_root_run(ctx->root); TEST(ctx->completed, ctx->asynch.a);
   ctx->completed = NULL;
 
   n = soa_get_local_sdp(ctx->asynch.a, 0, &offer, &offerlen); TEST(n, 1);
@@ -1828,7 +1828,7 @@
 
   n = soa_generate_answer(ctx->asynch.b, test_completed); TEST(n, 1);
 
-  su_root_run(ctx->root); TEST(ctx->completed, ctx->asynch.b); 
+  su_root_run(ctx->root); TEST(ctx->completed, ctx->asynch.b);
   ctx->completed = NULL;
 
   TEST_1(soa_is_complete(ctx->asynch.b));
@@ -1840,7 +1840,7 @@
 
   n = soa_process_answer(ctx->asynch.a, test_completed); TEST(n, 1);
 
-  su_root_run(ctx->root); TEST(ctx->completed, ctx->asynch.a); 
+  su_root_run(ctx->root); TEST(ctx->completed, ctx->asynch.a);
   ctx->completed = NULL;
 
   TEST_1(soa_is_complete(ctx->asynch.a));
@@ -1867,7 +1867,7 @@
   TEST_VOID(soa_terminate(ctx->asynch.b, NULL));
 
 #endif
-  
+
   END();
 }
 
@@ -1878,7 +1878,7 @@
   su_root_destroy(ctx->root), ctx->root = NULL;
   soa_destroy(ctx->a);
   soa_destroy(ctx->b);
-  
+
   END();
 }
 
@@ -1892,8 +1892,8 @@
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
-	  "usage: %s [-v|-q] [-a] [-l level] [-p outbound-proxy-uri]\n", 
+  fprintf(stderr,
+	  "usage: %s [-v|-q] [-a] [-l level] [-p outbound-proxy-uri]\n",
 	  name);
   exit(exitcode);
 }
@@ -1927,7 +1927,7 @@
 
       if (rest == NULL || *rest)
 	usage(1);
-      
+
       su_log_set_level(soa_log, level);
     }
     else if (strcmp(argv[i], "--attach") == 0) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/127.zone
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/127.zone	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/127.zone	Tue Dec 23 07:37:03 2008
@@ -3,7 +3,7 @@
 			1 ; serial
 			28800 ; refresh
 			7200 ; retry
-			604800 ; expire	
+			604800 ; expire
 			86400 ; ttk
 			)
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/194.2.188
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/194.2.188	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/194.2.188	Tue Dec 23 07:37:03 2008
@@ -7,7 +7,7 @@
 	     36000000   ; EXPIRE
 	     120        ; MINIMUM
 	     )
-	       	
+
 	    NS	 ns.example.com.
 
 133	    PTR  sip00.example.com.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/3.f.f.e.1.2.0.0.3.0.1.2.c.0.0.0
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/3.f.f.e.1.2.0.0.3.0.1.2.c.0.0.0	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/3.f.f.e.1.2.0.0.3.0.1.2.c.0.0.0	Tue Dec 23 07:37:03 2008
@@ -7,7 +7,7 @@
 	     36000000   ; EXPIRE
 	     120        ; MINIMUM
 	     )
-	       	
+
 	    NS	 ns.example.com.
 
 c.a.7.e.d.7.e.f.f.f.0.2.8.0.a.0 PTR  sip01.example.com.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/3.f.f.e.1.2.0.0.3.0.1.2.c.0.0.0.arpa
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/3.f.f.e.1.2.0.0.3.0.1.2.c.0.0.0.arpa	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/3.f.f.e.1.2.0.0.3.0.1.2.c.0.0.0.arpa	Tue Dec 23 07:37:03 2008
@@ -7,7 +7,7 @@
 	     36000000   ; EXPIRE
 	     120        ; MINIMUM
 	     )
-	       	
+
 	    NS	 ns.example.com.
 
 c.a.7.e.d.7.e.f.f.f.0.2.8.0.a.0 PTR  sip01.example.com.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -17,9 +17,9 @@
 
 noinst_LTLIBRARIES = 	libsresolv.la
 
-check_PROGRAMS = 	torture_sresolv test_sresolv 
+check_PROGRAMS = 	torture_sresolv test_sresolv
 
-TESTS = 		torture_sresolv run_test_sresolv 
+TESTS = 		torture_sresolv run_test_sresolv
 
 CLEANFILES =		resolv.conf error.conf named.conf.tmp \
 			.test_sresolv.api.conf.?????? \

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/example.com
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/example.com	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/example.com	Tue Dec 23 07:37:03 2008
@@ -53,7 +53,7 @@
 full	A6	0 3ff0:12:3012:c006:0a08:20ff:fe7d:e7ac
 
 sip00	A	194.2.188.133
-	AAAA	3ff0:0010:3012:c000:02c0:95ff:fee2:4b78 
+	AAAA	3ff0:0010:3012:c000:02c0:95ff:fee2:4b78
 
 sip01	A	194.2.188.134
 	AAAA	3ff0:0012:3012:c006:0a08:20ff:fe7d:e7ac

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/resolve_sip.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/resolve_sip.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/resolve_sip.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@file resolve_sip.c Use sresolv library to resolve a SIP or SIPS domain.
  *
- * This is an example program for @b sresolv library. 
+ * This is an example program for @b sresolv library.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
@@ -94,9 +94,9 @@
 static int query_a(struct context *sr, char const *domain);
 
 /* Process NAPTR records */
-static 
-void answer_to_naptr_query(sres_context_t *sr, 
-			   sres_query_t *q, 
+static
+void answer_to_naptr_query(sres_context_t *sr,
+			   sres_query_t *q,
 			   sres_record_t *answers[])
 {
   int i;
@@ -104,7 +104,7 @@
   sr->sr_query = NULL;
 
   /* Sort NAPTR records by the order. */
-  sres_sort_answers(sr->sres, answers);  
+  sres_sort_answers(sr->sres, answers);
 
   for (i = 0; answers && answers[i]; i++) {
     sres_naptr_record_t const *na = answers[i]->sr_naptr;
@@ -114,8 +114,8 @@
       continue;
 
     printf("naptr: %s\n\t%d IN NAPTR %u %u \"%s\" \"%s\" \"%s\" %s\n",
-	   na->na_record->r_name, na->na_record->r_ttl, 
-	   na->na_order, na->na_prefer, 
+	   na->na_record->r_name, na->na_record->r_ttl,
+	   na->na_order, na->na_prefer,
 	   na->na_flags, na->na_services,
 	   na->na_regexp, na->na_replace);
 
@@ -162,8 +162,8 @@
 }
 
 /* Process SRV records */
-static 
-void answer_to_srv_query(sres_context_t *sr, sres_query_t *q, 
+static
+void answer_to_srv_query(sres_context_t *sr, sres_query_t *q,
 			 sres_record_t *answers[])
 {
   int i;
@@ -206,8 +206,8 @@
 }
 
 /* Process A records */
-static 
-void answer_to_a_query(sres_context_t *sr, sres_query_t *q, 
+static
+void answer_to_a_query(sres_context_t *sr, sres_query_t *q,
 		       sres_record_t *answers[])
 {
   int i;
@@ -260,11 +260,11 @@
   sr->sr_n_sockets = 1;
   sr->sr_sockets = calloc(1, sizeof(*sr->sr_sockets));
   sr->sr_pollfds = calloc(1, sizeof(*sr->sr_pollfds));
-  
+
   if (!sr->sr_sockets || !sr->sr_pollfds ||
       (sres_resolver_sockets(sr->sres, sr->sr_sockets, 1) == -1))
     return 0;
-  
+
   sr->sr_pollfds[0].fd = sr->sr_sockets[0];
   sr->sr_pollfds[0].events = POLLIN | POLLERR;
 
@@ -280,14 +280,14 @@
   while (!sr->sr_ready) {
     events = poll(sr->sr_pollfds, n, 500);
 
-    if (events) 
+    if (events)
       for (i = 0; i < n; i++) {
 	if (sr->sr_pollfds[i].revents)
 	  sres_resolver_receive(sr->sres, sr->sr_pollfds[i].fd);
       }
 
     /* No harm is done (except wasted CPU) if timer is called more often */
-    sres_resolver_timer(sr->sres, sr->sr_sockets[0]); 
+    sres_resolver_timer(sr->sres, sr->sr_sockets[0]);
   }
 }
 
@@ -310,8 +310,8 @@
 
   sr->sres = sres_resolver_new(getenv("SRESOLV_CONF"));
 
-  if (sr->sres) 
-    if (prepare_run(sr)) 
+  if (sr->sres)
+    if (prepare_run(sr))
       if (query_naptr(sr, sr->sr_canon = argv[1]) == 0)
 	run(sr);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/root.zone
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/root.zone	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/root.zone	Tue Dec 23 07:37:03 2008
@@ -10,5 +10,3 @@
 ns.example.com	A	127.0.0.2
 		AAAA	::2
 		A6	0 ::2
-
-	
\ No newline at end of file

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/run_test_sresolv
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/run_test_sresolv	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/run_test_sresolv	Tue Dec 23 07:37:03 2008
@@ -61,14 +61,14 @@
 } || {
 echo test_sresolv: there is no BIND 9 named in you path, skipping
 exit 77
-} 
+}
 
 if eval $ipv6
 then
     # Figure out nice IPv6 address for us
     ns=`ip addr ls | awk '
     /^[0-9]:/ { up = ($3 ~ /UP/) && ($3 !~ /LOOPBACK/); }
-    /inet6 fe80::/ { next; } # no link-local 
+    /inet6 fe80::/ { next; } # no link-local
     up && $1 ~ /inet6/ { sub(/\/.*$/, "", $2); print $2; exit 0; }'`
 
     # Nothing found, use localnode ::1
@@ -161,13 +161,13 @@
 echo $0: started named pid $!
 for i in 1 2 3 4 5; do
     test -r $t/named.pid && break
-    sleep 1; 
+    sleep 1;
 done
 
-test -r $t/named.pid || { 
-    echo $0: cannot start named >&2 ; 
+test -r $t/named.pid || {
+    echo $0: cannot start named >&2 ;
     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 
+	echo $0: perhaps you have to disable SELinux protection for named
     fi
     exit 77
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres.h	Tue Dec 23 07:37:03 2008
@@ -94,7 +94,7 @@
 /** Opaque type of DNS resolver object. */
 typedef struct sres_resolver_s sres_resolver_t;
 
-#ifndef SRES_CONTEXT_T 
+#ifndef SRES_CONTEXT_T
 #define SRES_CONTEXT_T struct sres_context_s
 #endif
 /** Application-defined type for sres_query_t context. */
@@ -119,7 +119,7 @@
 			     char const *options, ...);
 
 /** New resolver object. */
-SRESPUBFUN 
+SRESPUBFUN
 sres_resolver_t *
 sres_resolver_new_with_cache_va(char const *conf_file_path,
 				sres_cache_t *cache,
@@ -148,12 +148,12 @@
  * function is responsible for freeing the list of answers and it must
  * (eventually) call sres_free_answers().
  */
-typedef void sres_answer_f(sres_context_t *context, 
+typedef void sres_answer_f(sres_context_t *context,
 			   sres_query_t *query,
 			   sres_record_t **answers);
 
 /** Make a DNS query. */
-SRESPUBFUN 
+SRESPUBFUN
 sres_query_t *sres_query(sres_resolver_t *res,
                          sres_answer_f *callback,
                          sres_context_t *context,
@@ -161,7 +161,7 @@
                          char const *domain);
 
 /** Search DNS. */
-SRESPUBFUN 
+SRESPUBFUN
 sres_query_t *sres_search(sres_resolver_t *res,
 			  sres_answer_f *callback,
 			  sres_context_t *context,
@@ -169,7 +169,7 @@
 			  char const *name);
 
 /** Make a reverse DNS query. */
-SRESPUBFUN 
+SRESPUBFUN
 sres_query_t *sres_query_sockaddr(sres_resolver_t *res,
                                   sres_answer_f *callback,
                                   sres_context_t *context,
@@ -177,7 +177,7 @@
 				  struct sockaddr const *addr);
 
 /** Make a DNS query with socket. @deprecated */
-SRESPUBFUN 
+SRESPUBFUN
 sres_query_t *sres_query_make(sres_resolver_t *res,
 			      sres_answer_f *callback,
 			      sres_context_t *context,
@@ -186,7 +186,7 @@
 			      char const *domain);
 
 /** Make a reverse DNS query with socket. @deprecated */
-SRESPUBFUN 
+SRESPUBFUN
 sres_query_t *sres_query_make_sockaddr(sres_resolver_t *res,
 				       sres_answer_f *callback,
 				       sres_context_t *context,
@@ -195,25 +195,25 @@
 				       struct sockaddr const *addr);
 
 /** Rebind a DNS query. */
-SRESPUBFUN 
+SRESPUBFUN
 void sres_query_bind(sres_query_t *q,
                      sres_answer_f *callback,
                      sres_context_t *context);
 
 /**Get a list of matching (type/domain) records from cache. */
-SRESPUBFUN 
+SRESPUBFUN
 sres_record_t **sres_cached_answers(sres_resolver_t *res,
 				    uint16_t type,
 				    char const *domain);
 
 /**Search for a list of matching (type/name) records from cache. */
-SRESPUBFUN 
+SRESPUBFUN
 sres_record_t **sres_search_cached_answers(sres_resolver_t *res,
 					   uint16_t type,
 					   char const *name);
 
 /**Get a list of matching (type/domain) records from cache. */
-SRESPUBFUN 
+SRESPUBFUN
 sres_record_t **sres_cached_answers_sockaddr(sres_resolver_t *res,
                                              uint16_t type,
 					     struct sockaddr const *addr);
@@ -229,7 +229,7 @@
 
 
 /** Send a query, wait for answer, return results. */
-SRESPUBFUN 
+SRESPUBFUN
 int sres_blocking_query(sres_resolver_t *res,
 			uint16_t type,
 			char const *domain,
@@ -237,7 +237,7 @@
 			sres_record_t ***return_records);
 
 /** Search DNS, return results. */
-SRESPUBFUN 
+SRESPUBFUN
 int sres_blocking_search(sres_resolver_t *res,
 			 uint16_t type,
 			 char const *name,
@@ -245,7 +245,7 @@
 			 sres_record_t ***return_records);
 
 /** Send a a reverse DNS query, wait for answer, return results. */
-SRESPUBFUN 
+SRESPUBFUN
 int sres_blocking_query_sockaddr(sres_resolver_t *res,
 				 uint16_t type,
 				 struct sockaddr const *addr,
@@ -260,8 +260,8 @@
 
 /** Filter and sort the list of records */
 SRESPUBFUN
-int sres_filter_answers(sres_resolver_t *res, 
-			sres_record_t **answers, 
+int sres_filter_answers(sres_resolver_t *res,
+			sres_record_t **answers,
 			uint16_t type);
 
 /** Free the list records. */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_async.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_async.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_async.h	Tue Dec 23 07:37:03 2008
@@ -27,7 +27,7 @@
 #define SOFIA_RESOLV_SRES_ASYNC_H
 
 /**
- * @file sofia-resolv/sres_async.h 
+ * @file sofia-resolv/sres_async.h
  *
  * Asynchronous interface for Sofia DNS Resolver.
  *
@@ -50,7 +50,7 @@
 extern "C" {
 #endif
 
-#ifndef SRES_ASYNC_T 
+#ifndef SRES_ASYNC_T
 #define SRES_ASYNC_T struct sres_async_s
 #endif
 /** Application-defined type for context used by asynchronous operation. */
@@ -59,7 +59,7 @@
 /** Prototype for update function.
  *
  * This kind of function is called when the nameserver configuration has
- * been updated. 
+ * been updated.
  *
  * If the old_socket is not -1, it indicates that old_socket will be closed
  * and it should be removed from poll() or select() set.
@@ -75,7 +75,7 @@
 
 /** Set asynchronous operation data. */
 SRESPUBFUN
-sres_async_t *sres_resolver_set_async(sres_resolver_t *res, 
+sres_async_t *sres_resolver_set_async(sres_resolver_t *res,
 				      sres_update_f *update,
 				      sres_async_t *async,
 				      int update_all);
@@ -86,7 +86,7 @@
 				      sres_update_f *update);
 
 /** Create sockets for resolver. */
-SRESPUBFUN int sres_resolver_sockets(sres_resolver_t *, 
+SRESPUBFUN int sres_resolver_sockets(sres_resolver_t *,
 				     sres_socket_t *sockets,
 				     int n);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_cache.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_cache.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_cache.h	Tue Dec 23 07:37:03 2008
@@ -81,7 +81,7 @@
 
 /** Free answers not matching with type */
 SRESPUBFUN int sres_cache_filter(sres_cache_t *cache,
-				 sres_record_t **answers, 
+				 sres_record_t **answers,
 				 uint16_t type);
 
 /** Free the list records. */
@@ -103,7 +103,7 @@
 SRESPUBFUN void sres_cache_store(sres_cache_t *, sres_record_t *, time_t now);
 
 /** Modify the priority in the specified SRV record */
-SRESPUBFUN int sres_cache_set_srv_priority(sres_cache_t *, 
+SRESPUBFUN int sres_cache_set_srv_priority(sres_cache_t *,
 					   char const *domain,
 					   char const *target,
 					   uint16_t port,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_config.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_config.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_config.h	Tue Dec 23 07:37:03 2008
@@ -27,7 +27,7 @@
 #define SOFIA_RESOLV_SRES_CONFIG_H
 
 /**
- * @file sofia-resolv/sres_config.h 
+ * @file sofia-resolv/sres_config.h
  *
  * Configuration for Sofia DNS Resolver.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_record.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_record.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_record.h	Tue Dec 23 07:37:03 2008
@@ -45,7 +45,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-  
+
 /** Common part of all DNS records. */
 typedef struct sres_common
 {
@@ -101,7 +101,7 @@
   struct in_addr a_addr;	/**< IP4 address */
 } sres_a_record_t;
 
-/** IPv6 address used by sresolv library. 
+/** IPv6 address used by sresolv library.
  *
  * @sa #sres_aaaa_record, #sres_a6_record
  */
@@ -225,10 +225,10 @@
   sres_type_nxt = 30,	    /**< Next domain. */
   sres_type_eid = 31,	    /**< Endpoint identifier. */
   sres_type_nimloc = 32,    /**< Nimrod Locator. */
-  sres_type_srv = 33,	    /**< Server Selection (@RFC2782, 
+  sres_type_srv = 33,	    /**< Server Selection (@RFC2782,
 			         #sres_srv_record). */
   sres_type_atma = 34,	    /**< ATM Address */
-  sres_type_naptr = 35,	    /**< Naming Authority PoinTeR (@RFC2915, 
+  sres_type_naptr = 35,	    /**< Naming Authority PoinTeR (@RFC2915,
                                  #sres_naptr_record) */
   sres_type_kx = 36,	    /**< Key Exchange */
   sres_type_cert = 37,	    /**< Certification record */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-sip/sresolv.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-sip/sresolv.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-sip/sresolv.h	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-#ifndef SRESOLV_H 
+#ifndef SRESOLV_H
 /** Defined when <sofia-sip/sresolv.h> has been included. */
 #define SRESOLV_H
 
@@ -64,7 +64,7 @@
 #define SRESTAG_CACHE_REF(x) srestag_cache_ref, tag_ptr_vr(&(x), (x))
 
 /** Create a resolver object using @a root reactor. */
-SOFIAPUBFUN sres_resolver_t *sres_resolver_create(su_root_t *root, 
+SOFIAPUBFUN sres_resolver_t *sres_resolver_create(su_root_t *root,
 						  char const *resolv_conf,
 				                  tag_type_t, tag_value_t,
 						  ...);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c	Tue Dec 23 07:37:03 2008
@@ -25,13 +25,13 @@
 
 /**@CFILE sres.c
  * @brief Sofia DNS Resolver implementation.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Teemu Jalava <Teemu.Jalava at nokia.com>
  * @author Mikko Haataja
- * @author Kai Vehmanen <kai.vehmanen at nokia.com> 
- *         (work on the win32 nameserver discovery) 
- * @author Dimitri E. Prado 
+ * @author Kai Vehmanen <kai.vehmanen at nokia.com>
+ *         (work on the win32 nameserver discovery)
+ * @author Dimitri E. Prado
  *         (initial version of win32 nameserver discovery)
  *
  * @todo The resolver should allow handling arbitrary records, too.
@@ -105,7 +105,7 @@
 
 #if HAVE_WINSOCK2_H
 /* Posix send() */
-su_inline 
+su_inline
 ssize_t sres_send(sres_socket_t s, void *b, size_t length, int flags)
 {
   if (length > INT_MAX)
@@ -114,7 +114,7 @@
 }
 
 /* Posix recvfrom() */
-su_inline 
+su_inline
 ssize_t sres_recvfrom(sres_socket_t s, void *buffer, size_t length, int flags,
 		      struct sockaddr *from, socklen_t *fromlen)
 {
@@ -126,7 +126,7 @@
   if (length > INT_MAX)
     length = INT_MAX;
 
-  retval = recvfrom(s, buffer, (int)length, flags, 
+  retval = recvfrom(s, buffer, (int)length, flags,
 		    (void *)from, fromlen ? &ilen : NULL);
 
   if (fromlen)
@@ -202,7 +202,7 @@
 static char const sres_conf_file_path[] = "/etc/resolv.conf";
 
 /** EDNS0 support. @internal */
-enum edns { 
+enum edns {
   edns_not_tried = -1,
   edns_not_supported = 0,
   edns0_configured = 1,
@@ -220,7 +220,7 @@
 
   /** ICMP/temporary error received, zero when successful. */
   time_t                  dns_icmp;
-  /** Persistent error, zero when successful or timeout. 
+  /** Persistent error, zero when successful or timeout.
    *
    * Never selected if dns_error is SRES_TIME_MAX.
    */
@@ -251,7 +251,7 @@
   short               res_update_all;
 
   uint16_t            res_id;
-  short               res_i_server;  /**< Current server to try 
+  short               res_i_server;  /**< Current server to try
 					(when doing round-robin) */
   short               res_n_servers; /**< Number of servers */
   sres_server_t     **res_servers;
@@ -338,7 +338,7 @@
 #define m_qdcount m_packet.mp_header.mh_qdcount
 #define m_ancount m_packet.mp_header.mh_ancount
 #define m_nscount m_packet.mp_header.mh_nscount
-#define m_arcount m_packet.mp_header.mh_arcount 
+#define m_arcount m_packet.mp_header.mh_arcount
 #define m_data    m_packet.mp_data
 };
 
@@ -385,7 +385,7 @@
    (void *)&((struct sockaddr *)ss)->sa_data)
 #endif
 
-static int sres_config_changed_servers(sres_config_t const *new_c, 
+static int sres_config_changed_servers(sres_config_t const *new_c,
 				       sres_config_t const *old_c);
 static sres_server_t **sres_servers_new(sres_resolver_t *res,
 					sres_config_t const *c);
@@ -398,8 +398,8 @@
 }
 
 /** Return true if we have a search list or a local domain name. */
-static int 
-sres_has_search_domain(sres_resolver_t *res) 
+static int
+sres_has_search_domain(sres_resolver_t *res)
 {
   return res->res_config->c_search[0] != NULL;
 }
@@ -409,7 +409,7 @@
 sres_resolver_t *
 sres_resolver_new_with_cache_va(char const *conf_file_path,
 				sres_cache_t *cache,
-				char const *options, 
+				char const *options,
 				va_list va);
 static
 sres_resolver_t *
@@ -434,25 +434,25 @@
 
 static void sres_free_query(sres_resolver_t *res, sres_query_t *q);
 
-static 
-int sres_sockaddr2string(sres_resolver_t *, 
-			 char name[], size_t namelen, 
+static
+int sres_sockaddr2string(sres_resolver_t *,
+			 char name[], size_t namelen,
 			 struct sockaddr const *);
 
-static 
+static
 sres_config_t *sres_parse_resolv_conf(sres_resolver_t *res,
 				      char const **options);
 
 static
-sres_server_t *sres_next_server(sres_resolver_t *res, 
+sres_server_t *sres_next_server(sres_resolver_t *res,
 				uint8_t *in_out_i,
 				int always);
 
 static
 int sres_send_dns_query(sres_resolver_t *res, sres_query_t *q);
 
-static 
-void sres_answer_subquery(sres_context_t *context, 
+static
+void sres_answer_subquery(sres_context_t *context,
 			  sres_query_t *query,
 			  sres_record_t **answers);
 
@@ -468,26 +468,26 @@
 static void
 sres_resend_dns_query(sres_resolver_t *res, sres_query_t *q, int timeout);
 
-static 
+static
 sres_server_t *sres_server_by_socket(sres_resolver_t const *ts,
 				     sres_socket_t socket);
 
 static
-int sres_resolver_report_error(sres_resolver_t *res, 
+int sres_resolver_report_error(sres_resolver_t *res,
 			       sres_socket_t socket,
 			       int errcode,
 			       struct sockaddr_storage *remote,
-			       socklen_t remotelen, 
+			       socklen_t remotelen,
 			       char const *info);
 
 static
-void sres_log_response(sres_resolver_t const *res, 
+void sres_log_response(sres_resolver_t const *res,
 		       sres_message_t const *m,
 		       struct sockaddr_storage const *from,
 		       sres_query_t const *query,
 		       sres_record_t * const *reply);
 
-static int sres_decode_msg(sres_resolver_t *res, 
+static int sres_decode_msg(sres_resolver_t *res,
 			   sres_message_t *m,
 			   sres_query_t **,
 			   sres_record_t ***aanswers);
@@ -531,9 +531,9 @@
 static void m_put_uint16(sres_message_t *m, uint16_t h);
 static void m_put_uint32(sres_message_t *m, uint32_t w);
 
-static uint16_t m_put_domain(sres_message_t *m, 
-                             char const *domain, 
-                             uint16_t top, 
+static uint16_t m_put_domain(sres_message_t *m,
+                             char const *domain,
+                             uint16_t top,
                              char const *topdomain);
 
 static uint32_t m_get_uint32(sres_message_t *m);
@@ -560,7 +560,7 @@
  *
  * The SRESOLV_DEBUG environment variable is used to determine the debug
  * logging level for @b sresolv module. The default level is 3.
- * 
+ *
  * @sa <sofia-sip/su_debug.h>, sresolv_log, SOFIA_DEBUG
  */
 #ifdef DOXYGEN
@@ -571,8 +571,8 @@
 #define SU_DEBUG 3
 #endif
 
-/**Debug log for @b sresolv module. 
- * 
+/**Debug log for @b sresolv module.
+ *
  * The sresolv_log is the log object used by @b sresolv module. The level of
  * #sresolv_log is set using #SRESOLV_DEBUG environment variable.
  */
@@ -593,7 +593,7 @@
  * file can be overriden by giving the name of the configuration file as @a
  * conf_file_path.
  *
- * @param conf_file_path name of the resolv.conf configuration file 
+ * @param conf_file_path name of the resolv.conf configuration file
  *
  * @return A pointer to a newly created sres resolver object, or NULL upon
  * an error.
@@ -638,9 +638,9 @@
  * It is also possible to override the values in the resolv.conf and
  * RES_OPTIONS by giving the directives in the NULL-terminated list.
  *
- * @param conf_file_path name of the resolv.conf configuration file 
+ * @param conf_file_path name of the resolv.conf configuration file
  * @param cache          optional pointer to a resolver cache (may be NULL)
- * @param option, ...    list of resolv.conf options directives 
+ * @param option, ...    list of resolv.conf options directives
  *                       (overriding options in conf_file)
  *
  * @par Environment Variables
@@ -667,7 +667,7 @@
 
 /**Create a resolver.
  *
- * Allocate and initialize a new sres resolver object. 
+ * Allocate and initialize a new sres resolver object.
  *
  * This is a stdarg version of sres_resolver_new_with_cache().
  */
@@ -683,7 +683,7 @@
   sres_resolver_t *res;
 
   va_copy(va0, va);
-  
+
   for (i = 0, o = option; o; o = va_arg(va0, char const *)) {
     if (i < 16)
       olist[i] = o;
@@ -716,7 +716,7 @@
   sres_resolver_t *res;
   size_t i, n, len;
   char **array, *o, *end;
- 
+
   for (n = 0, len = 0; options && options[n]; n++)
     len += strlen(options[n]) + 1;
 
@@ -785,7 +785,7 @@
 {
   return su_home_ref(res->res_home);
 }
-		     
+
 /** Decrease the reference count on a resolver object.  */
 void
 sres_resolver_unref(sres_resolver_t *res)
@@ -796,12 +796,12 @@
 /** Set userdata pointer.
  *
  * @return New userdata pointer.
- * 
+ *
  * @ERRORS
  * @ERROR EFAULT @a res points outside the address space
  */
 void *
-sres_resolver_set_userdata(sres_resolver_t *res, 
+sres_resolver_set_userdata(sres_resolver_t *res,
 			   void *userdata)
 {
   void *old;
@@ -817,7 +817,7 @@
 /**Get userdata pointer.
  *
  * @return Userdata pointer.
- * 
+ *
  * @ERRORS
  * @ERROR EFAULT @a res points outside the address space
  */
@@ -833,7 +833,7 @@
 /** Set async object.
  *
  * @return Set async object.
- * 
+ *
  * @ERRORS
  * @ERROR EFAULT @a res points outside the address space
  * @ERROR EALREADY different async callback already set
@@ -841,7 +841,7 @@
 sres_async_t *
 sres_resolver_set_async(sres_resolver_t *res,
 			sres_update_f *callback,
-			sres_async_t *async, 
+			sres_async_t *async,
 			int update_all)
 {
   if (!res)
@@ -849,7 +849,7 @@
 
   if (res->res_updcb && res->res_updcb != callback)
     return su_seterrno(EALREADY), (void *)NULL;
-    
+
   res->res_async = async;
   res->res_updcb = callback;
   res->res_update_all = callback && update_all != 0;
@@ -906,12 +906,12 @@
  * Query types also indicate the record type of the result.
  * Any record can be queried with #sres_qtype_any.
  * Well-known query types understood and decoded by @b sres include
- * #sres_type_a, 
+ * #sres_type_a,
  * #sres_type_aaaa,
  * #sres_type_cname,
- * #sres_type_ptr 
- * #sres_type_soa, 
- * #sres_type_aaaa, 
+ * #sres_type_ptr
+ * #sres_type_soa,
+ * #sres_type_aaaa,
  * #sres_type_srv, and
  * #sres_type_naptr.
  *
@@ -939,7 +939,7 @@
 {
   sres_query_t *query = NULL;
   size_t dlen;
-  
+
   char b[8];
   SU_DEBUG_9(("sres_query(%p, %p, %s, \"%s\") called\n",
 			  (void *)res, (void *)context, sres_record_type(type, b), domain));
@@ -970,12 +970,12 @@
 
 /**Search DNS.
  *
- * Sends DNS queries with specified @a type and @a name to the DNS server. 
+ * Sends DNS queries with specified @a type and @a name to the DNS server.
  * If the @a name does not contain enought dots, the search domains are
  * appended to the name and resulting domain name are also queried. When
  * answer to all the search domains is received, the @a callback function
  * is called with @a context and combined records from answers as arguments.
- * 
+ *
  * The sres resolver takes care of retransmitting the queries if a root
  * object is associate with the resolver or if sres_resolver_timer() is
  * called in regular intervals. It generates an error record with nonzero
@@ -1031,7 +1031,7 @@
     dots = res->res_config->c_opt.ndots;
   else if (sres_has_search_domain(res))
     for (dots = 0, dot = strchr(domain, '.');
-	 dots < res->res_config->c_opt.ndots && dot; 
+	 dots < res->res_config->c_opt.ndots && dot;
 	 dots++, dot = strchr(dot + 1, '.'))
       ;
   else
@@ -1057,7 +1057,7 @@
       for (i = 0, subs = 0; i <= SRES_MAX_SEARCH; i++) {
 	if (domains[i]) {
 	  len = strlen(domains[i]);
-	  
+
 	  if (dlen + len + 1 > SRES_MAXDNAME)
 	    continue;
 
@@ -1106,7 +1106,7 @@
  * @param context pointer given as an extra argument to @a callback function
  * @param type record type to query (or sres_qtype_any for any record)
  * @param addr socket address structure
- * 
+ *
  * The @a type should be #sres_type_ptr. The @a addr should contain either
  * IPv4 (AF_INET) or IPv6 (AF_INET6) address.
  *
@@ -1132,7 +1132,7 @@
 		    uint16_t type,
 		    struct sockaddr const *addr)
 {
-  char name[80]; 
+  char name[80];
 
   if (!res || !addr)
     return su_seterrno(EFAULT), (void *)NULL;
@@ -1171,7 +1171,7 @@
 			 uint16_t type,
 			 struct sockaddr const *addr)
 {
-  char name[80]; 
+  char name[80];
 
   if (!res || !addr)
     return su_seterrno(EFAULT), (void *)NULL;
@@ -1226,7 +1226,7 @@
 
   if (!domain)
     return NULL;
-  
+
   if (!sres_cache_get(res->res_cache, type, domain, &result))
     return su_seterrno(ENOENT), (void *)NULL;
 
@@ -1267,7 +1267,7 @@
 
   if (sres_has_search_domain(res))
     for (dots = 0, dot = strchr(domain, '.');
-	 dots < res->res_config->c_opt.ndots && dot; 
+	 dots < res->res_config->c_opt.ndots && dot;
 	 dots++, dot = strchr(dot + 1, '.'))
       ;
   else
@@ -1315,7 +1315,7 @@
  * @param res pointer to resolver
  * @param type record type to query (or sres_qtype_any for any record)
  * @param addr socket address structure
- * 
+ *
  * The @a type should be #sres_type_ptr. The @a addr should contain either
  * IPv4 (AF_INET) or IPv6 (AF_INET6) address.
  *
@@ -1324,7 +1324,7 @@
  * "ip6-dotint", the IPv6 addresses are resolved using suffix ".ip6.int"
  * instead of default ".ip6.arpa".
  *
- * @retval 
+ * @retval
  * pointer to an array of pointers to cached records, or
  * NULL if no entry was found.
  *
@@ -1363,13 +1363,13 @@
  * @param res      pointer to resolver
  * @param domain   domain name of the SRV record(s) to modify
  * @param target   SRV target of the SRV record(s) to modify
- * @param port     port number of SRV record(s) to modify 
- *                 (in host byte order) 
+ * @param port     port number of SRV record(s) to modify
+ *                 (in host byte order)
  * @param ttl      new ttl for SRV records of the domain
  * @param priority new priority value (0=highest, 65535=lowest)
  *
  * @sa sres_cache_set_srv_priority()
- * 
+ *
  * @NEW_1_12_8
  */
 int sres_set_cached_srv_priority(sres_resolver_t *res,
@@ -1389,8 +1389,8 @@
   if (!domain)
     return -1;
 
-  return sres_cache_set_srv_priority(res->res_cache, 
-				     domain, target, port, 
+  return sres_cache_set_srv_priority(res->res_cache,
+				     domain, target, port,
 				     ttl, priority);
 }
 
@@ -1409,7 +1409,7 @@
 
   /* Simple insertion sorting */
   /*
-   * We do not use qsort because we want later extend this to sort 
+   * We do not use qsort because we want later extend this to sort
    * local A records first etc.
    */
   for (i = 1; answers[i]; i++) {
@@ -1431,10 +1431,10 @@
 
 /** Sort and filter query results */
 int
-sres_filter_answers(sres_resolver_t *res, 
-		    sres_record_t **answers, 
+sres_filter_answers(sres_resolver_t *res,
+		    sres_record_t **answers,
 		    uint16_t type)
-{		    
+{
   int i, n;
 
   if (res == NULL || answers == NULL)
@@ -1465,11 +1465,11 @@
 }
 
 /** Free and zero an array of records.
- * 
- * The array of records can be returned by sres_cached_answers() or 
+ *
+ * The array of records can be returned by sres_cached_answers() or
  * given by callback function.
  */
-void 
+void
 sres_free_answers(sres_resolver_t *res,
 		  sres_record_t **answers)
 {
@@ -1528,7 +1528,7 @@
   case sres_qtype_mailb: return "MAILB";
   case sres_qtype_maila: return "MAILA";
   case sres_qtype_any: return "ANY";
-    
+
   default:
     sprintf(buffer, "%u?", type & 65535);
     return buffer;
@@ -1553,7 +1553,7 @@
 }
 
 /** Compare two records. */
-int 
+int
 sres_record_compare(sres_record_t const *aa, sres_record_t const *bb)
 {
   int D;
@@ -1565,9 +1565,9 @@
 
   if (a->r_status)
     return 0;
-  
+
   switch (a->r_type) {
-  case sres_type_soa: 
+  case sres_type_soa:
     {
       sres_soa_record_t const *A = aa->sr_soa, *B = bb->sr_soa;
       D = A->soa_serial - B->soa_serial; if (D) return D;
@@ -1588,7 +1588,7 @@
     {
       sres_a6_record_t const *A = aa->sr_a6, *B = bb->sr_a6;
       D = A->a6_prelen - B->a6_prelen; if (D) return D;
-      D = !A->a6_prename - !B->a6_prename; 
+      D = !A->a6_prename - !B->a6_prename;
       if (D == 0 && A->a6_prename && B->a6_prename)
 	D = strcasecmp(A->a6_prename, B->a6_prename); if (D) return D;
       return memcmp(&A->a6_suffix, &B->a6_suffix, sizeof A->a6_suffix);
@@ -1596,7 +1596,7 @@
   case sres_type_aaaa:
     {
       sres_aaaa_record_t const *A = aa->sr_aaaa, *B = bb->sr_aaaa;
-      return memcmp(&A->aaaa_addr, &B->aaaa_addr, sizeof A->aaaa_addr);      
+      return memcmp(&A->aaaa_addr, &B->aaaa_addr, sizeof A->aaaa_addr);
     }
   case sres_type_cname:
     {
@@ -1625,7 +1625,7 @@
       D = strcmp(A->na_flags, B->na_flags); if (D) return D;
       D = strcmp(A->na_services, B->na_services); if (D) return D;
       D = strcmp(A->na_regexp, B->na_regexp); if (D) return D;
-      return strcmp(A->na_replace, B->na_replace); 
+      return strcmp(A->na_replace, B->na_replace);
     }
   default:
     return 0;
@@ -1636,14 +1636,14 @@
 /* Private functions */
 
 /** Destruct */
-static 
-void 
+static
+void
 sres_resolver_destructor(void *arg)
 {
   sres_resolver_t *res = arg;
 
   assert(res);
-  sres_cache_unref(res->res_cache); 
+  sres_cache_unref(res->res_cache);
   res->res_cache = NULL;
 
   sres_servers_close(res, res->res_servers);
@@ -1656,7 +1656,7 @@
 }
 
 /*
- * 3571 is a prime => 
+ * 3571 is a prime =>
  * we hash successive id values to different parts of hash tables
  */
 #define Q_PRIME 3571
@@ -1697,18 +1697,18 @@
     query->q_i_server = res->res_i_server;
     query->q_n_servers = res->res_n_servers;
     query->q_hash = query->q_id * Q_PRIME /* + query->q_i_server */;
-    
+
     sres_qtable_append(res->res_queries, query);
 
     if (res->res_schedulecb && res->res_queries->qt_used == 1)
-      res->res_schedulecb(res->res_async, 2 * SRES_RETRANSMIT_INTERVAL); 
+      res->res_schedulecb(res->res_async, 2 * SRES_RETRANSMIT_INTERVAL);
   }
 
   return query;
 }
 
 su_inline
-void 
+void
 sres_remove_query(sres_resolver_t *res, sres_query_t *q, int all)
 {
   int i;
@@ -1749,7 +1749,7 @@
       sres_cache_free_answers(res->res_cache, q->q_subanswers[i]);
     q->q_subanswers[i] = NULL;
   }
- 
+
   su_free(res->res_home, q);
 }
 
@@ -1767,7 +1767,7 @@
       for (j = 0; search_results[i][j]; j++)
 	found++;
 
-  combined_result = su_alloc((su_home_t *)res->res_cache, 
+  combined_result = su_alloc((su_home_t *)res->res_cache,
 			     (found + 1) * (sizeof combined_result[0]));
   if (combined_result) {
     for (i = 0, found = 0; i <= SRES_MAX_SEARCH; i++)
@@ -1832,7 +1832,7 @@
       name[4 * i + 2] = hex > 9 ? hex + 'a' - 10 : hex + '0';
       name[4 * i + 3] = '.';
     }
-    
+
     strcpy(name + 4 * i, postfix);
 
     return (int)required;
@@ -1840,7 +1840,7 @@
 #endif /* HAVE_SIN6 */
   else {
     su_seterrno(EAFNOSUPPORT);
-    SU_DEBUG_3(("%s: %s\n", "sres_sockaddr2string", 
+    SU_DEBUG_3(("%s: %s\n", "sres_sockaddr2string",
                 su_strerror(EAFNOSUPPORT)));
     return 0;
   }
@@ -1848,8 +1848,8 @@
 
 /** Make a domain name a top level domain name.
  *
- * The function sres_toplevel() returns a copies string @a domain and 
- * terminates it with a dot if it is not already terminated. 
+ * The function sres_toplevel() returns a copies string @a domain and
+ * terminates it with a dot if it is not already terminated.
  */
 static
 char const *
@@ -1926,7 +1926,7 @@
  * @retval 0 when otherwise successful
  * @retval -1 upon an error
  */
-static 
+static
 int sres_update_config(sres_resolver_t *res, int always, time_t now)
 {
   sres_config_t *c = NULL;
@@ -1938,9 +1938,9 @@
   if (!always && previous && now < res->res_checked)
     return 0;
   /* Try avoid checking for changes too often. */
-  res->res_checked = now + SRES_UPDATE_INTERVAL_SECS; 
-  
-  if (!always && previous && 
+  res->res_checked = now + SRES_UPDATE_INTERVAL_SECS;
+
+  if (!always && previous &&
       sres_config_timestamp(previous) == previous->c_modified)
     return 0;
 
@@ -1999,7 +1999,7 @@
  * name server IP addresses.
  *
  * @return number of server addresses added
- */ 
+ */
 static int sres_parse_win32_reg_parse_dnsserver(sres_config_t *c, HKEY key, LPCTSTR lpValueName)
 {
   su_home_t *home = c->c_home;
@@ -2009,10 +2009,10 @@
   int ret, servers_added = 0;
 
   /* get name servers and ... */
-  while((ret = RegQueryValueEx(key, 
-			       lpValueName, 
-			       NULL, NULL, 
-			       name_servers, 
+  while((ret = RegQueryValueEx(key,
+			       lpValueName,
+			       NULL, NULL,
+			       name_servers,
 			       &name_servers_length)) == ERROR_MORE_DATA) {
     name_servers_length += QUERY_DATALEN;
 
@@ -2033,14 +2033,14 @@
 
       /* add to list */
       reg_dns_list = su_strlst_split(home, (char *)name_servers, " ");
-	    
+
       for(i = 0 ; i < su_strlst_len(reg_dns_list); i++) {
 	const char *item = su_strlst_item(reg_dns_list, i);
 	SU_DEBUG_3(("Adding nameserver: %s (key=%s)\n", item, (char*)lpValueName));
 	sres_parse_nameserver(c, item);
 	++servers_added;
       }
-	    
+
       su_strlst_destroy(reg_dns_list);
 
     }
@@ -2069,9 +2069,9 @@
 #define MAX_VALUE_NAME_LEN    16383
 
   su_home_t *home = c->c_home;
-  HKEY key_handle;  
+  HKEY key_handle;
 #if 0
-  HKEY interface_key_handle;  
+  HKEY interface_key_handle;
   FILETIME ftime;
   int index, i;
 #endif
@@ -2085,13 +2085,13 @@
   int guid_size = MAX_VALUE_NAME_LEN;
 #endif
 
-  /* step: find interface specific nameservers 
+  /* step: find interface specific nameservers
    * - this is currently disabled 2006/Jun (the current check might insert
-   *   multiple unnecessary nameservers to the search list) 
+   *   multiple unnecessary nameservers to the search list)
    */
   /* open the 'Interfaces' registry Key */
-  if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, 
-		   "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces", 
+  if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+		   "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces",
 		   0, KEY_READ, &key_handle)) {
     SU_DEBUG_2(("RegOpenKeyEx failed\n"));
   } else {
@@ -2101,12 +2101,12 @@
 			interface_guid, &guid_size,
 			NULL,NULL,0,&ftime) == ERROR_SUCCESS){
       if (RegOpenKeyEx(key_handle, interface_guid,
-		       0, KEY_READ, 
+		       0, KEY_READ,
 		       &interface_key_handle) == ERROR_SUCCESS) {
 
 	/* note: 'NameServer' is preferred over 'DhcpNameServer' */
 	found += sres_parse_win32_reg_parse_dnsserver(c, interface_key_handle, "NameServer");
-	if (found == 0) 
+	if (found == 0)
 	  found += sres_parse_win32_reg_parse_dnsserver(c, interface_key_handle, "DhcpNameServer");
 
 	RegCloseKey(interface_key_handle);
@@ -2120,16 +2120,16 @@
   }
 #endif /* #if 0: interface-specific nameservers */
 
-  /* step: if no interface-specific nameservers are found, 
+  /* step: if no interface-specific nameservers are found,
    *       check for system-wide nameservers */
   if (found == 0) {
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, 
-		     "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", 
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+		     "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
 		     0, KEY_READ, &key_handle)) {
       SU_DEBUG_2(("RegOpenKeyEx failed (2)\n"));
     } else {
       found += sres_parse_win32_reg_parse_dnsserver(c, key_handle, "NameServer");
-      if (found == 0) 
+      if (found == 0)
 	found += sres_parse_win32_reg_parse_dnsserver(c, key_handle, "DhcpNameServer");
       RegCloseKey(key_handle);
     }
@@ -2149,13 +2149,13 @@
 
 /** Parse /etc/resolv.conf file.
  *
- * @retval #sres_config_t structure when successful 
+ * @retval #sres_config_t structure when successful
  * @retval NULL upon an error
  *
- * @todo The resolv.conf directives @b sortlist and most of the options 
+ * @todo The resolv.conf directives @b sortlist and most of the options
  *       are currently ignored.
  */
-static 
+static
 sres_config_t *sres_parse_resolv_conf(sres_resolver_t *res,
 				      char const **options)
 {
@@ -2164,7 +2164,7 @@
   if (c) {
     FILE *f;
     int i;
-    
+
     f = fopen(c->c_filename = res->res_cnffile, "r");
 
     sres_parse_config(c, f);
@@ -2172,7 +2172,7 @@
     if (f)
       fclose(f);
 
-#if HAVE_WIN32    
+#if HAVE_WIN32
     /* note: no 127.0.0.1 on win32 systems */
     /* on win32, query the registry for nameservers */
     if (sres_parse_win32_ip(c) == 0 || sres_parse_win32_reg(c) == 0)
@@ -2184,14 +2184,14 @@
     if (c->c_nameservers[0] == NULL)
       sres_parse_nameserver(c, "127.0.0.1");
 #endif
-      
+
     for (i = 0; c->c_nameservers[i] && i < SRES_MAX_NAMESERVERS; i++) {
       struct sockaddr_in *sin = (void *)c->c_nameservers[i]->ns_addr;
       sin->sin_port = htons(c->c_port);
     }
 
     sres_parse_options(c, getenv("RES_OPTIONS"));
-    
+
     if (options)
       for (i = 0; options[i]; i++)
 	sres_parse_options(c, options[i]);
@@ -2206,7 +2206,7 @@
 
 uint16_t _sres_default_port = 53;
 
-/** Parse config file. 
+/** Parse config file.
  *
  * @return Number of search domains, if successful.
  * @retval -1 upon an error (never happens).
@@ -2230,7 +2230,7 @@
   c->c_opt.attempts = SRES_MAX_RETRY_COUNT;
   c->c_port = _sres_default_port;
 
-  if (f != NULL) {  
+  if (f != NULL) {
     for (line = 1; fgets(buf, sizeof(buf), f); line++) {
       size_t len;
       char *value, *b;
@@ -2320,7 +2320,7 @@
  * - @b attempts:<i>n</i> fail after <i>n</i> retries
  * - @b rotate          use round robin selection of nameservers
  * - @b no-check-names  do not check names for invalid characters
- * - @b inet6           (no effect) 
+ * - @b inet6           (no effect)
  * - @b ip6-dotint      IPv6 addresses are resolved using suffix ".ip6.int"
  *                      instead of the standard ".ip6.arpa" suffix
  * - @b ip6-bytestring  (no effect)
@@ -2358,7 +2358,7 @@
 #endif
 
 /* Parse options line or #SRES_OPTIONS or #RES_OPTIONS environment variable. */
-static int 
+static int
 sres_parse_options(sres_config_t *c, char const *value)
 {
   if (!value)
@@ -2440,8 +2440,8 @@
     struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
     memset(sa, 0, ns->ns_addrlen = sizeof *sin6);
     err = su_inet_pton(sa->sa_family = AF_INET6, server, &sin6->sin6_addr);
-  } 
-  else 
+  }
+  else
 #endif
     {
       struct sockaddr_in *sin = (struct sockaddr_in *)sa;
@@ -2486,8 +2486,8 @@
 /* ---------------------------------------------------------------------- */
 
 /** Check if the new configuration has different servers than the old */
-static 
-int sres_config_changed_servers(sres_config_t const *new_c, 
+static
+int sres_config_changed_servers(sres_config_t const *new_c,
 				sres_config_t const *old_c)
 {
   int i;
@@ -2534,7 +2534,7 @@
     dns->dns_socket = INVALID_SOCKET;
     ns = c->c_nameservers[i];
     memcpy(dns->dns_addr, ns->ns_addr, dns->dns_addrlen = ns->ns_addrlen);
-    su_inet_ntop(dns->dns_addr->ss_family, SS_ADDR(dns->dns_addr), 
+    su_inet_ntop(dns->dns_addr->ss_family, SS_ADDR(dns->dns_addr),
 	      dns->dns_name, sizeof dns->dns_name);
     dns->dns_edns = c->c_opt.edns;
     servers[i] = dns++;
@@ -2575,7 +2575,7 @@
   for (i = 0; i < SRES_MAX_NAMESERVERS; i++) {
     if (!servers[i])
       break;
-  }  
+  }
 
   return i;
 }
@@ -2637,7 +2637,7 @@
     sres_close(s);
     return INVALID_SOCKET;
   }
-  
+
   if (res->res_updcb) {
     if (res->res_updcb(res->res_async, s, INVALID_SOCKET) < 0) {
       SU_DEBUG_1(("%s: %s: %s\n", "sres_server_socket", "update callback",
@@ -2648,18 +2648,18 @@
   }
 
   dns->dns_socket = s;
-  
+
   return s;
 }
 
 /* ---------------------------------------------------------------------- */
 
 /** Send a query packet */
-static 
-int 
-sres_send_dns_query(sres_resolver_t *res, 
+static
+int
+sres_send_dns_query(sres_resolver_t *res,
 		    sres_query_t *q)
-{                        
+{
   sres_message_t m[1];
   uint8_t i, i0, N = res->res_n_servers;
   sres_socket_t s;
@@ -2680,7 +2680,7 @@
     return -1;
   if (servers == NULL)
     return -1;
-  if (N == 0) 
+  if (N == 0)
     return -1;
 
   memset(m, 0, offsetof(sres_message_t, m_data[sizeof m->m_packet.mp_header]));
@@ -2689,16 +2689,16 @@
   size = sizeof(m->m_packet.mp_header);
   m->m_size = (uint16_t)sizeof(m->m_data);
   m->m_offset = (uint16_t)size;
-  
+
   m->m_id = id;
   m->m_flags = htons(SRES_HDR_QUERY | SRES_HDR_RD);
-  
+
   /* Query record */
   m->m_qdcount = htons(1);
   m_put_domain(m, domain, 0, NULL);
   m_put_uint16(m, type);
   m_put_uint16(m, sres_class_in);
-  
+
   no_edns_size = m->m_offset;
 
   /* EDNS0 record (optional) */
@@ -2707,7 +2707,7 @@
   m_put_uint16(m, sizeof(m->m_packet)); /* Class: our UDP payload size */
   m_put_uint32(m, 0);		/* TTL: extended RCODE & flags */
   m_put_uint16(m, 0);
-  
+
   edns_size = m->m_offset;
 
   if (m->m_error) {
@@ -2727,9 +2727,9 @@
     /* If server supports EDNS, include EDNS0 record */
     q->q_edns = dns->dns_edns;
     /* 0 (no EDNS) or 1 (EDNS supported) additional data records */
-    m->m_arcount = htons(q->q_edns != 0); 
+    m->m_arcount = htons(q->q_edns != 0);
     /* Size with or without EDNS record */
-    size = q->q_edns ? edns_size : no_edns_size; 
+    size = q->q_edns ? edns_size : no_edns_size;
 
     s = sres_server_socket(res, dns);
 
@@ -2757,10 +2757,10 @@
 
   q->q_i_server = i;
 
-  SU_DEBUG_5(("%s(%p, %p) id=%u %s %s (to [%s]:%u)\n", 
+  SU_DEBUG_5(("%s(%p, %p) id=%u %s %s (to [%s]:%u)\n",
 	      "sres_send_dns_query",
-	      (void *)res, (void *)q, id, sres_record_type(type, b), domain, 
-	      dns->dns_name, 
+	      (void *)res, (void *)q, id, sres_record_type(type, b), domain,
+	      dns->dns_name,
 	      htons(((struct sockaddr_in *)dns->dns_addr)->sin_port)));
 
   return 0;
@@ -2779,7 +2779,7 @@
  * @param always return always a server
  */
 static
-sres_server_t *sres_next_server(sres_resolver_t *res, 
+sres_server_t *sres_next_server(sres_resolver_t *res,
 				uint8_t *in_out_i,
 				int always)
 {
@@ -2801,7 +2801,7 @@
 	dns->dns_error != SRES_TIME_MAX)
       dns->dns_error = 0;
   }
-  
+
   /* Retry using another server? */
   for (j = (i + 1) % N; (j != i); j = (j + 1) % N) {
     dns = servers[j]; if (!dns) continue;
@@ -2820,7 +2820,7 @@
   if (!always)
     return NULL;
 
-  dns = servers[i]; 
+  dns = servers[i];
   if (dns && dns->dns_error < now && dns->dns_error != SRES_TIME_MAX)
     return dns;
 
@@ -2829,7 +2829,7 @@
     if (dns->dns_error < now && dns->dns_error != SRES_TIME_MAX)
       return *in_out_i = j, dns;
   }
-  
+
   return NULL;
 }
 
@@ -2837,7 +2837,7 @@
  * Callback function for subqueries
  */
 static
-void sres_answer_subquery(sres_context_t *context, 
+void sres_answer_subquery(sres_context_t *context,
 			  sres_query_t *query,
 			  sres_record_t **answers)
 {
@@ -2908,7 +2908,7 @@
 
     SU_DEBUG_5(("sres(q=%p): reporting errors for %u %s\n",
 		(void *)q, q->q_type, q->q_name));
- 
+
     sres_remove_query(q->q_res, q, 1);
     (q->q_callback)(q->q_context, q, answers);
   }
@@ -2922,7 +2922,7 @@
  * recommend calling it in 500 ms intervals.
  *
  * @param res pointer to resolver object
- * @param dummy argument for compatibility 
+ * @param dummy argument for compatibility
  */
 void sres_resolver_timer(sres_resolver_t *res, int dummy)
 {
@@ -2943,16 +2943,16 @@
      */
     for (i = 0; i < res->res_queries->qt_size; i++) {
       q = res->res_queries->qt_table[i];
-      
+
       if (!q)
 	continue;
-      
+
       /* Exponential backoff */
       retry_time = q->q_timestamp + ((time_t)1 << q->q_retry_count);
-      
+
       if (now < retry_time)
 	continue;
-      
+
       sres_resend_dns_query(res, q, 1);
 
       if (q != res->res_queries->qt_table[i])
@@ -2960,14 +2960,14 @@
     }
 
     if (res->res_schedulecb && res->res_queries->qt_used)
-      res->res_schedulecb(res->res_async, SRES_RETRANSMIT_INTERVAL); 
+      res->res_schedulecb(res->res_async, SRES_RETRANSMIT_INTERVAL);
   }
 
   sres_cache_clean(res->res_cache, res->res_now);
 }
 
 /** Resend DNS query, report error if cannot resend any more.
- * 
+ *
  * @param res  resolver object
  * @param q    query object
  * @param timeout  true if resent because of timeout
@@ -2978,10 +2978,10 @@
 {
   uint8_t i, N;
   sres_server_t *dns;
-  
+
   SU_DEBUG_9(("sres_resend_dns_query(%p, %p, %s) called\n",
 	      (void *)res, (void *)q, timeout ? "timeout" : "error"));
-  
+
   N = res->res_n_servers;
 
   if (N > 0 && q->q_retry_count < SRES_MAX_RETRY_COUNT) {
@@ -2994,12 +2994,12 @@
       if (q->q_retry_count > res->res_n_servers + 1 &&
 	  dns->dns_edns == edns_not_tried)
 	q->q_edns = edns_not_supported;
-      
+
       sres_send_dns_query(res, q);
 
       if (timeout)
 	q->q_retry_count++;
-      
+
       return;
     }
   }
@@ -3015,7 +3015,7 @@
 
 
 /** Get a server by socket */
-static 
+static
 sres_server_t *
 sres_server_by_socket(sres_resolver_t const *res, sres_socket_t socket)
 {
@@ -3045,7 +3045,7 @@
 
   if (from->ss_family == AF_INET6) {
     struct in6_addr const *ip6 = &sin6->sin6_addr;
-  
+
     if (IN6_IS_ADDR_V4MAPPED(ip6) || IN6_IS_ADDR_V4COMPAT(ip6)) {
       /* Convert to a IPv4 address */
       struct sockaddr_in *sin = (struct sockaddr_in *)from;
@@ -3086,7 +3086,7 @@
 /** Create connected sockets for resolver.
  */
 int sres_resolver_sockets(sres_resolver_t *res,
-			  sres_socket_t *return_sockets, 
+			  sres_socket_t *return_sockets,
 			  int n)
 {
   sres_socket_t s = INVALID_SOCKET;
@@ -3108,7 +3108,7 @@
 
     if (s == INVALID_SOCKET) {	/* Mark as a bad destination */
       dns->dns_icmp = SRES_TIME_MAX;
-      dns->dns_error = SRES_TIME_MAX;	
+      dns->dns_error = SRES_TIME_MAX;
     }
 
     return_sockets[i++] = s;
@@ -3121,18 +3121,18 @@
 /** Get a server by socket address */
 static
 sres_server_t *
-sres_server_by_sockaddr(sres_resolver_t const *res, 
+sres_server_by_sockaddr(sres_resolver_t const *res,
 			void const *from, socklen_t fromlen)
 {
   int i;
 
   for (i = 0; i < res->res_n_servers; i++) {
     sres_server_t *dns = res->res_servers[i];
-    if (dns->dns_addrlen == fromlen && 
+    if (dns->dns_addrlen == fromlen &&
 	memcmp(dns->dns_addr, from, fromlen) == 0)
       return dns;
   }
-  
+
   return NULL;
 }
 #endif
@@ -3206,11 +3206,11 @@
 	strcpy(info, origin = "local");
 	break;
       case SO_EE_ORIGIN_ICMP:
-	snprintf(info, sizeof(info), "%s type=%u code=%u", 
+	snprintf(info, sizeof(info), "%s type=%u code=%u",
 		 origin = "icmp", ee->ee_type, ee->ee_code);
 	break;
       case SO_EE_ORIGIN_ICMP6:
-	snprintf(info, sizeof(info), "%s type=%u code=%u", 
+	snprintf(info, sizeof(info), "%s type=%u code=%u",
 		 origin = "icmp6", ee->ee_type, ee->ee_code);
 	break;
       case SO_EE_ORIGIN_NONE:
@@ -3222,7 +3222,7 @@
       }
 
       if (ee->ee_info)
-	snprintf(info + strlen(info), sizeof(info) - strlen(info), 
+	snprintf(info + strlen(info), sizeof(info) - strlen(info),
 		 " info=%08x", ee->ee_info);
       errcode = ee->ee_errno;
 
@@ -3231,9 +3231,9 @@
 
 	sres_canonize_sockaddr(from, &fromlen);
 
-	snprintf(info + strlen(info), sizeof(info) - strlen(info), 
+	snprintf(info + strlen(info), sizeof(info) - strlen(info),
 		 " reported by ");
-	su_inet_ntop(from->ss_family, SS_ADDR(from), 
+	su_inet_ntop(from->ss_family, SS_ADDR(from),
 		  info + strlen(info), sizeof(info) - strlen(info));
       }
 
@@ -3246,8 +3246,8 @@
 	/* Get error, if any */
 	getsockopt(socket, SOL_SOCKET, SO_ERROR, (void *)&error, &errorlen);
       }
-      
-      if (sres_resolver_report_error(res, socket, errcode, 
+
+      if (sres_resolver_report_error(res, socket, errcode,
 				     msg->msg_name, msg->msg_namelen,
 				     info))
 	return errcode;
@@ -3279,12 +3279,12 @@
 
 /** Report error */
 static
-int 
+int
 sres_resolver_report_error(sres_resolver_t *res,
 			   sres_socket_t socket,
 			   int errcode,
 			   struct sockaddr_storage *remote,
-			   socklen_t remotelen, 
+			   socklen_t remotelen,
 			   char const *info)
 {
   char buf[80];
@@ -3298,7 +3298,7 @@
       struct sockaddr_in const *sin = (struct sockaddr_in *)remote;
       uint8_t const *in_addr = (uint8_t*)&sin->sin_addr;
       su_inet_ntop(AF_INET, in_addr, buf, sizeof(buf));
-    } 
+    }
 #if HAVE_SIN6
     else if (remote->ss_family == AF_INET6) {
       struct sockaddr_in6 const *sin6 = (struct sockaddr_in6 *)remote;
@@ -3308,9 +3308,9 @@
 #endif
   }
 
-  SU_DEBUG_5(("sres: network error %u (%s)%s%s%s%s\n", 
+  SU_DEBUG_5(("sres: network error %u (%s)%s%s%s%s\n",
 	      errcode, su_strerror(errcode),
-	      buf[0] ? " from " : "", buf, 
+	      buf[0] ? " from " : "", buf,
 	      info ? " by " : "",
 	      info ? info : ""));
 
@@ -3328,7 +3328,7 @@
 
       for (i = 0; i < res->res_queries->qt_size; i++) {
 	q = res->res_queries->qt_table[i];
-      
+
 	if (!q || dns != res->res_servers[q->q_i_server])
 	  continue;
 
@@ -3340,13 +3340,13 @@
       }
     }
   }
-  
+
   return 1;
 }
 
 
 /** Receive a response packet from socket. */
-int 
+int
 sres_resolver_receive(sres_resolver_t *res, int socket)
 {
   ssize_t num_bytes;
@@ -3363,8 +3363,8 @@
   SU_DEBUG_9(("%s(%p, %u) called\n", "sres_resolver_receive",
 	      (void *)res, socket));
 
-  memset(m, 0, offsetof(sres_message_t, m_data)); 
-  
+  memset(m, 0, offsetof(sres_message_t, m_data));
+
   num_bytes = sres_recvfrom(socket, m->m_data, sizeof (m->m_data), 0,
 			    (void *)from, &fromlen);
 
@@ -3398,12 +3398,12 @@
     sres_qtable_append(res->res_queries, query);
     sres_send_dns_query(res, query);
     query->q_retry_count++;
-  } 
+  }
   else if (!error && reply) {
     /* Remove the query from the pending list and notify the listener */
     sres_remove_query(res, query, 1);
     if (query->q_callback != NULL)
-      (query->q_callback)(query->q_context, query, reply); 
+      (query->q_callback)(query->q_context, query, reply);
     sres_free_query(res, query);
   }
   else {
@@ -3414,7 +3414,7 @@
 }
 
 static
-void sres_log_response(sres_resolver_t const *res, 
+void sres_log_response(sres_resolver_t const *res,
 		       sres_message_t const *m,
 		       struct sockaddr_storage const *from,
 		       sres_query_t const *query,
@@ -3433,7 +3433,7 @@
       struct sockaddr_in const *sin = (void *)from;
       su_inet_ntop(AF_INET, &sin->sin_addr, host, sizeof host);
       port = sin->sin_port;
-    } 
+    }
 #if HAVE_SIN6
     else if (from->ss_family == AF_INET6) {
       struct sockaddr_in6 const *sin6 = (void *)from;
@@ -3442,8 +3442,8 @@
     }
 #endif
 
-    SU_DEBUG_5(("sres_resolver_receive(%p, %p) id=%u (from [%s]:%u)\n", 
-		(void *)res, (void *)query, m->m_id, 
+    SU_DEBUG_5(("sres_resolver_receive(%p, %p) id=%u (from [%s]:%u)\n",
+		(void *)res, (void *)query, m->m_id,
 		host, ntohs(port)));
   }
 }
@@ -3457,7 +3457,7 @@
  */
 static
 int
-sres_decode_msg(sres_resolver_t *res, 
+sres_decode_msg(sres_resolver_t *res,
 		sres_message_t *m,
 		sres_query_t **qq,
 		sres_record_t ***return_answers)
@@ -3486,9 +3486,9 @@
 
   m->m_flags   = ntohs(m->m_flags);
   m->m_qdcount = ntohs(m->m_qdcount);
-  m->m_ancount = ntohs(m->m_ancount); 
-  m->m_nscount = ntohs(m->m_nscount); 
-  m->m_arcount = ntohs(m->m_arcount); 
+  m->m_ancount = ntohs(m->m_ancount);
+  m->m_nscount = ntohs(m->m_nscount);
+  m->m_arcount = ntohs(m->m_arcount);
 
   hash = Q_PRIME * m->m_id;
 
@@ -3530,8 +3530,8 @@
   if (m->m_ancount == 0 && err == 0)
     err = SRES_RECORD_ERR;
 
-  if (err == SRES_RECORD_ERR || 
-      err == SRES_NAME_ERR || 
+  if (err == SRES_RECORD_ERR ||
+      err == SRES_NAME_ERR ||
       err == SRES_UNIMPL_ERR)
     errorcount = 1;
 
@@ -3547,7 +3547,7 @@
       rr = error = sres_create_error_rr(res->res_cache, query, err);
     else
       rr = sres_create_record(res, m);
- 
+
     if (!rr) {
       SU_DEBUG_5(("sres_create_record: %s\n", m->m_error));
       break;
@@ -3577,7 +3577,7 @@
       rr->sr_refcount++;
     else
       /* Do not pass extra records to user */
-      answers[i] = NULL;	
+      answers[i] = NULL;
 
     sres_cache_store(res->res_cache, rr, res->res_now);
   }
@@ -3585,7 +3585,7 @@
   *return_answers = answers;
 
   return err;
-}  
+}
 
 static
 sres_record_t *
@@ -3600,13 +3600,13 @@
   char btype[8], bclass[8];
 
   sr = memset(sr0, 0, sizeof sr0);
-  
+
   len = m_get_domain(sr->sr_name = name, sizeof(name) - 1, m, 0); /* Name */
   sr->sr_type = m_get_uint16(m);  /* Type */
   sr->sr_class = m_get_uint16(m); /* Class */
   sr->sr_ttl = m_get_uint32(m);   /* TTL */
   sr->sr_rdlen = m_get_uint16(m); /* rdlength */
-  sr->sr_parsed = 1;		
+  sr->sr_parsed = 1;
   if (m->m_error)
     goto error;
 
@@ -3672,7 +3672,7 @@
 
   return sr;
 
- error:  
+ error:
   if (sr && sr != sr0)
     sres_cache_free_record(cache, sr);
   SU_DEBUG_5(("%s: %s\n", "sres_create_record", m->m_error));
@@ -3697,7 +3697,7 @@
   soa->soa_retry = m_get_uint32(m);
   soa->soa_expire = m_get_uint32(m);
   soa->soa_minimum = m_get_uint32(m);
-  
+
   if (m->m_error)
     return NULL;
 
@@ -3849,7 +3849,7 @@
   offset = m->m_offset, dlen = m_get_domain(NULL, 0, m, 0) + 1;
   if (m->m_error)
     return NULL;
-  
+
   srv = (void *)sres_cache_alloc_record(cache, (void *)srv, dlen);
   if (srv)
     m_get_domain(srv->srv_target = (char *)(srv + 1), dlen, m, offset);
@@ -3942,7 +3942,7 @@
 
 static
 void
-m_put_uint16(sres_message_t *m, 
+m_put_uint16(sres_message_t *m,
 	     uint16_t h)
 {
   uint8_t *p;
@@ -3962,8 +3962,8 @@
 }
 
 static
-void 
-m_put_uint32(sres_message_t *m, 
+void
+m_put_uint32(sres_message_t *m,
 	     uint32_t w)
 {
   uint8_t *p;
@@ -3988,7 +3988,7 @@
 static
 uint16_t
 m_put_domain(sres_message_t *m,
-	     char const *domain, 
+	     char const *domain,
 	     uint16_t top,
 	     char const *topdomain)
 {
@@ -4065,7 +4065,7 @@
 }
 
 static
-uint16_t 
+uint16_t
 m_get_uint16(sres_message_t *m)
 {
   uint8_t const *p = m->m_data + m->m_offset;
@@ -4084,7 +4084,7 @@
 }
 
 static
-uint8_t 
+uint8_t
 m_get_uint8(sres_message_t *m)
 {
   uint8_t const *p = m->m_data + m->m_offset;
@@ -4105,7 +4105,7 @@
 /**
  * Get a string.
  */
-static int m_get_string(char *d, 
+static int m_get_string(char *d,
 			int n,
 			sres_message_t *m,
 			uint16_t offset)
@@ -4123,7 +4123,7 @@
     save_offset = 0;
 
   size = p[offset++];
-  
+
   if (size + offset >= m->m_size) {
     m->m_error = "truncated message";
     return size;
@@ -4150,7 +4150,7 @@
  *
  * @param offset start uncompression from this point in message
  */
-static int m_get_domain(char *d, 
+static int m_get_domain(char *d,
 			int n,
 			sres_message_t *m,
 			uint16_t offset)
@@ -4164,7 +4164,7 @@
   if (m->m_error)
     return 0;
 
-  if (d == NULL) 
+  if (d == NULL)
     n = 0;
 
   if (offset == 0)
@@ -4191,7 +4191,7 @@
 
       offset = new_offset;
       save_offset = 0;
-    } 
+    }
     else {
       if (offset + cnt >= m->m_size) {
         m->m_error = "truncated message";
@@ -4204,13 +4204,13 @@
 
       i += cnt + 1;
       offset += cnt;
-    }  
+    }
   }
 
-  if (i == 0) { 
-    if (i < n) 
+  if (i == 0) {
+    if (i < n)
       d[i] = '.';
-    i++; 
+    i++;
   }
 
   if (i < n)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_blocking.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_blocking.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_blocking.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@CFILE sres_blocking.c
  * @brief Blocking interface for Sofia DNS Resolver implementation.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @date Created: Fri Mar 24 15:23:08 EET 2006 ppessi
  */
@@ -94,7 +94,7 @@
   short revents;    /* returned events */
 } fds[SRES_MAX_NAMESERVERS];
 #endif
-  sres_record_t ***return_records;  
+  sres_record_t ***return_records;
 };
 
 struct sres_blocking_context_s
@@ -103,7 +103,7 @@
   sres_resolver_t *resolver;
   sres_blocking_t *block;
   sres_query_t *query;
-  sres_record_t ***return_records;  
+  sres_record_t ***return_records;
 };
 
 static
@@ -143,7 +143,7 @@
 
     b->n_sockets = N;
   }
-  
+
   if (new_socket != INVALID_SOCKET) {
     if (N == SRES_MAX_NAMESERVERS)
       return -1;
@@ -194,7 +194,7 @@
     }
 
     n = select(n, readfds, NULL, errorfds, timeval);
-  
+
     if (n <= 0)
       sres_resolver_timer(c->resolver, -1);
     else for (i = 0; n > 0 && i < c->block->n_sockets; i++) {
@@ -213,7 +213,7 @@
 }
 
 static
-void sres_blocking_callback(sres_blocking_context_t *c, 
+void sres_blocking_callback(sres_blocking_context_t *c,
 			    sres_query_t *query,
 			    sres_record_t **answers)
 {
@@ -221,13 +221,13 @@
   *c->return_records = answers;
 }
 
-static 
+static
 sres_blocking_t *sres_set_blocking(sres_resolver_t *res)
 {
   sres_blocking_t *b;
   int i;
 
-  b = sres_resolver_get_async(res, sres_blocking_update); 
+  b = sres_resolver_get_async(res, sres_blocking_update);
   if (b)
     return b;
 
@@ -241,7 +241,7 @@
   if (b) {
     for (i = 0; i < SRES_MAX_NAMESERVERS; i++)
       b->fds[i].fd = INVALID_SOCKET;
-  
+
     if (!sres_resolver_set_async(res, sres_blocking_update, b, 0)) {
       free(b), b = NULL;
     }
@@ -261,7 +261,7 @@
 /**Send a DNS query, wait for response, return results.
  *
  * Sends a DNS query with specified @a type and @a domain to the DNS server,
- * if @a ignore_cache is not given or no records are found from cache. 
+ * if @a ignore_cache is not given or no records are found from cache.
  * Function returns an error record with nonzero status if no response is
  * received from DNS server.
  *
@@ -280,7 +280,7 @@
  * @ERROR ENAMETOOLONG @a domain is longer than SRES_MAXDNAME
  * @ERROR ENETDOWN no DNS servers configured
  * @ERROR ENOMEM memory exhausted
- * @ERROR EOPNOTSUPP  resolver @a res is in asynchronous mode 
+ * @ERROR EOPNOTSUPP  resolver @a res is in asynchronous mode
  *
  * @sa sres_query(), sres_blocking_search()
  *
@@ -305,7 +305,7 @@
 
   c->block = sres_set_blocking(res);
   if (c->block == NULL)
-    return su_seterrno(EOPNOTSUPP); /* Resolver in asynchronous mode */ 
+    return su_seterrno(EOPNOTSUPP); /* Resolver in asynchronous mode */
 
   if (!ignore_cache) {
     cached = sres_cached_answers(res, type, domain);
@@ -325,7 +325,7 @@
 
 /** Search DNS, return results.
  *
- * Search for @a name with specified @a type and @a name from the DNS server. 
+ * Search for @a name with specified @a type and @a name from the DNS server.
  * If the @a name does not contain enought dots, the search domains are
  * appended to the name and resulting domain name are also queried.
  *
@@ -344,7 +344,7 @@
  * @ERROR ENAMETOOLONG @a domain is longer than SRES_MAXDNAME
  * @ERROR ENETDOWN no DNS servers configured
  * @ERROR ENOMEM memory exhausted
- * @ERROR EOPNOTSUPP  resolver @a res is in asynchronous mode 
+ * @ERROR EOPNOTSUPP  resolver @a res is in asynchronous mode
  *
  * @sa sres_blocking_query(), sres_search()
  *
@@ -369,7 +369,7 @@
 
   c->block = sres_set_blocking(res);
   if (c->block == NULL)
-    return su_seterrno(EOPNOTSUPP); /* Resolver in asynchronous mode */ 
+    return su_seterrno(EOPNOTSUPP); /* Resolver in asynchronous mode */
 
   if (!ignore_cache) {
     cached = sres_search_cached_answers(res, type, name);
@@ -402,7 +402,7 @@
  * @ERROR EFAULT @a res or @a addr point outside the address space
  * @ERROR ENOMEM memory exhausted
  * @ERROR ENETDOWN no DNS servers configured
- * @ERROR EOPNOTSUPP  resolver @a res is in asynchronous mode 
+ * @ERROR EOPNOTSUPP  resolver @a res is in asynchronous mode
  *
  * @sa sres_blocking_query(), sres_query_sockaddr(), sres_cached_answers_sockaddr()
  *
@@ -427,7 +427,7 @@
 
   c->block = sres_set_blocking(res);
   if (c->block == NULL)
-    return su_seterrno(EOPNOTSUPP); /* Resolver in asynchronous mode */ 
+    return su_seterrno(EOPNOTSUPP); /* Resolver in asynchronous mode */
 
   if (!ignore_cache) {
     cached = sres_cached_answers_sockaddr(res, type, addr);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_cache.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_cache.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_cache.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@CFILE sres_cache.c
  * @brief Cache for Sofia DNS Resolver.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Teemu Jalava <Teemu.Jalava at nokia.com>
  * @author Mikko Haataja
@@ -38,7 +38,7 @@
 #include <stdint.h>
 #elif HAVE_INTTYPES_H
 #include <inttypes.h>
-#else 
+#else
 #if defined(_WIN32)
 typedef unsigned _int8 uint8_t;
 typedef unsigned _int16 uint16_t;
@@ -200,8 +200,8 @@
   rr_iter2 = sres_htable_hash(cache->cache_hash, hash);
 
   /* Find the domain records from the hash table */
-  for (rr_iter = rr_iter2; 
-       rr_iter && *rr_iter; 
+  for (rr_iter = rr_iter2;
+       rr_iter && *rr_iter;
        rr_iter = sres_htable_next(cache->cache_hash, rr_iter)) {
     rr = (*rr_iter)->rr;
 
@@ -209,7 +209,7 @@
 	now <= (*rr_iter)->rr_expires &&
         (type == sres_qtype_any || rr->sr_type == type) &&
         rr->sr_name != NULL &&
-        strcasecmp(rr->sr_name, domain) == 0) 
+        strcasecmp(rr->sr_name, domain) == 0)
       rr_count++;
   }
 
@@ -227,8 +227,8 @@
 
   /* Second pass: add the rr pointers to the allocated array */
 
-  for (rr_iter = rr_iter2, rr_count = 0; 
-       rr_iter && *rr_iter; 
+  for (rr_iter = rr_iter2, rr_count = 0;
+       rr_iter && *rr_iter;
        rr_iter = sres_htable_next(cache->cache_hash, rr_iter)) {
     rr = (*rr_iter)->rr;
 
@@ -237,7 +237,7 @@
         (type == sres_qtype_any || rr->sr_type == type) &&
         rr->sr_name != NULL &&
         strcasecmp(rr->sr_name, domain) == 0) {
-      SU_DEBUG_9(("rr found in cache: %s %02d\n", 
+      SU_DEBUG_9(("rr found in cache: %s %02d\n",
 		  rr->sr_name, rr->sr_type));
 
       result[rr_count++] = rr;
@@ -249,7 +249,7 @@
 
   UNLOCK(cache);
 
-  SU_DEBUG_9(("%s(%p, %s, \"%s\") returned %d entries\n", "sres_cache_get", 
+  SU_DEBUG_9(("%s(%p, %s, \"%s\") returned %d entries\n", "sres_cache_get",
 	      (void *)cache, sres_record_type(type, b), domain, rr_count));
 
   *return_cached = result;
@@ -282,7 +282,7 @@
     memcpy(&sr->sr_status, &template->sr_status,
 	   size - offsetof(sres_common_t, r_status));
   }
-    
+
   return sr;
 }
 
@@ -298,7 +298,7 @@
 }
 
 /** Store record to cache */
-void 
+void
 sres_cache_store(sres_cache_t *cache, sres_record_t *rr, time_t now)
 {
   sres_rr_hash_entry_t **rr_iter, *rr_hash_entry;
@@ -322,7 +322,7 @@
     }
 
   for (rr_iter = sres_htable_hash(cache->cache_hash, hash);
-       (rr_hash_entry = *rr_iter); 
+       (rr_hash_entry = *rr_iter);
        rr_iter = sres_htable_next(cache->cache_hash, rr_iter)) {
     sres_record_t *or = rr_hash_entry->rr;
 
@@ -334,13 +334,13 @@
       continue;
     if (!!or->sr_name != !!rr->sr_name)
       continue;
-    if (or->sr_name != rr->sr_name && 
+    if (or->sr_name != rr->sr_name &&
 	strcasecmp(or->sr_name, rr->sr_name) != 0)
       continue;
     if (rr->sr_type != sres_type_soa /* There can be only one */
 	&& sres_record_compare(or, rr))
       continue;
-    
+
     /* There was an old entry in the cache.. Zap it, replace this with it */
     sres_heap_remove(cache->cache_heap, rr_hash_entry->rr_heap_index);
     rr_hash_entry->rr_expires = now + rr->sr_ttl;
@@ -354,7 +354,7 @@
 
     return;
   }
-  
+
   rr_hash_entry = su_zalloc(cache->cache_home, sizeof(*rr_hash_entry));
 
   if (rr_hash_entry) {
@@ -402,7 +402,7 @@
   for (i = 0; answers[i] != NULL; i++) {
     if (answers[i]->sr_refcount <= 1)
       su_free(cache->cache_home, answers[i]);
-    else 
+    else
       answers[i]->sr_refcount--;
     answers[i] = NULL;
   }
@@ -416,7 +416,7 @@
   if (answer) {
     if (answer->sr_refcount <= 1)
       su_free(cache->cache_home, answer);
-    else 
+    else
       answer->sr_refcount--;
   }
 }
@@ -427,7 +427,7 @@
 sres_hash_key(const char *string)
 {
   unsigned int result = 0;
-  
+
   while (string && *string)
     result = result * 797 + (unsigned char) * (string++);
 
@@ -460,7 +460,7 @@
 	UNLOCK(cache);
 	return;
       }
-      
+
       sres_heap_remove(cache->cache_heap, 1);
       sres_htable_remove(cache->cache_hash, e);
       _sres_cache_free_one(cache, e->rr);
@@ -478,16 +478,16 @@
  * greylisting of SIP servers.
  *
  * @param cache    pointer to DNS cache object
- * @param domain   domain name of the SRV record(s) to modify 
+ * @param domain   domain name of the SRV record(s) to modify
  *                 (including final dot)
  * @param target   SRV target of the SRV record(s) to modify
- * @param port     port number of SRV record(s) to modify 
- *                 (in host byte order) 
+ * @param port     port number of SRV record(s) to modify
+ *                 (in host byte order)
  * @param ttl      new ttl
  * @param priority new priority value (0=highest, 65535=lowest)
  *
  * @sa sres_set_cached_srv_priority()
- * 
+ *
  * @NEW_1_12_8
  */
 int sres_cache_set_srv_priority(sres_cache_t *cache,
@@ -501,7 +501,7 @@
   unsigned hash;
   sres_rr_hash_entry_t **iter;
   time_t expires;
-  
+
   if (cache == NULL || domain == NULL || target == NULL)
     return -1;
 
@@ -517,13 +517,13 @@
        iter && *iter;
        iter = sres_htable_next(cache->cache_hash, iter)) {
     sres_record_t *rr = (*iter)->rr;
-    
+
     if (rr && rr->sr_name &&
 	sres_type_srv == rr->sr_type &&
 	strcasecmp(rr->sr_name, domain) == 0) {
 
       (*iter)->rr_expires = expires;
-      
+
       if ((port == 0 || rr->sr_srv->srv_port == port) &&
 	  rr->sr_srv->srv_target &&
 	  strcasecmp(rr->sr_srv->srv_target, target) == 0) {
@@ -552,12 +552,12 @@
 
 static inline
 void sres_heap_set_entry(sres_rr_hash_entry_t **heap,
-			 size_t index, 
+			 size_t index,
 			 sres_rr_hash_entry_t *entry)
 {
   entry->rr_heap_index = index;
   heap[index] = entry;
-}  
+}
 
 HEAP_BODIES(static inline,
 	    sres_heap_t,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sresolv.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sresolv.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sresolv.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@CFILE sresolv.c
  * @brief Sofia DNS Resolver interface using su_root_t.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Teemu Jalava <Teemu.Jalava at nokia.com>
  * @author Mikko Haataja
@@ -78,17 +78,17 @@
   sres_sofia_register_t srs_reg[SRES_MAX_NAMESERVERS];
 };
 
-static int sres_sofia_update(sres_sofia_t *, 
+static int sres_sofia_update(sres_sofia_t *,
 			     su_socket_t new_socket,
 			     su_socket_t old_socket);
 
-static void sres_sofia_timer(su_root_magic_t *magic, 
+static void sres_sofia_timer(su_root_magic_t *magic,
 			     su_timer_t *t,
 			     sres_sofia_t *arg);
 
 static int sres_sofia_set_timer(sres_sofia_t *srs, unsigned long interval);
 
-static int sres_sofia_poll(su_root_magic_t *, su_wait_t *, 
+static int sres_sofia_poll(su_root_magic_t *, su_wait_t *,
 			   sres_sofia_register_t *);
 
 /**Create a resolver.
@@ -97,7 +97,7 @@
  * the resolver object using the Sofia asynchronous reactor #su_root_t.
  */
 sres_resolver_t *
-sres_resolver_create(su_root_t *root, 
+sres_resolver_create(su_root_t *root,
 		     char const *conf_file_path,
 		     tag_type_t tag, tag_value_t value, ...)
 {
@@ -127,7 +127,7 @@
     srs->srs_socket = INVALID_SOCKET;
 
     sres_resolver_set_async(res, sres_sofia_update, srs, 0);
-    
+
     t = su_timer_create(su_root_task(root), SRES_RETRANSMIT_INTERVAL);
     srs->srs_timer = t;
 
@@ -150,7 +150,7 @@
 }
 
 /** Destroy a resolver object. */
-int 
+int
 sres_resolver_destroy(sres_resolver_t *res)
 {
   sres_sofia_t *srs;
@@ -163,9 +163,9 @@
     return su_seterrno(EINVAL);
 
   /* Remove sockets from too, zap timers. */
-  sres_sofia_update(srs, INVALID_SOCKET, INVALID_SOCKET); 
+  sres_sofia_update(srs, INVALID_SOCKET, INVALID_SOCKET);
 
-  sres_resolver_unref(res); 
+  sres_resolver_unref(res);
 
   return 0;
 }
@@ -229,7 +229,7 @@
 
       reg = srs->srs_reg + i;
     }
-    else 
+    else
       reg = old_reg;
   }
 
@@ -271,7 +271,7 @@
 
   SU_DEBUG_3(("sres: %s: %s\n", what, su_strerror(error)));
 
-  return su_seterrno(error);			
+  return su_seterrno(error);
 }
 
 
@@ -317,20 +317,20 @@
       return INVALID_SOCKET;
   }
 
-  return srs->srs_socket; 
+  return srs->srs_socket;
 }
 
 
 /** Sofia timer wrapper. */
-static 
-void 
+static
+void
 sres_sofia_timer(su_root_magic_t *magic, su_timer_t *t, sres_sofia_t *srs)
 {
   sres_resolver_timer(srs->srs_resolver, -1);
 }
 
 /** Sofia timer set wrapper. */
-static 
+static
 int
 sres_sofia_set_timer(sres_sofia_t *srs, unsigned long interval)
 {
@@ -342,10 +342,10 @@
 
 
 /** Sofia poll/select wrapper, called by su_root_t object */
-static 
-int 
-sres_sofia_poll(su_root_magic_t *magic, 
-		su_wait_t *w, 
+static
+int
+sres_sofia_poll(su_root_magic_t *magic,
+		su_wait_t *w,
 		sres_sofia_register_t *reg)
 {
   sres_sofia_t *srs = reg->reg_ptr;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sresolv.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sresolv.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/sresolv.docs	Tue Dec 23 07:37:03 2008
@@ -32,7 +32,7 @@
 Sofia resolver uses the usual configuration for DNS. In Unix-based systems,
 the DNS configuration is stored in the file /etc/resolv.conf, on Windows, it
 is available through the registry. Sofia resolvers reloads the configuration
-when it detect that it has been changed. 
+when it detect that it has been changed.
 
 In addition to the configuration files, the environment variables
 #SRES_OPTIONS and #RES_OPTIONS can be used to change the behaviour of the
@@ -68,7 +68,7 @@
 @code
 #include <sofia-sip/sresolv.h>
 
-sres_resolver_t *sres_resolver_create(su_root_t *root, 
+sres_resolver_t *sres_resolver_create(su_root_t *root,
 				      char const *resolv_conf,
 				      tag_type_t, tag_value_t, ...);
 
@@ -80,7 +80,7 @@
 
 The second part of interface is used when sending DNS queries:
 
- at code 
+ at code
 sres_query_t *sres_query(sres_resolver_t *res,
 			 sres_answer_f *callback,
 			 sres_context_t *context,
@@ -116,7 +116,7 @@
 
 int sres_sort_answers(sres_resolver_t *res, sres_record_t **answers);
 
-int sres_filter_answers(sres_resolver_t *sres, sres_record_t **answers, 
+int sres_filter_answers(sres_resolver_t *sres, sres_record_t **answers,
 			uint16_t type);
 
 void sres_free_answers(sres_resolver_t *res, sres_record_t **answers);
@@ -127,7 +127,7 @@
 
 @section sofia_resolv_sres_h Interface in <sofia-resolv/sres.h>
 
-The generic interface to Sofia resolver is defined in <sofia-resolv/sres.h>. 
+The generic interface to Sofia resolver is defined in <sofia-resolv/sres.h>.
 The first part of interface consists of functions for handling resolver
 objects:
 
@@ -182,7 +182,7 @@
 
 @subsection sresolv_async Asynchronous Interface in <sofia-resolv/sres_async.h>
 
-It is also possible to use resolver asynchronously without #su_root_t object. 
+It is also possible to use resolver asynchronously without #su_root_t object.
 
 @code
 #include <sys/types.h>
@@ -191,7 +191,7 @@
 
 #include <sofia-resolv/sres_async.h>
 
-sres_async_t *sres_resolver_set_async(sres_resolver_t *res, 
+sres_async_t *sres_resolver_set_async(sres_resolver_t *res,
 				      sres_update_f *update,
 				      sres_async_t *async,
 				      int update_all);
@@ -239,7 +239,7 @@
     process_natpr(context, NULL, results);
   }
   else {
-    context->query = sres_query(context->sres, 
+    context->query = sres_query(context->sres,
                                 process_natpr, context,
 	                        sres_type_naptr, domain);
     if (!context->query)
@@ -253,9 +253,9 @@
 		   sres_record_t *answers[])
 {
   sres_sort_answers(context->sres, answers);
- 
+
   ...
- 
+
   sres_free_answers(context->sres, answers);
 }
 @endcode

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/test_sresolv.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/test_sresolv.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/test_sresolv.c	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 /**@internal
  *
  * @CFILE test_sresolv.c Test module for sresolv
- * 
+ *
  * @author Mikko Haataja
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
  *
@@ -103,7 +103,7 @@
   sres_socket_t    sink;
   int              sinkidx;
   char const      *sinkconf;
-  
+
   int              ready;
   int              n_sockets;
   sres_socket_t    sockets[SRES_MAX_NAMESERVERS];
@@ -122,7 +122,7 @@
 #if HAVE_WINSOCK2_H
 
 /* Posix send() */
-su_inline 
+su_inline
 ssize_t sres_send(sres_socket_t s, void *b, size_t length, int flags)
 {
   if (length > INT_MAX)
@@ -130,7 +130,7 @@
   return (ssize_t)send(s, b, (int)length, flags);
 }
 
-su_inline 
+su_inline
 ssize_t sres_sendto(sres_socket_t s, void *b, size_t length, int flags,
 		    struct sockaddr const *sa, socklen_t salen)
 {
@@ -140,7 +140,7 @@
 }
 
 /* Posix recvfrom() */
-su_inline 
+su_inline
 ssize_t sres_recvfrom(sres_socket_t s, void *buffer, size_t length, int flags,
 		      struct sockaddr *from, socklen_t *fromlen)
 {
@@ -152,7 +152,7 @@
   if (length > INT_MAX)
     length = INT_MAX;
 
-  retval = recvfrom(s, buffer, (int)length, flags, 
+  retval = recvfrom(s, buffer, (int)length, flags,
 		    (void *)from, fromlen ? &ilen : NULL);
 
   if (fromlen)
@@ -218,7 +218,7 @@
   if (mode < 0)
      return -1;
 
-  if (blocking) 
+  if (blocking)
     mode &= ~(O_NDELAY | O_NONBLOCK);
   else
     mode |= O_NDELAY | O_NONBLOCK;
@@ -255,7 +255,7 @@
     TEST_1(setblocking(s2, 0) == 0);
     TEST_1(setblocking(s3, 0) == 0);
     TEST_1(setblocking(s4, 0) == 0);
-    
+
     memset(a, 0, sizeof a);
     memset(a1, 0, sizeof a1);
     memset(a2, 0, sizeof a2);
@@ -280,10 +280,10 @@
 
     TEST(bind(s3, (struct sockaddr *)a3, a3len), 0);
     TEST(bind(s4, (struct sockaddr *)a4, a4len), 0);
-    
+
     alen = sizeof a;
     TEST(getsockname(s3, (struct sockaddr *)a, &alen), 0);
-    sin3->sin_port = sin->sin_port; 
+    sin3->sin_port = sin->sin_port;
     memset(sin->sin_zero, 0, sizeof sin->sin_zero);
     TEST(alen, a3len); TEST_M(a, a3, a3len);
 
@@ -329,7 +329,7 @@
   n = ctx->n_sockets;
 
   events = poll(ctx->fds, ctx->n_sockets, ctx->timeout ? 50 : 500);
-      
+
   if (!events)
     return events;
 
@@ -339,7 +339,7 @@
     if (ctx->fds[i].revents & POLLIN)
       sres_resolver_receive(ctx->resolver, ctx->fds[i].fd);
   }
-  
+
   return events;
 }
 
@@ -353,9 +353,9 @@
       ctx->timeout <<= 1;
       offset += ctx->timeout;
     }
-    
+
     /* No harm is done (except wasted CPU) if timer is called more often */
-    sres_resolver_timer(ctx->resolver, -1); 
+    sres_resolver_timer(ctx->resolver, -1);
   }
 }
 
@@ -376,7 +376,7 @@
   TEST_RUN(ctx);
 
   TEST_1(result = sres_cached_answers(res, sres_type_soa, domain));
-  
+
   TEST_1(result != NULL);
   TEST_1(result[0] != NULL);
 
@@ -415,7 +415,7 @@
 
   for (i = 0; result[i] != NULL; i++) {
     rr = (sres_naptr_record_t *) result[i]->sr_naptr;
-                                        
+
     switch(rr->na_order) {
     case 20:
       TEST(rr->na_record->r_type, sres_type_naptr);
@@ -475,7 +475,7 @@
   END();
 }
 
-char const longname[1026] = 
+char const longname[1026] =
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -484,7 +484,7 @@
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
-  
+
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -493,7 +493,7 @@
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
-  
+
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -502,7 +502,7 @@
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
-  
+
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa."
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -512,7 +512,7 @@
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.";
 
-char name2048[2049] = 
+char name2048[2049] =
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
   "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
@@ -556,7 +556,7 @@
   sres_record_t **result;
   const sres_a_record_t *rr_a;
   char const *domain = "sip00.example.com";
-  char name1025[1026] = 
+  char name1025[1026] =
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -565,7 +565,7 @@
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-		  
+
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -583,7 +583,7 @@
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-		  
+
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -592,7 +592,7 @@
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
 		  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-		  
+
 		  ".";
 
   BEGIN();
@@ -612,7 +612,7 @@
   query = sres_query(res, test_answer, ctx, sres_type_a, longname);
   TEST_1(query);
   sres_query_bind(query, NULL, NULL);
-  
+
   TEST_1(sres_query(res, test_answer, ctx, sres_type_a, domain));
 
   TEST_RUN(ctx);
@@ -660,7 +660,7 @@
   sres_free_answers(res, ctx->result), ctx->result = NULL;
 
   /* Try missing domain */
-  TEST_1(sres_query(res, test_answer, ctx, sres_type_a, 
+  TEST_1(sres_query(res, test_answer, ctx, sres_type_a,
 			 "no-sip.example.com"));
 
   TEST_RUN(ctx);
@@ -675,9 +675,9 @@
 
   sres_free_answers(res, ctx->result), ctx->result = NULL;
 
-  /* Try domain without A record => 
+  /* Try domain without A record =>
      we should get a record with SRES_RECORD_ERR */
-  TEST_1(sres_query(res, test_answer, ctx, sres_type_a, 
+  TEST_1(sres_query(res, test_answer, ctx, sres_type_a,
 			 "aaaa.example.com"));
 
   TEST_RUN(ctx);
@@ -736,7 +736,7 @@
 
   TEST_1(result = ctx->result);
   TEST_1(result[0]);
-  
+
   rr_a6 = result[0]->sr_a6;
   TEST(rr_a6->a6_record->r_type, sres_type_a6);
   TEST(rr_a6->a6_record->r_class, sres_class_in);
@@ -807,7 +807,7 @@
   TEST_S(su_inet_ntop(AF_INET6, &rr_a6->a6_suffix, buf, sizeof(buf)),
 	 "3ff0:12:3012:c006:a08:20ff:fe7d:e7ac");
   TEST_P(rr_a6->a6_prename, NULL);
- 
+
   sres_free_answers(res, ctx->result), ctx->result = NULL;
 
   /* Check parsing of special case: no suffix */
@@ -822,7 +822,7 @@
   TEST(rr_a6->a6_prelen, 128);
   TEST_S(su_inet_ntop(AF_INET6, &rr_a6->a6_suffix, buf, sizeof(buf)), "::");
   TEST_S(rr_a6->a6_prename, "a6.example.com.");
- 
+
   sres_free_answers(res, ctx->result), ctx->result = NULL;
 
   TEST_1(result = sres_cached_answers(res, sres_type_a6, domain));
@@ -868,7 +868,7 @@
   sres_free_answers(res, ctx->result), ctx->result = NULL;
 
   TEST_1(result = sres_cached_answers(res, sres_type_aaaa, domain));
-  
+
   TEST_1(rr_aaaa = result[0]->sr_aaaa);
   TEST(rr_aaaa->aaaa_record->r_type, sres_type_aaaa);
   TEST(rr_aaaa->aaaa_record->r_class, sres_class_in);
@@ -900,7 +900,7 @@
 
   for (i = 0; result[i] != NULL; i++) {
     TEST_1(rr = (sres_srv_record_t *) result[i]->sr_srv);
-    
+
     switch(rr->srv_priority) {
     case 3:
       TEST(rr->srv_record->r_type, sres_type_srv);
@@ -940,7 +940,7 @@
 
   for (i = 0; result[i] != NULL; i++) {
     TEST_1(rr = (sres_srv_record_t *) result[i]->sr_srv);
-    
+
     switch(rr->srv_priority) {
     case 3:
       TEST(rr->srv_record->r_type, sres_type_srv);
@@ -1035,7 +1035,7 @@
   sres_query_t *query;
   const sres_ptr_record_t *rr;
   struct sockaddr_in sin = {0};
-  
+
   su_inet_pton(AF_INET, "127.0.0.1", &sin.sin_addr);
   sin.sin_family = AF_INET;
 
@@ -1048,7 +1048,7 @@
   TEST_RUN(ctx);
 
   result = ctx->result;
-  
+
   TEST_1(result != NULL);
   TEST_1(result[0] != NULL);
 
@@ -1067,7 +1067,7 @@
   sres_resolver_t *res = ctx->resolver;
   sres_record_t **result;
   const sres_ptr_record_t *rr;
-  char const *domain = 
+  char const *domain =
     "c.a.7.e.d.7.e.f.f.f.0.2.8.0.a.0.0.0.0.c.2.1.0.3.0.0.2.1.e.f.f.3.ip6.int";
 
   BEGIN();
@@ -1076,7 +1076,7 @@
   TEST_RUN(ctx);
 
   result = ctx->result;
-  
+
   TEST_1(result != NULL);
   TEST_1(result[0] != NULL);
 
@@ -1098,12 +1098,12 @@
 
   BEGIN();
 
-  su_inet_pton(AF_INET6, "3ffe:1200:3012:c000:0a08:20ff:fe7d:e7ac", 
+  su_inet_pton(AF_INET6, "3ffe:1200:3012:c000:0a08:20ff:fe7d:e7ac",
 	       &sin6.sin6_addr);
 
   sin6.sin6_family = AF_INET6;
 
-  ctx->query = 
+  ctx->query =
     sres_query_sockaddr(res, test_answer, ctx,
 			     sres_type_ptr, (struct sockaddr*)&sin6);
   TEST_1(ctx->query != NULL);
@@ -1111,7 +1111,7 @@
   TEST_RUN(ctx);
 
   result = ctx->result;
-  
+
   TEST_1(result != NULL);
   TEST_1(result[0] != NULL);
 
@@ -1153,7 +1153,7 @@
   sres_query(res, test_answer_multi, ctx,
 		  sres_qtype_any, "_sips._tcp.example.com");
 
-  sres_query(res, test_answer_multi, ctx, 
+  sres_query(res, test_answer_multi, ctx,
 		  sres_qtype_any, "sip.example.com");
 
   sres_query(res, test_answer_multi, ctx,
@@ -1179,11 +1179,11 @@
 
   /* For a chance, a fully qualified domain name with final "." */
   domain = "example.com.";
-  
-  result = sres_cached_answers(res, 
+
+  result = sres_cached_answers(res,
 			       sres_qtype_any,
 			       domain);
-  
+
   TEST_1(result != NULL);
 
   for (i = 0; result[i] != NULL; i++) {
@@ -1227,7 +1227,7 @@
         TEST_S(rr_naptr->na_flags, "u");
         TEST_S(rr_naptr->na_services, "TEST+D2U");
 
-        TEST_S(rr_naptr->na_regexp, 
+        TEST_S(rr_naptr->na_regexp,
 	       "/(tst:([^@]+@))?example.com$/\\1operator.com/i");
 
         TEST_S(rr_naptr->na_replace, ".");
@@ -1251,7 +1251,7 @@
       }
     }
   }
-  
+
   TEST(ok, 7);
 
   /* Reverse order before sorting */
@@ -1269,8 +1269,8 @@
     sort_array[0] = result[i], sort_array[1] = result[i], sort_array[2] = NULL;
     sres_sort_answers(res, sort_array);
   }
-  
-  /* Test free */ 
+
+  /* Test free */
   for (i = 0; result[i]; i++) {
     sres_free_answer(res, result[i]);
     result[i] = NULL;
@@ -1279,10 +1279,10 @@
   /* Test sres_free_answers() */
   sres_free_answers(res, result);
 
-  result = sres_cached_answers(res, 
+  result = sres_cached_answers(res,
 			       sres_qtype_any,
 			       "_sips._tcp.example.com");
-  
+
   TEST_1(result != NULL);
 
   ok = 0;
@@ -1340,7 +1340,7 @@
   sres_free_answers(res, result);
 
   domain = "sip.example.com";
-  result = sres_cached_answers(res, 
+  result = sres_cached_answers(res,
 			       sres_qtype_any,
 			       domain);
 
@@ -1357,7 +1357,7 @@
 
 #if HAVE_SIN6
   domain = "subnet.example.com";
-  result = sres_cached_answers(res, 
+  result = sres_cached_answers(res,
 			       sres_qtype_any,
 			       domain);
 
@@ -1386,10 +1386,10 @@
 	 "3ffe:1200:3012:c000:206:5bff:fe55:462f");
   sres_free_answers(res, result);
 
-  result = sres_cached_answers_sockaddr(res, 
+  result = sres_cached_answers_sockaddr(res,
                                         sres_type_ptr,
                                         (struct sockaddr *)&sin6);
-  
+
   TEST_1(result != NULL);
 
   rr_ptr = result[0]->sr_ptr;
@@ -1397,7 +1397,7 @@
 
   TEST(rr_ptr->ptr_record->r_type, sres_type_ptr);
   TEST(rr_ptr->ptr_record->r_class, sres_class_in);
-  TEST_S(rr_ptr->ptr_domain, "sip01.example.com.");    
+  TEST_S(rr_ptr->ptr_domain, "sip01.example.com.");
 
   sres_free_answers(res, result);
 #endif /* HAVE_SIN6 */
@@ -1412,7 +1412,7 @@
   sres_record_t **result;
   const sres_aaaa_record_t *rr_aaaa;
   char buf[50] = {0};
-  
+
   BEGIN();
 
   TEST_1(sres_query(res, test_answer, ctx,
@@ -1447,7 +1447,7 @@
   struct sockaddr_in sin[1];
   socklen_t sinsize = sizeof sin;
   FILE *f;
-  
+
   BEGIN();
 
   sink = socket(AF_INET, SOCK_DGRAM, 0); TEST_1(sink != INVALID_SOCKET);
@@ -1458,21 +1458,21 @@
 
   ctx->sink = sink;
 
-  template = su_sprintf(ctx->home, "%s/test_sresolv.XXXXXX", 
+  template = su_sprintf(ctx->home, "%s/test_sresolv.XXXXXX",
 			tmpdir ? tmpdir : "/tmp");
   TEST_1(template);
 
-#ifndef _WIN32  
+#ifndef _WIN32
   fd = mkstemp(template); TEST_1(fd != -1);
 #else
   fd = open(template, O_WRONLY); TEST_1(fd != -1);
-#endif  
+#endif
 
   f = fdopen(fd, "w"); TEST_1(f);
-  fprintf(f, 
+  fprintf(f,
 	  "domain example.com\n"
 	  "search foo.bar.com\n"
-	  "port %u\n", 
+	  "port %u\n",
 	  ntohs(sin->sin_port));
   fclose(f);
 
@@ -1563,7 +1563,7 @@
   ctx->query = q;
   if (ctx->result)
     sres_free_answers(ctx->resolver, ctx->result);
-  ctx->result = answer; 
+  ctx->result = answer;
   BREAK(ctx);
 }
 
@@ -1720,9 +1720,9 @@
   TEST_1(ctx->sink != INVALID_SOCKET && ctx->sink != (sres_socket_t)0);
 
   /* Prepare for test_answer() callback */
-  sres_free_answers(ctx->resolver, ctx->result); 
+  sres_free_answers(ctx->resolver, ctx->result);
   ctx->result = NULL;
-  ctx->query = NULL; 
+  ctx->query = NULL;
 
   /* Get canned response */
   TEST_1(bin = hex2bin(__func__, hextest, NULL, &binlen));
@@ -1795,12 +1795,12 @@
   ctx->n_sockets = n;
   TEST_1(n < SRES_MAX_NAMESERVERS);
   TEST(sres_resolver_sockets(res, ctx->sockets, n), n);
-  
+
   for (i = 0; i < n; i++) {
     ctx->fds[i].fd = ctx->sockets[i];
     ctx->fds[i].events = POLLIN | POLLERR;
   }
-  
+
   TEST_P(sres_resolver_ref(ctx->resolver), ctx->resolver);
   sres_resolver_unref(ctx->resolver);
 
@@ -1823,7 +1823,7 @@
   offset = 0;
   memset(ctx, 0, sizeof ctx);
   ctx->home->suh_size = sizeof ctx;
-  
+
   return 0;
 }
 
@@ -1839,7 +1839,7 @@
   TEST_1(res = sres_resolver_new(conf_file));
   n = sres_resolver_sockets(res, NULL, 0);
   TEST_1(n > 0);
-    
+
   TEST(sres_resolver_sockets(res, &socket, 1), n);
 
 #if !__linux
@@ -1852,12 +1852,12 @@
 port $port
 -->8-->8-->8-->8-->8-->8-->8-->8-->8-->8-->8-->8--
   */
-  printf("%s:%u: %s test should be updated\n", 
+  printf("%s:%u: %s test should be updated\n",
 	 __FILE__, __LINE__, __func__);
 #else
   TEST_P(sres_query(res, test_answer, ctx, sres_type_a, "example.com"), NULL);
 #endif
-    
+
   sres_resolver_unref(res);
 
   END();
@@ -1882,7 +1882,7 @@
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
+  fprintf(stderr,
 	  "usage: %s OPTIONS [-] [conf-file] [error-conf-file]\n"
 	  "\twhere OPTIONS are\n"
 	  "\t    -v be verbose\n"
@@ -1932,7 +1932,7 @@
 
       if (rest == NULL || *rest)
 	usage(1);
-      
+
       su_log_set_level(sresolv_log, level);
     } else
       usage(1);
@@ -1949,7 +1949,7 @@
 #if HAVE_ALARM
   else if (o_alarm) {
     alarm(60);
-    signal(SIGALRM, sig_alarm); 
+    signal(SIGALRM, sig_alarm);
   }
 #endif
 
@@ -1975,7 +1975,7 @@
     /* These tests are run with (local) nameserver,
      */
     int initerror = test_init(ctx, argv[i]);
-    if (!initerror) { 
+    if (!initerror) {
       error |= test_a(ctx);
       error |= test_soa(ctx);
       error |= test_naptr(ctx);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/torture_sresolv.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/torture_sresolv.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/sresolv/torture_sresolv.c	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 /**@internal
  *
  * @CFILE torture_sresolv.c Torture tests for Sofia resolver.
- * 
+ *
  * @author Mikko Haataja
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
  */
@@ -96,7 +96,7 @@
 {
 }
 
-static char name2048[2049] = 
+static char name2048[2049] =
   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
   "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
@@ -151,7 +151,7 @@
 
   template = su_sprintf(ctx->home, ".torture_sresolv_api.conf.XXXXXX");
   TEST_1(template);
-  
+
   TEST_1(res = sres_resolver_new(NULL));
   TEST(su_home_threadsafe((su_home_t *)res), 0);
   TEST_VOID(sres_resolver_unref(res));
@@ -160,7 +160,7 @@
   fd = mkstemp(template); TEST_1(fd != -1);
 #else
   fd = open(template, O_WRONLY); TEST_1(fd != -1);
-#endif  
+#endif
 
   f = fdopen(fd, "w"); TEST_1(f);
   fprintf(f, "domain example.com\n");
@@ -173,9 +173,9 @@
   TEST(su_home_threadsafe((su_home_t *)res), 0);
 
   unlink(template);
-  
+
   s = sockets[0];
-  
+
   TEST_P(sres_resolver_ref(NULL), NULL);
   TEST(errno, EFAULT);
   sres_resolver_unref(NULL);
@@ -188,7 +188,7 @@
   TEST_P(sres_resolver_get_userdata(res), NULL);
   TEST_P(sres_resolver_set_userdata(res, sa), NULL);
   TEST_P(sres_resolver_get_userdata(res), sa);
-  TEST_P(sres_resolver_set_userdata(res, NULL), sa); 
+  TEST_P(sres_resolver_set_userdata(res, NULL), sa);
   TEST_P(sres_resolver_get_userdata(res), NULL);
 
   errno = 0;
@@ -218,7 +218,7 @@
   sres_sort_answers(NULL, NULL);
 
   sres_resolver_unref(res);
-  
+
   END();
 }
 
@@ -232,7 +232,7 @@
 int test_cache(void)
 {
   BEGIN();
- 
+
   sres_a_record_t *a, a0[1], **all;
   char host[128];
   sres_cache_t *cache;
@@ -285,7 +285,7 @@
     t2.tv_sec = t1.tv_sec - t0.tv_sec, t2.tv_nsec = t1.tv_nsec - t0.tv_nsec;
     if (t1.tv_nsec < t0.tv_nsec)
       t2.tv_sec--, t2.tv_nsec += 1000000000;
-    printf("sres_cache: stored %u entries: %lu.%09lu sec\n", 
+    printf("sres_cache: stored %u entries: %lu.%09lu sec\n",
 	   (unsigned)N, (long unsigned)t2.tv_sec, t2.tv_nsec);
   }
 
@@ -302,7 +302,7 @@
     t2.tv_sec = t1.tv_sec - t0.tv_sec, t2.tv_nsec = t1.tv_nsec - t0.tv_nsec;
     if (t1.tv_nsec < t0.tv_nsec)
       t2.tv_sec--, t2.tv_nsec += 1000000000;
-    printf("sres_cache: cleaned %u entries: %lu.%09lu sec\n", 
+    printf("sres_cache: cleaned %u entries: %lu.%09lu sec\n",
 	   (unsigned)N, (long unsigned)t2.tv_sec, t2.tv_nsec);
   }
 
@@ -324,7 +324,7 @@
     t2.tv_sec = t1.tv_sec - t0.tv_sec, t2.tv_nsec = t1.tv_nsec - t0.tv_nsec;
     if (t1.tv_nsec < t0.tv_nsec)
       t2.tv_sec--, t2.tv_nsec += 1000000000;
-    printf("sres_cache: stored %u entries: %lu.%09lu sec\n", 
+    printf("sres_cache: stored %u entries: %lu.%09lu sec\n",
 	   (unsigned)N, (long unsigned)t2.tv_sec, t2.tv_nsec);
   }
 
@@ -337,12 +337,12 @@
     sres_cache_clean(cache, now + 3600);
 
   clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t1);
-  
+
   if (o_timing) {
     t2.tv_sec = t1.tv_sec - t0.tv_sec, t2.tv_nsec = t1.tv_nsec - t0.tv_nsec;
     if (t1.tv_nsec < t0.tv_nsec)
       t2.tv_sec--, t2.tv_nsec += 1000000000;
-    printf("sres_cache: cleaned %u entries: %lu.%09lu sec\n", 
+    printf("sres_cache: cleaned %u entries: %lu.%09lu sec\n",
 	   (unsigned)N, (long unsigned)t2.tv_sec, t2.tv_nsec);
   }
 
@@ -369,7 +369,7 @@
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
+  fprintf(stderr,
 	  "usage: %s OPTIONS [-]\n"
 	  "\twhere OPTIONS are\n"
 	  "\t    -v be verbose\n"
@@ -419,7 +419,7 @@
 
       if (rest == NULL || *rest)
 	usage(1);
-      
+
       su_log_set_level(sresolv_log, level);
     }
     else
@@ -429,7 +429,7 @@
 #if HAVE_ALARM
   if (o_alarm) {
     alarm(60);
-    signal(SIGALRM, sig_alarm); 
+    signal(SIGALRM, sig_alarm);
   }
 #endif
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -11,14 +11,14 @@
 2006-05-07  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* sofia-sip/stun.h: Added new NAT types stun_nattype_t. The
-	naming is now compliant with the terms used by IETF BEHAVE 
+	naming is now compliant with the terms used by IETF BEHAVE
 	documents.
 
 2006-05-06  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
 	* sofia-sip/stun.h (stun_nattype_str): Added a new function to the
 	public API.
-	
+
 	* sofia-sip/stun.h (stun_nattype): Modified the function signature.
 
 	* sofia-sip/stun.h (stun_state_t): Moved all request-specific states
@@ -54,7 +54,7 @@
 
 2006-02-09  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-	* stun_tag.h: Added STUN_DOMAIN() and STUN_REQUIRE_INTEGRITY(). 
+	* stun_tag.h: Added STUN_DOMAIN() and STUN_REQUIRE_INTEGRITY().
 	Deprecated STUN_INTEGRITY.
 
 	* stun.c: Mark wait entries as deregistered after
@@ -95,7 +95,7 @@
 	* stun_internal.h: included stun_common.h
 
 	* torture_stun.c: updated get_localinfo() to get_address()
-	
+
 2006-01-13  Martti Mela  <martti.mela at nokia.com>
 
 	* stun.c: actions are now very separate from each other. Bug fixes.
@@ -111,7 +111,7 @@
 	glueing into TPORT.
 
 	* stunc.c: Removed unnecessary su_root_break()s.
-	
+
 2006-01-10  Martti Mela  <martti.mela at nokia.com>
 
 	* stun.c: First working version of get_lifetime functionality. All
@@ -165,7 +165,7 @@
 	stun_handle functionality.
 
 	* stunc.c, torture_stun.c: modified in accordance to stun.h.
-	
+
 2005-12-16  Martti Mela  <martti.mela at nokia.com>
 
 	* stun.h: changed stun_engine_t to stun_handle_t.
@@ -175,7 +175,7 @@
 	representation, too.
 
 	* stunc.c, torture_stun.c: behave now in conformance to stun.h
-	
+
 2005-12-15  Martti Mela  <martti.mela at nokia.com>
 
 	* STUN updated to work asynchronously.
@@ -189,7 +189,7 @@
 
 2005-11-19  Kai Vehmanen  <kaiv at .devtag.AUTHORS>
 
-	* stun.h (stun_set_uname_pwd): Changed from unsigned to signed 
+	* stun.h (stun_set_uname_pwd): Changed from unsigned to signed
 	char pointers for passing username and password.
 
 2005-11-18  Kai Vehmanen  <kai.vehmanen at nokia.com>
@@ -207,7 +207,7 @@
 
 2005-10-24  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-	* stun.c: Fixed stun_bind() behaviour when STUN 
+	* stun.c: Fixed stun_bind() behaviour when STUN
 	discovery fails. Added enum for tracking client
 	state.
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/lookup_stun_server.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/lookup_stun_server.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/lookup_stun_server.c	Tue Dec 23 07:37:03 2008
@@ -23,7 +23,7 @@
  */
 
 /**@internal
- * @file lookup_stun_server.c 
+ * @file lookup_stun_server.c
  * @brief Test app for STUN DNS-SRV lookups.
  *
  * @author Kai Vehmanen <Kai.Vehmanen at nokia.com>
@@ -53,16 +53,16 @@
   uint16_t tcp_port = 0, udp_port = 0, stp_port = 0;
   int res = 0;
 
-  printf("STUN DNS-SRV lookup results:\n"); 
+  printf("STUN DNS-SRV lookup results:\n");
 
   res = stun_dns_lookup_udp_addr(self, &udp_target, &udp_port);
-  printf(" _stun._udp.%s:     %s:%u (%s).\n", g_domain, udp_target, udp_port, RESULT(res)); 
+  printf(" _stun._udp.%s:     %s:%u (%s).\n", g_domain, udp_target, udp_port, RESULT(res));
 
   res = stun_dns_lookup_tcp_addr(self, &tcp_target, &tcp_port);
-  printf(" _stun._tcp.%s:     %s:%u (%s).\n", g_domain, tcp_target, tcp_port, RESULT(res)); 
+  printf(" _stun._tcp.%s:     %s:%u (%s).\n", g_domain, tcp_target, tcp_port, RESULT(res));
 
   res = stun_dns_lookup_stp_addr(self, &stp_target, &stp_port);
-  printf(" _stun-tls._tcp.%s: %s:%u (%s).\n", g_domain, stp_target, stp_port, RESULT(res)); 
+  printf(" _stun-tls._tcp.%s: %s:%u (%s).\n", g_domain, stp_target, stp_port, RESULT(res));
 
   su_root_break(root);
 }
@@ -71,7 +71,7 @@
 {
   su_root_t *root;
   stun_dns_lookup_t *lookup;
-  
+
   if (argc < 2) {
     printf("usage: ./lookup_stun_server <domain>\n");
     return -1;
@@ -87,7 +87,7 @@
 
   /* step: initiate the DNS-SRV lookup */
   lookup = stun_dns_lookup(root, root, lookup_cb, g_domain);
- 
+
   if (lookup) {
     /* step: enter the main loop (break fro lookup_cb()) */
     su_root_run(root);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun.h	Tue Dec 23 07:37:03 2008
@@ -56,13 +56,13 @@
 
 typedef struct stun_mini_s     stun_mini_t;
 
-#ifndef STUN_MAGIC_T 
+#ifndef STUN_MAGIC_T
 #define STUN_MAGIC_T            struct stun_magic_t
 #endif
 /** STUN server context */
 typedef STUN_MAGIC_T stun_magic_t;
 
-#ifndef STUN_DISCOVERY_MAGIC_T 
+#ifndef STUN_DISCOVERY_MAGIC_T
 #define STUN_DISCOVERY_MAGIC_T            struct stun_discovery_magic_t
 #endif
 /** STUN discovery_ context */
@@ -90,44 +90,44 @@
  * XXX: should be extended to distinguish between filtering and
  *      mapping allocation behaviour (see IETF BEHAVE documents)
  *
- * Note: the NAT type detection algorithm can fail in 
- *       case where the NAT behaves in a nondeterministic 
+ * Note: the NAT type detection algorithm can fail in
+ *       case where the NAT behaves in a nondeterministic
  *       fashion.
  **/
 typedef enum stun_nattype_e {
-  stun_nat_unknown = 0, 
-      
+  stun_nat_unknown = 0,
+
   /* no NAT between client and STUN server */
-  stun_open_internet,     
+  stun_open_internet,
 
   /* UDP communication blocked by FW */
-  stun_udp_blocked,       
+  stun_udp_blocked,
 
   /* No NAT, but a FW element is performing address and port
    * restricted filtering. */
-  stun_sym_udp_fw,        
+  stun_sym_udp_fw,
 
-  /* Endpoint independent filtering (endpoint independent mapping) 
+  /* Endpoint independent filtering (endpoint independent mapping)
    * RFC3489 full cone NAT. */
-  stun_nat_full_cone,     
+  stun_nat_full_cone,
 
   /* Address restricted filtering (endpoint independent mapping),
    * RFC3489 restricted cone NAT. */
-  stun_nat_res_cone,      
+  stun_nat_res_cone,
 
-  /* Address and port restricted filtering (endpoint 
+  /* Address and port restricted filtering (endpoint
    * independent mapping), RFC3489 port restricted cone */
-  stun_nat_port_res_cone, 
+  stun_nat_port_res_cone,
 
   /* Endpoint independent filtering, endpoint dependent mapping. */
-  stun_nat_ei_filt_ad_map, 
+  stun_nat_ei_filt_ad_map,
 
   /* Address dependent filtering, endpoint dependent mapping. */
-  stun_nat_ad_filt_ad_map, 
+  stun_nat_ad_filt_ad_map,
 
-  /* Address and port dependent filtering, endpoint dependent mapping 
+  /* Address and port dependent filtering, endpoint dependent mapping
    * RFC3489 symmetric NAT). */
-  stun_nat_adp_filt_ad_map, 
+  stun_nat_adp_filt_ad_map,
 
 } stun_nattype_t;
 
@@ -138,9 +138,9 @@
  * @see stun_obtain_shared_secret()
  * @see stun_test_nattype()
  * @see stun_test_lifetime()
- */ 
+ */
 typedef enum stun_state_e {
-  
+
   stun_no_assigned_event,
 
   /* TLS events; see stun_obtain_shared_request() */
@@ -211,7 +211,7 @@
 			 int sid, su_sockaddr_t *from_addr,
 			 socklen_t from_len);
 
-/* ------------------------------------------------------------------- 
+/* -------------------------------------------------------------------
  * Functions for 'Binding Discovery' usage (RFC3489/3489bis) */
 
 SOFIAPUBFUN
@@ -219,12 +219,12 @@
 			      stun_discovery_magic_t *magic,
 			      tag_type_t tag, tag_value_t value, ...);
 
-SOFIAPUBFUN 
-int stun_bind(stun_handle_t *sh, 
+SOFIAPUBFUN
+int stun_bind(stun_handle_t *sh,
 	      stun_discovery_f, stun_discovery_magic_t *magic,
 	      tag_type_t tag, tag_value_t value, ...);
 
-SOFIAPUBFUN 
+SOFIAPUBFUN
 int stun_discovery_get_address(stun_discovery_t *sd,
 			       void *addr,
 			       socklen_t *return_addrlen);
@@ -244,13 +244,13 @@
 		       tag_type_t tag, tag_value_t value, ...);
 SOFIAPUBFUN int stun_lifetime(stun_discovery_t *sd);
 
-/* ------------------------------------------------------------------- 
+/* -------------------------------------------------------------------
  * Functions for 'Connectivity Check' and 'NAT Keepalives' usages (RFC3489bis) */
 
-SOFIAPUBFUN 
+SOFIAPUBFUN
 int stun_set_uname_pwd(stun_handle_t *sh,
 		       const char *uname,
-		       isize_t len_uname, 
+		       isize_t len_uname,
 		       const char *pwd,
 		       isize_t len_pwd);
 
@@ -259,7 +259,7 @@
 
 /* Create a keepalive dispatcher for bound SIP sockets */
 
-SOFIAPUBFUN 
+SOFIAPUBFUN
 int stun_keepalive(stun_handle_t *sh,
 		   su_sockaddr_t *sa,
 		   tag_type_t tag, tag_value_t value,
@@ -274,10 +274,10 @@
 /* -------------------------------------------------------------------
  * Functions for STUN server discovery using DNS (RFC3489/3489bis) */
 
-SOFIAPUBFUN 
-stun_dns_lookup_t *stun_dns_lookup(stun_magic_t *magic, 
+SOFIAPUBFUN
+stun_dns_lookup_t *stun_dns_lookup(stun_magic_t *magic,
 				   su_root_t *root,
-				   stun_dns_lookup_f func, 
+				   stun_dns_lookup_f func,
 				   const char *domain);
 SOFIAPUBFUN void stun_dns_lookup_destroy(stun_dns_lookup_t *self);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun_common.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun_common.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun_common.h	Tue Dec 23 07:37:03 2008
@@ -28,12 +28,12 @@
 
 /**
  * @file sofia-sip/stun_common.h
- * @brief 
- * 
+ * @brief
+ *
  * @author Tat Chan <Tat.Chan at nokia.com>
- * 
+ *
  * @date Created: Fri Oct  3 13:39:55 2003 ppessi
- * 
+ *
  */
 
 #include <sofia-sip/su_localinfo.h>
@@ -69,7 +69,7 @@
 #define STUN_A_REFRESH_INTERVAL       0x8024
 
 /* Defines for mandatory and optional attributes */
-#define STUN_A_LAST_MANDATORY         0x0023 /**< largest attribute in the current 
+#define STUN_A_LAST_MANDATORY         0x0023 /**< largest attribute in the current
 						spec (see above for exceptions
 						for buggy servers) */
 #define STUN_A_OPTIONAL               0x7fff
@@ -209,7 +209,7 @@
 int stun_encode_type_len(stun_attr_t *attr, uint16_t len);
 int stun_encode_response_address(stun_attr_t *attr);
 
-int stun_validate_message_integrity(stun_msg_t *msg, stun_buffer_t *pwd); 
+int stun_validate_message_integrity(stun_msg_t *msg, stun_buffer_t *pwd);
 
 int stun_copy_buffer(stun_buffer_t *p, stun_buffer_t *p2);
 void stun_init_buffer(stun_buffer_t *p);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun.c	Tue Dec 23 07:37:03 2008
@@ -31,11 +31,11 @@
  * @author Tat Chan <Tat.Chan at nokia.com>
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Kai Vehmanen <Kai.Vehmanen at nokia.com>
- * 
+ *
  * @date Created: Thu Jul 24 17:21:00 2003 ppessi
  */
 
-#include "config.h" 
+#include "config.h"
 
 #include <assert.h>
 #include <string.h>
@@ -79,7 +79,7 @@
 #endif
 
 /** STUN log. */
-su_log_t stun_log[] = { SU_LOG_INIT("stun", "STUN_DEBUG", SU_DEBUG) }; 
+su_log_t stun_log[] = { SU_LOG_INIT("stun", "STUN_DEBUG", SU_DEBUG) };
 
 /**@var char const STUN_DEBUG[]
  *
@@ -87,7 +87,7 @@
  *
  * The STUN_DEBUG environment variable is used to determine the debug logging
  * level for @b stun module. The default level is 3.
- * 
+ *
  * @sa <sofia-sip/su_debug.h>, stun_log, SOFIA_DEBUG
  */
 extern char const STUN_DEBUG[];
@@ -100,7 +100,7 @@
 /**
  * States of STUN requests. See stun_state_e for states
  * discovery processes.
- */ 
+ */
 typedef enum stun_req_state_e {
   stun_req_no_assigned_event,
   stun_req_dispose_me,            /**< request can be disposed */
@@ -214,7 +214,7 @@
   char           *sh_domain;        /**< domain address for DNS-SRV lookups */
 
   stun_dns_lookup_t  *sh_dns_lookup;
-  stun_action_t       sh_dns_pend_action; 
+  stun_action_t       sh_dns_pend_action;
   stun_discovery_f    sh_dns_pend_cb;
   stun_discovery_magic_t *sh_dns_pend_ctx;
   tagi_t             *sh_dns_pend_tags;
@@ -259,13 +259,13 @@
   STUN_STATE_STR(stun_tls_ssl_connect_failed);
   STUN_STATE_STR(stun_discovery_timeout);
   /* STUN_STATE_STR(stun_req_timeout); */
-  
+
   case stun_error:
   default: return "stun_error";
   }
 }
 
-/** 
+/**
  * Returns the NAT type attached to STUN discovery handle.
  *
  * @see stun_nattype_str().
@@ -294,7 +294,7 @@
 
 /**
  * Returns the detected NAT type.
- * 
+ *
  * @see stun_nattype_str().
  * @see stun_test_nattype().
  */
@@ -318,10 +318,10 @@
 
 
 #if HAVE_OPENSSL
-char const stun_version[] = 
+char const stun_version[] =
  "sofia-sip-stun using " OPENSSL_VERSION_TEXT;
 #else
-char const stun_version[] = 
+char const stun_version[] =
  "sofia-sip-stun";
 #endif
 
@@ -349,18 +349,18 @@
 #endif
 
 /* timers */
-static void stun_sendto_timer_cb(su_root_magic_t *magic, 
+static void stun_sendto_timer_cb(su_root_magic_t *magic,
 				 su_timer_t *t,
 				 su_timer_arg_t *arg);
 #if HAVE_OPENSSL
-static void stun_tls_connect_timer_cb(su_root_magic_t *magic, 
+static void stun_tls_connect_timer_cb(su_root_magic_t *magic,
 				      su_timer_t *t,
 				      su_timer_arg_t *arg);
 #endif
-static void stun_test_lifetime_timer_cb(su_root_magic_t *magic, 
+static void stun_test_lifetime_timer_cb(su_root_magic_t *magic,
 					su_timer_t *t,
 					su_timer_arg_t *arg);
-static void stun_keepalive_timer_cb(su_root_magic_t *magic, 
+static void stun_keepalive_timer_cb(su_root_magic_t *magic,
 				    su_timer_t *t,
 				    su_timer_arg_t *arg);
 
@@ -387,8 +387,8 @@
 /**
  * Check if a STUN handle should be created.
  *
- * Return true if STUNTAG_SERVER() or STUNTAG_DOMAIN() tags have 
- * been specified, or otherwise if STUN_SERVER environment variable 
+ * Return true if STUNTAG_SERVER() or STUNTAG_DOMAIN() tags have
+ * been specified, or otherwise if STUN_SERVER environment variable
  * is set.
  *
  * @TAGS
@@ -408,7 +408,7 @@
   ta_start(ta, tag, value);
   t = tl_find(ta_args(ta), stuntag_server);
   t2 = tl_find(ta_args(ta), stuntag_domain);
-  if (t && t->t_value) 
+  if (t && t->t_value)
     stun_server = (char *)t->t_value;
   else if (t2 && t2->t_value)
     stun_server = (char *)t2->t_value;
@@ -420,14 +420,14 @@
 }
 
 
-/** 
+/**
  * Creates a STUN handle.
  *
- * The created handles can be used for STUN binding discovery, 
+ * The created handles can be used for STUN binding discovery,
  * keepalives, and other STUN usages.
  *
  * @param root eventloop to used by the stun state machine
- * @param tag,value,... tag-value list 
+ * @param tag,value,... tag-value list
  *
  * @TAGS
  * @TAG STUNTAG_DOMAIN() domain to use in DNS-SRV based STUN server
@@ -444,7 +444,7 @@
   int req_msg_integrity = 1;
   int err;
   ta_list ta;
-  
+
   enter;
 
   ta_start(ta, tag, value);
@@ -470,7 +470,7 @@
     SU_DEBUG_5(("%s: using STUN_SERVER=%s\n", __func__, server));
   }
 
-  SU_DEBUG_5(("%s(\"%s\"): called\n", 
+  SU_DEBUG_5(("%s(\"%s\"): called\n",
 	      __func__, server));
 
   /* fail, if no server or a domain for a DNS-SRV lookup is specified */
@@ -478,7 +478,7 @@
     errno = ENOENT;
     return NULL;
   }
-  
+
   stun->sh_pri_info.ai_addrlen = 16;
   stun->sh_pri_info.ai_addr = &stun->sh_pri_addr->su_sa;
 
@@ -490,7 +490,7 @@
 
   stun->sh_domain = su_strdup(stun->sh_home, domain);
   stun->sh_dns_lookup = NULL;
-  
+
   if (server) {
     err = stun_atoaddr(stun->sh_home, AF_INET, &stun->sh_pri_info, server);
     if (err < 0) {
@@ -512,16 +512,16 @@
   /* initialize username and password */
   stun_init_buffer(&stun->sh_username);
   stun_init_buffer(&stun->sh_passwd);
-  
+
   stun->sh_nattype = stun_nat_unknown;
-  
+
   /* initialize random number generator */
   srand(time(NULL));
- 
+
   return stun;
 }
 
-/** 
+/**
  * Performs shared secret request/response processing.
  * Result will be trigged in STUN handle callback (state
  * one of stun_tls_*).
@@ -549,13 +549,13 @@
 
   if (!sh->sh_pri_addr[0].su_port) {
     /* no STUN server address, perform a DNS-SRV lookup */
-   
+
     ta_list ta;
     ta_start(ta, tag, value);
     SU_DEBUG_5(("Delaying STUN shared-secret req. for DNS-SRV query.\n"));
     err = priv_dns_queue_action(sh, stun_action_tls_query, sdf, magic, ta_tags(ta));
     ta_end(ta);
-       
+
     return err;
   }
 
@@ -588,7 +588,7 @@
 
   /* Do an asynchronous connect(). Three error codes are ok,
    * others cause return -1. */
-  if (connect(s, (struct sockaddr *) &sh->sh_pri_addr, 
+  if (connect(s, (struct sockaddr *) &sh->sh_pri_addr,
 	      ai->ai_addrlen) == SOCKET_ERROR) {
     err = su_errno();
     if (err != EINPROGRESS && err != EAGAIN && err != EWOULDBLOCK) {
@@ -598,7 +598,7 @@
 
   SU_DEBUG_9(("%s: %s: %s\n", __func__, "connect",
 	      su_strerror(err)));
-  
+
   sd = stun_discovery_create(sh, stun_action_tls_query, sdf, magic);
   sd->sd_socket = s;
   /* req = stun_request_create(sd); */
@@ -650,16 +650,16 @@
 
   /* This is the default */
   req->sr_socket = sd->sd_socket;
-  
+
   req->sr_localinfo.li_addrlen = sizeof(su_sockaddr_t);
   req->sr_localinfo.li_addr = req->sr_local_addr;
-  
+
   /* default timeout for next sendto() */
   req->sr_timeout = STUN_SENDTO_TIMEOUT;
   req->sr_retry_count = 0;
   /* req->sr_action = action; */
   req->sr_request_mask = 0;
-  
+
   req->sr_msg = calloc(sizeof(stun_msg_t), 1);
 
   req->sr_state = stun_req_discovery_init;
@@ -706,9 +706,9 @@
 }
 
 
-/** Destroy a STUN client */ 
+/** Destroy a STUN client */
 void stun_handle_destroy(stun_handle_t *sh)
-{ 
+{
   stun_discovery_t *sd = NULL, *kill = NULL;
   stun_request_t *a, *b;
 
@@ -753,7 +753,7 @@
 
 /** Create wait object and register it to the handle callback */
 static
-int assign_socket(stun_discovery_t *sd, su_socket_t s, int register_socket) 
+int assign_socket(stun_discovery_t *sd, su_socket_t s, int register_socket)
 {
   stun_handle_t *sh = sd->sd_handle;
   int events;
@@ -763,7 +763,7 @@
   socklen_t sulen;
   char addr[SU_ADDRSIZE];
   int err;
-  
+
   su_wait_t wait[1] = { SU_WAIT_INIT };
 
   enter;
@@ -806,7 +806,7 @@
 #endif
 
     if ((err = bind(s, &su->su_sa, sulen)) < 0) {
-      SU_DEBUG_3(("%s: bind(%s:%u): %s\n",  __func__, 
+      SU_DEBUG_3(("%s: bind(%s:%u): %s\n",  __func__,
 		  su_inet_ntop(su->su_family, SU_ADDR(su), addr, sizeof(addr)),
 		  (unsigned) ntohs(su->su_port),
 		  su_strerror(su_errno())));
@@ -867,13 +867,13 @@
 
       memcpy(su, li->li_addr, *return_len = li->li_addrlen);
 
-      SU_DEBUG_3(("%s: using local address %s\n", __func__, 
+      SU_DEBUG_3(("%s: using local address %s\n", __func__,
 		  su_inet_ntop(family, SU_ADDR(su), addr, sizeof(addr))));
       break;
     }
 
     su_freelocalinfo(res);
-    
+
     if (!li) {			/* Not found */
       return STUN_ERROR(error, su_getlocalinfo);
     }
@@ -898,13 +898,13 @@
   if (res == 0 && udp_target) {
     /* XXX: assumption that same host and port used for UDP/TLS */
     stun_atoaddr(sh->sh_home, AF_INET, &sh->sh_pri_info, udp_target);
-    
-    if (udp_port) 
+
+    if (udp_port)
       sh->sh_pri_addr[0].su_port = htons(udp_port);
     else
       sh->sh_pri_addr[0].su_port = htons(STUN_DEFAULT_PORT);
 
-    /* step: now that server address is known, continue 
+    /* step: now that server address is known, continue
      *       the pending action */
 
     SU_DEBUG_5(("STUN server address found, running queue actions (%d).\n",
@@ -918,15 +918,15 @@
     case stun_action_binding_request:
       stun_bind(sh, sh->sh_dns_pend_cb, sh->sh_dns_pend_ctx, TAG_NEXT(sh->sh_dns_pend_tags));
       break;
-      
+
     case stun_action_test_lifetime:
       stun_test_lifetime(sh, sh->sh_dns_pend_cb, sh->sh_dns_pend_ctx, TAG_NEXT(sh->sh_dns_pend_tags));
       break;
-      
+
     case stun_action_test_nattype:
       stun_test_nattype(sh, sh->sh_dns_pend_cb, sh->sh_dns_pend_ctx, TAG_NEXT(sh->sh_dns_pend_tags));
       break;
-      
+
     default:
       SU_DEBUG_5(("Warning: unknown pending STUN DNS-SRV action.\n"));
     }
@@ -963,7 +963,7 @@
       sh->sh_dns_lookup = stun_dns_lookup((stun_magic_t*)sh, sh->sh_root, priv_lookup_cb, sh->sh_domain);
       ta_start(ta, tag, value);
       assert(sh->sh_dns_pend_tags == NULL);
-      sh->sh_dns_pend_tags = tl_tlist(sh->sh_home, 
+      sh->sh_dns_pend_tags = tl_tlist(sh->sh_home,
 				      ta_tags(ta));
       ta_end(ta);
       sh->sh_dns_pend_cb = sdf;
@@ -974,7 +974,7 @@
 
     return 0;
   }
-  
+
   return -1;
 }
 
@@ -988,17 +988,17 @@
   return res;
 }
 
-/** 
+/**
  * Performs a STUN Binding Discovery (see RFC3489/3489bis) process
  *
- * To integrity protect the discovery process, first call 
+ * To integrity protect the discovery process, first call
  * stun_request_shared_secret() on the handle 'sh'.
  *
  * If STUNTAG_REGISTER_SOCKET() is omitted, or set to false, the
  * client is responsible for socket i/o. Other stun module will
  * perform the whole discovery process and return the results
  * via callback 'sdf'.
- * 
+ *
  * @param sh       pointer to valid stun handle
  * @param sdf      callback to signal process progress
  * @param magic    context pointer attached to 'sdf'
@@ -1011,16 +1011,16 @@
  * @return
  * On success, zero is returned.  Upon error, -1 is returned, and @e errno is
  * set appropriately.
- * 
+ *
  * @ERRORS
  * @ERROR EFAULT          An invalid address is given as argument
  * @ERROR EPROTONOSUPPORT Not a UDP socket.
  * @ERROR EINVAL          The socket is already bound to an address.
- * @ERROR EACCESS   	  The address is protected, and the user is not 
+ * @ERROR EACCESS   	  The address is protected, and the user is not
  *                  	  the super-user.
  * @ERROR ENOTSOCK  	  Argument is a descriptor for a file, not a socket.
- * @ERROR EAGAIN          Operation in progress. Application should call 
- *                        stun_bind() again when there is data available on 
+ * @ERROR EAGAIN          Operation in progress. Application should call
+ *                        stun_bind() again when there is data available on
  *                        the socket.
  */
 int stun_bind(stun_handle_t *sh,
@@ -1034,7 +1034,7 @@
   stun_discovery_t *sd = NULL;
   ta_list ta;
   int s_reg = 0;
-  
+
   enter;
 
   if (sh == NULL)
@@ -1077,7 +1077,7 @@
 }
 
 
-/** 
+/**
  * Returns the address of the public binding allocated by the NAT.
  *
  * In case of multiple on path NATs, the binding allocated by
@@ -1091,7 +1091,7 @@
 			       socklen_t *return_addrlen)
 {
   socklen_t siz;
-  
+
   enter;
 
   assert(sd && addr);
@@ -1105,7 +1105,7 @@
     *return_addrlen = siz;
 
   memcpy(addr, sd->sd_addr_seen_outside, siz);
-  
+
   return 0;
 }
 
@@ -1149,7 +1149,7 @@
 
   sh = sd->sd_handle;
 
-  if (sd->sd_timer) 
+  if (sd->sd_timer)
     su_timer_destroy(sd->sd_timer), sd->sd_timer = NULL;
 
   /* if we are in the queue*/
@@ -1163,12 +1163,12 @@
 }
 
 /**
- * Initiates STUN discovery process to find out NAT 
- * characteristics. 
+ * Initiates STUN discovery process to find out NAT
+ * characteristics.
  *
- * Process partly follows the algorithm defined in RFC3489 section 
+ * Process partly follows the algorithm defined in RFC3489 section
  * 10.1. Due the known limitations of RFC3489, some of the tests
- * are done. 
+ * are done.
  *
  * Note: does not support STUNTAG_DOMAIN() even if specified to
  * stun_handle_init().
@@ -1198,13 +1198,13 @@
 
   if (!sh->sh_pri_addr[0].su_port) {
     /* no STUN server address, perform a DNS-SRV lookup */
-   
+
     ta_list ta;
     ta_start(ta, tag, value);
     SU_DEBUG_5(("Delaying STUN get-nat-type req. for DNS-SRV query.\n"));
     err = priv_dns_queue_action(sh, stun_action_test_nattype, sdf, magic, ta_tags(ta));
     ta_end(ta);
-       
+
     return err;
   }
 
@@ -1238,10 +1238,10 @@
   destination = (su_sockaddr_t *) sd->sd_pri_addr;
 
   req = stun_request_create(sd);
-  if (stun_make_binding_req(sh, req, req->sr_msg, 
-			    STUNTAG_CHANGE_IP(0), 
+  if (stun_make_binding_req(sh, req, req->sr_msg,
+			    STUNTAG_CHANGE_IP(0),
 			    STUNTAG_CHANGE_PORT(0),
-			    TAG_END()) < 0) 
+			    TAG_END()) < 0)
     return -1;
 
   err = stun_send_binding_request(req, destination);
@@ -1253,10 +1253,10 @@
   /* Same Public IP and port, Test III, server ip 0 or 1 should be
      the same */
   req = stun_request_create(sd);
-  if (stun_make_binding_req(sh, req, req->sr_msg, 
-			    STUNTAG_CHANGE_IP(0), 
+  if (stun_make_binding_req(sh, req, req->sr_msg,
+			    STUNTAG_CHANGE_IP(0),
 			    STUNTAG_CHANGE_PORT(1),
-			    TAG_END()) < 0) 
+			    TAG_END()) < 0)
     return -1;
 
   err = stun_send_binding_request(req, destination);
@@ -1267,12 +1267,12 @@
   req = NULL;
 
   req = stun_request_create(sd);
-  if (stun_make_binding_req(sh, req, req->sr_msg, 
-			    STUNTAG_CHANGE_IP(1), 
+  if (stun_make_binding_req(sh, req, req->sr_msg,
+			    STUNTAG_CHANGE_IP(1),
 			    STUNTAG_CHANGE_PORT(1),
-			    TAG_END()) < 0) 
+			    TAG_END()) < 0)
     return -1;
-  
+
   err = stun_send_binding_request(req, destination);
   if (err < 0) {
     stun_free_message(req->sr_msg);
@@ -1286,7 +1286,7 @@
  *******************************************************************/
 
 #if HAVE_OPENSSL
-static 
+static
 int stun_tls_callback(su_root_magic_t *m, su_wait_t *w, su_wakeup_arg_t *arg)
 {
   stun_discovery_t *sd = arg;
@@ -1349,7 +1349,7 @@
       stun_free_buffer(&msg_req->enc_buf);
       return -1;
     }
-    
+
     /* openssl initiation */
     SSLeay_add_ssl_algorithms();
     SSL_load_error_strings();
@@ -1361,13 +1361,13 @@
       stun_free_buffer(&msg_req->enc_buf);
       return -1;
     }
-    
+
     if (SSL_CTX_set_cipher_list(ctx, "AES128-SHA") == 0) {
       STUN_ERROR(errno, SSL_CTX_set_cipher_list);
       stun_free_buffer(&msg_req->enc_buf);
       return -1;
     }
-    
+
     /* Start TLS negotiation */
     ssl = SSL_new(ctx);
     self->sh_ssl = ssl;
@@ -1406,7 +1406,7 @@
 
       return -1;
     }
-    
+
     /* Inform application about the progress  */
     sd->sd_state = stun_tls_writing;
     /* self->sh_callback(self->sh_context, self, self->sh_state); */
@@ -1424,16 +1424,16 @@
 		      sd->sd_socket, events);
 
     SU_DEBUG_3(("TLS connection using %s\n", SSL_get_cipher(ssl)));
-    
-    server_cert = SSL_get_peer_certificate(ssl); 
+
+    server_cert = SSL_get_peer_certificate(ssl);
     if(server_cert) {
       SU_DEBUG_3(("\t subject: %s\n", X509_NAME_oneline(X509_get_subject_name(server_cert), 0, 0)));
       SU_DEBUG_3(("\t issuer: %s\n", X509_NAME_oneline(X509_get_issuer_name(server_cert), 0, 0)));
     }
     X509_free(server_cert);
-    
+
     z = SSL_write(ssl, msg_req->enc_buf.data, msg_req->enc_buf.size);
-    
+
     if (z < 0) {
       err = SSL_get_error(ssl, z);
       if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)
@@ -1484,7 +1484,7 @@
     SSL_CTX_free(self->sh_ctx), ctx = NULL;
 
     stun_free_buffer(&msg_req->enc_buf);
-  
+
     /* process response */
     if (stun_parse_message(resp) < 0) {
       perror("stun_parse_message");
@@ -1505,17 +1505,17 @@
 
     case SHARED_SECRET_ERROR_RESPONSE:
       if (stun_process_error_response(resp) < 0) {
-	SU_DEBUG_5(("Error in Shared Secret Error Response.\n")); 
+	SU_DEBUG_5(("Error in Shared Secret Error Response.\n"));
       }
       stun_free_buffer(&resp->enc_buf);
       return -1;
-    
+
       break;
 
     default:
       break;
     }
-    
+
     su_wait_destroy(w);
     su_root_deregister(self->sh_root, sd->sd_index);
     sd->sd_index = -1; /* mark index as deregistered */
@@ -1539,7 +1539,7 @@
 
 
 #if HAVE_OPENSSL
-static void stun_tls_connect_timer_cb(su_root_magic_t *magic, 
+static void stun_tls_connect_timer_cb(su_root_magic_t *magic,
 				      su_timer_t *t,
 				      su_timer_arg_t *arg)
 {
@@ -1562,7 +1562,7 @@
 
   su_root_deregister(sh->sh_root, sd->sd_index);
   sd->sd_index = -1; /* mark index as deregistered */
-  
+
   sd->sd_state = stun_tls_connection_timeout;
   sd->sd_callback(sd->sd_magic, sh, sd, sd->sd_action, sd->sd_state);
 
@@ -1577,7 +1577,7 @@
 int stun_make_sharedsecret_req(stun_msg_t *msg)
 {
 
-  int i, len; 
+  int i, len;
   uint16_t tmp;
 
   /* compose header */
@@ -1586,17 +1586,17 @@
 				stun_send_message */
   for (i = 0; i < STUN_TID_BYTES; i++) {
     msg->stun_hdr.tran_id[i] = (1 + rand() % RAND_MAX_16);
-  } 
-  
+  }
+
   /* no buffer assigned yet */
   stun_init_buffer(&msg->enc_buf);
-  
+
   msg->enc_buf.data = malloc(20);
   msg->enc_buf.size = 20;
 
   tmp = htons(msg->stun_hdr.msg_type);
   len = 0;
-  
+
   memcpy(msg->enc_buf.data, &tmp, sizeof(tmp));
   len+=sizeof(tmp);
 
@@ -1606,7 +1606,7 @@
 
   memcpy(msg->enc_buf.data+len, msg->stun_hdr.tran_id, STUN_TID_BYTES);
   len+=STUN_TID_BYTES;
-    
+
   return 0;
 }
 
@@ -1695,12 +1695,12 @@
   binding_response.enc_buf.size = dgram_len;
   memcpy(binding_response.enc_buf.data, dgram, dgram_len);
 
-  
+
   SU_DEBUG_5(("%s: response from server %s:%u\n", __func__,
 	      su_inet_ntop(recv.su_family, SU_ADDR(&recv), addr, sizeof(addr)),
 	      ntohs(recv.su_port)));
 
-  debug_print(&binding_response.enc_buf);      
+  debug_print(&binding_response.enc_buf);
 
   /* Parse here the incoming message. */
   if (stun_parse_message(&binding_response) < 0) {
@@ -1722,13 +1722,13 @@
 
     msg = &binding_response;
     for (a = &msg->stun_attr; *a;) {
-      
+
       if ((*a)->pattr)
 	free((*a)->pattr);
-      
+
       if ((*a)->enc_buf.data)
 	free((*a)->enc_buf.data);
-      
+
       b = *a;
       b = b->next;
       free(*a);
@@ -1792,7 +1792,7 @@
     req->sr_state = stun_req_dispose_me;
     break;
   }
-  
+
   return 0;
 }
 
@@ -1837,14 +1837,14 @@
     }
 
     break;
-    
+
   case BINDING_ERROR_RESPONSE:
   default:
     if (stun_process_error_response(binding_response) < 0) {
       SU_DEBUG_3(("%s: Error in Binding Error Response.\n", __func__));
     }
     req->sr_state = stun_req_error;
-      
+
     break;
   }
 
@@ -1852,7 +1852,7 @@
 
 }
 
-static void stun_test_lifetime_timer_cb(su_root_magic_t *magic, 
+static void stun_test_lifetime_timer_cb(su_root_magic_t *magic,
 				       su_timer_t *t,
 				       su_timer_arg_t *arg)
 {
@@ -1921,7 +1921,7 @@
 
     new = stun_request_create(sd);
     new->sr_from_y = 0;
-    if (stun_make_binding_req(sh, new, new->sr_msg, 0, 0) < 0) 
+    if (stun_make_binding_req(sh, new, new->sr_msg, 0, 0) < 0)
       return -1;
 
     destination = (su_sockaddr_t *) sd->sd_pri_addr;
@@ -1957,16 +1957,16 @@
   li = &req->sr_localinfo;
   sa = req->sr_local_addr;
   stun_free_message(binding_response);
-  
+
   /* Destroy me with the bad mofo timer */
   req->sr_state = stun_req_dispose_me, req = NULL;
-  
+
   new = stun_request_create(sd);
   /* Use sockfdy */
   new->sr_socket = sockfdy;
   new->sr_from_y = 1;
 
-  if (stun_make_binding_req(sh, new, new->sr_msg, 0, 0) < 0) 
+  if (stun_make_binding_req(sh, new, new->sr_msg, 0, 0) < 0)
     return -1;
 
   stun_add_response_address(new->sr_msg, (struct sockaddr_in *) sa);
@@ -1999,7 +1999,7 @@
 
   sd->sd_state = stun_discovery_done;
   req->sr_state = stun_req_dispose_me;
-  
+
   if (sd->sd_callback)
     sd->sd_callback(sd->sd_magic, sh, sd, action, sd->sd_state);
 
@@ -2016,7 +2016,7 @@
   int af;
   char addr[SU_ADDRSIZE];
 
-  SU_DEBUG_5(("%s: checking if %s is a local address.\n", __func__, 
+  SU_DEBUG_5(("%s: checking if %s is a local address.\n", __func__,
 	      su_inet_ntop(AF_INET, SU_ADDR(su), addr, sizeof(addr))));
 
   hints->li_family = af = su->su_family;
@@ -2028,15 +2028,15 @@
   for (li = res; li; li = li->li_next) {
     if (li->li_family != af)
       continue;
-      
+
     if (memcmp(SU_ADDR(su), SU_ADDR(li->li_addr), SU_ADDRLEN(su)) == 0) {
       SU_DEBUG_5(("%s: found matching local address\n", __func__));
       break;
     }
 
-    SU_DEBUG_9(("%s: skipping local address %s.\n", __func__, 
+    SU_DEBUG_9(("%s: skipping local address %s.\n", __func__,
 		su_inet_ntop(af, SU_ADDR(li->li_addr), addr, sizeof(addr))));
-  }  
+  }
 
   su_freelocalinfo(res);
 
@@ -2046,9 +2046,9 @@
 /**
  * Helper function for action_determine_nattype().
  */
-static void priv_mark_discovery_done(stun_discovery_t *sd, 
-				     stun_handle_t *sh, 
-				     stun_action_t action, 
+static void priv_mark_discovery_done(stun_discovery_t *sd,
+				     stun_handle_t *sh,
+				     stun_action_t action,
 				     stun_request_t *req)
 {
   sd->sd_state = stun_discovery_done;
@@ -2059,7 +2059,7 @@
 
 /**
  * Handles responses related to the NAT type discovery process.
- * 
+ *
  * The requests for Tests I-III are sent in parallel, so the
  * callback has to keep track of which requests have been received
  * and postpone decisions until enough responses have been processed.
@@ -2095,7 +2095,7 @@
   li = &req->sr_localinfo;
 
   /* check whether the response timed out or not */
-  if (req->sr_state == stun_req_timeout) 
+  if (req->sr_state == stun_req_timeout)
     reply_res = -1;
   else
     reply_res = 1;
@@ -2127,7 +2127,7 @@
        inet_ntoa(li->li_addr->su_sin.sin_addr),
        li->li_addr->su_port)); */
 
-    /* note: check whether MAPPED-ADDRESS address has changed (when 
+    /* note: check whether MAPPED-ADDRESS address has changed (when
      *       sending to a different IP:port -> NAT mapping behaviour) */
     if (su_cmp_sockaddr(sd->sd_addr_seen_outside, li->li_addr) != 0) {
       sd->sd_mapped_addr_match = 0;
@@ -2146,21 +2146,21 @@
     sd->sd_nattype = stun_udp_blocked;
     priv_mark_discovery_done(sd, sh, action, req);
   }
-  /* case 2: mapped address matches our local address 
+  /* case 2: mapped address matches our local address
    *         not behind a NAT, result of test two determinces
    *         whether we are behind a symmetric FW or not */
   else if (sd->sd_first > 0 &&
-	   sd->sd_second && 
+	   sd->sd_second &&
 	   priv_find_matching_localadress(sd->sd_addr_seen_outside)) {
-    if (sd->sd_second > 0) 
+    if (sd->sd_second > 0)
       sd->sd_nattype = stun_open_internet;
     else
       sd->sd_nattype = stun_sym_udp_fw;
     priv_mark_discovery_done(sd, sh, action, req);
   }
-  /* case 3: response ok to Test-II, and behind a NAT 
+  /* case 3: response ok to Test-II, and behind a NAT
    *         do not make conclusions until Test-IV has been scheduled */
-  else if (sd->sd_first > 0 && 
+  else if (sd->sd_first > 0 &&
 	   sd->sd_second > 0 &&
 	   sd->sd_fourth) {
     if (sd->sd_mapped_addr_match == 1)
@@ -2169,28 +2169,28 @@
       sd->sd_nattype = stun_nat_ei_filt_ad_map;
     priv_mark_discovery_done(sd, sh, action, req);
   }
-  /* case 4: tests I-III done, perform IV 
+  /* case 4: tests I-III done, perform IV
    *         see notes below */
-  else if (sd->sd_first > 0 && 
+  else if (sd->sd_first > 0 &&
 	   sd->sd_second &&
 	   sd->sd_third &&
 	   sd->sd_fourth == 0) {
 
-    /* 
+    /*
      * No response received, so we now perform Test IV using the address
-     * learnt from response to Test-I. 
-     * 
+     * learnt from response to Test-I.
+     *
      * Unfortunately running  this test will potentially affect
      * results of a subsequent Test-II (depends on NAT binding timeout
-     * values). To get around this, the STUN server would ideally have 
+     * values). To get around this, the STUN server would ideally have
      * a dedicated IP:port for Test-IV. But within the currents specs,
-     * we need to reuse one of the IP:port addresses already used in 
+     * we need to reuse one of the IP:port addresses already used in
      * Test-II by the STUN server to send us packets.
      */
 
     SU_DEBUG_7(("Sending STUN NAT type Test-IV request to %s.\n",
 	       inet_ntoa(sd->sd_sec_addr[0].su_sin.sin_addr)));
-    
+
     sd->sd_fourth = 2; /* request, -1, 0, 1 reserved for results */
     req->sr_state = stun_req_dispose_me;
     req = stun_request_create(sd);
@@ -2212,13 +2212,13 @@
       action_determine_nattype(req, binding_response);
       return -1;
     }
-    
+
     return 0; /* we don't want to dispose this req */
   }
   /* case 5: no response Test-II, and success with III
    *         the NAT is filtering packets from different IP
    *         do not make conclusions until Test-IV has been scheduled */
-  else if (sd->sd_first > 0 && 
+  else if (sd->sd_first > 0 &&
 	   sd->sd_second < 0 &&
 	   sd->sd_third > 0 &&
 	   sd->sd_fourth) {
@@ -2228,10 +2228,10 @@
       sd->sd_nattype = stun_nat_ad_filt_ad_map;
     priv_mark_discovery_done(sd, sh, action, req);
   }
-  /* case 6: no response to Test-II nor III 
+  /* case 6: no response to Test-II nor III
    *         the NAT is filtering packets from different port
    *         do not make conclusions until Test-IV has been scheduled */
-  else if (sd->sd_first > 0 && 
+  else if (sd->sd_first > 0 &&
 	   sd->sd_second < 0 &&
 	   sd->sd_third < 0 &&
 	   sd->sd_fourth) {
@@ -2249,7 +2249,7 @@
 }
 
 
-static void stun_sendto_timer_cb(su_root_magic_t *magic, 
+static void stun_sendto_timer_cb(su_root_magic_t *magic,
 				 su_timer_t *t,
 				 su_timer_arg_t *arg)
 {
@@ -2269,7 +2269,7 @@
 
   ++req->sr_retry_count;
 
-  /* check if max retry count has been exceeded; or if 
+  /* check if max retry count has been exceeded; or if
    * action type is NAT type check (XXX: the request attributes
    * are not passed correctly to resend function) */
   if (req->sr_retry_count >= sh->sh_max_retries ||
@@ -2283,7 +2283,7 @@
     /* Either the server was dead, address wrong or STUN_UDP_BLOCKED */
     /* sd->sd_nattype = stun_udp_blocked; */
     req->sr_state = stun_req_timeout;
-    
+
     /* If the action is binding request, we are done. If action was
        NAT type determination, process with the state machine. */
     switch (action) {
@@ -2300,11 +2300,11 @@
     case stun_action_test_nattype:
       action_determine_nattype(req, NULL);
       break;
-      
+
     case stun_action_test_lifetime:
       process_test_lifetime(req, NULL);
       break;
-      
+
     case stun_action_keepalive:
       sd->sd_state = stun_discovery_timeout;
 
@@ -2313,7 +2313,7 @@
 	sd->sd_callback(sd->sd_magic, sh, sd, action, sd->sd_state);
 
       stun_keepalive_destroy(sh, sd->sd_socket);
-      
+
       break;
 
     default:
@@ -2338,10 +2338,10 @@
     timeout = req->sr_timeout *= 2;
 
   }
-  
+
   su_timer_set_at(t, stun_sendto_timer_cb, (su_wakeup_arg_t *) req,
 		  su_time_add(su_now(), timeout));
-  
+
   return;
 }
 
@@ -2355,20 +2355,20 @@
  * @return
  * On success, zero is returned.  Upon error, -1 is returned, and @e errno is
  * set appropriately.
- * 
+ *
  * @ERRORS
  * @ERROR EBADF           @a sockfd is not a valid deseriptor.
  * @ERROR EPROTONOSUPPORT @a sockfd is not an UDP socket.
  * @ERROR EINVAL          The socket is already bound to an address.
- * @ERROR EACCESS   	  The address is protected, and the user is not 
+ * @ERROR EACCESS   	  The address is protected, and the user is not
  *                  	  the super-user.
  * @ERROR ENOTSOCK  	  Argument is a descriptor for a file, not a socket.
- * @ERROR EAGAIN          Operation in progress. Application should call 
- *                        stun_bind() again when there is data available on 
+ * @ERROR EAGAIN          Operation in progress. Application should call
+ *                        stun_bind() again when there is data available on
  *                        the socket.
  * @ERROR ETIMEDOUT       Request timed out.
- * 
- */   
+ *
+ */
 static int stun_send_binding_request(stun_request_t *req,
 				     su_sockaddr_t  *srvr_addr)
 {
@@ -2406,9 +2406,9 @@
 			  tag_type_t tag, tag_value_t value, ...)
 {
   int i;
-  stun_attr_t *tmp, **p; 
+  stun_attr_t *tmp, **p;
   int bits = 0;
-  int chg_ip = 0, chg_port = 0; 
+  int chg_ip = 0, chg_port = 0;
 
   ta_list ta;
 
@@ -2422,7 +2422,7 @@
 	  TAG_END());
 
   ta_end(ta);
-  
+
   if (chg_ip)
     bits |= CHG_IP;
   if (chg_port)
@@ -2430,15 +2430,15 @@
 
   if (req)
     req->sr_request_mask = bits;
-  
+
   /* compose header */
   msg->stun_hdr.msg_type = BINDING_REQUEST;
   msg->stun_hdr.msg_len = 0; /* actual len computed by
 				stun_send_message */
   for (i = 0; i < STUN_TID_BYTES; i++) {
     msg->stun_hdr.tran_id[i] = (1 + rand() % RAND_MAX_16);
-  } 
-  
+  }
+
   /* optional attributes:
    * - Response Address
    * - Change Request X
@@ -2463,7 +2463,7 @@
 
   /* USERNAME */
   if (sh->sh_use_msgint &&
-      sh->sh_username.data && 
+      sh->sh_username.data &&
       sh->sh_passwd.data) {
     stun_buffer_t *a_pattr = (stun_buffer_t*)malloc(sizeof(stun_buffer_t));
     tmp = (stun_attr_t *) malloc(sizeof(stun_attr_t));
@@ -2507,7 +2507,7 @@
   /* check message digest if exists */
   switch (msg->stun_hdr.msg_type) {
   case BINDING_RESPONSE:
-    if (stun_process_binding_response(msg) < 0) 
+    if (stun_process_binding_response(msg) < 0)
       return -1;
     break;
   case BINDING_ERROR_RESPONSE:
@@ -2546,7 +2546,7 @@
   }
 
   ec = (stun_attr_errorcode_t *)attr->pattr;
-  
+
   SU_DEBUG_5(("%s: Received Binding Error Response:\n", __func__));
   SU_DEBUG_5(("%s: Error: %d %s\n", __func__, ec->code, ec->phrase));
 
@@ -2554,7 +2554,7 @@
 }
 
 /**
- * Sets values for USERNAME and PASSWORD stun fields 
+ * Sets values for USERNAME and PASSWORD stun fields
  * for the handle.
  */
 int stun_set_uname_pwd(stun_handle_t *sh,
@@ -2572,7 +2572,7 @@
   }
   else
     return -1;
-  
+
   sh->sh_passwd.data = malloc(len_pwd);
   if (sh->sh_passwd.data) {
     memcpy(sh->sh_passwd.data, pwd, len_pwd);
@@ -2582,13 +2582,13 @@
     return -1;
 
   sh->sh_use_msgint = 1; /* turn on message integrity ussage */
-  
+
   return 0;
 }
 
-  
+
 /**
- * Converts character address format to sockaddr_in 
+ * Converts character address format to sockaddr_in
  */
 int stun_atoaddr(su_home_t *home,
 		 int ai_family,
@@ -2608,7 +2608,7 @@
   dstaddr = (su_sockaddr_t *) info->ai_addr;
 
   /* note: works only for IPv4 */
-  if (ai_family != AF_INET) 
+  if (ai_family != AF_INET)
     return -1;
 
   hints->ai_family = ai_family;
@@ -2624,7 +2624,7 @@
     host = tmp;
     ++port;
   }
-    
+
   err = su_getaddrinfo(host, NULL, hints, &res);
   if (err == 0) {
     for (ai = res; ai; ai = ai->ai_next) {
@@ -2637,12 +2637,12 @@
       info->ai_protocol = ai->ai_protocol;
       info->ai_addrlen = ai->ai_addrlen;
       info->ai_canonname = su_strdup(home, host);
-      
+
       memcpy(&dstaddr->su_sa, res->ai_addr, sizeof(struct sockaddr));
       break;
     }
 
-    if (port) 
+    if (port)
       dstaddr->su_port = htons(atoi(port));
     else
       dstaddr->su_port = htons(STUN_DEFAULT_PORT);
@@ -2659,7 +2659,7 @@
 }
 
 /**
- * Initiates STUN discovery process to find out NAT 
+ * Initiates STUN discovery process to find out NAT
  * binding life-time settings.
  *
  * @TAGS
@@ -2693,13 +2693,13 @@
 
   if (!sh->sh_pri_addr[0].su_port) {
     /* no STUN server address, perform a DNS-SRV lookup */
-   
+
     ta_list ta;
     ta_start(ta, tag, value);
     SU_DEBUG_5(("Delaying STUN get-lifetime req. for DNS-SRV query.\n"));
     err = priv_dns_queue_action(sh, stun_action_test_lifetime, sdf, magic, ta_tags(ta));
     ta_end(ta);
-       
+
     return err;
   }
 
@@ -2768,7 +2768,7 @@
 
   SU_DEBUG_1(("%s: determining binding life time, this may take a while.\n", __func__));
 
-  if (stun_make_binding_req(sh, req, req->sr_msg, 0, 0) < 0) 
+  if (stun_make_binding_req(sh, req, req->sr_msg, 0, 0) < 0)
     return -1;
 
   err = stun_send_binding_request(req, destination);
@@ -2794,7 +2794,7 @@
   addr = malloc(sizeof(stun_attr_sockaddr_t));
   memcpy(addr, mapped_addr, sizeof(stun_attr_sockaddr_t));
   tmp->pattr = addr;
-  
+
   if (req->stun_attr == NULL) {
     tmp->next = NULL;
   }
@@ -2808,7 +2808,7 @@
 
 
 /**
- * Determines if the message is STUN message (-1 if not stun). 
+ * Determines if the message is STUN message (-1 if not stun).
  */
 int stun_msg_is_keepalive(uint16_t data)
 {
@@ -2826,7 +2826,7 @@
 }
 
 /**
- * Determines length of STUN message (0 (-1?) if not stun). 
+ * Determines length of STUN message (0 (-1?) if not stun).
  */
 int stun_message_length(void *data, isize_t len, int end_of_message)
 {
@@ -2851,7 +2851,7 @@
 }
 
 /** Process incoming message */
-int stun_process_message(stun_handle_t *sh, su_socket_t s, 
+int stun_process_message(stun_handle_t *sh, su_socket_t s,
 			 su_sockaddr_t *sa, socklen_t salen,
 			 void *data, isize_t len)
 {
@@ -2866,8 +2866,8 @@
   /* Message received. */
   msg.enc_buf.data = data;
   msg.enc_buf.size = (unsigned)len;
- 
-  debug_print(&msg.enc_buf);      
+
+  debug_print(&msg.enc_buf);
 
   /* Parse here the incoming message. */
   if (stun_parse_message(&msg) < 0) {
@@ -2904,8 +2904,8 @@
 }
 
 
-/** 
- * Creates a keepalive dispatcher for bound SIP sockets 
+/**
+ * Creates a keepalive dispatcher for bound SIP sockets
  */
 int stun_keepalive(stun_handle_t *sh,
 		   su_sockaddr_t *sa,
@@ -2937,7 +2937,7 @@
   /* If there already is keepalive associated with the given socket,
    * destroy it. */
   stun_keepalive_destroy(sh, s);
-  
+
   sd = stun_discovery_create(sh, action, NULL, NULL); /* XXX --
 							 specify last
 							 params if
@@ -2948,17 +2948,17 @@
 
   req = stun_request_create(sd);
 
-  SU_DEBUG_3(("%s: Starting to send STUN keepalives to %s:%u\n", __func__, 
+  SU_DEBUG_3(("%s: Starting to send STUN keepalives to %s:%u\n", __func__,
 	      su_inet_ntop(sa->su_family, SU_ADDR(sa), addr, sizeof(addr)),
 	      (unsigned) ntohs(sa->su_port)));
-  
+
   if (stun_make_binding_req(sh, req, req->sr_msg, 0, 0) < 0 ||
       stun_send_binding_request(req, sa) < 0) {
     stun_request_destroy(req);
     stun_discovery_destroy(sd);
     return -1;
   }
-  
+
   sd->sd_timer = su_timer_create(su_root_task(sh->sh_root), timeout);
   su_timer_set(sd->sd_timer, stun_keepalive_timer_cb, (su_wakeup_arg_t *) sd);
 
@@ -2966,7 +2966,7 @@
 }
 
 /** Send SIP keepalives */
-static void stun_keepalive_timer_cb(su_root_magic_t *magic, 
+static void stun_keepalive_timer_cb(su_root_magic_t *magic,
 				    su_timer_t *t,
 				    su_timer_arg_t *arg)
 {
@@ -2984,14 +2984,14 @@
     return;
 
   req = stun_request_create(sd);
-  
+
   if (stun_make_binding_req(sh, req, req->sr_msg, 0, 0) < 0 ||
       stun_send_binding_request(req, destination) < 0) {
     stun_request_destroy(req);
     stun_discovery_destroy(sd);
     return;
   }
-  
+
   sd->sd_timer = su_timer_create(su_root_task(sh->sh_root), timeout);
   su_timer_set(sd->sd_timer, stun_keepalive_timer_cb, (su_wakeup_arg_t *) sd);
 
@@ -3088,9 +3088,9 @@
       break;
 
     default:
-      return -1;    
+      return -1;
     }
-  }   
+  }
 
   tmp = s_attr;
   tmp->attr_type = SOURCE_ADDRESS;
@@ -3115,10 +3115,10 @@
 
   stun_send_message(s, &to_addr, &resp, NULL);
   return 0;
-} 
+}
 
 /**
- * Returns socket attached to the discovery object 
+ * Returns socket attached to the discovery object
  */
 su_socket_t stun_discovery_get_socket(stun_discovery_t *sd)
 {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_common.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_common.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_common.c	Tue Dec 23 07:37:03 2008
@@ -24,13 +24,13 @@
 
 /**@internal
  * @file stun_common.c
- * @brief 
- * 
+ * @brief
+ *
  * @author Tat Chan <Tat.Chan at nokia.com>
  * @author Kai Vehmanen <kai.vehmanen at nokia.com>
- *  
+ *
  * @date Created: Fri Oct  3 13:40:41 2003 ppessi
- * 
+ *
  */
 
 #include "config.h"
@@ -88,7 +88,7 @@
   /* parse header first */
   p = msg->enc_buf.data;
   msg->stun_hdr.msg_type = get16(p, 0);
-  msg->stun_hdr.msg_len = get16(p, 2); 
+  msg->stun_hdr.msg_len = get16(p, 2);
   memcpy(msg->stun_hdr.tran_id, p + 4, STUN_TID_BYTES);
 
   SU_DEBUG_5(("%s: Parse STUN message: Length = %d\n", __func__,
@@ -120,7 +120,7 @@
   attr_type = get16(p, 0);
   len = get16(p, 2);
 
-  SU_DEBUG_5(("%s: received attribute: Type %02X, Length %d - %s\n", 
+  SU_DEBUG_5(("%s: received attribute: Type %02X, Length %d - %s\n",
 	      __func__, attr_type, len, stun_attr_phrase(attr_type)));
 
   if (attr_type > STUN_A_LAST_MANDATORY && attr_type < STUN_A_OPTIONAL) {
@@ -197,8 +197,8 @@
   return len+4;
 }
 
-int stun_parse_attr_address(stun_attr_t *attr, 
-			    const unsigned char *p, 
+int stun_parse_attr_address(stun_attr_t *attr,
+			    const unsigned char *p,
 			    unsigned len)
 {
   su_sockaddr_t *addr;
@@ -398,7 +398,7 @@
   /* note: align the phrase len (see RFC3489:11.2.9) */
   padded = phrase_len + (phrase_len % 4 == 0 ? 0 : 4 - (phrase_len % 4));
 
-  /* note: error-code has four octets of headers plus the 
+  /* note: error-code has four octets of headers plus the
    *       reason field -> len+4 octets */
   if (stun_encode_type_len(attr, (uint16_t)(padded + 4)) < 0) {
     return -1;
@@ -409,7 +409,7 @@
     attr->enc_buf.data[6] = class;
     attr->enc_buf.data[7] = num;
     /* note: 4 octets of TLV header and 4 octets of error-code header */
-    memcpy(attr->enc_buf.data+8, error->phrase, 
+    memcpy(attr->enc_buf.data+8, error->phrase,
 	   phrase_len);
     memset(attr->enc_buf.data + 8 + phrase_len, 0, padded - phrase_len);
   }
@@ -491,8 +491,8 @@
   return 0;
 }
 
-/** 
- * Validate the message integrity based on given 
+/**
+ * Validate the message integrity based on given
  * STUN password 'pwd'. The received content should be
  * in msg->enc_buf.
  */
@@ -506,7 +506,7 @@
   unsigned char *padded_text;
 #endif
 
-  /* password NULL so shared-secret not established and 
+  /* password NULL so shared-secret not established and
      messege integrity checks can be skipped */
   if (pwd->data == NULL)
     return 0;
@@ -610,7 +610,7 @@
 
 
 int stun_send_message(su_socket_t s, su_sockaddr_t *to_addr,
-		      stun_msg_t *msg, stun_buffer_t *pwd) 
+		      stun_msg_t *msg, stun_buffer_t *pwd)
 {
   int err;
   char ipaddr[SU_ADDRSIZE + 2];
@@ -618,7 +618,7 @@
 
   stun_encode_message(msg, pwd);
 
-  err = su_sendto(s, msg->enc_buf.data, msg->enc_buf.size, 0, 
+  err = su_sendto(s, msg->enc_buf.data, msg->enc_buf.size, 0,
 		  to_addr, SU_SOCKADDR_SIZE(to_addr));
 
   free(msg->enc_buf.data), msg->enc_buf.data = NULL;
@@ -648,9 +648,9 @@
   }
   else
     STUN_ERROR(errno, sendto);
-  
+
   return err;
-}  
+}
 
 
 /** Send a STUN message.
@@ -673,7 +673,7 @@
       case MAPPED_ADDRESS:
       case SOURCE_ADDRESS:
       case CHANGED_ADDRESS:
-      case REFLECTED_FROM:	
+      case REFLECTED_FROM:
 #ifdef USE_TURN
       case TURN_ALTERNATE_SERVER:
       case TURN_DESTINATION_ADDRESS:
@@ -717,7 +717,7 @@
     msg->stun_hdr.msg_len = len;
     buf_len = 20 + msg->stun_hdr.msg_len;
     buf = (unsigned char *) malloc(buf_len);
-    
+
     /* convert to binary format for transmission */
     set16(buf, 0, msg->stun_hdr.msg_type);
     set16(buf, 2, msg->stun_hdr.msg_len);
@@ -730,7 +730,7 @@
     while(attr) {
       /* attach only if enc_buf is not null */
       if(attr->enc_buf.data && attr->attr_type != MESSAGE_INTEGRITY) {
-	memcpy(buf+len, (void *)attr->enc_buf.data, attr->enc_buf.size); 
+	memcpy(buf+len, (void *)attr->enc_buf.data, attr->enc_buf.size);
 	len += attr->enc_buf.size;
       }
       attr = attr->next;
@@ -742,10 +742,10 @@
 	free(buf);
 	return -1;
       }
-      memcpy(buf+len, (void *)msg_int->enc_buf.data, 
+      memcpy(buf+len, (void *)msg_int->enc_buf.data,
 	     msg_int->enc_buf.size);
     }
-    
+
     /* save binary buffer for future reference */
     if (msg->enc_buf.data)
       free(msg->enc_buf.data);
@@ -782,10 +782,10 @@
   sa = &temp->su_sin;
 
   address_size = strlen(inet_ntoa(sa->sin_addr));
-  
+
   local_ip_address = malloc(address_size + 1);
   strcpy(local_ip_address, (char *) inet_ntoa(sa->sin_addr)); /* otherwise? */
-    
+
   su_freelocalinfo(li);
 
   return local_ip_address;
@@ -807,7 +807,7 @@
   case UNKNOWN_ATTRIBUTES: return "UNKNOWN-ATTRIBUTES";
   case REFLECTED_FROM: return "REFLECTED-FROM";
   case STUN_A_ALTERNATE_SERVER:
-  case STUN_A_ALTERNATE_SERVER_DEP: 
+  case STUN_A_ALTERNATE_SERVER_DEP:
     return "ALTERNATE-SERVER";
   case STUN_A_REALM: return "REALM";
   case STUN_A_NONCE: return "NONCE";

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c	Tue Dec 23 07:37:03 2008
@@ -23,13 +23,13 @@
  */
 
 /**@internal
- * @file stun_dns.c 
+ * @file stun_dns.c
  * @brief Functins to discover STUN server address using DNS-SRV.
  *
- * Refs: 
+ * Refs:
  *   - RFC3489/3489bis
  *   - RFC2782
- * 
+ *
  * @author Kai Vehmanen <kai.vehmanen at nokia.com>
  */
 
@@ -100,16 +100,16 @@
 	self->stun_tcp_target = su_strdup(self->stun_home, rr->srv_target);
 	self->stun_tcp_port = rr->srv_port;
 	self->stun_state |= stun_dns_tls;
-	SU_DEBUG_5(("%s: stun (tcp) for domain %s is at %s:%u.\n", 
-		    __func__, rr->srv_record->r_name, self->stun_tcp_target, self->stun_tcp_port)); 
+	SU_DEBUG_5(("%s: stun (tcp) for domain %s is at %s:%u.\n",
+		    __func__, rr->srv_record->r_name, self->stun_tcp_target, self->stun_tcp_port));
       }
       else if ((self->stun_state & stun_dns_udp) == 0 &&
 	       strncmp(rr->srv_record->r_name, udp_name, strlen(udp_name)) == 0) {
 	self->stun_udp_target = su_strdup(self->stun_home, rr->srv_target);
 	self->stun_udp_port = rr->srv_port;
 	self->stun_state |= stun_dns_udp;
-	SU_DEBUG_5(("%s: stun (udp) for domain %s is at %s:%u.\n", 
-		    __func__, rr->srv_record->r_name, self->stun_udp_target, self->stun_udp_port)); 
+	SU_DEBUG_5(("%s: stun (udp) for domain %s is at %s:%u.\n",
+		    __func__, rr->srv_record->r_name, self->stun_udp_target, self->stun_udp_port));
       }
     }
   }
@@ -130,18 +130,18 @@
  * The result will be delivered asynchronously in the
  * 'func' callback. 'root' will be used as the event loop.
  */
-stun_dns_lookup_t *stun_dns_lookup(stun_magic_t *magic, 
+stun_dns_lookup_t *stun_dns_lookup(stun_magic_t *magic,
 				   su_root_t *root,
-				   stun_dns_lookup_f func, 
+				   stun_dns_lookup_f func,
 				   const char *domain)
 {
   stun_dns_lookup_t *self;
   sres_query_t *query;
 
-  if (!domain || 
+  if (!domain ||
       strlen(domain) + strlen(STUN_SRV_SERVICE_UDP ".") + 1>= SRES_MAXDNAME)
     return NULL;
-  
+
   self = su_home_new(sizeof(stun_dns_lookup_t));
 
   /* see nta.c:outgoing_answer_srv() */
@@ -167,7 +167,7 @@
   else {
     su_free(NULL, self), self = NULL;
   }
-  
+
   return self;
 }
 
@@ -192,7 +192,7 @@
  * @param port location where to store port number
  *
  * @return 0 on success, non-zero otherwise
- */ 
+ */
 int stun_dns_lookup_udp_addr(stun_dns_lookup_t *self, const char **target, uint16_t *port)
 {
   int result = -1;
@@ -215,7 +215,7 @@
  * @param port location where to store port number
  *
  * @return 0 on success, non-zero otherwise
- */ 
+ */
 int stun_dns_lookup_tcp_addr(stun_dns_lookup_t *self, const char **target, uint16_t *port)
 {
   int result = -1;
@@ -238,7 +238,7 @@
  * @param port location where to store port number
  *
  * @return 0 on success, non-zero otherwise
- */ 
+ */
 int stun_dns_lookup_stp_addr(stun_dns_lookup_t *self, const char **target, uint16_t *port)
 {
   /* XXX: not implemented */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_internal.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_internal.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_internal.h	Tue Dec 23 07:37:03 2008
@@ -99,7 +99,7 @@
 		      stun_msg_t *msg, stun_buffer_t *pwd);
 
 int stun_make_binding_req(stun_handle_t *se, stun_request_t *req,
-			  stun_msg_t *msg, 
+			  stun_msg_t *msg,
 			  tag_type_t, tag_value_t, ...);
 int stun_process_response(stun_msg_t *msg);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_mini.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_mini.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_mini.c	Tue Dec 23 07:37:03 2008
@@ -24,14 +24,14 @@
 
 /**@internal
  * @file stun_mini.c
- * @brief Minimal stun server 
- * 
+ * @brief Minimal stun server
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Tat Chan <Tat.Chan at nokia.com>
  * @author Kai Vehmanen <kai.vehmanen at nokia.com>
- *  
+ *
  * @date Created: Fri Oct  3 13:40:41 2003 ppessi
- * 
+ *
  */
 
 #include "config.h"
@@ -62,11 +62,11 @@
   stun_bound_t *sockets;
 };
 
-static int process_3489_request(stun_mini_t *mini, 
+static int process_3489_request(stun_mini_t *mini,
 				stun_msg_t *request, stun_msg_t *response,
 				su_socket_t socket, void *, socklen_t);
 
-static int process_bis_request(stun_mini_t *mini, 
+static int process_bis_request(stun_mini_t *mini,
 			       stun_msg_t *request, stun_msg_t *response,
 			       su_socket_t socket, void *, socklen_t);
 
@@ -118,12 +118,12 @@
     return su_seterrno(EAFNOSUPPORT);
 
   ss = calloc(1, offsetof(stun_bound_t, ss_addr.array[addrlen]));
-  
+
   ss->ss_socket = socket;
   ss->ss_scope = su_sockaddr_scope((void *)addr, addrlen);
 
   memcpy(ss->ss_addr.array, addr, ss->ss_addrlen = addrlen);
-  
+
   *next = ss;
 
   return 0;
@@ -168,7 +168,7 @@
 
   if (mini == NULL || msg == NULL || from == NULL)
     return;
-    
+
   if (msglen < 20)
     verdict = "runt";
   else if (data[0] == 1)
@@ -218,7 +218,7 @@
 			 stun_msg_t *request,
 			 stun_msg_t *response,
 			 su_socket_t socket,
-			 void *from, 
+			 void *from,
 			 socklen_t fromlen)
 {
   stun_bound_t *ss, *changed = NULL, ss0[1];
@@ -239,12 +239,12 @@
   a = stun_get_attr(request->stun_attr, RESPONSE_ADDRESS);
   if (a)
     return STUN_600_GLOBAL_FAILURE;
- 
+
   /* compose header */
   response->stun_hdr.msg_type = BINDING_RESPONSE;
-  memcpy(response->stun_hdr.tran_id, request->stun_hdr.tran_id, 
+  memcpy(response->stun_hdr.tran_id, request->stun_hdr.tran_id,
 	 sizeof response->stun_hdr.tran_id);
-  
+
   next = &response->stun_attr;
 
   /* MAPPED-ADDRESS */
@@ -265,7 +265,7 @@
     struct sockaddr_in const *sin, *sin2;
     int scope = su_sockaddr_scope(from, fromlen);
     stun_bound_t *changed_ip = NULL, *same_scope = NULL;
-    
+
     sin = from;
 
     for (changed = mini->sockets; changed; changed = changed->ss_next) {
@@ -296,7 +296,7 @@
       /* We don't have socekt with both changed port and ip */
       changed = changed_ip;
 
-    if (changed == NULL) 
+    if (changed == NULL)
       changed = same_scope;
   }
 
@@ -337,11 +337,11 @@
   stun_send_message(socket, (void *)from, response, NULL);
 
   return 0;
-} 
+}
 
-static int process_bis_request(stun_mini_t *mini, 
+static int process_bis_request(stun_mini_t *mini,
 			       stun_msg_t *request, stun_msg_t *response,
-			       su_socket_t socket, 
+			       su_socket_t socket,
 			       void *from, socklen_t fromlen)
 {
   return process_3489_request(mini, request, response, socket, from, fromlen);
@@ -365,7 +365,7 @@
 
   response->stun_hdr.msg_type = BINDING_ERROR_RESPONSE;
   response->stun_hdr.msg_len = 0; /* actual len computed later */
-  
+
   memcpy(response->stun_hdr.tran_id, transaction_id, 16);
 
   /* ERROR-CODE */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stun_tag.c	Tue Dec 23 07:37:03 2008
@@ -39,13 +39,13 @@
 #include <sofia-sip/stun_tag.h>
 
 /**@def STUNTAG_ANY()
- * 
+ *
  * Filter tag matching any STUNTAG_*().
  */
 tag_typedef_t stuntag_any = NSTAG_TYPEDEF(*);
 
 /**@def STUNTAG_DOMAIN(x)
- * 
+ *
  * The domain to use in DNS-SRV based STUN server discovery.
  * Note: this is commonly the domain part of a public SIP
  * address (AOR). See sect 9.1 of RFC3489.
@@ -64,9 +64,9 @@
 
 /**@def STUNTAG_SERVER(x)
  *
- * Fully qualified host name, or dotted IP address of the STUN server 
+ * Fully qualified host name, or dotted IP address of the STUN server
  * address. If defined, the DNS-SRV based discovery (@see STUNTAG_DOMAIN())
- * will be skipped. 
+ * will be skipped.
  *
  * @par Used with
  *    nua_set_params() \n
@@ -86,9 +86,9 @@
 tag_typedef_t stuntag_server = STRTAG_TYPEDEF(server);
 
 /**@def STUNTAG_REQUIRE_INTEGRITY(x)
- *  
+ *
  * Whether to require support for shared-secret based packet
- * authentication and integrity checks (see sect 9.2 of RFC3489). 
+ * authentication and integrity checks (see sect 9.2 of RFC3489).
  * If false, integrity checks are performed only when server supports it.
  *
  * @par Used with
@@ -113,7 +113,7 @@
 tag_typedef_t stuntag_integrity = BOOLTAG_TYPEDEF(integrity);
 
 /**@def STUNTAG_SOCKET(x)
- *  
+ *
  * Bind socket for STUN.
  *
  * @par Used with
@@ -130,7 +130,7 @@
 tag_typedef_t stuntag_socket = SOCKETTAG_TYPEDEF(socket);
 
 /**@def STUNTAG_REGISTER_EVENTS(x)
- *  
+ *
  * Register socket events for eventloop owned by STUN.
  *
  * @par Used with
@@ -150,7 +150,7 @@
 tag_typedef_t stuntag_register_events = BOOLTAG_TYPEDEF(register_events);
 
 /**@def STUNTAG_ACTION(x)
- *  
+ *
  * Command action for STUN request.
  *
  * @par Used with
@@ -169,7 +169,7 @@
 /* ---------------------------------------------------------------------- */
 
 /**@def STUNTAG_CHANGE_IP(x)
- *  
+ *
  * Add CHANGE-REQUEST attribute with "change IP" flag to the request.
  *
  * @par Used with
@@ -183,7 +183,7 @@
 tag_typedef_t stuntag_change_ip = BOOLTAG_TYPEDEF(change_ip);
 
 /**@def STUNTAG_CHANGE_PORT(x)
- *  
+ *
  * Add CHANGE-REQUEST attribute with "change port" flag to the request.
  *
  * @par Used with
@@ -199,7 +199,7 @@
 /* ---------------------------------------------------------------------- */
 
 /**@def STUNTAG_TIMEOUT(x)
- *  
+ *
  * Timeout controls the launching of the STUN keepalive timer.
  *
  * @par Used with

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stunc.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stunc.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/stun/stunc.c	Tue Dec 23 07:37:03 2008
@@ -24,22 +24,22 @@
 
 /**
  * STUN test client
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Martti Mela <Martti.Mela at nokia.com>
  * @author Kai Vehmanen <Kai.Vehmanen at nokia.com>
- * 
+ *
  * @date Created: Thu Jul 24 17:21:00 2003 ppessi
  */
 
 /**@page stunc STUN test client.
- * 
+ *
  * @section stunc_synopsis Synopsis
  * <tt>stunc [OPTIONS] \<stun-server-address\></tt>
  *
  * @section stunc_description Description
  * The @em stunc utility can be used to gather information about possible
- * NAT devices that are located between the client and STUN server. 
+ * NAT devices that are located between the client and STUN server.
  *
  * @em stunc can provide the following information: the IP address and
  * port as seen by the STUN server, detecting presence of NATs, and
@@ -78,7 +78,7 @@
  *
  * <dt>-s</dt>
  * <dd>Request a shared-secret over TLS. Tests whether the STUN server
- * supports the shared-secret mechanism (needed to protect message 
+ * supports the shared-secret mechanism (needed to protect message
  * integrity). Can be combined with @em -b, @em -l and @em -n.
  * </dd>
  *
@@ -99,7 +99,7 @@
  *
  * @section stunc_environment Environment
  * #STUN_DEBUG
- * 
+ *
  * @section stunc_bugs Reporting Bugs
  * Report bugs to <sofia-sip-devel at lists.sourceforge.net>.
  *
@@ -116,7 +116,7 @@
  * PARTICULAR PURPOSE.
  */
 
-#include "config.h" 
+#include "config.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -156,7 +156,7 @@
 
 void usage(char *name)
 {
-  fprintf(stderr, 
+  fprintf(stderr,
 	  "stunc (%s)\n"
 	  "usage: %s <server> [-b] [-n] [-l] [-r] [-s]\n"
 	  "  -b\tmake a binding request\n"
@@ -216,14 +216,14 @@
 		      STUNTAG_SOCKET(stunc->sc_socket),
 		      STUNTAG_REGISTER_EVENTS(1),
 		      TAG_NULL());
-    
+
       if (err < 0) {
 	SU_DEBUG_0(("%s: %s  failed\n", __func__, "stun_handle_bind()"));
 	su_root_break(stun_root(sh));
       }
     }
     break;
-    
+
   case stun_tls_connection_failed:
     SU_DEBUG_0(("%s: Obtaining shared secret failed.\n",
 		__func__));
@@ -269,7 +269,7 @@
   case stun_discovery_done:
     addrlen = sizeof(*sa);
     memset(sa, 0, addrlen);
-    
+
     if (stun_discovery_get_address(sd, sa, &addrlen) < 0) {
       SU_DEBUG_0(("%s: stun_discovery_get_address() failed", __func__));
       return;
@@ -313,7 +313,7 @@
     break;
 
   case stun_discovery_done:
-    SU_DEBUG_3(("%s: NAT type determined to be '%s' (%d).\n", 
+    SU_DEBUG_3(("%s: NAT type determined to be '%s' (%d).\n",
 		__func__, stun_nattype_str(sd), (int)stun_nattype(sd)));
     break;
 
@@ -361,12 +361,12 @@
 int main(int argc, char *argv[])
 {
   int err = 0, i, sflags = 0;
-  stunc_t stunc[1]; 
+  stunc_t stunc[1];
   su_root_t *root;
   stun_handle_t *sh;
   su_socket_t s;
 
-  if (su_init() != 0) 
+  if (su_init() != 0)
     return -1;
 
   root = su_root_create(stunc);
@@ -393,16 +393,16 @@
 
   /* Running this test requires a local STUN server on default port */
   sh = stun_handle_init(root,
-			STUNTAG_SERVER(argv[1]), 
+			STUNTAG_SERVER(argv[1]),
 			STUNTAG_REQUIRE_INTEGRITY(sflags & do_secret),
-			TAG_NULL()); 
+			TAG_NULL());
 
   if (!sh) {
     SU_DEBUG_0(("%s: %s failed\n", __func__, "stun_handle_init()"));
     return -1;
   }
 
-  s = su_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); 
+  s = su_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
   if (s == -1) {
     SU_DEBUG_0(("%s: %s  failed: %s\n", __func__,
 		"su_socket()", su_gli_strerror(errno)));
@@ -424,7 +424,7 @@
     sockaddr.su_family = AF_INET;
 
     SU_DEBUG_3(("stunc: Binding to local port %u.\n", ntohs(sockaddr.su_port)));
-  
+
     err = bind(s, (struct sockaddr *)&sockaddr, socklen);
     if (err < 0) {
       SU_DEBUG_1(("%s: Error %d binding to %s:%u\n", __func__, err,
@@ -452,7 +452,7 @@
 		    STUNTAG_SOCKET(s),
 		    STUNTAG_REGISTER_EVENTS(1),
 		    TAG_NULL());
-    
+
     if (err < 0) {
       SU_DEBUG_0(("%s: %s  failed\n", __func__, "stun_bind()"));
       return -1;
@@ -464,7 +464,7 @@
 			    STUNTAG_REGISTER_EVENTS(1),
 			    STUNTAG_SOCKET(stunc->sc_socket),
 			    TAG_NULL());
-    
+
     if (err < 0) {
       SU_DEBUG_0(("%s: %s  failed\n", __func__, "stun_test_nattype()"));
       su_root_break(stun_root(sh));
@@ -476,13 +476,13 @@
 			     STUNTAG_REGISTER_EVENTS(1),
 			     STUNTAG_SOCKET(stunc->sc_socket),
 			     TAG_NULL());
-    
+
     if (err < 0) {
       SU_DEBUG_0(("%s: %s  failed\n", __func__, "stun_test_lifetime()"));
       su_root_break(stun_root(sh));
     }
   }
- 
+
   if (err == 0)
     su_root_run(root);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -93,7 +93,7 @@
 
 2005-08-17  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
-	* Added su_strlst_dup() and su_strlst_copy(). 
+	* Added su_strlst_dup() and su_strlst_copy().
 
 	* Added { to BEGIN() and } to END() in <tstdef.h>
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -14,7 +14,7 @@
 
 noinst_LTLIBRARIES = 	libsu.la
 
-bin_PROGRAMS = 		addrinfo localinfo 
+bin_PROGRAMS = 		addrinfo localinfo
 
 check_PROGRAMS = 	torture_su torture_su_port \
 			torture_su_alloc torture_su_time torture_su_tag \

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/addrinfo.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/addrinfo.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/addrinfo.c	Tue Dec 23 07:37:03 2008
@@ -23,13 +23,13 @@
  */
 
 /**@page addrinfo Resolve network services
- * 
+ *
  * @section synopsis Synopsis
  *
  * <tt>addrinfo [-pcn46] service-name host</tt>
  *
  * @section description Description
- * 
+ *
  * The @em addrinfo utility will use su_getaddrinfo() to resolve the network
  * services and print resolved names. See sect 6.1 of RFC3493 and the getaddrinfo(3)
  * manual page of POSIX 1003.1g, for more information.
@@ -84,7 +84,7 @@
 int getopt(int argc, char * const argv[], char const *opstring);
 extern int optind;
 
-void usage(void)
+static void usage(void)
 {
   fputs(help, stderr);
   exit(1);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/foo.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/foo.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/foo.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@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.
  *
@@ -60,7 +60,7 @@
   size_t next;
 
   s->p >>= 1;
-  
+
   next = s->b + s->c + 1, s->c = s->b, s->b = next;
 
   return next;
@@ -87,8 +87,8 @@
     return "0";
 
   binary[64] = 0;
-  
-  for (i = 64; p; p >>= 1) 
+
+  for (i = 64; p; p >>= 1)
     binary[--i] = "01"[p & 1];
 
   return binary + i;
@@ -107,7 +107,7 @@
  * @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;
 
@@ -115,7 +115,7 @@
       r2 = r - 1;
       stretch_down(&s, 0);
     }
- 
+
     if (array->less(array->m, r2, r))
       break;
 
@@ -125,8 +125,8 @@
 
     stretch_down(&s, 0);
   }
-} 
- 
+}
+
 /** Trinkle the roots of the given stretches
  *
  * @param array   description of array to sort
@@ -160,12 +160,12 @@
     }
 
     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;
@@ -175,9 +175,9 @@
     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; 
+    break;
   }
- 
+
   sift(array, r, s);
 }
 
@@ -198,7 +198,7 @@
     array->swap(array->m, r, r1);
     trinkle(array, r1, s);
   }
-} 
+}
 
 /** Sort array using smoothsort.
  *
@@ -251,10 +251,10 @@
     DEBUG(("loop1 q=%zu: b=%u p=%s\n", q, s.b, binary(s.p)));
 
     if (s.b <= 1) {
-      while ((s.p & 1) == 0) 
+      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);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/getopt.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/getopt.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/getopt.c	Tue Dec 23 07:37:03 2008
@@ -1,177 +1,177 @@
-/***************************************************************************** 
- * 
- *  MODULE NAME : GETOPT.C 
- * 
- *  COPYRIGHTS: 
- *             This module contains code made available by IBM 
- *             Corporation on an AS IS basis.  Any one receiving the 
- *             module is considered to be licensed under IBM copyrights 
- *             to use the IBM-provided source code in any way he or she 
- *             deems fit, including copying it, compiling it, modifying 
- *             it, and redistributing it, with or without 
- *             modifications.  No license under any IBM patents or 
- *             patent applications is to be implied from this copyright 
- *             license. 
- * 
- *             A user of the module should understand that IBM cannot 
- *             provide technical support for the module and will not be 
- *             responsible for any consequences of use of the program. 
- * 
- *             Any notices, including this one, are not to be removed 
- *             from the module without the prior written consent of 
- *             IBM. 
- * 
- *  AUTHOR:   Original author: 
- *                 G. R. Blair (BOBBLAIR at AUSVM1) 
- *                 Internet: bobblair at bobblair.austin.ibm.com 
- * 
- *            Extensively revised by: 
- *                 John Q. Walker II, Ph.D. (JOHHQ at RALVM6) 
- *                 Internet: johnq at ralvm6.vnet.ibm.com 
- * 
- *****************************************************************************/ 
- 
-/****************************************************************************** 
- * getopt() 
- * 
- * The getopt() function is a command line parser.  It returns the next 
- * option character in argv that matches an option character in opstring. 
- * 
- * The argv argument points to an array of argc+1 elements containing argc 
- * pointers to character strings followed by a null pointer. 
- * 
- * The opstring argument points to a string of option characters; if an 
- * option character is followed by a colon, the option is expected to have 
- * an argument that may or may not be separated from it by white space. 
- * The external variable optarg is set to point to the start of the option 
- * argument on return from getopt(). 
- * 
- * The getopt() function places in optind the argv index of the next argument 
- * to be processed.  The system initializes the external variable optind to 
- * 1 before the first call to getopt(). 
- * 
- * When all options have been processed (that is, up to the first nonoption 
- * argument), getopt() returns EOF.  The special option "--" may be used to 
- * delimit the end of the options; EOF will be returned, and "--" will be 
- * skipped. 
- * 
- * The getopt() function returns a question mark (?) when it encounters an 
- * option character not included in opstring.  This error message can be 
- * disabled by setting opterr to zero.  Otherwise, it returns the option 
- * character that was detected. 
- * 
- * If the special option "--" is detected, or all options have been 
- * processed, EOF is returned. 
- * 
- * Options are marked by either a minus sign (-) or a slash (/). 
- * 
- * No errors are defined. 
- *****************************************************************************/ 
- 
-#include <stdio.h>                  /* for EOF */ 
-#include <string.h>                 /* for strchr() */ 
- 
- 
-/* static (global) variables that are specified as exported by getopt() */ 
-char *optarg = NULL;    /* pointer to the start of the option argument  */ 
-int   optind = 1;       /* number of the next argv[] to be evaluated    */ 
-int   opterr = 1;       /* non-zero if a question mark should be returned 
-                           when a non-valid option character is detected */ 
- 
-/* handle possible future character set concerns by putting this in a macro */ 
-#define _next_char(string)  (char)(*(string+1)) 
- 
-int getopt(int argc, char *argv[], char *opstring) 
-{ 
-    static char *pIndexPosition = NULL; /* place inside current argv string */ 
-    char *pArgString = NULL;        /* where to start from next */ 
-    char *pOptString;               /* the string in our program */ 
- 
- 
-    if (pIndexPosition != NULL) { 
-        /* we last left off inside an argv string */ 
-        if (*(++pIndexPosition)) { 
-            /* there is more to come in the most recent argv */ 
-            pArgString = pIndexPosition; 
-        } 
-    } 
- 
-    if (pArgString == NULL) { 
-        /* we didn't leave off in the middle of an argv string */ 
-        if (optind >= argc) { 
-            /* more command-line arguments than the argument count */ 
-            pIndexPosition = NULL;  /* not in the middle of anything */ 
-            return EOF;             /* used up all command-line arguments */ 
-        } 
- 
-        /*--------------------------------------------------------------------- 
-         * If the next argv[] is not an option, there can be no more options. 
-         *-------------------------------------------------------------------*/ 
-        pArgString = argv[optind++]; /* set this to the next argument ptr */ 
- 
-        if (('/' != *pArgString) && /* doesn't start with a slash or a dash? */ 
-            ('-' != *pArgString)) { 
-            --optind;               /* point to current arg once we're done */ 
-            optarg = NULL;          /* no argument follows the option */ 
-            pIndexPosition = NULL;  /* not in the middle of anything */ 
-            return EOF;             /* used up all the command-line flags */ 
-        } 
- 
-        /* check for special end-of-flags markers */ 
-        if ((strcmp(pArgString, "-") == 0) || 
-            (strcmp(pArgString, "--") == 0)) { 
-            optarg = NULL;          /* no argument follows the option */ 
-            pIndexPosition = NULL;  /* not in the middle of anything */ 
-            return EOF;             /* encountered the special flag */ 
-        } 
- 
-        pArgString++;               /* look past the / or - */ 
-    } 
- 
-    if (':' == *pArgString) {       /* is it a colon? */ 
-        /*--------------------------------------------------------------------- 
-         * Rare case: if opterr is non-zero, return a question mark; 
-         * otherwise, just return the colon we're on. 
-         *-------------------------------------------------------------------*/ 
-        return (opterr ? (int)'?' : (int)':'); 
-    } 
-    else if ((pOptString = strchr(opstring, *pArgString)) == 0) { 
-        /*--------------------------------------------------------------------- 
-         * The letter on the command-line wasn't any good. 
-         *-------------------------------------------------------------------*/ 
-        optarg = NULL;              /* no argument follows the option */ 
-        pIndexPosition = NULL;      /* not in the middle of anything */ 
-        return (opterr ? (int)'?' : (int)*pArgString); 
-    } 
-    else { 
-        /*--------------------------------------------------------------------- 
-         * The letter on the command-line matches one we expect to see 
-         *-------------------------------------------------------------------*/ 
-        if (':' == _next_char(pOptString)) { /* is the next letter a colon? */ 
-            /* It is a colon.  Look for an argument string. */ 
-            if ('\0' != _next_char(pArgString)) {  /* argument in this argv? */ 
-                optarg = &pArgString[1];   /* Yes, it is */ 
-            } 
-            else { 
-                /*------------------------------------------------------------- 
-                 * The argument string must be in the next argv. 
-                 * But, what if there is none (bad input from the user)? 
-                 * In that case, return the letter, and optarg as NULL. 
-                 *-----------------------------------------------------------*/ 
-                if (optind < argc) 
-                    optarg = argv[optind++]; 
-                else { 
-                    optarg = NULL; 
-                    return (opterr ? (int)'?' : (int)*pArgString); 
-                } 
-            } 
-            pIndexPosition = NULL;  /* not in the middle of anything */ 
-        } 
-        else { 
-            /* it's not a colon, so just return the letter */ 
-            optarg = NULL;          /* no argument follows the option */ 
-            pIndexPosition = pArgString;    /* point to the letter we're on */ 
-        } 
-        return (int)*pArgString;    /* return the letter that matched */ 
-    } 
+/*****************************************************************************
+ *
+ *  MODULE NAME : GETOPT.C
+ *
+ *  COPYRIGHTS:
+ *             This module contains code made available by IBM
+ *             Corporation on an AS IS basis.  Any one receiving the
+ *             module is considered to be licensed under IBM copyrights
+ *             to use the IBM-provided source code in any way he or she
+ *             deems fit, including copying it, compiling it, modifying
+ *             it, and redistributing it, with or without
+ *             modifications.  No license under any IBM patents or
+ *             patent applications is to be implied from this copyright
+ *             license.
+ *
+ *             A user of the module should understand that IBM cannot
+ *             provide technical support for the module and will not be
+ *             responsible for any consequences of use of the program.
+ *
+ *             Any notices, including this one, are not to be removed
+ *             from the module without the prior written consent of
+ *             IBM.
+ *
+ *  AUTHOR:   Original author:
+ *                 G. R. Blair (BOBBLAIR at AUSVM1)
+ *                 Internet: bobblair at bobblair.austin.ibm.com
+ *
+ *            Extensively revised by:
+ *                 John Q. Walker II, Ph.D. (JOHHQ at RALVM6)
+ *                 Internet: johnq at ralvm6.vnet.ibm.com
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ * getopt()
+ *
+ * The getopt() function is a command line parser.  It returns the next
+ * option character in argv that matches an option character in opstring.
+ *
+ * The argv argument points to an array of argc+1 elements containing argc
+ * pointers to character strings followed by a null pointer.
+ *
+ * The opstring argument points to a string of option characters; if an
+ * option character is followed by a colon, the option is expected to have
+ * an argument that may or may not be separated from it by white space.
+ * The external variable optarg is set to point to the start of the option
+ * argument on return from getopt().
+ *
+ * The getopt() function places in optind the argv index of the next argument
+ * to be processed.  The system initializes the external variable optind to
+ * 1 before the first call to getopt().
+ *
+ * When all options have been processed (that is, up to the first nonoption
+ * argument), getopt() returns EOF.  The special option "--" may be used to
+ * delimit the end of the options; EOF will be returned, and "--" will be
+ * skipped.
+ *
+ * The getopt() function returns a question mark (?) when it encounters an
+ * option character not included in opstring.  This error message can be
+ * disabled by setting opterr to zero.  Otherwise, it returns the option
+ * character that was detected.
+ *
+ * If the special option "--" is detected, or all options have been
+ * processed, EOF is returned.
+ *
+ * Options are marked by either a minus sign (-) or a slash (/).
+ *
+ * No errors are defined.
+ *****************************************************************************/
+
+#include <stdio.h>                  /* for EOF */
+#include <string.h>                 /* for strchr() */
+
+
+/* static (global) variables that are specified as exported by getopt() */
+char *optarg = NULL;    /* pointer to the start of the option argument  */
+int   optind = 1;       /* number of the next argv[] to be evaluated    */
+int   opterr = 1;       /* non-zero if a question mark should be returned
+                           when a non-valid option character is detected */
+
+/* handle possible future character set concerns by putting this in a macro */
+#define _next_char(string)  (char)(*(string+1))
+
+int getopt(int argc, char *argv[], char *opstring)
+{
+    static char *pIndexPosition = NULL; /* place inside current argv string */
+    char *pArgString = NULL;        /* where to start from next */
+    char *pOptString;               /* the string in our program */
+
+
+    if (pIndexPosition != NULL) {
+        /* we last left off inside an argv string */
+        if (*(++pIndexPosition)) {
+            /* there is more to come in the most recent argv */
+            pArgString = pIndexPosition;
+        }
+    }
+
+    if (pArgString == NULL) {
+        /* we didn't leave off in the middle of an argv string */
+        if (optind >= argc) {
+            /* more command-line arguments than the argument count */
+            pIndexPosition = NULL;  /* not in the middle of anything */
+            return EOF;             /* used up all command-line arguments */
+        }
+
+        /*---------------------------------------------------------------------
+         * If the next argv[] is not an option, there can be no more options.
+         *-------------------------------------------------------------------*/
+        pArgString = argv[optind++]; /* set this to the next argument ptr */
+
+        if (('/' != *pArgString) && /* doesn't start with a slash or a dash? */
+            ('-' != *pArgString)) {
+            --optind;               /* point to current arg once we're done */
+            optarg = NULL;          /* no argument follows the option */
+            pIndexPosition = NULL;  /* not in the middle of anything */
+            return EOF;             /* used up all the command-line flags */
+        }
+
+        /* check for special end-of-flags markers */
+        if ((strcmp(pArgString, "-") == 0) ||
+            (strcmp(pArgString, "--") == 0)) {
+            optarg = NULL;          /* no argument follows the option */
+            pIndexPosition = NULL;  /* not in the middle of anything */
+            return EOF;             /* encountered the special flag */
+        }
+
+        pArgString++;               /* look past the / or - */
+    }
+
+    if (':' == *pArgString) {       /* is it a colon? */
+        /*---------------------------------------------------------------------
+         * Rare case: if opterr is non-zero, return a question mark;
+         * otherwise, just return the colon we're on.
+         *-------------------------------------------------------------------*/
+        return (opterr ? (int)'?' : (int)':');
+    }
+    else if ((pOptString = strchr(opstring, *pArgString)) == 0) {
+        /*---------------------------------------------------------------------
+         * The letter on the command-line wasn't any good.
+         *-------------------------------------------------------------------*/
+        optarg = NULL;              /* no argument follows the option */
+        pIndexPosition = NULL;      /* not in the middle of anything */
+        return (opterr ? (int)'?' : (int)*pArgString);
+    }
+    else {
+        /*---------------------------------------------------------------------
+         * The letter on the command-line matches one we expect to see
+         *-------------------------------------------------------------------*/
+        if (':' == _next_char(pOptString)) { /* is the next letter a colon? */
+            /* It is a colon.  Look for an argument string. */
+            if ('\0' != _next_char(pArgString)) {  /* argument in this argv? */
+                optarg = &pArgString[1];   /* Yes, it is */
+            }
+            else {
+                /*-------------------------------------------------------------
+                 * The argument string must be in the next argv.
+                 * But, what if there is none (bad input from the user)?
+                 * In that case, return the letter, and optarg as NULL.
+                 *-----------------------------------------------------------*/
+                if (optind < argc)
+                    optarg = argv[optind++];
+                else {
+                    optarg = NULL;
+                    return (opterr ? (int)'?' : (int)*pArgString);
+                }
+            }
+            pIndexPosition = NULL;  /* not in the middle of anything */
+        }
+        else {
+            /* it's not a colon, so just return the letter */
+            optarg = NULL;          /* no argument follows the option */
+            pIndexPosition = pArgString;    /* point to the letter we're on */
+        }
+        return (int)*pArgString;    /* return the letter that matched */
+    }
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/localinfo.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/localinfo.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/localinfo.c	Tue Dec 23 07:37:03 2008
@@ -23,13 +23,13 @@
  */
 
 /**@page localinfo list local network addresses
- * 
+ *
  * @section synopsis Synopsis
  *
  * <tt>localinfo [-imdn46gslh] [domainname]</tt>
  *
  * @section description Description
- * 
+ *
  * The @em localinfo utility will obtain the local network addresses
  * and print them.
  *
@@ -61,7 +61,7 @@
  *
  * @section examples Examples
  *
- * You want to find out local IPv6 addresses: 
+ * You want to find out local IPv6 addresses:
  * @code
  * $ localinfo -6
  * @endcode
@@ -110,7 +110,7 @@
 int getopt(int argc, char * const argv[], char const *opstring);
 extern int optind;
 
-void usage(int returncode)
+static void usage(int returncode)
 {
   fputs(help, stderr);
   exit(returncode);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memccpy.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memccpy.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memccpy.c	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 /**@internal @file memccpy.c
  * @brief The memccpy() replacement function.
- *  
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Nov 17 17:45:51 EET 2005 ppessi
  */
 
@@ -46,7 +46,7 @@
  * @param n          size of destination area
  *
  * @return
- * Returns a pointer to the next character in @a dest after @a c, 
+ * Returns a pointer to the next character in @a dest after @a c,
  * or NULL if @a c was not found in the first @a n characters of @a src.
  */
 void *memccpy(void *dest, const void *src, int c, size_t n)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memcspn.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memcspn.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memcspn.c	Tue Dec 23 07:37:03 2008
@@ -24,9 +24,9 @@
 
 /**@internal @file memcspn.c
  * @brief The memcspn() replacement function.
- *  
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Nov 17 17:45:51 EET 2005 ppessi
  */
 
@@ -48,7 +48,7 @@
  * @return
  * The memspn() function returns the number of bytes in the memory area @a
  * which consists entirely of bytes not in @a reject.
- * @par 
+ * @par
  * If @a rejectlen is 0, or @a reject is NULL, it returns @a memlen, size of
  * the memory area.
  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memmem.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memmem.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memmem.c	Tue Dec 23 07:37:03 2008
@@ -25,11 +25,11 @@
 /**@internal @file memmem.c
  *
  * @brief Backup implementation of memmem()
- *  
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Sat Apr 12 19:32:33 2003 ppessi
- * 
+ *
  */
 
 #include "config.h"

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memspn.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memspn.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/memspn.c	Tue Dec 23 07:37:03 2008
@@ -23,13 +23,13 @@
  */
 
 /**@internal @file memspn.c
- * 
+ *
  * The memspn() replacement function.
- *  
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Sat Apr 12 19:32:33 2003 ppessi
- * 
+ *
  */
 
 #include "config.h"

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/poll.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/poll.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/poll.c	Tue Dec 23 07:37:03 2008
@@ -8,7 +8,7 @@
 
    Copyright (C) 1994,1996,1997,1998,1999,2001,2002
    Free Software Foundation, Inc.
-   
+
    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
@@ -57,7 +57,7 @@
 #define FDSETSIZE(n) (((n) + NFDBITS - 1) / NFDBITS * (NFDBITS / NBBY))
 #define roundup(n, x) (((n) + (x) - 1) / (x) * (x))
 
-/* Emulated poll() using select(). 
+/* Emulated poll() using select().
 
 This is used by su_wait().
 
@@ -241,7 +241,7 @@
       break;
     }
 
-  if (ready > 0) 
+  if (ready > 0)
     for (f = fds; f < &fds[nfds]; ++f)
       {
 	if (f->fd >= 0)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/smoothsort.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/smoothsort.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/smoothsort.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@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.
  *
@@ -37,6 +37,8 @@
 
 #include "config.h"
 
+#include <sofia-sip/heap.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <sys/types.h>
@@ -60,7 +62,7 @@
   size_t next;
 
   s->p >>= 1;
-  
+
   next = s->b + s->c + 1, s->c = s->b, s->b = next;
 
   return next;
@@ -87,8 +89,8 @@
     return "0";
 
   binary[64] = 0;
-  
-  for (i = 64; p; p >>= 1) 
+
+  for (i = 64; p; p >>= 1)
     binary[--i] = "01"[p & 1];
 
   return binary + i;
@@ -107,7 +109,7 @@
  * @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;
 
@@ -115,7 +117,7 @@
       r2 = r - 1;
       stretch_down(&s, 0);
     }
- 
+
     if (array->less(array->m, r2, r))
       break;
 
@@ -125,8 +127,8 @@
 
     stretch_down(&s, 0);
   }
-} 
- 
+}
+
 /** Trinkle the roots of the given stretches
  *
  * @param array   description of array to sort
@@ -160,12 +162,12 @@
     }
 
     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;
@@ -175,9 +177,9 @@
     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; 
+    break;
   }
- 
+
   sift(array, r, s);
 }
 
@@ -198,7 +200,7 @@
     array->swap(array->m, r, r1);
     trinkle(array, r1, s);
   }
-} 
+}
 
 /** Sort array using smoothsort.
  *
@@ -251,10 +253,10 @@
     DEBUG(("loop1 q=%zu: b=%u p=%s\n", q, s.b, binary(s.p)));
 
     if (s.b <= 1) {
-      while ((s.p & 1) == 0) 
+      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);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/heap.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/heap.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/heap.h	Tue Dec 23 07:37:03 2008
@@ -32,7 +32,7 @@
  *
  * This file contain template macros implementing @a heap in C. The @a heap
  * keeps its element in a known order and it can be used to implement, for
- * example, a prioritye queue or an ordered queue. 
+ * example, a prioritye queue or an ordered queue.
  *
  * The ordering within the heap is defined as follows:
  * - indexing starts from 1
@@ -53,14 +53,14 @@
  * to be removed. The template defines also a predicate used to check if the
  * heap is full, and a function used to resize the heap.
  *
- * The heap user must define four primitives: 
- * - less than comparison 
+ * The heap user must define four primitives:
+ * - less than comparison
  * - array setter
  * - heap array allocator
  * - empty element
  *
  * Please note that in order to remove an entry in the heap, the application
- * must know its index in the heap array. 
+ * must know its index in the heap array.
  *
  * The heap struct is declared with macro HEAP_DECLARE(). The prototypes for
  * heap functions are instantiated with macro HEAP_PROTOS(). The
@@ -68,7 +68,7 @@
  *
  * Example code can be found from <su/torture_heap.c> and
  * <sresolv/sres_cache.c>.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
  * @NEW_1_12_7.
  */
@@ -77,9 +77,9 @@
 #define HEAP_MIN_SIZE 31
 
 /** Declare heap structure type.
- * 
+ *
  * The macro #HEAP_TYPE contains declaration of the heap structure.
- * 
+ *
  * @showinitializer
  */
 #define HEAP_TYPE struct { void *private; }
@@ -100,7 +100,7 @@
  * @param heaptype  type of heap
  * @param prefix    function prefix
  * @param type      type of entries
- * 
+ *
  * The declared functions will have scope @a scope (for example, @c static
  * or @c static inline). The declared function names will have prefix @a
  * prefix. The heap structure has type @a heaptype. The heap element type is
@@ -144,7 +144,7 @@
  * Functions have scope @a scope, e.g., @c static @c inline.
  * The heap structure has type @a type.
  * The function names start with @a prefix, the field names start
- * with @a pr. The entry type is @a entrytype. 
+ * with @a pr. The entry type is @a entrytype.
 
  * The function (or macro) @a less compares two entries in heap. It gets two
  * arguments and it returns true if its left argument is less than its right

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable.h	Tue Dec 23 07:37:03 2008
@@ -48,11 +48,11 @@
  * When a entry with new identical hash key is added to the table, it can be
  * either @e inserted (before any other entry with same key value) or
  * @e appended.
- * 
+ *
  * Example code can be found from <htable_test.c>.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Sep 25 17:42:40 2001 ppessi
  */
 
@@ -62,7 +62,7 @@
 #define HTABLE_MIN_SIZE 31
 
 /** Declare hash table structure type.
- * 
+ *
  * The macro HTABLE_DECLARE() expands to a declaration for hash table
  * structure.  The its typedef will be <em>prefix</em><code>_t</code>, the
  * field names start withb @a pr.  The entry type is @a entry_t.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable2.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable2.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable2.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef HTABLE2_H
 /** Defined when <sofia-sip/htable2.h> has been included. */
-#define HTABLE2_H 
+#define HTABLE2_H
 
 /**@file sofia-sip/htable2.h
  *
@@ -33,7 +33,7 @@
  * Note: this version stores the given element types as entries (instead of
  * always storing a pointer to element). It can be used 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 declaration
  * for template datatypes is instantiated with macro HTABLE2_DECLARE2(). The
@@ -51,9 +51,9 @@
  * When a entry with new identical key is added to the table, it can be
  * either @e inserted (before any other entry with same key value) or @e
  * appended.
- * 
+ *
  * Example code can be found from <htable_test.c>.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
  *
  * @date Created: Tue Sep 25 17:42:40 2001 ppessi
@@ -65,7 +65,7 @@
 #define HTABLE2_MIN_SIZE 31
 
 /** Declare hash table structure type.
- * 
+ *
  * The macro HTABLE2_DECLARE2() expands to a declaration for hash table
  * structure. The its typedef will be @a type, the field names start with @a
  * pr. The entry type is @a entrytype.
@@ -127,8 +127,8 @@
  * hash value of each entry is given as @a hfun.
  *
  * @param type      hash table type
- * @param prefix    function prefix for hash table 
- * @param pr        field prefix for hash table 
+ * @param prefix    function prefix for hash table
+ * @param pr        field prefix for hash table
  * @param entrytype type of entry element
  * @param sizetype  size_t type
  * @param hfun      function or macro returning hash value of entry
@@ -297,7 +297,7 @@
 #define HTABLE2_BODIES(type, prefix, pr, entrytype, \
 		        hfun, is_used, reclaim, is_equal, halloc) \
   HTABLE2_BODIES2(type, prefix, pr, entrytype, unsigned, \
-		        hfun, is_used, reclaim, is_equal, halloc) 
+		        hfun, is_used, reclaim, is_equal, halloc)
 
 
 #endif /** !defined(HTABLE2_H) */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/rbtree.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/rbtree.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/rbtree.h	Tue Dec 23 07:37:03 2008
@@ -24,14 +24,14 @@
 
 #ifndef RBTREE_H
 /** Defined when <sofia-sip/rbtree.h> has been included. */
-#define RBTREE_H 
+#define RBTREE_H
 
 /**@file sofia-sip/rbtree.h
  *
  * Red-black tree.
  *
  * This file contain a red-black-tree template for C. The red-black-tree is
- * a balanced binary tree containing structures as nodes. 
+ * a balanced binary tree containing structures as nodes.
  *
  * The prototypes for red-black-tree functions are declared with macro
  * RBTREE_PROTOS(). The implementation is instantiated with macro
@@ -40,9 +40,9 @@
  * When a entry with new identical key is added to the tree, it can be
  * either @e inserted (replacing other node with same key value) or @e
  * appended.
- * 
+ *
  * Example code can be found from <rbtree_test.c>.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
  *
  * @date Created: Tue Sep  7 19:45:11 EEST 2004 ppessi
@@ -80,7 +80,7 @@
   left(c) = x;					   \
   parent(x) = c;				   \
 } \
-extern int const prefix##_dummy 
+extern int const prefix##_dummy
 
   /*               x                c
    *              / \              / \
@@ -259,11 +259,11 @@
  *
  * @param tree pointer to the root of the tree
  * @param node pointer to node to be inserted
- * @param return_old return value parameter for matching node 
+ * @param return_old return value parameter for matching node
  *                   already in the @a tree
  *
  * @retval 0 if node was inserted
- * @retval -1 if there already was an matching node 
+ * @retval -1 if there already was an matching node
  *            and return_old is NULL.
  */
 int rbtree_insert(Type **tree, Type *node, Type **return_old);
@@ -387,7 +387,7 @@
  * @param tree pointer to the root of the tree
  * @param node pointer to node to be appended
  */
-void rbtree_remove(Type **tree, Type *node);				
+void rbtree_remove(Type **tree, Type *node);
 #endif
 
 #define RBTREE_REMOVE(SCOPE, prefix, Type, left, right, parent,		\
@@ -584,7 +584,7 @@
 } \
 extern int const prefix##_dummy
 
-/** Define prototypes for red-black tree functions. @HIDE 
+/** Define prototypes for red-black tree functions. @HIDE
  *
  * @param SCOPE function scope (e.g., su_inline)
  * @param prefix function prefix (e.g., rbtree)
@@ -605,12 +605,12 @@
   SCOPE Type *prefix ## _last(Type const *);				\
   SCOPE int prefix ## _height(Type const *)
 
-/** Define bodies for red-black tree functions. @HIDE 
+/** Define bodies for red-black tree functions. @HIDE
  *
  * @param SCOPE function scope (e.g., su_inline)
  * @param prefix function prefix (e.g., rbtree)
  * @param Type node type
- * @param left accessor of left node 
+ * @param left accessor of left node
  * @param right accessor of right node
  * @param parent accessor of parent node
  * @param IS_RED predicate testing if node is red
@@ -621,7 +621,7 @@
  * @param CMP method comparing two nodes
  * @param INSERT setter marking node as inserted to the tree
  * @param REMOVE method marking node as removed and possibly deleting node
- * 
+ *
  * @par Example
  *
  * @code
@@ -637,7 +637,7 @@
  * #define INSERT(node) ((node)->inserted = 1)
  * #define REMOVE(node) ((node)->left = (node)->right = (node)->parent = NULL, \
  *                       (node)->inserted = 0)
- * 
+ *
  * RBTREE_BODIES(su_inline, rbtree, struct node,
  *               LEFT, RIGHT, PARENT,
  *               IS_RED, SET_RED, IS_BLACK, SET_BLACK, COPY_COLOR,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h	Tue Dec 23 07:37:03 2008
@@ -25,11 +25,11 @@
 #ifndef SU_H
 /** Defined when <sofia-sip/su.h> has been included. */
 #define SU_H
-/**@ingroup su_socket 
+/**@ingroup su_socket
  * @file sofia-sip/su.h Socket and network address interface
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Mar 18 19:40:51 1999 pessi
  */
 
@@ -67,11 +67,11 @@
 #  include <winsock2.h>
 #  include <ws2tcpip.h>
 #  if SU_HAVE_IN6
-#    if defined(IPPROTO_IPV6) || (_WIN32_WINNT >= 0x0600)
+#    if defined(IPPROTO_IPV6) || (_WIN32_WINNT >= 0x0501)
 /*     case 1: IPv6 defined in winsock2.h/ws2tcpip.h */
 #    else
 /*     case 2: try to use "IPv6 Tech Preview" */
-#      include <tpipv6.h>		
+#      include <tpipv6.h>
 #    endif
 #  endif
 #endif
@@ -83,14 +83,14 @@
 
 #if SU_HAVE_BSDSOCK || DOCUMENTATION_ONLY
 enum {
-  /** Invalid socket descriptor, error from socket() or accept() */ 
+  /** Invalid socket descriptor, error from socket() or accept() */
   INVALID_SOCKET = -1,
 #define INVALID_SOCKET ((su_socket_t)INVALID_SOCKET)
   /** Error from other socket calls */
   SOCKET_ERROR = -1,
 #define SOCKET_ERROR SOCKET_ERROR
   /** Return code for a successful call */
-  su_success = 0, 
+  su_success = 0,
   /** Return code for an unsuccessful call */
   su_failure = -1
 };
@@ -98,9 +98,9 @@
 #define MSG_NOSIGNAL (0)
 #endif
 #elif SU_HAVE_WINSOCK
-enum { 
-  su_success = 0, 
-  su_failure = 0xffffffffUL 
+enum {
+  su_success = 0,
+  su_failure = 0xffffffffUL
 };
 
 #define MSG_NOSIGNAL (0)
@@ -168,7 +168,7 @@
 #define               su_len          su_array[0]
   short               su_family;
 #endif
-#define               su_port         su_sin.sin_port  
+#define               su_port         su_sin.sin_port
 #endif
 
   char                su_array[32];   /**< Presented as chars */
@@ -230,8 +230,8 @@
  * For historical reasons, the structure is known as #msg_iovec_t in @msg
  * module.
  *
- * @sa #su_ioveclen_t, SU_IOVECLEN_MAX, su_vsend(), su_vrecv(), 
- * #msg_iovec_t, msg_iovec(), msg_recv_iovec(), 
+ * @sa #su_ioveclen_t, SU_IOVECLEN_MAX, su_vsend(), su_vrecv(),
+ * #msg_iovec_t, msg_iovec(), msg_recv_iovec(),
  * @c struct @c iovec defined in <sys/uio.h>, writev(2), readv(2),
  * sendmsg(), recvmsg(),
  * <a href="http://msdn.microsoft.com/library/en-us/winsock/winsock/wsabuf_2.asp">
@@ -242,7 +242,7 @@
   su_ioveclen_t siv_len;		/**< Size of buffer.  */
 } su_iovec_t;
 
-/** Maximum size of buffer in a single su_iovec_t element. 
+/** Maximum size of buffer in a single su_iovec_t element.
  * @sa #su_ioveclen_t, #su_iovec_t
  *
  * @since New in @VERSION_1_12_2.
@@ -277,7 +277,7 @@
 SOFIAPUBFUN int su_ioctl(su_socket_t s, int request, ...);
 
 /**Check for in-progress error codes.
- * 
+ *
  * Checks if the @a errcode indicates that the socket call failed because
  * it would have blocked.
  *
@@ -287,7 +287,7 @@
  */
 SOFIAPUBFUN int su_is_blocking(int errcode);
 
-/** Set/reset blocking option. */ 
+/** Set/reset blocking option. */
 SOFIAPUBFUN int su_setblocking(su_socket_t s, int blocking);
 /** Set/reset address reusing option. */
 SOFIAPUBFUN int su_setreuseaddr(su_socket_t s, int reuse);
@@ -314,7 +314,7 @@
 #define su_ioctl  ioctl
 /*
  * Note: before 1.12.2, there was su_isblocking() which did not take argument
- * and which was missing from WINSOCK 
+ * and which was missing from WINSOCK
  */
 #define su_is_blocking(e) \
   ((e) == EINPROGRESS || (e) == EAGAIN || (e) == EWOULDBLOCK)
@@ -324,7 +324,7 @@
 SOFIAPUBFUN int su_inet_pton(int af, char const *src, void *dst);
 SOFIAPUBFUN const char *su_inet_ntop(int af, void const *src,
 				  char *dst, size_t size);
-SOFIAPUBFUN ssize_t 
+SOFIAPUBFUN ssize_t
   su_send(su_socket_t s, void *buffer, size_t length, int flags),
   su_sendto(su_socket_t s, void *buffer, size_t length, int flags,
 	    su_sockaddr_t const *to, socklen_t tolen),
@@ -424,7 +424,7 @@
 
 #define SU_SOCKADDR_INADDR_ANY(su) SU_HAS_INADDR_ANY(su)
 
-/**@HI Calculate correct size of su_sockaddr_t structure. */ 
+/**@HI Calculate correct size of su_sockaddr_t structure. */
 #if SU_HAVE_IN6
 #define SU_SOCKADDR_SIZE(su) \
   ((socklen_t)((su)->su_family == AF_INET ? sizeof((su)->su_sin)	  \

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_addrinfo.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_addrinfo.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_addrinfo.h	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -13,7 +13,7 @@
  * 3. Neither the name of the project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -30,12 +30,12 @@
 #ifndef SU_ADDRINFO_H
 /* Defined when <sofia-sip/su_addrinfo.h> has been included */
 #define SU_ADDRINFO_H
-/**@ingroup su_socket 
+/**@ingroup su_socket
  *
  * @file sofia-sip/su_addrinfo.h Network address and service translation.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Wed Nov 30 17:07:04 EET 2005 ppessi
  */
 
@@ -115,10 +115,10 @@
 };
 #endif	/* SU_WITH_GETADDRINFO */
 
-#ifndef EAI_BADHINTS     
+#ifndef EAI_BADHINTS
 #define EAI_BADHINTS	10012
 #endif
-#ifndef EAI_PROTOCOL  
+#ifndef EAI_PROTOCOL
 #define EAI_PROTOCOL	10013
 #endif
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc.h	Tue Dec 23 07:37:03 2008
@@ -30,7 +30,7 @@
  * @file sofia-sip/su_alloc.h Home-based memory management interface
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Aug 19 01:12:25 1999 ppessi
  */
 
@@ -54,7 +54,7 @@
 typedef struct su_alock su_alock_t;
 
 /** Memory home structure */
-struct su_home_s { 
+struct su_home_s {
   int         suh_size;
   su_block_t *suh_blocks;
   su_alock_t *suh_lock;
@@ -140,7 +140,7 @@
      __attribute__((__malloc__));
 
 /* free an independent block */
-SU_DLL void su_free(su_home_t *h, void *);		
+SU_DLL void su_free(su_home_t *h, void *);
 
 /** Check if a memory home is threadsafe */
 SU_DLL int su_home_is_threadsafe(su_home_t const *home);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc_stat.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc_stat.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc_stat.h	Tue Dec 23 07:37:03 2008
@@ -24,14 +24,14 @@
 
 #ifndef SU_ALLOC_STAT_H
 /** Defined when <sofia-sip/su_alloc_stat.h> has been included. */
-#define SU_ALLOC_STAT_H 
+#define SU_ALLOC_STAT_H
 
 /**@ingroup su_alloc
  *
  * @file sofia-sip/su_alloc_stat.h Home-based memory management statistics
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Apr  9 10:24:05 2002 ppessi
  */
 
@@ -48,10 +48,10 @@
 typedef struct su_home_stat_t su_home_stat_t;
 
 SU_DLL void su_home_init_stats(su_home_t *h);
-SU_DLL void su_home_get_stats(su_home_t *, int include_clones, 
+SU_DLL void su_home_get_stats(su_home_t *, int include_clones,
 			      su_home_stat_t *stats, isize_t statssize);
 
-SU_DLL void su_home_stat_add(su_home_stat_t *total, 
+SU_DLL void su_home_stat_add(su_home_stat_t *total,
 			     su_home_stat_t const *hs);
 
 struct su_home_stat_t

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_bm.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_bm.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_bm.h	Tue Dec 23 07:37:03 2008
@@ -29,9 +29,9 @@
 /**
  * @file sofia-sip/su_bm.h
  * @brief Boyer-Moore search algorithm
- *  
+ *
  * @author Pekka.Pessi at nokia.com
- * 
+ *
  * @date Created: Mon Apr 11 17:03:13 2005 ppessi
  */
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_config.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_config.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_config.h	Tue Dec 23 07:37:03 2008
@@ -24,14 +24,14 @@
 #ifndef SU_CONFIG_H
 /** Defined when <sofia-sip/su_config.h> has been included. */
 #define SU_CONFIG_H
-/**@file sofia-sip/su_config.h 
- * 
+/**@file sofia-sip/su_config.h
+ *
  * @b su library configuration
- * 
+ *
  * This file includes an appropriate <sofia-sip/su_configure*.h> include file.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Mar 18 19:40:51 1999 pessi
  */
 
@@ -45,7 +45,7 @@
 #define __malloc__		/* avoid spurious warnigns */
 #endif
 #elif !defined(__attribute__)
-#  define __attribute__(x) 
+#  define __attribute__(x)
 #endif
 
 /* C++ linkage needs to know that types and declarations are C, not C++.  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_configure.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_configure.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_configure.h.in	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef SU_CONFIGURE_H
 /** Defined when <sofia-sip/su_configure.h> has been included. */
-#define SU_CONFIGURE_H 
+#define SU_CONFIGURE_H
 
 /**@file sofia-sip/su_configure.h
  *
@@ -37,7 +37,7 @@
  * in "config.h".
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Mon Aug 21 20:32:25 2000 ppessi
  */
 
@@ -70,7 +70,7 @@
 #undef SU_HAVE_WINSOCK
 
 /** Define as 1 if you have Winsock2 interface */
-#undef SU_HAVE_WINSOCK2     	
+#undef SU_HAVE_WINSOCK2
 
 /** Define as 1 if you have OSX CoreFoundation interface */
 #undef SU_HAVE_OSX_CF_API
@@ -92,7 +92,7 @@
 #undef SU_INLINE_TAG_CAST
 
 /** Define this as 1 if we can use tags directly from stack. */
-#undef SU_HAVE_TAGSTACK 
+#undef SU_HAVE_TAGSTACK
 
 /* These are valid only for GCC */
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_debug.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_debug.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_debug.h	Tue Dec 23 07:37:03 2008
@@ -24,14 +24,14 @@
 
 #ifndef SU_DEBUG_H
 /** Defined when <sofia-sip/su_debug.h> has been included */
-#define SU_DEBUG_H 
+#define SU_DEBUG_H
 
 /**@ingroup su_log
  * @file sofia-sip/su_debug.h
  * @brief SU debugging macros
  *
  * The logging levels and macros to use are defined as follows:
- *  - SU_DEBUG_0()  fatal errors, panic 
+ *  - SU_DEBUG_0()  fatal errors, panic
  *  - SU_DEBUG_1()  critical errors, minimal progress at subsystem level
  *  - SU_DEBUG_2()  non-critical errors
  *  - SU_DEBUG_3()  warnings, progress messages
@@ -44,10 +44,10 @@
  * structure, e.g., "iptsec_debug.h".
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Feb  8 10:06:33 2000 ppessi
  *
- * @sa @ref debug_logs, su_llog(), su_vllog(), #su_log_t, 
+ * @sa @ref debug_logs, su_llog(), su_vllog(), #su_log_t,
  */
 
 #ifndef SU_LOG_H
@@ -82,7 +82,7 @@
 SU_DEBUG_DEF(0)
 /** Log messages at level 0.
  *
- * Fatal errors and panic messages should be logged at level 0. 
+ * Fatal errors and panic messages should be logged at level 0.
  *
  * @sa su_llog(), su_vllog(), #su_log_t, @ref debug_logs
  */
@@ -115,7 +115,7 @@
 
 #if SU_DEBUG_MAX >= 2
 SU_DEBUG_DEF(2)
-/**Log messages at level 2. 
+/**Log messages at level 2.
  *
  * Non-critical errors should be logged at level 2.
  *
@@ -173,7 +173,7 @@
 SU_DEBUG_DEF(7)
 /** Log messages at level 7.
  *
- * Media protocol actions (incoming packets, etc) should be logged at level 7. 
+ * Media protocol actions (incoming packets, etc) should be logged at level 7.
  *
  * @sa su_llog(), su_vllog(), #su_log_t, @ref debug_logs
  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h	Tue Dec 23 07:37:03 2008
@@ -32,7 +32,7 @@
  * socket library and C libraries).
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Dec 22 18:16:06 EET 2005 pessi
  */
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_localinfo.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_localinfo.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_localinfo.h	Tue Dec 23 07:37:03 2008
@@ -24,14 +24,14 @@
 
 #ifndef SU_LOCALINFO_H
 /** Defined when <sofia-sip/su_localinfo.h> has been included. */
-#define SU_LOCALINFO_H 
+#define SU_LOCALINFO_H
 
 
 /**@ingroup su_socket
  * @file sofia-sip/su_localinfo.h  Interface for obtaining local addresses.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Aug 10 18:58:01 2000 ppessi
  */
 
@@ -46,8 +46,8 @@
 
 /** Local address info structure. */
 struct su_localinfo_s {
-  /**Bitwise or of flags: 
-   * #LI_V4MAPPED, #LI_CANONNAME, #LI_NAMEREQD, 
+  /**Bitwise or of flags:
+   * #LI_V4MAPPED, #LI_CANONNAME, #LI_NAMEREQD,
    * #LI_NUMERIC, #LI_DOWN, #LI_IFNAME */
   int li_flags;
   int li_family;		/**< Address family. */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_log.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_log.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_log.h	Tue Dec 23 07:37:03 2008
@@ -22,9 +22,9 @@
  *
  */
 
-/**@ingroup su_log 
+/**@ingroup su_log
  * @file sofia-sip/su_log.h   SU logging interface
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>.
  *
  * @date Created: Thu Feb 22 18:09:02 2001 ppessi
@@ -79,7 +79,7 @@
 
 SOFIAPUBFUN void su_llog(su_log_t *log, unsigned level, char const *fmt, ...)
   __attribute__ ((__format__ (printf, 3, 4)));
-SOFIAPUBFUN void su_vllog(su_log_t *log, unsigned level, 
+SOFIAPUBFUN void su_vllog(su_log_t *log, unsigned level,
 			  char const *fmt, va_list ap);
 SOFIAPUBFUN void su_log_redirect(su_log_t *log, su_logger_f *f, void *stream);
 SOFIAPUBFUN void su_log_set_level(su_log_t *log, unsigned level);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_md5.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_md5.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_md5.h	Tue Dec 23 07:37:03 2008
@@ -40,7 +40,7 @@
 /** @file sofia-sip/su_md5.h MD5 digest interface.
  *
  * @author <Pekka.Pessi at nokia.com>
- */ 
+ */
 
 #ifndef SU_TYPES_H
 #include "sofia-sip/su_types.h"

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_os_nw.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_os_nw.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_os_nw.h	Tue Dec 23 07:37:03 2008
@@ -98,9 +98,9 @@
 
 typedef struct su_network_changed_s su_network_changed_t;
 
-/** Function prototype for network-changed callback . 
+/** Function prototype for network-changed callback .
+ *
  *
- * 
  * @since New in @VERSION_1_12_2.
  */
 typedef void (su_network_changed_f)(su_network_changed_magic_t *, su_root_t *);
@@ -112,8 +112,8 @@
 /* Network-changed */
 SOFIAPUBFUN su_network_changed_t *
 su_root_add_network_changed(su_home_t *home,
-			    su_root_t *root, 
-			    su_network_changed_f *, 
+			    su_root_t *root,
+			    su_network_changed_f *,
 			    su_network_changed_magic_t *);
 SOFIAPUBFUN int su_root_remove_network_changed(su_network_changed_t *);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_osx_runloop.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_osx_runloop.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_osx_runloop.h	Tue Dec 23 07:37:03 2008
@@ -29,11 +29,11 @@
 /**
  * @file sofia-sip/su_osx_runloop.h
  * @brief OSX Run Loop integration.
- * 
+ *
  * @author Martti Mela <Martti.Mela at nokia.com>
- *  
+ *
  * @date Created: Fri Sep 22 16:49:51 EEST 2006 mela
- * 
+ *
  * @NEW_1_12_4.
  */
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_strlst.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_strlst.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_strlst.h	Tue Dec 23 07:37:03 2008
@@ -28,7 +28,7 @@
  * @file sofia-sip/su_strlst.h String lists
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Fri May  3 09:13:22 2002 ppessi
  */
 
@@ -58,7 +58,7 @@
      __attribute__((__malloc__));
 
 SU_DLL su_strlst_t *su_strlst_vcreate_with_dup(su_home_t *,
-					       char const *, 
+					       char const *,
 					       va_list va)
      __attribute__((__malloc__));
 
@@ -84,14 +84,14 @@
 SU_DLL char const *su_strlst_item(su_strlst_t const *, usize_t i);
 
 /** Set a numbered item to list */
-SU_DLL char const *su_strlst_set_item(su_strlst_t *self, usize_t i, 
+SU_DLL char const *su_strlst_set_item(su_strlst_t *self, usize_t i,
 				      char const *s);
 
 /** Remove a numbered item from list. */
 SU_DLL char const *su_strlst_remove(su_strlst_t *, usize_t i);
 
 /** Concatenate list of strings to one string. */
-SU_DLL char *su_strlst_join(su_strlst_t *s, su_home_t *home, 
+SU_DLL char *su_strlst_join(su_strlst_t *s, su_home_t *home,
 			     char const *sep)
      __attribute__((__malloc__));
 
@@ -100,7 +100,7 @@
      __attribute__((__malloc__));
 
 /** Duplicate and split a string. */
-SU_DLL su_strlst_t *su_strlst_dup_split(su_home_t *, char const *s, 
+SU_DLL su_strlst_t *su_strlst_dup_split(su_home_t *, char const *s,
 					char const *sep)
      __attribute__((__malloc__));
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h	Tue Dec 23 07:37:03 2008
@@ -30,7 +30,7 @@
  * @file sofia-sip/su_tag.h  Object-oriented tags and tag list interface.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Feb 20 19:48:18 2001 ppessi
  */
 
@@ -68,7 +68,7 @@
 /** Tag type class */
 typedef struct tag_class_s const tag_class_t;
 
-/** Tag structure. 
+/** 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.
@@ -77,7 +77,7 @@
   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 
+  tag_value_t    tt_magic;	/**< Class-specific data
 				   (e.g., pointer to header class structure) */
 };
 
@@ -96,12 +96,12 @@
 /** Any tag accepted when filtering. */
 SOFIAPUBVAR tag_typedef_t tag_any;
 
-/** Filter tag using function as argument. 
+/** Filter tag using function as argument.
  * @since New in @VERSION_1_12_2.
  */
 SOFIAPUBVAR tag_typedef_t tag_filter;
 
-/** Prototype for filtering function used with TAG_FILTER(). 
+/** Prototype for filtering function used with TAG_FILTER().
  * @since New in @VERSION_1_12_2.
  */
 typedef int tag_filter_f(tagi_t const *filter, tagi_t const *dest);
@@ -121,11 +121,11 @@
 /** @HI Initialize a filter tag item accepting any item. */
 #define TAG_ANY()   tag_any,  (tag_value_t)0
 
-/** @HI Initialize a @a item if condition is true; 
+/** @HI Initialize a @a item if condition is true;
  * otherwise, initialize an empty tag item. */
 #define TAG_IF(condition, item) !(condition) ? tag_skip : item
 
-/** @HI Initialize a filter tag item accepting any item. 
+/** @HI Initialize a filter tag item accepting any item.
  * @since New in @VERSION_1_12_2.
  */
 #define TAG_FILTER(function)  tag_filter, tag_filter_v(function)
@@ -134,7 +134,7 @@
 SOFIAPUBFUN int t_snprintf(tagi_t const *t, char b[], size_t size);
 
 /** Convert string to a tag value */
-SOFIAPUBFUN int t_scan(tag_type_t tt, su_home_t *home, char const *s, 
+SOFIAPUBFUN int t_scan(tag_type_t tt, su_home_t *home, char const *s,
 		       tag_value_t *return_value);
 
 /* Tagarg functions */
@@ -142,7 +142,7 @@
 SOFIAPUBFUN size_t tl_tmove(tagi_t *dst, size_t, tag_type_t, tag_value_t, ...);
 SOFIAPUBFUN int tl_gets(tagi_t const lst[], tag_type_t, tag_value_t, ...);
 SOFIAPUBFUN int tl_tgets(tagi_t lst[], tag_type_t, tag_value_t, ...);
-SOFIAPUBFUN tagi_t *tl_tfilter(su_home_t *, tagi_t const lst[], 
+SOFIAPUBFUN tagi_t *tl_tfilter(su_home_t *, tagi_t const lst[],
 			       tag_type_t, tag_value_t, ...);
 SOFIAPUBFUN int tl_tremove(tagi_t lst[], tag_type_t, tag_value_t, ...);
 
@@ -162,7 +162,7 @@
 SOFIAPUBFUN tagi_t *tl_afilter(su_home_t *, tagi_t const filter[],
 			       tagi_t const lst[]);
 
-SOFIAPUBFUN tagi_t *tl_filtered_tlist(su_home_t *home, tagi_t const filter[], 
+SOFIAPUBFUN tagi_t *tl_filtered_tlist(su_home_t *home, tagi_t const filter[],
 				      tag_type_t, tag_value_t, ...);
 
 SOFIAPUBFUN size_t  tl_vlen(va_list ap);
@@ -192,7 +192,7 @@
 su_inline tag_value_t tag_ptr_vr(void *vp, void *v)
   { (void)v; return(tag_value_t)vp; }
 su_inline tag_value_t tag_cptr_v(void const *v) { return (tag_value_t)v; }
-su_inline tag_value_t tag_cptr_vr(void *vp, void const *v) 
+su_inline tag_value_t tag_cptr_vr(void *vp, void const *v)
   { (void)v; return(tag_value_t)vp; }
 su_inline tag_value_t tag_cstr_v(char const *v) { return (tag_value_t)v; }
 su_inline tag_value_t tag_cstr_vr(char const**vp) {return(tag_value_t)vp;}
@@ -202,7 +202,7 @@
 extern "C++" {
   su_inline tag_value_t tag_ptr_v(void const *v)
   { return (tag_value_t)v; }
-  su_inline tag_value_t tag_ptr_vr(void *vp, void const *p) 
+  su_inline tag_value_t tag_ptr_vr(void *vp, void const *p)
   { return (tag_value_t)vp; }
   su_inline tag_value_t tag_str_v(char *v) { return (tag_value_t)v; }
   su_inline tag_value_t tag_str_vr(char **vp) {return (tag_value_t)vp;}

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_class.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_class.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_class.h	Tue Dec 23 07:37:03 2008
@@ -24,14 +24,14 @@
 
 #ifndef SU_TAG_CLASS_H
 /** Defined when <sofia-sip/su_tag_class.h> has been included. */
-#define SU_TAG_CLASS_H 
+#define SU_TAG_CLASS_H
 
 /**@SU_TAG
  * @file  su_tag_class.h
- * @brief Tag class interface for object-oriented tags 
+ * @brief Tag class interface for object-oriented tags
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Wed Feb 21 00:49:41 2001 ppessi
  */
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_inline.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_inline.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_inline.h	Tue Dec 23 07:37:03 2008
@@ -24,13 +24,13 @@
 
 #ifndef SU_TAG_INLINE_H
 /** Defined when <sofia-sip/su_tag_inline.h> has been included */
-#define SU_TAG_INLINE_H 
+#define SU_TAG_INLINE_H
 /**@SU_TAG
  * @file sofia-sip/su_tag_inline.h
  * Inline functions for object tags and tag lists.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Feb 20 19:48:18 2001 ppessi
  */
 
@@ -69,7 +69,7 @@
 {
   tag_type_t tt = TAG_TYPE_OF(t);
 
-  if (tt->tt_next) 
+  if (tt->tt_next)
     return tt->tt_next(t);
   else
     return t + 1;
@@ -79,7 +79,7 @@
 {
   tag_type_t tt = TAG_TYPE_OF(src);
 
-  if (tt->tt_move) 
+  if (tt->tt_move)
     return tt->tt_move(dst, src);
 
   *dst = *src;
@@ -90,7 +90,7 @@
 {
   tag_type_t tt = TAG_TYPE_OF(t);
 
-  if (tt->tt_xtra) 
+  if (tt->tt_xtra)
     return tt->tt_xtra(t, offset);
 
   return 0;
@@ -100,7 +100,7 @@
 {
   tag_type_t tt = TAG_TYPE_OF(src);
 
-  if (tt->tt_dup) 
+  if (tt->tt_dup)
     return tt->tt_dup(dst, src, bb);
 
   *dst = *src;
@@ -112,7 +112,7 @@
   if (!tt)
     return NULL;
 
-  if (tt->tt_find) 
+  if (tt->tt_find)
     return tt->tt_find(tt, lst);
 
   for (; lst; lst = t_next(lst)) {
@@ -127,7 +127,7 @@
 {
   tag_type_t tt = TAG_TYPE_OF(t);
 
-  if (tt->tt_free) 
+  if (tt->tt_free)
     return tt->tt_free(t);
   else if (tt->tt_next)
     return (tagi_t *)tt->tt_next(t);
@@ -139,7 +139,7 @@
 {
   tag_type_t tt = TAG_TYPE_OF(t);
 
-  if (tt->tt_len) 
+  if (tt->tt_len)
     return tt->tt_len(t);
 
   return sizeof(*t);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_io.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_io.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_io.h	Tue Dec 23 07:37:03 2008
@@ -24,14 +24,14 @@
 
 #ifndef SU_TAG_IO_H
 /** Defined when <sofia-sip/su_tag_io.h> has been included */
-#define SU_TAG_IO_H 
+#define SU_TAG_IO_H
 
 /**@SU_TAG
  * @file sofia-sip/su_tag_io.h
  * @brief I/O interface for tag lists
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Wed Feb 21 12:10:06 2001 ppessi
  */
 
@@ -52,8 +52,8 @@
 su_inline tag_value_t tag_socket_v(su_socket_t v) {
   return (tag_value_t)v;
 }
-su_inline tag_value_t tag_socket_vr(su_socket_t *vp) { 
-  return (tag_value_t)vp; 
+su_inline tag_value_t tag_socket_vr(su_socket_t *vp) {
+  return (tag_value_t)vp;
 }
 #else
 #define tag_socket_v(v)   (tag_value_t)(v)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h	Tue Dec 23 07:37:03 2008
@@ -26,11 +26,11 @@
 /** Defined when <sofia-sip/su_tagarg.h> has been included. */
 #define SU_TAGARG_H
 
-/**@SU_TAG 
+/**@SU_TAG
  * @file sofia-sip/su_tagarg.h  Tagged argument lists
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Feb 20 19:48:18 2001 ppessi
  */
 
@@ -54,14 +54,14 @@
  *
  * Such a function could be called as follows:
  * @code
- *   tag_print(stdout, 
- *             TAG_STRING("a is"), TAG_INT(a), 
+ *   tag_print(stdout,
+ *             TAG_STRING("a is"), TAG_INT(a),
  *             TAG_STRING("b is"), URLTAG_URL(b),
  *             TAG_IF(c, TAG_STRING("and c is true")),
  *             TAG_END());
  * @endcode
  *
- * @note 
+ * @note
  * The tagged argument list @b must be terminated by a TAG_END(),
  * TAG_NULL() or TAG_NEXT().
  */
@@ -180,7 +180,7 @@
   (ta).tl[0].t_tag, (ta).tl[0].t_value, (ta).tl[1].t_tag, (ta).tl[1].t_value
 
 /**Handle return from function with tagged argument list
- * 
+ *
  * The ta_end() macro handles return from function whose tagged argument
  * list was initialized by ta_start().
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_time.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_time.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_time.h	Tue Dec 23 07:37:03 2008
@@ -26,9 +26,9 @@
 /** Defined when <sofia-sip/su_time.h> has been included. */
 #define SU_TIME_H
 /**@ingroup su_time
- * @file sofia-sip/su_time.h 
+ * @file sofia-sip/su_time.h
  * @brief Time types and functions.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @date Created: Thu Mar 18 19:40:51 1999 pessi
  *
@@ -40,35 +40,35 @@
 
 SOFIA_BEGIN_DECLS
 
-/** Time in seconds and microsecondcs. 
+/** Time in seconds and microsecondcs.
  *
  * The structure su_time_t contains time in seconds and microseconds since
  * epoch (January 1, 1900).
  */
-struct su_time_s { 
+struct su_time_s {
   unsigned long tv_sec;		/**< Seconds */
   unsigned long tv_usec;	/**< Microseconds  */
 };
 /** Time in seconds and microsecondcs. */
 typedef struct su_time_s su_time_t;
 
-/** Time difference in microseconds. 
- * 
+/** Time difference in microseconds.
+ *
  * The type su_duration_t is used to present small time differences (24
  * days), usually calculated between two su_time_t timestamps.  Note that
  * the su_duration_t is signed.
  */
 typedef long su_duration_t;
 
-enum { 
+enum {
   /** Maximum duration in milliseconds. */
-  SU_DURATION_MAX = 0x7fffffffL 
+  SU_DURATION_MAX = 0x7fffffffL
 };
 #define SU_DURATION_MAX SU_DURATION_MAX
 
-/** NTP timestamp. 
- * 
- * NTP timestamp is defined as microseconds since epoch (1-Jan-1900) 
+/** NTP timestamp.
+ *
+ * NTP timestamp is defined as microseconds since epoch (1-Jan-1900)
  * with 64-bit resolution.
  */
 typedef uint64_t su_ntp_t;
@@ -79,11 +79,11 @@
 #define SU_TIME_CMP(t1, t2) su_time_cmp(t1, t2)
 
 /** Seconds from 1.1.1900 to 1.1.1970. @NEW_1_12_4. */
-#define SU_TIME_EPOCH 2208988800UL 
+#define SU_TIME_EPOCH 2208988800UL
 
 typedef uint64_t su_nanotime_t;
 
-#define SU_E9 (1000000000U) 
+#define SU_E9 (1000000000U)
 
 SOFIAPUBFUN su_nanotime_t su_nanotime(su_nanotime_t *return_time);
 SOFIAPUBFUN su_nanotime_t su_monotime(su_nanotime_t *return_time);
@@ -111,12 +111,25 @@
 SOFIAPUBFUN uint32_t su_ntp_fraq(su_time_t t);
 SOFIAPUBFUN uint32_t su_time_ms(su_time_t t);
 #else
+su_inline uint32_t su_ntp_fraq(su_time_t t);
+su_inline uint32_t su_time_ms(su_time_t t);
+#endif
+
+SOFIAPUBFUN su_ntp_t su_ntp_hilo(uint32_t hi, uint32_t lo);
+
+SOFIAPUBFUN uint64_t su_counter(void);
+
+SOFIAPUBFUN uint64_t su_nanocounter(void);
+
+SOFIAPUBFUN uint32_t su_random(void);
+
+#if SU_HAVE_INLINE
 /** Middle 32 bit of NTP timestamp. */
 su_inline uint32_t su_ntp_fraq(su_time_t t)
 {
   /*
    * Multiply usec by 0.065536 (ie. 2**16 / 1E6)
-   * 
+   *
    * Utilize fact that 0.065536 == 1024 / 15625
    */
   return (t.tv_sec << 16) + (1024 * t.tv_usec + 7812) / 15625;
@@ -129,14 +142,6 @@
 }
 #endif
 
-SOFIAPUBFUN su_ntp_t su_ntp_hilo(uint32_t hi, uint32_t lo);
-
-SOFIAPUBFUN uint64_t su_counter(void);
-
-SOFIAPUBFUN uint64_t su_nanocounter(void);
-
-SOFIAPUBFUN uint32_t su_random();
-
 SOFIA_END_DECLS
 
 #endif /* !defined(SU_TIME_H) */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_types.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_types.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_types.h	Tue Dec 23 07:37:03 2008
@@ -28,7 +28,7 @@
 /**@file sofia-sip/su_types.h Basic integer types for @b su library.
  *
  * This include file provides <stdint.h> or <inttypes.h> types.
- *  
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @date Created: Thu Mar 18 19:40:51 1999 pessi
  */
@@ -79,21 +79,21 @@
 typedef unsigned SU_INTPTR_T uintptr_t;
 #endif
 
-/** 64-bit unsigned integer */ 
+/** 64-bit unsigned integer */
 typedef SU_U64_T uint64_t;
-/** 64-bit signed integer */   
+/** 64-bit signed integer */
 typedef SU_S64_T int64_t;
-/** 32-bit unsigned integer */ 
+/** 32-bit unsigned integer */
 typedef SU_U32_T uint32_t;
-/** 32-bit signed integer */   
+/** 32-bit signed integer */
 typedef SU_S32_T int32_t;
-/** 16-bit unsigned integer */ 
+/** 16-bit unsigned integer */
 typedef SU_U16_T uint16_t;
-/** 16-bit signed integer */   
+/** 16-bit signed integer */
 typedef SU_S16_T int16_t;
-/** 8-bit unsigned integer */  
+/** 8-bit unsigned integer */
 typedef SU_U8_T  uint8_t;
-/** 8-bit signed integer */    
+/** 8-bit signed integer */
 typedef SU_S8_T  int8_t;
 
 /** At least 64-bit integer */
@@ -119,9 +119,9 @@
 #endif
 
 #ifdef SOFIA_ISIZE_T
-/** Compatibility type. 
+/** Compatibility type.
  *
- * sofia-sip <= 1.12.1 often used int for count of bytes. 
+ * sofia-sip <= 1.12.1 often used int for count of bytes.
  * When configured for compatibility with sofia-sip 1.12.0, this is defined
  * as int, otherwise as size_t. Note that int is signed and size_t is
  * unsigned.
@@ -134,9 +134,9 @@
 #endif
 
 #ifdef SOFIA_ISSIZE_T
-/**Compatibility type. 
+/**Compatibility type.
  *
- * sofia-sip <= 1.12.1 used int for count of bytes. 
+ * sofia-sip <= 1.12.1 used int for count of bytes.
  * When configured for compatibility with sofia-sip 1.12.0, this is defined
  * as int, otherwise as ssize_t. (-1 is used for error indication).
  *
@@ -148,9 +148,9 @@
 #endif
 
 #ifdef SOFIA_USIZE_T
-/**Compatibility type. 
+/**Compatibility type.
  *
- * sofia-sip <= 1.12.1 sometimes used unsigned int for count of bytes. 
+ * sofia-sip <= 1.12.1 sometimes used unsigned int for count of bytes.
  * When configured for compatibility with sofia-sip 1.12.0, this is defined
  * as unsigned int, otherwise as size_t.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_uniqueid.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_uniqueid.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_uniqueid.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef SU_UNIQUEID_H
 /** Defined when <sofia-sip/su_uniqueid.h> has been included. */
-#define SU_UNIQUEID_H 
+#define SU_UNIQUEID_H
 
 
 /**@ingroup su_uniqueid
@@ -33,7 +33,7 @@
  * Functions to handle GloballyUniqueIDs.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Apr 15 06:31:41 1997 pessi
  *
  */
@@ -45,8 +45,8 @@
 SOFIA_BEGIN_DECLS
 
 /** Globally unique identifier type. */
-typedef union GloballyUniqueIdentifier { 
-  unsigned char id[16]; 
+typedef union GloballyUniqueIdentifier {
+  unsigned char id[16];
   struct {
     uint32_t  time_low;
     uint16_t  time_mid;
@@ -60,8 +60,8 @@
 /** Return node identifier */
 SOFIAPUBFUN size_t su_node_identifier(void *address, size_t addrlen);
 
-/** Generate a GUID 
- * 
+/** Generate a GUID
+ *
  * The function guid_generate() generates a new globally unique identifier
  * for an IP telephony call.  The guid follows the structure specified in
  * the ITU-T recommendation H.225.0 v2.  The guid is usable also in SIP
@@ -78,19 +78,19 @@
  * H.225.0 v2.  The printed identifier can be used as a SIP @b Call-ID if
  * the colons in IEEE MAC address are replaced with '-', '+' or other
  * character allowed in SIP @e token.
- * 
+ *
  * @param buf  [out] buffer to store the formatted globally unique identifier
  * @param len  [in] size of buffer @a buf (should be at least guid_strlen bytes)
  * @param guid [in] pointer to structure containing globally unique identifier
- * 
- * @retval 
+ *
+ * @retval
  * The function guid_sprintf() returns length of the formatted
  * globally unique identifier excluding the final NUL.
  */
 SOFIAPUBFUN isize_t su_guid_sprintf(char* buf, size_t len, su_guid_t const *guid);
 
-enum { 
-  /** Length of guid in hex format */ 
+enum {
+  /** Length of guid in hex format */
   su_guid_strlen = 8 + 5 + 5 + 5 + 13
 };
 
@@ -102,7 +102,7 @@
  * @param lb [in] lower bound
  * @param ub [in] upper bound
  *
- * @return 
+ * @return
 * The function randint() returns a pseudo-random integer.
  */
 SOFIAPUBFUN int su_randint(int lb, int ub);
@@ -117,7 +117,7 @@
 SOFIAPUBFUN void *su_randmem(void *mem, size_t siz);
 
 /** Generate a random 32-bit integer. */
-SOFIAPUBFUN uint32_t su_random();
+SOFIAPUBFUN uint32_t su_random(void);
 
 SOFIA_END_DECLS
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_vector.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_vector.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_vector.h	Tue Dec 23 07:37:03 2008
@@ -28,9 +28,9 @@
 
 /**@file sofia-sip/su_vector.h
  * @brief Vector interface
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- *  
+ *
  * @date Created: Fri Sep 27 14:31:15 2002 ppessi
  */
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_wait.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_wait.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_wait.h	Tue Dec 23 07:37:03 2008
@@ -31,7 +31,7 @@
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Martti Mela <Martti.Mela at nokia.com>
- * 
+ *
  * @date Created: Tue Sep 14 15:51:04 1999 ppessi
  */
 
@@ -236,8 +236,8 @@
 typedef SU_ROOT_MAGIC_T su_root_magic_t;
 
 #ifndef SU_WAKEUP_ARG_T
-/**Default type of @link ::su_wakeup_f wakeup function @endlink 
- * @link ::su_wakeup_arg_t argument type @endlink.  
+/**Default type of @link ::su_wakeup_f wakeup function @endlink
+ * @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 <sofia-sip/su_wait.h>, for example,
@@ -249,7 +249,7 @@
 #define SU_WAKEUP_ARG_T void
 #endif
 
-/** @link ::su_wakeup_f Wakeup callback @endlink argument type. 
+/** @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 <sofia-sip/su_wait.h>, for example,
@@ -260,7 +260,7 @@
  */
 typedef SU_WAKEUP_ARG_T su_wakeup_arg_t;
 
-/** Wakeup callback function pointer type. 
+/** Wakeup callback function pointer type.
  *
  * Whenever a registered wait object receives an event, the @link
  * ::su_wakeup_f callback function @endlink is invoked.
@@ -269,7 +269,7 @@
 			   su_wait_t *,
 			   su_wakeup_arg_t *arg);
 
-enum { 
+enum {
   su_pri_normal,		/**< Normal priority */
   su_pri_first,			/**< Elevated priority */
   su_pri_realtime		/**< Real-time priority */
@@ -310,9 +310,9 @@
 typedef SU_PREPOLL_MAGIC_T su_prepoll_magic_t;
 
 
-/** Pre-poll callback function prototype. 
+/** Pre-poll callback function prototype.
+ *
  *
- * 
  */
 typedef void su_prepoll_f(su_prepoll_magic_t *, su_root_t *);
 
@@ -327,7 +327,7 @@
 /** Default type of timer expiration callback function argument type.
  * Application may define this to appropriate type before including
  * <sofia-sip/su_wait.h>. */
-#define SU_TIMER_ARG_T void 
+#define SU_TIMER_ARG_T void
 #endif
 
 /** Timer object type. */
@@ -337,7 +337,7 @@
 typedef SU_TIMER_ARG_T su_timer_arg_t;
 
 /** Timeout function type. */
-typedef void (*su_timer_f)(su_root_magic_t *magic, 
+typedef void (*su_timer_f)(su_root_magic_t *magic,
 			   su_timer_t *t,
 			   su_timer_arg_t *arg);
 
@@ -372,7 +372,7 @@
 /** Default type of su_msg_t message data.  Application may define this to
  * appropriate type before including <sofia-sip/su_wait.h>.
  */
-#define SU_MSG_ARG_T void 
+#define SU_MSG_ARG_T void
 #endif
 
 /** Message argument type. */
@@ -394,7 +394,7 @@
 #define SU_MSG_R_INIT   { NULL }
 
 /** Message delivery function type. */
-typedef void su_msg_function(su_root_magic_t *magic, 
+typedef void su_msg_function(su_root_magic_t *magic,
 			     su_msg_r msg,
 			     su_msg_arg_t *arg);
 
@@ -454,14 +454,14 @@
 SOFIAPUBFUN char const *su_root_name(su_root_t *self);
 SOFIAPUBFUN int su_root_set_magic(su_root_t *self, su_root_magic_t *magic);
 SOFIAPUBFUN su_root_magic_t *su_root_magic(su_root_t *root);
-SOFIAPUBFUN int su_root_register(su_root_t*, su_wait_t *, 
+SOFIAPUBFUN int su_root_register(su_root_t*, su_wait_t *,
 				 su_wakeup_f, su_wakeup_arg_t *,
 				 int priority);
 /* This is slow. Deprecated. */
-SOFIAPUBFUN int su_root_unregister(su_root_t*, su_wait_t *, 
+SOFIAPUBFUN int su_root_unregister(su_root_t*, su_wait_t *,
 				   su_wakeup_f, su_wakeup_arg_t*);
 SOFIAPUBFUN int su_root_deregister(su_root_t*, int);
-SOFIAPUBFUN int su_root_eventmask(su_root_t *, 
+SOFIAPUBFUN int su_root_eventmask(su_root_t *,
 				  int index, int socket, int events);
 SOFIAPUBFUN su_duration_t su_root_step(su_root_t *root, su_duration_t timeout);
 SOFIAPUBFUN su_duration_t su_root_sleep(su_root_t *root, su_duration_t);
@@ -471,8 +471,8 @@
 SOFIAPUBFUN _su_task_r su_root_task(su_root_t const *root);
 SOFIAPUBFUN _su_task_r su_root_parent(su_root_t const *root);
 
-SOFIAPUBFUN int su_root_add_prepoll(su_root_t *root, 
-				    su_prepoll_f *, 
+SOFIAPUBFUN int su_root_add_prepoll(su_root_t *root,
+				    su_prepoll_f *,
 				    su_prepoll_magic_t *);
 SOFIAPUBFUN int su_root_remove_prepoll(su_root_t *root);
 
@@ -494,13 +494,13 @@
 SOFIAPUBFUN int su_timer_set_at(su_timer_t *, su_timer_f,
 				su_timer_arg_t *, su_time_t);
 SOFIAPUBFUN int su_timer_run(su_timer_t *, su_timer_f, su_timer_arg_t *);
-SOFIAPUBFUN int su_timer_set_for_ever(su_timer_t *, su_timer_f, 
+SOFIAPUBFUN int su_timer_set_for_ever(su_timer_t *, su_timer_f,
 				      su_timer_arg_t *);
 SOFIAPUBFUN int su_timer_reset(su_timer_t *);
 
 SOFIAPUBFUN su_root_t *su_timer_root(su_timer_t const *);
 
-SOFIAPUBFUN int su_timer_expire(su_timer_queue_t * const, 
+SOFIAPUBFUN int su_timer_expire(su_timer_queue_t * const,
 				su_duration_t *tout,
 				su_time_t now);
 
@@ -526,7 +526,7 @@
 
 /* Messages */
 SOFIAPUBFUN int su_msg_create(su_msg_r msg,
-			      su_task_r const to, su_task_r const from, 
+			      su_task_r const to, su_task_r const from,
 			      su_msg_f wakeup, isize_t size);
 SOFIAPUBFUN int su_msg_report(su_msg_r msg, su_msg_f report);
 SOFIAPUBFUN int su_msg_deinitializer(su_msg_r msg, su_msg_deinit_function *);
@@ -543,7 +543,7 @@
 
 SOFIAPUBFUN int su_msg_new(su_msg_r msg, size_t size);
 SOFIAPUBFUN int su_msg_send_to(su_msg_r msg,
-			       su_task_r const to, 
+			       su_task_r const to,
 			       su_msg_f wakeup);
 
 /** Does reference contain a message? */
@@ -559,10 +559,10 @@
 
 /* Clones */
 SOFIAPUBFUN int su_root_threading(su_root_t *self, int enable);
-SOFIAPUBFUN int su_clone_start(su_root_t *root, 
+SOFIAPUBFUN int su_clone_start(su_root_t *root,
 			       su_clone_r,
 			       su_root_magic_t *magic,
-			       su_root_init_f, 
+			       su_root_init_f,
 			       su_root_deinit_f);
 SOFIAPUBFUN _su_task_r su_clone_task(su_clone_r);
 SOFIAPUBFUN void su_clone_forget(su_clone_r);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/tstdef.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/tstdef.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/tstdef.h	Tue Dec 23 07:37:03 2008
@@ -25,14 +25,14 @@
 /**@file sofia-sip/tstdef.h Macros for unit tests
  *
  * The macros defined here can be used by unit test programs. When a test
- * fails, the TEST macros print the offending file name and line number. 
+ * fails, the TEST macros print the offending file name and line number.
  * They use format that is accepted by Emacs and other fine editors so you
  * can directly go to the source code of the failed test with next-error.
- * 
- * @note There is no protection agains multiple inclusion. 
+ *
+ * @note There is no protection agains multiple inclusion.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Wed Aug 22 13:53:24 2001 ppessi
  *
  * @par Example Program
@@ -45,50 +45,50 @@
  *
  * You should typedef longlong to integer type at least 64 bit wide before
  * including <sofia-sip/tstdef.h>, too.
- * 
+ *
  * As an example, we provide a test program making sure that inet_ntop() and
  * inet_pton() behave as expected and that we can create UDP/IPv4 sockets
  * with @b su library:
  *
  * @code
  * #include "config.h"
- * 
+ *
  * #include <stdio.h>
  * #include <limits.h>
- * 
+ *
  * #include <sofia-sip/su.h>
- * 
+ *
  * #define TSTFLAGS tstflags
  *
  * #include <stdlib.h>
  * #include <sofia-sip/tstdef.h>
  *
  * static int tstflags = 0;
- * 
+ *
  * void usage(void)
  * {
  *   fprintf(stderr, "usage: %s [-v|--verbatim]\n", name);
  *   exit(2);
  * }
- * 
+ *
  * static int socket_test(void);
- * 
+ *
  * int main(int argc, char *argv[])
  * {
  *   int retval = 0, i;
- * 
+ *
  *   for (i = 1; argv[i]; i++) {
  *     if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--verbatim") == 0)
  *       tstflags |= tst_verbatim;
  *     else
  *       usage();
  *   }
- * 
+ *
  *   retval |= socket_test(); fflush(stdout);
- * 
+ *
  *   return retval;
  * }
- * 
+ *
  * double max_bandwidth()
  *
  * int socket_test(void)
@@ -99,19 +99,19 @@
  *   unsigned long addr;
  *
  *   BEGIN();
- * 
+ *
  *   // Check inet_ntop() return value (Tests equality of integral values)
  *   TEST(inet_ntop(AF_INET, &localhost, buf, sizeof buf), buf);
- * 
+ *
  *   // Check inet_ntop() result (Tests equality of strings)
  *   TEST_S(buf, "127.0.0.1");
- * 
+ *
  *   // Check inet_pton() argument validation (Tests equality of ints)
  *   TEST(inet_pton(0, buf, &addr), -1);
- * 
+ *
  *   // Check inet_pton() return value (Tests for true value (non-zero))
  *   TEST_1(inet_pton(AF_INET, buf, &addr) > 0);
- * 
+ *
  *   // Check inet_pton() result (Tests equality of memory areas)
  *   TEST_M(&addr, &localhost, sizeof(addr));
  *
@@ -158,7 +158,7 @@
 /** End a test function. @HIDE */
 #define END() (void) tstdef_dummy; } END_(TSTFLAGS)
 /**Test that @a suite returns a nonzero value.
- * @deprecated Use TEST_1() 
+ * @deprecated Use TEST_1()
  * @HIDE */
 #define TEST0(suite) TEST_1_(TSTFLAGS, suite)
 /** Test that @a suite returns a nonzero value. @HIDE */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/strcasestr.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/strcasestr.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/strcasestr.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@internal @file strcasestr.c
  * @brief Backup implementation of strcasestr()
- *  
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  */
 
@@ -67,7 +67,7 @@
       }
     }
     haystack++;
-  } 
+  }
 
   return NULL;		/* Not found */
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/strtoull.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/strtoull.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/strtoull.c	Tue Dec 23 07:37:03 2008
@@ -1,4 +1,4 @@
-/* 
+/*
  * strtoull.c --
  *
  *	Source code for the "strtoull" library procedure.
@@ -8,7 +8,7 @@
  *
 The following license.terms for information on usage and redistribution
 of this individual file, and for a DISCLAIMER OF ALL WARRANTIES.
- 
+
 This software is copyrighted by the Regents of the University of
 California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
 Corporation and other parties.  The following terms apply to all files
@@ -40,7 +40,7 @@
 
 GOVERNMENT USE: If you are acquiring this software on behalf of the
 U.S. government, the Government shall have only "Restricted Rights"
-in the software and related documentation as defined in the Federal 
+in the software and related documentation as defined in the Federal
 Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you
 are acquiring the software on behalf of the Department of Defense, the
 software shall be classified as "Commercial Computer Software" and the
@@ -48,7 +48,7 @@
 252.227-7013 (c) (1) of DFARs.  Notwithstanding the foregoing, the
 authors grant the U.S. Government and others acting in its behalf
 permission to use and distribute the software in accordance with the
-terms specified in this license. 
+terms specified in this license.
  */
 
 #include "config.h"
@@ -132,7 +132,7 @@
      * If no base was provided, pick one from the leading characters
      * of the string.
      */
-    
+
     if (base == 0) {
 	if (*p == '0') {
 	    p += 1;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su.c	Tue Dec 23 07:37:03 2008
@@ -24,13 +24,13 @@
 
 /**@ingroup su_socket
  * @CFILE su.c OS-independent socket functions
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Mar 18 19:40:51 1999 pessi
  */
 
-#include "config.h" 
+#include "config.h"
 
 #if HAVE_SYS_SOCKIO_H
 #include <sys/sockio.h>
@@ -68,12 +68,12 @@
 
 /** Create a socket endpoint for communication.
  *
- * @param af addressing family 
- * @param socktype socket type 
+ * @param af addressing family
+ * @param socktype socket type
  * @param proto protocol number specific to the addressing family
  *
  * The newly created socket is nonblocking unless global variable
- * su_socket_blocking is set to true. 
+ * su_socket_blocking is set to true.
  *
  * Also, the newly created socket is closed on exec() if global variable
  * su_socket_close_on_exec is set to true. Note that a multithreaded program
@@ -109,7 +109,7 @@
 
   /* Assign socket to an already active access point (interface) */
   ioctl(s, SIOCSIFNAME, &ifr);
-  ioctl(s, SIOCIFSTART, &ifr);	
+  ioctl(s, SIOCIFSTART, &ifr);
 #endif
 
   return s;
@@ -123,7 +123,7 @@
 extern void *su_localinfo_ap_set(su_sockaddr_t *su, int *index);
 extern int su_localinfo_ap_deinit(void *aconn);
 #define NUMIFS 64
-  
+
 int su_localinfo_ap_name_to_index(int ap_index)
 {
   struct ifconf ifc;
@@ -136,7 +136,7 @@
   s= socket(AF_INET, SOCK_STREAM, 0);
   if (s < 0)
     return -1;
-  
+
   ifc.ifc_len = NUMIFS * sizeof (struct ifreq);
 
   memset(buf, 0, ifc.ifc_len);
@@ -179,12 +179,12 @@
 #error Unknown index field in struct ifreq
 #endif
 
-    if (ap_index == if_index) 
+    if (ap_index == if_index)
     {
       strncpy(su_global_ap_name, (const char *) if_name, sizeof(su_global_ap_name));
       error = 0;
     };
-  
+
 #else
 #error su_localinfo() cannot map interface name to number
 #endif
@@ -200,8 +200,8 @@
 /** Initialize socket implementation.
  *
  * Before using any sofia-sip-ua functions, the application should call
- * su_init() in order to initialize run-time environment including sockets. 
- * This function may prepare plugins if there are any. 
+ * su_init() in order to initialize run-time environment including sockets.
+ * This function may prepare plugins if there are any.
  *
  * @par POSIX Implementation
  * The su_init() initializes debugging logs and ignores the SIGPIPE signal.
@@ -260,7 +260,7 @@
   if (mode < 0)
      return -1;
 
-  if (blocking) 
+  if (blocking)
     mode &= ~(O_NDELAY | O_NONBLOCK);
   else
     mode |= O_NDELAY | O_NONBLOCK;
@@ -320,7 +320,7 @@
 int su_setblocking(su_socket_t s, int blocking)
 {
   unsigned long nonBlock = !blocking;
-  
+
   return ioctlsocket(s, FIONBIO, &nonBlock);
 }
 
@@ -350,7 +350,7 @@
 
 int su_setreuseaddr(su_socket_t s, int reuse)
 {
-  return setsockopt(s, SOL_SOCKET, SO_REUSEADDR, 
+  return setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
 		    (void *)&reuse, (socklen_t)sizeof(reuse));
 }
 
@@ -442,7 +442,7 @@
   if (length > INT_MAX)
     length = INT_MAX;
 
-  retval = recvfrom(s, buffer, (int)length, flags, 
+  retval = recvfrom(s, buffer, (int)length, flags,
 		    &from->su_sa, fromlen ? &ilen : NULL);
 
   if (fromlen)
@@ -458,7 +458,7 @@
 {
   int ret;
   DWORD bytes_sent = (DWORD)su_failure;
-  
+
   ret = WSASendTo(s,
 		  (LPWSABUF)iov,
 		  (DWORD)iovlen,
@@ -552,13 +552,13 @@
 
   if ((rv = a->su_family - b->su_family))
     return rv;
-  
+
   if (a->su_family == AF_INET)
-    rv = memcmp(&a->su_sin.sin_addr, &b->su_sin.sin_addr, 
+    rv = memcmp(&a->su_sin.sin_addr, &b->su_sin.sin_addr,
 		sizeof(struct in_addr));
 #if SU_HAVE_IN6
   else if (a->su_family == AF_INET6)
-    rv = memcmp(&a->su_sin6.sin6_addr, &b->su_sin6.sin6_addr, 
+    rv = memcmp(&a->su_sin6.sin6_addr, &b->su_sin6.sin6_addr,
 		sizeof(struct in6_addr));
 #endif
   else
@@ -566,7 +566,7 @@
 
   if (rv)
     return rv;
-  
+
   return a->su_port - b->su_port;
 }
 
@@ -592,7 +592,7 @@
   if (a->su_family == 0 || SU_SOCKADDR_INADDR_ANY(a))
     ;
   else if (a->su_family == AF_INET) {
-    if (memcmp(&a->su_sin.sin_addr, &b->su_sin.sin_addr, 
+    if (memcmp(&a->su_sin.sin_addr, &b->su_sin.sin_addr,
 	       sizeof(struct in_addr)))
       return 0;
   }
@@ -600,7 +600,7 @@
   else if (a->su_family == AF_INET6) {
     if (a->su_scope_id != 0 && a->su_scope_id != b->su_scope_id)
       return 0;
-    if (memcmp(&a->su_sin6.sin6_addr, &b->su_sin6.sin6_addr, 
+    if (memcmp(&a->su_sin6.sin6_addr, &b->su_sin6.sin6_addr,
 	       sizeof(struct in6_addr)))
       return 0;
   }
@@ -610,7 +610,7 @@
 
   if (a->su_port == 0)
     return 1;
-  
+
   return a->su_port == b->su_port;
 }
 
@@ -624,10 +624,10 @@
   if (!IN6_IS_ADDR_V4MAPPED(&su->su_sin6.sin6_addr) &&
       !IN6_IS_ADDR_V4COMPAT(&su->su_sin6.sin6_addr))
     return;
-  
+
   su->su_family = AF_INET;
   su->su_array32[1] = su->su_array32[5];
-  su->su_array32[2] = 0; 
+  su->su_array32[2] = 0;
   su->su_array32[3] = 0;
 #endif
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su.docs	Tue Dec 23 07:37:03 2008
@@ -6,11 +6,11 @@
  *
  * The @b su module contains a simple, portable socket/timing/synchronizing
  * library developed for Sofia communications software.
- * 
+ *
  * @CONTACT Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @STATUS @SofiaSIP Core library
- * 
+ *
  * @LICENSE LGPL
  *
  * @section su_overview Overview
@@ -19,9 +19,9 @@
  *
  * - <sofia-sip/su_types.h> - integral types
  * - <sofia-sip/su_alloc.h> - @ref su_alloc memory management
- * - <sofia-sip/su.h> - @ref su_socket 
+ * - <sofia-sip/su.h> - @ref su_socket
  *   - <sofia-sip/su_localinfo.h> - get list of local IP addresses
- * - <sofia-sip/su_wait.h> - @ref su_wait 
+ * - <sofia-sip/su_wait.h> - @ref su_wait
  * - <sofia-sip/su_time.h> - @ref su_time
  * - <sofia-sip/su_log.h> - @ref su_log
  * - <sofia-sip/su_tag.h> - @ref su_tag
@@ -62,19 +62,19 @@
  * - <a href=group_su_alloc.html>su_alloc</a> - memory management functions
  * - <a href=group_su_log.html>su_log</a> - generic logging functions
  * - <a href=group_su_tag.html>su_tag</a> - tag list function
- * - <a href=group_su_md5.html>su_md5</a> - MD5 hashing 
+ * - <a href=group_su_md5.html>su_md5</a> - MD5 hashing
  */
 
 /**@defgroup su_programs Shell Programs
- * 
+ *
  * The @b su module provides few shell utilities:
  * - @ref localinfo (localinfo.c)
- * - @ref addrinfo (addrinfo.c) 
+ * - @ref addrinfo (addrinfo.c)
  */
 
 /**@defgroup su_socket Socket Functions
  *
- *  @brief The <sofia-sip/su.h> contains the portable socket functions. 
+ *  @brief The <sofia-sip/su.h> contains the portable socket functions.
  *
  *  The <sofia-sip/su.h> contains following functions, macros, and types:
  *    - su_init(): initializes sockets
@@ -84,7 +84,7 @@
  *    - su_ioctl(): ioctl to a socket
  *    - su_setreuseaddr(): set/reset reusing the addresses/ports for a socket
  *    - su_setblocking(): enables/disables blocking
- *    - su_is_blocking(): checks if the previous call failed because it 
+ *    - su_is_blocking(): checks if the previous call failed because it
  *  	would have blocked
  *    - su_errno(): the latest socket error
  *    - su_perror(): prints the latest socket error message to stderr

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_addrinfo.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_addrinfo.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_addrinfo.c	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -13,7 +13,7 @@
  * 3. Neither the name of the project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -83,7 +83,7 @@
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 
 };
-static const char in_loopback[] = { 127, 0, 0, 1 }; 
+static const char in_loopback[] = { 127, 0, 0, 1 };
 static const char in6_loopback[] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
 };
@@ -100,7 +100,7 @@
 	int a_socklen;
 	int a_off;
 	const char *a_addrany;
-	const char *a_loopback;	
+	const char *a_loopback;
 } gai_afdl [] = {
 #if SU_HAVE_IN6
 #define N_INET6 0
@@ -142,7 +142,7 @@
 static int get_addr(const char *, int, struct addrinfo **,
 		    struct addrinfo *, int);
 static int str_isnumber(const char *);
-	
+
 #define GET_CANONNAME(ai, str) \
 if (pai->ai_flags & AI_CANONNAME) {\
 	if (((ai)->ai_canonname = (char *)malloc(strlen(str) + 1)) != NULL) {\
@@ -243,7 +243,7 @@
 	pai->ai_addr = NULL;
 	pai->ai_next = NULL;
 	port = GAI_ANY;
-	
+
 	if (hostname == NULL && servname == NULL)
 		return EAI_NONAME;
 	if (hints) {
@@ -373,7 +373,7 @@
 			}
 		}
 	}
-	
+
 	/*
 	 * hostname == NULL.
 	 * passive socket -> anyaddr (0.0.0.0 or ::)
@@ -408,7 +408,7 @@
 		else
 			ERR(EAI_FAMILY);
 	}
-	
+
 	/* hostname as numeric name */
 	for (i = 0; gai_afdl[i].a_af; i++) {
 		if (su_inet_pton(gai_afdl[i].a_af, hostname, pton)) {
@@ -432,7 +432,7 @@
 				break;
 #endif
 			}
-			
+
 			if (pai->ai_family == gai_afdl[i].a_af ||
 			    pai->ai_family == PF_UNSPEC) {
 				if (! (pai->ai_flags & AI_CANONNAME)) {
@@ -450,7 +450,7 @@
 				 */
 				get_name(pton, &gai_afdl[i], &top, pton, pai, port);
 				goto good;
-			} else 
+			} else
 				ERR(EAI_FAMILY);	/*xxx*/
 		}
 	}
@@ -489,7 +489,7 @@
 	struct hostent *hp;
 	struct addrinfo *cur;
 	int error = 0, h_error;
-	
+
 #if SU_HAVE_IN6
 	hp = getipnodebyaddr(addr, gai_afd->a_addrlen, gai_afd->a_af, &h_error);
 #else
@@ -500,7 +500,7 @@
 		GET_CANONNAME(cur, hp->h_name);
 	} else
 		GET_AI(cur, gai_afd, numaddr, port);
-	
+
 #if SU_HAVE_IN6
 	if (hp)
 		freehostent(hp);
@@ -568,7 +568,7 @@
 	if ((hp->h_name == NULL) || (hp->h_name[0] == 0) ||
 	    (hp->h_addr_list[0] == NULL))
 		ERR(EAI_FAIL);
-	
+
 	for (i = 0; (ap = hp->h_addr_list[i]) != NULL; i++) {
 		switch (af) {
 #if SU_HAVE_IN6
@@ -700,7 +700,7 @@
 #else
 	len = salen;
 #endif
-	
+
 	family = sa->sa_family;
 	for (i = 0; gni_afdl[i].a_af; i++)
 		if (gni_afdl[i].a_af == family) {
@@ -708,10 +708,10 @@
 			goto found;
 		}
 	return ENI_FAMILY;
-	
+
  found:
 	if (len != gni_afd->a_socklen) return ENI_SALEN;
-	
+
 	port = ((struct gni_sockinet *)sa)->si_port; /* network byte order */
 	addr = (char *)sa + gni_afd->a_off;
 
@@ -739,7 +739,7 @@
 			flags |= NI_NUMERICHOST;
 		v4a >>= IN_CLASSA_NSHIFT;
 		if (v4a == 0 || v4a == IN_LOOPBACKNET)
-			flags |= NI_NUMERICHOST;			
+			flags |= NI_NUMERICHOST;
 		break;
 #if SU_HAVE_IN6
 	case AF_INET6:
@@ -799,7 +799,7 @@
 #endif	/* !HAVE_GETNAMEINFO */
 
 #if !HAVE_FREEADDRINFO
-static 
+static
 void
 freeaddrinfo(ai)
 	struct addrinfo *ai;
@@ -820,13 +820,13 @@
 #endif
 
 #if !HAVE_GAI_STRERROR
-static 
+static
 char *
 gai_strerror(ecode)
 	int ecode;
 {
   switch (ecode) {
-  case 0: 
+  case 0:
     return "success.";
 #if defined(EAI_ADDRFAMILY)
   case EAI_ADDRFAMILY:
@@ -908,7 +908,7 @@
     int socktype;
 
     socktype = hints->ai_socktype;
-    
+
     if (!(socktype == 0 ||
 	  socktype == SOCK_SEQPACKET ||
 	  socktype == SOCK_STREAM ||
@@ -950,7 +950,7 @@
 	continue;
       }
 
-      if (ai->ai_family != AF_INET 
+      if (ai->ai_family != AF_INET
 #if SU_HAVE_IN6
 	  && ai->ai_family != AF_INET6
 #endif
@@ -992,7 +992,7 @@
 	       int flags)
 {
   return getnameinfo(&su->su_sa, (socklen_t)sulen,
-		     return_host, (socklen_t)hostlen, 
-		     return_serv, (socklen_t)servlen, 
+		     return_host, (socklen_t)hostlen,
+		     return_serv, (socklen_t)servlen,
 		     flags);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c	Tue Dec 23 07:37:03 2008
@@ -43,7 +43,7 @@
  *   ...
  * }
  * @endcode
- * 
+ *
  * A new home memory pool can be created with su_home_new():
  * @code
  * struct context *ctx = su_home_new(sizeof (struct context));
@@ -58,7 +58,7 @@
  *
  * Note that the tophome has a reference to @a ctx structure; whenever
  * tophome is freed, the @a ctx is also freed.
- * 
+ *
  * You can also create an independent home object by passing NULL as @a
  * tophome argument. This is identical to the call to su_home_new().
  *
@@ -92,7 +92,7 @@
  * @code
  *    su_free(tophome, ctx);
  * @endcode
- * 
+ *
  * @note
  *
  * The su_home_destroy() function is deprecated as it does not free the home
@@ -122,13 +122,13 @@
  * and one wants to keep the allocations, the allocations can be combined
  * into an existing home with su_home_move(). For example,
  * @code
- * int example(su_home_t *home, ...) 
+ * int example(su_home_t *home, ...)
  * {
  *   su_home_t temphome[1] = { SU_HOME_INIT(temphome) };
- *   
+ *
  *   ... do lot of allocations with temphome ...
- *  
- *   if (success) 
+ *
+ *   if (success)
  *     su_home_move(home, temphome);
  *   su_home_deinit(temphome);
  *
@@ -156,7 +156,7 @@
  * allocator is used. The overhead caused by the large number of small
  * allocations can be reduced by using su_home_preload(): it allocates or
  * preloads some a memory to home to be used as a kind of private heap. The
- * preloaded memory area is then used to satisfy small enough allocations. 
+ * preloaded memory area is then used to satisfy small enough allocations.
  * For instance, the SIP parser typically preloads some 2K of memory when it
  * starts to parse the message.
  *
@@ -177,7 +177,7 @@
  * @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
  */
 
@@ -224,13 +224,13 @@
 #define MEMCHECK_EXTRA sizeof (size_t)
 #endif
 
-enum { 
+enum {
   SUB_N = 31,			/**< Initial size */
   SUB_N_AUTO = 7,		/**< Initial size for autohome */
   SUB_P = 29			/**< Secondary probe.
-				 * Secondary probe must be relative prime 
+				 * Secondary probe must be relative prime
 				 * with all sub_n values */
-};		
+};
 
 #define ALIGNMENT (8)
 #define ALIGN(n) (size_t)(((n) + (ALIGNMENT - 1)) & (size_t)~(ALIGNMENT - 1))
@@ -279,7 +279,7 @@
 size_t count_su_block_find, count_su_block_find_loop;
 size_t size_su_block_find, used_su_block_find;
 size_t max_size_su_block_find, max_used_su_block_find;
-size_t su_block_find_collision, su_block_find_collision_used, 
+size_t su_block_find_collision, su_block_find_collision_used,
   su_block_find_collision_size;
 #endif
 
@@ -287,7 +287,7 @@
 {
   size_t h, h0, probe;
 
-#if SU_ALLOC_STATS  
+#if SU_ALLOC_STATS
   size_t collision = 0;
 
   count_su_block_find++;
@@ -315,7 +315,7 @@
       h -= b->sub_n;
 #if SU_ALLOC_STATS
     if (++collision > su_block_find_collision)
-      su_block_find_collision = collision, 
+      su_block_find_collision = collision,
 	su_block_find_collision_used = b->sub_used,
 	su_block_find_collision_size = b->sub_n;
     count_su_block_find_loop++;
@@ -350,8 +350,8 @@
 su_inline int su_is_preloaded(su_block_t const *sub, char *data)
 {
   return
-    sub->sub_preload && 
-    sub->sub_preload <= data && 
+    sub->sub_preload &&
+    sub->sub_preload <= data &&
     sub->sub_preload + sub->sub_prsize > data;
 }
 
@@ -414,14 +414,14 @@
  *             if > 1, allocate a subhome
  *
  */
-static 
-void *sub_alloc(su_home_t *home, 
+static
+void *sub_alloc(su_home_t *home,
 		su_block_t *sub,
 		size_t size,
 		enum sub_zero zero)
 {
   void *data, *preload = NULL;
-  
+
   assert (size < (((size_t)1) << SIZEBITS));
 
   if (size >= ((size_t)1) << SIZEBITS)
@@ -472,7 +472,7 @@
   if (size && sub && zero < do_clone &&
       sub->sub_preload && size <= sub->sub_prsize) {
     /* Use preloaded memory */
-    size_t prused = sub->sub_prused + size + MEMCHECK_EXTRA; 
+    size_t prused = sub->sub_prused + size + MEMCHECK_EXTRA;
     prused = ALIGN(prused);
     if (prused <= sub->sub_prsize) {
       preload = (char *)sub->sub_preload + sub->sub_prused;
@@ -501,13 +501,13 @@
       sub->sub_auto_all = 0;
 
     if (zero >= do_clone) {
-      /* Prepare cloned home */ 
+      /* Prepare cloned home */
       su_home_t *subhome = data;
 
       assert(preload == 0);
 
       subhome->suh_blocks = su_hash_alloc(SUB_N);
-      if (!subhome->suh_blocks) 
+      if (!subhome->suh_blocks)
 	return (void)safefree(data), NULL;
 
       subhome->suh_size = (unsigned)size;
@@ -532,7 +532,7 @@
  *
  * Create a home object used to collect multiple memory allocations under
  * one handle. The memory allocations made using this home object is freed
- * either when this home is destroyed. 
+ * either when this home is destroyed.
  *
  * The maximum @a size of a home object is INT_MAX (2 gigabytes).
  *
@@ -580,7 +580,7 @@
       UNLOCK(home);
       return NULL;
     }
-    
+
     if (sub->sub_ref != REF_MAX)
       sub->sub_ref++;
     UNLOCK(home);
@@ -746,7 +746,7 @@
 /** Return true if home is a clone. */
 int su_home_has_parent(su_home_t const *home)
 {
-  return home && !home->suh_lock && 
+  return home && !home->suh_lock &&
     home->suh_blocks && home->suh_blocks->sub_parent;
 }
 
@@ -905,8 +905,8 @@
  * Creates a home object. A home object is used to collect multiple memory
  * allocations, so that they all can be freed by calling su_home_unref().
  *
- * @return This function returns a pointer to an #su_home_t object, or 
- * NULL upon an error. 
+ * @return This function returns a pointer to an #su_home_t object, or
+ * NULL upon an error.
  */
 su_home_t *su_home_create(void)
 {
@@ -950,7 +950,7 @@
  *
  * @sa SU_HOME_INIT(), su_home_deinit(), su_home_new(), su_home_clone()
  *
- * @bug 
+ * @bug
  * Prior to @VERSION_1_12_8 the su_home_t structure should have been
  * initialized with SU_HOME_INIT() or otherwise zeroed before calling
  * su_home_init().
@@ -958,7 +958,7 @@
 int su_home_init(su_home_t *home)
 {
   su_block_t *sub;
-    
+
   if (home == NULL)
     return -1;
 
@@ -1020,17 +1020,15 @@
     home->suh_blocks = NULL;
 
     if (home->suh_lock) {
-#ifdef WIN32
-      UNLOCK(home); /* we must unlock here or windows leaks handles on the next call because the mutex is locked */
-#endif
-/* "In the LinuxThreads implementation, no resources are associated with mutex objects,
-   thus pthread_mutex_destroy actually does nothing except checking that the mutex is unlocked. "
-   In the Windows pthread implementation we must free the handles that are allocated */
-      _su_home_destroy_mutexes(home->suh_lock);
+		void *suh_lock = home->suh_lock;
+
+		home->suh_lock = NULL;
+
+		/* Unlock, or risk assert() or leak handles on Windows */
+		_su_home_unlocker(suh_lock);
+		_su_home_destroy_mutexes(suh_lock);
     }
   }
-
-  home->suh_lock = NULL;
 }
 
 /** Free memory blocks allocated through home.
@@ -1089,7 +1087,7 @@
 	destructor(src);
       }
 
-      if (d) 
+      if (d)
 	used = s->sub_used + d->sub_used;
       else
 	used = s->sub_used;
@@ -1109,7 +1107,7 @@
 	dst->suh_blocks = d2;
 
       	for (i = 0; i < n; i++)
-	  if (d->sub_nodes[i].sua_data) 
+	  if (d->sub_nodes[i].sua_data)
 	    su_block_add(d2, d->sub_nodes[i].sua_data)[0] = d->sub_nodes[i];
 
 	if (d) {
@@ -1149,7 +1147,7 @@
     UNLOCK(dst); UNLOCK(src);
   }
   else {
-    s = MEMLOCK(src); 
+    s = MEMLOCK(src);
 
     if (s && s->sub_used) {
       s->sub_used = 0;
@@ -1173,7 +1171,7 @@
   if (home == NULL)
     return;
 
-  if (home->suh_blocks == NULL) 
+  if (home->suh_blocks == NULL)
     su_home_init(home);
 
   sub = MEMLOCK(home);
@@ -1249,7 +1247,7 @@
  *   @param home  pointer to memory pool object
  *   @param data  pointer to old memory block
  *   @param size  size of the memory block to be allocated
- *   
+ *
  * @return
  *   A pointer to the allocated memory block or
  *   NULL if an error occurred.
@@ -1262,7 +1260,7 @@
   size_t p;
   size_t term = 0 - size;
 
-  if (!home) 
+  if (!home)
     return realloc(data, size);
 
   if (size == 0) {
@@ -1282,11 +1280,11 @@
 
   if (!su_alloc_check(sub, sua))
     return UNLOCK(home);
-  
+
   assert(!sua->sua_home);
   if (sua->sua_home)
     return UNLOCK(home);
-  
+
   if (!su_is_preloaded(sub, data)) {
     ndata = realloc(data, size + MEMCHECK_EXTRA);
     if (ndata) {
@@ -1356,7 +1354,7 @@
       if (sub->sub_stats)
 	su_home_stats_free(sub, data, data, sua->sua_size);
     }
-    
+
     memcpy(ndata, data,
 	   (size_t)sua->sua_size < size
 	   ? (size_t)sua->sua_size
@@ -1409,7 +1407,7 @@
 
     UNLOCK(home);
   }
-  
+
   return retval;
 }
 
@@ -1450,7 +1448,7 @@
  *
  * Allocates a structure with a given size, zeros
  * it, and initializes the size field to the given size.  The size field
- * is an int at the beginning of the structure. Note that it has type of int. 
+ * is an int at the beginning of the structure. Note that it has type of int.
  *
  * @param home  pointer to memory pool object
  * @param size  size of the structure
@@ -1463,12 +1461,12 @@
  *     char *tst_name;
  *     void *tst_ptr[3];
  *   };
- * 
+ *
  *   struct test *t;
  *   ...
- *   t = su_salloc(home, sizeof (*t)); 
+ *   t = su_salloc(home, sizeof (*t));
  *   assert(t && t->t_size == sizeof (*t));
- *   
+ *
  * @endcode
  * After calling su_salloc() we get a pointer t to a struct test,
  * initialized to zero except the tst_size field, which is initialized to
@@ -1505,13 +1503,13 @@
   return home && home->suh_lock;
 }
 
-/** Increase refcount and obtain exclusive lock on home. 
+/** Increase refcount and obtain exclusive lock on home.
  *
  * @note The #su_home_t structure must be created with su_home_new() or
  * su_home_clone(), or initialized with su_home_init() before using this
- * function. 
+ * function.
  *
- * In order to enable actual locking, use su_home_threadsafe(), too. 
+ * In order to enable actual locking, use su_home_threadsafe(), too.
  * Otherwise the su_home_mutex_lock() will just increase the reference
  * count.
  */
@@ -1559,7 +1557,7 @@
 }
 
 
-/** Obtain exclusive lock on home without increasing refcount. 
+/** Obtain exclusive lock on home without increasing refcount.
  *
  * Unless su_home_threadsafe() has been used to intialize locking on home
  * object the function just returns -1.
@@ -1582,9 +1580,9 @@
 }
 
 
-/** Try to obtain exclusive lock on home without increasing refcount. 
+/** Try to obtain exclusive lock on home without increasing refcount.
  *
- * @return 0 if successful, -1 if not threadsafe, 
+ * @return 0 if successful, -1 if not threadsafe,
  * EBUSY if already locked, error code otherwise.
  *
  * @sa su_home_lock(), su_home_unlock().
@@ -1649,7 +1647,7 @@
   }
   else
     size = sub->sub_stats->hs_size;
-  
+
   memset(sub->sub_stats, 0, size);
   sub->sub_stats->hs_size = (int)size;
   sub->sub_stats->hs_blocksize = sub->sub_n;
@@ -1657,7 +1655,7 @@
 
 /** Retrieve statistics from memory home.
  */
-void su_home_get_stats(su_home_t *home, int include_clones, 
+void su_home_get_stats(su_home_t *home, int include_clones,
 		       su_home_stat_t *hs,
 		       isize_t size)
 {
@@ -1683,7 +1681,7 @@
   UNLOCK(home);
 }
 
-static 
+static
 void su_home_stats_alloc(su_block_t *sub, void *p, void *preload,
 			 size_t size, int zero)
 {
@@ -1706,13 +1704,13 @@
   hs->hs_allocs.hsa_rbytes += rsize;
   if (hs->hs_allocs.hsa_rbytes > hs->hs_allocs.hsa_maxrbytes)
     hs->hs_allocs.hsa_maxrbytes = hs->hs_allocs.hsa_rbytes;
-  
+
   hs->hs_blocks.hsb_number++;
   hs->hs_blocks.hsb_bytes += size;
   hs->hs_blocks.hsb_rbytes += rsize;
 }
 
-static 
+static
 void su_home_stats_free(su_block_t *sub, void *p, void *preload,
 			unsigned size)
 {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_alloc_lock.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_alloc_lock.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_alloc_lock.c	Tue Dec 23 07:37:03 2008
@@ -23,11 +23,11 @@
  */
 
 /**@ingroup su_alloc
- * @CFILE su_alloc_lock.c 
+ * @CFILE su_alloc_lock.c
  * @brief Thread-locking for su_alloc module.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Fri Feb 23 17:38:11 2001 ppessi
  */
 
@@ -57,7 +57,7 @@
   return pthread_mutex_lock(mutex + 1);
 }
 
-int mutex_trylocker(void *_mutex)
+static int mutex_trylocker(void *_mutex)
 {
   pthread_mutex_t *mutex = _mutex;
   return pthread_mutex_trylock(mutex + 1);
@@ -121,7 +121,7 @@
   if (mutex) {
     /* Mutex for memory operations */
     pthread_mutex_init(mutex, NULL);
-    /* Mutex used for explicit locking */ 
+    /* Mutex used for explicit locking */
     pthread_mutex_init(mutex + 1, NULL);
     home->suh_lock = (void *)mutex;
     return 0;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c	Tue Dec 23 07:37:03 2008
@@ -39,7 +39,7 @@
 #include "config.h"
 
 #define su_base_port_s su_port_s
-#define SU_CLONE_T su_msg_t 
+#define SU_CLONE_T su_msg_t
 
 #include "sofia-sip/su.h"
 #include "su_port.h"
@@ -98,7 +98,7 @@
  *
  * Currently this is only used if SU_HAVE_PTHREADS is 0.
  */
-int su_base_port_thread(su_port_t const *self, 
+int su_base_port_thread(su_port_t const *self,
 			enum su_port_thread_op op)
 {
   switch (op) {
@@ -120,7 +120,7 @@
 void su_base_port_incref(su_port_t *self, char const *who)
 {
   su_home_ref(self->sup_home);
-  PORT_REFCOUNT_DEBUG(("incref(%p) to %u by %s\n", self, 
+  PORT_REFCOUNT_DEBUG(("incref(%p) to %u by %s\n", self,
 		       su_home_refcount(self->sup_home), who));
 }
 
@@ -128,14 +128,14 @@
 {
   int zapped = su_home_unref(self->sup_home);
 
-  PORT_REFCOUNT_DEBUG(("%s(%p) to %u%s by %s\n", 
+  PORT_REFCOUNT_DEBUG(("%s(%p) to %u%s by %s\n",
 		       blocking ? "zapref" : "decref",
 		       self, zapped ? 0 : su_home_refcount(self->sup_home),
 		       blocking && !zapped ? " FAILED" :"",
 		       who));
 
   /* We should block until all references are destroyed */
-  if (blocking) 
+  if (blocking)
     /* ...but we just abort() */
     assert(zapped);
 
@@ -159,7 +159,7 @@
     int wakeup;
 
     su_port_lock(self, "su_port_send");
-    
+
     wakeup = self->sup_head == NULL;
 
     *self->sup_tail = rmsg[0]; rmsg[0] = NULL;
@@ -219,7 +219,7 @@
       *tail = msg, *next = msg->sum_next, tail = &msg->sum_next;
     }
     else
-      next = &msg->sum_next;      
+      next = &msg->sum_next;
   }
 
   *tail = NULL, self->sup_tail = next;
@@ -248,11 +248,11 @@
       *tail = msg, *next = msg->sum_next, tail = &msg->sum_next;
     }
     else
-      next = &msg->sum_next;      
+      next = &msg->sum_next;
   }
 
   *tail = NULL, self->sup_tail = next;
-  
+
   su_port_unlock(self, "su_base_port_getmsgs_of_root");
 
   return su_base_port_execute_msgs(selected);
@@ -293,7 +293,7 @@
  *
  * @param self      pointer to port object
  * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
- * 
+ *
  * @retval 0 multishot mode is disabled
  * @retval 1 multishot mode is enabled
  * @retval -1 an error occurred
@@ -304,16 +304,16 @@
 }
 
 /** @internal Main loop.
- * 
+ *
  * The function @c su_port_run() waits for wait objects and the timers
  * associated with the port object.  When any wait object is signaled or
  * timer is expired, it invokes the callbacks, and returns waiting.
- * 
+ *
  * The function @c su_port_run() runs until @c su_port_break() is called
  * from a callback.
- * 
+ *
  * @param self     pointer to port object
- * 
+ *
  */
 void su_base_port_run(su_port_t *self)
 {
@@ -395,27 +395,27 @@
 /** @internal
  * The function @c su_port_break() is used to terminate execution of @c
  * su_port_run(). It can be called from a callback function.
- * 
+ *
  * @param self     pointer to port
- * 
+ *
  */
 void su_base_port_break(su_port_t *self)
 {
-  self->sup_running = 0; 
+  self->sup_running = 0;
 }
 
 /** @internal Block until wait object is signaled or timeout.
  *
- * This function waits for wait objects and the timers associated with 
+ * This function waits for wait objects and the timers associated with
  * the root object.  When any wait object is signaled or timer is
- * expired, it invokes the callbacks. 
- * 
+ * expired, it invokes the callbacks.
+ *
  *   This function returns when a callback has been invoked or @c tout
- *   milliseconds is elapsed. 
+ *   milliseconds is elapsed.
  *
  * @param self     pointer to port
  * @param tout     timeout in milliseconds
- * 
+ *
  * @return
  *   Milliseconds to the next invocation of timer, or @c SU_WAIT_FOREVER if
  *   there are no active timers.
@@ -465,8 +465,8 @@
  */
 
 int su_base_port_add_prepoll(su_port_t *self,
-			     su_root_t *root, 
-			     su_prepoll_f *callback, 
+			     su_root_t *root,
+			     su_prepoll_f *callback,
 			     su_prepoll_magic_t *magic)
 {
   if (self->sup_prepoll)
@@ -501,8 +501,8 @@
   return &self->sup_timers;
 }
 
-/* ====================================================================== 
- * Clones 
+/* ======================================================================
+ * Clones
  */
 
 #define SU_TASK_COPY(d, s, by) (void)((d)[0]=(s)[0], \
@@ -529,7 +529,7 @@
   child->sur_deinit = deinit;
   child->sur_threading = parent->sur_threading;
 
-  SU_TASK_COPY(child->sur_parent, su_root_task(parent), 
+  SU_TASK_COPY(child->sur_parent, su_root_task(parent),
 	       su_base_port_clone_start);
   SU_TASK_COPY(child->sur_task, child->sur_parent,
 	       su_base_port_clone_start);
@@ -564,7 +564,7 @@
  * @internal
  *
  * Called by su_port_wait() and su_clone_wait()
- */ 
+ */
 void su_base_port_wait(su_clone_r rclone)
 {
   su_port_t *self;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_bm.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_bm.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_bm.c	Tue Dec 23 07:37:03 2008
@@ -25,11 +25,11 @@
 /**@internal
  * @file su_bm.c
  * @brief Search with Boyer-Moore algorithm
- *  
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Mon Apr 11 16:35:16 2005 ppessi
- * 
+ *
  */
 
 #include "config.h"
@@ -47,7 +47,7 @@
 #define TORTURELOG(x) (void)0
 #endif
 
-struct bw_fwd_table { 
+struct bw_fwd_table {
   unsigned char table[UCHAR_MAX + 1];
 };
 
@@ -81,7 +81,7 @@
  * naive implementation if the searched substring is shorter than the cache
  * line.
  *
- */ 
+ */
 
 /**@ingroup su_bm
  * @typedef struct bw_fwd_table bm_fwd_table_t;
@@ -90,7 +90,7 @@
  *
  */
 
-/** Build case-sensitive forward skip table #bm_fwd_table_t 
+/** Build case-sensitive forward skip table #bm_fwd_table_t
  *  for Boyer-Moore algorithm.
  * @ingroup su_bm
  */
@@ -134,9 +134,9 @@
   for (i = j = nlen - 1; i < hlen;) {
     unsigned char h = haystack[i];
     if (h == needle[j]) {
-      TORTURELOG(("match \"%s\" at %u\nwith  %*s\"%.*s*%s\": %s\n", 
-		  haystack, (unsigned)i, 
-		  (int)(i - j), "", (int)j, needle, needle + j + 1, 
+      TORTURELOG(("match \"%s\" at %u\nwith  %*s\"%.*s*%s\": %s\n",
+		  haystack, (unsigned)i,
+		  (int)(i - j), "", (int)j, needle, needle + j + 1,
 		  j == 0 ? "match!" : "back by 1"));
       if (j == 0)
 	return (char *)haystack + i;
@@ -145,24 +145,24 @@
     else {
       if (fwd->table[h] > nlen - j) {
 	TORTURELOG(("match \"%s\" at %u\n"
-		    "last  %*s\"%.*s*%s\": (by %u)\n", 
+		    "last  %*s\"%.*s*%s\": (by %u)\n",
 		    haystack, (unsigned)i,
-		    (int)(i - j), "", 
+		    (int)(i - j), "",
 		    (int)j, needle, needle + j + 1, fwd->table[h]));
       	i += fwd->table[h];
       }
       else {
 	TORTURELOG(("match \"%s\" at %u\n"
-		    "2nd   %*s\"%.*s*%s\": (by %u)\n", 
+		    "2nd   %*s\"%.*s*%s\": (by %u)\n",
 		    haystack, (unsigned)i,
-		    (int)(i - j), "", 
+		    (int)(i - j), "",
 		    (int)j, needle, needle + j + 1, (unsigned)(nlen - j)));
 	i += nlen - j;
       }
       j = nlen - 1;
     }
   }
-  
+
   return NULL;
 }
 
@@ -233,7 +233,7 @@
 
   for (i = j = nlen - 1; i < hlen;) {
     unsigned char h = haystack[i], n = needle[j];
-    if (isupper(h)) 
+    if (isupper(h))
       h = tolower(h);
     if (isupper(n))
       n = tolower(n);
@@ -242,7 +242,7 @@
       TORTURELOG(("match \"%s\" at %u\n"
 		  "with  %*s\"%.*s*%s\": %s\n",
 		  haystack, (unsigned)i,
-		  (int)(i - j), "", (int)j, needle, needle + j + 1, 
+		  (int)(i - j), "", (int)j, needle, needle + j + 1,
 		  j == 0 ? "match!" : "back by 1"));
       if (j == 0)
 	return (char *)haystack + i;
@@ -253,21 +253,21 @@
 	TORTURELOG(("match \"%s\" at %u\n"
 		    "last  %*s\"%.*s*%s\": (by %u)\n",
 		    haystack, (unsigned)i,
-		    (int)(i - j), "", (int)j, needle, needle + j + 1, 
+		    (int)(i - j), "", (int)j, needle, needle + j + 1,
 		    fwd->table[h]));
       	i += fwd->table[h];
       }
       else {
 	TORTURELOG(("match \"%s\" at %u\n"
-		    "2nd   %*s\"%.*s*%s\": (by %u)\n", 
+		    "2nd   %*s\"%.*s*%s\": (by %u)\n",
 		    haystack, (unsigned)i,
-		    (int)(i - j), "", (int)j, needle, needle + j + 1, 
+		    (int)(i - j), "", (int)j, needle, needle + j + 1,
 		    (unsigned)(nlen - j)));
 	i += nlen - j;
       }
       j = nlen - 1;
     }
   }
-  
+
   return NULL;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_default_log.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_default_log.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_default_log.c	Tue Dec 23 07:37:03 2008
@@ -26,7 +26,7 @@
  * @CFILE su_default_log.c
  *
  * Default debug log object.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Fri Feb 23 17:30:46 2001 ppessi
@@ -52,7 +52,7 @@
  *
  * The SOFIA_DEBUG environment variable is used to determine the default
  * debug logging level. The normal level is 3.
- * 
+ *
  * @sa <sofia-sip/su_debug.h>, su_log_global
  */
 extern char const SOFIA_DEBUG[];
@@ -63,7 +63,7 @@
 #define SOFIA_DEBUG_ 3
 #endif
 
-/**Default debug log. 
+/**Default debug log.
  *
  * If a source module does not define a log object, the output from su_log()
  * function or SU_DEBUG_X() macros use this log object. Also, if a log
@@ -80,13 +80,13 @@
  * The level of #su_log_default is set using SOFIA_DEBUG environment
  * variable.
  */
-su_log_t su_log_default[1] = {{ 
-  sizeof(su_log_t), 
+su_log_t su_log_default[1] = {{
+  sizeof(su_log_t),
   "sofia",		/* Log name */
   "SOFIA_DEBUG",	/* Environment variable controlling logging level */
   SOFIA_DEBUG_,		/* Default level */
   SU_LOG_MAX,		/* Maximum log level */
   0,
-  default_logger, 
+  default_logger,
   NULL
 }};

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_devpoll_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_devpoll_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_devpoll_port.c	Tue Dec 23 07:37:03 2008
@@ -58,7 +58,7 @@
 #define POLL2EPOLL_NEEDED \
   (POLLIN != EPOLLIN || POLLOUT != EPOLLOUT || POLLPRI != EPOLLPRI || \
    POLLERR != EPOLLERR || POLLHUP != EPOLLHUP)
- 
+
 #define POLL2EPOLL(e) (e & (POLLIN|POLLOUT|POLLPRI|POLLERR|POLLHUP))
 #define EPOLL2POLL(e) (e & (POLLIN|POLLOUT|POLLPRI|POLLERR|POLLHUP))
 
@@ -71,8 +71,8 @@
   int              sup_devpoll;
   unsigned         sup_multishot; /**< Multishot operation? */
 
-  unsigned         sup_registers; /** Counter incremented by 
-				      su_port_register() or 
+  unsigned         sup_registers; /** Counter incremented by
+				      su_port_register() or
 				      su_port_unregister()
 				   */
   int              sup_n_registrations;
@@ -82,9 +82,9 @@
   /** Structure containing registration data */
   struct su_devpoll {
     struct su_devpoll *ser_next; /* Next in free list */
-    su_wakeup_f     ser_cb; 
-    su_wakeup_arg_t*ser_arg; 
-    su_root_t      *ser_root; 
+    su_wakeup_f     ser_cb;
+    su_wakeup_arg_t*ser_arg;
+    su_root_t      *ser_root;
     int             ser_id; /** registration identifier */
     su_wait_t       ser_wait[1];
   } **sup_indices;
@@ -99,19 +99,19 @@
 				   int blocking,
 				   char const *who);
 static int su_devpoll_port_register(su_port_t *self,
-				  su_root_t *root, 
-				  su_wait_t *wait, 
+				  su_root_t *root,
+				  su_wait_t *wait,
 				  su_wakeup_f callback,
 				  su_wakeup_arg_t *arg,
 				  int priority);
 static int su_devpoll_port_unregister(su_port_t *port,
-				    su_root_t *root, 
-				    su_wait_t *wait,	
-				    su_wakeup_f callback, 
+				    su_root_t *root,
+				    su_wait_t *wait,
+				    su_wakeup_f callback,
 				    su_wakeup_arg_t *arg);
 static int su_devpoll_port_deregister(su_port_t *self, int i);
 static int su_devpoll_port_unregister_all(su_port_t *self, su_root_t *root);
-static int su_devpoll_port_eventmask(su_port_t *self, 
+static int su_devpoll_port_eventmask(su_port_t *self,
 				   int index,
 				   int socket,
 				   int events);
@@ -182,22 +182,22 @@
  *
  *  Please note if identical wait objects are inserted, only first one is
  *  ever signalled.
- * 
+ *
  * @param self	     pointer to port
  * @param root	     pointer to root object
  * @param waits	     pointer to wait object
  * @param callback   callback function pointer
  * @param arg	     argument given to callback function when it is invoked
- * @param priority   relative priority of the wait object 
+ * @param priority   relative priority of the wait object
  *              (0 is normal, 1 important, 2 realtime)
- * 
+ *
  * @return
- *   Positive index of the wait object, 
+ *   Positive index of the wait object,
  *   or -1 upon an error.
  */
 int su_devpoll_port_register(su_port_t *self,
-			     su_root_t *root, 
-			     su_wait_t *wait, 
+			     su_root_t *root,
+			     su_wait_t *wait,
 			     su_wakeup_f callback,
 			     su_wakeup_arg_t *arg,
 			     int priority)
@@ -223,7 +223,7 @@
 
   if (!ser) {
     i = self->sup_max_index, j = i == 0 ? 15 : i + 16;
-    
+
     if (j >= self->sup_size_indices) {
       /* Reallocate index table */
       n = n < 1024 ? 2 * n : n + 1024;
@@ -255,17 +255,17 @@
   if ((size_t)wait->fd >= self->sup_n_devpoll_by_socket) {
     size_t n_devpoll_by_socket = ((size_t)wait->fd + 32) / 32 * 32;
 
-    devpoll_by_socket = su_realloc(h, devpoll_by_socket, 
-				   n_devpoll_by_socket * 
+    devpoll_by_socket = su_realloc(h, devpoll_by_socket,
+				   n_devpoll_by_socket *
 				   (sizeof devpoll_by_socket[0]));
     if (devpoll_by_socket == NULL)
       return -1;
-    
+
     memset(&devpoll_by_socket[self->sup_n_devpoll_by_socket],
 	   0,
-	   (char *)&devpoll_by_socket[n_devpoll_by_socket] - 
+	   (char *)&devpoll_by_socket[n_devpoll_by_socket] -
 	   (char *)&devpoll_by_socket[self->sup_n_devpoll_by_socket]);
-    
+
     self->sup_devpoll_by_socket = devpoll_by_socket;
     self->sup_n_devpoll_by_socket = n_devpoll_by_socket;
   }
@@ -273,7 +273,7 @@
 
   if (devpoll_by_socket[wait->fd])
     /* XXX - we should lift this limitation with epoll, too */
-    return errno = EEXIST, -1;  
+    return errno = EEXIST, -1;
 
   i = ser->ser_id;
 
@@ -282,7 +282,7 @@
   pollfd->revents = 0;
 
   if (write(self->sup_devpoll, pollfd, (sizeof pollfd)) != (sizeof pollfd)) {
-    return errno = EIO, -1;  
+    return errno = EIO, -1;
   }
 
   indices[0] = ser->ser_next;
@@ -327,7 +327,7 @@
 
   if (destroy_wait)
     su_wait_destroy(ser->ser_wait);
-  
+
   memset(ser, 0, sizeof *ser);
   ser->ser_id = i;
   ser->ser_next = indices[0], indices[0] = ser;
@@ -341,25 +341,25 @@
 
 
 /** Unregister a su_wait_t object.
- *  
+ *
  *  The function su_devpoll_port_unregister() unregisters a su_wait_t object. The
  *  wait object, a callback function and a argument are removed from the
  *  port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param root     - pointer to root object
  * @param wait     - pointer to wait object
  * @param callback - callback function pointer (may be NULL)
- * @param arg      - argument given to callback function when it is invoked 
+ * @param arg      - argument given to callback function when it is invoked
  *                   (may be NULL)
  *
- * @deprecated Use su_devpoll_port_deregister() instead. 
+ * @deprecated Use su_devpoll_port_deregister() instead.
  *
  * @return Nonzero index of the wait object, or -1 upon an error.
  */
 int su_devpoll_port_unregister(su_port_t *self,
-			     su_root_t *root, 
-			     su_wait_t *wait,	
+			     su_root_t *root,
+			     su_wait_t *wait,
 			     su_wakeup_f callback, /* XXX - ignored */
 			     su_wakeup_arg_t *arg)
 {
@@ -387,14 +387,14 @@
 }
 
 /** Deregister a su_wait_t object.
- *  
+ *
  *  Deregisters a registration by index. The wait object, a callback
  *  function and a argument are removed from the port object. The wait
  *  object is destroyed.
- * 
+ *
  * @param self     - pointer to port object
  * @param i        - registration index
- * 
+ *
  * @return Index of the wait object, or -1 upon an error.
  */
 int su_devpoll_port_deregister(su_port_t *self, int i)
@@ -417,10 +417,10 @@
  *
  * The function su_devpoll_port_unregister_all() unregisters all su_wait_t
  * objects associated with given root object.
- * 
+ *
  * @param  self     - pointer to port object
  * @param  root     - pointer to root object
- * 
+ *
  * @return Number of wait objects removed.
  */
 int su_devpoll_port_unregister_all(su_port_t *self, su_root_t *root)
@@ -479,7 +479,7 @@
   w[1].revents = 0;
 
   if (write(self->sup_devpoll, w, (sizeof w)) == -1) {
-    SU_DEBUG_1(("su_devpoll_port_eventmask(%p): %d: %s\n", (void *)self, 
+    SU_DEBUG_1(("su_devpoll_port_eventmask(%p): %d: %s\n", (void *)self,
 		socket, su_strerror(su_errno())));
     return -1;
   }
@@ -496,7 +496,7 @@
  *
  * @param self      pointer to port object
  * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
- * 
+ *
  * @retval 0 multishot mode is disabled
  * @retval 1 multishot mode is enabled
  * @retval -1 an error occurred
@@ -508,7 +508,7 @@
     return self->sup_multishot;
   else if (multishot == 0 || multishot == 1)
     return self->sup_multishot = multishot;
-  else 
+  else
     return (errno = EINVAL), -1;
 }
 
@@ -546,7 +546,7 @@
     if (socket < 0 || self->sup_n_devpoll_by_socket <= socket)
       continue;
     ser = self->sup_devpoll_by_socket[socket]; assert(ser);
-      
+
     magic = ser->ser_root ? su_root_magic(ser->ser_root) : NULL;
     ser->ser_wait->revents = ev[j].revents;
     ser->ser_cb(magic, ser->ser_wait, ser->ser_arg);
@@ -554,7 +554,7 @@
     if (version != self->sup_registers)
       /* Callback function used su_register()/su_deregister() */
       break;
-  }    
+  }
 
   return events;
 }
@@ -568,7 +568,7 @@
 
   if (devpoll == -1) {
     /* Fallback to poll() */
-    SU_DEBUG_3(("%s(): open(\"%s\") => %u: %s\n", 
+    SU_DEBUG_3(("%s(): open(\"%s\") => %u: %s\n",
 		"su_devpoll_port_create", "/dev/poll",
 		errno, strerror(errno)));
     return su_poll_port_create();
@@ -581,9 +581,9 @@
   }
 
   if (su_home_destructor(su_port_home(self), su_devpoll_port_deinit) < 0 ||
-      !(self->sup_indices = 
+      !(self->sup_indices =
 	su_zalloc(su_port_home(self),
-		  (sizeof self->sup_indices[0]) * 
+		  (sizeof self->sup_indices[0]) *
 		  (self->sup_size_indices = 64)))) {
     su_home_unref(su_port_home(self));
     close(devpoll);
@@ -608,7 +608,7 @@
 			 su_root_init_f init,
 			 su_root_deinit_f deinit)
 {
-  return su_pthreaded_port_start(su_devpoll_port_create, 
+  return su_pthreaded_port_start(su_devpoll_port_create,
 				 parent, return_clone, magic, init, deinit);
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_epoll_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_epoll_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_epoll_port.c	Tue Dec 23 07:37:03 2008
@@ -58,7 +58,7 @@
 #define POLL2EPOLL_NEEDED \
   (POLLIN != EPOLLIN || POLLOUT != EPOLLOUT || POLLPRI != EPOLLPRI || \
    POLLERR != EPOLLERR || POLLHUP != EPOLLHUP)
- 
+
 #define POLL2EPOLL(e) (e & (POLLIN|POLLOUT|POLLPRI|POLLERR|POLLHUP))
 #define EPOLL2POLL(e) (e & (POLLIN|POLLOUT|POLLPRI|POLLERR|POLLHUP))
 
@@ -71,8 +71,8 @@
   int              sup_epoll;
   unsigned         sup_multishot; /**< Multishot operation? */
 
-  unsigned         sup_registers; /** Counter incremented by 
-				      su_port_register() or 
+  unsigned         sup_registers; /** Counter incremented by
+				      su_port_register() or
 				      su_port_unregister()
 				   */
   int              sup_n_registrations;
@@ -82,9 +82,9 @@
   /** Structure containing registration data */
   struct su_epoll_register {
     struct su_epoll_register *ser_next; /* Next in free list */
-    su_wakeup_f     ser_cb; 
-    su_wakeup_arg_t*ser_arg; 
-    su_root_t      *ser_root; 
+    su_wakeup_f     ser_cb;
+    su_wakeup_arg_t*ser_arg;
+    su_root_t      *ser_root;
     int             ser_id; /** registration identifier */
     su_wait_t       ser_wait[1];
   } **sup_indices;
@@ -94,19 +94,19 @@
 				 int blocking,
 				 char const *who);
 static int su_epoll_port_register(su_port_t *self,
-				  su_root_t *root, 
-				  su_wait_t *wait, 
+				  su_root_t *root,
+				  su_wait_t *wait,
 				  su_wakeup_f callback,
 				  su_wakeup_arg_t *arg,
 				  int priority);
 static int su_epoll_port_unregister(su_port_t *port,
-				    su_root_t *root, 
-				    su_wait_t *wait,	
-				    su_wakeup_f callback, 
+				    su_root_t *root,
+				    su_wait_t *wait,
+				    su_wakeup_f callback,
 				    su_wakeup_arg_t *arg);
 static int su_epoll_port_deregister(su_port_t *self, int i);
 static int su_epoll_port_unregister_all(su_port_t *self, su_root_t *root);
-static int su_epoll_port_eventmask(su_port_t *self, 
+static int su_epoll_port_eventmask(su_port_t *self,
 				   int index,
 				   int socket,
 				   int events);
@@ -174,22 +174,22 @@
  *
  *  Please note if identical wait objects are inserted, only first one is
  *  ever signalled.
- * 
+ *
  * @param self	     pointer to port
  * @param root	     pointer to root object
  * @param waits	     pointer to wait object
  * @param callback   callback function pointer
  * @param arg	     argument given to callback function when it is invoked
- * @param priority   relative priority of the wait object 
+ * @param priority   relative priority of the wait object
  *              (0 is normal, 1 important, 2 realtime)
- * 
+ *
  * @return
- *   Positive index of the wait object, 
+ *   Positive index of the wait object,
  *   or -1 upon an error.
  */
 int su_epoll_port_register(su_port_t *self,
-			   su_root_t *root, 
-			   su_wait_t *wait, 
+			   su_root_t *root,
+			   su_wait_t *wait,
 			   su_wakeup_f callback,
 			   su_wakeup_arg_t *arg,
 			   int priority)
@@ -212,7 +212,7 @@
     su_home_t *h = su_port_home(self);
 
     i = self->sup_max_index, j = i == 0 ? 15 : i + 16;
-    
+
     if (j >= self->sup_size_indices) {
       /* Reallocate index table */
       n = n < 1024 ? 2 * n : n + 1024;
@@ -246,7 +246,7 @@
   ev.events = POLL2EPOLL(wait->events);
   ev.data.u64 = 0;
   ev.data.u32 = (uint32_t)i;
-  
+
   if (epoll_ctl(self->sup_epoll, EPOLL_CTL_ADD, wait->fd, &ev) == -1) {
     SU_DEBUG_0(("EPOLL_CTL_ADD(%u, %u) failed: %s\n",
 		wait->fd, ev.events, strerror(errno)));
@@ -282,13 +282,13 @@
   assert(ser->ser_id == i);
 
   if (epoll_ctl(self->sup_epoll, EPOLL_CTL_DEL, ser->ser_wait->fd, NULL) == -1) {
-    SU_DEBUG_1(("su_port(%p): EPOLL_CTL_DEL(%u): %s\n", (void *)self, 
+    SU_DEBUG_1(("su_port(%p): EPOLL_CTL_DEL(%u): %s\n", (void *)self,
 		ser->ser_wait->fd, su_strerror(su_errno())));
   }
 
   if (destroy_wait)
     su_wait_destroy(ser->ser_wait);
-  
+
   memset(ser, 0, sizeof *ser);
   ser->ser_id = i;
   ser->ser_next = indices[0], indices[0] = ser;
@@ -301,25 +301,25 @@
 
 
 /** Unregister a su_wait_t object.
- *  
+ *
  *  The function su_epoll_port_unregister() unregisters a su_wait_t object. The
  *  wait object, a callback function and a argument are removed from the
  *  port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param root     - pointer to root object
  * @param wait     - pointer to wait object
  * @param callback - callback function pointer (may be NULL)
- * @param arg      - argument given to callback function when it is invoked 
+ * @param arg      - argument given to callback function when it is invoked
  *                   (may be NULL)
  *
- * @deprecated Use su_epoll_port_deregister() instead. 
+ * @deprecated Use su_epoll_port_deregister() instead.
  *
  * @return Nonzero index of the wait object, or -1 upon an error.
  */
 int su_epoll_port_unregister(su_port_t *self,
-			     su_root_t *root, 
-			     su_wait_t *wait,	
+			     su_root_t *root,
+			     su_wait_t *wait,
 			     su_wakeup_f callback, /* XXX - ignored */
 			     su_wakeup_arg_t *arg)
 {
@@ -347,14 +347,14 @@
 }
 
 /** Deregister a su_wait_t object.
- *  
+ *
  *  Deregisters a registration by index. The wait object, a callback
  *  function and a argument are removed from the port object. The wait
  *  object is destroyed.
- * 
+ *
  * @param self     - pointer to port object
  * @param i        - registration index
- * 
+ *
  * @return Index of the wait object, or -1 upon an error.
  */
 int su_epoll_port_deregister(su_port_t *self, int i)
@@ -377,10 +377,10 @@
  *
  * The function su_epoll_port_unregister_all() unregisters all su_wait_t
  * objects associated with given root object.
- * 
+ *
  * @param  self     - pointer to port object
  * @param  root     - pointer to root object
- * 
+ *
  * @return Number of wait objects removed.
  */
 int su_epoll_port_unregister_all(su_port_t *self, su_root_t *root)
@@ -437,7 +437,7 @@
   ev.data.u32 = (uint32_t)index;
 
   if (epoll_ctl(self->sup_epoll, EPOLL_CTL_MOD, socket, &ev) == -1) {
-    SU_DEBUG_1(("su_port(%p): EPOLL_CTL_MOD(%u): %s\n", (void *)self, 
+    SU_DEBUG_1(("su_port(%p): EPOLL_CTL_MOD(%u): %s\n", (void *)self,
 		socket, su_strerror(su_errno())));
     return -1;
   }
@@ -454,7 +454,7 @@
  *
  * @param self      pointer to port object
  * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
- * 
+ *
  * @retval 0 multishot mode is disabled
  * @retval 1 multishot mode is enabled
  * @retval -1 an error occurred
@@ -466,7 +466,7 @@
     return self->sup_multishot;
   else if (multishot == 0 || multishot == 1)
     return self->sup_multishot = multishot;
-  else 
+  else
     return (errno = EINVAL), -1;
 }
 
@@ -487,7 +487,7 @@
 
   int const M = 4;
   struct epoll_event ev[M];
-    
+
   n = epoll_wait(self->sup_epoll, ev, self->sup_multishot ? M : 1, tout);
 
   assert(n <= M);
@@ -508,7 +508,7 @@
     if (version != self->sup_registers)
       /* Callback function used su_register()/su_deregister() */
       return events;
-  }    
+  }
 
   return n;
 }
@@ -522,7 +522,7 @@
 
   if (epoll == -1) {
     /* Fallback to poll() */
-    SU_DEBUG_3(("%s(): epoll_create() => %u: %s\n", 
+    SU_DEBUG_3(("%s(): epoll_create() => %u: %s\n",
 		"su_port_create", epoll, strerror(errno)));
     return su_poll_port_create();
   }
@@ -537,9 +537,9 @@
 	      "su_port_create", (void *)self, self->sup_epoll, "OK"));
 
   if (su_home_destructor(su_port_home(self), su_epoll_port_deinit) < 0 ||
-      !(self->sup_indices = 
+      !(self->sup_indices =
 	su_zalloc(su_port_home(self),
-		  (sizeof self->sup_indices[0]) * 
+		  (sizeof self->sup_indices[0]) *
 		  (self->sup_size_indices = 64)))) {
     su_home_unref(su_port_home(self));
     close(epoll);
@@ -561,7 +561,7 @@
 			 su_root_init_f init,
 			 su_root_deinit_f deinit)
 {
-  return su_pthreaded_port_start(su_epoll_port_create, 
+  return su_pthreaded_port_start(su_epoll_port_create,
 				 parent, return_clone, magic, init, deinit);
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_errno.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_errno.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_errno.c	Tue Dec 23 07:37:03 2008
@@ -23,14 +23,14 @@
  */
 
 /**@CFILE su_errno.c errno compatibility
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Original: Thu Mar 18 19:40:51 1999 pessi
  * @date Split to su_errno.c: Thu Dec 22 18:37:02 EET 2005 pessi
  */
 
-#include "config.h" 
+#include "config.h"
 
 #include <sofia-sip/su_errno.h>
 #include <sofia-sip/su.h>
@@ -128,7 +128,7 @@
   };
   static char buf[64];
 
-  if (errcode < WSABASEERR) 
+  if (errcode < WSABASEERR)
     return strerror(errcode);
 
   if (errcode < 20000)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_global_log.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_global_log.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_global_log.c	Tue Dec 23 07:37:03 2008
@@ -28,7 +28,7 @@
  * Global SU debug log.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Mon May  7 11:08:36 2001 ppessi
  */
 
@@ -45,7 +45,7 @@
  *
  * The SU_DEBUG environment variable is used to determine the debug logging
  * level for @b su module. The default level is 3.
- * 
+ *
  * @sa <sofia-sip/su_debug.h>, su_log_global
  */
 extern char const SU_DEBUG[];
@@ -57,18 +57,18 @@
 #define SU_DEBUG_ 3
 #endif
 
-/**Debug log for @b su module. 
- * 
+/**Debug log for @b su module.
+ *
  * The su_log_global is the log object used by @b su module. The level of
  * #su_log_global is set using #SU_DEBUG environment variable.
  */
-su_log_t su_log_global[1] = {{ 
-  sizeof(su_log_t), 
-  "su", 
-  "SU_DEBUG", 
-  SU_DEBUG_, 
+su_log_t su_log_global[1] = {{
+  sizeof(su_log_t),
+  "su",
+  "SU_DEBUG",
+  SU_DEBUG_,
   SU_LOG_MAX,
   0,
-  NULL, 
+  NULL,
   NULL
 }};

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c	Tue Dec 23 07:37:03 2008
@@ -67,8 +67,8 @@
   int              sup_kqueue;
   unsigned         sup_multishot; /**< Multishot operation? */
 
-  unsigned         sup_registers; /** Counter incremented by 
-				      su_port_register() or 
+  unsigned         sup_registers; /** Counter incremented by
+				      su_port_register() or
 				      su_port_unregister()
 				   */
   int              sup_n_registrations;
@@ -80,9 +80,9 @@
   /** Structure containing registration data */
   struct su_register {
     struct su_register *ser_next; /* Next in free list */
-    su_wakeup_f     ser_cb; 
-    su_wakeup_arg_t*ser_arg; 
-    su_root_t      *ser_root; 
+    su_wakeup_f     ser_cb;
+    su_wakeup_arg_t*ser_arg;
+    su_root_t      *ser_root;
     int             ser_id; /** registration identifier */
     su_wait_t       ser_wait[1];
   } **sup_indices;
@@ -91,19 +91,19 @@
 static void su_kqueue_port_decref(su_port_t *, int blocking, char const *who);
 
 static int su_kqueue_port_register(su_port_t *self,
-				 su_root_t *root, 
-				 su_wait_t *wait, 
+				 su_root_t *root,
+				 su_wait_t *wait,
 				 su_wakeup_f callback,
 				 su_wakeup_arg_t *arg,
 				 int priority);
 static int su_kqueue_port_unregister(su_port_t *port,
-				   su_root_t *root, 
-				   su_wait_t *wait,	
-				   su_wakeup_f callback, 
+				   su_root_t *root,
+				   su_wait_t *wait,
+				   su_wakeup_f callback,
 				   su_wakeup_arg_t *arg);
 static int su_kqueue_port_deregister(su_port_t *self, int i);
 static int su_kqueue_port_unregister_all(su_port_t *self, su_root_t *root);
-static int su_kqueue_port_eventmask(su_port_t *self, 
+static int su_kqueue_port_eventmask(su_port_t *self,
 				  int index,
 				  int socket,
 				  int events);
@@ -171,22 +171,22 @@
  *
  *  Please note if identical wait objects are inserted, only first one is
  *  ever signalled.
- * 
+ *
  * @param self	     pointer to port
  * @param root	     pointer to root object
  * @param waits	     pointer to wait object
  * @param callback   callback function pointer
  * @param arg	     argument given to callback function when it is invoked
- * @param priority   relative priority of the wait object 
+ * @param priority   relative priority of the wait object
  *              (0 is normal, 1 important, 2 realtime)
- * 
+ *
  * @return
- *   Positive index of the wait object, 
+ *   Positive index of the wait object,
  *   or -1 upon an error.
  */
 int su_kqueue_port_register(su_port_t *self,
-			    su_root_t *root, 
-			    su_wait_t *wait, 
+			    su_root_t *root,
+			    su_wait_t *wait,
 			    su_wakeup_f callback,
 			    su_wakeup_arg_t *arg,
 			    int priority)
@@ -210,7 +210,7 @@
     su_home_t *h = su_port_home(self);
 
     i = self->sup_max_index, j = i == 0 ? 15 : i + 16;
-    
+
     if (j >= self->sup_size_indices) {
       /* Reallocate index table */
       n = n < 1024 ? 2 * n : n + 1024;
@@ -310,7 +310,7 @@
 
   if (destroy_wait)
     su_wait_destroy(wait);
-  
+
   memset(ser, 0, sizeof *ser);
   ser->ser_id = i;
   ser->ser_next = indices[0], indices[0] = ser;
@@ -323,25 +323,25 @@
 
 
 /** Unregister a su_wait_t object.
- *  
+ *
  *  The function su_kqueue_port_unregister() unregisters a su_wait_t object. The
  *  wait object, a callback function and a argument are removed from the
  *  port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param root     - pointer to root object
  * @param wait     - pointer to wait object
  * @param callback - callback function pointer (may be NULL)
- * @param arg      - argument given to callback function when it is invoked 
+ * @param arg      - argument given to callback function when it is invoked
  *                   (may be NULL)
  *
- * @deprecated Use su_kqueue_port_deregister() instead. 
+ * @deprecated Use su_kqueue_port_deregister() instead.
  *
  * @return Nonzero index of the wait object, or -1 upon an error.
  */
 int su_kqueue_port_unregister(su_port_t *self,
-			      su_root_t *root, 
-			      su_wait_t *wait,	
+			      su_root_t *root,
+			      su_wait_t *wait,
 			      su_wakeup_f callback, /* XXX - ignored */
 			      su_wakeup_arg_t *arg)
 {
@@ -369,14 +369,14 @@
 }
 
 /** Deregister a su_wait_t object.
- *  
+ *
  *  Deregisters a registration by index. The wait object, a callback
  *  function and a argument are removed from the port object. The wait
  *  object is destroyed.
- * 
+ *
  * @param self     - pointer to port object
  * @param i        - registration index
- * 
+ *
  * @return Index of the wait object, or -1 upon an error.
  */
 int su_kqueue_port_deregister(su_port_t *self, int i)
@@ -398,13 +398,13 @@
  *
  * The function su_kqueue_port_unregister_all() unregisters all su_wait_t objects
  * and destroys all queued timers associated with given root object.
- * 
+ *
  * @param  self     - pointer to port object
  * @param  root     - pointer to root object
- * 
+ *
  * @return Number of wait objects removed.
  */
-int su_kqueue_port_unregister_all(su_port_t *self, 
+int su_kqueue_port_unregister_all(su_port_t *self,
 				su_root_t *root)
 {
   int i, I, n;
@@ -490,7 +490,7 @@
  *
  * @param self      pointer to port object
  * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
- * 
+ *
  * @retval 0 multishot mode is disabled
  * @retval 1 multishot mode is enabled
  * @retval -1 an error occurred
@@ -502,7 +502,7 @@
     return self->sup_multishot;
   else if (multishot == 0 || multishot == 1)
     return self->sup_multishot = multishot;
-  else 
+  else
     return (errno = EINVAL), -1;
 }
 
@@ -523,7 +523,7 @@
 
   int const M = 4;
   struct kevent ev[M];
-  
+
   struct timespec ts;
 
   ts.tv_sec = tout / 1000;
@@ -534,7 +534,7 @@
 	     tout < SU_DURATION_MAX ? &ts : NULL);
 
   assert(n <= M);
-  
+
   for (j = 0; j < n; j++) {
     struct su_register *ser;
     su_root_magic_t *magic;
@@ -559,7 +559,7 @@
 	/* Callback function used su_register()/su_deregister() */
 	return events;
     }
-  }    
+  }
 
   return n;
 }
@@ -589,7 +589,7 @@
 
   self->sup_kqueue = kq, kq = -1;
   self->sup_indices = su_zalloc(su_port_home(self),
-				(sizeof self->sup_indices[0]) * 
+				(sizeof self->sup_indices[0]) *
 				(self->sup_size_indices = 64));
   if (!self->sup_indices)
     goto failed;
@@ -614,7 +614,7 @@
 			su_root_init_f init,
 			su_root_deinit_f deinit)
 {
-  return su_pthreaded_port_start(su_kqueue_port_create, 
+  return su_pthreaded_port_start(su_kqueue_port_create,
 				 parent, return_clone, magic, init, deinit);
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c	Tue Dec 23 07:37:03 2008
@@ -29,7 +29,7 @@
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Martti Mela <Martti.Mela at nokia.com>
- * 
+ *
  * @date Created: Wed Oct  4 14:09:29 EET 2000 ppessi
  */
 
@@ -118,9 +118,9 @@
  * - #LI_V4MAPPED: when returning IPv4 addresses, map them as IPv6
  *   addresses.  If this flag is specified, IPv4 addresses are returned even
  *   if @a hints->li_family is set to @c AF_INET6.
- * - #LI_CANONNAME: return the domain name (DNS PTR) corresponding to the 
+ * - #LI_CANONNAME: return the domain name (DNS PTR) corresponding to the
  *   local address in @a li_canonname.
- * - #LI_NAMEREQD: Do not return addresses not in DNS. 
+ * - #LI_NAMEREQD: Do not return addresses not in DNS.
  * - #LI_NUMERIC: instead of domain name, return the text presentation of
  *   the addresss in @a li_canonname.
  * - #LI_DOWN: include interfaces and their addresses even if the interfaces
@@ -151,12 +151,12 @@
  * matching scope are returned. The different address scopes can be combined
  * with bitwise or. They are defined as follows
  * - #LI_SCOPE_HOST: host-local address, valid within host (::1, 127.0.0.1/8)
- * - #LI_SCOPE_LINK: link-local address, valid within link 
- *   (IP6 addresses with prefix fe80::/10, 
+ * - #LI_SCOPE_LINK: link-local address, valid within link
+ *   (IP6 addresses with prefix fe80::/10,
  *    IP4 addresses in net 169.254.0.0/16).
  * - #LI_SCOPE_SITE: site-local address, addresses valid within organization
  *   (IPv6 addresses with prefix  fec::/10,
- *    private IPv4 addresses in nets 10.0.0.0/8, 172.16.0.0/12, 
+ *    private IPv4 addresses in nets 10.0.0.0/8, 172.16.0.0/12,
  *    and 192.168.0.0/16 as defined in @RFC1918)
  * - #LI_SCOPE_GLOBAL: global address.
  *
@@ -173,13 +173,13 @@
  *
  * @return Zero (#ELI_NOERROR) when successful, or negative error code when
  * failed.
- * 
+ *
  * @par Diagnostics
  * Use su_gli_strerror() in order to obtain a string describing the error
  * code returned by su_getlocalinfo().
  *
  */
-int su_getlocalinfo(su_localinfo_t const *hints, 
+int su_getlocalinfo(su_localinfo_t const *hints,
 		    su_localinfo_t **return_localinfo)
 {
   int error = 0, ip4 = 0, ip6 = 0;
@@ -214,14 +214,14 @@
     break;
 
   case 0:
-    ip6 = ip4 = 1;    
+    ip6 = ip4 = 1;
     break;
 
   default:
     return -1;
   }
 
-#if USE_LOCALINFO0 
+#if USE_LOCALINFO0
   error = localinfo0(hh, rr);
 #else
 
@@ -230,8 +230,8 @@
     error = localinfo6(hh, rr);
     if (error == ELI_NOADDRESS && ip4)
       error = 0;
-    
-    if (!error) 
+
+    if (!error)
       /* Search end of list */
       for (; *rr; rr = &(*rr)->li_next)
 	;
@@ -254,7 +254,7 @@
   return error;
 }
 
-/** Free local address information. 
+/** Free local address information.
  *
  * Free a list of su_localinfo_t structures obtained with su_getlocalinfo()
  * or su_copylocalinfo() along with socket addresses and strings associated
@@ -274,7 +274,7 @@
   }
 }
 
-/** Describe su_localinfo errors. 
+/** Describe su_localinfo errors.
  *
  * The function su_gli_strerror() returns a string describing the error
  * condition indicated by the code that was returned by the function
@@ -332,7 +332,7 @@
     }
 
     if (li0->li_ifname)
-      li->li_ifname = strcpy(li->li_addrlen + (char *)li->li_addr, 
+      li->li_ifname = strcpy(li->li_addrlen + (char *)li->li_addr,
 			     li0->li_ifname);
   }
 
@@ -341,7 +341,7 @@
 
 
 /** Return IPv4 address scope */
-static int 
+static int
 li_scope4(uint32_t ip4)
 {
   ip4 = ntohl(ip4);
@@ -369,16 +369,16 @@
 {
   uint8_t const *u = ip6;
 
-  return 
-    u[0] == 0 && u[1] == 0 && u[2] == 0 && u[3] == 0 && 
-    u[4] == 0 && u[5] == 0 && u[6] == 0 && u[7] == 0 && 
-    u[8] == 0 && u[9] == 0 && u[10] == 0 && u[11] == 0 && 
+  return
+    u[0] == 0 && u[1] == 0 && u[2] == 0 && u[3] == 0 &&
+    u[4] == 0 && u[5] == 0 && u[6] == 0 && u[7] == 0 &&
+    u[8] == 0 && u[9] == 0 && u[10] == 0 && u[11] == 0 &&
     u[12] == 0 && u[13] == 0 && u[14] == 0 && u[15] == 1;
 }
 #endif
 
 /** Return IPv6 address scope */
-static int 
+static int
 li_scope6(struct in6_addr const *ip6)
 {
   if (IN6_IS_ADDR_V4MAPPED(ip6) || IN6_IS_ADDR_V4COMPAT(ip6)) {
@@ -446,7 +446,7 @@
 
   s = su_socket(AF_INET, SOCK_DGRAM, 0);
   if (s == -1) {
-    SU_DEBUG_1(("su_localinfo: su_socket failed: %s\n", 
+    SU_DEBUG_1(("su_localinfo: su_socket failed: %s\n",
 		su_strerror(su_errno())));
     return ELI_SYSTEM;
   }
@@ -475,7 +475,7 @@
 
   if (scope == LI_SCOPE_HOST || scope == LI_SCOPE_LINK)
     gni_flags = NI_NUMERICHOST;
-    
+
   if (su_xtra) {
     /* Map IPv4 address to IPv6 address */
     memset(sa, 0, sizeof(*sa));
@@ -500,7 +500,7 @@
   }
   else
     li->li_flags = 0;
-  
+
   li->li_canonname = canonname;
 
   canonname = NULL;
@@ -546,7 +546,7 @@
 
   s = su_socket(AF_INET, SOCK_DGRAM, 0);
   if (s == -1) {
-    SU_DEBUG_1(("su_localinfo: su_socket failed: %s\n", 
+    SU_DEBUG_1(("su_localinfo: su_socket failed: %s\n",
 		su_strerror(su_errno())));
     return ELI_SYSTEM;
   }
@@ -555,13 +555,13 @@
   /* Get the list of known IP address from the kernel */
   if (ioctl(s, SIOCGIFNUM, (char *) &numifs) < 0) {
     /* can't get number of interfaces -- fall back */
-    SU_DEBUG_1(("su_localinfo: SIOCGIFNUM failed: %s\n", 
+    SU_DEBUG_1(("su_localinfo: SIOCGIFNUM failed: %s\n",
 		su_strerror(su_errno())));
     error = ELI_SYSTEM;
     goto err;
   }
 
-  SU_DEBUG_9(("su_localinfo: %d active interfaces according to SIOCGIFNUM\n", 
+  SU_DEBUG_9(("su_localinfo: %d active interfaces according to SIOCGIFNUM\n",
 	      numifs));
 
   if (numifs < 0)
@@ -584,20 +584,20 @@
     error = ELI_MEMORY;
     goto err;
   }
-  
+
   li_first = (su_localinfo_t *)buffer;
   memset(li_first, 0, sizeof(su_localinfo_t) + su_xtra);
   ifc.ifc_buf = buffer + sizeof(su_localinfo_t) + su_xtra;
 #if HAVE_OPEN_C
   if (ioctl(s, SIOCGIFACTIVECONF, (char *)&ifc) < 0) {
-    SU_DEBUG_1(("su_localinfo: SIOCGIFCONF failed: %s\n", 
+    SU_DEBUG_1(("su_localinfo: SIOCGIFCONF failed: %s\n",
 		su_strerror(su_errno())));
     error = ELI_SYSTEM;
     goto err;
   }
 #else
   if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
-    SU_DEBUG_1(("su_localinfo: SIOCGIFCONF failed: %s\n", 
+    SU_DEBUG_1(("su_localinfo: SIOCGIFCONF failed: %s\n",
 		su_strerror(su_errno())));
     error = ELI_SYSTEM;
     goto err;
@@ -628,7 +628,7 @@
 #if defined(SIOCGIFINDEX)
     ifreq[0] = *ifr;
     if (ioctl(s, SIOCGIFINDEX, ifreq) < 0) {
-      SU_DEBUG_1(("su_localinfo: SIOCGIFINDEX failed: %s\n", 
+      SU_DEBUG_1(("su_localinfo: SIOCGIFINDEX failed: %s\n",
 		  su_strerror(su_errno())));
       error = ELI_SYSTEM;
       goto err;
@@ -657,7 +657,7 @@
 
     if (su_get_local_ip_addr(sa) < 0)
       goto err;
-      
+
     li->li_family = sa->su_family;
     li->li_scope = LI_SCOPE_GLOBAL /* scope */;
     li->li_index = if_index;
@@ -687,14 +687,14 @@
 #if defined(SIOCGIFFLAGS)
     ifreq[0] = *ifr;
     if (ioctl(s, SIOCGIFFLAGS, ifreq) < 0) {
-      SU_DEBUG_1(("su_localinfo: SIOCGIFFLAGS failed: %s\n", 
+      SU_DEBUG_1(("su_localinfo: SIOCGIFFLAGS failed: %s\n",
 		  su_strerror(su_errno())));
       error = ELI_SYSTEM;
       goto err;
     }
     /* Do not include interfaces that are down unless explicitly asked */
     if ((ifreq->ifr_flags & IFF_UP) == 0 && (hints->li_flags & LI_DOWN) == 0) {
-      SU_DEBUG_9(("su_localinfo: if %s with index %d is down\n", 
+      SU_DEBUG_9(("su_localinfo: if %s with index %d is down\n",
 		  if_name, if_index));
       continue;
     }
@@ -708,7 +708,7 @@
     *ifreq = *ifr;
     ifreq->ifr_addr.sa_family = AF_INET;
     if (ioctl(s, SIOCGIFADDR, ifreq) < 0) {
-      SU_DEBUG_1(("su_localinfo: SIOCGIFADDR failed: %s\n", 
+      SU_DEBUG_1(("su_localinfo: SIOCGIFADDR failed: %s\n",
 		  su_strerror(su_errno())));
       error = ELI_SYSTEM;
       goto err;
@@ -746,7 +746,7 @@
       goto err;
     else if (error > 0)
       continue;
-    
+
     if (canonname)
       if (strchr(canonname, ':') ||
 	  strspn(canonname, "0123456789.") == strlen(canonname))
@@ -807,7 +807,7 @@
   su_localinfo_t *li = NULL, **lli = &tbf;
   su_sockaddr_t *su;
 #if SU_HAVE_IN6
-  socklen_t su_sockaddr_size = 
+  socklen_t su_sockaddr_size =
     (hints->li_flags & LI_V4MAPPED) ? sizeof(*su) : sizeof(struct sockaddr_in);
   flags = hints->li_flags & (LI_V4MAPPED|LI_CANONNAME|LI_NUMERIC|LI_IFNAME);
 #else
@@ -822,7 +822,7 @@
       name = hints->li_canonname;
     else if (gethostname(name = hostname, sizeof(hostname)) != 0)
       return ELI_SYSTEM;
-  
+
     h = gethostbyname(name);
 
     if (name)
@@ -845,7 +845,7 @@
 
       li->li_addrlen = su_sockaddr_size;
       li->li_addr = su = (su_sockaddr_t *)(li + 1);
-      su->su_family = li->li_family = 
+      su->su_family = li->li_family =
 	li->li_flags & LI_V4MAPPED ? AF_INET6 : AF_INET;
 
 #if SU_HAVE_IN6
@@ -854,10 +854,10 @@
 	memcpy(&((int32_t*)&su->su_sin6.sin6_addr)[3],
 	       h->h_addr_list[i], h->h_length);
       }
-      else 
+      else
 #endif
 	memcpy(&su->su_sin.sin_addr.s_addr, h->h_addr_list[i], h->h_length);
-      if (li->li_flags & LI_IFNAME) 
+      if (li->li_flags & LI_IFNAME)
 	li->li_ifname = ifname;
       if (li->li_scope == LI_SCOPE_HOST || li->li_scope == LI_SCOPE_LINK)
 	gni_flags = NI_NUMERICHOST;
@@ -876,7 +876,7 @@
       error = ELI_MEMORY;
       goto err;
     }
-    li->li_flags = hints->li_flags & 
+    li->li_flags = hints->li_flags &
       (LI_V4MAPPED|LI_CANONNAME|LI_NUMERIC|LI_IFNAME);
     li->li_scope = LI_SCOPE_HOST, li->li_index = 1;
     if (li->li_flags & LI_IFNAME)
@@ -889,7 +889,7 @@
       ((int32_t*)&su->su_sin6.sin6_addr)[2] = htonl(0xffff);
       ((int32_t*)&su->su_sin6.sin6_addr)[3] = htonl(0x7f000001);
     }
-    else 
+    else
 #endif
       su->su_family = li->li_family = AF_INET,
       su->su_sin.sin_addr.s_addr = htonl(0x7f000001);
@@ -897,7 +897,7 @@
     if ((error = li_name(hints, NI_NUMERICHOST, su, &li->li_canonname)) < 0) {
       goto err;
     } else if (error > 0) {
-      free(li); li = NULL; 
+      free(li); li = NULL;
     } else {
       *lli = li; lli = &li->li_next; li = NULL;
     }
@@ -918,7 +918,7 @@
 
 #if USE_LOCALINFO0 || !SU_HAVE_IN6
 
-#elif HAVE_PROC_NET_IF_INET6 
+#elif HAVE_PROC_NET_IF_INET6
 /** Build a list of local IPv6 addresses and append it to *return_result. */
 static
 int localinfo6(su_localinfo_t const *hints, su_localinfo_t **return_result)
@@ -947,7 +947,7 @@
 		 &in6.s6_addr32[0],
 		 &in6.s6_addr32[1],
 		 &in6.s6_addr32[2],
-		 &in6.s6_addr32[3], 
+		 &in6.s6_addr32[3],
 		 &if_index, &prefix_len, &scope, &flags, ifname) != 9)
 	break;
 
@@ -970,10 +970,10 @@
 	  (hints->li_index && hints->li_index != if_index) ||
 	  (hints->li_ifname && strcmp(hints->li_ifname, ifname) != 0))
 	continue;
-      
+
       su->su_family = AF_INET6;
-      su->su_sin6.sin6_addr = in6; 
-      
+      su->su_sin6.sin6_addr = in6;
+
       addrlen = su_sockaddr_size(su);
 
       if ((error = li_name(hints, 0, su, &canonname)) < 0)
@@ -983,7 +983,7 @@
       else
 	error = ELI_NOADDRESS;
 
-      if (canonname && 
+      if (canonname &&
 	  (strchr(canonname, ':') ||
 	   strspn(canonname, "0123456789.") == strlen(canonname)))
 	flags |= LI_NUMERIC;
@@ -1009,14 +1009,14 @@
       li->li_canonname = canonname;
       if (if_namelen)
 	li->li_ifname = memcpy(addrlen + (char *)addr, ifname, if_namelen);
-      
+
       canonname = NULL;
     }
 
     fclose(f);
   }
 
-  if (canonname) 
+  if (canonname)
     free(canonname);
 
   return error;
@@ -1031,7 +1031,7 @@
   su_localinfo_t *li = NULL;
   su_sockaddr_t *su;
   int const su_sockaddr_size = sizeof(*su);
-  
+
   error = ELI_NOADDRESS;
 
 #if defined(__APPLE_CC__)
@@ -1049,39 +1049,39 @@
 	sa->su_family = AF_INET6;
 	if (su_inet_pton(AF_INET6, addr, &sa->su_sin6.sin6_addr) <= 0)
 	  goto err;
-	
+
 	s = su_socket(AF_INET6, SOCK_DGRAM, 0);
 	if (s == -1) {
-	  SU_DEBUG_1(("su_localinfo: su_socket failed: %s\n", 
+	  SU_DEBUG_1(("su_localinfo: su_socket failed: %s\n",
 		      su_strerror(su_errno())));
 	  return ELI_SYSTEM;
 	}
-	
+
 	error = getsockname(s, (struct sockaddr *) sa, &salen);
 	if (error < 0 && errno == SOCKET_ERROR) {
 	  SU_DEBUG_1(("%s: getsockname() failed: %s\n", __func__,
 		      su_strerror(su_errno())));
 	}
-	
+
 	error = bind(s, (struct sockaddr *) sa, salen);
-	
+
 	if (error < 0) {
 	  SU_DEBUG_1(("%s: bind() failed: %s\n", __func__,
 		      su_strerror(su_errno())));
 	  goto err;
 	}
-	
+
 	su_close(s);
-	
+
 	li->li_family = sa->su_family;
 	li->li_scope = LI_SCOPE_GLOBAL;
 	li->li_index = 0;
 	li->li_addrlen = su_sockaddr_size(sa);
 	li->li_addr = sa;
-	
+
 	if ((error = li_name(hints, NI_NUMERICHOST, sa, &li->li_canonname)) < 0)
 	  goto err;
-	
+
 	li->li_flags = NI_NUMERICHOST;
       }
     }
@@ -1107,12 +1107,12 @@
       su->su_family = li->li_family = AF_INET6;
       if (su_inet_pton(AF_INET6, addr, &su->su_sin6.sin6_addr) <= 0)
 	goto err;
-      if (li->li_flags & LI_IFNAME) 
+      if (li->li_flags & LI_IFNAME)
 	li->li_ifname = ifname;
       if ((error = li_name(hints, NI_NUMERICHOST, su, &li->li_canonname)) < 0)
 	goto err;
       else if (error > 0) {
-	free(li); li = NULL; 
+	free(li); li = NULL;
       }
     }
   }
@@ -1133,7 +1133,7 @@
 #include <ifaddrs.h>
 
 static
-int bsd_localinfo(su_localinfo_t const hints[1], 
+int bsd_localinfo(su_localinfo_t const hints[1],
 		  su_localinfo_t **return_result)
 {
   struct ifaddrs *ifa, *results;
@@ -1186,7 +1186,7 @@
       scope = li_scope6(&su->su_sin6.sin6_addr);
     }
 #endif
-    else 
+    else
       continue;
 
     if (hints->li_flags & LI_IFNAME) {
@@ -1200,7 +1200,7 @@
 	(hints->li_ifname && (!ifname || strcmp(hints->li_ifname, ifname))) ||
 	(hints->li_index && hints->li_index != if_index))
       continue;
-    
+
     if (scope == LI_SCOPE_HOST || scope == LI_SCOPE_LINK)
       gni_flags = NI_NUMERICHOST;
 
@@ -1222,7 +1222,7 @@
       error = 0;
       continue;
     }
-    
+
     if (canonname)
       if (strchr(canonname, ':') ||
 	  canonname[strspn(canonname, "0123456789.")] == '\0')
@@ -1232,7 +1232,7 @@
       SU_DEBUG_1(("su_getlocalinfo: memory exhausted\n"));
       error = ELI_MEMORY;
       break;
-    } 
+    }
     *return_result = li, return_result = &li->li_next;
 
     li->li_flags = flags;
@@ -1259,7 +1259,7 @@
 
 #elif USE_LOCALINFO0 && HAVE_IPHLPAPI_H && SU_HAVE_IN6
 
-static 
+static
 char const *ws2ifname(DWORD iftype)
 {
   switch (iftype) {
@@ -1321,21 +1321,21 @@
       goto err;
     }
 
-    if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
-	               FORMAT_MESSAGE_FROM_SYSTEM | 
+    if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+	               FORMAT_MESSAGE_FROM_SYSTEM |
 	               FORMAT_MESSAGE_IGNORE_INSERTS,
 	  	       NULL,
 	  	       error,
 		       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
 		       msg, 0, NULL))
       msg = empty;
- 
+
     SU_DEBUG_1(("su_localinfo: GetAdaptersAddresses: %s (%d)\n", msg, error));
     if (msg != empty) LocalFree((LPVOID)msg);
     error = ELI_SYSTEM;
     goto err;
   }
-  
+
   for (iaa = iaa0; iaa; iaa = iaa->Next) {
     IP_ADAPTER_UNICAST_ADDRESS *ua;
     IP_ADAPTER_UNICAST_ADDRESS lua[1];
@@ -1382,11 +1382,11 @@
 	  continue;
 	scope = li_scope6(&su->su_sin6.sin6_addr);
       }
-      else 
+      else
 	continue;
 
       if (hints->li_flags & LI_IFNAME) {
-	snprintf(ifname, sizeof(ifname), "%s%u", 
+	snprintf(ifname, sizeof(ifname), "%s%u",
 		 ws2ifname(iaa->IfType), if_index);
 	ifnamelen = strlen(ifname) + 1;
       }
@@ -1396,7 +1396,7 @@
 	  /* (hints->li_ifname && strcmp(hints->li_ifname, ifname) != 0) || */
 	  (hints->li_index && hints->li_index != if_index))
 	continue;
-    
+
       if (scope == LI_SCOPE_HOST || scope == LI_SCOPE_LINK)
 	gni_flags = NI_NUMERICHOST;
 
@@ -1413,7 +1413,7 @@
 	goto err;
       else if (error > 0)
 	continue;
-    
+
       if (canonname)
 	if (strchr(canonname, ':') ||
 	    strspn(canonname, "0123456789.") == strlen(canonname))
@@ -1422,7 +1422,7 @@
       if (!(li = calloc(1, sizeof(*li) + sulen + ifnamelen))) {
 	SU_DEBUG_1(("su_getlocalinfo: memory exhausted\n"));
 	error = ELI_MEMORY; goto err;
-      } 
+      }
       *next = li, next = &li->li_next;
 
       li->li_flags = flags;
@@ -1463,7 +1463,7 @@
   union {
     SOCKET_ADDRESS_LIST sal[1];
 #if HAVE_INTERFACE_INFO_EX
-    INTERFACE_INFO_EX   ii[1];    
+    INTERFACE_INFO_EX   ii[1];
 #else
     INTERFACE_INFO      ii[1];
 #endif
@@ -1497,7 +1497,7 @@
     SU_DEBUG_1(("su_getlocalinfo: no local addresses\n"));
     error = -1; goto err;
   }
-  
+
   for (i = 0; i < b.sal->iAddressCount; i++) {
     su_sockaddr_t *su = (su_sockaddr_t *)b.sal->Address[i].lpSockaddr;
 #if SU_HAVE_IN6
@@ -1512,7 +1512,7 @@
 
     if (hints->li_scope && (hints->li_scope & scope) == 0)
       continue;
-    
+
     if (scope == LI_SCOPE_HOST || scope == LI_SCOPE_LINK)
       gni_flags = NI_NUMERICHOST;
 
@@ -1537,12 +1537,12 @@
       goto err;
     else if (error > 0)
       continue;
-    
+
     if (canonname)
       if (strchr(canonname, ':') ||
 	  strspn(canonname, "0123456789.") == strlen(canonname))
 	flags |= LI_NUMERIC;
-   
+
     li->li_flags = flags;
     li->li_family = su->su_family;
     li->li_scope = scope;
@@ -1552,7 +1552,7 @@
     li->li_canonname = canonname, canonname = NULL;
     if (hints->li_flags & LI_IFNAME)
       li->li_ifname = if_name;
-    li->li_addr = (su_sockaddr_t *)(li + 1); 
+    li->li_addr = (su_sockaddr_t *)(li + 1);
     li->li_addrlen = sulen;
     memcpy(li->li_addr, su, sulen);
   }
@@ -1571,10 +1571,10 @@
 }
 #endif
 
-static 
-int li_name(su_localinfo_t const *hints, 
+static
+int li_name(su_localinfo_t const *hints,
 	    int gni_flags,
-	    su_sockaddr_t const *su, 
+	    su_sockaddr_t const *su,
 	    char **ccanonname)
 {
   char name[SU_MAXHOST];
@@ -1585,11 +1585,11 @@
 
   if ((flags & LI_CANONNAME) || hints->li_canonname) {
     if ((flags & LI_NAMEREQD) == LI_NAMEREQD)
-      gni_flags |= NI_NAMEREQD;      
+      gni_flags |= NI_NAMEREQD;
     if (flags & LI_NUMERIC)
       gni_flags |= NI_NUMERICHOST;
 
-    error = su_getnameinfo(su, su_sockaddr_size(su), 
+    error = su_getnameinfo(su, su_sockaddr_size(su),
 			   name, sizeof(name), NULL, 0,
 			   gni_flags);
     if (error) {
@@ -1654,6 +1654,6 @@
     su_freelocalinfo(li);
     return 0;
   }
-  else 
+  else
     return -1;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_log.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_log.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_log.c	Tue Dec 23 07:37:03 2008
@@ -28,7 +28,7 @@
  * Implementation of generic logging interface.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Fri Feb 23 17:30:13 2001 ppessi
  */
 
@@ -51,7 +51,7 @@
 #else
 #define SU_LOG_IS_INIT(log) ((log)->log_init)
 #define SU_LOG_DO_INIT(log) ((log)->log_init = 1)
-#define SU_LOG_LOCK(log) 
+#define SU_LOG_LOCK(log)
 #define SU_LOG_UNLOCK(log)
 #endif
 
@@ -63,9 +63,9 @@
  * interface provides means for redirecting the log and filtering log
  * messages based on message priority.
  *
- * @sa @ref debug_logs, <sofia-sip/su_log.h>, 
+ * @sa @ref debug_logs, <sofia-sip/su_log.h>,
  * su_llog(), su_vllog(), #su_log_t, #SU_DEBUG,
- * SU_DEBUG_0(), SU_DEBUG_1(), SU_DEBUG_2(), SU_DEBUG_3(), SU_DEBUG_5(), 
+ * SU_DEBUG_0(), SU_DEBUG_1(), SU_DEBUG_2(), SU_DEBUG_3(), SU_DEBUG_5(),
  * SU_DEBUG_7(), SU_DEBUG_9()
  */
 
@@ -81,7 +81,7 @@
   su_perror2(s, su_errno());
 }
 
-/** Log a message to default log. 
+/** Log a message to default log.
  *
  * This function is a replacement for printf().
  *
@@ -96,7 +96,7 @@
   va_end(ap);
 }
 
-/** Log a message with level. 
+/** Log a message with level.
  *
  * @note This function is used mainly by SU_DEBUG_n() macros.
  */
@@ -120,7 +120,7 @@
   if (!log->log_init)
     su_log_init(log);
 
-  if (log->log_init > 1 ? 
+  if (log->log_init > 1 ?
       level > log->log_level :
       level > su_log_default->log_level)
     return;
@@ -156,14 +156,14 @@
 
   if (log->log_env && (env = getenv(log->log_env))) {
     int level = atoi(env);
-    
+
     /* Why? */
     /* if (level == 0) level = 1; */
     log->log_level = level;
     log->log_init = 2;
 
-    if (explicitly_initialized) 
-      su_llog(log, 0, "%s: initialized log to level %u (%s=%s)\n", 
+    if (explicitly_initialized)
+      su_llog(log, 0, "%s: initialized log to level %u (%s=%s)\n",
 	      log->log_name, log->log_level, log->log_env, env);
   }
   else {
@@ -171,10 +171,10 @@
     log->log_init = 1;
     if (explicitly_initialized) {
       if (log != su_log_default)
-	su_llog(log, 0, "%s: logging at default level %u\n", 
+	su_llog(log, 0, "%s: logging at default level %u\n",
 		log->log_name, su_log_default->log_level);
       else
-	su_llog(log, 0, "%s: initialized log to level %u (default)\n", 
+	su_llog(log, 0, "%s: initialized log to level %u (default)\n",
 		log->log_name, log->log_level);
     }
   }
@@ -188,7 +188,7 @@
  * @code
  * void logger(void *logarg, char const *format, va_list ap);
  * @endcode
- * 
+ *
  * If @a logger is NULL, the default logger will be used. If @a log is NULL,
  * the default logger is changed.
  */
@@ -206,7 +206,7 @@
  * The function su_log_set_level() sets the logging level.  The log events
  * have certain level (0..9); if logging level is lower than the level of
  * the event, the log message is ignored.
- * 
+ *
  * If @a log is NULL, the default log level is changed.
  */
 void su_log_set_level(su_log_t *log, unsigned level)
@@ -221,7 +221,7 @@
     explicitly_initialized = getenv("SHOW_DEBUG_LEVELS");
 
   if (explicitly_initialized)
-    su_llog(log, 0, "%s: set log to level %u\n", 
+    su_llog(log, 0, "%s: set log to level %u\n",
 	    log->log_name, log->log_level);
 }
 
@@ -229,11 +229,11 @@
  *
  * The function su_log_soft_set_level() sets the logging level if it is not
  * already set, or the environment variable controlling the log level is not
- * set. 
+ * set.
  *
  * The log events have certain level (0..9); if logging level is lower than
  * the level of the event, the log message is ignored.
- * 
+ *
  * If @a log is NULL, the default log level is changed.
  */
 void su_log_soft_set_level(su_log_t *log, unsigned level)
@@ -254,7 +254,7 @@
       explicitly_initialized = getenv("SHOW_DEBUG_LEVELS");
 
     if (explicitly_initialized)
-      su_llog(log, 0, "%s: soft set log to level %u\n", 
+      su_llog(log, 0, "%s: soft set log to level %u\n",
 	      log->log_name, log->log_level);
   }
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_md5.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_md5.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_md5.c	Tue Dec 23 07:37:03 2008
@@ -38,7 +38,7 @@
  */
 
 /** @ingroup su_md5
- * 
+ *
  * @CFILE su_md5.c MD5 Implementation
  *
  * To compute the message digest of a chunk of bytes, declare an su_md5_t
@@ -58,7 +58,7 @@
  * @note Regarding su_* namespace: this avoids potential conflicts
  * with libraries such as some versions of Kerberos.  No particular
  * need to worry about whether the system supplies an MD5 library, as
- * this file is only about 3k of object code. 
+ * this file is only about 3k of object code.
  *
  */
 
@@ -93,7 +93,7 @@
  *
  * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
  * initialization constants.
- * 
+ *
  * @param ctx Pointer to context structure.
  */
 void
@@ -103,7 +103,7 @@
   ctx->buf[1] = 0xefcdab89;
   ctx->buf[2] = 0x98badcfe;
   ctx->buf[3] = 0x10325476;
-  
+
   ctx->bits[0] = 0;
   ctx->bits[1] = 0;
 }
@@ -111,7 +111,7 @@
 /** Clear MD5 context.
  *
  * The function su_md5_deinit() clears MD5 context.
- * 
+ *
  * @param context  Pointer to MD5 context structure.
  */
 void su_md5_deinit(su_md5_t *context)
@@ -142,14 +142,14 @@
   if ((ctx->bits[0] = (t + ((uint32_t)len << 3)) & 0xffffffff) < t)
     ctx->bits[1]++;	/* Carry from low to high */
   ctx->bits[1] += (uint32_t)(len >> 29);
-  
+
   t = (t >> 3) & 0x3f;	/* Bytes already in shsInfo->data */
-  
+
   /* Handle any leading odd-sized chunks */
-  
+
   if ( t ) {
     unsigned char *p = ctx->in + t;
-    
+
     t = 64 - t;
 
     if (len < t) {
@@ -162,9 +162,9 @@
     buf += t;
     len -= t;
   }
-  
+
   /* Process data in 64-byte chunks */
-  
+
   while (len >= 64) {
     su_md5_transform(ctx->buf, buf);
     buf += 64;
@@ -176,7 +176,7 @@
 }
 
 /** Copy memory, fix case to lower. */
-static 
+static
 void mem_i_cpy(unsigned char *d, unsigned char const *s, size_t len)
 {
   size_t i;
@@ -211,14 +211,14 @@
   if ((ctx->bits[0] = (t + ((uint32_t)len << 3)) & 0xffffffff) < t)
     ctx->bits[1]++;	/* Carry from low to high */
   ctx->bits[1] += (uint32_t)(len >> 29);
-  
+
   t = (t >> 3) & 0x3f;	/* Bytes already in shsInfo->data */
-  
+
   /* Handle any leading odd-sized chunks */
-  
+
   if ( t ) {
     unsigned char *p = ctx->in + t;
-    
+
     t = sizeof(ctx->in) - t;
 
     if (len < t) {
@@ -230,7 +230,7 @@
     buf += t;
     len -= t;
   }
-  
+
   /* Process data in 64-byte chunks */
   while (len >= sizeof(ctx->in)) {
     mem_i_cpy(ctx->in, buf, sizeof(ctx->in));
@@ -253,7 +253,7 @@
  */
 void su_md5_strupdate(su_md5_t *ctx, char const *s)
 {
-  if (s) 
+  if (s)
     su_md5_update(ctx, s, strlen(s));
 }
 
@@ -267,7 +267,7 @@
  */
 void su_md5_str0update(su_md5_t *ctx, char const *s)
 {
-  if (!s) 
+  if (!s)
     s = "";
 
   su_md5_update(ctx, s, strlen(s) + 1);
@@ -283,7 +283,7 @@
  */
 void su_md5_striupdate(su_md5_t *ctx, char const *s)
 {
-  if (s) 
+  if (s)
     su_md5_iupdate(ctx, s, strlen(s));
 }
 
@@ -298,7 +298,7 @@
  */
 void su_md5_stri0update(su_md5_t *ctx, char const *s)
 {
-  if (!s) 
+  if (!s)
     s = "";
 
   su_md5_iupdate(ctx, s, strlen(s) + 1);
@@ -323,35 +323,35 @@
   su_md5_t ctx[1];
 
   ctx[0] = context[0];
-  
+
   /* Compute number of bytes mod 64 */
   count = (ctx->bits[0] >> 3) & 0x3F;
-  
+
   /* Set the first char of padding to 0x80.  This is safe since there is
      always at least one byte free */
   p = ctx->in + count;
   *p++ = 0x80;
-  
+
   /* Bytes of padding needed to make 64 bytes */
   count = 64 - 1 - count;
-  
+
   /* Pad out to 56 mod 64 */
   if (count < 8) {
     /* Two lots of padding:  Pad the first block to 64 bytes */
     memset(p, 0, count);
     su_md5_transform (ctx->buf, ctx->in);
-    
+
     /* Now fill the next block with 56 bytes */
     memset(ctx->in, 0, 56);
   } else {
     /* Pad block to 56 bytes */
     memset(p, 0, count-8);
   }
-  
+
   /* Append length in bits and transform */
   putu32(ctx->bits[0], ctx->in + 56);
   putu32(ctx->bits[1], ctx->in + 60);
-  
+
   su_md5_transform(ctx->buf, ctx->in);
   putu32(ctx->buf[0], digest);
   putu32(ctx->buf[1], digest + 4);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_module_debug.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_module_debug.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_module_debug.h	Tue Dec 23 07:37:03 2008
@@ -34,9 +34,9 @@
  * functions within @b su module.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- *  
+ *
  * @date Created: Wed Jan 29 18:18:49 2003 ppessi
- * 
+ *
  */
 
 #include <sofia-sip/su_log.h>

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_open_c_localinfo.cpp
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_open_c_localinfo.cpp	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_open_c_localinfo.cpp	Tue Dec 23 07:37:03 2008
@@ -35,7 +35,7 @@
 #include "config.h"
 
 #include <unistd.h>
-#include <in_sock.h> 
+#include <in_sock.h>
 #include <es_sock.h>
 #include <e32base.h>
 #include <s32mem.h>
@@ -58,7 +58,7 @@
 	su->su_sin.sin_addr.s_addr = sa_global->su_sin.sin_addr.s_addr;
 	su->su_family = sa_global->su_family;
 	su->su_len = sa_global->su_len;
-	
+
 	return 0;
 }
 
@@ -76,32 +76,32 @@
   TCommDbConnPref iPref;
   RSocketServ aSocketServ;
   RSocket sock;
-  
+
   /* Get the IAP id of the underlying interface of this RConnection */
   TUint32 iapId;
-  
+
   iPref.SetDirection(ECommDbConnectionDirectionOutgoing);
   iPref.SetDialogPreference(ECommDbDialogPrefPrompt);
   iPref.SetBearerSet(KCommDbBearerUnknown /*PSD*/);
-  
+
   aSocketServ = RSocketServ();
   aSocketServ.Connect();
   RConnection *aConnection = new RConnection();
   aConnection->Open(aSocketServ);
   aConnection->Start(iPref);
-  
+
   User::LeaveIfError(sock.Open(aSocketServ, KAfInet, KSockStream,
 			       KProtocolInetTcp));
-  
+
   User::LeaveIfError(aConnection->GetIntSetting(_L("IAP\\Id"), iapId));
-  
+
   /* Get IP information from the socket */
   TSoInetInterfaceInfo ifinfo;
   TPckg<TSoInetInterfaceInfo> ifinfopkg(ifinfo);
-  
+
   TSoInetIfQuery ifquery;
   TPckg<TSoInetIfQuery> ifquerypkg(ifquery);
-  
+
   /* To find out which interfaces are using our current IAP, we
    * must enumerate and go through all of them and make a query
    * by name for each. */
@@ -109,7 +109,7 @@
   while(sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, ifinfopkg) == KErrNone) {
     ifquery.iName = ifinfo.iName;
     TInt err = sock.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, ifquerypkg);
-    
+
     /* IAP ID is index 1 of iZone */
     if(err == KErrNone && ifquery.iZone[1] == iapId) {
       /* We have found an interface using the IAP we are interested in. */
@@ -126,7 +126,7 @@
     else if(err != KErrNone)
       break;
   }
-  
+
   sock.Close();
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_os_nw.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_os_nw.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_os_nw.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@ingroup su_os_nw
  *
- * @CFILE su_os_nw.c  
+ * @CFILE su_os_nw.c
  * Implementation of OS-specific network events interface.
  *
  * @author Martti Mela <Martti.Mela at nokia.com>
@@ -97,8 +97,8 @@
 }
 
 
-void nw_changed_cb(SCDynamicStoreRef store, 
-		   CFArrayRef changedKeys, 
+void nw_changed_cb(SCDynamicStoreRef store,
+		   CFArrayRef changedKeys,
 		   void *info)
 {
   su_network_changed_t *snc = (su_network_changed_t *) info;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_osx_runloop.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_osx_runloop.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_osx_runloop.c	Tue Dec 23 07:37:03 2008
@@ -46,7 +46,7 @@
 #include <limits.h>
 #include <errno.h>
 
-#define su_port_s su_osx_port_s 
+#define su_port_s su_osx_port_s
 
 #include "su_port.h"
 #include "sofia-sip/su_osx_runloop.h"
@@ -64,14 +64,14 @@
 static su_port_t *su_osx_runloop_create(void) __attribute__((__malloc__));
 
 /* Callback for CFObserver and CFSocket */
-static void cf_observer_cb(CFRunLoopObserverRef observer, 
-			   CFRunLoopActivity activity, 
+static void cf_observer_cb(CFRunLoopObserverRef observer,
+			   CFRunLoopActivity activity,
 			   void *info);
 
-static void su_osx_port_socket_cb(CFSocketRef s, 
-				  CFSocketCallBackType callbackType, 
-				  CFDataRef address, 
-				  const void *data, 
+static void su_osx_port_socket_cb(CFSocketRef s,
+				  CFSocketCallBackType callbackType,
+				  CFDataRef address,
+				  const void *data,
 				  void *info);
 
 static void su_osx_port_deinit(void *arg);
@@ -87,15 +87,15 @@
 static int su_osx_port_send(su_port_t *self, su_msg_r rmsg);
 
 static int su_osx_port_register(su_port_t *self,
-			    su_root_t *root, 
-			    su_wait_t *wait, 
+			    su_root_t *root,
+			    su_wait_t *wait,
 			    su_wakeup_f callback,
 			    su_wakeup_arg_t *arg,
 			    int priority);
 static int su_osx_port_unregister(su_port_t *port,
-			      su_root_t *root, 
-			      su_wait_t *wait,	
-			      su_wakeup_f callback, 
+			      su_root_t *root,
+			      su_wait_t *wait,
+			      su_wakeup_f callback,
 			      su_wakeup_arg_t *arg);
 
 static int su_osx_port_deregister(su_port_t *self, int i);
@@ -118,9 +118,9 @@
 }
 
 /*
- * Port is a per-thread reactor.  
+ * Port is a per-thread reactor.
  *
- * Multiple root objects executed by single thread share a su_port_t object. 
+ * Multiple root objects executed by single thread share a su_port_t object.
  */
 struct su_osx_port_s {
   su_socket_port_t sup_socket[1];
@@ -143,11 +143,11 @@
     int        o_current;
     int        o_count;
   } osx_magic[1];
-  
+
   unsigned         sup_multishot; /**< Multishot operation? */
 
-  unsigned         sup_registers; /** Counter incremented by 
-				      su_port_register() or 
+  unsigned         sup_registers; /** Counter incremented by
+				      su_port_register() or
 				      su_port_unregister()
 				   */
   int              sup_n_waits; /**< Active su_wait_t in su_waits */
@@ -157,21 +157,21 @@
 
 #define INDEX_MAX (0x7fffffff)
 
-  /** Indices from index returned by su_root_register() to tables below. 
+  /** Indices from index returned by su_root_register() to tables below.
    *
    * Free elements are negative. Free elements form a list, value of free
    * element is (0 - index of next free element).
    *
-   * First element sup_indices[0] points to first free element. 
+   * First element sup_indices[0] points to first free element.
    */
   int             *sup_indices;
 
   int             *sup_reverses; /** Reverse index */
-  su_wakeup_f     *sup_wait_cbs; 
-  su_wakeup_arg_t**sup_wait_args; 
-  su_root_t      **sup_wait_roots; 
+  su_wakeup_f     *sup_wait_cbs;
+  su_wakeup_arg_t**sup_wait_args;
+  su_root_t      **sup_wait_roots;
 
-  su_wait_t       *sup_waits; 
+  su_wait_t       *sup_waits;
 };
 
 
@@ -223,10 +223,10 @@
   return su_root_create_with_port(magic, su_osx_runloop_create());
 }
 
-void osx_enabler_cb(CFSocketRef s, 
-		    CFSocketCallBackType type, 
-		    CFDataRef address, 
-		    const void *data, 
+void osx_enabler_cb(CFSocketRef s,
+		    CFSocketCallBackType type,
+		    CFDataRef address,
+		    const void *data,
 		    void *info)
 {
   CFRunLoopRef  rl;
@@ -234,21 +234,21 @@
   su_port_t    *self = magic->o_port;
   su_duration_t tout = 0;
   su_time_t     now = su_now();
-  
+
   rl = CFRunLoopGetCurrent();
 
   if (self->sup_base->sup_running) {
-    
+
     if (self->sup_base->sup_prepoll)
       self->sup_base->sup_prepoll(self->sup_base->sup_pp_magic, self->sup_base->sup_pp_root);
-    
+
     if (self->sup_base->sup_head)
       su_base_port_getmsgs(self);
-    
+
     if (self->sup_base->sup_timers)
       su_timer_expire(&self->sup_base->sup_timers, &tout, now);
   }
-  
+
   CFRunLoopWakeUp(rl);
 }
 
@@ -259,7 +259,7 @@
  *
  * @return
  *   If successful a pointer to the new message port is returned, otherwise
- *   NULL is returned.  
+ *   NULL is returned.
  */
 su_port_t *su_osx_runloop_create(void)
 {
@@ -279,7 +279,7 @@
     self->osx_magic->o_port = self;
     self->sup_observer_cntx->info = self->osx_magic;
     self->sup_observer =
-      CFRunLoopObserverCreate(NULL, 
+      CFRunLoopObserverCreate(NULL,
 			      kCFRunLoopAfterWaiting | kCFRunLoopBeforeWaiting,
 			      TRUE, 0, cf_observer_cb, self->sup_observer_cntx);
 #if 0
@@ -295,8 +295,8 @@
 }
 
 static
-void cf_observer_cb(CFRunLoopObserverRef observer, 
-		    CFRunLoopActivity activity, 
+void cf_observer_cb(CFRunLoopObserverRef observer,
+		    CFRunLoopActivity activity,
 		    void *info)
 {
   CFRunLoopRef  rl;
@@ -311,17 +311,17 @@
 
     if (self->sup_base->sup_prepoll)
       self->sup_base->sup_prepoll(self->sup_base->sup_pp_magic, self->sup_base->sup_pp_root);
-    
+
     if (self->sup_base->sup_head)
       su_port_getmsgs(self);
-    
+
     if (self->sup_base->sup_timers)
       su_timer_expire(&self->sup_base->sup_timers, &tout, now);
   } else
     SU_DEBUG_9(("cf_observer_cb(): PORT IS NOT RUNNING!\n"));
 
   CFRunLoopWakeUp(rl);
-  
+
   return;
 }
 
@@ -342,14 +342,14 @@
 
   if (events & SU_WAIT_IN)
     type |= kCFSocketReadCallBack;
-  
+
   if (events & SU_WAIT_OUT)
     type |= kCFSocketWriteCallBack;
-  
+
 #if 0
   if (events & SU_WAIT_CONNECT)
     type |= kCFSocketConnectCallBack;
-  
+
   if (events & SU_WAIT_ACCEPT)
     type |= kCFSocketAcceptCallBack;
 #endif
@@ -366,13 +366,13 @@
 
   if (type & kCFSocketReadCallBack)
     event |= SU_WAIT_IN;
-  
+
   if (type & kCFSocketWriteCallBack)
     event |= SU_WAIT_OUT;
-  
+
   if (type & kCFSocketConnectCallBack)
     event |= SU_WAIT_CONNECT;
-  
+
   if (type & kCFSocketAcceptCallBack)
     event |= SU_WAIT_ACCEPT;
 
@@ -381,37 +381,37 @@
 #endif
 
 static
-void su_osx_port_socket_cb(CFSocketRef s, 
-			   CFSocketCallBackType type, 
-			   CFDataRef address, 
-			   const void *data, 
+void su_osx_port_socket_cb(CFSocketRef s,
+			   CFSocketCallBackType type,
+			   CFDataRef address,
+			   const void *data,
 			   void *info)
 {
   struct osx_magic *magic = (struct osx_magic *) info;
   su_port_t        *self = magic->o_port;
   int               curr = magic->o_current;
   su_duration_t tout = 0;
-  
+
 #if SU_HAVE_POLL
   {
     su_root_t *root;
     su_wait_t *waits = self->sup_waits;
     int n = self->sup_indices[curr];
-    
+
     assert(self->sup_reverses[n] == curr);
-    
+
     SU_DEBUG_9(("socket_cb(%p): count %u index %d\n", self->sup_sources[n], magic->o_count, curr));
-    
+
     waits[n].revents = map_poll_event_to_cf_event(type);
 
     root = self->sup_wait_roots[n];
-    self->sup_wait_cbs[n](root ? su_root_magic(root) : NULL, 
-			  &waits[n], 
+    self->sup_wait_cbs[n](root ? su_root_magic(root) : NULL,
+			  &waits[n],
 			  self->sup_wait_args[n]);
-    
+
     if (self->sup_base->sup_running) {
       su_port_getmsgs(self);
-      
+
       if (self->sup_base->sup_timers)
 	su_timer_expire(&self->sup_base->sup_timers, &tout, su_now());
 
@@ -420,12 +420,12 @@
 
       /* CFRunLoopWakeUp(CFRunLoopGetCurrent()); */
     }
-    
+
     /* Tell to run loop an su socket fired */
     self->sup_source_fired = 1;
   }
 #endif
-  
+
 }
 
 /** @internal Send a message to the port. */
@@ -437,7 +437,7 @@
     int wakeup;
 
     //XXX - mela SU_OSX_PORT_LOCK(self, "su_osx_port_send");
-    
+
     wakeup = self->sup_base->sup_head == NULL;
 
     *self->sup_base->sup_tail = rmsg[0]; rmsg[0] = NULL;
@@ -480,21 +480,21 @@
  *
  *  Please note if identical wait objects are inserted, only first one is
  *  ever signalled.
- * 
+ *
  * @param self	     pointer to port
  * @param root	     pointer to root object
  * @param waits	     pointer to wait object
  * @param callback   callback function pointer
  * @param arg	     argument given to callback function when it is invoked
- * @param priority   relative priority of the wait object 
+ * @param priority   relative priority of the wait object
  *              (0 is normal, 1 important, 2 realtime)
- * 
+ *
  * @return
- *   The function @su_osx_port_register returns nonzero index of the wait object, 
+ *   The function @su_osx_port_register returns nonzero index of the wait object,
  *   or -1 upon an error.  */
 int su_osx_port_register(su_port_t *self,
-			 su_root_t *root, 
-			 su_wait_t *wait, 
+			 su_root_t *root,
+			 su_wait_t *wait,
 			 su_wakeup_f callback,
 			 su_wakeup_arg_t *arg,
 			 int priority)
@@ -527,7 +527,7 @@
 
     if (self->sup_size_waits == 0)
       size = su_root_size_hint;
-    else 
+    else
       size = 2 * self->sup_size_waits;
 
     if (size < SU_WAIT_MIN)
@@ -551,7 +551,7 @@
 	reverses[i] = -1;
       self->sup_reverses = reverses;
     }
-      
+
     sources = realloc(self->sup_sources, size * sizeof(*sources));
     if (sources)
       self->sup_sources = sources;
@@ -574,10 +574,10 @@
 
     /* Add sup_wait_roots array, if needed */
     wait_tasks = realloc(self->sup_wait_roots, size * sizeof(*wait_tasks));
-    if (wait_tasks) 
+    if (wait_tasks)
       self->sup_wait_roots = wait_tasks;
 
-    if (!(indices && 
+    if (!(indices &&
 	  reverses && sources && sockets && waits && wait_cbs && wait_args && wait_tasks)) {
       return -1;
     }
@@ -598,7 +598,7 @@
       self->sup_waits[n] = self->sup_waits[n-1];
       self->sup_wait_cbs[n] = self->sup_wait_cbs[n-1];
       self->sup_wait_args[n] = self->sup_wait_args[n-1];
-      self->sup_wait_roots[n] = self->sup_wait_roots[n-1];	
+      self->sup_wait_roots[n] = self->sup_wait_roots[n-1];
     }
 
     self->sup_pri_offset++;
@@ -672,7 +672,7 @@
   n = indices[i]; assert(n >= 0); assert(i == reverses[n]);
 
   N = --self->sup_n_waits;
-  
+
   rl = CFRunLoopGetCurrent();
   CFSocketInvalidate(self->sup_sockets[n]);
   CFRelease(self->sup_sockets[n]);
@@ -723,7 +723,7 @@
   self->sup_wait_cbs[n] = NULL;
   self->sup_wait_args[n] = NULL;
   self->sup_wait_roots[n] = NULL;
-  
+
   indices[i] = indices[0];
   indices[0] = -i;
 
@@ -734,23 +734,23 @@
 
 
 /** Unregister a su_wait_t object.
- *  
+ *
  *  The function su_osx_port_unregister() unregisters a su_wait_t object. The
  *  wait object, a callback function and a argument are removed from the
  *  port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param root     - pointer to root object
  * @param wait     - pointer to wait object
  * @param callback - callback function pointer (may be NULL)
- * @param arg      - argument given to callback function when it is invoked 
+ * @param arg      - argument given to callback function when it is invoked
  *                   (may be NULL)
- * 
+ *
  * @return Nonzero index of the wait object, or -1 upon an error.
  */
 int su_osx_port_unregister(su_port_t *self,
-		       su_root_t *root, 
-		       su_wait_t *wait,	
+		       su_root_t *root,
+		       su_wait_t *wait,
 		       su_wakeup_f callback, /* XXX - ignored */
 		       su_wakeup_arg_t *arg)
 {
@@ -773,14 +773,14 @@
 }
 
 /** Deregister a su_wait_t object.
- *  
- *  The function su_osx_port_deregister() deregisters a su_wait_t registrattion. 
+ *
+ *  The function su_osx_port_deregister() deregisters a su_wait_t registrattion.
  *  The wait object, a callback function and a argument are removed from the
  *  port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param i        - registration index
- * 
+ *
  * @return Index of the wait object, or -1 upon an error.
  */
 int su_osx_port_deregister(su_port_t *self, int i)
@@ -796,7 +796,7 @@
 
   if (self->sup_indices[i] < 0)
     return su_seterrno(EBADF);
-    
+
   retval = su_osx_port_deregister0(self, i);
 
   su_wait_destroy(wait);
@@ -810,13 +810,13 @@
  *
  * The function su_osx_port_unregister_all() unregisters all su_wait_t objects
  * and destroys all queued timers associated with given root object.
- * 
+ *
  * @param  self     - pointer to port object
  * @param  root     - pointer to root object
- * 
+ *
  * @return Number of wait objects removed.
  */
-int su_osx_port_unregister_all(su_port_t *self, 
+int su_osx_port_unregister_all(su_port_t *self,
 			   su_root_t *root)
 {
   int i, j, index, N;
@@ -834,13 +834,13 @@
   N          = self->sup_n_waits;
   indices    = self->sup_indices;
   reverses   = self->sup_reverses;
-  sources    = self->sup_sources; 
-  sockets    = self->sup_sockets; 
-  waits      = self->sup_waits; 
-  wait_cbs   = self->sup_wait_cbs; 
+  sources    = self->sup_sources;
+  sockets    = self->sup_sockets;
+  waits      = self->sup_waits;
+  wait_cbs   = self->sup_wait_cbs;
   wait_args  = self->sup_wait_args;
-  wait_roots = self->sup_wait_roots; 
-  
+  wait_roots = self->sup_wait_roots;
+
   rl = CFRunLoopGetCurrent();
 
   for (i = j = 0; i < N; i++) {
@@ -871,7 +871,7 @@
       wait_args[j]  = wait_args[i];
       wait_roots[j] = wait_roots[i];
     }
-    
+
     j++;
   }
 
@@ -931,7 +931,7 @@
 
   CFSocketSetSocketFlags(self->sup_sockets[n],
 			 map_poll_event_to_cf_event(events));
-  
+
   return ret;
 }
 
@@ -939,7 +939,7 @@
  *
  *  Copies the su_wait_t objects from the port. The number of wait objects
  *  can be found out by calling su_osx_port_query() with @a n_waits as zero.
- * 
+ *
  * @note This function is called only by friends.
  *
  * @param self     - pointer to port object
@@ -976,7 +976,7 @@
  *
  * @param self      pointer to port object
  * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
- * 
+ *
  * @retval 0 multishot mode is disabled
  * @retval 1 multishot mode is enabled
  * @retval -1 an error occurred
@@ -987,7 +987,7 @@
     return self->sup_multishot;
   else if (multishot == 0 || multishot == 1)
     return self->sup_multishot = multishot;
-  else 
+  else
     return (errno = EINVAL), -1;
 }
 
@@ -1007,9 +1007,9 @@
  * using Core Foundation's Run Loop.
  *
  * The function su_root_osx_prepare_run() returns immmediately.
- * 
+ *
  * @param root     pointer to root object
- * 
+ *
  * @NEW_1_12_4.
  */
 void su_root_osx_prepare_run(su_root_t *root)
@@ -1030,7 +1030,7 @@
 
   if (self->sup_base->sup_head)
     su_port_getmsgs(self);
-  
+
   if (self->sup_base->sup_timers)
     su_timer_expire(&self->sup_base->sup_timers, &tout, su_now());
 
@@ -1044,16 +1044,16 @@
 }
 
 /** @internal Main loop.
- * 
+ *
  * The function @c su_osx_port_run() waits for wait objects and the timers
  * associated with the port object.  When any wait object is signaled or
  * timer is expired, it invokes the callbacks, and returns waiting.
- * 
+ *
  * The function @c su_osx_port_run() runs until @c su_osx_port_break() is called
  * from a callback.
- * 
+ *
  * @param self     pointer to port object
- * 
+ *
  */
 void su_osx_port_run(su_port_t *self)
 {
@@ -1072,7 +1072,7 @@
 
   if (self->sup_base->sup_head)
     su_port_getmsgs(self);
-  
+
   if (self->sup_base->sup_timers)
     su_timer_expire(&self->sup_base->sup_timers, &tout, su_now());
 
@@ -1144,16 +1144,16 @@
 /** @internal
  * The function @c su_osx_port_break() is used to terminate execution of @c
  * su_osx_port_run(). It can be called from a callback function.
- * 
+ *
  * @param self     pointer to port
- * 
+ *
  */
 void su_osx_port_break(su_port_t *self)
 {
   if (self->sup_main_loop)
     CFRunLoopStop(self->sup_main_loop);
 
-  self->sup_base->sup_running = 0; 
+  self->sup_base->sup_running = 0;
 }
 
 /** @internal
@@ -1178,7 +1178,7 @@
   i = su_wait(waits, n, tout);
 
   if (i >= 0 && (unsigned)i < n) {
-#if HAVE_POLL			
+#if HAVE_POLL
     /* poll() can return events for multiple wait objects */
     if (self->sup_multishot) {
       for (; i < n; i++) {
@@ -1212,16 +1212,16 @@
 
 /** @internal Block until wait object is signaled or timeout.
  *
- * This function waits for wait objects and the timers associated with 
+ * This function waits for wait objects and the timers associated with
  * the root object.  When any wait object is signaled or timer is
- * expired, it invokes the callbacks. 
- * 
+ * expired, it invokes the callbacks.
+ *
  *   This function returns when a callback has been invoked or @c tout
- *   milliseconds is elapsed. 
+ *   milliseconds is elapsed.
  *
  * @param self     pointer to port
  * @param tout     timeout in milliseconds
- * 
+ *
  * @return
  *   Milliseconds to the next invocation of timer, or @c SU_WAIT_FOREVER if
  *   there are no active timers.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_perf.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_perf.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_perf.c	Tue Dec 23 07:37:03 2008
@@ -28,7 +28,7 @@
  * Performance test for su message passing
  *
  * @internal
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Thu Mar 18 19:40:51 1999 pessi
@@ -80,7 +80,7 @@
 {
   su_time_t now = su_now();
   double dur = su_time_diff(now, m->started);
-  
+
   printf("su_perf: %g message exchanges per second"
 	 " (%d message exchanges in %g seconds)\n",
 	 (double)p->n / dur, p->n, dur);
@@ -126,7 +126,7 @@
  *
  * Create a ponger and pinger, responding to incoming message do_ping
  *
- * After "target" rounds, print out elapsed time and number of messages 
+ * After "target" rounds, print out elapsed time and number of messages
  * passed.
  *
  */
@@ -136,8 +136,8 @@
   su_clone_r ping = SU_CLONE_R_INIT, pong = SU_CLONE_R_INIT;
   su_msg_r start_msg = SU_MSG_R_INIT;
 
-  struct perf 
-    pinger = { PINGER, "ping", 1, 0 }, 
+  struct perf
+    pinger = { PINGER, "ping", 1, 0 },
     ponger = { PONGER, "pong", 1, 0x7fffffff};
 
   int have_threads = 1;
@@ -158,15 +158,15 @@
   su_init(); atexit(su_deinit);
 
   root = su_root_create(NULL);
-  
+
   su_root_threading(root, have_threads);
 
   if (su_clone_start(root, ping, &pinger, do_init, do_destroy) != 0)
     perror("su_clone_start"), exit(1);
   if (su_clone_start(root, pong, &ponger, do_init, do_destroy) != 0)
-    perror("su_clone_start"), exit(1); 
+    perror("su_clone_start"), exit(1);
 
-  if (su_msg_create(start_msg, su_clone_task(pong), su_clone_task(ping), 
+  if (su_msg_create(start_msg, su_clone_task(pong), su_clone_task(ping),
 		    do_ping, sizeof(struct message)) == 0) {
     su_msg_data(start_msg)->started = su_now();
     su_msg_send(start_msg);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_poll_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_poll_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_poll_port.c	Tue Dec 23 07:37:03 2008
@@ -61,8 +61,8 @@
 
   unsigned         sup_multishot; /**< Multishot operation? */
 
-  unsigned         sup_registers; /** Counter incremented by 
-				      su_port_register() or 
+  unsigned         sup_registers; /** Counter incremented by
+				      su_port_register() or
 				      su_port_unregister()
 				   */
 
@@ -72,39 +72,39 @@
 
 #define INDEX_MAX (0x7fffffff)
 
-  /** Indices from index returned by su_root_register() to tables below. 
+  /** Indices from index returned by su_root_register() to tables below.
    *
    * Free elements are negative. Free elements form a list, value of free
    * element is (0 - index of next free element).
    *
-   * First element sup_indices[0] points to first free element. 
+   * First element sup_indices[0] points to first free element.
    */
   int             *sup_indices;
 
   int             *sup_reverses; /** Reverse index */
-  su_wakeup_f     *sup_wait_cbs; 
-  su_wakeup_arg_t**sup_wait_args; 
-  su_root_t      **sup_wait_roots; 
-  su_wait_t       *sup_waits; 
+  su_wakeup_f     *sup_wait_cbs;
+  su_wakeup_arg_t**sup_wait_args;
+  su_root_t      **sup_wait_roots;
+  su_wait_t       *sup_waits;
 
 };
 
 static void su_poll_port_decref(su_port_t *, int blocking, char const *who);
 
 static int su_poll_port_register(su_port_t *self,
-				 su_root_t *root, 
-				 su_wait_t *wait, 
+				 su_root_t *root,
+				 su_wait_t *wait,
 				 su_wakeup_f callback,
 				 su_wakeup_arg_t *arg,
 				 int priority);
 static int su_poll_port_unregister(su_port_t *port,
-				   su_root_t *root, 
-				   su_wait_t *wait,	
-				   su_wakeup_f callback, 
+				   su_root_t *root,
+				   su_wait_t *wait,
+				   su_wakeup_f callback,
 				   su_wakeup_arg_t *arg);
 static int su_poll_port_deregister(su_port_t *self, int i);
 static int su_poll_port_unregister_all(su_port_t *self, su_root_t *root);
-static int su_poll_port_eventmask(su_port_t *self, 
+static int su_poll_port_eventmask(su_port_t *self,
 				  int index,
 				  int socket,
 				  int events);
@@ -170,22 +170,22 @@
  *
  *  Please note if identical wait objects are inserted, only first one is
  *  ever signalled.
- * 
+ *
  * @param self	     pointer to port
  * @param root	     pointer to root object
  * @param waits	     pointer to wait object
  * @param callback   callback function pointer
  * @param arg	     argument given to callback function when it is invoked
- * @param priority   relative priority of the wait object 
+ * @param priority   relative priority of the wait object
  *              (0 is normal, 1 important, 2 realtime)
- * 
+ *
  * @return
- *   Positive index of the wait object, 
+ *   Positive index of the wait object,
  *   or -1 upon an error.
  */
 int su_poll_port_register(su_port_t *self,
-			  su_root_t *root, 
-			  su_wait_t *wait, 
+			  su_root_t *root,
+			  su_wait_t *wait,
 			  su_wakeup_f callback,
 			  su_wakeup_arg_t *arg,
 			  int priority)
@@ -212,7 +212,7 @@
 
     if (self->sup_size_waits == 0)
       size = su_root_size_hint;
-    else 
+    else
       size = 2 * self->sup_size_waits;
 
     if (size < SU_WAIT_MIN)
@@ -239,7 +239,7 @@
 	reverses[i] = -1;
       self->sup_reverses = reverses;
     }
-      
+
     waits = su_realloc(h, self->sup_waits, size * sizeof(*waits));
     if (waits)
       self->sup_waits = waits;
@@ -254,10 +254,10 @@
 
     /* Add sup_wait_roots array, if needed */
     wait_tasks = su_realloc(h, self->sup_wait_roots, size * sizeof(*wait_tasks));
-    if (wait_tasks) 
+    if (wait_tasks)
       self->sup_wait_roots = wait_tasks;
 
-    if (!(indices && 
+    if (!(indices &&
 	  reverses && waits && wait_cbs && wait_args && wait_tasks)) {
       return -1;
     }
@@ -276,7 +276,7 @@
       self->sup_waits[n] = self->sup_waits[n-1];
       self->sup_wait_cbs[n] = self->sup_wait_cbs[n-1];
       self->sup_wait_args[n] = self->sup_wait_args[n-1];
-      self->sup_wait_roots[n] = self->sup_wait_roots[n-1];	
+      self->sup_wait_roots[n] = self->sup_wait_roots[n-1];
     }
 
     self->sup_pri_offset++;
@@ -316,9 +316,9 @@
 
   if (destroy_wait)
     su_wait_destroy(&self->sup_waits[n]);
-  
+
   N = --self->sup_n_waits;
-  
+
   if (n < self->sup_pri_offset) {
     int j = --self->sup_pri_offset;
     if (n != j) {
@@ -354,7 +354,7 @@
   self->sup_wait_cbs[n] = NULL;
   self->sup_wait_args[n] = NULL;
   self->sup_wait_roots[n] = NULL;
-  
+
   indices[i] = indices[0];
   indices[0] = -i;
 
@@ -365,25 +365,25 @@
 
 
 /** Unregister a su_wait_t object.
- *  
+ *
  *  The function su_poll_port_unregister() unregisters a su_wait_t object. The
  *  wait object, a callback function and a argument are removed from the
  *  port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param root     - pointer to root object
  * @param wait     - pointer to wait object
  * @param callback - callback function pointer (may be NULL)
- * @param arg      - argument given to callback function when it is invoked 
+ * @param arg      - argument given to callback function when it is invoked
  *                   (may be NULL)
  *
- * @deprecated Use su_poll_port_deregister() instead. 
+ * @deprecated Use su_poll_port_deregister() instead.
  *
  * @return Nonzero index of the wait object, or -1 upon an error.
  */
 int su_poll_port_unregister(su_port_t *self,
-			    su_root_t *root, 
-			    su_wait_t *wait,	
+			    su_root_t *root,
+			    su_wait_t *wait,
 			    su_wakeup_f callback, /* XXX - ignored */
 			    su_wakeup_arg_t *arg)
 {
@@ -406,14 +406,14 @@
 }
 
 /** Deregister a su_wait_t object.
- *  
+ *
  *  Deregisters a registration by index. The wait object, a callback
  *  function and a argument are removed from the port object. The wait
  *  object is destroyed.
- * 
+ *
  * @param self     - pointer to port object
  * @param i        - registration index
- * 
+ *
  * @return Index of the wait object, or -1 upon an error.
  */
 int su_poll_port_deregister(su_port_t *self, int i)
@@ -429,7 +429,7 @@
 
   if (self->sup_indices[i] < 0)
     return su_seterrno(EBADF);
-    
+
   retval = su_poll_port_deregister0(self, i, 1);
 
   su_wait_destroy(wait);
@@ -443,13 +443,13 @@
  *
  * The function su_poll_port_unregister_all() unregisters all su_wait_t objects
  * and destroys all queued timers associated with given root object.
- * 
+ *
  * @param  self     - pointer to port object
  * @param  root     - pointer to root object
- * 
+ *
  * @return Number of wait objects removed.
  */
-int su_poll_port_unregister_all(su_port_t *self, 
+int su_poll_port_unregister_all(su_port_t *self,
 				su_root_t *root)
 {
   int i, j, index, N;
@@ -464,11 +464,11 @@
   N          = self->sup_n_waits;
   indices    = self->sup_indices;
   reverses   = self->sup_reverses;
-  waits      = self->sup_waits; 
-  wait_cbs   = self->sup_wait_cbs; 
+  waits      = self->sup_waits;
+  wait_cbs   = self->sup_wait_cbs;
   wait_args  = self->sup_wait_args;
-  wait_roots = self->sup_wait_roots; 
-  
+  wait_roots = self->sup_wait_roots;
+
   for (i = j = 0; i < N; i++) {
     index = reverses[i]; assert(index > 0 && indices[index] == i);
 
@@ -490,10 +490,10 @@
       wait_args[j]  = wait_args[i];
       wait_roots[j] = wait_roots[i];
     }
-    
+
     j++;
   }
-  
+
   for (i = j; i < N; i++) {
     reverses[i] = -1;
     wait_cbs[i] = NULL;
@@ -545,7 +545,7 @@
  *
  * @param self      pointer to port object
  * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
- * 
+ *
  * @retval 0 multishot mode is disabled
  * @retval 1 multishot mode is enabled
  * @retval -1 an error occurred
@@ -557,7 +557,7 @@
     return self->sup_multishot;
   else if (multishot == 0 || multishot == 1)
     return self->sup_multishot = multishot;
-  else 
+  else
     return (errno = EINVAL), -1;
 }
 
@@ -637,7 +637,7 @@
 #endif
   fprintf(f, "\t%d wait objects\n", self->sup_n_waits);
   for (i = 0; i < self->sup_n_waits; i++) {
-    
+
   }
 }
 
@@ -669,7 +669,7 @@
 			su_root_init_f init,
 			su_root_deinit_f deinit)
 {
-  return su_pthreaded_port_start(su_poll_port_create, 
+  return su_pthreaded_port_start(su_poll_port_create,
 				 parent, return_clone, magic, init, deinit);
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_port.c	Tue Dec 23 07:37:03 2008
@@ -28,7 +28,7 @@
  * OS-Independent Socket Syncronization Interface.
  *
  * This looks like nth reincarnation of "reactor". It implements the
- * poll/select/WaitForMultipleObjects and message passing functionality. 
+ * poll/select/WaitForMultipleObjects and message passing functionality.
  * This is virtual implementation:
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
@@ -106,6 +106,7 @@
   if (start) preferred_su_clone_start = start;
 }
 
+static
 void su_port_set_system_preferences(char const *name)
 {
   su_port_create_f *create = preferred_su_port_create;
@@ -149,17 +150,17 @@
   }
 #endif
 
-  if (create == NULL) 
+  if (create == NULL)
     create = su_default_port_create;
 
   if (!preferred_su_port_create ||
-      preferred_su_port_create == su_default_port_create) 
+      preferred_su_port_create == su_default_port_create)
     preferred_su_port_create = create;
 
   if (start == NULL)
     start = su_default_clone_start;
 
-  if (!preferred_su_clone_start || 
+  if (!preferred_su_clone_start ||
       preferred_su_clone_start == su_default_clone_start)
     preferred_su_clone_start = start;
 }
@@ -184,25 +185,25 @@
  */
 
 /**@ingroup su_wait
- * 
+ *
  * @page su_clone_t Clone Objects
  *
  * The process may be divided into many tasks via cloning. Several tasks may
- * run in context of one thread, or each task may be run by its own thread. 
+ * run in context of one thread, or each task may be run by its own thread.
  * However, only a single thread can execute code within a task. There can
  * be a 1-to-N mapping from thread to tasks. Thus, software using tasks can
  * be executed by multiple threads in a multithreaded environment and by a
  * single thread in a singlethreaded environment.
- * 
+ *
  * The clones are useful for handling tasks that can be executed by a
  * separate threads, but which do not block excessively. When threads are
  * not available or they are not needed, clones can also be run in a
  * single-threaded mode. Running in single-threaded mode is especially
  * useful while debugging.
- * 
+ *
  * A clone task is created with function su_clone_start(). Each clone has
  * its own root object (su_root_t), which holds a context pointer
- * (su_root_magic_t *). The context object can be different from that of 
+ * (su_root_magic_t *). The context object can be different from that of
  * parent task.
  *
  * When a clone is started, the clone initialization function is called. The
@@ -211,7 +212,7 @@
  * initialization is successful, the clone task reverts to run the event
  * loop and invoking the event callbacks until its parent stops it by
  * calling su_clone_wait() which invokes the deinit function. The clone task
- * is destroyed when the deinit function returns. 
+ * is destroyed when the deinit function returns.
  *
  * The public API consists of following functions:
  *    - su_clone_start()
@@ -219,7 +220,7 @@
  *    - su_clone_wait()
  *    - su_clone_forget()
  *
- * @note 
+ * @note
  * There is only one event loop for each thread which can be shared by
  * multiple clone tasks. Therefore, the clone tasks can not explicitly run
  * or step the event loop, but they are limited to event callbacks. A clone
@@ -239,7 +240,7 @@
  *
  * Allocate and initialize a sub-task. Depending on the su_root_threading()
  * settings, a separate thread may be created to execute the sub-task. The
- * sub-task is represented by clone handle to the rest of the application. 
+ * sub-task is represented by clone handle to the rest of the application.
  * The function su_clone_start() returns the clone handle in @a
  * return_clone. The clone handle is used to communicate with the newly
  * created clone task using messages.
@@ -255,14 +256,14 @@
  * Messages can also be used to pass information between tasks or threads.
  *
  * In multi-threaded implementation, su_clone_start() launches a new thread,
- * and the initialization routine is executed by this newly created thread. 
+ * and the initialization routine is executed by this newly created thread.
  * The calling thread blocks until the initialization routine completes. If
  * the initialization routine returns #su_success (0), the sub-task is
  * considered to be created successfully. After the successful
  * initialization, the sub-task continues to execeute the function
  * su_root_run().
  *
- * In single-threaded implementations, just a new root object is created. 
+ * In single-threaded implementations, just a new root object is created.
  * The initialization routine is called directly from su_clone_start().
  *
  * If the initalization function @a init fails, the sub-task (either the
@@ -297,7 +298,7 @@
   if (deinit == NULL)
     deinit = su_root_deinit_nothing;
 
-    
+
   if (parent == NULL || parent->sur_threading) {
     if (preferred_su_clone_start == NULL)
       su_port_set_system_preferences(getenv("SU_PORT"));
@@ -314,7 +315,7 @@
 }
 
 /** Get reference to a clone task.
- * 
+ *
  * @param clone Clone pointer
  *
  * @return A reference to the task structure of the clone.
@@ -325,7 +326,7 @@
 }
 
 /**Forget the clone.
- * 
+ *
  * Normally, the clone task executes until it is stopped.  If the parent
  * task does not need to stop the task, it can "forget" the clone.  The
  * clone exits independently of the parent task.
@@ -341,7 +342,7 @@
  *
  * This can used only if clone task has sent no report messages (messages
  * with delivery report sent back to clone).
- * 
+ *
  * @deprecated. Use su_clone_wait().
  */
 void su_clone_stop(su_clone_r rclone)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_port.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_port.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_port.h	Tue Dec 23 07:37:03 2008
@@ -26,14 +26,14 @@
 /** Defined when <su_port.h> has been included. */
 #define SU_PORT_H
 
-/**@internal @file su_port.h 
+/**@internal @file su_port.h
  *
  * @brief Internal OS-independent syncronization interface.
  *
  * This looks like the "reactor" pattern.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Fri May 12 14:13:34 2000 ppessi
  */
 
@@ -91,7 +91,7 @@
   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;
@@ -102,15 +102,15 @@
   struct _GSource *(*su_port_gsource)(su_port_t *port);
   int (*su_port_send)(su_port_t *self, su_msg_r rmsg);
   int (*su_port_register)(su_port_t *self,
-			  su_root_t *root, 
-			  su_wait_t *wait, 
+			  su_root_t *root,
+			  su_wait_t *wait,
 			  su_wakeup_f callback,
 			  su_wakeup_arg_t *arg,
 			  int priority);
   int (*su_port_unregister)(su_port_t *port,
-			    su_root_t *root, 
-			    su_wait_t *wait,	
-			    su_wakeup_f callback, 
+			    su_root_t *root,
+			    su_wait_t *wait,
+			    su_wakeup_f callback,
 			    su_wakeup_arg_t *arg);
   int (*su_port_deregister)(su_port_t *self, int i);
   int (*su_port_unregister_all)(su_port_t *self,
@@ -119,15 +119,15 @@
   void (*su_port_run)(su_port_t *self);
   void (*su_port_break)(su_port_t *self);
   su_duration_t (*su_port_step)(su_port_t *self, su_duration_t tout);
-  
+
   /* 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, 
-			     su_prepoll_f *, 
+			     su_root_t *root,
+			     su_prepoll_f *,
 			     su_prepoll_magic_t *);
-  
+
   int (*su_port_remove_prepoll)(su_port_t *port,
 				su_root_t *root);
 
@@ -149,7 +149,7 @@
   void (*su_port_wait)(su_clone_r rclone);
   int (*su_port_execute)(su_task_r const task,
 			 int (*function)(void *), void *arg,
-			 int *return_value);  
+			 int *return_value);
 } su_port_vtable_t;
 
 SOFIAPUBFUN su_port_t *su_port_create(void)
@@ -168,9 +168,11 @@
 
 SOFIAPUBFUN char const *su_port_name(su_port_t const *port);
 
+SOFIAPUBFUN int su_timer_reset_all(su_timer_queue_t *, su_task_r );
+
 /* ---------------------------------------------------------------------- */
 
-/* React to multiple events per one poll() to make sure 
+/* React to multiple events per one poll() to make sure
  * that high-priority events can never completely mask other events.
  * Enabled by default on all platforms except WIN32 */
 #if !defined(WIN32)
@@ -245,8 +247,8 @@
 
 su_inline
 int su_port_register(su_port_t *self,
-		     su_root_t *root, 
-		     su_wait_t *wait, 
+		     su_root_t *root,
+		     su_wait_t *wait,
 		     su_wakeup_f callback,
 		     su_wakeup_arg_t *arg,
 		     int priority)
@@ -258,9 +260,9 @@
 
 su_inline
 int su_port_unregister(su_port_t *self,
-		       su_root_t *root, 
-		       su_wait_t *wait,	
-		       su_wakeup_f callback, 
+		       su_root_t *root,
+		       su_wait_t *wait,
+		       su_wakeup_f callback,
 		       su_wakeup_arg_t *arg)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
@@ -353,8 +355,8 @@
 
 su_inline
 int su_port_add_prepoll(su_port_t *self,
-			su_root_t *root, 
-			su_prepoll_f *prepoll, 
+			su_root_t *root,
+			su_prepoll_f *prepoll,
 			su_prepoll_magic_t *magic)
 {
   su_virtual_port_t *base = (su_virtual_port_t *)self;
@@ -415,9 +417,9 @@
   su_port_vtable_t const *sup_vtable;
 
   /* Implementation may vary stuff below, too. */
-  
+
   /* Pre-poll callback */
-  su_prepoll_f    *sup_prepoll; 
+  su_prepoll_f    *sup_prepoll;
   su_prepoll_magic_t *sup_pp_magic;
   su_root_t       *sup_pp_root;
 
@@ -460,8 +462,8 @@
 					    su_duration_t tout);
 
 SOFIAPUBFUN int su_base_port_add_prepoll(su_port_t *self,
-					 su_root_t *root, 
-					 su_prepoll_f *, 
+					 su_root_t *root,
+					 su_prepoll_f *,
 					 su_prepoll_magic_t *);
 
 SOFIAPUBFUN int su_base_port_remove_prepoll(su_port_t *self, su_root_t *root);
@@ -483,10 +485,10 @@
 
 #include <pthread.h>
 
-/** @internal 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 
+  struct su_pthread_port_waiting_parent
                   *sup_waiting_parent;
   pthread_t        sup_tid;
   pthread_mutex_t  sup_obtained[1];
@@ -564,7 +566,7 @@
   su_socket_t       sup_mbox[SU_MBOX_SIZE];
 } su_socket_port_t;
 
-SOFIAPUBFUN int su_socket_port_init(su_socket_port_t *, 
+SOFIAPUBFUN int su_socket_port_init(su_socket_port_t *,
 				    su_port_vtable_t const *);
 SOFIAPUBFUN void su_socket_port_deinit(su_socket_port_t *self);
 SOFIAPUBFUN int su_socket_port_send(su_port_t *self, su_msg_r rmsg);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_proxy.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_proxy.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_proxy.c	Tue Dec 23 07:37:03 2008
@@ -24,12 +24,12 @@
 
 /**@internal @ingroup su_root_ex
  *
- * @file su_proxy.c 
+ * @file su_proxy.c
  *
  * @brief Transport level proxy demonstrating various @b su features.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Wed May 23 17:42:40 2001 ppessi
  */
 
@@ -63,7 +63,7 @@
 #define __func__ "su_proxy"
 #endif
 
-struct proxy_s 
+struct proxy_s
 {
   su_home_t      pr_home[1];
   su_root_t     *pr_root;
@@ -71,7 +71,7 @@
   forwarder_t   *pr_forwarders;
 };
 
-struct forwarder_s 
+struct forwarder_s
 {
   forwarder_t  *f_next;
   forwarder_t **f_prev;
@@ -138,7 +138,7 @@
     error = pr_run(pr);
 
   pr_deinit(pr);
-   
+
   su_deinit();
 
   exit(error);
@@ -189,14 +189,14 @@
     return 2;
 
   if ((error = su_getaddrinfo(argv[1], argv[2], hints, &res))) {
-    fprintf(stderr, "getaddrinfo: %s:%s: %s\n", 
+    fprintf(stderr, "getaddrinfo: %s:%s: %s\n",
 	    argv[1], argv[2], su_gai_strerror(error));
     return 1;
   }
 
     pr->pr_addrinfo = res;
 
-  if (argv[3]) 
+  if (argv[3])
     service = argv[3];
   else
     service = argv[2];
@@ -208,14 +208,14 @@
     return 1;
   }
 
-  for (ai = res; 
+  for (ai = res;
        ai;
        ai = ai->ai_next) {
     forwarder_create_listener(pr, ai);
   }
 
   su_freeaddrinfo(res);
-  
+
   if (!pr->pr_forwarders) {
     fprintf(stderr, "%s:%s: %s\n", argv[1], argv[2], "unable to forward");
     return 1;
@@ -233,7 +233,7 @@
     su_root_destroy(pr->pr_root), pr->pr_root = NULL;
 
   su_home_deinit(pr->pr_home);
-  
+
   su_deinit();
 }
 
@@ -315,8 +315,8 @@
       su_setblocking(s, 0);
       su_setreuseaddr(s, 1);
       if (bind(s, ai->ai_addr, ai->ai_addrlen) >= 0) {
-	if (ai->ai_socktype == SOCK_STREAM ? 
-	    forwarder_init_stream(f) >= 0 : 
+	if (ai->ai_socktype == SOCK_STREAM ?
+	    forwarder_init_stream(f) >= 0 :
 	    forwarder_init_dgram(f) >= 0)
 	  return f;
       }
@@ -327,7 +327,7 @@
   }
 
   forwarder_destroy(f);
-  
+
   return NULL;
 }
 
@@ -335,11 +335,11 @@
 {
   if (listen(f->f_socket, SOMAXCONN) < 0)
     return SOCKET_ERROR;
-  
+
   if (su_wait_create(f->f_wait, f->f_socket, SU_WAIT_ACCEPT) < 0)
     return SOCKET_ERROR;
 
-  if (su_root_register(f->f_pr->pr_root, f->f_wait, 
+  if (su_root_register(f->f_pr->pr_root, f->f_wait,
 		       forwarder_accept, f, 0) < 0)
     return SOCKET_ERROR;
 
@@ -359,7 +359,7 @@
   su_sockaddr_t *su;
   socklen_t  sulen;
   int events;
-  
+
   events = su_wait_events(w, f0->f_socket);
 
   f = forwarder_create(pr);
@@ -371,7 +371,7 @@
     f->f_upstream = 1;
     if (f->f_socket != INVALID_SOCKET) {
       char buf[SU_ADDRSIZE];
-      
+
       SU_DEBUG_3(("accept: connection from %s:%u\n",
 		  su_inet_ntop(su->su_family, SU_ADDR(su), buf, sizeof(buf)),
 		  ntohs(su->su_port)));
@@ -400,7 +400,7 @@
   su_addrinfo_t *ai;
 
   assert(f_peer);
-  
+
   f = forwarder_create(pr);
   if (!f) {
     SU_DEBUG_1(("%s: cannot allocate peer\n", __func__));
@@ -440,7 +440,7 @@
     goto error;
   }
 
-  if (su_root_register(pr->pr_root, f->f_wait + 1, 
+  if (su_root_register(pr->pr_root, f->f_wait + 1,
 		       forwarder_connected, f, 0) == -1) {
     SU_DEBUG_1(("%s: cannot register\n", __func__));
     goto error;
@@ -495,13 +495,13 @@
   if (n > 0) {
     b->b_sent = 0; b->b_used = n;
     if (f->f_peer->f_buf) {
-      forwarder_append(f, b); 
+      forwarder_append(f, b);
       return 0;
     }
     if (forwarder_send(pr, f->f_peer, b) >= 0) {
       if (b->b_sent < b->b_used) {
 	su_root_unregister(pr->pr_root, w, forwarder_recv, f);
-	su_root_register(pr->pr_root, f->f_peer->f_wait + 1, 
+	su_root_register(pr->pr_root, f->f_peer->f_wait + 1,
 			 forwarder_empty, f->f_peer, 0);
 	forwarder_append(f, b);
       }
@@ -514,7 +514,7 @@
   if (n < 0) {
     int error = su_errno();
     SU_DEBUG_1(("recv: %s\n", su_strerror(error)));
-  
+
     if (error == EINTR || error == EAGAIN || error == EWOULDBLOCK) {
       return 0;
     }
@@ -523,7 +523,7 @@
   }
 
   /* shutdown */
-  forwarder_shutdown(f);	
+  forwarder_shutdown(f);
 
   return 0;
 }
@@ -531,7 +531,7 @@
 int forwarder_send(proxy_t *pr, forwarder_t *f, buffer_t *b)
 {
   int n, error;
-  
+
   do {
     n = send(f->f_socket, b->b_data + b->b_sent, b->b_used - b->b_sent, 0);
 
@@ -626,11 +626,11 @@
   forwarder_t *f_peer = f->f_peer;
   su_sockaddr_t *su = f->f_dest;
   char buf[SU_ADDRSIZE];
-  
+
   SU_DEBUG_3(("forwarder_shutdown: shutdown from %s:%u\n",
 	      su_inet_ntop(su->su_family, SU_ADDR(su), buf, sizeof(buf)),
 	      ntohs(su->su_port)));
-  
+
   if (su_root_unregister(f->f_pr->pr_root, f->f_wait, forwarder_recv, f) < 0) {
     SU_DEBUG_1(("%s: su_root_unregister failed\n", __func__));
   }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c	Tue Dec 23 07:37:03 2008
@@ -99,7 +99,7 @@
 
   su_home_lock(self->sup_base->sup_home);
 
-  PORT_LOCK_DEBUG((" ...%p at %s locked(%p)...", 
+  PORT_LOCK_DEBUG((" ...%p at %s locked(%p)...",
 		   (void *)pthread_self(), who, self));
 }
 
@@ -107,7 +107,7 @@
 {
   su_home_unlock(self->sup_base->sup_home);
 
-  PORT_LOCK_DEBUG((" ...%p at %s unlocked(%p)\n", 
+  PORT_LOCK_DEBUG((" ...%p at %s unlocked(%p)\n",
 		   (void *)pthread_self(), who, self));
 }
 
@@ -116,7 +116,7 @@
  * Change or query ownership of the port object.
  *
  * @param self pointer to a port object
- * @param op operation 
+ * @param op operation
  *
  * @ERRORS
  * @ERROR EALREADY port already has an owner (or has no owner)
@@ -224,7 +224,7 @@
  *
  * @sa su_root_threading(), su_clone_task(), su_clone_stop(), su_clone_wait(),
  * su_clone_forget().
- * 
+ *
  */
 int su_pthreaded_port_start(su_port_create_f *create,
 			    su_root_t *parent,
@@ -302,7 +302,7 @@
 
       task->sut_root->sur_threading = 1;	/* By default */
 
-      SU_TASK_COPY(task->sut_root->sur_parent, su_root_task(arg->parent), 
+      SU_TASK_COPY(task->sut_root->sur_parent, su_root_task(arg->parent),
 		   su_pthread_port_clone_main);
       SU_TASK_COPY(task->sut_root->sur_task, task,
 		   su_pthread_port_clone_main);
@@ -329,7 +329,7 @@
 	    mom->waiting = 0;
 	    pthread_cond_signal(mom->cv);
 	    pthread_mutex_unlock(mom->mutex);
-    
+
 	    pthread_mutex_lock(mom->deinit);
 	    su_port_getmsgs(task->sut_port);
 	    pthread_mutex_unlock(mom->deinit);
@@ -345,7 +345,7 @@
     }
 
     task->sut_port->sup_base->sup_vtable->
-      su_port_decref(task->sut_port, zap, 
+      su_port_decref(task->sut_port, zap,
 		     "su_pthread_port_clone_main");
   }
 
@@ -373,7 +373,7 @@
 /** "Stop" message function for pthread clone.
  *
  * @sa su_clone_wait()
- * @internal 
+ * @internal
  */
 static void su_pthread_port_clone_break(su_root_magic_t *m,
 					su_msg_r msg,
@@ -406,8 +406,8 @@
     su_base_port_wait(rclone);
     return;
   }
-  
-  assert(parent); assert(clone); 
+
+  assert(parent); assert(clone);
   assert(rclone[0]->sum_func == su_pthread_port_clone_break);
 #if 0
   assert(!clone->sup_paused);
@@ -418,7 +418,7 @@
   if (!clone->sup_thread) {	/* Already died */
     su_msg_destroy(rclone);
     pthread_join(tid, NULL);
-    return;  
+    return;
   }
 
   pthread_mutex_init(mom->deinit, NULL);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_root.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_root.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_root.c	Tue Dec 23 07:37:03 2008
@@ -23,12 +23,12 @@
  */
 
 /**@ingroup su_wait
- * @CFILE su_root.c 
- * OS-independent synchronization interface. 
+ * @CFILE su_root.c
+ * OS-independent synchronization interface.
  * @internal
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Sep 14 15:51:04 1999 ppessi
  */
 
@@ -56,7 +56,7 @@
 #include "sofia-sip/su_alloc.h"
 
 /**@ingroup su_wait
- * 
+ *
  * @page su_root_t Tasks and root objects
  *
  * A task is the basic execution unit for the Sofia event-driven programming
@@ -91,8 +91,8 @@
  * New tasks can be created via su_clone_start() function.
  */
 
-/**@ingroup su_wait 
- * 
+/**@ingroup su_wait
+ *
  * @page su_root_register Registering Wait Objects
  *
  * When application expects I/O events, it can create a wait object and
@@ -111,10 +111,18 @@
  */
 
 /**@ingroup su_wait
- * 
- * Contains hint of number of sockets supported by su_root_t */ 
+ *
+ * Contains hint of number of sockets supported by su_root_t */
 int su_root_size_hint = 64;
 
+/* ====================================================================== */
+
+_su_task_r su_task_new(su_task_r task, su_root_t *root, su_port_t *port);
+int su_task_attach(su_task_r self, su_root_t *root);
+int su_task_detach(su_task_r self);
+
+int su_timer_reset_all(su_timer_t **t0, su_task_r);
+
 /* =========================================================================
  * Tasks
  */
@@ -187,7 +195,7 @@
 void su_task_copy(su_task_r dst, su_task_r const src)
 {
   su_port_t *port;
-  
+
   assert(src); assert(dst);
 
   SU_TASK_ZAP(dst, su_task_copy);
@@ -219,10 +227,10 @@
 
 /**
  * Compare two tasks with each other.
- * 
+ *
  * @param a  First task
  * @param b  Second task
- * 
+ *
  * @retval negative number, if a < b
  * @retval positive number, if a > b
  * @retval 0, if a == b.
@@ -249,14 +257,14 @@
  *
  * @param task  task handle
  *
- * @retval true (nonzero) if task is not stopped, 
+ * @retval true (nonzero) if task is not stopped,
  * @retval zero if it is null or stopped.
  */
 int su_task_is_running(su_task_r const task)
 {
-  return 
-    task && 
-    task->sut_port && 
+  return
+    task &&
+    task->sut_port &&
     task->sut_root;
 }
 
@@ -265,7 +273,7 @@
  *
  * @param self task handle
  * @param root pointer to the root object
- * 
+ *
  * @retval 0 if successful,
  * @retval -1 otherwise.
  */
@@ -275,16 +283,16 @@
     self->sut_root = root;
     return 0;
   }
-  else 
+  else
     return -1;
 }
 
-/** 
+/**
  * Get root pointer attached to a task handle.
  *
  * @param self task handle
  *
- * @return 
+ * @return
  * A pointer to root object attached to the task handle, or NULL if no root
  * object has been attached.
  */
@@ -307,7 +315,7 @@
 
 /**
  * Return the timer list associated with given task.
- * 
+ *
  * @param task task handle
  *
  * @return A timer list of the task. If there are no timers, it returns
@@ -348,12 +356,6 @@
   }
 }
 
-_su_task_r su_task_new(su_task_r task, su_root_t *root, su_port_t *port);
-int su_task_attach(su_task_r self, su_root_t *root);
-int su_task_detach(su_task_r self);
-
-int su_timer_reset_all(su_timer_t **t0, su_task_r);
-
 /* Note that is *not* necessary same as su_root_t,
  * as su_root_t can be extended */
 
@@ -408,7 +410,7 @@
     /* This one creates a new reference to port */
     su_task_new(self->sur_task, self, port);
     /* ... so we zap the old one below */
-  } 
+  }
 
   su_port_decref(port, "su_root_create_with_port");
 
@@ -416,7 +418,7 @@
 }
 
 /** Destroy a root object.
- * 
+ *
  *  Stop and free an instance of su_root_t
  *
  * @param self     pointer to a root object.
@@ -541,7 +543,7 @@
   return su_port_gsource(self->sur_port);
 }
 
-/** Register a su_wait_t object. 
+/** Register a su_wait_t object.
  *
  *  The function su_root_register() registers a su_wait_t object. The wait
  *  object, a callback function and a argument are stored to the root
@@ -655,7 +657,7 @@
  *
  * @param self      pointer to root object
  * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
- * 
+ *
  * @retval 0 multishot mode is disabled
  * @retval 1 multishot mode is enabled
  * @retval -1 an error occurred
@@ -808,8 +810,8 @@
 }
 
 /** Add a pre-poll callback. */
-int su_root_add_prepoll(su_root_t *root, 
-			su_prepoll_f *callback, 
+int su_root_add_prepoll(su_root_t *root,
+			su_prepoll_f *callback,
 			su_prepoll_magic_t *magic)
 {
   if (root == NULL)
@@ -840,7 +842,7 @@
   return su_port_release(root->sur_port);
 }
 
-/** Obtain the root port from other thread. 
+/** Obtain the root port from other thread.
  *
  * @param root pointer to root object
  *
@@ -848,7 +850,7 @@
  * @retval -1 upon an error
  *
  * @ERRORS
- * @ERROR EFAULT 
+ * @ERROR EFAULT
  * @NEW_1_12_7
  */
 int su_root_obtain(su_root_t *root)
@@ -858,7 +860,7 @@
   return su_port_obtain(root->sur_port);
 }
 
-/**Check if a thread has obtained the root. 
+/**Check if a thread has obtained the root.
  *
  * @param root a pointer to root object
  *
@@ -883,13 +885,13 @@
 /**
  * Allocate a su message of given size.
  *
- * Allocate a su message with given data size. 
+ * Allocate a su message with given data size.
  *
  * @param  rmsg   handle to the new message (may be uninitialized prior calling)
  * @param  size   size of the message data
  *
  * @retval  0 if successful,
- * @retval -1 if message allocation fails.  
+ * @retval -1 if message allocation fails.
  *
  * @NEW_1_12_8
  */
@@ -919,7 +921,7 @@
  * @param  size   size of the message data
  *
  * @retval  0 if successful,
- * @retval -1 if message allocation fails.  
+ * @retval -1 if message allocation fails.
  */
 int su_msg_create(su_msg_r        rmsg,
 		  su_task_r const to,
@@ -932,17 +934,17 @@
     SU_TASK_COPY(rmsg[0]->sum_from, from, su_msg_create);
     rmsg[0]->sum_func = wakeup;
     return 0;
-  } 
+  }
 
   return -1;
 }
 
 /** Add a delivery report function to a message.
- * 
+ *
  * The delivery report funcgtion gets called by the sending task after the
  * message was delivered and the message function was executed. (The
- * su_root_t message delivery loop calls su_msg_delivery_report() 
- * 
+ * su_root_t message delivery loop calls su_msg_delivery_report()
+ *
  */
 int su_msg_report(su_msg_r msg,
 		  su_msg_f report)
@@ -1068,7 +1070,7 @@
   }
 }
 
-/** Gets a pointer to the message data area. 
+/** Gets a pointer to the message data area.
  *
  * The function @c su_msg_data() returns a pointer to the message data
  * area. If @c rmsg contains a @c NULL handle, or message size is 0, @c NULL
@@ -1076,7 +1078,7 @@
  *
  * @param rmsg       message handle
  *
- * @return A pointer to the message data area is returned.  
+ * @return A pointer to the message data area is returned.
  */
 su_msg_arg_t *su_msg_data(su_msg_cr rmsg)
 {
@@ -1101,7 +1103,7 @@
  *
  * @param rmsg       message handle
  *
- * @return The task handle of the sender is returned.  
+ * @return The task handle of the sender is returned.
  */
 _su_task_r su_msg_from(su_msg_cr rmsg)
 {
@@ -1118,14 +1120,14 @@
  *
  * @param rmsg       message handle
  *
- * @return The task handle of the recipient is returned.  
+ * @return The task handle of the recipient is returned.
  */
 _su_task_r su_msg_to(su_msg_cr rmsg)
 {
   return rmsg[0] ? rmsg[0]->sum_to : NULL;
 }
 
-/** Remove references to 'from' and 'to' tasks from a message. 
+/** Remove references to 'from' and 'to' tasks from a message.
  *
  * @param rmsg       message handle
  */
@@ -1137,7 +1139,7 @@
   }
 }
 
-/**Send a message. 
+/**Send a message.
  *
  * The function @c su_msg_send() sends the message. The message is added to
  * the recipients message queue, and recipient is waken up. The caller may
@@ -1156,7 +1158,7 @@
   if (rmsg[0]) {
     su_msg_t *msg = rmsg[0];
 
-    if (msg->sum_to->sut_port) 
+    if (msg->sum_to->sut_port)
       return su_port_send(msg->sum_to->sut_port, rmsg);
 
     su_msg_destroy(rmsg);
@@ -1164,7 +1166,7 @@
     return -1;
   }
 
-  return 0;		
+  return 0;
 }
 
 /** Send message to the @a to_task and mark @a from_task as sender.
@@ -1183,9 +1185,9 @@
     if (wakeup)
       msg->sum_func = wakeup;
 
-    if (msg->sum_to->sut_port && 
+    if (msg->sum_to->sut_port &&
 	msg->sum_to->sut_port != to_task->sut_port) {
-      SU_TASK_ZAP(msg->sum_to, "su_msg_send_to"); 
+      SU_TASK_ZAP(msg->sum_to, "su_msg_send_to");
     }
 
     if (to_task->sut_port != NULL) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_select_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_select_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_select_port.c	Tue Dec 23 07:37:03 2008
@@ -83,8 +83,8 @@
   int              sup_epoll;
   unsigned         sup_multishot; /**< Multishot operation? */
 
-  unsigned         sup_registers; /** Counter incremented by 
-				      su_port_register() or 
+  unsigned         sup_registers; /** Counter incremented by
+				      su_port_register() or
 				      su_port_unregister()
 				   */
   int              sup_n_registrations;
@@ -94,15 +94,15 @@
   /** Structure containing registration data */
   struct su_select_register {
     struct su_select_register *ser_next; /* Next in free list */
-    su_wakeup_f     ser_cb; 
-    su_wakeup_arg_t*ser_arg; 
-    su_root_t      *ser_root; 
+    su_wakeup_f     ser_cb;
+    su_wakeup_arg_t*ser_arg;
+    su_root_t      *ser_root;
     int             ser_id; /** registration identifier */
     su_wait_t       ser_wait[1];
   } **sup_indices;
 
   int               sup_maxfd, sup_allocfd;
-  
+
   fd_set           *sup_readfds, *sup_readfds2;
   fd_set           *sup_writefds, *sup_writefds2;
 };
@@ -111,19 +111,19 @@
 				 int blocking,
 				 char const *who);
 static int su_select_port_register(su_port_t *self,
-				  su_root_t *root, 
-				  su_wait_t *wait, 
+				  su_root_t *root,
+				  su_wait_t *wait,
 				  su_wakeup_f callback,
 				  su_wakeup_arg_t *arg,
 				  int priority);
 static int su_select_port_unregister(su_port_t *port,
-				    su_root_t *root, 
-				    su_wait_t *wait,	
-				    su_wakeup_f callback, 
+				    su_root_t *root,
+				    su_wait_t *wait,
+				    su_wakeup_f callback,
 				    su_wakeup_arg_t *arg);
 static int su_select_port_deregister(su_port_t *self, int i);
 static int su_select_port_unregister_all(su_port_t *self, su_root_t *root);
-static int su_select_port_eventmask(su_port_t *self, 
+static int su_select_port_eventmask(su_port_t *self,
 				   int index,
 				   int socket,
 				   int events);
@@ -189,22 +189,22 @@
  *
  *  Please note if identical wait objects are inserted, only first one is
  *  ever signalled.
- * 
+ *
  * @param self	     pointer to port
  * @param root	     pointer to root object
  * @param waits	     pointer to wait object
  * @param callback   callback function pointer
  * @param arg	     argument given to callback function when it is invoked
- * @param priority   relative priority of the wait object 
+ * @param priority   relative priority of the wait object
  *              (0 is normal, 1 important, 2 realtime)
- * 
+ *
  * @return
- *   Positive index of the wait object, 
+ *   Positive index of the wait object,
  *   or -1 upon an error.
  */
 int su_select_port_register(su_port_t *self,
-			   su_root_t *root, 
-			   su_wait_t *wait, 
+			   su_root_t *root,
+			   su_wait_t *wait,
 			   su_wakeup_f callback,
 			   su_wakeup_arg_t *arg,
 			   int priority)
@@ -225,7 +225,7 @@
 
   self->sup_registers++;
 
-  if (wait->fd >= allocfd) 
+  if (wait->fd >= allocfd)
     allocfd += __NFDBITS;		/* long at a time */
 
   if (allocfd >= self->sup_allocfd) {
@@ -259,7 +259,7 @@
     su_home_t *h = su_port_home(self);
 
     i = self->sup_max_index, j = i == 0 ? 15 : i + 16;
-    
+
     if (j >= self->sup_size_indices) {
       /* Reallocate index table */
       n = n < 1024 ? 2 * n : n + 1024;
@@ -291,7 +291,7 @@
   i = ser->ser_id;
 
   indices[0] = ser->ser_next;
-  
+
   ser->ser_next = NULL;
   *ser->ser_wait = *wait;
   ser->ser_cb = callback;
@@ -358,25 +358,25 @@
 
 
 /** Unregister a su_wait_t object.
- *  
- * The function su_select_port_unregister() unregisters a su_wait_t object. 
+ *
+ * The function su_select_port_unregister() unregisters a su_wait_t object.
  * The registration defined by the wait object, the callback function and
  * the argument pointer are removed from the port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param root     - pointer to root object
  * @param wait     - pointer to wait object
  * @param callback - callback function pointer (may be NULL)
- * @param arg      - argument given to callback function when it is invoked 
+ * @param arg      - argument given to callback function when it is invoked
  *                   (may be NULL)
  *
- * @deprecated Use su_select_port_deregister() instead. 
+ * @deprecated Use su_select_port_deregister() instead.
  *
  * @return Nonzero index of the wait object, or -1 upon an error.
  */
 int su_select_port_unregister(su_port_t *self,
-			     su_root_t *root, 
-			     su_wait_t *wait,	
+			     su_root_t *root,
+			     su_wait_t *wait,
 			     su_wakeup_f callback, /* XXX - ignored */
 			     su_wakeup_arg_t *arg)
 {
@@ -404,14 +404,14 @@
 }
 
 /** Deregister a su_wait_t object.
- *  
+ *
  *  Deregisters a registration by index. The wait object, a callback
  *  function and a argument are removed from the port object. The wait
  *  object is destroyed.
- * 
+ *
  * @param self     - pointer to port object
  * @param i        - registration index
- * 
+ *
  * @return Index of the wait object, or -1 upon an error.
  */
 int su_select_port_deregister(su_port_t *self, int i)
@@ -434,10 +434,10 @@
  *
  * The function su_select_port_unregister_all() unregisters all su_wait_t
  * objects associated with given root object.
- * 
+ *
  * @param  self     - pointer to port object
  * @param  root     - pointer to root object
- * 
+ *
  * @return Number of wait objects removed.
  */
 int su_select_port_unregister_all(su_port_t *self, su_root_t *root)
@@ -498,7 +498,7 @@
     return -1;
 
   assert(socket < self->sup_maxfd);
-  
+
   if (events & SU_WAIT_IN)
     FD_SET(socket, self->sup_readfds);
   else
@@ -521,7 +521,7 @@
  *
  * @param self      pointer to port object
  * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
- * 
+ *
  * @retval 0 multishot mode is disabled
  * @retval 1 multishot mode is enabled
  * @retval -1 an error occurred
@@ -533,7 +533,7 @@
     return self->sup_multishot;
   else if (multishot == 0 || multishot == 1)
     return self->sup_multishot = multishot;
-  else 
+  else
     return (errno = EINVAL), -1;
 }
 
@@ -563,7 +563,7 @@
   if (bytes) {
     rset = memcpy(self->sup_readfds2, self->sup_readfds, bytes);
     wset = memcpy(self->sup_writefds2, self->sup_writefds, bytes);
-  }  
+  }
 
   tv.tv_sec = tout / 1000;
   tv.tv_usec = (tout % 1000) * 1000;
@@ -609,7 +609,7 @@
 
     if (n == 0)
       break;
-  }    
+  }
 
   assert(n == 0);
 
@@ -627,9 +627,9 @@
     return NULL;
 
   if (su_home_destructor(su_port_home(self), su_select_port_deinit) < 0 ||
-      !(self->sup_indices = 
+      !(self->sup_indices =
 	su_zalloc(su_port_home(self),
-		  (sizeof self->sup_indices[0]) * 
+		  (sizeof self->sup_indices[0]) *
 		  (self->sup_size_indices = __NFDBITS)))) {
     su_home_unref(su_port_home(self));
     return NULL;
@@ -649,7 +649,7 @@
 			 su_root_init_f init,
 			 su_root_deinit_f deinit)
 {
-  return su_pthreaded_port_start(su_select_port_create, 
+  return su_pthreaded_port_start(su_select_port_create,
 				 parent, return_clone, magic, init, deinit);
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c	Tue Dec 23 07:37:03 2008
@@ -84,7 +84,7 @@
   su_wait_t wait[1] = { SU_WAIT_INIT };
   char const *why;
 
-  SU_DEBUG_9(("su_socket_port_init(%p, %p) called\n", 
+  SU_DEBUG_9(("su_socket_port_init(%p, %p) called\n",
 	      (void *)self, (void *)vtable));
 
   if (su_pthread_port_init(self, vtable) != 0)
@@ -109,17 +109,17 @@
     struct sockaddr_in sin = { sizeof(struct sockaddr_in), 0 };
     socklen_t sinsize = sizeof sin;
     struct sockaddr *sa = (struct sockaddr *)&sin;
-    
+
     af = PF_INET;
-      
+
     self->sup_mbox[0] = mb = su_socket(af, SOCK_DGRAM, IPPROTO_UDP);
     if (mb == INVALID_SOCKET) {
       why = "socket"; goto error;
     }
-    
+
     sin.sin_family = AF_INET;
     sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); /* 127.1 */
-      
+
     /* Get a port for us */
     if (bind(mb, sa, sizeof sin) == -1) {
       why = "bind"; goto error;
@@ -128,20 +128,20 @@
     if (getsockname(mb, sa, &sinsize) == -1) {
       why = "getsockname"; goto error;
     }
-    
+
     if (connect(mb, sa, sinsize) == -1) {
       why = "connect"; goto error;
     }
   }
-#endif    
+#endif
 
   if (su_wait_create(wait, mb, SU_WAIT_IN) == -1) {
     why = "su_wait_create";
     goto error;
   }
 
-  self->sup_mbox_index = su_port_register(self, NULL, wait, 
-					  su_mbox_port_wakeup, 
+  self->sup_mbox_index = su_port_register(self, NULL, wait,
+					  su_mbox_port_wakeup,
 					  (void *)self->sup_mbox, 0);
 
   if (self->sup_mbox_index <= 0) {
@@ -151,9 +151,9 @@
   }
 
   return 0;
-  
+
   error:
-    su_log("%s: %s: %s\n", "su_socket_port_init", 
+    su_log("%s: %s: %s\n", "su_socket_port_init",
 	   why, su_strerror(su_errno()));
 
   return retval;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_sprintf.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_sprintf.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_sprintf.c	Tue Dec 23 07:37:03 2008
@@ -27,7 +27,7 @@
  * @CFILE su_sprintf.c  su_*sprintf() functions
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Apr 17 20:05:21 2001 ppessi
  */
 
@@ -50,7 +50,7 @@
 
 #include "sofia-sip/su_alloc.h"
 
-/**Copy a formatted string. 
+/**Copy a formatted string.
  *
  * The function su_vsprintf() print a string according to a @a fmt like
  * vprintf() or vsnprintf(). The resulting string is copied to a memory area
@@ -61,7 +61,7 @@
  * @param home pointer to memory home (may be NULL)
  * @param fmt format string
  * @param ap @e stdarg argument list (must match with the @a fmt format string)
- * 
+ *
  * @return A pointer to a fresh copy of formatting result, or NULL upon an
  * error.
  */
@@ -76,9 +76,9 @@
   n = vsnprintf(s, sizeof(s), fmt, aq);
   va_end(aq);
 
-  if (n >= 0 && (size_t)n + 1 < sizeof(s)) 
+  if (n >= 0 && (size_t)n + 1 < sizeof(s))
     return su_strdup(home, s);
-  
+
   len = n > 0 ? (size_t)n + 1 : 2 * sizeof(s);
 
   for (rv = su_alloc(home, len);
@@ -90,7 +90,7 @@
     if (n > -1 && (size_t)n < len)
       break;
     if (n > -1)			/* glibc >2.1 */
-      len = (size_t)n + 1;		
+      len = (size_t)n + 1;
     else			/* glibc 2.0 */
       len *= 2;
 
@@ -101,7 +101,7 @@
   return rv;
 }
 
-/**Copy a formatted string. 
+/**Copy a formatted string.
  *
  * The function su_sprintf() print a string according to a @a fmt like
  * printf() or snprintf(). The resulting string is copied to a memory area
@@ -112,7 +112,7 @@
  * @param home pointer to memory home (may be NULL)
  * @param fmt format string
  * @param ... argument list (must match with the @a fmt format string)
- * 
+ *
  * @return A pointer to a fresh copy of formatting result, or NULL upon an
  * error.
  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_strdup.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_strdup.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_strdup.c	Tue Dec 23 07:37:03 2008
@@ -27,7 +27,7 @@
  * @CFILE su_strdup.c  Home-based string duplication functions
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Wed Jul 19 10:06:14 2000 ppessi
  */
 
@@ -44,7 +44,7 @@
  *
  * @param home  pointer to memory home
  * @param s     string to be duplicated
- * 
+ *
  * @return The function su_strdup() returns pointer to the newly created
  *         string, or @c NULL upon an error.
  */
@@ -70,7 +70,7 @@
  * @param home  pointer to memory home
  * @param s1    string to be first string
  * @param s2    string to be first string
- * 
+ *
  * @return Pointer to the newly created string is returned, or @c NULL upon
  * an error.
  */
@@ -104,7 +104,7 @@
  *
  * @param home  pointer to memory home
  * @param ...  NULL-terminated list of strings to be concatenated
- * 
+ *
  * @return Pointer to the newly created string is returned, or @c NULL upon
  * an error.
  */
@@ -152,7 +152,7 @@
  * @param home  pointer to memory home
  * @param s     string to be duplicated
  * @param n     size of the resulting string
- * 
+ *
  * @return The function su_strndup() returns pointer to the newly created
  *         string, or @c NULL upon an error.
  */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_strlst.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_strlst.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_strlst.c	Tue Dec 23 07:37:03 2008
@@ -55,22 +55,22 @@
  * @code
  * usize_t i, n;
  * su_strlst_t *l;
- * 
+ *
  * l = su_strlst_split(NULL, buf, "\n");
- * 
+ *
  * nonempty = 0;
- * 
+ *
  * for (i = 0; i < su_strlst_len(l); i++) {
  *   n = strcspn(su_strlst_item(l, i), " \t");
  *   if (su_strlst_item(l, i)[n])
  *     nonempty++;
  * }
- * 
+ *
  * su_strlst_destroy(l);
  * @endcode
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Fri May  3 09:22:59 2002 ppessi
  */
 
@@ -250,8 +250,8 @@
 
 /** Copy a string list */
 static
-su_strlst_t *su_strlst_copy_by(su_home_t *home, 
-			       su_strlst_t const *orig, 
+su_strlst_t *su_strlst_copy_by(su_home_t *home,
+			       su_strlst_t const *orig,
 			       int deeply)
 {
   su_strlst_t *self;
@@ -330,7 +330,7 @@
       if (list)
 	memcpy(list, self->sl_list, self->sl_len * sizeof(*self->sl_list));
     }
-    
+
     if (!list)
       return 0;
 
@@ -341,7 +341,7 @@
   return 1;
 }
 
-/**Duplicate and append a string to list. 
+/**Duplicate and append a string to list.
  *
  * @param self  pointer to a string list object
  * @param str   string to be duplicated and appended
@@ -448,7 +448,7 @@
 
 /**Returns a numbered item from the list of strings. The numbering starts from
  * 0.
- * 
+ *
  * @param self  pointer to a string list object
  * @param i     string index
  *
@@ -464,10 +464,10 @@
     return NULL;
 }
 
-/**Sets a item to the list of strings. 
+/**Sets a item to the list of strings.
  *
  * Note that the item numbering starts from 0.
- * 
+ *
  * @param self  pointer to a string list object
  * @param i     string index
  * @param s     string to be set as item @a i
@@ -499,7 +499,7 @@
 
 /**Removes a numbered item from the list of strings. The numbering starts from
  * 0. The caller is responsible of reclaiming memory used by the removed string.
- * 
+ *
  * @param self  pointer to a string list object
  * @param i     string index
  *
@@ -512,7 +512,7 @@
   if (self && i < self->sl_len) {
     char const *s = self->sl_list[i];
 
-    memmove(&self->sl_list[i], &self->sl_list[i + 1], 
+    memmove(&self->sl_list[i], &self->sl_list[i + 1],
 	    &self->sl_list[self->sl_len] - &self->sl_list[i]);
 
     self->sl_len--;
@@ -539,7 +539,7 @@
  * @param home  home pointer
  * @param sep   separator (may be NULL)
  *
- * @return 
+ * @return
  *
  * The function su_strlst_join() returns a concatenation of the strings in
  * list, or NULL upon an error.
@@ -599,7 +599,7 @@
   return l;
 }
 
-/**Split a string. 
+/**Split a string.
  *
  * Splits a string to substrings. It returns a string list object. The
  * string to be split is not copied but instead modified in place. Use
@@ -626,7 +626,7 @@
   return NULL;
 }
 
-/**Duplicate and split a string. 
+/**Duplicate and split a string.
  *
  * Duplicates a string and splits the result to substrings. It returns a
  * string list object. The string to be splitted is not modified.
@@ -638,8 +638,8 @@
  * @return
  * Pointer to list of strings, if successful, or NULL upon an error.
  */
-su_strlst_t *su_strlst_dup_split(su_home_t *home, 
-				 char const *cstr, 
+su_strlst_t *su_strlst_dup_split(su_home_t *home,
+				 char const *cstr,
 				 char const *sep)
 {
   if (cstr) {
@@ -657,23 +657,23 @@
   return NULL;
 }
 
-/** Get number of items in list. 
+/** Get number of items in list.
  *
- * The function su_strlst_len() returns the number of items in the 
+ * The function su_strlst_len() returns the number of items in the
  * string list.
- * 
+ *
  */
 usize_t su_strlst_len(su_strlst_t const *l)
 {
   return l ? l->sl_len : 0;
 }
 
-/**Get a string array from list. 
+/**Get a string array from list.
  *
  * The function su_strlst_get_array() returns an array of strings. The
  * length of the array is always one longer than the length of the string
  * list, and the last string in the returned array is always NULL.
- * 
+ *
  * @param self pointer to a string list object
  *
  * @return
@@ -686,7 +686,7 @@
     size_t size = sizeof(retval[0]) * (self->sl_len + 1);
 
     retval = su_alloc(self->sl_home, size);
-    
+
     if (retval) {
       memcpy(retval, self->sl_list, sizeof(retval[0]) * self->sl_len);
       retval[self->sl_len] = NULL;
@@ -697,11 +697,11 @@
   return NULL;
 }
 
-/**Free a string array. 
+/**Free a string array.
  *
  * The function su_strlst_free_array() discards a string array allocated
  * with su_strlst_get_array().
- * 
+ *
  * @param self  pointer to a string list object
  * @param array  string array to be freed
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_tag.c	Tue Dec 23 07:37:03 2008
@@ -23,11 +23,11 @@
  */
 
 /**@SU_TAG
- * 
- * @CFILE su_tag.c  
+ *
+ * @CFILE su_tag.c
  *
  * Special tags.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
  * @date Created: Tue Feb 20 20:03:38 2001 ppessi

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_tag_io.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_tag_io.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_tag_io.c	Tue Dec 23 07:37:03 2008
@@ -23,12 +23,12 @@
  */
 
 /**@SU_TAG
- * 
+ *
  * @CFILE su_tag_io.c
  * @brief Printing tag lists.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Wed Feb 21 12:12:27 2001 ppessi
  */
 
@@ -62,7 +62,7 @@
       if (n > 0 && buffer[n - 1] == '\n')
 	fmt = "   %s";
     }
-    else 
+    else
       buffer[sizeof(buffer) - 1] = '\0';
     fprintf(f, fmt, buffer);
   }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c	Tue Dec 23 07:37:03 2008
@@ -23,8 +23,8 @@
  */
 
 /**@SU_TAG
- * 
- * @CFILE su_taglist.c  
+ *
+ * @CFILE su_taglist.c
  *
  * Implementation of tag items and lists.
  *
@@ -66,7 +66,7 @@
  *
  * Object-oriented tag routines for Sofia utility library.
  *
- * The <sofia-sip/su_tag.h> defines a interface to object-oriented tag list routines. 
+ * The <sofia-sip/su_tag.h> defines a interface to object-oriented tag list routines.
  * A tag list is a linear list (array) of tag items, tagi_t structures,
  * terminated by a TAG_END() item. Each tag item has a label, tag, (@c
  * t_tag) and a value (@c t_value). The tag is a pointer (tag_type_t) to a
@@ -86,7 +86,7 @@
  * be used to a list of named arguments to a @ref tagarg "@em tagarg"
  * function, to store variable amount of data in a memory area, and pass
  * data between processes and threads.
- * 
+ *
  * The tagged argument lists can be used like named arguments in
  * higher-level languages. The argument list consists of tag-value pairs;
  * tags specify the name and type of the value. All the tag items are not
@@ -94,21 +94,21 @@
  * to other functions. This feature is used also by the Sofia APIs, the
  * lower-layer settings and options are frequently passed through the
  * upper-layer API in the tag lists.
- * 
+ *
  * The tagged argument lists are constructed using special macros that
  * expand to two function arguments, tag and value. Each tag item macro
  * checks its arguments type so the tagged argument lists are typesafe if
  * the list is correctly constructed.
- * 
+ *
  * Each function documents the tags it accepts and also the tags it may pass
  * to the lower layers (at least in theory).
- * 
+ *
  * @par Special Tags
  *
  * There are a new special tags that are used to control and modify the tag
  * list processing itself. These special tags are as follows:
  * - TAG_NULL() or TAG_END() - indicates the end of tag list
- * - TAG_SKIP() - indicates an empty (overwritten) tag item 
+ * - TAG_SKIP() - indicates an empty (overwritten) tag item
  * - TAG_NEXT() - contains a pointer to the next tag list.
  *
  * The tag type structures are declared as tag_typedef_t. They can be
@@ -137,8 +137,8 @@
 {
   tag_type_t tt = TAG_TYPE_OF(t);
   int n, m;
-  
-  n = snprintf(b, size, "%s::%s: ", 
+
+  n = snprintf(b, size, "%s::%s: ",
                tt->tt_ns ? tt->tt_ns : "",
 	       tt->tt_name ? tt->tt_name : "null");
   if (n < 0)
@@ -177,10 +177,10 @@
 }
 
 /**Move a tag list.
- * 
+ *
  * The function tl_tmove() moves the tag list arguments to @a dst.  The @a
  * dst must have big enough for all arguments.
- * 
+ *
  * @param dst   pointer to the destination buffer
  * @param size  sizeof @a dst
  * @param t_tag,t_value,... tag list
@@ -188,14 +188,14 @@
  * @return
  * The function tl_tmove() returns number of tag list items initialized.
  */
-size_t tl_tmove(tagi_t *dst, size_t size, 
+size_t tl_tmove(tagi_t *dst, size_t size,
 		tag_type_t t_tag, tag_value_t t_value, ...)
 {
   size_t n = 0, N = size / sizeof(tagi_t);
   tagi_t tagi[1];
   va_list ap;
-  
-  va_start(ap, t_value); 
+
+  va_start(ap, t_value);
 
   tagi->t_tag = t_tag, tagi->t_value = t_value;
 
@@ -204,7 +204,7 @@
     if (n < N)
       dst[n] = *tagi;
     n++;
-    if (t_end(tagi)) 
+    if (t_end(tagi))
       break;
 
     tagi->t_tag = va_arg(ap, tag_type_t);
@@ -217,16 +217,16 @@
 }
 
 /**Move a tag list.
- * 
+ *
  * The function tl_move() copies the tag list @a src to the buffer @a
  * dst. The size of the @a dst list must be at least @c tl_len(src) bytes.
- * 
+ *
  * @param dst pointer to the destination buffer
  * @param src tag list to be moved
  *
  * @return
  * The function tl_move() returns a pointer to the @a dst list after last
- * moved element.  
+ * moved element.
  */
 tagi_t *tl_move(tagi_t *dst, tagi_t const src[])
 {
@@ -242,10 +242,10 @@
 size_t tl_len(tagi_t const lst[])
 {
   size_t len = 0;
-  
+
   do {
     len += t_len(lst);
-  } 
+  }
   while ((lst = t_next(lst)));
 
   return len;
@@ -271,15 +271,15 @@
  * functionality.
  *
  * The size of the @a dst buffer must be at least @c tl_len(src) bytes.  The
- * size of buffer @a **bb must be at least @c tl_dup_xtra(src) bytes. 
- * 
+ * size of buffer @a **bb must be at least @c tl_dup_xtra(src) bytes.
+ *
  * @param[out] dst pointer to the destination buffer
  * @param[in] src tag list to be duplicated
  * @param[in,out] bb  pointer to pointer to buffer
  *
  * @return
  * A pointer to the @a dst list after last
- * duplicated taglist element.  
+ * duplicated taglist element.
  *
  * The pointer at @a *bb is updated to the byte after last duplicated memory
  * area.
@@ -292,12 +292,12 @@
 
   return dst;
 }
-	       
+
 
 /** Free a tag list.
  *
  * The function tl_free() frees resources associated with a tag list.
- * In other words, it calls t_free on each tag item on the list. 
+ * In other words, it calls t_free on each tag item on the list.
  *
  */
 void tl_free(tagi_t list[])
@@ -349,7 +349,7 @@
 tagi_t *tl_find_last(tagi_t const lst[], tag_type_t tt)
 {
   tagi_t const *last, *next;
-  
+
   for (next = last = t_find(tt, lst); next; next = t_find(tt, t_next(last)))
     last = next;
 
@@ -373,9 +373,9 @@
 static int tl_get(tag_type_t tt, void *p, tagi_t const lst[])
 {
   tagi_t const *t, *latest = NULL;
-  
+
   assert(tt);
-  
+
   if (tt == NULL || p == NULL)
     return 0;
 
@@ -414,14 +414,14 @@
       assert(tt->tt_class == ref_tag_class);
     }
 #endif
-  } 
+  }
 
   ta_end(ta);
 
   return n;
 }
 
-/** Find tags from given list. 
+/** Find tags from given list.
  *
  * Copies values of argument tag list into the reference tags in the tag
  * list @a lst.
@@ -453,7 +453,7 @@
       assert(tt->tt_class == ref_tag_class);
     }
 #endif
-  } 
+  }
 
   ta_end(ta);
 
@@ -462,9 +462,9 @@
 
 
 /** Filter an element in tag list */
-tagi_t *t_filter(tagi_t *dst, 
-		 tagi_t const filter[], 
-		 tagi_t const *src, 
+tagi_t *t_filter(tagi_t *dst,
+		 tagi_t const filter[],
+		 tagi_t const *src,
 		 void **bb)
 {
   tag_type_t tt = TAG_TYPE_OF(src);
@@ -475,7 +475,7 @@
       if (TAG_TYPE_OF(f)->tt_filter)
 	dst = TAG_TYPE_OF(f)->tt_filter(dst, f, src, bb);
       else if (f->t_tag == tt)
-	dst = t_dup(dst, src, bb); 
+	dst = t_dup(dst, src, bb);
     }
   }
   else {
@@ -500,7 +500,7 @@
  *
  * Each tag in @a src is checked against tags in list @a filter. If the tag
  * is in the @a filter list, or there is a special filter tag in the list
- * which matches with the tag in @a src, the tag is duplicated to @a dst using 
+ * which matches with the tag in @a src, the tag is duplicated to @a dst using
  * memory buffer in @a b.
  *
  * When @a dst is NULL, this function calculates the size of the filtered list.
@@ -508,9 +508,9 @@
  * @sa tl_afilter(), tl_tfilter(), tl_filtered_tlist(),
  * TAG_FILTER(), TAG_ANY(), #ns_tag_class
  */
-tagi_t *tl_filter(tagi_t dst[], 
-		  tagi_t const filter[], 
-		  tagi_t const src[], 
+tagi_t *tl_filter(tagi_t dst[],
+		  tagi_t const filter[],
+		  tagi_t const src[],
 		  void **b)
 {
   tagi_t const *s;
@@ -536,13 +536,13 @@
 
 
 
-/**Filter a tag list. 
- * 
+/**Filter a tag list.
+ *
  * The function tl_afilter() will build a tag list containing tags specified
  * in @a filter and extracted from @a src.  It will allocate the memory used by
  * tag list via the specified memory @a home, which may be also @c NULL.
  *
- * @sa tl_afilter(), tl_tfilter(), tl_filtered_tlist(), 
+ * @sa tl_afilter(), tl_tfilter(), tl_filtered_tlist(),
  * TAG_FILTER(), TAG_ANY(), #ns_tag_class
  */
 tagi_t *tl_afilter(su_home_t *home, tagi_t const filter[], tagi_t const src[])
@@ -574,10 +574,10 @@
 }
 
 /** Filter tag list @a src with given tags.
- * 
+ *
  * @sa tl_afilter(), tl_filtered_tlist(), TAG_FILTER(), TAG_ANY(), #ns_tag_class
  */
-tagi_t *tl_tfilter(su_home_t *home, tagi_t const src[], 
+tagi_t *tl_tfilter(su_home_t *home, tagi_t const src[],
 		   tag_type_t tag, tag_value_t value, ...)
 {
   tagi_t *tl;
@@ -592,7 +592,7 @@
  *
  * @sa tl_afilter(), tl_tfilter(), TAG_FILTER(), TAG_ANY(), #ns_tag_class
  */
-tagi_t *tl_filtered_tlist(su_home_t *home, tagi_t const filter[], 
+tagi_t *tl_filtered_tlist(su_home_t *home, tagi_t const filter[],
 			  tag_type_t tag, tag_value_t value, ...)
 {
   tagi_t *tl;
@@ -687,13 +687,13 @@
   for (;t;) {
     *t++ = *tagi;
 
-    if (t_end(tagi)) 
+    if (t_end(tagi))
       break;
 
     tagi->t_tag = va_arg(ap, tag_type_t);
     tagi->t_value = va_arg(ap, tag_value_t);
   }
-  
+
   assert((char *)rv + size == (char *)t);
 
   return rv;
@@ -702,7 +702,7 @@
 /** Make a tag list until TAG_NEXT() or TAG_END() */
 tagi_t *tl_list(tag_type_t tag, tag_value_t value, ...)
 {
-  va_list ap;  
+  va_list ap;
   tagi_t *t;
 
   va_start(ap, value);
@@ -728,7 +728,7 @@
     next = tl_next(tagi);
     if (next != tagi + 1)
       break;
-    
+
     if (tagi->t_tag != tag_skip)
       len += sizeof(tagi_t);
     tagi->t_tag = va_arg(ap, tag_type_t);
@@ -791,7 +791,7 @@
  */
 tagi_t *tl_llist(tag_type_t tag, tag_value_t value, ...)
 {
-  va_list ap;  
+  va_list ap;
   tagi_t *t;
 
   va_start(ap, value);
@@ -809,7 +809,7 @@
 }
 
 /** Convert a string to the a value of a tag. */
-int t_scan(tag_type_t tt, su_home_t *home, char const *s, 
+int t_scan(tag_type_t tt, su_home_t *home, char const *s,
 	   tag_value_t *return_value)
 {
   if (tt == NULL || s == NULL || return_value == NULL)
@@ -828,37 +828,35 @@
 /* ====================================================================== */
 /* null tag */
 
+static
 tagi_t const *t_null_next(tagi_t const *t)
 {
   return NULL;
 }
 
+static
 tagi_t *t_null_move(tagi_t *dst, tagi_t const *src)
 {
   memset(dst, 0, sizeof(*dst));
   return dst + 1;
 }
 
+static
 tagi_t *t_null_dup(tagi_t *dst, tagi_t const *src, void **bb)
 {
   memset(dst, 0, sizeof(*dst));
   return dst + 1;
 }
 
-tagi_t *t_null_copy(tagi_t *dst, tagi_t const *src, void **bb)
-{
-  memset(dst, 0, sizeof(*dst));
-  return dst + 1;
-}
-
+static
 tagi_t const * t_null_find(tag_type_t tt, tagi_t const lst[])
 {
   return NULL;
 }
 
-tagi_t *t_null_filter(tagi_t *dst, 
-		      tagi_t const filter[], 
-		      tagi_t const *src, 
+tagi_t *t_null_filter(tagi_t *dst,
+		      tagi_t const filter[],
+		      tagi_t const *src,
 		      void **bb)
 {
   if (TAG_TYPE_OF(src) == tag_null) {
@@ -871,9 +869,9 @@
   return dst;
 }
 
-tag_class_t null_tag_class[1] = 
-  {{ 
-    sizeof(null_tag_class), 
+tag_class_t null_tag_class[1] =
+  {{
+    sizeof(null_tag_class),
     /* tc_next */     t_null_next,
     /* tc_len */      NULL,
     /* tc_move */     t_null_move,
@@ -919,35 +917,40 @@
 /* ====================================================================== */
 /* skip tag - placeholder in tag list */
 
+static
 tagi_t const *t_skip_next(tagi_t const *t)
 {
   return t + 1;
 }
 
+static
 tagi_t *t_skip_move(tagi_t *dst, tagi_t const *src)
 {
   return dst;
 }
 
+static
 size_t t_skip_len(tagi_t const *t)
 {
   return 0;
 }
 
+static
 tagi_t *t_skip_dup(tagi_t *dst, tagi_t const *src, void **bb)
 {
   return dst;
 }
 
-tagi_t *t_skip_filter(tagi_t *dst, 
-		    tagi_t const filter[], 
-		    tagi_t const *src, 
+static
+tagi_t *t_skip_filter(tagi_t *dst,
+		    tagi_t const filter[],
+		    tagi_t const *src,
 		    void **bb)
 {
   return dst;
 }
 
-tag_class_t skip_tag_class[1] = 
+tag_class_t skip_tag_class[1] =
   {{
     sizeof(skip_tag_class),
     /* tc_next */     t_skip_next,
@@ -968,11 +971,13 @@
 /* ====================================================================== */
 /* next tag - jump to next tag list */
 
+static
 tagi_t const *t_next_next(tagi_t const *t)
 {
   return (tagi_t *)(t->t_value);
 }
 
+static
 tagi_t *t_next_move(tagi_t *dst, tagi_t const *src)
 {
   if (!src->t_value)
@@ -980,6 +985,7 @@
   return dst;
 }
 
+static
 size_t t_next_len(tagi_t const *t)
 {
   if (!t->t_value)
@@ -987,6 +993,7 @@
   return 0;
 }
 
+static
 tagi_t *t_next_dup(tagi_t *dst, tagi_t const *src, void **bb)
 {
   if (!src->t_value)
@@ -994,15 +1001,16 @@
   return dst;
 }
 
-tagi_t *t_next_filter(tagi_t *dst, 
-		    tagi_t const filter[], 
-		    tagi_t const *src, 
+static
+tagi_t *t_next_filter(tagi_t *dst,
+		    tagi_t const filter[],
+		    tagi_t const *src,
 		    void **bb)
 {
   return dst;
 }
 
-tag_class_t next_tag_class[1] = 
+tag_class_t next_tag_class[1] =
   {{
     sizeof(next_tag_class),
     /* tc_next */     t_next_next,
@@ -1023,9 +1031,10 @@
 /* ====================================================================== */
 /* filter tag  - use function to filter tag */
 
+static
 tagi_t *t_filter_with(tagi_t *dst,
-		      tagi_t const *t, 
-		      tagi_t const *src, 
+		      tagi_t const *t,
+		      tagi_t const *src,
 		      void **bb)
 {
   tag_filter_f *function;
@@ -1039,7 +1048,7 @@
     return dst;
 
   if (dst) {
-    return t_dup(dst, src, bb); 
+    return t_dup(dst, src, bb);
   }
   else {
     dst = (tagi_t *)((char *)dst + t_len(src));
@@ -1047,8 +1056,8 @@
     return dst;
   }
 }
-		   
-tag_class_t filter_tag_class[1] = 
+
+tag_class_t filter_tag_class[1] =
   {{
     sizeof(filter_tag_class),
     /* tc_next */     NULL,
@@ -1070,15 +1079,16 @@
 /* ====================================================================== */
 /* any tag - match to any tag when filtering */
 
+static
 tagi_t *t_any_filter(tagi_t *dst,
-		     tagi_t const filter[], 
-		     tagi_t const *src, 
+		     tagi_t const filter[],
+		     tagi_t const *src,
 		     void **bb)
 {
   if (!src)
     return dst;
   else if (dst) {
-    return t_dup(dst, src, bb); 
+    return t_dup(dst, src, bb);
   }
   else {
     dst = (tagi_t *)((char *)dst + t_len(src));
@@ -1086,8 +1096,8 @@
     return dst;
   }
 }
-		   
-tag_class_t any_tag_class[1] = 
+
+tag_class_t any_tag_class[1] =
   {{
     sizeof(any_tag_class),
     /* tc_next */     NULL,
@@ -1111,8 +1121,8 @@
 
 static
 tagi_t *t_ns_filter(tagi_t *dst,
-		    tagi_t const filter[], 
-		    tagi_t const *src, 
+		    tagi_t const filter[],
+		    tagi_t const *src,
 		    void **bb)
 {
   char const *match, *ns;
@@ -1137,7 +1147,7 @@
     return dst;
 
   if (dst) {
-    return t_dup(dst, src, bb); 
+    return t_dup(dst, src, bb);
   }
   else {
     dst = (tagi_t *)((char *)dst + t_len(src));
@@ -1146,8 +1156,8 @@
   }
 }
 
-/** Namespace filtering class */		   
-tag_class_t ns_tag_class[1] = 
+/** Namespace filtering class */
+tag_class_t ns_tag_class[1] =
   {{
     sizeof(ns_tag_class),
     /* tc_next */     NULL,
@@ -1178,15 +1188,15 @@
   return 1;
 }
 
-int t_int_scan(tag_type_t tt, su_home_t *home, 
-	       char const *s, 
+int t_int_scan(tag_type_t tt, su_home_t *home,
+	       char const *s,
 	       tag_value_t *return_value)
 {
   int value;
   char *rest;
 
   value = strtol(s, &rest, 0);
-  
+
   if (s != rest) {
     *return_value = (tag_value_t)value;
     return 1;
@@ -1197,7 +1207,7 @@
   }
 }
 
-tag_class_t int_tag_class[1] = 
+tag_class_t int_tag_class[1] =
   {{
     sizeof(int_tag_class),
     /* tc_next */     NULL,
@@ -1228,15 +1238,15 @@
   return 1;
 }
 
-int t_uint_scan(tag_type_t tt, su_home_t *home, 
-	       char const *s, 
+int t_uint_scan(tag_type_t tt, su_home_t *home,
+	       char const *s,
 	       tag_value_t *return_value)
 {
   unsigned value;
   char *rest;
 
   value = strtoul(s, &rest, 0);
-  
+
   if (s != rest) {
     *return_value = (tag_value_t)value;
     return 1;
@@ -1247,7 +1257,7 @@
   }
 }
 
-tag_class_t uint_tag_class[1] = 
+tag_class_t uint_tag_class[1] =
   {{
     sizeof(int_tag_class),
     /* tc_next */     NULL,
@@ -1282,15 +1292,15 @@
 }
 
 static
-int t_size_scan(tag_type_t tt, su_home_t *home, 
-		 char const *s, 
+int t_size_scan(tag_type_t tt, su_home_t *home,
+		 char const *s,
 		 tag_value_t *return_value)
 {
   unsigned longlong value;
   char *rest;
 
   value = strtoull(s, &rest, 0);
-  
+
   if (s != rest && value <= SIZE_MAX) {
     *return_value = (tag_value_t)value;
     return 1;
@@ -1302,7 +1312,7 @@
 }
 
 /** Tag class for tags with size_t value. @NEW_1_12_5. */
-tag_class_t size_tag_class[1] = 
+tag_class_t size_tag_class[1] =
   {{
     sizeof(int_tag_class),
     /* tc_next */     NULL,
@@ -1330,15 +1340,15 @@
 }
 
 static
-int t_usize_scan(tag_type_t tt, su_home_t *home, 
-		 char const *s, 
+int t_usize_scan(tag_type_t tt, su_home_t *home,
+		 char const *s,
 		 tag_value_t *return_value)
 {
   unsigned longlong value;
   char *rest;
 
   value = strtoull(s, &rest, 0);
-  
+
   if (s != rest && value <= USIZE_MAX) {
     *return_value = (tag_value_t)value;
     return 1;
@@ -1350,7 +1360,7 @@
 }
 
 /** Tag class for tags with usize_t value. @NEW_1_12_5. */
-tag_class_t usize_tag_class[1] = 
+tag_class_t usize_tag_class[1] =
   {{
     sizeof(int_tag_class),
     /* tc_next */     NULL,
@@ -1382,17 +1392,17 @@
   return 1;
 }
 
-int t_bool_scan(tag_type_t tt, su_home_t *home, 
-	       char const *s, 
+int t_bool_scan(tag_type_t tt, su_home_t *home,
+	       char const *s,
 	       tag_value_t *return_value)
 {
   int retval;
   int value = 0;
 
-  if (strncasecmp(s, "true", 4) == 0 
+  if (strncasecmp(s, "true", 4) == 0
       && strlen(s + 4) == strspn(s + 4, " \t\r\n")) {
     value = 1, retval = 1;
-  } else if (strncasecmp(s, "false", 5) == 0 
+  } else if (strncasecmp(s, "false", 5) == 0
 	     && strlen(s + 5) == strspn(s + 5, " \t\r\n")) {
     value = 0, retval = 1;
   } else {
@@ -1404,11 +1414,11 @@
     *return_value = (tag_value_t)value;
   else
     *return_value = (tag_value_t)0;
-  
+
   return retval;
 }
 
-tag_class_t bool_tag_class[1] = 
+tag_class_t bool_tag_class[1] =
   {{
     sizeof(bool_tag_class),
     /* tc_next */     NULL,
@@ -1440,8 +1450,8 @@
 }
 
 /* This is not usually very safe, so it is not used */
-int t_ptr_scan(tag_type_t tt, su_home_t *home, 
-	       char const *s, 
+int t_ptr_scan(tag_type_t tt, su_home_t *home,
+	       char const *s,
 	       tag_value_t *return_value)
 {
   int retval;
@@ -1453,11 +1463,11 @@
     *return_value = (tag_value_t)ptr;
   else
     *return_value = (tag_value_t)NULL;
-  
+
   return retval;
 }
 
-tag_class_t ptr_tag_class[1] = 
+tag_class_t ptr_tag_class[1] =
   {{
     sizeof(ptr_tag_class),
     /* tc_next */     NULL,
@@ -1491,7 +1501,7 @@
   return 1;
 }
 
-tag_class_t socket_tag_class[1] = 
+tag_class_t socket_tag_class[1] =
   {{
     sizeof(socket_tag_class),
     /* tc_next */     NULL,
@@ -1512,25 +1522,25 @@
 
 int t_str_snprintf(tagi_t const *t, char b[], size_t size)
 {
-  if (t->t_value) 
+  if (t->t_value)
     return snprintf(b, size, "\"%s\"", (char const *)t->t_value);
   else
     return snprintf(b, size, "<null>");
 }
 
-int t_str_scan(tag_type_t tt, su_home_t *home, 
-	       char const *s, 
+int t_str_scan(tag_type_t tt, su_home_t *home,
+	       char const *s,
 	       tag_value_t *return_value)
 {
   int retval;
 
   s = su_strdup(home, s);
-    
+
   if (s)
     *return_value = (tag_value_t)s, retval = 1;
   else
     *return_value = (tag_value_t)NULL, retval = -1;
-  
+
   return retval;
 }
 
@@ -1540,10 +1550,10 @@
   if (src->t_value) {
     char const *s = (char const *)src->t_value;
     size_t len = strlen(s) + 1;
-    dst->t_value = (tag_value_t)strcpy(*bb, s); 
+    dst->t_value = (tag_value_t)strcpy(*bb, s);
     *bb = (char *)*bb + len;
   }
-  else 
+  else
     dst->t_value = (tag_value_t)0;
 
   return dst + 1;
@@ -1554,7 +1564,7 @@
   return t->t_value ? strlen((char *)t->t_value) + 1 : 0;
 }
 
-tag_class_t str_tag_class[1] = 
+tag_class_t str_tag_class[1] =
   {{
     sizeof(str_tag_class),
     /* tc_next */     NULL,
@@ -1574,7 +1584,7 @@
 /* cstr tag - pass constant string value (no need to dup) */
 
 /** Tag class for constant strings */
-tag_class_t cstr_tag_class[1] = 
+tag_class_t cstr_tag_class[1] =
   {{
     sizeof(cstr_tag_class),
     /* tc_next */     NULL,
@@ -1593,7 +1603,7 @@
 /* ====================================================================== */
 /* ref tag - pass reference */
 
-tag_class_t ref_tag_class[1] = 
+tag_class_t ref_tag_class[1] =
   {{
     sizeof(ref_tag_class),
     /* tc_next */     NULL,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_time.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_time.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_time.c	Tue Dec 23 07:37:03 2008
@@ -30,7 +30,7 @@
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Jari Selin <Jari.Selin at nokia.com>
  * @author Kai Vehmanen <first.surname at nokia.com>
- * 
+ *
  * @date Created: Thu Mar 18 19:40:51 1999 pessi
  */
 
@@ -59,49 +59,49 @@
 /**@defgroup su_time Time Handling
  *
  * OS-independent timing functions and types for the @b su library.
- *  
+ *
  * The @b su library provides three different time formats with different
  * ranges and epochs in <sofia-sip/su_time.h>:
  *
  *   - #su_time_t, second and microsecond as 32-bit values since 1900,
  *   - #su_duration_t, milliseconds between two times, and
- *   - #su_ntp_t, standard NTP timestamp (seconds since 1900 as 
- *     a fixed-point 64-bit value with 32 bits representing subsecond 
+ *   - #su_ntp_t, standard NTP timestamp (seconds since 1900 as
+ *     a fixed-point 64-bit value with 32 bits representing subsecond
  *     value).
  */
 
 /**
  * Compare two timestamps.
- * 
+ *
  * The function su_time_cmp() compares two su_time_t timestamps.
- * 
+ *
  * @param t1 first NTP timestamp in su_time_t structure
  * @param t2 second NTP timestamp in su_time_t structure
- * 
+ *
  * @retval  Negative, if @a t1 is before @a t2,
  * @retval  Zero, if @a t1 is same as @a t2, or
  * @retval  Positive, if @a t1 is after @a t2.
- * 
+ *
  */
 long su_time_cmp(su_time_t const t1, su_time_t const t2)
 {
   long retval = 0;
 
-  if (t1.tv_sec > t2.tv_sec) 
+  if (t1.tv_sec > t2.tv_sec)
     retval = 1;
-  else if (t1.tv_sec < t2.tv_sec) 
+  else if (t1.tv_sec < t2.tv_sec)
     retval = -1;
   else {
-    if (t1.tv_usec > t2.tv_usec) 
+    if (t1.tv_usec > t2.tv_usec)
       retval = 1;
-    else if (t1.tv_usec < t2.tv_usec) 
+    else if (t1.tv_usec < t2.tv_usec)
       retval = -1;
   }
 
   return retval;
 }
 
-/**@def SU_TIME_CMP(t1, t2) 
+/**@def SU_TIME_CMP(t1, t2)
  *
  * Compare two timestamps.
  *
@@ -109,7 +109,7 @@
  *
  * @param t1   first NTP timestamp in su_time_t structure
  * @param t2   second NTP timestamp in su_time_t  structure
- * 
+ *
  * @retval negative, if t1 is before t2,
  * @retval zero,     if t1 is same as t2, or
  * @retval positive, if t1 is after t2.
@@ -119,19 +119,19 @@
 
 /** Difference between two timestamps.
  *
- * The function returns difference between two timestamps 
+ * The function returns difference between two timestamps
  * in seconds (t1 - t2).
  *
  * @param t1   first timeval
  * @param t2   second timeval
- * 
+ *
  * @return
  *    The difference between two timestamps in seconds as a double.
  */
 double su_time_diff(su_time_t const t1, su_time_t const t2)
 {
   return
-    ((double)t1.tv_sec - (double)t2.tv_sec) 
+    ((double)t1.tv_sec - (double)t2.tv_sec)
     + (double)((long)t1.tv_usec - (long)t2.tv_usec) / 1000000.0;
 }
 
@@ -151,14 +151,14 @@
 
 /** Print su_time_t timestamp.
  *
- *   This function prints a su_time_t timestamp as a decimal number to the 
+ *   This function prints a su_time_t timestamp as a decimal number to the
  *   given buffer.
  *
  * @param s    pointer to buffer
  * @param n    buffer size
  * @param tv   pointer to the timeval object
- * 
- * @return 
+ *
+ * @return
  *   The number of characters printed, excluding the final @c NUL.
  */
 int su_time_print(char *s, int n, su_time_t const *tv)
@@ -172,11 +172,11 @@
 
 /** Time difference in milliseconds.
  *
- * Calculates the duration from t2 to t1 in milliseconds.  
+ * Calculates the duration from t2 to t1 in milliseconds.
  *
  * @param t1   after time
  * @param t2   before time
- * 
+ *
  * @return The duration in milliseconds between the two times.
  * If the difference is bigger than #SU_DURATION_MAX, return #SU_DURATION_MAX
  * instead.
@@ -202,6 +202,8 @@
 
 typedef uint64_t su_t64_t;	/* time with 64 bits */
 
+static su_time_t su_t64_to_time(su_t64_t const us);
+
 const uint32_t su_res32 = 1000000UL;
 const su_t64_t su_res64 = (su_t64_t)1000000UL;
 
@@ -215,7 +217,7 @@
  *
  * The function su_ntp_now() returns the current NTP timestamp.  NTP
  * timestamp is seconds elapsed since January 1st, 1900.
- * 
+ *
  * @return
  * The current time as NTP timestamp is returned.
  */
@@ -235,20 +237,20 @@
 
     usec = now / 1000;
     nsec = now % 1000;
-    
+
     /*
      * Multiply usec by 4294.967296 (ie. 2**32 / 1E6)
-     * 
-     * Utilize fact that 4294.967296 == 4295 - 511 / 15625 
+     *
+     * Utilize fact that 4294.967296 == 4295 - 511 / 15625
      */
     now = 4295 * usec - 511 * usec / 15625;
     rem = (511U * usec) % 15625U;
-  
+
     /* Multiply nsec by 4.294967296 */
     nsec = 4295 * 125 * nsec - (511 * nsec) / 125;
     nsec -= 8 * rem; /* usec rounding */
     nsec = (nsec + (nsec < 0 ? -62499 : +62499)) / 125000;
-    
+
     return now + nsec;
   }
 }
@@ -307,6 +309,7 @@
   return (uint32_t) (ntp >> 16) & 0xffffffffLU;
 }
 
+static
 su_time_t su_t64_to_time(su_t64_t const us)
 {
   su_time_t tv;
@@ -317,7 +320,7 @@
   return tv;
 }
 
-/** 
+/**
  * Add milliseconds to the time.
  *
  * @param t0  time in seconds and microseconds as @c su_time_t
@@ -328,7 +331,7 @@
   return su_t64_to_time(SU_TIME_TO_T64(t0) + SU_DUR_TO_T64(dur));
 }
 
-/** 
+/**
  * Add seconds to the time.
  *
  * @param t0  time in seconds and microseconds as @c su_time_t
@@ -354,7 +357,7 @@
 
   if(!counterfreq) {
     LARGE_INTEGER Freq = { 0, 0 };
-    if (!QueryPerformanceFrequency(&Freq)) { 
+    if (!QueryPerformanceFrequency(&Freq)) {
       SU_DEBUG_1(("su_counter: QueryPerformanceFrequency failed\n"));
       return 0;
     }
@@ -366,9 +369,9 @@
      return 0;
   }
   count = (ULONGLONG) LargeIntCount.QuadPart;
- 
+
   /* return value is in ns */
-  return  ((count * 1000 * 1000 * 1000) / counterfreq) ; 
+  return  ((count * 1000 * 1000 * 1000) / counterfreq) ;
 }
 
 uint64_t su_counter(void)
@@ -384,7 +387,7 @@
  * for timing purposes.
  *
  * Parameters:
- * 
+ *
  * @return
  *   The current CPU counter value in nanoseconds
  */
@@ -396,7 +399,7 @@
   static clockid_t cpu = CLOCK_REALTIME;
 
 # define CLOCK_GETTIMEOFDAY 0xdedbeefUL
-  
+
   if (init == 0) {
     init = 1;
 
@@ -425,8 +428,8 @@
     perror("clock_gettime");
 
   /* return value is in nanoseconds */
-  return 
-    (uint64_t)((unsigned long)tp.tv_nsec) + 
+  return
+    (uint64_t)((unsigned long)tp.tv_nsec) +
     (uint64_t)((unsigned long)tp.tv_sec) * 1000000000ULL;
 }
 
@@ -436,7 +439,7 @@
  * for timing purposes.
  *
  * Parameters:
- * 
+ *
  * @return
  *   The current CPU counter value in microseconds.
  */
@@ -451,8 +454,8 @@
   struct timeval tv;
   gettimeofday(&tv, NULL);
   /* return value is in microseconds */
-  return 
-    (uint64_t)((unsigned long)tv.tv_usec) + 
+  return
+    (uint64_t)((unsigned long)tv.tv_usec) +
     (uint64_t)((unsigned long)tv.tv_sec) * 1000000ULL;
 }
 
@@ -461,8 +464,8 @@
   struct timeval tv;
   gettimeofday(&tv, NULL);
   /* return value is in nanoseconds */
-  return 
-    (uint64_t)((unsigned long)tv.tv_usec) * 1000ULL + 
+  return
+    (uint64_t)((unsigned long)tv.tv_usec) * 1000ULL +
     (uint64_t)((unsigned long)tv.tv_sec) * 1000000000ULL;
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_time0.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_time0.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_time0.c	Tue Dec 23 07:37:03 2008
@@ -31,7 +31,7 @@
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Jari Selin <Jari.Selin at nokia.com>
- * 
+ *
  * @date Created: Fri May 10 18:13:19 2002 ppessi
  */
 
@@ -61,7 +61,7 @@
 #endif
 
 /** Seconds from 1.1.1900 to 1.1.1970 */
-#define NTP_EPOCH 2208988800UL 
+#define NTP_EPOCH 2208988800UL
 #define E9 (1000000000U)
 #define E7 (10000000U)
 
@@ -92,7 +92,7 @@
   GetSystemTimeAsFileTime(date.ft);
 
   tv->tv_usec = (unsigned long) ((date.ull->QuadPart % E7) / 10);
-  tv->tv_sec = (unsigned long) ((date.ull->QuadPart / E7) - 
+  tv->tv_sec = (unsigned long) ((date.ull->QuadPart / E7) -
     /* 1900-Jan-01 - 1601-Jan-01: 299 years, 72 leap years */
     (299 * 365 + 72) * 24 * 60 * (uint64_t)60);
 #else
@@ -122,7 +122,7 @@
 #if HAVE_CLOCK_GETTIME
   {
     struct timespec tv;
-  
+
     if (clock_gettime(CLOCK_REALTIME, &tv) == 0) {
       now = ((su_nanotime_t)tv.tv_sec + NTP_EPOCH) * E9 + tv.tv_nsec;
       *return_time = now;
@@ -139,11 +139,11 @@
       FILETIME       ft[1];
       ULARGE_INTEGER ull[1];
     } date;
-    
+
     GetSystemTimeAsFileTime(date.ft);
 
-    now = 100 * 
-      (date.ull->QuadPart - 
+    now = 100 *
+      (date.ull->QuadPart -
        /* 1900-Jan-01 - 1601-Jan-01: 299 years, 72 leap years */
        ((su_nanotime_t)(299 * 365 + 72) * 24 * 60 * 60) * E7);
   }
@@ -173,16 +173,16 @@
  * monotonic and never goes back - if the underlying system supports such a
  * clock.
  *
- * @param return_time optional pointer to return the current time 
+ * @param return_time optional pointer to return the current time
  *
- * @return Current time as nanoseconds 
+ * @return Current time as nanoseconds
  */
 su_nanotime_t su_monotime(su_nanotime_t *return_time)
 {
 #if HAVE_CLOCK_GETTIME && CLOCK_MONOTONIC
   {
     struct timespec tv;
-  
+
     if (clock_gettime(CLOCK_MONOTONIC, &tv) == 0) {
       su_nanotime_t now = (su_nanotime_t)tv.tv_sec * E9 + tv.tv_nsec;
       if (return_time)
@@ -195,7 +195,7 @@
 #if HAVE_NANOUPTIME
   {
     struct timespec tv;
-  
+
     nanouptime(&tv);
     now = (su_nanotime_t)tv.tv_sec * E9 + tv.tv_nsec;
     if (return_time)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_timer.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_timer.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_timer.c	Tue Dec 23 07:37:03 2008
@@ -63,7 +63,7 @@
  *   - su_timer_set_interval(),
  *   - su_timer_set_at(),
  *   - su_timer_set(),
- *   - su_timer_set_for_ever(), 
+ *   - su_timer_set_for_ever(),
  *   - su_timer_run(),
  *   - su_timer_reset(), and
  *   - su_timer_root().
@@ -90,7 +90,7 @@
  * The default duration is given in milliseconds.
  *
  * Usually, timer wakeup function should be called at regular intervals. In
- * such case, the timer is activated using function su_timer_set_for_ever(). 
+ * such case, the timer is activated using function su_timer_set_for_ever().
  * When the timer is activated it is given the wakeup function and pointer to
  * context data:
  * @code
@@ -158,7 +158,7 @@
   unsigned char   sut_set;	/**< Timer is set (inserted in tree) */
 };
 
-/** Timer running status */ 
+/** Timer running status */
 enum sut_running {
   reset = 0,		/**< Timer is not running */
   run_at_intervals = 1, /**< Compensate missed wakeup calls */
@@ -195,7 +195,7 @@
 	      IS_RED, SET_RED, IS_BLACK, SET_BLACK, COPY_COLOR,
 	      CMP, INSERT, REMOVE);
 
-/**@internal Set the timer. 
+/**@internal Set the timer.
  *
  * @retval 0 when successful (always)
  */
@@ -217,7 +217,7 @@
   return timers_append(timers, t);
 }
 
-/**@internal Reset the timer. 
+/**@internal Reset the timer.
  *
  * @retval 0 when successful (always)
  */
@@ -238,7 +238,7 @@
 }
 
 /**@internal Validate timer @a t and return pointer to per-port timer tree.
- * 
+ *
  * @retval pointer to pointer to timer tree when successful
  * @retval NULL upon an error
  */
@@ -263,7 +263,7 @@
 
   if (use_sut_duration && t->sut_duration == 0) {
     assert(t->sut_duration > 0);
-    SU_DEBUG_1(("%s(%p): %s\n", caller, (void *)t, 
+    SU_DEBUG_1(("%s(%p): %s\n", caller, (void *)t,
 		"timer without default duration"));
     return NULL;
   }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c	Tue Dec 23 07:37:03 2008
@@ -32,7 +32,7 @@
  * not unique if multiple processes are run on the same node.
  *
  * Use su_guid_sprintf() to convert #su_guid_t to printable format.
- * 
+ *
  * The random integers can be generated with functions
  * - su_randint(),
  * - su_randmem(), or
@@ -44,7 +44,7 @@
  * @CFILE su_uniqueid.c Construct a GloballyUniqueID as per H.225.0 v2.
  *
  * @author Pekka Pessi <pessi at research.nokia.com>
- * 
+ *
  * @date Created: Tue Apr 15 06:31:41 1997 pessi
  */
 
@@ -87,7 +87,7 @@
 #define MAGIC (16384)
 
 /* 100-nanosecond intervals between 15 October 1582 and 1 January 1900 */
-static const uint64_t ntp_epoch = 
+static const uint64_t ntp_epoch =
 (uint64_t)(141427) * (24 * 60 * 60L) * granularity;
 
 /* State */
@@ -104,7 +104,7 @@
 {
   uint64_t tl = su_ntp_now();
   uint64_t hi = su_ntp_hi(tl), lo = su_ntp_lo(tl);
-  
+
   lo *= granularity;
   hi *= granularity;
 
@@ -143,7 +143,7 @@
 
   /* Initialize our random number generator */
 #if HAVE_DEV_URANDOM
-  if (!urandom) 
+  if (!urandom)
     urandom = fopen("/dev/urandom", "rb");
 #endif	/* HAVE_DEV_URANDOM */
 
@@ -161,7 +161,7 @@
       seed[2*i] ^= now.tv_sec; seed[2*i+1] ^= now.tv_sec;
     }
 
-    seed[30] ^= getuid(); 
+    seed[30] ^= getuid();
     seed[31] ^= getpid();
   }
 
@@ -252,12 +252,12 @@
   uint64_t time;
   unsigned clock;
 
-  if (!initialized) init(); 
+  if (!initialized) init();
 
   time = timestamp();
   clock = clock_sequence;
 
-  v->s.time_high_and_version = 
+  v->s.time_high_and_version =
     htons((unsigned short)(((time >> 48) & 0x0fff) | (version << 12)));
   v->s.time_mid = htons((unsigned short)((time >> 32) & 0xffff));
   v->s.time_low = htonl((unsigned long)(time & 0xffffffffUL));
@@ -278,20 +278,20 @@
 	  ntohs(v->s.time_high_and_version),
 	  v->s.clock_seq_low,
 	  v->s.clock_seq_hi_and_reserved,
-	  v->s.node[0], v->s.node[1], v->s.node[2], 
+	  v->s.node[0], v->s.node[1], v->s.node[2],
 	  v->s.node[3], v->s.node[4], v->s.node[5]);
   memcpy(buf, mybuf, len > sizeof(mybuf) ? sizeof(mybuf) : len);
   return su_guid_strlen;
 }
 
-/* 
- * Generate random integer in range [lb, ub] (inclusive) 
+/*
+ * Generate random integer in range [lb, ub] (inclusive)
  */
 int su_randint(int lb, int ub)
 {
   unsigned rnd = 0;
-  
-  if (!initialized) init(); 
+
+  if (!initialized) init();
 
   if (urandom) {
     size_t len = fread(&rnd, 1, sizeof rnd, urandom); (void)len;
@@ -309,7 +309,7 @@
 {
   size_t i;
 
-  if (!initialized) init(); 
+  if (!initialized) init();
 
   if (urandom) {
     size_t len = fread(mem, 1, siz, urandom); (void)len;
@@ -322,14 +322,14 @@
   return mem;
 }
 
-/** Get random number for RTP timestamps. 
+/** Get random number for RTP timestamps.
  *
  * This function returns a 32-bit random integer. It also initializes the
  * random number generator, if needed.
  */
 uint32_t su_random(void)
 {
-  if (!initialized) init(); 
+  if (!initialized) init();
 
   if (urandom) {
     uint32_t rnd;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_vector.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_vector.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_vector.c	Tue Dec 23 07:37:03 2008
@@ -37,7 +37,7 @@
  * The vectors are resizeable unidimensional arrays.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- *  
+ *
  * @date Created: Fri Sep 27 14:43:29 2002 ppessi
  */
 
@@ -66,7 +66,7 @@
   void              **v_list;
 };
 
-/** Create a vector. 
+/** Create a vector.
  *
  * The function su_vector_create() creates a pointer vector object. The
  * vector is initially empty. The function clones a memory home for the
@@ -126,19 +126,19 @@
 	return 0;
 
       memcpy(list, vector->v_list, index * sizeof(vector->v_list[0]));
-      memcpy(list + index + 1, vector->v_list + index, 
+      memcpy(list + index + 1, vector->v_list + index,
 	     (vector->v_len - index) * sizeof(vector->v_list[0]));
 
       if (vector->v_list != (void **)(vector + 1)) {
 	su_free(vector->v_home, vector->v_list);
       }
     }
-    
+
     vector->v_list = list;
     vector->v_size *= 2;
   }
   else {
-    memmove(vector->v_list + index + 1, vector->v_list + index, 
+    memmove(vector->v_list + index + 1, vector->v_list + index,
 	    (vector->v_len - index) * sizeof(vector->v_list[0]));
   }
 
@@ -147,7 +147,7 @@
   return 1;
 }
 
-/**Insert an item to vector. 
+/**Insert an item to vector.
  *
  * The function su_vector_insert() inserts an @a item to the @a vector.
  * The items after the @a index will be moved further within the vector.
@@ -161,7 +161,7 @@
  */
 int su_vector_insert(su_vector_t *vector, usize_t index, void *item)
 {
-  if (vector && 
+  if (vector &&
       index <= vector->v_len &&
       su_vector_make_place(vector, index) > 0) {
     vector->v_list[index] = item;
@@ -170,7 +170,7 @@
   return -1;
 }
 
-/**Remove an item from vector. 
+/**Remove an item from vector.
  *
  * The function su_vector_remove() removes an item from the @a vector.
  * The items after the @a index will be moved backwards within the vector.
@@ -186,8 +186,8 @@
   if (vector && index < vector->v_len) {
     if (vector->v_free_func)
         (vector->v_free_func)(vector->v_list[index]);
-    
-    memmove(vector->v_list + index, 
+
+    memmove(vector->v_list + index,
             vector->v_list + index + 1,
             (vector->v_len - index - 1) * sizeof(vector->v_list[0]));
     vector->v_len--;
@@ -197,7 +197,7 @@
   return -1;
 }
 
-/**Remove all items from vector. 
+/**Remove all items from vector.
  *
  * The function su_vector_empty() removes all items from the @a vector.
  *
@@ -224,7 +224,7 @@
   return -1;
 }
 
-/**Append an item to vector. 
+/**Append an item to vector.
  *
  * The function su_vector_append() appends an @a item to the @a vector.
  *
@@ -250,11 +250,11 @@
   return 0;
 }
 
-/**Get a numbered item from list. 
+/**Get a numbered item from list.
  *
  * The function su_vector_item() returns a numbered item from vector. The
  * numbering starts from 0.
- * 
+ *
  * @param vector  pointer to a vector object
  * @param i     index
  *
@@ -269,9 +269,9 @@
     return NULL;
 }
 
-/** Get number of items in list. 
+/** Get number of items in list.
  *
- * The function su_vector_len() returns the number of items in the 
+ * The function su_vector_len() returns the number of items in the
  * vector.
  */
 usize_t su_vector_len(su_vector_t const *l)
@@ -284,12 +284,12 @@
   return su_vector_len(vector) == 0;
 }
 
-/**Get a pointer array from list. 
+/**Get a pointer array from list.
  *
  * The function su_vector_get_array() returns an array of pointer. The
  * length of the array is always one longer than the length of the vector,
  * and the last item in the returned array is always NULL.
- * 
+ *
  * @param vector  pointer to a vector object
  *
  * @return
@@ -302,7 +302,7 @@
     size_t newsize = sizeof(retval[0]) * (vector->v_len + 1);
 
     retval = su_alloc(vector->v_home, newsize);
-    
+
     if (retval) {
       retval[vector->v_len] = NULL;
       return memcpy(retval, vector->v_list, sizeof(retval[0]) * vector->v_len);
@@ -312,11 +312,11 @@
   return NULL;
 }
 
-/**Free a string array. 
+/**Free a string array.
  *
  * The function su_vector_free_array() discards a string array allocated
  * with su_vector_get_array().
- * 
+ *
  * @param vector  pointer to a vector object
  * @param array  string array to be freed
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_wait.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_wait.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_wait.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@ingroup su_wait
  *
- * @CFILE su_wait.c  
+ * @CFILE su_wait.c
  * Implementation of OS-independent socket synchronization interface.
  *
  * This looks like nth reincarnation of "reactor".  It implements the
@@ -121,13 +121,13 @@
  *
  * As a side-effect the socket is put into non-blocking mode when wait
  * object is created.
- * 
+ *
  * @param newwait  the newly created wait object (output)
  * @param socket   socket
  * @param events   mask for events that can signal this wait object
- * 
+ *
  * @retval 0 if the call was successful,
- * @retval -1 upon an error.  
+ * @retval -1 upon an error.
 */
 int su_wait_create(su_wait_t *newwait, su_socket_t socket, int events)
 {
@@ -164,7 +164,7 @@
   mode |= O_NDELAY | O_NONBLOCK;
   if (fcntl(socket, F_SETFL, mode) < 0)
     return -1;
-  
+
   newwait->fd = socket;
   newwait->events = events;
   newwait->revents = 0;
@@ -177,7 +177,7 @@
  *
  * The function su_wait_destroy() destroys a su_wait_t object.
  *
- * @param waitobj  pointer to wait object   
+ * @param waitobj  pointer to wait object
  *
  * @retval 0 when successful,
  * @retval -1 upon an error.
@@ -206,11 +206,11 @@
  * The function su_wait() blocks until an event specified by wait objects in
  * @a wait array.  If @a timeout is not SU_WAIT_FOREVER, a timeout occurs
  * after @a timeout milliseconds.
- * 
+ *
  * In Unix, this is @c poll() or @c select().
- * 
+ *
  * In Windows, this is @c WSAWaitForMultipleEvents().
- * 
+ *
  * @param waits    array of wait objects
  * @param n        number of wait objects in array waits
  * @param timeout  timeout in milliseconds
@@ -250,20 +250,20 @@
 	  return j;
       }
     }
-  
+
     if (errno == EINTR)
       continue;
 
     return -1;
-  }  
+  }
 #endif
 }
 
 /** Get events.
- * 
+ *
  *   The function su_wait_events() returns an mask describing events occurred.
  *
- * @param waitobj  pointer to wait object   
+ * @param waitobj  pointer to wait object
  * @param s        socket
  *
  * @return Binary mask describing the events.
@@ -285,15 +285,15 @@
 }
 
 /** Set event mask.
- * 
+ *
  *   The function su_wait_mask() sets the mask describing events that can
  *   signal the wait object.
  *
- * @param waitobj  pointer to wait object   
+ * @param waitobj  pointer to wait object
  * @param s        socket
  * @param events   new event mask
  *
- * @retval  0 when successful, 
+ * @retval  0 when successful,
  * @retval -1 upon an error.
  */
 int su_wait_mask(su_wait_t *waitobj, su_socket_t s, int events)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_win32_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_win32_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_win32_port.c	Tue Dec 23 07:37:03 2008
@@ -61,8 +61,8 @@
 
   unsigned         sup_multishot; /**< Multishot operation? */
 
-  unsigned         sup_registers; /** Counter incremented by 
-				      su_port_register() or 
+  unsigned         sup_registers; /** Counter incremented by
+				      su_port_register() or
 				      su_port_unregister()
 				   */
 
@@ -70,39 +70,39 @@
   int              sup_size_waits; /**< Size of allocated su_waits */
   int              sup_pri_offset; /**< Offset to prioritized waits */
 
-  /** Indices from index returned by su_root_register() to tables below. 
+  /** Indices from index returned by su_root_register() to tables below.
    *
    * Free elements are negative. Free elements form a list, value of free
    * element is (0 - index of next free element).
    *
-   * First element sup_indices[0] points to first free element. 
+   * First element sup_indices[0] points to first free element.
    */
   int             *sup_indices;
 
   int             *sup_reverses; /** Reverse index */
-  su_wakeup_f     *sup_wait_cbs; 
-  su_wakeup_arg_t**sup_wait_args; 
-  su_root_t      **sup_wait_roots; 
-  su_wait_t       *sup_waits; 
+  su_wakeup_f     *sup_wait_cbs;
+  su_wakeup_arg_t**sup_wait_args;
+  su_root_t      **sup_wait_roots;
+  su_wait_t       *sup_waits;
 
 };
 
 static void su_wsevent_port_decref(su_port_t *, int blocking, char const *who);
 
 static int su_wsevent_port_register(su_port_t *self,
-				 su_root_t *root, 
-				 su_wait_t *wait, 
+				 su_root_t *root,
+				 su_wait_t *wait,
 				 su_wakeup_f callback,
 				 su_wakeup_arg_t *arg,
 				 int priority);
 static int su_wsevent_port_unregister(su_port_t *port,
-				   su_root_t *root, 
-				   su_wait_t *wait,	
-				   su_wakeup_f callback, 
+				   su_root_t *root,
+				   su_wait_t *wait,
+				   su_wakeup_f callback,
 				   su_wakeup_arg_t *arg);
 static int su_wsevent_port_deregister(su_port_t *self, int i);
 static int su_wsevent_port_unregister_all(su_port_t *self, su_root_t *root);
-static int su_wsevent_port_eventmask(su_port_t *self, 
+static int su_wsevent_port_eventmask(su_port_t *self,
 				  int index,
 				  int socket,
 				  int events);
@@ -168,22 +168,22 @@
  *
  *  Please note if identical wait objects are inserted, only first one is
  *  ever signalled.
- * 
+ *
  * @param self	     pointer to port
  * @param root	     pointer to root object
  * @param waits	     pointer to wait object
  * @param callback   callback function pointer
  * @param arg	     argument given to callback function when it is invoked
- * @param priority   relative priority of the wait object 
+ * @param priority   relative priority of the wait object
  *              (0 is normal, 1 important, 2 realtime)
- * 
+ *
  * @return
- *   Positive index of the wait object, 
+ *   Positive index of the wait object,
  *   or -1 upon an error.
  */
 int su_wsevent_port_register(su_port_t *self,
-			  su_root_t *root, 
-			  su_wait_t *wait, 
+			  su_root_t *root,
+			  su_wait_t *wait,
 			  su_wakeup_f callback,
 			  su_wakeup_arg_t *arg,
 			  int priority)
@@ -210,7 +210,7 @@
 
     if (self->sup_size_waits == 0)
       size = su_root_size_hint;
-    else 
+    else
       size = 2 * self->sup_size_waits;
 
     if (size < SU_WAIT_MIN)
@@ -237,7 +237,7 @@
 	reverses[i] = -1;
       self->sup_reverses = reverses;
     }
-      
+
     waits = su_realloc(h, self->sup_waits, size * sizeof(*waits));
     if (waits)
       self->sup_waits = waits;
@@ -252,10 +252,10 @@
 
     /* Add sup_wait_roots array, if needed */
     wait_tasks = su_realloc(h, self->sup_wait_roots, size * sizeof(*wait_tasks));
-    if (wait_tasks) 
+    if (wait_tasks)
       self->sup_wait_roots = wait_tasks;
 
-    if (!(indices && 
+    if (!(indices &&
 	  reverses && waits && wait_cbs && wait_args && wait_tasks)) {
       return -1;
     }
@@ -274,7 +274,7 @@
       self->sup_waits[n] = self->sup_waits[n-1];
       self->sup_wait_cbs[n] = self->sup_wait_cbs[n-1];
       self->sup_wait_args[n] = self->sup_wait_args[n-1];
-      self->sup_wait_roots[n] = self->sup_wait_roots[n-1];	
+      self->sup_wait_roots[n] = self->sup_wait_roots[n-1];
     }
 
     self->sup_pri_offset++;
@@ -314,9 +314,9 @@
 
   if (destroy_wait)
     su_wait_destroy(&self->sup_waits[n]);
-  
+
   N = --self->sup_n_waits;
-  
+
   if (n < self->sup_pri_offset) {
     int j = --self->sup_pri_offset;
     if (n != j) {
@@ -352,7 +352,7 @@
   self->sup_wait_cbs[n] = NULL;
   self->sup_wait_args[n] = NULL;
   self->sup_wait_roots[n] = NULL;
-  
+
   indices[i] = indices[0];
   indices[0] = -i;
 
@@ -363,24 +363,24 @@
 
 
 /** Unregister a su_wait_t object.
- *  
+ *
  * Unregisters a su_wait_t object. The wait object, a callback function and
  * a argument are removed from the port object.
- * 
+ *
  * @param self     - pointer to port object
  * @param root     - pointer to root object
  * @param wait     - pointer to wait object
  * @param callback - callback function pointer (may be NULL)
- * @param arg      - argument given to callback function when it is invoked 
+ * @param arg      - argument given to callback function when it is invoked
  *                   (may be NULL)
  *
- * @deprecated Use su_wsevent_port_deregister() instead. 
+ * @deprecated Use su_wsevent_port_deregister() instead.
  *
  * @return Nonzero index of the wait object, or -1 upon an error.
  */
 int su_wsevent_port_unregister(su_port_t *self,
-			    su_root_t *root, 
-			    su_wait_t *wait,	
+			    su_root_t *root,
+			    su_wait_t *wait,
 			    su_wakeup_f callback, /* XXX - ignored */
 			    su_wakeup_arg_t *arg)
 {
@@ -403,14 +403,14 @@
 }
 
 /** Deregister a su_wait_t object.
- *  
+ *
  *  Deregisters a registration by index. The wait object, a callback
  *  function and a argument are removed from the port object. The wait
  *  object is destroyed.
- * 
+ *
  * @param self     - pointer to port object
  * @param i        - registration index
- * 
+ *
  * @return Index of the wait object, or -1 upon an error.
  */
 int su_wsevent_port_deregister(su_port_t *self, int i)
@@ -426,7 +426,7 @@
 
   if (self->sup_indices[i] < 0)
     return su_seterrno(EBADF);
-    
+
   retval = su_wsevent_port_deregister0(self, i, 1);
 
   su_wait_destroy(wait);
@@ -440,13 +440,13 @@
  *
  * Unregisters all su_wait_t objects and destroys all queued timers
  * associated with given root object.
- * 
+ *
  * @param  self     - pointer to port object
  * @param  root     - pointer to root object
- * 
+ *
  * @return Number of wait objects removed.
  */
-int su_wsevent_port_unregister_all(su_port_t *self, 
+int su_wsevent_port_unregister_all(su_port_t *self,
 				su_root_t *root)
 {
   int i, j, index, N;
@@ -461,11 +461,11 @@
   N          = self->sup_n_waits;
   indices    = self->sup_indices;
   reverses   = self->sup_reverses;
-  waits      = self->sup_waits; 
-  wait_cbs   = self->sup_wait_cbs; 
+  waits      = self->sup_waits;
+  wait_cbs   = self->sup_wait_cbs;
   wait_args  = self->sup_wait_args;
-  wait_roots = self->sup_wait_roots; 
-  
+  wait_roots = self->sup_wait_roots;
+
   for (i = j = 0; i < N; i++) {
     index = reverses[i]; assert(index > 0 && indices[index] == i);
 
@@ -487,10 +487,10 @@
       wait_args[j]  = wait_args[i];
       wait_roots[j] = wait_roots[i];
     }
-    
+
     j++;
   }
-  
+
   for (i = j; i < N; i++) {
     reverses[i] = -1;
     wait_cbs[i] = NULL;
@@ -541,7 +541,7 @@
  *
  * @param self      pointer to port object
  * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
- * 
+ *
  * @retval 0 multishot mode is disabled
  * @retval 1 multishot mode is enabled
  * @retval -1 an error occurred
@@ -553,7 +553,7 @@
     return self->sup_multishot;
   else if (multishot == 0 || multishot == 1)
     return self->sup_multishot = multishot;
-  else 
+  else
     return (errno = EINVAL), -1;
 }
 
@@ -635,7 +635,7 @@
 			    su_root_init_f init,
 			    su_root_deinit_f deinit)
 {
-  return su_pthreaded_port_start(su_wsaevent_port_create, 
+  return su_pthreaded_port_start(su_wsaevent_port_create,
 				 parent, return_clone, magic, init, deinit);
 }
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/tag_dll.awk
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/tag_dll.awk	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/tag_dll.awk	Tue Dec 23 07:37:03 2008
@@ -105,18 +105,18 @@
   print "" > REF;
 }
 
-/^#define TAG_NAMESPACE/ { 
-  print "#undef TAG_NAMESPACE" > REF; 
-  print $0 > REF; 
+/^#define TAG_NAMESPACE/ {
+  print "#undef TAG_NAMESPACE" > REF;
+  print $0 > REF;
   print "" > REF;
-  print "#undef TAG_NAMESPACE" > DLL; 
-  print $0 > DLL; 
+  print "#undef TAG_NAMESPACE" > DLL;
+  print $0 > DLL;
   print "" > DLL;
 }
 
-/SU_HAVE_EXPERIMENTAL/ { 
-  print $0 > REF; 
-  print $0 > DLL; 
+/SU_HAVE_EXPERIMENTAL/ {
+  print $0 > REF;
+  print $0 > DLL;
 }
 
 !DEFS && /^tag_typedef_t/ { DEFS = 1; }
@@ -139,7 +139,7 @@
 END {
   if (LIST) {
     print "\nEXPORT tag_type_t " LIST "[] =\n{" > REF;
-    print "\nEXPORT tag_type_t " LIST "[] =\n{" > DLL; 
+    print "\nEXPORT tag_type_t " LIST "[] =\n{" > DLL;
     for (tag in typedefs) {
       if (typedefs[tag] !~ /NSTAG_TYPEDEF/) {
         print "  " tag "," > REF;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_htable.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_htable.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_htable.c	Tue Dec 23 07:37:03 2008
@@ -85,7 +85,7 @@
 HTABLE_DECLARE(htable, ht, entry_t);
 HTABLE_PROTOS(htable, ht, entry_t);
 
-struct hentry_s 
+struct hentry_s
 {
   unsigned long e_value;
   unsigned long e_n;
@@ -101,7 +101,7 @@
   htable_t c_hash[1];
 } context_t;
 
-context_t *context_create(void) 
+context_t *context_create(void)
 {
   context_t *c = su_home_clone(NULL, sizeof(*c));
 
@@ -131,7 +131,7 @@
     /* Resize hash table */
     if (htable_is_full(ht)) {
       htable_resize(c->c_home, ht, 0);
-      fprintf(stderr, "htable: resized to %u with %u entries\n", 
+      fprintf(stderr, "htable: resized to %u with %u entries\n",
 	      ht->ht_size, ht->ht_used);
     }
 
@@ -157,9 +157,9 @@
   su_free(c->c_home, e);
 }
 
-/* 
- * Check that all n entries with hash h are in hash table 
- * and they are stored in same order 
+/*
+ * Check that all n entries with hash h are in hash table
+ * and they are stored in same order
  * in which they were added to the hash
  */
 static unsigned long count(context_t *c, hash_value_t h)
@@ -168,7 +168,7 @@
   unsigned long n, expect = 1;
 
   for (ee = htable_hash(c->c_hash, h), n = 0;
-       (e = *ee); 
+       (e = *ee);
        ee = htable_next(c->c_hash, ee)) {
     if (e->e_value != h)
       continue;
@@ -225,10 +225,10 @@
 
     TEST_1(add(c, h, 1)); TEST_1(add(c, h, 2)); TEST_1(add(c, h, 3));
     TEST_1(add(c, h, 4)); TEST_1(add(c, h, 5)); TEST_1(add(c, h, 6));
-    TEST_1(add(c, h, 7)); TEST_1(add(c, h, 8)); TEST_1(add(c, h, 9)); 
+    TEST_1(add(c, h, 7)); TEST_1(add(c, h, 8)); TEST_1(add(c, h, 9));
 
     TEST(count(c, h), 9);
-    
+
     TEST(htable_resize(c->c_home, c->c_hash, ++size), 0);
     TEST(count(c, h), 9);
     TEST(htable_resize(c->c_home, c->c_hash, ++size), 0);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_htable2.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_htable2.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_htable2.c	Tue Dec 23 07:37:03 2008
@@ -83,7 +83,7 @@
 
 typedef struct hentry_s entry_t;
 
-struct hentry_s 
+struct hentry_s
 {
   hash_value_t e_hash;
   unsigned long e_n;
@@ -108,7 +108,7 @@
   htable2_t c_hash[1];
 } context_t;
 
-context_t *context_create(void) 
+context_t *context_create(void)
 {
   context_t *c = su_home_clone(NULL, sizeof(*c));
 
@@ -139,7 +139,7 @@
     /* Resize hash table */
     if (htable2_is_full(ht)) {
       htable2_resize(c->c_home, ht, 0);
-      fprintf(stderr, "htable: resized to "MOD_ZU" with "MOD_ZU" entries\n", 
+      fprintf(stderr, "htable: resized to "MOD_ZU" with "MOD_ZU" entries\n",
 	      ht->ht2_size, ht->ht2_used);
     }
 
@@ -163,9 +163,9 @@
   htable2_remove(c->c_hash, e);
 }
 
-/* 
- * Check that all n entries with hash h are in hash table 
- * and they are stored in same order 
+/*
+ * Check that all n entries with hash h are in hash table
+ * and they are stored in same order
  * in which they were added to the hash
  */
 static unsigned long count(context_t *c, hash_value_t h)
@@ -236,10 +236,10 @@
 
     TEST_1(add(c, h, 1)); TEST_1(add(c, h, 2)); TEST_1(add(c, h, 3));
     TEST_1(add(c, h, 4)); TEST_1(add(c, h, 5)); TEST_1(add(c, h, 6));
-    TEST_1(add(c, h, 7)); TEST_1(add(c, h, 8)); TEST_1(add(c, h, 9)); 
+    TEST_1(add(c, h, 7)); TEST_1(add(c, h, 8)); TEST_1(add(c, h, 9));
 
     TEST(count(c, h), 9);
-    
+
     TEST(htable2_resize(c->c_home, c->c_hash, ++size), 0);
     TEST(count(c, h), 9);
     TEST(htable2_resize(c->c_home, c->c_hash, ++size), 0);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_memmem.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_memmem.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_memmem.c	Tue Dec 23 07:37:03 2008
@@ -78,13 +78,13 @@
 
   TEST_P(memmem(haystack, 12, needle, 3), haystack + 2);
   TEST_P(memmem(needle, 3, haystack, 12), NULL);
-  
+
 #if HAVE_MEMMEM
   if (memmem(haystack, 12, "", 0) == NULL) {
     fprintf(stderr, "test_memmem.c: "
 	    "*** WARNING: system memmem() fails with empty needle ***\n");
   }
-  else 
+  else
 #endif
   {
     TEST_P(memmem(haystack, 12, "", 0), haystack);
@@ -151,7 +151,7 @@
   }
 
   {
-    char const hs[] = 
+    char const hs[] =
 "A case-folding string searching test consisting of a Very Long String\n"
 
 "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer felis. "
@@ -194,14 +194,14 @@
 "non, mi. Suspendisse vestibulum nunc eu neque. Sed rutrum felis aliquam "
 "urna. Ut tincidunt orci vitae ipsum. Nullam eros. Quisque augue. Quisque "
 "lacinia. Nunc ligula diam, nonummy a, porta in, tristique quis, leo. "
-"Phasellus nunc nulla, fringilla vel, lacinia et, suscipit a, turpis. " 
+"Phasellus nunc nulla, fringilla vel, lacinia et, suscipit a, turpis. "
 "Integer a est. Curabitur mauris lacus, vehicula sit amet, sodales vel, "
 "iaculis vitae, massa. Nam diam est, ultrices vitae, varius et, tempor a, "
 "leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, "
 "per inceptos hymenaeos. Fusce felis nibh, ullamcorper non, malesuada eget, "
       "facilisis vel, purus.\n";
 
-char const needle[] = 
+char const needle[] =
 "Proin congue. Curabitur placerat diam id eros. "
 "Pellentesque vitae nulla. Quisque at lorem et dolor auctor consequat. Sed "
 "sed tellus non nibh imperdiet venenatis. Integer ultrices dapibus nisi. "
@@ -209,7 +209,7 @@
 "ullamcorper pretium lorem. Vestibulum ante ipsum primis in faucibus orci "
 "luctus et ultrices posuere cubilia Curae;\n";
 
-char const Needle[] = 
+char const Needle[] =
 "PROIN CONGUE. CURABITUR PLACERAT DIAM ID EROS. "
 "PELLENTESQUE VITAE NULLA. QUISQUE AT LOREM ET DOLOR AUCTOR CONSEQUAT. SED "
 "SED TELLUS NON NIBH IMPERDIET VENENATIS. INTEGER ULTRICES DAPIBUS NISI. "

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_poll.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_poll.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_poll.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@internal 
+/**@internal
  * @file test_poll.c
  * Example code for <sofia-sip/su_wait.h>.
  *
@@ -57,15 +57,15 @@
   char *port = host ? argv[2] : NULL;
   su_addrinfo_t *ai = NULL, hints[1] = {{ 0 }};
   int error;
-  
-  if (argv[1] && (strcmp(argv[1], "--help") == 0 || 
-		  strcmp(argv[1], "-?") == 0)) 
+
+  if (argv[1] && (strcmp(argv[1], "--help") == 0 ||
+		  strcmp(argv[1], "-?") == 0))
     usage(argv[0]);
 
   if (!port) port = "echo";
 
   if ((error = su_getaddrinfo(host, port, hints, &ai))) {
-    fprintf(stderr, "poll_test: su_getaddrinfo(): %s\n", 
+    fprintf(stderr, "poll_test: su_getaddrinfo(): %s\n",
 	    su_gai_strerror(error));
     exit(1);
   }
@@ -96,7 +96,7 @@
     su_wait_create(&w, s, SU_WAIT_OUT);
 
     n = su_wait(&w, 1, SU_WAIT_FOREVER);
-    
+
     printf("su_wait returned %d\n", n);
 
     err = su_soerror(s);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_su.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_su.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_su.c	Tue Dec 23 07:37:03 2008
@@ -30,7 +30,7 @@
  * @internal
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Thu Mar 18 19:40:51 1999 pessi
  */
 
@@ -87,7 +87,7 @@
 short opt_verbatim = 0;
 short opt_singlethread = 0;
 
-static su_socket_t udpsocket(void) 
+static su_socket_t udpsocket(void)
 {
   su_socket_t s;
   su_sockaddr_t su = { 0 };
@@ -111,7 +111,7 @@
 
   if (getsockname(s, &su.su_sa, &sulen) == SOCKET_ERROR) {
     su_perror("udpsocket: getsockname");
-    exit(1); 
+    exit(1);
   }
 
   if (opt_verbatim)
@@ -131,7 +131,7 @@
   return buf;
 }
 
-void 
+void
 do_ping(struct pinger *p, su_timer_t *t, void *p0)
 {
   char buf[1024];
@@ -142,7 +142,7 @@
   p->when = su_now();
 
   snprintf(buf, sizeof(buf), "Ping %d at %s", p->id++, snow(p->when));
-  if (su_sendto(p->s, buf, strlen(buf), 0, 
+  if (su_sendto(p->s, buf, strlen(buf), 0,
 		&p->addr, su_sockaddr_size(&p->addr)) == -1) {
     su_perror("do_ping: send");
   }
@@ -202,7 +202,7 @@
   p->id = 0;
 
   snprintf(buf, sizeof(buf), "Pong at %s", snow(su_now()));
-  if (su_sendto(p->s, buf, strlen(buf), 0, 
+  if (su_sendto(p->s, buf, strlen(buf), 0,
 		&p->addr, su_sockaddr_size(&p->addr)) == -1) {
     su_perror("do_pong: send");
   }
@@ -472,7 +472,7 @@
 /*
  * test su_wait functionality:
  *
- * Create a ponger, waking up do_recv() when data arrives, 
+ * Create a ponger, waking up do_recv() when data arrives,
  *                  then scheduling do_pong() by timer
  *
  * Create a pinger, executed from timer, scheduling do_ping(),
@@ -490,8 +490,8 @@
   int opt_alarm = 1;
 #endif
 
-  struct pinger 
-    pinger = { PINGER, "ping", 1 }, 
+  struct pinger
+    pinger = { PINGER, "ping", 1 },
     ponger = { PONGER, "pong", 1 };
 
   char *argv0 = argv[0];
@@ -545,13 +545,13 @@
 
   fprintf(stdout, "test_su: testing %s port implementation\n",
 	  su_root_name(root));
-  
+
   su_root_threading(root, !opt_singlethread);
 
   if (su_clone_start(root, ping, &pinger, do_init, do_destroy) != 0)
     perror("su_clone_start"), exit(1);
   if (su_clone_start(root, pong, &ponger, do_init, do_destroy) != 0)
-    perror("su_clone_start"), exit(1); 
+    perror("su_clone_start"), exit(1);
 
   /* Test timer, exiting after 200 milliseconds */
   t = su_timer_create(su_root_task(root), 200L);
@@ -559,7 +559,7 @@
     su_perror("su_timer_create"), exit(1);
   su_timer_set(t, (su_timer_f)do_exit, NULL);
 
-  su_msg_create(start_msg, su_clone_task(ping), su_clone_task(pong), 
+  su_msg_create(start_msg, su_clone_task(ping), su_clone_task(pong),
 		init_ping, 0);
   su_msg_send(start_msg);
 
@@ -571,13 +571,13 @@
   su_timer_destroy(t);
 
   if (pinger.rtt_n) {
-    printf("%s executed %u pings in %g, mean rtt=%g sec\n", name, 
+    printf("%s executed %u pings in %g, mean rtt=%g sec\n", name,
 	   pinger.rtt_n, pinger.rtt_total, pinger.rtt_total / pinger.rtt_n);
   }
   su_root_destroy(root);
 
   if (opt_verbatim)
-    printf("%s exiting\n", argv0); 
+    printf("%s exiting\n", argv0);
 
   return 0;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_su_osx.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_su_osx.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/test_su_osx.c	Tue Dec 23 07:37:03 2008
@@ -30,7 +30,7 @@
  *
  * @author Martti Mela <Martti.Mela at nokia.com>
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Sep 26 17:16:02 EEST 2006 mela
  */
 
@@ -96,13 +96,13 @@
 /* For run loop */
 int running = 0;
 
-static su_socket_t udpsocket(void) 
+static su_socket_t udpsocket(void)
 {
   su_socket_t s;
   su_sockaddr_t su = { 0 };
   socklen_t sulen = sizeof(su);
   char nbuf[64];
-  
+
   enter;
 
   su.su_family = opt_family;
@@ -122,7 +122,7 @@
 
   if (getsockname(s, &su.su_sa, &sulen) == SOCKET_ERROR) {
     su_perror("udpsocket: getsockname");
-    exit(1); 
+    exit(1);
   }
 
   if (opt_verbatim)
@@ -144,7 +144,7 @@
   return buf;
 }
 
-void 
+void
 do_ping(struct pinger *p, su_timer_t *t, void *p0)
 {
   char buf[1024];
@@ -159,7 +159,7 @@
   p->when = su_now();
 
   snprintf(buf, sizeof(buf), "Ping %d at %s", p->id++, snow(p->when));
-  if (su_sendto(p->s, buf, strlen(buf), 0, 
+  if (su_sendto(p->s, buf, strlen(buf), 0,
 		&p->addr, su_sockaddr_size(&p->addr)) == -1) {
     su_perror("do_ping: send");
   }
@@ -223,7 +223,7 @@
   p->id = 0;
 
   snprintf(buf, sizeof(buf), "Pong at %s", snow(su_now()));
-  if (su_sendto(p->s, buf, strlen(buf), 0, 
+  if (su_sendto(p->s, buf, strlen(buf), 0,
 		&p->addr, su_sockaddr_size(&p->addr)) == -1) {
     su_perror("do_pong: send");
   }
@@ -467,7 +467,7 @@
 /*
  * test su_wait functionality:
  *
- * Create a ponger, waking up do_recv() when data arrives, 
+ * Create a ponger, waking up do_recv() when data arrives,
  *                  then scheduling do_pong() by timer
  *
  * Create a pinger, executed from timer, scheduling do_ping(),
@@ -483,8 +483,8 @@
   su_timer_t *t;
   unsigned long sleeppid = 0;
 
-  struct pinger 
-    pinger = { PINGER, "ping", 1 }, 
+  struct pinger
+    pinger = { PINGER, "ping", 1 },
     ponger = { PONGER, "pong", 1 };
 
   char *argv0 = argv[0];
@@ -528,16 +528,16 @@
 
   time_test();
 
-  root = su_root_osx_runloop_create(NULL); 
+  root = su_root_osx_runloop_create(NULL);
 
   if (!root) perror("su_root_osx_runloop_create"), exit(1);
-  
+
   su_root_threading(root, 0 && !opt_singlethread);
 
   if (su_clone_start(root, ping, &pinger, do_init, do_destroy) != 0)
     perror("su_clone_start"), exit(1);
   if (su_clone_start(root, pong, &ponger, do_init, do_destroy) != 0)
-    perror("su_clone_start"), exit(1); 
+    perror("su_clone_start"), exit(1);
 
   /* Test timer, exiting after 200 milliseconds */
   t = su_timer_create(su_root_task(root), 2000L);
@@ -545,7 +545,7 @@
     su_perror("su_timer_create"), exit(1);
   su_timer_set(t, (su_timer_f)do_exit, NULL);
 
-  su_msg_create(start_msg, su_clone_task(ping), su_clone_task(pong), 
+  su_msg_create(start_msg, su_clone_task(ping), su_clone_task(pong),
 		init_ping, 0);
   su_msg_send(start_msg);
 
@@ -557,20 +557,20 @@
     while (running == 1) {
       su_root_step(root, 20);
     }
-  
+
   su_clone_wait(root, ping);
   su_clone_wait(root, pong);
 
   su_timer_destroy(t);
 
   if (pinger.rtt_n) {
-    printf("%s executed %u pings in %g, mean rtt=%g sec\n", name, 
+    printf("%s executed %u pings in %g, mean rtt=%g sec\n", name,
 	   pinger.rtt_n, pinger.rtt_total, pinger.rtt_total / pinger.rtt_n);
   }
   su_root_destroy(root);
 
   if (opt_verbatim)
-    printf("%s exiting\n", argv0); 
+    printf("%s exiting\n", argv0);
 
 #ifndef HAVE_WIN32
    if (sleeppid)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_heap.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_heap.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_heap.c	Tue Dec 23 07:37:03 2008
@@ -175,7 +175,7 @@
       TEST(array[i], i - n / 2);
     }
   }
-  
+
   END();
 }
 
@@ -472,7 +472,7 @@
   BEGIN();
 
   Heap2 heap = { NULL };
-  
+
   unsigned i, N;
   type1 *items;
 
@@ -498,7 +498,7 @@
     TEST(e->key, i);
     TEST(e->value, i);
   }
-  
+
   for (i = 1; i <= N; i++) {
     type2 e = heap2_remove(heap, 1);
     TEST(e->key, i);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_rbtree.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_rbtree.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_rbtree.c	Tue Dec 23 07:37:03 2008
@@ -85,7 +85,7 @@
 Node *node_new(su_home_t *home, int value)
 {
   Node *n = su_zalloc(home, sizeof (*n));
-  
+
   n->value = value;
 
   return n;
@@ -100,9 +100,9 @@
   if (k > (1 << 32))
     result += 32, k = (k >> 32) + ((k & ((1 << 32) - 1)) != 0);
 #endif
-  if (k > (1 << 16)) 
+  if (k > (1 << 16))
     result += 16, k = (k >> 16) + ((k & ((1 << 16) - 1)) != 0);
-  if (k > (1 << 8)) 
+  if (k > (1 << 8))
     result += 8, k = (k >> 8) + ((k & ((1 << 8) - 1)) != 0);
   if (k > (1 << 4))
     result += 4, k = (k >> 4) + ((k & 15) != 0);
@@ -112,7 +112,7 @@
     result += 1, k = (k >> 1) + (k & 1);
   if (k > 1)
     result += 1;
-  
+
   return result;
 }
 
@@ -127,7 +127,7 @@
     else
       tree = tree->left;
   }
-   
+
   return tree;
 }
 
@@ -163,7 +163,7 @@
   six = node_new(home, 6);
   seven = node_new(home, 7);
 
-  TEST_1(one); 
+  TEST_1(one);
   TEST_1(three);
   TEST_1(five);
   TEST_1(six);
@@ -175,16 +175,16 @@
   TEST_P(five->left, NULL); TEST_P(five->right, NULL);
   TEST_P(five->parent, NULL); TEST(five->black, 1);
 
-  /* Check after another node: 
+  /* Check after another node:
    *
    *         5b
-   *        / 
+   *        /
    *       3r
    */
   TEST(redblack_insert(&tree, three, &o), 0); TEST_P(o, NULL);
   TEST_P(tree->left, three); TEST(tree->black, 1);
   TEST_P(three->left, NULL); TEST_P(three->right, NULL);
-  TEST_P(three->parent, tree); TEST(three->black, 0); 
+  TEST_P(three->parent, tree); TEST(three->black, 0);
 
   /* Check third node
    *         5b
@@ -194,21 +194,21 @@
   TEST(redblack_insert(&tree, seven, &o), 0); TEST_P(o, NULL);
   TEST_P(tree->right, seven); TEST(tree->black, 1);
   TEST_P(seven->left, NULL); TEST_P(seven->right, NULL);
-  TEST_P(seven->parent, tree); TEST(seven->black, 0); 
+  TEST_P(seven->parent, tree); TEST(seven->black, 0);
 
   /* Check after fourth node:
    *         5b
    *        / \
    *       3b  7b
    *      /
-   *     1r  
+   *     1r
    */
   TEST(redblack_insert(&tree, one, &o), 0); TEST_P(o, NULL);
-  TEST_P(tree->left->left, one); 
-  TEST(tree->black, 1); 
+  TEST_P(tree->left->left, one);
+  TEST(tree->black, 1);
   TEST(tree->left->black, 1); TEST(tree->right->black, 1);
   TEST_P(one->left, NULL); TEST_P(one->right, NULL);
-  TEST_P(one->parent, tree->left); TEST(one->black, 0); 
+  TEST_P(one->parent, tree->left); TEST(one->black, 0);
 
   /* Checks that we got after fifth node:
    *         5b
@@ -256,7 +256,7 @@
   y = node_new(home, 2);
 
   TEST_1(x);
-  TEST_1(y); 
+  TEST_1(y);
 
   /*
    *              x                   y               x
@@ -298,8 +298,8 @@
   um497 = node_new(home, 497); TEST_1(um497);
   um995 = node_new(home, 995); TEST_1(um995);
 
-  o = (void *)-1; TEST(redblack_insert(&tree, um995, &o), 0); TEST_P(o, NULL); 
-  o = (void *)-1; TEST(redblack_insert(&tree, um497, &o), 0); TEST_P(o, NULL); 
+  o = (void *)-1; TEST(redblack_insert(&tree, um995, &o), 0); TEST_P(o, NULL);
+  o = (void *)-1; TEST(redblack_insert(&tree, um497, &o), 0); TEST_P(o, NULL);
   o = (void *)-1; TEST(redblack_insert(&tree, um103, &o), 0); TEST_P(o, NULL);
 
   um = node_find(tree, 103); TEST_P(um, um103);
@@ -338,9 +338,9 @@
 
   for (i = 0; i < N; i++) {
     node = node_find(tree, i);
-    TEST_1(node); 
+    TEST_1(node);
     TEST(node->value, i);
-    TEST_P(nodes[i], node); 
+    TEST_P(nodes[i], node);
   }
 
   node = node_find(tree, 0);
@@ -360,9 +360,9 @@
     node = node_find(tree, i);
     TEST_1(node); TEST(node->value, i);
     redblack_remove(&tree, node);
-    TEST_1(node->parent == NULL && 
-	   node->left == NULL && 
-	   node->right == NULL); 
+    TEST_1(node->parent == NULL &&
+	   node->left == NULL &&
+	   node->right == NULL);
     TEST_1(redblack_height(tree) <= 2 * (int)log2ceil(N - i + 1));
     TEST_1(redblack_check(tree));
   }
@@ -371,7 +371,7 @@
 
   for (i = N - 1; i >= 0; i--) {
     o = (void *)-1;
-    TEST(redblack_insert(&tree, nodes[i], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[i], &o), 0);
     TEST_P(o, NULL);
     TEST_1(redblack_height(tree) <= 2 * (int)log2ceil(N - i + 1));
     TEST_1(redblack_check(tree));
@@ -394,7 +394,7 @@
     int sn = (i * 57) % N;
     o = (void *)-1;
     TEST(nodes[sn]->inserted, 0);
-    TEST(redblack_insert(&tree, nodes[sn], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[sn], &o), 0);
     nodes[sn]->inserted = 1;
     TEST_P(o, NULL);
     TEST_1(redblack_height(tree) <= 2 * (int)log2ceil(i + 1 + 1));
@@ -422,7 +422,7 @@
     int sn = (i * 517) % N;	/* relative prime to N */
     o = (void *)-1;
     TEST(nodes[sn]->inserted, 0);
-    TEST(redblack_insert(&tree, nodes[sn], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[sn], &o), 0);
     nodes[sn]->inserted = 1;
     TEST_P(o, NULL);
     TEST_1(redblack_height(tree) <= 2 * (int)log2ceil(i + 1 + 1));
@@ -450,7 +450,7 @@
     int sn = (i * 1957) % N;	/* relative prime to N */
     o = (void *)-1;
     TEST(nodes[sn]->inserted, 0);
-    TEST(redblack_insert(&tree, nodes[sn], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[sn], &o), 0);
     nodes[sn]->inserted = 1;
     TEST_P(o, NULL);
     TEST_1(redblack_height(tree) <= 2 * (int)log2ceil(i + 1 + 1));
@@ -480,13 +480,13 @@
     int sn = N - i - 1;
     TEST(nodes[i]->inserted, 0);
     o = (void *)-1;
-    TEST(redblack_insert(&tree, nodes[i], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[i], &o), 0);
     TEST_P(o, NULL);
     nodes[i]->inserted = 1;
 
     TEST(nodes[sn]->inserted, 0);
     o = (void *)-1;
-    TEST(redblack_insert(&tree, nodes[sn], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[sn], &o), 0);
     TEST_P(o, NULL);
     nodes[sn]->inserted = 1;
   }
@@ -516,13 +516,13 @@
     int sn = N - i - 1;
     TEST(nodes[i]->inserted, 0);
     o = (void *)-1;
-    TEST(redblack_insert(&tree, nodes[i], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[i], &o), 0);
     TEST_P(o, NULL);
     nodes[i]->inserted = 1;
 
     TEST(nodes[sn]->inserted, 0);
     o = (void *)-1;
-    TEST(redblack_insert(&tree, nodes[sn], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[sn], &o), 0);
     TEST_P(o, NULL);
     nodes[sn]->inserted = 1;
   }
@@ -552,13 +552,13 @@
     int sn = N / 2 + i;
     TEST(nodes[i]->inserted, 0);
     o = (void *)-1;
-    TEST(redblack_insert(&tree, nodes[i], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[i], &o), 0);
     TEST_P(o, NULL);
     nodes[i]->inserted = 1;
 
     TEST(nodes[sn]->inserted, 0);
     o = (void *)-1;
-    TEST(redblack_insert(&tree, nodes[sn], &o), 0); 
+    TEST(redblack_insert(&tree, nodes[sn], &o), 0);
     TEST_P(o, NULL);
     nodes[sn]->inserted = 1;
   }
@@ -583,13 +583,13 @@
   TEST_P(tree, NULL);
 
   /* Insert in perfect order ... */
-  
+
   for (j = N / 2; j > 0; j /= 2) {
     for (i = N - j; i >= 0; i -= j) {
       if (nodes[i]->inserted)
 	continue;
       o = (void *)-1;
-      TEST(redblack_insert(&tree, nodes[i], &o), 0); 
+      TEST(redblack_insert(&tree, nodes[i], &o), 0);
       TEST_P(o, NULL);
       nodes[i]->inserted = 1;
     }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c	Tue Dec 23 07:37:03 2008
@@ -57,7 +57,7 @@
   su_sockaddr_t  su[1], a[1], b[1];
 
   BEGIN();
-  
+
   hints->li_family = AF_INET;
 
   TEST(su_getlocalinfo(hints, &res), 0);
@@ -66,7 +66,7 @@
     if (li->li_addrlen != res->li_addrlen ||
 	memcmp(li->li_addr, res->li_addr, li->li_addrlen) != 0)
       TEST_1(su_cmp_sockaddr(li->li_addr, res->li_addr) != 0);
-    else 
+    else
       TEST_1(su_cmp_sockaddr(li->li_addr, res->li_addr) == 0);
   }
 
@@ -115,8 +115,8 @@
   su_getlocalinfo(hints, &res);
   su_freelocalinfo(res), res = NULL;
 
-  memset(a, 0, sizeof *a); 
-  memset(b, 0, sizeof *b); 
+  memset(a, 0, sizeof *a);
+  memset(b, 0, sizeof *b);
 
   TEST_1(su_match_sockaddr(a, b));
   b->su_family = AF_INET;
@@ -206,7 +206,7 @@
   TEST(listen(l, 5), 0);
 
   TEST(su_setblocking(s, 1), 0);
-  
+
   TEST(connect(s, &su.su_sa, sulen), 0);
   a = accept(l, &csu.su_sa, &csulen); TEST_1(a != -1);
 
@@ -253,12 +253,12 @@
   su_close(a);
 
   su_close(l);
-  su_close(s); 
+  su_close(s);
 
   END();
 }
 
-#if HAVE_SELECT 
+#if HAVE_SELECT
 
 #if HAVE_WIN32
 int test_select(void)
@@ -307,7 +307,7 @@
   TEST(su_inet_pton(AF_INET, "127.0.0.1", &su.su_sin.sin_addr), 1);
   TEST(bind(s, &su.su_sa, sulen), 0);
   TEST(getsockname(s, &su.su_sa, &sulen), 0);
-  
+
   tv.tv_sec = 0; tv.tv_usec = 1000;
   TEST(select(0, NULL, NULL, NULL, &tv), 0);
 
@@ -320,20 +320,20 @@
   TEST(select(s + 1, NULL, wset, NULL, &tv), 1);
   TEST_1(FD_ISSET(s, wset));
 
-  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset); 
+  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset);
   FD_SET(s, rset); FD_SET(s, wset);
   tv.tv_sec = 0, tv.tv_usec = 1000;
   TEST(select(s + 1, rset, wset, NULL, &tv), 1);
   TEST_1(!FD_ISSET(s, rset));
   TEST_1(FD_ISSET(s, wset));
 
-  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset); 
+  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset);
   FD_SET(s, rset); FD_SET(s, wset);
   tv.tv_sec = 0, tv.tv_usec = 1000;
   TEST(select(s + 1, rset, NULL, NULL, &tv), 0);
   TEST_1(!FD_ISSET(s, rset));
 
-  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset); 
+  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset);
   FD_SET(s, rset); FD_CLR(s, wset);
   tv.tv_sec = 0, tv.tv_usec = 1000;
   TEST(select(s + 1, rset, wset, NULL, &tv), 0);
@@ -342,14 +342,14 @@
 
   TEST(su_sendto(s, "foo", 3, 0, &su, sulen), 3);
 
-  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset); 
+  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset);
   FD_SET(s, rset); FD_CLR(s, wset);
   tv.tv_sec = 0, tv.tv_usec = 1000;
   TEST(select(s + 1, rset, wset, NULL, &tv), 1);
   TEST_1(FD_ISSET(s, rset));
   TEST_1(!FD_ISSET(s, wset));
 
-  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset); 
+  FD_ZERO_TO(s, rset); FD_ZERO_TO(s, wset);
   FD_SET(s, rset); FD_SET(s, wset);
   tv.tv_sec = 0, tv.tv_usec = 1000;
   TEST(select(s + 1, rset, wset, NULL, &tv), 2);
@@ -383,14 +383,14 @@
   char hexdigest[2 * SU_MD5_DIGEST_SIZE + 1];
 
   struct { char *input; uint8_t digest[SU_MD5_DIGEST_SIZE]; } suite[] = {
-    { (""), 
+    { (""),
 	{ 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04,
 	  0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e } },
     { ("a"), { 0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8,
 	       0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61 } },
     { ("abc"), { 0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0,
 		 0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72 } },
-    { ("message digest"), 
+    { ("message digest"),
       { 0xf9, 0x6b, 0x69, 0x7d, 0x7c, 0xb7, 0x93, 0x8d,
 	0x52, 0x5a, 0x2f, 0x31, 0xaa, 0xf1, 0x61, 0xd0 } },
     { ("abcdefghijklmnopqrstuvwxyz"),
@@ -456,13 +456,13 @@
   TEST_S(hexdigest, "93b885adfe0da089cdf634904fd59f71");
   su_md5_deinit(md5);
 
-  su_md5_init(md5);   
+  su_md5_init(md5);
   su_md5_stri0update(md5, NULL);
   su_md5_stri0update(md5, "ABBADABBADOO");
   su_md5_hexdigest(md5, hexdigest);
   TEST_S(hexdigest, "101e6dd7cfabdb5c74f44b4c545c05cc");
 
-  su_md5_init(md5); 
+  su_md5_init(md5);
   su_md5_update(md5, "\0abbadabbadoo\0", 14);
   su_md5_hexdigest(md5, hexdigest);
   TEST_S(hexdigest, "101e6dd7cfabdb5c74f44b4c545c05cc");
@@ -512,7 +512,7 @@
     else
       usage(1);
   }
-  
+
   retval |= test_sockaddr();
   retval |= test_sendrecv();
   retval |= test_select();

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_alloc.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_alloc.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_alloc.c	Tue Dec 23 07:37:03 2008
@@ -22,7 +22,7 @@
  *
  */
 
-/**@internal 
+/**@internal
  * @file su_alloc_test.c
  *
  * Testing functions for su_alloc functions.
@@ -489,7 +489,7 @@
 
     TEST_1(su_strlst_append(l, ""));
 
-    TEST_S(su_strlst_join(l, home, "\n"), 
+    TEST_S(su_strlst_join(l, home, "\n"),
 	   "a\n" "b\n" "1: 1\n" "1.0: 1\n");
 
     TEST_VOID(su_strlst_destroy(l));
@@ -698,7 +698,7 @@
 
   su_home_get_stats(tmphome, 0, hs, sizeof *hs);
 
-  TEST64(hs->hs_allocs.hsa_preload + hs->hs_allocs.hsa_number, 
+  TEST64(hs->hs_allocs.hsa_preload + hs->hs_allocs.hsa_number,
 	  8191 + 8191 + 8191 / 32);
   TEST64(hs->hs_frees.hsf_preload + hs->hs_frees.hsf_number,
 	 8191 + 8191 + 8191 / 32 - 1);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_bm.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_bm.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_bm.c	Tue Dec 23 07:37:03 2008
@@ -24,8 +24,8 @@
 
 /**@internal
  * @file torture_su_bm.c
- * @brief Test string search with Boyer-Moore algorithm 
- *  
+ * @brief Test string search with Boyer-Moore algorithm
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @date Created: Sun Apr 17 21:02:10 2005 ppessi
  */
@@ -50,9 +50,9 @@
 int test_bm(void)
 {
   BEGIN();
-  
+
   {
-    char const hs[] = 
+    char const hs[] =
       "A Boyer-Moore string searching test consisting of a Long String";
     char const *s;
 
@@ -106,9 +106,9 @@
 int test_bm_long(void)
 {
   BEGIN();
-  
+
   {
-    char const hs[] = 
+    char const hs[] =
 "A Boyer-Moore string searching test consisting of a Very Long String\n"
 
 "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer felis. "
@@ -151,14 +151,14 @@
 "non, mi. Suspendisse vestibulum nunc eu neque. Sed rutrum felis aliquam "
 "urna. Ut tincidunt orci vitae ipsum. Nullam eros. Quisque augue. Quisque "
 "lacinia. Nunc ligula diam, nonummy a, porta in, tristique quis, leo. "
-"Phasellus nunc nulla, fringilla vel, lacinia et, suscipit a, turpis. " 
+"Phasellus nunc nulla, fringilla vel, lacinia et, suscipit a, turpis. "
 "Integer a est. Curabitur mauris lacus, vehicula sit amet, sodales vel, "
 "iaculis vitae, massa. Nam diam est, ultrices vitae, varius et, tempor a, "
 "leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, "
 "per inceptos hymenaeos. Fusce felis nibh, ullamcorper non, malesuada eget, "
       "facilisis vel, purus.\n";
 
-char const needle[] = 
+char const needle[] =
 "Proin congue. Curabitur placerat diam id eros. "
 "Pellentesque vitae nulla. Quisque at lorem et dolor auctor consequat. Sed "
 "sed tellus non nibh imperdiet venenatis. Integer ultrices dapibus nisi. "
@@ -166,7 +166,7 @@
 "ullamcorper pretium lorem. Vestibulum ante ipsum primis in faucibus orci "
 "luctus et ultrices posuere cubilia Curae;\n";
 
-char const Needle[] = 
+char const Needle[] =
 "PROIN CONGUE. CURABITUR PLACERAT DIAM ID EROS. "
 "PELLENTESQUE VITAE NULLA. QUISQUE AT LOREM ET DOLOR AUCTOR CONSEQUAT. SED "
 "SED TELLUS NON NIBH IMPERDIET VENENATIS. INTEGER ULTRICES DAPIBUS NISI. "
@@ -211,8 +211,8 @@
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
-	  "usage: %s [-v] [-a]\n", 
+  fprintf(stderr,
+	  "usage: %s [-v] [-a]\n",
 	  name);
   exit(exitcode);
 }
@@ -223,7 +223,7 @@
   int i;
 
   /* Set our name */
-  if (strchr(argv[0], '/')) 
+  if (strchr(argv[0], '/'))
     name = strrchr(argv[0], '/') + 1;
   else
     name = argv[0];

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_port.c	Tue Dec 23 07:37:03 2008
@@ -85,7 +85,7 @@
 
   if (n != port->sup_n_waits)
     return 0;
-  
+
   n = 0;
 
   for (i = 1; i <= N; i++) {
@@ -108,19 +108,19 @@
   return n == port->sup_size_waits;
 }
 
-struct su_root_magic_s 
+struct su_root_magic_s
 {
   int error, *sockets, *regs, *wakeups;
 };
 
-static int callback(su_root_magic_t *magic, 
+static int callback(su_root_magic_t *magic,
 		    su_wait_t *w,
 		    su_wakeup_arg_t *arg)
 {
   intptr_t i = (intptr_t)arg;
 
   assert(magic);
- 
+
   if (i <= 0 || i > I)
     return ++magic->error;
 
@@ -208,7 +208,7 @@
 
     if (bind(sockets[i], &su->su_sa, sizeof su->su_sin) != 0)
       perror("bind"), assert(0);
-    
+
     TEST(su_wait_create(wait + i, sockets[i], SU_WAIT_IN), 0);
 
     reg[i] = su_port_register(port, root, wait + i, callback, (void*)i, 0);
@@ -285,7 +285,7 @@
 
 #if HAVE_EPOLL
   /* With epoll we do not bother to prioritize the wait list */
-  if (port->sup_epoll == -1) 
+  if (port->sup_epoll == -1)
 #endif
     TEST(port->sup_pri_offset, prioritized);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root.c	Tue Dec 23 07:37:03 2008
@@ -121,33 +121,33 @@
 {
   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_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(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_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);
@@ -166,7 +166,7 @@
 
 #include <pthread.h>
 
-void *suspend_resume_test_thread(void *_rt) 
+void *suspend_resume_test_thread(void *_rt)
 {
   root_test_t *rt = _rt;
 
@@ -221,7 +221,7 @@
   TEST_1(rt->rt_root);
   TEST(su_root_obtain(rt->rt_root), 0);
   TEST(su_root_has_thread(rt->rt_root), 2);
-#else  
+#else
   TEST_1(rt->rt_root = su_root_create(rt));
 #endif
 
@@ -263,7 +263,7 @@
   pthread_mutex_destroy(rt->rt_sr.deinit);
 #else
   TEST_VOID(su_root_destroy(rt->rt_root)); rt->rt_root = NULL;
-#endif  
+#endif
 
   END();
 }
@@ -274,19 +274,19 @@
 {
   char buffer[64];
   int n, error;
- 
+
   su_wait_events(w, ep->s);
 
   n = recv(ep->s, buffer, sizeof(buffer), 0);
   error = su_errno();
- 
+
   if (n < 0)
     fprintf(stderr, "%s: %s\n", "recv", su_strerror(error));
 
   TEST_1(n > 0);
 
   rt->rt_received = ep->i;
-	   
+
   return 0;
 }
 
@@ -340,15 +340,15 @@
   TEST_1((s = su_socket(rt->rt_family, SOCK_DGRAM, 0)) != -1);
 
   for (i = 0; i < 5; i++) {
-    rt->rt_ep[i]->registered = 
-      su_root_register(rt->rt_root, rt->rt_ep[i]->wait, 
+    rt->rt_ep[i]->registered =
+      su_root_register(rt->rt_root, rt->rt_ep[i]->wait,
 		       wakeups[i], rt->rt_ep[i], 0);
     TEST(rt->rt_ep[i]->registered, i + 1 + SU_HAVE_PTHREADS);
   }
 
   for (i = 0; i < 5; i++) {
     test_ep_t *ep = rt->rt_ep[i];
-    TEST_SIZE(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen), 
+    TEST_SIZE(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen),
 	      sizeof(msg));
     test_run(rt);
     TEST(rt->rt_received, i);
@@ -356,22 +356,22 @@
   }
 
   for (i = 0; i < 5; i++) {
-    TEST(su_root_unregister(rt->rt_root, rt->rt_ep[i]->wait, 
-			    wakeups[i], rt->rt_ep[i]), 
+    TEST(su_root_unregister(rt->rt_root, rt->rt_ep[i]->wait,
+			    wakeups[i], rt->rt_ep[i]),
 	 rt->rt_ep[i]->registered);
   }
 
 
   for (i = 0; i < 5; i++) {
-    rt->rt_ep[i]->registered = 
-      su_root_register(rt->rt_root, rt->rt_ep[i]->wait, 
+    rt->rt_ep[i]->registered =
+      su_root_register(rt->rt_root, rt->rt_ep[i]->wait,
 		       wakeups[i], rt->rt_ep[i], 1);
     TEST_1(rt->rt_ep[i]->registered > 0);
   }
 
   for (i = 0; i < 5; i++) {
     test_ep_t *ep = rt->rt_ep[i];
-    TEST_SIZE(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen), 
+    TEST_SIZE(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen),
 	      sizeof(msg));
     test_run(rt);
     TEST(rt->rt_received, i);
@@ -379,22 +379,22 @@
   }
 
   for (i = 0; i < 5; i++) {
-    TEST(su_root_deregister(rt->rt_root, rt->rt_ep[i]->registered), 
+    TEST(su_root_deregister(rt->rt_root, rt->rt_ep[i]->registered),
 	 rt->rt_ep[i]->registered);
   }
 
   for (i = 0; i < 5; i++) {
     test_ep_t *ep = rt->rt_ep[i];
     TEST_1(su_wait_create(ep->wait, ep->s, SU_WAIT_IN|SU_WAIT_ERR) != -1);
-    ep->registered = 
-      su_root_register(rt->rt_root, ep->wait, 
+    ep->registered =
+      su_root_register(rt->rt_root, ep->wait,
 		       wakeups[i], ep, 1);
     TEST_1(ep->registered > 0);
   }
 
   for (i = 0; i < 5; i++) {
     test_ep_t *ep = rt->rt_ep[i];
-    TEST_SIZE(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen), 
+    TEST_SIZE(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen),
 	      sizeof(msg));
     test_run(rt);
     TEST(rt->rt_received, i);
@@ -402,8 +402,8 @@
   }
 
   for (i = 0; i < 5; i++) {
-    TEST(su_root_unregister(rt->rt_root, rt->rt_ep[i]->wait, 
-			    wakeups[i], rt->rt_ep[i]), 
+    TEST(su_root_unregister(rt->rt_root, rt->rt_ep[i]->wait,
+			    wakeups[i], rt->rt_ep[i]),
 	 rt->rt_ep[i]->registered);
   }
 
@@ -415,7 +415,7 @@
 {
   char buffer[64];
   ssize_t x;
-  test_ep_t *n = node->next; 
+  test_ep_t *n = node->next;
 
   su_wait_events(w, node->s);
 
@@ -428,14 +428,14 @@
     *node->prev = n;
 
     if (n) {
-      *node->prev = node->next;    
+      *node->prev = node->next;
       node->next->prev = node->prev;
       sendto(n->s, "foo", 3, 0, (void *)n->addr, n->addrlen);
     }
 
     node->next = NULL;
     node->prev = NULL;
-    
+
     if (!*node->list) {
       su_root_break(rt->rt_root);
     }
@@ -456,9 +456,9 @@
   test_ep_t *n, *nodes, *list = NULL;
   su_sockaddr_t su[1];
   socklen_t sulen;
-  
+
   TEST_1(nodes = calloc(N, sizeof *nodes));
-  
+
   memset(su, 0, sulen = sizeof su->su_sin);
   su->su_len = sizeof su->su_sin;
   su->su_family = AF_INET;
@@ -480,7 +480,7 @@
       su_close(n->s);
       break;
     }
-      
+
     if (getsockname(n->s, (void *)n->addr, &n->addrlen)) {
       su_perror("getsockname()");
       su_close(n->s);
@@ -499,7 +499,7 @@
       su_close(n->s);
       break;
     }
-    
+
     n->list = &list, n->prev = &list;
     if ((n->next = list))
       n->next->prev = &n->next;
@@ -559,21 +559,21 @@
   rt->rt_success_deinit = 1;
 }
 
-void receive_a_reporter(root_test_t *rt, 
+void receive_a_reporter(root_test_t *rt,
 			su_msg_r msg,
 			su_msg_arg_t *arg)
 {
   rt->rt_recv_reporter = 1;
 }
 
-void receive_recv_report(root_test_t *rt, 
+void receive_recv_report(root_test_t *rt,
 			 su_msg_r msg,
 			 su_msg_arg_t *arg)
 {
   rt->rt_reported_reporter = 1;
 }
 
-void send_a_reporter_msg(root_test_t *rt, 
+void send_a_reporter_msg(root_test_t *rt,
 			 su_msg_r msg,
 			 su_msg_arg_t *arg)
 {
@@ -602,12 +602,12 @@
   rt->rt_msg_destroyed++;
 }
 
-static void receive_simple_msg(root_test_t *rt, 
+static void receive_simple_msg(root_test_t *rt,
 			       su_msg_r msg,
 			       su_msg_arg_t *arg)
 {
   assert(rt == *arg);
-  rt->rt_msg_received = 
+  rt->rt_msg_received =
     su_task_cmp(su_msg_from(msg), su_task_null) == 0 &&
     su_task_cmp(su_msg_to(msg), su_task_null) == 0;
 }
@@ -657,10 +657,10 @@
 
   rt->rt_msg_received = 0;
   rt->rt_msg_destroyed = 0;
-  
+
   TEST(su_msg_deinitializer(m, deinit_simple_msg), 0);
   TEST(su_msg_send_to(m, su_clone_task(rt->rt_clone), receive_simple_msg), 0);
-  
+
   while (rt->rt_msg_destroyed == 0)
     su_root_step(rt->rt_root, 1);
 
@@ -680,7 +680,7 @@
   TEST_1(rt->rt_sent_reporter);
   TEST_1(rt->rt_recv_reporter);
   TEST_1(rt->rt_reported_reporter);
-  
+
   rt->rt_recv_reporter = 0;
 
   /* Make sure we can handle messages done as expected */
@@ -701,8 +701,8 @@
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
-	  "usage: %s [-v] [-a]\n", 
+  fprintf(stderr,
+	  "usage: %s [-v] [-a]\n",
 	  name);
   exit(exitcode);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root_osx.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root_osx.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root_osx.c	Tue Dec 23 07:37:03 2008
@@ -135,19 +135,19 @@
 {
   char buffer[64];
   int n, error;
- 
+
   su_wait_events(w, ep->s);
 
   n = recv(ep->s, buffer, sizeof(buffer), 0);
   error = su_errno();
- 
+
   if (n < 0)
     fprintf(stderr, "%s: %s\n", "recv", su_strerror(error));
 
   TEST_1(n > 0);
 
   rt->rt_received = ep->i;
-	   
+
   return 0;
 }
 
@@ -202,15 +202,15 @@
   TEST_1((s = su_socket(rt->rt_family, SOCK_DGRAM, 0)) != -1);
 
   for (i = 0; i < 5; i++) {
-    rt->rt_ep[i]->registered = 
-      su_root_register(rt->rt_root, rt->rt_ep[i]->wait, 
+    rt->rt_ep[i]->registered =
+      su_root_register(rt->rt_root, rt->rt_ep[i]->wait,
 		       wakeups[i], rt->rt_ep[i], 0);
     TEST(rt->rt_ep[i]->registered, i + 1 + SU_HAVE_PTHREADS);
   }
 
   for (i = 0; i < 5; i++) {
     test_ep_t *ep = rt->rt_ep[i];
-    TEST(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen), 
+    TEST(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen),
 	 sizeof(msg));
     test_run(rt);
     TEST(rt->rt_received, i);
@@ -218,22 +218,22 @@
   }
 
   for (i = 0; i < 5; i++) {
-    TEST(su_root_unregister(rt->rt_root, rt->rt_ep[i]->wait, 
-			    wakeups[i], rt->rt_ep[i]), 
+    TEST(su_root_unregister(rt->rt_root, rt->rt_ep[i]->wait,
+			    wakeups[i], rt->rt_ep[i]),
 	 rt->rt_ep[i]->registered);
   }
 
 
   for (i = 0; i < 5; i++) {
-    rt->rt_ep[i]->registered = 
-      su_root_register(rt->rt_root, rt->rt_ep[i]->wait, 
+    rt->rt_ep[i]->registered =
+      su_root_register(rt->rt_root, rt->rt_ep[i]->wait,
 		       wakeups[i], rt->rt_ep[i], 1);
     TEST_1(rt->rt_ep[i]->registered > 0);
   }
 
   for (i = 0; i < 5; i++) {
     test_ep_t *ep = rt->rt_ep[i];
-    TEST(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen), 
+    TEST(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen),
 	 sizeof(msg));
     test_run(rt);
     TEST(rt->rt_received, i);
@@ -241,22 +241,22 @@
   }
 
   for (i = 0; i < 5; i++) {
-    TEST(su_root_deregister(rt->rt_root, rt->rt_ep[i]->registered), 
+    TEST(su_root_deregister(rt->rt_root, rt->rt_ep[i]->registered),
 	 rt->rt_ep[i]->registered);
   }
 
   for (i = 0; i < 5; i++) {
     test_ep_t *ep = rt->rt_ep[i];
     TEST_1(su_wait_create(ep->wait, ep->s, SU_WAIT_IN|SU_WAIT_ERR) != -1);
-    ep->registered = 
-      su_root_register(rt->rt_root, ep->wait, 
+    ep->registered =
+      su_root_register(rt->rt_root, ep->wait,
 		       wakeups[i], ep, 1);
     TEST_1(ep->registered > 0);
   }
 
   for (i = 0; i < 5; i++) {
     test_ep_t *ep = rt->rt_ep[i];
-    TEST(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen), 
+    TEST(su_sendto(s, msg, sizeof(msg), 0, ep->addr, ep->addrlen),
 	 sizeof(msg));
     test_run(rt);
     TEST(rt->rt_received, i);
@@ -264,8 +264,8 @@
   }
 
   for (i = 0; i < 5; i++) {
-    TEST(su_root_unregister(rt->rt_root, rt->rt_ep[i]->wait, 
-			    wakeups[i], rt->rt_ep[i]), 
+    TEST(su_root_unregister(rt->rt_root, rt->rt_ep[i]->wait,
+			    wakeups[i], rt->rt_ep[i]),
 	 rt->rt_ep[i]->registered);
   }
 
@@ -322,14 +322,14 @@
   TEST_VOID(su_clone_wait(rt->rt_root, rt->rt_clone));
 
   TEST_1(rt->rt_success_deinit);
-  
+
   END();
 }
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
-	  "usage: %s [-v] [-a]\n", 
+  fprintf(stderr,
+	  "usage: %s [-v] [-a]\n",
 	  name);
   exit(exitcode);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_tag.c	Tue Dec 23 07:37:03 2008
@@ -28,7 +28,7 @@
  * Testing functions for su_tag module.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- * 
+ *
  * @date Created: Tue Mar  6 18:33:42 2001 ppessi
  */
 
@@ -47,7 +47,7 @@
 #define DEVNULL "/dev/null"
 #else
 #define DEVNULL "nul"
-#endif 
+#endif
 
 int tstflags = 0;
 
@@ -127,27 +127,27 @@
 
   tag_typedef_t _tag_b = STRTAG_TYPEDEF(b);
   tag_typedef_t _tag_b_ref = REFTAG_TYPEDEF(tag_b);
- 
+
   tag_typedef_t _tag_i = INTTAG_TYPEDEF(i);
   tag_typedef_t _tag_i_ref = REFTAG_TYPEDEF(tag_i);
- 
+
   tag_typedef_t _tag_j = INTTAG_TYPEDEF(j);
   tag_typedef_t _tag_j_ref = REFTAG_TYPEDEF(tag_j);
- 
+
   tag_typedef_t _tag_k = INTTAG_TYPEDEF(k);
   tag_typedef_t _tag_k_ref = REFTAG_TYPEDEF(tag_k);
-  
+
   tag_typedef_t _tag_n = INTTAG_TYPEDEF(n);
   tag_typedef_t _tag_n_ref = REFTAG_TYPEDEF(tag_n);
 
 #undef TAG_NAMESPACE
 #define TAG_NAMESPACE "pq"
-  
+
   tag_typedef_t _tag_any_pq = NSTAG_TYPEDEF(*);
 
   tag_typedef_t _tag_p = BOOLTAG_TYPEDEF(p);
   tag_typedef_t _tag_p_ref = REFTAG_TYPEDEF(tag_p);
-  
+
   tag_typedef_t _tag_q = BOOLTAG_TYPEDEF(q);
   tag_typedef_t _tag_q_ref = REFTAG_TYPEDEF(tag_q);
 
@@ -237,22 +237,22 @@
 	       (tv)1, (tv)2, (tv)3, (tv)4, (tv)5,
 	       (tv)6, (tv)7, (tv)8, (tv)9, (tv)10);
 }
-], 
+],
 SAC_SU_DEFINE(SU_HAVE_TAGSTACK, 1, [
-Define this as 1 if your compiler puts the variable argument list nicely in memory]), 
+Define this as 1 if your compiler puts the variable argument list nicely in memory]),
 )
 
 */
 
 static int test_stackargs(int l, ...)
 {
-  va_list ap;  
+  va_list ap;
   int i, *p;
 
   BEGIN();
 
   va_start(ap, l);
-  
+
   p = &l;
 
   for (i = l; i <= 10; i++) {
@@ -287,10 +287,10 @@
 
   BEGIN();
 
-  lst = tl_list(TAG_A("Moro"), 
-		TAG_A("Vaan"), 
-		TAG_I(1), 
-		TAG_SKIP(2), 
+  lst = tl_list(TAG_A("Moro"),
+		TAG_A("Vaan"),
+		TAG_I(1),
+		TAG_SKIP(2),
 		TAG_NEXT(rest));
 
   TEST_P(lst[0].t_tag, tag_a);
@@ -379,12 +379,12 @@
 
   home = su_home_new(sizeof *home); TEST_1(home);
 
-  lst = tl_list(TAG_A("Moro"), 
+  lst = tl_list(TAG_A("Moro"),
 		TAG_I(2),
 		TAG_Q(3),
-		TAG_SKIP(2), 
-		TAG_A("vaan"), 
-		TAG_I(1), 
+		TAG_SKIP(2),
+		TAG_A("vaan"),
+		TAG_I(1),
 		TAG_P(2),
 		TAG_NULL());
 
@@ -420,7 +420,7 @@
   su_free(NULL, b1); su_free(NULL, b2); su_free(NULL, b3); su_free(NULL, b4);
 
   nsfilter = tl_list(TAG_ANY_PQ(), TAG_END());
-  
+
   b5 = tl_afilter(NULL, nsfilter, lst);
   TEST_SIZE(tl_len(b5), 3 * sizeof(tagi_t));
   TEST_SIZE(tl_xtra(b5, 0), 0);
@@ -437,7 +437,7 @@
   b = tl_afilter(home, filter6, lst); TEST_1(b);
   TEST_P(b[0].t_tag, 0);
 
-  tl_vfree(filter1); tl_vfree(filter2); tl_vfree(filter3); 
+  tl_vfree(filter1); tl_vfree(filter2); tl_vfree(filter3);
   tl_vfree(filter4); tl_vfree(filter5); tl_vfree(filter6);
 
   tl_vfree(lst);
@@ -455,14 +455,14 @@
   tagi_t *lst;
   FILE *out;
 
-  lst = tl_list(TAG_A("Moro"), 
-		TAG_I(2), 
+  lst = tl_list(TAG_A("Moro"),
+		TAG_I(2),
 		TAG_J(3),
 		TAG_K(5),
-		TAG_SKIP(2), 
-		TAG_A("Vaan"), 
+		TAG_SKIP(2),
+		TAG_A("Vaan"),
 		TAG_B("b"),
-		TAG_I(1), 
+		TAG_I(1),
 		TAG_NULL());
 
   if (tstflags & tst_verbatim)
@@ -524,15 +524,15 @@
 
   BEGIN();
 
-  lst = tl_list(TAG_A("Moro"), 
-		TAG_I(2), 
+  lst = tl_list(TAG_A("Moro"),
+		TAG_I(2),
 		TAG_J(3),
 		TAG_K(5),
 		TAG_P(3),
-		TAG_SKIP(2), 
-		TAG_A("Vaan"), 
+		TAG_SKIP(2),
+		TAG_A("Vaan"),
 		TAG_B("b"),
-		TAG_I(1), 
+		TAG_I(1),
 		TAG_NULL());
 
   TEST_1(lst);
@@ -540,7 +540,7 @@
   TEST_1(t = tl_find(lst, tag_i)); TEST(t->t_value, 2);
   TEST_1(t = tl_find_last(lst, tag_i)); TEST(t->t_value, 1);
 
-  TEST(tl_gets(lst, 
+  TEST(tl_gets(lst,
 	       TAG_A_REF(a),
 	       TAG_B_REF(b),
 	       TAG_I_REF(i),
@@ -566,7 +566,7 @@
   lst = tl_list(TAG_A_REF(a),
 		TAG_I_REF(i),
 		TAG_NULL());
-  
+
   TEST(tl_tgets(lst, TAG_A("Foo"), TAG_I(-1), TAG_END()), 2);
 
   TEST_S(a, "Foo");
@@ -629,8 +629,8 @@
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
-	  "usage: %s [-v] [-a]\n", 
+  fprintf(stderr,
+	  "usage: %s [-v] [-a]\n",
 	  name);
   exit(exitcode);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_time.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_time.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_time.c	Tue Dec 23 07:37:03 2008
@@ -23,14 +23,14 @@
  */
 
 /**@ingroup su_time
- * 
- * @IFILE torture_su_time.c  
+ *
+ * @IFILE torture_su_time.c
  *
  * Tests for su_time functions.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Kai Vehmanen <first.surname at nokia.com>
- * 
+ *
  * @date Created: Fri May 10 16:08:18 2002 ppessi
  */
 
@@ -81,7 +81,7 @@
   su_time_t now;
   su_ntp_t ntp, ntp0, ntp1;
   uint64_t increment = 3019;
-  
+
   BEGIN();
 
   ntp_hi = 2208988800UL;
@@ -138,7 +138,7 @@
   uint64_t tl;
   uint16_t seq1, seq2;
   const uint64_t granularity = 10000000U;
-  const uint64_t ntp_epoch = 
+  const uint64_t ntp_epoch =
     (uint64_t)(141427) * (24 * 60 * 60L) * granularity;
   isize_t i;
 
@@ -175,7 +175,7 @@
 
   for (i = 0; i < 32000; i++) {
     su_guid_generate(g2);
-    seq2 = ((g2->s.clock_seq_hi_and_reserved & 0x3f) << 8) 
+    seq2 = ((g2->s.clock_seq_hi_and_reserved & 0x3f) << 8)
       + g2->s.clock_seq_low;
     TEST((seq1 + i + 2) % 16384, seq2);
   }
@@ -216,15 +216,15 @@
 
 void usage(int exitcode)
 {
-  fprintf(stderr, 
-	  "usage: %s [-v] [-a]\n", 
+  fprintf(stderr,
+	  "usage: %s [-v] [-a]\n",
 	  name);
   exit(exitcode);
 }
 
 char *lastpart(char *path)
 {
-  if (strchr(path, '/')) 
+  if (strchr(path, '/'))
     return strrchr(path, '/') + 1;
   else
     return path;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_timer.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_timer.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/torture_su_timer.c	Tue Dec 23 07:37:03 2008
@@ -261,7 +261,7 @@
 
   now = su_now();
 
-  printf("Inserting %u timers took %f millisec\n", 
+  printf("Inserting %u timers took %f millisec\n",
 	 i, su_time_diff(inserted, started) * 1000);
 
   printf("Processing %u/%u timers took %f millisec (%f expected)\n",

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -1,6 +1,6 @@
 2006-10-19  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-	* tport.c (tport_is_shutdown, tport_is_closed): Added to 
+	* tport.c (tport_is_shutdown, tport_is_closed): Added to
 	public API.
 
 2006-01-15  Martti Mela  <martti.mela at nokia.com>
@@ -22,11 +22,11 @@
 
 	* tport.c (tport_bind_server): Avoid segfault
 	if init for a NAT traversal mechanism has failed.
-	
+
 2005-10-18  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
 	* Feature #1326002.
-	
+
   * Added stun_test(), but not running it.
 
     M ./libsofia-sip-ua/tport/tport_test.c +32

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -21,7 +21,7 @@
 
 noinst_LTLIBRARIES = 	libtport.la
 
-bin_PROGRAMS = 		
+bin_PROGRAMS =
 
 check_PROGRAMS =	test_tport
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h	Tue Dec 23 07:37:03 2008
@@ -213,7 +213,7 @@
 TPORT_DLL isize_t tport_queuelen(tport_t const *self);
 
 /** Send a queued message (and queue another, if required). */
-TPORT_DLL int tport_tqsend(tport_t *, msg_t *, msg_t *, 
+TPORT_DLL int tport_tqsend(tport_t *, msg_t *, msg_t *,
 			   tag_type_t, tag_value_t, ...);
 
 /** Stop reading from socket until tport_continue() is called. */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_plugins.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_plugins.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_plugins.h	Tue Dec 23 07:37:03 2008
@@ -91,7 +91,7 @@
   int (*vsc_can_send_comp)(tport_compressor_t const *);
   int (*vsc_can_recv_comp)(tport_compressor_t const *);
 
-  int (*vsc_set_comp_name)(tport_t const *self, 
+  int (*vsc_set_comp_name)(tport_t const *self,
 			   tport_compressor_t const *return_sc,
 			   char const *comp);
 
@@ -104,7 +104,7 @@
 			     char const *name, int namelen,
 			     int create_if_needed);
 
-  struct sigcomp_compartment * 
+  struct sigcomp_compartment *
   (*vsc_compartment_incref)(struct sigcomp_compartment *cc);
 
   void (*vsc_compartment_decref)(struct sigcomp_compartment **pointer_to_cc);
@@ -146,19 +146,19 @@
   (*vsc_sigcomp_assign_if_needed)(tport_t *self,
 				  struct sigcomp_compartment *cc);
 
-  void (*vsc_accept_incomplete)(tport_t const *self, 
+  void (*vsc_accept_incomplete)(tport_t const *self,
 				tport_compressor_t *sc,
 				msg_t *msg);
 
-  int (*vsc_recv_comp)(tport_t const *self, 
+  int (*vsc_recv_comp)(tport_t const *self,
 		       tport_compressor_t *sc,
 		       msg_t **in_out_msg,
 		       su_sockaddr_t *from,
 		       socklen_t fromlen);
 
   ssize_t (*vsc_send_comp)(tport_t const *self,
-		       msg_t *msg, 
-		       msg_iovec_t iov[], 
+		       msg_t *msg,
+		       msg_iovec_t iov[],
 		       size_t iovused,
 		       struct sigcomp_compartment *cc,
 		       tport_compressor_t *sc);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h	Tue Dec 23 07:37:03 2008
@@ -28,9 +28,9 @@
 
 /**@file sofia-sip/tport_tag.h
  * @brief Tags for tport module.
- * 
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- *  
+ *
  * @date Created: Sat Oct 12 18:39:48 2002 ppessi
  */
 
@@ -74,7 +74,7 @@
 TPORT_DLL extern tag_typedef_t tptag_server_ref;
 #define TPTAG_SERVER_REF(x) tptag_server_ref, tag_bool_vr(&(x))
 
-/** Define how the public transport connects to Internet. 
+/** Define how the public transport connects to Internet.
  *
  * @sa TPTAG_PUBLIC(), tport_is_public().
  */
@@ -186,6 +186,12 @@
 TPORT_DLL extern tag_typedef_t tptag_tls_version_ref;
 #define TPTAG_TLS_VERSION_REF(x) tptag_tls_version_ref, tag_uint_vr(&(x))
 
+TPORT_DLL extern tag_typedef_t tptag_tls_verify_peer;
+#define TPTAG_TLS_VERIFY_PEER(x) tptag_tls_verify_peer, tag_uint_v((x))
+
+TPORT_DLL extern tag_typedef_t tptag_tls_verify_peer_ref;
+#define TPTAG_TLS_VERIFY_PEER_REF(x) tptag_tls_verify_peer_ref, tag_uint_vr(&(x))
+
 #if 0
 TPORT_DLL extern tag_typedef_t tptag_trusted;
 #define TPTAG_TRUSTED(x) tptag_trusted, tag_bool_v((x))

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/test_tport.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/test_tport.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/test_tport.c	Tue Dec 23 07:37:03 2008
@@ -49,7 +49,7 @@
 
 #define TP_STACK_T tp_test_t
 #define TP_CLIENT_T struct called
- 
+
 #include <sofia-sip/su_wait.h>
 #include <sofia-sip/su_md5.h>
 
@@ -158,7 +158,7 @@
 
   for (tp = tport_primaries(tp); tp; tp = tport_next(tp))
     n++;
-  
+
   return n;
 }
 
@@ -169,7 +169,7 @@
   usize_t i, len;
 
   BEGIN();
-  
+
   TEST_1(tst = msg_test_public(msg));
   TEST_1(pl = tst->msg_payload);
 
@@ -197,7 +197,7 @@
   msg_test_t *tst;
   msg_payload_t *pl;
   su_md5_t md5[1];
-  
+
   BEGIN();
 
   TEST_1(tst = msg_test_public(msg));
@@ -255,7 +255,7 @@
     if (strcmp(b64, tst->msg_content_md5->g_string)) {
       ;
     }
-    
+
     TEST_S(b64, tst->msg_content_md5->g_string);
   } else {
     TEST_1(tst->msg_content_md5);
@@ -266,7 +266,7 @@
 
 #define TPORT_TEST_VERSION MSG_TEST_VERSION_CURRENT
 
-static int new_test_msg(tp_test_t *tt, msg_t **retval, 
+static int new_test_msg(tp_test_t *tt, msg_t **retval,
 			char const *ident,
 			int N, int len)
 {
@@ -336,7 +336,7 @@
 
   TEST_1(md5 = msg_content_md5_make(home, b64));
   TEST(msg_header_insert(msg, (void *)tst, (msg_header_t *)md5), 0);
-  
+
   TEST_1(sep = msg_separator_create(home));
   TEST(msg_header_insert(msg, (void *)tst, (msg_header_t *)sep), 0);
 
@@ -361,7 +361,7 @@
 
   if (tport_delivered_from(tp, msg, frm) != -1 && frm->tpn_comp) {
     struct sigcomp_compartment *cc = test_sigcomp_compartment(tt, tp, frm);
-   
+
     tport_sigcomp_accept(tp, cc, msg);
   }
 
@@ -374,7 +374,7 @@
   }
   else if (test_msg_md5(tt, msg))
     msg_destroy(msg);
-  else if (tt->tt_rmsg) 
+  else if (tt->tt_rmsg)
     msg_destroy(msg);
   else {
     tt->tt_rmsg = msg;
@@ -388,14 +388,14 @@
 			  char const *remote)
 {
   tt->tt_status = -1;
-  fprintf(stderr, "tp_test_error(%p): error %d (%s) from %s\n", 
-	  (void *)tp, errcode, su_strerror(errcode), 
+  fprintf(stderr, "tp_test_error(%p): error %d (%s) from %s\n",
+	  (void *)tp, errcode, su_strerror(errcode),
 	  remote ? remote : "<unknown destination>");
 }
 
 msg_t *tp_test_msg(tp_test_t *tt, int flags,
 		   char const data[], usize_t size,
-		   tport_t const *tp, 
+		   tport_t const *tp,
 		   tp_client_t *tpc)
 {
   msg_t *msg = msg_create(tt->tt_mclass, flags);
@@ -408,15 +408,15 @@
 
 static
 struct sigcomp_compartment *
-test_sigcomp_compartment(tp_test_t *tt, 
-			 tport_t *tp, 
+test_sigcomp_compartment(tp_test_t *tt,
+			 tport_t *tp,
 			 tp_name_t const *tpn)
 {
   struct sigcomp_compartment *cc = NULL;
 #if HAVE_SIGCOMP
   char name[256];
   int namesize;
-  
+
   namesize = snprintf(name, sizeof name, "TEST_%s/%s:%s",
 		     tpn->tpn_proto,
 		     tpn->tpn_host,
@@ -425,11 +425,11 @@
   if (namesize <= 0 || namesize >= sizeof name)
     return NULL;
 
-  cc = sigcomp_compartment_access(tt->state_handler, 
+  cc = sigcomp_compartment_access(tt->state_handler,
 				  0, name, namesize, NULL, 0);
 
   if (cc == NULL) {
-    cc = sigcomp_compartment_create(tt->algorithm, tt->state_handler, 
+    cc = sigcomp_compartment_create(tt->algorithm, tt->state_handler,
 				    0, name, namesize, NULL, 0);
 
     sigcomp_compartment_option(cc, "dms=32768");
@@ -506,23 +506,23 @@
 
 #if HAVE_SIGCOMP
   TEST_1(tt->state_handler = sigcomp_state_handler_create());
-  TEST_1(tt->algorithm = 
+  TEST_1(tt->algorithm =
 	 sigcomp_algorithm_by_name(getenv("SIGCOMP_ALGORITHM")));
-  TEST_1(tt->master_cc = 
-	 sigcomp_compartment_create(tt->algorithm, tt->state_handler, 
+  TEST_1(tt->master_cc =
+	 sigcomp_compartment_create(tt->algorithm, tt->state_handler,
 				    0, "", 0, NULL, 0));
   TEST(sigcomp_compartment_option(tt->master_cc, "stateless"), 1);
 #endif
 
   /* Create client transport */
-  TEST_1(tt->tt_tports = 
+  TEST_1(tt->tt_tports =
 	 tport_tcreate(tt, tp_test_class, tt->tt_root,
 		       IF_SIGCOMP_TPTAG_COMPARTMENT(tt->master_cc)
 		       TAG_END()));
 
   /* Bind client transports */
   TEST(tport_tbind(tt->tt_tports, myname, transports,
-		   TPTAG_SERVER(0), TAG_END()), 
+		   TPTAG_SERVER(0), TAG_END()),
        0);
 
   if (getenv("TPORT_TEST_HOST"))
@@ -536,15 +536,15 @@
   myname->tpn_ident = "server";
 
   /* Create server transport */
-  TEST_1(tt->tt_srv_tports = 
+  TEST_1(tt->tt_srv_tports =
 	 tport_tcreate(tt, tp_test_class, tt->tt_root,
 		       IF_SIGCOMP_TPTAG_COMPARTMENT(tt->master_cc)
 		       TAG_END()));
 
   /* Bind server transports */
-  TEST(tport_tbind(tt->tt_srv_tports, myname, transports, 
+  TEST(tport_tbind(tt->tt_srv_tports, myname, transports,
 		   TPTAG_SERVER(1),
-		   TAG_END()), 
+		   TAG_END()),
        0);
 
   /* Check that the master transport has idle parameter */
@@ -578,13 +578,13 @@
 
     rname->tpn_port = port;
     rname->tpn_ident = "failure";
-    
+
     before = count_tports(tt->tt_srv_tports);
 
     /* Bind server transports to an reserved port - this should fail */
-    TEST(tport_tbind(tt->tt_srv_tports, rname, transports, 
+    TEST(tport_tbind(tt->tt_srv_tports, rname, transports,
 		     TPTAG_SERVER(1),
-		     TAG_END()), 
+		     TAG_END()),
 	 -1);
 
     after = count_tports(tt->tt_srv_tports);
@@ -601,9 +601,9 @@
     rname->tpn_ident = "server2";
 
     /* Bind server transports to another port */
-    TEST(tport_tbind(tt->tt_srv_tports, rname, transports, 
+    TEST(tport_tbind(tt->tt_srv_tports, rname, transports,
 		     TPTAG_SERVER(1),
-		     TAG_END()), 
+		     TAG_END()),
 	 0);
 
     /* Check that new transports are after old ones. */
@@ -631,16 +631,16 @@
 
     /* Bind client transports */
     TEST(tport_tbind(tt->tt_tports, tlsname, transports,
-		     TPTAG_SERVER(0), 
+		     TPTAG_SERVER(0),
 		     TPTAG_CERTIFICATE(srcdir),
-		     TAG_END()), 
+		     TAG_END()),
 	 0);
 
     /* Bind tls server transport */
-    TEST(tport_tbind(tt->tt_srv_tports, tlsname, transports, 
+    TEST(tport_tbind(tt->tt_srv_tports, tlsname, transports,
 		     TPTAG_SERVER(1),
 		     TPTAG_CERTIFICATE(srcdir),
-		     TAG_END()), 
+		     TAG_END()),
 	 0);
   }
 #endif
@@ -651,9 +651,9 @@
     if (tt->tt_flags & tst_verbatim) {
       char const *host = tpn->tpn_host != tpn->tpn_canon ? tpn->tpn_host : "";
       printf("bound transport to %s/%s:%s%s%s%s%s\n",
-	     tpn->tpn_proto, tpn->tpn_canon, tpn->tpn_port, 
+	     tpn->tpn_proto, tpn->tpn_canon, tpn->tpn_port,
 	     host[0] ? ";maddr=" : "", host,
-	     tpn->tpn_comp ? ";comp=" : "", 
+	     tpn->tpn_comp ? ";comp=" : "",
 	     tpn->tpn_comp ? tpn->tpn_comp : "");
     }
 
@@ -676,10 +676,10 @@
       tt->tt_tcp_comp->tpn_ident = NULL;
 
       if (tt->tt_tcp_addr == NULL) {
-	tt->tt_tcp_addr = tport_get_address(tp); 
+	tt->tt_tcp_addr = tport_get_address(tp);
 	tt->tt_tcp = tp;
       }
-    } 
+    }
     else if (strcmp(tpn->tpn_proto, "sctp") == 0) {
       *tt->tt_sctp_name = *tpn;
       tt->tt_sctp_name->tpn_ident = NULL;
@@ -693,13 +693,13 @@
   END();
 }
 
-char const payload[] = 
+char const payload[] =
 "Some data\n"
 "More data\n";
 
 #include <time.h>
 
-int 
+int
 tport_test_run(tp_test_t *tt, unsigned timeout)
 {
   time_t now = time(NULL);
@@ -715,7 +715,7 @@
     }
     su_root_step(tt->tt_root, 500L);
 
-    if (!getenv("TPORT_TEST_DEBUG") && 
+    if (!getenv("TPORT_TEST_DEBUG") &&
 	time(NULL) > (time_t)(now + timeout))
       return 0;
   }
@@ -838,7 +838,7 @@
   msg_destroy(msg);
 
   tport_set_params(tp,
-       	    TPTAG_KEEPALIVE(100), 
+       	    TPTAG_KEEPALIVE(100),
        	    TPTAG_PINGPONG(500),
        	    TPTAG_IDLE(500),
        	    TAG_END());
@@ -901,7 +901,7 @@
 
   /* This uses a new connection */
   TEST_1(!new_test_msg(tt, &msg, "tcp-no-reuse", 1, 1024));
-  TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name, 
+  TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name,
        		   TPTAG_REUSE(0), TAG_END()));
   N++;
   TEST_S(tport_name(tp)->tpn_ident, "client");
@@ -910,7 +910,7 @@
 
   /* This uses the old connection */
   TEST_1(!new_test_msg(tt, &msg, "tcp-reuse", 1, 1024));
-  TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name, 
+  TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name,
        		   TPTAG_REUSE(1), TAG_END()));
   N++;
   TEST_S(tport_name(tp)->tpn_ident, "client");
@@ -940,8 +940,8 @@
   TEST_1(pending_server_close && pending_client_close);
   SU_DEBUG_3(("tport_test(%p): waiting for PONG timeout\n", (void *)tp0));
 
-  /* Wait until notifications - 
-     client closes when no pong is received and notifys pending, 
+  /* Wait until notifications -
+     client closes when no pong is received and notifys pending,
      then server closes and notifys pending */
   while (pending_server_close || pending_client_close)
     su_root_step(tt->tt_root, 50);
@@ -956,7 +956,7 @@
   msg_destroy(msg);
 
   tport_set_params(tp0,
-       	    TPTAG_KEEPALIVE(250), 
+       	    TPTAG_KEEPALIVE(250),
        	    TPTAG_PINGPONG(200),
        	    TAG_END());
 
@@ -999,7 +999,7 @@
 static int test_incomplete(tp_test_t *tt)
 {
   BEGIN();
-  
+
   su_addrinfo_t const *ai = tt->tt_tcp_addr;
   su_socket_t s;
   int connected;
@@ -1010,12 +1010,12 @@
 
   s = su_socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
   TEST_1(s != SOCKET_ERROR);
-  
+
   su_setblocking(s, 1);
   connected = connect(s, ai->ai_addr, (socklen_t)ai->ai_addrlen);
 
   su_root_step(tt->tt_root, 50);
-  
+
   TEST(su_send(s, "F", 1, 0), 1);
   su_root_step(tt->tt_root, 50);
   TEST(su_send(s, "O", 1, 0), 1);
@@ -1024,12 +1024,12 @@
   su_root_step(tt->tt_root, 50);
   TEST(su_send(s, " ", 1, 0), 1);
   su_root_step(tt->tt_root, 50);
-  
+
   tt->tt_received = 0;
   TEST(tport_test_run(tt, 5), -1);
   TEST(tt->tt_received, 1);
   TEST_P(tt->tt_rmsg, NULL);
-  
+
   su_close(s);
 
   END();
@@ -1050,7 +1050,7 @@
   TEST_1(tp = tport_by_name(tt->tt_tports, tpn));
   TEST_1(tport_is_primary(tp));
   TEST(tport_flush(tp), 0);
-  
+
   for (i = 0; i < 10; i++)
     su_root_step(tt->tt_root, 10L);
 
@@ -1083,7 +1083,7 @@
   /* Enable reuse on single connection */
   TEST(tport_set_params(tp1, TPTAG_REUSE(1), TAG_END()), 1);
   TEST(new_test_msg(tt, &msg, "reuse-3", 1, 1024), 0);
-  TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name, 
+  TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name,
 			  TPTAG_REUSE(1),
 			  TAG_END()));
   TEST_S(tport_name(tp)->tpn_ident, "client");
@@ -1101,7 +1101,7 @@
 
   /* Send a single message with different connection */
   TEST_1(!new_test_msg(tt, &msg, "fresh-1", 1, 1024));
-  TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name, 
+  TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name,
 			  TPTAG_FRESH(1),
 			  TPTAG_REUSE(1),
 			  TAG_END()));
@@ -1135,7 +1135,7 @@
   tport_t *tp, *tp0;
   char buffer[32];
 
-  if (!tt->tt_sctp_name->tpn_proto) 
+  if (!tt->tt_sctp_name->tpn_proto)
     return 0;
 
   /* Just a small and nice message first */
@@ -1148,7 +1148,7 @@
   tport_set_params(tp, TPTAG_KEEPALIVE(100), TPTAG_IDLE(500), TAG_END());
 
   TEST(tport_test_run(tt, 5), 1);
-    
+
   TEST_1(!check_msg(tt, tt->tt_rmsg, NULL));
   test_check_md5(tt, tt->tt_rmsg);
   msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
@@ -1177,7 +1177,7 @@
     TEST_S(tport_name(tp)->tpn_ident, "client");
     msg_destroy(msg);
   }
-  
+
   /* Fill up the queue */
   for (i = 1; i < TPORT_QUEUESIZE; i++) {
     snprintf(buffer, sizeof buffer, "cid:sctp-%u", n + i);
@@ -1191,16 +1191,16 @@
   TEST_1(!new_test_msg(tt, &msg, buffer, 1, 1024));
   TEST_1(!tport_tsend(tt->tt_tports, msg, tt->tt_sctp_name, TAG_END()));
   msg_destroy(msg);
-  
+
   TEST(tport_test_run(tt, 5), 1);
-    
+
   TEST_1(!check_msg(tt, tt->tt_rmsg, NULL));
   test_check_md5(tt, tt->tt_rmsg);
   msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
 
   /* This uses a new connection */
   TEST_1(!new_test_msg(tt, &msg, "cid:sctp-new", 1, 1024));
-  TEST_1(tport_tsend(tt->tt_tports, msg, tt->tt_sctp_name, 
+  TEST_1(tport_tsend(tt->tt_tports, msg, tt->tt_sctp_name,
 		     TPTAG_REUSE(0), TAG_END()));
   msg_destroy(msg);
 
@@ -1211,22 +1211,22 @@
     TEST_1(!check_msg(tt, tt->tt_rmsg, NULL));
     msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
   }
-  
+
   /* Try to send a single message */
   TEST_1(!new_test_msg(tt, &msg, "cid:sctp-final", 1, 512));
   TEST_1(tport_tsend(tt->tt_tports, msg, tt->tt_sctp_name, TAG_END()));
   msg_destroy(msg);
-  
+
   TEST(tport_test_run(tt, 10), 1);
-  
+
   TEST_1(!check_msg(tt, tt->tt_rmsg, NULL));
   msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
   }
 
   tport_unref(tp0);
 
-  /* Wait until notifications - 
-     client closes when idle and notifys pending, 
+  /* Wait until notifications -
+     client closes when idle and notifys pending,
      then server closes and notifys pending */
   while (pending_server_close || pending_client_close)
     su_root_step(tt->tt_root, 50);
@@ -1256,7 +1256,7 @@
 
 static int tls_test(tp_test_t *tt)
 {
-  BEGIN(); 
+  BEGIN();
 
 #if HAVE_TLS
   tp_name_t const *dst = tt->tt_tls_name;
@@ -1319,7 +1319,7 @@
 
   /* This uses a new connection */
   TEST_1(!new_test_msg(tt, &msg, "tls-no-reuse", 1, 1024));
-  TEST_1(tp = tport_tsend(tt->tt_tports, msg, dst, 
+  TEST_1(tp = tport_tsend(tt->tt_tports, msg, dst,
 		     TPTAG_REUSE(0), TAG_END()));
   TEST_1(tp != tp0);
   msg_destroy(msg);
@@ -1345,12 +1345,12 @@
 
   tport_decref(&tp0);
 
-  /* Wait until notifications - 
-     client closes when idle and notifys pending, 
+  /* Wait until notifications -
+     client closes when idle and notifys pending,
      then server closes and notifys pending */
   while (pending_server_close || pending_client_close)
     su_root_step(tt->tt_root, 50);
-  
+
 #endif
 
   END();
@@ -1364,7 +1364,7 @@
   su_home_t *home;
   tp_name_t tpn[1] = {{ NULL }};
   struct sigcomp_compartment *cc;
-  
+
   if (tt->tt_udp_comp->tpn_comp) {
     msg_t *msg = NULL;
 
@@ -1372,8 +1372,8 @@
 
     TEST_1(!new_test_msg(tt, &msg, "udp-sigcomp", 1, 1200));
     test_create_md5(tt, msg);
-    TEST_1(tport_tsend(tt->tt_tports, 
-		       msg, 
+    TEST_1(tport_tsend(tt->tt_tports,
+		       msg,
 		       tt->tt_udp_comp,
 		       TPTAG_COMPARTMENT(cc),
 		       TAG_END()));
@@ -1386,25 +1386,25 @@
     test_check_md5(tt, tt->tt_rmsg);
 
     TEST_1(msg = tt->tt_rmsg); tt->tt_rmsg = NULL;
-    
+
     TEST_1(home = msg_home(msg));
-    
+
     TEST_1(tport_convert_addr(home, tpn, "udp", NULL, msg_addr(msg)) == 0);
-    
+
     tpn->tpn_comp = tport_name(tt->tt_rtport)->tpn_comp;
-    
+
     /* reply */
     TEST_1(cc = test_sigcomp_compartment(tt, tt->tt_tports, tpn));
-    TEST_1(tport_tsend(tt->tt_rtport, msg, tpn, 
+    TEST_1(tport_tsend(tt->tt_rtport, msg, tpn,
 		       TPTAG_COMPARTMENT(cc),
 		       TAG_END()) != NULL);
-    
+
     msg_destroy(msg);
-    
+
     TEST(tport_test_run(tt, 5), 1);
 
-    TEST_1(!check_msg(tt, tt->tt_rmsg, NULL)); 
-    test_check_md5(tt, tt->tt_rmsg); 
+    TEST_1(!check_msg(tt, tt->tt_rmsg, NULL));
+    test_check_md5(tt, tt->tt_rmsg);
     msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
   }
 
@@ -1420,9 +1420,9 @@
     tport_log->log_level = 9;
 
     TEST_1(cc = test_sigcomp_compartment(tt, tt->tt_tports, tpn));
-    TEST_1(tp = tport_tsend(tt->tt_tports, 
-			    msg, 
-			    tpn, 
+    TEST_1(tp = tport_tsend(tt->tt_tports,
+			    msg,
+			    tpn,
 			    TPTAG_COMPARTMENT(cc),
 			    TAG_END()));
     TEST_1(tport_incref(tp)); tport_decref(&tp);
@@ -1436,9 +1436,9 @@
 
     TEST_1(!new_test_msg(tt, &msg, "tcp-sigcomp-2", 1, 3000));
     test_create_md5(tt, msg);
-    TEST_1(tp = tport_tsend(tt->tt_tports, 
-			    msg, 
-			    tt->tt_tcp_comp, 
+    TEST_1(tp = tport_tsend(tt->tt_tports,
+			    msg,
+			    tt->tt_tcp_comp,
 			    TPTAG_COMPARTMENT(cc),
 			    TAG_END()));
     TEST_1(tport_incref(tp)); tport_decref(&tp);
@@ -1447,15 +1447,15 @@
     TEST(tport_test_run(tt, 5), 1);
 
     TEST_1(!check_msg(tt, tt->tt_rmsg, "tcp-sigcomp-2"));
-    test_check_md5(tt, tt->tt_rmsg); 
+    test_check_md5(tt, tt->tt_rmsg);
 
     msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
 
     TEST_1(!new_test_msg(tt, &msg, "tcp-sigcomp-3", 1, 45500));
     test_create_md5(tt, msg);
-    TEST_1(tp = tport_tsend(tt->tt_tports, 
-			    msg, 
-			    tt->tt_tcp_comp, 
+    TEST_1(tp = tport_tsend(tt->tt_tports,
+			    msg,
+			    tt->tt_tcp_comp,
 			    TPTAG_COMPARTMENT(cc),
 			    TAG_END()));
     TEST_1(tport_incref(tp));
@@ -1476,9 +1476,9 @@
 
       TEST_1(!new_test_msg(tt, &msg, "tcp-sigcomp-4", 1, 1000));
       test_create_md5(tt, msg);
-      TEST_1(tp = tport_tsend(tt->tt_tports, 
-			      msg, 
-			      tpn, 
+      TEST_1(tp = tport_tsend(tt->tt_tports,
+			      msg,
+			      tpn,
 			      TPTAG_COMPARTMENT(cc),
 			      TPTAG_FRESH(1),
 			      TAG_END()));
@@ -1486,7 +1486,7 @@
       msg_destroy(msg);
 
       TEST(tport_test_run(tt, 5), 1);
-      
+
       TEST_1(!check_msg(tt, tt->tt_rmsg, "tcp-sigcomp-4"));
       test_check_md5(tt, tt->tt_rmsg);
       TEST_1((msg_addrinfo(tt->tt_rmsg)->ai_flags & TP_AI_COMPRESSED) == 0);
@@ -1496,14 +1496,14 @@
       TEST_1(!new_test_msg(tt, &msg, "tcp-sigcomp-5", 1, 1000));
       test_create_md5(tt, msg);
       {
-	/* Mess with internal data structures in order to 
+	/* Mess with internal data structures in order to
 	   force tport to use SigComp on this connection */
 	tp_name_t *tpn = (tp_name_t *)tport_name(rtp);
 	tpn->tpn_comp = "sigcomp";
       }
-      TEST_1(tp = tport_tsend(rtp, 
-			      msg, 
-			      tt->tt_tcp_comp, 
+      TEST_1(tp = tport_tsend(rtp,
+			      msg,
+			      tt->tt_tcp_comp,
 			      TPTAG_COMPARTMENT(cc),
 			      TAG_END()));
       TEST_1(tport_incref(tp));
@@ -1544,8 +1544,8 @@
 #endif
 
   TEST_1(mr = tport_tcreate(tt, tp_test_class, tt->tt_root, TAG_END()));
-  
-  TEST(tport_tbind(tt->tt_tports, tpn, transports, TPTAG_SERVER(1), 
+
+  TEST(tport_tbind(tt->tt_tports, tpn, transports, TPTAG_SERVER(1),
 		   STUNTAG_SERVER("999.999.999.999"),
 		   TAG_END()), -1);
 
@@ -1587,7 +1587,7 @@
   BEGIN();
 
   lst = tl_list(TSTTAG_HEADER_STR("X: Y"),
-		TAG_SKIP(2), 
+		TAG_SKIP(2),
 		TPTAG_IDENT("foo"),
 		TSTTAG_HEADER_STR("X: Y"),
 		TPTAG_IDENT("bar"),

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_client.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_client.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_client.c	Tue Dec 23 07:37:03 2008
@@ -40,7 +40,7 @@
   if (mode < 0)
      return -1;
 
-  if (blocking) 
+  if (blocking)
     mode &= ~(O_NDELAY | O_NONBLOCK);
   else
     mode |= O_NDELAY | O_NONBLOCK;
@@ -66,7 +66,7 @@
       pos += ret;
       printf("%d bytes written\n", ret);
       break;
-    
+
     case SSL_ERROR_WANT_WRITE:
       printf("want write\n");
       break;
@@ -103,7 +103,7 @@
     perror("fopen");
     exit(1);
   }
-  
+
   if (fstat(fileno(fp), &stats) < 0) {
     perror("fstat");
     exit(1);
@@ -140,7 +140,7 @@
 
     while (posBuffer < sizeof(buf)) {
       int bytes;
-      
+
       bytes = read(fileno(fp), buf + posBuffer, sizeof(buf));
 
       if (bytes == 0)
@@ -149,7 +149,7 @@
       if (bytes < 0) {
         perror("read");
       }
-      
+
       else {
         printf("writing %d buffer\n", bytes);
         tls_write_buffer(ctx, buf, bytes);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_server.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_server.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_server.c	Tue Dec 23 07:37:03 2008
@@ -60,7 +60,7 @@
   if (mode < 0)
      return -1;
 
-  if (blocking) 
+  if (blocking)
     mode &= ~(O_NDELAY | O_NONBLOCK);
   else
     mode |= O_NDELAY | O_NONBLOCK;
@@ -82,7 +82,7 @@
 
   tls_setblocking(sock, 0);
 
-  printf("socket %d registered, ctx = %p, mngr_size = %d, width = %d\n", 
+  printf("socket %d registered, ctx = %p, mngr_size = %d, width = %d\n",
          sock, ctx, mngr_size, width);
 }
 
@@ -119,7 +119,7 @@
       printf("ssl error want read\n");
       return bytes;
       break;
-      
+
     case SSL_ERROR_WANT_WRITE:
       break;
 
@@ -127,7 +127,7 @@
       printf("shutdown\n");
       tls_shutdown(ctx);
       return bytes;
-      
+
     case SSL_ERROR_SYSCALL:
       perror("tls_syscall");
       tls_shutdown(ctx);
@@ -138,7 +138,7 @@
       printf("TLS error code %d\n", err);
       return bytes;
     }
-    
+
     if (tls_pending(ctx)) {
       printf("read pending\n");
     }
@@ -162,7 +162,7 @@
   if (bytes > 0) {
     sprintf(fname, "%s%02d.txt", file_prefix, i);
     fp = fopen(fname, "a");
-  
+
     if (fp == NULL)
       perror("tls_slave_handler fopen");
 
@@ -175,7 +175,7 @@
       fclose(fp);
     }
   }
-  
+
   return 0;
 }
 
@@ -190,7 +190,7 @@
   tls_issues.master_socket = master_socket;
 
   sock = init_tls_slave(tls_issues, tls_mngr[i].ctx, &ctx_slave);
-  
+
   if (sock < 0) {
     perror("init_tls_slave");
     return -1;
@@ -245,13 +245,13 @@
 
   init_event_mngr();
 
-  if (init_tls_master(&master_socket, 
+  if (init_tls_master(&master_socket,
                       tls_issues,
                       &ctx) < 0) {
     printf("init_tls_master failed\n");
     exit (1);
   }
-  
+
   regi_sock(master_socket, ctx, tls_master_handler);
 
   for (;;) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport.c	Tue Dec 23 07:37:03 2008
@@ -108,7 +108,7 @@
 {
   if (a == b)
     return 0;
-  
+
   if (a->tp_addrlen != b->tp_addrlen)
     return (int)(a->tp_addrlen - b->tp_addrlen);
 
@@ -122,7 +122,7 @@
 
 RBTREE_PROTOS(su_inline, tprb, tport_t);
 
-RBTREE_BODIES(su_inline, tprb, tport_t, 
+RBTREE_BODIES(su_inline, tprb, tport_t,
 	      TP_LEFT, TP_RIGHT, TP_PARENT,
 	      TP_IS_RED, TP_SET_RED, TP_IS_BLACK, TP_SET_BLACK, TP_COPY_COLOR,
 	      tp_cmp, TP_INSERT, TP_REMOVE);
@@ -171,25 +171,25 @@
 /** Return true if transport is master. */
 int tport_is_master(tport_t const *self)
 {
-  return 
-    self && 
+  return
+    self &&
     self->tp_master->mr_master == self;
 }
 
 /** Return true if transport is primary. */
 int tport_is_primary(tport_t const *self)
 {
-  return 
-    self && 
+  return
+    self &&
     self->tp_pri->pri_primary == self;
 }
 
 /** Return true if transport is secondary. */
 int tport_is_secondary(tport_t const *self)
 {
-  return 
-    self && 
-    self->tp_master->mr_master != self && 
+  return
+    self &&
+    self->tp_master->mr_master != self &&
     self->tp_pri->pri_primary != self;
 }
 
@@ -204,33 +204,33 @@
 {
   return self && self->tp_addrinfo->ai_socktype == SOCK_STREAM;
 }
- 
+
 /** Test if transport is dgram. */
 int tport_is_dgram(tport_t const *self)
 {
   return self && self->tp_addrinfo->ai_socktype == SOCK_DGRAM;
 }
- 
+
 /** Test if transport is udp. */
 int tport_is_udp(tport_t const *self)
 {
   return self && self->tp_addrinfo->ai_protocol == IPPROTO_UDP;
 }
- 
+
 /** Test if transport is tcp. */
 int tport_is_tcp(tport_t const *self)
 {
   return self && self->tp_addrinfo->ai_protocol == IPPROTO_TCP;
 }
- 
+
 /** Return 1 if transport is reliable, 0 otherwise.
  *
  * (Note that this is part of external API).
  */
 int tport_is_reliable(tport_t const *self)
 {
-  return self != NULL && 
-    (self->tp_addrinfo->ai_socktype == SOCK_STREAM || 
+  return self != NULL &&
+    (self->tp_addrinfo->ai_socktype == SOCK_STREAM ||
      self->tp_addrinfo->ai_socktype == SOCK_SEQPACKET);
 }
 
@@ -248,8 +248,8 @@
 /** Return true if transport supports IPv4 */
 int tport_has_ip4(tport_t const *self)
 {
-  return self && 
-    (self->tp_addrinfo->ai_family == 0 || 
+  return self &&
+    (self->tp_addrinfo->ai_family == 0 ||
      self->tp_addrinfo->ai_family == AF_INET);
 }
 
@@ -258,8 +258,8 @@
 /** Return true if transport supports IPv6 */
 int tport_has_ip6(tport_t const *self)
 {
-  return self && 
-    (self->tp_addrinfo->ai_family == 0 || 
+  return self &&
+    (self->tp_addrinfo->ai_family == 0 ||
      self->tp_addrinfo->ai_family == AF_INET6);
 }
 #endif
@@ -277,7 +277,7 @@
   tport_primary_t *pri;
 
   if (tport_is_master(self)) {
-    for (pri = self->tp_master->mr_primaries; pri; pri = pri->pri_next) 
+    for (pri = self->tp_master->mr_primaries; pri; pri = pri->pri_next)
       if (pri->pri_updating)
 	return 1;
   }
@@ -322,8 +322,8 @@
 int tport_is_clear_to_send(tport_t const *self)
 {
   return
-    tport_is_master(self) || 
-    tport_is_primary(self) || 
+    tport_is_master(self) ||
+    tport_is_primary(self) ||
     (tport_is_secondary(self) &&
      tport_is_registered(self) &&
      self->tp_reusable &&
@@ -352,16 +352,16 @@
 /** Set IP TOS for socket */
 void tport_set_tos(su_socket_t socket, su_addrinfo_t *ai, int tos)
 {
-  if (tos >= 0 && 
-      ai->ai_family == AF_INET && 
+  if (tos >= 0 &&
+      ai->ai_family == AF_INET &&
       setsockopt(socket, IPPROTO_IP, IP_TOS, (const void*)&tos, sizeof(tos)) < 0) {
     SU_DEBUG_3(("tport: setsockopt(IP_TOS): %s\n",
 		su_strerror(su_errno())));
   }
 }
 
-static 
-tport_t *tport_connect(tport_primary_t *pri, su_addrinfo_t *ai, 
+static
+tport_t *tport_connect(tport_primary_t *pri, su_addrinfo_t *ai,
 		       tp_name_t const *tpn);
 
 static int bind6only_check(tport_master_t *mr);
@@ -370,13 +370,13 @@
 int tport_server_addrinfo(tport_master_t *mr,
 			  char const *canon,
 			  int family,
-			  char const *host, 
+			  char const *host,
 			  char const *service,
 			  char const *protocol,
 			  char const * const transports[],
 			  su_addrinfo_t **res);
 
-static int tport_get_local_addrinfo(tport_master_t *mr, 
+static int tport_get_local_addrinfo(tport_master_t *mr,
 				    char const *port,
 				    su_addrinfo_t const *hints,
 				    su_addrinfo_t **return_ai);
@@ -427,7 +427,7 @@
 static tport_primary_t *tport_alloc_primary(tport_master_t *mr,
 					    tport_vtable_t const *vtable,
 					    tp_name_t tpn[1],
-					    su_addrinfo_t *ai, 
+					    su_addrinfo_t *ai,
 					    tagi_t const *tags,
 					    char const **return_culprit);
 
@@ -445,21 +445,21 @@
 
 /* Stack class used when transports are being destroyed */
 static
-void tport_destroy_recv(tp_stack_t *stack, tport_t *tp, 
-			msg_t *msg, tp_magic_t *magic, 
+void tport_destroy_recv(tp_stack_t *stack, tport_t *tp,
+			msg_t *msg, tp_magic_t *magic,
 			su_time_t received)
 {
   msg_destroy(msg);
 }
 
 static
-void tport_destroy_error(tp_stack_t *stack, tport_t *tp, 
+void tport_destroy_error(tp_stack_t *stack, tport_t *tp,
 			 int errcode, char const *remote)
 {
 }
 
 static
-msg_t *tport_destroy_alloc(tp_stack_t *stack, int flags, 
+msg_t *tport_destroy_alloc(tp_stack_t *stack, int flags,
 			   char const data[], usize_t len,
 			   tport_t const *tp,
 			   tp_client_t *tpc)
@@ -473,7 +473,7 @@
 /** Create the master transport.
  *
  * Master transport object is used to bind the protocol using transport with
- * actual transport objects corresponding to TCP, UDP, etc. 
+ * actual transport objects corresponding to TCP, UDP, etc.
  *
  * @sa tport_tbind()
  *
@@ -483,7 +483,7 @@
  */
 tport_t *tport_tcreate(tp_stack_t *stack,
 		       tp_stack_class_t const *tpac,
-		       su_root_t *root, 
+		       su_root_t *root,
 		       tag_type_t tag, tag_value_t value, ...)
 {
   tport_master_t *mr;
@@ -547,7 +547,7 @@
 {
   tport_master_t *mr;
 
-  static tp_stack_class_t tport_destroy_tpac[1] = 
+  static tp_stack_class_t tport_destroy_tpac[1] =
     {{
 	sizeof tport_destroy_tpac,
 	/* tpac_recv */ tport_destroy_recv,
@@ -560,7 +560,7 @@
 
   if (self == NULL)
     return;
-  
+
   assert(tport_is_master(self));
   if (!tport_is_master(self))
     return;
@@ -586,7 +586,7 @@
 
 
 /** Allocate a primary transport */
-static 
+static
 tport_primary_t *tport_alloc_primary(tport_master_t *mr,
 				     tport_vtable_t const *vtable,
 				     tp_name_t tpn[1],
@@ -600,7 +600,7 @@
 
   for (next = &mr->mr_primaries; *next; next = &(*next)->pri_next)
     ;
-  
+
   assert(vtable->vtp_pri_size >= sizeof *pri);
 
   if ((pri = su_home_clone(mr->mr_home, vtable->vtp_pri_size))) {
@@ -625,9 +625,9 @@
 		(void *)pri));
   }
 
-  *next = pri; 
+  *next = pri;
   tp = pri->pri_primary;
-  
+
   if (!tp)
     *return_culprit = "alloc";
   else if (tport_set_params(tp, TAG_NEXT(tags)) < 0)
@@ -635,9 +635,9 @@
   else if (vtable->vtp_init_primary &&
 	   vtable->vtp_init_primary(pri, tpn, ai, tags, return_culprit) < 0)
     ;
-  else if (tport_setname(tp, vtable->vtp_name, ai, tpn->tpn_canon) == -1) 
+  else if (tport_setname(tp, vtable->vtp_name, ai, tpn->tpn_canon) == -1)
     *return_culprit = "tport_setname";
-  else if (tpn->tpn_ident && 
+  else if (tpn->tpn_ident &&
 	   !(tp->tp_name->tpn_ident = su_strdup(tp->tp_home, tpn->tpn_ident)))
     *return_culprit = "alloc ident";
   else
@@ -652,7 +652,7 @@
 
 
 /** Destroy a primary transport and its secondary transports. @internal */
-static 
+static
 void tport_zap_primary(tport_primary_t *pri)
 {
   tport_primary_t **prip;
@@ -695,7 +695,7 @@
 tport_primary_t *tport_listen(tport_master_t *mr,
 			      tport_vtable_t const *vtable,
 			      tp_name_t tpn[1],
-			      su_addrinfo_t *ai, 
+			      su_addrinfo_t *ai,
 			      tagi_t *tags)
 {
   tport_primary_t *pri = NULL;
@@ -739,7 +739,7 @@
       return TPORT_LISTEN_ERROR(su_errno(), "su_wait_create");
 
     /* Register receiving or accepting function with events specified above */
-    index = su_root_register(mr->mr_root, wait, tport_wakeup_pri, tp, 0); 
+    index = su_root_register(mr->mr_root, wait, tport_wakeup_pri, tp, 0);
     if (index == -1) {
       su_wait_destroy(wait);
       return TPORT_LISTEN_ERROR(su_errno(), "su_root_register");
@@ -750,7 +750,7 @@
 
   pri->pri_primary->tp_has_connection = 0;
 
-  SU_DEBUG_5(("%s(%p): %s " TPN_FORMAT "\n", 
+  SU_DEBUG_5(("%s(%p): %s " TPN_FORMAT "\n",
 	      __func__, (void *)pri, "listening at",
 	      TPN_ARGS(pri->pri_primary->tp_name)));
 
@@ -780,13 +780,13 @@
 	(IN6_IS_ADDR_V4MAPPED(&su->su_sin6.sin6_addr) ||
 	 IN6_IS_ADDR_V4COMPAT(&su->su_sin6.sin6_addr))) {
       su_sockaddr_t su0[1];
-      
+
       memcpy(su0, su, sizeof su0);
-      
+
       memset(su, 0, ai->ai_addrlen = sizeof su->su_sin);
       su->su_family = ai->ai_family = AF_INET;
       su->su_port = su0->su_port;
-      
+
 #ifndef IN6_V4MAPPED_TO_INADDR
 #define IN6_V4MAPPED_TO_INADDR(in6, in4) \
       memcpy((in4), 12 + (uint8_t *)(in6), sizeof(struct in_addr))
@@ -823,17 +823,17 @@
 
   if (self->tp_pri->pri_vtable->vtp_set_events)
     return self->tp_pri->pri_vtable->vtp_set_events(self);
-  
+
   SU_DEBUG_7(("tport_set_events(%p): events%s%s%s\n", (void *)self,
 	      (events & SU_WAIT_IN) ? " IN" : "",
 	      (events & SU_WAIT_OUT) ? " OUT" : "",
 	      SU_WAIT_CONNECT != SU_WAIT_OUT &&
 	      (events & SU_WAIT_CONNECT) ? " CONNECT" : ""));
-  
-  return 
-    su_root_eventmask(self->tp_master->mr_root, 
-		      self->tp_index, 
-		      self->tp_socket, 
+
+  return
+    su_root_eventmask(self->tp_master->mr_root,
+		      self->tp_index,
+		      self->tp_socket,
 		      self->tp_events = events);
 }
 
@@ -851,7 +851,7 @@
  *
  * @note The socket is always closed upon error.
  */
-tport_t *tport_alloc_secondary(tport_primary_t *pri, 
+tport_t *tport_alloc_secondary(tport_primary_t *pri,
 			       int socket,
 			       int accepted,
 			       char const **return_reason)
@@ -862,7 +862,7 @@
   self = su_home_clone(mr->mr_home, pri->pri_vtable->vtp_secondary_size);
 
   if (self) {
-    SU_DEBUG_7(("%s(%p): new secondary tport %p\n", 
+    SU_DEBUG_7(("%s(%p): new secondary tport %p\n",
 		__func__, (void *)pri, (void *)self));
 
     self->tp_refs = -1;			/* Freshly allocated  */
@@ -915,7 +915,7 @@
  * @param tpn   canonical name of node
  */
 static
-tport_t *tport_connect(tport_primary_t *pri, 
+tport_t *tport_connect(tport_primary_t *pri,
 		       su_addrinfo_t *ai,
 		       tp_name_t const *tpn)
 {
@@ -996,20 +996,20 @@
 
     /* Bind this socket to same IP address as the primary server socket */
     if (getsockname(server_socket, &susa.su_sa, &susalen) < 0) {
-      SU_DEBUG_3(("%s(%p): getsockname(): %s\n", 
+      SU_DEBUG_3(("%s(%p): getsockname(): %s\n",
 		  __func__, (void *)self, su_strerror(su_errno())));
     }
     else {
       susa.su_port = 0;
       if (bind(s, &susa.su_sa, susalen) < 0) {
-	SU_DEBUG_3(("%s(%p): bind(local-ip): %s\n", 
+	SU_DEBUG_3(("%s(%p): bind(local-ip): %s\n",
 		    __func__, (void *)self, su_strerror(su_errno())));
       }
     }
   }
 
   /* Set sockname for the tport */
-  if (tport_setname(self, tpn->tpn_proto, real_ai, tpn->tpn_canon) == -1) 
+  if (tport_setname(self, tpn->tpn_proto, real_ai, tpn->tpn_canon) == -1)
     TPORT_CONNECT_ERROR(su_errno(), tport_setname);
 
   /* Try to have a non-blocking connect().
@@ -1039,7 +1039,7 @@
   self->tp_index = index;
 
   if (ai == real_ai) {
-    SU_DEBUG_5(("%s(%p): %s to " TPN_FORMAT "\n", 
+    SU_DEBUG_5(("%s(%p): %s to " TPN_FORMAT "\n",
 		__func__, (void *)self, what, TPN_ARGS(self->tp_name)));
   }
   else {
@@ -1078,7 +1078,7 @@
 
   if (self->tp_msg) {
     msg_destroy(self->tp_msg), self->tp_msg = NULL;
-    SU_DEBUG_3(("%s(%p): zapped partially received message\n", 
+    SU_DEBUG_3(("%s(%p): zapped partially received message\n",
 		__func__, (void *)self));
   }
 
@@ -1088,7 +1088,7 @@
       msg_destroy(self->tp_queue[i]), self->tp_queue[i] = NULL;
       n++;
     }
-    SU_DEBUG_3(("%s(%p): zapped %lu queued messages\n", 
+    SU_DEBUG_3(("%s(%p): zapped %lu queued messages\n",
 		__func__, (void *)self, (LU)n));
   }
 
@@ -1132,7 +1132,7 @@
     return;
   if (--tp->tp_refs > 0)
     return;
-  
+
   if (!tport_is_secondary(tp))
     return;
 
@@ -1186,7 +1186,7 @@
   tpp = self->tp_params;
   ta_start(ta, tag, value);
 
-  connect = tpp->tpp_conn_orient 
+  connect = tpp->tpp_conn_orient
     /* Only dgram primary is *not* connection-oriented */
     || !tport_is_primary(self) || !tport_is_dgram(self);
 
@@ -1235,7 +1235,7 @@
   ta_list ta;
   int n, m = 0;
   tport_params_t tpp[1], *tpp0;
-  
+
   usize_t mtu;
   int connect, sdwn_error, reusable, stun_server, pong2ping;
 
@@ -1296,8 +1296,8 @@
   if (mtu > UINT_MAX)
     mtu = UINT_MAX;
   tpp->tpp_mtu = (unsigned)mtu;
-  /* Currently only primary UDP transport can *not* be connection oriented */ 
-  tpp->tpp_conn_orient = connect; 
+  /* Currently only primary UDP transport can *not* be connection oriented */
+  tpp->tpp_conn_orient = connect;
   tpp->tpp_sdwn_error = sdwn_error;
   self->tp_reusable = reusable;
   tpp->tpp_stun_server = stun_server;
@@ -1306,7 +1306,7 @@
   if (memcmp(tpp0, tpp, sizeof tpp) == 0)
     return n;
 
-  if (tport_is_secondary(self) && 
+  if (tport_is_secondary(self) &&
       self->tp_params == self->tp_pri->pri_primary->tp_params) {
     tpp0 = su_zalloc(self->tp_home, sizeof *tpp0); if (!tpp0) return -1;
     self->tp_params = tpp0;
@@ -1376,7 +1376,7 @@
 
 /**Get a vtable for given protocol */
 tport_vtable_t const *tport_vtable_by_name(char const *protoname,
-					   enum tport_via public) 
+					   enum tport_via public)
 {
   int i;
 
@@ -1392,7 +1392,7 @@
 
     assert(vtable->vtp_pri_size >= sizeof (tport_primary_t));
     assert(vtable->vtp_secondary_size >= sizeof (tport_t));
-    
+
     return vtable;
   }
 
@@ -1400,7 +1400,7 @@
 }
 
 #if 0
-tport_set_f const *tport_set_methods[TPORT_NUMBER_OF_TYPES + 1] = 
+tport_set_f const *tport_set_methods[TPORT_NUMBER_OF_TYPES + 1] =
   {
     tport_server_bind_set,
     tport_client_bind_set,
@@ -1414,7 +1414,7 @@
     NULL
   };
 
-int tport_bind_set(tport_master_t *mr, 
+int tport_bind_set(tport_master_t *mr,
 		   tp_name_t const *tpn,
 		   char const * const transports[],
 		   tagi_t const *taglist,
@@ -1448,7 +1448,7 @@
  *
  * @TAGS
  * TPTAG_SERVER(), TPTAG_PUBLIC(), TPTAG_IDENT(), TPTAG_HTTP_CONNECT(),
- * TPTAG_CERTIFICATE(), TPTAG_TLS_VERSION(), and tags used with
+ * TPTAG_CERTIFICATE(), TPTAG_TLS_VERSION(), TPTAG_TLS_VERIFY_PEER, and tags used with
  * tport_set_params(), especially TPTAG_QUEUESIZE().
  */
 int tport_tbind(tport_t *self,
@@ -1461,7 +1461,7 @@
   tp_name_t mytpn[1];
   tport_master_t *mr;
   char const *http_connect = NULL;
-  
+
   if (self == NULL || tport_is_secondary(self) ||
       tpn == NULL || transports == NULL) {
     su_seterrno(EINVAL);
@@ -1486,7 +1486,7 @@
 
   if (http_connect && public == 0)
     public = tport_type_connect;
-    
+
   if (public && public != tport_type_stun)
     server = 0;
 
@@ -1519,7 +1519,7 @@
 
   if (public == tport_type_local)
     public = tport_type_client;
-  
+
   SU_DEBUG_5(("%s(%p) to " TPN_FORMAT "\n",
 	      __func__, (void *)mr, TPN_ARGS(tpn)));
 
@@ -1531,8 +1531,8 @@
   for (i = 0; transports[i]; i++) {
     su_addrinfo_t hints[1];
     char const *proto = transports[i];
-    
-    if (strcmp(proto, tpn->tpn_proto) != 0 && 
+
+    if (strcmp(proto, tpn->tpn_proto) != 0 &&
         strcmp(tpn->tpn_proto, tpn_any) != 0)
       continue;
 
@@ -1582,7 +1582,7 @@
   bind6only_check(mr);
 
   (void)hostname;
-  
+
   SU_DEBUG_5(("%s(%p) to " TPN_FORMAT "\n",
 	      __func__, (void *)mr, TPN_ARGS(tpn)));
 
@@ -1603,7 +1603,7 @@
   if (tpn->tpn_port != NULL && strlen(tpn->tpn_port) > 0 &&
       strcmp(tpn->tpn_port, tpn_any) != 0)
     service = tpn->tpn_port;
-  else 
+  else
     service = "";
 
   if (host && (strcmp(host, "0.0.0.0") == 0 || strcmp(host, "0") == 0))
@@ -1617,7 +1617,7 @@
       (host || tpn->tpn_canon != tpn->tpn_host))
     canon = tpn->tpn_canon;
 
-  if (tport_server_addrinfo(mr, canon, family, 
+  if (tport_server_addrinfo(mr, canon, family,
 			    host, service, tpn->tpn_proto,
 			    transports, &res) < 0)
     return -1;
@@ -1628,9 +1628,9 @@
   port = port0 = port1 = ntohs(((su_sockaddr_t *)res->ai_addr)->su_port);
   error = EPROTONOSUPPORT;
 
-  /* 
-   * Loop until we can bind all the transports requested 
-   * by the transport user to the same port. 
+  /*
+   * Loop until we can bind all the transports requested
+   * by the transport user to the same port.
    */
   for (;;) {
     for (ai = res; ai; ai = ai->ai_next) {
@@ -1651,7 +1651,7 @@
       tpname->tpn_canon = canon;
       tpname->tpn_host = host;
 
-      SU_DEBUG_9(("%s(%p): calling tport_listen for %s\n", 
+      SU_DEBUG_9(("%s(%p): calling tport_listen for %s\n",
 		  __func__, (void *)mr, ai->ai_canonname));
 
       pri = tport_listen(mr, vtable, tpname, ainfo, tags);
@@ -1698,7 +1698,7 @@
     if (port == port1)		/* All ports in use! */
       break;
 
-    SU_DEBUG_3(("%s(%p): cannot bind all transports to port %u, trying %u\n", 
+    SU_DEBUG_3(("%s(%p): cannot bind all transports to port %u, trying %u\n",
 		__func__, (void *)mr, old, port));
   }
 
@@ -1728,20 +1728,20 @@
 
   s4 = su_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
   s6 = su_socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
-  
+
   memset(su, 0, sizeof *su);
   su->su_len = sulen = (sizeof su->su_sin6);
   su->su_family = AF_INET6;
-  
+
   memset(su4, 0, sizeof *su4);
   su4->su_len = su4len = (sizeof su->su_sin);
   su4->su_family = AF_INET;
-  
+
   if (bind(s6, &su->su_sa, sulen) < 0)
     ;
   else if (getsockname(s6, &su->su_sa, &sulen) < 0)
     ;
-  else if ((su4->su_port = su->su_port) != 0 && 
+  else if ((su4->su_port = su->su_port) != 0 &&
 	   bind(s4, &su4->su_sa, su4len) == 0)
     retval = 1;
 
@@ -1757,14 +1757,14 @@
 /* Number of supported transports */
 #define TPORT_N (8)
 
-/** Return list of addrinfo structures matching to 
+/** Return list of addrinfo structures matching to
  * canon/host/service/protocol
  */
 static
 int tport_server_addrinfo(tport_master_t *mr,
 			  char const *canon,
 			  int family,
-			  char const *host, 
+			  char const *host,
 			  char const *service,
 			  char const *protocol,
 			  char const * const transports[],
@@ -1775,13 +1775,13 @@
 
   *return_addrinfo = NULL;
 
-  /* 
+  /*
    * Resolve all the transports requested by the protocol
    */
   for (i = 0, N = 0; transports[i] && N < TPORT_N; i++) {
     su_addrinfo_t *ai = &hints[N];
 
-    if (strcasecmp(transports[i], protocol) != 0 && 
+    if (strcasecmp(transports[i], protocol) != 0 &&
 	strcmp(protocol, tpn_any) != 0)
       continue;
 
@@ -1795,7 +1795,7 @@
 
   if (N == 0)
     return su_seterrno(EPROTONOSUPPORT);
-  if (transports[i] /* Too many protocols */) 
+  if (transports[i] /* Too many protocols */)
     return su_seterrno(ENOMEM);
 
   hints[N - 1].ai_next = NULL;
@@ -1803,7 +1803,7 @@
   if (host) {
     int error = tport_getaddrinfo(host, service, hints, return_addrinfo);
     if (error || !*return_addrinfo) {
-      SU_DEBUG_3(("%s(%p): su_getaddrinfo(%s, %s) for %s: %s\n", 
+      SU_DEBUG_3(("%s(%p): su_getaddrinfo(%s, %s) for %s: %s\n",
 		  __func__, (void *)mr,
 		  host ? host : "\"\"", service, protocol,
 		  su_gai_strerror(error)));
@@ -1818,7 +1818,7 @@
 /** Convert localinfo into addrinfo */
 static
 int
-tport_get_local_addrinfo(tport_master_t *mr, 
+tport_get_local_addrinfo(tport_master_t *mr,
 			 char const *port,
 			 su_addrinfo_t const *hints,
 			 su_addrinfo_t **return_ai)
@@ -1855,14 +1855,14 @@
   error = su_getlocalinfo(lihints, &li_result);
   if (error) {
 #if SU_HAVE_IN6
-    SU_DEBUG_3(("%s(%p): su_getlocalinfo() for %s address: %s\n", 
-		__func__, (void *)mr, 
-		family == AF_INET6 ? "ip6" 
+    SU_DEBUG_3(("%s(%p): su_getlocalinfo() for %s address: %s\n",
+		__func__, (void *)mr,
+		family == AF_INET6 ? "ip6"
 		: family == AF_INET ? "ip4" : "ip",
 		su_gli_strerror(error)));
 #else
-    SU_DEBUG_3(("%s(%p): su_getlocalinfo() for %s address: %s\n", 
-		__func__, (void *)mr, 
+    SU_DEBUG_3(("%s(%p): su_getlocalinfo() for %s address: %s\n",
+		__func__, (void *)mr,
 		family == AF_INET ? "ip4" : "ip",
 		su_gli_strerror(error)));
 #endif
@@ -1878,7 +1878,7 @@
       ai = calloc(1, sizeof *ai + li->li_addrlen);
       if (ai == NULL)
 	break;
-    
+
       *prev = ai, prev = &ai->ai_next;
 
       ai->ai_flags = AI_PASSIVE | TP_AI_ANY;
@@ -1886,7 +1886,7 @@
       ai->ai_socktype = h->ai_socktype;
       ai->ai_protocol = h->ai_protocol;
       ai->ai_canonname = h->ai_canonname;
-      ai->ai_addr = memcpy(ai + 1, li->li_addr, 
+      ai->ai_addr = memcpy(ai + 1, li->li_addr,
 			   ai->ai_addrlen = li->li_addrlen);
       su = (void *)ai->ai_addr;
       su->su_port = htons(lport);
@@ -1924,7 +1924,7 @@
   int error = EAI_SOCKTYPE;
   int i, N;
   su_addrinfo_t *all[TPORT_N + 1]; /* Lists for all supported transports */
-  su_addrinfo_t *results[TPORT_N + 1]; 
+  su_addrinfo_t *results[TPORT_N + 1];
   void *addr;
   int addrlen;
 
@@ -1938,7 +1938,7 @@
     error = su_getaddrinfo(node, service, h, &all[N]);
     results[N] = all[N];
     if (error == EAI_SOCKTYPE) {
-      SU_DEBUG_7(("%s(): su_getaddrinfo(%s, %s) for %s: %s\n", 
+      SU_DEBUG_7(("%s(): su_getaddrinfo(%s, %s) for %s: %s\n",
 		  __func__, node ? node : "\"\"", service,
 		  h0->ai_canonname, su_gai_strerror(error)));
       continue;
@@ -1979,22 +1979,22 @@
 
 	if (memcmp(addr, a, addrlen)) /* Different address */
 	  break;
-	
+
 	results[i] = ai0->ai_next;
 
 	ai = calloc(1, sizeof *ai + ai0->ai_addrlen);
-	if (ai == NULL) 
+	if (ai == NULL)
 	  goto error;
 	*prev = memcpy(ai, ai0, sizeof *ai); prev = &ai->ai_next; *prev = NULL;
 	ai->ai_addr = memcpy(ai + 1, ai0->ai_addr, ai0->ai_addrlen);
 	ai->ai_canonname = h0->ai_canonname;
       }
     }
-  }    
+  }
 
   for (i = 0; i < N; i++)
     su_freeaddrinfo(all[i]);
-  
+
   *res = tbf;
   return 0;
 
@@ -2052,8 +2052,8 @@
   return 0;
 }
 
-/** Close a transport. 
- * 
+/** Close a transport.
+ *
  * Close the socket associated with a transport object. Report an error to
  * all pending clients, if required. Set/reset timer, too.
  */
@@ -2097,7 +2097,7 @@
 	msg_ref_destroy(self->tp_queue[i]), self->tp_queue[i] = NULL;
     }
   }
-  
+
   self->tp_index = 0;
   self->tp_events = 0;
 }
@@ -2181,7 +2181,7 @@
     tport_base_timer(self, now);
 }
 
-/** Base timer for secondary transports.  
+/** Base timer for secondary transports.
  *
  * Closes and zaps unused transports.  Sets the timer again.
  */
@@ -2190,8 +2190,8 @@
   unsigned timeout = self->tp_params->tpp_idle;
 
   if (timeout != UINT_MAX) {
-    if (self->tp_refs == 0 && 
-	self->tp_msg == NULL && 
+    if (self->tp_refs == 0 &&
+	self->tp_msg == NULL &&
 	!tport_has_queued(self) &&
 	su_time_cmp(su_time_add(self->tp_rtime, timeout), now) < 0 &&
 	su_time_cmp(su_time_add(self->tp_stime, timeout), now) < 0) {
@@ -2208,7 +2208,7 @@
   tport_set_secondary_timer(self);
 }
 
-/** Set timer for a secondary transport. 
+/** Set timer for a secondary transport.
  *
  * This function should be called after any network activity:
  * tport_base_connect(), tport_send_msg(), tport_send_queue(),
@@ -2239,7 +2239,7 @@
   }
 
   if (self->tp_params->tpp_idle != UINT_MAX) {
-    if (self->tp_refs == 0 && 
+    if (self->tp_refs == 0 &&
 	self->tp_msg == NULL && !tport_has_queued(self)) {
       if (su_time_cmp(self->tp_stime, self->tp_rtime) < 0) {
 	target = su_time_add(self->tp_rtime, self->tp_params->tpp_idle);
@@ -2322,11 +2322,11 @@
     host = "*";
   else if (!SU_SOCKADDR_INADDR_ANY(su))
     host = tport_hostport(buf, sizeof(buf), su, 0);
-  else if (canonlen && su->su_family == AF_INET && 
+  else if (canonlen && su->su_family == AF_INET &&
 	   strspn(canon, "0123456789.") == canonlen)
     host = canon;
 #if SU_HAVE_IN6
-  else if (canonlen && su->su_family == AF_INET6 && 
+  else if (canonlen && su->su_family == AF_INET6 &&
 	   strspn(canon, "0123456789abcdefABCDEF:.") == canonlen)
     host = canon;
 #endif
@@ -2340,7 +2340,7 @@
     strcpy(port, "*");
   else
     snprintf(port, sizeof(port), "%u", ntohs(su->su_port));
-  
+
   name->tpn_proto = protoname;
   name->tpn_host = host;
   name->tpn_canon = canon ? canon : host;
@@ -2359,8 +2359,8 @@
 {
   su_addrinfo_t *selfai = self->tp_addrinfo;
 
-  if (tport_convert_addr(self->tp_home, self->tp_name, 
-			 protoname, canon, 
+  if (tport_convert_addr(self->tp_home, self->tp_name,
+			 protoname, canon,
 			 (su_sockaddr_t *)ai->ai_addr) < 0)
     return -1;
 
@@ -2369,9 +2369,9 @@
 
   selfai->ai_flags = ai->ai_flags & TP_AI_MASK;
 
-  selfai->ai_family = ai->ai_family;     
-  selfai->ai_socktype = ai->ai_socktype; 
-  selfai->ai_protocol = ai->ai_protocol; 
+  selfai->ai_family = ai->ai_family;
+  selfai->ai_socktype = ai->ai_socktype;
+  selfai->ai_protocol = ai->ai_protocol;
   selfai->ai_canonname = (char *)self->tp_name->tpn_canon;
 
   if (ai->ai_addr) {
@@ -2389,10 +2389,10 @@
  *
  * @param hints hints with the protocol number and socktype [OUT]
  * @param proto protocol name [IN]
- * @param flags hint flags      
+ * @param flags hint flags
  */
 static
-int getprotohints(su_addrinfo_t *hints, 
+int getprotohints(su_addrinfo_t *hints,
 		  char const *proto,
 		  int flags)
 {
@@ -2406,7 +2406,7 @@
     proto = "tcp";
 #endif
 
-#if HAVE_SCTP  
+#if HAVE_SCTP
   if (strcasecmp(proto, "sctp") == 0) {
     hints->ai_protocol = IPPROTO_SCTP;
     hints->ai_socktype = SOCK_STREAM;
@@ -2419,7 +2419,7 @@
     hints->ai_socktype = SOCK_DGRAM;
     return 0;
   }
-  
+
   if (strcasecmp(proto, "tcp") == 0) {
     hints->ai_protocol = IPPROTO_TCP;
     hints->ai_socktype = SOCK_STREAM;
@@ -2478,7 +2478,7 @@
   if (li->li_family == AF_INET) {
     if (n >= bufsiz)
       return NULL;
-    
+
     memcpy(buf, li->li_canonname, n + 1);
   }
   else {
@@ -2488,14 +2488,14 @@
     memcpy(buf + 1, li->li_canonname, n);
     buf[0] = '['; buf[++n] = ']'; buf[++n] = '\0';
   }
-      
+
   su_freelocalinfo(li);
-  
+
   return buf;
 }
 
 /** Process errors from transport. */
-void tport_error_report(tport_t *self, int errcode, 
+void tport_error_report(tport_t *self, int errcode,
 			su_sockaddr_t const *addr)
 {
   char const *errmsg;
@@ -2532,10 +2532,10 @@
   }
   else {
     if (tport_is_primary(self))
-      SU_DEBUG_3(("%s(%p): %s (with %s)\n", __func__, (void *)self, 
+      SU_DEBUG_3(("%s(%p): %s (with %s)\n", __func__, (void *)self,
 		  errmsg, self->tp_protoname));
     else
-      SU_DEBUG_3(("%s(%p): %s (with %s/%s:%s)\n", __func__, (void *)self, 
+      SU_DEBUG_3(("%s(%p): %s (with %s/%s:%s)\n", __func__, (void *)self,
 		  errmsg, self->tp_protoname, self->tp_host, self->tp_port));
   }
 
@@ -2545,7 +2545,7 @@
 }
 
 /** Accept a new connection.
- * 
+ *
  * The function tport_accept() accepts a new connection and creates a
  * secondary transport object for the new socket.
  */
@@ -2553,7 +2553,7 @@
 {
   tport_t *self;
   su_addrinfo_t ai[1];
-  su_sockaddr_t su[1]; 
+  su_sockaddr_t su[1];
   socklen_t sulen = sizeof su;
   su_socket_t s = INVALID_SOCKET, l = pri->pri_primary->tp_socket;
   char const *reason = "accept";
@@ -2576,7 +2576,7 @@
 
   ai->ai_addr = &su->su_sa, ai->ai_addrlen = sulen;
 
-  /* Alloc a new transport object, then register socket events with it */ 
+  /* Alloc a new transport object, then register socket events with it */
   self = tport_alloc_secondary(pri, s, 1, &reason);
 
   if (self) {
@@ -2589,7 +2589,7 @@
     SU_CANONIZE_SOCKADDR(su);
 
     if (/* Create wait object with appropriate events. */
-	su_wait_create(wait, s, events) != -1 
+	su_wait_create(wait, s, events) != -1
 	/* Register socket to root */
 	&&
 	(i = su_root_register(root, wait, wakeup, self, 0)) != -1) {
@@ -2600,7 +2600,7 @@
       self->tp_events = events;
 
       if (tport_setname(self, pri->pri_protoname, ai, NULL) != -1) {
-	SU_DEBUG_5(("%s(%p): new connection from " TPN_FORMAT "\n", 
+	SU_DEBUG_5(("%s(%p): new connection from " TPN_FORMAT "\n",
 		    __func__,  (void *)self, TPN_ARGS(self->tp_name)));
 
 	tprb_append(&pri->pri_open, self);
@@ -2654,7 +2654,7 @@
   su_wait_t wait[1] =  { SU_WAIT_INIT };
 
   int error;
-  
+
   SU_DEBUG_7(("tport_connected(%p): events%s%s\n", (void *)self,
 	      events & SU_WAIT_CONNECT ? " CONNECTED" : "",
 	      events & SU_WAIT_ERR ? " ERR" : ""));
@@ -2683,7 +2683,7 @@
   self->tp_events = SU_WAIT_IN | SU_WAIT_ERR | SU_WAIT_HUP;
 
   if (su_wait_create(wait, self->tp_socket, self->tp_events) == -1 ||
-      (self->tp_index = su_root_register(mr->mr_root, 
+      (self->tp_index = su_root_register(mr->mr_root,
 					 wait, tport_wakeup, self, 0))
       == -1) {
     tport_close(self);
@@ -2709,10 +2709,10 @@
   assert(w->fd == self->tp_socket);
 #endif
 
-  SU_DEBUG_7(("%s(%p): events%s%s%s%s%s%s\n", 
+  SU_DEBUG_7(("%s(%p): events%s%s%s%s%s%s\n",
 	      "tport_wakeup_pri", (void *)self,
 	      events & SU_WAIT_IN ? " IN" : "",
-	      SU_WAIT_ACCEPT != SU_WAIT_IN && 
+	      SU_WAIT_ACCEPT != SU_WAIT_IN &&
 	      (events & SU_WAIT_ACCEPT) ? " ACCEPT" : "",
 	      events & SU_WAIT_OUT ? " OUT" : "",
 	      events & SU_WAIT_HUP ? " HUP" : "",
@@ -2735,7 +2735,7 @@
   assert(w->fd == self->tp_socket);
 #endif
 
-  SU_DEBUG_7(("%s(%p): events%s%s%s%s%s\n", 
+  SU_DEBUG_7(("%s(%p): events%s%s%s%s%s\n",
 	      "tport_wakeup", (void *)self,
 	      events & SU_WAIT_IN ? " IN" : "",
 	      events & SU_WAIT_OUT ? " OUT" : "",
@@ -2761,7 +2761,7 @@
 
   if ((events & SU_WAIT_IN) && !self->tp_closed)
     tport_recv_event(self);
-  
+
   if ((events & SU_WAIT_HUP) && !self->tp_closed)
     tport_hup_event(self);
 
@@ -2813,7 +2813,7 @@
 /** Receive data available on the socket.
  *
  * @retval -1 error
- * @retval 0  end-of-stream  
+ * @retval 0  end-of-stream
  * @retval 1  normal receive
  * @retval 2  incomplete recv, recv again
  * @retval 3  STUN keepalive, ignore
@@ -2830,7 +2830,7 @@
 void tport_recv_event(tport_t *self)
 {
   int again;
-  
+
   SU_DEBUG_7(("%s(%p)\n", "tport_recv_event", (void *)self));
 
   do {
@@ -2850,16 +2850,16 @@
       if (!su_is_blocking(error)) {
 	tport_error_report(self, error, NULL);
 	return;
-      } 
+      }
       else {
-	SU_DEBUG_3(("%s: recvfrom(): %s (%d)\n", __func__, 
+	SU_DEBUG_3(("%s: recvfrom(): %s (%d)\n", __func__,
 		    su_strerror(EAGAIN), EAGAIN));
       }
     }
 
     if (again >= 0)
       tport_parse(self, !again, self->tp_rtime);
-  } 
+  }
   while (again > 1);
 
   if (!tport_is_secondary(self))
@@ -2876,8 +2876,8 @@
   tport_set_secondary_timer(self);
 }
 
-/* 
- * Parse the data and feed complete messages to the stack 
+/*
+ * Parse the data and feed complete messages to the stack
  */
 static void tport_parse(tport_t *self, int complete, su_time_t now)
 {
@@ -2896,17 +2896,17 @@
 	tport_sigcomp_accept_incomplete(self, msg);
 	break;
       }
-    } 
+    }
 
     if (msg_get_flags(msg, MSG_FLG_TOOLARGE))
       SU_DEBUG_3(("%s(%p): too large message from " TPN_FORMAT "\n",
 		  __func__, (void *)self, TPN_ARGS(self->tp_name)));
 
     /* Do not try to read anymore from this connection? */
-    if (tport_is_stream(self) && 
+    if (tport_is_stream(self) &&
 	msg_get_flags(msg, MSG_FLG_TOOLARGE | MSG_FLG_ERROR))
       self->tp_recv_close = stall = 1;
-    
+
     if (n == -1)
       next = NULL;
     else if (streaming)
@@ -2927,7 +2927,7 @@
 
   if (self->tp_rlogged != msg)
     self->tp_rlogged = NULL;
-  
+
   self->tp_msg = msg;
 }
 
@@ -2968,7 +2968,7 @@
 #endif
 
     d->d_from->tpn_canon = ipaddr;
-    d->d_from->tpn_host = ipaddr;    
+    d->d_from->tpn_host = ipaddr;
   }
 
   d->d_comp = sc;
@@ -2987,7 +2987,7 @@
   }
 
   SU_DEBUG_7(("%s(%p): %smsg %p ("MOD_ZU" bytes)"
-	      " from " TPN_FORMAT " next=%p\n", 
+	      " from " TPN_FORMAT " next=%p\n",
 	      __func__, (void *)self, error ? "bad " : "",
 	      (void *)msg, (size_t)msg_size(msg),
 	      TPN_ARGS(d->d_from), (void *)next));
@@ -3028,7 +3028,7 @@
 {
   if (name == NULL)
     return -1;
-  
+
   if (tp == NULL || msg == NULL || msg != tp->tp_master->mr_delivery->d_msg) {
     memset(name, 0, sizeof *name);
     return -1;
@@ -3054,12 +3054,12 @@
 }
 
 /** Allocate message for N bytes,
- *  return message buffer as a iovec 
+ *  return message buffer as a iovec
  */
-ssize_t tport_recv_iovec(tport_t const *self, 
+ssize_t tport_recv_iovec(tport_t const *self,
 			 msg_t **in_out_msg,
 			 msg_iovec_t iovec[msg_n_fragments],
-			 size_t N, 
+			 size_t N,
 			 int exact)
 {
   msg_t *msg = *in_out_msg;
@@ -3072,13 +3072,13 @@
   fresh = !msg;
 
   /*
-   * Allocate a new message if needed 
+   * Allocate a new message if needed
    */
   if (!msg) {
     if (!(*in_out_msg = msg = tport_msg_alloc(self, N))) {
       SU_DEBUG_7(("%s(%p): cannot allocate msg for "MOD_ZU" bytes "
-		  "from (%s/%s:%s)\n", 
-		  __func__, (void *)self, N, 
+		  "from (%s/%s:%s)\n",
+		  __func__, (void *)self, N,
 		  self->tp_protoname, self->tp_host, self->tp_port));
       return -1;
     }
@@ -3096,8 +3096,8 @@
   if (veclen < 0) {
     int err = su_errno();
     SU_DEBUG_7(("%s(%p): cannot get msg %p buffer for "MOD_ZU" bytes "
-		"from (%s/%s:%s): %s\n", 
-		__func__, (void *)self, (void *)msg, N, 
+		"from (%s/%s:%s): %s\n",
+		__func__, (void *)self, (void *)msg, N,
 		self->tp_protoname, self->tp_host, self->tp_port,
 		su_strerror(err)));
     su_seterrno(err);
@@ -3108,8 +3108,8 @@
 
   SU_DEBUG_7(("%s(%p) msg %p from (%s/%s:%s) has "MOD_ZU" bytes, "
 	      "veclen = "MOD_ZD"\n",
-              __func__, (void *)self, 
-	      (void *)msg, self->tp_protoname, self->tp_host, self->tp_port, 
+              __func__, (void *)self,
+	      (void *)msg, self->tp_protoname, self->tp_host, self->tp_port,
 	      N, veclen));
 
   for (i = 0; veclen > 1 && i < veclen; i++) {
@@ -3130,20 +3130,20 @@
   return -1;
 }
 
-/** Send a message. 
+/** Send a message.
  *
  * The function tport_tsend() sends a message using the transport @a self.
  *
  * @TAGS
- * TPTAG_MTU(), TPTAG_REUSE(), TPTAG_CLOSE_AFTER(), TPTAG_SDWN_AFTER(), 
+ * TPTAG_MTU(), TPTAG_REUSE(), TPTAG_CLOSE_AFTER(), TPTAG_SDWN_AFTER(),
  * TPTAG_FRESH(), TPTAG_COMPARTMENT().
  */
-tport_t *tport_tsend(tport_t *self, 
-		     msg_t *msg, 
-		     tp_name_t const *_tpn, 
+tport_t *tport_tsend(tport_t *self,
+		     msg_t *msg,
+		     tp_name_t const *_tpn,
 		     tag_type_t tag, tag_value_t value, ...)
 {
-  ta_list ta; 
+  ta_list ta;
   tagi_t const *t;
   int reuse, sdwn_after, close_after, resolved = 0, fresh;
   unsigned mtu;
@@ -3160,7 +3160,7 @@
   }
 
   *tpn = *_tpn;
-  
+
   SU_DEBUG_7(("tport_tsend(%p) tpn = " TPN_FORMAT "\n",
 	      (void *)self, TPN_ARGS(tpn)));
 
@@ -3186,8 +3186,8 @@
 
   /* tl_gets() is a bit too slow here... */
   for (t = ta_args(ta); t; t = tl_next(t)) {
-    tag_type_t tt = t->t_tag; 
-    
+    tag_type_t tt = t->t_tag;
+
     if (tptag_reuse == tt)
       reuse = t->t_value != 0;
     else if (tptag_mtu == tt)
@@ -3200,7 +3200,7 @@
       fresh = t->t_value != 0;
     else if (tptag_compartment == tt)
       cc = (struct sigcomp_compartment *)t->t_value;
-  }    
+  }
 
   ta_end(ta);
 
@@ -3213,9 +3213,9 @@
   tpn->tpn_comp = tport_canonize_comp(tpn->tpn_comp);
   if (tpn->tpn_comp) {
     ai->ai_flags |= TP_AI_COMPRESSED;
-    SU_DEBUG_9(("%s: compressed msg(%p) with %s\n", 
+    SU_DEBUG_9(("%s: compressed msg(%p) with %s\n",
 		__func__, (void *)msg, tpn->tpn_comp));
-  } 
+  }
 
   if (!tpn->tpn_comp || cc == NONE)
     cc = NULL;
@@ -3233,8 +3233,8 @@
     self = self;
   }
   /*
-   * Try to find an already open connection to the destination, 
-   * or get a primary protocol 
+   * Try to find an already open connection to the destination,
+   * or get a primary protocol
    */
   else {
     /* If primary, resolve the destination address, store it in the msg */
@@ -3242,7 +3242,7 @@
       return NULL;
     }
     resolved = 1;
-    
+
     self = tport_by_addrinfo(primary, msg_addrinfo(msg), tpn);
 
     if (!self)
@@ -3258,7 +3258,7 @@
     if (tport_is_connection_oriented(self)
 	|| self->tp_params->tpp_conn_orient) {
 #if 0 && HAVE_UPNP /* We do not want to use UPnP with secondary transports! */
-      if (upnp_register_upnp_client(1) != 0) { 
+      if (upnp_register_upnp_client(1) != 0) {
 	upnp_check_for_nat();
       }
 #endif
@@ -3300,15 +3300,15 @@
   }
 
   if (self->tp_pri->pri_vtable->vtp_prepare
-      ? self->tp_pri->pri_vtable->vtp_prepare(self, msg, tpn, cc, mtu) < 0 
+      ? self->tp_pri->pri_vtable->vtp_prepare(self, msg, tpn, cc, mtu) < 0
       : tport_prepare_and_send(self, msg, tpn, cc, mtu) < 0)
     return NULL;
   else
     return self;
 }
 
-int tport_prepare_and_send(tport_t *self, msg_t *msg, 
-			   tp_name_t const *tpn, 
+int tport_prepare_and_send(tport_t *self, msg_t *msg,
+			   tp_name_t const *tpn,
 			   struct sigcomp_compartment *cc,
 			   unsigned mtu)
 {
@@ -3326,7 +3326,7 @@
   }
 
   /*
-   * If there is already an queued message, 
+   * If there is already an queued message,
    * put this message straight in the queue
    */
   if ((self->tp_queue && self->tp_queue[self->tp_qhead]) ||
@@ -3338,7 +3338,7 @@
     }
     return 0;
   }
-  
+
   retval = tport_send_msg(self, msg, tpn, cc);
 
   tport_set_secondary_timer(self);
@@ -3352,8 +3352,8 @@
  * @retval 0 when succesful
  * @retval -1 upon an error
  */
-int tport_send_msg(tport_t *self, msg_t *msg, 
-		   tp_name_t const *tpn, 
+int tport_send_msg(tport_t *self, msg_t *msg,
+		   tp_name_t const *tpn,
 		   struct sigcomp_compartment *cc)
 {
   msg_iovec_t *iov, auto_iov[40];
@@ -3364,7 +3364,7 @@
   su_time_t now;
   su_addrinfo_t *ai;
 
-  assert(self->tp_queue == NULL || 
+  assert(self->tp_queue == NULL ||
 	 self->tp_queue[self->tp_qhead] == NULL ||
 	 self->tp_queue[self->tp_qhead] == msg);
 
@@ -3378,7 +3378,7 @@
   /* Get a iovec for message contents */
   for (;;) {
     iovused = msg_iovec(msg, iov, iovlen);
-    if (iovused <= iovlen) 
+    if (iovused <= iovlen)
       break;
 
     iov = su_realloc(self->tp_home, self->tp_iov, sizeof(*iov) * iovused);
@@ -3387,7 +3387,7 @@
       msg_set_errno(msg, errno);
       return -1;
     }
-    
+
     self->tp_iov = iov, self->tp_iovlen = iovlen = iovused;
   }
 
@@ -3404,7 +3404,7 @@
   n = (size_t)nerror;
 
   self->tp_unsent = NULL, self->tp_unsentlen = 0;
-  
+
   if (n > 0 && self->tp_master->mr_log && self->tp_slogged != msg) {
     tport_log_msg(self, msg, "send", "to", now);
     self->tp_slogged = msg;
@@ -3422,8 +3422,8 @@
       }
       else {
 	char const *comp = tpn->tpn_comp;
-	
-	SU_DEBUG_1(("%s(%p): send truncated for %s/%s:%s%s%s\n", 
+
+	SU_DEBUG_1(("%s(%p): send truncated for %s/%s:%s%s%s\n",
 		    "tport_vsend", (void *)self, tpn->tpn_proto, tpn->tpn_host, tpn->tpn_port,
 		    comp ? ";comp=" : "", comp ? comp : ""));
 
@@ -3448,18 +3448,18 @@
 
   if (close_after || sdwn_after)
     tport_shutdown0(self, close_after ? 2 : 1);
-  
+
   return 0;
 }
 
-static 
-ssize_t tport_vsend(tport_t *self, 
-		    msg_t *msg, 
+static
+ssize_t tport_vsend(tport_t *self,
+		    msg_t *msg,
 		    tp_name_t const *tpn,
-		    msg_iovec_t iov[], 
+		    msg_iovec_t iov[],
 		    size_t iovused,
 		    struct sigcomp_compartment *cc)
-{ 
+{
   ssize_t n;
   su_addrinfo_t *ai = msg_addrinfo(msg);
 
@@ -3474,14 +3474,14 @@
   if (n == 0)
     return 0;
 
-  if (n == -1) 
+  if (n == -1)
     return tport_send_error(self, msg, tpn, "tport_vsend");
 
   tport_sent_bytes(self, n, n);	/* Sigcomp will decrease on_line accodingly */
 
   if (n > 0 && self->tp_master->mr_dump_file)
     tport_dump_iovec(self, msg, n, iov, iovused, "sent", "to");
-    
+
   if (tport_log->log_level >= 7) {
     size_t i, m = 0;
 
@@ -3490,10 +3490,10 @@
 
     if (tpn == NULL || tport_is_connection_oriented(self))
       tpn = self->tp_name;
-    
-    SU_DEBUG_7(("%s(%p): "MOD_ZU" bytes of "MOD_ZU" to %s/%s:%s%s\n", 
-		"tport_vsend", (void *)self, n, m, tpn->tpn_proto, tpn->tpn_host, 
-		tpn->tpn_port, 
+
+    SU_DEBUG_7(("%s(%p): "MOD_ZU" bytes of "MOD_ZU" to %s/%s:%s%s\n",
+		"tport_vsend", (void *)self, n, m,
+		self->tp_name->tpn_proto, tpn->tpn_host, tpn->tpn_port,
 		(ai->ai_flags & TP_AI_COMPRESSED) ? ";comp=sigcomp" : ""));
   }
 
@@ -3513,8 +3513,8 @@
   if (su_is_blocking(error)) {
     su_addrinfo_t *ai = msg_addrinfo(msg);
     char const *comp = (ai->ai_flags & TP_AI_COMPRESSED) ? ";comp=sigcomp" : "";
-    SU_DEBUG_5(("%s(%p): %s with (s=%d %s/%s:%s%s)\n", 
-		who, (void *)self, "EAGAIN", (int)self->tp_socket, 
+    SU_DEBUG_5(("%s(%p): %s with (s=%d %s/%s:%s%s)\n",
+		who, (void *)self, "EAGAIN", (int)self->tp_socket,
 		tpn->tpn_proto, tpn->tpn_host, tpn->tpn_port, comp));
     return 0;
   }
@@ -3532,10 +3532,10 @@
   char const *comp = (ai->ai_flags & TP_AI_COMPRESSED) ? ";comp=sigcomp" : "";
 
   int error = msg_errno(msg);
-  
+
   if (self->tp_addrinfo->ai_family == AF_INET) {
-    SU_DEBUG_3(("%s(%p): %s with (s=%d %s/%s:%s%s)\n", 
-		who, (void *)self, su_strerror(error), (int)self->tp_socket, 
+    SU_DEBUG_3(("%s(%p): %s with (s=%d %s/%s:%s%s)\n",
+		who, (void *)self, su_strerror(error), (int)self->tp_socket,
 		tpn->tpn_proto, tpn->tpn_host, tpn->tpn_port, comp));
   }
 #if SU_HAVE_IN6
@@ -3543,21 +3543,21 @@
     su_sockaddr_t const *su = (su_sockaddr_t const *)ai->ai_addr;
     SU_DEBUG_3(("%s(%p): %s with (s=%d, IP6=%s/%s:%s%s"
 		" (scope=%i) addrlen=%u)\n",
-		who, (void *)self, su_strerror(error), (int)self->tp_socket, 
+		who, (void *)self, su_strerror(error), (int)self->tp_socket,
 		tpn->tpn_proto, tpn->tpn_host, tpn->tpn_port, comp,
 		su->su_scope_id, (unsigned)ai->ai_addrlen));
   }
 #endif
   else {
-    SU_DEBUG_3(("%s(%p): %s with (s=%d, AF=%u addrlen=%u)%s\n", 
-		who, (void *)self, su_strerror(error), 
+    SU_DEBUG_3(("%s(%p): %s with (s=%d, AF=%u addrlen=%u)%s\n",
+		who, (void *)self, su_strerror(error),
 		(int)self->tp_socket, ai->ai_family, (unsigned)ai->ai_addrlen, comp));
   }
 
 #if 0
   int i;
   for (i = 0; i < iovused; i++)
-    SU_DEBUG_7(("\t\tiov[%d] = { %d bytes @ %p }\n", 
+    SU_DEBUG_7(("\t\tiov[%d] = { %d bytes @ %p }\n",
 		i, iov[i].siv_len, (void *)iov[i].siv_base));
 #endif
 
@@ -3572,16 +3572,16 @@
 
 
 static
-int tport_queue_rest(tport_t *self, 
-		     msg_t *msg, 
-		     msg_iovec_t iov[], 
+int tport_queue_rest(tport_t *self,
+		     msg_t *msg,
+		     msg_iovec_t iov[],
 		     size_t iovused)
 {
   size_t iovlen = self->tp_iovlen;
 
   assert(tport_is_connection_oriented(self));
-  assert(self->tp_queue == NULL || 
-	 self->tp_queue[self->tp_qhead] == NULL || 
+  assert(self->tp_queue == NULL ||
+	 self->tp_queue[self->tp_qhead] == NULL ||
 	 self->tp_queue[self->tp_qhead] == msg);
 
   if (tport_queue(self, msg) < 0)
@@ -3618,19 +3618,19 @@
   return 0;
 }
 
-/** Queue a message to transport. 
+/** Queue a message to transport.
  *
  * The tport_tqueue() function queues a message in the send queue. It is
  * used by an (server) application that is required to send (response)
  * messages in certain order. For example, a HTTP server or proxy may
  * receive multiple requests from a single TCP connection. The server is
- * required to answer to the requests in same order as they are received. 
+ * required to answer to the requests in same order as they are received.
  * The responses are, however, sometimes generated asynchronously, that is,
  * a response to a later request may be ready earlier. For that purpose, the
  * HTTP protocol stack queues an empty response message immediately upon
  * receiving a request. Other messages cannot be sent before the queued one.
  *
- * The function tport_tqsend() is used to send the completed response message. 
+ * The function tport_tqsend() is used to send the completed response message.
  *
  * @param self pointer to transport object
  * @param msg  message to be inserted into queue
@@ -3651,7 +3651,7 @@
  *
  * @sa tport_tqsend()
  */
-int tport_tqueue(tport_t *self, msg_t *msg, 
+int tport_tqueue(tport_t *self, msg_t *msg,
 		 tag_type_t tag, tag_value_t value, ...)
 {
   msg_unprepare(msg);
@@ -3679,8 +3679,8 @@
 {
   unsigned short qhead = self->tp_qhead;
   unsigned short N = self->tp_params->tpp_qsize;
-  
-  SU_DEBUG_7(("tport_queue(%p): queueing %p for %s/%s:%s\n", 
+
+  SU_DEBUG_7(("tport_queue(%p): queueing %p for %s/%s:%s\n",
 	      (void *)self, (void *)msg,
 	      self->tp_protoname, self->tp_host, self->tp_port));
 
@@ -3711,8 +3711,8 @@
 }
 
 /** Send a queued message (and queue another, if required).
- * 
- * The function tport_tqsend() sends a message to the transport. 
+ *
+ * The function tport_tqsend() sends a message to the transport.
  *
  * @deprecated Alternative interface will be provided in near future.
  */
@@ -3787,7 +3787,7 @@
       msg_destroy(self->tp_queue[qhead]);
       if ((self->tp_queue[qhead] = msg_ref_create(next)))
 	msg_unprepare(next);
-      return 0; 
+      return 0;
     }
   }
 
@@ -3808,7 +3808,7 @@
     qhead = (qhead + 1) % N;
     next = self->tp_queue[qhead]; self->tp_queue[qhead] = msg; msg = next;
     /* Above we made sure that there is an empty slot */
-    assert(!next || qhead != self->tp_qhead); 
+    assert(!next || qhead != self->tp_qhead);
   } while (next);
 
   return 0;
@@ -3817,12 +3817,12 @@
 /** Send event.
  *
  * Process SU_WAIT_OUT event.
- */ 
+ */
 void tport_send_event(tport_t *self)
 {
   assert(tport_is_connection_oriented(self));
-  
-  SU_DEBUG_7(("tport_send_event(%p) - ready to send to (%s/%s:%s)\n", 
+
+  SU_DEBUG_7(("tport_send_event(%p) - ready to send to (%s/%s:%s)\n",
 	      (void *)self, self->tp_protoname, self->tp_host, self->tp_port));
   tport_send_queue(self);
   tport_set_secondary_timer(self);
@@ -3859,7 +3859,7 @@
       tport_log_msg(self, msg, "send", "to", self->tp_stime);
       self->tp_slogged = msg;
     }
-    
+
     for (i = 0, total = 0; i < iovused; i++) {
       if (total + (size_t)iov[i].mv_len > n) {
 	iov[i].mv_len -= (su_ioveclen_t)(n - total);
@@ -3875,7 +3875,7 @@
     assert(total == n);
 
     /* We have sent a complete message */
-    
+
     self->tp_queue[qhead] = NULL;
     tport_sent_message(self, msg, 0);
     msg_destroy(msg);
@@ -3885,7 +3885,7 @@
 
   while (msg_is_prepared(msg = self->tp_queue[self->tp_qhead = qhead])) {
     /* XXX - what about errors? */
-    tport_send_msg(self, msg, self->tp_name, NULL); 
+    tport_send_msg(self, msg, self->tp_name, NULL);
     if (self->tp_unsent)
       return;
 
@@ -3917,7 +3917,7 @@
   if (host_is_ip_address(tpn->tpn_host))
     hints->ai_flags |= AI_NUMERICHOST;
 #endif
-  
+
   if (tpn->tpn_host[0] == '[') {
     /* Remove [] around IPv6 address */
     char *end;
@@ -3934,7 +3934,7 @@
       return -1;
     }
   }
-  else 
+  else
     host = tpn->tpn_host;
 
   if ((error = su_getaddrinfo(host, tpn->tpn_port, hints, &res))) {
@@ -3950,13 +3950,13 @@
   su = (su_sockaddr_t *) msg_addrinfo(msg)->ai_addr;
 
 #if SU_HAVE_IN6
-  SU_DEBUG_9(("tport_resolve addrinfo = %s%s%s:%d\n", 
+  SU_DEBUG_9(("tport_resolve addrinfo = %s%s%s:%d\n",
 	      su->su_family == AF_INET6 ? "[" : "",
               su_inet_ntop(su->su_family, SU_ADDR(su), ipaddr, sizeof(ipaddr)),
 	      su->su_family == AF_INET6 ? "]" : "",
               htons(su->su_port)));
 #else
-  SU_DEBUG_9(("tport_resolve addrinfo = %s%s%s:%d\n", 
+  SU_DEBUG_9(("tport_resolve addrinfo = %s%s%s:%d\n",
 	      "",
               su_inet_ntop(su->su_family, SU_ADDR(su), ipaddr, sizeof(ipaddr)),
 	      "",
@@ -4003,7 +4003,7 @@
   }
 
   msg_set_errno(msg, EAFNOSUPPORT);
-   
+
   return -1;
 }
 
@@ -4021,7 +4021,7 @@
   mai->ai_flags = flags;
 }
 
-/** Process error event. 
+/** Process error event.
  *
  * Return events that can be processed afterwards.
  */
@@ -4052,9 +4052,9 @@
  *
  * @return Positive integer, or -1 upon an error.
  */
-int tport_pend(tport_t *self, 
-	       msg_t *msg, 
-	       tport_pending_error_f *callback, 
+int tport_pend(tport_t *self,
+	       msg_t *msg,
+	       tport_pending_error_f *callback,
 	       tp_client_t *client)
 {
   tport_pending_t *pending;
@@ -4065,8 +4065,8 @@
   if (msg == NULL && tport_is_primary(self))
     return -1;
 
-  SU_DEBUG_7(("tport_pend(%p): pending %p for %s/%s:%s (already %u)\n", 
-	      (void *)self, (void *)msg, 
+  SU_DEBUG_7(("tport_pend(%p): pending %p for %s/%s:%s (already %u)\n",
+	      (void *)self, (void *)msg,
 	      self->tp_protoname, self->tp_host, self->tp_port,
 	      self->tp_pused));
 
@@ -4074,7 +4074,7 @@
     unsigned i, len = 8;
     if (self->tp_plen)
       len = 2 * self->tp_plen;
-    pending = su_realloc(self->tp_home, 
+    pending = su_realloc(self->tp_home,
 			 self->tp_pending, len * sizeof(*pending));
     if (!pending) {
       msg_set_errno(msg, errno);
@@ -4085,7 +4085,7 @@
 
     for (i = self->tp_plen; i + 1 < len; i++)
       pending[i].p_client = pending + i + 1;
-      
+
     self->tp_released = pending + self->tp_plen;
     self->tp_pending = pending;
     self->tp_plen = len;
@@ -4105,11 +4105,11 @@
 }
 
 /** Mark message as no more pending */
-int tport_release(tport_t *self, 
+int tport_release(tport_t *self,
 		  int pendd,
-		  msg_t *msg, 
-		  msg_t *reply, 
-		  tp_client_t *client, 
+		  msg_t *msg,
+		  msg_t *reply,
+		  tp_client_t *client,
 		  int still_pending)
 {
   tport_pending_t *pending;
@@ -4119,14 +4119,14 @@
 
   pending = self->tp_pending + (pendd - 1);
 
-  if (pending->p_client != client || 
+  if (pending->p_client != client ||
       pending->p_msg != msg) {
 	  SU_DEBUG_1(("%s(%p): %u %p by %p not pending\n",
-		      __func__, (void *)self, 
+		      __func__, (void *)self,
 		      pendd, (void *)msg, (void *)client));
     return su_seterrno(EINVAL), -1;
   }
-  
+
   SU_DEBUG_7(("%s(%p): %p by %p with %p%s\n",
 	      __func__, (void *)self,
 	      (void *)msg, (void *)client, (void *)reply,
@@ -4136,7 +4136,7 @@
 
   if (still_pending)
     return 0;
-	    
+
   /* Just to make sure nobody uses stale data */
   memset(pending, 0, sizeof(*pending));
   pending->p_client = self->tp_released;
@@ -4213,11 +4213,11 @@
   for (i = 0; i < self->tp_plen; i++) {
     pending = self->tp_pending + i;
 
-    if (!pending->p_client || 
+    if (!pending->p_client ||
 	pending->p_msg != msg ||
 	pending->p_reported == reported)
       continue;
-    
+
     pending->p_reported = reported;
 
     pending->p_callback(self->TP_STACK, pending->p_client, self, msg, error);
@@ -4299,14 +4299,14 @@
   return self->tp_name;
 }
 
-/** Get transport identifier. */ 
+/** Get transport identifier. */
 char const *tport_ident(tport_t const *self)
 {
   return self ? self->tp_ident : NULL;
 }
 
 /** Get transport by protocol name. */
-tport_t *tport_by_protocol(tport_t const *self, char const *proto) 
+tport_t *tport_by_protocol(tport_t const *self, char const *proto)
 {
   if (proto && strcmp(proto, tpn_any) != 0) {
     for (; self; self = tport_next(self))
@@ -4340,7 +4340,7 @@
 #endif
   else if (host_is_ip4_address(tpn->tpn_host))
     family = AF_INET;
-  else 
+  else
     family = 0;
 
   if (proto && strcmp(proto, tpn_any) == 0)
@@ -4366,7 +4366,7 @@
     }
     if (proto && strcasecmp(proto, tp->tp_protoname))
       continue;
-    
+
     if (comp && comp != tp->tp_name->tpn_comp) {
       if (tp->tp_name->tpn_comp == NULL && nocomp == NULL)
 	nocomp = self;
@@ -4436,7 +4436,7 @@
     }
 
     su->su_port = htons(strtoul(port, NULL, 10));
-    
+
     if (su_inet_pton(su->su_family, host, SU_ADDR(su)) > 0) {
       resolved = 1;
       next = NULL;
@@ -4511,7 +4511,7 @@
 }
 
 /** Get transport from primary by addrinfo. */
-tport_t *tport_by_addrinfo(tport_primary_t const *pri, 
+tport_t *tport_by_addrinfo(tport_primary_t const *pri,
 			   su_addrinfo_t const *ai,
 			   tp_name_t const *tpn)
 {
@@ -4530,7 +4530,7 @@
 
   /* Find leftmost (prevmost) matching tport */
   while (sub) {
-    cmp = (int)(sub->tp_addrlen - ai->ai_addrlen); 
+    cmp = (int)(sub->tp_addrlen - ai->ai_addrlen);
     if (cmp == 0)
       cmp = memcmp(sub->tp_addr, sa, ai->ai_addrlen);
 
@@ -4566,8 +4566,8 @@
 
     if (comp != sub->tp_name->tpn_comp)
       continue;
-    
-    if (sub->tp_addrlen != ai->ai_addrlen 
+
+    if (sub->tp_addrlen != ai->ai_addrlen
 	|| memcmp(sub->tp_addr, sa, ai->ai_addrlen)) {
       sub = NULL;
       break;
@@ -4587,7 +4587,7 @@
 
 
 /** Get transport name from URL. */
-int tport_name_by_url(su_home_t *home, 
+int tport_name_by_url(su_home_t *home,
 		      tp_name_t *tpn,
 		      url_string_t const *us)
 {
@@ -4652,7 +4652,7 @@
  * @retval 0 when successful
  * @retval -1 upon an error
  */
-int tport_name_dup(su_home_t *home, 
+int tport_name_dup(su_home_t *home,
 		   tp_name_t *dst,
 		   tp_name_t const *src)
 {
@@ -4662,7 +4662,7 @@
   if (!src->tpn_proto || !src->tpn_host || !src->tpn_port || !src->tpn_canon)
     return -1;
 
-  if (strcmp(src->tpn_proto, tpn_any)) 
+  if (strcmp(src->tpn_proto, tpn_any))
     n_proto = strlen(src->tpn_proto) + 1;
   else
     n_proto = 0;
@@ -4701,12 +4701,12 @@
     dst->tpn_comp = memcpy(s, src->tpn_comp, n_comp), s += n_comp;
   else
     dst->tpn_comp = NULL;
-  
+
   return 0;
 }
 
 /** Convert a sockaddr structure into printable form. */
-char *tport_hostport(char buf[], isize_t bufsize, 
+char *tport_hostport(char buf[], isize_t bufsize,
 		     su_sockaddr_t const *su,
 		     int with_port_and_brackets)
 {
@@ -4715,13 +4715,13 @@
 
 #if SU_HAVE_IN6
   if (with_port_and_brackets > 1 || su->su_family == AF_INET6) {
-    *b++ = '['; bufsize--; 
+    *b++ = '['; bufsize--;
   }
 #endif
 
   if (su_inet_ntop(su->su_family, SU_ADDR(su), b, bufsize) == NULL)
     return NULL;
-  n = strlen(b); 
+  n = strlen(b);
   if (bufsize < n + 2)
     return NULL;
 
@@ -4729,7 +4729,7 @@
 
 #if SU_HAVE_IN6
   if (with_port_and_brackets > 1 || su->su_family == AF_INET6) {
-    *b++ = ']'; bufsize--; 
+    *b++ = ']'; bufsize--;
   }
   if (with_port_and_brackets) {
     unsigned short port = ntohs(su->su_port);
@@ -4737,7 +4737,7 @@
       n = snprintf(b, bufsize, ":%u", port);
       if (n <= 0)
         return NULL;
-      b += n; 
+      b += n;
       if (bufsize > n)
         bufsize -= n;
       else

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport.docs	Tue Dec 23 07:37:03 2008
@@ -100,7 +100,7 @@
 retransmitted, application can receive it later than a data chunk that
 was sent after lost one but did not need any retransmissions.
 
- at subsection tp_magic Transport Magic 
+ at subsection tp_magic Transport Magic
 
 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
@@ -142,7 +142,7 @@
 
 @note While the reference counting has been implemented in the tport
 module, the transport objects are not destroyed by timers by default as
-all the protocol stacks do @b not properly handle the reference counting. 
+all the protocol stacks do @b not properly handle the reference counting.
 Timers are activated when the tag TPTAG_IDLE() is used.
 
 @subsection tp_pend Pending Requests
@@ -183,11 +183,11 @@
 activate message logging within @b tport module.
 <dl compact>
 <dt>@b #TPORT_LOG
-   <dd>if set, tport module prints out the message contents 
+   <dd>if set, tport module prints out the message contents
        after parsing
 <dt>@b #TPORT_DUMP
    <dd>contains dump file name - incoming data is written
-       dump file @e before parsing 
+       dump file @e before parsing
 <dt>@b #TPORT_DEBUG
    <dd>integer in range -1..9 controlling amount of
        debugging printout from @b tport module. See also #tport_log.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h	Tue Dec 23 07:37:03 2008
@@ -136,21 +136,21 @@
   ssize_t             tp_refs;		/**< Number of references to tport */
 
   unsigned            tp_black:1;       /**< Used by red-black-tree */
-  
+
   unsigned            tp_accepted:1;    /**< Originally server? */
   unsigned            tp_conn_orient:1;	/**< Is connection-oriented */
   unsigned            tp_has_connection:1; /**< Has real connection */
   unsigned            tp_reusable:1;    /**< Can this connection be reused */
   unsigned            tp_closed : 1;
   /**< This transport is closed.
-   * 
+   *
    * A closed transport is inserted into pri_closed list.
    */
 
   /** Remote end has sent FIN (2) or we should not just read */
   unsigned            tp_recv_close:2;
   /** We will send FIN (1) or have sent FIN (2) */
-  unsigned            tp_send_close:2; 
+  unsigned            tp_send_close:2;
   unsigned            tp_has_keepalive:1;
   unsigned            tp_has_stun_server:1;
   unsigned            tp_trunc:1;
@@ -172,7 +172,7 @@
   su_time_t           tp_ptime;	        /**< Ping sent */
 
   tp_name_t           tp_name[1];	/**< Transport name.
-					 * 
+					 *
 					 * This is either our name (if primary)
 					 * or peer name (if secondary).
 					 */
@@ -205,7 +205,7 @@
   unsigned            tp_pused;         /**< Used pends */
   tport_pending_t    *tp_pending;       /**< Pending requests */
   tport_pending_t    *tp_released;      /**< Released pends */
-  
+
   /* ==== Send queue ===================================================== */
 
   msg_t             **tp_queue;		/**< Messages being sent */
@@ -225,7 +225,7 @@
   tport_compressor_t *tp_comp;
 
   /* ==== Statistics  ===================================================== */
-  
+
   struct {
     uint64_t sent_msgs, sent_errors, sent_bytes, sent_on_line;
     uint64_t recv_msgs, recv_errors, recv_bytes, recv_on_line;
@@ -244,9 +244,9 @@
 #endif
   tport_vtable_t const
                      *pri_vtable;
-  int                 pri_public;       /**< Type of primary transport; 
+  int                 pri_public;       /**< Type of primary transport;
 					 * tport_type_local,
-					 * tport_type_stun, etc. 
+					 * tport_type_stun, etc.
 					 */
 
   tport_primary_t    *pri_next;	        /**< Next primary tport */
@@ -276,20 +276,20 @@
   int                 mr_stun_step_ready; /**< for stun's callback */
 
   tp_stack_t  	     *mr_stack;         /**< Transport consumer */
-  tp_stack_class_t 
+  tp_stack_class_t
                const *mr_tpac;		/**< Methods provided by stack */
   int                 mr_log;	        /**< Do logging of parsed messages */
   su_root_t    	     *mr_root;		/**< SU root pointer */
 
   /**< Timer reclaiming unused connections and compartment */
-  su_timer_t         *mr_timer;		
+  su_timer_t         *mr_timer;
   /** FILE to dump received and sent data */
-  FILE               *mr_dump_file;	
+  FILE               *mr_dump_file;
   char               *mr_dump;	/**< Filename for dumping received/sent data */
   tport_primary_t    *mr_primaries;        /**< List of primary contacts */
 
   tport_params_t      mr_params[1];
-  
+
   unsigned            mr_boundserver:1; /**< Server has been bound */
   unsigned            mr_bindv6only:1; /**< We can bind separately to IPv6/4 */
   unsigned :0;
@@ -340,7 +340,7 @@
 			  char const **return_culprit);
   void (*vtp_deinit_primary)(tport_primary_t *pri);
   int (*vtp_wakeup_pri)(tport_primary_t *pri, int events);
-  tport_t *(*vtp_connect)(tport_primary_t *pri, su_addrinfo_t *ai, 
+  tport_t *(*vtp_connect)(tport_primary_t *pri, su_addrinfo_t *ai,
 			  tp_name_t const *tpn);
 
   size_t vtp_secondary_size;	/* Size of secondary tport */
@@ -355,8 +355,8 @@
   ssize_t (*vtp_send)(tport_t const *self, msg_t *msg,
 		      msg_iovec_t iov[], size_t iovused);
   void (*vtp_deliver)(tport_t *self,  msg_t *msg, su_time_t now);
-  int (*vtp_prepare)(tport_t *self, msg_t *msg, 
-		     tp_name_t const *tpn, 
+  int (*vtp_prepare)(tport_t *self, msg_t *msg,
+		     tp_name_t const *tpn,
 		     struct sigcomp_compartment *cc,
 		     unsigned mtu);
   int (*vtp_keepalive)(tport_t *self, su_addrinfo_t const *ai,
@@ -364,7 +364,7 @@
   int (*vtp_stun_response)(tport_t const *self,
 			   void *msg, size_t msglen,
 			   void *addr, socklen_t addrlen);
-  int (*vtp_next_secondary_timer)(tport_t *self, su_time_t *, 
+  int (*vtp_next_secondary_timer)(tport_t *self, su_time_t *,
 				  char const **return_why);
   void (*vtp_secondary_timer)(tport_t *self, su_time_t);
 };
@@ -391,12 +391,12 @@
 
 void tport_set_tos(su_socket_t socket, su_addrinfo_t *ai, int tos);
 
-tport_t *tport_base_connect(tport_primary_t *pri, 
+tport_t *tport_base_connect(tport_primary_t *pri,
 			    su_addrinfo_t *ai,
 			    su_addrinfo_t *name,
 			    tp_name_t const *tpn);
 
-int tport_stream_init_primary(tport_primary_t *pri, 
+int tport_stream_init_primary(tport_primary_t *pri,
 			      su_socket_t socket,
 			      tp_name_t tpn[1],
 			      su_addrinfo_t *ai,
@@ -427,36 +427,36 @@
 void tport_send_event(tport_t *self);
 void tport_hup_event(tport_t *self);
 
-ssize_t tport_recv_iovec(tport_t const *self, 
+ssize_t tport_recv_iovec(tport_t const *self,
 			 msg_t **mmsg,
-			 msg_iovec_t iovec[msg_n_fragments], size_t N, 
+			 msg_iovec_t iovec[msg_n_fragments], size_t N,
 			 int exact);
 
 msg_t *tport_msg_alloc(tport_t const *self, usize_t size);
 
-int tport_prepare_and_send(tport_t *self, msg_t *msg, 
-			   tp_name_t const *tpn, 
+int tport_prepare_and_send(tport_t *self, msg_t *msg,
+			   tp_name_t const *tpn,
 			   struct sigcomp_compartment *cc,
 			   unsigned mtu);
-int tport_send_msg(tport_t *self, msg_t *msg, 
-		   tp_name_t const *tpn, 
+int tport_send_msg(tport_t *self, msg_t *msg,
+		   tp_name_t const *tpn,
 		   struct sigcomp_compartment *cc);
 
 void tport_send_queue(tport_t *self);
 
-void tport_deliver(tport_t *self, msg_t *msg, msg_t *next, 
+void tport_deliver(tport_t *self, msg_t *msg, msg_t *next,
 		   tport_compressor_t *comp,
 		   su_time_t now);
 void tport_base_deliver(tport_t *self, msg_t *msg, su_time_t now);
 
 int tport_recv_error_report(tport_t *self);
-void tport_error_report(tport_t *self, int errcode, 
+void tport_error_report(tport_t *self, int errcode,
 			su_sockaddr_t const *addr);
 
 int tport_open_log(tport_master_t *mr, tagi_t *tags);
-void tport_log_msg(tport_t *tp, msg_t *msg, char const *what, 
+void tport_log_msg(tport_t *tp, msg_t *msg, char const *what,
 		   char const *via, su_time_t now);
-void tport_dump_iovec(tport_t const *self, msg_t *msg, 
+void tport_dump_iovec(tport_t const *self, msg_t *msg,
 		      size_t n, su_iovec_t const iov[], size_t iovused,
 		      char const *what, char const *how);
 
@@ -466,9 +466,9 @@
 extern tport_vtable_t const tport_udp_vtable;
 extern tport_vtable_t const tport_udp_client_vtable;
 
-int tport_udp_init_primary(tport_primary_t *, 
-			   tp_name_t tpn[1], 
-			   su_addrinfo_t *, 
+int tport_udp_init_primary(tport_primary_t *,
+			   tp_name_t tpn[1],
+			   su_addrinfo_t *,
 			   tagi_t const *,
 			   char const **return_culprit);
 void tport_udp_deinit_primary(tport_primary_t *);
@@ -480,12 +480,12 @@
 extern tport_vtable_t const tport_tcp_vtable;
 extern tport_vtable_t const tport_tcp_client_vtable;
 
-int tport_tcp_init_primary(tport_primary_t *, 
- 			  tp_name_t  tpn[1], 
+int tport_tcp_init_primary(tport_primary_t *,
+ 			  tp_name_t  tpn[1],
  			  su_addrinfo_t *, tagi_t const *,
  			  char const **return_culprit);
-int tport_tcp_init_client(tport_primary_t *, 
- 			 tp_name_t tpn[1], 
+int tport_tcp_init_client(tport_primary_t *,
+ 			 tp_name_t tpn[1],
  			 su_addrinfo_t *, tagi_t const *,
  			 char const **return_culprit);
 int tport_tcp_init_secondary(tport_t *self, int socket, int accepted,
@@ -518,7 +518,7 @@
   int tpd_is_client_only;
 } tport_descriptor_t;
 
-typedef int const *(tport_set_f)(tport_master_t *mr, 
+typedef int const *(tport_set_f)(tport_master_t *mr,
 				 tp_name_t const *tpn,
 				 tagi_t const *taglist,
 				 tport_descriptor_t **return_set,
@@ -566,8 +566,8 @@
 			  socklen_t fromlen);
 
 ssize_t tport_send_comp(tport_t const *self,
-		    msg_t *msg, 
-		    msg_iovec_t iov[], 
+		    msg_t *msg,
+		    msg_iovec_t iov[],
 		    size_t iovused,
 		    struct sigcomp_compartment *cc,
 		    tport_compressor_t *sc);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_logging.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_logging.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_logging.c	Tue Dec 23 07:37:03 2008
@@ -49,7 +49,7 @@
  *
  * If the TPORT_LOG environment variable is set, the tport module logs the
  * contents of parsed messages. This eases debugging the signaling greatly.
- * 
+ *
  * @sa TPORT_DUMP, TPORT_DEBUG, tport_log
  */
 #ifdef DOXYGEN
@@ -63,7 +63,7 @@
  * The received and sent data is dumped to the file specified by TPORT_DUMP
  * environment variable. This can be used to save message traces and help
  * hairy debugging tasks.
- * 
+ *
  * @sa TPORT_LOG, TPORT_DEBUG, tport_log
  */
 #ifdef DOXYGEN
@@ -76,19 +76,19 @@
  *
  * The TPORT_DEBUG environment variable is used to determine the debug logging
  * level for @b tport module. The default level is 3.
- * 
+ *
  * @sa <sofia-sip/su_debug.h>, tport_log, SOFIA_DEBUG
  */
 #ifdef DOXYGEN
 extern char const TPORT_DEBUG[]; /* dummy declaration for Doxygen */
 #endif
 
-/**Debug log for @b tport module. 
- * 
+/**Debug log for @b tport module.
+ *
  * The tport_log is the log object used by @b tport module. The level of
  * #tport_log is set using #TPORT_DEBUG environment variable.
  */
-su_log_t tport_log[] = { 
+su_log_t tport_log[] = {
   SU_LOG_INIT("tport", "TPORT_DEBUG", SU_DEBUG)
 };
 
@@ -99,9 +99,9 @@
   int log_msg = mr->mr_log != 0;
   char const *dump = NULL;
   int n;
-  
+
   n = tl_gets(tags,
-	      TPTAG_LOG_REF(log_msg), 
+	      TPTAG_LOG_REF(log_msg),
 	      TPTAG_DUMP_REF(dump),
 	      TAG_END());
 
@@ -129,7 +129,7 @@
     if (mr->mr_dump_file && mr->mr_dump_file != stdout)
       fclose(mr->mr_dump_file), mr->mr_dump_file = NULL;
 
-    if (strcmp(dumpname, "-")) 
+    if (strcmp(dumpname, "-"))
       mr->mr_dump_file = fopen(dumpname, "ab"); /* XXX */
     else
       mr->mr_dump_file = stdout;
@@ -144,8 +144,8 @@
 }
 
 /** Create log stamp */
-void tport_stamp(tport_t const *self, msg_t *msg, 
-		 char stamp[128], char const *what, 
+void tport_stamp(tport_t const *self, msg_t *msg,
+		 char stamp[128], char const *what,
 		 size_t n, char const *via,
 		 su_time_t now)
 {
@@ -183,7 +183,7 @@
 }
 
 /** Dump the data from the iovec */
-void tport_dump_iovec(tport_t const *self, msg_t *msg, 
+void tport_dump_iovec(tport_t const *self, msg_t *msg,
 		      size_t n, su_iovec_t const iov[], size_t iovused,
 		      char const *what, char const *how)
 {
@@ -214,7 +214,7 @@
 }
 
 /** Log the message. */
-void tport_log_msg(tport_t *self, msg_t *msg, 
+void tport_log_msg(tport_t *self, msg_t *msg,
 		   char const *what, char const *via,
 		   su_time_t now)
 {
@@ -232,9 +232,9 @@
     n += iov[i].mv_len;
 
   tport_stamp(self, msg, stamp, what, n, via, now);
-  su_log(stamp);
+  su_log("%s", stamp);
   su_log("   " MSG_SEPARATOR);
- 
+
   for (i = 0; truncated == 0 && i < iovlen && i < 80; i++) {
     char *s = iov[i].mv_base, *end = s + iov[i].mv_len;
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_sigcomp.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_sigcomp.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_sigcomp.c	Tue Dec 23 07:37:03 2008
@@ -64,11 +64,11 @@
   struct sigcomp_compartment   *sc_cc;
   struct sigcomp_compressor    *sc_compressor;
   struct sigcomp_buffer        *sc_output;
-  unsigned                      sc_compressed; 
+  unsigned                      sc_compressed;
 
   struct sigcomp_buffer        *sc_input;
   unsigned                      sc_copied;
-  
+
   enum {
     format_is_unknown,
     format_is_sigcomp,
@@ -95,7 +95,7 @@
   sh = sigcomp_state_handler_create();
 
   if (sh == NULL) {
-    SU_DEBUG_1(("tport: initializing SigComp state handler: %s\n", 
+    SU_DEBUG_1(("tport: initializing SigComp state handler: %s\n",
 		strerror(errno)));
     vsc_master_deinit_sigcomp(mr, retval), retval = NULL;
     return retval;
@@ -106,7 +106,7 @@
   cc = sigcomp_compartment_create(a, sh, 0, "", 0, NULL, 0);
 
   if (cc == NULL) {
-    SU_DEBUG_1(("tport: initializing SigComp master compartment: %s\n", 
+    SU_DEBUG_1(("tport: initializing SigComp master compartment: %s\n",
 		strerror(errno)));
     vsc_master_deinit_sigcomp(mr, retval), retval = NULL;
     return retval;
@@ -146,7 +146,7 @@
 {
   if (master_sc == NULL ||
       master_sc->sc_cc == NULL ||
-      compression == NULL || 
+      compression == NULL ||
       strcasecmp(compression, tport_sigcomp_name))
     return NULL;
 
@@ -166,7 +166,7 @@
 }
 
 /** Set/reset compression */
-int vsc_set_compression(tport_t *self, 
+int vsc_set_compression(tport_t *self,
 			tport_sigcomp_t *sc,
 			char const *comp)
 {
@@ -186,7 +186,7 @@
       return 0;
     }
   }
-  
+
   return -1;
 }
 
@@ -194,7 +194,7 @@
 /** Assign a SigComp compartment (to a possibly connected tport). */
 int tport_sigcomp_assign(tport_t *self, struct sigcomp_compartment *cc)
 {
-  if (tport_is_connection_oriented(self) && 
+  if (tport_is_connection_oriented(self) &&
       tport_is_secondary(self) &&
       self->tp_socket != INVALID_SOCKET) {
 
@@ -205,7 +205,7 @@
       /* Remove old assignment */
       sigcomp_compartment_unref(self->tp_sigcomp->sc_cc);
     }
-    
+
     self->tp_sigcomp->sc_cc = sigcomp_compartment_ref(cc);
 
     return 0;
@@ -223,7 +223,7 @@
   if (how >= 2 && self->tp_sigcomp->sc_cc) {
     sigcomp_compartment_unref(self->tp_sigcomp->sc_cc);
     self->tp_sigcomp->sc_cc = NULL;
-  }  
+  }
 }
 
 static int vsc_recv_sigcomp_r(tport_t*, msg_t**, struct sigcomp_udvm*, int);
@@ -369,50 +369,50 @@
 
     data = input->b_data + input->b_avail;
     dlen = input->b_size - input->b_avail;
-    
+
     if (tport_is_stream(self)) {
       n = recv(self->tp_socket, data, dlen, 0);
-    } 
+    }
     else if (dlen >= N) {
       n = recvfrom(self->tp_socket, data, dlen, 0, &su->su_sa, &su_size);
       SU_CANONIZE_SOCKADDR(su);
-    } 
+    }
     else {
       recvfrom(self->tp_socket, data, dlen, 0, &su->su_sa, &su_size);
       SU_CANONIZE_SOCKADDR(su);
       su_seterrno(EMSGSIZE);		/* Protocol error */
       return -1;
     }
-  
+
     if (n == (unsigned)-1) {
       char const *pn = self->tp_protoname;
       int err = su_errno();
-    
+
       if (su_is_blocking(err)) {
 	SU_DEBUG_7(("%s(%p): recv from %s: EAGAIN\n", __func__, self, pn));
 	return 1;
       }
-    
+
       SU_DEBUG_1(("%s(%p): recv from %s: %s (%d)\n", __func__, self, pn,
 		  su_strerror(err), err));
       return -1;
     }
-  
+
     /* XXX - in case of stream, use message buffers for output? */
-    
+
     input->b_avail += n;
     input->b_complete = (n == 0) || !tport_is_stream(self);
   }
 
   for (complete = eos = 0; !complete;) {
     output = sigcomp_udvm_output_buffer(udvm, 16384);
-    
+
     if (sigcomp_udvm_decompress(udvm, output, input) < 0) {
       int error = sigcomp_udvm_errno(udvm);
-      
+
       SU_DEBUG_3(("%s: UDVM error %d: %s\n", __func__,
 		  error, sigcomp_udvm_strerror(udvm)));
-      
+
       su_seterrno(EREMOTEIO);
 
       return -1;
@@ -424,7 +424,7 @@
     eos = complete && input->b_complete;
 
     veclen = tport_recv_iovec(self, mmsg, iovec, dlen, eos);
-    
+
     if (dlen ? veclen <= 0 : veclen < 0) {
       return -1;
     }
@@ -437,27 +437,27 @@
     assert(dlen == n);
 
     msg = *mmsg;
-    
+
     if (msg) {
       /* Message address */
       if (self->tp_addrinfo->ai_socktype == SOCK_STREAM)
 	msg_set_address(msg, self->tp_addr, self->tp_addrlen);
       else
 	msg_set_address(msg, su, su_size);
-      
-      SU_DEBUG_5(("%s(%p): sigcomp recv = %u => %u %s\n", __func__, self, 
+
+      SU_DEBUG_5(("%s(%p): sigcomp recv = %u => %u %s\n", __func__, self,
 		  N, dlen, eos ? " (complete)" : ""));
 
       msg_mark_as_compressed(msg);
-      
+
       /* Write the received data to the message dump file */
       if (self->tp_master->mr_dump_file && !self->tp_pri->pri_threadpool)
 	tport_dump_iovec(self, msg, n, iovec, veclen, "recv", "from");
-      
+
       msg_recv_commit(msg, dlen, eos);    /* Mark buffer as used */
     }
     else {
-      SU_DEBUG_5(("%s(%p): sigcomp recv = %u => %u %s\n", __func__, self, 
+      SU_DEBUG_5(("%s(%p): sigcomp recv = %u => %u %s\n", __func__, self,
 		  N, dlen, eos ? " (complete)" : ""));
       if (complete || !tport_is_stream(self)) {
 	sigcomp_udvm_reject(udvm); /* Reject empty message */
@@ -467,7 +467,7 @@
     if (self->tp_addrinfo->ai_socktype == SOCK_STREAM) {
       if (eos)
 	return 0;
-    
+
       if (output->b_complete)
 	return n < N || sigcomp_udvm_has_pending_data(udvm) ? 2 : 1;
 
@@ -481,8 +481,8 @@
 
 static
 int vsc_send_sigcomp(tport_t const *self,
-		     msg_t *msg, 
-		     msg_iovec_t iov[], 
+		     msg_t *msg,
+		     msg_iovec_t iov[],
 		     int iovused,
 		     struct sigcomp_compartment *cc,
 		     tport_sigcomp_t *sc)
@@ -511,7 +511,7 @@
     sc->sc_outfmt = format_is_sigcomp;
 
   assert(cc);
-  
+
   if (c == NULL) {
     assert(input == NULL);
     if (stream)
@@ -519,7 +519,7 @@
     else
       c = sigcomp_compressor_create(cc);
     sc->sc_compressor = c;
-  } 
+  }
 
   ccname = sigcomp_compartment_name(cc, &ccnamelen);
 
@@ -539,7 +539,7 @@
     sc->sc_input = input = sigcomp_compressor_input_buffer(c, input_size);
 
     assert(input->b_avail == 0 && input->b_used == 0);
-  } 
+  }
   else if (!input->b_complete) {
     int input_size = 0;
 
@@ -552,15 +552,15 @@
 
   if (output == NULL)
     sc->sc_output = output = sigcomp_compressor_output_buffer(c, NULL);
-    
+
   if (!c || !input || !output) {
-    SU_DEBUG_3(("%s(%p): %s (%u)%s%s%s\n", 
+    SU_DEBUG_3(("%s(%p): %s (%u)%s%s%s\n",
 		__func__, self, strerror(errno), errno,
 		c ? "" : " (comp)",
 		input ? "" : " (input)",
 		output ? "" : " (output)"));
     sigcomp_compressor_free(c);
-    sc->sc_compressor = NULL; 
+    sc->sc_compressor = NULL;
     sc->sc_output = NULL; sc->sc_input = NULL;
     sc->sc_compressed = 0; sc->sc_copied = 0;
     return -1;
@@ -598,17 +598,17 @@
       input->b_complete = i == iovused;
       assert(stream || input->b_complete); (void)stream;
     }
-    
+
     m = output->b_avail - output->b_used;
 
     n = sigcomp_compressor_compress(c, output, input);
-    
+
     if (n < 0) {
       SU_DEBUG_3(("%s(%p): %s (%u)\n", __func__, self,
-		  sigcomp_compressor_strerror(c), 
+		  sigcomp_compressor_strerror(c),
 		  sigcomp_compressor_errno(c)));
       sigcomp_compressor_free(c);
-      sc->sc_compressor = NULL; 
+      sc->sc_compressor = NULL;
       sc->sc_output = NULL; sc->sc_input = NULL;
       sc->sc_compressed = 0;
       return -1;
@@ -616,15 +616,15 @@
 
     assert(input->b_complete || sc->sc_copied - k > 0);
 
-    SU_DEBUG_5(("%s: input %u (%u new) compressed %u to %u with '%.*s'\n", 
-		__func__, sc->sc_copied, k, n, 
-		(output->b_avail - output->b_used) - m, 
+    SU_DEBUG_5(("%s: input %u (%u new) compressed %u to %u with '%.*s'\n",
+		__func__, sc->sc_copied, k, n,
+		(output->b_avail - output->b_used) - m,
 		ccnamelen, ccname));
 
     sc->sc_compressed = n;
 
     assert(stream || output->b_complete);
-  } 
+  }
   else {
     assert(tport_is_connection_oriented(self));
     n = sc->sc_compressed;
@@ -636,7 +636,7 @@
   ciov->siv_len = output->b_avail - output->b_used;
 
   m = self->tp_pri->pri_vtable->vtp_send(self, msg, ciov, 1);
-  
+
   if (m == -1) {
     int error = su_errno();
 
@@ -650,9 +650,9 @@
 
     return -1;
   }
-  
+
   output->b_used += m;
-  
+
   if (output->b_used < output->b_avail)
     return 0;
 
@@ -668,7 +668,7 @@
     sc->sc_compressor = NULL;
   }
 
-  assert(sc->sc_compressed >= n); assert(sc->sc_copied >= n); 
+  assert(sc->sc_compressed >= n); assert(sc->sc_copied >= n);
 
   sc->sc_compressed -= n;
   sc->sc_copied -= n;
@@ -677,7 +677,7 @@
 }
 
 /** Initialize UDVM */
-static 
+static
 struct sigcomp_udvm *tport_init_udvm(tport_t *self)
 {
   struct sigcomp_compartment *cc;
@@ -701,7 +701,7 @@
 
 
 /** Get primary compartment */
-static 
+static
 struct sigcomp_compartment *
 tport_primary_compartment(tport_master_t *mr)
 {
@@ -721,14 +721,14 @@
 
   udvm = self->tp_sigcomp->sc_udvm;
   if (udvm && sigcomp_udvm_is_complete(udvm)) {
-    if (self->tp_master->mr_tpac->tpac_sigcomp_accept && 
+    if (self->tp_master->mr_tpac->tpac_sigcomp_accept &&
 	self->tp_sigcomp->sc_cc == NULL) {
       tport_t *ref;
       struct tport_delivery *d;
 
       d = self->tp_master->mr_delivery;
 
-      d->d_tport = self; 
+      d->d_tport = self;
       d->d_msg = msg;
       d->d_udvm = &self->tp_sigcomp->sc_udvm;
       *d->d_from = *self->tp_name;
@@ -744,11 +744,11 @@
     }
     else {
       if (tport_log->log_level >= 5) {
-	char const *name; 
+	char const *name;
 	int namelen;
-      
+
 	name = sigcomp_compartment_name(self->tp_sigcomp->sc_cc, &namelen);
-	SU_DEBUG_5(("tport(%p): msg %p SigComp implicit accept '%.*s'\n", 
+	SU_DEBUG_5(("tport(%p): msg %p SigComp implicit accept '%.*s'\n",
 		    self, msg, namelen, name));
       }
       sigcomp_udvm_accept(udvm, self->tp_sigcomp->sc_cc);
@@ -758,9 +758,9 @@
 
 
 /** Accept a SigComp message */
-int 
-tport_sigcomp_accept(tport_t *self, 
-		     struct sigcomp_compartment *cc, 
+int
+tport_sigcomp_accept(tport_t *self,
+		     struct sigcomp_compartment *cc,
 		     msg_t *msg)
 {
   struct sigcomp_udvm *udvm;
@@ -775,12 +775,12 @@
 
   if (udvm) {
     if (tport_log->log_level >= 5) {
-      char const *name; 
+      char const *name;
       int namelen;
-   
+
       if (cc) {
 	name = sigcomp_compartment_name(cc, &namelen);
-	SU_DEBUG_5(("tport(%p): msg %p SigComp accept '%.*s'\n", 
+	SU_DEBUG_5(("tport(%p): msg %p SigComp accept '%.*s'\n",
 		    self, msg, namelen, name));
       }
       else {
@@ -814,7 +814,7 @@
 su_inline
 int msg_is_compressed(msg_t *msg)
 {
-  return msg && 
+  return msg &&
     (msg_addrinfo(msg)->ai_flags & TP_AI_COMPRESSED) == TP_AI_COMPRESSED;
 }
 
@@ -852,11 +852,11 @@
       /* Use default compartment */
       cc = self->tp_master->mr_compartment;
   }
-  else 
+  else
     cc = NULL;
-  
+
   return cc;
-}			   
+}
 
 /** Receive data from datagram using SigComp. */
 int tport_recv_sigcomp_dgram(tport_t *self, int N)
@@ -881,5 +881,5 @@
 #endif
   recv(self->tp_socket, dummy, 1, 0); /* remove msg from socket */
   /* XXX - send NACK ? */
-  return su_seterrno(error);     
+  return su_seterrno(error);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_sigcomp.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_sigcomp.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_sigcomp.c	Tue Dec 23 07:37:03 2008
@@ -140,7 +140,7 @@
 int tport_has_compression(tport_t const *self, char const *comp)
 {
   return
-    self && comp && 
+    self && comp &&
     self->tp_name->tpn_comp == tport_canonize_comp(comp);
 }
 
@@ -169,7 +169,7 @@
 }
 
 
-/** Assign a SigComp compartment (to a possibly connected tport). 
+/** Assign a SigComp compartment (to a possibly connected tport).
  *
  * @related tport_s
  */
@@ -180,7 +180,7 @@
   if (!vsc)
     return 0;
 
-  if (tport_is_connection_oriented(self) && 
+  if (tport_is_connection_oriented(self) &&
       tport_is_secondary(self) &&
       self->tp_socket != INVALID_SOCKET) {
     return vsc->vsc_set_compartment(self, self->tp_comp, cc);
@@ -207,7 +207,7 @@
   }
 
   return vsc->vsc_get_compartment(self, self->tp_comp);
-}			   
+}
 
 
 /** Test if tport has a SigComp compartment assigned to it. */
@@ -217,13 +217,13 @@
 
   if (vsc && self)
     return vsc->vsc_has_sigcomp_assigned(self->tp_comp);
-    
+
   return 0;
 }
 
-int 
-tport_sigcomp_accept(tport_t *self, 
-		     struct sigcomp_compartment *cc, 
+int
+tport_sigcomp_accept(tport_t *self,
+		     struct sigcomp_compartment *cc,
 		     msg_t *msg)
 {
   tport_comp_vtable_t const *vsc = tport_comp_vtable;
@@ -260,7 +260,7 @@
 }
 
 /** Receive data from datagram using SigComp. */
-int tport_recv_comp_dgram(tport_t const *self, 
+int tport_recv_comp_dgram(tport_t const *self,
 			  tport_compressor_t *sc,
 			  msg_t **in_out_msg,
 			  su_sockaddr_t *from,
@@ -273,13 +273,13 @@
 
   msg_destroy(*in_out_msg), *in_out_msg = NULL;
 
-  return su_seterrno(EBADMSG);     
+  return su_seterrno(EBADMSG);
 }
 
 
 ssize_t tport_send_comp(tport_t const *self,
-			msg_t *msg, 
-			msg_iovec_t iov[], 
+			msg_t *msg,
+			msg_iovec_t iov[],
 			size_t iovused,
 			struct sigcomp_compartment *cc,
 			tport_compressor_t *comp)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_stun.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_stun.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_stun.c	Tue Dec 23 07:37:03 2008
@@ -55,13 +55,13 @@
 }
 
 static
-tport_stun_server_vtable_t const stun_mini_vtable = 
+tport_stun_server_vtable_t const stun_mini_vtable =
   {
     sizeof stun_mini_vtable,
-    vst_create, 
+    vst_create,
     stun_mini_destroy,
-    stun_mini_add_socket, 
-    stun_mini_remove_socket, 
+    stun_mini_add_socket,
+    stun_mini_remove_socket,
     stun_mini_request
   };
 
@@ -98,10 +98,10 @@
 {
   tport_stun_server_t *stun_server = tp->tp_master->mr_stun_server;
 
-  if (tport_stun_server_vtable && 
+  if (tport_stun_server_vtable &&
       stun_server &&
       tp->tp_params->tpp_stun_server) {
-    if (tport_stun_server_vtable->vst_add_socket(stun_server, 
+    if (tport_stun_server_vtable->vst_add_socket(stun_server,
 						 tp->tp_socket) == 0)
       tp->tp_has_stun_server = 1;
   }
@@ -124,7 +124,7 @@
 /**Process stun messagee.
  *
  * @retval -1 error
- * @retval 3  stun message received, ignore  
+ * @retval 3  stun message received, ignore
  */
 int tport_recv_stun_dgram(tport_t const *self,
 			  msg_t **in_out_msg,
@@ -150,7 +150,7 @@
   else if (request[0] == 1) {
     /* This is a response. */
     if (self->tp_pri->pri_vtable->vtp_stun_response) {
-      if (self->tp_pri->pri_vtable->vtp_stun_response(self, request, n, 
+      if (self->tp_pri->pri_vtable->vtp_stun_response(self, request, n,
 						      from, fromlen) < 0)
 	retval = -1;
     }
@@ -161,7 +161,7 @@
   else if (request[0] == 0 && self->tp_master->mr_stun_server) {
     tport_stun_server_vtable_t const *vst = tport_stun_server_vtable;
     vst->vst_request(self->tp_master->mr_stun_server,
-		     self->tp_socket, request, n, 
+		     self->tp_socket, request, n,
 		     (void *)from, fromlen);
   }
   else if (request[0] == 0) {
@@ -279,7 +279,7 @@
   if (vtable->vst_size <= (int)sizeof *vtable)
     return su_seterrno(EINVAL);
 
-  if (!vtable->vst_create || 
+  if (!vtable->vst_create ||
       !vtable->vst_destroy ||
       !vtable->vst_add_socket ||
       !vtable->vst_remove_socket ||

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 /**@CFILE tport_tag.c
  * @brief Tags for transport module
  *
- * @note This file is used to automatically generate 
+ * @note This file is used to automatically generate
  * tport_tag_ref.c and tport_tag_dll.c
  *
  * Copyright (c) 2002 Nokia Research Center.  All rights reserved.
@@ -54,7 +54,7 @@
 
 /**@def TPTAG_IDENT(cstr)
  *
- * Identify a transport interface. 
+ * 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(),
@@ -75,7 +75,7 @@
 
 /**@def TPTAG_FRESH(boolean)
  *
- * Create new connection (but allow other messages to reuse the new one). 
+ * 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().
@@ -92,7 +92,7 @@
 
 /**@def TPTAG_PUBLIC(tport_via)
  *
- * Define how the public transport connects to Internet. 
+ * 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().
@@ -146,7 +146,7 @@
 /**@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().
  */
@@ -156,7 +156,7 @@
  *
  * How long transports may be idle (value in milliseconds).
  *
- * If 0, zap immediately, 
+ * If 0, zap immediately,
  * if UINT_MAX, leave them there (default value for now).
  *
  * @par Use With
@@ -201,7 +201,7 @@
  *
  * Ping-pong interval in milliseconds.
  *
- * If 0 or UINT_MAX, do not check for PONGs. Default value is 0. 
+ * 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
@@ -257,7 +257,7 @@
  *
  * Path to the public key certificate directory.
  *
- * Use with tport_tbind(), nua_create(), nta_agent_create(), 
+ * 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);
@@ -275,11 +275,25 @@
  *
  * Sets the TLS version (version 0 implies SSL2/SSL3).
  *
- * Use with tport_tbind(), nua_create(), nta_agent_create(), 
+ * 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_TLS_VERIFY_PEER(x)
+ *
+ * The verification of certificates can be controlled:
+ * 0: no verify certificates;
+ * 1: on server mode, the certificate returned by client is checked
+ *    if fail the TLS/SSL handshake is immediately terminated;
+ * 1: on client mode, the server certificate is verified
+ *    if fail the TLS/SSL handshake is immediately terminated;
+ *
+ * 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_verify_peer = UINTTAG_TYPEDEF(tls_verify_peer);
+
 /**@def TPTAG_QUEUESIZE(x)
  *
  * Specify the number of messages that can be queued per connection.
@@ -399,7 +413,7 @@
  *
  * If set, print out parsed or sent messages at transport layer.
  *
- * Use with tport_tcreate(), nua_create(), nta_agent_create(), 
+ * Use with tport_tcreate(), nua_create(), nta_agent_create(),
  * nth_engine_create(), or initial nth_site_create().
  *
  * @sa #TPORT_LOG environment variable, TPTAG_DUMP()
@@ -410,7 +424,7 @@
 
 /**@def TPTAG_DUMP(x)
  *
- * Filename for dumping unparsed messages from transport. 
+ * Filename for dumping unparsed messages from transport.
  *
  * Use with tport_tcreate(), nta_agent_create(), nua_create(),
  * nth_engine_create(), or initial nth_site_create().
@@ -421,7 +435,7 @@
  */
 tag_typedef_t tptag_dump = STRTAG_TYPEDEF(dump);
 
-/** Mark transport as trusted. 
+/** Mark transport as trusted.
  *
  * @note Not implemented by tport module.
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_threadpool.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_threadpool.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_threadpool.c	Tue Dec 23 07:37:03 2008
@@ -34,7 +34,7 @@
 
 #include "config.h"
 
-#undef HAVE_SIGCOMP 
+#undef HAVE_SIGCOMP
 
 #define SU_ROOT_MAGIC_T         struct tport_threadpool
 #define SU_WAKEUP_ARG_T         struct tport_s
@@ -93,7 +93,7 @@
   int        thrp_yield;
 };
 
-typedef struct 
+typedef struct
 {
   threadpool_t *tpd_thrp;
   int  tpd_errorcode;
@@ -114,16 +114,16 @@
   thrp_udp_deliver_t thrp_udp_deliver[1];
 };
 
-int tport_threadpool_init_primary(tport_primary_t *, 
-				  tp_name_t tpn[1], 
-				  su_addrinfo_t *, 
+int tport_threadpool_init_primary(tport_primary_t *,
+				  tp_name_t tpn[1],
+				  su_addrinfo_t *,
 				  tagi_t const *,
 				  char const **return_culprit);
 static void tport_threadpool_deinit_primary(tport_primary_t *pri);
 
 static int tport_thread_send(tport_t *tp,
 			     msg_t *msg,
-			     tp_name_t const *tpn, 
+			     tp_name_t const *tpn,
 			     struct sigcomp_compartment *cc,
 			     unsigned mtu);
 
@@ -149,16 +149,16 @@
 
 static int thrp_udp_init(su_root_t *, threadpool_t *);
 static void thrp_udp_deinit(su_root_t *, threadpool_t *);
-static int thrp_udp_event(threadpool_t *thrp, 
-			    su_wait_t *w, 
+static int thrp_udp_event(threadpool_t *thrp,
+			    su_wait_t *w,
 			    tport_t *_tp);
-static int thrp_udp_recv_deliver(threadpool_t *thrp, 
-				 tport_t const *tp, 
+static int thrp_udp_recv_deliver(threadpool_t *thrp,
+				 tport_t const *tp,
 				 thrp_udp_deliver_t *tpd,
 				 int events);
 static int thrp_udp_recv(threadpool_t *thrp, thrp_udp_deliver_t *tpd);
 #if HAVE_SIGCOMP
-static int thrp_udvm_decompress(threadpool_t *thrp, 
+static int thrp_udvm_decompress(threadpool_t *thrp,
 				thrp_udp_deliver_t *tpd);
 #endif
 static void thrp_udp_deliver(threadpool_t *thrp,
@@ -176,8 +176,8 @@
 
 
 /** Launch threads in the tport pool. */
-int tport_threadpool_init_primary(tport_primary_t *pri, 
-				  tp_name_t tpn[1], 
+int tport_threadpool_init_primary(tport_primary_t *pri,
+				  tp_name_t tpn[1],
 				  su_addrinfo_t *ai,
 				  tagi_t const *tags,
 				  char const **return_culprit)
@@ -210,7 +210,7 @@
       thrp[i].thrp_compartment = tport_primary_compartment(tp->tp_master);
 #endif
     thrp[i].thrp_tport = tptp;
-    if (su_clone_start(pri->pri_master->mr_root, 
+    if (su_clone_start(pri->pri_master->mr_root,
 		       thrp[i].thrp_clone,
 		       thrp + i,
 		       thrp_udp_init,
@@ -219,7 +219,7 @@
   }
 
   tp->tp_events = 0;
-  
+
   return 0;
 
  error:
@@ -231,7 +231,7 @@
  *
  * @note Executed by stack thread only.
  */
-static 
+static
 void tport_threadpool_deinit_primary(tport_primary_t *pri)
 {
   tport_threadpool_t *tptp = (tport_threadpool_t *)pri;
@@ -246,7 +246,7 @@
     thrp[i].thrp_killing = 1;
 
   /* Stop every task in the threadpool. */
-  for (i = 0; i < N; i++) 
+  for (i = 0; i < N; i++)
     su_clone_wait(pri->pri_master->mr_root, thrp[i].thrp_clone);
 
   su_free(pri->pri_home, tptp), tptp->tptp_pool = NULL;
@@ -299,8 +299,8 @@
   thrp->thrp_yield = 0;
 }
 
-static int thrp_udp_event(threadpool_t *thrp, 
-			  su_wait_t *w, 
+static int thrp_udp_event(threadpool_t *thrp,
+			  su_wait_t *w,
 			  tport_t *tp)
 {
 #if HAVE_POLL
@@ -317,7 +317,7 @@
 			su_root_task(thrp->thrp_root),
 			thrp_udp_deliver,
 			sizeof (*tpd)) == -1) {
-	SU_DEBUG_1(("thrp_udp_event(%p): su_msg_create(): %s\n", thrp, 
+	SU_DEBUG_1(("thrp_udp_event(%p): su_msg_create(): %s\n", thrp,
 		    strerror(errno)));
 	return 0;
       }
@@ -337,7 +337,7 @@
       tpd = su_msg_data(thrp->thrp_rmsg)->thrp_udp_deliver;
       memset(tpd, 0, sizeof *tpd);
       return 0;
-    } 
+    }
 
     if (thrp->thrp_yield || (thrp->thrp_s_sent - thrp->thrp_s_recv) > 0)
       return 0;
@@ -346,8 +346,8 @@
   }
 }
 
-static int thrp_udp_recv_deliver(threadpool_t *thrp, 
-				 tport_t const *tp, 
+static int thrp_udp_recv_deliver(threadpool_t *thrp,
+				 tport_t const *tp,
 				 thrp_udp_deliver_t *tpd,
 				 int events)
 {
@@ -378,10 +378,10 @@
       assert(tpd->tpd_errorcode);
       if (su_is_blocking(tpd->tpd_errorcode))
 	return 0;
-    } 
+    }
     else if (tpd->tpd_msg) {
       int n = msg_extract(tpd->tpd_msg); (void)n;
-      
+
       thrp->thrp_rcvd_msgs++;
       thrp->thrp_rcvd_bytes += msg_size(tpd->tpd_msg);
     }
@@ -395,7 +395,7 @@
 
     if (tpd->tpd_msg || tpd->tpd_errorcode) {
       if (qlen >= tp->tp_params->tpp_thrprqsize) {
-	SU_DEBUG_7(("tport recv queue %i: %u\n", 
+	SU_DEBUG_7(("tport recv queue %i: %u\n",
 		    (int)(thrp - tp->tp_pri->tptp_pool), qlen));
 	thrp_yield(thrp);
       }
@@ -429,7 +429,7 @@
   pthread_mutex_lock(mutex);
 
   /* Simulate packet loss */
-  if (tp->tp_params->tpp_drop && 
+  if (tp->tp_params->tpp_drop &&
       su_randint(0, 1000) < tp->tp_params->tpp_drop) {
     recv(s, sample, 1, 0);
     pthread_mutex_unlock(mutex);
@@ -462,7 +462,7 @@
       void *data;
       int dlen;
 
-      tpd->tpd_udvm = 
+      tpd->tpd_udvm =
 	sigcomp_udvm_create_for_compartment(thrp->thrp_compartment);
       input = sigcomp_udvm_input_buffer(tpd->tpd_udvm, N); assert(input);
 
@@ -473,23 +473,23 @@
 	dlen = 0;
 
       tpd->tpd_namelen = sizeof(tpd->tpd_name);
-    
-      dlen = recvfrom(tp->tp_socket, data, dlen, 0, 
+
+      dlen = recvfrom(tp->tp_socket, data, dlen, 0,
 		      &tpd->tpd_name->su_sa, &tpd->tpd_namelen);
 
       SU_CANONIZE_SOCKADDR(tpd->tpd_name);
-      
+
       if (dlen < N) {
 	su_seterrno(EMSGSIZE);		/* Protocol error */
 	N = -1;
-      } else if (dlen == -1) 
+      } else if (dlen == -1)
 	N = -1;
       else {
-	input->b_avail += dlen; 
+	input->b_avail += dlen;
 	input->b_complete = 1;
-	
+
 	pthread_mutex_unlock(mutex);
-      
+
 	N = thrp_udvm_decompress(thrp, tpd);
 
 	if (N == -1)
@@ -511,8 +511,8 @@
   else {
     /* receive as usual */
     N = tport_recv_dgram_r(tp, &tpd->tpd_msg, N);
-  } 
-  
+  }
+
   pthread_mutex_unlock(mutex);
 
   return N;
@@ -533,22 +533,22 @@
   ssize_t veclen;
 
   output = sigcomp_udvm_output_buffer(udvm, -1);
-  
+
   if (sigcomp_udvm_decompress(udvm, output, NULL) < 0) {
     int error = sigcomp_udvm_errno(udvm);
     SU_DEBUG_3(("%s: UDVM error %d: %s\n", __func__,
 		error, sigcomp_udvm_strerror(udvm)));
     su_seterrno(EREMOTEIO);
     return -1;
-  } 
+  }
 
   data = output->b_data + output->b_used;
   dlen = output->b_avail - output->b_used;
   /* XXX - if a message is larger than default output size... */
   eos = output->b_complete; assert(output->b_complete);
-    
+
   veclen = tport_recv_iovec(tp, &tpd->tpd_msg, iovec, dlen, eos);
-    
+
   if (veclen <= 0) {
     n = -1;
   } else {
@@ -560,7 +560,7 @@
     assert(dlen == n);
 
     msg_recv_commit(tpd->tpd_msg, dlen, eos);    /* Mark buffer as used */
-    
+
     /* Message address */
     ai = msg_addrinfo(tpd->tpd_msg);
     ai->ai_flags |= TP_AI_COMPRESSED;
@@ -580,7 +580,7 @@
  *
  * @note Executed by stack thread only.
  */
-static 
+static
 void thrp_udp_deliver(su_root_magic_t *magic,
 		      su_msg_r m,
 		      union tport_su_msg_arg *arg)
@@ -602,7 +602,7 @@
     return;
   }
 
-  SU_DEBUG_7(("thrp_udp_deliver(%p): got %p delay %f\n", 
+  SU_DEBUG_7(("thrp_udp_deliver(%p): got %p delay %f\n",
 	      thrp, tpd, 1000 * su_time_diff(now, tpd->tpd_when)));
 
   if (tpd->tpd_errorcode)
@@ -612,14 +612,14 @@
     tp->tp_rlogged = NULL;
   }
 
-#if HAVE_SIGCOMP 
+#if HAVE_SIGCOMP
   if (tpd->tpd_udvm) {
     sigcomp_udvm_free(tpd->tpd_udvm), tpd->tpd_udvm = NULL;
   }
 #endif
 }
 
-static 
+static
 void thrp_udp_deliver_report(threadpool_t *thrp,
 			     su_msg_r m,
 			     union tport_su_msg_arg *arg)
@@ -639,11 +639,11 @@
 static
 int tport_thread_send(tport_t *tp,
 		      msg_t *msg,
-		      tp_name_t const *tpn, 
+		      tp_name_t const *tpn,
 		      struct sigcomp_compartment *cc,
 		      unsigned mtu)
 {
-  
+
   threadpool_t *thrp = tp->tp_pri->tptp_pool;
   thrp_udp_deliver_t *tpd;
   int i, N = tp->tp_pri->tptp_poolsize;
@@ -661,12 +661,12 @@
 
   qlen = totalqlen = thrp->thrp_s_sent - thrp->thrp_s_recv;
 
-  /* Select thread with shortest queue */ 
+  /* Select thread with shortest queue */
   for (i = 1; i < N; i++) {
     threadpool_t *other = tp->tp_pri->tptp_pool + i;
     unsigned len = other->thrp_s_sent - other->thrp_s_recv;
 
-    if (len < qlen || 
+    if (len < qlen ||
 	(len == qlen && (other->thrp_s_sent - thrp->thrp_s_sent) < 0))
       thrp = other, qlen = len;
 
@@ -681,7 +681,7 @@
 		    su_root_task(tp->tp_master->mr_root),
 		    thrp_udp_send,
 		    sizeof (*tpd)) != su_success) {
-    SU_DEBUG_1(("thrp_udp_event(%p): su_msg_create(): %s\n", thrp, 
+    SU_DEBUG_1(("thrp_udp_event(%p): su_msg_create(): %s\n", thrp,
 		strerror(errno)));
     return -1;
   }
@@ -708,7 +708,7 @@
 }
 
 /** thrp_udp_send() is run by threadpool to send the message. */
-static 
+static
 void thrp_udp_send(threadpool_t *thrp,
 		   su_msg_r m,
 		   union tport_su_msg_arg *arg)
@@ -723,7 +723,7 @@
 
   thrp->thrp_s_recv++;
 
-  { 
+  {
     double delay = 1000 * su_time_diff(su_now(), tpd->tpd_when);
     if (delay > 100)
       SU_DEBUG_3(("thrp_udp_deliver(%p): got %p delay %f\n", thrp, tpd, delay));
@@ -753,7 +753,7 @@
   /* Get a iovec for message contents */
   for (;;) {
     iovused = msg_iovec(msg, iov, iovlen);
-    if (iovused <= iovlen) 
+    if (iovused <= iovlen)
       break;
 
     iov = iov0 = realloc(iov0, sizeof(*iov) * iovused);
@@ -776,9 +776,9 @@
     tport_sigcomp_t sc[1] = {{ NULL }};
 
     n = tport_sigcomp_vsend(tp, msg, iov, iovused, tpd->tpd_cc, sc);
-  } 
+  }
 #endif
-  else 
+  else
     n = tport_send_dgram(tp, msg, iov, iovused);
 
   if (n == -1)
@@ -788,7 +788,7 @@
     free(iov0);
 }
 
-static 
+static
 void thrp_udp_send_report(su_root_magic_t *magic,
 			  su_msg_r msg,
 			  union tport_su_msg_arg *arg)
@@ -799,7 +799,7 @@
 
   assert(magic != thrp);
 
-  SU_DEBUG_7(("thrp_udp_send_report(%p): got %p delay %f\n", 
+  SU_DEBUG_7(("thrp_udp_send_report(%p): got %p delay %f\n",
 	      thrp, tpd, 1000 * su_time_diff(su_now(), tpd->tpd_when)));
 
   if (tp->tp_master->mr_log)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 /**@CFILE tport_tls.c
  * @brief TLS interface
- * 
+ *
  * @author Mikko Haataja <ext-Mikko.A.Haataja at nokia.com>
  * @author Pekka Pessi <ext-Pekka.Pessi at nokia.com>
  *
@@ -36,6 +36,10 @@
 
 #define OPENSSL_NO_KRB5 oh-no
 
+#include <sofia-sip/su_types.h>
+#include <sofia-sip/su.h>
+#include <sofia-sip/su_wait.h>
+
 #include <openssl/lhash.h>
 #include <openssl/bn.h>
 #include <openssl/x509.h>
@@ -47,10 +51,6 @@
 #include <openssl/bio.h>
 #include <openssl/opensslv.h>
 
-#include <sofia-sip/su_types.h>
-#include <sofia-sip/su.h>
-#include <sofia-sip/su_wait.h>
-
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -112,7 +112,7 @@
       const char *func = ERR_func_error_string(e);
       const char *reason = ERR_reason_error_string(e);
 
-      su_llog(tport_log, level, "%s: %08lx:%s:%s:%s\n", 
+      su_llog(tport_log, level, "%s: %08lx:%s:%s:%s\n",
 	      s, e, error, func, reason);
     }
   }
@@ -165,8 +165,8 @@
     SU_DEBUG_1(("  subject  = %s\n", data));
     SU_DEBUG_1(("  err %i:%s\n", err, X509_verify_cert_error_string(err)));
   }
- 
-  return 1;			/* Always return "ok" */
+
+  return ok;
 }
 
 static
@@ -182,7 +182,7 @@
     if (ti->randFile &&
 	!RAND_load_file(ti->randFile, 1024 * 1024)) {
       if (ti->configured > 1) {
-	SU_DEBUG_3(("%s: cannot open randFile %s\n", 
+	SU_DEBUG_3(("%s: cannot open randFile %s\n",
 		   "tls_init_context", ti->randFile));
 	tls_log_errors(3, "tls_init_context", 0);
       }
@@ -216,7 +216,7 @@
     return -1;
   }
 
-  if (!SSL_CTX_use_certificate_file(tls->ctx, 
+  if (!SSL_CTX_use_certificate_file(tls->ctx,
 				    ti->cert,
 				    SSL_FILETYPE_PEM)) {
     if (ti->configured > 0) {
@@ -230,8 +230,8 @@
     }
   }
 
-  if (!SSL_CTX_use_PrivateKey_file(tls->ctx, 
-                                   ti->key, 
+  if (!SSL_CTX_use_PrivateKey_file(tls->ctx,
+                                   ti->key,
                                    SSL_FILETYPE_PEM)) {
     if (ti->configured > 0) {
       tls_log_errors(1, "tls_init_context", 0);
@@ -253,8 +253,8 @@
 #endif
   }
 
-  if (!SSL_CTX_load_verify_locations(tls->ctx, 
-                                     ti->CAfile, 
+  if (!SSL_CTX_load_verify_locations(tls->ctx,
+                                     ti->CAfile,
                                      ti->CApath)) {
     if (ti->configured > 0)
       tls_log_errors(1, "tls_init_context", 0);
@@ -264,9 +264,8 @@
 
   SSL_CTX_set_verify_depth(tls->ctx, ti->verify_depth);
 
-  SSL_CTX_set_verify(tls->ctx, 
-		     getenv("SSL_VERIFY_PEER") ? SSL_VERIFY_PEER : SSL_VERIFY_NONE
-		     /* SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT */,
+  SSL_CTX_set_verify(tls->ctx,
+		     ti->verify_peer == 1 ? SSL_VERIFY_PEER : SSL_VERIFY_NONE,
                      tls_verify_cb);
 
   if (!SSL_CTX_set_cipher_list(tls->ctx, ti->cipher)) {
@@ -318,8 +317,8 @@
 
 tls_t *tls_init_master(tls_issues_t *ti)
 {
-  /* Default id in case RAND fails */ 
-  unsigned char sessionId[32] = "sofia/tls"; 
+  /* Default id in case RAND fails */
+  unsigned char sessionId[32] = "sofia/tls";
   tls_t *tls;
 
 #if HAVE_SIGPIPE
@@ -342,8 +341,8 @@
 
   SSL_CTX_set_session_id_context(tls->ctx,
                                  (void*) sessionId,
-				 sizeof(sessionId)); 
-  
+				 sizeof(sessionId));
+
   if (ti->CAfile != NULL)
     SSL_CTX_set_client_CA_list(tls->ctx,
                                SSL_load_client_CA_file(ti->CAfile));
@@ -379,7 +378,7 @@
 
   assert(sock != -1);
 
-  tls->bio_con = BIO_new_socket(sock, BIO_NOCLOSE); 
+  tls->bio_con = BIO_new_socket(sock, BIO_NOCLOSE);
   tls->con = SSL_new(tls->ctx);
 
   if (tls->con == NULL) {
@@ -435,10 +434,10 @@
 
   if (!tls) return -1;
 
-  cert = SSL_get_peer_certificate(tls->con); 
+  cert = SSL_get_peer_certificate(tls->con);
   if (!cert)
     return X509_V_OK;
-  
+
   extcount = X509_get_ext_count(cert);
 
   for (k = 0; k < TLS_MAX_HOSTS && tls->hosts[k]; k++)
@@ -455,14 +454,14 @@
 
     ext = X509_get_ext(cert, i);
     name = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext)));
-    
+
     if (strcmp(name, "subjectAltName") != 0)
       continue;
-      
+
     vp = X509V3_EXT_get(ext); if (!vp) continue;
     d2i = X509V3_EXT_d2i(ext);
     values = vp->i2v(vp, d2i, NULL);
-    
+
     for (j = 0; j < sk_CONF_VALUE_num(values); j++) {
       value = sk_CONF_VALUE_value(values, j);
       if (strcmp(value->name, "DNS") == 0) {
@@ -480,18 +479,18 @@
       }
     }
   }
-   
+
   if (k < TLS_MAX_HOSTS) {
     X509_NAME *subject;
     char name[256];
 
     subject = X509_get_subject_name(cert);
     if (subject) {
-      if (X509_NAME_get_text_by_NID(subject, NID_commonName, 
+      if (X509_NAME_get_text_by_NID(subject, NID_commonName,
 				    name, sizeof name) > 0) {
 	name[(sizeof name) - 1] = '\0';
 
-	for (i = 0; tls->hosts[i]; i++) 
+	for (i = 0; tls->hosts[i]; i++)
 	  if (strcasecmp(tls->hosts[i], name) == 0)
 	    break;
 
@@ -507,7 +506,7 @@
 
   if (error == X509_V_OK)
     tls->verified = 1;
-  
+
   return error;
 }
 
@@ -518,7 +517,7 @@
   if (tls == NULL) { errno = EINVAL; return -1; }
   if (!tls->verified) { errno = EAGAIN; return -1; }
 
-  if (!hosts) 
+  if (!hosts)
     return 0;
 
   for (i = 0; hosts[i]; i++) {
@@ -531,7 +530,7 @@
       return -1;
     }
   }
-  
+
   return 0;
 }
 
@@ -605,12 +604,12 @@
   if (!tls->verified) {
     int err = tls_post_connection_check(tls);
 
-    if (err != X509_V_OK && 
+    if (err != X509_V_OK &&
 	err != SSL_ERROR_SYSCALL &&
 	err != SSL_ERROR_WANT_WRITE &&
 	err != SSL_ERROR_WANT_READ) {
       SU_DEBUG_1((
-		 "%s: server certificate doesn't verify\n", 
+		 "%s: server certificate doesn't verify\n",
 		 "tls_read"));
     }
   }
@@ -632,11 +631,11 @@
 
 /** Check if data is available in TCP connection.
  *
- * 
+ *
  *
  * @retval -1 upon an error
  * @retval 0 end-of-stream
- * @retval 1 nothing to read 
+ * @retval 1 nothing to read
  * @retval 2 there is data to read
  */
 int tls_want_read(tls_t *tls, int events)
@@ -660,8 +659,8 @@
 {
   ssize_t ret;
 
-  if (0) 
-    SU_DEBUG_1(("tls_write(%p, %p, "MOD_ZU") called on %s\n", 
+  if (0)
+    SU_DEBUG_1(("tls_write(%p, %p, "MOD_ZU") called on %s\n",
 	    (void *)tls, buf, size,
 	    tls && tls->type == tls_slave ? "server" : "client"));
 
@@ -676,9 +675,9 @@
     assert(tls->write_events == 0);
 
     if (tls->write_events ||
-	buf != tls->write_buffer || 
+	buf != tls->write_buffer ||
 	size < tls->write_buffer_len) {
-      errno = EIO;		
+      errno = EIO;
       return -1;
     }
 
@@ -743,9 +742,9 @@
 
   if (tls->type == tls_master)
     return mask;
-  
+
   return
     (mask & ~(SU_WAIT_IN|SU_WAIT_OUT)) |
-    ((mask & SU_WAIT_IN) ? tls->read_events : 0) | 
+    ((mask & SU_WAIT_IN) ? tls->read_events : 0) |
     ((mask & SU_WAIT_OUT) ? tls->write_events : 0);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.h	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 #ifndef TPORT_TLS_H
 /** Defined when <tport_tls.h> has been included. */
 #define TPORT_TLS_H
-/**@internal 
+/**@internal
  * @file tport_tls.h
  * @brief Internal TLS interface
  *
@@ -48,7 +48,9 @@
 extern char const tls_version[];
 
 typedef struct tls_issues_s {
-  int  verify_depth;    /* if 0, then do nothing                      */
+  int   verify_peer;    /* 0: no verify certificate, *
+                         * 1: if fail the TLS/SSL handshake is terminated. */
+  int   verify_depth;   /* if 0, then do nothing                      */
   int   configured;	/* If non-zero, complain about certificate errors */
   char *cert;		/* CERT file name. File format is PEM         */
   char *key;		/* Private key file. PEM format               */
@@ -58,7 +60,7 @@
   char *cipher;         /* Should be one of the above defined ciphers *
 			 * or NULL (default: "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH
                          */
-  int   version;	/* For tls1, version is 1. When ssl3/ssl2 is 
+  int   version;	/* For tls1, version is 1. When ssl3/ssl2 is
 			 * used, it is 0. */
 } tls_issues_t;
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_connect.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_connect.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_connect.c	Tue Dec 23 07:37:03 2008
@@ -49,14 +49,14 @@
 #include <sofia-sip/http_header.h>
 
 static int tport_http_connect_init_primary(tport_primary_t *,
-					   tp_name_t tpn[1], 
-					   su_addrinfo_t *, 
+					   tp_name_t tpn[1],
+					   su_addrinfo_t *,
 					   tagi_t const *,
 					   char const **return_culprit);
 
 static void tport_http_connect_deinit_primary(tport_primary_t *);
 
-static tport_t *tport_http_connect(tport_primary_t *pri, su_addrinfo_t *ai, 
+static tport_t *tport_http_connect(tport_primary_t *pri, su_addrinfo_t *ai,
 				   tp_name_t const *tpn);
 
 static void tport_http_deliver(tport_t *self, msg_t *msg, su_time_t now);
@@ -94,8 +94,8 @@
 };
 
 static int tport_http_connect_init_primary(tport_primary_t *pri,
-					   tp_name_t tpn[1], 
-					   su_addrinfo_t *ai, 
+					   tp_name_t tpn[1],
+					   su_addrinfo_t *ai,
 					   tagi_t const *tags,
 					   char const **return_culprit)
 {
@@ -122,13 +122,13 @@
     port = "8080";
 
   memcpy(hints, ai, sizeof hints);
-  
+
   hints->ai_flags = 0;
   hints->ai_addr = NULL;
   hints->ai_addrlen = 0;
   hints->ai_next = NULL;
   hints->ai_canonname = NULL;
-  
+
   error = su_getaddrinfo(host, port, hints, &thc->thc_proxy);
   if (error)
     return *return_culprit = "su_getaddrinfo", -1;
@@ -139,24 +139,24 @@
 static void tport_http_connect_deinit_primary(tport_primary_t *pri)
 {
   tport_http_connect_t *thc = (tport_http_connect_t *)pri;
-  
+
   su_freeaddrinfo(thc->thc_proxy), thc->thc_proxy = NULL;
 }
 
-static tport_t *tport_http_connect(tport_primary_t *pri, su_addrinfo_t *ai, 
+static tport_t *tport_http_connect(tport_primary_t *pri, su_addrinfo_t *ai,
 				   tp_name_t const *tpn)
 {
   tport_http_connect_t *thc = (tport_http_connect_t *)pri;
   tport_http_connect_instance_t *thci;
   tport_master_t *mr = pri->pri_master;
-  
+
   msg_t *msg, *response;
 
   char hostport[TPORT_HOSTPORTSIZE];
 
   tport_t *tport;
   http_request_t *rq;
-  
+
   msg = msg_create(http_default_mclass(), 0);
 
   if (!msg)
@@ -167,21 +167,21 @@
   rq = http_request_format(msg_home(msg), "CONNECT %s HTTP/1.1", hostport);
 
   if (msg_header_insert(msg, NULL, (void *)rq) < 0
-      || msg_header_add_str(msg, NULL, 
+      || msg_header_add_str(msg, NULL,
 			    "User-Agent: Sofia-SIP/" VERSION "\n") < 0
       || msg_header_add_str(msg, NULL, "Proxy-Connection: keepalive\n") < 0
       || msg_header_add_make(msg, NULL, http_host_class, hostport) < 0
-      || msg_header_add_make(msg, NULL, http_separator_class, "\r\n") < 0 
+      || msg_header_add_make(msg, NULL, http_separator_class, "\r\n") < 0
       || msg_serialize(msg, NULL) < 0
       || msg_prepare(msg) < 0)
     return (void)msg_destroy(msg), NULL;
 
-  /* 
-   * Create a response message that ignores the body 
-   * if there is no Content-Length 
+  /*
+   * Create a response message that ignores the body
+   * if there is no Content-Length
    */
   response = msg_create(http_default_mclass(), mr->mr_log | MSG_FLG_MAILBOX);
-  
+
   tport = tport_base_connect(pri, thc->thc_proxy, ai, tpn);
   if (!tport) {
     msg_destroy(msg); msg_destroy(response);
@@ -189,17 +189,17 @@
   }
 
   thci = (tport_http_connect_instance_t*)tport;
-  
+
   thci->thci_response = response;
   tport->tp_msg = response;
   msg_set_next(response, thci->thci_stackmsg = tport_msg_alloc(tport, 512));
 
   if (tport_send_msg(tport, msg, tpn, NULL) < 0) {
     SU_DEBUG_9(("tport_send_msg failed in tpot_http_connect\n"));
-    msg_destroy(msg); 
+    msg_destroy(msg);
     tport_zap_secondary(tport);
     return NULL;
-  }  
+  }
 
   tport_set_secondary_timer(tport);
 
@@ -217,7 +217,7 @@
     http_t *http = http_object(msg);
 
     if (http && http->http_status) {
-      SU_DEBUG_0(("tport_http_connect: %u %s\n", 
+      SU_DEBUG_0(("tport_http_connect: %u %s\n",
 		  http->http_status->st_status,
 		  http->http_status->st_phrase));
       if (http->http_status->st_status < 300) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_sctp.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_sctp.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_sctp.c	Tue Dec 23 07:37:03 2008
@@ -67,7 +67,7 @@
 typedef struct tport_sctp_t
 {
   tport_t sctp_base[1];
-  
+
   msg_t *sctp_recv[MAX_STREAMS];
   struct sctp_send {
     msg_t *ss_msg;
@@ -80,17 +80,17 @@
 
 #define TP_SCTP_MSG_MAX (65536)
 
-static int tport_sctp_init_primary(tport_primary_t *, 
-				   tp_name_t tpn[1], 
+static int tport_sctp_init_primary(tport_primary_t *,
+				   tp_name_t tpn[1],
 				   su_addrinfo_t *, tagi_t const *,
 				   char const **return_culprit);
-static int tport_sctp_init_client(tport_primary_t *, 
-				  tp_name_t tpn[1], 
+static int tport_sctp_init_client(tport_primary_t *,
+				  tp_name_t tpn[1],
 				  su_addrinfo_t *, tagi_t const *,
 				  char const **return_culprit);
 static int tport_sctp_init_secondary(tport_t *self, int socket, int accepted,
 				     char const **return_reason);
-static int tport_sctp_init_socket(tport_primary_t *pri, 
+static int tport_sctp_init_socket(tport_primary_t *pri,
 				  int socket,
 				  char const **return_reason);
 static int tport_recv_sctp(tport_t *self);
@@ -148,7 +148,7 @@
   tport_sctp_timer,
 };
 
-static int tport_sctp_init_primary(tport_primary_t *pri, 
+static int tport_sctp_init_primary(tport_primary_t *pri,
 				   tp_name_t tpn[1],
 				   su_addrinfo_t *ai,
 				   tagi_t const *tags,
@@ -166,11 +166,11 @@
 
   if (tport_sctp_init_socket(pri, socket, return_culprit) < 0)
     return -1;
-  
+
   return tport_stream_init_primary(pri, socket, tpn, ai, tags, return_culprit);
 }
 
-static int tport_sctp_init_client(tport_primary_t *pri, 
+static int tport_sctp_init_client(tport_primary_t *pri,
 				  tp_name_t tpn[1],
 				  su_addrinfo_t *ai,
 				  tagi_t const *tags,
@@ -197,7 +197,7 @@
 }
 
 /** Initialize a SCTP socket */
-static int tport_sctp_init_socket(tport_primary_t *pri, 
+static int tport_sctp_init_socket(tport_primary_t *pri,
 				  int socket,
 				  char const **return_reason)
 {
@@ -215,11 +215,11 @@
 /** Receive data available on the socket.
  *
  * @retval -1 error
- * @retval 0  end-of-stream  
+ * @retval 0  end-of-stream
  * @retval 1  normal receive
  * @retval 2  incomplete recv, recv again
  */
-static 
+static
 int tport_recv_sctp(tport_t *self)
 {
   msg_t *msg;
@@ -266,14 +266,14 @@
 static ssize_t tport_send_sctp(tport_t const *self, msg_t *msg,
 			       msg_iovec_t iov[], size_t iovused)
 {
-  
+
 
   return su_vsend(self->tp_socket, iov, iovused, MSG_NOSIGNAL, NULL, 0);
 }
 
 /** Calculate tick timer if send is pending. */
 int tport_next_sctp_send_tick(tport_t *self,
-			    su_time_t *return_target, 
+			    su_time_t *return_target,
 			    char const **return_why)
 {
   unsigned timeout = 100;  /* Retry 10 times a second... */
@@ -293,7 +293,7 @@
   unsigned timeout = 100;
 
   /* Send timeout */
-  if (tport_has_queued(self) && 
+  if (tport_has_queued(self) &&
       su_time_cmp(su_time_add(self->tp_ktime, timeout), now) < 0) {
     uint64_t bytes = self->tp_stats.sent_bytes;
     su_time_t stime = self->tp_stime;
@@ -307,10 +307,10 @@
 
 /** Calculate next timer for SCTP. */
 int tport_sctp_next_timer(tport_t *self,
-			 su_time_t *return_target, 
+			 su_time_t *return_target,
 			 char const **return_why)
 {
-  return 
+  return
     tport_next_recv_timeout(self, return_target, return_why) |
     tport_next_sctp_send_tick(self, return_target, return_why);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c	Tue Dec 23 07:37:03 2008
@@ -50,8 +50,8 @@
 #include <sofia-sip/stun.h>
 
 static int tport_udp_init_stun(tport_primary_t *,
-			       tp_name_t tpn[1], 
-			       su_addrinfo_t *, 
+			       tp_name_t tpn[1],
+			       su_addrinfo_t *,
 			       tagi_t const *,
 			       char const **return_culprit);
 
@@ -98,8 +98,8 @@
 };
 
 static int tport_udp_init_stun(tport_primary_t *pri,
-			       tp_name_t tpn[1], 
-			       su_addrinfo_t *ai, 
+			       tp_name_t tpn[1],
+			       su_addrinfo_t *ai,
 			       tagi_t const *tags,
 			       char const **return_culprit)
 {
@@ -121,7 +121,7 @@
     return -1;
 
 #if 0
-  if (stun_obtain_shared_secret(sh, tport_stun_tls_cb, pri, 
+  if (stun_obtain_shared_secret(sh, tport_stun_tls_cb, pri,
 				TAG_NEXT(tags)) < 0) {
     return *return_culprit = "stun_request_shared_secret()", -1;
   }
@@ -142,8 +142,8 @@
 
 static void tport_udp_deinit_stun(tport_primary_t *pri)
 {
-  if (pri->pri_stun_handle) 
-    stun_handle_destroy(pri->pri_stun_handle); 
+  if (pri->pri_stun_handle)
+    stun_handle_destroy(pri->pri_stun_handle);
   pri->pri_stun_handle = NULL;
 }
 
@@ -195,18 +195,18 @@
     char ipname[SU_ADDRSIZE + 2] = { 0 };
     ai->ai_addr = (void *)su;
 
-    SU_DEBUG_5(("%s: stun_bind() ok: local address NATed as %s:%u\n", 
+    SU_DEBUG_5(("%s: stun_bind() ok: local address NATed as %s:%u\n",
 		__func__,
 		su_inet_ntop(su->su_family, SU_ADDR(su),
 			     ipname, sizeof(ipname)),
 		(unsigned) ntohs(su->su_port)));
   }
 
-  /* Send message to calling application indicating 
-   * there's a new public address available 
+  /* Send message to calling application indicating
+   * there's a new public address available
    */
   tport_has_been_updated(self);
-  
+
   return;
 }
 
@@ -221,12 +221,12 @@
   tport_primary_t *pri = tp->tp_pri;
   int err;
 
-  err = stun_keepalive(pri->pri_stun_handle, 
+  err = stun_keepalive(pri->pri_stun_handle,
 		       (su_sockaddr_t *)ai->ai_addr,
 		       STUNTAG_SOCKET(tp->tp_socket),
 		       STUNTAG_TIMEOUT(10000),
 		       TAG_NEXT(taglist));
-  
+
   if (err < 0)
     return -1;
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c	Tue Dec 23 07:37:03 2008
@@ -111,7 +111,7 @@
 
 static int tport_tcp_setsndbuf(int socket, int atleast);
 
-int tport_tcp_init_primary(tport_primary_t *pri, 
+int tport_tcp_init_primary(tport_primary_t *pri,
 			   tp_name_t tpn[1],
 			   su_addrinfo_t *ai,
 			   tagi_t const *tags,
@@ -129,7 +129,7 @@
   return tport_stream_init_primary(pri, socket, tpn, ai, tags, return_culprit);
 }
 
-int tport_stream_init_primary(tport_primary_t *pri, 
+int tport_stream_init_primary(tport_primary_t *pri,
 			      su_socket_t socket,
 			      tp_name_t tpn[1],
 			      su_addrinfo_t *ai,
@@ -168,7 +168,7 @@
   return 0;
 }
 
-int tport_tcp_init_client(tport_primary_t *pri, 
+int tport_tcp_init_client(tport_primary_t *pri,
 			  tp_name_t tpn[1],
 			  su_addrinfo_t *ai,
 			  tagi_t const *tags,
@@ -223,7 +223,7 @@
 {
   size_t i;
   char const *b = buffer;
-  
+
   for (i = 0; i < len; i++) {
     if (b[i] != '\r' && b[i] != '\n' && b[i] != ' ' && b[i] != '\t')
       break;
@@ -235,10 +235,10 @@
 /** Receive from stream.
  *
  * @retval -1 error
- * @retval 0  end-of-stream  
+ * @retval 0  end-of-stream
  * @retval 1  normal receive
  * @retval 2  incomplete recv, recv again
- * 
+ *
  */
 int tport_recv_stream(tport_t *self)
 {
@@ -343,8 +343,8 @@
 }
 
 /** Send to stream */
-ssize_t tport_send_stream(tport_t const *self, msg_t *msg, 
-			  msg_iovec_t iov[], 
+ssize_t tport_send_stream(tport_t const *self, msg_t *msg,
+			  msg_iovec_t iov[],
 			  size_t iovused)
 {
 #if __sun__			/* XXX - there must be a better way... */
@@ -356,7 +356,7 @@
 
 /** Calculate timeout if receive is incomplete. */
 int tport_next_recv_timeout(tport_t *self,
-			    su_time_t *return_target, 
+			    su_time_t *return_target,
 			    char const **return_why)
 {
   unsigned timeout = self->tp_params->tpp_timeout;
@@ -388,7 +388,7 @@
   unsigned timeout = self->tp_params->tpp_timeout;
 
   if (timeout < INT_MAX) {
-    if (self->tp_msg && 
+    if (self->tp_msg &&
 	su_time_cmp(su_time_add(self->tp_rtime, timeout), now) < 0) {
       msg_t *msg = self->tp_msg;
       msg_set_streaming(msg, 0);
@@ -399,7 +399,7 @@
 
 #if 0
     /* Send timeout */
-    if (tport_has_queued(self) && 
+    if (tport_has_queued(self) &&
 	su_time_cmp(su_time_add(self->tp_stime, timeout), now) < 0) {
       stime = su_time_add(self->tp_stime, self->tp_params->tpp_timeout);
       if (su_time_cmp(stime, target) < 0)
@@ -411,7 +411,7 @@
 
 /** Calculate next timeout for keepalive */
 int tport_next_keepalive(tport_t *self,
-			 su_time_t *return_target, 
+			 su_time_t *return_target,
 			 char const **return_why)
 {
   /* Keepalive timer */
@@ -446,9 +446,9 @@
   if (timeout != 0) {
     if (self->tp_ptime.tv_sec && !self->tp_recv_close &&
 	su_time_cmp(su_time_add(self->tp_ptime, timeout), now) < 0) {
-      SU_DEBUG_3(("%s(%p): %s to " TPN_FORMAT "%s\n", 
+      SU_DEBUG_3(("%s(%p): %s to " TPN_FORMAT "%s\n",
 		  __func__, (void *)self,
-		  "closing connection", TPN_ARGS(self->tp_name), 
+		  "closing connection", TPN_ARGS(self->tp_name),
 		  " because of PONG timeout"));
       tport_error_report(self, EPIPE, NULL);
       if (!self->tp_closed)
@@ -488,8 +488,8 @@
     int error = su_errno();
 
     why = " failed";
-    
-    if (!su_is_blocking(error)) 
+
+    if (!su_is_blocking(error))
       tport_error_report(self, error, NULL);
     else
       why = " blocking";
@@ -497,7 +497,7 @@
     return -1;
   }
 
-  SU_DEBUG_7(("%s(%p): %s to " TPN_FORMAT "%s\n", 
+  SU_DEBUG_7(("%s(%p): %s to " TPN_FORMAT "%s\n",
 	      __func__, (void *)self,
 	      "sending PING", TPN_ARGS(self->tp_name), why));
 
@@ -512,7 +512,7 @@
   if (tport_has_queued(self) || !self->tp_params->tpp_pong2ping)
     return 0;
 
-  SU_DEBUG_7(("%s(%p): %s to " TPN_FORMAT "%s\n", 
+  SU_DEBUG_7(("%s(%p): %s to " TPN_FORMAT "%s\n",
 	      __func__, (void *)self,
 	      "sending PONG", TPN_ARGS(self->tp_name), ""));
 
@@ -521,10 +521,10 @@
 
 /** Calculate next timer for TCP. */
 int tport_tcp_next_timer(tport_t *self,
-			 su_time_t *return_target, 
+			 su_time_t *return_target,
 			 char const **return_why)
 {
-  return 
+  return
     tport_next_recv_timeout(self, return_target, return_why) |
     tport_next_keepalive(self, return_target, return_why);
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tls.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tls.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tls.c	Tue Dec 23 07:37:03 2008
@@ -48,17 +48,30 @@
 #include <string.h>
 #include <sofia-sip/string0.h>
 
+#if HAVE_FUNC
+#elif HAVE_FUNCTION
+#define __func__ __FUNCTION__
+#else
+static char const __func__[] = "tport_type_tls";
+#endif
+
+#if HAVE_WIN32
+#include <io.h>
+#define access(_filename, _mode) _access(_filename, _mode)
+#define R_OK (04)
+#endif
+
 /* ---------------------------------------------------------------------- */
 /* TLS */
 
 #include "tport_tls.h"
 
 static int tport_tls_init_primary(tport_primary_t *,
-				  tp_name_t tpn[1], 
+				  tp_name_t tpn[1],
 				  su_addrinfo_t *, tagi_t const *,
 				  char const **return_culprit);
 static int tport_tls_init_client(tport_primary_t *,
-				 tp_name_t tpn[1], 
+				 tp_name_t tpn[1],
 				 su_addrinfo_t *, tagi_t const *,
 				 char const **return_culprit);
 static int tport_tls_init_master(tport_primary_t *pri,
@@ -161,6 +174,7 @@
   char *tbf = NULL;
   char const *path = NULL;
   unsigned tls_version = 1;
+  unsigned tls_verify = 0;
   su_home_t autohome[SU_HOME_AUTO_SIZE(1024)];
   tls_issues_t ti = {0};
 
@@ -172,6 +186,7 @@
   tl_gets(tags,
 	  TPTAG_CERTIFICATE_REF(path),
 	  TPTAG_TLS_VERSION_REF(tls_version),
+	  TPTAG_TLS_VERIFY_PEER_REF(tls_verify),
 	  TAG_END());
 
   if (!path) {
@@ -180,8 +195,9 @@
       homedir = "";
     path = tbf = su_sprintf(autohome, "%s/.sip/auth", homedir);
   }
-  
+
   if (path) {
+    ti.verify_peer = tls_verify;
     ti.verify_depth = 2;
     ti.configured = path != tbf;
     ti.randFile = su_sprintf(autohome, "%s/%s", path, "tls_seed.dat");
@@ -189,6 +205,7 @@
     ti.cert = ti.key;
     ti.CAfile = su_sprintf(autohome, "%s/%s", path, "cafile.pem");
     ti.version = tls_version;
+    ti.CApath = su_strdup(autohome, path);
 
     SU_DEBUG_9(("%s(%p): tls key = %s\n", __func__, (void *)pri, ti.key));
 
@@ -248,7 +265,7 @@
   tport_tls_t *tlstp = (tport_tls_t *)self;
 
   /* XXX - PPe: does the tls_shutdown zap everything but socket? */
-  if (tlstp->tlstp_context != NULL) 
+  if (tlstp->tlstp_context != NULL)
     tls_free(tlstp->tlstp_context);
   tlstp->tlstp_context = NULL;
 
@@ -277,16 +294,16 @@
   int mask = tls_events(tlstp->tlstp_context, self->tp_events);
 
   SU_DEBUG_7(("%s(%p): logical events%s%s real%s%s\n",
-	      "tport_tls_set_events", (void *)self, 
+	      "tport_tls_set_events", (void *)self,
 	      (self->tp_events & SU_WAIT_IN) ? " IN" : "",
 	      (self->tp_events & SU_WAIT_OUT) ? " OUT" : "",
 	      (mask & SU_WAIT_IN) ? " IN" : "",
 	      (mask & SU_WAIT_OUT) ? " OUT" : ""));
 
   return
-    su_root_eventmask(self->tp_master->mr_root, 
-		      self->tp_index, 
-		      self->tp_socket, 
+    su_root_eventmask(self->tp_master->mr_root,
+		      self->tp_index,
+		      self->tp_socket,
 		      mask);
 }
 
@@ -307,7 +324,7 @@
     else if (ret < 0)
       tport_error_report(self, errno, NULL);
   }
-  
+
   if ((self->tp_events & SU_WAIT_IN) && !self->tp_closed) {
     for (;;) {
       ret = tls_want_read(tlstp->tlstp_context, events);
@@ -344,15 +361,15 @@
     return 0;
 
   SU_DEBUG_7(("%s(%p): logical events%s%s real%s%s\n",
-	      "tport_tls_events", (void *)self, 
+	      "tport_tls_events", (void *)self,
 	      (events & SU_WAIT_IN) ? " IN" : "",
 	      (events & SU_WAIT_OUT) ? " OUT" : "",
 	      (mask & SU_WAIT_IN) ? " IN" : "",
 	      (mask & SU_WAIT_OUT) ? " OUT" : ""));
 
-  su_root_eventmask(self->tp_master->mr_root, 
-		    self->tp_index, 
-		    self->tp_socket, 
+  su_root_eventmask(self->tp_master->mr_root,
+		    self->tp_index,
+		    self->tp_socket,
 		    mask);
 
   return 0;
@@ -361,12 +378,12 @@
 /** Receive data from TLS.
  *
  * @retval -1 error
- * @retval 0  end-of-stream  
+ * @retval 0  end-of-stream
  * @retval 1  normal receive
  * @retval 2  incomplete recv, recv again
- * 
+ *
  */
-static 
+static
 int tport_tls_recv(tport_t *self)
 {
   tport_tls_t *tlstp = (tport_tls_t *)self;
@@ -407,7 +424,7 @@
     memcpy(iovec[i].mv_base, tls_buf + n, m);
     n += m;
   }
-    
+
   assert(N == n);
 
   /* Write the received data to the message dump file */
@@ -449,7 +466,7 @@
 
   for (i = 0; i < iovlen; i = j) {
 #if 0
-    nerror = tls_write(tlstp->tlstp_context, 
+    nerror = tls_write(tlstp->tlstp_context,
 		  iov[i].siv_base,
 		  m = iov[i].siv_len);
     j = i + 1;
@@ -460,7 +477,7 @@
     if (i + 1 == iovlen)
       buf = NULL;		/* Don't bother copying single chunk */
 
-    if (buf && 
+    if (buf &&
 	(char *)iov[i].siv_base - buf < TLSBUFSIZE &&
 	(char *)iov[i].siv_base - buf >= 0) {
       tlsbufsize = buf + TLSBUFSIZE - (char *)iov[i].siv_base;
@@ -483,8 +500,8 @@
     nerror = tls_write(tlstp->tlstp_context, buf, m);
 #endif
 
-    SU_DEBUG_9(("tport_tls_writevec: vec %p %p %lu ("MOD_ZD")\n",  
-		(void *)tlstp->tlstp_context, (void *)iov[i].siv_base, (LU)iov[i].siv_len, 
+    SU_DEBUG_9(("tport_tls_writevec: vec %p %p %lu ("MOD_ZD")\n",
+		(void *)tlstp->tlstp_context, (void *)iov[i].siv_base, (LU)iov[i].siv_len,
 		nerror));
 
     if (nerror == -1) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c	Tue Dec 23 07:37:03 2008
@@ -131,16 +131,16 @@
   tport_set_tos(s, ai, pri->pri_params->tpp_tos);
 
 #if HAVE_IP_ADD_MEMBERSHIP
-  if (ai->ai_family == AF_INET && 
+  if (ai->ai_family == AF_INET &&
       IN_MULTICAST(ntohl(su->su_sin.sin_addr.s_addr))) {
     /* Try to join to the multicast group */
-    /* Bind to the SIP address like 
+    /* Bind to the SIP address like
        <sip:88.77.66.55:5060;maddr=224.0.1.75;transport=udp> */
     struct ip_mreq imr[1];
     struct in_addr iface;
 
     memset(imr, 0, sizeof imr);
-      
+
     imr->imr_multiaddr = su->su_sin.sin_addr;
 
     if (host_is_ip4_address(tpn->tpn_canon) &&
@@ -153,7 +153,7 @@
 		  "IP_ADD_MEMBERSHIP", su_strerror(su_errno())));
     }
 #if HAVE_IP_MULTICAST_LOOP
-    else 
+    else
       if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, &one, sizeof one) < 0) {
 	SU_DEBUG_3(("setsockopt(%s): %s\n",
 		    "IP_MULTICAST_LOOP", su_strerror(su_errno())));
@@ -191,26 +191,26 @@
   }
 #endif
 
-  tl_gets(tags, 
+  tl_gets(tags,
 	  TPTAG_UDP_RMEM_REF(rmem),
 	  TPTAG_UDP_WMEM_REF(wmem),
 	  TAG_END());
 
-  if (rmem != 0 && 
+  if (rmem != 0 &&
 #if HAVE_SO_RCVBUFFORCE
       setsockopt(s, SOL_SOCKET, SO_RCVBUFFORCE, (void *)&rmem, sizeof rmem) < 0 &&
 #endif
       setsockopt(s, SOL_SOCKET, SO_RCVBUF, (void *)&rmem, sizeof rmem) < 0) {
-    SU_DEBUG_3(("setsockopt(SO_RCVBUF): %s\n", 
+    SU_DEBUG_3(("setsockopt(SO_RCVBUF): %s\n",
 		su_strerror(su_errno())));
   }
 
-  if (wmem != 0 && 
+  if (wmem != 0 &&
 #if HAVE_SO_SNDBUFFORCE
       setsockopt(s, SOL_SOCKET, SO_SNDBUFFORCE, (void *)&wmem, sizeof wmem) < 0 &&
 #endif
       setsockopt(s, SOL_SOCKET, SO_SNDBUF, (void *)&wmem, sizeof wmem) < 0) {
-    SU_DEBUG_3(("setsockopt(SO_SNDBUF): %s\n", 
+    SU_DEBUG_3(("setsockopt(SO_SNDBUF): %s\n",
 		su_strerror(su_errno())));
   }
 
@@ -255,7 +255,7 @@
     return;
 
   for (;;) {
-    n = su_recvfrom(tp->tp_socket, buffer, sizeof buffer, MSG_TRUNC, 
+    n = su_recvfrom(tp->tp_socket, buffer, sizeof buffer, MSG_TRUNC,
 		    (void *)&su, &sulen);
 
     if (n > (ssize_t)sizeof buffer) {
@@ -273,7 +273,7 @@
 /** Receive datagram.
  *
  * @retval -1 error
- * @retval 0  end-of-stream  
+ * @retval 0  end-of-stream
  * @retval 1  normal receive (should never happen)
  * @retval 2  incomplete recv, call me again (should never happen)
  * @retval 3  STUN keepalive, ignore
@@ -289,7 +289,7 @@
   uint8_t sample[1];
 
   /* Simulate packet loss */
-  if (self->tp_params->tpp_drop && 
+  if (self->tp_params->tpp_drop &&
       (unsigned)su_randint(0, 1000) < self->tp_params->tpp_drop) {
     su_recv(self->tp_socket, sample, 1, 0);
     SU_DEBUG_3(("tport(%p): simulated packet loss!\n", (void *)self));
@@ -326,9 +326,9 @@
   from = (su_sockaddr_t *)ai->ai_addr, fromlen = (socklen_t)(ai->ai_addrlen);
 
   n = su_vrecv(self->tp_socket, iovec, veclen, 0, from, &fromlen);
-  
+
   ai->ai_addrlen = fromlen;
-  
+
   if (n == SOCKET_ERROR) {
     int error = su_errno();
     msg_destroy(msg); self->tp_msg = NULL;
@@ -360,7 +360,7 @@
 
   if ((sample[0] & 0xf8) == 0xf8)
     /* SigComp */
-    return tport_recv_comp_dgram(self, self->tp_comp, &self->tp_msg, 
+    return tport_recv_comp_dgram(self, self->tp_comp, &self->tp_msg,
 				 from, fromlen);
 #if HAVE_SOFIA_STUN
   else if (sample[0] == 0 || sample[0] == 1)
@@ -372,8 +372,8 @@
 }
 
 /** Send using su_vsend(). Map IPv4 addresses as IPv6 addresses, if needed. */
-ssize_t tport_send_dgram(tport_t const *self, msg_t *msg, 
-			 msg_iovec_t iov[], 
+ssize_t tport_send_dgram(tport_t const *self, msg_t *msg,
+			 msg_iovec_t iov[],
 			 size_t iovused)
 {
   su_sockaddr_t su[1];
@@ -481,12 +481,12 @@
 	break;
       case SO_EE_ORIGIN_ICMP:
 	origin = "icmp";
-	snprintf(info, sizeof(info), " type=%u code=%u", 
+	snprintf(info, sizeof(info), " type=%u code=%u",
 		 ee->ee_type, ee->ee_code);
 	break;
       case SO_EE_ORIGIN_ICMP6:
 	origin = "icmp6";
-	snprintf(info, sizeof(info), " type=%u code=%u", 
+	snprintf(info, sizeof(info), " type=%u code=%u",
 		ee->ee_type, ee->ee_code);
 	break;
       case SO_EE_ORIGIN_NONE:
@@ -498,11 +498,11 @@
       }
 
       if (ee->ee_info)
-	snprintf(info + strlen(info), sizeof(info) - strlen(info), 
+	snprintf(info + strlen(info), sizeof(info) - strlen(info),
 		 " info=%08x", ee->ee_info);
 
       SU_DEBUG_3(("%s: %s (%d) [%s%s]\n",
-		  __func__, su_strerror(ee->ee_errno), ee->ee_errno, 
+		  __func__, su_strerror(ee->ee_errno), ee->ee_errno,
 		  origin, info));
       if (from->su_family != AF_UNSPEC)
 	SU_DEBUG_3(("\treported by [%s]:%u\n",

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url.h	Tue Dec 23 07:37:03 2008
@@ -34,7 +34,7 @@
 #ifndef URL_H_TYPES
 #define URL_H_TYPES
 
-/** Recognized URL schemes (value of url_t.url_type). 
+/** Recognized URL schemes (value of url_t.url_type).
  *
  * @sa &lt;<a href="http://www.iana.org/assignments/uri-schemes.html">http://www.iana.org/assignments/uri-schemes.html</a>&gt;
  */
@@ -63,12 +63,12 @@
   _url_none
 };
 
-/** URL structure. 
- * 
+/** URL structure.
+ *
  * This structure is used to present a parsed URL.
  */
 typedef struct {
-  char                url_pad[sizeof(void *) - 2];   
+  char                url_pad[sizeof(void *) - 2];
 				    /**< Zero pad for URL_STRING_P(). */
   signed char         url_type;	    /**< URL type (url_type_e). */
   char                url_root;	    /**< Nonzero if root "//" */
@@ -83,13 +83,13 @@
   char const         *url_fragment; /**< Fragment (separated by #) */
 } url_t;
 
-enum { 
+enum {
   /** Maximum size of a URL. */
   URL_MAXLEN = 65536
 };
 
 /** Type to present either a parsed URL or string.
- * 
+ *
  * The union type url_string_t is used to pass a parsed URL or string as a
  * parameter. The URL_STRING_P() checks if a passed pointer points to a
  * string or a parsed URL. Testing requires that the first character of the
@@ -113,7 +113,7 @@
 
 SOFIA_BEGIN_DECLS
 
-/** Convert a string to a url struct. */ 
+/** Convert a string to a url struct. */
 SOFIAPUBFUN url_t *url_make(su_home_t *h, char const *str);
 
 /** Convert a string formatting result to a url struct. */
@@ -122,7 +122,7 @@
 /** Convert #url_t to a string allocated from @a home */
 SOFIAPUBFUN char *url_as_string(su_home_t *home, url_t const *url);
 
-/** Duplicate the url to memory allocated via home */ 
+/** Duplicate the url to memory allocated via home */
 SOFIAPUBFUN url_t *url_hdup(su_home_t *h, url_t const *src);
 
 /** Sanitize a URL. */
@@ -169,7 +169,7 @@
 /* Query handling */
 
 /** Convert a URL query to a header string. */
-SOFIAPUBFUN char *url_query_as_header_string(su_home_t *home, 
+SOFIAPUBFUN char *url_query_as_header_string(su_home_t *home,
 					     char const *query);
 
 /* ---------------------------------------------------------------------- */
@@ -195,8 +195,8 @@
 /* ---------------------------------------------------------------------- */
 /* Initializing */
 
-/** Initializer for an #url_t structure. @HI 
- * 
+/** Initializer for an #url_t structure. @HI
+ *
  * The macro URL_INIT_AS() is used to initialize a #url_t structure with a
  * known url type:
  * @code
@@ -229,11 +229,11 @@
 /* ---------------------------------------------------------------------- */
 /* url_string_t handling */
 
-/** Test if a pointer to #url_string_t is a string 
+/** Test if a pointer to #url_string_t is a string
  * (not a pointer to a #url_t structure). */
 #define URL_STRING_P(u) ((u) && *((url_string_t*)(u))->us_str != 0)
 
-/** Test if a pointer to #url_string_t is a string 
+/** Test if a pointer to #url_string_t is a string
  * (not a pointer to a #url_t structure). */
 #define URL_IS_STRING(u) ((u) && *((url_string_t*)(u))->us_str != 0)
 
@@ -306,10 +306,10 @@
 /** Calculate the size of srings attached to the url. */
 SOFIAPUBFUN isize_t url_xtra(url_t const * url);
 
-/** Duplicate the url in the provided memory area. */ 
+/** Duplicate the url in the provided memory area. */
 SOFIAPUBFUN issize_t url_dup(char *, isize_t , url_t *dst, url_t const *src);
 
-/** Duplicate the url: use @a buf up to @a end. @HI */ 
+/** Duplicate the url: use @a buf up to @a end. @HI */
 #define URL_DUP(buf, end, dst, src) \
   (buf) += url_dup((buf), (isize_t)((buf) < (end) ? (end) - (buf) : 0), (dst), (src))
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag.h	Tue Dec 23 07:37:03 2008
@@ -59,9 +59,9 @@
 #define URLTAG_URL_REF(u)  urltag_url_ref, urltag_url_vr(&(u))
 
 #if SU_HAVE_INLINE
-su_inline 
+su_inline
 tag_value_t urltag_url_v(void const *v) { return (tag_value_t)v; }
-su_inline 
+su_inline
 tag_value_t urltag_url_vr(url_string_t const **vp) { return(tag_value_t)vp; }
 #else
 #define urltag_url_v(v)   (tag_value_t)(v)

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag_class.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag_class.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag_class.h	Tue Dec 23 07:37:03 2008
@@ -24,7 +24,7 @@
 
 #ifndef URL_TAG_CLASS_H
 /**Defined when <sofia-sip/url_tag_class.h> has been included. */
-#define URL_TAG_CLASS_H 
+#define URL_TAG_CLASS_H
 /**@file  url_tag_class.h
  * @brief Tag classes for URLs
  *

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c	Tue Dec 23 07:37:03 2008
@@ -71,9 +71,9 @@
                       "abcdefghijklmnopqrstuvwxyz" \
                       "0123456789" \
                       "-_.!~*'()"
-  
+
   char unreserved[26 + 26 + 10 + 9 + 1];
-  
+
   BEGIN();
 
   d = url_as_string(home, (url_t *)"sip:joe at example.com");
@@ -86,9 +86,9 @@
   TEST_1(!url_reserved_p(""));
   TEST_1(url_reserved_p("foobar:bar"));
 
-  TEST_SIZE(url_esclen("a" EXCLUDED, ""), 
+  TEST_SIZE(url_esclen("a" EXCLUDED, ""),
 	    1 + strlen(RESERVED) + 3 * strlen(DELIMS UNWISE));
-  TEST_SIZE(url_esclen("a" EXCLUDED, DELIMS UNWISE), 
+  TEST_SIZE(url_esclen("a" EXCLUDED, DELIMS UNWISE),
 	    1 + strlen(RESERVED) + 3 * strlen(DELIMS UNWISE));
   TEST_SIZE(url_esclen("a" EXCLUDED, EXCLUDED), 1 + 3 * strlen(EXCLUDED));
   TEST_SIZE(url_esclen("a" EXCLUDED, NULL), 1 + 3 * strlen(EXCLUDED));
@@ -184,14 +184,14 @@
   TEST_1(u = url_hdup(home, url));
   TEST(u->url_type, url_any);
   TEST(url_cmp(any, u), 0);
-  
+
   url_digest(hash1, sizeof(hash1), url, NULL);
   url_digest(hash2, sizeof(hash2), (url_t *)"*", NULL);
   TEST(memcmp(hash1, hash2, sizeof(hash1)), 0);
 
   {
     char buf[6];
-    
+
     TEST_1(u = url_hdup(home, (void *)"error"));
     TEST_SIZE(url_xtra(u), 6);
     TEST_SIZE(url_dup(buf, 6, url, u), 6);
@@ -227,7 +227,7 @@
   }
 
   su_home_deinit(home);
-  
+
   END();
 }
 
@@ -238,17 +238,17 @@
   url_t sip[1] = { URL_INIT_AS(sip) };
   url_t *u, url[1];
   char *tst, *s;
-  char sipurl0[] = 
+  char sipurl0[] =
     "sip:pekka%2Epessi at nokia%2Ecom;method=%4D%45%53%53%41%47%45"
     "?body=CANNED%20MSG";
-  char sipurl[] = 
+  char sipurl[] =
     "sip:user:pass at host:32;param=1"
     "?From=foo at bar&To=bar at baz#unf";
-  char sip2url[] = 
+  char sip2url[] =
     "sip:user/path;tel-param:pass at host:32;param=1%3d%3d1"
     "?From=foo at bar&To=bar at baz#unf";
   char sip2[sizeof(sipurl) + 32];
-  char sipsurl[] = 
+  char sipsurl[] =
     "sips:user:pass at host:32;param=1"
     "?From=foo at bar&To=bar at baz#unf";
   size_t i, j;
@@ -277,7 +277,7 @@
 
   TEST_S(url_query_as_header_string(home, url->url_headers),
 	 "\n\nCANNED MSG");
-  
+
   sip->url_user = "user";
   sip->url_password = "pass";
   sip->url_host = "host";
@@ -297,7 +297,7 @@
   TEST_1(url_cmp(sip, u) == 0);
   TEST(url_e(sip2, sizeof(sip2), u), strlen(sipurl));
   TEST_1(strcmp(sip2, sipurl) == 0);
-  TEST_SIZE(snprintf(sip2, sizeof(sip2), URL_PRINT_FORMAT, 
+  TEST_SIZE(snprintf(sip2, sizeof(sip2), URL_PRINT_FORMAT,
 		     URL_PRINT_ARGS(sip)), strlen(sipurl));
   TEST_1(strcmp(sip2, sipurl) == 0);
 
@@ -395,11 +395,11 @@
 
   u = url_hdup(home, (void*)"sip:u:p at host:5060;user=phone;transport=tcp");
   TEST_1(u);
-  TEST_1(url_have_transport(u));  
+  TEST_1(url_have_transport(u));
   TEST_1(url_strip_transport(u));
   TEST_S(u->url_params, "user=phone");
   TEST_1(!url_have_transport(u));
-  
+
   u = url_hdup(home, (void*)"sip:u:p at host;user=phone;;");
   TEST_1(u);
   /* We don't have transport params */
@@ -470,14 +470,14 @@
   char *tst;
   char wvurl[] = "wv:+12345678 at imps.com";
   char wv2[sizeof(wvurl) + 32];
-  
+
   BEGIN();
 
   TEST_S(url_scheme(url_wv), "wv");
 
   wv->url_user = "+12345678";
   wv->url_host = "imps.com";
-  
+
   TEST_1(tst = su_strdup(home, wvurl));
   TEST_1(url_d(url, tst) == 0);
   TEST_1(url_cmp(wv, url) == 0);
@@ -488,7 +488,7 @@
   TEST_1(url_cmp(wv, u) == 0);
   TEST_SIZE(url_e(wv2, sizeof(wv2), u), strlen(wvurl));
   TEST_1(strcmp(wv2, wvurl) == 0);
-  TEST_SIZE(snprintf(wv2, sizeof(wv2), URL_PRINT_FORMAT, 
+  TEST_SIZE(snprintf(wv2, sizeof(wv2), URL_PRINT_FORMAT,
 		     URL_PRINT_ARGS(wv)), strlen(wvurl));
   TEST_1(strcmp(wv2, wvurl) == 0);
 
@@ -512,13 +512,13 @@
   url_t tel[1] = { URL_INIT_AS(tel) };
   url_t *u, url[1];
   char *tst;
-  char telurl[] = 
+  char telurl[] =
     "tel:+12345678"
     ";param=1;param=2"
     "?From=foo at bar&To=bar at baz#unf";
   char tel2[sizeof(telurl) + 32];
   url_t *a, *b;
-  
+
   BEGIN();
 
   TEST_S(url_scheme(url_tel), "tel");
@@ -527,7 +527,7 @@
   tel->url_params = "param=1;param=2";
   tel->url_headers = "From=foo at bar&To=bar at baz";
   tel->url_fragment = "unf";
-  
+
   TEST_1(tst = su_strdup(home, telurl));
   TEST_1(url_d(url, tst) == 0);
   TEST_1(url_cmp(tel, url) == 0);
@@ -540,7 +540,7 @@
   TEST_1(url_cmp(tel, u) == 0);
   TEST_SIZE(url_e(tel2, sizeof(tel2), u), strlen(telurl));
   TEST_1(strcmp(tel2, telurl) == 0);
-  TEST_SIZE(snprintf(tel2, sizeof(tel2), URL_PRINT_FORMAT, 
+  TEST_SIZE(snprintf(tel2, sizeof(tel2), URL_PRINT_FORMAT,
 		     URL_PRINT_ARGS(tel)), strlen(telurl));
   TEST_1(strcmp(tel2, telurl) == 0);
 
@@ -566,7 +566,7 @@
   url_t fax[1] = { URL_INIT_AS(fax) };
   url_t *u, url[1];
   char *tst;
-  char faxurl[] = 
+  char faxurl[] =
     "fax:+12345678"
     ";param=1;param=2"
     "?From=foo at bar&To=bar at baz#unf";
@@ -590,7 +590,7 @@
   TEST_1(url_cmp(fax, u) == 0);
   TEST_SIZE(url_e(fax2, sizeof(fax2), u), strlen(faxurl));
   TEST_1(strcmp(fax2, faxurl) == 0);
-  TEST_SIZE(snprintf(fax2, sizeof(fax2), URL_PRINT_FORMAT, 
+  TEST_SIZE(snprintf(fax2, sizeof(fax2), URL_PRINT_FORMAT,
 		     URL_PRINT_ARGS(fax)), strlen(faxurl));
   TEST_1(strcmp(fax2, faxurl) == 0);
 
@@ -611,7 +611,7 @@
   url_t modem[1] = { URL_INIT_AS(modem) };
   url_t *u, url[1];
   char *tst;
-  char modemurl[] = 
+  char modemurl[] =
     "modem:+12345678"
     ";param=1;param=2"
     "?From=foo at bar&To=bar at baz#unf";
@@ -635,7 +635,7 @@
   TEST_1(url_cmp(modem, u) == 0);
   TEST_SIZE(url_e(modem2, sizeof(modem2), u), strlen(modemurl));
   TEST_1(strcmp(modem2, modemurl) == 0);
-  TEST_SIZE(snprintf(modem2, sizeof(modem2), URL_PRINT_FORMAT, 
+  TEST_SIZE(snprintf(modem2, sizeof(modem2), URL_PRINT_FORMAT,
 		     URL_PRINT_ARGS(modem)), strlen(modemurl));
   TEST_1(strcmp(modem2, modemurl) == 0);
 
@@ -676,7 +676,7 @@
   TEST(url_cmp(file, u), 0);
   TEST_SIZE(url_e(buf1, sizeof(buf1), u), strlen(fileurl));
   TEST_S(buf1, fileurl);
-  TEST_SIZE(snprintf(buf2, sizeof(buf2), URL_PRINT_FORMAT, URL_PRINT_ARGS(u)), 
+  TEST_SIZE(snprintf(buf2, sizeof(buf2), URL_PRINT_FORMAT, URL_PRINT_ARGS(u)),
 	    strlen(fileurl));
   TEST_S(buf2, fileurl);
 
@@ -702,8 +702,8 @@
 
   BEGIN();
 
-  ldap->url_type = url_unknown; 
-  ldap->url_scheme = "ldap"; 
+  ldap->url_type = url_unknown;
+  ldap->url_scheme = "ldap";
 
   /* TEST_S(url_scheme(url_ldap), "ldap"); */
 
@@ -732,7 +732,7 @@
   TEST(url_cmp(ldap, u), 0);
   TEST_SIZE(url_e(buf1, sizeof(buf1), u), strlen(ldapurl));
   TEST_S(buf1, ldapurl);
-  TEST_SIZE(snprintf(buf2, sizeof(buf2), URL_PRINT_FORMAT, URL_PRINT_ARGS(u)), 
+  TEST_SIZE(snprintf(buf2, sizeof(buf2), URL_PRINT_FORMAT, URL_PRINT_ARGS(u)),
 	    strlen(ldapurl));
   TEST_S(buf2, ldapurl);
 
@@ -775,7 +775,7 @@
   TEST_1(url_cmp(rtsp, u) == 0);
   TEST(url_e(rtsp2, sizeof(rtsp2), u), strlen(rtspurl));
   TEST_1(strcmp(rtsp2, rtspurl) == 0);
-  TEST_SIZE(snprintf(rtsp2, sizeof(rtsp2), URL_PRINT_FORMAT, 
+  TEST_SIZE(snprintf(rtsp2, sizeof(rtsp2), URL_PRINT_FORMAT,
 		     URL_PRINT_ARGS(rtsp)), strlen(rtspurl));
   TEST_1(strcmp(rtsp2, rtspurl) == 0);
 
@@ -807,12 +807,12 @@
   url_t http[1] = { URL_INIT_AS(http) };
   url_t *u, url[1];
   char *tst;
-  char httpurl[] = 
+  char httpurl[] =
     "http://user:pass@host:32/foo;param=1/bar;param=3"
     "?From=foo at bar&To=bar at baz#unf";
   char http2[sizeof(httpurl) + 32];
 
-  char queryonly[] = 
+  char queryonly[] =
     "http://some.host?query";
 
   BEGIN();
@@ -838,7 +838,7 @@
   TEST_1(url_cmp(http, u) == 0);
   TEST_SIZE(url_e(http2, sizeof(http2), u), strlen(httpurl));
   TEST_1(strcmp(http2, httpurl) == 0);
-  TEST_SIZE(snprintf(http2, sizeof(http2), URL_PRINT_FORMAT, 
+  TEST_SIZE(snprintf(http2, sizeof(http2), URL_PRINT_FORMAT,
 		     URL_PRINT_ARGS(http)), strlen(httpurl));
   TEST_1(strcmp(http2, httpurl) == 0);
 
@@ -859,10 +859,10 @@
   TEST_S(u->url_headers, "here");
 
   url_digest(hash1, sizeof(hash1), u, NULL);
-  url_digest(hash2, sizeof(hash2), (url_t *)"http://[::1]/test;ing?here", 
+  url_digest(hash2, sizeof(hash2), (url_t *)"http://[::1]/test;ing?here",
 	     NULL);
   TEST(memcmp(hash1, hash2, sizeof(hash1)), 0);
-    
+
   su_home_deinit(home);
 
   END();
@@ -920,7 +920,7 @@
   url_string_t *us0 = NULL;
 
   tagi_t *lst, *dup;
-  
+
   tag_value_t value;
   char *s;
   su_home_t home[1] = { SU_HOME_INIT(home) };
@@ -977,7 +977,7 @@
   tagi_t *lst, *result;
 
   lst = tl_list(TAG_A("X"),
-		TAG_SKIP(2), 
+		TAG_SKIP(2),
 		URLTAG_URL((void *)"urn:foo"),
 		TAG_B("Y"),
 		URLTAG_URL((void *)"urn:bar"),
@@ -997,8 +997,8 @@
   END();
 }
 
-#if 0 
-/* This is just a spike. How we can get 
+#if 0
+/* This is just a spike. How we can get
  *   register_printf_function('U', printf_url, printf_url_info)
  * run while initializing?
  */
@@ -1014,7 +1014,7 @@
 }
 
 /* This is the appropriate argument information function for `printf_url'.  */
-int printf_url_info(const struct printf_info *info, 
+int printf_url_info(const struct printf_info *info,
 		    size_t n, int *argtypes)
 {
   if (n > 0) {
@@ -1027,7 +1027,7 @@
 
 int test_print(void)
 {
-#if 0 
+#if 0
   url_t u0[1];
   url_t *u1 = NULL;
   url_t const *u2 = (void *)-1;
@@ -1080,7 +1080,7 @@
     else
       usage(1);
   }
-  
+
 #if HAVE_OPEN_C
   tstflags |= tst_verbatim;
 #endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url.c	Tue Dec 23 07:37:03 2008
@@ -53,7 +53,7 @@
  * The macro URL_PRINT_FORMAT is used in format string of printf() or
  * similar printing functions.  A URL can be printed like this:
  * @code
- *   printf("%s received URL " URL_PRINT_FORMAT "\n", 
+ *   printf("%s received URL " URL_PRINT_FORMAT "\n",
  *          my_name, URL_PRINT_ARGS(url));
  * @endcode
  */
@@ -65,7 +65,7 @@
  * or similar printing functions.  Using it, a URL can be printed like this:
  *
  * @code
- *   printf("%s received URL " URL_PRINT_FORMAT "\n", 
+ *   printf("%s received URL " URL_PRINT_FORMAT "\n",
  *          my_name, URL_PRINT_ARGS(url));
  * @endcode
  */
@@ -146,14 +146,14 @@
 static char *url_canonize(char *d, char const *s, size_t n,
 			  unsigned syn33,
 			  char const allowed[]);
-static char *url_canonize2(char *d, char const *s, size_t n, 
+static char *url_canonize2(char *d, char const *s, size_t n,
 			   unsigned syn33,
 			   unsigned m32, unsigned m64, unsigned m96);
 static int url_tel_cmp_numbers(char const *A, char const *B);
 
-/**Test if string contains excluded or url-reserved characters. 
+/**Test if string contains excluded or url-reserved characters.
+ *
  *
- * 
  *
  * @param s  string to be searched
  *
@@ -162,7 +162,7 @@
  */
 int url_reserved_p(char const *s)
 {
-  if (s) 
+  if (s)
     while (*s) {
       unsigned char u = *s++;
 
@@ -177,11 +177,11 @@
  *
  * Calculate the length of string @a s when the excluded or reserved
  * characters in it have been escaped.
- * 
+ *
  * @param s         String with reserved URL characters. [IN
  * @param reserved  Optional array of reserved characters [IN]
  *
- * @return 
+ * @return
  * The number of characters in corresponding but escaped string.
  *
  * You can handle a part of URL with reserved characters like this:
@@ -230,7 +230,7 @@
 {
   char *retval = d;
   unsigned mask32, mask64, mask96;
- 
+
   MASKS_WITH_RESERVED(reserved, mask32, mask64, mask96);
 
   while (s && *s) {
@@ -251,7 +251,7 @@
   }
 
   *d = '\0';
-  
+
   return retval;
 }
 
@@ -350,7 +350,7 @@
   size_t i = 0;
 
   if (d == s)
-    for (;s[i] && i < n; d++, i++) 
+    for (;s[i] && i < n; d++, i++)
       if (s[i] == '%')
 	break;
 
@@ -365,12 +365,12 @@
     }
 
     h1 = s[i + 1], h2 = s[i + 2];
-    
+
     if (!IS_HEX(h1) || !IS_HEX(h2)) {
       *d = '\0';
       return NULL;
     }
-    
+
 #define UNHEX(a) (a - (a >= 'a' ? 'a' - 10 : (a >= 'A' ? 'A' - 10 : '0')))
     c = (UNHEX(h1) << 4) | UNHEX(h2);
 
@@ -391,7 +391,7 @@
     d +=2, i += 2;
 #undef    UNHEX
   }
-  
+
   *d = '\0';
 
   return d;
@@ -400,7 +400,7 @@
 
 /** Canonize a URL component (with precomputed mask).
  *
- * This version does not flag error if *s contains character that should 
+ * This version does not flag error if *s contains character that should
  * be escaped.
  */
 static
@@ -410,7 +410,7 @@
   size_t i = 0;
 
   if (d == s)
-    for (;s[i] && i < n; d++, i++) 
+    for (;s[i] && i < n; d++, i++)
       if (s[i] == '%')
 	break;
 
@@ -423,12 +423,12 @@
     }
 
     h1 = s[i + 1], h2 = s[i + 2];
-    
+
     if (!IS_HEX(h1) || !IS_HEX(h2)) {
       *d = '\0';
       return NULL;
     }
-    
+
 #define UNHEX(a) (a - (a >= 'a' ? 'a' - 10 : (a >= 'A' ? 'A' - 10 : '0')))
     c = (UNHEX(h1) << 4) | UNHEX(h2);
 
@@ -448,7 +448,7 @@
     d +=2, i += 2;
 #undef    UNHEX
   }
-  
+
   *d = '\0';
 
   return d;
@@ -478,7 +478,7 @@
   case url_msrp:   return "msrp";
   case url_msrps:  return "msrps";
   case url_wv:     return "wv";
-  default:       
+  default:
     assert(url_type == url_unknown);
     return NULL;
   }
@@ -487,10 +487,10 @@
 su_inline
 int url_type_is_opaque(enum url_type_e url_type)
 {
-  return 
+  return
     url_type == url_invalid ||
-    url_type == url_tel || 
-    url_type == url_modem || 
+    url_type == url_tel ||
+    url_type == url_modem ||
     url_type == url_fax ||
     url_type == url_cid;
 }
@@ -513,29 +513,29 @@
 {
 #define test_scheme(s) \
    if (len == strlen(#s) && !strncasecmp(scheme, #s, len)) return url_##s
-  
+
   switch (scheme[0]) {
   case '*': if (strcmp(scheme, "*") == 0) return url_any;
-  case 'c': case 'C': 
+  case 'c': case 'C':
     test_scheme(cid); break;
-  case 'f': case 'F': 
+  case 'f': case 'F':
     test_scheme(ftp); test_scheme(file); test_scheme(fax); break;
-  case 'h': case 'H': 
+  case 'h': case 'H':
     test_scheme(http); test_scheme(https); break;
-  case 'i': case 'I': 
+  case 'i': case 'I':
     test_scheme(im); break;
-  case 'm': case 'M': 
-    test_scheme(mailto); test_scheme(modem); 
+  case 'm': case 'M':
+    test_scheme(mailto); test_scheme(modem);
     test_scheme(msrp); test_scheme(msrps); break;
-  case 'p': case 'P': 
+  case 'p': case 'P':
     test_scheme(pres); break;
-  case 'r': case 'R': 
+  case 'r': case 'R':
     test_scheme(rtsp); test_scheme(rtspu); break;
-  case 's': case 'S': 
+  case 's': case 'S':
     test_scheme(sip); test_scheme(sips); break;
-  case 't': case 'T': 
+  case 't': case 'T':
     test_scheme(tel); break;
-  case 'w': case 'W': 
+  case 'w': case 'W':
     test_scheme(wv); break;
 
 
@@ -560,7 +560,7 @@
  *
  * @note The parsed string @a s will be modified when parsing it.
  *
- * @retval 0 if successful, 
+ * @retval 0 if successful,
  * @retval -1 otherwise.
  */
 static
@@ -571,7 +571,7 @@
   int have_authority = 1;
 
   memset(url, 0, sizeof(*url));
-  
+
   if (strcmp(s, "*") == 0) {
     url->url_type = url_any;
     url->url_scheme = "*";
@@ -636,7 +636,7 @@
 	host += 2; s += 2, url->url_root = '/';
 	n = strcspn(s, "/?#@[]");
       }
-      else 
+      else
 	n = strcspn(s, "@;/?#");
 
       if (s[n] == '@')
@@ -691,7 +691,7 @@
     default:
       break;
     }
-    
+
     if (host[n] == ':') {
       char *port = host + n + 1;
       url->url_port = port;
@@ -712,8 +712,8 @@
 	/* Port can be *digit, empty string or "*" */
 	while (*port >= '0' && *port <= '9')
 	  port++;
-	
-	if (port != url->url_port ? port[0] != '\0' 
+
+	if (port != url->url_port ? port[0] != '\0'
 	    : (port[0] != '*' || port[1] != '\0'))
 	  return -1;
       }
@@ -755,7 +755,7 @@
  *
  * @note The parsed string @a s will be modified when parsing it.
  *
- * @retval 0 if successful, 
+ * @retval 0 if successful,
  * @retval -1 otherwise.
  */
 int url_d(url_t *url, char *s)
@@ -799,7 +799,7 @@
 
   /* port is canonized by _url_d() */
   s = (char *)url->url_path;
-  if (s && !url_canonize(s, s, SIZE_MAX, 
+  if (s && !url_canonize(s, s, SIZE_MAX,
 			 /* Allow all URI characters but ? */
 			 /* Allow unescaped /;?@, - but do not convert */
 			 SYN33('/') | SYN33(';') | SYN33('=') | SYN33('@') |
@@ -816,7 +816,7 @@
 			 /* Convert escaped /:&+$ to unescaped */
 			 "/:&+$"))
     return -1;
-  
+
   /* Unhex alphanumeric and unreserved URI characters */
   s = (char *)url->url_headers;
   if (s && !url_canonize3(s, s, SIZE_MAX, RESERVED_MASK))
@@ -830,8 +830,8 @@
   return 0;
 }
 
-/** Encode an URL. 
- * 
+/** Encode an URL.
+ *
  * The function url_e() combines a URL from substrings in url_t structure
  * according the @ref url_syntax "URL syntax" presented above.  The encoded
  * @a url is stored in a @a buffer of @a n bytes.
@@ -840,8 +840,8 @@
  * @param n      size of @a buffer.
  * @param url    URL to be encoded.
  *
- * @return 
- * Return the number of bytes in the encoding.  
+ * @return
+ * Return the number of bytes in the encoding.
  *
  * @note The function follows the convention set by C99 snprintf().  Even if
  * the result does not fit into the @a buffer and it is truncated, the
@@ -904,7 +904,7 @@
 
     if (url->url_password) {
       if (do_copy && (do_copy = 1 <= n))
-	*b = ':'; 
+	*b = ':';
       b++; n--;
       i = strlen(url->url_password);
       if (do_copy && (do_copy = i <= n))
@@ -914,7 +914,7 @@
 
     if (url->url_host) {
       if (do_copy && (do_copy = 1 <= n))
-	*b = '@'; 
+	*b = '@';
       b++; n--;
     }
   }
@@ -930,7 +930,7 @@
       if (do_copy && (do_copy = i <= n)) {
 	b[0] = ':';
 	memcpy(b + 1, url->url_port, i - 1);
-      } 
+      }
       b += i; n -= i;
     }
   }
@@ -946,7 +946,7 @@
       memcpy(b, url->url_path, i);
     b += i; n -= i;
   }
-  
+
   {
     static char const sep[] = ";?#";
     char const *pp[3];
@@ -974,15 +974,15 @@
     buffer[m - 1] = '\0';
 
   assert((size_t)(b - buffer) == (size_t)(m - n));
-  
-  /* This follows the snprintf(C99) return value, 
+
+  /* This follows the snprintf(C99) return value,
    * Number of characters written (excluding NUL)
    */
   return b - buffer;
 }
 
 
-/** Calculate the length of URL when encoded. 
+/** Calculate the length of URL when encoded.
  *
  */
 isize_t url_len(url_t const * url)
@@ -992,7 +992,7 @@
   if (url->url_scheme) rv += strlen(url->url_scheme) + 1; /* plus ':' */
   if (url->url_user) {
     rv += strlen(url->url_user);
-    if (url->url_password) 
+    if (url->url_password)
       rv += strlen(url->url_password) + 1;   /* plus ':' */
     rv += url->url_host != NULL;  /* plus '@' */
   }
@@ -1007,11 +1007,11 @@
 }
 
 /**@def URL_E(buf, end, url)
- * Encode an URL: use @a buf up to @a end. 
+ * Encode an URL: use @a buf up to @a end.
  * @hideinitializer
  */
 
-/** 
+/**
  * Calculate the size of strings associated with a #url_t sructure.
  *
  * @param url pointer to a #url_t structure or string
@@ -1026,7 +1026,7 @@
   }
   else {
     size_t len_scheme, len_user, len_password,
-      len_host, len_port, len_path, len_params, 
+      len_host, len_port, len_path, len_params,
       len_headers, len_fragment;
 
     len_scheme = (url->url_type <= url_unknown && url->url_scheme) ?
@@ -1061,7 +1061,7 @@
   for (; buf < end && (*buf = *src); buf++, src++)
     ;
 
-  if (buf >= end) 
+  if (buf >= end)
     while (*src++)
       buf++;
 
@@ -1069,12 +1069,12 @@
 #endif
 }
 
-/** 
+/**
  * Duplicate the url.
- * 
+ *
  * The function url_dup() copies the url structure @a src and the strings
  * attached to it to @a url.  The non-constant strings in @a src are copied
- * to @a buf.  If the size of duplicated strings exceed @a bufsize, the 
+ * to @a buf.  If the size of duplicated strings exceed @a bufsize, the
  * corresponding string fields in @a url are set to NULL.
  *
  * The calling function can calculate the size of buffer required by calling
@@ -1108,7 +1108,7 @@
   else {
     char *b = buf;
     char *end = b + bufsize;
-    char const **dstp; 
+    char const **dstp;
     char const * const *srcp;
     url_t dst0[1];
 
@@ -1154,7 +1154,7 @@
 }
 
 /**@def URL_DUP(buf, end, dst, src)
- *  Duplicate the url: use @a buf up to @a end. @HI 
+ *  Duplicate the url: use @a buf up to @a end. @HI
  *
  * The macro URL_DUP() duplicates the url.  The non-constant strings in @a
  * src are copied to @a buf.  However, no strings are copied past @a end.
@@ -1169,14 +1169,14 @@
  * @param dst     Destination URL structure.
  * @param src     Source URL structure.
  *
- * @return 
- * The macro URL_DUP() returns pointer to first unused byte in the 
+ * @return
+ * The macro URL_DUP() returns pointer to first unused byte in the
  * buffer @a buf.
  */
 
 /** Duplicate the url to memory allocated via home.
  *
- * The function url_hdup() duplicates (deep copies) an #url_t structure. 
+ * The function url_hdup() duplicates (deep copies) an #url_t structure.
  * Alternatively, it can be passed a string; string is then copied and
  * parsed to the #url_t structure.
  *
@@ -1190,7 +1190,7 @@
  * @return
  * The function url_hdup() returns a pointer to the newly allocated #url_t
  * structure, or NULL upon an error.
- */ 
+ */
 url_t *url_hdup(su_home_t *home, url_t const *src)
 {
   if (src) {
@@ -1211,13 +1211,13 @@
 }
 
 
-/** Convert an string to an url */ 
+/** Convert an string to an url */
 url_t *url_make(su_home_t *h, char const *str)
 {
   return url_hdup(h, URL_STRING_MAKE(str)->us_url);
 }
 
-/** Print an URL */ 
+/** Print an URL */
 url_t *url_format(su_home_t *h, char const *fmt, ...)
 {
   url_t *url;
@@ -1263,7 +1263,7 @@
 }
 
 
-/** Test if param @a tag matches to parameter string @a p. 
+/** Test if param @a tag matches to parameter string @a p.
  */
 #define URL_PARAM_MATCH(p, tag) \
  (strncasecmp(p, tag, strlen(tag)) == 0 && \
@@ -1274,8 +1274,8 @@
  *
  * This function searches for a parameter from a parameter list.
  *
- * If you want to test if there is parameter @b user=phone, 
- * call this function like 
+ * If you want to test if there is parameter @b user=phone,
+ * call this function like
  * @code if (url_param(url->url_param, "user=phone", NULL, 0))
  * @endcode
  *
@@ -1287,8 +1287,8 @@
  * @retval positive length of parameter value (including final NUL) if found
  * @retval zero     if not found.
  */
-isize_t url_param(char const *params, 
-		  char const *tag, 
+isize_t url_param(char const *params,
+		  char const *tag,
 		  char value[], isize_t vlen)
 {
   size_t n, tlen, flen;
@@ -1309,7 +1309,7 @@
     if (strncasecmp(p, tag, tlen) == 0) {
       if (n == tlen) {
 	if (vlen > 0)
-	  value[0] = '\0';	
+	  value[0] = '\0';
 	return 1;
       }
       if (p[tlen] != '=')
@@ -1328,9 +1328,9 @@
   return 0;
 }
 
-/** Check for a parameter. 
+/** Check for a parameter.
  *
- * @deprecated 
+ * @deprecated
  * Bad grammar. Use url_has_param().
  */
 isize_t url_have_param(char const *params, char const *tag)
@@ -1354,7 +1354,7 @@
 
   if (!s)
     return -1;
-  
+
   if (url->url_params)
     strcpy(s, url->url_params)[n - 1] = ';';
   strcpy(s + n, param);
@@ -1374,7 +1374,7 @@
 {
   if (params && name) {
     size_t i, n = strlen(name), remove, rest;
-    
+
     for (i = 0; params[i];) {
       if (strncasecmp(params + i, name, n) ||
 	  (params[i + n] != '=' && params[i + n] != ';' && params[i + n])) {
@@ -1429,7 +1429,7 @@
 
   if (url->url_type != url_sip && url->url_type != url_sips)
     return 0;
-  
+
   if (url->url_port != NULL) {
     if (!modify)
       return 1;
@@ -1475,13 +1475,13 @@
 
   if (d != url->url_params)
     *d = '\0';
-  else 
+  else
     url->url_params = NULL;
 
   return 1;
 }
 
-/** Strip transport-specific stuff. 
+/** Strip transport-specific stuff.
  *
  * The function url_strip_transport() removes transport-specific parameters
  * from a SIP or SIPS URI.  These parameters include:
@@ -1497,7 +1497,7 @@
  * @note
  * If the parameter string contains empty parameters, they are stripped, too.
  *
- * @return 
+ * @return
  * The function url_strip_transport() returns @e true, if the URL was
  * modified, @e false otherwise.
  */
@@ -1506,14 +1506,14 @@
   return url_strip_transport2(url, 1);
 }
 
-/** Check for transport-specific stuff. 
+/** Check for transport-specific stuff.
  *
  * The function url_have_transport() tests if there are transport-specific
  * parameters in a SIP or SIPS URI. These parameters include:
  * - the port number
  * - "maddr=" parameters
  * - "transport=" parameters
- * 
+ *
  * @note
  * The @a url must be a pointer to a URL structure.
  *
@@ -1538,7 +1538,7 @@
  *
  * @note Currently, the url parameters are not compared. This is because the
  * url_cmp() is used to sort URLs: taking parameters into account makes that
- * impossible. 
+ * impossible.
  */
 int url_cmp(url_t const *a, url_t const *b)
 {
@@ -1556,7 +1556,7 @@
     /* presence and instant messaging URLs match magically with SIP */
     enum url_type_e a_type = a->url_type;
     enum url_type_e b_type = b->url_type;
-    
+
     if (a_type == url_im || a_type == url_pres)
       a_type = url_sip;
 
@@ -1570,7 +1570,7 @@
 
   url_type = a->url_type;	/* Or b->url_type, they are equal! */
 
-  if (url_type <= url_unknown && 
+  if (url_type <= url_unknown &&
       ((rv = !a->url_scheme - !b->url_scheme) ||
        (a->url_scheme && b->url_scheme &&
 	(rv = strcasecmp(a->url_scheme, b->url_scheme)))))
@@ -1589,7 +1589,7 @@
       a_port = b_port = url_port_default(url_type);
     else
       a_port = b_port = "";
-    
+
     if (a->url_port) a_port = a->url_port;
     if (b->url_port) b_port = b->url_port;
 
@@ -1635,7 +1635,7 @@
     /* Skip visual-separators */
     do {
       a = *A++;
-      if (a == '%' && IS_HEX(A[0]) && IS_HEX(A[1])) 
+      if (a == '%' && IS_HEX(A[0]) && IS_HEX(A[1]))
 	a = (UNHEX(A[0]) << 4) | UNHEX(A[1]), A +=2;
     } while (a == ' ' || a == '-' || a == '.' || a == '(' || a == ')');
 
@@ -1644,7 +1644,7 @@
 
     do {
       b = *B++;
-      if (b == '%' && IS_HEX(B[0]) && IS_HEX(B[1])) 
+      if (b == '%' && IS_HEX(B[0]) && IS_HEX(B[1]))
 	b = (UNHEX(B[0]) << 4) | UNHEX(B[1]), B +=2;
     } while (b == ' ' || b == '-' || b == '.' || b == '(' || b == ')');
 
@@ -1678,7 +1678,7 @@
 
   url_type = a->url_type;	/* Or b->url_type, they are equal! */
 
-  if (url_type <= url_unknown && 
+  if (url_type <= url_unknown &&
       ((rv = !a->url_scheme - !b->url_scheme) ||
        (a->url_scheme && b->url_scheme &&
 	(rv = strcasecmp(a->url_scheme, b->url_scheme)))))
@@ -1700,7 +1700,7 @@
       a_port = b_port = url_port_default(url_type);
     else
       a_port = b_port = "";
-    
+
     if (a->url_port) a_port = a->url_port;
     if (b->url_port) b_port = b->url_port;
 
@@ -1790,10 +1790,10 @@
   case url_msrps:
     return "9999";		/* XXXX */
 
-  case url_tel:	
-  case url_fax:	
+  case url_tel:
+  case url_fax:
   case url_modem:
-  case url_im:	
+  case url_im:
   case url_pres:
   case url_cid:
   case url_wv:
@@ -1909,7 +1909,7 @@
 #define   UNHEX(a) (a - (a >= 'a' ? 'a' - 10 : (a >= 'A' ? 'A' - 10 : '0')))
       c = (UNHEX(s[i+1]) << 4) | UNHEX(s[i+2]);
 #undef    UNHEX
-      if (c != '%' && c > ' ' && c < '\177' && 
+      if (c != '%' && c > ' ' && c < '\177' &&
 	  (!strchr(EXCLUDED, c) || strchr(allow, c))) {
 	if (i != j)
 	  su_md5_iupdate(md5, s + j, i - j);
@@ -1955,7 +1955,7 @@
   else {
     su_md5_update(md5, "", 1);
   }
-  
+
   if (type == url_sip || type == url_sips) {
     /* SIP URL may have /;? in user part but no path */
     /* user-unreserved  =  "&" / "=" / "+" / "$" / "," / ";" / "?" / "/" */
@@ -1989,7 +1989,7 @@
       s += 2;
       n = strcspn(s, "/?#@[]");
     }
-    else 
+    else
       n = strcspn(s, "@;/?#");
 
     if (s[n] == '@') {
@@ -2007,7 +2007,7 @@
   }
   else /* if (!have_authority) */ {
     n = strcspn(s, ":/;?#");	/* Until pass, path, query or fragment */
-    
+
     canon_update(md5, s, n, ""); /* user */
     su_md5_update(md5, "\0", 1); /* host, no port */
     su_md5_striupdate(md5, url_port_default(type));
@@ -2019,7 +2019,7 @@
     if (colon == NULL || ++colon == s + n || *colon != ':')
       colon = NULL;
   }
-  else 
+  else
     colon = memchr(s, ':', n);
 
   if (colon) {
@@ -2081,26 +2081,26 @@
  * the resulting string will be truncated.
  *
  * @param home memory home used to alloate string (if NULL, malloc() it)
- * @param query query part from SIP URL 
- * 
+ * @param query query part from SIP URL
+ *
  * The result string is allocated from @a home, and it can be used as
  * argument to msg_header_parse_str(), msg_header_add_str() or
  * SIPTAG_HEADER_STR().
  *
  * @sa msg_header_add_str(), SIPTAG_HEADER_STR(),
- * sip_headers_as_url_query(), sip_url_query_as_taglist(), 
+ * sip_headers_as_url_query(), sip_url_query_as_taglist(),
  * @RFC3261 section 19.1.1 "Headers", #url_t, url_s#url_headers,
  * url_unescape(), url_unescape_to()
  *
  * @since New in @VERSION_1_12_4.
  */
-char *url_query_as_header_string(su_home_t *home, 
+char *url_query_as_header_string(su_home_t *home,
 				 char const *query)
 {
   size_t i, j, n, b_start = 0, b_len = 0;
   char *s = su_strdup(home, query);
 
-  if (!s) 
+  if (!s)
     return NULL;
 
   for (i = 0, j = 0; s[i];) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url.docs	Tue Dec 23 07:37:03 2008
@@ -3,7 +3,7 @@
 @section url_meta Module Meta Information
 
 The Sofia @b url module contains macros and functions for using URL
-datatype #url_t, parsing and printing URLs. 
+datatype #url_t, parsing and printing URLs.
 
 @CONTACT Pekka Pessi <Pekka.Pessi at nokia.com>
 
@@ -13,11 +13,11 @@
 
 @section url_syntax Using URL Library
 
-The URL library provides URL datatype and helper functions related to it. 
+The URL library provides URL datatype and helper functions related to it.
 There is URL parser, which separates the URL components to the #url_t
 structure.
 
- at note 
+ at note
 Please note that we use terms URL and URI interchangeable.
 
 The formal URI syntax is defined in the @RFC3986.
@@ -39,14 +39,14 @@
 The URL library understands two alternative URL syntaxes. First, the
 basic syntax used by, e.g., @b ftp:, @b http: and @b rtsp: URLs:
 
-<i>scheme</i> ":" ["//" [ <i>user</i> [":" <i>password</i> ] "@"] 
-<i>host</i> [":" <i>port</i> ] ] 
+<i>scheme</i> ":" ["//" [ <i>user</i> [":" <i>password</i> ] "@"]
+<i>host</i> [":" <i>port</i> ] ]
       ["/" <i>path</i> ] ["?" <i>query</i> ] ["#" <i>fragment</i> ]
 
 Alternatively, the syntax used by @b mailto:, @b sip:, @b im:, @b tel,
 and @b pres: URLs:
 
-<i>scheme</i> ":" [ [ <i>user</i> [":" <i>password</i> ] "@"] 
+<i>scheme</i> ":" [ [ <i>user</i> [":" <i>password</i> ] "@"]
 <i>host</i> [":" <i>port</i> ] ] [";" <i>params</i> ] ["?" <i>query</i> ]
 ["#" <i>fragment</i> ]
 
@@ -80,7 +80,7 @@
 as follows:
 @code
  url_type = url_sip
- url_root = 0 
+ url_root = 0
  url_scheme = "sip"
  url_user = "joe.user"
  url_password = NULL
@@ -113,7 +113,7 @@
 int url_sanitize(url_t *u);
 char const *url_scheme(enum url_type_e type);
 
-#define URL_INIT_AS(type) 
+#define URL_INIT_AS(type)
 void url_init(url_t *url, enum url_type_e type);
 
 int url_cmp(url_t const *a, url_t const *b);
@@ -138,7 +138,7 @@
 char const *url_port_default(enum url_type_e url_type);
 char const *url_tport_default(enum url_type_e url_type);
 char const *url_port(url_t const *u);
-#define URL_PORT(u) 
+#define URL_PORT(u)
 @endcode
 
 In addition to the basic URL structure, #url_t, the library interface
@@ -149,13 +149,13 @@
 #define URL_IS_STRING(u) ((u) && *((url_string_t*)(u))->us_str != 0)
 int url_string_p(url_string_t const * url);
 int url_is_string(url_string_t const * url);
-#define URL_STRING_MAKE(s) 
+#define URL_STRING_MAKE(s)
 @endcode
 
 There are a macros for printf()-like formatting of URLs:
 @code
 #define URL_PRINT_FORMAT
-#define URL_PRINT_ARGS(u) 
+#define URL_PRINT_ARGS(u)
 @endcode
 
 These functions calculate MD5 digest of URL or contribute contents of the
@@ -165,7 +165,7 @@
 void url_digest(void *hash, int hsize, url_t const *, char const *key);
 @endcode
 
-SIP or SIPS URIs have some parameters that control transport of the request. 
+SIP or SIPS URIs have some parameters that control transport of the request.
 In some cases, they should be detected and removed:
 @code
 int url_have_transport(url_t const *u);
@@ -181,7 +181,7 @@
 #define URL_E(buf, end, url)
 isize_t url_xtra(url_t const * url);
 issize_t url_dup(char *, isize_t , url_t *dst, url_t const *src);
-#define URL_DUP(buf, end, dst, src) 
+#define URL_DUP(buf, end, dst, src)
 @endcode
 
 */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url_tag.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url_tag.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/url_tag.c	Tue Dec 23 07:37:03 2008
@@ -56,7 +56,7 @@
   if (URL_STRING_P(us))
     return snprintf(b, size, "<%s>", us->us_str);
   else
-    return snprintf(b, size, "<" URL_PRINT_FORMAT ">", 
+    return snprintf(b, size, "<" URL_PRINT_FORMAT ">",
 		    URL_PRINT_ARGS(us->us_url));
 }
 
@@ -95,7 +95,7 @@
     dst->t_value = (tag_value_t)d;
     *bb = b + sizeof(*d) + xtra;
   }
-  
+
   return dst + 1;
 }
 
@@ -110,7 +110,7 @@
  *
  * @param tt tag type
  * @param home memory home used to allocate new #url_t structure
- * @param str string to convert 
+ * @param str string to convert
  * @param return_value return-value parameter for converted url
  *
  * @retval 0 when successful
@@ -130,7 +130,7 @@
 
   for (len = 0; !IS_EXCLUDED(str[len]); len++)
     ;
-  
+
   url = su_alloc(home, (sizeof *url) + len + 1);
   if (!url)
     return -1;
@@ -145,7 +145,7 @@
   return 0;
 }
 
-tag_class_t url_tag_class[1] = 
+tag_class_t url_tag_class[1] =
   {{
     sizeof(url_tag_class),
     /* tc_next */     NULL,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/urlmap.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/urlmap.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/urlmap.c	Tue Dec 23 07:37:03 2008
@@ -172,7 +172,7 @@
   (*top)->um_black = 1;
 }
 
-static 
+static
 void red_black_balance_delete(UrlMap **top, UrlMap *um)
 {
   UrlMap *dad, *brother;
@@ -192,7 +192,7 @@
 	brother->um_black = 0;
 	um = dad;
 	continue;
-      } 
+      }
 
       if (!brother->um_right || brother->um_right->um_black) {
 	brother->um_left->um_black = 1;
@@ -208,7 +208,7 @@
       left_rotate(top, dad);
       um = *top;
       break;
-    } else { 
+    } else {
       assert(um == dad->um_right);
       brother = dad->um_left;
 
@@ -224,7 +224,7 @@
 	brother->um_black = 0;
 	um = dad;
 	continue;
-      } 
+      }
 
       if (!brother->um_left || brother->um_left->um_black) {
 	brother->um_right->um_black = 1;
@@ -424,12 +424,12 @@
       dad->um_dad->um_right = dad;
 
     dad->um_black = um->um_black;
-    
+
     if ((dad->um_left = um->um_left))
-      dad->um_left->um_dad = dad;      
+      dad->um_left->um_dad = dad;
 
     if ((dad->um_right = um->um_right))
-      dad->um_right->um_dad = dad;      
+      dad->um_right->um_dad = dad;
   }
 
   um->um_left = NULL;
@@ -438,7 +438,7 @@
   um->um_black = 0;
   um->um_inserted = 0;
 
-  if (need_to_balance) 
+  if (need_to_balance)
     red_black_balance_delete(top, kid);
 }
 
@@ -600,7 +600,7 @@
   six = url_map_new(home, (void*)"/6", sizeof (UrlMap));
   seven = url_map_new(home, (void*)"/7", sizeof (UrlMap));
 
-  TEST_1(one); 
+  TEST_1(one);
   TEST_1(three);
   TEST_1(five);
   TEST_1(six);
@@ -612,16 +612,16 @@
   TEST_P(five->um_left, NULL); TEST_P(five->um_right, NULL);
   TEST_P(five->um_dad, NULL); TEST(five->um_black, 1);
 
-  /* Check after another node: 
+  /* Check after another node:
    *
    *         5b
-   *        / 
+   *        /
    *       3r
    */
   TEST(url_map_insert(&tree, three, &o), 0); TEST_P(o, NULL);
   TEST_P(tree->um_left, three); TEST(tree->um_black, 1);
   TEST_P(three->um_left, NULL); TEST_P(three->um_right, NULL);
-  TEST_P(three->um_dad, tree); TEST(three->um_black, 0); 
+  TEST_P(three->um_dad, tree); TEST(three->um_black, 0);
 
   /* Check third node
    *         5b
@@ -631,21 +631,21 @@
   TEST(url_map_insert(&tree, seven, &o), 0); TEST_P(o, NULL);
   TEST_P(tree->um_right, seven); TEST(tree->um_black, 1);
   TEST_P(seven->um_left, NULL); TEST_P(seven->um_right, NULL);
-  TEST_P(seven->um_dad, tree); TEST(seven->um_black, 0); 
+  TEST_P(seven->um_dad, tree); TEST(seven->um_black, 0);
 
   /* Check after fourth node:
    *         5b
    *        / \
    *       3b  7b
    *      /
-   *     1r  
+   *     1r
    */
   TEST(url_map_insert(&tree, one, &o), 0); TEST_P(o, NULL);
-  TEST_P(tree->um_left->um_left, one); 
-  TEST(tree->um_black, 1); 
+  TEST_P(tree->um_left->um_left, one);
+  TEST(tree->um_black, 1);
   TEST(tree->um_left->um_black, 1); TEST(tree->um_right->um_black, 1);
   TEST_P(one->um_left, NULL); TEST_P(one->um_right, NULL);
-  TEST_P(one->um_dad, tree->um_left); TEST(one->um_black, 0); 
+  TEST_P(one->um_dad, tree->um_left); TEST(one->um_black, 0);
 
   /* Checks that we got after fifth node:
    *         5b
@@ -693,7 +693,7 @@
   y = url_map_new(home, (void*)"/y", sizeof *y);
 
   TEST_1(x);
-  TEST_1(y); 
+  TEST_1(y);
 
   /*
    *              x                   y               x
@@ -725,9 +725,9 @@
   if (k > (1 << 32))
     result += 32, k = (k >> 32) + ((k & ((1 << 32) - 1)) != 0);
 #endif
-  if (k > (1 << 16)) 
+  if (k > (1 << 16))
     result += 16, k = (k >> 16) + ((k & ((1 << 16) - 1)) != 0);
-  if (k > (1 << 8)) 
+  if (k > (1 << 8))
     result += 8, k = (k >> 8) + ((k & ((1 << 8) - 1)) != 0);
   if (k > (1 << 4))
     result += 4, k = (k >> 4) + ((k & 15) != 0);
@@ -737,7 +737,7 @@
     result += 1, k = (k >> 1) + (k & 1);
   if (k > 1)
     result += 1;
-  
+
   return result;
 }
 
@@ -803,9 +803,9 @@
     te = (TEntry *)url_map_find(tree, (void*)u, 1);
     TEST_1(te); TEST(te->te_value, i);
     url_map_remove(&tree, te->te_urlmap);
-    TEST_1(te->te_urlmap->um_dad == NULL && 
-	   te->te_urlmap->um_left == NULL && 
-	   te->te_urlmap->um_right == NULL); 
+    TEST_1(te->te_urlmap->um_dad == NULL &&
+	   te->te_urlmap->um_left == NULL &&
+	   te->te_urlmap->um_right == NULL);
     TEST_1(url_map_height(tree) <= 2 * log2ceil(N - i + 1));
     TEST_1(redblack_check(tree));
   }
@@ -814,7 +814,7 @@
 
   for (i = N - 1; i >= 0; i--) {
     o = (void *)-1;
-    TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0);
     TEST_P(o, NULL);
     TEST_1(url_map_height(tree) <= 2 * log2ceil(N - i + 1));
     TEST_1(redblack_check(tree));
@@ -837,7 +837,7 @@
     int sn = (i * 57) % N;
     o = (void *)-1;
     TEST(nodes[sn]->te_inserted, 0);
-    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0);
     nodes[sn]->te_inserted = 1;
     TEST_P(o, NULL);
     TEST_1(url_map_height(tree) <= 2 * log2ceil(i + 1 + 1));
@@ -865,7 +865,7 @@
     int sn = (i * 517) % N;	/* relative prime to N */
     o = (void *)-1;
     TEST(nodes[sn]->te_inserted, 0);
-    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0);
     nodes[sn]->te_inserted = 1;
     TEST_P(o, NULL);
     TEST_1(url_map_height(tree) <= 2 * log2ceil(i + 1 + 1));
@@ -893,7 +893,7 @@
     int sn = (i * 1957) % N;	/* relative prime to N */
     o = (void *)-1;
     TEST(nodes[sn]->te_inserted, 0);
-    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0);
     nodes[sn]->te_inserted = 1;
     TEST_P(o, NULL);
     TEST_1(url_map_height(tree) <= 2 * log2ceil(i + 1 + 1));
@@ -923,13 +923,13 @@
     int sn = N - i - 1;
     TEST(nodes[i]->te_inserted, 0);
     o = (void *)-1;
-    TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0);
     TEST_P(o, NULL);
     nodes[i]->te_inserted = 1;
 
     TEST(nodes[sn]->te_inserted, 0);
     o = (void *)-1;
-    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0);
     TEST_P(o, NULL);
     nodes[sn]->te_inserted = 1;
   }
@@ -959,13 +959,13 @@
     int sn = N - i - 1;
     TEST(nodes[i]->te_inserted, 0);
     o = (void *)-1;
-    TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0);
     TEST_P(o, NULL);
     nodes[i]->te_inserted = 1;
 
     TEST(nodes[sn]->te_inserted, 0);
     o = (void *)-1;
-    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0);
     TEST_P(o, NULL);
     nodes[sn]->te_inserted = 1;
   }
@@ -995,13 +995,13 @@
     int sn = N / 2 + i;
     TEST(nodes[i]->te_inserted, 0);
     o = (void *)-1;
-    TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0);
     TEST_P(o, NULL);
     nodes[i]->te_inserted = 1;
 
     TEST(nodes[sn]->te_inserted, 0);
     o = (void *)-1;
-    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0); 
+    TEST(url_map_insert(&tree, nodes[sn]->te_urlmap, &o), 0);
     TEST_P(o, NULL);
     nodes[sn]->te_inserted = 1;
   }
@@ -1026,13 +1026,13 @@
   TEST_P(tree, NULL);
 
   /* Insert in perfect order ... */
-  
+
   for (j = N / 2; j > 0; j /= 2) {
     for (i = N - j; i >= 0; i -= j) {
       if (nodes[i]->te_inserted)
 	continue;
       o = (void *)-1;
-      TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0); 
+      TEST(url_map_insert(&tree, nodes[i]->te_urlmap, &o), 0);
       TEST_P(o, NULL);
       nodes[i]->te_inserted = 1;
     }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/urlmap.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/urlmap.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/url/urlmap.h	Tue Dec 23 07:37:03 2008
@@ -28,10 +28,10 @@
 
 /**
  * @file urlmap.h
- * @brief 
- * 
+ * @brief
+ *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
- *  
+ *
  * @date Created: Wed Mar 10 17:06:20 2004 ppessi
  */
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-coverage.m4
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-coverage.m4	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-coverage.m4	Tue Dec 23 07:37:03 2008
@@ -1,8 +1,8 @@
 dnl =====================================================================
 dnl This file contains autoconf macros shared by Sofia modules.
-dnl 
+dnl
 dnl Author: Pekka Pessi <Pekka.Pessi at nokia.com>
-dnl 
+dnl
 dnl License:
 dnl
 dnl Copyright (c) 2001,2004 Nokia and others. All Rights Reserved.
@@ -12,19 +12,19 @@
 dnl otherwise. Permission has been granted, though, to use and distribute
 dnl all macros under the following license, which is a modified version of
 dnl the GNU General Public License version 2:
-dnl 
+dnl
 dnl Each Autoconf macro in this file is free software; you can redistribute it
 dnl and/or modify it under the terms of the GNU General Public License as
 dnl published by the Free Software Foundation; either version 2, or (at your
 dnl option) any later version.
-dnl 
+dnl
 dnl They are distributed in the hope that they will be useful, but WITHOUT ANY
 dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 dnl FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 dnl details. (You should have received a copy of the GNU General Public License
 dnl along with this program; if not, write to the Free Software Foundation,
 dnl Inc., 59 Temple Place -- Suite 330, Boston, MA 02111-1307, USA.)
-dnl 
+dnl
 dnl As a special exception, the Free Software Foundation gives unlimited
 dnl permission to copy, distribute and modify the configure scripts that are
 dnl the output of Autoconf. You need not follow the terms of the GNU General
@@ -32,21 +32,21 @@
 dnl portions of the text of Autoconf appear in them. The GNU General Public
 dnl License (GPL) does govern all other use of the material that constitutes
 dnl the Autoconf program.
-dnl 
+dnl
 dnl Certain portions of the Autoconf source text are designed to be copied
-dnl (in certain cases, depending on the input) into the output of Autoconf. 
+dnl (in certain cases, depending on the input) into the output of Autoconf.
 dnl We call these the "data" portions. The rest of the Autoconf source text
 dnl consists of comments plus executable code that decides which of the data
 dnl portions to output in any given case. We call these comments and
 dnl executable code the "non-data" portions. Autoconf never copies any of
 dnl the non-data portions into its output.
-dnl 
+dnl
 dnl This special exception to the GPL applies to versions of Autoconf
 dnl released by the Free Software Foundation. When you make and distribute a
 dnl modified version of Autoconf, you may extend this special exception to
 dnl the GPL to apply to your modified version as well, *unless* your
 dnl modified version has the potential to copy into its output some of the
-dnl text that was the non-data portion of the version that you started with. 
+dnl text that was the non-data portion of the version that you started with.
 dnl (In other words, unless your change moves or copies text from the
 dnl non-data portions to the data portions.) If your modification has such
 dnl potential, you must delete any notice of this special exception to the

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-general.m4
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-general.m4	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-general.m4	Tue Dec 23 07:37:03 2008
@@ -1,8 +1,8 @@
 dnl =====================================================================
 dnl This file contains autoconf macros shared by Sofia modules.
-dnl 
+dnl
 dnl Author: Pekka Pessi <Pekka.Pessi at nokia.com>
-dnl 
+dnl
 dnl License:
 dnl
 dnl Copyright (c) 2001,2004 Nokia and others. All Rights Reserved.
@@ -12,19 +12,19 @@
 dnl otherwise. Permission has been granted, though, to use and distribute
 dnl all macros under the following license, which is a modified version of
 dnl the GNU General Public License version 2:
-dnl 
+dnl
 dnl Each Autoconf macro in this file is free software; you can redistribute it
 dnl and/or modify it under the terms of the GNU General Public License as
 dnl published by the Free Software Foundation; either version 2, or (at your
 dnl option) any later version.
-dnl 
+dnl
 dnl They are distributed in the hope that they will be useful, but WITHOUT ANY
 dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 dnl FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 dnl details. (You should have received a copy of the GNU General Public License
 dnl along with this program; if not, write to the Free Software Foundation,
 dnl Inc., 59 Temple Place -- Suite 330, Boston, MA 02111-1307, USA.)
-dnl 
+dnl
 dnl As a special exception, the Free Software Foundation gives unlimited
 dnl permission to copy, distribute and modify the configure scripts that are
 dnl the output of Autoconf. You need not follow the terms of the GNU General
@@ -32,21 +32,21 @@
 dnl portions of the text of Autoconf appear in them. The GNU General Public
 dnl License (GPL) does govern all other use of the material that constitutes
 dnl the Autoconf program.
-dnl 
+dnl
 dnl Certain portions of the Autoconf source text are designed to be copied
-dnl (in certain cases, depending on the input) into the output of Autoconf. 
+dnl (in certain cases, depending on the input) into the output of Autoconf.
 dnl We call these the "data" portions. The rest of the Autoconf source text
 dnl consists of comments plus executable code that decides which of the data
 dnl portions to output in any given case. We call these comments and
 dnl executable code the "non-data" portions. Autoconf never copies any of
 dnl the non-data portions into its output.
-dnl 
+dnl
 dnl This special exception to the GPL applies to versions of Autoconf
 dnl released by the Free Software Foundation. When you make and distribute a
 dnl modified version of Autoconf, you may extend this special exception to
 dnl the GPL to apply to your modified version as well, *unless* your
 dnl modified version has the potential to copy into its output some of the
-dnl text that was the non-data portion of the version that you started with. 
+dnl text that was the non-data portion of the version that you started with.
 dnl (In other words, unless your change moves or copies text from the
 dnl non-data portions to the data portions.) If your modification has such
 dnl potential, you must delete any notice of this special exception to the
@@ -56,7 +56,7 @@
 
 dnl ===================================================================
 dnl Get host, target and build variables filled with appropriate info,
-dnl and check the validity of the cache 
+dnl and check the validity of the cache
 dnl ===================================================================
 
 AC_DEFUN([SAC_CANONICAL_SYSTEM_CACHE_CHECK], [
@@ -73,7 +73,7 @@
 if test "$ac_cv_hostcheck" != "$hostcheck"; then
   AC_MSG_RESULT(changed)
   AC_MSG_WARN(config.cache exists!)
-  AC_MSG_ERROR([you must do 'make distclean' first to compile 
+  AC_MSG_ERROR([you must do 'make distclean' first to compile
  for different host or different parameters.])
 else
   AC_MSG_RESULT(ok)
@@ -116,7 +116,7 @@
     *solaris*)  ac_cv_cwflag="-erroff=%none,E_END_OF_LOOP_CODE_NOT_REACHED,E_BAD_PTR_INT_COMBINATION -errtags"
 	        ;;
     *)		ac_cv_cwflag=;;
-		esac 
+		esac
   ;;
 esac])
 AC_SUBST([CWFLAG], [$ac_cv_cwflag])
@@ -132,10 +132,10 @@
 AC_DEFUN([AC_STRUCT_SIN6], [
 AC_CACHE_CHECK([for sockaddr_in6],
   ac_cv_sin6,
-[AC_EGREP_HEADER(struct sockaddr_in6, netinet/in.h, 
+[AC_EGREP_HEADER(struct sockaddr_in6, netinet/in.h,
   ac_cv_sin6=yes, ac_cv_sin6=no)])
 if test $ac_cv_sin6 = yes ;then
-	AC_DEFINE([HAVE_SIN6], 1, 
+	AC_DEFINE([HAVE_SIN6], 1,
 		[Define to 1 if you have IPv6 structures and constants])
 fi
 ])
@@ -150,7 +150,7 @@
 #include <sys/socket.h>]], [[
  struct sockaddr t;t.sa_len = 0;]])],[ac_cv_sa_len=yes],[ac_cv_sa_len=no])])
 if test "$ac_cv_sa_len" = yes ;then
-	AC_DEFINE([HAVE_SA_LEN], 1, 
+	AC_DEFINE([HAVE_SA_LEN], 1,
 		[Define to 1 if you have sa_len in struct sockaddr])
 fi
 ])
@@ -160,7 +160,7 @@
 dnl ======================================================================
 AC_DEFUN([AC_FLAG_MSG_NOSIGNAL], [
 AC_REQUIRE([AC_PROG_CC])
-AC_CACHE_CHECK([for MSG_NOSIGNAL], 
+AC_CACHE_CHECK([for MSG_NOSIGNAL],
   ac_cv_flag_msg_nosignal, [
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
@@ -169,7 +169,7 @@
 ]])],[ac_cv_flag_msg_nosignal=yes],[ac_cv_flag_msg_nosignal=no])])
 if test "$ac_cv_flag_msg_nosignal" = yes ; then
 	AC_DEFINE([HAVE_MSG_NOSIGNAL], 1,
-		[Define to 1 if you have MSG_NOSIGNAL flag for send()]) 
+		[Define to 1 if you have MSG_NOSIGNAL flag for send()])
 fi
 ])dnl
 
@@ -178,7 +178,7 @@
 dnl ======================================================================
 AC_DEFUN([AC_SYS_MSG_ERRQUEUE], [
 AC_REQUIRE([AC_PROG_CC])
-AC_CACHE_CHECK([for MSG_ERRQUEUE], 
+AC_CACHE_CHECK([for MSG_ERRQUEUE],
   ac_cv_flag_msg_errqueue, [
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
@@ -187,7 +187,7 @@
 ]])],[ac_cv_flag_msg_errqueue=yes],[ac_cv_flag_msg_errqueue=no])])
 if test "$ac_cv_flag_msg_errqueue" = yes; then
 	AC_DEFINE([HAVE_MSG_ERRQUEUE], 1,
-		[Define to 1 if you have MSG_ERRQUEUE flag for send()]) 
+		[Define to 1 if you have MSG_ERRQUEUE flag for send()])
 fi
 ])dnl
 
@@ -196,7 +196,7 @@
 dnl ======================================================================
 AC_DEFUN([AC_SYS_IP_RECVERR], [
 AC_REQUIRE([AC_PROG_CC])
-AC_CACHE_CHECK([for IP_RECVERR], 
+AC_CACHE_CHECK([for IP_RECVERR],
   ac_cv_sys_ip_recverr, [
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
@@ -208,7 +208,7 @@
   setsockopt(s, SOL_IP, IP_RECVERR, &one, sizeof(one));
 ]])],[ac_cv_sys_ip_recverr=yes],[ac_cv_sys_ip_recverr=no])])
 if test "$ac_cv_sys_ip_recverr" = yes ; then
-	AC_DEFINE([HAVE_IP_RECVERR], 1, 
+	AC_DEFINE([HAVE_IP_RECVERR], 1,
 		[Define to 1 if you have IP_RECVERR in <netinet/in.h>])
 fi
 ])dnl
@@ -218,7 +218,7 @@
 dnl ======================================================================
 AC_DEFUN([AC_SYS_IPV6_RECVERR], [
 AC_REQUIRE([AC_PROG_CC])
-AC_CACHE_CHECK([for IPV6_RECVERR], 
+AC_CACHE_CHECK([for IPV6_RECVERR],
   ac_cv_sys_ipv6_recverr, [
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
@@ -261,7 +261,7 @@
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[char *s = __func__;
 ]])],[ac_cv_c_var_func=yes],[ac_cv_c_var_func=no]))
 if test $ac_cv_c_var_func = "yes"; then
-AC_DEFINE([HAVE_FUNC], 1, [Define to 1 if the C compiler supports __func__]) 
+AC_DEFINE([HAVE_FUNC], 1, [Define to 1 if the C compiler supports __func__])
 fi
 ])dnl
 
@@ -272,7 +272,7 @@
 char *s = __FUNCTION__;
 ]])],[ac_cv_c_macro_function=yes],[ac_cv_c_macro_function=no]))
 if test $ac_cv_c_macro_function = "yes"; then
-AC_DEFINE([HAVE_FUNCTION], 1, [Define to 1 if the C compiler supports __FUNCTION__]) 
+AC_DEFINE([HAVE_FUNCTION], 1, [Define to 1 if the C compiler supports __FUNCTION__])
 fi
 ])dnl
 
@@ -281,8 +281,8 @@
 dnl ======================================================================
 AC_DEFUN([AC_C_INLINE_DEFINE], [
 AC_C_INLINE
-case "$ac_cv_c_inline" in *inline* | yes) 
-	AC_DEFINE([HAVE_INLINE], 1, [Define to 1 if you have inlining compiler]) ;; 
+case "$ac_cv_c_inline" in *inline* | yes)
+	AC_DEFINE([HAVE_INLINE], 1, [Define to 1 if you have inlining compiler]) ;;
 esac
 ])
 
@@ -298,7 +298,7 @@
 ]])],[ac_cv_c_keyword_struct=yes],[ac_cv_c_keyword_struct=no]))
 if test $ac_cv_c_keyword_struct = "yes"; then
 AC_DEFINE([HAVE_STRUCT_KEYWORDS], 1, [
-Define to 1 if your CC supports C99 struct initialization]) 
+Define to 1 if your CC supports C99 struct initialization])
 fi
 ])
 
@@ -307,7 +307,7 @@
 dnl should be removed after automake conversion is finished
 dnl ======================================================================
 
-AC_DEFUN([AC_AUTOCONF_PARAM], 
+AC_DEFUN([AC_AUTOCONF_PARAM],
 [
 if autoconf --version | fgrep '2.13' > /dev/null ; then
     AUTOCONF_PARAM="-l"
@@ -349,7 +349,7 @@
 
 AC_DEFUN([AC_CHECK_COMPILATION_ENVIRONMENT], [
 AC_REQUIRE([AC_PROG_CC])
-AC_CACHE_CHECK([for compilation environment], 
+AC_CACHE_CHECK([for compilation environment],
   ac_cc_environment, [
 machine=`$CC -dumpmachine`
 if test "$machine" = mingw32 ; then
@@ -392,7 +392,7 @@
   [ac_cv_dev_urandom=no
    if test -r /dev/urandom; then ac_cv_dev_urandom=yes; fi])
 if test $ac_cv_dev_urandom = yes; then
-  AC_DEFINE([HAVE_DEV_URANDOM], 1, 
+  AC_DEFINE([HAVE_DEV_URANDOM], 1,
     [Define to 1 if you have /dev/urandom.])
   AC_DEFINE([DEV_URANDOM], 1,
     [Define to the random number source name.])

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-openssl.m4
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-openssl.m4	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-openssl.m4	Tue Dec 23 07:37:03 2008
@@ -13,29 +13,29 @@
   : # No openssl
 else
 
-  if test "$with_openssl" = "pkg-config" ; then 
+  if test "$with_openssl" = "pkg-config" ; then
     PKG_CHECK_MODULES(openssl, openssl,
 	[HAVE_TLS=1 HAVE_OPENSSL=1 LIBS="$openssl_LIBS $LIBS"],
 	[HAVE_OPENSSL=0])
   fi
 
-  if test $HAVE_OPENSSL = 1 ; then
+  if test x$HAVE_OPENSSL = x1 ; then
      AC_DEFINE([HAVE_LIBCRYPTO], 1, [Define to 1 if you have the `crypto' library (-lcrypto).])
      AC_DEFINE([HAVE_LIBSSL], 1, [Define to 1 if you have the `ssl' library (-lssl).])
   else
     AC_CHECK_HEADERS([openssl/tls1.h], [
       HAVE_OPENSSL=1 HAVE_TLS=1
 
-      AC_CHECK_LIB(crypto, BIO_new,, 
+      AC_CHECK_LIB(crypto, BIO_new,,
       	HAVE_OPENSSL=0
       	AC_MSG_WARN(OpenSSL crypto library was not found))
 
-      AC_CHECK_LIB(ssl, TLSv1_method,, 
+      AC_CHECK_LIB(ssl, TLSv1_method,,
       	HAVE_TLS=0
       	AC_MSG_WARN(OpenSSL protocol library was not found))
      ],[AC_MSG_WARN(OpenSSL include files were not found)])
   fi
-  
+
   if test x$HAVE_OPENSSL = x1; then
      AC_DEFINE([HAVE_OPENSSL], 1, [Define to 1 if you have OpenSSL])
   fi

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-su2.m4
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-su2.m4	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-su2.m4	Tue Dec 23 07:37:03 2008
@@ -12,33 +12,33 @@
 
 dnl Define compilation options for su_configure.h
 
-case "$target" in 
+case "$target" in
 *-*-solaris?.* )
   SAC_SU_DEFINE(__EXTENSIONS__, 1, [Define to 1 in Solaris in order to get POSIX extensions.])
 ;;
 esac
 
 # Check includes used by su includes
-AC_CHECK_HEADER(sys/types.h, 
-	SAC_SU_DEFINE([SU_HAVE_SYS_TYPES], 1, 
+AC_CHECK_HEADER(sys/types.h,
+	SAC_SU_DEFINE([SU_HAVE_SYS_TYPES], 1,
 		     [Define to 1 if Sofia uses sys/types.h]))
 
 ax_inttypes=false
 AC_CHECK_HEADER(stdint.h, [
 	ax_inttypes=true
-	SAC_SU_DEFINE([SU_HAVE_STDINT], 1, 
+	SAC_SU_DEFINE([SU_HAVE_STDINT], 1,
 		     [Define to 1 if Sofia uses stdint.h])])
 AC_CHECK_HEADER(inttypes.h,[
 	ax_inttypes=true
-	SAC_SU_DEFINE([SU_HAVE_INTTYPES], 1, 
+	SAC_SU_DEFINE([SU_HAVE_INTTYPES], 1,
 		     [Define to 1 if Sofia uses inttypes.h])])
 
-if $ax_inttypes; then : ; else 
+if $ax_inttypes; then : ; else
 	AC_MSG_ERROR("No <stdint.h> or <inttypes.h> found.")
 fi
 
 if test "x$MINGW_ENVIRONMENT" != x1 ; then
-  AC_CHECK_HEADER(pthread.h, 
+  AC_CHECK_HEADER(pthread.h,
         HAVE_PTHREADS=1;
 	SAC_SU_DEFINE([SU_HAVE_PTHREADS], 1, [Sofia SU uses pthreads]))
 else
@@ -128,7 +128,7 @@
 dnl SAC_ENABLE_COREFOUNDATION
 dnl ======================================================================
 AC_ARG_ENABLE(corefoundation,
-[  --enable-corefoundation 
+[  --enable-corefoundation
                           compile with OSX COREFOUNDATION [[disabled]]],
  , enable_corefoundation=no)
 AM_CONDITIONAL(COREFOUNDATION, test $enable_corefoundation = yes)
@@ -191,7 +191,7 @@
 	       (tv)6, (tv)7, (tv)8, (tv)9, (tv)10);
 }
 ]])],[ac_cv_tagstack=yes],[ac_cv_tagstack=no],[
-case "$target" in 
+case "$target" in
 i?86-*-* ) ac_cv_tagstack=yes ;;
 * ) ac_cv_tagstack=no ;;
 esac
@@ -229,7 +229,7 @@
 
 AC_REQUIRE([AC_SYS_SA_LEN])
 if test "$ac_cv_sa_len" = yes ;then
-  SAC_SU_DEFINE([SU_HAVE_SOCKADDR_SA_LEN], 1, 
+  SAC_SU_DEFINE([SU_HAVE_SOCKADDR_SA_LEN], 1,
 	        [Define to 1 if you have sa_len in struct sockaddr])
 fi
 
@@ -238,7 +238,7 @@
 
 if ! test no$enable_ip6 = nono ; then
 AC_STRUCT_SIN6
-case $ac_cv_sin6 in 
+case $ac_cv_sin6 in
 yes) SAC_SU_DEFINE(SU_HAVE_IN6, 1, [
 	Define to 1 if you have struct sockaddr_in6]) ;;
  no) ;;
@@ -254,7 +254,7 @@
   AC_DEFINE([HAVE_WIN32], 1, [Define to 1 you have WIN32])
   SAC_SU_DEFINE([SU_HAVE_WINSOCK], 1, [Define to 1 you have WinSock])
   SAC_SU_DEFINE([SU_HAVE_WINSOCK2], 1, [Define to 1 you have WinSock2])
-  SAC_SU_DEFINE([SU_HAVE_SOCKADDR_STORAGE], 1, 
+  SAC_SU_DEFINE([SU_HAVE_SOCKADDR_STORAGE], 1,
       [Define to 1 if you have struct sockaddr_storage])
   AC_DEFINE([HAVE_ADDRINFO], 1,
       [Define to 1 if you have addrinfo structure.])
@@ -276,7 +276,7 @@
 #endif
   ])
   AC_DEFINE([HAVE_FILETIME], 1, [
-     Define to 1 if you have WIN32 FILETIME type and 
+     Define to 1 if you have WIN32 FILETIME type and
      GetSystemTimeAsFileTime().])
 ],[
 dnl no winsock2
@@ -335,7 +335,7 @@
 fi])
 
 if test "$ac_cv_struct_addrinfo" = yes; then
-  SAC_SU_DEFINE([SU_HAVE_ADDRINFO], 1, 
+  SAC_SU_DEFINE([SU_HAVE_ADDRINFO], 1,
     [Define to 1 if you have struct addrinfo.])
 fi
 
@@ -349,7 +349,7 @@
   ac_cv_struct_sockaddr_storage='sys/socket.h missing'
 fi])
 if test "$ac_cv_struct_sockaddr_storage" = yes; then
-  SAC_SU_DEFINE(SU_HAVE_SOCKADDR_STORAGE, 1, 
+  SAC_SU_DEFINE(SU_HAVE_SOCKADDR_STORAGE, 1,
     [Define to 1 if you have struct sockaddr_storage])
 fi
 
@@ -437,7 +437,7 @@
 AC_CHECK_LIB(pthread, pthread_create)
 AC_CHECK_LIB(socket, socketpair,,,-lnsl)
 
-AC_ARG_WITH(rt,  
+AC_ARG_WITH(rt,
 [  --with-rt               use POSIX realtime library [[used by default]]])
 if test "${with_rt}" != no; then
 	AC_SEARCH_LIBS(clock_gettime, rt)
@@ -451,30 +451,30 @@
 # No GLib path explicitly defined, use pkg-config
 AC_ARG_WITH(glib,
 [  --with-glib=version     use GLib (default=2.0)], [
-case "$with_glib" in 
+case "$with_glib" in
 yes | "" ) with_glib=2.0 ;;
 esac
 ], [with_glib=2.0])
 
 AC_ARG_WITH(glib-dir,
-[  --with-glib-dir=PREFIX  explicitly define GLib path],, 
+[  --with-glib-dir=PREFIX  explicitly define GLib path],,
  with_glib_dir="pkg-config")
 
 if test "$with_glib" = no || test "$with_glib_dir" = "no" ; then
 
   : # No glib
 
-elif test "$with_glib_dir" = "pkg-config" ; then 
+elif test "$with_glib_dir" = "pkg-config" ; then
 
   PKG_CHECK_MODULES(GLIB, glib-$with_glib, [HAVE_GLIB=yes], [HAVE_GLIB=no])
 
-else # GLib path is explicitly defined 
+else # GLib path is explicitly defined
 
   gprefix=$with_glib_dir
   GLIB_VERSION="$with_glib"
   GLIBXXX=glib-$with_glib
 
-  if test "$gprefix" = "yes" ; then 
+  if test "$gprefix" = "yes" ; then
     for gprefix in /usr /usr/local /opt/$GLIBXXX
     do
   	test -d $gprefix/include/$GLIBXXX && break
@@ -492,7 +492,7 @@
     # glib_mkenums=glib-mkenums
 
     HAVE_GLIB=yes
-    
+
     if test "x$MINGW_ENVIRONMENT" = x1 ; then
       GLIB_LIBS="${glibdir}/lib$GLIBXXX.dll.a ${glibdir}/libintl.a ${glibdir}/libiconv.a"
     else
@@ -501,7 +501,7 @@
     GLIB_CFLAGS="-I${gincludedir}/$GLIBXXX -I${glibdir}/$GLIBXXX/include"
   fi
 
-fi # GLib path is explicitly defined 
+fi # GLib path is explicitly defined
 
 if test "x$HAVE_GLIB" = xyes ; then
   SAC_COMMA_APPEND([SOFIA_GLIB_PKG_REQUIRES],[glib-2.0])
@@ -544,7 +544,7 @@
 fi
 
 if test $ac_cv_func_if_nameindex = yes ; then
-  SAC_SU_DEFINE([SU_HAVE_IF_NAMEINDEX], 1, 
+  SAC_SU_DEFINE([SU_HAVE_IF_NAMEINDEX], 1,
     [Define to 1 if you have if_nameindex().])
 fi
 
@@ -619,7 +619,7 @@
 # Check IPv6 addresss configuration
 # ===========================================================================
 case "$target" in
- *-*-linux*) AC_DEFINE([HAVE_PROC_NET_IF_INET6], 1, 
+ *-*-linux*) AC_DEFINE([HAVE_PROC_NET_IF_INET6], 1,
 	[Define to 1 if you have /proc/net/if_inet6 control file]) ;;
 esac
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-tport.m4
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-tport.m4	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/m4/sac-tport.m4	Tue Dec 23 07:37:03 2008
@@ -19,7 +19,7 @@
 
 	AC_CHECK_FUNC(sigcomp_library_2_5,
             [AC_DEFINE([HAVE_SIGCOMP], 1, [Define to 1 if you have Sofia sigcomp >= 2.5])
-             AC_DEFINE([HAVE_SOFIA_SIGCOMP], 1, [Define to 1 if you have Sofia sigcomp >= 2.5])], 
+             AC_DEFINE([HAVE_SOFIA_SIGCOMP], 1, [Define to 1 if you have Sofia sigcomp >= 2.5])],
              AC_MSG_ERROR(Sofia SigComp API >= 2.5 was not found))
 fi
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/open_c/build_sources.cmd
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/open_c/build_sources.cmd	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/open_c/build_sources.cmd	Tue Dec 23 07:37:03 2008
@@ -67,7 +67,7 @@
    TEMPLATE1=%PR2%.in ^
    TEMPLATE2=%PR3%.in ^
    TEMPLATE3=%PR4%.in ^
-   TEMPLATE=%PR5%.in %SIPEXTRA% < NUL 
+   TEMPLATE=%PR5%.in %SIPEXTRA% < NUL
 %CHECK%
 
 %AWK_SIP_AWK% PT=%PT% TEMPLATE=%PT%.in ^

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/open_c/version.awk
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/open_c/version.awk	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/open_c/version.awk	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 #! /bin/gawk
 #
 # This script extracts the version information from configure.ac
-# and re-generates win32/config.h and 
+# and re-generates win32/config.h and
 # libsofia-sip-ua/features/sofia_sip_features.h
 #
 # --------------------------------------------------------------------
@@ -38,7 +38,7 @@
 
 IN && /^AC_INIT/ { version=$2; gsub(/[\]\[)]/, "", version); }
 
-OUT && /@[A-Z_]+@/ { 
+OUT && /@[A-Z_]+@/ {
   gsub(/@PACKAGE_VERSION@/, version);
   gsub(/@PACKAGE_BUGREPORT@/, "sofia-sip-devel at lists.sourceforge.net");
   gsub(/@PACKAGE_NAME@/, "sofia-sip");

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/packages/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/packages/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/packages/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 2005-11-15  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-	* sofia-sip.spec.in: Removed the --includedir parameter. 
-	The public headers are now installed under 
+	* sofia-sip.spec.in: Removed the --includedir parameter.
+	The public headers are now installed under
 	includedir/sofia-sip-MAJOR.MINOR/
 
 2005-10-06  Pekka Pessi  <Pekka.Pessi at nokia.com>

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/packages/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/packages/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/packages/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -10,7 +10,7 @@
 pkgconfig_DATA = sofia-sip-ua.pc
 
 if HAVE_GLIB
-# We should probably have something here telling 
+# We should probably have something here telling
 # if we have gobject support or not
 pkgconfig_DATA += sofia-sip-ua-glib.pc
 endif

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/packages/sofia-sip.spec.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/packages/sofia-sip.spec.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/packages/sofia-sip.spec.in	Tue Dec 23 07:37:03 2008
@@ -1,6 +1,6 @@
 # Sofia SIP UA Library
 
-Summary: Sofia SIP User-Agent library 
+Summary: Sofia SIP User-Agent library
 Name: sofia-sip
 Version: @VERSION@
 Release: 1%{?dist}
@@ -15,7 +15,7 @@
 %define opt_with() %{expand:%%global with_%{1} %%{?_with_%{1}:1}%%{?!_with_%{1}:0}}
 %define opt_without() %{expand:%%global with_%{1} %%{!?_without_%{1}:1}%%{?_without_%{1}:0}}
 
-# Options: 
+# Options:
 %opt_with doxygen	- Generate documents using doxygen and dot
 %opt_with check		- Run tests
 %opt_with openssl	- Always use OpenSSL (TLS)
@@ -94,7 +94,7 @@
 # note: soname in pkgname allows install of multiple library versions
 # The glib interface is still a bit unstable
 %package	glib at LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
-Summary:	GLIB bindings for Sofia-SIP 
+Summary:	GLIB bindings for Sofia-SIP
 Group:		System Environment/Libraries
 Requires:	sofia-sip
 Obsoletes:	sofia-sip-glib < %{version}-%{release}
@@ -123,11 +123,11 @@
 Requires:	pkgconfig
 
 %description	devel
-Development package for Sofia SIP UA library. This package includes 
+Development package for Sofia SIP UA library. This package includes
 static libraries and include files.
 
 %if !%{with_doxygen}
-The reference documentation for Sofia SIP UA library is available at 
+The reference documentation for Sofia SIP UA library is available at
 <http://sofia-sip.sourceforge.net/development.html>
 %endif
 
@@ -209,7 +209,7 @@
 - Bumped version. rpmlinted.
 
 * Tue Dec  5 2006 Kai Vehmanen <first.lastname at nokia.com>
-- The 'nua-glib' module, and the related dependency to gobject, has been 
+- The 'nua-glib' module, and the related dependency to gobject, has been
   removed from the sofia-sip package
 
 * Fri Oct  6 2006 Pekka Pessi <ppessi at gmail.com> - 1.12.3

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/rules/lcov.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/rules/lcov.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/rules/lcov.am	Tue Dec 23 07:37:03 2008
@@ -1,4 +1,4 @@
-# 
+#
 # Generate lcov output
 #
 
@@ -37,7 +37,7 @@
 	rm -rf $$odir ; mkdir -p $$odir && \
 	${LCOV_REPORT} ${GENHTML_OPTIONS} \
           --title "${PACKAGE_NAME}-${PACKAGE_VERSION}$$sub" \
-	  --srcdir=${srcdir} -o $$odir 
+	  --srcdir=${srcdir} -o $$odir
 
 # Rerun checks before generating report
 lcov-rerun: clean-lcov

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/rules/recursive.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/rules/recursive.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/rules/recursive.am	Tue Dec 23 07:37:03 2008
@@ -2,7 +2,7 @@
 # --------------------------
 
 all-recursive: built-sources-recursive
-built-sources: built-sources-recursive 
+built-sources: built-sources-recursive
 clean-built-sources: clean-built-sources-recursive
 valcheck: valcheck-recursive
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/rules/valcheck.am
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/rules/valcheck.am	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/rules/valcheck.am	Tue Dec 23 07:37:03 2008
@@ -1,4 +1,4 @@
-# 
+#
 # run tests with valgrind
 #
 
@@ -23,7 +23,7 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-VALGRIND = valgrind 
+VALGRIND = valgrind
 
 VALGRINDFLAGS = --tool=memcheck
 
@@ -34,7 +34,7 @@
 	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
 	$(MAKE) $(AM_MAKEFLAGS) valcheck-TESTS
 
-# Run tests with valgrind in 
+# Run tests with valgrind in
 valcheck-TESTS:	$(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/coverage
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/coverage	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/coverage	Tue Dec 23 07:37:03 2008
@@ -28,14 +28,14 @@
 
 {
 for f in *.bb
-do 
+do
     test "$f" = "*.bb" && { echo "run 'make check' first"; exit 1; }
     gcov $gcovflags "$f" 2>/dev/null
-done 
+done
 for f in $@
-do 
+do
     gcov $gcovflags "$f" 2>/dev/null
-done 
+done
 } |
 awk '
 BEGIN {
@@ -51,10 +51,10 @@
     else
 	file = "";
 }
-file ~ /\.[hc]$/ && /Lines executed/ { 
-	sub(/Lines executed:/, ""); 
+file ~ /\.[hc]$/ && /Lines executed/ {
+	sub(/Lines executed:/, "");
 	covered = int($3*$1/100 + 0.5);
-	
+
 #	printf "%-5u %-5u %-5u %-7s %s\n", $3, covered, $3 - covered, $1, file;
 	if ($3 == 0) {
 		/* skip */
@@ -69,11 +69,11 @@
         }
 }
 
-/torture/ { next; } 
+/torture/ { next; }
 /test/ { next; }
 /\/usr\/include/ { next; }
 
-/(source )?lines executed in file (.*\/)?[-A-Za-z_0-9]+\.[ch]/ { 
+/(source )?lines executed in file (.*\/)?[-A-Za-z_0-9]+\.[ch]/ {
         file = $0;
 	sub(/.* in file /, "", file);
 	sub(/.*\//, "", file);
@@ -98,7 +98,7 @@
 	l = lines[file]; c = coverage[file];
 	covered = int(c + 0.5);
         total += l; total_coverage += c;
-	printf "%-5u %-5u %-5u %6.2f%%  %s\n", 
+	printf "%-5u %-5u %-5u %6.2f%%  %s\n",
 		l, covered, l - covered, 100.0 * c / l, file;
     }
     if (total) {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/fix-include-sofia-sip
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/fix-include-sofia-sip	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/fix-include-sofia-sip	Tue Dec 23 07:37:03 2008
@@ -1,12 +1,12 @@
 #! /bin/sed -f
-# 
+#
 # Run this script like
 #
 # fix-include-sofia-sip -i.bak source.h source.c
 #
 # or
 #
-# find . -name '*.[hc]' -print0 | xargs -0 fix-include-sofia-sip -i.bak 
+# find . -name '*.[hc]' -print0 | xargs -0 fix-include-sofia-sip -i.bak
 #
 /^ *# *include/ {
 # Not using features.h...

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/hide_emails.sh
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/hide_emails.sh	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/hide_emails.sh	Tue Dec 23 07:37:03 2008
@@ -31,7 +31,7 @@
 
 echo "Postprocessing HTML in ${1:-.}: hiding email addresses, fixing links"
 
-find ${1:-.} -name '*.html' -print0 | 
+find ${1:-.} -name '*.html' -print0 |
 xargs -0 \
 sed -r -i '
 # Hide e-mail addresses

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/lcov-report
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/lcov-report	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/lcov-report	Tue Dec 23 07:37:03 2008
@@ -30,7 +30,7 @@
 
 while test $# -gt 0;
 do
-  case $1 in 
+  case $1 in
   --srcdir | -s )
     test -z "$2" && usage 1; shift; srcdir=$1; shift; ;;
   --srcdir=* )
@@ -41,7 +41,7 @@
     o=${1#--output?directory=}; shift ;;
   --prefix=* | --title=* | --show-details | --legend | --frames )
     GENHTML_OPTIONS="${GENHTML_OPTIONS} $1" ; shift ;;
-  --prefix | --title ) 
+  --prefix | --title )
     test -z "$2" && usage 1; GENHTML_OPTIONS="${GENHTML_OPTIONS} $1 $2" ; shift ; shift ;;
   --help | '-?' | -h ) usage 0 ;;
   - ) shift; break ;;
@@ -53,7 +53,7 @@
 info=${o:=.}/lcov.info geninfo=${o}/genhtml.info
 rm -f ${info} ${info}
 
-case ${GENHTML_OPTIONS} in *--prefix* ) ;; *) 
+case ${GENHTML_OPTIONS} in *--prefix* ) ;; *)
   GENHTML_OPTIONS="${GENHTML_OPTIONS} --prefix=`cd ${srcdir:=.} && pwd`"
 esac
 
@@ -64,7 +64,7 @@
     # remove source files in builddir
     test ${srcdir:-.} = . || lcov -l ${info} | grep "`pwd`"
     # remove test programs
-    lcov -l ${info} | grep "/test\|/torture\|_test[.][ch][+xp]*$" 
+    lcov -l ${info} | grep "/test\|/torture\|_test[.][ch][+xp]*$"
 } |
 cut -d: -f1 |
 xargs lcov -r ${info} > ${geninfo}

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/rpmbuild-snaphot
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/rpmbuild-snaphot	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/rpmbuild-snaphot	Tue Dec 23 07:37:03 2008
@@ -27,7 +27,7 @@
 
 function usage
 {
-  echo "usage: snapshot.sh [-bc|-bb] [-c|--configure] [rpmbuild options]" 
+  echo "usage: snapshot.sh [-bc|-bb] [-c|--configure] [rpmbuild options]"
   exit $@
 }
 
@@ -36,10 +36,10 @@
 
 case "$1" in -b? ) bb=$1 ; shift ;; esac
 
-while true ; do 
-  case "$1" in 
+while true ; do
+  case "$1" in
   -c | --configure | --co ) configure=1; shift; ;;
-  '-?' | --help | -h ) usage 0 ;; 
+  '-?' | --help | -h ) usage 0 ;;
   *) break ;;
   esac
 done
@@ -89,24 +89,24 @@
 /@VERSION@/ { sub(/@VERSION@/, version); }
 /@PACKAGE@/ { sub(/@PACKAGE@/, package); }
 /@PACKAGE_NAME@/ { sub(/@PACKAGE_NAME@/, package_name); }
-/@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@/ { 
+/@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@/ {
   sub(/@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@/, glib_sover);
 }
-/^Release:/ { 
+/^Release:/ {
   print "Release: " release "%{?dist}\n";
   print "Prefix: " prefix "\n";
   next;
 }
 /^Source0:/ { print "Source0:" dummy "\n"; next; }
-/disable-dependency-tracking/ { 
+/disable-dependency-tracking/ {
   sub(/--disable-dependency-tracking/, "");
 }
-/^%configure/ { 
+/^%configure/ {
  print "cd " "\"" pwd "\"";
  if (!configure) { $1="echo skipping configure"; }
  $1=$1 "-C --enable-maintainer-mode";
- print $0; 
- next; 
+ print $0;
+ next;
 }
 # Do not make documentation
 /^make doc/ { print "echo skipping " $0; next; }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/uncovered
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/uncovered	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/scripts/uncovered	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 
 while test $# -gt 0;
 do
-  case $1 in 
+  case $1 in
   --lcov-dir | -l ) test -z "$2" && usage 1; shift; ldir=$1; shift; ;;
   --lcov-dir=* ) ldir=${1#--ldir=}; shift ;;
   --srcdir | -s )
@@ -41,21 +41,21 @@
 
 cwd=`pwd`
 
-tdir=${TMPDIR:-/tmp}/$USER.uncovered.$$ 
+tdir=${TMPDIR:-/tmp}/$USER.uncovered.$$
 info=${tdir}/lcov.info geninfo=${tdir}/genhtml.info
 
 test -d ${tdir} && { echo ${tdir}: already exists ; exit 2 ; }
 
 mkdir -p ${tdir} &&
 {
-    # Find all lcov.info0 under -t DIR 
+    # Find all lcov.info0 under -t DIR
     test -d ${ldir} &&
     find ${ldir} -name lcov.info |
     while read s
     do
-      find $cwd -type f -not -newer $s | xargs lcov -q -e $s 
+      find $cwd -type f -not -newer $s | xargs lcov -q -e $s
     done
-    
+
     lcov -q -c -d . --compat-libtool
 } > ${info}
 
@@ -65,8 +65,8 @@
   # remove system includes with with inlined functions
   lcov -q -l ${info} | grep -v "`cd ${srcdir:-.} && pwd`"
   # remove test programs
-  lcov -q -l ${info} | grep "/test\|/torture\|_test[.]c$" 
-} | 
+  lcov -q -l ${info} | grep "/test\|/torture\|_test[.]c$"
+} |
 cut -d: -f1 |
 xargs lcov -q -r ${info} > ${geninfo} &&
 cd ${tdir} &&
@@ -107,7 +107,7 @@
         for ($f = $ARGV) {
           s:^[.]'$cwd/'::o;
           s:[.]gcov[.]html$::;
-        } 
+        }
         s/^ +(\d+)[^:]+:/$1:/;
         $uncovered = $f . ":" . $_;
       }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/check_sofia.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/check_sofia.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/check_sofia.c	Tue Dec 23 07:37:03 2008
@@ -38,7 +38,7 @@
 #include <stdlib.h>
 
 /* Globals used by <sofia-sip/tstdef.h> */
-int tstflags;			
+int tstflags;
 char const name[] = "check_sofia";
 
 int main(int argc, char *argv[])

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_100rel.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_100rel.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_100rel.c	Tue Dec 23 07:37:03 2008
@@ -106,7 +106,7 @@
     RESPOND(ep, call, nh, SIP_180_RINGING,
 	    TAG_IF(call->sdp, SOATAG_USER_SDP_STR(call->sdp)),
 	    TAG_END());
-    RESPOND(ep, call, nh, SIP_200_OK, 
+    RESPOND(ep, call, nh, SIP_200_OK,
 	    NUTAG_INCLUDE_EXTRA_SDP(1),
 	    TAG_END());
     return 0;
@@ -283,7 +283,7 @@
 
   if (print_headings)
     printf("TEST NUA-10.1.2: PASSED\n");
-  
+
   END();
 }
 
@@ -395,7 +395,7 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 407);
   TEST_1(sip = sip_object(e->data->e_msg));
-  TEST_1(au = sip->sip_proxy_authenticate); 
+  TEST_1(au = sip->sip_proxy_authenticate);
 
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_calling); /* CALLING */
@@ -499,7 +499,7 @@
 
   if (print_headings)
     printf("TEST NUA-10.1.4: PASSED\n");
-  
+
   END();
 }
 
@@ -607,12 +607,12 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_proceeding);
   TEST_1(!is_offer_answer_done(e->data->e_tags));
-  
+
   if (!ep) {
     TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_prack);
     TEST(e->data->e_status, 200);
   }
-    
+
   ei = event_by_type(e->next, nua_r_invite);
   ep = event_by_type(e->next, nua_r_prack);
   if (!ep) {
@@ -696,7 +696,7 @@
 
   /* Client transitions:
      INIT -(C1)-> CALLING: nua_invite(), nua_i_state
-     CALLING -(C2)-> TERMINATING: nua_r_invite, nua_i_state, 
+     CALLING -(C2)-> TERMINATING: nua_r_invite, nua_i_state,
                                   nua_r_prack, nua_i_state
      TERMINATING -(T1)-> TERMINATED: nua_r_invite, nua_i_state
   */
@@ -722,7 +722,7 @@
     int bye = 1, cancel = 1, invite = 1, state = 1;
 
     while (bye || cancel || invite || state) {
-      TEST_1(e = e->next); 
+      TEST_1(e = e->next);
       if (e->data->e_event == nua_r_bye) {
 	TEST_E(e->data->e_event, nua_r_bye);
 	TEST(e->data->e_status, 200);
@@ -778,9 +778,9 @@
   /* 183 is PRACKed, PRACK is responded with 483 */
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_prack);
 
-  /* Client terminates the call 
-     - we may (it is received before BYE) or may not (received after BYE) 
-       get CANCEL request 
+  /* Client terminates the call
+     - we may (it is received before BYE) or may not (received after BYE)
+       get CANCEL request
   */
   TEST_1(e = e->next);
   if (e->data->e_event == nua_i_cancel) {
@@ -1116,7 +1116,7 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_update);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_early); /* EARLY */
-  TEST_1(!is_offer_sent(e->data->e_tags)); 
+  TEST_1(!is_offer_sent(e->data->e_tags));
   TEST_1(is_offer_recv(e->data->e_tags));
   TEST_1(is_answer_sent(e->data->e_tags));
   TEST_1(!is_answer_recv(e->data->e_tags));
@@ -1281,9 +1281,9 @@
    |-------200 OK-------|
    |			|
 
-   Note that the boxed responses above can be re-ordered 
+   Note that the boxed responses above can be re-ordered
    (180 or 200 OK to INVITE is received before 200 OK to UPDATE).
-   ACK, however, is sent only after 200 OK to both UPDATE and INVITE. 
+   ACK, however, is sent only after 200 OK to both UPDATE and INVITE.
 */
 
   a_call->sdp = "m=audio 5008 RTP/AVP 8";
@@ -1513,7 +1513,7 @@
     return 0;
   case nua_r_update:
     if (200 <= status && status < 300) {
-      RESPOND(ep, call, nh, SIP_180_RINGING, 
+      RESPOND(ep, call, nh, SIP_180_RINGING,
 	      SIPTAG_REQUIRE_STR("100rel"),
 	      TAG_END());
       ep->next_condition = accept_pracked;
@@ -1741,7 +1741,7 @@
   do {
     TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
     TEST(callstate(e->data->e_tags), nua_callstate_early); /* EARLY */
-    TEST_1(is_offer_sent(e->data->e_tags)); 
+    TEST_1(is_offer_sent(e->data->e_tags));
     TEST_1(!is_offer_recv(e->data->e_tags));
     TEST_1(!is_answer_sent(e->data->e_tags));
     TEST_1(!is_answer_recv(e->data->e_tags));
@@ -2035,7 +2035,7 @@
 #endif
   END();
 }
- 
+
 int cancel_when_pracked(CONDITION_PARAMS);
 int alert_call(CONDITION_PARAMS);
 
@@ -2129,7 +2129,7 @@
    Option B:
    EARLY -(S3b)-> COMPLETED: nua_respond(), nua_i_state
    COMPLETED -(S4)-> READY: nua_i_ack, nua_i_state
-   READY -(T1)-> TERMINATED: nua_i_bye, nua_i_state   
+   READY -(T1)-> TERMINATED: nua_i_bye, nua_i_state
   */
   TEST_1(e = b->events->head); TEST_E(e->data->e_event, nua_i_invite);
   TEST(e->data->e_status, 100);
@@ -2157,7 +2157,7 @@
 
   if (print_headings)
     printf("TEST NUA-10.6: PASSED\n");
-  
+
   END();
 }
 
@@ -2298,7 +2298,7 @@
    Option B:
    EARLY -(S3b)-> COMPLETED: nua_respond(), nua_i_state
    COMPLETED -(S4)-> READY: nua_i_ack, nua_i_state
-   READY -(T1)-> TERMINATED: nua_i_bye, nua_i_state   
+   READY -(T1)-> TERMINATED: nua_i_bye, nua_i_state
   */
   TEST_1(e = b->events->head); TEST_E(e->data->e_event, nua_i_invite);
   TEST(e->data->e_status, 100);
@@ -2343,7 +2343,7 @@
 
   if (print_headings)
     printf("TEST NUA-10.7: PASSED\n");
-  
+
   END();
 }
 
@@ -2561,7 +2561,7 @@
 
   if (print_headings)
     printf("TEST NUA-10.8.2: PASSED\n");
-  
+
   END();
 }
 
@@ -2575,7 +2575,7 @@
   if (event == nua_i_prack) {
     if (!ep->flags.bit0) {
       sip_contact_t m[1];
-      
+
       ep->flags.bit0 = 1;
 
       *m = *ep->contact;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_basic_call.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_basic_call.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_basic_call.c	Tue Dec 23 07:37:03 2008
@@ -75,7 +75,7 @@
 
   switch (callstate(tags)) {
   case nua_callstate_received:
-    RESPOND(ep, call, nh, SIP_180_RINGING, 
+    RESPOND(ep, call, nh, SIP_180_RINGING,
 	    TAG_END());
     return 0;
   case nua_callstate_early:
@@ -115,7 +115,7 @@
 
   switch (callstate(tags)) {
   case nua_callstate_received:
-    RESPOND(ep, call, nh, SIP_180_RINGING, 
+    RESPOND(ep, call, nh, SIP_180_RINGING,
 	    TAG_IF(call->sdp, SOATAG_USER_SDP_STR(call->sdp)),
 	    NUTAG_M_DISPLAY("Bob"),
 	    NUTAG_M_USERNAME("b+b"),
@@ -212,8 +212,8 @@
     printf("TEST NUA-3.1: Basic call\n");
 
   /* Disable session timer from proxy */
-  test_proxy_get_session_timer(ctx->p, &se, &min_se); 
-  test_proxy_set_session_timer(ctx->p, 0, 0); 
+  test_proxy_get_session_timer(ctx->p, &se, &min_se);
+  test_proxy_set_session_timer(ctx->p, 0, 0);
 
   a_call->sdp = "m=audio 5008 RTP/AVP 8";
   b_call->sdp = "m=audio 5010 RTP/AVP 0 8";
@@ -357,7 +357,7 @@
   nua_handle_destroy(a_call->nh), a_call->nh = NULL;
   nua_handle_destroy(b_call->nh), b_call->nh = NULL;
 
-  test_proxy_set_session_timer(ctx->p, se, min_se); 
+  test_proxy_set_session_timer(ctx->p, se, min_se);
 
   if (print_headings)
     printf("TEST NUA-3.1: PASSED\n");
@@ -422,7 +422,7 @@
   a_call->sdp = "m=audio 5008 RTP/AVP 8";
   b_call->sdp = "m=audio 5010 RTP/AVP 0 8";
 
-  TEST_1(a_call->nh = nua_handle(a->nua, a_call, 
+  TEST_1(a_call->nh = nua_handle(a->nua, a_call,
 				 SIPTAG_TO_STR("<sip:b at x.org>"),
 				 TAG_END()));
 
@@ -453,7 +453,7 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 200);
   TEST_1(sip = sip_object(e->data->e_msg));
-  TEST_1(sip->sip_content_type); 
+  TEST_1(sip->sip_content_type);
   TEST_S(sip->sip_content_type->c_type, "application/sdp");
   TEST_1(sip->sip_payload);	/* there is sdp in 200 OK */
   TEST_1(sip->sip_contact);
@@ -533,7 +533,7 @@
   TEST_1(sip->sip_subscription_state);
   TEST_S(sip->sip_subscription_state->ss_substate, "terminated");
   TEST_1(tl_find(e->data->e_tags, nutag_substate));
-  TEST(tl_find(e->data->e_tags, nutag_substate)->t_value, 
+  TEST(tl_find(e->data->e_tags, nutag_substate)->t_value,
        nua_substate_terminated);
   TEST_1(!e->next);
 
@@ -615,7 +615,7 @@
 
   switch (callstate(tags)) {
   case nua_callstate_received:
-    RESPOND(ep, call, nh, SIP_180_RINGING, 
+    RESPOND(ep, call, nh, SIP_180_RINGING,
 	    NUTAG_MEDIA_ENABLE(0),
 	    TAG_END());
     return 0;
@@ -655,7 +655,7 @@
     "t=0 0\r\n"
     "m=audio 5008 RTP/AVP 8\r\n";
 
-  b_call->sdp = 
+  b_call->sdp =
     "v=0\r\n"
     "o=- 2 1 IN IP4 127.0.0.1\r\n"
     "s=-\r\n"
@@ -663,7 +663,7 @@
     "t=0 0\r\n"
     "m=audio 5010 RTP/AVP 0 8\r\n";
 
-  TEST_1(a_call->nh = nua_handle(a->nua, a_call, 
+  TEST_1(a_call->nh = nua_handle(a->nua, a_call,
 				 SIPTAG_TO_STR("<sip:b at x.org>"),
 				 TAG_END()));
 
@@ -695,7 +695,7 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 200);
   TEST_1(sip = sip_object(e->data->e_msg));
-  TEST_1(sip->sip_content_type); 
+  TEST_1(sip->sip_content_type);
   TEST_S(sip->sip_content_type->c_type, "application/sdp");
   TEST_1(sip->sip_payload);	/* there is sdp in 200 OK */
   TEST_1(sip->sip_contact);
@@ -780,7 +780,7 @@
 
   switch (callstate(tags)) {
   case nua_callstate_completing:
-    ACK(ep, call, nh, 
+    ACK(ep, call, nh,
 	TAG_IF(call->sdp, SIPTAG_CONTENT_TYPE_STR("application/sdp")),
 	TAG_IF(call->sdp, SIPTAG_PAYLOAD_STR(call->sdp)),
 	TAG_END());
@@ -805,7 +805,7 @@
 
   switch (callstate(tags)) {
   case nua_callstate_received:
-    RESPOND(ep, call, nh, SIP_180_RINGING, 
+    RESPOND(ep, call, nh, SIP_180_RINGING,
 	    NUTAG_MEDIA_ENABLE(0),
 	    TAG_IF(call->sdp, SIPTAG_CONTENT_TYPE_STR("application/sdp")),
 	    TAG_IF(call->sdp, SIPTAG_PAYLOAD_STR(call->sdp)),
@@ -848,7 +848,7 @@
     "t=0 0\r\n"
     "m=audio 5008 RTP/AVP 8\r\n";
 
-  b_call->sdp = 
+  b_call->sdp =
     "v=0\r\n"
     "o=- 2 1 IN IP4 127.0.0.1\r\n"
     "s=-\r\n"
@@ -856,7 +856,7 @@
     "t=0 0\r\n"
     "m=audio 5010 RTP/AVP 0 8\r\n";
 
-  TEST_1(a_call->nh = nua_handle(a->nua, a_call, 
+  TEST_1(a_call->nh = nua_handle(a->nua, a_call,
 				 SIPTAG_TO_STR("<sip:b at x.org>"),
 				 TAG_END()));
 
@@ -889,7 +889,7 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 200);
   TEST_1(sip = sip_object(e->data->e_msg));
-  TEST_1(sip->sip_content_type); 
+  TEST_1(sip->sip_content_type);
   TEST_S(sip->sip_content_type->c_type, "application/sdp");
   TEST_1(sip->sip_payload);	/* there is sdp in 200 OK */
   TEST_1(sip->sip_contact);
@@ -996,8 +996,8 @@
 }
 
 /* Test changing from/to within dialog */
-/* Test that a proper Contact gets selected in response 
- * regardless of the To URI. 
+/* Test that a proper Contact gets selected in response
+ * regardless of the To URI.
  */
 int test_basic_call_5(struct context *ctx)
 {
@@ -1014,7 +1014,7 @@
   a_call->sdp = "m=audio 5008 RTP/AVP 8";
   b_call->sdp = "m=audio 5010 RTP/AVP 0 8";
 
-  TEST_1(a_call->nh = nua_handle(a->nua, a_call, 
+  TEST_1(a_call->nh = nua_handle(a->nua, a_call,
 				 SIPTAG_TO_STR("<sips:b at x.org>"),
 				 TAG_END()));
 
@@ -1073,8 +1073,8 @@
   TEST(callstate(e->data->e_tags), nua_callstate_completed); /* COMPLETED */
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_ack);
   TEST_1(sip = sip_object(e->data->e_msg));
-  TEST_S(sip->sip_to->a_url->url_user, "anonymous"); 
-  TEST_S(sip->sip_from->a_url->url_user, "anonymous"); 
+  TEST_S(sip->sip_to->a_url->url_user, "anonymous");
+  TEST_S(sip->sip_from->a_url->url_user, "anonymous");
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
   TEST_1(!e->next);
@@ -1177,8 +1177,8 @@
     printf("TEST NUA-3.6: Basic call\n");
 
   /* Disable session timer from proxy */
-  test_proxy_get_session_timer(ctx->p, &se, &min_se); 
-  test_proxy_set_session_timer(ctx->p, 0, 0); 
+  test_proxy_get_session_timer(ctx->p, &se, &min_se);
+  test_proxy_set_session_timer(ctx->p, 0, 0);
 
   a_call->sdp = "m=audio 5008 RTP/AVP 8";
   b_call->sdp = "m=audio 5010 RTP/AVP 0 8";
@@ -1256,8 +1256,8 @@
   a_call->sdp =
     "m=audio 5008 RTP/AVP 8\n"
     "m=video 5014 RTP/AVP 34 31\n";
-  
-  m = memset(b_video, 0, sizeof b_video);    
+
+  m = memset(b_video, 0, sizeof b_video);
   m->m_size = sizeof *m;
   m->m_session = b_sdp;
   m->m_type = sdp_media_video, m->m_type_name = "video";
@@ -1265,7 +1265,7 @@
   m->m_proto = sdp_proto_rtp; m->m_proto_name = "RTP/AVP";
   m->m_rtpmaps = memset(rm = b_h261, 0, sizeof b_h261);
   rm->rm_size = sizeof *rm;
-  rm->rm_pt = 31; rm->rm_encoding = "h261"; rm->rm_rate = 90000; 
+  rm->rm_pt = 31; rm->rm_encoding = "h261"; rm->rm_rate = 90000;
 
   b_sdp->sdp_media->m_next = m;
 
@@ -1336,7 +1336,7 @@
   nua_handle_destroy(a_call->nh), a_call->nh = NULL;
   nua_handle_destroy(b_call->nh), b_call->nh = NULL;
 
-  test_proxy_set_session_timer(ctx->p, se, min_se); 
+  test_proxy_set_session_timer(ctx->p, se, min_se);
 
   if (print_headings)
     printf("TEST NUA-3.6: PASSED\n");
@@ -1421,7 +1421,7 @@
 
   switch (callstate(tags)) {
   case nua_callstate_received:
-    RESPOND(ep, call, nh, SIP_180_RINGING, 
+    RESPOND(ep, call, nh, SIP_180_RINGING,
 	    TAG_IF(call->sdp, SOATAG_USER_SDP_STR(call->sdp)),
 	    SIPTAG_CONTACT(contact_for_b),
 	    TAG_END());
@@ -1475,11 +1475,11 @@
   mb->m_url->url_user = "b++b";
 
   contact_for_b = mb;
-  
+
   sip_route_init(rb)->r_url[0] = b->contact->m_url[0];
   rb->r_url->url_user = "bob+0";
   url_param_add(nua_handle_home(a_call->nh), rb->r_url, "lr");
-  
+
   INVITE(a, a_call, a_call->nh,
 	 NUTAG_URL("sip:bob at example.org"), /* Expanded by proxy */
 	 SIPTAG_ROUTE_STR("B2 <sip:bob+2 at example.org>;bar=foo"), /* Last in list */
@@ -1582,7 +1582,7 @@
   TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
   TEST_1(!e->next);
   free_events_in_list(ctx, a->events);
-  
+
   TEST_1(e = b->events->head); TEST_E(e->data->e_event, nua_i_invite);
   TEST(e->data->e_status, 200);
   TEST_1(sip = sip_object(e->data->e_msg));
@@ -1773,7 +1773,7 @@
   free_events_in_list(ctx, b->events);
 
   /* Make B to process HUMPPA at application level */
-  nua_set_hparams(b_call->nh, NUTAG_APPL_METHOD("HUMPPA"), 
+  nua_set_hparams(b_call->nh, NUTAG_APPL_METHOD("HUMPPA"),
 		  NUTAG_ALLOW("HUMPPA"),
 		  TAG_END());
   run_b_until(ctx, nua_r_set_params, until_final_response);
@@ -1898,7 +1898,7 @@
   /* Let A allow INFO  */
   nua_set_params(a->nua, NUTAG_ALLOW("INFO"), TAG_END());
   /* Make B to process INFO at application level */
-  nua_set_hparams(b_call->nh, NUTAG_APPL_METHOD("INFO"), 
+  nua_set_hparams(b_call->nh, NUTAG_APPL_METHOD("INFO"),
 		  NUTAG_ALLOW("INFO"),
 		  TAG_END());
   run_ab_until(ctx, nua_r_set_params, NULL, nua_r_set_params, NULL);
@@ -1955,7 +1955,7 @@
   save_event_in_list(ctx, event, ep, call);
 
   if (event == nua_i_method) {
-    RESPOND(ep, call, nh, 
+    RESPOND(ep, call, nh,
 	    SIP_604_DOES_NOT_EXIST_ANYWHERE,
 	    NUTAG_WITH(current),
 	    TAG_END());
@@ -1974,7 +1974,7 @@
   save_event_in_list(ctx, event, ep, call);
 
   if (event == nua_i_info) {
-    RESPOND(ep, call, nh, 
+    RESPOND(ep, call, nh,
 	    SIP_480_TEMPORARILY_UNAVAILABLE,
 	    NUTAG_WITH(current),
 	    TAG_END());

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_call_hold.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_call_hold.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_call_hold.c	Tue Dec 23 07:37:03 2008
@@ -524,7 +524,7 @@
   TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
   TEST_1(!e->next);
   free_events_in_list(ctx, b->events);
-  
+
   TEST_1(e = a->events->head); TEST_E(e->data->e_event, nua_i_ack);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
@@ -618,7 +618,7 @@
   TEST_1(!e->next);
 #endif
   free_events_in_list(ctx, b->events);
-  
+
   TEST_1(e = a->events->head); TEST_E(e->data->e_event, nua_i_ack);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
@@ -632,7 +632,7 @@
   if (print_headings)
     printf("TEST NUA-7.6.2: PASSED\n");
   }
-  
+
 
   /* ---------------------------------------------------------------------- */
   /*
@@ -742,7 +742,7 @@
 static size_t remove_first_ack(void *_once, void *message, size_t len)
 {
   int *once = _once;
-  
+
   if (*once)
     return len;
 
@@ -792,8 +792,8 @@
   a_call->sdp = "m=audio 5008 RTP/AVP 0 8\n";
   b_call->sdp = "m=audio 5010 RTP/AVP 8\n";
 
-  TEST_1(a_call->nh = 
-	 nua_handle(a->nua, a_call, 
+  TEST_1(a_call->nh =
+	 nua_handle(a->nua, a_call,
 		    SIPTAG_FROM_STR("Alice <sip:alice at example.com>"),
 		    SIPTAG_TO(b->to),
 		    NUTAG_AUTOANSWER(0),
@@ -823,12 +823,12 @@
 */
 
   /* re-INVITE A, send BYE after receiving 180 */
-  INVITE(b, b_call, b_call->nh, 
+  INVITE(b, b_call, b_call->nh,
 	 SIPTAG_SUBJECT_STR("re-INVITE"),
 	 TAG_END());
   /* Run until both a and b has terminated their call */
   run_ab_until(ctx, -1, ringing_until_terminated, -1, bye_when_ringing);
-  
+
 #if notyet
   struct event *e;
 
@@ -849,8 +849,8 @@
   TEST(callstate(e->data->e_tags), nua_callstate_terminating); /* READY */
   /* Now we can receive events, in any possible order */
   /* XXX */
-  TEST_1(e = e->next); 
-  
+  TEST_1(e = e->next);
+
   TEST_1(!nua_handle_has_active_call(a_call->nh));
 
   /*
@@ -890,7 +890,7 @@
 }
 
 /*
- Accept INVITE 
+ Accept INVITE
  X
  |                    |
  |-------INVITE------>|
@@ -998,8 +998,8 @@
   a_call->sdp = "m=audio 5008 RTP/AVP 0 8\n";
   b_call->sdp = "m=audio 5010 RTP/AVP 8\n";
 
-  TEST_1(a_call->nh = 
-	 nua_handle(a->nua, a_call, 
+  TEST_1(a_call->nh =
+	 nua_handle(a->nua, a_call,
 		    SIPTAG_FROM_STR("Alice <sip:alice at example.com>"),
 		    SIPTAG_TO(b->to),
 		    TAG_END()));
@@ -1098,7 +1098,7 @@
   }
   else switch (callstate(tags)) {
   case nua_callstate_received:
-    RESPOND(ep, call, nh, SIP_180_RINGING, 
+    RESPOND(ep, call, nh, SIP_180_RINGING,
 	    SIPTAG_REQUIRE_STR("100rel"),
 	    TAG_END());
     return 0;
@@ -1166,7 +1166,7 @@
     printf("TEST NUA-7: Test call hold and re-INVITEs\n");
 
   retval = test_call_hold(ctx);
-  
+
   if (retval == 0)
     retval = test_reinvite(ctx);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_call_reject.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_call_reject.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_call_reject.c	Tue Dec 23 07:37:03 2008
@@ -128,7 +128,7 @@
   TEST_1(e = b->events->head); TEST_E(e->data->e_event, nua_i_invite);
   TEST(e->data->e_status, 100);
   TEST_1(sip = sip_object(e->data->e_msg));
-  TEST_1(sip->sip_contact); TEST_1(!sip->sip_contact->m_next); 
+  TEST_1(sip->sip_contact); TEST_1(!sip->sip_contact->m_next);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_received); /* RECEIVED */
   TEST_1(is_offer_recv(e->data->e_tags));
@@ -1042,7 +1042,7 @@
   TEST(e->data->e_status, 904);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_terminated); /* TERMINATED */
-  TEST_1(!e->next); 
+  TEST_1(!e->next);
 
   free_events_in_list(ctx, a->events);
 
@@ -1263,7 +1263,7 @@
 {
   (void)arg;
 
-  if (len >= 7 && strncasecmp(message, "ACK sip", 7) == 0) 
+  if (len >= 7 && strncasecmp(message, "ACK sip", 7) == 0)
     return 0;
   return len;
 }
@@ -1297,7 +1297,7 @@
   TEST_1(f = test_nat_add_filter(ctx->nat, filter_200_OK, NULL, nat_inbound));
   TEST_1(f2 = test_nat_add_filter(ctx->nat, filter_200_OK,
 				  NULL, nat_outbound));
-  
+
   INVITE(a, a_call, a_call->nh,
 	 TAG_IF(!ctx->proxy_tests, NUTAG_URL(b->contact->m_url)),
 	 SIPTAG_SUBJECT_STR("NUA-4.7.1"),
@@ -1383,7 +1383,7 @@
   TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
 
   TEST_1(f = test_nat_add_filter(ctx->nat, filter_ACK, NULL, nat_outbound));
-  
+
   INVITE(a, a_call, a_call->nh,
 	 TAG_IF(!ctx->proxy_tests, NUTAG_URL(b->contact->m_url)),
 	 SIPTAG_SUBJECT_STR("NUA-4.7.2"),
@@ -1421,14 +1421,14 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 180);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_proceeding); 
+  TEST(callstate(e->data->e_tags), nua_callstate_proceeding);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 200);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_bye);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_terminated); 
+  TEST(callstate(e->data->e_tags), nua_callstate_terminated);
   TEST_1(!e->next);
 
   /*
@@ -1503,7 +1503,7 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 180);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_proceeding); 
+  TEST(callstate(e->data->e_tags), nua_callstate_proceeding);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 200);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
@@ -1513,7 +1513,7 @@
   TEST(callstate(e->data->e_tags), nua_callstate_terminating);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_bye);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_terminated); 
+  TEST(callstate(e->data->e_tags), nua_callstate_terminated);
   TEST_1(!e->next);
 
   /*
@@ -1559,7 +1559,7 @@
   TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
 
   TEST_1(f = test_nat_add_filter(ctx->nat, filter_ACK, NULL, nat_outbound));
-  
+
   INVITE(a, a_call, a_call->nh,
 	 TAG_IF(!ctx->proxy_tests, NUTAG_URL(b->contact->m_url)),
 	 SIPTAG_SUBJECT_STR("NUA-4.7.4"),
@@ -1599,14 +1599,14 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 180);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_proceeding); 
+  TEST(callstate(e->data->e_tags), nua_callstate_proceeding);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 200);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_bye);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_terminated); 
+  TEST(callstate(e->data->e_tags), nua_callstate_terminated);
   TEST_1(!e->next);
 
   /*
@@ -1626,7 +1626,7 @@
   TEST_1(is_answer_sent(e->data->e_tags));
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_error);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_terminating); 
+  TEST(callstate(e->data->e_tags), nua_callstate_terminating);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_bye);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_terminated); /* TERMINATED */

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_cancel_bye.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_cancel_bye.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_cancel_bye.c	Tue Dec 23 07:37:03 2008
@@ -288,7 +288,7 @@
     printf("TEST NUA-5.1.2: PASSED\n");
 
  /* ----------------------------------------------------------------------- */
- 
+
   if (print_headings)
     printf("TEST NUA-5.2.1: cancel call when ringing\n");
 
@@ -687,7 +687,7 @@
   TEST_1(is_offer_recv(e->data->e_tags));
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_early); /* EARLY */
-  TEST_1(!e->next);  
+  TEST_1(!e->next);
 
   free_events_in_list(ctx, b->events);
   nua_handle_destroy(b_call->nh), b_call->nh = NULL;
@@ -757,7 +757,7 @@
     TEST(e->data->e_status, 180);
     TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
     TEST(callstate(e->data->e_tags), nua_callstate_proceeding); /* PROCEEDING */
-    TEST_1(e = e->next); 
+    TEST_1(e = e->next);
   }
   if (e->data->e_event == nua_r_invite) {
     TEST_E(e->data->e_event, nua_r_invite);
@@ -765,7 +765,7 @@
     TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
     TEST(callstate(e->data->e_tags), nua_callstate_completing); /* COMPLETING */
     TEST_1(is_answer_recv(e->data->e_tags));
-    TEST_1(e = e->next); 
+    TEST_1(e = e->next);
   }
   TEST_E(e->data->e_event, nua_i_bye);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
@@ -790,7 +790,7 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_completed); /* COMPLETED */
   TEST_1(is_answer_sent(e->data->e_tags));
-  TEST_1(!e->next);  
+  TEST_1(!e->next);
 
   free_events_in_list(ctx, b->events);
   nua_handle_destroy(b_call->nh), b_call->nh = NULL;
@@ -866,7 +866,7 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
   TEST(callstate(e->data->e_tags), nua_callstate_completed); /* COMPLETED */
   TEST_1(is_answer_sent(e->data->e_tags));
-  TEST_1(!e->next);  
+  TEST_1(!e->next);
 
   free_events_in_list(ctx, b->events);
   nua_handle_destroy(b_call->nh), b_call->nh = NULL;
@@ -885,7 +885,7 @@
   a_call->sdp = "m=audio 5008 RTP/AVP 8";
   b_call->sdp = "m=audio 5010 RTP/AVP 0 8";
 
-  return 
+  return
     test_call_destroy_1(ctx) ||
     test_call_destroy_2(ctx) ||
     test_call_destroy_3(ctx) ||
@@ -1108,12 +1108,12 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 180);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_proceeding); 
+  TEST(callstate(e->data->e_tags), nua_callstate_proceeding);
 
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 200);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_completing); 
+  TEST(callstate(e->data->e_tags), nua_callstate_completing);
   TEST_1(e = e->next);
 
   TEST_E(e->data->e_event, nua_r_bye); TEST(e->data->e_status, 200);
@@ -1212,7 +1212,7 @@
   free_events_in_list(ctx, b->events);
 
   /* re-INVITE A. */
-  INVITE(b, b_call, b_call->nh, 
+  INVITE(b, b_call, b_call->nh,
 	 SIPTAG_SUBJECT_STR("NUA-6.3 re-INVITE"),
 	 TAG_END());
   run_ab_until(ctx, -1, reject_reinvite_401, -1, save_until_final_response);
@@ -1224,7 +1224,7 @@
   free_events_in_list(ctx, b->events);
 
   BYE(b, b_call, b_call->nh, TAG_END());
-  
+
   run_ab_until(ctx, -1, until_terminated, -1, until_terminated);
 
   free_events_in_list(ctx, a->events);
@@ -1287,7 +1287,7 @@
   free_events_in_list(ctx, b->events);
 
   /* re-INVITE A. */
-  INVITE(b, b_call, b_call->nh, 
+  INVITE(b, b_call, b_call->nh,
 	 SIPTAG_SUBJECT_STR("NUA-6.4.1 re-INVITE"),
 	 TAG_END());
   run_ab_until(ctx, -1, reject_reinvite_401, -1, save_until_final_response);
@@ -1299,7 +1299,7 @@
   free_events_in_list(ctx, b->events);
 
   BYE(a, a_call, a_call->nh, TAG_END());
-  
+
   run_ab_until(ctx, -1, until_terminated, -1, until_terminated);
 
   free_events_in_list(ctx, a->events);
@@ -1362,7 +1362,7 @@
   free_events_in_list(ctx, b->events);
 
   /* UPDATE A. */
-  UPDATE(b, b_call, b_call->nh, 
+  UPDATE(b, b_call, b_call->nh,
 	 SIPTAG_SUBJECT_STR("NUA-6.4.2 UPDATE"),
 	 TAG_END());
   BYE(b, b_call, b_call->nh, TAG_END()); /* Queued until nua_authenticate */
@@ -1375,7 +1375,7 @@
   free_events_in_list(ctx, b->events);
 
   AUTHENTICATE(b, b_call, b_call->nh, TAG_END());
-  
+
   run_ab_until(ctx, -1, until_terminated, -1, until_terminated);
 
   free_events_in_list(ctx, a->events);
@@ -1472,7 +1472,7 @@
   TEST_1(e = c->events->head); TEST_E(e->data->e_event, nua_i_invite);
   free_events_in_list(ctx, c->events);
 
-  BYE(c, c_call, c_call->nh, 
+  BYE(c, c_call, c_call->nh,
       TAG_END());
   run_c_until(ctx, -1, save_until_final_response);
 
@@ -1482,9 +1482,9 @@
   free_events_in_list(ctx, a->events);
   free_events_in_list(ctx, c->events);
 
-  AUTHENTICATE(c, c_call, c_call->nh, 
+  AUTHENTICATE(c, c_call, c_call->nh,
 	       NUTAG_AUTH("Digest:\"test-proxy\":charlie:secret"), TAG_END());
-  
+
   run_abc_until(ctx, -1, until_terminated, -1, NULL, -1, until_terminated);
 
   free_events_in_list(ctx, a->events);
@@ -1556,12 +1556,12 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 180);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_proceeding); 
+  TEST(callstate(e->data->e_tags), nua_callstate_proceeding);
 
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 200);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
-  TEST(callstate(e->data->e_tags), nua_callstate_ready); 
+  TEST(callstate(e->data->e_tags), nua_callstate_ready);
   TEST_1(!e->next);
 
   /*
@@ -1588,7 +1588,7 @@
   free_events_in_list(ctx, b->events);
 
   BYE(b, b_call, b_call->nh, TAG_END());
-  
+
   run_b_until(ctx, -1, until_terminated);
 
   /* B transitions:
@@ -1651,7 +1651,7 @@
 
 int test_early_bye(struct context *ctx)
 {
-  return 
+  return
     test_bye_with_407(ctx) ||
     test_bye_before_200(ctx) ||
     test_bye_before_ack(ctx) ||

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_extension.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_extension.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_extension.c	Tue Dec 23 07:37:03 2008
@@ -75,7 +75,7 @@
   sip_t const *sip;
 
 
-/* Test for EXTENSION 
+/* Test for EXTENSION
 
    A			B
    |------EXTENSION---->|

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_init.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_init.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_init.c	Tue Dec 23 07:37:03 2008
@@ -23,7 +23,7 @@
  */
 
 /**@CFILE test_init.c
- * @brief Init nua test context 
+ * @brief Init nua test context
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  * @author Martti Mela <Martti Mela at nokia.com>
@@ -114,7 +114,7 @@
 			       TAG_END());
 
     if (ctx->p) {
-      ctx->a.domain = 
+      ctx->a.domain =
 	test_proxy_add_domain(ctx->p,
 			      URL_STRING_MAKE("sip:example.com")->us_url,
 			      AUTHTAG_METHOD("Digest"),
@@ -126,7 +126,7 @@
 			      AUTHTAG_NEXT_EXPIRES(60),
 			      TAG_END());
 
-      ctx->b.domain = 
+      ctx->b.domain =
 	test_proxy_add_domain(ctx->p,
 			      URL_STRING_MAKE("sip:example.org")->us_url,
 			      AUTHTAG_METHOD("Digest"),
@@ -140,7 +140,7 @@
 
       test_proxy_domain_set_outbound(ctx->b.domain, 1);
 
-      ctx->c.domain = 
+      ctx->c.domain =
 	test_proxy_add_domain(ctx->p,
 			      URL_STRING_MAKE("sip:example.net")->us_url,
 			      AUTHTAG_METHOD("Digest"),
@@ -379,7 +379,7 @@
 	            NUTAG_APPL_METHOD_REF(appl_method),
 	            SIPTAG_SUPPORTED_REF(supported),
 	            TAG_END());
-  
+
   TEST(err, 4); TEST_1(m);
   TEST_1(ctx->c.contact = sip_contact_dup(ctx->home, m));
   TEST_1(ctx->c.allow = sip_allow_dup(ctx->home, allow));

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nat.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nat.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nat.c	Tue Dec 23 07:37:03 2008
@@ -128,7 +128,7 @@
 
 static struct binding *nat_binding_new(struct nat *nat,
 				       char const *protoname,
-				       int socktype, int protocol, 
+				       int socktype, int protocol,
 				       int connected,
 				       su_socket_t in_socket,
 				       su_sockaddr_t *from,
@@ -178,7 +178,7 @@
   nat->root = root;
   nat->udp_socket = INVALID_SOCKET, nat->tcp_socket = INVALID_SOCKET;
 
-  tl_gets(nat->tags, 
+  tl_gets(nat->tags,
 	  TESTNATTAG_SYMMETRIC_REF(nat->symmetric),
 	  TESTNATTAG_LOGGING_REF(nat->logging),
 	  TAG_END());
@@ -427,7 +427,7 @@
   if (nat == NULL)
     return su_seterrno(EFAULT);
 
-  return su_task_execute(su_clone_task(nat->clone), 
+  return su_task_execute(su_clone_task(nat->clone),
 			 invalidate_bindings, nat, NULL);
 }
 
@@ -485,10 +485,10 @@
   su_wakeup_f in_to_out, out_to_in;
 
   if (b->socktype == SOCK_STREAM)
-    in_to_out = tcp_in_to_out, out_to_in = tcp_out_to_in;    
+    in_to_out = tcp_in_to_out, out_to_in = tcp_out_to_in;
   else
-    in_to_out = udp_in_to_out, out_to_in = udp_out_to_in;    
-  
+    in_to_out = udp_in_to_out, out_to_in = udp_out_to_in;
+
   if (b->in_socket == INVALID_SOCKET) {
     int in_socket;
 
@@ -549,7 +549,7 @@
   b->in_register = su_root_register(nat->root, wait, in_to_out, b, 0);
   if (b->in_register < 0) {
     su_perror("nat_binding_new: su_root_register");
-    su_wait_destroy(wait); 
+    su_wait_destroy(wait);
     return -1;
   }
 
@@ -610,13 +610,13 @@
 
 #if 0
 static struct binding *nat_binding_find(struct nat *nat,
-					su_sockaddr_t *from, 
+					su_sockaddr_t *from,
 					int fromlen)
 {
   char name[64], ipname[64];
   size_t namelen;
   struct binding *b;
-				       
+
   su_inet_ntop(from->su_family, SU_ADDR(from), ipname, sizeof ipname);
   snprintf(name, sizeof name,
 	   from->su_family == AF_INET6 ? "[%s]:%u" : "%s:%u",
@@ -629,7 +629,7 @@
   }
 
   if (b == NULL)
-    b = nat_binding_new(nat, "UDP", SOCK_DGRAM, IPPROTO_UDP, nat->symmetric, 
+    b = nat_binding_new(nat, "UDP", SOCK_DGRAM, IPPROTO_UDP, nat->symmetric,
 			INVALID_SOCKET, from, fromlen);
 
   return b;
@@ -659,7 +659,7 @@
     return 0;
   }
 
-  b = nat_binding_new(nat, "UDP", SOCK_DGRAM, IPPROTO_UDP, nat->symmetric, 
+  b = nat_binding_new(nat, "UDP", SOCK_DGRAM, IPPROTO_UDP, nat->symmetric,
 		      INVALID_SOCKET, from, fromlen);
   if (b == NULL)
     return 0;
@@ -667,7 +667,7 @@
   if (nat->symmetric)
     m = su_send(b->out_socket, nat->buffer, n, 0);
   else
-    m = su_sendto(b->out_socket, nat->buffer, n, 0, 
+    m = su_sendto(b->out_socket, nat->buffer, n, 0,
 		  nat->out_address, nat->out_addrlen);
 
   if (nat->logging)
@@ -989,7 +989,7 @@
 
   a->nat = nat;
   a->f = filter;
-  
+
   if (su_task_execute(su_clone_task(nat->clone),
 		      execute_nat_filter_remove, a, NULL) < 0)
     return -1;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nat.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nat.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nat.h	Tue Dec 23 07:37:03 2008
@@ -33,7 +33,7 @@
 struct nat;
 struct nat_filter;
 
-struct nat *test_nat_create(su_root_t *, int family, 
+struct nat *test_nat_create(su_root_t *, int family,
 			    tag_type_t, tag_value_t, ...);
 
 void test_nat_destroy(struct nat *);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua.c	Tue Dec 23 07:37:03 2008
@@ -74,7 +74,7 @@
 static char const options_usage[] =
   "   -v | --verbose    be verbose\n"
   "   -q | --quiet      be quiet\n"
-  "   -a | --abort      abort on error\n" 
+  "   -a | --abort      abort on error\n"
   "   -s                use only single thread\n"
   "   -l level          set logging level (0 by default)\n"
   "   -e | --events     print nua events\n"
@@ -122,7 +122,7 @@
 #if HAVE_OPEN_C
   dup2(1, 2);
 #endif
-  
+
   if (getenv("EXPENSIVE_CHECKS"))
     o_expensive = 1;
 
@@ -331,7 +331,7 @@
   ctx->a.printer = o_events_init ? print_event : NULL;
 
   retval |= test_nua_api_errors(ctx); SINGLE_FAILURE_CHECK();
-  
+
   retval |= test_tag_filter(); SINGLE_FAILURE_CHECK();
 
   retval |= test_nua_params(ctx); SINGLE_FAILURE_CHECK();

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua.h	Tue Dec 23 07:37:03 2008
@@ -111,7 +111,7 @@
   struct event *head, **tail;
 };
 
-struct event 
+struct event
 {
   struct event *next, **prev;
   struct call *call;
@@ -267,7 +267,7 @@
 int run_b_until(struct context *, nua_event_t, condition_function *);
 int run_c_until(struct context *, nua_event_t, condition_function *);
 
-typedef int operation_f(struct endpoint *ep, struct call *call, 
+typedef int operation_f(struct endpoint *ep, struct call *call,
 			nua_handle_t *nh, tag_type_t tag, tag_value_t value,
 			...);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua_api.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua_api.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua_api.c	Tue Dec 23 07:37:03 2008
@@ -160,7 +160,7 @@
 int test_nua_destroy(struct context *ctx)
 {
   BEGIN();
-  
+
   struct endpoint *a = &ctx->a;
 
   TEST_1(ctx->root = su_root_create(NULL));
@@ -307,7 +307,7 @@
 
   if (print_headings)
     printf("TEST NUA-1.2.4: PASSED\n");
-  
+
   END();
 }
 
@@ -384,7 +384,7 @@
    A
    |------REGISTER--\
    |<-------503-----/
-   |			
+   |
 
 */
 
@@ -393,7 +393,7 @@
 
   TEST_1(a_reg->nh = nua_handle(a->nua, a_reg, TAG_END()));
 
-  REGISTER(a, a_reg, a_reg->nh, 
+  REGISTER(a, a_reg, a_reg->nh,
 	   NUTAG_REGISTRAR(URL_STRING_MAKE("sip:bad.domain")),
 	   SIPTAG_TO_STR("sip:lissu at bad.domain"),
 	   TAG_END());
@@ -407,7 +407,7 @@
 
   TEST_1(a_reg->nh = nua_handle(a->nua, a_reg, TAG_END()));
 
-  REGISTER(a, a_reg, a_reg->nh, 
+  REGISTER(a, a_reg, a_reg->nh,
 	   NUTAG_REGISTRAR(URL_STRING_MAKE("sip:bad.domain")),
 	   SIPTAG_TO_STR("sip:lissu at bad.domain"),
 	   TAG_END());
@@ -447,13 +447,13 @@
   nua_shutdown(a->nua);
 
   run_a_until(ctx, -1, until_final_response);
-  
+
   TEST_VOID(nua_destroy(a->nua));
 
   a->nua = NULL;
 
   su_root_destroy(ctx->root), ctx->root = NULL;
-	 
+
   if (print_headings)
     printf("TEST NUA-1.2: PASSED\n");
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua_params.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua_params.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_nua_params.c	Tue Dec 23 07:37:03 2008
@@ -155,7 +155,7 @@
 		 SIPTAG_USER_AGENT_STR("test_nua/1.0"),
 
 		 SIPTAG_ORGANIZATION_STR("Open Laboratory"),
-		 
+
 		 NUTAG_M_DISPLAY("XXX"),
 		 NUTAG_M_USERNAME("xxx"),
 		 NUTAG_M_PARAMS("user=ip"),
@@ -310,7 +310,7 @@
     char const *m_params = "NONE";
     char const *m_features = "NONE";
     char const *instance = "NONE";
-    
+
     url_string_t const *registrar = NONE;
     unsigned keepalive = (unsigned)-1, keepalive_stream = (unsigned)-1;
 
@@ -424,10 +424,10 @@
     TEST_S(sip_header_as_string(tmphome, (void *)allow), "OPTIONS, INFO, ACK");
     TEST_S(allow_str, "OPTIONS, INFO, ACK");
     TEST_S(appl_method, "INVITE, REGISTER, PUBLISH, SUBSCRIBE, NOTIFY");
-    TEST_S(sip_header_as_string(tmphome, (void *)allow_events), 
+    TEST_S(sip_header_as_string(tmphome, (void *)allow_events),
 	   "reg, presence, presence.winfo");
     TEST_S(allow_events_str, "reg, presence, presence.winfo");
-    TEST_S(sip_header_as_string(tmphome, (void *)supported), 
+    TEST_S(sip_header_as_string(tmphome, (void *)supported),
 	   "foo, bar, baz");
     TEST_S(supported_str, "foo, bar, baz");
     TEST_S(sip_header_as_string(tmphome, (void *)user_agent), "test_nua");

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_offer_answer.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_offer_answer.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_offer_answer.c	Tue Dec 23 07:37:03 2008
@@ -66,7 +66,7 @@
           <--nua_i_state---|                    |
 
    Client transitions:
-   INIT -(C1)-> CALLING -(C2a)-> PROCEEDING -(C3+C4)-> 
+   INIT -(C1)-> CALLING -(C2a)-> PROCEEDING -(C3+C4)->
    TERMINATING -> TERMINATED
    Server transitions:
    INIT -(S1)-> RECEIVED -(S2a)-> EARLY -(S3b)-> COMPLETED -(S4)-> READY
@@ -113,8 +113,8 @@
 
   /* Client transitions:
      INIT -(C1)-> CALLING: nua_invite(), nua_i_state
-     CALLING -(C3)-> PROCEEDING: nua_r_invite, nua_i_state 
-     PROCEEDING -(C3a+C5)-> TERMINATING: nua_r_invite, nua_i_state 
+     CALLING -(C3)-> PROCEEDING: nua_r_invite, nua_i_state
+     PROCEEDING -(C3a+C5)-> TERMINATING: nua_r_invite, nua_i_state
      TERMINATING -(C12)-> TERMINATED: nua_r_bye, nua_i_state
   */
   TEST_1(e = a->events->head); TEST_E(e->data->e_event, nua_i_state);
@@ -198,7 +198,7 @@
 
   switch (callstate(tags)) {
   case nua_callstate_received:
-    RESPOND(ep, call, nh, SIP_180_RINGING, 
+    RESPOND(ep, call, nh, SIP_180_RINGING,
 	    NUTAG_MEDIA_ENABLE(0),
 	    TAG_END());
     return 0;
@@ -238,7 +238,7 @@
     "t=0 0\r\n"
     "m=audio 5008 RTP/AVP 8\r\n";
 
-  b_call->sdp = 
+  b_call->sdp =
     "v=0\r\n"
     "o=- 2 1 IN IP4 127.0.0.1\r\n"
     "s=-\r\n"
@@ -246,7 +246,7 @@
     "t=0 0\r\n"
     "m=audio 5010 RTP/AVP 0 8\r\n";
 
-  TEST_1(a_call->nh = nua_handle(a->nua, a_call, 
+  TEST_1(a_call->nh = nua_handle(a->nua, a_call,
 				 SIPTAG_TO_STR("<sip:b at x.org>"),
 				 TAG_END()));
 
@@ -279,7 +279,7 @@
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
   TEST(e->data->e_status, 200);
   TEST_1(sip = sip_object(e->data->e_msg));
-  TEST_1(sip->sip_content_type); 
+  TEST_1(sip->sip_content_type);
   TEST_S(sip->sip_content_type->c_type, "application/sdp");
   TEST_1(sip->sip_payload);	/* there is sdp in 200 OK */
   TEST_1(sip->sip_contact);
@@ -344,7 +344,7 @@
 
   switch (callstate(tags)) {
   case nua_callstate_received:
-    RESPOND(ep, call, nh, SIP_180_RINGING, 
+    RESPOND(ep, call, nh, SIP_180_RINGING,
 	    TAG_END());
     return 0;
   case nua_callstate_early:
@@ -387,7 +387,7 @@
   nua_set_params(b->nua, NUTAG_MEDIA_ENABLE(0), TAG_END());
   run_b_until(ctx, nua_r_set_params, until_final_response);
 
-  TEST_1(a_call->nh = nua_handle(a->nua, a_call, 
+  TEST_1(a_call->nh = nua_handle(a->nua, a_call,
 				 SIPTAG_TO_STR("<sip:b at x.org>"),
 				 TAG_END()));
 
@@ -456,7 +456,7 @@
   nua_handle_destroy(b_call->nh), b_call->nh = NULL;
 
   nua_set_params(b->nua,
-		 NUTAG_MEDIA_ENABLE(1), 
+		 NUTAG_MEDIA_ENABLE(1),
 		 SOATAG_USER_SDP_STR("m=audio 5006 RTP/AVP 8 0"),
 		 TAG_END());
   run_b_until(ctx, nua_r_set_params, until_final_response);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_ops.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_ops.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_ops.c	Tue Dec 23 07:37:03 2008
@@ -48,7 +48,7 @@
 }
 
 int until_final_response(CONDITION_PARAMS)
-{ 
+{
   return status >= 200;
 }
 
@@ -115,7 +115,7 @@
 {
   tagi_t const *ti;
 
-  return 
+  return
     ((ti = tl_find(tags, nutag_answer_recv)) && ti->t_value) ||
     ((ti = tl_find(tags, nutag_offer_sent)) && ti->t_value) ||
     ((ti = tl_find(tags, nutag_offer_recv)) && ti->t_value) ||
@@ -182,7 +182,7 @@
 	    ep->name, (void *)nh, nua_event_name(event), phrase,
 	    nua_substate_name(t ? t->t_value : 0));
   }
-  else if ((int)event >= nua_i_bye || 
+  else if ((int)event >= nua_i_bye ||
 	   event == nua_i_invite || event == nua_i_cancel ||
 	   event == nua_i_ack) {
     fprintf(stderr, "%s %s.nua(%p): event %s %03d %s\n", timestamp,
@@ -208,7 +208,7 @@
 	      ep->name, (void *)nh, operation);
   }
 
-  if (tags && 
+  if (tags &&
       ((tstflags & tst_verbatim) || ctx->print_tags || ep->print_tags))
     tl_print(stderr, "", tags);
 }
@@ -516,7 +516,7 @@
     if (list->head == NULL)
       list->tail = &list->head;
   }
-}			      
+}
 
 struct event *event_by_type(struct event *e, nua_event_t etype)
 {

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_proxy.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_proxy.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_proxy.c	Tue Dec 23 07:37:03 2008
@@ -98,7 +98,7 @@
   tagi_t      *tags;
 
   su_root_t   *root;
- 
+
   nta_agent_t *agent;
   url_t const *uri;
   sip_route_t *lr;
@@ -119,7 +119,7 @@
     unsigned t1x64;
     sip_time_t session_expires, min_se;
   } prefs;
-}; 
+};
 
 struct domain {
   su_home_t home[1];
@@ -139,7 +139,7 @@
     int outbound_tcp;		/**< Use inbound TCP connection as outbound */
     char const *authorize;	/**< Authorization realm to use */
     int record_route;
-  } prefs;  
+  } prefs;
 
   tagi_t *tags;
 };
@@ -175,18 +175,18 @@
   tport_t *tport;		/**< Reference to tport */
 };
 
-static struct binding *binding_new(su_home_t *home, 
+static struct binding *binding_new(su_home_t *home,
 				   sip_contact_t *contact,
 				   tport_t *tport,
 				   sip_call_id_t const *call_id,
 				   uint32_t cseq,
-				   sip_time_t registered, 
+				   sip_time_t registered,
 				   sip_time_t expires);
 static void binding_destroy(su_home_t *home, struct binding *b);
 static int binding_is_active(struct binding const *b)
 {
   return
-    b->expires > sip_now() && 
+    b->expires > sip_now() &&
     (b->tport == NULL || tport_is_clear_to_send(b->tport));
 }
 
@@ -270,21 +270,21 @@
 static auth_challenger_t proxy_challenger[1];
 
 /* Proxy entry point */
-static int 
+static int
 test_proxy_init(su_root_t *root, struct proxy *proxy)
 {
   struct proxy_tr *t;
   struct client_tr *c;
 
-  auth_challenger_t _proxy_challenger[1] = 
-  {{ 
+  auth_challenger_t _proxy_challenger[1] =
+  {{
       SIP_407_PROXY_AUTH_REQUIRED,
       sip_proxy_authenticate_class,
       sip_proxy_authentication_info_class
     }};
 
-  auth_challenger_t _registrar_challenger[1] = 
-  {{ 
+  auth_challenger_t _registrar_challenger[1] =
+  {{
       SIP_401_UNAUTHORIZED,
       sip_www_authenticate_class,
       sip_authentication_info_class
@@ -323,14 +323,14 @@
 		       NTATAG_SIP_T1X64_REF(proxy->prefs.t1x64),
 		       TAG_END());
 
-  if (!proxy->defleg) 
+  if (!proxy->defleg)
     return -1;
   /* if (!proxy->example_net || !proxy->example_org || !proxy->example_com)
      return -1; */
 
   /* Create stateless client */
   t = su_zalloc(proxy->home, sizeof *t);
-  c = su_zalloc(proxy->home, sizeof *c); 
+  c = su_zalloc(proxy->home, sizeof *c);
 
   if (!t || !c)
     return -1;
@@ -350,7 +350,7 @@
 
   if (!proxy->lr)
     return -1;
-  				  
+
   return 0;
 }
 
@@ -391,7 +391,7 @@
     ta_start(ta, tag, value);
     p->tags = tl_llist(ta_tags(ta));
     ta_end(ta);
-    
+
     if (su_clone_start(root,
 		       p->clone,
 		       p,
@@ -435,7 +435,7 @@
   struct proxy *p;
   int logging;
 };
- 
+
 static int _set_logging(void *_a)
 {
   struct _set_logging *a = _a;
@@ -451,8 +451,8 @@
 }
 
 void test_proxy_domain_set_expiration(struct domain *d,
-				      sip_time_t min_expires, 
-				      sip_time_t expires, 
+				      sip_time_t min_expires,
+				      sip_time_t expires,
 				      sip_time_t max_expires)
 {
   if (d) {
@@ -475,7 +475,7 @@
 }
 
 void test_proxy_set_session_timer(struct proxy *p,
-				  sip_time_t session_expires, 
+				  sip_time_t session_expires,
 				  sip_time_t min_se)
 {
   if (p) {
@@ -529,7 +529,7 @@
   }
 }
 
-int test_proxy_domain_set_authorize(struct domain *d, 
+int test_proxy_domain_set_authorize(struct domain *d,
 				     char const *realm)
 {
   if (d) {
@@ -604,14 +604,14 @@
     d->prefs.outbound_tcp = 0;
     d->prefs.authorize = NULL;
 
-    if (d->uri && d->tags && 
+    if (d->uri && d->tags &&
 	!su_task_execute(su_clone_task(p->clone), _domain_init, d, &init)) {
       if (init == 0)
 	/* OK */;
       else
 	d = NULL;
     }
-    else 
+    else
       su_home_unref(d->home);
   }
 
@@ -687,7 +687,7 @@
   for (v = nta_agent_via(p->agent); v; v = v->v_next) {
     char const *proto = v->v_protocol;
 
-    if (v->v_next && 
+    if (v->v_next &&
 	strcasecmp(v->v_host, v->v_next->v_host) == 0 &&
 	str0cmp(v->v_port, v->v_next->v_port) == 0 &&
 	((proto == sip_transport_udp &&
@@ -753,14 +753,14 @@
 {
   int (*process)(struct proxy_tr *) = NULL;
   sip_method_t method = sip->sip_request->rq_method;
-  
+
   assert(pod->domain->magic = domain_init);
 
   if (leg == pod->domain->uleg)
     process = proxy_transaction;
   else if (method == sip_method_register)
     process = process_register;
-  else if (method == sip_method_options) 
+  else if (method == sip_method_options)
     process = process_options;
 
   if (process == NULL)
@@ -839,15 +839,15 @@
 
   if (t->as)
     info = t->as->as_info, response = t->as->as_response;
-  
-  if (nta_incoming_treply(t->server, t->status = status, phrase, 
+
+  if (nta_incoming_treply(t->server, t->status = status, phrase,
 			  SIPTAG_HEADER(info),
 			  SIPTAG_HEADER(response),
 			  ta_tags(ta)) < 0)
     t->status = status = 500;
 
   ta_end(ta);
-  
+
   return status;
 }
 
@@ -892,8 +892,8 @@
   }
 
   /* Remove our routes */
-  while (t->sip->sip_route && 
-	 url_has_param(t->sip->sip_route->r_url, "lr") && 
+  while (t->sip->sip_route &&
+	 url_has_param(t->sip->sip_route->r_url, "lr") &&
 	 (url_cmp(t->proxy->lr->r_url, t->sip->sip_route->r_url) == 0 ||
 	  url_cmp(t->proxy->rr_uri, t->sip->sip_route->r_url) == 0)) {
     sip_route_remove(t->msg, t->sip);
@@ -902,7 +902,7 @@
 
   if (t->use_auth)
     return challenge_transaction(t);
-  
+
   return 0;
 }
 
@@ -915,7 +915,7 @@
 
   if (t->method == sip_method_invite) {
     if (t->proxy->prefs.min_se) {
-      if (!sip->sip_min_se || 
+      if (!sip->sip_min_se ||
 	  sip->sip_min_se->min_delta < t->proxy->prefs.min_se) {
 	min_se = sip_min_se_init(min_se0);
 	min_se->min_delta = t->proxy->prefs.min_se;
@@ -959,7 +959,7 @@
   struct binding *b;
 
 #if 0
-  if (sip->sip_request->rq_method == sip_method_register) 
+  if (sip->sip_request->rq_method == sip_method_register)
     return process_register(proxy, irq, sip);
 #endif
 
@@ -968,7 +968,7 @@
     return respond_transaction(t, SIP_404_NOT_FOUND, TAG_END());
 
   for (b = e->bindings; b; b = b->next) {
-    if (binding_is_active(b)) 
+    if (binding_is_active(b))
       target_transaction(t, b->contact->m_url, b->tport);
 
     if (t->clients)		/* XXX - enable forking */
@@ -1073,7 +1073,7 @@
     msg_header_remove(t->msg, (msg_pub_t *)sip, as->as_match);
 
   return 0;
-}		      
+}
 
 int proxy_ack_cancel(struct proxy_tr *t,
 		     nta_incoming_t *irq,
@@ -1083,7 +1083,7 @@
   int status;
 
   if (sip == NULL) {		/* timeout */
-    proxy_tr_destroy(t);	
+    proxy_tr_destroy(t);
     return 0;
   }
 
@@ -1096,7 +1096,7 @@
     if (c->client && c->status < 200)
       /*
        * We don't care about response to CANCEL (or ACK)
-       * so we give NULL as callback pointer (and nta immediately 
+       * so we give NULL as callback pointer (and nta immediately
        * destroys transaction object or marks it disposable)
        */
       if (nta_outgoing_tcancel(c->client, NULL, NULL, TAG_END()) == NULL)
@@ -1117,7 +1117,7 @@
   if (sip) {
     msg_t *response = nta_outgoing_getresponse(client);
     if (c->t->method == sip_method_invite)
-      final = sip->sip_status->st_status >= 300, 
+      final = sip->sip_status->st_status >= 300,
 	timeout = sip->sip_status->st_status >= 200;
     else
       final = sip->sip_status->st_status >= 200;
@@ -1150,7 +1150,7 @@
   assert(c->t);
 
   if (sip &&
-      sip->sip_status->st_status >= 200 && 
+      sip->sip_status->st_status >= 200 &&
       sip->sip_status->st_status < 300) {
     msg_t *response = nta_outgoing_getresponse(client);
     sip_via_remove(response, sip_object(response));
@@ -1168,7 +1168,7 @@
 }
 
 
-/** Proxy only late responses 
+/** Proxy only late responses
  *
  * Keeping the invite transactions live
  */
@@ -1219,7 +1219,7 @@
 
   if (t->as)
     su_home_unref(t->as->as_home), t->as = NULL;
-  
+
   while (t->clients) {
     client_tr_remove(c = t->clients);
     nta_outgoing_destroy(c->client), c->client = NULL;
@@ -1275,7 +1275,7 @@
 
   if (check_out_of_order(t))
     return t->status;
-  
+
   return update_bindings(t);
 }
 
@@ -1286,7 +1286,7 @@
   sip_via_t *v = sip->sip_via;
 
   if (m && v && v->v_received && m->m_url->url_host
-      && strcasecmp(v->v_received, m->m_url->url_host) 
+      && strcasecmp(v->v_received, m->m_url->url_host)
       && host_is_ip_address(m->m_url->url_host))
     return respond_transaction(t, 406, "Unacceptable Contact", TAG_END());
 
@@ -1309,7 +1309,7 @@
 
   for (; m; m = m->m_next) {
     expires = sip_contact_expires(m, ex, date, t->domain->prefs.expires, t->now);
-    
+
     if (expires > 0 && expires < t->domain->prefs.min_expires) {
       sip_min_expires_t me[1];
 
@@ -1375,8 +1375,8 @@
   if (d == NULL)
     return NULL;
 
-  e = su_zalloc(d->home, sizeof *e); 
-  if (!e) 
+  e = su_zalloc(d->home, sizeof *e);
+  if (!e)
     return NULL;
 
   e->domain = d;
@@ -1415,16 +1415,16 @@
 /* Bindings */
 
 static
-struct binding *binding_new(su_home_t *home, 
+struct binding *binding_new(su_home_t *home,
 			    sip_contact_t *contact,
 			    tport_t *tport,
 			    sip_call_id_t const *call_id,
 			    uint32_t cseq,
-			    sip_time_t registered, 
+			    sip_time_t registered,
 			    sip_time_t expires)
 {
   struct binding *b;
-  
+
   b = su_zalloc(home, sizeof *b);
 
   if (b) {
@@ -1444,7 +1444,7 @@
     if (b)
       msg_header_remove_param(b->contact->m_common, "expires");
   }
-  
+
   return b;
 }
 
@@ -1472,7 +1472,7 @@
   sip_date_t *date = t->sip->sip_date;
   sip_time_t expires;
   tport_t *tport = NULL;
-  sip_contact_t *contacts = NULL, **mm = &contacts; 
+  sip_contact_t *contacts = NULL, **mm = &contacts;
   void *tbf;
 
   if (t->sip->sip_contact == NULL) {
@@ -1486,7 +1486,7 @@
   if (t->entry == NULL)
     return respond_transaction(t, SIP_500_INTERNAL_SERVER_ERROR, TAG_END());
 
-  if (d->prefs.outbound_tcp && 
+  if (d->prefs.outbound_tcp &&
       str0casecmp(t->sip->sip_via->v_protocol, sip_transport_tcp) == 0)
     tport = nta_incoming_transport(t->proxy->agent, t->server, NULL);
 
@@ -1494,7 +1494,7 @@
   for (m = t->sip->sip_contact; m; m = m->m_next) {
     if (m->m_url->url_type == url_any)
       break;
-    
+
     expires = sip_contact_expires(m, ex, date, d->prefs.expires, t->now);
 
     if (expires > d->prefs.max_expires)
@@ -1519,7 +1519,7 @@
       next = old->next;
 
       for (b = bindings; b != last; b = b->next) {
-	if (url_cmp_all(old->contact->m_url, b->contact->m_url) != 0) 
+	if (url_cmp_all(old->contact->m_url, b->contact->m_url) != 0)
 	  continue;
 
 	if (strcmp(old->call_id->i_id, b->call_id->i_id) == 0) {
@@ -1561,7 +1561,7 @@
 
     *mm = sip_contact_copy(d->home, b->contact);
     if (*mm) {
-      expires = su_sprintf(d->home, "expires=%u", 
+      expires = su_sprintf(d->home, "expires=%u",
 			   (unsigned)(b->expires - t->now));
       msg_header_add_param(d->home, (*mm)->m_common, expires);
       mm = &(*mm)->m_next;
@@ -1586,7 +1586,7 @@
   struct domain *d;
   struct registration_entry *e;
   struct binding *b;
-  
+
   /* Close all outbound transports */
   for (d = p->domains; d; d = d->next) {
     for (e = d->entries; e; e = e->next) {
@@ -1599,6 +1599,6 @@
       }
     }
   }
-  
+
   return 0;
 }

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_proxy.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_proxy.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_proxy.h	Tue Dec 23 07:37:03 2008
@@ -49,17 +49,17 @@
 void test_proxy_set_logging(struct proxy *, int logging);
 
 void test_proxy_domain_set_expiration(struct domain *,
-				      sip_time_t min_expires, 
-				      sip_time_t expires, 
+				      sip_time_t min_expires,
+				      sip_time_t expires,
 				      sip_time_t max_expires);
 
 void test_proxy_domain_get_expiration(struct domain *,
-				      sip_time_t *return_min_expires, 
-				      sip_time_t *return_expires, 
+				      sip_time_t *return_min_expires,
+				      sip_time_t *return_expires,
 				      sip_time_t *return_max_expires);
 
 void test_proxy_set_session_timer(struct proxy *p,
-				  sip_time_t session_expires, 
+				  sip_time_t session_expires,
 				  sip_time_t min_se);
 
 void test_proxy_get_session_timer(struct proxy *p,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_refer.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_refer.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_refer.c	Tue Dec 23 07:37:03 2008
@@ -239,7 +239,7 @@
     printf("TEST %s.2: B refers A to C\n", tests);
 
   if (b_refer != b_call)
-    TEST_1(b_refer->nh = 
+    TEST_1(b_refer->nh =
 	   nua_handle(b->nua, b_refer, SIPTAG_TO(a->to), TAG_END()));
 
   *sip_refer_to_init(r0)->r_url = *c->contact->m_url;
@@ -356,7 +356,7 @@
     Events in A:
     nua_i_subscribe, nua_r_notify
   */
-  TEST_1(e = a->events->head); 
+  TEST_1(e = a->events->head);
   if (e->data->e_event == nua_r_notify)
     TEST_1(e = e->next);
   TEST_E(e->data->e_event, nua_i_subscribe);
@@ -371,7 +371,7 @@
      Events in B after nua_subscribe():
      nua_r_subscribe, nua_i_notify
   */
-  TEST_1(e = b->events->head); 
+  TEST_1(e = b->events->head);
   if (e->data->e_event == nua_i_notify) {
   TEST(e->data->e_status, 200);
   TEST_1(sip = sip_object(e->data->e_msg));
@@ -575,7 +575,7 @@
   TEST(callstate(e->data->e_tags), nua_callstate_terminated); /* TERMINATED */
   TEST_1(!e->next);
   free_events_in_list(ctx, a->events);
-  
+
   /* Transitions of B:
      READY -(T1)-> TERMINATED: nua_i_bye, nua_i_state
   */
@@ -685,7 +685,7 @@
 
     assert(nua_handle_has_events(r_call->nh));
 
-    pl = sip_payload_format(NULL, "SIP/2.0 %u %s\r\n", 
+    pl = sip_payload_format(NULL, "SIP/2.0 %u %s\r\n",
 			    st->st_status, st->st_phrase);
 
     NOTIFY(ep, r_call, r_call->nh,
@@ -761,7 +761,7 @@
   TEST_1(sip->sip_refer_to);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_notify);
   TEST(e->data->e_status, 200);
-  TEST_1(!e->next); 
+  TEST_1(!e->next);
   /*
      Events in C after nua_refer():
      nua_r_refer
@@ -780,7 +780,7 @@
   TEST(e->data->e_status, 480);
 
   TEST_1(!e->next);
-  
+
   free_events_in_list(ctx, a->events);
   free_events_in_list(ctx, c->events);
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_register.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_register.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_register.c	Tue Dec 23 07:37:03 2008
@@ -75,10 +75,10 @@
     printf("TEST NUA-2.3.0.1: un-REGISTER a\n");
 
   TEST_1(a_reg->nh = nua_handle(a->nua, a_reg, TAG_END()));
-  UNREGISTER(a, a_reg, a_reg->nh, SIPTAG_TO(a->to), 
+  UNREGISTER(a, a_reg, a_reg->nh, SIPTAG_TO(a->to),
 	     SIPTAG_CONTACT_STR("*"),
 	     TAG_END());
-  run_a_until(ctx, -1, until_final_response);  
+  run_a_until(ctx, -1, until_final_response);
   AUTHENTICATE(a, a_reg, a_reg->nh,
 	       NUTAG_AUTH("Digest:\"test-proxy\":alice:secret"), TAG_END());
   run_a_until(ctx, -1, until_final_response);
@@ -91,10 +91,10 @@
     printf("TEST NUA-2.3.0.2: un-REGISTER b\n");
 
   TEST_1(b_reg->nh = nua_handle(b->nua, b_reg, TAG_END()));
-  UNREGISTER(b, b_reg, b_reg->nh, SIPTAG_TO(b->to), 
+  UNREGISTER(b, b_reg, b_reg->nh, SIPTAG_TO(b->to),
 	     SIPTAG_CONTACT_STR("*"),
 	     TAG_END());
-  run_b_until(ctx, -1, until_final_response);  
+  run_b_until(ctx, -1, until_final_response);
   AUTHENTICATE(b, b_reg, b_reg->nh,
 	       NUTAG_AUTH("Digest:\"test-proxy\":bob:secret"), TAG_END());
   run_b_until(ctx, -1, until_final_response);
@@ -111,7 +111,7 @@
 	     SIPTAG_FROM(c->to), SIPTAG_TO(c->to),
 	     SIPTAG_CONTACT_STR("*"),
 	     TAG_END());
-  run_c_until(ctx, -1, until_final_response);  
+  run_c_until(ctx, -1, until_final_response);
   AUTHENTICATE(c, c_reg, c_reg->nh,
 	       NUTAG_AUTH("Digest:\"test-proxy\":charlie:secret"), TAG_END());
   run_c_until(ctx, -1, until_final_response);
@@ -227,7 +227,7 @@
   }
 
   run_a_until(ctx, -1, a->next_condition);
-  
+
   for (e = a->events->head; e; e = e->next) {
     TEST_E(e->data->e_event, nua_r_register);
     TEST(e->data->e_status, 200);
@@ -375,7 +375,7 @@
     if (ctx->p)
       m->m_url->url_params = "transport=tcp";
 
-    REGISTER(b, b_reg, b_reg->nh, SIPTAG_TO(b->to), 
+    REGISTER(b, b_reg, b_reg->nh, SIPTAG_TO(b->to),
 	     SIPTAG_CONTACT(m),
 	     /* Do not include credentials unless challenged */
 	     NUTAG_AUTH_CACHE(nua_auth_cache_challenged),
@@ -440,7 +440,7 @@
 	   NUTAG_CALLEE_CAPS(1),
 	   SIPTAG_EXPIRES_STR("5"), /* Test 423 negotiation */
 	   TAG_END());
-  run_abc_until(ctx, -1, save_events, -1, save_events, 
+  run_abc_until(ctx, -1, save_events, -1, save_events,
 		-1, save_until_final_response);
 
   TEST_1(e = c->events->head);
@@ -454,7 +454,7 @@
 
   AUTHENTICATE(c, c_reg, c_reg->nh,
 	       NUTAG_AUTH("Digest:\"test-proxy-0\":charlie:secret"), TAG_END());
-  run_abc_until(ctx, -1, save_events, -1, save_events, 
+  run_abc_until(ctx, -1, save_events, -1, save_events,
 		-1, save_until_final_response);
 
   TEST_1(e = c->events->head);
@@ -527,7 +527,7 @@
   }
 
   run_ab_until(ctx, -1, a->next_condition, -1, b->next_condition);
-  
+
   for (e = a->events->head; e; e = e->next) {
     TEST_E(e->data->e_event, nua_r_register);
     TEST(e->data->e_status, 200);
@@ -628,7 +628,7 @@
 
   TEST_1(b_call->nh = nua_handle(b->nua, b_call, TAG_END()));
 
-  REGISTER(b, b_call, b_call->nh, 
+  REGISTER(b, b_call, b_call->nh,
 	   NUTAG_REGISTRAR((url_string_t *)c->contact->m_url),
 	   SIPTAG_TO(b->to),
 	   NUTAG_OUTBOUND(NULL),
@@ -778,7 +778,7 @@
 
     free_events_in_list(ctx, c->events);
 
-    /* Sneakily change the realm */  
+    /* Sneakily change the realm */
 
     TEST(test_proxy_domain_set_authorize(ctx->c.domain, "test-proxy"), 0);
 
@@ -871,7 +871,7 @@
 
   if (print_headings)
     printf("TEST NUA-2.5.1: PASSED\n");
-  
+
   if (print_headings)
     printf("TEST NUA-2.5.2: OPTIONS from B to A\n");
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_session_timer.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_session_timer.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_session_timer.c	Tue Dec 23 07:37:03 2008
@@ -82,7 +82,7 @@
 
   /* We negotiate session timer of 6 second */
   /* Disable session timer from proxy */
-  test_proxy_set_session_timer(ctx->p, 0, 0); 
+  test_proxy_set_session_timer(ctx->p, 0, 0);
 
   nua_set_params(ctx->b.nua,
 		 NUTAG_SESSION_REFRESHER(nua_any_refresher),
@@ -199,7 +199,7 @@
       TEST_1(f);
 
       run_ab_until(ctx, -1, until_terminated, -1, until_terminated);
-      
+
       TEST_1(e = a->events->head); TEST_E(e->data->e_event, nua_r_bye);
 
       free_events_in_list(ctx, a->events);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_simple.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_simple.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_simple.c	Tue Dec 23 07:37:03 2008
@@ -148,7 +148,7 @@
   TEST_1(e = a->events->head); TEST_E(e->data->e_event, nua_r_message);
   TEST(e->data->e_status, 202);
   TEST_1(sip = sip_object(e->data->e_msg));
-  TEST_1(sip_user_agent(sip)); 
+  TEST_1(sip_user_agent(sip));
   TEST_S(sip_user_agent(sip)->g_value, "007");
   TEST_1(!e->next);
 
@@ -229,7 +229,7 @@
 int accept_request(CONDITION_PARAMS)
 {
   msg_t *with = nua_current_request(nua);
-  
+
   if (!(check_handle(ep, call, nh, SIP_500_INTERNAL_SERVER_ERROR)))
     return 0;
 
@@ -265,7 +265,7 @@
       RESPOND(ep, call, nh, SIP_412_PRECONDITION_FAILED,
 	      NUTAG_WITH(with),
 	      TAG_END());
-    } 
+    }
     else {
       RESPOND(ep, call, nh, SIP_200_OK,
 	      NUTAG_WITH(with),
@@ -433,7 +433,7 @@
   if (!ctx->expensive && 0)
     goto skip_republish;
 
-  run_ab_until(ctx, -1, save_until_final_response, -1, respond_with_etag); 
+  run_ab_until(ctx, -1, save_until_final_response, -1, respond_with_etag);
 
   /* Client events: nua_r_publish
   */
@@ -445,7 +445,7 @@
   TEST_1(!e->next);
 
   free_events_in_list(ctx, a->events);
- 
+
   /*
    Server events:
    nua_i_publish
@@ -492,7 +492,7 @@
 
   TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
 
-  /* Let server close handle without responding to PUBLISH */ 
+  /* Let server close handle without responding to PUBLISH */
   PUBLISH(a, a_call, a_call->nh,
 	  TAG_IF(!ctx->proxy_tests, NUTAG_URL(b->contact->m_url)),
 	  SIPTAG_EVENT_STR("presence"),
@@ -579,7 +579,7 @@
   switch (event) {
   case nua_i_subscribe:
     if (status < 200) {
-      NOTIFY(ep, call, nh, 
+      NOTIFY(ep, call, nh,
 	     SIPTAG_EVENT(sip->sip_event),
 	     SIPTAG_CONTENT_TYPE_STR("application/pidf+xml"),
 	     SIPTAG_PAYLOAD_STR(presence_closed),
@@ -647,7 +647,7 @@
 	      SIPTAG_EXPIRES(sip->sip_expires),
 	      TAG_END());
 
-      NOTIFY(ep, call, nh, 
+      NOTIFY(ep, call, nh,
 	     SIPTAG_EVENT(sip->sip_event),
 	     SIPTAG_CONTENT_TYPE_STR("application/pidf+xml"),
 	     SIPTAG_PAYLOAD_STR(presence_closed),
@@ -673,7 +673,7 @@
 
   switch (event) {
   case nua_i_subscribe:
-    NOTIFY(ep, call, nh, 
+    NOTIFY(ep, call, nh,
 	   SIPTAG_EVENT(sip->sip_event),
 	   SIPTAG_CONTENT_TYPE_STR("application/pidf+xml"),
 	   SIPTAG_PAYLOAD_STR(presence_closed),
@@ -970,7 +970,7 @@
   TEST(e->data->e_status, 200);
   TEST_1(sip = sip_object(e->data->e_msg));
   TEST_1(tl_find(e->data->e_tags, nutag_substate));
-  TEST(tl_find(e->data->e_tags, nutag_substate)->t_value, 
+  TEST(tl_find(e->data->e_tags, nutag_substate)->t_value,
        nua_substate_terminated);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_notify);
   TEST_1(e->data->e_status >= 200);
@@ -1089,7 +1089,7 @@
 
   SUBSCRIBE(a, a_call, a_call->nh, TAG_END());
 
-  run_ab_until(ctx, -1, save_until_notified_and_responded_twice, 
+  run_ab_until(ctx, -1, save_until_notified_and_responded_twice,
 	       -1, accept_subscription_until_terminated);
 
 #if 0
@@ -1128,7 +1128,7 @@
   TEST(e->data->e_status, 200);
   TEST_1(sip = sip_object(e->data->e_msg));
   TEST_1(tl_find(e->data->e_tags, nutag_substate));
-  TEST(tl_find(e->data->e_tags, nutag_substate)->t_value, 
+  TEST(tl_find(e->data->e_tags, nutag_substate)->t_value,
        nua_substate_terminated);
   TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_notify);
   TEST_1(e->data->e_status >= 200);
@@ -1500,7 +1500,7 @@
   TEST_1(!e->next);
 
   free_events_in_list(ctx, a->events);
-  
+
   /* 2nd NOTIFY using same dialog */
   /* Check that server really discards the dialog */
 
@@ -1633,7 +1633,7 @@
   a->state.n = 4;
   b->state.n = 4;
 
-  run_ab_until(ctx, -1, save_until_nth_final_response, 
+  run_ab_until(ctx, -1, save_until_nth_final_response,
 	       -1, accept_n_notifys);
 
   /* Notifier events: nua_r_notify nua_r_notify */
@@ -1743,7 +1743,7 @@
   a->state.n = 3;
   b->state.n = 3;
 
-  run_ab_until(ctx, -1, save_until_nth_final_response, 
+  run_ab_until(ctx, -1, save_until_nth_final_response,
 	       -1, accept_n_notifys);
 
   /* Notifier events: nua_r_notify nua_r_notify */
@@ -1876,14 +1876,14 @@
   END();
 }
 
-/**Terminate when received notify. 
+/**Terminate when received notify.
  * Respond to NOTIFY with 200 OK if it has not been responded.
  * Save events (except nua_i_active or terminated).
  */
 int accept_notify(CONDITION_PARAMS)
 {
   if (event == nua_i_notify && status < 200)
-    RESPOND(ep, call, nh, SIP_200_OK, 
+    RESPOND(ep, call, nh, SIP_200_OK,
 	    NUTAG_WITH_THIS(ep->nua),
 	    TAG_END());
 
@@ -1898,7 +1898,7 @@
 
   if (nua_r_set_params <= event && event < nua_i_network_changed
       && status >= 200) {
-    if (ep->state.n > 0) 
+    if (ep->state.n > 0)
       ep->state.n--;
     return ep->state.n == 0;
   }
@@ -1911,7 +1911,7 @@
   tagi_t const *substate = tl_find(tags, nutag_substate);
 
   if (event == nua_i_notify && status < 200)
-    RESPOND(ep, call, nh, SIP_200_OK, 
+    RESPOND(ep, call, nh, SIP_200_OK,
 	    NUTAG_WITH_THIS(ep->nua),
 	    TAG_END());
 
@@ -1920,10 +1920,10 @@
   if (event != nua_i_notify)
     return 0;
 
-  if (ep->state.n > 0) 
+  if (ep->state.n > 0)
     ep->state.n--;
 
-  if (ep->state.n == 0) 
+  if (ep->state.n == 0)
     return 1;
 
   if (substate && substate->t_value == nua_substate_terminated) {
@@ -2068,7 +2068,7 @@
 	    NUTAG_WITH(with),
 	    SIPTAG_EXPIRES_STR("360"),
 	    TAG_END());
-    NOTIFY(ep, call, nh, 
+    NOTIFY(ep, call, nh,
 	   SIPTAG_EVENT(sip->sip_event),
 	   SIPTAG_CONTENT_TYPE_STR("application/pidf+xml"),
 	   SIPTAG_PAYLOAD_STR(presence_closed),

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_sip_events.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_sip_events.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/tests/test_sip_events.c	Tue Dec 23 07:37:03 2008
@@ -72,7 +72,7 @@
 		   NUTAG_AUTH("Digest:\"test-proxy\":charlie:secret"),
 		   TAG_END());
     }
-    else if (status >= 300) 
+    else if (status >= 300)
       return 1;
     else if (status >= 200)
       ep->flags.bit1 = 1;

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/utils/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/utils/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/utils/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -1,6 +1,6 @@
 2006-02-08  Kai Vehmanen  <kai.vehmanen at nokia.com>
 
-	* Makefile.am, nua_cli.c: nua_cli example add removed from the 
+	* Makefile.am, nua_cli.c: nua_cli example add removed from the
 	distribution package.
 
 2005-09-29  Pekka Pessi  <Pekka.Pessi at nokia.com>
@@ -14,8 +14,8 @@
     M ./utils/nua_cli.c +2
 
 2005-09-28  Pekka Pessi  <Pekka.Pessi at nokia.com>
-	
-	* Not using soa directly anymore. 
+
+	* Not using soa directly anymore.
 
 	    M ./utils/nua_cli.c -5 +3
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/utils/Doxyfile.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/utils/Doxyfile.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/utils/Doxyfile.in	Tue Dec 23 07:37:03 2008
@@ -1,5 +1,5 @@
 #
-# Template for Doxyfile. 
+# Template for Doxyfile.
 # @configure_input@
 #
 # Copyright (C) 2006 Nokia Corporation
@@ -27,13 +27,13 @@
 @INCLUDE = ../libsofia-sip-ua/docs/Doxyfile.aliases
 @INCLUDE = ../libsofia-sip-ua/docs/Doxyfile.rfc
 
-FILE_PATTERNS        = *.h *.c 
+FILE_PATTERNS        = *.h *.c
 
 EXCLUDE_PATTERNS     = acconfig.h config.h confdefs.h \
 			test*.h test*.c torture*.c *test.c *torture.c \
 			*_tag_dll.c *_tag_ref.c
 
-TAGFILES             = 
+TAGFILES             =
 
 OUTPUT_LANGUAGE      = English
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/utils/apps_utils.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/utils/apps_utils.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/utils/apps_utils.h	Tue Dec 23 07:37:03 2008
@@ -3,8 +3,8 @@
 
 /**
  * @nofile apps_utils.h
- * @brief 
- * 
+ * @brief
+ *
  * Copyright (C) 2005 Nokia Corporation.
  *
  * Written by Pekka Pessi <pekka -dot pessi -at- nokia -dot- com>
@@ -25,7 +25,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA
  * @ENDLGPL@
- * 
+ *
  * @date Created: Thu Apr  8 15:55:15 2004 ppessi
  *
  */
@@ -38,20 +38,20 @@
 		       sip_t const *sip,
 		       nta_response_f response_function)
 {
-  if (sip && sip->sip_status->st_status == 407 && 
+  if (sip && sip->sip_status->st_status == 407 &&
       sip->sip_proxy_authenticate &&
-      c->c_proxy_auth_retries++ < 3 && 
+      c->c_proxy_auth_retries++ < 3 &&
       c->c_proxy && c->c_proxy->url_user && c->c_proxy->url_password) {
     url_t *u = c->c_proxy;
     msg_t *rmsg = nta_outgoing_getrequest(oreq);
     sip_t *rsip = sip_object(rmsg);
 
     if (auc_challenge(&c->c_proxy_auth, c->c_home, sip->sip_proxy_authenticate,
-		      sip_proxy_authorization_class) >= 0 
+		      sip_proxy_authorization_class) >= 0
 	&&
-	auc_all_credentials(&c->c_proxy_auth, NULL, NULL, 
+	auc_all_credentials(&c->c_proxy_auth, NULL, NULL,
 			    u->url_user, u->url_password) > 0
-	&& 
+	&&
 	auc_authorization(&c->c_proxy_auth, rmsg, (msg_pub_t *)rsip,
 			  rsip->sip_request->rq_method_name,
 			  rsip->sip_request->rq_url,
@@ -59,14 +59,14 @@
       nta_outgoing_destroy(c->c_orq);
       sip_header_remove(rmsg, rsip, (sip_header_t *)rsip->sip_via);
       nta_msg_request_complete(rmsg, c->c_leg, 0, NULL, NULL);
-      c->c_orq = nta_outgoing_tmcreate(c->c_agent, response_function, c, NULL, 
+      c->c_orq = nta_outgoing_tmcreate(c->c_agent, response_function, c, NULL,
 				       rmsg, TAG_END());
       return 1;
     }
   }
 
   return 0;
-}				   
+}
 
 static inline
 int server_authenticate(context_t *c,
@@ -74,18 +74,18 @@
 			sip_t const *sip,
 			nta_response_f response_function)
 {
-  if (sip && sip->sip_status->st_status == 401 && 
+  if (sip && sip->sip_status->st_status == 401 &&
       sip->sip_www_authenticate &&
-      c->c_auth_retries++ < 3 && 
+      c->c_auth_retries++ < 3 &&
       c->c_password && c->c_username) {
     msg_t *rmsg = nta_outgoing_getrequest(oreq);
     sip_t *rsip = sip_object(rmsg);
 
     if (auc_challenge(&c->c_auth, c->c_home, sip->sip_www_authenticate,
-		      sip_authorization_class) >= 0 
+		      sip_authorization_class) >= 0
 	&&
 	auc_all_credentials(&c->c_auth, NULL, NULL, c->c_username, c->c_password) > 0
-	&& 
+	&&
 	auc_authorization(&c->c_auth, rmsg, (msg_pub_t *)rsip,
 			  rsip->sip_request->rq_method_name,
 			  rsip->sip_request->rq_url,
@@ -93,14 +93,14 @@
       nta_outgoing_destroy(c->c_orq);
       sip_header_remove(rmsg, rsip, (sip_header_t *)rsip->sip_via);
       nta_msg_request_complete(rmsg, c->c_leg, 0, NULL, NULL);
-      c->c_orq = nta_outgoing_tmcreate(c->c_agent, response_function, c, NULL, 
+      c->c_orq = nta_outgoing_tmcreate(c->c_agent, response_function, c, NULL,
 				       rmsg, TAG_END());
       return 1;
     }
   }
 
   return 0;
-}				   
+}
 
 static inline
 int tag_from_header(nta_agent_t *nta,

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-date.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-date.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-date.c	Tue Dec 23 07:37:03 2008
@@ -23,18 +23,18 @@
  */
 
 /**@page sip-date Print or parse SIP date
- * 
+ *
  * @section synopsis Synopsis
  *
  * <tt>sip-date [-n] [SIP-date | [YYYYy] [DDd] [HHh] [MMm] [SS[s]]]</tt>
  *
  * @section description Description
- * 
+ *
  * @em sip-date is an utility for printing a SIP date (in the format
  * specified by RFC 1123, but the timezone must always be GMT) or parsing a
  * given SIP date. The date can be given as a SIP date or by giving year,
  * day, hour, minutes and seconds separately.
- * 
+ *
  * @section options Options
  *
  * The @em sip-date utility takes options as follows:
@@ -84,14 +84,14 @@
 
 void usage(void)
 {
-  fprintf(stderr, 
+  fprintf(stderr,
 	  "usage: sip-date [-n] "
           "[SIP-date | [YYYYy] [DDd] [HHh] [MMm] [SS[s]]]\n");
   exit(1);
 }
 
 /* Epoch year. */
-#define EPOCH 1900		
+#define EPOCH 1900
 /* Day number of New Year Day of given year */
 #define YEAR_DAYS(y) \
   (((y)-1) * 365 + ((y)-1) / 4 - ((y)-1) / 100 + ((y)-1) / 400)
@@ -123,7 +123,7 @@
     buf[n] = '\0';
 
     s = buf;
-      
+
     if (s[0] < '0' || s[0] > '9') {
       if (msg_date_d(&s, &t) < 0) {
 	fprintf(stderr, "sip-date: %s is not valid time\n", s);
@@ -136,17 +136,17 @@
 
 	if (msg_delta_d(&s, &t2) < 0)
 	  usage();
-      
+
 	switch (*s) {
-	case 'y': t2 = YEAR_DAYS(t2) - YEAR_DAYS(EPOCH); 
+	case 'y': t2 = YEAR_DAYS(t2) - YEAR_DAYS(EPOCH);
 	  /*FALLTHROUGH*/
 	case 'd': t += t2 * 24 * 60 * 60; s++; break;
 	case 'h': t += t2 * 60 * 60; s++; break;
 	case 'm': t += t2 * 60; s++; break;
-	case 's': 
+	case 's':
 	  s++;
 	default:
-	  t += t2; 
+	  t += t2;
 	  break;
 	}
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-dig.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-dig.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-dig.c	Tue Dec 23 07:37:03 2008
@@ -31,7 +31,7 @@
  */
 
 /**@page sip-dig Resolve SIP URIs.
- * 
+ *
  * @section sip_dig_synopsis Synopsis
  * <tt>sip-dig [OPTIONS] uri...</tt>
  *
@@ -45,7 +45,7 @@
  * otherwise indicated by NAPTR or SRV records, the sip-dig uses UDP and TCP
  * as transports for SIP and TLS for SIPS URIs.
  *
- * The results are printed intended, with a preference followed by weight, 
+ * The results are printed intended, with a preference followed by weight,
  * then protocol name, port number and IP address in numeric format.
  *
  * @section sip_dig_options Command Line Options
@@ -73,7 +73,7 @@
  * <dd>Use TLS over SCTP transport protocol.
  * </dd>
  * <dt>--no-sctp</dt>
- * <dd>Ignore SCTP or TLS-SCTP records in the list of default transports. 
+ * <dd>Ignore SCTP or TLS-SCTP records in the list of default transports.
  * This option has no effect if transport protocols has been explicitly
  * listed.
  * </dd>
@@ -117,7 +117,7 @@
  *
  * @section sip_dig_environment Environment
  * #SRESOLV_DEBUG, SRESOLV_CONF
- * 
+ *
  * @section sip_dig_bugs Reporting Bugs
  * Report bugs to <sofia-sip-devel at lists.sourceforge.net>.
  *
@@ -171,11 +171,11 @@
 	    double weight);
 
 int dig_srv_at(struct dig *dig,
-	       char const *tport, sres_record_t **answers, 
+	       char const *tport, sres_record_t **answers,
 	       double weight, int pweight,
 	       int priority);
 
-int dig_addr(struct dig *dig, 
+int dig_addr(struct dig *dig,
 	     char const *tport, char const *host, char const *port,
 	     double weight);
 
@@ -192,7 +192,7 @@
 int prepare_transport(struct dig *dig, char const *tport);
 
 int count_transports(struct dig *dig,
-		     char const *tp1, 
+		     char const *tp1,
 		     char const *tp2);
 
 void usage(int exitcode)
@@ -216,7 +216,7 @@
 
   struct dig dig[1] = {{ NULL }};
 
-  if (su_init() != 0) 
+  if (su_init() != 0)
     return -1;
 
   while (argv[1] && argv[1][0] == '-') {
@@ -444,7 +444,7 @@
 		 char const *tport,
 		 char const *tport2)
 {
-  
+
   int i, tcount = 0;
   struct transport const *tports = dig->tports;
 
@@ -545,7 +545,7 @@
     else if (strcasecmp(na->na_flags, "a") == 0) {
       scount = dig_addr(dig, tp->name, na->na_replace, NULL, weight / nacount);
     }
-    else 
+    else
       scount = 0;
 
     count += scount;
@@ -604,7 +604,7 @@
 	continue;
       if (srv->srv_record->r_status != 0)
 	continue;
-      
+
       if (srv->srv_priority != priority && pweight != 0) {
 	scount = dig_srv_at(dig, tport, answers, weight / n, pweight,
 			    priority);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-options.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-options.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/utils/sip-options.c	Tue Dec 23 07:37:03 2008
@@ -23,7 +23,7 @@
  */
 
 /**@page sip-options Query SIP OPTIONS
- * 
+ *
  * @section synopsis Synopsis
  * <tt>sip-options [OPTIONS] target-uri </tt>
  *
@@ -46,7 +46,7 @@
  *     preliminary responses are silently discarded.
  * </dd>
  * <dt>--all | -a</dt>
- * <dd>All SIP headers will be printed. If the --all option is given, 
+ * <dd>All SIP headers will be printed. If the --all option is given,
  *     the @em options utility also prints @b From, @b Via, @b Call-ID or
  *     @b CSeq headers.
  * </dd>
@@ -82,7 +82,7 @@
  *
  * @section environment Environment
  * #SIPADDRESS, #sip_proxy, #NTA_DEBUG, #TPORT_DEBUG, #TPORT_LOG.
- * 
+ *
  * @section bugs Reporting Bugs
  * Report bugs to <sofia-sip-devel at lists.sourceforge.net>.
  *
@@ -117,13 +117,13 @@
 #include <sofia-sip/tport_tag.h>
 
 struct context_s {
-  su_home_t   	  c_home[1];
-  su_root_t   	 *c_root;
-  nta_agent_t 	 *c_agent;
+  su_home_t	  c_home[1];
+  su_root_t	 *c_root;
+  nta_agent_t	 *c_agent;
   url_t          *c_proxy;
   char const     *c_username;
   char const     *c_password;
-  nta_leg_t   	 *c_leg;
+  nta_leg_t	 *c_leg;
   nta_outgoing_t *c_orq;
   auth_client_t  *c_proxy_auth;
   auth_client_t  *c_auth;
@@ -139,7 +139,7 @@
 static
 void usage(int rc)
 {
-  fprintf(rc ? stderr : stdout, 
+  fprintf(rc ? stderr : stdout,
 	  "usage: %s OPTIONS url [extra-file]\n"
 	  "where OPTIONS are\n"
 	  "    --mf=count | --max-forwards=count\n"
@@ -164,15 +164,15 @@
 {
   su_home_t *home;
   context_t context[1] = {{{SU_HOME_INIT(context)}}};
-  char 
+  char
     *extra = NULL,
-    *o_bind = "sip:*:*", 
+    *o_bind = "sip:*:*",
     *o_from = getenv("SIPADDRESS"),
     *o_http_proxy = NULL,
     *o_max_forwards = NULL,
     *o_method = NULL,
     *o_to = NULL;
-   
+
   char *s, *v;
 
   sip_method_t method = sip_method_options;
@@ -190,11 +190,11 @@
   while ((s = argv++[1])) {
     if (!MATCH(s, "-"))             { o_to = s;           break; }
     else if (strcmp(s, "") == 0)    { o_to = argv++[1];   break; }
-    else if (MATCH(s, "-a") || MATCH(s, "--all")) 
+    else if (MATCH(s, "-a") || MATCH(s, "--all"))
                                     { context->c_all = 1; }
-    else if (MATCH(s, "-x") || MATCH(s, "--extra")) 
+    else if (MATCH(s, "-x") || MATCH(s, "--extra"))
                                     { extra = "-"; }
-    else if (MATCH(s, "-1") || MATCH(s, "--1XX")) 
+    else if (MATCH(s, "-1") || MATCH(s, "--1XX"))
                                     { context->c_pre = 1; }
     else if (MATCH2(s, "--mf"))     { o_max_forwards = v; }
     else if (MATCH2(s, "--http-proxy"))     { o_http_proxy = v; }
@@ -205,7 +205,7 @@
     else if (MATCH2(s, "--from"))   { o_from = v; }
     else if (MATCH2(s, "--method")) { o_method = v; }
     else if (MATCH(s, "--help"))    { usage(0); }
-    else 
+    else
       usage(2);
   }
 
@@ -216,7 +216,7 @@
     extra = argv++[1];
 
   su_init();
-  
+
   su_home_init(home = context->c_home);
 
   context->c_root = su_root_create(context);
@@ -225,7 +225,7 @@
   if (context->c_root) {
     url_string_t *r_uri;
 
-    context->c_agent = 
+    context->c_agent =
       nta_agent_create(context->c_root,
 		       URL_STRING_MAKE(o_bind),
 		       NULL, NULL, /* Ignore incoming messages */
@@ -251,7 +251,7 @@
       tag_from_header(context->c_agent, context->c_home, from);
 
       if (o_method) {
-	method = sip_method_code(o_method); 
+	method = sip_method_code(o_method);
       } else {
 	isize_t len;
 	char const *params = to->a_url->url_params;
@@ -262,7 +262,7 @@
 	  o_method = su_alloc(home, len + 1);
 	  if (o_method == 0 ||
 	      url_param(params, "method", o_method, len + 1) != len) {
-	    fprintf(stderr, "%s: %s\n", name, 
+	    fprintf(stderr, "%s: %s\n", name,
 		    o_method ? "internal error" : strerror(errno));
 	    exit(2);
 	  }
@@ -281,7 +281,7 @@
 
       if (extra) {
 	FILE *hf;
-	
+
 	if (strcmp(extra, "-"))
 	  hf = fopen(extra, "rb");
 	else
@@ -290,7 +290,7 @@
 	extra = readfile(hf);
       }
 
-      context->c_proxy = url_hdup(context->c_home, 
+      context->c_proxy = url_hdup(context->c_home,
 				  (url_t *)getenv("sip_proxy"));
 
       nta_agent_set_params(context->c_agent,
@@ -298,17 +298,17 @@
 			   NTATAG_DEFAULT_PROXY(context->c_proxy),
 			   TAG_END());
 
-      context->c_leg = 
+      context->c_leg =
 	nta_leg_tcreate(context->c_agent,
 			NULL, NULL,      /* ignore incoming requests */
 			SIPTAG_FROM(from), /* who is sending OPTIONS? */
 			SIPTAG_TO(to), /* whom we are sending OPTIONS? */
 			TAG_END());
-				      
+
       if (context->c_leg) {
-	context->c_orq = 
+	context->c_orq =
 	  nta_outgoing_tcreate(context->c_leg,
-			       response_to_options, context, 
+			       response_to_options, context,
 			       NULL,
 			       method, o_method, r_uri,
 			       SIPTAG_USER_AGENT_STR("options"),
@@ -317,7 +317,7 @@
 			       TAG_END());
 
 	if (context->c_orq) {
-	  su_root_run(context->c_root); 
+	  su_root_run(context->c_root);
 	  nta_outgoing_destroy(context->c_orq), context->c_orq = NULL;
 	}
 
@@ -326,7 +326,7 @@
 
       nta_agent_destroy(context->c_agent), context->c_agent = NULL;
     }
-    
+
     su_root_destroy(context->c_root);
   }
 
@@ -345,7 +345,7 @@
     return 0;
   if (server_authenticate(context, oreq, sip, response_to_options))
     return 0;
-				   
+
   if (sip->sip_status->st_status >= 200 || context->c_pre) {
     sip_header_t *h = (sip_header_t *)sip->sip_status;
     char hname[64];
@@ -362,17 +362,17 @@
 
       if (h->sh_class->hc_name == NULL) {
 	sl_header_print(stdout, NULL, h);
-      } 
+      }
       else if (h->sh_class->hc_name[0] == '\0') {
-	sl_header_print(stdout, "%s\n", h); 
+	sl_header_print(stdout, "%s\n", h);
       }
       else {
 	snprintf(hname, sizeof hname, "%s: %%s\n", h->sh_class->hc_name);
-	sl_header_print(stdout, hname, h); 
+	sl_header_print(stdout, hname, h);
       }
     }
   }
-  
+
   if (sip->sip_status->st_status >= 200) {
     context->c_retval = sip->sip_status->st_status >= 300;
     su_root_break(context->c_root);

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/utils/utils.docs
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/utils/utils.docs	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/utils/utils.docs	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 /* -*- c -*- */
 
 /**@MODULEPAGE "utils" - Sofia-SIP Command Line Utilities
- * 
+ *
  * @section utils_meta Module Meta Information
  *
  * Command line utilities for <a href="../index.html">Sofia-SIP</a>.
@@ -14,8 +14,8 @@
  *
  * @section utuils_overview Overview
  *
- * The Sofia-SIP provides a few command line utilities: 
- * - @ref sip-date "sip-date" - print or parse SIP date 
+ * The Sofia-SIP provides a few command line utilities:
+ * - @ref sip-date "sip-date" - print or parse SIP date
  * - @ref sip-dig "sip-dig" - resolve SIP URIs
  * - @ref sip-options "sip-options" - query SIP OPTIONS
  * - @ref localinfo "localinfo" - list local network addresses

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/win32/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/win32/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/win32/ChangeLog	Tue Dec 23 07:37:03 2008
@@ -1,20 +1,20 @@
 2006-05-11  Pekka Pessi  <Pekka.Pessi at nokia.com>
 
   	* Now building libsofia_sip_ua.dll on win32.
-  
+
   	We define both IN_LIBSOFIA_SIP_UA and IN_LIBSOFIA_SRES in
   	libsofia_sip_ua.dsp.
-  
+
   	Because of DLL linkage, we compile tags typedefs as C++
   	(see win32/tests/test_nua/test_nat_tags.cpp).
-  
+
   	Removed LIBSOFIA_SIP_UA_STATIC from win32/sofia-sip/su_configure.h.
-  
+
   	Added libsofia_sip_ua_static.lib, too. If you want to compile against
-  	that, you need define LIBSOFIA_SIP_UA_STATIC by yourself. 
-  
+  	that, you need define LIBSOFIA_SIP_UA_STATIC by yourself.
+
   	Added libsofia-sip-ua-static/libsofia_sip_ua_static.dsp.
-  
+
   	Using multithreaded DLL runtime for all projects.
 
 2006-05-03  Kai Vehmanen  <kai.vehmanen at nokia.com>
@@ -26,19 +26,19 @@
   * Added test_tport.dsp to SofiaSIP.dsw
 
   * Added source files:
-  
+
   sres.c sres_blocking.c sres_cache.c stun.c stun_common.c stun_dns.c
   stun_internal.h stun_mini.c nua_params.c nua_params.h tport_internal.h
   tport_logging.c tport_stub_sigcomp.c tport_stub_stun.c
   tport_threadpool.c tport_type_connect.c tport_type_tcp.c
   tport_type_udp.c
-  
+
   and
-  
+
   sofia-resolv/sres.h sofia-resolv/sres_async.h
   sofia-resolv/sres_cache.h sofia-resolv/sres_record.h
   sofia-sip/tport_plugins.h
-  
+
   to libsofia_sip_ua.dsp.
 
   * Added stat() as well as struct stat to compatibity win32/unistd.h.

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/win32/README.txt
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/win32/README.txt	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/win32/README.txt	Tue Dec 23 07:37:03 2008
@@ -2,11 +2,11 @@
 win32/README.txt / Sofia-SIP for win32
 ======================================
 
-The win32 subdirectory contains the build environment for Win32 
+The win32 subdirectory contains the build environment for Win32
 environment using MSVC.
 
 Currently, the provided workspace/solution files will create both
-shared and static libraries for libsofia-sip-ua, and a few test 
+shared and static libraries for libsofia-sip-ua, and a few test
 programs. The test programs can be run with the script check.cmd.
 
 
@@ -18,7 +18,7 @@
 is needed. You can for example use gawk (3.1.5 or newer) or mawk (tested
 with 1.3.3) implementations. Precompiled binaries are available
 for instance at:
- 
+
   - http://gnuwin32.sourceforge.net/packages/mawk.htm
   - http://ftp.uni-kl.de/pub/windows/cygwin/release/gawk/
   - plus many sites, a web search for "win32 awk" will

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/win32/build_sources.cmd
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/win32/build_sources.cmd	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/win32/build_sources.cmd	Tue Dec 23 07:37:03 2008
@@ -67,7 +67,7 @@
    TEMPLATE1=%PR2%.in ^
    TEMPLATE2=%PR3%.in ^
    TEMPLATE3=%PR4%.in ^
-   TEMPLATE=%PR5%.in %SIPEXTRA% < NUL 
+   TEMPLATE=%PR5%.in %SIPEXTRA% < NUL
 %CHECK%
 
 %AWK_SIP_AWK% PT=%PT% TEMPLATE=%PT%.in ^

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/win32/config.h.in
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/win32/config.h.in	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/win32/config.h.in	Tue Dec 23 07:37:03 2008
@@ -25,7 +25,7 @@
 /**@file win32/config.h.in
  * @brief <config.h> used by Windows.
  *
- * Use this on WIN32. 
+ * Use this on WIN32.
  *
  * @author Pekka Pessi <Pekka.Pessi at nokia.com>
  *
@@ -151,7 +151,7 @@
 #undef HAVE_INTTYPES_H
 
 /* Define to 1 if you have the <iphlpapi.h> header file. */
-#if _MSC_VER > 1200 
+#if _MSC_VER > 1200
 #define HAVE_IPHLPAPI_H 1
 #else
 // XXX: vehmanek-win32-fix for VC6
@@ -458,7 +458,7 @@
 
 #define snprintf _snprintf
 
-#ifndef _MSC_VER 
+#ifndef _MSC_VER
 #define vsnprintf _vsnprintf
 #endif
 #if _MSC_VER < 1500
@@ -485,14 +485,14 @@
 #define HAVE_SIO_ADDRESS_LIST_QUERY 1
 
 /* Define to 1 if you have INTERFACE_INFO ioctl */
-#define HAVE_INTERFACE_INFO 	   (1) 
+#define HAVE_INTERFACE_INFO 	   (1)
 
 /* Ignore certain warnings */
 #ifdef _MSC_VER
 #pragma warning( disable : 4090 4204 4244 4018 4514 4706 4761)
 /* VC does not grok const */
 #pragma warning( disable : 4022 4028 )
-/* Temporarily disable high frequency, low value warnings.  
+/* Temporarily disable high frequency, low value warnings.
    We may still want to re-enable and fix these */
 #pragma warning( disable : 4132 4100 4127 4152)
 #if (_MSC_VER >= 1400) // VC8+
@@ -505,7 +505,7 @@
 #endif // VC8+
 #endif
 
-/* size_t/ssize_t modifiers 
+/* size_t/ssize_t modifiers
  * ref: http://msdn2.microsoft.com/en-us/library/tcxf1dw6.aspx */
 #define MOD_ZD "%ld"
 #define MOD_ZU "%lu"

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/win32/libsofia-sip-ua/sofia-sip-ua.def
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/win32/libsofia-sip-ua/sofia-sip-ua.def	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/win32/libsofia-sip-ua/sofia-sip-ua.def	Tue Dec 23 07:37:03 2008
@@ -121,7 +121,7 @@
 msg_token_d
 msg_unquote_dup
 msghdrtag_dup
-msghdrtag_snprintf 
+msghdrtag_snprintf
 msghdrtag_xtra
 msgobjtag_dup
 msgobjtag_snprintf
@@ -311,7 +311,7 @@
 sip_serialize
 sip_status_create
 sip_status_phrase
-sip_to_add_param   
+sip_to_add_param
 sip_to_create
 sip_to_tag
 sip_version_d

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/win32/sofia-sip/su_configure.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/win32/sofia-sip/su_configure.h	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/win32/sofia-sip/su_configure.h	Tue Dec 23 07:37:03 2008
@@ -46,7 +46,7 @@
 #define SU_HAVE_STDINT          (0)
 #define SU_HAVE_NT              0
 
-/* note: on Windows 2000 and older (WINVER<=500), IPv6-tech-preview 
+/* note: on Windows 2000 and older (WINVER<=500), IPv6-tech-preview
  * is needed for IPv4 support as well, so SU_HAVE_IN6 must be set */
 #define SU_HAVE_IN6             1
 
@@ -104,7 +104,7 @@
 #define snprintf    _snprintf
 #endif
 #ifndef vsnprintf
-#ifndef _MSC_VER 
+#ifndef _MSC_VER
 #define vsnprintf _vsnprintf
 #endif
 #if _MSC_VER < 1500

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/win32/version.awk
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/win32/version.awk	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/win32/version.awk	Tue Dec 23 07:37:03 2008
@@ -1,7 +1,7 @@
 #! /bin/gawk
 #
 # This script extracts the version information from configure.ac
-# and re-generates win32/config.h and 
+# and re-generates win32/config.h and
 # libsofia-sip-ua/features/sofia_sip_features.h
 #
 # --------------------------------------------------------------------
@@ -38,7 +38,7 @@
 
 IN && /^AC_INIT/ { version=$2; gsub(/[\]\[)]/, "", version); }
 
-OUT && /@[A-Z_]+@/ { 
+OUT && /@[A-Z_]+@/ {
   gsub(/@PACKAGE_VERSION@/, version);
   gsub(/@PACKAGE_BUGREPORT@/, "sofia-sip-devel at lists.sourceforge.net");
   gsub(/@PACKAGE_NAME@/, "sofia-sip");

Modified: freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/abyss.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/abyss.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/abyss.2008.vcproj	Tue Dec 23 07:37:03 2008
@@ -54,7 +54,7 @@
 				ProgramDataBaseFileName=".\Debug\abyss/"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
+				DebugInformationFormat="3"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"

Modified: freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmlparse.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmlparse.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmlparse.2008.vcproj	Tue Dec 23 07:37:03 2008
@@ -122,14 +122,14 @@
 				PreprocessorDefinitions="WIN32;_WINDOWS;XML_DTD;_LIB"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
+				RuntimeLibrary="3"
 				PrecompiledHeaderFile=".\Debug\xmlparse/xmlparse.pch"
 				AssemblerListingLocation=".\Debug\xmlparse/"
 				ObjectFile=".\Debug\xmlparse/"
 				ProgramDataBaseFileName=".\Debug\xmlparse/"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
+				DebugInformationFormat="3"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"

Modified: freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmlrpc.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmlrpc.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmlrpc.2008.vcproj	Tue Dec 23 07:37:03 2008
@@ -54,7 +54,7 @@
 				ProgramDataBaseFileName=".\Debug\xmlrpc/"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
+				DebugInformationFormat="3"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -1115,11 +1115,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\lib\abyss\src\server.h"
+				RelativePath="..\include\xmlrpc-c\server.h"
 				>
 			</File>
 			<File
-				RelativePath="..\include\xmlrpc-c\server.h"
+				RelativePath="..\lib\abyss\src\server.h"
 				>
 			</File>
 			<File

Modified: freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmltok.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmltok.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/xmlrpc-c/Windows/xmltok.2008.vcproj	Tue Dec 23 07:37:03 2008
@@ -47,14 +47,14 @@
 				PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;XML_DTD;XML_NS;_LIB"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
+				RuntimeLibrary="3"
 				PrecompiledHeaderFile=".\Debug\xmltok/xmltok.pch"
 				AssemblerListingLocation=".\Debug\xmltok/"
 				ObjectFile=".\Debug\xmltok/"
 				ProgramDataBaseFileName=".\Debug\xmltok/"
 				WarningLevel="3"
 				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
+				DebugInformationFormat="3"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"

Modified: freeswitch/branches/gmaruzz/libs/xmlrpc-c/lib/abyss/src/file.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/xmlrpc-c/lib/abyss/src/file.c	(original)
+++ freeswitch/branches/gmaruzz/libs/xmlrpc-c/lib/abyss/src/file.c	Tue Dec 23 07:37:03 2008
@@ -40,11 +40,15 @@
        cause security exposures.
     */
 
+#if !defined(_FILE_OFFSET_BITS)
 #define _FILE_OFFSET_BITS 64
+#endif
     /* Tell GNU libc to make off_t 64 bits and all the POSIX file functions
        the versions that handle 64 bit file offsets.
     */
+#if !defined(_LARGE_FILES)
 #define _LARGE_FILES
+#endif
     /* Same as above, but for AIX */
 
 #include <string.h>

Modified: freeswitch/branches/gmaruzz/scripts/socket/FreeSWITCH/Client.pm
==============================================================================
--- freeswitch/branches/gmaruzz/scripts/socket/FreeSWITCH/Client.pm	(original)
+++ freeswitch/branches/gmaruzz/scripts/socket/FreeSWITCH/Client.pm	Tue Dec 23 07:37:03 2008
@@ -73,7 +73,7 @@
       while(length($h->{body}) < $h->{'content-length'}) {
 	my $buf;
 	recv $s, $buf, $h->{'content-length'} - length($h->{body}), 0;
-	if (!$buf) {
+	if ($buf eq '') {
 	  $h->{socketerror} = "yes";
 	  return $h;	  
 	}
@@ -152,9 +152,9 @@
 
   my $r = $self->sendmsg({ 'command' => "api " . shift });
 
-  if ($r->{body}) {
+  if ($r->{body} ne '') {
     $reply = $r->{body};
-  } elsif ($r->{'reply-text'}) {
+  } elsif ($r->{'reply-text'} ne '') {
     $reply = $r->{'reply-text'};
   } else {
     $reply = "socketerror";

Modified: freeswitch/branches/gmaruzz/src/include/switch_core.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_core.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_core.h	Tue Dec 23 07:37:03 2008
@@ -1165,6 +1165,12 @@
 SWITCH_DECLARE(void) switch_core_session_unset_write_codec(_In_ switch_core_session_t *session);
 
 
+SWITCH_DECLARE(void) switch_core_session_lock_codec_write(_In_ switch_core_session_t *session);
+SWITCH_DECLARE(void) switch_core_session_unlock_codec_write(_In_ switch_core_session_t *session);
+SWITCH_DECLARE(void) switch_core_session_lock_codec_read(_In_ switch_core_session_t *session);
+SWITCH_DECLARE(void) switch_core_session_unlock_codec_read(_In_ switch_core_session_t *session);
+
+
 SWITCH_DECLARE(switch_status_t) switch_core_session_get_read_impl(switch_core_session_t *session,  switch_codec_implementation_t *impp);
 SWITCH_DECLARE(switch_status_t) switch_core_session_get_write_impl(switch_core_session_t *session,  switch_codec_implementation_t *impp);
 SWITCH_DECLARE(switch_status_t) switch_core_session_get_video_read_impl(switch_core_session_t *session,  switch_codec_implementation_t *impp);

Modified: freeswitch/branches/gmaruzz/src/include/switch_loadable_module.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_loadable_module.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_loadable_module.h	Tue Dec 23 07:37:03 2008
@@ -41,6 +41,7 @@
 #ifndef SWITCH_LOADABLE_MODULE_H
 #define SWITCH_LOADABLE_MODULE_H
 
+#include <switch_log.h>
 #include <switch.h>
 #include <switch_module_interfaces.h>
 
@@ -324,44 +325,74 @@
 		break;															\
 	}
 
+static inline int switch_check_interval(uint32_t rate, uint32_t ptime)
+{
+	uint32_t max_ms = 0, ptime_div = 0;
+
+	switch (rate) {
+	case 22050:
+	case 11025:
+		if (ptime < 120) return 1;
+		break;
+	case 48000:
+		max_ms = 20;
+		ptime_div = 2;
+		break;
+	case 32000:
+	case 16000:
+		max_ms = 60;
+		ptime_div = 2;
+		break;
+	case 8000:
+		max_ms = 120;
+		ptime_div = 2;
+		break;		
+	}
+
+	if (max_ms && ptime_div && (ptime <= max_ms && (ptime % ptime_div) == 0) && ((rate / 1000) * ptime) < SWITCH_RECOMMENDED_BUFFER_SIZE) {
+		return 1;
+	}
+	
+	return 0;
+}
 
-	 static inline void switch_core_codec_add_implementation(switch_memory_pool_t *pool, switch_codec_interface_t *codec_interface,
-															 /*! enumeration defining the type of the codec */
-															 const switch_codec_type_t codec_type,
-															 /*! the IANA code number */
-															 switch_payload_t ianacode,
-															 /*! the IANA code name */
-															 const char *iananame,
-															 /*! default fmtp to send (can be overridden by the init function) */
-															 char *fmtp,
-															 /*! samples transferred per second */
-															 uint32_t samples_per_second,
-															 /*! actual samples transferred per second for those who are not moron g722 RFC writers */
-															 uint32_t actual_samples_per_second,
-															 /*! bits transferred per second */
-															 int bits_per_second,
-															 /*! number of microseconds that denote one frame */
-															 int microseconds_per_packet,
-															 /*! number of samples that denote one frame */
-															 uint32_t samples_per_packet,
-															 /*! number of bytes that denote one frame decompressed */
-															 uint32_t decoded_bytes_per_packet,
-															 /*! number of bytes that denote one frame compressed */
-															 uint32_t encoded_bytes_per_packet,
-															 /*! number of channels represented */
-															 uint8_t number_of_channels,
-															 /*! number of frames to send in one network packet */
-															 int codec_frames_per_packet,
-															 /*! function to initialize a codec handle using this implementation */
-															 switch_core_codec_init_func_t init,
-															 /*! function to encode raw data into encoded data */
-															 switch_core_codec_encode_func_t encode,
-															 /*! function to decode encoded data into raw data */
-															 switch_core_codec_decode_func_t decode,
-															 /*! deinitalize a codec handle using this implementation */
-															 switch_core_codec_destroy_func_t destroy)
+static inline void switch_core_codec_add_implementation(switch_memory_pool_t *pool, switch_codec_interface_t *codec_interface,
+														/*! enumeration defining the type of the codec */
+														const switch_codec_type_t codec_type,
+														/*! the IANA code number */
+														switch_payload_t ianacode,
+														/*! the IANA code name */
+														const char *iananame,
+														/*! default fmtp to send (can be overridden by the init function) */
+														char *fmtp,
+														/*! samples transferred per second */
+														uint32_t samples_per_second,
+														/*! actual samples transferred per second for those who are not moron g722 RFC writers */
+														uint32_t actual_samples_per_second,
+														/*! bits transferred per second */
+														int bits_per_second,
+														/*! number of microseconds that denote one frame */
+														int microseconds_per_packet,
+														/*! number of samples that denote one frame */
+														uint32_t samples_per_packet,
+														/*! number of bytes that denote one frame decompressed */
+														uint32_t decoded_bytes_per_packet,
+														/*! number of bytes that denote one frame compressed */
+														uint32_t encoded_bytes_per_packet,
+														/*! number of channels represented */
+														uint8_t number_of_channels,
+														/*! number of frames to send in one network packet */
+														int codec_frames_per_packet,
+														/*! function to initialize a codec handle using this implementation */
+														switch_core_codec_init_func_t init,
+														/*! function to encode raw data into encoded data */
+														switch_core_codec_encode_func_t encode,
+														/*! function to decode encoded data into raw data */
+														switch_core_codec_decode_func_t decode,
+														/*! deinitalize a codec handle using this implementation */
+														switch_core_codec_destroy_func_t destroy)
 {
-	if (codec_type == SWITCH_CODEC_TYPE_VIDEO || SWITCH_ACCEPTABLE_INTERVAL(microseconds_per_packet / 1000)) {
+	if (codec_type == SWITCH_CODEC_TYPE_VIDEO || switch_check_interval(actual_samples_per_second, microseconds_per_packet / 1000)) {
 		switch_codec_implementation_t *impl = (switch_codec_implementation_t *) switch_core_alloc(pool, sizeof(*impl));
 		impl->codec_type = codec_type;
 		impl->ianacode = ianacode;
@@ -383,6 +414,9 @@
 		impl->codec_id = codec_interface->codec_id;
 		impl->next = codec_interface->implementations;
 		codec_interface->implementations = impl;
+	} else {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Rejected codec name: %s rate: %u ptime: %u\n", 
+						  iananame, actual_samples_per_second, microseconds_per_packet / 1000);
 	}
 }
 

Modified: freeswitch/branches/gmaruzz/src/include/switch_log.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_log.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_log.h	Tue Dec 23 07:37:03 2008
@@ -63,7 +63,7 @@
 	char *content;
 	const char *userdata;
 	/* To maintain abi, only add new elements to the end of this struct and do not delete any elements */
-
+	switch_text_channel_t channel;
 } switch_log_node_t;
 
 typedef switch_status_t (*switch_log_function_t) (const switch_log_node_t *node, switch_log_level_t level);

Modified: freeswitch/branches/gmaruzz/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_types.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_types.h	Tue Dec 23 07:37:03 2008
@@ -359,9 +359,9 @@
 #define SWITCH_SYSTEM_THREAD_STACKSIZE 8192 * 1024
 #define SWITCH_MAX_INTERVAL 120	/* we only do up to 120ms */
 #define SWITCH_INTERVAL_PAD 10	/* A little extra buffer space to be safe */
-#define SWITCH_MAX_SAMPLE_LEN 32
+#define SWITCH_MAX_SAMPLE_LEN 48
 #define SWITCH_BYTES_PER_SAMPLE 2	/* slin is 2 bytes per sample */
-#define SWITCH_RECOMMENDED_BUFFER_SIZE (SWITCH_BYTES_PER_SAMPLE * SWITCH_MAX_SAMPLE_LEN * (SWITCH_MAX_INTERVAL + SWITCH_INTERVAL_PAD))
+#define SWITCH_RECOMMENDED_BUFFER_SIZE 4096 /* worst case of 32khz @60ms we only do 48khz @10ms which is 960 */
 #define SWITCH_MAX_CODECS 50
 #define SWITCH_MAX_STATE_HANDLERS 30
 #define SWITCH_CORE_QUEUE_LEN 100000

Modified: freeswitch/branches/gmaruzz/src/include/switch_utils.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_utils.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_utils.h	Tue Dec 23 07:37:03 2008
@@ -56,7 +56,7 @@
 SWITCH_DECLARE(int) switch_isupper(int c);
 SWITCH_DECLARE(int) switch_isxdigit(int c);
 
-
+#define switch_goto_status(_status, _label) status = _status; goto _label
 #define switch_samples_per_packet(rate, interval) ((uint32_t)((float)rate / (1000.0f / (float)interval)))
 #define SWITCH_SMAX 32767
 #define SWITCH_SMIN -32768

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c	Tue Dec 23 07:37:03 2008
@@ -457,10 +457,6 @@
 	const char *err;
 	switch_xml_t xml_root;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (cmd && !strcmp(cmd, "reloadxml")) {
 		if ((xml_root = switch_xml_open_root(1, &err))) {
 			switch_xml_free(xml_root);
@@ -696,10 +692,6 @@
 	int sps = 0, last_sps = 0;
 	const char *var;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	switch_core_measure_time(switch_core_uptime(), &duration);
 
 	if (stream->param_event) {
@@ -877,10 +869,6 @@
 {
 	const char *err;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (switch_strlen_zero(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", LOAD_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
@@ -902,10 +890,6 @@
 	switch_bool_t force = SWITCH_FALSE;
 	const char *p = cmd;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (switch_strlen_zero(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
@@ -950,10 +934,6 @@
 	switch_bool_t force = SWITCH_FALSE;
 	const char *p = cmd;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (switch_strlen_zero(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
@@ -1003,10 +983,6 @@
 	const char *err;
 	switch_xml_t xml_root;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if ((xml_root = switch_xml_open_root(1, &err))) {
 		switch_xml_free(xml_root);
 	}
@@ -1023,10 +999,6 @@
 	char *mycmd = NULL, *kcause = NULL;
 	switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
 		stream->write_function(stream, "-USAGE: %s\n", KILL_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
@@ -1057,10 +1029,6 @@
 {
 	switch_core_session_t *ksession = NULL;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (!cmd) {
 		stream->write_function(stream, "-USAGE: %s\n", PARK_SYNTAX);
 	} else if ((ksession = switch_core_session_locate(cmd))) {
@@ -1082,10 +1050,6 @@
 	int argc = 0;
 	char *tuuid, *dest, *dp, *context, *arg = NULL;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
 		stream->write_function(stream, "-USAGE: %s\n", TRANSFER_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
@@ -1303,10 +1267,6 @@
 	char *mycmd = NULL, *argv[6] = { 0 };
 	int argc = 0;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1346,10 +1306,6 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1392,10 +1348,6 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (session) {
-		return status;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1427,10 +1379,6 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (session) {
-		return status;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1467,10 +1415,6 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (session) {
-		return status;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1514,10 +1458,6 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (session) {
-		return status;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1549,10 +1489,6 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (session) {
-		return status;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1589,10 +1525,6 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1633,10 +1565,6 @@
 	int argc = 0;
 	uint32_t limit = 0;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (switch_strlen_zero(cmd)) {
 		goto usage;
 	}
@@ -1704,10 +1632,6 @@
 	uint32_t limit = 0;
 	char *flags = NULL;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
 		goto usage;
 	}
@@ -1769,10 +1693,6 @@
 	char *mycmd, *flag;
 	switch_channel_t *channel = NULL;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (switch_strlen_zero(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", BREAK_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
@@ -1812,10 +1732,6 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -2368,10 +2284,6 @@
 	switch_core_flag_t cflags = switch_core_flags();
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	db = switch_core_db_handle();
 	
 	holder.justcount = 0;
@@ -2657,10 +2569,6 @@
 	char *mycmd = NULL, *argv[3] = { 0 };
 	int argc = 0;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 		if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) {
@@ -2707,11 +2615,7 @@
 	switch_core_session_t *psession = NULL;
 	char *mycmd = NULL, *vars, *argv[64] = { 0 };
 	int argc = 0;
-	char *var_name, *var_value;
-
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
+	char *var_name, *var_value = NULL;
 
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		char *uuid = mycmd;
@@ -2763,10 +2667,6 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 		if (argc >= 2 && !switch_strlen_zero(argv[0])) {
@@ -2814,10 +2714,6 @@
 	char *uuid = NULL, *dtmf_data = NULL;
 	int argc = 0;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (switch_strlen_zero(cmd)) {
 		goto usage;
 	}
@@ -2864,10 +2760,6 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 		if (argc >= 0 && !switch_strlen_zero(argv[0])) {

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_conference/mod_conference.c	Tue Dec 23 07:37:03 2008
@@ -3729,10 +3729,6 @@
 		cmd = "help";
 	}
 
-	if (session) {
-		return SWITCH_STATUS_FALSE;
-	}
-
 	if (stream->param_event) {
 		http = switch_event_get_header(stream->param_event, "http-host");
 	}
@@ -4893,7 +4889,7 @@
 
 		if (!strcasecmp(var, "rate") && !switch_strlen_zero(val)) {
 			uint32_t tmp = atoi(val);
-			if (tmp == 8000 || tmp == 16000 || tmp == 32000) {
+			if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 48000) {
 				rate = tmp;
 			}
 		} else if (!strcasecmp(var, "domain") && !switch_strlen_zero(val)) {

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprpars.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprpars.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprpars.c	Tue Dec 23 07:37:03 2008
@@ -12,7 +12,6 @@
 
 #include "exprpriv.h"
 #include "exprmem.h"
-#include "switch_utils.h"
 
 /* Data structure used by parser */
 typedef struct _exprToken {

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprpriv.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprpriv.h	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprpriv.h	Tue Dec 23 07:37:03 2008
@@ -206,6 +206,16 @@
 int exprFuncListAddType(exprFuncList *flist, char *name, int type, int min, int max, int refmin, int refmax);
 int exprFuncListGet(exprFuncList *flist, char *name, exprFuncType *ptr, int *type, int *min, int *max, int *refmin, int *refmax);
 
+#ifdef WIN32
+#define SWITCH_DECLARE(type)			__declspec(dllimport) type __stdcall
+#else
+#define SWITCH_DECLARE(type) type 
+#endif
+
+SWITCH_DECLARE(int) switch_isalnum(int c);
+SWITCH_DECLARE(int) switch_isalpha(int c);
+SWITCH_DECLARE(int) switch_isdigit(int c);
+SWITCH_DECLARE(int) switch_isspace(int c);
 
 #ifdef __cplusplus
 }

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprutil.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprutil.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprutil.c	Tue Dec 23 07:37:03 2008
@@ -11,8 +11,6 @@
 #include "exprincl.h"
 
 #include "exprpriv.h"
-#include "switch_utils.h"
-
 
 /* Return the version number */
 void exprGetVersion(int *major, int *minor)

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_http/http_req.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_http/http_req.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_http/http_req.c	Tue Dec 23 07:37:03 2008
@@ -379,7 +379,7 @@
     
         if(token != HEADER && token != PHRASE && token != STATUS_CODE) break;
     }while(token != SYNTAX_ERROR);
- 
+
     if(nt != 0){ 
         response->headers = (http_header_t *)malloc(sizeof(http_header_t)*nt);
         if(response->headers == NULL){
@@ -441,7 +441,6 @@
         return ERROR;
     }
 
-
     response->body = (char *)malloc((buf_len - sm.pos + 1) * sizeof(char));
     if(response->body == NULL){
         perror("Could not allocate memory for body");

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_http/mod_http.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_http/mod_http.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_http/mod_http.c	Tue Dec 23 07:37:03 2008
@@ -32,6 +32,7 @@
  *
  */
 
+
 #include <switch.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -95,6 +96,7 @@
     char *buf;
     char *method;
     char *url;
+    char *headers_dec;
     char *headers_str;
     char *value;
     char *body;
@@ -104,6 +106,7 @@
     struct json_object *json_http_headers;
     char *key;
     struct json_object *val;
+    enum json_type jsontype;
     struct lh_entry *entry;
     int i;
     int j;
@@ -136,6 +139,14 @@
     }
     
     method = argv[0];
+    if(strcasecmp(     "GET",    method) == 0) request.method = GET;
+    else if(strcasecmp("POST",   method) == 0) request.method = POST;
+    else if(strcasecmp("HEAD",   method) == 0) request.method = HEAD;
+    else if(strcasecmp("DELETE", method) == 0) request.method = DELETE;
+    else if(strcasecmp("PUT",    method) == 0) request.method = PUT;
+
+
+
     url = argv[1];
     headers_str = argv[2];
     if(argc == HTTP_PARAMS){
@@ -173,7 +184,28 @@
        
     GARBAGE_ADD(request.url);
     strcpy(request.url, url); 
-    json_http_headers = json_tokener_parse(headers_str);
+    
+    
+    l = strlen(headers_str); 
+    
+    headers_dec = url_decode(headers_str, l);
+    GARBAGE_ADD(headers_dec);
+
+    json_http_headers = json_tokener_parse(headers_dec);
+    if(is_error(json_http_headers)){
+	switch_safe_free(ccmd);
+	stream->write_function(stream, "-ERR\n");
+	GARBAGE_CLEANUP();
+	return SWITCH_STATUS_SUCCESS;
+    }
+
+    jsontype = json_object_get_type(json_http_headers);
+    if(jsontype != json_type_object){
+	switch_safe_free(ccmd);
+	stream->write_function(stream, "-ERR\n");
+	GARBAGE_CLEANUP();
+	return SWITCH_STATUS_SUCCESS;
+    } 
 
     i = 0;
     json_object_object_foreach(json_http_headers, key, val){ 
@@ -181,12 +213,14 @@
     }
     
     request.header_len = i;
-    headers = (http_header_t *)malloc(i * sizeof(http_header_t));
+    headers = (http_header_t *)malloc(i  * sizeof(http_header_t));
+    request.headers = headers;
     GARBAGE_ADD(headers);
 
     i = 0;
     json_object_object_foreach(json_http_headers, key, val){
         l = strlen(key);
+
         request.headers[i].field_name = (char *)malloc((l + 1) * sizeof(char));
         if(request.headers[i].field_name == NULL){
             switch_safe_free(ccmd);
@@ -194,11 +228,22 @@
             GARBAGE_CLEANUP();
             return SWITCH_STATUS_SUCCESS;
         }
+	
         GARBAGE_ADD(request.headers[i].field_name);
+
         strcpy(request.headers[i].field_name, key);
         a += strlen(key);
 
-        value = json_object_to_json_string(val);
+	jsontype = json_object_get_type(val);
+	if(jsontype != json_type_string){
+	    switch_safe_free(ccmd);
+	    stream->write_function(stream, "-ERR\n");
+	    GARBAGE_CLEANUP();
+	    return SWITCH_STATUS_SUCCESS;
+	}
+
+	value = json_object_get_string(val);
+        /* value = json_object_to_json_string(val); */
         l = strlen(value);
         request.headers[i].value = (char *)malloc((l + 1) * sizeof(char));
         if(request.headers[i].value == NULL){
@@ -223,6 +268,7 @@
     }else request.body_len = 0;
 
     ret = http_req(&request, &response);
+
     if(response.version != NULL) GARBAGE_ADD(response.version);
     if(response.phrase  != NULL) GARBAGE_ADD(response.phrase);
     if(response.headers != NULL) GARBAGE_ADD(response.headers);

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_limit/mod_limit.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_limit/mod_limit.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_limit/mod_limit.c	Tue Dec 23 07:37:03 2008
@@ -26,7 +26,8 @@
  * Anthony Minessale II <anthmct at yahoo.com>
  * Ken Rice <krice at suspicious dot org
  * Mathieu Rene <mathieu.rene at gmail.com>
- * 
+ * Bret McDanel <trixter AT 0xdecafbad.com>
+ *
  * mod_limit.c -- Resource Limit Module
  *
  */
@@ -239,6 +240,18 @@
 			switch_core_db_test_reactive(db, "select * from limit_data", NULL, limit_sql);
 			switch_core_db_test_reactive(db, "select * from db_data", NULL, db_sql);
 			switch_core_db_test_reactive(db, "select * from group_data", NULL, group_sql);
+			
+			switch_core_db_exec(db, "create index if not exists ld_hostname on limit_data (hostname)", NULL, NULL, NULL);
+			switch_core_db_exec(db, "create index if not exists ld_uuid on limit_data (uuid)", NULL, NULL, NULL);
+			switch_core_db_exec(db, "create index if not exists ld_realm on limit_data (realm)", NULL, NULL, NULL);
+			switch_core_db_exec(db, "create index if not exists ld_id on limit_data (id)", NULL, NULL, NULL);
+
+			switch_core_db_exec(db, "create index if not exists dd_realm on db_data (realm)", NULL, NULL, NULL);
+			switch_core_db_exec(db, "create index if not exists dd_data_key on db_data (data_key)", NULL, NULL, NULL);
+
+			switch_core_db_exec(db, "create index if not exists gd_groupname on group_data (groupname)", NULL, NULL, NULL);
+			switch_core_db_exec(db, "create index if not exists gd_url on group_data (url)", NULL, NULL, NULL);
+
 		} else {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open SQL Database!\n");
 			status = SWITCH_STATUS_FALSE;
@@ -439,6 +452,9 @@
 						   argv[3]);
 	} else if (!strcasecmp(argv[0], "delete")) {
 		sql = switch_mprintf("delete from db_data where realm='%q' and data_key='%q'", argv[1], argv[2]);
+	} else {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "USAGE: db %s\n", DB_USAGE);
+		return;
 	}
 
 	switch_assert(sql);
@@ -735,6 +751,48 @@
 	switch_mutex_unlock(globals.mutex);
 }
 
+
+#define LIMIT_USAGE_USAGE "<realm> <id>"
+SWITCH_STANDARD_API(limit_usage_function)
+{
+	int argc = 0;
+	char *argv[6] = { 0 };
+	char *mydata = NULL;
+	char *sql = NULL;
+	char *realm = NULL;
+	char *id = NULL;
+	char buf[80] = "";
+	callback_t cbt = { 0 };
+
+
+    if (!switch_strlen_zero(cmd)) {
+        mydata = strdup(cmd);
+        switch_assert(mydata);
+        argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+    }
+
+    if (argc < 2) {
+        stream->write_function(stream, "USAGE: limit_usage %s\n", LIMIT_USAGE_USAGE);
+		goto end;
+    }
+
+
+	realm = argv[0];
+	id = argv[1];
+
+	cbt.buf = buf;
+	cbt.len = sizeof(buf);
+	sql = switch_mprintf("select count(hostname) from limit_data where realm='%q' and id like '%q'", realm, id);
+	limit_execute_sql_callback(NULL, sql, sql2str_callback, &cbt);
+	switch_safe_free(sql);
+
+    stream->write_function(stream, "%s", buf);
+
+end:
+	switch_safe_free(mydata);
+	return SWITCH_STATUS_SUCCESS;
+}
+
 #define LIMITHASH_USAGE "<realm> <id> <max>[/interval] [number [dialplan [context]]]"
 #define LIMITHASH_DESC "limit access to a resource and transfer to an extension if the limit is exceeded"
 SWITCH_STANDARD_APP(limit_hash_function)
@@ -801,14 +859,11 @@
 	/* Did we already run on this channel before? */
 	if ((channel_hash = switch_channel_get_private(channel, "limit_hash")))
 	{
-		/* Yes, but check if we did that realm+id */
-		if (!switch_core_hash_find(channel_hash, hashkey)) {
-			/* No, add it to our table so the state handler can take care of it */
-			switch_core_hash_insert(channel_hash, hashkey, item);
-		} else {
-			/* Yes, dont touch total counter */
-			increment = 0;
-		}
+		/* Yes, but check if we did that realm+id
+		   If we didnt, allow incrementing the counter.
+		   If we did, dont touch it but do the validation anyways
+		 */
+		increment = !!!switch_core_hash_find(channel_hash, hashkey);
 	} else {
 		/* This is the first limit check on this channel, create a hashtable, set our prviate data and add a state handler */
 		new_channel = 1;
@@ -837,6 +892,10 @@
 	if (increment) {
 		item->total_usage++;
 		
+		if (!new_channel)  {
+			switch_core_hash_insert(channel_hash, hashkey, item);
+		}
+		
 		if (interval == 0) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Usage for %s is now %d/%d\n", hashkey, item->total_usage, max);	
 		} else {
@@ -925,6 +984,7 @@
 	SWITCH_ADD_APP(app_interface, "group", "Manage a group", GROUP_DESC, group_function, GROUP_USAGE, SAF_SUPPORT_NOMEDIA);
 
 	SWITCH_ADD_API(commands_api_interface, "limit_hash_usage", "Gets the usage count of a limited resource", limit_hash_usage_function,  LIMIT_HASH_USAGE_USAGE);
+	SWITCH_ADD_API(commands_api_interface, "limit_usage", "Gets the usage count of a limited resource", limit_usage_function, "<realm> <id>");
 	SWITCH_ADD_API(commands_api_interface, "db", "db get/set", db_api_function, "[insert|delete|select]/<realm>/<key>/<value>");
 	switch_console_set_complete("add db insert");
 	switch_console_set_complete("add db delete");

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_voicemail/mod_voicemail.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_voicemail/mod_voicemail.c	Tue Dec 23 07:37:03 2008
@@ -74,6 +74,7 @@
 	char play_saved_messages_key[2];
 
 	char main_menu_key[2];
+	char skip_greet_key[2];
 	char config_menu_key[2];
 	char record_greeting_key[2];
 	char choose_greeting_key[2];
@@ -270,6 +271,7 @@
 		char *play_saved_messages_key = "2";
 
 		char *main_menu_key = "0";
+		char *skip_greet_key = "#";
 		char *config_menu_key = "5";
 		char *record_greeting_key = "1";
 		char *choose_greeting_key = "2";
@@ -450,6 +452,8 @@
 				play_saved_messages_key = val;
 			} else if (!strcasecmp(var, "main-menu-key") && !switch_strlen_zero(val)) {
 				main_menu_key = val;
+			} else if (!strcasecmp(var, "skip-greet-key") && val && (!*val || is_dtmf(*val))) {
+				skip_greet_key = val;
 			} else if (!strcasecmp(var, "config-menu-key") && !switch_strlen_zero(val)) {
 				config_menu_key = val;
 			} else if (!strcasecmp(var, "record-greeting-key") && !switch_strlen_zero(val)) {
@@ -717,6 +721,7 @@
 			*profile->play_new_messages_key = *play_new_messages_key;
 			*profile->play_saved_messages_key = *play_saved_messages_key;
 			*profile->main_menu_key = *main_menu_key;
+			*profile->skip_greet_key = *skip_greet_key;
 			*profile->config_menu_key = *config_menu_key;
 			*profile->record_greeting_key = *record_greeting_key;
 			*profile->choose_greeting_key = *choose_greeting_key;
@@ -1048,7 +1053,7 @@
 	  record_file:
 		*message_len = 0;
 
-		TRY_CODE(switch_ivr_phrase_macro(session, macro_name, NULL, NULL, NULL));
+		if (macro_name) TRY_CODE(switch_ivr_phrase_macro(session, macro_name, NULL, NULL, NULL));
 		TRY_CODE(switch_ivr_gentones(session, profile->tone_spec, 0, NULL));
 
 		memset(&fh, 0, sizeof(fh));
@@ -2639,6 +2644,7 @@
 	switch_time_t ts = switch_timestamp_now();
 	char *dbuf = NULL;
 	char *vm_storage_dir = NULL;
+	char *record_macro = VM_RECORD_MESSAGE_MACRO;
 	int send_main = 0;
 	int send_notify = 0;
 	int insert_db = 1;
@@ -2830,6 +2836,8 @@
 					goto end;
 				}
 			}
+		} else if (*profile->skip_greet_key && !strcasecmp(buf, profile->skip_greet_key)) {
+			record_macro = NULL;
 		} else {
 			goto greet;
 		}
@@ -2858,7 +2866,7 @@
 	switch_snprintf(key_buf, sizeof(key_buf), "%s:%s", profile->operator_key, profile->vmain_key);
 	memset(buf, 0, sizeof(buf));
 
-	status = create_file(session, profile, VM_RECORD_MESSAGE_MACRO, file_path, &message_len, SWITCH_TRUE, key_buf, buf);
+	status = create_file(session, profile, record_macro, file_path, &message_len, SWITCH_TRUE, key_buf, buf);
 
 	if ((status == SWITCH_STATUS_NOTFOUND)) {
 		goto end;

Modified: freeswitch/branches/gmaruzz/src/mod/codecs/mod_amr/mod_amr.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/codecs/mod_amr/mod_amr.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/codecs/mod_amr/mod_amr.c	Tue Dec 23 07:37:03 2008
@@ -320,8 +320,24 @@
 
 	SWITCH_ADD_CODEC(codec_interface, "AMR");
 	switch_core_codec_add_implementation(pool, codec_interface,
-										 SWITCH_CODEC_TYPE_AUDIO, 96, "AMR", "octet-align=0", 8000, 8000, 12200, 20000, 160, 320, 0, 1, 1, 
-										 switch_amr_init, switch_amr_encode, switch_amr_decode, switch_amr_destroy);
+										 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
+										 96,						/* the IANA code number */
+										 "AMR",						/* the IANA code name */
+										 "octet-align=0",			/* default fmtp to send (can be overridden by the init function) */
+										 8000,						/* samples transferred per second */
+										 8000,						/* actual samples transferred per second */
+										 12200,						/* bits transferred per second */
+										 20000,						/* number of microseconds per frame */
+										 160,						/* number of samples per frame */
+										 320,						/* number of bytes per frame decompressed */
+										 0,							/* number of bytes per frame compressed */
+										 1,							/* number of channels represented */
+										 1, 						/* number of frames per network packet */
+										 switch_amr_init,			/* function to initialize a codec handle using this implementation */
+										 switch_amr_encode,			/* function to encode raw data into encoded data */
+										 switch_amr_decode,			/* function to decode encoded data into raw data */
+										 switch_amr_destroy);		/* deinitalize a codec handle using this implementation */
+
 	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_SUCCESS;
 }

Modified: freeswitch/branches/gmaruzz/src/mod/codecs/mod_g729/mod_g729.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/codecs/mod_g729/mod_g729.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/codecs/mod_g729/mod_g729.c	Tue Dec 23 07:37:03 2008
@@ -38,7 +38,7 @@
 SWITCH_MODULE_DEFINITION(mod_g729, mod_g729_load, NULL, NULL);
 
 #ifndef G729_PASSTHROUGH
-#include "g729/g729.h"
+#include "g729.h"
 
 struct g729_context {
 	struct dec_state decoder_object;

Modified: freeswitch/branches/gmaruzz/src/mod/codecs/mod_siren/mod_siren.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/codecs/mod_siren/mod_siren.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/codecs/mod_siren/mod_siren.c	Tue Dec 23 07:37:03 2008
@@ -147,7 +147,7 @@
 	SWITCH_ADD_CODEC(codec_interface, "Polycom(R) G722.1/G722.1C");
 
 	spf = 320, bpf = 640;
-	for (count = 4; count > 0; count--) {
+	for (count = 3; count > 0; count--) {
 		switch_core_codec_add_implementation(pool,
 											 codec_interface,
 											 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
@@ -169,7 +169,7 @@
 											 switch_siren_destroy);		/* deinitalize a codec handle using this implementation */
 	}
 	spf = 640, bpf = 1280;
-	for (count = 4; count > 0; count--) {
+	for (count = 3; count > 0; count--) {
 		switch_core_codec_add_implementation(pool,
 											 codec_interface,
 											 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */

Modified: freeswitch/branches/gmaruzz/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c	Tue Dec 23 07:37:03 2008
@@ -588,7 +588,7 @@
 											 switch_adpcm_destroy);		/* deinitalize a codec handle using this implementation */
 	}
 	mpf = 10000, spf = 160, bpf = 320, ebpf = 160;
-	for (count = 12; count > 0; count--) {
+	for (count = 6; count > 0; count--) {
 		switch_core_codec_add_implementation(pool,
 											 codec_interface,
 											 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
@@ -781,7 +781,7 @@
 	/* G722 */
 	mpf = 10000, spf = 80, bpf = 320, ebpf = 80;
 	SWITCH_ADD_CODEC(codec_interface, "G.722");
-	for (count = 12; count > 0; count--) {
+	for (count = 6; count > 0; count--) {
 		switch_core_codec_add_implementation(pool,
 											 codec_interface,
 											 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
@@ -881,8 +881,23 @@
 #if SWITCH_MAX_INTERVAL >= 90
 	SWITCH_ADD_CODEC(codec_interface, "LPC-10");
 	switch_core_codec_add_implementation(pool, codec_interface,
-										 SWITCH_CODEC_TYPE_AUDIO, 7, "LPC", NULL, 8000, 8000, 2400,
-										 90000, 720, 1440, 28, 1, 4, switch_lpc10_init, switch_lpc10_encode, switch_lpc10_decode, switch_lpc10_destroy);
+										 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
+										 7,							/* the IANA code number */
+										 "LPC",						/* the IANA code name */
+										 NULL,						/* default fmtp to send (can be overridden by the init function) */
+										 8000,						/* samples transferred per second */
+										 8000,						/* actual samples transferred per second */
+										 2400,						/* bits transferred per second */
+										 90000,						/* number of microseconds per frame */
+										 720,						/* number of samples per frame */
+										 1440,						/* number of bytes per frame decompressed */
+										 28,						/* number of bytes per frame compressed */
+										 1,							/* number of channels represented */
+										 4,							/* number of frames per network packet */
+										 switch_lpc10_init,			/* function to initialize a codec handle using this implementation */
+										 switch_lpc10_encode,		/* function to encode raw data into encoded data */
+										 switch_lpc10_decode,		/* function to decode encoded data into raw data */
+										 switch_lpc10_destroy);		/* deinitalize a codec handle using this implementation */
 #endif
 	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/branches/gmaruzz/src/mod/directories/mod_ldap/Makefile
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/directories/mod_ldap/Makefile	(original)
+++ freeswitch/branches/gmaruzz/src/mod/directories/mod_ldap/Makefile	Tue Dec 23 07:37:03 2008
@@ -1,6 +1,6 @@
 switch_srcdir=../../../..
 
-LDAP=openldap-2.3.19
+LDAP=openldap-2.4.11
 LDAP_DIR=$(switch_srcdir)/libs/$(LDAP)
 
 LDAPLA=$(LDAP_DIR)/libraries/libldap_r/libldap_r.la
@@ -15,7 +15,7 @@
 include $(switch_srcdir)/build/modmake.rules
 
 $(LDAP_DIR):
-	$(GETLIB) $(LDAP).tgz
+	$(GETLIB) $(LDAP).tar.gz
 	cd $(LDAP_DIR) && ./configure $(DEFAULT_ARGS) --disable-bdb --disable-hdb --disable-slapd
 
 $(LDAPLA) $(LIBLBERLA): $(LDAP_DIR)

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/mod_opal.cpp
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/mod_opal.cpp	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/mod_opal.cpp	Tue Dec 23 07:37:03 2008
@@ -82,7 +82,7 @@
 
     /* Prevent the loading of OPAL codecs via "plug ins", this is a directory
        full of DLLs that will be loaded automatically. */
-    putenv("PTLIBPLUGINDIR=/no/thanks");
+    putenv((char *)"PTLIBPLUGINDIR=/no/thanks");
 
 
     *module_interface = switch_loadable_module_create_module_interface(pool, modname);
@@ -162,7 +162,7 @@
     char name[256] = "opal/";
     switch_copy_string(name + 5, outbound_profile->destination_number, sizeof(name)-5);
     switch_channel_set_name(channel, name);
-
+    switch_channel_set_flag(channel, CF_OUTBOUND);
     switch_channel_set_caller_profile(channel, caller_profile);
     switch_channel_set_state(channel, CS_INIT);
 

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/Makefile.am	Tue Dec 23 07:37:03 2008
@@ -44,7 +44,7 @@
 $(mod_sofia_la_SOURCES) : $(BUILT_SOURCES)
 
 $(SOFIALA): $(SOFIA_DIR) $(SOFIA_DIR)/.update
-	cd $(SOFIA_DIR) && $(MAKE)
+	cd $(SOFIA_DIR) && $(MAKE) SOFIA_CFLAGS="$(AM_CFLAGS)"
 	$(TOUCH_TARGET)
 
 ../../../../libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h: $(SOFIALA)

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.c	Tue Dec 23 07:37:03 2008
@@ -373,6 +373,8 @@
 		switch_safe_free(stream.data);
 	}
 
+	switch_clear_flag(tech_pvt, TFLAG_IO);
+
 	if (tech_pvt->read_codec.implementation) {
 		switch_core_codec_destroy(&tech_pvt->read_codec);
 	}
@@ -385,7 +387,6 @@
 	switch_core_session_unset_write_codec(session);
 
 	switch_mutex_lock(tech_pvt->profile->flag_mutex);
-	switch_clear_flag(tech_pvt, TFLAG_IO);
 	tech_pvt->profile->inuse--;
 	switch_mutex_unlock(tech_pvt->profile->flag_mutex);
 
@@ -656,6 +657,10 @@
 	tech_pvt->read_frame.datalen = 0;
 	switch_set_flag_locked(tech_pvt, TFLAG_READING);
 
+	if (switch_test_flag(tech_pvt, TFLAG_HUP) || switch_test_flag(tech_pvt, TFLAG_BYE) || !tech_pvt->read_codec.implementation) {
+		return SWITCH_STATUS_FALSE;
+	}
+
 	if (switch_test_flag(tech_pvt, TFLAG_IO)) {
 		switch_status_t status;
 
@@ -665,7 +670,7 @@
 
 		switch_assert(tech_pvt->rtp_session != NULL);
 		tech_pvt->read_frame.datalen = 0;
-
+		
 		while (switch_test_flag(tech_pvt, TFLAG_IO) && tech_pvt->read_frame.datalen == 0) {
 			tech_pvt->read_frame.flags = SFF_NONE;
 
@@ -733,14 +738,20 @@
 									tech_pvt->codec_ms = codec_ms;
 									switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, 
 													  "Changing codec ptime to %d. I bet you have a linksys/sipura =D\n", tech_pvt->codec_ms);
-									switch_core_codec_destroy(&tech_pvt->read_codec);
+
+									switch_core_session_lock_codec_write(session);
+									switch_core_session_lock_codec_read(session);
+
+									switch_core_codec_destroy(&tech_pvt->read_codec);									
 									switch_core_codec_destroy(&tech_pvt->write_codec);
+									
 									if (sofia_glue_tech_set_codec(tech_pvt, 2) != SWITCH_STATUS_SUCCESS) {
 										*frame = NULL;
+										switch_core_session_unlock_codec_write(session);
+										switch_core_session_unlock_codec_read(session);
 										return SWITCH_STATUS_GENERR;
 									}
-
-
+									
 									if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_timeout_sec"))) {
 										int v = atoi(val);
 										if (v >= 0) {
@@ -779,6 +790,10 @@
 									}
 
 									tech_pvt->check_frames = MAX_CODEC_CHECK_FRAMES;
+
+									switch_core_session_unlock_codec_write(session);
+									switch_core_session_unlock_codec_read(session);
+
 								}
 							
 							}
@@ -845,6 +860,10 @@
 		return SWITCH_STATUS_SUCCESS;
 	}
 
+	if (switch_test_flag(tech_pvt, TFLAG_BYE) || !tech_pvt->read_codec.implementation) {
+		return SWITCH_STATUS_FALSE;
+	}
+
 	switch_set_flag_locked(tech_pvt, TFLAG_WRITING);
 
 	if (!switch_test_flag(frame, SFF_CNG) && !switch_test_flag(frame, SFF_PROXY_PACKET)) {

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia.c	Tue Dec 23 07:37:03 2008
@@ -3516,7 +3516,7 @@
 					int tmp;
 					/* move signal_ptr where we need it (right past Signal=) */
 					signal_ptr = signal_ptr + 7;
-					if (*signal_ptr && strlen(signal_ptr) == 1 && is_dtmf(*signal_ptr)) {
+					if (*signal_ptr && (*signal_ptr == '*' || *signal_ptr == '#' || *signal_ptr == 'A' || *signal_ptr == 'B' || *signal_ptr == 'C' || *signal_ptr == 'D')) {
 						dtmf.digit = *signal_ptr;
 					} else {
 						tmp = atoi(signal_ptr);

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_glue.c	Tue Dec 23 07:37:03 2008
@@ -1532,27 +1532,32 @@
 switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
 {
 	int ms;
-
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
+	int resetting = 0;
+	
 	if (!tech_pvt->iananame) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No audio codec available\n");
-		return SWITCH_STATUS_FALSE;
+		switch_goto_status(SWITCH_STATUS_FALSE, end);
 	}
 
 	if (tech_pvt->read_codec.implementation) {
 		if (!force) {
-			return SWITCH_STATUS_SUCCESS;
+			switch_goto_status(SWITCH_STATUS_SUCCESS, end);
 		}
 		if (strcasecmp(tech_pvt->read_codec.implementation->iananame, tech_pvt->iananame) ||
 			tech_pvt->read_codec.implementation->samples_per_second != tech_pvt->rm_rate) {
 
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Changing Codec from %s to %s\n",
 							  tech_pvt->read_codec.implementation->iananame, tech_pvt->rm_encoding);
+			switch_core_session_lock_codec_write(tech_pvt->session);
+			switch_core_session_lock_codec_read(tech_pvt->session);
+			resetting = 1;
 			switch_core_codec_destroy(&tech_pvt->read_codec);
 			switch_core_codec_destroy(&tech_pvt->write_codec);
 			switch_core_session_reset(tech_pvt->session, SWITCH_TRUE);
 		} else {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Already using %s\n", tech_pvt->read_codec.implementation->iananame);
-			return SWITCH_STATUS_SUCCESS;
+			switch_goto_status(SWITCH_STATUS_SUCCESS, end);
 		}
 	}
 	
@@ -1565,7 +1570,7 @@
 							   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags,
 							   NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
-		return SWITCH_STATUS_FALSE;
+		switch_goto_status(SWITCH_STATUS_FALSE, end);
 	}
 
 	if (switch_core_codec_init(&tech_pvt->write_codec,
@@ -1577,7 +1582,7 @@
 							   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags,
 							   NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
-		return SWITCH_STATUS_FALSE;
+		switch_goto_status(SWITCH_STATUS_FALSE, end);
 	}
 
 	if (switch_rtp_ready(tech_pvt->rtp_session)) {
@@ -1590,7 +1595,7 @@
 
 	if (!tech_pvt->read_codec.implementation) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
-		return SWITCH_STATUS_FALSE;
+		switch_goto_status(SWITCH_STATUS_FALSE, end);
 	}
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set Codec %s %s/%ld %d ms %d samples\n",
@@ -1612,7 +1617,13 @@
 		switch_rtp_set_default_payload(tech_pvt->rtp_session, tech_pvt->pt);
 	}
 
-	return SWITCH_STATUS_SUCCESS;
+ end:
+	if (resetting) {
+		switch_core_session_unlock_codec_write(tech_pvt->session);
+		switch_core_session_unlock_codec_read(tech_pvt->session);
+	}
+
+	return status;
 }
 
 
@@ -2981,6 +2992,34 @@
 		test_sql = switch_mprintf("delete from sip_authentication where hostname='%q'", mod_sofia_globals.hostname);
 		switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_authentication", auth_sql);
 		free(test_sql);
+
+		switch_core_db_exec(profile->master_db, "create index if not exists sr_call_id on sip_registrations (call_id)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sr_sip_user on sip_registrations (sip_user)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sr_sip_host on sip_registrations (sip_host)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sr_profile_name on sip_registrations (profile_name)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sr_presence_hosts on sip_registrations (presence_hosts)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sr_contact on sip_registrations (contact)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sr_expires on sip_registrations (expires)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sr_hostname on sip_registrations (hostname)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sr_status on sip_registrations (status)", NULL, NULL, NULL);
+
+		switch_core_db_exec(profile->master_db, "create index if not exists ss_call_id on sip_subscriptions (call_id)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists ss_hostname on sip_subscriptions (hostname)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists ss_sip_user on sip_subscriptions (sip_user)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists ss_sip_host on sip_subscriptions (sip_host)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists ss_presence_hosts on sip_subscriptions (presence_hosts)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists ss_event on sip_subscriptions (event)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists ss_proto on sip_subscriptions (proto)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists ss_sub_to_user on sip_subscriptions (sub_to_user)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists ss_sub_to_host on sip_subscriptions (sub_to_host)", NULL, NULL, NULL);
+
+		switch_core_db_exec(profile->master_db, "create index if not exists sd_uuid on sip_dialogs (uuid)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sd_hostname on sip_dialogs (hostname)", NULL, NULL, NULL);
+
+		switch_core_db_exec(profile->master_db, "create index if not exists sp_hostname on sip_presence (hostname)", NULL, NULL, NULL);
+
+		switch_core_db_exec(profile->master_db, "create index if not exists sa_nonce on sip_authentication (nonce)", NULL, NULL, NULL);
+		switch_core_db_exec(profile->master_db, "create index if not exists sa_hostname on sip_authentication (hostname)", NULL, NULL, NULL);
 	}
 
 #ifdef SWITCH_HAVE_ODBC

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_presence.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_presence.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_presence.c	Tue Dec 23 07:37:03 2008
@@ -441,10 +441,10 @@
 	case SWITCH_EVENT_PRESENCE_PROBE:
 		if (proto) {
 			char *to = switch_event_get_header(event, "to");
-			char *probe_user, *probe_euser, *probe_host, *p;
+			char *probe_user = NULL, *probe_euser, *probe_host, *p;
 
 			if (!to || !(probe_user = strdup(to))) {
-				return;
+				goto done;
 			}
 
 			if ((probe_host = strchr(probe_user, '@'))) {
@@ -488,10 +488,9 @@
 				switch_safe_free(sql);
 			}
 
-			switch_safe_free(user);
 			switch_safe_free(probe_user);
 		}
-		return;
+		goto done;
 	default:
 		break;
 	}
@@ -1211,7 +1210,9 @@
 		unsigned delta = (unsigned) (exptime * -1);
 		switch_snprintf(sstr, sizeof(sstr), "active;expires=%u", delta);
 		switch_snprintf(expires_str, sizeof(expires_str), "%u", delta);
-		nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, delta, delta);
+		if (nh && nh->nh_ds && nh->nh_ds->ds_usage) {
+			nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, delta, delta);
+		}
 	}
 
 	nua_notify(nh, 
@@ -1662,9 +1663,9 @@
 			}
 
 			
-
-			nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, exp_delta + SUB_OVERLAP, exp_delta + SUB_OVERLAP);
-			
+			if (nh && nh->nh_ds && nh->nh_ds->ds_usage) {
+				nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, exp_delta + SUB_OVERLAP, exp_delta + SUB_OVERLAP);
+			}
 
 			nua_respond(nh, SIP_202_ACCEPTED, SIPTAG_CONTACT_STR(contact_str), NUTAG_WITH_THIS(nua), 
 						SIPTAG_SUBSCRIPTION_STATE_STR(sstr),

Modified: freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Tue Dec 23 07:37:03 2008
@@ -134,29 +134,32 @@
 static switch_status_t socket_logger(const switch_log_node_t *node, switch_log_level_t level)
 {
 	listener_t *l;
-
+	
 	switch_mutex_lock(globals.listener_mutex);
 	for (l = listen_list.listeners; l; l = l->next) {
 		if (switch_test_flag(l, LFLAG_LOG) && l->level >= node->level) {
-			char *data = strdup(node->data);
-			if (data) {
-				if (switch_queue_trypush(l->log_queue, data) == SWITCH_STATUS_SUCCESS) {
-					if (l->lost_logs) {
-						int ll = l->lost_logs;
-						switch_event_t *event;
-						l->lost_logs = 0;
-						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Lost %d log lines!\n", ll);
-						if (switch_event_create(&event, SWITCH_EVENT_TRAP) == SWITCH_STATUS_SUCCESS) {
-							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "info", "lost %d log lines", ll);
-							switch_event_fire(&event);
-						}
+			switch_log_node_t *dnode = malloc(sizeof(*node));
+
+			switch_assert(dnode);
+			*dnode = *node;
+			dnode->data = strdup(node->data);
+			switch_assert(dnode->data);
+			
+			if (switch_queue_trypush(l->log_queue, dnode) == SWITCH_STATUS_SUCCESS) {
+				if (l->lost_logs) {
+					int ll = l->lost_logs;
+					switch_event_t *event;
+					l->lost_logs = 0;
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Lost %d log lines!\n", ll);
+					if (switch_event_create(&event, SWITCH_EVENT_TRAP) == SWITCH_STATUS_SUCCESS) {
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "info", "lost %d log lines", ll);
+						switch_event_fire(&event);
 					}
-				} else {
-					switch_safe_free(data);
-					l->lost_logs++;
 				}
 			} else {
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
+				switch_safe_free(dnode->data);
+				switch_safe_free(dnode);
+				l->lost_logs++;
 			}
 		}
 	}
@@ -171,7 +174,11 @@
 
 	if (listener->log_queue) {
 		while (switch_queue_trypop(listener->log_queue, &pop) == SWITCH_STATUS_SUCCESS) {
-			if (pop) free(pop);
+			switch_log_node_t *dnode = (switch_log_node_t *) pop;
+			if (dnode) {
+				free(dnode->data);
+				free(dnode);
+			}
 		}
 	}
 
@@ -981,17 +988,32 @@
 		if (!*mbuf) {
 			if (switch_test_flag(listener, LFLAG_LOG)) {
 				if (switch_queue_trypop(listener->log_queue, &pop) == SWITCH_STATUS_SUCCESS) {
-					char *data = (char *) pop;
-
-
-					if (data) {
-						switch_snprintf(buf, sizeof(buf), "Content-Type: log/data\nContent-Length: %" SWITCH_SSIZE_T_FMT "\n\n", strlen(data));
+					switch_log_node_t *dnode = (switch_log_node_t *) pop;
+					
+					if (dnode->data) {
+						switch_snprintf(buf, sizeof(buf), 
+										"Content-Type: log/data\n"
+										"Content-Length: %" SWITCH_SSIZE_T_FMT "\n"
+										"Log-Level: %d\n"
+										"Text-Channel: %d\n"
+										"Log-File: %s\n"
+										"Log-Func: %s\n"
+										"Log->Line: %d\n"
+										"\n",
+										strlen(dnode->data),
+										dnode->level,
+										dnode->channel,
+										dnode->file,
+										dnode->func,
+										dnode->line
+										);
 						len = strlen(buf);
 						switch_socket_send(listener->sock, buf, &len);
-						len = strlen(data);
-						switch_socket_send(listener->sock, data, &len);
+						len = strlen(dnode->data);
+						switch_socket_send(listener->sock, dnode->data, &len);
 
-						free(data);
+						free(dnode->data);
+						free(dnode);
 					}
 					do_sleep = 0;
 				}

Modified: freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c	Tue Dec 23 07:37:03 2008
@@ -155,6 +155,14 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
+	if(channel) {
+		const char *disable_flag = switch_channel_get_variable(channel, "disable_radius_start");
+		if(switch_true(disable_flag)) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "[mod_radius_cdr] Not Sending RADIUS Start\n");
+			return SWITCH_STATUS_SUCCESS;
+		}
+	}
+
 	switch_thread_rwlock_rdlock(globals.rwlock);
 
 	rad_config = my_radius_init();
@@ -335,7 +343,9 @@
 				}
 			}
 
-			if (profile->caller_extension && profile->caller_extension->last_application->application_name) {
+			if (profile->caller_extension && 
+				profile->caller_extension->last_application && 
+				profile->caller_extension->last_application->application_name) {
 				if (rc_avpair_add(rad_config, &send, PW_FS_LASTAPP,
 								  (void *) profile->caller_extension->last_application->application_name, -1, PW_FS_PEC) == NULL) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed adding Freeswitch-Lastapp: %s\n", profile->source);
@@ -385,6 +395,15 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
+
+	if(channel) {
+		const char *disable_flag = switch_channel_get_variable(channel, "disable_radius_stop");
+		if(switch_true(disable_flag)) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "[mod_radius_cdr] Not Sending RADIUS Stop\n");
+			return SWITCH_STATUS_SUCCESS;
+		}
+	}
+
 	switch_thread_rwlock_rdlock(globals.rwlock);
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "[mod_radius_cdr] Entering my_on_hangup\n");
@@ -535,7 +554,8 @@
 					goto end;
 				}
 			}
-			if (profile->caller_extension && profile->caller_extension->last_application->application_name) {
+			if (profile->caller_extension && profile->caller_extension->last_application && 
+			    profile->caller_extension->last_application->application_name) {
 				if (rc_avpair_add(rad_config, &send, PW_FS_LASTAPP,
 								  (void *) profile->caller_extension->last_application->application_name, -1, PW_FS_PEC) == NULL) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed adding Freeswitch-Lastapp: %s\n", profile->source);

Modified: freeswitch/branches/gmaruzz/src/mod/formats/mod_local_stream/mod_local_stream.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/formats/mod_local_stream/mod_local_stream.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/formats/mod_local_stream/mod_local_stream.c	Tue Dec 23 07:37:03 2008
@@ -450,7 +450,7 @@
 
 			if (!strcasecmp(var, "rate")) {
 				int tmp = atoi(val);
-				if (tmp == 8000 || tmp == 16000 || tmp == 32000) {
+				if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 48000) {
 					source->rate = tmp;
 				}
 			} else if (!strcasecmp(var, "shuffle")) {

Modified: freeswitch/branches/gmaruzz/src/mod/formats/mod_sndfile/mod_sndfile.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/formats/mod_sndfile/mod_sndfile.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/formats/mod_sndfile/mod_sndfile.c	Tue Dec 23 07:37:03 2008
@@ -95,12 +95,9 @@
 
 		context->sfinfo.channels = handle->channels;
 		context->sfinfo.samplerate = handle->samplerate;
-		if (handle->samplerate == 8000 || handle->samplerate == 16000) {
+		if (handle->samplerate == 8000 || handle->samplerate == 16000 ||
+			handle->samplerate == 24000 || handle->samplerate == 32000 || handle->samplerate == 48000) {
 			context->sfinfo.format |= SF_FORMAT_PCM_16;
-		} else if (handle->samplerate == 24000) {
-			context->sfinfo.format |= SF_FORMAT_PCM_24;
-		} else if (handle->samplerate == 32000) {
-			context->sfinfo.format |= SF_FORMAT_PCM_32;
 		}
 
 		sf_command(context->handle, SFC_FILE_TRUNCATE, &frames, sizeof(frames));

Modified: freeswitch/branches/gmaruzz/src/mod/languages/mod_lua/mod_lua.cpp
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/languages/mod_lua/mod_lua.cpp	(original)
+++ freeswitch/branches/gmaruzz/src/mod/languages/mod_lua/mod_lua.cpp	Tue Dec 23 07:37:03 2008
@@ -278,10 +278,6 @@
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "binding '%s' to '%s'\n", globals.xml_handler, val);
 					switch_xml_bind_search_function(lua_fetch, switch_xml_parse_section_string(val), NULL);
 				}
-			} else if (!strcmp(var, "startup-script")) {
-				if (val) {
-					lua_thread(val);
-				}
 			} else if (!strcmp(var, "module-directory") && !switch_strlen_zero(val)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "lua: appending module directory: '%s'\n", val);
 				if(cpath_stream.data_len) {
@@ -332,6 +328,19 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "lua: LUA_PATH set to: '%s'\n", (char *)path_stream.data);
 		}
 	}
+
+	if ((settings = switch_xml_child(cfg, "settings"))) {
+		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
+			if (!strcmp(var, "startup-script")) {
+				if (val) {
+					lua_thread(val);
+				}
+			}
+		}
+	}
+
 	switch_safe_free(path_stream.data);
     
 	switch_xml_free(xml);

Modified: freeswitch/branches/gmaruzz/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Tue Dec 23 07:37:03 2008
@@ -1778,6 +1778,8 @@
 	struct js_session *jss = JS_GetPrivate(cx, obj);
 	switch_channel_t *channel;
 
+	METHOD_SANITY_CHECK();
+
 	channel = switch_core_session_get_channel(jss->session);
 
 	if (argc > 1) {
@@ -1799,10 +1801,7 @@
 	struct js_session *jss = JS_GetPrivate(cx, obj);
 	switch_channel_t *channel;
 
-	if (!jss || !jss->session) {
-		*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
-		return JS_TRUE;
-	}
+	METHOD_SANITY_CHECK();
 
 	channel = switch_core_session_get_channel(jss->session);
 

Modified: freeswitch/branches/gmaruzz/src/switch_core_codec.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_core_codec.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_core_codec.c	Tue Dec 23 07:37:03 2008
@@ -58,6 +58,26 @@
 	switch_mutex_unlock(session->codec_read_mutex);
 }
 
+SWITCH_DECLARE(void) switch_core_session_lock_codec_write(switch_core_session_t *session)
+{
+	switch_mutex_lock(session->codec_write_mutex);
+}
+
+SWITCH_DECLARE(void) switch_core_session_unlock_codec_write(switch_core_session_t *session)
+{
+	switch_mutex_unlock(session->codec_write_mutex);
+}
+
+SWITCH_DECLARE(void) switch_core_session_lock_codec_read(switch_core_session_t *session)
+{
+	switch_mutex_lock(session->codec_read_mutex);
+}
+
+SWITCH_DECLARE(void) switch_core_session_unlock_codec_read(switch_core_session_t *session)
+{
+	switch_mutex_unlock(session->codec_read_mutex);
+}
+
 SWITCH_DECLARE(void) switch_core_session_unset_write_codec(switch_core_session_t *session)
 {	
 	switch_mutex_t *mutex = NULL;
@@ -550,7 +570,8 @@
 {
 	switch_mutex_t *mutex;
 	switch_memory_pool_t *pool;
-
+	int free_pool = 0;
+	
 	switch_assert(codec != NULL);	
 	
 	if (!codec->implementation) {
@@ -558,6 +579,10 @@
 		return SWITCH_STATUS_NOT_INITALIZED;
 	}
 
+	if (switch_test_flag(codec, SWITCH_CODEC_FLAG_FREE_POOL)) {
+		free_pool = 1;
+	}
+
 	pool = codec->memory_pool;
 	mutex = codec->mutex;
 
@@ -571,7 +596,7 @@
 	
 	if (mutex) switch_mutex_unlock(mutex);
 
-	if (switch_test_flag(codec, SWITCH_CODEC_FLAG_FREE_POOL)) {
+	if (free_pool) {
 		switch_core_destroy_memory_pool(&pool);
 	}
 

Modified: freeswitch/branches/gmaruzz/src/switch_core_db.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_core_db.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_core_db.c	Tue Dec 23 07:37:03 2008
@@ -86,7 +86,7 @@
 		if (ret == SQLITE_BUSY || ret == SQLITE_LOCKED) {
 			if (sane > 1) {
 				switch_safe_free(err);
-				switch_yield(20000);
+				switch_cond_next();
 				continue;
 			}
 		} else {

Modified: freeswitch/branches/gmaruzz/src/switch_core_io.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_core_io.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_core_io.c	Tue Dec 23 07:37:03 2008
@@ -539,6 +539,10 @@
 	switch_mutex_unlock(session->read_codec->mutex);
 	switch_mutex_unlock(session->codec_read_mutex);
 
+	if (switch_core_session_private_event_count(session)) {
+		switch_ivr_parse_all_events(session);
+	}
+
 	return status;
 }
 
@@ -594,7 +598,10 @@
 
 	if (switch_test_flag(frame, SFF_PROXY_PACKET) || pass_cng) {
 		/* Fast PASS! */
-		return perform_write(session, frame, flag, stream_id);
+		switch_mutex_lock(session->codec_write_mutex);
+		status = perform_write(session, frame, flag, stream_id);
+		switch_mutex_unlock(session->codec_write_mutex);
+		return status;
 	}
 
 	switch_assert(frame->codec != NULL);
@@ -636,363 +643,364 @@
 		do_resample = TRUE;
 	}
 
-	if (need_codec) {
-		if (!switch_test_flag(session, SSF_WARN_TRANSCODE)) {
+	if (!need_codec) {
+		do_write = TRUE;
+		goto done;
+	}
+
+	if (!switch_test_flag(session, SSF_WARN_TRANSCODE)) {
 			switch_core_session_message_t msg = { 0 };
 
 			msg.message_id = SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY;
 			switch_core_session_receive_message(session, &msg);
 			switch_set_flag(session, SSF_WARN_TRANSCODE);
-		}
-
-		if (frame->codec) {
-			session->raw_write_frame.datalen = session->raw_write_frame.buflen;
-			status = switch_core_codec_decode(frame->codec,
-											  session->write_codec,
-											  frame->data,
-											  frame->datalen,
-											  session->write_codec->implementation->actual_samples_per_second,
-											  session->raw_write_frame.data, &session->raw_write_frame.datalen, &session->raw_write_frame.rate, &flag);
+	}
 
+	if (frame->codec) {
+		session->raw_write_frame.datalen = session->raw_write_frame.buflen;
+		status = switch_core_codec_decode(frame->codec,
+										  session->write_codec,
+										  frame->data,
+										  frame->datalen,
+										  session->write_codec->implementation->actual_samples_per_second,
+										  session->raw_write_frame.data, &session->raw_write_frame.datalen, &session->raw_write_frame.rate, &flag);
 
 
 
-			if (do_resample && status == SWITCH_STATUS_SUCCESS) {
-				status = SWITCH_STATUS_RESAMPLE;
-			}
 
-			switch (status) {
-			case SWITCH_STATUS_RESAMPLE:
-				write_frame = &session->raw_write_frame;
-				if (!session->write_resampler) {
-					switch_mutex_lock(session->resample_mutex);
-					status = switch_resample_create(&session->write_resampler,
-													frame->codec->implementation->actual_samples_per_second,
-													frame->codec->implementation->decoded_bytes_per_packet,
-													session->write_codec->implementation->actual_samples_per_second,
-													session->write_codec->implementation->decoded_bytes_per_packet, session->pool);
-					switch_mutex_unlock(session->resample_mutex);
-					if (status != SWITCH_STATUS_SUCCESS) {
-						goto done;
-					}
+		if (do_resample && status == SWITCH_STATUS_SUCCESS) {
+			status = SWITCH_STATUS_RESAMPLE;
+		}
+
+		switch (status) {
+		case SWITCH_STATUS_RESAMPLE:
+			write_frame = &session->raw_write_frame;
+			if (!session->write_resampler) {
+				switch_mutex_lock(session->resample_mutex);
+				status = switch_resample_create(&session->write_resampler,
+												frame->codec->implementation->actual_samples_per_second,
+												frame->codec->implementation->decoded_bytes_per_packet,
+												session->write_codec->implementation->actual_samples_per_second,
+												session->write_codec->implementation->decoded_bytes_per_packet, session->pool);
+				switch_mutex_unlock(session->resample_mutex);
+				if (status != SWITCH_STATUS_SUCCESS) {
+					goto done;
 				}
-				break;
-			case SWITCH_STATUS_SUCCESS:
-				session->raw_write_frame.samples = session->raw_write_frame.datalen / sizeof(int16_t);
-				session->raw_write_frame.timestamp = frame->timestamp;
-				session->raw_write_frame.rate = frame->rate;
-				session->raw_write_frame.m = frame->m;
-				session->raw_write_frame.ssrc = frame->ssrc;
-				session->raw_write_frame.seq = frame->seq;
-				session->raw_write_frame.payload = frame->payload;
-				write_frame = &session->raw_write_frame;
-				break;
-			case SWITCH_STATUS_BREAK:
-				status = SWITCH_STATUS_SUCCESS; goto error;
-			case SWITCH_STATUS_NOOP:
-				if (session->write_resampler) {
-					switch_mutex_lock(session->resample_mutex);
-					switch_resample_destroy(&session->write_resampler);
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating write resampler\n");
-					switch_mutex_unlock(session->resample_mutex);
-				}
-				write_frame = frame;
-				status = SWITCH_STATUS_SUCCESS;
-				break;
-			default:
-				if (status == SWITCH_STATUS_NOT_INITALIZED) {
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec init error!\n");
-					goto error;
-				}
-				if (ptime_mismatch) {
-					status = perform_write(session, frame, flags, stream_id);
-					status = SWITCH_STATUS_SUCCESS; goto error;
-				}
-				
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s decoder error!\n", frame->codec->codec_interface->interface_name);
+			}
+			break;
+		case SWITCH_STATUS_SUCCESS:
+			session->raw_write_frame.samples = session->raw_write_frame.datalen / sizeof(int16_t);
+			session->raw_write_frame.timestamp = frame->timestamp;
+			session->raw_write_frame.rate = frame->rate;
+			session->raw_write_frame.m = frame->m;
+			session->raw_write_frame.ssrc = frame->ssrc;
+			session->raw_write_frame.seq = frame->seq;
+			session->raw_write_frame.payload = frame->payload;
+			write_frame = &session->raw_write_frame;
+			break;
+		case SWITCH_STATUS_BREAK:
+			status = SWITCH_STATUS_SUCCESS; goto error;
+		case SWITCH_STATUS_NOOP:
+			if (session->write_resampler) {
+				switch_mutex_lock(session->resample_mutex);
+				switch_resample_destroy(&session->write_resampler);
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating write resampler\n");
+				switch_mutex_unlock(session->resample_mutex);
+			}
+			write_frame = frame;
+			status = SWITCH_STATUS_SUCCESS;
+			break;
+		default:
+			if (status == SWITCH_STATUS_NOT_INITALIZED) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec init error!\n");
 				goto error;
 			}
+			if (ptime_mismatch) {
+				status = perform_write(session, frame, flags, stream_id);
+				status = SWITCH_STATUS_SUCCESS; goto error;
+			}
+				
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s decoder error!\n", frame->codec->codec_interface->interface_name);
+			goto error;
 		}
+	}
 
-		if (session->write_resampler) {
-			short *data = write_frame->data;
+	if (session->write_resampler) {
+		short *data = write_frame->data;
 
-			switch_mutex_lock(session->resample_mutex);
+		switch_mutex_lock(session->resample_mutex);
 
-			session->write_resampler->from_len = write_frame->datalen / 2;
-			switch_short_to_float(data, session->write_resampler->from, session->write_resampler->from_len);
+		session->write_resampler->from_len = write_frame->datalen / 2;
+		switch_short_to_float(data, session->write_resampler->from, session->write_resampler->from_len);
 
-			session->write_resampler->to_len = (uint32_t)
-				switch_resample_process(session->write_resampler, session->write_resampler->from,
-										session->write_resampler->from_len, session->write_resampler->to, session->write_resampler->to_size, 0);
+		session->write_resampler->to_len = (uint32_t)
+			switch_resample_process(session->write_resampler, session->write_resampler->from,
+									session->write_resampler->from_len, session->write_resampler->to, session->write_resampler->to_size, 0);
 
-			switch_float_to_short(session->write_resampler->to, data, session->write_resampler->to_len);
+		switch_float_to_short(session->write_resampler->to, data, session->write_resampler->to_len);
 
-			write_frame->samples = session->write_resampler->to_len;
-			write_frame->datalen = write_frame->samples * 2;
-			write_frame->rate = session->write_resampler->to_rate;
-			switch_mutex_unlock(session->resample_mutex);
-		}
+		write_frame->samples = session->write_resampler->to_len;
+		write_frame->datalen = write_frame->samples * 2;
+		write_frame->rate = session->write_resampler->to_rate;
+		switch_mutex_unlock(session->resample_mutex);
+	}
 
-		if (session->bugs) {
-			switch_media_bug_t *bp, *dp, *last = NULL;
+	if (session->bugs) {
+		switch_media_bug_t *bp, *dp, *last = NULL;
 
-			switch_thread_rwlock_rdlock(session->bug_rwlock);
-			for (bp = session->bugs; bp; bp = bp->next) {
-				switch_bool_t ok = SWITCH_TRUE;
-				if (!bp->ready) {
-					continue;
-				}
-				if (switch_test_flag(bp, SMBF_WRITE_STREAM)) {
+		switch_thread_rwlock_rdlock(session->bug_rwlock);
+		for (bp = session->bugs; bp; bp = bp->next) {
+			switch_bool_t ok = SWITCH_TRUE;
+			if (!bp->ready) {
+				continue;
+			}
+			if (switch_test_flag(bp, SMBF_WRITE_STREAM)) {
 
-					switch_mutex_lock(bp->write_mutex);
-					switch_buffer_write(bp->raw_write_buffer, write_frame->data, write_frame->datalen);
-					switch_mutex_unlock(bp->write_mutex);
-					if (bp->callback) {
-						ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_WRITE);
-					}
+				switch_mutex_lock(bp->write_mutex);
+				switch_buffer_write(bp->raw_write_buffer, write_frame->data, write_frame->datalen);
+				switch_mutex_unlock(bp->write_mutex);
+				if (bp->callback) {
+					ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_WRITE);
 				}
+			}
 
-				if (switch_test_flag(bp, SMBF_WRITE_REPLACE)) {
-					do_bugs = 0;
-					if (bp->callback) {
-						bp->write_replace_frame_in = write_frame;
-						bp->write_replace_frame_out = write_frame;
-						if ((ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_WRITE_REPLACE)) == SWITCH_TRUE) {
-							write_frame = bp->write_replace_frame_out;
-						}
+			if (switch_test_flag(bp, SMBF_WRITE_REPLACE)) {
+				do_bugs = 0;
+				if (bp->callback) {
+					bp->write_replace_frame_in = write_frame;
+					bp->write_replace_frame_out = write_frame;
+					if ((ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_WRITE_REPLACE)) == SWITCH_TRUE) {
+						write_frame = bp->write_replace_frame_out;
 					}
 				}
+			}
 
-				if (bp->stop_time && bp->stop_time <= switch_timestamp(NULL)) {
-					ok = SWITCH_FALSE;
-				}
+			if (bp->stop_time && bp->stop_time <= switch_timestamp(NULL)) {
+				ok = SWITCH_FALSE;
+			}
 
 
-				if (ok == SWITCH_FALSE) {
-					bp->ready = 0;
-					if (last) {
-						last->next = bp->next;
-					} else {
-						session->bugs = bp->next;
-					}
-					dp = bp;
-					bp = last;
-					switch_core_media_bug_close(&dp);
-					if (!bp) {
-						break;
-					}
-					continue;
+			if (ok == SWITCH_FALSE) {
+				bp->ready = 0;
+				if (last) {
+					last->next = bp->next;
+				} else {
+					session->bugs = bp->next;
 				}
-				last = bp;
+				dp = bp;
+				bp = last;
+				switch_core_media_bug_close(&dp);
+				if (!bp) {
+					break;
+				}
+				continue;
 			}
-			switch_thread_rwlock_unlock(session->bug_rwlock);
+			last = bp;
 		}
+		switch_thread_rwlock_unlock(session->bug_rwlock);
+	}
 
-		if (do_bugs) {
-			do_write = TRUE;
-			write_frame = frame;
-			goto done;
-		}
+	if (do_bugs) {
+		do_write = TRUE;
+		write_frame = frame;
+		goto done;
+	}
 
-		if (session->write_codec) {
-			if (write_frame->datalen == session->write_codec->implementation->decoded_bytes_per_packet) {
-				perfect = TRUE;
-			} else {
-				if (!session->raw_write_buffer) {
-					switch_size_t bytes = session->write_codec->implementation->decoded_bytes_per_packet;
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
-									  "Engaging Write Buffer at %u bytes to accommodate %u->%u\n",
-									  (uint32_t) bytes, write_frame->datalen, session->write_codec->implementation->decoded_bytes_per_packet);
-					if ((status = switch_buffer_create_dynamic(&session->raw_write_buffer,
-															   bytes * SWITCH_BUFFER_BLOCK_FRAMES,
-															   bytes * SWITCH_BUFFER_START_FRAMES, 0)) != SWITCH_STATUS_SUCCESS) {
-						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Buffer Failed!\n");
-						goto error;
-					}
+	if (session->write_codec) {
+		if (write_frame->datalen == session->write_codec->implementation->decoded_bytes_per_packet) {
+			perfect = TRUE;
+		} else {
+			if (!session->raw_write_buffer) {
+				switch_size_t bytes = session->write_codec->implementation->decoded_bytes_per_packet;
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+								  "Engaging Write Buffer at %u bytes to accommodate %u->%u\n",
+								  (uint32_t) bytes, write_frame->datalen, session->write_codec->implementation->decoded_bytes_per_packet);
+				if ((status = switch_buffer_create_dynamic(&session->raw_write_buffer,
+														   bytes * SWITCH_BUFFER_BLOCK_FRAMES,
+														   bytes * SWITCH_BUFFER_START_FRAMES, 0)) != SWITCH_STATUS_SUCCESS) {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Buffer Failed!\n");
+					goto error;
 				}
+			}
 
-				if (!(switch_buffer_write(session->raw_write_buffer, write_frame->data, write_frame->datalen))) {
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Buffer %u bytes Failed!\n", write_frame->datalen);
-					status = SWITCH_STATUS_MEMERR; goto error;
-				}
+			if (!(switch_buffer_write(session->raw_write_buffer, write_frame->data, write_frame->datalen))) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Buffer %u bytes Failed!\n", write_frame->datalen);
+				status = SWITCH_STATUS_MEMERR; goto error;
 			}
+		}
 
-			if (perfect) {
-				enc_frame = write_frame;
-				session->enc_write_frame.datalen = session->enc_write_frame.buflen;
-
-				status = switch_core_codec_encode(session->write_codec,
-												  frame->codec,
-												  enc_frame->data,
-												  enc_frame->datalen,
-												  session->write_codec->implementation->actual_samples_per_second,
-												  session->enc_write_frame.data, &session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
-
-				switch (status) {
-				case SWITCH_STATUS_RESAMPLE:
-					/* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fixme 2\n"); */
-				case SWITCH_STATUS_SUCCESS:
-					session->enc_write_frame.codec = session->write_codec;
-					session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t);
-					if (frame->codec->implementation->samples_per_packet != session->write_codec->implementation->samples_per_packet) {
-						session->enc_write_frame.timestamp = 0;
-					} else {
-						session->enc_write_frame.timestamp = frame->timestamp;
-					}
-					session->enc_write_frame.payload = session->write_codec->implementation->ianacode;
-					session->enc_write_frame.m = frame->m;
-					session->enc_write_frame.ssrc = frame->ssrc;
-					session->enc_write_frame.seq = frame->seq;
-					write_frame = &session->enc_write_frame;
-					break;
-				case SWITCH_STATUS_NOOP:
-					enc_frame->codec = session->write_codec;
-					enc_frame->samples = enc_frame->datalen / sizeof(int16_t);
-					enc_frame->timestamp = frame->timestamp;
-					enc_frame->m = frame->m;
-					enc_frame->seq = frame->seq;
-					enc_frame->ssrc = frame->ssrc;
-					enc_frame->payload = enc_frame->codec->implementation->ianacode;
-					write_frame = enc_frame;
-					status = SWITCH_STATUS_SUCCESS;
-					break;
-				case SWITCH_STATUS_NOT_INITALIZED:
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec init error!\n");
-					write_frame = NULL;
-                    goto error;					
-				default:
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s encoder error!\n",
-									  session->read_codec->codec_interface->interface_name);
-					write_frame = NULL;
-					goto error;
-				}
-				if (flag & SFF_CNG) {
-					switch_set_flag(write_frame, SFF_CNG);
+		if (perfect) {
+			enc_frame = write_frame;
+			session->enc_write_frame.datalen = session->enc_write_frame.buflen;
+
+			status = switch_core_codec_encode(session->write_codec,
+											  frame->codec,
+											  enc_frame->data,
+											  enc_frame->datalen,
+											  session->write_codec->implementation->actual_samples_per_second,
+											  session->enc_write_frame.data, &session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
+
+			switch (status) {
+			case SWITCH_STATUS_RESAMPLE:
+				/* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fixme 2\n"); */
+			case SWITCH_STATUS_SUCCESS:
+				session->enc_write_frame.codec = session->write_codec;
+				session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t);
+				if (frame->codec->implementation->samples_per_packet != session->write_codec->implementation->samples_per_packet) {
+					session->enc_write_frame.timestamp = 0;
+				} else {
+					session->enc_write_frame.timestamp = frame->timestamp;
 				}
-				status = perform_write(session, write_frame, flags, stream_id);
+				session->enc_write_frame.payload = session->write_codec->implementation->ianacode;
+				session->enc_write_frame.m = frame->m;
+				session->enc_write_frame.ssrc = frame->ssrc;
+				session->enc_write_frame.seq = frame->seq;
+				write_frame = &session->enc_write_frame;
+				break;
+			case SWITCH_STATUS_NOOP:
+				enc_frame->codec = session->write_codec;
+				enc_frame->samples = enc_frame->datalen / sizeof(int16_t);
+				enc_frame->timestamp = frame->timestamp;
+				enc_frame->m = frame->m;
+				enc_frame->seq = frame->seq;
+				enc_frame->ssrc = frame->ssrc;
+				enc_frame->payload = enc_frame->codec->implementation->ianacode;
+				write_frame = enc_frame;
+				status = SWITCH_STATUS_SUCCESS;
+				break;
+			case SWITCH_STATUS_NOT_INITALIZED:
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec init error!\n");
+				write_frame = NULL;
+				goto error;					
+			default:
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s encoder error!\n",
+								  session->read_codec->codec_interface->interface_name);
+				write_frame = NULL;
+				goto error;
+			}
+			if (flag & SFF_CNG) {
+				switch_set_flag(write_frame, SFF_CNG);
+			}
+			status = perform_write(session, write_frame, flags, stream_id);
+			goto error;
+		} else {
+			switch_size_t used = switch_buffer_inuse(session->raw_write_buffer);
+			uint32_t bytes = session->write_codec->implementation->decoded_bytes_per_packet;
+			switch_size_t frames = (used / bytes);
+
+			status = SWITCH_STATUS_SUCCESS;
+			if (!frames) {
 				goto error;
 			} else {
-				switch_size_t used = switch_buffer_inuse(session->raw_write_buffer);
-				uint32_t bytes = session->write_codec->implementation->decoded_bytes_per_packet;
-				switch_size_t frames = (used / bytes);
+				switch_size_t x;
+				for (x = 0; x < frames; x++) {
+					if ((session->raw_write_frame.datalen = (uint32_t)
+						 switch_buffer_read(session->raw_write_buffer, session->raw_write_frame.data, bytes)) != 0) {
+						int rate;
+						enc_frame = &session->raw_write_frame;
+						session->raw_write_frame.rate = session->write_codec->implementation->actual_samples_per_second;
+						session->enc_write_frame.datalen = session->enc_write_frame.buflen;
+
+						if (frame->codec && frame->codec->implementation) {
+							rate = frame->codec->implementation->actual_samples_per_second;
+						} else {
+							rate = session->write_codec->implementation->actual_samples_per_second;
+						}
 
-				status = SWITCH_STATUS_SUCCESS;
-				if (!frames) {
-					goto error;
-				} else {
-					switch_size_t x;
-					for (x = 0; x < frames; x++) {
-						if ((session->raw_write_frame.datalen = (uint32_t)
-							 switch_buffer_read(session->raw_write_buffer, session->raw_write_frame.data, bytes)) != 0) {
-							int rate;
-							enc_frame = &session->raw_write_frame;
-							session->raw_write_frame.rate = session->write_codec->implementation->actual_samples_per_second;
-							session->enc_write_frame.datalen = session->enc_write_frame.buflen;
-
-							if (frame->codec && frame->codec->implementation) {
-								rate = frame->codec->implementation->actual_samples_per_second;
-							} else {
-								rate = session->write_codec->implementation->actual_samples_per_second;
-							}
+						status = switch_core_codec_encode(session->write_codec,
+														  frame->codec,
+														  enc_frame->data,
+														  enc_frame->datalen,
+														  rate,
+														  session->enc_write_frame.data,
+														  &session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
+						switch (status) {
+						case SWITCH_STATUS_RESAMPLE:
+							session->enc_write_frame.codec = session->write_codec;
+							session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t);
+							session->enc_write_frame.m = frame->m;
+							session->enc_write_frame.ssrc = frame->ssrc;
+							session->enc_write_frame.payload = session->write_codec->implementation->ianacode;
+							write_frame = &session->enc_write_frame;
+							if (!session->write_resampler) {
+								switch_mutex_lock(session->resample_mutex);
+								status = switch_resample_create(&session->write_resampler,
+																frame->codec->implementation->actual_samples_per_second,
+																frame->codec->implementation->decoded_bytes_per_packet,
+																session->write_codec->implementation->actual_samples_per_second,
+																session->write_codec->implementation->decoded_bytes_per_packet, session->pool);
+								switch_mutex_unlock(session->resample_mutex);
 
-							status = switch_core_codec_encode(session->write_codec,
-															  frame->codec,
-															  enc_frame->data,
-															  enc_frame->datalen,
-															  rate,
-															  session->enc_write_frame.data,
-															  &session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
-							switch (status) {
-							case SWITCH_STATUS_RESAMPLE:
-								session->enc_write_frame.codec = session->write_codec;
-								session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t);
-								session->enc_write_frame.m = frame->m;
-								session->enc_write_frame.ssrc = frame->ssrc;
-								session->enc_write_frame.payload = session->write_codec->implementation->ianacode;
-								write_frame = &session->enc_write_frame;
-								if (!session->write_resampler) {
-									switch_mutex_lock(session->resample_mutex);
-									status = switch_resample_create(&session->write_resampler,
-																	frame->codec->implementation->actual_samples_per_second,
-																	frame->codec->implementation->decoded_bytes_per_packet,
-																	session->write_codec->implementation->actual_samples_per_second,
-																	session->write_codec->implementation->decoded_bytes_per_packet, session->pool);
-									switch_mutex_unlock(session->resample_mutex);
-
-									if (status != SWITCH_STATUS_SUCCESS) {
-										goto done;
-									}
+								if (status != SWITCH_STATUS_SUCCESS) {
+									goto done;
 								}
-								break;
-							case SWITCH_STATUS_SUCCESS:
-								session->enc_write_frame.codec = session->write_codec;
-								session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t);
-								session->enc_write_frame.m = frame->m;
-								session->enc_write_frame.ssrc = frame->ssrc;
-								session->enc_write_frame.payload = session->write_codec->implementation->ianacode;
-								write_frame = &session->enc_write_frame;
-								break;
-							case SWITCH_STATUS_NOOP:
-								if (session->write_resampler) {
-									switch_mutex_lock(session->resample_mutex);
-									switch_resample_destroy(&session->write_resampler);
-									switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating write resampler\n");
-									switch_mutex_unlock(session->resample_mutex);
-								}
-								enc_frame->codec = session->write_codec;
-								enc_frame->samples = enc_frame->datalen / sizeof(int16_t);
-								enc_frame->m = frame->m;
-								enc_frame->ssrc = frame->ssrc;
-								enc_frame->payload = enc_frame->codec->implementation->ianacode;
-								write_frame = enc_frame;
-								status = SWITCH_STATUS_SUCCESS;
-								break;
-							case SWITCH_STATUS_NOT_INITALIZED:
-								switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec init error!\n");
-								write_frame = NULL;
-								goto error;
-							default:
-								switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s encoder error %d!\n",
-												  session->read_codec->codec_interface->interface_name, status);
-								write_frame = NULL;
-								goto error;
 							}
-
-							if (session->read_resampler) {
-								short *data = write_frame->data;
+							break;
+						case SWITCH_STATUS_SUCCESS:
+							session->enc_write_frame.codec = session->write_codec;
+							session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t);
+							session->enc_write_frame.m = frame->m;
+							session->enc_write_frame.ssrc = frame->ssrc;
+							session->enc_write_frame.payload = session->write_codec->implementation->ianacode;
+							write_frame = &session->enc_write_frame;
+							break;
+						case SWITCH_STATUS_NOOP:
+							if (session->write_resampler) {
 								switch_mutex_lock(session->resample_mutex);
-
-								session->read_resampler->from_len =
-									switch_short_to_float(data, session->read_resampler->from, (int) write_frame->datalen / 2);
-								session->read_resampler->to_len = (uint32_t)
-									switch_resample_process(session->read_resampler, session->read_resampler->from,
-															session->read_resampler->from_len,
-															session->read_resampler->to, session->read_resampler->to_size, 0);
-								switch_float_to_short(session->read_resampler->to, data, write_frame->datalen * 2);
-								write_frame->samples = session->read_resampler->to_len;
-								write_frame->datalen = session->read_resampler->to_len * 2;
-								write_frame->rate = session->read_resampler->to_rate;
+								switch_resample_destroy(&session->write_resampler);
+								switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating write resampler\n");
 								switch_mutex_unlock(session->resample_mutex);
-
-							}
-							if (flag & SFF_CNG) {
-								switch_set_flag(write_frame, SFF_CNG);
 							}
+							enc_frame->codec = session->write_codec;
+							enc_frame->samples = enc_frame->datalen / sizeof(int16_t);
+							enc_frame->m = frame->m;
+							enc_frame->ssrc = frame->ssrc;
+							enc_frame->payload = enc_frame->codec->implementation->ianacode;
+							write_frame = enc_frame;
+							status = SWITCH_STATUS_SUCCESS;
+							break;
+						case SWITCH_STATUS_NOT_INITALIZED:
+							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec init error!\n");
+							write_frame = NULL;
+							goto error;
+						default:
+							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s encoder error %d!\n",
+											  session->read_codec->codec_interface->interface_name, status);
+							write_frame = NULL;
+							goto error;
+						}
 
-							if ((status = perform_write(session, write_frame, flags, stream_id)) != SWITCH_STATUS_SUCCESS) {
-								break;
-							}
+						if (session->read_resampler) {
+							short *data = write_frame->data;
+							switch_mutex_lock(session->resample_mutex);
+
+							session->read_resampler->from_len =
+								switch_short_to_float(data, session->read_resampler->from, (int) write_frame->datalen / 2);
+							session->read_resampler->to_len = (uint32_t)
+								switch_resample_process(session->read_resampler, session->read_resampler->from,
+														session->read_resampler->from_len,
+														session->read_resampler->to, session->read_resampler->to_size, 0);
+							switch_float_to_short(session->read_resampler->to, data, write_frame->datalen * 2);
+							write_frame->samples = session->read_resampler->to_len;
+							write_frame->datalen = session->read_resampler->to_len * 2;
+							write_frame->rate = session->read_resampler->to_rate;
+							switch_mutex_unlock(session->resample_mutex);
+
+						}
+						if (flag & SFF_CNG) {
+							switch_set_flag(write_frame, SFF_CNG);
+						}
+
+						if ((status = perform_write(session, write_frame, flags, stream_id)) != SWITCH_STATUS_SUCCESS) {
+							break;
 						}
 					}
-					goto error;
 				}
+				goto error;
 			}
 		}
-	} else {
-		do_write = TRUE;
 	}
-
+	
  done:
 
 	if (do_write) {

Modified: freeswitch/branches/gmaruzz/src/switch_core_sqldb.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_core_sqldb.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_core_sqldb.c	Tue Dec 23 07:37:03 2008
@@ -38,7 +38,7 @@
 static struct {
 	switch_core_db_t *db;
 	switch_core_db_t *event_db;
-	switch_queue_t *sql_queue;
+	switch_queue_t *sql_queue[2];
 	switch_memory_pool_t *memory_pool;
 	int thread_running;
 } sql_manager;
@@ -61,7 +61,7 @@
 	while (begin_retries > 0) {
 		again = 0;
 
-		switch_core_db_exec(db, "begin transaction", NULL, NULL, &errmsg);
+		switch_core_db_exec(db, "BEGIN", NULL, NULL, &errmsg);
 
 		if (errmsg) {
 			begin_retries--;
@@ -74,7 +74,7 @@
 			errmsg = NULL;
 
 			if (again) {
-				switch_core_db_exec(db, "end transaction", NULL, NULL, NULL);
+				switch_core_db_exec(db, "COMMIT", NULL, NULL, NULL);
 				goto again;
 			}
 
@@ -109,7 +109,7 @@
 
 done:
 
-	switch_core_db_exec(db, "end transaction", NULL, NULL, NULL);
+	switch_core_db_exec(db, "COMMIT", NULL, NULL, NULL);
 
 	return status;
 }
@@ -151,13 +151,13 @@
 	void *pop;
 	uint32_t itterations = 0;
 	uint8_t trans = 0, nothing_in_queue = 0;
-	uint32_t target = 1000;
+	uint32_t target = 50000;
 	switch_size_t len = 0, sql_len = SQLLEN;
 	char *tmp, *sqlbuf = (char *) malloc(sql_len);
 	char *sql;
 	switch_size_t newlen;
 	int lc = 0;
-
+	
 	switch_assert(sqlbuf);
 
 	if (!sql_manager.event_db) {
@@ -167,7 +167,8 @@
 	sql_manager.thread_running = 1;
 
 	for (;;) {
-		if (switch_queue_trypop(sql_manager.sql_queue, &pop) == SWITCH_STATUS_SUCCESS) {
+		if (switch_queue_trypop(sql_manager.sql_queue[0], &pop) == SWITCH_STATUS_SUCCESS || 
+			switch_queue_trypop(sql_manager.sql_queue[1], &pop) == SWITCH_STATUS_SUCCESS) {
 			sql = (char *) pop;
 
 			if (sql) {
@@ -201,9 +202,9 @@
 		} else {
 			nothing_in_queue = 1;
 		}
-
-
-		if (trans && ((itterations == target) || nothing_in_queue)) {
+		
+		
+		if (trans && ((itterations == target) || (nothing_in_queue && ++lc >= 500))) {
 			if (switch_core_db_persistant_execute_trans(sql_manager.event_db, sqlbuf, 100) != SWITCH_STATUS_SUCCESS) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL thread unable to commit transaction, records lost!\n");
 			}
@@ -212,19 +213,19 @@
 			nothing_in_queue = 0;
 			len = 0;
 			*sqlbuf = '\0';
-		}
-
-		if (++lc == 300000) {
-			switch_core_db_exec(sql_manager.db, "vacuum;", NULL, NULL, NULL);
 			lc = 0;
 		}
-
+		
 		if (nothing_in_queue) {
 			switch_cond_next();
 		}
 	}
 
-	while (switch_queue_trypop(sql_manager.sql_queue, &pop) == SWITCH_STATUS_SUCCESS) {
+	while (switch_queue_trypop(sql_manager.sql_queue[0], &pop) == SWITCH_STATUS_SUCCESS) {
+		free(pop);
+	}
+
+	while (switch_queue_trypop(sql_manager.sql_queue[1], &pop) == SWITCH_STATUS_SUCCESS) {
 		free(pop);
 	}
 
@@ -288,17 +289,20 @@
 		sql =
 			switch_mprintf
 			("update channels set read_codec='%q',read_rate='%q',write_codec='%q',write_rate='%q' where uuid='%q'",
-			 switch_event_get_header_nil(event, "channel-read-codec-name"), switch_event_get_header_nil(event,
-																								"channel-read-codec-rate"),
-			 switch_event_get_header_nil(event, "channel-write-codec-name"), switch_event_get_header_nil(event,
-																								 "channel-write-codec-rate"),
+			 switch_event_get_header_nil(event, "channel-read-codec-name"), 
+			 switch_event_get_header_nil(event, "channel-read-codec-rate"),
+			 switch_event_get_header_nil(event, "channel-write-codec-name"), 
+			 switch_event_get_header_nil(event, "channel-write-codec-rate"),
 			 switch_event_get_header_nil(event, "unique-id"));
 		break;
 	case SWITCH_EVENT_CHANNEL_EXECUTE:
 		sql = switch_mprintf("update channels set application='%q',application_data='%q' where uuid='%q'",
 							 switch_event_get_header_nil(event, "application"),
-							 switch_event_get_header_nil(event, "application-data"), switch_event_get_header_nil(event, "unique-id")
-			);
+							 switch_event_get_header_nil(event, "application-data"), 
+							 switch_event_get_header_nil(event, "unique-id")
+
+							 );
+
 		break;
 	case SWITCH_EVENT_CHANNEL_STATE:
 		{
@@ -384,7 +388,11 @@
 	}
 
 	if (sql) {
-		switch_queue_push(sql_manager.sql_queue, sql);
+		if (switch_stristr("update channels", sql)) {
+			switch_queue_push(sql_manager.sql_queue[1], sql);
+		} else {
+			switch_queue_push(sql_manager.sql_queue[0], sql);
+		}
 		sql = NULL;
 	}
 }
@@ -442,7 +450,7 @@
 			"   read_rate  VARCHAR(255),\n" 
 			"   write_codec  VARCHAR(255),\n" 
 			"   write_rate  VARCHAR(255)\n" 
-			");\n";
+			");\ncreate index uuindex on channels (uuid);\n";
 		char create_calls_sql[] =
 			"CREATE TABLE calls (\n"
 			"   created  VARCHAR(255),\n"
@@ -458,7 +466,9 @@
 			"   callee_dest_num  VARCHAR(255),\n" 
 			"   callee_chan_name VARCHAR(255),\n" 
 			"   callee_uuid      VARCHAR(255)\n" 
-			");\n";
+			");\n"
+			"create index eruuindex on calls (caller_uuid);\n"
+			"create index eeuuindex on calls (callee_uuid);\n";
 		char create_interfaces_sql[] =
 			"CREATE TABLE interfaces (\n"
 			"   type             VARCHAR(255),\n"
@@ -488,6 +498,17 @@
 		switch_core_db_test_reactive(sql_manager.db, "select sticky from aliases", "DROP TABLE aliases", create_alias_sql);
 		switch_core_db_exec(sql_manager.db, "delete from complete where sticky=0", NULL, NULL, NULL);
 		switch_core_db_exec(sql_manager.db, "delete from aliases where sticky=0", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists alias1 on aliases (alias)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete1 on complete (a1)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete2 on complete (a2)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete3 on complete (a3)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete4 on complete (a4)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete5 on complete (a5)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete6 on complete (a6)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete7 on complete (a7)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete8 on complete (a8)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete9 on complete (a9)", NULL, NULL, NULL);
+		switch_core_db_exec(sql_manager.db, "create index if not exists complete10 on complete (a10)", NULL, NULL, NULL);
 		switch_core_db_exec(sql_manager.db, create_channels_sql, NULL, NULL, NULL);
 		switch_core_db_exec(sql_manager.db, create_calls_sql, NULL, NULL, NULL);
 		switch_core_db_exec(sql_manager.db, create_interfaces_sql, NULL, NULL, NULL);
@@ -497,12 +518,14 @@
 		}
 	}
 
-	switch_queue_create(&sql_manager.sql_queue, SWITCH_SQL_QUEUE_LEN, sql_manager.memory_pool);
+	switch_queue_create(&sql_manager.sql_queue[0], SWITCH_SQL_QUEUE_LEN, sql_manager.memory_pool);
+	switch_queue_create(&sql_manager.sql_queue[1], SWITCH_SQL_QUEUE_LEN, sql_manager.memory_pool);
 
 	switch_threadattr_create(&thd_attr, sql_manager.memory_pool);
 	switch_threadattr_detach_set(thd_attr, 1);
 	switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
 	switch_thread_create(&thread, thd_attr, switch_core_sql_thread, NULL, sql_manager.memory_pool);
+
 	while (!sql_manager.thread_running) {
 		switch_yield(10000);
 	}
@@ -510,10 +533,14 @@
 
 void switch_core_sqldb_stop(void)
 {
-	switch_queue_push(sql_manager.sql_queue, NULL);
+	switch_queue_push(sql_manager.sql_queue[0], NULL);
+	switch_queue_push(sql_manager.sql_queue[1], NULL);
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Waiting for unfinished SQL transactions\n");
-	while (switch_queue_size(sql_manager.sql_queue) > 0) {
+	while (switch_queue_size(sql_manager.sql_queue[0]) > 0) {
+		switch_yield(10000);
+	}
+	while (switch_queue_size(sql_manager.sql_queue[1]) > 0) {
 		switch_yield(10000);
 	}
 

Modified: freeswitch/branches/gmaruzz/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_ivr.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_ivr.c	Tue Dec 23 07:37:03 2008
@@ -539,6 +539,8 @@
 {
 
 	while (switch_ivr_parse_next_event(session) == SWITCH_STATUS_SUCCESS);
+	switch_ivr_sleep(session, 0, SWITCH_TRUE, NULL);
+
 	return SWITCH_STATUS_SUCCESS;
 }
 

Modified: freeswitch/branches/gmaruzz/src/switch_loadable_module.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_loadable_module.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_loadable_module.c	Tue Dec 23 07:37:03 2008
@@ -1415,7 +1415,7 @@
 
 	for (x = 0; x < preflen; x++) {
 		char *cur, *last = NULL, *next = NULL, *name, *p, buf[256];
-		uint32_t interval = 0, rate = 8000;
+		uint32_t interval = 0, rate = 0;
 
 		switch_copy_string(buf, prefs[x], sizeof(buf));
 		last = name = next = cur = buf;
@@ -1442,25 +1442,25 @@
 
 		if ((codec_interface = switch_loadable_module_get_codec_interface(name)) != 0) {
 			/* If no specific codec interval is requested opt for 20ms above all else because lots of stuff assumes it */
-			if (!interval) {
-				for (imp = codec_interface->implementations; imp; imp = imp->next) {
-					uint8_t match = 1;
-
-					if (imp->codec_type != SWITCH_CODEC_TYPE_VIDEO) {
-						if ((uint32_t) (imp->microseconds_per_packet / 1000) != 20) {
-							match = 0;
-						}
-
-						if (match && rate && (uint32_t) imp->samples_per_second != rate) {
-							match = 0;
-						}
+			for (imp = codec_interface->implementations; imp; imp = imp->next) {
+				uint8_t match = 1;
+				
+				if (imp->codec_type != SWITCH_CODEC_TYPE_VIDEO) {
+
+					if ((!interval && (uint32_t) (imp->microseconds_per_packet / 1000) != 20) || 
+						(interval && (uint32_t) (imp->microseconds_per_packet / 1000) != interval)) {
+						match = 0;
 					}
 
-					if (match) {
-						array[i++] = imp;
-						goto found;
+					if (match && ((!rate && (uint32_t) imp->samples_per_second != 8000) || (rate && (uint32_t) imp->samples_per_second != rate))) {
+						match = 0;
 					}
 				}
+
+				if (match) {
+					array[i++] = imp;
+					goto found;
+				}
 			}
 
 			/* Either looking for a specific interval or there was no interval specified and there wasn't one @20ms available */
@@ -1468,10 +1468,11 @@
 				uint8_t match = 1;
 
 				if (imp->codec_type != SWITCH_CODEC_TYPE_VIDEO) {
+
 					if (interval && (uint32_t) (imp->microseconds_per_packet / 1000) != interval) {
 						match = 0;
 					}
-
+					
 					if (match && rate && (uint32_t) imp->samples_per_second != rate) {
 						match = 0;
 					}

Modified: freeswitch/branches/gmaruzz/src/switch_log.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_log.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_log.c	Tue Dec 23 07:37:03 2008
@@ -352,7 +352,7 @@
 			node = malloc(sizeof(*node));
 			switch_assert(node);
 		}
-
+		
 		node->data = data;
 		data = NULL;
 		switch_set_string(node->file, filep);
@@ -361,7 +361,7 @@
 		node->level = level;
 		node->content = content;
 		node->timestamp = now;
-
+		node->channel = channel;
 
 		if (switch_queue_trypush(LOG_QUEUE, node) != SWITCH_STATUS_SUCCESS) {
 			free(node->data);
@@ -376,9 +376,7 @@
 
 	switch_safe_free(data);
 	switch_safe_free(new_fmt);
-	if (handle) {
-		fflush(handle);
-	}
+
 }
 
 SWITCH_DECLARE(switch_status_t) switch_log_init(switch_memory_pool_t *pool, switch_bool_t colorize)

Modified: freeswitch/branches/gmaruzz/src/switch_pcm.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_pcm.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_pcm.c	Tue Dec 23 07:37:03 2008
@@ -323,26 +323,61 @@
 	switch_codec_interface_t *codec_interface;
 	int mpf = 10000, spf = 80, bpf = 160, ebpf = 160, bps = 128000, rate = 8000, counta = 1, countb = 12;
 	switch_payload_t ianacode[4] = { 0, 10, 117, 119 };
+	int samples_per_frame, bytes_per_frame, ms_per_frame, x;
 
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
 
 	SWITCH_ADD_CODEC(codec_interface, "PROXY VIDEO PASS-THROUGH");
 	switch_core_codec_add_implementation(pool, codec_interface,
-										 SWITCH_CODEC_TYPE_VIDEO, 31, "PROXY-VID", NULL, 90000, 90000, 0,
-										 0, 0, 0, 0, 1, 1, switch_proxy_init, switch_proxy_encode, switch_proxy_decode, switch_proxy_destroy);
+										 SWITCH_CODEC_TYPE_VIDEO,	/* enumeration defining the type of the codec */
+										 31,						/* the IANA code number */
+										 "PROXY-VID",				/* the IANA code name */
+										 NULL,						/* default fmtp to send (can be overridden by the init function) */
+										 90000,						/* samples transferred per second */
+										 90000,						/* actual samples transferred per second */
+										 0,							/* bits transferred per second */ 
+										 0,							/* number of microseconds per frame */
+										 0,							/* number of samples per frame */
+										 0,							/* number of bytes per frame decompressed */
+										 0,							/* number of bytes per frame compressed */
+										 1,							/* number of channels represented */ 
+										 1,							/* number of frames per network packet */
+										 switch_proxy_init,			/* function to initialize a codec handle using this implementation */
+										 switch_proxy_encode,		/* function to encode raw data into encoded data */
+										 switch_proxy_decode,		/* function to encode raw data into encoded data */
+										 switch_proxy_destroy);		/* deinitalize a codec handle using this implementation */
 
 
 	SWITCH_ADD_CODEC(codec_interface, "PROXY PASS-THROUGH");
 	switch_core_codec_add_implementation(pool, codec_interface,
-										 SWITCH_CODEC_TYPE_AUDIO, 0, "PROXY", NULL, 8000, 8000, 0,
-										 20000, 160, 320, 320, 1, 1,
-										 switch_proxy_init, switch_proxy_encode, switch_proxy_decode, switch_proxy_destroy);
+										 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
+										 0,							/* the IANA code number */
+										 "PROXY",					/* the IANA code name */
+										 NULL,						/* default fmtp to send (can be overridden by the init function) */
+										 8000,						/* samples transferred per second */
+										 8000,						/* actual samples transferred per second */
+										 0,							/* bits transferred per second */
+										 20000,						/* number of microseconds per frame */
+										 160,						/* number of samples per frame */
+										 320,						/* number of bytes per frame decompressed */
+										 320,						/* number of bytes per frame compressed */
+										 1,							/* number of channels represented */
+										 1,							/* number of frames per network packet */
+										 switch_proxy_init,			/* function to initialize a codec handle using this implementation */
+										 switch_proxy_encode,		/* function to encode raw data into encoded data */
+										 switch_proxy_decode,		/* function to decode encoded data into raw data */
+										 switch_proxy_destroy);		/* deinitalize a codec handle using this implementation */
 
 	SWITCH_ADD_CODEC(codec_interface, "RAW Signed Linear (16 bit)");
 
 	for (counta = 1; counta <= 3; counta++) {
-		for (countb = 12; countb > 0; countb--) {
+		if (rate == 8000) {
+			countb = 12;
+		} else {
+			countb = 6;
+		}
+		for (; countb > 0; countb--) {
 			switch_core_codec_add_implementation(pool, codec_interface,
 												 SWITCH_CODEC_TYPE_AUDIO, ianacode[counta], "L16", NULL, rate, rate, bps,
 												 mpf * countb, spf * countb, bpf * countb, ebpf * countb, 1, spf * countb,
@@ -356,13 +391,186 @@
 	}
 	/* these formats below are for file playing. */
 
+	samples_per_frame = 96;
+	bytes_per_frame = 192;
+	ms_per_frame = 2000;
+
+	for (x = 0; x < 5; x++) {
+		switch_core_codec_add_implementation(pool, codec_interface,
+											 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
+											 118, 						/* the IANA code number */
+											 "L16",						/* the IANA code name */
+											 NULL,						/* default fmtp to send (can be overridden by the init function) */
+											 48000,						/* samples transferred per second */
+											 48000,						/* actual samples transferred per second */
+											 768000,					/* bits transferred per second */
+											 ms_per_frame,				/* number of microseconds per frame */
+											 samples_per_frame,			/* number of samples per frame */
+											 bytes_per_frame,			/* number of bytes per frame decompressed */
+											 bytes_per_frame,			/* number of bytes per frame compressed */
+											 1,							/* number of channels represented */
+											 1,							/* number of frames per network packet */
+											 switch_raw_init,			/* function to initialize a codec handle using this implementation */
+											 switch_raw_encode,			/* function to encode raw data into encoded data */
+											 switch_raw_decode,			/* function to decode encoded data into raw data */
+											 switch_raw_destroy);		/* deinitalize a codec handle using this implementation */
+		
+		samples_per_frame += 96;
+		bytes_per_frame += 192;
+		ms_per_frame += 2000;
+		
+	}
+
+
+	samples_per_frame = 16;
+	bytes_per_frame = 32;
+	ms_per_frame = 2000;
+
+	for (x = 0; x < 4; x++) {
+		switch_core_codec_add_implementation(pool, codec_interface,
+											 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
+											 10, 						/* the IANA code number */
+											 "L16",						/* the IANA code name */
+											 NULL,						/* default fmtp to send (can be overridden by the init function) */
+											 8000,						/* samples transferred per second */
+											 8000,						/* actual samples transferred per second */
+											 128000,					/* bits transferred per second */
+											 ms_per_frame,				/* number of microseconds per frame */
+											 samples_per_frame,			/* number of samples per frame */
+											 bytes_per_frame,			/* number of bytes per frame decompressed */
+											 bytes_per_frame,			/* number of bytes per frame compressed */
+											 1,							/* number of channels represented */
+											 1,							/* number of frames per network packet */
+											 switch_raw_init,			/* function to initialize a codec handle using this implementation */
+											 switch_raw_encode,			/* function to encode raw data into encoded data */
+											 switch_raw_decode,			/* function to decode encoded data into raw data */
+											 switch_raw_destroy);		/* deinitalize a codec handle using this implementation */
+		
+		samples_per_frame += 16;
+		bytes_per_frame += 32;
+		ms_per_frame += 2000;
+		
+	}
+
+
+
+	samples_per_frame = 32;
+	bytes_per_frame = 64;
+	ms_per_frame = 2000;
+
+	for (x = 0; x < 4; x++) {
+		switch_core_codec_add_implementation(pool, codec_interface,
+											 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
+											 10, 						/* the IANA code number */
+											 "L16",						/* the IANA code name */
+											 NULL,						/* default fmtp to send (can be overridden by the init function) */
+											 16000,						/* samples transferred per second */
+											 16000,						/* actual samples transferred per second */
+											 256000,					/* bits transferred per second */
+											 ms_per_frame,				/* number of microseconds per frame */
+											 samples_per_frame,			/* number of samples per frame */
+											 bytes_per_frame,			/* number of bytes per frame decompressed */
+											 bytes_per_frame,			/* number of bytes per frame compressed */
+											 1,							/* number of channels represented */
+											 1,							/* number of frames per network packet */
+											 switch_raw_init,			/* function to initialize a codec handle using this implementation */
+											 switch_raw_encode,			/* function to encode raw data into encoded data */
+											 switch_raw_decode,			/* function to decode encoded data into raw data */
+											 switch_raw_destroy);		/* deinitalize a codec handle using this implementation */
+		
+		samples_per_frame += 32;
+		bytes_per_frame += 64;
+		ms_per_frame += 2000;
+		
+	}
+
+
+	samples_per_frame = 64;
+	bytes_per_frame = 128;
+	ms_per_frame = 2000;
+	
+	for (x = 0; x < 4; x++) {
+		switch_core_codec_add_implementation(pool, codec_interface,
+											 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
+											 10, 						/* the IANA code number */
+											 "L16",						/* the IANA code name */
+											 NULL,						/* default fmtp to send (can be overridden by the init function) */
+											 32000,						/* samples transferred per second */
+											 32000,						/* actual samples transferred per second */
+											 512000,					/* bits transferred per second */
+											 ms_per_frame,				/* number of microseconds per frame */
+											 samples_per_frame,			/* number of samples per frame */
+											 bytes_per_frame,			/* number of bytes per frame decompressed */
+											 bytes_per_frame,			/* number of bytes per frame compressed */
+											 1,							/* number of channels represented */
+											 1,							/* number of frames per network packet */
+											 switch_raw_init,			/* function to initialize a codec handle using this implementation */
+											 switch_raw_encode,			/* function to encode raw data into encoded data */
+											 switch_raw_decode,			/* function to decode encoded data into raw data */
+											 switch_raw_destroy);		/* deinitalize a codec handle using this implementation */
+		
+		samples_per_frame += 64;
+		bytes_per_frame += 128;
+		ms_per_frame += 2000;
+		
+	}
+
+	switch_core_codec_add_implementation(pool, codec_interface,
+										 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
+										 118, 						/* the IANA code number */
+										 "L16",						/* the IANA code name */
+										 NULL,						/* default fmtp to send (can be overridden by the init function) */
+										 48000,						/* samples transferred per second */
+										 48000,						/* actual samples transferred per second */
+										 768000,					/* bits transferred per second */
+										 20000,						/* number of microseconds per frame */
+										 960,						/* number of samples per frame */
+										 1920,						/* number of bytes per frame decompressed */
+										 1920,						/* number of bytes per frame compressed */
+										 1,							/* number of channels represented */
+										 1,							/* number of frames per network packet */
+										 switch_raw_init,			/* function to initialize a codec handle using this implementation */
+										 switch_raw_encode,			/* function to encode raw data into encoded data */
+										 switch_raw_decode,			/* function to decode encoded data into raw data */
+										 switch_raw_destroy);		/* deinitalize a codec handle using this implementation */
+
 	switch_core_codec_add_implementation(pool, codec_interface,
-										 SWITCH_CODEC_TYPE_AUDIO, 118, "L16", NULL, 22050, 22050, 352800,
-										 20000, 441, 882, 882, 1, 1, switch_raw_init, switch_raw_encode, switch_raw_decode, switch_raw_destroy);
+										 SWITCH_CODEC_TYPE_AUDIO,	/* enumeration defining the type of the codec */
+										 118,						/* the IANA code number */
+										 "L16", 					/* the IANA code name */
+										 NULL, 						/* default fmtp to send (can be overridden by the init function) */
+										 22050, 					/* samples transferred per second */
+										 22050, 					/* actual samples transferred per second */
+										 352800,					/* bits transferred per second */
+										 20000, 					/* number of microseconds per frame */
+										 441, 						/* number of samples per frame */
+										 882, 						/* number of bytes per frame decompressed */
+										 882, 						/* number of bytes per frame compressed */
+										 1, 						/* number of channels represented */
+										 1, 						/* number of frames per network packet */
+										 switch_raw_init, 			/* function to initialize a codec handle using this implementation */
+										 switch_raw_encode, 		/* function to encode raw data into encoded data */
+										 switch_raw_decode, 		/* function to decode encoded data into raw data */
+										 switch_raw_destroy);		/* deinitalize a codec handle using this implementation */
 
 	switch_core_codec_add_implementation(pool, codec_interface,
-										 SWITCH_CODEC_TYPE_AUDIO, 118, "L16", NULL, 11025, 11025, 176400,
-										 40000, 441, 882, 882, 1, 1, switch_raw_init, switch_raw_encode, switch_raw_decode, switch_raw_destroy);
+										 SWITCH_CODEC_TYPE_AUDIO, 	/* enumeration defining the type of the codec */
+										 118, 						/* the IANA code number */
+										 "L16", 					/* the IANA code name */
+										 NULL, 						/* default fmtp to send (can be overridden by the init function) */
+										 11025, 					/* samples transferred per second */
+										 11025, 					/* actual samples transferred per second */
+										 176400,					/* bits transferred per second */
+										 40000, 					/* number of microseconds per frame */
+										 441, 						/* number of samples per frame */
+										 882, 						/* number of bytes per frame decompressed */
+										 882, 						/* number of bytes per frame compressed */
+										 1, 						/* number of channels represented */
+										 1, 						/* number of frames per network packet */
+										 switch_raw_init, 			/* function to initialize a codec handle using this implementation */
+										 switch_raw_encode, 		/* function to encode raw data into encoded data */
+										 switch_raw_decode, 		/* function to decode encoded data into raw data */
+										 switch_raw_destroy);		/* deinitalize a codec handle using this implementation */
 
 
 

Modified: freeswitch/branches/gmaruzz/src/switch_time.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_time.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_time.c	Tue Dec 23 07:37:03 2008
@@ -44,7 +44,9 @@
 #endif
 
 #define MAX_TICK UINT32_MAX - 1024
-#define MS_PER_TICK 10
+
+static int MS_PER_TICK = 10;
+
 static switch_memory_pool_t *module_pool = NULL;
 
 static struct {
@@ -252,6 +254,11 @@
 		private_info->start = private_info->reference = TIMER_MATRIX[timer->interval].tick;
 		private_info->roll = TIMER_MATRIX[timer->interval].roll;
 		private_info->ready = 1;
+
+		if (timer->interval < MS_PER_TICK) {
+			MS_PER_TICK = timer->interval;
+		}
+
 		return SWITCH_STATUS_SUCCESS;
 	}
 
@@ -319,7 +326,7 @@
 #endif
 
 	timer_step(timer);
-	
+
 	while (globals.RUNNING == 1 && private_info->ready && TIMER_MATRIX[timer->interval].tick < private_info->reference) {
 		check_roll();
 		if (globals.use_cond_yield == 1) {
@@ -506,6 +513,7 @@
 		}
 #endif
 
+
 		if ((current_ms % MS_PER_TICK) == 0) {
 			for (x = MS_PER_TICK; x <= MAX_ELEMENTS; x += MS_PER_TICK) {
 				if ((current_ms % x) == 0) {
@@ -525,6 +533,7 @@
 				}
 			}
 		}
+
 		if (current_ms == MAX_ELEMENTS) {
 			current_ms = 0;
 		}

Modified: freeswitch/branches/gmaruzz/support-d/.bashrc
==============================================================================
--- freeswitch/branches/gmaruzz/support-d/.bashrc	(original)
+++ freeswitch/branches/gmaruzz/support-d/.bashrc	Tue Dec 23 07:37:03 2008
@@ -25,5 +25,5 @@
 alias tcommit='svn commit --no-auth-cache --username=anthm'
 alias mcommit='svn commit --no-auth-cache --username=mikej'
 alias dp='emacs /usr/local/freeswitch/conf/dialplan/default.xml'
-
+alias fstop='top -p `cat /usr/local/freeswitch/log/freeswitch.pid`'
 # End of file



More information about the Freeswitch-branches mailing list