[Freeswitch-svn] [commit] r4494 - in freeswitch/trunk: . libs/win32/pcre libs/win32/sofia libs/win32/sqlite src src/include src/mod/applications/mod_dptools src/mod/applications/mod_enum src/mod/dialplans/mod_dialplan_xml src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_sofia src/mod/endpoints/mod_woomera src/mod/event_handlers/mod_cdr src/mod/event_handlers/mod_event_multicast src/mod/event_handlers/mod_event_socket src/mod/languages/mod_spidermonkey src/mod/languages/mod_spidermonkey_core_db src/mod/xml_int/mod_xml_rpc w32/Library

Freeswitch SVN mikej at freeswitch.org
Fri Mar 9 15:44:13 EST 2007


Author: mikej
Date: Fri Mar  9 15:44:13 2007
New Revision: 4494

Added:
   freeswitch/trunk/src/include/switch_core_db.h
   freeswitch/trunk/src/include/switch_private.h.in
   freeswitch/trunk/src/include/switch_regex.h
   freeswitch/trunk/src/switch_apr.c
   freeswitch/trunk/src/switch_core_db.c
   freeswitch/trunk/src/switch_regex.c
Modified:
   freeswitch/trunk/Freeswitch.sln
   freeswitch/trunk/Makefile.am
   freeswitch/trunk/acsite.m4
   freeswitch/trunk/configure.in
   freeswitch/trunk/libs/win32/pcre/libpcre.vcproj
   freeswitch/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj
   freeswitch/trunk/libs/win32/sqlite/sqlite.vcproj
   freeswitch/trunk/src/include/switch.h
   freeswitch/trunk/src/include/switch_am_config.h.in
   freeswitch/trunk/src/include/switch_apr.h
   freeswitch/trunk/src/include/switch_ivr.h
   freeswitch/trunk/src/include/switch_platform.h
   freeswitch/trunk/src/include/switch_resample.h
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/include/switch_utils.h
   freeswitch/trunk/src/include/switch_xml.h
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
   freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c
   freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
   freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.h
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.cpp
   freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
   freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c
   freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
   freeswitch/trunk/src/switch_console.c
   freeswitch/trunk/src/switch_core.c
   freeswitch/trunk/src/switch_event.c
   freeswitch/trunk/src/switch_ivr.c
   freeswitch/trunk/src/switch_loadable_module.c
   freeswitch/trunk/src/switch_log.c
   freeswitch/trunk/src/switch_rtp.c
   freeswitch/trunk/src/switch_stun.c
   freeswitch/trunk/src/switch_utils.c
   freeswitch/trunk/src/switch_xml.c
   freeswitch/trunk/w32/Library/FreeSwitchCore.vcproj

Log:
add wrapper code to fully encapsulate apr, apr-utils, pcre, and sqlite.  fully use switch_ namespace in modules, create our own format and type defines.  follow up commit for unix autotools coming soon after this.  PLEASE NOTE: you will NEED to do a make megaclean and run configure again after this update (and the following commit) or it will not build.

Modified: freeswitch/trunk/Freeswitch.sln
==============================================================================
--- freeswitch/trunk/Freeswitch.sln	(original)
+++ freeswitch/trunk/Freeswitch.sln	Fri Mar  9 15:44:13 2007
@@ -3,22 +3,20 @@
 # Visual Studio 2005
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchConsole", "w32\Console\FreeSwitchConsole.vcproj", "{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "FreeSwitchCoreLib", "w32\Library\FreeSwitchCore.vcproj", "{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}"
 	ProjectSection(ProjectDependencies) = postProject
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EEF031CB-FED8-451E-A471-91EC8D4F6750}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
 		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761} = {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
+		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EEF031CB-FED8-451E-A471-91EC8D4F6750}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g729", "src\mod\codecs\mod_g729\mod_g729.vcproj", "{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}"
@@ -28,42 +26,34 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsm", "src\mod\codecs\mod_gsm\mod_gsm.vcproj", "{4926323F-4EA8-4B7D-A3D3-65488725988F}"
 	ProjectSection(ProjectDependencies) = postProject
-		{8FD2E297-4096-47E5-9258-C48FF1841523} = {8FD2E297-4096-47E5-9258-C48FF1841523}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{8FD2E297-4096-47E5-9258-C48FF1841523} = {8FD2E297-4096-47E5-9258-C48FF1841523}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xmpp_event", "src\mod\event_handlers\mod_xmpp_event\mod_xmpp_event.vcproj", "{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}"
 	ProjectSection(ProjectDependencies) = postProject
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sndfile", "src\mod\formats\mod_sndfile\mod_sndfile.vcproj", "{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4} = {3D0370CA-BED2-4657-A475-32375CBCB6E4}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4} = {3D0370CA-BED2-4657-A475-32375CBCB6E4}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_bridgecall", "src\mod\applications\mod_bridgecall\mod_bridgecall.vcproj", "{E1794405-29D4-466D-9BE3-DD2344C2A663}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "mod_event_test", "src\mod\event_handlers\mod_event_test\mod_event_test.vcproj", "{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "mod_g711", "src\mod\codecs\mod_g711\mod_g711.vcproj", "{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}"
@@ -73,28 +63,22 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_iax", "src\mod\endpoints\mod_iax\mod_iax.vcproj", "{3A5B9131-F20C-4A85-9447-6C1610941CEE}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_playback", "src\mod\applications\mod_playback\mod_playback.vcproj", "{78100236-7CEA-4948-96CC-E8ED3160329C}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "mod_PortAudio", "src\mod\endpoints\mod_portaudio\mod_PortAudio.vcproj", "{5FD31A25-5D83-4794-8BEE-904DAD84CE71}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {0A18A071-125E-442F-AFF7-A3F68ABECF99}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {0A18A071-125E-442F-AFF7-A3F68ABECF99}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_l16", "src\mod\codecs\mod_l16\mod_l16.vcproj", "{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}"
@@ -104,24 +88,20 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_softtimer", "src\mod\timers\mod_softtimer\mod_softtimer.vcproj", "{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "mod_speex", "src\mod\codecs\mod_speex\mod_speex.vcproj", "{5580D60E-0F77-4716-9CD4-B8E5986FA375}"
 	ProjectSection(ProjectDependencies) = postProject
-		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918} = {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{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.vcproj", "{FE3540C5-3303-46E0-A69E-D92F775687F1}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"
@@ -144,19 +124,14 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_xml", "src\mod\dialplans\mod_dialplan_xml\mod_dialplan_xml.vcproj", "{07113B25-D3AF-4E04-BA77-4CD1171F022C}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
 		{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}") = "mod_ivrtest", "src\mod\applications\mod_ivrtest\mod_ivrtest.vcproj", "{419AA391-5F3F-4BFE-A869-9D154D62A792}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 	EndProjectSection
 EndProject
 Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FreeSwitchSetup", "w32\Setup\Setup.vdproj", "{B17FFBE6-A942-4056-8346-B624FB5D995B}"
@@ -170,28 +145,22 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_directory", "src\mod\dialplans\mod_dialplan_directory\mod_dialplan_directory.vcproj", "{A27CCA23-1541-4337-81A4-F0A6413078A0}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "mod_zeroconf", "src\mod\event_handlers\mod_zeroconf\mod_zeroconf.vcproj", "{C7705DC4-2088-493E-AF8D-65BC6D65C125}"
 	ProjectSection(ProjectDependencies) = postProject
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{49C34584-B6DA-448F-83CF-27584DC9FC90} = {49C34584-B6DA-448F-83CF-27584DC9FC90}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{49C34584-B6DA-448F-83CF-27584DC9FC90} = {49C34584-B6DA-448F-83CF-27584DC9FC90}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_multicast", "src\mod\event_handlers\mod_event_multicast\mod_event_multicast.vcproj", "{784113EF-44D9-4949-835D-7065D3C7AD08}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "libteletone", "libs\libteletone\libteletone.vcproj", "{89385C74-5860-4174-9CAF-A39E7C48909C}"
@@ -200,14 +169,10 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey", "src\mod\languages\mod_spidermonkey\mod_spidermonkey.vcproj", "{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}"
 	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ASR-TTS", "ASR-TTS", "{4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}"
@@ -229,36 +194,28 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_echo", "src\mod\applications\mod_echo\mod_echo.vcproj", "{0E2C6395-13B9-46E5-9264-8859D346018D}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "mod_ilbc", "src\mod\codecs\mod_ilbc\mod_ilbc.vcproj", "{D3EC0AFF-76FC-4210-A825-9A17410660A3}"
 	ProjectSection(ProjectDependencies) = postProject
-		{989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {989BB874-7AF1-44CB-8E5C-CC8113D267E8}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {989BB874-7AF1-44CB-8E5C-CC8113D267E8}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dingaling", "src\mod\endpoints\mod_dingaling\mod_dingaling.vcproj", "{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}"
 	ProjectSection(ProjectDependencies) = postProject
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{1906D736-08BD-4EE1-924F-B536249B9A54} = {1906D736-08BD-4EE1-924F-B536249B9A54}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_commands", "src\mod\applications\mod_commands\mod_commands.vcproj", "{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}"
 	ProjectSection(ProjectDependencies) = postProject
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}"
@@ -272,58 +229,42 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_rpc", "src\mod\xml_int\mod_xml_rpc\mod_xml_rpc.vcproj", "{CBEC7225-0C21-4DA8-978E-1F158F8AD950}"
 	ProjectSection(ProjectDependencies) = postProject
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94} = {356EC96D-4C9F-47B5-9083-FC328B87BA94}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94} = {356EC96D-4C9F-47B5-9083-FC328B87BA94}
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rss", "src\mod\applications\mod_rss\mod_rss.vcproj", "{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "mod_conference", "src\mod\applications\mod_conference\mod_conference.vcproj", "{C24FB505-05D7-4319-8485-7540B44C8603}"
 	ProjectSection(ProjectDependencies) = postProject
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "mod_dptools", "src\mod\applications\mod_dptools\mod_dptools.vcproj", "{B5881A85-FE70-4F64-8607-2CAAE52669C6}"
 	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_socket", "src\mod\event_handlers\mod_event_socket\mod_event_socket.vcproj", "{05515420-16DE-4E63-BE73-85BE85BA5142}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr", "src\mod\event_handlers\mod_cdr\mod_cdr.vcproj", "{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
@@ -336,6 +277,7 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdingaling", "libs\libdingaling\libdingaling.vcproj", "{1906D736-08BD-4EE1-924F-B536249B9A54}"
 	ProjectSection(ProjectDependencies) = postProject
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
 	EndProjectSection
 EndProject
@@ -361,8 +303,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\apr-util\libaprutil.vcproj", "{F057DA7F-79E5-4B00-845C-EF446EF055E3}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Downloads", "_Downloads", "{C120A020-773F-4EA3-923F-B67AF28B750D}"
@@ -380,8 +322,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSResponder static library", "libs\win32\howl\libmDNSResponder.vcproj", "{49C34584-B6DA-448F-83CF-27584DC9FC90}"
 	ProjectSection(ProjectDependencies) = postProject
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
 		{5927104D-C14C-4AC8-925C-4AB681762E75} = {5927104D-C14C-4AC8-925C-4AB681762E75}
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsndfile", "libs\win32\libsndfile\libsndfile.vcproj", "{3D0370CA-BED2-4657-A475-32375CBCB6E4}"
@@ -401,49 +343,40 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.vcproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}"
 	ProjectSection(ProjectDependencies) = postProject
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg726", "libs\codec\g726\libg726.vcproj", "{5A6A281A-AA50-470A-8305-202BDA1CD1BF}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g726", "src\mod\codecs\mod_g726\mod_g726.vcproj", "{486369EB-F150-4B56-BCC8-77B9E18FF5F5}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{5A6A281A-AA50-470A-8305-202BDA1CD1BF} = {5A6A281A-AA50-470A-8305-202BDA1CD1BF}
+		{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}") = "libg7xx", "libs\codec\g7xx\libg7xx.vcproj", "{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g722", "src\mod\codecs\mod_g722\mod_g722.vcproj", "{D42518CC-7475-454D-B392-0E132C07D761}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}
+		{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}") = "mod_park", "src\mod\applications\mod_park\mod_park.vcproj", "{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.vcproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
 	ProjectSection(ProjectDependencies) = postProject
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
 		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PTHREAD", "libs\win32\Download PTHREAD.vcproj", "{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}"
@@ -455,82 +388,67 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g723_1", "src\mod\codecs\mod_g723_1\mod_g723_1.vcproj", "{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{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}") = "mod_native_file", "src\mod\formats\mod_native_file\mod_native_file.vcproj", "{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 	EndProjectSection
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSwitch.NET", "src\dotnet\FreeSwitch.NET.csproj", "{251CAABC-16C3-4593-A491-603B908094E0}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_core_db", "src\mod\languages\mod_spidermonkey_core_db\mod_spidermonkey_core_db.vcproj", "{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}"
 	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_teletone", "src\mod\languages\mod_spidermonkey_teletone\mod_spidermonkey_teletone.vcproj", "{8F992C49-6C51-412F-B2A3-34EAB708EB65}"
 	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libudns", "libs\win32\udns\libudns.vcproj", "{4043FC6A-9A30-4577-8AD5-9B233C9575D8}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_enum", "src\mod\applications\mod_enum\mod_enum.vcproj", "{71A967D5-0E99-4CEF-A587-98836EE6F2EF}"
 	ProjectSection(ProjectDependencies) = postProject
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_etpan", "src\mod\languages\mod_spidermonkey_etpan\mod_spidermonkey_etpan.vcproj", "{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}"
 	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}
 		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_odbc", "src\mod\languages\mod_spidermonkey_odbc\mod_spidermonkey_odbc.vcproj", "{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}"
 	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libetpan", "libs\win32\etpan\libetpan.vcproj", "{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_curl", "src\mod\xml_int\mod_xml_curl\mod_xml_curl.vcproj", "{AB91A099-7690-4ECF-8994-E458F4EA1ED4}"
 	ProjectSection(ProjectDependencies) = postProject
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
 		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
@@ -538,17 +456,16 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_en", "src\mod\say\mod_say_en\mod_say_en.vcproj", "{988CACF7-3FCB-4992-BE69-77872AE67DC8}"
 	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{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}") = "portaudio", "libs\portaudio\build\msvc\portaudio.vcproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_cdr", "src\mod\xml_int\mod_xml_cdr\mod_xml_cdr.vcproj", "{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}"
 	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
 		{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}") = "mod_amr", "src\mod\codecs\mod_amr\mod_amr.vcproj", "{8DEB383C-4091-4F42-A56F-C9E46D552D79}"
@@ -826,17 +743,17 @@
 		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32
 		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32
 		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.ActiveCfg = Release|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.ActiveCfg = Debug DLL|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.Build.0 = Debug DLL|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.Build.0 = Debug|Win32
 		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.ActiveCfg = Debug|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.ActiveCfg = Release DLL|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.Build.0 = Release DLL|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.ActiveCfg = Release|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.Build.0 = Release|Win32
 		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.ActiveCfg = Release|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.ActiveCfg = Debug DLL|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.Build.0 = Debug DLL|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.Build.0 = Debug|Win32
 		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|x64.ActiveCfg = Debug|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.ActiveCfg = Release DLL|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.Build.0 = Release DLL|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.ActiveCfg = Release|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.Build.0 = Release|Win32
 		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|x64.ActiveCfg = Release|Win32
 		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.ActiveCfg = Debug|Win32
 		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.Build.0 = Debug|Win32

Modified: freeswitch/trunk/Makefile.am
==============================================================================
--- freeswitch/trunk/Makefile.am	(original)
+++ freeswitch/trunk/Makefile.am	Fri Mar  9 15:44:13 2007
@@ -4,82 +4,46 @@
 NAME=freeswitch
 PREFIX=$(prefix)
 
-AM_CFLAGS       = $(new_AM_CFLAGS)
+AM_CFLAGS   = $(new_AM_CFLAGS)
 AM_CPPFLAGS = $(AM_CFLAGS)
-AM_LDFLAGS = $(new_AM_LDFLAGS)
+AM_LDFLAGS  = $(new_AM_LDFLAGS)
+BASE        = $(PWD)
+OSARCH=$(shell uname -s)
+LIBTOOL=$(PWD)/libtool
+LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
+
+FIRST_INCLUDES = -I$(PWD)/src/include -I$(PWD)
+AM_CFLAGS  += $(FIRST_INCLUDES) -I$(PREFIX)/include
 
-APR_CONFIG=$(prefix)/bin/apr-1-config
-APU_CONFIG=$(prefix)/bin/apu-1-config
-AM_CFLAGS  += -I$(PREFIX)/include $(shell $(APR_CONFIG) --cflags --cppflags --includes) -I${prefix}/include/srtp
 AM_LDFLAGS += -L$(PREFIX)/lib
-AM_LDFLAGS += $(shell $(APR_CONFIG) --link-ld --libs )
-AM_CFLAGS  += $(shell $(APU_CONFIG) --includes) 
-AM_LDFLAGS += $(shell $(APU_CONFIG) --link-ld --libs )
 AM_LDFLAGS += -lm -L/usr/local/lib/db42 -L/usr/local/lib
-AM_LDFLAGS += -lsqlite3 -lpcre
-OSARCH=$(shell uname -s)
 
 if CRASHPROT
 AM_CFLAGS += -DCRASH_PROT
 endif
 
-AM_CFLAGS  +=-I$(PWD)/src/sqlite -I$(PWD) -I$(PWD)/src/include -I$(PREFIX)/include
-AM_CFLAGS 	+= -DSWITCH_MOD_DIR=\"$(PREFIX)/mod\"
-AM_CFLAGS	+= -DSWITCH_PREFIX_DIR=\"$(PREFIX)\"
-AM_CFLAGS	+= -DSWITCH_CONF_DIR=\"$(PREFIX)/conf\"
-AM_CFLAGS	+= -DSWITCH_DB_DIR=\"$(PREFIX)/db\"
-AM_CFLAGS	+= -DSWITCH_LOG_DIR=\"$(PREFIX)/log\"
-AM_CFLAGS	+= -DSWITCH_SCRIPT_DIR=\"$(PREFIX)/scripts\"
-AM_CFLAGS	+= -DSWITCH_HTDOCS_DIR=\"$(PREFIX)/htdocs\"
-AM_CFLAGS	+= -DSWITCH_GRAMMAR_DIR=\"$(PREFIX)/grammar\"
-
-
 libfreeswitch_la_SOURCES	= \
-src/include/switch_am_config.h\
-src/include/switch.h\
-src/include/switch_apr.h\
-src/include/switch_buffer.h\
-src/include/switch_caller.h\
-src/include/switch_channel.h\
-src/include/switch_config.h\
-src/include/switch_console.h\
-src/include/switch_core.h\
-src/include/switch_event.h\
-src/include/switch_frame.h\
-src/include/switch_ivr.h\
-src/include/switch_loadable_module.h\
-src/include/switch_module_interfaces.h\
-src/include/switch_platform.h\
-src/include/switch_resample.h\
-src/include/switch_sqlite.h\
-src/include/switch_types.h\
-src/include/switch_utils.h\
-src/include/switch_version.h\
-src/include/switch_rtp.h\
-src/include/switch_stun.h\
-src/include/switch_log.h\
-src/include/switch_xml.h\
-src/switch_rtp.c\
+src/switch_apr.c \
 src/switch_buffer.c \
 src/switch_caller.c \
 src/switch_channel.c \
 src/switch_config.c \
 src/switch_console.c \
 src/switch_core.c \
+src/switch_core_db.c\
 src/switch_loadable_module.c \
 src/switch_utils.c \
 src/switch_event.c \
 src/switch_resample.c \
+src/switch_regex.c\
+src/switch_rtp.c\
 src/switch_ivr.c \
 src/switch_stun.c\
 src/switch_log.c\
 src/switch_xml.c
 
-
-
-#bindir = $(PREFIX)/bin
-#libdir = $(PREFIX)/lib
 library_includedir	= $(PREFIX)/include
+
 library_include_HEADERS = \
 src/include/switch_am_config.h\
 src/include/switch.h\
@@ -90,6 +54,7 @@
 src/include/switch_config.h\
 src/include/switch_console.h\
 src/include/switch_core.h\
+src/include/switch_core_db.h\
 src/include/switch_event.h\
 src/include/switch_frame.h\
 src/include/switch_ivr.h\
@@ -97,7 +62,7 @@
 src/include/switch_module_interfaces.h\
 src/include/switch_platform.h\
 src/include/switch_resample.h\
-src/include/switch_sqlite.h\
+src/include/switch_regex.h\
 src/include/switch_types.h\
 src/include/switch_utils.h\
 src/include/switch_rtp.h\
@@ -109,13 +74,40 @@
 BUILT_SOURCES = version depends
 CLEANFILES = src/include/switch_version.h scripts/fsxs
 
+APR_CONFIG=$(PWD)/libs/apr/apr-1-config
+APU_CONFIG=$(PWD)/libs/apr-util/apu-1-config
 
-lib_LTLIBRARIES		= libfreeswitch.la
-libfreeswitch_la_CFLAGS	= $(AM_CFLAGS)
-libfreeswitch_la_LDFLAGS	= -version-info 1:0:0
-libfreeswitch_la_LIBADD  = -lteletone -lresample -lsrtp -lsqlite3 -lpcre
+CORE_INCLUDES	  = -I$(PWD)/libs/apr/include
+CORE_INCLUDES	 += -I$(PWD)/libs/apr-util/include
+CORE_INCLUDES	 += -I$(PWD)/libs/sqlite
+CORE_INCLUDES	 += -I$(PWD)/libs/pcre
+CORE_INCLUDES	 += -I$(PWD)/libs/srtp/include
+CORE_INCLUDES	 += -I$(PWD)/libs/srtp/crypto/include
+CORE_INCLUDES  += -I$(PWD)/libs/libresample/include
+CORE_INCLUDES  += -I$(PWD)/libs/libteletone/src
+
+CORE_CFLAGS     = $(shell $(APR_CONFIG) --cflags --cppflags --includes)
+CORE_CFLAGS    += $(shell $(APU_CONFIG) --includes)
+CORE_CFLAGS    += -DSWITCH_MOD_DIR=\"$(PREFIX)/mod\"
+CORE_CFLAGS    += -DSWITCH_PREFIX_DIR=\"$(PREFIX)\"
+CORE_CFLAGS    += -DSWITCH_CONF_DIR=\"$(PREFIX)/conf\"
+CORE_CFLAGS	   += -DSWITCH_DB_DIR=\"$(PREFIX)/db\"
+CORE_CFLAGS	   += -DSWITCH_LOG_DIR=\"$(PREFIX)/log\"
+CORE_CFLAGS	   += -DSWITCH_SCRIPT_DIR=\"$(PREFIX)/scripts\"
+CORE_CFLAGS	   += -DSWITCH_HTDOCS_DIR=\"$(PREFIX)/htdocs\"
+CORE_CFLAGS	   += -DSWITCH_GRAMMAR_DIR=\"$(PREFIX)/grammar\"
+
+CORE_LDFLAGS    = $(shell $(APR_CONFIG) --link-ld --libs )
+CORE_LDFLAGS   += $(shell $(APU_CONFIG) --link-ld --libs )
+
+lib_LTLIBRARIES	          = libfreeswitch.la
+libfreeswitch_la_CFLAGS   = $(FIRST_INCLUDES) $(CORE_INCLUDES) $(AM_CFLAGS) $(CORE_CFLAGS)
+libfreeswitch_la_LDFLAGS  = -version-info 1:0:0 $(AM_LDFLAGS) $(CORE_LDFLAGS)
+libfreeswitch_la_LIBADD   = -lteletone -lresample -lsrtp -lsqlite3 -lpcre
 nodist_libfreeswitch_la_SOURCES = src/include/switch_version.h
 
+$(libfreeswitch_la_SOURCES): depends version
+
 bin_PROGRAMS =	freeswitch
 bin_SCRIPTS = scripts/fsxs
 freeswitch_SOURCES = 	src/switch.c\
@@ -123,9 +115,6 @@
 freeswitch_CFLAGS = $(AM_CFLAGS)
 freeswitch_LDADD = ${top_builddir}/libfreeswitch.la 
 
-
-
-
 version: Makefile src/include/switch_version.h
 	MAKE=$(MAKE) ./build/checkversion.sh
 
@@ -153,7 +142,6 @@
 	./build/buildlib.sh . install libresample --prefix=$(PREFIX)
 	./build/buildlib.sh . install libteletone --prefix=$(PREFIX)
 	./build/buildlib.sh . install srtp --prefix=$(PREFIX)
-#	./build/buildlib.sh . install libspeakup --prefix=$(PREFIX)
 	./build/buildlib.sh . install pcre --prefix=$(PREFIX)
 	rm build/freeswitch.env
 

Modified: freeswitch/trunk/acsite.m4
==============================================================================
--- freeswitch/trunk/acsite.m4	(original)
+++ freeswitch/trunk/acsite.m4	Fri Mar  9 15:44:13 2007
@@ -4,4 +4,4 @@
 m4_include([build/config/ax_check_compiler_flags.m4])
 m4_include([build/config/ac_gcc_archflag.m4])
 m4_include([build/config/ac_gcc_x86_cpuid.m4])
-
+m4_include([libs/apr/build/apr_common.m4])

Modified: freeswitch/trunk/configure.in
==============================================================================
--- freeswitch/trunk/configure.in	(original)
+++ freeswitch/trunk/configure.in	Fri Mar  9 15:44:13 2007
@@ -6,7 +6,8 @@
 AC_CONFIG_AUX_DIR(build/config)
 AM_INIT_AUTOMAKE(libfreeswitch,0.1)
 AC_CONFIG_SRCDIR([src/switch.c])
-AC_CONFIG_HEADER([src/include/switch_am_config.h])
+AC_CONFIG_HEADER([src/include/switch_private.h])
+
 
 AC_PREFIX_DEFAULT(/usr/local/freeswitch)
 
@@ -134,12 +135,145 @@
 
 AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
 
+# Checks for integer size
+AC_CHECK_SIZEOF(char, 1)
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(long, 4)
+AC_CHECK_SIZEOF(short, 2)
+AC_CHECK_SIZEOF(long long, 8)
+AC_TYPE_SIZE_T
+AC_CHECK_TYPE(ssize_t, int)
+
+# Checks for pointer size
+AC_CHECK_SIZEOF(void*, 4)
+
+if test "x$ac_cv_sizeof_voidp" != "x"; then
+    voidp_size=$ac_cv_sizeof_voidp
+else
+    AC_ERROR([Cannot determine size of void*])
+fi
+
+if test "$ac_cv_sizeof_short" = "2"; then
+    short_value=short
+fi
+if test "$ac_cv_sizeof_int" = "4"; then
+    int_value=int
+fi
+
+if test "$ac_cv_sizeof_int" = "8"; then
+    int64_t_fmt='#define SWITCH_INT64_T_FMT "d"'
+    uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"'
+    int64_value="int"
+    long_value=int
+elif test "$ac_cv_sizeof_long" = "8"; then
+    int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"'
+    uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"'
+    int64_value="long"
+    long_value=long
+elif test "$ac_cv_sizeof_long_long" = "8"; then
+    int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
+    uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
+    int64_value="long long"
+    long_value="long long"
+elif test "$ac_cv_sizeof_longlong" = "8"; then
+    int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"'
+    uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"'
+    int64_value="__int64"
+    long_value="__int64"
+else
+    AC_ERROR([could not detect a 64-bit integer type])
+fi
+
+if test "$ac_cv_type_size_t" = "yes"; then
+    size_t_value="size_t"
+else
+    size_t_value="switch_int32_t"
+fi
+
+if test "$ac_cv_type_ssize_t" = "yes"; then
+    ssize_t_value="ssize_t"
+else
+    ssize_t_value="switch_int32_t"
+fi
+
+APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
+
+if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
+    ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
+elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
+    ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
+else
+    ssize_t_fmt='#error Can not determine the proper size for ssize_t'
+fi
+
+APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
+
+if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
+    size_t_fmt='#define SWITCH_SIZE_T_FMT "d"'
+elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
+    size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
+else
+    size_t_fmt='#error Can not determine the proper size for size_t'
+fi
+
+# Basically, we have tried to figure out the correct format strings
+# for SWITCH types which vary between platforms, but we don't always get 
+# it right.  If you find that we don't get it right for your platform, 
+# you can override our decision below.
+# NOTE: borrowed much of this logic from apr.
+case $host in
+   s390*linux*)
+       # uniquely, the 31-bit Linux/s390 uses "unsigned long int"
+       # for size_t rather than "unsigned int":
+       size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
+       ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
+       ;;
+   *-os2*)
+       size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
+       ;;
+   *aix4*|*aix5*)
+       ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
+       size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
+       ;;
+    *beos*)
+        ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
+        size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
+        ;;
+    *apple-darwin*)
+        osver=`uname -r`
+        case $osver in
+           [0-7].*)
+              ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
+              ;;
+           *)
+              ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
+              ;;
+        esac
+        size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
+        ;;
+esac
+
+AC_SUBST(voidp_size)
+AC_SUBST(short_value)
+AC_SUBST(int_value)
+AC_SUBST(long_value)
+AC_SUBST(int64_value)
+AC_SUBST(size_t_value)
+AC_SUBST(ssize_t_value)
+AC_SUBST(int64_t_fmt) 
+AC_SUBST(uint64_t_fmt) 
+AC_SUBST(ssize_t_fmt) 
+AC_SUBST(size_t_fmt)
+
+
+
 AC_ARG_ENABLE(crash-protection,     
 	[  --enable-crash-protection         Compile with CRASH Protection],,[enable_crash_prot="no"])
 
 AM_CONDITIONAL([CRASHPROT],[test "x$enable_crash_prot" != "xno"])
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile
+                src/include/switch_am_config.h])
 
 AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
 AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])

Modified: freeswitch/trunk/libs/win32/pcre/libpcre.vcproj
==============================================================================
--- freeswitch/trunk/libs/win32/pcre/libpcre.vcproj	(original)
+++ freeswitch/trunk/libs/win32/pcre/libpcre.vcproj	Fri Mar  9 15:44:13 2007
@@ -53,7 +53,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="./"
-				PreprocessorDefinitions="_WIN32;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBPCRE_EXPORTS;SUPPORT_UTF8;SUPPORT_UCP;POSIX_MALLOC_THRESHOLD=10;NO_RECURSE;DEBUG;PCRE_DEFINITION;DLL_EXPORT"
+				PreprocessorDefinitions="_WIN32;WIN32;_DEBUG;_WINDOWS;LIBPCRE_EXPORTS;SUPPORT_UTF8;SUPPORT_UCP;POSIX_MALLOC_THRESHOLD=10;NO_RECURSE;DEBUG;PCRE_DEFINITION;PCRE_STATIC"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
@@ -97,7 +97,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\pcre\pcre.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
+				CommandLine=""
 			/>
 		</Configuration>
 		<Configuration
@@ -140,7 +140,7 @@
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="./"
-				PreprocessorDefinitions="_WIN32;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBPCRE_EXPORTS;SUPPORT_UTF8;SUPPORT_UCP;POSIX_MALLOC_THRESHOLD=10;NO_RECURSE;PCRE_DEFINITION;DLL_EXPORT"
+				PreprocessorDefinitions="_WIN32;WIN32;NDEBUG;_WINDOWS;LIBPCRE_EXPORTS;SUPPORT_UTF8;SUPPORT_UCP;POSIX_MALLOC_THRESHOLD=10;NO_RECURSE;PCRE_DEFINITION;PCRE_STATIC"
 				StringPooling="true"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
@@ -183,7 +183,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\pcre\pcre.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
+				CommandLine=""
 			/>
 		</Configuration>
 		<Configuration
@@ -285,7 +285,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\pcre\pcre.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
+				CommandLine=""
 			/>
 		</Configuration>
 		<Configuration
@@ -386,7 +386,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\pcre\pcre.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
+				CommandLine=""
 			/>
 		</Configuration>
 	</Configurations>

Modified: freeswitch/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj
==============================================================================
--- freeswitch/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj	(original)
+++ freeswitch/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj	Fri Mar  9 15:44:13 2007
@@ -44,7 +44,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="&quot;..\..\sofia-sip\win32&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\su&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\ipt&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\sresolv&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\url&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\http&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\nth&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\stun&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\features&quot;;&quot;..\..\pthreads-w32-2-7-0-release&quot;;."
-				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
@@ -123,7 +123,7 @@
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				AdditionalIncludeDirectories="&quot;..\..\sofia-sip\win32&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\su&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\ipt&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\sresolv&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\url&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\http&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\nth&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\stun&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;..\..\sofia-sip\libsofia-sip-ua\features&quot;;&quot;..\..\pthreads-w32-2-7-0-release&quot;;."
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H"
 				StringPooling="true"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
@@ -182,247 +182,742 @@
 				Name="su"
 				Filter="su*.c"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\inet_ntop.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\inet_pton.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_addrinfo.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_alloc.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_alloc_lock.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_bm.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_default_log.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_errno.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_global_log.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_localinfo.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_log.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_md5.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_os_nw.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_port.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_root.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_sprintf.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_strdup.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_strlst.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_tag_io.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_taglist.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_time.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_time0.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_timer.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_uniqueid.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_vector.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_wait.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\inet_ntop.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\inet_pton.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_addrinfo.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_alloc.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_alloc_lock.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_bm.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_default_log.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_errno.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_global_log.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_localinfo.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_log.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_md5.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_os_nw.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_port.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_root.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_sprintf.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_strdup.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_strlst.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_tag_io.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_taglist.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_time.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_time0.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_timer.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_uniqueid.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_vector.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_wait.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="ipt"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\base64.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\rc4.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\string0.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\token64.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\base64.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\rc4.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\string0.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\token64.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="url"
 				Filter="url*.c"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\url.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\url_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\url_tag_ref.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\url.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\url_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\url_tag_ref.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="features"
 				Filter="features*.c"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\features\features.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\features\features.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="bnf"
 				Filter="bnf*.c"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\bnf\bnf.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\bnf\bnf.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="msg"
 				Filter="msg*.c"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_auth.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_basic.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_date.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_generic.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_header_copy.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_header_make.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_mclass.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_mime.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_mime_table.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_parser.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_parser_util.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_tag.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_auth.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_basic.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_date.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_generic.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_header_copy.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_header_make.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_mclass.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_mime.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_mime_table.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_parser.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_parser_util.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_tag.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="clib replacement"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\memcspn.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\memmem.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\memspn.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\strcasestr.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\strtoull.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\memcspn.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\memmem.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\memspn.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\strcasestr.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\strtoull.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="sip"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_basic.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_caller_prefs.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_event.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_extra.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_feature.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_header.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_mime.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_parser.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_parser_table.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_prack.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_pref_util.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_reason.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_refer.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_security.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_session.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_status.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_tag_class.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_tag_ref.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_time.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_util.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_basic.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_caller_prefs.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_event.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_extra.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_feature.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_header.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_mime.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_parser.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_parser_table.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_prack.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_pref_util.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_reason.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_refer.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_security.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_session.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_status.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_tag_class.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_tag_ref.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_time.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_util.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="http"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_basic.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_extra.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_header.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_parser.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_status.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_tag_class.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_tag_ref.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_basic.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_extra.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_header.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_parser.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_status.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_tag_class.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\http_tag_ref.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="nth"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\nth_client.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\nth_server.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\nth_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\nth_tag_ref.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\nth_client.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\nth_server.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\nth_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\nth_tag_ref.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="sresolv"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sres.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sres_blocking.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sres_cache.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sresolv.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sres.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sres_blocking.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sres_cache.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sresolv.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="nea"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_debug.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_event.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_server.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_tag_ref.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_debug.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_event.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_server.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_tag_ref.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="iptsec"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_client.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_common.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_digest.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_module.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_module_http.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_module_sip.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_plugin.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_plugin_delayed.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_tag_ref.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\iptsec_debug.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_client.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_common.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_digest.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_module.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_module_http.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_module_sip.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_plugin.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_plugin_delayed.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\auth_tag_ref.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\iptsec_debug.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="stun"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_common.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_dns.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_internal.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_mini.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_tag_ref.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_common.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_dns.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_internal.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_mini.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\stun_tag_ref.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="nua"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_common.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_dialog.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_dialog.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_event_server.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_extension.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_message.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_notifier.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_options.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_params.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_params.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_publish.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_register.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_registrar.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_session.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_stack.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_stack.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_subnotref.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_tag_ref.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\outbound.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_common.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_dialog.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_dialog.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_event_server.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_extension.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_message.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_notifier.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_options.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_params.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_params.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_publish.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_register.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_registrar.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_session.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_stack.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_stack.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_subnotref.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\nua_tag_ref.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\outbound.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="nta"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta_check.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta_tag_ref.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sl_read_payload.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sl_utils_log.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sl_utils_print.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta_check.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta_tag_ref.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sl_read_payload.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sl_utils_log.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sl_utils_print.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="tport"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_internal.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_logging.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_stub_sigcomp.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_stub_stun.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_tag_ref.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_type_connect.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_type_tcp.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_type_udp.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_internal.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_logging.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_stub_sigcomp.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_stub_stun.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_tag_ref.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_type_connect.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_type_tcp.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_type_udp.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="sdp"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp_parse.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp_print.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp_tag_ref.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp_parse.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp_print.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sdp_tag_ref.c"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="soa"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\soa.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\sofia-sip\soa_session.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\soa_static.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\soa_tag.c"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\soa_tag_ref.c"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\soa.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\sofia-sip\soa_session.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\soa_static.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\soa_tag.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\soa_tag_ref.c"
+					>
+				</File>
 			</Filter>
 		</Filter>
 		<Filter
@@ -433,194 +928,533 @@
 				Name="su headers"
 				Filter="su*.h"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\htable.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\htable2.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\rbtree.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_addrinfo.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_alloc.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_alloc_stat.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_bm.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_config.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_debug.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_errno.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_localinfo.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_log.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_md5.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_module_debug.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_os_nw.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_port.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_source.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_strlst.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tag.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tag_class.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tag_inline.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tag_io.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tagarg.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_time.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_types.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_uniqueid.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_vector.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_wait.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\tstdef.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\htable.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\htable2.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\rbtree.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_addrinfo.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_alloc.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_alloc_stat.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_bm.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_config.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_debug.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_errno.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_localinfo.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_log.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_md5.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_module_debug.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_os_nw.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\su_port.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_source.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_strlst.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tag.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tag_class.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tag_inline.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tag_io.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_tagarg.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_time.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_types.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_uniqueid.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_vector.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\su_wait.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\su\sofia-sip\tstdef.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="win32 headers"
 				>
-				<File RelativePath="..\config.h"></File>
-				<File RelativePath="..\sofia-sip\su_configure.h"></File>
-				<File RelativePath="..\unistd.h"></File>
+				<File
+					RelativePath="..\config.h"
+					>
+				</File>
+				<File
+					RelativePath="..\sofia-sip\su_configure.h"
+					>
+				</File>
+				<File
+					RelativePath="..\unistd.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="ipt headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\sofia-sip\base64.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\sofia-sip\rc4.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\sofia-sip\string0.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\sofia-sip\token64.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\sofia-sip\base64.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\sofia-sip\rc4.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\sofia-sip\string0.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\ipt\sofia-sip\token64.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="url headers"
 				Filter="url*.h"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\sofia-sip\url.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\sofia-sip\url_tag.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\sofia-sip\url_tag_class.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\sofia-sip\url.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\sofia-sip\url_tag.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\url\sofia-sip\url_tag_class.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="features headers"
 				Filter="features*.h"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\features\sofia-sip\sofia_features.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\features\sofia-sip\sofia_features.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="bnf headers"
 				Filter="bnf*.h"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\bnf\sofia-sip\bnf.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\bnf\sofia-sip\hostdomain.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\bnf\sofia-sip\bnf.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\bnf\sofia-sip\hostdomain.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="msg headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_addr.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_bnf.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_buffer.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_date.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_header.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_internal.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_mclass.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_mclass_hash.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_mime.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_mime_protos.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_parser.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_protos.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_tag_class.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_types.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_addr.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_bnf.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_buffer.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_date.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_header.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\msg_internal.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_mclass.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_mclass_hash.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_mime.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_mime_protos.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_parser.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_protos.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_tag_class.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\msg\sofia-sip\msg_types.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="sip headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_extensions.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_hclasses.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_header.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_internal.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_parser.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_protos.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_status.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_tag.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_tag_class.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_util.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_extensions.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_hclasses.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_header.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sip_internal.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_parser.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_protos.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_status.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_tag.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_tag_class.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sip\sofia-sip\sip_util.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="http headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_hclasses.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_header.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_parser.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_protos.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_status.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_tag.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_tag_class.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_hclasses.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_header.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_parser.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_protos.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_status.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_tag.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\http\sofia-sip\http_tag_class.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="nth headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\sofia-sip\nth.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\sofia-sip\nth_tag.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\sofia-sip\nth.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nth\sofia-sip\nth_tag.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="sresolv headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-resolv\sres.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-resolv\sres_async.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-resolv\sres_cache.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-resolv\sres_record.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-sip\sresolv.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-resolv\sres.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-resolv\sres_async.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-resolv\sres_cache.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-resolv\sres_record.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sresolv\sofia-sip\sresolv.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="nea headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\sofia-sip\nea.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_debug.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\sofia-sip\nea_tag.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\sofia-sip\nea.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\nea_debug.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nea\sofia-sip\nea_tag.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="iptsec headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_client.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_digest.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_module.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_ntlm.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_plugin.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\iptsec_debug.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_client.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_digest.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_module.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_ntlm.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\sofia-sip\auth_plugin.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\iptsec\iptsec_debug.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="stun headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\sofia-sip\stun.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\sofia-sip\stun_common.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\sofia-sip\stun_tag.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\sofia-sip\stun.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\sofia-sip\stun_common.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\stun\sofia-sip\stun_tag.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="nua headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\sofia-sip\nua.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\sofia-sip\nua_tag.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\sofia-sip\nua.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nua\sofia-sip\nua_tag.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="nta headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\nta.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta_internal.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\nta_stateless.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\nta_tag.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\nta_tport.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\sl_utils.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\nta.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\nta_internal.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\nta_stateless.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\nta_tag.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\nta_tport.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\nta\sofia-sip\sl_utils.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="tport headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\sofia-sip\tport.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\sofia-sip\tport_plugins.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\sofia-sip\tport_tag.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_tls.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\sofia-sip\tport.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\sofia-sip\tport_plugins.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\sofia-sip\tport_tag.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\tport\tport_tls.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="sdp headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sofia-sip\sdp.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sofia-sip\sdp_tag.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sofia-sip\sdp.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\sdp\sofia-sip\sdp_tag.h"
+					>
+				</File>
 			</Filter>
 			<Filter
 				Name="soa headers"
 				>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\sofia-sip\soa.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\sofia-sip\soa_add.h"></File>
-				<File RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\sofia-sip\soa_tag.h"></File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\sofia-sip\soa.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\sofia-sip\soa_add.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sofia-sip\libsofia-sip-ua\soa\sofia-sip\soa_tag.h"
+					>
+				</File>
 			</Filter>
 		</Filter>
 	</Files>

Modified: freeswitch/trunk/libs/win32/sqlite/sqlite.vcproj
==============================================================================
--- freeswitch/trunk/libs/win32/sqlite/sqlite.vcproj	(original)
+++ freeswitch/trunk/libs/win32/sqlite/sqlite.vcproj	Fri Mar  9 15:44:13 2007
@@ -78,7 +78,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\sqlite\src\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;xcopy &quot;$(ProjectDir)*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;&#x0D;&#x0A;"
+				CommandLine="&#x0D;&#x0A;"
 			/>
 		</Configuration>
 		<Configuration
@@ -142,7 +142,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\sqlite\src\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;xcopy &quot;$(ProjectDir)*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;&#x0D;&#x0A;"
+				CommandLine="&#x0D;&#x0A;"
 			/>
 		</Configuration>
 		<Configuration
@@ -224,7 +224,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\sqlite\src\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;xcopy &quot;$(ProjectDir)*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;&#x0D;&#x0A;"
+				CommandLine="&#x0D;&#x0A;"
 			/>
 		</Configuration>
 		<Configuration
@@ -299,7 +299,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\sqlite\src\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;xcopy &quot;$(ProjectDir)*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;&#x0D;&#x0A;"
+				CommandLine="&#x0D;&#x0A;"
 			/>
 		</Configuration>
 	</Configurations>

Modified: freeswitch/trunk/src/include/switch.h
==============================================================================
--- freeswitch/trunk/src/include/switch.h	(original)
+++ freeswitch/trunk/src/include/switch.h	Fri Mar  9 15:44:13 2007
@@ -51,12 +51,29 @@
 #define FREESWITCH_MIB ".1.3.6.1.4.1." FREESWITCH_PEN
 #define FREESWITCH_ITAD "543"
 
-#include <switch_platform.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <stddef.h>
 #include <assert.h>
 #include <setjmp.h>
-#include <switch_apr.h>
-#include <switch_sqlite.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <limits.h>
+#include <sys/types.h>
+#include <time.h>
+#include <signal.h>
+#include <errno.h>
+
+#include <switch_platform.h>
 #include <switch_types.h>
+#include <switch_apr.h>
+
+#include <switch_core_db.h>
+#include <switch_regex.h>
 #include <switch_core.h>
 #include <switch_loadable_module.h>
 #include <switch_console.h>
@@ -74,7 +91,6 @@
 #include <switch_stun.h>
 #include <switch_log.h>
 #include <switch_xml.h>
-#include <pcre.h>
 
 
 /** \mainpage FreeSWITCH

Modified: freeswitch/trunk/src/include/switch_am_config.h.in
==============================================================================
--- freeswitch/trunk/src/include/switch_am_config.h.in	(original)
+++ freeswitch/trunk/src/include/switch_am_config.h.in	Fri Mar  9 15:44:13 2007
@@ -1,131 +1,18 @@
-/* src/include/switch_am_config.h.in.  Generated from configure.in by autoheader.  */
+#ifndef SWITCH_AM_CONFIG_H
+#define SWITCH_AM_CONFIG_H
 
-/* Enable extra debugging. */
-#undef DEBUG
 
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_DIRENT_H
+#define SWITCH_INT_16  @short_value@
+#define SWITCH_INT_32  @int_value@
+#define SWITCH_INT_64  @long_value@
+#define SWITCH_SIZE_T  @size_t_value@
+#define SWITCH_SSIZE_T @ssize_t_value@
+
+#define SWITCH_SIZEOF_VOIDP @voidp_size@
+
+ at ssize_t_fmt@
+ at size_t_fmt@
+ at int64_t_fmt@
+ at uint64_t_fmt@
 
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the `gethostname' function. */
-#undef HAVE_GETHOSTNAME
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
-   to 0 otherwise. */
-#undef HAVE_MALLOC
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `mlock' function. */
-#undef HAVE_MLOCK
-
-/* Define to 1 if you have the `mlockall' function. */
-#undef HAVE_MLOCKALL
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-#undef HAVE_NDIR_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strftime' function. */
-#undef HAVE_STRFTIME
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_DIR_H
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_NDIR_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `usleep' function. */
-#undef HAVE_USLEEP
-
-/* Define to 1 if you have the `vasprintf' function. */
-#undef HAVE_VASPRINTF
-
-/* Enable Optimization. */
-#undef OPTIMZER
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#undef RETSIGTYPE
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Little Endian */
-#undef SWITCH_BYTE_ORDER
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#undef TM_IN_SYS_TIME
-
-/* Version number of package */
-#undef VERSION
-
-/* sunpro is bad at inline */
-#undef __inline__
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
 #endif
-
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#undef size_t

Modified: freeswitch/trunk/src/include/switch_apr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_apr.h	(original)
+++ freeswitch/trunk/src/include/switch_apr.h	Fri Mar  9 15:44:13 2007
@@ -39,30 +39,6 @@
 #ifndef SWITCH_APR_H
 #define SWITCH_APR_H
 
-#include <apr.h>
-#include <apr_network_io.h>
-#include <apr_errno.h>
-#include <apr_general.h>
-#include <apr_thread_proc.h>
-#include <apr_portable.h>
-#include <apr_thread_mutex.h>
-#include <apr_thread_cond.h>
-#include <apr_thread_rwlock.h>
-#include <apr_file_io.h>
-#include <apr_poll.h>
-#include <apr_dso.h>
-#include <apr_hash.h>
-#include <apr_strings.h>
-#include <apr_network_io.h>
-#include <apr_poll.h>
-#include <apr_queue.h>
-#include <apr_uuid.h>
-#include <apr_strmatch.h>
-#define APR_WANT_STDIO
-#define APR_WANT_STRFUNC
-#include <apr_want.h>
-#include <apr_env.h>
-
 SWITCH_BEGIN_EXTERN_C
 
 /*
@@ -76,1198 +52,452 @@
  * @{
  */	
 
-#define SWITCH_SIZE_T_FMT APR_SIZE_T_FMT
-typedef apr_size_t swtich_size_t;
-typedef apr_int16_t switch_int16_t;
-
 /**
- * @defgroup switch_file_io File I/O Handling Functions
+ * @defgroup switch_memory_pool Memory Pool Functions
  * @ingroup switch_apr 
  * @{
  */
+/** The fundamental pool type */
+typedef struct apr_pool_t switch_memory_pool_t;
 
-typedef apr_size_t switch_size_t;
-
-/** Structure for referencing files. */
-typedef apr_file_t switch_file_t;
-
-#define SWITCH_SO_LINGER APR_SO_LINGER
-#define SWITCH_SO_KEEPALIVE APR_SO_KEEPALIVE
-#define SWITCH_SO_DEBUG APR_SO_DEBUG
-#define SWITCH_SO_NONBLOCK APR_SO_NONBLOCK
-#define SWITCH_SO_REUSEADDR APR_SO_REUSEADDR
-#define SWITCH_SO_SNDBUF APR_SO_SNDBUF
-#define SWITCH_SO_RCVBUF APR_SO_RCVBUF
-#define SWITCH_SO_DISCONNECTED APR_SO_DISCONNECTED
 
 /**
- * @defgroup switch_file_permissions File Permissions flags 
- * @ingroup switch_file_io
- * @{
+ * Clear all memory in the pool and run all the cleanups. This also destroys all
+ * subpools.
+ * @param p The pool to clear
+ * @remark This does not actually free the memory, it just allows the pool
+ *         to re-use this memory for the next allocation.
+ * @see apr_pool_destroy()
  */
-    
-#define SWITCH_FPROT_USETID APR_FPROT_USETID		/**< Set user id */
-#define SWITCH_FPROT_UREAD APR_FPROT_UREAD			/**< Read by user */
-#define SWITCH_FPROT_UWRITE APR_FPROT_UWRITE		/**< Write by user */
-#define SWITCH_FPROT_UEXECUTE APR_FPROT_UEXECUTE	/**< Execute by user */
-
-#define SWITCH_FPROT_GSETID APR_FPROT_GSETID		/**< Set group id */
-#define SWITCH_FPROT_GREAD APR_FPROT_GREAD			/**< Read by group */
-#define SWITCH_FPROT_GWRITE APR_FPROT_GWRITE		/**< Write by group */
-#define SWITCH_FPROT_GEXECUTE APR_FPROT_GEXECUTE	/**< Execute by group */
-
-#define SWITCH_FPROT_WSETID APR_FPROT_U WSETID
-#define SWITCH_FPROT_WREAD APR_FPROT_WREAD			/**< Read by others */
-#define SWITCH_FPROT_WWRITE APR_FPROT_WWRITE		/**< Write by others */
-#define SWITCH_FPROT_WEXECUTE APR_FPROT_WEXECUTE	/**< Execute by others */
+SWITCH_DECLARE(void) switch_pool_clear(switch_memory_pool_t *p);
 
-#define SWITCH_FPROT_OS_DEFAULT APR_FPROT_OS_DEFAULT	/**< use OS's default permissions */
-
-/* additional permission flags for apr_file_copy  and apr_file_append */
-#define SWITCH_FPROT_FILE_SOURCE_PERMS APR_FPROT_FILE_SOURCE_PERMS	/**< Copy source file's permissions */
 /** @} */
 
 /**
- * @defgroup switch_file_open_flags File Open Flags/Routines
- * @ingroup switch_file_io
+ * @defgroup switch_dso Dynamic Object Handling Routines
+ * @ingroup switch_apr 
  * @{
  */
-#define SWITCH_FOPEN_READ APR_FOPEN_READ							/**< Open the file for reading */
-#define SWITCH_FOPEN_WRITE APR_FOPEN_WRITE							/**< Open the file for writing */
-#define SWITCH_FOPEN_CREATE APR_FOPEN_CREATE						/**< Create the file if not there */
-#define SWITCH_FOPEN_APPEND APR_FOPEN_APPEND						/**< Append to the end of the file */
-#define SWITCH_FOPEN_TRUNCATE APR_FOPEN_TRUNCATE					/**< Open the file and truncate to 0 length */
-#define SWITCH_FOPEN_BINARY APR_FOPEN_BINARY						/**< Open the file in binary mode */
-#define SWITCH_FOPEN_EXCL APR_FOPEN_EXCL							/**< Open should fail if APR_CREATE and file exists. */
-#define SWITCH_FOPEN_BUFFERED APR_FOPEN_BUFFERED					/**< Open the file for buffered I/O */
-#define SWITCH_FOPEN_DELONCLOSE APR_FOPEN_DELONCLOSE				/**< Delete the file after close */
-#define SWITCH_FOPEN_XTHREAD APR_FOPEN_XTHREAD						/**< Platform dependent tag to open the file for use across multiple threads */
-#define SWITCH_FOPEN_SHARELOCK APR_FOPEN_SHARELOCK					/**< Platform dependent support for higher level locked read/write access to support writes across process/machines */
-#define SWITCH_FOPEN_NOCLEANUP APR_FOPEN_NOCLEANUP					/**< Do not register a cleanup when the file is opened */
-#define SWITCH_FOPEN_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED	/**< Advisory flag that this file should support apr_socket_sendfile operation */
-#define SWITCH_FOPEN_LARGEFILE APR_FOPEN_LAREFILE					/**< Platform dependent flag to enable large file support */
-/** @} */
-
-/**
- * Open the specified file.
- * @param newf The opened file descriptor.
- * @param fname The full path to the file (using / on all systems)
- * @param flag Or'ed value of:
- * <PRE>
- *         SWITCH_FOPEN_READ				open for reading
- *         SWITCH_FOPEN_WRITE				open for writing
- *         SWITCH_FOPEN_CREATE				create the file if not there
- *         SWITCH_FOPEN_APPEND				file ptr is set to end prior to all writes
- *         SWITCH_FOPEN_TRUNCATE			set length to zero if file exists
- *         SWITCH_FOPEN_BINARY				not a text file (This flag is ignored on 
- *											UNIX because it has no meaning)
- *         SWITCH_FOPEN_BUFFERED			buffer the data.  Default is non-buffered
- *         SWITCH_FOPEN_EXCL				return error if APR_CREATE and file exists
- *         SWITCH_FOPEN_DELONCLOSE			delete the file after closing.
- *         SWITCH_FOPEN_XTHREAD				Platform dependent tag to open the file
- *											for use across multiple threads
- *         SWITCH_FOPEN_SHARELOCK			Platform dependent support for higher
- *											level locked read/write access to support
- *											writes across process/machines
- *         SWITCH_FOPEN_NOCLEANUP			Do not register a cleanup with the pool 
- *											passed in on the <EM>pool</EM> argument (see below).
- *											The apr_os_file_t handle in apr_file_t will not
- *											be closed when the pool is destroyed.
- *         SWITCH_FOPEN_SENDFILE_ENABLED	Open with appropriate platform semantics
- *											for sendfile operations.  Advisory only,
- *											apr_socket_sendfile does not check this flag.
- * </PRE>
- * @param perm Access permissions for file.
- * @param pool The pool to use.
- * @remark If perm is SWITCH_FPROT_OS_DEFAULT and the file is being created,
- * appropriate default permissions will be used.
- */
-DoxyDefine(apr_status_t switch_file_open(switch_file_t **newf, const char *fname, apr_int32_t flag, switch_fileperms_t perm, switch_pool_t *pool);)
-#define switch_file_open apr_file_open
-#define switch_file_seek apr_file_seek
-
 /**
- * Close the specified file.
- * @param file The file descriptor to close.
+ * Structure for referencing dynamic objects
  */
-DoxyDefine(apr_status_t switch_file_close(switch_file_t *file);)
-#define switch_file_close apr_file_close
+typedef struct apr_dso_handle_t       switch_dso_handle_t;
 
 /**
- * Establish a lock on the specified, open file. The lock may be advisory
- * or mandatory, at the discretion of the platform. The lock applies to
- * the file as a whole, rather than a specific range. Locks are established
- * on a per-thread/process basis; a second lock by the same thread will not
- * block.
- * @param thefile The file to lock.
- * @param type The type of lock to establish on the file.
+ * Structure for referencing symbols from dynamic objects
  */
-DoxyDefine(apr_status_t apr_file_lock(switch_file_t *thefile, int type);)
-#define switch_file_lock apr_file_lock
+typedef void *                        switch_dso_handle_sym_t;
 
 /**
- * Remove any outstanding locks on the file.
- * @param thefile The file to unlock.
+ * Load a DSO library.
+ * @param res_handle Location to store new handle for the DSO.
+ * @param path Path to the DSO library
+ * @param ctx Pool to use.
+ * @bug We aught to provide an alternative to RTLD_GLOBAL, which
+ * is the only supported method of loading DSOs today.
  */
-DoxyDefine(apr_status_t apr_file_unlock(switch_file_t *thefile);)
-#define switch_file_unlock apr_file_unlock
+SWITCH_DECLARE(switch_status_t) switch_dso_load(switch_dso_handle_t **res_handle, 
+                                       const char *path, switch_memory_pool_t *ctx);
 
 /**
- * Delete the specified file.
- * @param path The full path to the file (using / on all systems)
- * @param pool The pool to use.
- * @remark If the file is open, it won't be removed until all
- * instances are closed.
+ * Close a DSO library.
+ * @param handle handle to close.
  */
-DoxyDefine(apr_status_t apr_file_remove(const char *path, apr_pool_t *pool);)
-#define switch_file_remove apr_file_remove
+SWITCH_DECLARE(switch_status_t) switch_dso_unload(switch_dso_handle_t *handle);
 
 /**
- * Read data from the specified file.
- * @param thefile The file descriptor to read from.
- * @param buf The buffer to store the data to.
- * @param nbytes On entry, the number of bytes to read; on exit, the number
- * of bytes read.
- *
- * @remark apr_file_read will read up to the specified number of
- * bytes, but never more.  If there isn't enough data to fill that
- * number of bytes, all of the available data is read.  The third
- * argument is modified to reflect the number of bytes read.  If a
- * char was put back into the stream via ungetc, it will be the first
- * character returned.
- *
- * @remark It is not possible for both bytes to be read and an APR_EOF
- * or other error to be returned.  APR_EINTR is never returned.
+ * Load a symbol from a DSO handle.
+ * @param ressym Location to store the loaded symbol
+ * @param handle handle to load the symbol from.
+ * @param symname Name of the symbol to load.
  */
-DoxyDefine(apr_status_t switch_file_read(switch_file_t *thefile, void *buf, switch_size_t *nbytes);)
-#define switch_file_read apr_file_read
+SWITCH_DECLARE(switch_status_t) switch_dso_sym(switch_dso_handle_sym_t *ressym, 
+                                      switch_dso_handle_t *handle,
+                                      const char *symname);
 
 /**
- * Write data to the specified file.
- * @param thefile The file descriptor to write to.
- * @param buf The buffer which contains the data.
- * @param nbytes On entry, the number of bytes to write; on exit, the number 
- *               of bytes written.
- *
- * @remark apr_file_write will write up to the specified number of
- * bytes, but never more.  If the OS cannot write that many bytes, it
- * will write as many as it can.  The third argument is modified to
- * reflect the * number of bytes written.
- *
- * @remark It is possible for both bytes to be written and an error to
- * be returned.  APR_EINTR is never returned.
+ * Report more information when a DSO function fails.
+ * @param dso The dso handle that has been opened
+ * @param buf Location to store the dso error
+ * @param bufsize The size of the provided buffer
  */
-DoxyDefine(apr_status_t switch_file_write(switch_file_t *thefile, const void *buf, switch_size_t *nbytes);)
-#define switch_file_write apr_file_write
+SWITCH_DECLARE(const char *) switch_dso_error(switch_dso_handle_t *dso, char *buf, size_t bufsize);
 
 /** @} */
 
 /**
- * @defgroup switch_thread_cond Condition Variable Routines
- * @ingroup switch_apr 
+ * @defgroup switch_string String Handling funcions
+ * @ingroup switch_apr
  * @{
  */
 
-/**
- * Note: destroying a condition variable (or likewise, destroying or
- * clearing the pool from which a condition variable was allocated) if
- * any threads are blocked waiting on it gives undefined results.
- */
+#ifndef snprintf
+#define snprintf switch_snprintf
+#endif
 
-/** Opaque structure for thread condition variables */
-typedef apr_thread_cond_t switch_thread_cond_t;
+SWITCH_DECLARE(int) switch_snprintf(char *buf, switch_size_t len, const char *format, ...);
+
+SWITCH_DECLARE(int) switch_vasprintf(char **buf, const char *format, va_list ap);
+
+SWITCH_DECLARE(char *) switch_copy_string(char *dst, const char *src, switch_size_t dst_size);
+
+/** @} */
 
 /**
- * Create and initialize a condition variable that can be used to signal
- * and schedule threads in a single process.
- * @param cond the memory address where the newly created condition variable
- *        will be stored.
- * @param pool the pool from which to allocate the mutex.
+ * @defgroup apr_hash Hash Tables
+ * @ingroup switch_apr
+ * @{
  */
-DoxyDefine(apr_status_t switch_thread_cond_create(switch_thread_cond_t **cond, switch_pool_t *pool);)
-#define switch_thread_cond_create apr_thread_cond_create
-
-typedef apr_os_thread_t switch_thread_id_t;
 
-#define switch_thread_data_set apr_thread_data_set
-#define switch_thread_data_get apr_thread_data_get
-#define switch_thread_self apr_os_thread_current
-#define switch_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \
-                                     + (apr_time_t)(usec))
+/** Abstract type for hash tables. */
+typedef struct apr_hash_t switch_hash_t;
 
+/** Abstract type for scanning hash tables. */
+typedef struct apr_hash_index_t switch_hash_index_t;
 
 /**
- * Put the active calling thread to sleep until signaled to wake up. Each
- * condition variable must be associated with a mutex, and that mutex must
- * be locked before  calling this function, or the behavior will be
- * undefined. As the calling thread is put to sleep, the given mutex
- * will be simultaneously released; and as this thread wakes up the lock
- * is again simultaneously acquired.
- * @param cond the condition variable on which to block.
- * @param mutex the mutex that must be locked upon entering this function,
- *        is released while the thread is asleep, and is again acquired before
- *        returning from this function.
+ * When passing a key to switch_hashfunc_default, this value can be
+ * passed to indicate a string-valued key, and have the length compute automatically.
+ *
  */
-DoxyDefine(apr_status_t switch_thread_cond_wait(switch_thread_cond_t *cond, switch_thread_mutex_t *mutex);)
-#define switch_thread_cond_wait apr_thread_cond_wait
+#define SWITCH_HASH_KEY_STRING     (-1)
 
 /**
- * Put the active calling thread to sleep until signaled to wake up or
- * the timeout is reached. Each condition variable must be associated
- * with a mutex, and that mutex must be locked before calling this
- * function, or the behavior will be undefined. As the calling thread
- * is put to sleep, the given mutex will be simultaneously released;
- * and as this thread wakes up the lock is again simultaneously acquired.
- * @param cond the condition variable on which to block.
- * @param mutex the mutex that must be locked upon entering this function,
- *        is released while the thread is asleep, and is again acquired before
- *        returning from this function.
- * @param timeout The amount of time in microseconds to wait. This is 
- *        a maximum, not a minimum. If the condition is signaled, we 
- *        will wake up before this time, otherwise the error APR_TIMEUP
- *        is returned.
+ * Start iterating over the entries in a hash table.
+ * @param p The pool to allocate the switch_hash_index_t iterator. If this
+ *          pool is NULL, then an internal, non-thread-safe iterator is used.
+ * @param ht The hash table
+ * @remark  There is no restriction on adding or deleting hash entries during
+ * an iteration (although the results may be unpredictable unless all you do
+ * is delete the current entry) and multiple iterations can be in
+ * progress at the same time.
+
  */
-DoxyDefine(apr_status_t switch_thread_cond_timedwait(switch_thread_cond_t *cond, switch_thread_mutex_t *mutex, switch_interval_time_t timeout);)
-#define switch_thread_cond_timedwait apr_thread_cond_timedwait
+SWITCH_DECLARE(switch_hash_index_t *) switch_hash_first(switch_memory_pool_t *p, switch_hash_t *ht);
 
 /**
- * Signals a single thread, if one exists, that is blocking on the given
- * condition variable. That thread is then scheduled to wake up and acquire
- * the associated mutex. Although it is not required, if predictable scheduling
- * is desired, that mutex must be locked while calling this function.
- * @param cond the condition variable on which to produce the signal.
+ * Continue iterating over the entries in a hash table.
+ * @param hi The iteration state
+ * @return a pointer to the updated iteration state.  NULL if there are no more  
+ *         entries.
  */
-DoxyDefine(apr_status_t switch_thread_cond_signal(switch_thread_cond_t *cond);)
-#define switch_thread_cond_signal apr_thread_cond_signal
+SWITCH_DECLARE(switch_hash_index_t *) switch_hash_next(switch_hash_index_t *ht);
 
 /**
- * Signals all threads blocking on the given condition variable.
- * Each thread that was signaled is then scheduled to wake up and acquire
- * the associated mutex. This will happen in a serialized manner.
- * @param cond the condition variable on which to produce the broadcast.
+ * Get the current entry's details from the iteration state.
+ * @param hi The iteration state
+ * @param key Return pointer for the pointer to the key.
+ * @param klen Return pointer for the key length.
+ * @param val Return pointer for the associated value.
+ * @remark The return pointers should point to a variable that will be set to the
+ *         corresponding data, or they may be NULL if the data isn't interesting.
  */
-DoxyDefine(apr_status_t switch_thread_cond_broadcast(switch_thread_cond_t *cond);)
-#define switch_thread_cond_broadcast apr_thread_cond_broadcast
+SWITCH_DECLARE(void) switch_hash_this(switch_hash_index_t *hi, const void **key, switch_ssize_t *klen, void **val);
 
 /**
- * Destroy the condition variable and free the associated memory.
- * @param cond the condition variable to destroy.
+ * The default hash function.
+ * @param key pointer to the key.
+ * @param klen the key length.
+ * 
  */
-DoxyDefine(apr_status_t switch_thread_cond_destroy(switch_thread_cond_t *cond);)
-#define switch_thread_cond_destroy apr_thread_cond_destroy
+SWITCH_DECLARE(unsigned int) switch_hashfunc_default(const char *key, switch_ssize_t *klen);
 
-/** @} */
+SWITCH_DECLARE(switch_memory_pool_t *) switch_hash_pool_get(switch_hash_t *ht);
 
-/**
- * @defgroup switch_thread_proc Threads and Process Functions
+/** @} */
+ /**
+ * @defgroup switch_time Time Routines
  * @ingroup switch_apr 
  * @{
  */
 
-/** Opaque Thread structure. */
-typedef apr_thread_t switch_thread_t;
+ /** number of microseconds since 00:00:00 january 1, 1970 UTC */
+typedef int64_t switch_time_t;
 
-/** Opaque Thread attributes structure. */
-typedef apr_threadattr_t switch_threadattr_t;
+ /** number of microseconds in the interval */
+typedef int64_t switch_interval_time_t;
 
 /**
- * The prototype for any APR thread worker functions.
- * typedef void *(SWITCH_THREAD_FUNC *switch_thread_start_t)(switch_thread_t*, void*);
+ * a structure similar to ANSI struct tm with the following differences:
+ *  - tm_usec isn't an ANSI field
+ *  - tm_gmtoff isn't an ANSI field (it's a bsdism)
  */
-#define SWITCH_THREAD_FUNC APR_THREAD_FUNC
-typedef apr_thread_start_t switch_thread_start_t;
+typedef struct switch_time_exp_t {
+    /** microseconds past tm_sec */
+    int32_t tm_usec;
+    /** (0-61) seconds past tm_min */
+    int32_t tm_sec;
+    /** (0-59) minutes past tm_hour */
+    int32_t tm_min;
+    /** (0-23) hours past midnight */
+    int32_t tm_hour;
+    /** (1-31) day of the month */
+    int32_t tm_mday;
+    /** (0-11) month of the year */
+    int32_t tm_mon;
+    /** year since 1900 */
+    int32_t tm_year;
+    /** (0-6) days since sunday */
+    int32_t tm_wday;
+    /** (0-365) days since jan 1 */
+    int32_t tm_yday;
+    /** daylight saving time */
+    int32_t tm_isdst;
+    /** seconds east of UTC */
+    int32_t tm_gmtoff;
+} switch_time_exp_t;
 
-#define switch_threadattr_stacksize_set apr_threadattr_stacksize_set
+SWITCH_DECLARE(switch_time_t) switch_time_make(switch_time_t sec, int32_t usec);
 
 /**
- * Create and initialize a new threadattr variable
- * @param new_attr The newly created threadattr.
- * @param cont The pool to use
+ * @return the current time
  */
-DoxyDefine(apr_status_t switch_threadattr_create(switch_threadattr_t **new_attr, switch_pool_t *cont);)
-#define switch_threadattr_create apr_threadattr_create
+SWITCH_DECLARE(switch_time_t) switch_time_now(void);
 
 /**
- * Set if newly created threads should be created in detached state.
- * @param attr The threadattr to affect 
- * @param on Non-zero if detached threads should be created.
+ * Convert time value from human readable format to a numeric apr_time_t that
+ * always represents GMT
+ * @param result the resulting imploded time
+ * @param input the input exploded time
  */
-DoxyDefine(apr_status_t switch_threadattr_detach_set(switch_threadattr_t *attr, switch_int32_t on);)
-#define switch_threadattr_detach_set apr_threadattr_detach_set
+SWITCH_DECLARE(switch_status_t) switch_time_exp_gmt_get(switch_time_t *result, switch_time_exp_t *input);
 
 /**
- * Create a new thread of execution
- * @param new_thread The newly created thread handle.
- * @param attr The threadattr to use to determine how to create the thread
- * @param func The function to start the new thread in
- * @param data Any data to be passed to the starting function
- * @param cont The pool to use
+ * formats the exploded time according to the format specified
+ * @param s string to write to
+ * @param retsize The length of the returned string
+ * @param max The maximum length of the string
+ * @param format The format for the time string
+ * @param tm The time to convert
  */
-DoxyDefine(apr_status_t switch_thread_create(switch_thread_t **new_thread, switch_threadattr_t *attr, switch_thread_start_t func, void *data, switch_pool_t *cont);)
-#define switch_thread_create apr_thread_create
-
-/** @} */
+SWITCH_DECLARE(switch_status_t) switch_strftime(char *s,
+												switch_size_t *retsize,
+												switch_size_t max,
+												const char *format,
+												switch_time_exp_t *tm);
 
 /**
- * @defgroup switch_network_io Network Routines
- * @ingroup switch_apr 
- * @{
+ * switch_rfc822_date formats dates in the RFC822
+ * format in an efficient manner.  It is a fixed length
+ * format which requires the indicated amount of storage,
+ * including the trailing NUL terminator.
+ * @param date_str String to write to.
+ * @param t the time to convert 
  */
+SWITCH_DECLARE(switch_status_t) switch_rfc822_date(char *date_str, switch_time_t t);
 
-/** descriptor refers to a socket */
-#define SWITCH_POLL_SOCKET APR_POLL_SOCKET
-
-/** @def SWITCH_UNSPEC
- * Let the system decide which address family to use
+/**
+ * convert a time to its human readable components in GMT timezone
+ * @param result the exploded time
+ * @param input the time to explode
  */
-#define SWITCH_UNSPEC APR_UNSPEC 
-
-/** A structure to represent sockets */
-typedef apr_socket_t switch_socket_t;
-
-/** Freeswitch's socket address type, used to ensure protocol independence */
-typedef apr_sockaddr_t switch_sockaddr_t;
-
-typedef apr_port_t switch_port_t;
-/* function definitions */
+SWITCH_DECLARE(switch_status_t) switch_time_exp_gmt(switch_time_exp_t *result, switch_time_t input);
 
 /**
- * Create a socket.
- * @param new_sock The new socket that has been set up.
- * @param family The address family of the socket (e.g., APR_INET).
- * @param type The type of the socket (e.g., SOCK_STREAM).
- * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP).
- * @param cont The pool to use
+ * Convert time value from human readable format to a numeric apr_time_t 
+ * e.g. elapsed usec since epoch
+ * @param result the resulting imploded time
+ * @param input the input exploded time
  */
-DoxyDefine(apr_status_t switch_socket_create(switch_socket_t **new_sock, int family, int type, int protocol, switch_pool_t *cont);)
-#define switch_socket_create apr_socket_create
+SWITCH_DECLARE(switch_status_t) switch_time_exp_get(switch_time_t *result, switch_time_exp_t *input);
 
 /**
- * Shutdown either reading, writing, or both sides of a socket.
- * @param thesocket The socket to close 
- * @param how How to shutdown the socket.  One of:
- * <PRE>
- *            APR_SHUTDOWN_READ         no longer allow read requests
- *            APR_SHUTDOWN_WRITE        no longer allow write requests
- *            APR_SHUTDOWN_READWRITE    no longer allow read or write requests 
- * </PRE>
- * @see apr_shutdown_how_e
- * @remark This does not actually close the socket descriptor, it just
- *      controls which calls are still valid on the socket.
+ * convert a time to its human readable components in local timezone
+ * @param result the exploded time
+ * @param input the time to explode
  */
-DoxyDefine(apr_status_t switch_socket_shutdown(switch_socket_t *thesocket, switch_shutdown_how_e how);)
-#define switch_socket_shutdown apr_socket_shutdown
+SWITCH_DECLARE(switch_status_t) switch_time_exp_lt(switch_time_exp_t *result, switch_time_t input);
 
 /**
- * Close a socket.
- * @param thesocket The socket to close 
+ * Sleep for the specified number of micro-seconds.
+ * @param t desired amount of time to sleep.
+ * @warning May sleep for longer than the specified time. 
  */
-DoxyDefine(apr_status_t switch_socket_close(switch_socket_t *thesocket);)
-#define switch_socket_close apr_socket_close
+SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t);
 
-/**
- * Bind the socket to its associated port
- * @param sock The socket to bind 
- * @param sa The socket address to bind to
- * @remark This may be where we will find out if there is any other process
- *      using the selected port.
- */
-DoxyDefine(apr_status_t switch_socket_bind(switch_socket_t *sock, switch_sockaddr_t *sa);)
-#define switch_socket_bind apr_socket_bind
+/** @} */
 
 /**
- * Listen to a bound socket for connections.
- * @param sock The socket to listen on 
- * @param backlog The number of outstanding connections allowed in the sockets
- *                listen queue.  If this value is less than zero, the listen
- *                queue size is set to zero.  
+ * @defgroup switch_thread_mutex Thread Mutex Routines
+ * @ingroup switch_apr
+ * @{
  */
-DoxyDefine(apr_status_t switch_socket_listen(switch_socket_t *sock, switch_int32_t backlog);)
-#define switch_socket_listen apr_socket_listen
 
-/**
- * Accept a new connection request
- * @param new_sock A copy of the socket that is connected to the socket that
- *                 made the connection request.  This is the socket which should
- *                 be used for all future communication.
- * @param sock The socket we are listening on.
- * @param connection_pool The pool for the new socket.
- */
-DoxyDefine(apr_status_t switch_socket_accept(switch_socket_t **new_sock, switch_socket_t *sock, switch_pool_t *connection_pool);)
-#define switch_socket_accept apr_socket_accept
+/** Opaque thread-local mutex structure */
+typedef struct apr_thread_mutex_t switch_mutex_t;
 
-/**
- * Issue a connection request to a socket either on the same machine 
- * or a different one.
- * @param sock The socket we wish to use for our side of the connection 
- * @param sa The address of the machine we wish to connect to.
- */
-DoxyDefine(apr_status_t switch_socket_connect(switch_socket_t *sock, switch_sockaddr_t *sa);)
-#define switch_socket_connect apr_socket_connect
+/** Lock Flags */
+#define SWITCH_MUTEX_DEFAULT	0x0	/**< platform-optimal lock behavior */
+#define SWITCH_MUTEX_NESTED		0x1	/**< enable nested (recursive) locks */
+#define	SWITCH_MUTEX_UNNESTED	0x2	/**< disable nested locks */
 
 /**
- * Create apr_sockaddr_t from hostname, address family, and port.
- * @param sa The new apr_sockaddr_t.
- * @param hostname The hostname or numeric address string to resolve/parse, or
- *               NULL to build an address that corresponds to 0.0.0.0 or ::
- * @param family The address family to use, or APR_UNSPEC if the system should 
- *               decide.
- * @param port The port number.
- * @param flags Special processing flags:
+ * Create and initialize a mutex that can be used to synchronize threads.
+ * @param lock the memory address where the newly created mutex will be
+ *        stored.
+ * @param flags Or'ed value of:
  * <PRE>
- *       APR_IPV4_ADDR_OK          first query for IPv4 addresses; only look
- *                                 for IPv6 addresses if the first query failed;
- *                                 only valid if family is APR_UNSPEC and hostname
- *                                 isn't NULL; mutually exclusive with
- *                                 APR_IPV6_ADDR_OK
- *       APR_IPV6_ADDR_OK          first query for IPv6 addresses; only look
- *                                 for IPv4 addresses if the first query failed;
- *                                 only valid if family is APR_UNSPEC and hostname
- *                                 isn't NULL and APR_HAVE_IPV6; mutually exclusive
- *                                 with APR_IPV4_ADDR_OK
+ *           SWITCH_THREAD_MUTEX_DEFAULT   platform-optimal lock behavior.
+ *           SWITCH_THREAD_MUTEX_NESTED    enable nested (recursive) locks.
+ *           SWITCH_THREAD_MUTEX_UNNESTED  disable nested locks (non-recursive).
  * </PRE>
- * @param p The pool for the apr_sockaddr_t and associated storage.
- */
-DoxyDefine(apr_status_t switch_sockaddr_info_get(switch_sockaddr_t **sa,
-									  const char *hostname,
-									  switch_int32_t family,
-									  switch_port_t port,
-									  switch_int32_t flags,
-									  switch_pool_t *p);)
-#define switch_sockaddr_info_get apr_sockaddr_info_get
-
-/**
- * Look up the host name from an apr_sockaddr_t.
- * @param hostname The hostname.
- * @param sa The apr_sockaddr_t.
- * @param flags Special processing flags.
- */
-DoxyDefine(apr_status_t switch_getnameinfo(char **hostname,
-									switch_sockaddr_t *sa,
-									switch_int32_t flags);)
-#define switch_getnameinfo apr_getnameinfo
-
-/**
- * Parse hostname/IP address with scope id and port.
- *
- * Any of the following strings are accepted:
- *   8080                  (just the port number)
- *   www.apache.org        (just the hostname)
- *   www.apache.org:8080   (hostname and port number)
- *   [fe80::1]:80          (IPv6 numeric address string only)
- *   [fe80::1%eth0]        (IPv6 numeric address string and scope id)
- *
- * Invalid strings:
- *                         (empty string)
- *   [abc]                 (not valid IPv6 numeric address string)
- *   abc:65536             (invalid port number)
+ * @param pool the pool from which to allocate the mutex.
+ * @warning Be cautious in using SWITCH_THREAD_MUTEX_DEFAULT.  While this is the
+ * most optimial mutex based on a given platform's performance charateristics,
+ * it will behave as either a nested or an unnested lock.
  *
- * @param addr The new buffer containing just the hostname.  On output, *addr 
- *             will be NULL if no hostname/IP address was specfied.
- * @param scope_id The new buffer containing just the scope id.  On output, 
- *                 *scope_id will be NULL if no scope id was specified.
- * @param port The port number.  On output, *port will be 0 if no port was 
- *             specified.
- *             ### FIXME: 0 is a legal port (per RFC 1700). this should
- *             ### return something besides zero if the port is missing.
- * @param str The input string to be parsed.
- * @param p The pool from which *addr and *scope_id are allocated.
- * @remark If scope id shouldn't be allowed, check for scope_id != NULL in 
- *         addition to checking the return code.  If addr/hostname should be 
- *         required, check for addr == NULL in addition to checking the 
- *         return code.
- */
-DoxyDefine(apr_status_t switch_parse_addr_port(char **addr,
-									char **scope_id,
-									switch_port_t *port,
-									const char *str,
-									switch_pool_t *p);)
-#define switch_parse_addr_port apr_parse_addr_port
-
-/**
- * Get name of the current machine
- * @param buf A buffer to store the hostname in.
- * @param len The maximum length of the hostname that can be stored in the
- *            buffer provided.  The suggested length is APRMAXHOSTLEN + 1.
- * @param cont The pool to use.
- * @remark If the buffer was not large enough, an error will be returned.
- */
-DoxyDefine(apr_status_t switch_gethostname(char *buf, int len, switch_pool_t *cont);)
-#define switch_gethostname apr_gethostname
-
-/**
- * Return the data associated with the current socket
- * @param data The user data associated with the socket.
- * @param key The key to associate with the user data.
- * @param sock The currently open socket.
- */
-DoxyDefine(apr_status_t switch_socket_data_get(void **data, const char *key,
-										switch_socket_t *sock);)
-#define switch_socket_data_get apr_socket_data_get
-
-/**
- * Set the data associated with the current socket.
- * @param sock The currently open socket.
- * @param data The user data to associate with the socket.
- * @param key The key to associate with the data.
- * @param cleanup The cleanup to call when the socket is destroyed.
- */
-DoxyDefine(apr_status_t switch_socket_data_set(switch_socket_t *sock, 
-									void *data,
-									const char *key,
-									switch_status_t (*cleanup)(void*));)
-#define switch_socket_data_set apr_socket_data_set
+*/
+SWITCH_DECLARE(switch_status_t) switch_mutex_init(switch_mutex_t **lock,
+												unsigned int flags,
+												switch_memory_pool_t *pool);
+
 
 /**
- * Send data over a network.
- * @param sock The socket to send the data over.
- * @param buf The buffer which contains the data to be sent. 
- * @param len On entry, the number of bytes to send; on exit, the number
- *            of bytes sent.
- * @remark
- * <PRE>
- * This functions acts like a blocking write by default.  To change 
- * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
- * socket option.
- *
- * It is possible for both bytes to be sent and an error to be returned.
- *
- * APR_EINTR is never returned.
- * </PRE>
+ * Destroy the mutex and free the memory associated with the lock.
+ * @param lock the mutex to destroy.
  */
-DoxyDefine(apr_status_t switch_socket_send(switch_socket_t *sock,
-								const char *buf,
-								apr_size_t *len);)
-#define switch_socket_send apr_socket_send
+SWITCH_DECLARE(switch_status_t) switch_mutex_destroy(switch_mutex_t *lock);
 
 /**
- * Send multiple packets of data over a network.
- * @param sock The socket to send the data over.
- * @param vec The array of iovec structs containing the data to send 
- * @param nvec The number of iovec structs in the array
- * @param len Receives the number of bytes actually written
- * @remark
- * <PRE>
- * This functions acts like a blocking write by default.  To change 
- * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
- * socket option.
- * The number of bytes actually sent is stored in argument 3.
- *
- * It is possible for both bytes to be sent and an error to be returned.
- *
- * APR_EINTR is never returned.
- * </PRE>
+ * Acquire the lock for the given mutex. If the mutex is already locked,
+ * the current thread will be put to sleep until the lock becomes available.
+ * @param lock the mutex on which to acquire the lock.
  */
-DoxyDefine(apr_status_t switch_socket_sendv(switch_socket_t *sock, 
-                                           const struct iovec *vec,
-                                           apr_int32_t nvec, apr_size_t *len);)
-#define switch_socket_sendv apr_socket_sendv
+SWITCH_DECLARE(switch_status_t) switch_mutex_lock(switch_mutex_t *lock);
 
 /**
- * @param sock The socket to send from
- * @param where The apr_sockaddr_t describing where to send the data
- * @param flags The flags to use
- * @param buf  The data to send
- * @param len  The length of the data to send
+ * Release the lock for the given mutex.
+ * @param lock the mutex from which to release the lock.
  */
-DoxyDefine(apr_status_t switch_socket_sendto(switcj_socket_t *sock, 
-								  apr_sockaddr_t *where,
-								  apr_int32_t flags,
-								  const char *buf, 
-								  apr_size_t *len);)
-#define switch_socket_sendto apr_socket_sendto
+SWITCH_DECLARE(switch_status_t) switch_mutex_unlock(switch_mutex_t *lock);
 
 /**
- * @param from The apr_sockaddr_t to fill in the recipient info
- * @param sock The socket to use
- * @param flags The flags to use
- * @param buf  The buffer to use
- * @param len  The length of the available buffer
- *
-
-DoxyDefine(apr_status_t switch_socket_recvfrom(switch_sockaddr_t *from, 
-									switch_socket_t *sock,
-									apr_int32_t flags, 
-									char *buf, 
-									apr_size_t *len);)
-#define switch_socket_recvfrom apr_socket_recvfrom
-*/
+ * Attempt to acquire the lock for the given mutex. If the mutex has already
+ * been acquired, the call returns immediately with APR_EBUSY. Note: it
+ * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine
+ * if the return value was APR_EBUSY, for portability reasons.
+ * @param lock the mutex on which to attempt the lock acquiring.
+ */
+SWITCH_DECLARE(switch_status_t) switch_mutex_trylock(switch_mutex_t *lock);
 
-/**
- * Send a file from an open file descriptor to a socket, along with 
- * optional headers and trailers
- * @param sock The socket to which we're writing
- * @param file The open file from which to read
- * @param hdtr A structure containing the headers and trailers to send
- * @param offset Offset into the file where we should begin writing
- * @param len (input)  - Number of bytes to send from the file 
- *            (output) - Number of bytes actually sent, 
- *                       including headers, file, and trailers
- * @param flags APR flags that are mapped to OS specific flags
- * @remark This functions acts like a blocking write by default.  To change 
- *         this behavior, use apr_socket_timeout_set() or the
- *         APR_SO_NONBLOCK socket option.
- * The number of bytes actually sent is stored in the len parameter.
- * The offset parameter is passed by reference for no reason; its
- * value will never be modified by the apr_socket_sendfile() function.
- */
-DoxyDefine(apr_status_t switch_socket_sendfile(apr_socket_t *sock, 
-                                              switch_file_t *file,
-                                              apr_hdtr_t *hdtr,
-                                              apr_off_t *offset,
-                                              apr_size_t *len,
-                                              apr_int32_t flags);)
-#define switch_socket_sendfile apr_socket_sendfile
+/** @} */
 
 /**
- * Read data from a network.
- * @param sock The socket to read the data from.
- * @param buf The buffer to store the data in. 
- * @param len On entry, the number of bytes to receive; on exit, the number
- *            of bytes received.
- * @remark
- * <PRE>
- * This functions acts like a blocking read by default.  To change 
- * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
- * socket option.
- * The number of bytes actually received is stored in argument 3.
- *
- * It is possible for both bytes to be received and an APR_EOF or
- * other error to be returned.
- *
- * APR_EINTR is never returned.
- * </PRE>
+ * @defgroup switch_thread_rwlock Thread Read/Write lock Routines
+ * @ingroup switch_apr
+ * @{
  */
-DoxyDefine(apr_status_t switch_socket_recv(switch_socket_t *sock, 
-								char *buf, 
-								apr_size_t *len);)
-#define switch_socket_recv apr_socket_recv
 
-/**
- * Setup socket options for the specified socket
- * @param sock The socket to set up.
- * @param opt The option we would like to configure.  One of:
- * <PRE>
- *            APR_SO_DEBUG      --  turn on debugging information 
- *            APR_SO_KEEPALIVE  --  keep connections active
- *            APR_SO_LINGER     --  lingers on close if data is present
- *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
- *                                  When this option is enabled, use
- *                                  the APR_STATUS_IS_EAGAIN() macro to
- *                                  see if a send or receive function
- *                                  could not transfer data without
- *                                  blocking.
- *            APR_SO_REUSEADDR  --  The rules used in validating addresses
- *                                  supplied to bind should allow reuse
- *                                  of local addresses.
- *            APR_SO_SNDBUF     --  Set the SendBufferSize
- *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
- * </PRE>
- * @param on Value for the option.
- */
-DoxyDefine(apr_status_t switch_socket_opt_set(switch_socket_t *sock,
-								   apr_int32_t opt, 
-								   apr_int32_t on);)
-#define switch_socket_opt_set apr_socket_opt_set
+/** Opaque structure used for the rwlock */
+typedef struct apr_thread_rwlock_t switch_thread_rwlock_t;
 
-/**
- * Setup socket timeout for the specified socket
- * @param sock The socket to set up.
- * @param t Value for the timeout.
- * <PRE>
- *   t > 0  -- read and write calls return APR_TIMEUP if specified time
- *             elapsess with no data read or written
- *   t == 0 -- read and write calls never block
- *   t < 0  -- read and write calls block
- * </PRE>
- */
-DoxyDefine(apr_status_t switch_socket_timeout_set(switch_socket_t *sock,
-									   apr_interval_time_t t);)
-#define switch_socket_timeout_set apr_socket_timeout_set
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_create(switch_thread_rwlock_t **rwlock,
+                                                  switch_memory_pool_t *pool);
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_destroy(switch_thread_rwlock_t *rwlock);
+SWITCH_DECLARE(switch_memory_pool_t *) switch_thread_rwlock_pool_get(switch_thread_rwlock_t *rwlock);
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_rdlock(switch_thread_rwlock_t *rwlock);
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_tryrdlock(switch_thread_rwlock_t *rwlock);
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_wrlock(switch_thread_rwlock_t *rwlock);
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_trywrlock(switch_thread_rwlock_t *rwlock);
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_unlock(switch_thread_rwlock_t *rwlock);
+
+/** @} */
 
 /**
- * Query socket options for the specified socket
- * @param sock The socket to query
- * @param opt The option we would like to query.  One of:
- * <PRE>
- *            APR_SO_DEBUG      --  turn on debugging information 
- *            APR_SO_KEEPALIVE  --  keep connections active
- *            APR_SO_LINGER     --  lingers on close if data is present
- *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
- *            APR_SO_REUSEADDR  --  The rules used in validating addresses
- *                                  supplied to bind should allow reuse
- *                                  of local addresses.
- *            APR_SO_SNDBUF     --  Set the SendBufferSize
- *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
- *            APR_SO_DISCONNECTED -- Query the disconnected state of the socket.
- *                                  (Currently only used on Windows)
- * </PRE>
- * @param on Socket option returned on the call.
+ * @defgroup switch_thread_cond Condition Variable Routines
+ * @ingroup switch_apr 
+ * @{
  */
-DoxyDefine(apr_status_t switch_socket_opt_get(switch_socket_t *sock, 
-									apr_int32_t opt, apr_int32_t *on);)
-#define switch_socket_opt_get apr_socket_opt_get
 
 /**
- * Query socket timeout for the specified socket
- * @param sock The socket to query
- * @param t Socket timeout returned from the query.
+ * Note: destroying a condition variable (or likewise, destroying or
+ * clearing the pool from which a condition variable was allocated) if
+ * any threads are blocked waiting on it gives undefined results.
  */
-DoxyDefine(apr_status_t switch_socket_timeout_get(switch_socket_t *sock, 
-                                                 apr_interval_time_t *t);)
-#define switch_socket_timeout_get apr_socket_timeout_get
+
+/** Opaque structure for thread condition variables */
+typedef struct apr_thread_cond_t switch_thread_cond_t;
 
 /**
- * Query the specified socket if at the OOB/Urgent data mark
- * @param sock The socket to query
- * @param atmark Is set to true if socket is at the OOB/urgent mark,
- *               otherwise is set to false.
+ * Create and initialize a condition variable that can be used to signal
+ * and schedule threads in a single process.
+ * @param cond the memory address where the newly created condition variable
+ *        will be stored.
+ * @param pool the pool from which to allocate the mutex.
  */
-DoxyDefine(apr_status_t switch_socket_atmark(switch_socket_t *sock, 
-								  int *atmark);)
-#define switch_socket_atmark apr_socket_atmark
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_create(switch_thread_cond_t **cond, switch_memory_pool_t *pool);
 
 /**
- * Return an apr_sockaddr_t from an apr_socket_t
- * @param sa The returned apr_sockaddr_t.
- * @param which Which interface do we want the apr_sockaddr_t for?
- * @param sock The socket to use
+ * Put the active calling thread to sleep until signaled to wake up. Each
+ * condition variable must be associated with a mutex, and that mutex must
+ * be locked before  calling this function, or the behavior will be
+ * undefined. As the calling thread is put to sleep, the given mutex
+ * will be simultaneously released; and as this thread wakes up the lock
+ * is again simultaneously acquired.
+ * @param cond the condition variable on which to block.
+ * @param mutex the mutex that must be locked upon entering this function,
+ *        is released while the thread is asleep, and is again acquired before
+ *        returning from this function.
  */
-DoxyDefine(apr_status_t switch_socket_addr_get(switch_sockaddr_t **sa,
-									apr_interface_e which,
-									switch_socket_t *sock);)
-#define switch_socket_addr_get apr_socket_addr_get
-
-/**
- * Return the IP address (in numeric address string format) in
- * an APR socket address.  APR will allocate storage for the IP address 
- * string from the pool of the apr_sockaddr_t.
- * @param addr The IP address.
- * @param sockaddr The socket address to reference.
- */
-DoxyDefine(apr_status_t switch_sockaddr_ip_get(char **addr, 
-									switch_sockaddr_t *sockaddr);)
-#define switch_sockaddr_ip_get apr_sockaddr_ip_get
-
-/**
- * See if the IP addresses in two APR socket addresses are
- * equivalent.  Appropriate logic is present for comparing
- * IPv4-mapped IPv6 addresses with IPv4 addresses.
- *
- * @param addr1 One of the APR socket addresses.
- * @param addr2 The other APR socket address.
- * @remark The return value will be non-zero if the addresses
- * are equivalent.
- */
-DoxyDefine(int switch_sockaddr_equal(const switch_sockaddr_t *addr1, 
-						  const switch_sockaddr_t *addr2);)
-#define switch_sockaddr_equal apr_sockaddr_equal
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_wait(switch_thread_cond_t *cond, switch_mutex_t *mutex);
 
 /**
-* Return the type of the socket.
-* @param sock The socket to query.
-* @param type The returned type (e.g., SOCK_STREAM).
-*/
-DoxyDefine(apr_status_t switch_socket_type_get(switch_socket_t *sock, 
-									int *type);)
-#define switch_socket_type_get apr_socket_type_get
+ * Put the active calling thread to sleep until signaled to wake up or
+ * the timeout is reached. Each condition variable must be associated
+ * with a mutex, and that mutex must be locked before calling this
+ * function, or the behavior will be undefined. As the calling thread
+ * is put to sleep, the given mutex will be simultaneously released;
+ * and as this thread wakes up the lock is again simultaneously acquired.
+ * @param cond the condition variable on which to block.
+ * @param mutex the mutex that must be locked upon entering this function,
+ *        is released while the thread is asleep, and is again acquired before
+ *        returning from this function.
+ * @param timeout The amount of time in microseconds to wait. This is 
+ *        a maximum, not a minimum. If the condition is signaled, we 
+ *        will wake up before this time, otherwise the error APR_TIMEUP
+ *        is returned.
+ */
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_timedwait(switch_thread_cond_t *cond, switch_mutex_t *mutex, switch_interval_time_t timeout);
 
 /**
- * Given an switch_sockaddr_t and a service name, set the port for the service
- * @param sockaddr The switch_sockaddr_t that will have its port set
- * @param servname The name of the service you wish to use
+ * Signals a single thread, if one exists, that is blocking on the given
+ * condition variable. That thread is then scheduled to wake up and acquire
+ * the associated mutex. Although it is not required, if predictable scheduling
+ * is desired, that mutex must be locked while calling this function.
+ * @param cond the condition variable on which to produce the signal.
  */
-DoxyDefine(apr_status_t switch_getservbyname(switch_sockaddr_t *sockaddr, 
-								  const char *servname);)
-#define switch_getservbyname apr_getservbyname
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_signal(switch_thread_cond_t *cond);
 
 /**
- * Build an ip-subnet representation from an IP address and optional netmask or
- * number-of-bits.
- * @param ipsub The new ip-subnet representation
- * @param ipstr The input IP address string
- * @param mask_or_numbits The input netmask or number-of-bits string, or NULL
- * @param p The pool to allocate from
+ * Signals all threads blocking on the given condition variable.
+ * Each thread that was signaled is then scheduled to wake up and acquire
+ * the associated mutex. This will happen in a serialized manner.
+ * @param cond the condition variable on which to produce the broadcast.
  */
-DoxyDefine(apr_status_t switch_ipsubnet_create(apr_ipsubnet_t **ipsub, 
-									const char *ipstr, 
-									const char *mask_or_numbits, 
-									switch_pool_t *p);)
-#define switch_ipsubnet_create apr_ipsubnet_create
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_broadcast(switch_thread_cond_t *cond);
 
 /**
- * Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet
- * representation.
- * @param ipsub The ip-subnet representation
- * @param sa The socket address to test
- * @return non-zero if the socket address is within the subnet, 0 otherwise
+ * Destroy the condition variable and free the associated memory.
+ * @param cond the condition variable to destroy.
  */
-DoxyDefine(int switch_ipsubnet_test(apr_ipsubnet_t *ipsub, switch_sockaddr_t *sa);)
-#define switch_ipsubnet_test apr_ipsubnet_test
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_destroy(switch_thread_cond_t *cond);
+
+/** @} */
 
 /**
- * Return the protocol of the socket.
- * @param sock The socket to query.
- * @param protocol The returned protocol (e.g., APR_PROTO_TCP).
+ * @defgroup switch_UUID UUID Handling
+ * @ingroup switch_apr
+ * @{
  */
-DoxyDefine(apr_status_t switch_socket_protocol_get(switch_socket_t *sock,
-										int *protocol);)
-#define switch_socket_protocol_get apr_socket_protocol_get
-
-/**
- * Join a Multicast Group
- * @param sock The socket to join a multicast group
- * @param join The address of the multicast group to join
- * @param iface Address of the interface to use.  If NULL is passed, the 
- *              default multicast interface will be used. (OS Dependent)
- * @param source Source Address to accept transmissions from (non-NULL 
- *               implies Source-Specific Multicast)
- */
-DoxyDefine(apr_status_t switch_mcast_join(switch_socket_t *sock,
-							   switch_sockaddr_t *join,
-							   switch_sockaddr_t *iface,
-							   switch_sockaddr_t *source);)
-#define switch_mcast_join apr_mcast_join
-
-/**
- * Leave a Multicast Group.  All arguments must be the same as
- * switch_mcast_join.
- * @param sock The socket to leave a multicast group
- * @param addr The address of the multicast group to leave
- * @param iface Address of the interface to use.  If NULL is passed, the 
- *              default multicast interface will be used. (OS Dependent)
- * @param source Source Address to accept transmissions from (non-NULL 
- *               implies Source-Specific Multicast)
- */
-DoxyDefine(apr_status_t switch_mcast_leave(switch_socket_t *sock,
-								switch_sockaddr_t *addr,
-								switch_sockaddr_t *iface,
-								switch_sockaddr_t *source);)
-#define switch_mcast_leave apr_mcast_leave
-
-/**
- * Set the Multicast Time to Live (ttl) for a multicast transmission.
- * @param sock The socket to set the multicast ttl
- * @param ttl Time to live to Assign. 0-255, default=1
- * @remark If the TTL is 0, packets will only be seen by sockets on 
- * the local machine, and only when multicast loopback is enabled.
- */
-DoxyDefine(apr_status_t switch_mcast_hops(switch_socket_t *sock,
-							   apr_byte_t ttl);)
-#define switch_mcast_hops apr_mcast_hops
-
-/**
- * Toggle IP Multicast Loopback
- * @param sock The socket to set multicast loopback
- * @param opt 0=disable, 1=enable
- */
-DoxyDefine(apr_status_t switch_mcast_loopback(switch_socket_t *sock,
-								   apr_byte_t opt);)
-#define switch_mcast_loopback apr_mcast_loopback
-
-/**
- * Set the Interface to be used for outgoing Multicast Transmissions.
- * @param sock The socket to set the multicast interface on
- * @param iface Address of the interface to use for Multicast
- */
-DoxyDefine(apr_status_t switch_mcast_interface(switch_socket_t *sock,
-									switch_sockaddr_t *iface);)
-#define switch_mcast_interface apr_mcast_interface
-
-/** @} */
-
-/**
- * @defgroup switch_memory_pool Memory Pool Functions
- * @ingroup switch_apr 
- * @{
- */
-/** The fundamental pool type */
-typedef apr_pool_t switch_memory_pool_t;
-
-
-/**
- * Clear all memory in the pool and run all the cleanups. This also destroys all
- * subpools.
- * @param p The pool to clear
- * @remark This does not actually free the memory, it just allows the pool
- *         to re-use this memory for the next allocation.
- * @see apr_pool_destroy()
- */
-DoxyDefine(void switch_pool_clear(switch_memory_pool_t *p);)
-#define switch_pool_clear apr_pool_clear
-/** @} */
-
-/**
- * @defgroup apr_poll Poll Routines
- * @ingroup switch_apr
- * @{
- */
-/** Poll descriptor set. */
-typedef apr_pollfd_t switch_pollfd_t;
-
-/** Opaque structure used for pollset API */
-typedef apr_pollset_t switch_pollset_t;
-
-/**
- * Poll options
- */
-#define SWITCH_POLLIN APR_POLLIN			/**< Can read without blocking */
-#define SWITCH_POLLPRI APR_POLLPRI			/**< Priority data available */
-#define SWITCH_POLLOUT APR_POLLOUT			/**< Can write without blocking */
-#define SWITCH_POLLERR APR_POLLERR			/**< Pending error */
-#define SWITCH_POLLHUP APR_POLLHUP			/**< Hangup occurred */
-#define SWITCH_POLLNVAL APR_POLLNVAL		/**< Descriptior invalid */
-
-/**
- * Setup a pollset object
- * @param pollset  The pointer in which to return the newly created object 
- * @param size The maximum number of descriptors that this pollset can hold
- * @param p The pool from which to allocate the pollset
- * @param flags Optional flags to modify the operation of the pollset.
- *
- * @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is
- * created on which it is safe to make concurrent calls to
- * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from
- * separate threads.  This feature is only supported on some
- * platforms; the apr_pollset_create() call will fail with
- * APR_ENOTIMPL on platforms where it is not supported.
- */
-DoxyDefine(apr_status_t switch_pollset_create(switch_pollset_t **pollset,
-                                             apr_uint32_t size,
-                                             switch_memory_pool_t *p,
-                                             apr_uint32_t flags);)
-#define switch_pollset_create apr_pollset_create
-
-/**
- * Add a socket or file descriptor to a pollset
- * @param pollset The pollset to which to add the descriptor
- * @param descriptor The descriptor to add
- * @remark If you set client_data in the descriptor, that value
- *         will be returned in the client_data field whenever this
- *         descriptor is signalled in apr_pollset_poll().
- * @remark If the pollset has been created with APR_POLLSET_THREADSAFE
- *         and thread T1 is blocked in a call to apr_pollset_poll() for
- *         this same pollset that is being modified via apr_pollset_add()
- *         in thread T2, the currently executing apr_pollset_poll() call in
- *         T1 will either: (1) automatically include the newly added descriptor
- *         in the set of descriptors it is watching or (2) return immediately
- *         with APR_EINTR.  Option (1) is recommended, but option (2) is
- *         allowed for implementations where option (1) is impossible
- *         or impractical.
- */
-DoxyDefine(apr_status_t switch_pollset_add(switch_pollset_t *pollset,
-                                          const switch_pollfd_t *descriptor);)
-#define switch_pollset_add apr_pollset_add
-
-/**
- * Poll the sockets in the poll structure
- * @param aprset The poll structure we will be using. 
- * @param numsock The number of sockets we are polling
- * @param nsds The number of sockets signalled.
- * @param timeout The amount of time in microseconds to wait.  This is 
- *                a maximum, not a minimum.  If a socket is signalled, we 
- *                will wake up before this time.  A negative number means 
- *                wait until a socket is signalled.
- * @remark The number of sockets signalled is returned in the third argument. 
- *         This is a blocking call, and it will not return until either a 
- *         socket has been signalled, or the timeout has expired. 
- */
-DoxyDefine(apr_status_t switch_poll(switch_pollfd_t *aprset, apr_int32_t numsock,
-                                   apr_int32_t *nsds, 
-                                   apr_interval_time_t timeout);)
-#define switch_poll apr_poll
- 
- /** @} */
-
- /**
- * @defgroup switch_time Time Routines
- * @ingroup switch_apr 
- * @{
- */
-
- /** number of microseconds since 00:00:00 january 1, 1970 UTC */
-typedef apr_time_t switch_time_t;
-
- /** number of microseconds in the interval */
-typedef apr_interval_time_t switch_interval_time_t;
-
-/**
- * a structure similar to ANSI struct tm with the following differences:
- *  - tm_usec isn't an ANSI field
- *  - tm_gmtoff isn't an ANSI field (it's a bsdism)
- */
-typedef apr_time_exp_t switch_time_exp_t;
-
-/**
- * @return the current time
- */
-DoxyDefine(switch_time_t switch_time_now(void);)
-#define switch_time_now apr_time_now
-
-/**
- * Convert time value from human readable format to a numeric apr_time_t that
- * always represents GMT
- * @param result the resulting imploded time
- * @param input the input exploded time
- */
-DoxyDefine(switch_status_t switch_time_exp_gmt_get(switch_time_t *result, switch_time_exp_t *input);)
-#define switch_time_exp_gmt_get apr_time_exp_gmt_get
-
-/**
- * formats the exploded time according to the format specified
- * @param s string to write to
- * @param retsize The length of the returned string
- * @param max The maximum length of the string
- * @param format The format for the time string
- * @param tm The time to convert
- */
-DoxyDefine(apr_status_t switch_strftime(char *s, apr_size_t *retsize, 
-                                       apr_size_t max, const char *format, 
-                                       switch_time_exp_t *tm);)
-#define switch_strftime apr_strftime
-
-/**
- * switch_rfc822_date formats dates in the RFC822
- * format in an efficient manner.  It is a fixed length
- * format which requires the indicated amount of storage,
- * including the trailing NUL terminator.
- * @param date_str String to write to.
- * @param t the time to convert 
- */
-DoxyDefine(apr_status_t switch_rfc822_date(char *date_str, switch_time_t t);)
-#define switch_rfc822_date apr_rfc822_date
-
-/**
- * convert a time to its human readable components in GMT timezone
- * @param result the exploded time
- * @param input the time to explode
- */
-DoxyDefine(apr_status_t switch_time_exp_gmt(switch_time_exp_t *result, 
-                                           switch_time_t input);)
-#define switch_time_exp_gmt apr_time_exp_gmt
-
-/**
- * Convert time value from human readable format to a numeric apr_time_t 
- * e.g. elapsed usec since epoch
- * @param result the resulting imploded time
- * @param input the input exploded time
- */
-DoxyDefine(apr_status_t switch_time_exp_get(switch_time_t *result, 
-											switch_time_exp_t *input);)
-#define switch_time_exp_get apr_time_exp_get
-
-/**
- * convert a time to its human readable components in local timezone
- * @param result the exploded time
- * @param input the time to explode
- */
-DoxyDefine(apr_status_t switch_time_exp_lt(switch_time_exp_t *result, 
-											switch_time_t input);)
-#define switch_time_exp_lt apr_time_exp_lt
-
-/**
- * Sleep for the specified number of micro-seconds.
- * @param t desired amount of time to sleep.
- * @warning May sleep for longer than the specified time. 
- */
-DoxyDefine(void switch_sleep(apr_interval_time_t t);)
-#define switch_sleep apr_sleep
-
-/** @} */
-
-/**
- * @defgroup apr_hash Hash Tables
- * @ingroup switch_apr
- * @{
- */
-
-/** Abstract type for hash tables. */
-typedef apr_hash_t switch_hash_t;
-
-/** Abstract type for scanning hash tables. */
-typedef apr_hash_index_t switch_hash_index_t;
-
-/**
- * Start iterating over the entries in a hash table.
- * @param p The pool to allocate the switch_hash_index_t iterator. If this
- *          pool is NULL, then an internal, non-thread-safe iterator is used.
- * @param ht The hash table
- * @remark  There is no restriction on adding or deleting hash entries during
- * an iteration (although the results may be unpredictable unless all you do
- * is delete the current entry) and multiple iterations can be in
- * progress at the same time.
-
- */
-DoxyDefine(switch_hash_index_t * switch_hash_first(switch_memory_pool_t *p, switch_hash_t *ht);)
-#define switch_hash_first apr_hash_first
-
-/**
- * Continue iterating over the entries in a hash table.
- * @param hi The iteration state
- * @return a pointer to the updated iteration state.  NULL if there are no more  
- *         entries.
- */
-DoxyDefine(switch_hash_index_t * switch_hash_next(switch_hash_index_t *hi);)
-#define switch_hash_next apr_hash_next
-
-/**
- * Get the current entry's details from the iteration state.
- * @param hi The iteration state
- * @param key Return pointer for the pointer to the key.
- * @param klen Return pointer for the key length.
- * @param val Return pointer for the associated value.
- * @remark The return pointers should point to a variable that will be set to the
- *         corresponding data, or they may be NULL if the data isn't interesting.
- */
-DoxyDefine(void switch_hash_this(switch_hash_index_t *hi, const void **key, 
-                                apr_ssize_t *klen, void **val);)
-#define switch_hash_this apr_hash_this
-
-/** @} */
-
-/**
- * @defgroup switch_StrMatch String matching routines
- * @ingroup switch_apr
- * @{
- */
-
-/** Precompiled search pattern */
-typedef apr_strmatch_pattern switch_strmatch_pattern;
-
-/**
- * Precompile a pattern for matching using the Boyer-Moore-Horspool algorithm
- * @param p The pool from which to allocate the pattern
- * @param s The pattern string
- * @param case_sensitive Whether the matching should be case-sensitive
- * @return a pointer to the compiled pattern, or NULL if compilation fails
- */
-DoxyDefine(const switch_strmatch_pattern * switch_strmatch_precompile(switch_memory_pool_t *p, const char *s, int case_sensitive);)
-#define switch_strmatch_precompile apr_strmatch_precompile
-
-/**
- * Search for a precompiled pattern within a string
- * @param pattern The pattern
- * @param s The string in which to search for the pattern
- * @param slen The length of s (excluding null terminator)
- * @return A pointer to the first instance of the pattern in s, or
- *         NULL if not found
- */
-DoxyDefine(const char * switch_strmatch(const switch_strmatch_pattern *pattern,
-                                       const char *s, apr_size_t slen);)
-#define switch_strmatch apr_strmatch
-/** @} */
-
-/**
- * @defgroup switch_UUID UUID Handling
- * @ingroup switch_apr
- * @{
- */
-
-/** we represent a UUID as a block of 16 bytes. */
-
-typedef apr_uuid_t switch_uuid_t;
-
-/** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */
+
+/** we represent a UUID as a block of 16 bytes. */
+
+typedef struct {
+    unsigned char data[16]; /**< the actual UUID */
+} switch_uuid_t;
+
+/** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */
+#define SWITCH_UUID_FORMATTED_LENGTH 36
 
 /**
  * Format a UUID into a string, following the standard format
@@ -1276,23 +506,20 @@
  *               the formatted UUID and a null terminator
  * @param uuid The UUID to format
  */ 
-DoxyDefine(void switch_uuid_format(char *buffer, const switch_uuid_t *uuid);)
-#define switch_uuid_format apr_uuid_format
+SWITCH_DECLARE(void) switch_uuid_format(char *buffer, const switch_uuid_t *uuid);
 
 /**
  * Generate and return a (new) UUID
  * @param uuid The resulting UUID
  */ 
-DoxyDefine(void switch_uuid_get(switch_uuid_t *uuid);)
-#define switch_uuid_get apr_uuid_get
+SWITCH_DECLARE(void) switch_uuid_get(switch_uuid_t *uuid);
 
 /**
  * Parse a standard-format string into a UUID
  * @param uuid The resulting UUID
  * @param uuid_str The formatted UUID
  */ 
-DoxyDefine(apr_status_t switch_uuid_parse(switch_uuid_t *uuid, const char *uuid_str);)
-#define switch_uuid_parse apr_uuid_parse
+SWITCH_DECLARE(switch_status_t) switch_uuid_parse(switch_uuid_t *uuid, const char *uuid_str);
 
 /** @} */
 
@@ -1303,7 +530,7 @@
  */
 
 /** Opaque structure used for queue API */
-typedef apr_queue_t switch_queue_t;
+typedef struct apr_queue_t switch_queue_t;
 
 /** 
  * create a FIFO queue
@@ -1311,18 +538,9 @@
  * @param queue_capacity maximum size of the queue
  * @param a pool to allocate queue from
  */
-DoxyDefine(apr_status_t switch_queue_create(switch_queue_t **queue, 
+SWITCH_DECLARE(switch_status_t) switch_queue_create(switch_queue_t **queue, 
                                            unsigned int queue_capacity, 
-                                           switch_memory_pool_t *a);)
-#define switch_queue_create apr_queue_create
-
-/**
- * interrupt all the threads blocking on this queue.
- *
- * @param queue the queue
- */
-DoxyDefine(apr_status_t switch_queue_interrupt_all(switch_queue_t *queue);)
-#define switch_queue_interrupt_all apr_queue_interrupt_all
+                                           switch_memory_pool_t *pool);
 
 /**
  * pop/get an object from the queue, blocking if the queue is already empty
@@ -1333,8 +551,7 @@
  * @returns APR_EOF if the queue has been terminated
  * @returns APR_SUCCESS on a successfull pop
  */
-DoxyDefine(apr_status_t switch_queue_pop(switch_queue_t *queue, void **data);)
-#define switch_queue_pop apr_queue_pop
+SWITCH_DECLARE(switch_status_t) switch_queue_pop(switch_queue_t *queue, void **data);
 
 /**
  * push/add a object to the queue, blocking if the queue is already full
@@ -1345,8 +562,7 @@
  * @returns APR_EOF the queue has been terminated
  * @returns APR_SUCCESS on a successfull push
  */
-DoxyDefine(apr_status_t switch_queue_push(switch_queue_t *queue, void *data);)
-#define switch_queue_push apr_queue_push
+SWITCH_DECLARE(switch_status_t) switch_queue_push(switch_queue_t *queue, void *data);
 
 /**
  * returns the size of the queue.
@@ -1356,17 +572,7 @@
  * @param queue the queue
  * @returns the size of the queue
  */
-DoxyDefine(unsigned int switch_queue_size(switch_queue_t *queue);)
-#define switch_queue_size apr_queue_size
-
-/**
- * terminate all queue, sendinging a interupt to all the
- * blocking threads
- *
- * @param queue the queue
- */
-DoxyDefine(apr_status_t switch_queue_term(switch_queue_t *queue);)
-#define switch_queue_term apr_queue_term
+SWITCH_DECLARE(unsigned int) switch_queue_size(switch_queue_t *queue);
 
 /**
  * pop/get an object to the queue, returning immediatly if the queue is empty
@@ -1378,8 +584,7 @@
  * @returns APR_EOF the queue has been terminated
  * @returns APR_SUCCESS on a successfull push
  */
-DoxyDefine(apr_status_t switch_queue_trypop(switch_queue_t *queue, void **data);)
-#define switch_queue_trypop apr_queue_trypop
+SWITCH_DECLARE(switch_status_t) switch_queue_trypop(switch_queue_t *queue, void **data);
 
 /**
  * push/add a object to the queue, returning immediatly if the queue is full
@@ -1391,92 +596,573 @@
  * @returns APR_EOF the queue has been terminated
  * @returns APR_SUCCESS on a successfull push
  */
-DoxyDefine(apr_status_t switch_queue_trypush(switch_queue_t *queue, void *data);)
-#define switch_queue_trypush apr_queue_trypush
+SWITCH_DECLARE(switch_status_t) switch_queue_trypush(switch_queue_t *queue, void *data);
 
 /** @} */
 
-
-typedef apr_thread_rwlock_t switch_thread_rwlock_t;
-
-#define switch_thread_rwlock_create apr_thread_rwlock_create
-#define switch_thread_rwlock_destroy apr_thread_rwlock_destroy
-#define switch_thread_rwlock_pool_get apr_thread_rwlock_pool_get
-#define switch_thread_rwlock_rdlock apr_thread_rwlock_rdlock
-#define switch_thread_rwlock_tryrdlock apr_thread_rwlock_tryrdlock
-#define switch_thread_rwlock_trywrlock apr_thread_rwlock_trywrlock
-#define switch_thread_rwlock_unlock apr_thread_rwlock_unlock
-#define switch_thread_rwlock_wrlock apr_thread_rwlock_wrlock
-
 /**
- * @defgroup switch_thread_mutex Thread Mutex Routines
- * @ingroup switch_apr
+ * @defgroup switch_file_io File I/O Handling Functions
+ * @ingroup switch_apr 
  * @{
  */
 
-/** Opaque thread-local mutex structure */
-typedef apr_thread_mutex_t switch_mutex_t;
+/** Structure for referencing files. */
+typedef struct apr_file_t switch_file_t;
 
-/** Lock Flags */
+typedef int32_t switch_fileperms_t;
+typedef int     switch_seek_where_t;
+
+/**
+ * @defgroup switch_file_permissions File Permissions flags 
+ * @ingroup switch_file_io
+ * @{
+ */
+    
+#define SWITCH_FPROT_USETID 0x8000			/**< Set user id */
+#define SWITCH_FPROT_UREAD 0x0400			/**< Read by user */
+#define SWITCH_FPROT_UWRITE 0x0200			/**< Write by user */
+#define SWITCH_FPROT_UEXECUTE 0x0100		/**< Execute by user */
+
+#define SWITCH_FPROT_GSETID 0x4000			/**< Set group id */
+#define SWITCH_FPROT_GREAD 0x0040			/**< Read by group */
+#define SWITCH_FPROT_GWRITE 0x0020			/**< Write by group */
+#define SWITCH_FPROT_GEXECUTE 0x0010		/**< Execute by group */
+
+#define SWITCH_FPROT_WSTICKY 0x2000
+#define SWITCH_FPROT_WREAD 0x0004			/**< Read by others */
+#define SWITCH_FPROT_WWRITE 0x0002			/**< Write by others */
+#define SWITCH_FPROT_WEXECUTE 0x0001		/**< Execute by others */
 
-#define SWITCH_MUTEX_DEFAULT APR_THREAD_MUTEX_DEFAULT	/**< platform-optimal lock behavior */
-#define SWITCH_MUTEX_NESTED APR_THREAD_MUTEX_NESTED	/**< enable nested (recursive) locks */
-#define	SWITCH_MUTEX_UNNESTED APR_THREAD_MUTEX_UNNESTED	/**< disable nested locks */
+#define SWITCH_FPROT_OS_DEFAULT 0x0FFF		/**< use OS's default permissions */
 
+/* additional permission flags for apr_file_copy  and apr_file_append */
+#define SWITCH_FPROT_FILE_SOURCE_PERMS 0x1000	/**< Copy source file's permissions */
+/** @} */
 
 /**
- * Create and initialize a mutex that can be used to synchronize threads.
- * @param lock the memory address where the newly created mutex will be
- *        stored.
- * @param flags Or'ed value of:
+ * @defgroup switch_file_open_flags File Open Flags/Routines
+ * @ingroup switch_file_io
+ * @{
+ */
+#define SWITCH_FOPEN_READ				0x00001		/**< Open the file for reading */
+#define SWITCH_FOPEN_WRITE				0x00002		/**< Open the file for writing */
+#define SWITCH_FOPEN_CREATE				0x00004		/**< Create the file if not there */
+#define SWITCH_FOPEN_APPEND				0x00008		/**< Append to the end of the file */
+#define SWITCH_FOPEN_TRUNCATE			0x00010		/**< Open the file and truncate to 0 length */
+#define SWITCH_FOPEN_BINARY				0x00020		/**< Open the file in binary mode */
+#define SWITCH_FOPEN_EXCL				0x00040		/**< Open should fail if APR_CREATE and file exists. */
+#define SWITCH_FOPEN_BUFFERED			0x00080		/**< Open the file for buffered I/O */
+#define SWITCH_FOPEN_DELONCLOSE			0x00100		/**< Delete the file after close */
+#define SWITCH_FOPEN_XTHREAD			0x00200		/**< Platform dependent tag to open the file for use across multiple threads */
+#define SWITCH_FOPEN_SHARELOCK			0x00400		/**< Platform dependent support for higher level locked read/write access to support writes across process/machines */
+#define SWITCH_FOPEN_NOCLEANUP			0x00800		/**< Do not register a cleanup when the file is opened */
+#define SWITCH_FOPEN_SENDFILE_ENABLED	0x01000		/**< Advisory flag that this file should support apr_socket_sendfile operation */
+#define SWITCH_FOPEN_LARGEFILE			0x04000		/**< Platform dependent flag to enable large file support */
+/** @} */
+
+/**
+ * Open the specified file.
+ * @param newf The opened file descriptor.
+ * @param fname The full path to the file (using / on all systems)
+ * @param flag Or'ed value of:
  * <PRE>
- *           SWITCH_THREAD_MUTEX_DEFAULT   platform-optimal lock behavior.
- *           SWITCH_THREAD_MUTEX_NESTED    enable nested (recursive) locks.
- *           SWITCH_THREAD_MUTEX_UNNESTED  disable nested locks (non-recursive).
+ *         SWITCH_FOPEN_READ				open for reading
+ *         SWITCH_FOPEN_WRITE				open for writing
+ *         SWITCH_FOPEN_CREATE				create the file if not there
+ *         SWITCH_FOPEN_APPEND				file ptr is set to end prior to all writes
+ *         SWITCH_FOPEN_TRUNCATE			set length to zero if file exists
+ *         SWITCH_FOPEN_BINARY				not a text file (This flag is ignored on 
+ *											UNIX because it has no meaning)
+ *         SWITCH_FOPEN_BUFFERED			buffer the data.  Default is non-buffered
+ *         SWITCH_FOPEN_EXCL				return error if APR_CREATE and file exists
+ *         SWITCH_FOPEN_DELONCLOSE			delete the file after closing.
+ *         SWITCH_FOPEN_XTHREAD				Platform dependent tag to open the file
+ *											for use across multiple threads
+ *         SWITCH_FOPEN_SHARELOCK			Platform dependent support for higher
+ *											level locked read/write access to support
+ *											writes across process/machines
+ *         SWITCH_FOPEN_NOCLEANUP			Do not register a cleanup with the pool 
+ *											passed in on the <EM>pool</EM> argument (see below).
+ *											The apr_os_file_t handle in apr_file_t will not
+ *											be closed when the pool is destroyed.
+ *         SWITCH_FOPEN_SENDFILE_ENABLED	Open with appropriate platform semantics
+ *											for sendfile operations.  Advisory only,
+ *											apr_socket_sendfile does not check this flag.
  * </PRE>
- * @param pool the pool from which to allocate the mutex.
- * @warning Be cautious in using SWITCH_THREAD_MUTEX_DEFAULT.  While this is the
- * most optimial mutex based on a given platform's performance charateristics,
- * it will behave as either a nested or an unnested lock.
+ * @param perm Access permissions for file.
+ * @param pool The pool to use.
+ * @remark If perm is SWITCH_FPROT_OS_DEFAULT and the file is being created,
+ * appropriate default permissions will be used.
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_open(switch_file_t **newf, const char *fname, int32_t flag, switch_fileperms_t perm, switch_memory_pool_t *pool);
+
+
+SWITCH_DECLARE(switch_status_t) switch_file_seek(switch_file_t *thefile, switch_seek_where_t where, int64_t *offset);
+
+/**
+ * Close the specified file.
+ * @param file The file descriptor to close.
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_close(switch_file_t *thefile);
+
+/**
+ * Delete the specified file.
+ * @param path The full path to the file (using / on all systems)
+ * @param pool The pool to use.
+ * @remark If the file is open, it won't be removed until all
+ * instances are closed.
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_remove(const char *path, switch_memory_pool_t *pool);
+
+/**
+ * Read data from the specified file.
+ * @param thefile The file descriptor to read from.
+ * @param buf The buffer to store the data to.
+ * @param nbytes On entry, the number of bytes to read; on exit, the number
+ * of bytes read.
  *
-SWITCH_DECLARE(switch_status_t) switch_mutex_init(switch_mutex_t **lock,
-												switch_lock_flag flags,
-												switch_memory_pool_t *pool);
-*/
-#define switch_mutex_init apr_thread_mutex_create
+ * @remark apr_file_read will read up to the specified number of
+ * bytes, but never more.  If there isn't enough data to fill that
+ * number of bytes, all of the available data is read.  The third
+ * argument is modified to reflect the number of bytes read.  If a
+ * char was put back into the stream via ungetc, it will be the first
+ * character returned.
+ *
+ * @remark It is not possible for both bytes to be read and an APR_EOF
+ * or other error to be returned.  APR_EINTR is never returned.
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_read(switch_file_t *thefile, void *buf, switch_size_t *nbytes);
+
 /**
- * Destroy the mutex and free the memory associated with the lock.
- * @param lock the mutex to destroy.
+ * Write data to the specified file.
+ * @param thefile The file descriptor to write to.
+ * @param buf The buffer which contains the data.
+ * @param nbytes On entry, the number of bytes to write; on exit, the number 
+ *               of bytes written.
+ *
+ * @remark apr_file_write will write up to the specified number of
+ * bytes, but never more.  If the OS cannot write that many bytes, it
+ * will write as many as it can.  The third argument is modified to
+ * reflect the * number of bytes written.
+ *
+ * @remark It is possible for both bytes to be written and an error to
+ * be returned.  APR_EINTR is never returned.
  */
-//SWITCH_DECLARE(switch_status_t) switch_mutex_destroy(switch_mutex_t *lock);
-#define switch_mutex_destroy apr_thread_mutex_destroy
+SWITCH_DECLARE(switch_status_t) switch_file_write(switch_file_t *thefile, const void *buf, switch_size_t *nbytes);
+
+SWITCH_DECLARE(switch_status_t) switch_file_exists(const char *filename);
+
+/** @} */
 
 /**
- * Acquire the lock for the given mutex. If the mutex is already locked,
- * the current thread will be put to sleep until the lock becomes available.
- * @param lock the mutex on which to acquire the lock.
+ * @defgroup switch_thread_proc Threads and Process Functions
+ * @ingroup switch_apr 
+ * @{
  */
-//SWITCH_DECLARE(switch_status_t) switch_mutex_lock(switch_mutex_t *lock);
-#define switch_mutex_lock apr_thread_mutex_lock
+
+/** Opaque Thread structure. */
+typedef struct apr_thread_t switch_thread_t;
+
+/** Opaque Thread attributes structure. */
+typedef struct apr_threadattr_t switch_threadattr_t;
 
 /**
- * Release the lock for the given mutex.
- * @param lock the mutex from which to release the lock.
+ * The prototype for any APR thread worker functions.
+ * typedef void *(SWITCH_THREAD_FUNC *switch_thread_start_t)(switch_thread_t*, void*);
  */
-//SWITCH_DECLARE(switch_status_t) switch_mutex_unlock(switch_mutex_t *lock);
-#define switch_mutex_unlock apr_thread_mutex_unlock
+typedef void *(SWITCH_THREAD_FUNC *switch_thread_start_t)(switch_thread_t*, void*);
+
+//APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, switch_size_t stacksize)
+SWITCH_DECLARE(switch_status_t) switch_threadattr_stacksize_set(switch_threadattr_t *attr, switch_size_t stacksize);
 
 /**
- * Attempt to acquire the lock for the given mutex. If the mutex has already
- * been acquired, the call returns immediately with APR_EBUSY. Note: it
- * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine
- * if the return value was APR_EBUSY, for portability reasons.
- * @param lock the mutex on which to attempt the lock acquiring.
+ * Create and initialize a new threadattr variable
+ * @param new_attr The newly created threadattr.
+ * @param cont The pool to use
+ */
+SWITCH_DECLARE(switch_status_t) switch_threadattr_create(switch_threadattr_t **new_attr, switch_memory_pool_t *pool);
+
+/**
+ * Set if newly created threads should be created in detached state.
+ * @param attr The threadattr to affect 
+ * @param on Non-zero if detached threads should be created.
  */
-//SWITCH_DECLARE(switch_status_t) switch_mutex_trylock(switch_mutex_t *lock);
-#define switch_mutex_trylock apr_thread_mutex_trylock
+SWITCH_DECLARE(switch_status_t) switch_threadattr_detach_set(switch_threadattr_t *attr, int32_t on);
+
+/**
+ * Create a new thread of execution
+ * @param new_thread The newly created thread handle.
+ * @param attr The threadattr to use to determine how to create the thread
+ * @param func The function to start the new thread in
+ * @param data Any data to be passed to the starting function
+ * @param cont The pool to use
+ */
+SWITCH_DECLARE(switch_status_t) switch_thread_create(switch_thread_t **new_thread, switch_threadattr_t *attr, switch_thread_start_t func, void *data, switch_memory_pool_t *cont);
 
 /** @} */
+
+/**
+ * @defgroup switch_network_io Network Routines
+ * @ingroup switch_apr 
+ * @{
+ */
+
+#define SWITCH_SO_LINGER 1
+#define SWITCH_SO_KEEPALIVE 2
+#define SWITCH_SO_DEBUG 4
+#define SWITCH_SO_NONBLOCK 8
+#define SWITCH_SO_REUSEADDR 16
+#define SWITCH_SO_SNDBUF 64
+#define SWITCH_SO_RCVBUF 128
+#define SWITCH_SO_DISCONNECTED 256
+
+ /**
+ * @def SWITCH_INET
+ * Not all platforms have these defined, so we'll define them here
+ * The default values come from FreeBSD 4.1.1
+ */
+#define SWITCH_INET     AF_INET
+
+/** @def SWITCH_UNSPEC
+ * Let the system decide which address family to use
+ */
+#ifdef AF_UNSPEC
+#define SWITCH_UNSPEC   AF_UNSPEC
+#else
+#define SWITCH_UNSPEC   0
+#endif
+
+/** A structure to represent sockets */
+typedef struct apr_socket_t switch_socket_t;
+
+/** Freeswitch's socket address type, used to ensure protocol independence */
+typedef struct apr_sockaddr_t switch_sockaddr_t;
+
+typedef enum {
+    SWITCH_SHUTDOWN_READ,          /**< no longer allow read request */
+    SWITCH_SHUTDOWN_WRITE,         /**< no longer allow write requests */
+    SWITCH_SHUTDOWN_READWRITE      /**< no longer allow read or write requests */
+} switch_shutdown_how_e;
+
+/**
+ * @defgroup IP_Proto IP Protocol Definitions for use when creating sockets
+ * @{
+ */
+#define SWITCH_PROTO_TCP       6   /**< TCP  */
+#define SWITCH_PROTO_UDP      17   /**< UDP  */
+#define SWITCH_PROTO_SCTP    132   /**< SCTP */
+/** @} */
+
+/* function definitions */
+
+/**
+ * Create a socket.
+ * @param new_sock The new socket that has been set up.
+ * @param family The address family of the socket (e.g., SWITCH_INET).
+ * @param type The type of the socket (e.g., SOCK_STREAM).
+ * @param protocol The protocol of the socket (e.g., SWITCH_PROTO_TCP).
+ * @param pool The pool to use
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_create(switch_socket_t **new_sock, int family, int type, int protocol, switch_memory_pool_t *pool);
+
+/**
+ * Shutdown either reading, writing, or both sides of a socket.
+ * @param sock The socket to close 
+ * @param how How to shutdown the socket.  One of:
+ * <PRE>
+ *            SWITCH_SHUTDOWN_READ         no longer allow read requests
+ *            SWITCH_SHUTDOWN_WRITE        no longer allow write requests
+ *            SWITCH_SHUTDOWN_READWRITE    no longer allow read or write requests 
+ * </PRE>
+ * @see switch_shutdown_how_e
+ * @remark This does not actually close the socket descriptor, it just
+ *      controls which calls are still valid on the socket.
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_shutdown(switch_socket_t *sock, switch_shutdown_how_e how);
+
+/**
+ * Close a socket.
+ * @param sock The socket to close 
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_close(switch_socket_t *sock);
+
+/**
+ * Bind the socket to its associated port
+ * @param sock The socket to bind 
+ * @param sa The socket address to bind to
+ * @remark This may be where we will find out if there is any other process
+ *      using the selected port.
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_bind(switch_socket_t *sock, switch_sockaddr_t *sa);
+
+/**
+ * Listen to a bound socket for connections.
+ * @param sock The socket to listen on 
+ * @param backlog The number of outstanding connections allowed in the sockets
+ *                listen queue.  If this value is less than zero, the listen
+ *                queue size is set to zero.  
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_listen(switch_socket_t *sock, int32_t backlog);
+
+/**
+ * Accept a new connection request
+ * @param new_sock A copy of the socket that is connected to the socket that
+ *                 made the connection request.  This is the socket which should
+ *                 be used for all future communication.
+ * @param sock The socket we are listening on.
+ * @param connection_pool The pool for the new socket.
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_accept(switch_socket_t **new_sock, switch_socket_t *sock, switch_memory_pool_t *pool);
+
+/**
+ * Issue a connection request to a socket either on the same machine 
+ * or a different one.
+ * @param sock The socket we wish to use for our side of the connection 
+ * @param sa The address of the machine we wish to connect to.
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_connect(switch_socket_t *sock, switch_sockaddr_t *sa);
+
+SWITCH_DECLARE(uint16_t) switch_sockaddr_get_port(switch_sockaddr_t *sa);
+SWITCH_DECLARE(char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in);
+SWITCH_DECLARE(int32_t) switch_sockaddr_get_family(switch_sockaddr_t *sa);
+SWITCH_DECLARE(switch_status_t) switch_sockaddr_ip_get(char **addr, switch_sockaddr_t *sa);
+
+
+/**
+ * Create apr_sockaddr_t from hostname, address family, and port.
+ * @param sa The new apr_sockaddr_t.
+ * @param hostname The hostname or numeric address string to resolve/parse, or
+ *               NULL to build an address that corresponds to 0.0.0.0 or ::
+ * @param family The address family to use, or SWITCH_UNSPEC if the system should 
+ *               decide.
+ * @param port The port number.
+ * @param flags Special processing flags:
+ * <PRE>
+ *       APR_IPV4_ADDR_OK          first query for IPv4 addresses; only look
+ *                                 for IPv6 addresses if the first query failed;
+ *                                 only valid if family is APR_UNSPEC and hostname
+ *                                 isn't NULL; mutually exclusive with
+ *                                 APR_IPV6_ADDR_OK
+ *       APR_IPV6_ADDR_OK          first query for IPv6 addresses; only look
+ *                                 for IPv4 addresses if the first query failed;
+ *                                 only valid if family is APR_UNSPEC and hostname
+ *                                 isn't NULL and APR_HAVE_IPV6; mutually exclusive
+ *                                 with APR_IPV4_ADDR_OK
+ * </PRE>
+ * @param p The pool for the apr_sockaddr_t and associated storage.
+ */
+SWITCH_DECLARE(switch_status_t) switch_sockaddr_info_get(switch_sockaddr_t **sa, const char *hostname, int32_t family, switch_port_t port, int32_t flags, switch_memory_pool_t *pool);
+
+/**
+ * Send data over a network.
+ * @param sock The socket to send the data over.
+ * @param buf The buffer which contains the data to be sent. 
+ * @param len On entry, the number of bytes to send; on exit, the number
+ *            of bytes sent.
+ * @remark
+ * <PRE>
+ * This functions acts like a blocking write by default.  To change 
+ * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
+ * socket option.
+ *
+ * It is possible for both bytes to be sent and an error to be returned.
+ *
+ * APR_EINTR is never returned.
+ * </PRE>
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t *sock, const char *buf, switch_size_t *len);
+
+/**
+ * @param sock The socket to send from
+ * @param where The apr_sockaddr_t describing where to send the data
+ * @param flags The flags to use
+ * @param buf  The data to send
+ * @param len  The length of the data to send
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_sendto(switch_socket_t *sock, switch_sockaddr_t *where, int32_t flags, const char *buf, switch_size_t *len);
+
+/**
+ * @param from The apr_sockaddr_t to fill in the recipient info
+ * @param sock The socket to use
+ * @param flags The flags to use
+ * @param buf  The buffer to use
+ * @param len  The length of the available buffer
+ *
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from,
+													   switch_socket_t *sock,
+													   int32_t flags,
+													   char *buf,
+													   size_t *len);
+
+
+/**
+ * Read data from a network.
+ * @param sock The socket to read the data from.
+ * @param buf The buffer to store the data in. 
+ * @param len On entry, the number of bytes to receive; on exit, the number
+ *            of bytes received.
+ * @remark
+ * <PRE>
+ * This functions acts like a blocking read by default.  To change 
+ * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
+ * socket option.
+ * The number of bytes actually received is stored in argument 3.
+ *
+ * It is possible for both bytes to be received and an APR_EOF or
+ * other error to be returned.
+ *
+ * APR_EINTR is never returned.
+ * </PRE>
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_recv(switch_socket_t *sock, char *buf, switch_size_t *len);
+
+/**
+ * Setup socket options for the specified socket
+ * @param sock The socket to set up.
+ * @param opt The option we would like to configure.  One of:
+ * <PRE>
+ *            APR_SO_DEBUG      --  turn on debugging information 
+ *            APR_SO_KEEPALIVE  --  keep connections active
+ *            APR_SO_LINGER     --  lingers on close if data is present
+ *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
+ *                                  When this option is enabled, use
+ *                                  the APR_STATUS_IS_EAGAIN() macro to
+ *                                  see if a send or receive function
+ *                                  could not transfer data without
+ *                                  blocking.
+ *            APR_SO_REUSEADDR  --  The rules used in validating addresses
+ *                                  supplied to bind should allow reuse
+ *                                  of local addresses.
+ *            APR_SO_SNDBUF     --  Set the SendBufferSize
+ *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
+ * </PRE>
+ * @param on Value for the option.
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int32_t opt, int32_t on);
+
+/**
+ * Setup socket timeout for the specified socket
+ * @param sock The socket to set up.
+ * @param t Value for the timeout.
+ * <PRE>
+ *   t > 0  -- read and write calls return APR_TIMEUP if specified time
+ *             elapsess with no data read or written
+ *   t == 0 -- read and write calls never block
+ *   t < 0  -- read and write calls block
+ * </PRE>
+ */
+SWITCH_DECLARE(switch_status_t) switch_socket_timeout_set(switch_socket_t *sock, switch_interval_time_t t);
+
+/**
+ * Join a Multicast Group
+ * @param sock The socket to join a multicast group
+ * @param join The address of the multicast group to join
+ * @param iface Address of the interface to use.  If NULL is passed, the 
+ *              default multicast interface will be used. (OS Dependent)
+ * @param source Source Address to accept transmissions from (non-NULL 
+ *               implies Source-Specific Multicast)
+ */
+SWITCH_DECLARE(switch_status_t) switch_mcast_join(switch_socket_t *sock, switch_sockaddr_t *join, switch_sockaddr_t *iface, switch_sockaddr_t *source);
+
+
+
+/** @} */
+
+/**
+ * @defgroup apr_poll Poll Routines
+ * @ingroup switch_apr
+ * @{
+ */
+/** Poll descriptor set. */
+typedef struct apr_pollfd_t switch_pollfd_t;
+
+/** Opaque structure used for pollset API */
+typedef struct apr_pollset_t switch_pollset_t;
+
+/**
+ * Poll options
+ */
+#define SWITCH_POLLIN 0x001			/**< Can read without blocking */
+#define SWITCH_POLLPRI 0x002			/**< Priority data available */
+#define SWITCH_POLLOUT 0x004			/**< Can write without blocking */
+#define SWITCH_POLLERR 0x010			/**< Pending error */
+#define SWITCH_POLLHUP 0x020			/**< Hangup occurred */
+#define SWITCH_POLLNVAL 0x040		/**< Descriptior invalid */
+
+/**
+ * Setup a pollset object
+ * @param pollset  The pointer in which to return the newly created object 
+ * @param size The maximum number of descriptors that this pollset can hold
+ * @param p The pool from which to allocate the pollset
+ * @param flags Optional flags to modify the operation of the pollset.
+ *
+ * @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is
+ * created on which it is safe to make concurrent calls to
+ * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from
+ * separate threads.  This feature is only supported on some
+ * platforms; the apr_pollset_create() call will fail with
+ * APR_ENOTIMPL on platforms where it is not supported.
+ */
+SWITCH_DECLARE(switch_status_t) switch_pollset_create(switch_pollset_t **pollset,
+													  uint32_t size,
+													  switch_memory_pool_t *p,
+													  uint32_t flags);
+
+/**
+ * Add a socket or file descriptor to a pollset
+ * @param pollset The pollset to which to add the descriptor
+ * @param descriptor The descriptor to add
+ * @remark If you set client_data in the descriptor, that value
+ *         will be returned in the client_data field whenever this
+ *         descriptor is signalled in apr_pollset_poll().
+ * @remark If the pollset has been created with APR_POLLSET_THREADSAFE
+ *         and thread T1 is blocked in a call to apr_pollset_poll() for
+ *         this same pollset that is being modified via apr_pollset_add()
+ *         in thread T2, the currently executing apr_pollset_poll() call in
+ *         T1 will either: (1) automatically include the newly added descriptor
+ *         in the set of descriptors it is watching or (2) return immediately
+ *         with APR_EINTR.  Option (1) is recommended, but option (2) is
+ *         allowed for implementations where option (1) is impossible
+ *         or impractical.
+ */
+SWITCH_DECLARE(switch_status_t) switch_pollset_add(switch_pollset_t *pollset,
+												   const switch_pollfd_t *descriptor);
+
+/**
+ * Poll the sockets in the poll structure
+ * @param aprset The poll structure we will be using. 
+ * @param numsock The number of sockets we are polling
+ * @param nsds The number of sockets signalled.
+ * @param timeout The amount of time in microseconds to wait.  This is 
+ *                a maximum, not a minimum.  If a socket is signalled, we 
+ *                will wake up before this time.  A negative number means 
+ *                wait until a socket is signalled.
+ * @remark The number of sockets signalled is returned in the third argument. 
+ *         This is a blocking call, and it will not return until either a 
+ *         socket has been signalled, or the timeout has expired. 
+ */
+SWITCH_DECLARE(switch_status_t) switch_poll(switch_pollfd_t *aprset,
+											int32_t numsock,
+											int32_t *nsds,
+											switch_interval_time_t timeout);
+
+/*!
+  \brief Create a set of file descriptors to poll
+  \param poll the polfd to create
+  \param sock the socket to add
+  \param flags the flags to modify the behaviour
+  \param pool the memory pool to use
+  \return SWITCH_STATUS_SUCCESS when successful
+*/
+SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t **poll, switch_socket_t *sock, int16_t flags, switch_memory_pool_t *pool);
+
+ 
+ /** @} */
+
+
+
+
 /** @} */
 /** @} */
 

Added: freeswitch/trunk/src/include/switch_core_db.h
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/include/switch_core_db.h	Fri Mar  9 15:44:13 2007
@@ -0,0 +1,378 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthmct at yahoo.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Anthony Minessale II <anthmct at yahoo.com>
+ * Michael Jerris <mike at jerris.com>
+ *
+ * switch_core_db.h -- Sqlite wrapper and extensions Header
+ *
+ */
+/*! \file switch_core_db.h
+    \brief Core DB Header
+*/
+#ifndef SWITCH_CORE_DB_H
+#define SWITCH_CORE_DB_H
+
+SWITCH_BEGIN_EXTERN_C
+
+/**
+ * @defgroup switch_sqlite_top Brought To You By SQLite
+ * @ingroup FREESWITCH
+ * @{
+ */
+
+/**
+ * @defgroup switch_core_db Database Routines
+ * @ingroup switch_sqlite_top 
+ * @{
+ */
+
+/**
+ * Each open database is represented by an instance of the
+ * following opaque structure.
+*/
+
+typedef struct sqlite3 switch_core_db_t;
+typedef struct sqlite3_stmt switch_core_db_stmt_t;
+
+typedef int (*switch_core_db_callback_func_t)(void *pArg, int argc, char **argv, char **columnNames);
+
+/**
+ * A function to close the database.
+ *
+ * Call this function with a pointer to a structure that was previously
+ * returned from switch_core_db_open() and the corresponding database will by closed.
+ *
+ * All SQL statements prepared using switch_core_db_prepare()
+ * must be deallocated using switch_core_db_finalize() before
+ * this routine is called. Otherwise, SWITCH_CORE_DB_BUSY is returned and the
+ * database connection remains open.
+ */
+SWITCH_DECLARE(int) switch_core_db_close(switch_core_db_t *db);
+
+/**
+ * Open the database file "filename".  The "filename" is UTF-8
+ * encoded.  A switch_core_db_t* handle is returned in *Db, even
+ * if an error occurs. If the database is opened (or created) successfully,
+ * then SWITCH_CORE_DB_OK is returned. Otherwise an error code is returned. The
+ * switch_core_db_errmsg() routine can be used to obtain
+ * an English language description of the error.
+ *
+ * If the database file does not exist, then a new database is created.
+ * The encoding for the database is UTF-8.
+ *
+ * Whether or not an error occurs when it is opened, resources associated
+ * with the switch_core_db_t* handle should be released by passing it to
+ * switch_core_db_close() when it is no longer required.
+ */
+SWITCH_DECLARE(int) switch_core_db_open(const char *filename, switch_core_db_t **ppDb);
+
+/**
+ * The next group of routines returns information about the information
+ * in a single column of the current result row of a query.  In every
+ * case the first parameter is a pointer to the SQL statement that is being
+ * executed (the switch_core_db_stmt_t* that was returned from switch_core_db_prepare()) and
+ * the second argument is the index of the column for which information 
+ * should be returned.  iCol is zero-indexed.  The left-most column as an
+ * index of 0.
+ *
+ * If the SQL statement is not currently point to a valid row, or if the
+ * the colulmn index is out of range, the result is undefined.
+ *
+ * These routines attempt to convert the value where appropriate.  For
+ * example, if the internal representation is FLOAT and a text result
+ * is requested, sprintf() is used internally to do the conversion
+ * automatically.  The following table details the conversions that
+ * are applied:
+ *
+ *    Internal Type    Requested Type     Conversion
+ *    -------------    --------------    --------------------------
+ *       NULL             INTEGER         Result is 0
+ *       NULL             FLOAT           Result is 0.0
+ *       NULL             TEXT            Result is an empty string
+ *       NULL             BLOB            Result is a zero-length BLOB
+ *       INTEGER          FLOAT           Convert from integer to float
+ *       INTEGER          TEXT            ASCII rendering of the integer
+ *       INTEGER          BLOB            Same as for INTEGER->TEXT
+ *       FLOAT            INTEGER         Convert from float to integer
+ *       FLOAT            TEXT            ASCII rendering of the float
+ *       FLOAT            BLOB            Same as FLOAT->TEXT
+ *       TEXT             INTEGER         Use atoi()
+ *       TEXT             FLOAT           Use atof()
+ *       TEXT             BLOB            No change
+ *       BLOB             INTEGER         Convert to TEXT then use atoi()
+ *       BLOB             FLOAT           Convert to TEXT then use atof()
+ *       BLOB             TEXT            Add a "\000" terminator if needed
+ *
+ *  Return the value as UTF-8 text.
+ */
+SWITCH_DECLARE(const unsigned char *)switch_core_db_column_text(switch_core_db_stmt_t *stmt, int iCol);
+
+/**
+ * The first parameter is a compiled SQL statement. This function returns
+ * the column heading for the Nth column of that statement, where N is the
+ * second function parameter.  The string returned is UTF-8.
+ */
+SWITCH_DECLARE(const char *)switch_core_db_column_name(switch_core_db_stmt_t *stmt, int N);
+
+/**
+ * Return the number of columns in the result set returned by the compiled
+ * SQL statement. This routine returns 0 if pStmt is an SQL statement
+ * that does not return data (for example an UPDATE).
+ */
+SWITCH_DECLARE(int) switch_core_db_column_count(switch_core_db_stmt_t *pStmt);
+
+/**
+ * Return a pointer to a UTF-8 encoded string describing in english the
+ * error condition for the most recent switch_core_db_* API call. The returned
+ * string is always terminated by an 0x00 byte.
+ *
+ * The string "not an error" is returned when the most recent API call was
+ * successful.
+ */
+SWITCH_DECLARE(const char *)switch_core_db_errmsg(switch_core_db_t *db);
+
+/**
+ * A function to executes one or more statements of SQL.
+ *
+ * If one or more of the SQL statements are queries, then
+ * the callback function specified by the 3rd parameter is
+ * invoked once for each row of the query result.  This callback
+ * should normally return 0.  If the callback returns a non-zero
+ * value then the query is aborted, all subsequent SQL statements
+ * are skipped and the switch_core_db_exec() function returns the SWITCH_CORE_DB_ABORT.
+ *
+ * The 4th parameter is an arbitrary pointer that is passed
+ * to the callback function as its first parameter.
+ *
+ * The 2nd parameter to the callback function is the number of
+ * columns in the query result.  The 3rd parameter to the callback
+ * is an array of strings holding the values for each column.
+ * The 4th parameter to the callback is an array of strings holding
+ * the names of each column.
+ *
+ * The callback function may be NULL, even for queries.  A NULL
+ * callback is not an error.  It just means that no callback
+ * will be invoked.
+ *
+ * If an error occurs while parsing or evaluating the SQL (but
+ * not while executing the callback) then an appropriate error
+ * message is written into memory obtained from malloc() and
+ * *errmsg is made to point to that message.  The calling function
+ * is responsible for freeing the memory that holds the error
+ * message.   Use switch_core_db_free() for this.  If errmsg==NULL,
+ * then no error message is ever written.
+ *
+ * The return value is is SWITCH_CORE_DB_OK if there are no errors and
+ * some other return code if there is an error.  The particular
+ * return value depends on the type of error. 
+ *
+ * If the query could not be executed because a database file is
+ * locked or busy, then this function returns SWITCH_CORE_DB_BUSY.  (This
+ * behavior can be modified somewhat using the sswitch_core_db_busy_handler()
+ * and switch_core_db_busy_timeout() functions below.)
+ */
+SWITCH_DECLARE(int) switch_core_db_exec(switch_core_db_t *db,
+										const char *sql,
+										switch_core_db_callback_func_t callback,
+										void *data,
+										char **errmsg);
+
+/**
+ * This function is called to delete a compiled
+ * SQL statement obtained by a previous call to switch_core_db_prepare().
+ * If the statement was executed successfully, or
+ * not executed at all, then SWITCH_CORE_DB_OK is returned. If execution of the
+ * statement failed then an error code is returned. 
+ *
+ * This routine can be called at any point during the execution of the
+ * virtual machine.  If the virtual machine has not completed execution
+ * when this routine is called, that is like encountering an error or
+ * an interrupt.  (See switch_core_db_interrupt().)  Incomplete updates may be
+ * rolled back and transactions cancelled,  depending on the circumstances,
+ * and the result code returned will be SWITCH_CORE_DB_ABORT.
+ */
+SWITCH_DECLARE(int) switch_core_db_finalize(switch_core_db_stmt_t *pStmt);
+
+/**
+ * To execute an SQL query, it must first be compiled into a byte-code
+ * program using the following routine.
+ *
+ * The first parameter "db" is an SQLite database handle. The second
+ * parameter "zSql" is the statement to be compiled, encoded as
+ * UTF-8. If the next parameter, "nBytes", is less
+ * than zero, then zSql is read up to the first nul terminator.  If
+ * "nBytes" is not less than zero, then it is the length of the string zSql
+ * in bytes (not characters).
+ *
+ * *pzTail is made to point to the first byte past the end of the first
+ * SQL statement in zSql.  This routine only compiles the first statement
+ * in zSql, so *pzTail is left pointing to what remains uncompiled.
+ *
+ * *ppStmt is left pointing to a compiled SQL statement that can be
+ * executed using switch_core_db_step().  Or if there is an error, *ppStmt may be
+ * set to NULL.  If the input text contained no SQL (if the input is and
+ * empty string or a comment) then *ppStmt is set to NULL.
+ *
+ * On success, SWITCH_CORE_DB_OK is returned.  Otherwise an error code is returned.
+ */
+SWITCH_DECLARE(int) switch_core_db_prepare(switch_core_db_t *db,
+										   const char *zSql,
+										   int nBytes,
+										   switch_core_db_stmt_t **ppStmt,
+										   const char **pzTail);
+
+/** 
+ * After an SQL query has been compiled with a call to either
+ * switch_core_db_prepare(), then this function must be
+ * called one or more times to execute the statement.
+ *
+ * The return value will be either SWITCH_CORE_DB_BUSY, SWITCH_CORE_DB_DONE, 
+ * SWITCH_CORE_DB_ROW, SWITCH_CORE_DB_ERROR, or SWITCH_CORE_DB_MISUSE.
+ *
+ * SWITCH_CORE_DB_BUSY means that the database engine attempted to open
+ * a locked database and there is no busy callback registered.
+ * Call switch_core_db_step() again to retry the open.
+ *
+ * SWITCH_CORE_DB_DONE means that the statement has finished executing
+ * successfully.  switch_core_db_step() should not be called again on this virtual
+ * machine.
+ *
+ * If the SQL statement being executed returns any data, then 
+ * SWITCH_CORE_DB_ROW is returned each time a new row of data is ready
+ * for processing by the caller. The values may be accessed using
+ * the switch_core_db_column_*() functions described below. switch_core_db_step()
+ * is called again to retrieve the next row of data.
+ * 
+ * SWITCH_CORE_DB_ERROR means that a run-time error (such as a constraint
+ * violation) has occurred.  switch_core_db_step() should not be called again on
+ * the VM. More information may be found by calling switch_core_db_errmsg().
+ *
+ * SWITCH_CORE_DB_MISUSE means that the this routine was called inappropriately.
+ * Perhaps it was called on a virtual machine that had already been
+ * finalized or on one that had previously returned SWITCH_CORE_DB_ERROR or
+ * SWITCH_CORE_DB_DONE.  Or it could be the case the the same database connection
+ * is being used simulataneously by two or more threads.
+ */
+SWITCH_DECLARE(int) switch_core_db_step(switch_core_db_stmt_t *stmt);
+
+/**
+ * Call this routine to free the memory that switch_core_db_get_table() allocated.
+ */
+SWITCH_DECLARE(void) switch_core_db_free(char *z);
+
+/** Return values for switch_core_db_exec() and switch_core_db_step()*/
+#define SWITCH_CORE_DB_OK           0   /* Successful result */
+/* beginning-of-error-codes */
+#define SWITCH_CORE_DB_ERROR        1   /* SQL error or missing database */
+#define SWITCH_CORE_DB_INTERNAL     2   /* NOT USED. Internal logic error in SQLite */
+#define SWITCH_CORE_DB_PERM         3   /* Access permission denied */
+#define SWITCH_CORE_DB_ABORT        4   /* Callback routine requested an abort */
+#define SWITCH_CORE_DB_BUSY         5   /* The database file is locked */
+#define SWITCH_CORE_DB_LOCKED       6   /* A table in the database is locked */
+#define SWITCH_CORE_DB_NOMEM        7   /* A malloc() failed */
+#define SWITCH_CORE_DB_READONLY     8   /* Attempt to write a readonly database */
+#define SWITCH_CORE_DB_INTERRUPT    9   /* Operation terminated by switch_core_db_interrupt()*/
+#define SWITCH_CORE_DB_IOERR       10   /* Some kind of disk I/O error occurred */
+#define SWITCH_CORE_DB_CORRUPT     11   /* The database disk image is malformed */
+#define SWITCH_CORE_DB_NOTFOUND    12   /* NOT USED. Table or record not found */
+#define SWITCH_CORE_DB_FULL        13   /* Insertion failed because database is full */
+#define SWITCH_CORE_DB_CANTOPEN    14   /* Unable to open the database file */
+#define SWITCH_CORE_DB_PROTOCOL    15   /* Database lock protocol error */
+#define SWITCH_CORE_DB_EMPTY       16   /* Database is empty */
+#define SWITCH_CORE_DB_SCHEMA      17   /* The database schema changed */
+#define SWITCH_CORE_DB_TOOBIG      18   /* NOT USED. Too much data for one row */
+#define SWITCH_CORE_DB_CONSTRAINT  19   /* Abort due to contraint violation */
+#define SWITCH_CORE_DB_MISMATCH    20   /* Data type mismatch */
+#define SWITCH_CORE_DB_MISUSE      21   /* Library used incorrectly */
+#define SWITCH_CORE_DB_NOLFS       22   /* Uses OS features not supported on host */
+#define SWITCH_CORE_DB_AUTH        23   /* Authorization denied */
+#define SWITCH_CORE_DB_FORMAT      24   /* Auxiliary database format error */
+#define SWITCH_CORE_DB_RANGE       25   /* 2nd parameter to switch_core_db_bind out of range */
+#define SWITCH_CORE_DB_NOTADB      26   /* File opened that is not a database file */
+#define SWITCH_CORE_DB_ROW         100  /* switch_core_db_step() has another row ready */
+#define SWITCH_CORE_DB_DONE        101  /* switch_core_db_step() has finished executing */
+/* end-of-error-codes */
+
+
+/** @} */
+/** @} */
+/**
+ * This routine is a variant of the "sprintf()" from the
+ * standard C library.  The resulting string is written into memory
+ * obtained from malloc() so that there is never a possiblity of buffer
+ * overflow.  This routine also implement some additional formatting
+ * options that are useful for constructing SQL statements.
+ *
+ * The strings returned by this routine should be freed by calling
+ * switch_core_db_free().
+ *
+ * All of the usual printf formatting options apply.  In addition, there
+ * is a "%q" option.  %q works like %s in that it substitutes a null-terminated
+ * string from the argument list.  But %q also doubles every '\'' character.
+ * %q is designed for use inside a string literal.  By doubling each '\''
+ * character it escapes that character and allows it to be inserted into
+ * the string.
+ *
+ * For example, so some string variable contains text as follows:
+ *
+ *      char *zText = "It's a happy day!";
+ *
+ * We can use this text in an SQL statement as follows:
+ *
+ *      char *z = switch_core_db_mprintf("INSERT INTO TABLES('%q')", zText);
+ *      switch_core_db_exec(db, z, callback1, 0, 0);
+ *      switch_core_db_free(z);
+ *
+ * Because the %q format string is used, the '\'' character in zText
+ * is escaped and the SQL generated is as follows:
+ *
+ *      INSERT INTO table1 VALUES('It''s a happy day!')
+ *
+ * This is correct.  Had we used %s instead of %q, the generated SQL
+ * would have looked like this:
+ *
+ *      INSERT INTO table1 VALUES('It's a happy day!');
+ *
+ * This second example is an SQL syntax error.  As a general rule you
+ * should always use %q instead of %s when inserting text into a string 
+ * literal.
+ */
+SWITCH_DECLARE(char *)switch_mprintf(const char *zFormat,...);
+
+SWITCH_END_EXTERN_C
+
+#endif
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ */

Modified: freeswitch/trunk/src/include/switch_ivr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_ivr.h	(original)
+++ freeswitch/trunk/src/include/switch_ivr.h	Fri Mar  9 15:44:13 2007
@@ -221,13 +221,6 @@
                                                        switch_input_args_t *args,
                                                        uint32_t limit);
 
-/*!
- \brief Function to evaluate an expression against a string
- \param target The string to find a match in
- \param expression The regular expression to run against the string
- \return Boolean if a match was found or not
-*/
-SWITCH_DECLARE(switch_status_t) switch_regex_match(char *target, char *expression);
 
 /*!
   \brief Play a sound and gather digits with the number of retries specified if the user doesn't give digits in the set time

Modified: freeswitch/trunk/src/include/switch_platform.h
==============================================================================
--- freeswitch/trunk/src/include/switch_platform.h	(original)
+++ freeswitch/trunk/src/include/switch_platform.h	Fri Mar  9 15:44:13 2007
@@ -48,6 +48,7 @@
 #define __SWITCH_FUNC__ (const char *)__func__
 #endif
 
+
 #ifdef _MSC_VER
 
 
@@ -62,7 +63,7 @@
  * C4512: assignment operator could not be generated
  * C4610: struct  can never be instantiated - user defined constructor required
  */
-#pragma warning(disable:4100 4200 4204 4706 4819 4132 4510 4512 4610)
+#pragma warning(disable:4100 4200 4204 4706 4819 4132 4510 4512 4610 4996)
 
 #if (_MSC_VER >= 1400) // VC8+
 #ifndef _CRT_SECURE_NO_DEPRECATE
@@ -93,20 +94,21 @@
 typedef __int64		int64_t;
 typedef unsigned long	in_addr_t;
 #endif
+typedef  int         pid_t;
+typedef  int         uid_t;
+typedef  int         gid_t;
 #define PACKED
 #include <io.h>
+#define strcasecmp(s1, s2) stricmp(s1, s2)
+#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
 #else
 /* packed attribute */
 #ifndef PACKED
 #define PACKED __attribute__ ((__packed__))
 #endif
-#include <limits.h>
-#include <inttypes.h>
-#include <sys/types.h>
 #include <inttypes.h>
 #include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
+#include <arpa/inet.h>
 #endif // _MSC_VER
 
 #ifndef __LITTLE_ENDIAN
@@ -124,6 +126,7 @@
 #endif
 
 #ifdef WIN32
+
 #if defined(SWITCH_CORE_DECLARE_STATIC)
 #define SWITCH_DECLARE(type)			type __stdcall
 #define SWITCH_DECLARE_NONSTD(type)		type __cdecl
@@ -152,11 +155,13 @@
 #ifndef S_IWUSR
 #define S_IWUSR _S_IWRITE
 #endif
+#define SWITCH_THREAD_FUNC  __stdcall
 #else //not win32
 #define SWITCH_DECLARE(type) type
 #define SWITCH_DECLARE_NONSTD(type) type
 #define SWITCH_MOD_DECLARE(type) type
 #define SWITCH_DECLARE_DATA
+#define SWITCH_THREAD_FUNC
 #endif
 
 #ifdef DOXYGEN
@@ -171,10 +176,115 @@
 #define PRINTF_FUNCTION(fmtstr,vars)
 #endif
 
+#ifdef SWITCH_INT32
+typedef SWITCH_INT32 switch_int32_t;
+#else
+typedef int32_t switch_int32_t;
+#endif
+
+#ifdef SWITCH_SIZE_T
+typedef  SWITCH_SIZE_T  switch_size_t;
+#else
+typedef  uintptr_t  switch_size_t;
+#endif
+
+#ifdef SWITCH_SSIZE_T
+typedef  SWITCH_SSIZE_T   switch_ssize_t;
+#else
+typedef  intptr_t	switch_ssize_t;
+#endif
+
+#ifdef WIN32
+
+#ifdef WIN64
+#define SWITCH_SSIZE_T_FMT          "%I64d"
+#define SWITCH_SIZE_T_FMT           "%I64d"
+#else
+#define SWITCH_SSIZE_T_FMT          "%d"
+#define SWITCH_SIZE_T_FMT           "%d"
+#endif
+
+#define SWITCH_INT64_T_FMT          "%I64d"
+#define SWITCH_UINT64_T_FMT         "%I64u"
+
+#else
+#ifndef SWITCH_SSIZE_T_FMT
+#define SWITCH_SSIZE_T_FMT          (sizeof (switch_ssize_t) == sizeof (long) ? "%ld" : sizeof (switch_ssize_t) == sizeof (int) ? "%d" : "%lld")
+#endif
+
+#ifndef SWITCH_SIZE_T_FMT
+#define SWITCH_SIZE_T_FMT           (sizeof (switch_size_t) == sizeof (long) ? "%lu" : sizeof (switch_size_t) == sizeof (int) ? "%u" : "%llu")
+#endif
+
+#ifndef SWITCH_INT64_T_FMT
+#define SWITCH_INT64_T_FMT          (sizeof (long) == 8 ? "%ld" : "%lld")
+#endif
+
+#ifndef SWITCH_UINT64_T_FMT
+#define SWITCH_UINT64_T_FMT         (sizeof (long) == 8 ? "%lu" : "%llu")
+#endif
+
+#endif
+
+#define SWITCH_TIME_T_FMT SWITCH_INT64_T_FMT
+
 SWITCH_END_EXTERN_C
 
+/* these includes must be outside the extern "C" block on windows or it will break compatibility with c++ modules*/
+#ifdef WIN32
+/* Has windows.h already been included?  If so, our preferences don't matter,
+ * but we will still need the winsock things no matter what was included.
+ * If not, include a restricted set of windows headers to our tastes.
+ */
+#ifndef _WINDOWS_
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#ifndef _WIN32_WINNT
+
+/* Restrict the server to a subset of Windows NT 4.0 header files by default
+ */
+#define _WIN32_WINNT 0x0400
+#endif
+#ifndef NOUSER
+#define NOUSER
+#endif
+#ifndef NOMCX
+#define NOMCX
+#endif
+#ifndef NOIME
+#define NOIME
+#endif
+#include <windows.h>
+/* 
+ * Add a _very_few_ declarations missing from the restricted set of headers
+ * (If this list becomes extensive, re-enable the required headers above!)
+ * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now
+ */
+#define SW_HIDE             0
+#ifndef _WIN32_WCE
+#include <winsock2.h>
+#include <mswsock.h>
+#include <ws2tcpip.h>
+#else
+#include <winsock.h>
+#endif
+#endif /* !_WINDOWS_ */
+#include <process.h>
+#endif
+
 #endif
 
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef TRUE
+#define TRUE (!FALSE)
+#endif
+
+
+
 /* For Emacs:
  * Local Variables:
  * mode:c

Added: freeswitch/trunk/src/include/switch_private.h.in
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/include/switch_private.h.in	Fri Mar  9 15:44:13 2007
@@ -0,0 +1,158 @@
+/* src/include/switch_private.h.in.  Generated from configure.in by autoheader.  */
+
+/* Enable extra debugging. */
+#undef DEBUG
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+   */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+   to 0 otherwise. */
+#undef HAVE_MALLOC
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mlock' function. */
+#undef HAVE_MLOCK
+
+/* Define to 1 if you have the `mlockall' function. */
+#undef HAVE_MLOCKALL
+
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strftime' function. */
+#undef HAVE_STRFTIME
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+   */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+   */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `usleep' function. */
+#undef HAVE_USLEEP
+
+/* Define to 1 if you have the `vasprintf' function. */
+#undef HAVE_VASPRINTF
+
+/* Enable Optimization. */
+#undef OPTIMZER
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* The size of a `char', as computed by sizeof. */
+#undef SIZEOF_CHAR
+
+/* The size of a `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of a `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of a `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of a `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of size_t */
+#undef SIZEOF_SIZE_T
+
+/* The size of ssize_t */
+#undef SIZEOF_SSIZE_T
+
+/* The size of a `void*', as computed by sizeof. */
+#undef SIZEOF_VOIDP
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Little Endian */
+#undef SWITCH_BYTE_ORDER
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* sunpro is bad at inline */
+#undef __inline__
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef ssize_t

Added: freeswitch/trunk/src/include/switch_regex.h
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/include/switch_regex.h	Fri Mar  9 15:44:13 2007
@@ -0,0 +1,93 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Michael Jerris <mike at jerris.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Michael Jerris <mike at jerris.com>
+ *
+ * switch_regex.h -- pcre wrapper and extensions Header
+ *
+ */
+/*! \file switch_regex.h
+    \brief Regex Header
+*/
+#ifndef SWITCH_REGEX_H
+#define SWITCH_REGEX_H
+
+SWITCH_BEGIN_EXTERN_C
+
+/**
+ * @defgroup switch_regex
+ * @ingroup FREESWITCH
+ * @{
+ */
+
+typedef struct real_pcre switch_regex_t;
+
+SWITCH_DECLARE(switch_regex_t *) switch_regex_compile(const char *pattern,
+													  int options,
+													  const char **errorptr,
+													  int *erroroffset,
+													  const unsigned char *tables);
+
+SWITCH_DECLARE(int) switch_regex_copy_substring(const char *subject,
+												int *ovector,
+												int stringcount,
+												int stringnumber,
+												char *buffer,
+												int size);
+
+SWITCH_DECLARE(void) switch_regex_free(void *data);
+
+SWITCH_DECLARE(int) switch_regex_perform(char *field, char *expression, switch_regex_t **new_re, int *ovector, uint32_t olen);
+SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_count, char *data, char *field_data, char *substituted, uint32_t len, int *ovector);
+
+/*!
+ \brief Function to evaluate an expression against a string
+ \param target The string to find a match in
+ \param expression The regular expression to run against the string
+ \return Boolean if a match was found or not
+*/
+SWITCH_DECLARE(switch_status_t) switch_regex_match(char *target, char *expression);
+
+#define switch_regex_safe_free(re)	if (re) {\
+				switch_regex_free(re);\
+				re = NULL;\
+			}
+
+/** @} */
+
+SWITCH_END_EXTERN_C
+
+#endif
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ */

Modified: freeswitch/trunk/src/include/switch_resample.h
==============================================================================
--- freeswitch/trunk/src/include/switch_resample.h	(original)
+++ freeswitch/trunk/src/include/switch_resample.h	Fri Mar  9 15:44:13 2007
@@ -45,7 +45,6 @@
 
 #include <switch.h>
 SWITCH_BEGIN_EXTERN_C
-#include <stdlib.h>
 
 /*!
   \defgroup resamp Audio Resample Functions

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Fri Mar  9 15:44:13 2007
@@ -35,7 +35,6 @@
 #define SWITCH_TYPES_H
 
 #include <switch.h>
-#include <ctype.h>
 SWITCH_BEGIN_EXTERN_C
 
 #define SWITCH_SEQ_ESC "\033["
@@ -503,7 +502,6 @@
 	SCSMF_DYNAMIC = (1 << 0)
 } switch_core_session_message_flag_t;
 
-#define SWITCH_UUID_FORMATTED_LENGTH APR_UUID_FORMATTED_LENGTH 	
 #define SWITCH_CHANNEL_LOG SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__
 #define SWITCH_CHANNEL_LOG_CLEAN SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__
 #define SWITCH_CHANNEL_EVENT SWITCH_CHANNEL_ID_EVENT, __FILE__, __SWITCH_FUNC__, __LINE__
@@ -944,6 +942,7 @@
 	SCSC_CHECK_RUNNING
 } switch_session_ctl_t;
 
+typedef uint16_t switch_port_t;
 typedef uint8_t switch_payload_t;
 typedef struct switch_rtp switch_rtp_t;
 typedef struct switch_core_session_message switch_core_session_message_t;
@@ -1032,7 +1031,6 @@
                                                  switch_say_type_t type,
                                                  switch_say_method_t method,
                                                  switch_input_args_t *args);
-typedef int (*switch_core_db_callback_func_t)(void *pArg, int argc, char **argv, char **columnNames);
 typedef switch_status_t (*switch_module_load_t) (switch_loadable_module_interface_t **, char *);
 typedef switch_status_t (*switch_module_reload_t) (void);
 typedef switch_status_t (*switch_module_pause_t) (void);

Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h	(original)
+++ freeswitch/trunk/src/include/switch_utils.h	Fri Mar  9 15:44:13 2007
@@ -39,30 +39,15 @@
 #define SWITCH_UTILS_H
 
 #include <switch.h>
-#include <pcre.h>
 
 SWITCH_BEGIN_EXTERN_C
 
-#ifndef snprintf
-#define snprintf apr_snprintf
-#endif
-#ifndef vsnprintf
-#define vsnprintf apr_vsnprintf
-#endif
-
 #define switch_bytes_per_frame(rate, interval) ((uint32_t)((float)rate / (1000.0f / (float)interval)))
 
 #define SWITCH_SMAX 32767
 #define SWITCH_SMIN -32768
 #define switch_normalize_to_16bit(n) if (n > SWITCH_SMAX) n = SWITCH_SMAX / 2; else if (n < SWITCH_SMIN) n = SWITCH_SMIN / 2;
 
-SWITCH_DECLARE(char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in);
-
-SWITCH_DECLARE(apr_status_t) switch_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
-									apr_int32_t flags, char *buf, 
-									apr_size_t *len);
-
-
 #define switch_codec2str(codec,buf,len) snprintf(buf, len, "%s@%uk@%ui", \
                                                  codec->implementation->iananame, \
                                                  codec->implementation->samples_per_second, \
@@ -133,10 +118,6 @@
  */
 #define is_dtmf(key)  ((key > 47 && key < 58) || (key > 64 && key < 69) || (key > 96 && key < 101) || key == 35 || key == 42 || key == 87 || key == 119)
 
-/*!
-  \brief Duplicate a string 
-*/
-#define switch_copy_string apr_cpystrn
 
 /*!
   \brief Test for the existance of a flag on an arbitary object
@@ -209,13 +190,7 @@
 /*!
   \brief Wait a desired number of microseconds and yield the CPU
 */
-#if defined(HAVE_USLEEP)
-#define switch_yield(ms) usleep(ms);
-#elif defined(WIN32)
-#define switch_yield(ms) Sleep((DWORD)((ms) / 1000));
-#else
-#define switch_yield(ms) apr_sleep(ms); //apr_thread_yield();
-#endif
+#define switch_yield(ms) switch_sleep(ms);
 
 /*!
   \brief Converts a string representation of a date into a switch_time_t
@@ -253,16 +228,6 @@
 SWITCH_DECLARE(char *) switch_escape_char(switch_memory_pool_t *pool, char *in, char *delim, char esc);
 
 /*!
-  \brief Create a set of file descriptors to poll
-  \param poll the polfd to create
-  \param sock the socket to add
-  \param flags the flags to modify the behaviour
-  \param pool the memory pool to use
-  \return SWITCH_STATUS_SUCCESS when successful
-*/
-SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t *poll, switch_socket_t *sock, switch_int16_t flags, switch_memory_pool_t *pool);
-
-/*!
   \brief Wait for a socket
   \param poll the pollfd to wait on
   \param ms the number of milliseconds to wait
@@ -276,20 +241,12 @@
 */
 SWITCH_DECLARE(const char *) switch_cut_path(const char *in);
 
-#define switch_clean_re(re)	if (re) {\
-				pcre_free(re);\
-				re = NULL;\
-			}
-
 SWITCH_DECLARE(char *) switch_string_replace(const char *string, const char *search, const char *replace);
 SWITCH_DECLARE(switch_status_t) switch_string_match(const char *string, size_t string_len, const char *search, size_t search_len);
-SWITCH_DECLARE(int) switch_perform_regex(char *field, char *expression, pcre **new_re, int *ovector, uint32_t olen);
-SWITCH_DECLARE(void) switch_perform_substitution(pcre *re, int match_count, char *data, char *field_data, char *substituted, uint32_t len, int *ovector);
 
 #define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK)
 SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len);
 SWITCH_DECLARE(char *) switch_url_decode(char *s);
-SWITCH_DECLARE(switch_status_t) switch_file_exists(const char *filename);
 SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/trunk/src/include/switch_xml.h
==============================================================================
--- freeswitch/trunk/src/include/switch_xml.h	(original)
+++ freeswitch/trunk/src/include/switch_xml.h	Fri Mar  9 15:44:13 2007
@@ -55,11 +55,7 @@
 
 #ifndef _SWITCH_XML_H
 #define _SWITCH_XML_H
-#include <switch_types.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <fcntl.h>
+#include <switch.h>
 
 
 ///\defgroup xml1 XML Library Functions

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Fri Mar  9 15:44:13 2007
@@ -374,7 +374,7 @@
         out = switch_str_time(data);
     }
 
-    stream->write_function(stream, "%d", (uint32_t)apr_time_sec(out));
+    stream->write_function(stream, "%d", (uint32_t)((out) / (int64_t)(1000000)) );
 
 	return SWITCH_STATUS_SUCCESS;
 }

Modified: freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c	Fri Mar  9 15:44:13 2007
@@ -315,16 +315,16 @@
 		}
 
 		if (flags && service && regex && replace) {
-			pcre *re = NULL;
+			switch_regex_t *re = NULL;
 			int proceed = 0, ovector[30];
 			char substituted[1024] = "";
 			char rbuf[1024] = "";
 			char *uri;
 			enum_route_t *route;
 
-			switch_clean_re(re);
+			switch_regex_safe_free(re);
 
-			if ((proceed = switch_perform_regex(q->number, regex, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
+			if ((proceed = switch_regex_perform(q->number, regex, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
 				if (strchr(regex, '(')) {
 					switch_perform_substitution(re, proceed, replace, q->number, substituted, sizeof(substituted), ovector);
 					uri = substituted;
@@ -333,8 +333,8 @@
 				}
 
 				if ((route = (enum_route_t *) switch_core_hash_find(globals.routes, service))){
-					switch_clean_re(re);
-					if ((proceed = switch_perform_regex(uri, route->regex, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
+					switch_regex_safe_free(re);
+					if ((proceed = switch_regex_perform(uri, route->regex, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
 						if (strchr(route->regex, '(')) {
 							switch_perform_substitution(re, proceed, route->replace, uri, rbuf, sizeof(rbuf), ovector);
 							uri = rbuf;
@@ -347,7 +347,7 @@
 				add_result(q, order, preference, service, uri);
 			}
 
-			switch_clean_re(re);
+			switch_regex_safe_free(re);
 		}
 
 		break;

Modified: freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
==============================================================================
--- freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	(original)
+++ freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	Fri Mar  9 15:44:13 2007
@@ -63,7 +63,7 @@
 		char *do_break_a = NULL;
 		char *expression = NULL;
 		char *field_data = NULL;
-		pcre *re = NULL;
+		switch_regex_t *re = NULL;
 		int ovector[30];
 		break_t do_break_i = BREAK_ON_FALSE;
 		
@@ -118,7 +118,7 @@
 				field_data = "";
 			}
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "test conditions %s(%s) =~ /%s/\n", field, field_data, expression);
-			if (!(proceed = switch_perform_regex(field_data, expression, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
+			if (!(proceed = switch_regex_perform(field_data, expression, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Regex mismatch\n");
 
 				for (xaction = switch_xml_child(xcond, "anti-action"); xaction; xaction = xaction->next) {
@@ -181,7 +181,7 @@
             switch_safe_free(substituted);
 		}
         
-		switch_clean_re(re);
+		switch_regex_safe_free(re);
 
 		if (do_break_i == BREAK_ON_TRUE || do_break_i == BREAK_ALWAYS) {
 			break;

Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Fri Mar  9 15:44:13 2007
@@ -363,7 +363,7 @@
 						 type, rpid, status, proto, from);
 	
 	
-	for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+	for (hi = switch_hash_first(switch_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
 		char *errmsg;
         switch_hash_this(hi, NULL, NULL, &val);
         profile = (struct mdl_profile *) val;
@@ -462,7 +462,7 @@
 		sql = switch_mprintf("select *,'%q' from subscriptions", status ? status : "");
 	}
 
-	for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+	for (hi = switch_hash_first(switch_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
 		char *errmsg;
         switch_hash_this(hi, NULL, NULL, &val);
         profile = (struct mdl_profile *) val;
@@ -537,7 +537,7 @@
 	sql = switch_mprintf("select * from subscriptions");
 	
 
-	for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+	for (hi = switch_hash_first(switch_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
 		char *errmsg;
         switch_hash_this(hi, NULL, NULL, &val);
         profile = (struct mdl_profile *) val;

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Fri Mar  9 15:44:13 2007
@@ -717,7 +717,7 @@
 
 	snprintf(buf, sizeof(buf), 
 			 "v=0\n"
-			 "o=FreeSWITCH %d%"APR_TIME_T_FMT" %d%"APR_TIME_T_FMT" IN IP4 %s\n"
+			 "o=FreeSWITCH %d%"SWITCH_TIME_T_FMT" %d%"SWITCH_TIME_T_FMT" IN IP4 %s\n"
 			 "s=FreeSWITCH\n"
 			 "c=IN IP4 %s\n"
 			 "t=0 0\n"
@@ -3219,13 +3219,13 @@
 		while (running < 5000) {
 			int result = switch_core_db_step(stmt);
 
-			if (result == SQLITE_ROW) {
+			if (result == SWITCH_CORE_DB_ROW) {
 				if ((colcount = switch_core_db_column_count(stmt))) {
 					switch_copy_string(npassword, (char *)switch_core_db_column_text(stmt, 0), len);
 					ret = npassword;
 				}
 				break;
-			} else if (result == SQLITE_BUSY) {
+			} else if (result == SWITCH_CORE_DB_BUSY) {
 				running++;
 				switch_yield(1000);
 				continue;
@@ -5639,7 +5639,7 @@
     void *val;
 
 	if ((sql = switch_mprintf("select 0,'unavailable','unavailable',* from sip_subscriptions where event='presence'"))) {
-		for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+		for (hi = switch_hash_first(switch_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
 			switch_hash_this(hi, NULL, NULL, &val);
 			profile = (sofia_profile_t *) val;
 			if (!(profile->pflags & PFLAG_PRESENCE)) {
@@ -5773,7 +5773,7 @@
 			sql = switch_mprintf("select 1,'%q','%q',* from sip_subscriptions where event='presence'", status, rpid);
 		}
 
-		for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+		for (hi = switch_hash_first(switch_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
 			switch_hash_this(hi, NULL, NULL, &val);
 			profile = (sofia_profile_t *) val;
 			if (!(profile->pflags & PFLAG_PRESENCE)) {
@@ -5872,7 +5872,7 @@
 		break;
 	}
 
-    for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+    for (hi = switch_hash_first(switch_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
         switch_hash_this(hi, NULL, NULL, &val);
         profile = (sofia_profile_t *) val;
         if (!(profile->pflags & PFLAG_PRESENCE)) {

Modified: freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c	Fri Mar  9 15:44:13 2007
@@ -117,7 +117,7 @@
 struct woomera_profile {
 	char *name;
 	switch_socket_t *woomera_socket;
-	apr_thread_mutex_t *iolock;
+	switch_mutex_t *iolock;
 	char woomera_host[WOOMERA_STRLEN];
 	switch_port_t woomera_port;
 	char audio_ip[WOOMERA_STRLEN];
@@ -134,9 +134,9 @@
 	switch_codec_t read_codec;
 	switch_codec_t write_codec;
 	switch_core_session_t *session;
-	switch_pollfd_t read_poll;
-	switch_pollfd_t write_poll;
-	switch_pollfd_t command_poll;
+	switch_pollfd_t *read_poll;
+	switch_pollfd_t *write_poll;
+	switch_pollfd_t *command_poll;
 	char databuf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
 	switch_mutex_t *iolock;
 	switch_sockaddr_t *udpread;
@@ -306,7 +306,7 @@
 static void udp_socket_close(struct private_object *tech_pvt)
 {
 	if (tech_pvt->udp_socket) {
-		apr_socket_shutdown(tech_pvt->udp_socket, APR_SHUTDOWN_READWRITE);
+		switch_socket_shutdown(tech_pvt->udp_socket, SWITCH_SHUTDOWN_READWRITE);
 		woomera_socket_close(&tech_pvt->udp_socket);
 	}
 }
@@ -364,7 +364,7 @@
 	tech_pvt = switch_core_session_get_private(session);
 	assert(tech_pvt != NULL);
 
-	return switch_socket_waitfor(&tech_pvt->read_poll, ms) ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
+	return switch_socket_waitfor(tech_pvt->read_poll, ms) ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
 }
 
 static switch_status_t woomera_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
@@ -375,7 +375,7 @@
 	assert(tech_pvt != NULL);
 
 	return SWITCH_STATUS_SUCCESS;
-//	return switch_socket_waitfor(&tech_pvt->write_poll, ms);
+//	return switch_socket_waitfor(tech_pvt->write_poll, ms);
 }
 
 static switch_status_t woomera_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.h
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.h	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.h	Fri Mar  9 15:44:13 2007
@@ -65,7 +65,7 @@
 #define STDCALL
 #endif
 
-typedef apr_status_t (STDCALL *modcdr_time_convert_t)(apr_time_exp_t*,apr_time_t);
+typedef switch_status_t (STDCALL *modcdr_time_convert_t)(switch_time_exp_t*,switch_time_t);
 
 class BaseCDR {
 	public:

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.cpp
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.cpp	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.cpp	Fri Mar  9 15:44:13 2007
@@ -67,7 +67,7 @@
 		convert_time(&tempcallend, callenddate);
 		
 		// Format the times
-		apr_size_t retsizecsd, retsizecad, retsizectd, retsizeced;  //csd == callstartdate, cad == callanswerdate, ced == callenddate, ceff == callenddate_forfile
+		switch_size_t retsizecsd, retsizecad, retsizectd, retsizeced;  //csd == callstartdate, cad == callanswerdate, ced == callenddate, ceff == callenddate_forfile
 		char format[] = "%Y-%m-%d %H:%M:%S";
 		switch_strftime(formattedcallstartdate,&retsizecsd,sizeof(formattedcallstartdate),format,&tempcallstart);
 		switch_strftime(formattedcallanswerdate,&retsizecad,sizeof(formattedcallanswerdate),format,&tempcallanswer);
@@ -213,7 +213,7 @@
 		
 	switch_time_exp_lt(&now_converted,now);
 		
-	apr_size_t retsize;		
+	switch_size_t retsize;		
 	char format[] = "%Y-%m-%d-%H-%M-%S";
 	char formatteddate[100];
 	memset(formatteddate,0,100);

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	Fri Mar  9 15:44:13 2007
@@ -65,10 +65,10 @@
 	char *next, *cur;
 	uint32_t count = 0;
 	uint8_t custom = 0;
-	apr_ssize_t hlen = APR_HASH_KEY_STRING;
+	switch_ssize_t hlen = SWITCH_HASH_KEY_STRING;
 
 	gethostname(globals.hostname, sizeof(globals.hostname));
-	globals.host_hash = apr_hashfunc_default(globals.hostname, &hlen);
+	globals.host_hash = switch_hashfunc_default(globals.hostname, &hlen);
 	globals.key_count = 0;
 
 	if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
@@ -256,7 +256,7 @@
 {
 	int x = 0;
 
-	switch_socket_shutdown(globals.udp_socket, APR_SHUTDOWN_READWRITE);
+	switch_socket_shutdown(globals.udp_socket, SWITCH_SHUTDOWN_READWRITE);
 	globals.running = -1;
 	while(x < 100000 && globals.running) {
 		x++;

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Fri Mar  9 15:44:13 2007
@@ -194,7 +194,7 @@
 		return;
 	}
 
-	if (switch_socket_create(&new_sock, AF_INET, SOCK_STREAM, APR_PROTO_TCP, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
+	if (switch_socket_create(&new_sock, AF_INET, SOCK_STREAM, SWITCH_PROTO_TCP, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Socket Error!\n");
 		return;
 	}
@@ -271,7 +271,7 @@
 static void close_socket(switch_socket_t **sock) {
 	switch_mutex_lock(listen_list.sock_mutex);
 	if (*sock) {
-		apr_socket_shutdown(*sock, APR_SHUTDOWN_READWRITE);
+		switch_socket_shutdown(*sock, SWITCH_SHUTDOWN_READWRITE);
 		switch_socket_close(*sock);
 		*sock = NULL;
 	}
@@ -449,7 +449,7 @@
 
 
 					if (data) {
-						snprintf(buf, sizeof(buf), "Content-Type: log/data\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", strlen(data));
+						snprintf(buf, sizeof(buf), "Content-Type: log/data\nContent-Length: %"SWITCH_SSIZE_T_FMT"\n\n", strlen(data));
 						len = strlen(buf);
 						switch_socket_send(listener->sock, buf, &len);
 						len = strlen(data);
@@ -486,7 +486,7 @@
 			
 					len = strlen(listener->ebuf);
 
-					snprintf(hbuf, sizeof(hbuf), "Content-Length: %"APR_SSIZE_T_FMT"\n" 
+					snprintf(hbuf, sizeof(hbuf), "Content-Length: %"SWITCH_SSIZE_T_FMT"\n" 
 							 "Content-Type: text/event-%s\n"
 							 "\n", len, etype);
 
@@ -558,7 +558,7 @@
         switch_size_t rlen, blen;
         char buf[1024] = "";
         rlen = strlen(reply);			
-        snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", rlen);
+        snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"SWITCH_SSIZE_T_FMT"\n\n", rlen);
         blen = strlen(buf);
         switch_socket_send(acs->listener->sock, buf, &blen);
         switch_socket_send(acs->listener->sock, reply, &rlen);
@@ -1006,7 +1006,7 @@
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Open\n");
 
-	switch_socket_opt_set(listener->sock, APR_SO_NONBLOCK, TRUE);
+	switch_socket_opt_set(listener->sock, SWITCH_SO_NONBLOCK, TRUE);
 	switch_set_flag_locked(listener, LFLAG_RUNNING);
 	add_listener(listener);
 
@@ -1210,9 +1210,9 @@
 	
 	
 	for(;;) {
-		rv = switch_sockaddr_info_get(&sa, prefs.ip, APR_INET, prefs.port, 0, pool);
+		rv = switch_sockaddr_info_get(&sa, prefs.ip, SWITCH_INET, prefs.port, 0, pool);
 		if (rv) goto fail;
-		rv = switch_socket_create(&listen_list.sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, pool);
+		rv = switch_socket_create(&listen_list.sock, switch_sockaddr_get_family(sa), SOCK_STREAM, SWITCH_PROTO_TCP, pool);
 		if (rv) goto sock_fail;
 		rv = switch_socket_opt_set(listen_list.sock, SWITCH_SO_REUSEADDR, 1);
 		if (rv) goto sock_fail;

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Fri Mar  9 15:44:13 2007
@@ -438,9 +438,9 @@
 static switch_status_t sm_load_file(char *filename)
 {
 	sm_loadable_module_t *module = NULL;
-	apr_dso_handle_t *dso = NULL;
-	apr_status_t status = SWITCH_STATUS_SUCCESS;
-	apr_dso_handle_sym_t function_handle = NULL;
+	switch_dso_handle_t *dso = NULL;
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
+	switch_dso_handle_sym_t function_handle = NULL;
 	spidermonkey_init_t spidermonkey_init = NULL;
 	const sm_module_interface_t *module_interface = NULL, *mp;
 
@@ -450,16 +450,16 @@
 
 	assert(filename != NULL);
 
-	status = apr_dso_load(&dso, filename, module_manager.pool);
+	status = switch_dso_load(&dso, filename, module_manager.pool);
 
 	while (loading) {
-		if (status != APR_SUCCESS) {
-			apr_dso_error(dso, derr, sizeof(derr));
+		if (status != SWITCH_STATUS_SUCCESS) {
+			switch_dso_error(dso, derr, sizeof(derr));
 			err = derr;
 			break;
 		}
 
-		status = apr_dso_sym(&function_handle, dso, "spidermonkey_init");
+		status = switch_dso_sym(&function_handle, dso, "spidermonkey_init");
 		spidermonkey_init = (spidermonkey_init_t)(intptr_t) function_handle;
 			
 		if (spidermonkey_init == NULL) {

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c	Fri Mar  9 15:44:13 2007
@@ -153,10 +153,10 @@
 		int running = 1;
 		while (running < 5000) {
 			int result = switch_core_db_step(dbo->stmt);
-			if (result == SQLITE_ROW) {
+			if (result == SWITCH_CORE_DB_ROW) {
 				*rval = BOOLEAN_TO_JSVAL( JS_TRUE );	
 				break;
-			} else if (result == SQLITE_BUSY) {
+			} else if (result == SWITCH_CORE_DB_BUSY) {
 				running++;
 				continue;
 			}

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	(original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	Fri Mar  9 15:44:13 2007
@@ -134,13 +134,7 @@
 	char *data;
 
 	va_start(ap, fmt);
-#ifdef HAVE_VASPRINTF
-	ret = vasprintf(&data, fmt, ap);
-#else
-	if ((data = (char *) malloc(2048))) {
-		vsnprintf(data, 2048, fmt, ap);
-	}
-#endif
+	ret = switch_vasprintf(&data, fmt, ap);
 	va_end(ap);
 	
 	if (data) {

Added: freeswitch/trunk/src/switch_apr.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/switch_apr.c	Fri Mar  9 15:44:13 2007
@@ -0,0 +1,675 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/F
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Michael Jerris <mike at jerris.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Michael Jerris <mike at jerris.com>
+ *
+ *
+ * switch_apr.c -- apr wrappers and extensions
+ *
+ */
+
+#include <switch.h>
+#ifndef WIN32
+#include <switch_private.h>
+#endif
+
+/* apr headers*/
+#include <apr.h>
+#include <apr_pools.h>
+#include <apr_hash.h>
+#include <apr_network_io.h>
+#include <apr_errno.h>
+#include <apr_thread_proc.h>
+#include <apr_portable.h>
+#include <apr_thread_mutex.h>
+#include <apr_thread_cond.h>
+#include <apr_thread_rwlock.h>
+#include <apr_file_io.h>
+#include <apr_poll.h>
+#include <apr_dso.h>
+#include <apr_strings.h>
+#define APR_WANT_STDIO
+#define APR_WANT_STRFUNC
+#include <apr_want.h>
+
+/* apr_vformatter_buff_t definition*/
+#include <apr_lib.h>
+
+/* apr-util headers */
+#include <apr_queue.h>
+#include <apr_uuid.h>
+
+/* apr stubs */
+
+/* Memory Pools */
+
+SWITCH_DECLARE(void) switch_pool_clear(switch_memory_pool_t *p)
+{
+	apr_pool_clear(p);
+}
+
+/* Hash tables */
+
+SWITCH_DECLARE(switch_hash_index_t *) switch_hash_first(switch_memory_pool_t *p, switch_hash_t *ht)
+{
+	return apr_hash_first(p, ht);
+}
+
+SWITCH_DECLARE(switch_hash_index_t *) switch_hash_next(switch_hash_index_t *ht)
+{
+	return apr_hash_next(ht);
+}
+
+SWITCH_DECLARE(void) switch_hash_this(switch_hash_index_t *hi, const void **key, switch_ssize_t *klen, void **val)
+{
+	apr_hash_this(hi, key, klen, val);
+}
+
+SWITCH_DECLARE(unsigned int) switch_hashfunc_default(const char *key, switch_ssize_t *klen)
+{
+	return apr_hashfunc_default(key, klen);
+}
+
+SWITCH_DECLARE(switch_memory_pool_t *) switch_hash_pool_get(switch_hash_t *ht)
+{
+	return apr_hash_pool_get(ht);
+}
+
+/* DSO functions */
+
+SWITCH_DECLARE(switch_status_t) switch_dso_load(switch_dso_handle_t **res_handle, 
+                                       const char *path, switch_memory_pool_t *ctx)
+{
+	return apr_dso_load(res_handle, path, ctx);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_dso_unload(switch_dso_handle_t *handle)
+{
+	return apr_dso_unload(handle);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_dso_sym(switch_dso_handle_sym_t *ressym, 
+                                      switch_dso_handle_t *handle,
+                                      const char *symname)
+{
+	return apr_dso_sym(ressym, handle, symname);
+}
+
+SWITCH_DECLARE(const char *) switch_dso_error(switch_dso_handle_t *dso, char *buf, size_t bufsize)
+{
+	return apr_dso_error(dso, buf, bufsize);
+}
+
+
+/* string functions */
+
+SWITCH_DECLARE(switch_status_t) switch_strftime(char *s,
+												switch_size_t *retsize,
+												switch_size_t max,
+												const char *format,
+												switch_time_exp_t *tm)
+{
+	return apr_strftime(s, retsize, max, format, (apr_time_exp_t *)tm);
+}
+
+SWITCH_DECLARE(int) switch_snprintf(char *buf, switch_size_t len, const char *format, ...)
+{
+    va_list ap;
+	int ret;
+	va_start(ap, format);
+	ret = apr_vsnprintf(buf, len, format, ap);
+    va_end(ap);
+	return ret;
+}
+
+SWITCH_DECLARE(int) switch_vsnprintf(char *buf, switch_size_t len, const char *format, va_list ap)
+{
+	return apr_vsnprintf(buf, len, format, ap);
+}
+
+SWITCH_DECLARE(char *) switch_copy_string(char *dst, const char *src, switch_size_t dst_size)
+{
+	return apr_cpystrn(dst, src, dst_size);
+}
+
+/* thread read write lock functions */
+
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_create(switch_thread_rwlock_t **rwlock,
+                                                  switch_memory_pool_t *pool)
+{
+	return apr_thread_rwlock_create(rwlock, pool);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_destroy(switch_thread_rwlock_t *rwlock)
+{
+	return apr_thread_rwlock_destroy(rwlock);
+}
+
+SWITCH_DECLARE(switch_memory_pool_t *) switch_thread_rwlock_pool_get(switch_thread_rwlock_t *rwlock)
+{
+	return apr_thread_rwlock_pool_get(rwlock);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_rdlock(switch_thread_rwlock_t *rwlock)
+{
+	return apr_thread_rwlock_rdlock(rwlock);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_tryrdlock(switch_thread_rwlock_t *rwlock)
+{
+	return apr_thread_rwlock_tryrdlock(rwlock);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_wrlock(switch_thread_rwlock_t *rwlock)
+{
+	return apr_thread_rwlock_wrlock(rwlock);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_trywrlock(switch_thread_rwlock_t *rwlock)
+{
+	return apr_thread_rwlock_trywrlock(rwlock);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_unlock(switch_thread_rwlock_t *rwlock)
+{
+	return apr_thread_rwlock_unlock(rwlock);
+}
+
+/* thread mutex functions */
+
+SWITCH_DECLARE(switch_status_t) switch_mutex_init(switch_mutex_t **lock,
+												unsigned int flags,
+												switch_memory_pool_t *pool)
+{
+	return apr_thread_mutex_create(lock, flags, pool);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_mutex_destroy(switch_mutex_t *lock)
+{
+	return apr_thread_mutex_destroy(lock);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_mutex_lock(switch_mutex_t *lock)
+{
+	return apr_thread_mutex_lock(lock);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_mutex_unlock(switch_mutex_t *lock)
+{
+	return apr_thread_mutex_unlock(lock);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_mutex_trylock(switch_mutex_t *lock)
+{
+	return apr_thread_mutex_trylock(lock);
+}
+
+/* time function stubs */
+
+SWITCH_DECLARE(switch_time_t) switch_time_now(void)
+{
+	return (switch_time_t)apr_time_now();
+}
+
+SWITCH_DECLARE(switch_status_t) switch_time_exp_gmt_get(switch_time_t *result, switch_time_exp_t *input)
+{
+	return apr_time_exp_gmt_get(result, (apr_time_exp_t *)input);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_time_exp_get(switch_time_t *result, switch_time_exp_t *input)
+{
+	return apr_time_exp_get(result, (apr_time_exp_t *)input);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_time_exp_lt(switch_time_exp_t *result, switch_time_t input)
+{
+	return apr_time_exp_lt((apr_time_exp_t *)result, input);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_time_exp_gmt(switch_time_exp_t *result, switch_time_t input)
+{
+	return apr_time_exp_gmt((apr_time_exp_t *)result, input);
+}
+
+SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t)
+{
+#if defined(HAVE_USLEEP)
+	usleep(t);
+#elif defined(WIN32)
+	Sleep((DWORD)((t) / 1000));
+#else
+	apr_sleep(t);
+#endif
+}
+
+
+SWITCH_DECLARE(switch_status_t) switch_rfc822_date(char *date_str, switch_time_t t)
+{
+	return apr_rfc822_date(date_str, t);
+}
+
+SWITCH_DECLARE(switch_time_t) switch_time_make(switch_time_t sec, int32_t usec)
+{
+	return ((switch_time_t)(sec) * APR_USEC_PER_SEC + (switch_time_t)(usec));
+}
+
+
+/* Thread condition locks */
+
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_create(switch_thread_cond_t **cond, switch_memory_pool_t *pool)
+{
+	return apr_thread_cond_create(cond, pool);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_wait(switch_thread_cond_t *cond, switch_mutex_t *mutex)
+{
+	return apr_thread_cond_wait(cond, mutex);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_timedwait(switch_thread_cond_t *cond, switch_mutex_t *mutex, switch_interval_time_t timeout)
+{
+	return apr_thread_cond_timedwait(cond, mutex, timeout);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_signal(switch_thread_cond_t *cond)
+{
+	return apr_thread_cond_signal(cond);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_broadcast(switch_thread_cond_t *cond)
+{
+	return apr_thread_cond_broadcast(cond);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_cond_destroy(switch_thread_cond_t *cond)
+{
+	return apr_thread_cond_destroy(cond);
+}
+
+/* file i/o stubs */
+
+SWITCH_DECLARE(switch_status_t) switch_file_open(switch_file_t **newf, const char *fname, int32_t flag, switch_fileperms_t perm, switch_memory_pool_t *pool)
+{
+	return apr_file_open(newf, fname, flag, perm, pool);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_file_seek(switch_file_t *thefile, switch_seek_where_t where, int64_t *offset)
+{
+	apr_status_t rv;
+	apr_off_t off = (apr_off_t)(*offset);
+	rv = apr_file_seek(thefile, where, &off);
+	*offset = (int64_t)off;
+	return rv;
+}
+
+SWITCH_DECLARE(switch_status_t) switch_file_close(switch_file_t *thefile)
+{
+	return apr_file_close(thefile);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_file_remove(const char *path, switch_memory_pool_t *pool)
+{
+	return apr_file_remove(path, pool);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_file_read(switch_file_t *thefile, void *buf, switch_size_t *nbytes)
+{
+	return apr_file_read(thefile, buf, nbytes);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_file_write(switch_file_t *thefile, const void *buf, switch_size_t *nbytes)
+{
+	return apr_file_write(thefile, buf, nbytes);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_file_exists(const char *filename)
+{
+	int32_t wanted = APR_FINFO_TYPE;
+	apr_finfo_t info = {0};
+	if (filename) {
+		apr_stat(&info, filename, wanted, NULL);
+		if (info.filetype != APR_NOFILE) {
+			return SWITCH_STATUS_SUCCESS;
+		}
+	}
+	return SWITCH_STATUS_FALSE;
+}
+
+/* thread stubs */
+
+
+SWITCH_DECLARE(switch_status_t) switch_threadattr_create(switch_threadattr_t **new_attr, switch_memory_pool_t *pool)
+{
+	return apr_threadattr_create(new_attr, pool);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_threadattr_detach_set(switch_threadattr_t *attr, int32_t on)
+{
+	return apr_threadattr_detach_set(attr, on);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_threadattr_stacksize_set(switch_threadattr_t *attr, switch_size_t stacksize)
+{
+	return apr_threadattr_stacksize_set(attr, stacksize);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_thread_create(switch_thread_t **new_thread, switch_threadattr_t *attr, switch_thread_start_t func, void *data, switch_memory_pool_t *cont)
+{
+	return apr_thread_create(new_thread, attr, func, data, cont);
+}
+
+/* socket stubs */
+
+SWITCH_DECLARE(switch_status_t) switch_socket_create(switch_socket_t **new_sock, int family, int type, int protocol, switch_memory_pool_t *pool)
+{
+	return apr_socket_create(new_sock, family, type, protocol, pool);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_shutdown(switch_socket_t *sock, switch_shutdown_how_e how)
+{
+	return apr_socket_shutdown(sock, how);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_close(switch_socket_t *sock)
+{
+	return apr_socket_close(sock);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_bind(switch_socket_t *sock, switch_sockaddr_t *sa)
+{
+	return apr_socket_bind(sock, sa);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_listen(switch_socket_t *sock, int32_t backlog)
+{
+	return apr_socket_listen(sock, backlog);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_accept(switch_socket_t **new_sock, switch_socket_t *sock, switch_memory_pool_t *pool)
+{
+	return apr_socket_accept(new_sock, sock, pool);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_connect(switch_socket_t *sock, switch_sockaddr_t *sa)
+{
+	return apr_socket_connect(sock, sa);
+}
+
+
+SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t *sock, const char *buf, switch_size_t *len)
+{
+	return apr_socket_send(sock, buf, len);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_sendto(switch_socket_t *sock, switch_sockaddr_t *where, int32_t flags, const char *buf, switch_size_t *len)
+{
+	return apr_socket_sendto(sock, where, flags, buf, len);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_recv(switch_socket_t *sock, char *buf, switch_size_t *len)
+{
+	return apr_socket_recv(sock, buf, len);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_sockaddr_info_get(switch_sockaddr_t **sa, const char *hostname, int32_t family, switch_port_t port, int32_t flags, switch_memory_pool_t *pool)
+{
+	return apr_sockaddr_info_get(sa, hostname, family, port, flags, pool);
+}
+
+
+SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int32_t opt, int32_t on)
+{
+	return apr_socket_opt_set(sock, opt, on);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_timeout_set(switch_socket_t *sock, switch_interval_time_t t)
+{
+	return apr_socket_timeout_set(sock, t);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_sockaddr_ip_get(char **addr, switch_sockaddr_t *sa)
+{
+	return apr_sockaddr_ip_get(addr, sa);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_mcast_join(switch_socket_t *sock, switch_sockaddr_t *join, switch_sockaddr_t *iface, switch_sockaddr_t *source)
+{
+	return apr_mcast_join(sock, join, iface, source);
+}
+
+
+/* socket functions */
+
+SWITCH_DECLARE(char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in)
+{
+    return get_addr(buf, len, &in->sa.sin.sin_addr);
+}
+
+
+SWITCH_DECLARE(uint16_t) switch_sockaddr_get_port(switch_sockaddr_t *sa)
+{
+	return sa->port;
+}
+
+SWITCH_DECLARE(int32_t) switch_sockaddr_get_family(switch_sockaddr_t *sa)
+{
+	return sa->family;
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from, switch_socket_t *sock,
+                                                    int32_t flags, char *buf, 
+                                                    size_t *len)
+{
+	apr_status_t r;
+
+	if ((r = apr_socket_recvfrom(from, sock, flags, buf, len)) == APR_SUCCESS) {
+		from->port = ntohs(from->sa.sin.sin_port);
+		/* from->ipaddr_ptr = &(from->sa.sin.sin_addr);
+		 * from->ipaddr_ptr = inet_ntoa(from->sa.sin.sin_addr);
+		 */
+	}
+
+	return r;
+
+}
+
+/* poll stubs */
+
+SWITCH_DECLARE(switch_status_t) switch_pollset_create(switch_pollset_t **pollset,
+													  uint32_t size,
+													  switch_memory_pool_t *p,
+													  uint32_t flags)
+{
+	return apr_pollset_create(pollset, size, p, flags);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_pollset_add(switch_pollset_t *pollset,
+												   const switch_pollfd_t *descriptor)
+{
+	return apr_pollset_add(pollset, descriptor);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_poll(switch_pollfd_t *aprset,
+											int32_t numsock,
+											int32_t *nsds,
+											switch_interval_time_t timeout)
+{
+	return apr_poll(aprset, numsock, nsds, timeout);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t **poll, switch_socket_t *sock,
+                                                            int16_t flags, switch_memory_pool_t *pool)
+{
+	switch_pollset_t *pollset;
+
+	void *ptr = NULL;
+
+	if ((ptr = apr_palloc(pool, sizeof(switch_pollfd_t))) == 0) {
+		return SWITCH_STATUS_MEMERR;
+	}
+
+	if (switch_pollset_create(&pollset, 1, pool, flags) != SWITCH_STATUS_SUCCESS) {
+		return SWITCH_STATUS_GENERR;
+	}
+
+	memset(ptr, 0, sizeof(switch_pollfd_t));
+	*poll = ptr;
+
+	(*poll)->desc_type = APR_POLL_SOCKET;
+	(*poll)->reqevents = flags;
+	(*poll)->desc.s = sock;
+	(*poll)->client_data = sock;
+
+	if (switch_pollset_add(pollset, *poll) != SWITCH_STATUS_SUCCESS) {
+		return SWITCH_STATUS_GENERR;
+	}
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+
+
+
+/* apr-util stubs */
+
+/* UUID Handling (apr-util) */
+
+
+SWITCH_DECLARE(void) switch_uuid_format(char *buffer, const switch_uuid_t *uuid)
+{
+	apr_uuid_format(buffer, (const apr_uuid_t *)uuid);
+}
+
+SWITCH_DECLARE(void) switch_uuid_get(switch_uuid_t *uuid)
+{
+	apr_uuid_get((apr_uuid_t *)uuid);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_uuid_parse(switch_uuid_t *uuid, const char *uuid_str)
+{
+	return apr_uuid_parse((apr_uuid_t *)uuid, uuid_str);
+}
+
+
+/* FIFO queues (apr-util) */
+
+SWITCH_DECLARE(switch_status_t) switch_queue_create(switch_queue_t **queue,
+                                           unsigned int queue_capacity, 
+                                           switch_memory_pool_t *pool)
+{
+	return apr_queue_create(queue, queue_capacity, pool);
+}
+
+SWITCH_DECLARE(unsigned int) switch_queue_size(switch_queue_t *queue)
+{
+	return apr_queue_size(queue);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_queue_pop(switch_queue_t *queue, void **data)
+{
+	return apr_queue_pop(queue, data);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_queue_push(switch_queue_t *queue, void *data)
+{
+	return apr_queue_push(queue, data);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_queue_trypop(switch_queue_t *queue, void **data)
+{
+	return apr_queue_trypop(queue, data);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_queue_trypush(switch_queue_t *queue, void *data)
+{
+	return apr_queue_trypush(queue, data);
+}
+
+#if 0
+/* Utility functions */
+struct switch_vasprintf_data {
+    apr_vformatter_buff_t vbuff;
+	switch_size_t len;
+	switch_size_t block_size;
+	char *buf;
+};
+
+static int vasprintf_flush(apr_vformatter_buff_t *buff)
+{
+    struct switch_vasprintf_data *data = (struct switch_vasprintf_data *)buff;
+
+	char *temp;
+	switch_size_t len = data->vbuff.curpos - data->buf;
+
+	if ((temp = realloc(data->buf, data->len + data->block_size))) {
+		data->buf = temp;
+		data->vbuff.curpos = data->buf + len;
+		data->len = data->len + data->block_size;
+		data->vbuff.endpos = data->buf + data->len;
+		return 0;
+	}
+    	
+	return -1;
+}
+#endif
+
+SWITCH_DECLARE(int) switch_vasprintf(char **buf, const char *format, va_list ap)
+{
+#if 0
+	struct switch_vasprintf_data data;
+
+	data.block_size = 1024;
+	data.buf = malloc(data.block_size);
+
+	if (data.buf == NULL) {
+		*buf = NULL;
+        return 0;
+    }
+
+    data.vbuff.curpos = data.buf;
+    data.vbuff.endpos = data.buf + data.block_size;
+
+    return apr_vformatter(vasprintf_flush, (apr_vformatter_buff_t *)&data, format, ap);
+#endif
+#ifdef HAVE_VASPRINTF
+    return vasprintf(buf, format, ap);
+#else
+    *buf = (char *) malloc(2048);
+    return vsnprintf(*buf, 2048, format, ap);
+#endif
+}
+
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ */

Modified: freeswitch/trunk/src/switch_console.c
==============================================================================
--- freeswitch/trunk/src/switch_console.c	(original)
+++ freeswitch/trunk/src/switch_console.c	Fri Mar  9 15:44:13 2007
@@ -48,13 +48,7 @@
 	}
 
 	va_start(ap, fmt);
-#ifdef HAVE_VASPRINTF
-	ret = vasprintf(&data, fmt, ap);
-#else
-	if ((data = (char *) malloc(2048))) {
-		ret = vsnprintf(data, 2048, fmt, ap);
-	}
-#endif
+	ret = switch_vasprintf(&data, fmt, ap);
 	va_end(ap);
 	
 	if (data) {
@@ -145,12 +139,7 @@
 
 	handle = switch_core_data_channel(channel);
 
-#ifdef HAVE_VASPRINTF
-	ret = vasprintf(&data, fmt, ap);
-#else
-	data = (char *) malloc(2048);
-	ret = vsnprintf(data, 2048, fmt, ap);
-#endif
+	ret = switch_vasprintf(&data, fmt, ap);
 	va_end(ap);
 	if (ret == -1) {
 		fprintf(stderr, "Memory Error\n");

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Fri Mar  9 15:44:13 2007
@@ -33,8 +33,31 @@
  */
 
 #include <switch.h>
-#include <stdio.h>
 #include <switch_version.h>
+#ifndef WIN32
+#include <switch_private.h>
+#endif
+
+/* for apr_pool_create and apr_pool_destroy */
+/* functions only used in this file so not exposed */
+#include <apr_pools.h>
+
+/* for apr_hash_make, apr_hash_pool_get, apr_hash_set */
+/* functions only used in this file so not exposed */
+#include <apr_hash.h>
+
+/* for apr_pvsprintf */
+/* function only used in this file so not exposed */
+#include <apr_strings.h>
+
+/* for apr_initialize and apr_terminate */
+/* function only used in this file so not exposed */
+#include <apr_general.h>
+
+#include <apr_portable.h>
+typedef apr_os_thread_t switch_thread_id_t;
+#define switch_thread_self apr_os_thread_current
+
 
 #ifdef HAVE_MLOCKALL
 #include <sys/mman.h>

Added: freeswitch/trunk/src/switch_core_db.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/switch_core_db.c	Fri Mar  9 15:44:13 2007
@@ -0,0 +1,118 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Michael Jerris <mike at jerris.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Michael Jerris <mike at jerris.com>
+ *
+ *
+ * switch_core_db.c -- sqlite wrapper and extensions
+ *
+ */
+
+#include <switch.h>
+#include <sqlite3.h>
+
+SWITCH_DECLARE(int) switch_core_db_open(const char *filename, switch_core_db_t **ppDb)
+{
+	return sqlite3_open(filename, ppDb);
+}
+
+SWITCH_DECLARE(int) switch_core_db_close(switch_core_db_t *db)
+{
+	return sqlite3_close(db);
+}
+
+SWITCH_DECLARE(const unsigned char *)switch_core_db_column_text(switch_core_db_stmt_t *stmt, int iCol)
+{
+	return sqlite3_column_text(stmt, iCol);
+}
+
+SWITCH_DECLARE(const char *)switch_core_db_column_name(switch_core_db_stmt_t *stmt, int N)
+{
+	return sqlite3_column_name(stmt, N);
+}
+
+SWITCH_DECLARE(int) switch_core_db_column_count(switch_core_db_stmt_t *pStmt)
+{
+	return sqlite3_column_count(pStmt);
+}
+
+SWITCH_DECLARE(const char *)switch_core_db_errmsg(switch_core_db_t *db)
+{
+	return sqlite3_errmsg(db);
+}
+
+SWITCH_DECLARE(int) switch_core_db_exec(switch_core_db_t *db,
+										const char *sql,
+										switch_core_db_callback_func_t callback,
+										void *data,
+										char **errmsg)
+{
+	return sqlite3_exec(db, sql, callback, data, errmsg);
+}
+
+SWITCH_DECLARE(int) switch_core_db_finalize(switch_core_db_stmt_t *pStmt)
+{
+	return sqlite3_finalize(pStmt);
+}
+
+SWITCH_DECLARE(int) switch_core_db_prepare(switch_core_db_t *db,
+										   const char *zSql,
+										   int nBytes,
+										   switch_core_db_stmt_t **ppStmt,
+										   const char **pzTail)
+{
+	return sqlite3_prepare(db, zSql, nBytes, ppStmt, pzTail);
+}
+
+SWITCH_DECLARE(int) switch_core_db_step(switch_core_db_stmt_t *stmt)
+{
+	return sqlite3_step(stmt);
+}
+
+SWITCH_DECLARE(void) switch_core_db_free(char *z)
+{
+	sqlite3_free(z);
+}
+
+SWITCH_DECLARE(char *)switch_mprintf(const char *zFormat,...)
+{
+  va_list ap;
+  char *z;
+  va_start(ap, zFormat);
+  z = sqlite3_vmprintf(zFormat, ap);
+  va_end(ap);
+  return z;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ */

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Fri Mar  9 15:44:13 2007
@@ -532,12 +532,7 @@
 	va_list ap;
 	if (fmt) {
 		va_start(ap, fmt);
-#ifdef HAVE_VASPRINTF
-		ret = vasprintf(&data, fmt, ap);
-#else
-		data = (char *) malloc(2048);
-		ret = vsnprintf(data, 2048, fmt, ap);
-#endif
+		ret = switch_vasprintf(&data, fmt, ap);
 		va_end(ap);
 
 		if (ret == -1) {

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Fri Mar  9 15:44:13 2007
@@ -92,10 +92,10 @@
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 	char *cmd = switch_event_get_header(event, "call-command");
 	unsigned long cmd_hash;
-	apr_ssize_t hlen = APR_HASH_KEY_STRING;
-	unsigned long CMD_EXECUTE = apr_hashfunc_default("execute", &hlen);
-	unsigned long CMD_HANGUP = apr_hashfunc_default("hangup", &hlen);
-	unsigned long CMD_NOMEDIA = apr_hashfunc_default("nomedia", &hlen);
+	switch_ssize_t hlen = SWITCH_HASH_KEY_STRING;
+	unsigned long CMD_EXECUTE = switch_hashfunc_default("execute", &hlen);
+	unsigned long CMD_HANGUP = switch_hashfunc_default("hangup", &hlen);
+	unsigned long CMD_NOMEDIA = switch_hashfunc_default("nomedia", &hlen);
 	
     assert(channel != NULL);
 	assert(event != NULL);
@@ -106,7 +106,7 @@
     }
 
 	hlen = (switch_size_t) strlen(cmd);
-	cmd_hash = apr_hashfunc_default(cmd, &hlen);
+	cmd_hash = switch_hashfunc_default(cmd, &hlen);
 
 	switch_channel_set_flag(channel, CF_EVENT_PARSE);
 	
@@ -1476,50 +1476,6 @@
 	return status;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_regex_match(char *target, char *expression) {
-	const char* error	= NULL;		//Used to hold any errors
-	int error_offset	= 0;		//Holds the offset of an error
-	pcre* pcre_prepared	= NULL;		//Holds the compiled regex
-	int match_count		= 0;		//Number of times the regex was matched
-	int offset_vectors[2];			//not used, but has to exist or pcre won't even try to find a match
-	
-	//Compile the expression
-	pcre_prepared = pcre_compile(expression, 0, &error, &error_offset, NULL);
-
-	//See if there was an error in the expression
-	if (error != NULL) {
-		//Clean up after ourselves
-		if (pcre_prepared) {
-			pcre_free(pcre_prepared);
-			pcre_prepared = NULL;
-		}	       
-
-		//Note our error	
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Regular Expression Error expression[%s] error[%s] location[%d]\n", expression, error, error_offset);
-
-		//We definitely didn't match anything
-		return SWITCH_STATUS_FALSE;
-	}
-
-	//So far so good, run the regex
-	match_count = pcre_exec(pcre_prepared, NULL, target, (int) strlen(target), 0, 0, offset_vectors, sizeof(offset_vectors) / sizeof(offset_vectors[0]));
-
-	//Clean up
-	if (pcre_prepared) {
-		pcre_free(pcre_prepared);
-		pcre_prepared = NULL;
-	}
-
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "number of matches: %d\n", match_count);
-
-	//Was it a match made in heaven?
-	if (match_count > 0) {
-		return SWITCH_STATUS_SUCCESS;
-	} else {
-		return SWITCH_STATUS_FALSE;
-	}
-}
-
 SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t *session,
 														   uint32_t min_digits,
 														   uint32_t max_digits,
@@ -4830,7 +4786,7 @@
         char *pattern = (char *) switch_xml_attr(input, "pattern");
 
         if (pattern) {
-            pcre *re = NULL;
+            switch_regex_t *re = NULL;
             int proceed = 0, ovector[30];
             char *substituted = NULL;
             uint32_t len = 0;
@@ -4838,7 +4794,7 @@
             char *expanded = NULL;
             switch_xml_t match = NULL;
             
-            if ((proceed = switch_perform_regex(data, pattern, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
+            if ((proceed = switch_regex_perform(data, pattern, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
                 match = switch_xml_child(input, "match");
             } else {
                 match = switch_xml_child(input, "nomatch");
@@ -4854,7 +4810,7 @@
                         len = (uint32_t)(strlen(data) + strlen(adata) + 10);
                         if (!(substituted = malloc(len))) {
                             switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
-                            switch_clean_re(re);
+                            switch_regex_safe_free(re);
                             switch_safe_free(expanded);
                             goto done;
                         }
@@ -4907,7 +4863,7 @@
                 }
             }
             
-            switch_clean_re(re);
+            switch_regex_safe_free(re);
             switch_safe_free(expanded);
             switch_safe_free(substituted);
         }
@@ -5111,25 +5067,25 @@
 			if (!(time_tag = switch_xml_add_child_d(x_times, "created_time", t_off++))) {
 				goto error;
 			}
-			snprintf(tmp, sizeof(tmp), "%"APR_TIME_T_FMT, caller_profile->times->created);
+			snprintf(tmp, sizeof(tmp), "%"SWITCH_TIME_T_FMT, caller_profile->times->created);
 			switch_xml_set_txt_d(time_tag, tmp);
 
 			if (!(time_tag = switch_xml_add_child_d(x_times, "answered_time", t_off++))) {
 				goto error;
 			}
-			snprintf(tmp, sizeof(tmp), "%"APR_TIME_T_FMT, caller_profile->times->answered);
+			snprintf(tmp, sizeof(tmp), "%"SWITCH_TIME_T_FMT, caller_profile->times->answered);
 			switch_xml_set_txt_d(time_tag, tmp);
 
 			if (!(time_tag = switch_xml_add_child_d(x_times, "hangup_time", t_off++))) {
 				goto error;
 			}
-			snprintf(tmp, sizeof(tmp), "%"APR_TIME_T_FMT, caller_profile->times->hungup);
+			snprintf(tmp, sizeof(tmp), "%"SWITCH_TIME_T_FMT, caller_profile->times->hungup);
 			switch_xml_set_txt_d(time_tag, tmp);
 
 			if (!(time_tag = switch_xml_add_child_d(x_times, "transfer_time", t_off++))) {
 				goto error;
 			}
-			snprintf(tmp, sizeof(tmp), "%"APR_TIME_T_FMT, caller_profile->times->transferred);
+			snprintf(tmp, sizeof(tmp), "%"SWITCH_TIME_T_FMT, caller_profile->times->transferred);
 			switch_xml_set_txt_d(time_tag, tmp);
 		}
 

Modified: freeswitch/trunk/src/switch_loadable_module.c
==============================================================================
--- freeswitch/trunk/src/switch_loadable_module.c	(original)
+++ freeswitch/trunk/src/switch_loadable_module.c	Fri Mar  9 15:44:13 2007
@@ -30,7 +30,15 @@
  *
  */
 #include <switch.h>
-#include <ctype.h>
+
+/* for apr_pstrcat */
+#include <apr_strings.h>
+
+/* for apr_env_get and apr_env_set */
+#include <apr_env.h>
+
+/* for apr file and directory handling */
+#include <apr_file_io.h>
 
 struct switch_loadable_module {
 	char *filename;
@@ -360,11 +368,11 @@
 static switch_status_t switch_loadable_module_load_file(char *filename, switch_loadable_module_t **new_module)
 {
 	switch_loadable_module_t *module = NULL;
-	apr_dso_handle_t *dso = NULL;
+	switch_dso_handle_t *dso = NULL;
 	apr_status_t status = SWITCH_STATUS_SUCCESS;
-	apr_dso_handle_sym_t load_function_handle = NULL;
-	apr_dso_handle_sym_t shutdown_function_handle = NULL;
-	apr_dso_handle_sym_t runtime_function_handle = NULL;
+	switch_dso_handle_sym_t load_function_handle = NULL;
+	switch_dso_handle_sym_t shutdown_function_handle = NULL;
+	switch_dso_handle_sym_t runtime_function_handle = NULL;
 	switch_module_load_t load_func_ptr = NULL;
 	int loading = 1;
 	const char *err = NULL;
@@ -374,16 +382,16 @@
 	assert(filename != NULL);
 
 	*new_module = NULL;
-	status = apr_dso_load(&dso, filename, loadable_modules.pool);
+	status = switch_dso_load(&dso, filename, loadable_modules.pool);
 
 	while (loading) {
 		if (status != APR_SUCCESS) {
-			apr_dso_error(dso, derr, sizeof(derr));
+			switch_dso_error(dso, derr, sizeof(derr));
 			err = derr;
 			break;
 		}
 
-		status = apr_dso_sym(&load_function_handle, dso, "switch_module_load");
+		status = switch_dso_sym(&load_function_handle, dso, "switch_module_load");
 		load_func_ptr = (switch_module_load_t)(intptr_t) load_function_handle;
 
 		if (load_func_ptr == NULL) {
@@ -414,9 +422,9 @@
 	module->module_interface = module_interface;
 	module->switch_module_load = load_func_ptr;
 
-	apr_dso_sym(&shutdown_function_handle, dso, "switch_module_shutdown");
+	switch_dso_sym(&shutdown_function_handle, dso, "switch_module_shutdown");
 	module->switch_module_shutdown = (switch_module_shutdown_t)(intptr_t) shutdown_function_handle;
-	apr_dso_sym(&runtime_function_handle, dso, "switch_module_runtime");
+	switch_dso_sym(&runtime_function_handle, dso, "switch_module_runtime");
 	module->switch_module_runtime = (switch_module_runtime_t)(intptr_t) runtime_function_handle;
 
 	module->lib = dso;
@@ -700,7 +708,7 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping: %s\n", module->module_interface->module_name);
 			if (module->switch_module_shutdown() == SWITCH_STATUS_UNLOAD) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s unloaded.\n", module->module_interface->module_name);
-				apr_dso_unload(module->lib);
+				switch_dso_unload(module->lib);
 				module->lib = NULL;
 			} else {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s shutdown.\n", module->module_interface->module_name);

Modified: freeswitch/trunk/src/switch_log.c
==============================================================================
--- freeswitch/trunk/src/switch_log.c	(original)
+++ freeswitch/trunk/src/switch_log.c	Fri Mar  9 15:44:13 2007
@@ -193,12 +193,7 @@
 		fmt = new_fmt;
 	}
 
-#ifdef HAVE_VASPRINTF
-	ret = vasprintf(&data, fmt, ap);
-#else
-	data = (char *) malloc(2048);
-	ret = vsnprintf(data, 2048, fmt, ap);
-#endif
+	ret = switch_vasprintf(&data, fmt, ap);
 	va_end(ap);
 	if (ret == -1) {
 		fprintf(stderr, "Memory Error\n");

Added: freeswitch/trunk/src/switch_regex.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/switch_regex.c	Fri Mar  9 15:44:13 2007
@@ -0,0 +1,200 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Michael Jerris <mike at jerris.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Michael Jerris <mike at jerris.com>
+ *
+ *
+ * switch_regex.c -- PCRE wrapper
+ *
+ */
+
+#include <switch.h>
+#include <pcre.h>
+
+
+SWITCH_DECLARE(switch_regex_t *) switch_regex_compile(const char *pattern,
+													  int options,
+													  const char **errorptr,
+													  int *erroroffset,
+													  const unsigned char *tables)
+{
+	return pcre_compile(pattern, options, errorptr, erroroffset, tables);
+
+}
+
+SWITCH_DECLARE(int) switch_regex_copy_substring(const char *subject,
+												int *ovector,
+												int stringcount,
+												int stringnumber,
+												char *buffer,
+												int size)
+{
+	return pcre_copy_substring(subject, ovector, stringcount, stringnumber, buffer, size);
+}
+
+SWITCH_DECLARE(void) switch_regex_free(void *data)
+{
+	pcre_free(data);
+}
+
+SWITCH_DECLARE(int) switch_regex_perform(char *field, char *expression, switch_regex_t **new_re, int *ovector, uint32_t olen)
+{
+	const char *error = NULL;
+	int erroffset = 0;
+	pcre *re = NULL;
+	int match_count = 0;
+	
+	if (!(field && expression)) {
+		return 0;
+	}
+
+	re = pcre_compile(expression, /* the pattern */
+					  0,		  /* default options */
+					  &error,	  /* for error message */
+					  &erroffset, /* for error offset */
+					  NULL);	  /* use default character tables */
+	if (error) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "COMPILE ERROR: %d [%s]\n", erroffset, error);
+		switch_regex_safe_free(re);
+		return 0;
+	}
+
+	match_count = pcre_exec(re,	/* result of pcre_compile() */
+							NULL,	/* we didn't study the pattern */
+							field,	/* the subject string */
+							(int) strlen(field), /* the length of the subject string */
+							0,	/* start at offset 0 in the subject */
+							0,	/* default options */
+							ovector,	/* vector of integers for substring information */
+							olen); /* number of elements (NOT size in bytes) */
+
+	if (match_count <= 0) {
+		switch_regex_safe_free(re);
+		match_count = 0;
+	}
+
+	*new_re = (switch_regex_t *)re;
+
+	return match_count;
+}
+
+
+SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_count, char *data, char *field_data, char *substituted, uint32_t len, int *ovector)
+{
+	char index[10] = "";
+	char replace[1024] = "";
+	uint32_t x, y = 0, z = 0, num = 0;
+
+	for (x = 0; x < (len-1) && x < strlen(data);) {
+		if (data[x] == '$') {
+			x++;
+			
+			if (!(data[x] > 47 && data[x] < 58)) {
+				substituted[y++] = data[x-1];
+				continue;
+			}
+
+			while (data[x] > 47 && data[x] < 58) {
+				index[z++] = data[x];
+				x++;
+			}
+			index[z++] = '\0';
+			z = 0;
+			num = atoi(index);
+			
+			if (pcre_copy_substring(field_data,
+									ovector,
+									match_count,
+									num,
+									replace,
+									sizeof(replace)) > 0) {
+				unsigned int r;
+				for (r = 0; r < strlen(replace); r++) {
+					substituted[y++] = replace[r];
+				}
+			}
+		} else {
+			substituted[y++] = data[x];
+			x++;
+		}
+	}
+	substituted[y++] = '\0';
+}
+
+SWITCH_DECLARE(switch_status_t) switch_regex_match(char *target, char *expression) {
+	const char* error	= NULL;		//Used to hold any errors
+	int error_offset	= 0;		//Holds the offset of an error
+	pcre* pcre_prepared	= NULL;		//Holds the compiled regex
+	int match_count		= 0;		//Number of times the regex was matched
+	int offset_vectors[2];			//not used, but has to exist or pcre won't even try to find a match
+	
+	//Compile the expression
+	pcre_prepared = pcre_compile(expression, 0, &error, &error_offset, NULL);
+
+	//See if there was an error in the expression
+	if (error != NULL) {
+		//Clean up after ourselves
+		if (pcre_prepared) {
+			pcre_free(pcre_prepared);
+			pcre_prepared = NULL;
+		}	       
+
+		//Note our error	
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Regular Expression Error expression[%s] error[%s] location[%d]\n", expression, error, error_offset);
+
+		//We definitely didn't match anything
+		return SWITCH_STATUS_FALSE;
+	}
+
+	//So far so good, run the regex
+	match_count = pcre_exec(pcre_prepared, NULL, target, (int) strlen(target), 0, 0, offset_vectors, sizeof(offset_vectors) / sizeof(offset_vectors[0]));
+
+	//Clean up
+	if (pcre_prepared) {
+		pcre_free(pcre_prepared);
+		pcre_prepared = NULL;
+	}
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "number of matches: %d\n", match_count);
+
+	//Was it a match made in heaven?
+	if (match_count > 0) {
+		return SWITCH_STATUS_SUCCESS;
+	} else {
+		return SWITCH_STATUS_FALSE;
+	}
+}
+
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ */

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Fri Mar  9 15:44:13 2007
@@ -242,7 +242,7 @@
 		remote_ip = switch_get_addr(ipbuf, sizeof(ipbuf), rtp_session->from_addr);
 		
 
-		switch_stun_packet_attribute_add_binded_address(rpacket, remote_ip, rtp_session->from_addr->port);
+		switch_stun_packet_attribute_add_binded_address(rpacket, remote_ip, switch_sockaddr_get_port(rtp_session->from_addr));
 		bytes = switch_stun_packet_length(rpacket);
 		switch_socket_sendto(rtp_session->sock, rtp_session->from_addr, 0, (void*)rpacket, &bytes);
 	}
@@ -310,7 +310,7 @@
 	new_sock = NULL;
 
 	if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK)) {
-		switch_socket_opt_set(rtp_session->sock, APR_SO_NONBLOCK, TRUE);
+		switch_socket_opt_set(rtp_session->sock, SWITCH_SO_NONBLOCK, TRUE);
 		switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_NOBLOCK);
 	}
 
@@ -566,7 +566,7 @@
 	switch_mutex_lock(rtp_session->flag_mutex);
 	if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) {
 		assert(rtp_session->sock != NULL);
-		apr_socket_shutdown(rtp_session->sock, APR_SHUTDOWN_READWRITE);
+		switch_socket_shutdown(rtp_session->sock, SWITCH_SHUTDOWN_READWRITE);
 		switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_IO);
 	}
 	switch_mutex_unlock(rtp_session->flag_mutex);
@@ -869,21 +869,21 @@
 
 
 		if (rtp_session->recv_msg.header.version) {
-			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && rtp_session->from_addr->port) {
+			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) {
                 char *tx_host;
                 char *old_host;
                 char bufa[30], bufb[30];
                 tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
                 old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);
 
-				if ((rtp_session->from_addr->port != rtp_session->remote_port) || strcmp(tx_host, old_host)) {
+				if ((switch_sockaddr_get_port(rtp_session->from_addr) != rtp_session->remote_port) || strcmp(tx_host, old_host)) {
 					const char *err;
 					uint32_t old = rtp_session->remote_port;
 
-					if (!switch_strlen_zero(tx_host) && rtp_session->from_addr->port > 0) {
+					if (!switch_strlen_zero(tx_host) && switch_sockaddr_get_port(rtp_session->from_addr) > 0) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Auto Changing port from %s:%u to %s:%u\n",
-										  old_host, old, tx_host, rtp_session->from_addr->port);
-						switch_rtp_set_remote_address(rtp_session, tx_host, rtp_session->from_addr->port, &err);
+										  old_host, old, tx_host, switch_sockaddr_get_port(rtp_session->from_addr));
+						switch_rtp_set_remote_address(rtp_session, tx_host, switch_sockaddr_get_port(rtp_session->from_addr), &err);
 					}
 				}
 				switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);

Modified: freeswitch/trunk/src/switch_stun.c
==============================================================================
--- freeswitch/trunk/src/switch_stun.c	(original)
+++ freeswitch/trunk/src/switch_stun.c	Fri Mar  9 15:44:13 2007
@@ -100,7 +100,7 @@
 
 	max = (int)strlen(set);
 
-	srand((unsigned int)apr_time_now());
+	srand((unsigned int)switch_time_now());
 
 	for(x = 0; x < len; x++) {
 		int j = (int)(max*1.0*rand()/(RAND_MAX+1.0));
@@ -313,7 +313,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 	
-	switch_socket_opt_set(sock, APR_SO_NONBLOCK, TRUE);
+	switch_socket_opt_set(sock, SWITCH_SO_NONBLOCK, TRUE);
 	packet = switch_stun_packet_build_header(SWITCH_STUN_BINDING_REQUEST, NULL, buf);
 	switch_stun_random_string(username, 32, NULL);
 	switch_stun_packet_attribute_add_username(packet, username, 32);
@@ -333,7 +333,7 @@
 
 		if ((elapsed = (unsigned int)((switch_time_now() - started) / 1000)) > 5000) {
 			*err = "Timeout";
-			switch_socket_shutdown(sock, APR_SHUTDOWN_READWRITE);
+			switch_socket_shutdown(sock, SWITCH_SHUTDOWN_READWRITE);
 			switch_socket_close(sock);
 			return SWITCH_STATUS_TIMEOUT;
 		}

Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c	(original)
+++ freeswitch/trunk/src/switch_utils.c	Fri Mar  9 15:44:13 2007
@@ -30,9 +30,6 @@
  *
  */
 #include <switch.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
 #ifndef WIN32
 #include <arpa/inet.h>
 #endif
@@ -193,97 +190,12 @@
  
 }
 
-SWITCH_DECLARE(int) switch_perform_regex(char *field, char *expression, pcre **new_re, int *ovector, uint32_t olen)
-{
-	const char *error = NULL;
-	int erroffset = 0;
-	pcre *re = NULL;
-	int match_count = 0;
-	
-	if (!(field && expression)) {
-		return 0;
-	}
-
-	re = pcre_compile(expression, /* the pattern */
-					  0,		  /* default options */
-					  &error,	  /* for error message */
-					  &erroffset, /* for error offset */
-					  NULL);	  /* use default character tables */
-	if (error) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "COMPILE ERROR: %d [%s]\n", erroffset, error);
-		switch_clean_re(re);
-		return 0;
-	}
-
-	match_count = pcre_exec(re,	/* result of pcre_compile() */
-							NULL,	/* we didn't study the pattern */
-							field,	/* the subject string */
-							(int) strlen(field), /* the length of the subject string */
-							0,	/* start at offset 0 in the subject */
-							0,	/* default options */
-							ovector,	/* vector of integers for substring information */
-							olen); /* number of elements (NOT size in bytes) */
-
-	if (match_count <= 0) {
-		switch_clean_re(re);
-		match_count = 0;
-	}
-
-	*new_re = re;
-
-	return match_count;
-}
-
-
-SWITCH_DECLARE(void) switch_perform_substitution(pcre *re, int match_count, char *data, char *field_data, char *substituted, uint32_t len, int *ovector)
-{
-	char index[10] = "";
-	char replace[1024] = "";
-	uint32_t x, y = 0, z = 0, num = 0;
-
-	for (x = 0; x < (len-1) && x < strlen(data);) {
-		if (data[x] == '$') {
-			x++;
-			
-			if (!(data[x] > 47 && data[x] < 58)) {
-				substituted[y++] = data[x-1];
-				continue;
-			}
-
-			while (data[x] > 47 && data[x] < 58) {
-				index[z++] = data[x];
-				x++;
-			}
-			index[z++] = '\0';
-			z = 0;
-			num = atoi(index);
-			
-			if (pcre_copy_substring(field_data,
-									ovector,
-									match_count,
-									num,
-									replace,
-									sizeof(replace)) > 0) {
-				unsigned int r;
-				for (r = 0; r < strlen(replace); r++) {
-					substituted[y++] = replace[r];
-				}
-			}
-		} else {
-			substituted[y++] = data[x];
-			x++;
-		}
-	}
-	substituted[y++] = '\0';
-}
-
-
 
 SWITCH_DECLARE(switch_time_t) switch_str_time(char *in)
 {
     switch_time_exp_t tm = {0};
     int proceed = 0, ovector[30];
-    pcre *re = NULL;
+    switch_regex_t *re = NULL;
     char replace[1024] = "";
     switch_time_t ret = 0;
     char *pattern = "^(\\d+)-(\\d+)-(\\d+)\\s*(\\d*):{0,1}(\\d*):{0,1}(\\d*)";
@@ -291,39 +203,39 @@
     switch_time_exp_lt(&tm, switch_time_now());
     tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
 
-    if ((proceed = switch_perform_regex(in, pattern, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
+    if ((proceed = switch_regex_perform(in, pattern, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
 
         if (proceed > 1) {
-            pcre_copy_substring(in, ovector, proceed, 1, replace, sizeof(replace));
+            switch_regex_copy_substring(in, ovector, proceed, 1, replace, sizeof(replace));
             tm.tm_year = atoi(replace) - 1900;
         }
 
         if (proceed > 2) {
-            pcre_copy_substring(in, ovector, proceed, 2, replace, sizeof(replace));
+            switch_regex_copy_substring(in, ovector, proceed, 2, replace, sizeof(replace));
             tm.tm_mon = atoi(replace) - 1;
         }
 
         if (proceed > 3) {
-            pcre_copy_substring(in, ovector, proceed, 3, replace, sizeof(replace));
+            switch_regex_copy_substring(in, ovector, proceed, 3, replace, sizeof(replace));
             tm.tm_mday = atoi(replace);
         }
         
         if (proceed > 4) {
-            pcre_copy_substring(in, ovector, proceed, 4, replace, sizeof(replace));
+            switch_regex_copy_substring(in, ovector, proceed, 4, replace, sizeof(replace));
             tm.tm_hour = atoi(replace);
         }
 
         if (proceed > 5) {
-            pcre_copy_substring(in, ovector, proceed, 5, replace, sizeof(replace));
+            switch_regex_copy_substring(in, ovector, proceed, 5, replace, sizeof(replace));
             tm.tm_min = atoi(replace);
         }
 
         if (proceed > 6) {
-            pcre_copy_substring(in, ovector, proceed, 6, replace, sizeof(replace));
+            switch_regex_copy_substring(in, ovector, proceed, 6, replace, sizeof(replace));
             tm.tm_sec = atoi(replace);
         }
 
-        apr_time_exp_gmt_get(&ret, &tm);
+        switch_time_exp_gmt_get(&ret, &tm);
         return ret;
     } /* possible else with more patterns later */
     
@@ -331,20 +243,6 @@
 
 }
 
-SWITCH_DECLARE(switch_status_t) switch_file_exists(const char *filename)
-{
-	int32_t wanted = APR_FINFO_TYPE;
-	apr_finfo_t info = {0};
-	if (filename) {
-		apr_stat(&info, filename, wanted, NULL);
-		if (info.filetype != APR_NOFILE) {
-			return SWITCH_STATUS_SUCCESS;
-		}
-	}
-	return SWITCH_STATUS_FALSE;
-}
-
-
 SWITCH_DECLARE(char *) switch_priority_name(switch_priority_t priority)
 {
 	switch(priority) { /*lol*/
@@ -377,28 +275,6 @@
 	return buf;
 }
 
-SWITCH_DECLARE(char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in)
-{
-    return get_addr(buf, len, &in->sa.sin.sin_addr);
-}
-
-SWITCH_DECLARE(apr_status_t) switch_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
-                                                    apr_int32_t flags, char *buf, 
-                                                    apr_size_t *len)
-{
-	apr_status_t r;
-
-	if ((r = apr_socket_recvfrom(from, sock, flags, buf, len)) == APR_SUCCESS) {
-		from->port = ntohs(from->sa.sin.sin_port);
-		/* from->ipaddr_ptr = &(from->sa.sin.sin_addr);
-		 * from->ipaddr_ptr = inet_ntoa(from->sa.sin.sin_addr);
-		 */
-	}
-
-	return r;
-
-}
-
 SWITCH_DECLARE(char) switch_rfc2833_to_char(int event)
 {
 	if (event > -1 && event < (int32_t) sizeof(RFC2833_CHARS)) {
@@ -530,26 +406,6 @@
 	}
 }
 
-SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t *poll, switch_socket_t *sock,
-                                                            switch_int16_t flags, switch_memory_pool_t *pool)
-{
-	switch_pollset_t *pollset;
-
-	if (switch_pollset_create(&pollset, 1, pool, flags) != SWITCH_STATUS_SUCCESS) {
-		return SWITCH_STATUS_GENERR;
-	}
-
-	poll->desc_type = SWITCH_POLL_SOCKET;
-	poll->reqevents = flags;
-	poll->desc.s = sock;
-	poll->client_data = sock;
-
-	if (switch_pollset_add(pollset, poll) != SWITCH_STATUS_SUCCESS) {
-		return SWITCH_STATUS_GENERR;
-	}
-
-	return SWITCH_STATUS_SUCCESS;
-}
 
 SWITCH_DECLARE(switch_status_t) switch_string_match(const char *string, size_t string_len, const char *search, size_t search_len)
 {
@@ -661,17 +517,6 @@
 }
 
 
-#ifdef WIN32
-/* this forces certain symbols to not be optimized out of the dll */
-void include_me(void)
-{
-	apr_socket_shutdown(NULL, 0);
-	apr_socket_recvfrom(NULL, NULL, 0, NULL, NULL);
-	apr_mcast_join(NULL, NULL, NULL, NULL);
-	apr_socket_opt_set(NULL, 0, 0);
-}
-#endif
-
 /* For Emacs:
  * Local Variables:
  * mode:c

Modified: freeswitch/trunk/src/switch_xml.c
==============================================================================
--- freeswitch/trunk/src/switch_xml.c	(original)
+++ freeswitch/trunk/src/switch_xml.c	Fri Mar  9 15:44:13 2007
@@ -54,8 +54,10 @@
  */
 
 #include <switch.h>
-#include <ctype.h>
-#include <sys/stat.h>
+#ifndef WIN32
+#include <switch_private.h>
+#endif
+
 #ifdef HAVE_MMAP
 #include <sys/mman.h>
 #endif

Modified: freeswitch/trunk/w32/Library/FreeSwitchCore.vcproj
==============================================================================
--- freeswitch/trunk/w32/Library/FreeSwitchCore.vcproj	(original)
+++ freeswitch/trunk/w32/Library/FreeSwitchCore.vcproj	Fri Mar  9 15:44:13 2007
@@ -44,7 +44,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libresample\include;..\..\libs\libteletone\src"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
@@ -137,7 +137,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libresample\include;..\..\libs\libteletone\src"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;CRASH_PROT"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;CRASH_PROT;PCRE_STATIC"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="2"
 				PrecompiledHeaderThrough="switch.h"
@@ -208,6 +208,10 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
 			<File
+				RelativePath="..\..\src\switch_apr.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\switch_buffer.c"
 				>
 				<FileConfiguration
@@ -248,6 +252,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\src\switch_core_db.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\switch_event.c"
 				>
 			</File>
@@ -264,6 +272,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\src\switch_regex.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\switch_resample.c"
 				>
 			</File>
@@ -322,6 +334,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\src\include\switch_core_db.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\include\switch_event.h"
 				>
 			</File>
@@ -350,15 +366,15 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\include\switch_resample.h"
+				RelativePath="..\..\src\include\switch_regex.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\include\switch_rtp.h"
+				RelativePath="..\..\src\include\switch_resample.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\include\switch_sqlite.h"
+				RelativePath="..\..\src\include\switch_rtp.h"
 				>
 			</File>
 			<File



More information about the Freeswitch-svn mailing list