[Freeswitch-svn] [commit] r2613 - in freeswitch/branches/james: . libs/codec/lpc10 libs/win32/apr libs/win32/apr-iconv libs/win32/apr-util src src/include src/mod/applications/mod_commands src/mod/applications/mod_conference src/mod/applications/mod_park src/mod/applications/mod_playback src/mod/asr_tts/mod_cepstral src/mod/codecs/mod_g722 src/mod/codecs/mod_g723_1 src/mod/codecs/mod_g729 src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_exosip src/mod/endpoints/mod_sofia src/mod/endpoints/mod_wanpipe src/mod/event_handlers/mod_event_socket src/mod/languages/mod_perl src/mod/languages/mod_php src/mod/languages/mod_spidermonkey

Freeswitch SVN james at freeswitch.org
Sun Sep 10 07:09:35 EDT 2006


Author: james
Date: Sun Sep 10 07:09:34 2006
New Revision: 2613

Added:
   freeswitch/branches/james/src/mod/applications/mod_park/
      - copied from r2606, /freeswitch/trunk/src/mod/applications/mod_park/
   freeswitch/branches/james/src/mod/applications/mod_park/mod_park.c
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/applications/mod_park/mod_park.c
   freeswitch/branches/james/src/mod/applications/mod_park/mod_park.vcproj
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/applications/mod_park/mod_park.vcproj
   freeswitch/branches/james/src/mod/languages/mod_php/
      - copied from r2606, /freeswitch/trunk/src/mod/languages/mod_php/
   freeswitch/branches/james/src/mod/languages/mod_php/Makefile
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/Makefile
   freeswitch/branches/james/src/mod/languages/mod_php/apptest.php
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/apptest.php
   freeswitch/branches/james/src/mod/languages/mod_php/fix.diff
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/fix.diff
   freeswitch/branches/james/src/mod/languages/mod_php/freeswitch.php
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/freeswitch.php
   freeswitch/branches/james/src/mod/languages/mod_php/mod_php.c
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/mod_php.c
   freeswitch/branches/james/src/mod/languages/mod_php/php_freeswitch.h
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/php_freeswitch.h
   freeswitch/branches/james/src/mod/languages/mod_php/switch_swig.c
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/switch_swig.c
   freeswitch/branches/james/src/mod/languages/mod_php/switch_swig.i
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/switch_swig.i
   freeswitch/branches/james/src/mod/languages/mod_php/switch_swig_wrap.c
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/switch_swig_wrap.c
   freeswitch/branches/james/src/mod/languages/mod_php/test.php
      - copied unchanged from r2606, /freeswitch/trunk/src/mod/languages/mod_php/test.php
Modified:
   freeswitch/branches/james/Freeswitch.sln
   freeswitch/branches/james/Makefile.in
   freeswitch/branches/james/libs/codec/lpc10/Makefile.am
   freeswitch/branches/james/libs/win32/apr-iconv/libapriconv.vcproj
   freeswitch/branches/james/libs/win32/apr-util/libaprutil.vcproj
   freeswitch/branches/james/libs/win32/apr/libapr.vcproj
   freeswitch/branches/james/src/include/switch.h
   freeswitch/branches/james/src/include/switch_apr.h
   freeswitch/branches/james/src/include/switch_bitpack.h
   freeswitch/branches/james/src/include/switch_buffer.h
   freeswitch/branches/james/src/include/switch_caller.h
   freeswitch/branches/james/src/include/switch_channel.h
   freeswitch/branches/james/src/include/switch_config.h
   freeswitch/branches/james/src/include/switch_console.h
   freeswitch/branches/james/src/include/switch_core.h
   freeswitch/branches/james/src/include/switch_event.h
   freeswitch/branches/james/src/include/switch_frame.h
   freeswitch/branches/james/src/include/switch_ivr.h
   freeswitch/branches/james/src/include/switch_loadable_module.h
   freeswitch/branches/james/src/include/switch_log.h
   freeswitch/branches/james/src/include/switch_module_interfaces.h
   freeswitch/branches/james/src/include/switch_platform.h
   freeswitch/branches/james/src/include/switch_resample.h
   freeswitch/branches/james/src/include/switch_rtp.h
   freeswitch/branches/james/src/include/switch_sqlite.h
   freeswitch/branches/james/src/include/switch_stun.h
   freeswitch/branches/james/src/include/switch_types.h
   freeswitch/branches/james/src/include/switch_utils.h
   freeswitch/branches/james/src/include/switch_xml.h
   freeswitch/branches/james/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/branches/james/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/branches/james/src/mod/applications/mod_playback/mod_playback.c
   freeswitch/branches/james/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
   freeswitch/branches/james/src/mod/codecs/mod_g722/mod_g722.c
   freeswitch/branches/james/src/mod/codecs/mod_g723_1/mod_g723_1.c
   freeswitch/branches/james/src/mod/codecs/mod_g729/mod_g729.c
   freeswitch/branches/james/src/mod/codecs/mod_g729/mod_g729.vcproj
   freeswitch/branches/james/src/mod/endpoints/mod_dingaling/mod_dingaling.c
   freeswitch/branches/james/src/mod/endpoints/mod_exosip/mod_exosip.c
   freeswitch/branches/james/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/branches/james/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
   freeswitch/branches/james/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
   freeswitch/branches/james/src/mod/languages/mod_perl/fs_perl.pm
   freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig.c
   freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig_wrap.c
   freeswitch/branches/james/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/branches/james/src/switch_buffer.c
   freeswitch/branches/james/src/switch_channel.c
   freeswitch/branches/james/src/switch_console.c
   freeswitch/branches/james/src/switch_core.c
   freeswitch/branches/james/src/switch_event.c
   freeswitch/branches/james/src/switch_ivr.c
   freeswitch/branches/james/src/switch_loadable_module.c

Log:
Update to trunk.


Modified: freeswitch/branches/james/Freeswitch.sln
==============================================================================
--- freeswitch/branches/james/Freeswitch.sln	(original)
+++ freeswitch/branches/james/Freeswitch.sln	Sun Sep 10 07:09:34 2006
@@ -3,21 +3,21 @@
 # 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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
-		{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}
+		{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}"
@@ -27,54 +27,54 @@
 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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4} = {3D0370CA-BED2-4657-A475-32375CBCB6E4}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_exosip", "src\mod\endpoints\mod_exosip\mod_exosip.vcproj", "{45DF84ED-D24A-4FF6-B5B0-0A9A5FDB9552}"
 	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}
-		{44F46B7E-0E51-4304-9735-330DFBAB41E5} = {44F46B7E-0E51-4304-9735-330DFBAB41E5}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{4EA67539-9EE9-4065-BD39-87E517FD8262} = {4EA67539-9EE9-4065-BD39-87E517FD8262}
 		{85255507-5D16-4218-85E2-F683BB2F04DA} = {85255507-5D16-4218-85E2-F683BB2F04DA}
+		{4EA67539-9EE9-4065-BD39-87E517FD8262} = {4EA67539-9EE9-4065-BD39-87E517FD8262}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{44F46B7E-0E51-4304-9735-330DFBAB41E5} = {44F46B7E-0E51-4304-9735-330DFBAB41E5}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{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_g711", "src\mod\codecs\mod_g711\mod_g711.vcproj", "{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}"
@@ -84,28 +84,28 @@
 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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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
-		{C30D35E4-7FC6-4E97-9BE5-4BC077BE0D4B} = {C30D35E4-7FC6-4E97-9BE5-4BC077BE0D4B}
-		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{C30D35E4-7FC6-4E97-9BE5-4BC077BE0D4B} = {C30D35E4-7FC6-4E97-9BE5-4BC077BE0D4B}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_l16", "src\mod\codecs\mod_l16\mod_l16.vcproj", "{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}"
@@ -115,24 +115,24 @@
 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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{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}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"
@@ -155,19 +155,19 @@
 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}
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	EndProjectSection
 EndProject
 Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FreeSwitchSetup", "w32\Setup\Setup.vdproj", "{B17FFBE6-A942-4056-8346-B624FB5D995B}"
@@ -181,28 +181,28 @@
 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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{49C34584-B6DA-448F-83CF-27584DC9FC90} = {49C34584-B6DA-448F-83CF-27584DC9FC90}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libteletone", "libs\libteletone\libteletone.vcproj", "{89385C74-5860-4174-9CAF-A39E7C48909C}"
@@ -211,15 +211,15 @@
 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}
-		{76D0A759-9C07-42D4-90A9-82AE15462C95} = {76D0A759-9C07-42D4-90A9-82AE15462C95}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{76D0A759-9C07-42D4-90A9-82AE15462C95} = {76D0A759-9C07-42D4-90A9-82AE15462C95}
+		{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}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
+		{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}"
@@ -241,35 +241,35 @@
 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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
-		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}"
@@ -283,54 +283,54 @@
 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
-		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{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}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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
-		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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
-		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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
-		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{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}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
@@ -355,8 +355,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre", "libs\win32\pcre\libpcre.vcproj", "{8D04B550-D240-4A44-8A18-35DA3F7038D9}"
 	ProjectSection(ProjectDependencies) = postProject
-		{1CED5987-A529-46DC-B30F-870D85FF9C94} = {1CED5987-A529-46DC-B30F-870D85FF9C94}
 		{91695C7C-7AD1-4782-9727-508F82D9C577} = {91695C7C-7AD1-4782-9727-508F82D9C577}
+		{1CED5987-A529-46DC-B30F-870D85FF9C94} = {1CED5987-A529-46DC-B30F-870D85FF9C94}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre Generate pcre_chartables.c", "libs\win32\pcre\pcre_chartables.c.vcproj", "{1CED5987-A529-46DC-B30F-870D85FF9C94}"
@@ -376,18 +376,18 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libapriconv", "libs\win32\apr-iconv\libapriconv.vcproj", "{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}"
 	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
 		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C4854C1D-5478-4F87-AB62-36CCDDDBA3C7}
+		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\apr-util\libaprutil.vcproj", "{F057DA7F-79E5-4B00-845C-EF446EF055E3}"
 	ProjectSection(ProjectDependencies) = postProject
-		{E969F3E0-1043-482A-AD49-787B8356BA92} = {E969F3E0-1043-482A-AD49-787B8356BA92}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
 		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C4854C1D-5478-4F87-AB62-36CCDDDBA3C7}
+		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{E969F3E0-1043-482A-AD49-787B8356BA92} = {E969F3E0-1043-482A-AD49-787B8356BA92}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Downloads", "_Downloads", "{C120A020-773F-4EA3-923F-B67AF28B750D}"
@@ -401,8 +401,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download APR-Util", "libs\win32\Download APR-Util.vcproj", "{E969F3E0-1043-482A-AD49-787B8356BA92}"
 	ProjectSection(ProjectDependencies) = postProject
-		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
 		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C4854C1D-5478-4F87-AB62-36CCDDDBA3C7}
+		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download LIBRESAMPLE", "libs\win32\Download LIBRESAMPLE.vcproj", "{C3B50FF8-E49B-4589-B07A-4D7866980669}"
@@ -436,15 +436,15 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eXosip", "libs\win32\exosip\eXosip.vcproj", "{4EA67539-9EE9-4065-BD39-87E517FD8262}"
 	ProjectSection(ProjectDependencies) = postProject
-		{C038D7B4-B116-4C3E-93E2-45D295429808} = {C038D7B4-B116-4C3E-93E2-45D295429808}
-		{44F46B7E-0E51-4304-9735-330DFBAB41E5} = {44F46B7E-0E51-4304-9735-330DFBAB41E5}
 		{85255507-5D16-4218-85E2-F683BB2F04DA} = {85255507-5D16-4218-85E2-F683BB2F04DA}
+		{44F46B7E-0E51-4304-9735-330DFBAB41E5} = {44F46B7E-0E51-4304-9735-330DFBAB41E5}
+		{C038D7B4-B116-4C3E-93E2-45D295429808} = {C038D7B4-B116-4C3E-93E2-45D295429808}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "osip2", "libs\win32\exosip\osip2.vcproj", "{85255507-5D16-4218-85E2-F683BB2F04DA}"
 	ProjectSection(ProjectDependencies) = postProject
-		{C038D7B4-B116-4C3E-93E2-45D295429808} = {C038D7B4-B116-4C3E-93E2-45D295429808}
 		{44F46B7E-0E51-4304-9735-330DFBAB41E5} = {44F46B7E-0E51-4304-9735-330DFBAB41E5}
+		{C038D7B4-B116-4C3E-93E2-45D295429808} = {C038D7B4-B116-4C3E-93E2-45D295429808}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "osipparser2", "libs\win32\exosip\osipparser2.vcproj", "{44F46B7E-0E51-4304-9735-330DFBAB41E5}"
@@ -461,8 +461,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}") = "Download LIBSNDFILE", "libs\win32\Download LIBSNDFILE.vcproj", "{EFA9E76E-62A5-4237-B7E9-F39B8E174CD5}"
@@ -488,8 +488,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Abyss", "libs\win32\xmlrpc\Abyss.vcproj", "{356EC96D-4C9F-47B5-9083-FC328B87BA94}"
 	ProjectSection(ProjectDependencies) = postProject
-		{EC8D4AE8-0F3E-454A-BFB8-D56A5D9C0121} = {EC8D4AE8-0F3E-454A-BFB8-D56A5D9C0121}
 		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
+		{EC8D4AE8-0F3E-454A-BFB8-D56A5D9C0121} = {EC8D4AE8-0F3E-454A-BFB8-D56A5D9C0121}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.vcproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}"
@@ -503,27 +503,27 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "js", "libs\win32\js\js.vcproj", "{204FA0DE-305D-4414-AE2E-F195A23F390D}"
 	ProjectSection(ProjectDependencies) = postProject
-		{B0AA13FC-636C-45A7-8EAE-663220679A75} = {B0AA13FC-636C-45A7-8EAE-663220679A75}
 		{76D0A759-9C07-42D4-90A9-82AE15462C95} = {76D0A759-9C07-42D4-90A9-82AE15462C95}
+		{B0AA13FC-636C-45A7-8EAE-663220679A75} = {B0AA13FC-636C-45A7-8EAE-663220679A75}
 	EndProjectSection
 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
-		{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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg7xx", "libs\codec\g7xx\libg7xx.vcproj", "{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}"
@@ -537,6 +537,14 @@
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	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
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -551,8 +559,10 @@
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.Build.0 = Debug|Win32
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.ActiveCfg = Release|Win32
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.Build.0 = Release|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.ActiveCfg = Release|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.Build.0 = Debug Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.ActiveCfg = Release Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.Build.0 = Release Passthrough|Win32
 		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Debug|Win32.ActiveCfg = Debug|Win32
 		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Debug|Win32.Build.0 = Debug|Win32
 		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Release|Win32.ActiveCfg = Release|Win32
@@ -881,6 +891,10 @@
 		{D42518CC-7475-454D-B392-0E132C07D761}.Debug|Win32.Build.0 = Debug|Win32
 		{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.ActiveCfg = Release|Win32
 		{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.Build.0 = Release|Win32
+		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Debug|Win32.Build.0 = Debug|Win32
+		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|Win32.ActiveCfg = Release|Win32
+		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -909,6 +923,7 @@
 		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{3A5B9131-F20C-4A85-9447-6C1610941CEE} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
 		{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
 		{FE3540C5-3303-46E0-A69E-D92F775687F1} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}

Modified: freeswitch/branches/james/Makefile.in
==============================================================================
--- freeswitch/branches/james/Makefile.in	(original)
+++ freeswitch/branches/james/Makefile.in	Sun Sep 10 07:09:34 2006
@@ -1136,6 +1136,8 @@
 
 installall: install install_mod
 
+sure: clean modclean modwipe uninstall installall
+
 wayclean: clean modclean
 
 modwipe:

Modified: freeswitch/branches/james/libs/codec/lpc10/Makefile.am
==============================================================================
--- freeswitch/branches/james/libs/codec/lpc10/Makefile.am	(original)
+++ freeswitch/branches/james/libs/codec/lpc10/Makefile.am	Sun Sep 10 07:09:34 2006
@@ -2,24 +2,20 @@
 SUBDIRS = 
 AUTOMAKE_OPTS= gnu
 MAKE=gmake
-NAME=liblpc10
+NAME=libg7xx
 
 AM_CC=gcc
 AM_CFLAGS	= -Wall -O3 -funroll-loops
 AM_CPPFLAGS = $(AM_CFLAGS)
 
-lib_LTLIBRARIES		= liblpc10.la
-liblpc10_la_SOURCES	= analys.c  dcbias.c  difmag.c  energy.c  hp100.c   ivfilt.c  lpcini.c  mload.c   placea.c  prepro.c  synths.c  vparms.c \
-bsynz.c   decode.c  dyptrk.c  f2clib.c  invert.c  lpcdec.c  lpfilt.c  onset.c   placev.c  random.c  tbdm.c \
-chanwr.c  deemp.c   encode.c  ham84.c   irc2pc.c  lpcenc.c  median.c  pitsyn.c  preemp.c  rcchk.c   voicin.c 
+lib_LTLIBRARIES		= libg7xx.la
+libg7xx_la_SOURCES	= g711.c g722_deode.c  g722_encode.c  g726.c  
 
+libg7xx_la_CFLAGS	= $(AM_CFLAGS)
+libg7xx_la_LDFLAGS	= 
 
-
-liblpc10_la_CFLAGS	= $(AM_CFLAGS)
-liblpc10_la_LDFLAGS	= 
-
-library_includedir	= $(prefix)/include/lpc10
-library_include_HEADERS =  f2c.h  lpc10.h
+library_includedir	= $(prefix)/include/g7xx
+library_include_HEADERS =  g726.h g711.h  g722.h
 
 
 

Modified: freeswitch/branches/james/libs/win32/apr-iconv/libapriconv.vcproj
==============================================================================
--- freeswitch/branches/james/libs/win32/apr-iconv/libapriconv.vcproj	(original)
+++ freeswitch/branches/james/libs/win32/apr-iconv/libapriconv.vcproj	Sun Sep 10 07:09:34 2006
@@ -25,7 +25,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="if not exist $(ProjectDir)..\..\include\ md  $(ProjectDir)..\..\include\&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-iconv-1.1.1\include\*.h&quot; $(ProjectDir)..\..\include\ /C /D /Y&#x0D;&#x0A;"
+				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-iconv-1.1.1\include\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -123,7 +123,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="if not exist $(ProjectDir)..\..\include\ md  $(ProjectDir)..\..\include\&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-iconv-1.1.1\include\*.h&quot; $(ProjectDir)..\..\include\ /C /D /Y&#x0D;&#x0A;"
+				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-iconv-1.1.1\include\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"

Modified: freeswitch/branches/james/libs/win32/apr-util/libaprutil.vcproj
==============================================================================
--- freeswitch/branches/james/libs/win32/apr-util/libaprutil.vcproj	(original)
+++ freeswitch/branches/james/libs/win32/apr-util/libaprutil.vcproj	Sun Sep 10 07:09:34 2006
@@ -25,7 +25,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="if not exist $(ProjectDir)..\..\include\ md  $(ProjectDir)..\..\include\&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.h&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apu.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apu.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apu.h&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.h&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.h&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.h&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\*.h&quot; $(ProjectDir)..\..\include\ /C /D /Y&#x0D;&#x0A;"
+				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.h&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu.h&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.h&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.h&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.h&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -125,7 +125,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="if not exist $(ProjectDir)..\..\include\ md  $(ProjectDir)..\..\include\&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.h&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apu.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apu.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apu.h&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.h&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.h&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.h type $(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.hw &gt; $(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.h&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\*.h&quot; $(ProjectDir)..\..\include\ /C /D /Y&#x0D;&#x0A;"
+				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apr_ldap.h&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu.h&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_config.h&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_select_dbm.h&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.h&quot; type &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\apu_want.h&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-util-1.2.7\include\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"

Modified: freeswitch/branches/james/libs/win32/apr/libapr.vcproj
==============================================================================
--- freeswitch/branches/james/libs/win32/apr/libapr.vcproj	(original)
+++ freeswitch/branches/james/libs/win32/apr/libapr.vcproj	Sun Sep 10 07:09:34 2006
@@ -25,7 +25,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="if not exist $(ProjectDir)..\..\include\ md  $(ProjectDir)..\..\include\&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-1.2.7\include\apr.h type $(ProjectDir)apr.hw &gt; $(ProjectDir)..\..\apr-1.2.7\include\apr.h&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-1.2.7\include\*.h&quot; $(ProjectDir)..\..\include\ /C /D /Y&#x0D;&#x0A;"
+				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-1.2.7\include\apr.h&quot; type &quot;$(ProjectDir)apr.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-1.2.7\include\apr.h&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-1.2.7\include\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -124,7 +124,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="if not exist $(ProjectDir)..\..\include\ md  $(ProjectDir)..\..\include\&#x0D;&#x0A;if not exist $(ProjectDir)..\..\apr-1.2.7\include\apr.h type $(ProjectDir)apr.hw &gt; $(ProjectDir)..\..\apr-1.2.7\include\apr.h&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-1.2.7\include\*.h&quot; $(ProjectDir)..\..\include\ /C /D /Y&#x0D;&#x0A;"
+				CommandLine="if not exist &quot;$(ProjectDir)..\..\include\&quot; md  &quot;$(ProjectDir)..\..\include\&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\..\apr-1.2.7\include\apr.h&quot; type &quot;$(ProjectDir)apr.hw&quot; &gt; &quot;$(ProjectDir)..\..\apr-1.2.7\include\apr.h&quot;&#x0D;&#x0A;xcopy &quot;$(ProjectDir)..\..\apr-1.2.7\include\*.h&quot; &quot;$(ProjectDir)..\..\include\&quot; /C /D /Y&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"

Modified: freeswitch/branches/james/src/include/switch.h
==============================================================================
--- freeswitch/branches/james/src/include/switch.h	(original)
+++ freeswitch/branches/james/src/include/switch.h	Sun Sep 10 07:09:34 2006
@@ -36,11 +36,11 @@
 #define SWITCH_H
 
 #ifdef __cplusplus
-#define BEGIN_EXTERN_C       extern "C" {
-#define END_EXTERN_C         }
+#define SWITCH_BEGIN_EXTERN_C       extern "C" {
+#define SWITCH_END_EXTERN_C         }
 #else
-#define BEGIN_EXTERN_C
-#define END_EXTERN_C
+#define SWITCH_BEGIN_EXTERN_C
+#define SWITCH_END_EXTERN_C
 #endif
 
 

Modified: freeswitch/branches/james/src/include/switch_apr.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_apr.h	(original)
+++ freeswitch/branches/james/src/include/switch_apr.h	Sun Sep 10 07:09:34 2006
@@ -63,7 +63,7 @@
 #include <apr_want.h>
 #include <apr_env.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 /*
    The pieces of apr we allow ppl to pass around between modules we typedef into our namespace and wrap all the functions
@@ -1433,6 +1433,6 @@
 /** @} */
 /** @} */
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_bitpack.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_bitpack.h	(original)
+++ freeswitch/branches/james/src/include/switch_bitpack.h	Sun Sep 10 07:09:34 2006
@@ -35,7 +35,7 @@
 */
 #ifndef SWITCH_BITPACK_H
 #define SWITCH_BITPACK_H
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 #include <switch.h>
 
@@ -278,5 +278,5 @@
 }
 ///\}
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 #endif

Modified: freeswitch/branches/james/src/include/switch_buffer.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_buffer.h	(original)
+++ freeswitch/branches/james/src/include/switch_buffer.h	Sun Sep 10 07:09:34 2006
@@ -40,7 +40,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 /**
  * @defgroup switch_buffer Buffer Routines
@@ -62,6 +62,18 @@
  */
 SWITCH_DECLARE(switch_status_t) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer_t **buffer, switch_size_t max_len);
 
+/*! \brief Allocate a new dynamic switch_buffer 
+ * \param buffer returned pointer to the new buffer
+ * \param blocksize length to realloc by as data is added
+ * \param start_len ammount of memory to reserve initially
+ * \param max_len length the buffer is allowed to grow to
+ * \return status
+ */
+SWITCH_DECLARE(switch_status_t) switch_buffer_create_dynamic(switch_buffer_t **buffer,
+															 switch_size_t blocksize,
+															 switch_size_t start_len,
+															 switch_size_t max_len);
+
 /*! \brief Get the length of a switch_buffer_t 
  * \param buffer any buffer of type switch_buffer_t
  * \return int size of the buffer.
@@ -107,8 +119,15 @@
  * \param buffer any buffer of type switch_buffer_t
  */
 SWITCH_DECLARE(void) switch_buffer_zero(switch_buffer_t *buffer);
+
+/*! \brief Destroy the buffer
+ * \param buffer buffer to destroy
+ * \note only neccessary on dynamic buffers (noop on pooled ones)
+ */
+SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer);
+
 /** @} */
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_caller.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_caller.h	(original)
+++ freeswitch/branches/james/src/include/switch_caller.h	Sun Sep 10 07:09:34 2006
@@ -55,7 +55,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 /*! \brief Call Specific Data
  */
@@ -195,7 +195,7 @@
 
 SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_t *caller_profile, char *prefix, switch_event_t *event);
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 /** @} */
 

Modified: freeswitch/branches/james/src/include/switch_channel.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_channel.h	(original)
+++ freeswitch/branches/james/src/include/switch_channel.h	Sun Sep 10 07:09:34 2006
@@ -40,7 +40,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 struct switch_channel_timetable {
 	switch_time_t created;
@@ -137,6 +137,12 @@
 								uint32_t flags);
 
 /*!
+  \brief Uninitalize a channel
+  \param channel the channel to uninit
+*/
+SWITCH_DECLARE(void) switch_channel_uninit(switch_channel_t *channel);
+
+/*!
   \brief Set the given channel's caller profile
   \param channel channel to assign the profile to
   \param caller_profile the profile to assign
@@ -298,17 +304,19 @@
 /*!
   \brief Set private data on channel
   \param channel channel on which to set data
+  \param key unique keyname to associate your private data to
   \param private_info void pointer to private data
   \return SWITCH_STATUS_SUCCESS if data was set
 */
-SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, void *private_info);
+SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, char *key, void *private_info);
 
 /*!
   \brief Retrieve private from a given channel
   \param channel channel to retrieve data from
+  \param key unique keyname to retrieve your private data
   \return void pointer to channel's private data
 */
-SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel);
+SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, char *key);
 
 /*!
   \brief Assign a name to a given channel
@@ -391,6 +399,6 @@
 SWITCH_DECLARE(switch_status_t) switch_channel_get_raw_mode (switch_channel_t *channel, int *freq, int *bits, int *channels, int *ms, int *kbps);
 /** @} */
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_config.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_config.h	(original)
+++ freeswitch/branches/james/src/include/switch_config.h	Sun Sep 10 07:09:34 2006
@@ -58,7 +58,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 /*! \brief A simple file handle representing an open configuration file **/
 struct switch_config {
@@ -104,7 +104,7 @@
 */
 SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t *cfg, char **var, char **val);
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 /** @} */
 

Modified: freeswitch/branches/james/src/include/switch_console.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_console.h	(original)
+++ freeswitch/branches/james/src/include/switch_console.h	Sun Sep 10 07:09:34 2006
@@ -41,8 +41,19 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
+#define SWITCH_CMD_CHUNK_LEN 1024
+#define SWITCH_STANDARD_STREAM(s) if ((s.data = (char *)malloc(SWITCH_CMD_CHUNK_LEN))) { \
+		memset(s.data, 0, SWITCH_CMD_CHUNK_LEN);						\
+		s.end = s.data;\
+		s.data_size = SWITCH_CMD_CHUNK_LEN;\
+		s.write_function = switch_console_stream_write;\
+		s.alloc_len = SWITCH_CMD_CHUNK_LEN;\
+		s.alloc_chunk = SWITCH_CMD_CHUNK_LEN;\
+	}
 
+ 
+
 /*!
   \brief A simple comand loop that reads input from the terminal
 */
@@ -57,6 +68,6 @@
   \brief A method akin to printf for dealing with api streams
 */
 SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, char *fmt, ...);
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_core.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_core.h	(original)
+++ freeswitch/branches/james/src/include/switch_core.h	Sun Sep 10 07:09:34 2006
@@ -40,7 +40,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 #define SWITCH_MAX_CORE_THREAD_SESSION_OBJS 128
 #define SWITCH_MAX_STREAMS 128
@@ -99,14 +99,89 @@
 
 struct switch_core_session;
 struct switch_core_runtime;
+struct switch_core_port_allocator;
 
-
 /*!
   \defgroup core1 Core Library 
   \ingroup FREESWITCH
   \{ 
 */
 
+
+///\defgroup mb1 Media Bugs
+///\ingroup core1
+///\{
+
+/*!
+  \brief Add a media bug to the session
+  \param session the session to add the bug to
+  \param callback a callback for events
+  \param user_data arbitrary user data
+  \param new_bug pointer to assign new bug to
+  \return SWITCH_STATUS_SUCCESS if the operation was a success
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_media_bug_add(switch_core_session_t *session,
+														  switch_media_bug_callback_t callback,
+														  void *user_data,
+														  switch_media_bug_t **new_bug);
+
+
+/*!
+  \brief Remove a media bug from the session
+  \param session the session to remove the bug from
+  \param bug bug to remove
+  \return SWITCH_STATUS_SUCCESS if the operation was a success
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(switch_core_session_t *session, switch_media_bug_t **bug);
+
+/*!
+  \brief Remove all media bugs from the session
+  \param session the session to remove the bugs from
+  \return SWITCH_STATUS_SUCCESS if the operation was a success
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(switch_core_session_t *session);
+
+/*!
+  \brief Read a frame from the bug
+  \param bug the bug to read from
+  \param frame the frame to write the data to
+  \return the amount of data 
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *bug, switch_frame_t *frame);
+
+///\}
+
+///\defgroup pa1 Port Allocation
+///\ingroup core1
+///\{
+
+/*!
+  \brief Initilize the port allocator
+  \param start the starting port
+  \param end the ending port
+  \param inc the amount to increment each port
+  \param new_allocator new pointer for the return value
+  \return SWITCH_STATUS_SUCCESS if the operation was a success
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start,
+															   switch_port_t end,
+															   uint8_t inc,
+															   switch_core_port_allocator_t **new_allocator);
+
+/*!
+  \brief Get a port from the port allocator
+  \param alloc the allocator object
+  \return the port
+*/
+SWITCH_DECLARE(switch_port_t) switch_core_port_allocator_request_port(switch_core_port_allocator_t *alloc);
+
+/*!
+  \brief destroythe port allocator
+  \param alloc the allocator object
+*/
+SWITCH_DECLARE(void) switch_core_port_allocator_destroy(switch_core_port_allocator_t **alloc);
+///\}
+
 ///\defgroup ss Startup/Shutdown
 ///\ingroup core1
 ///\{
@@ -469,8 +544,32 @@
 */
 SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(switch_core_session_t *session, switch_event_t **event);
 
+/*! 
+  \brief Queue a private event on a given session
+  \param session the session to queue the message on
+  \param event the event to queue
+  \return the status returned by the message handler
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_session_queue_private_event(switch_core_session_t *session, switch_event_t **event);
 
+
 /*! 
+  \brief Indicate the number of waiting private events on a session
+  \param session the session to check
+  \return the number of events
+*/
+SWITCH_DECLARE(int32_t) switch_core_session_private_event_count(switch_core_session_t *session);
+
+/*! 
+  \brief DE-Queue a private event on a given session
+  \param session the session to de-queue the message on
+  \param event the de-queued event
+  \return the  SWITCH_STATUS_SUCCESS if the event was de-queued
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch_core_session_t *session, switch_event_t **event);
+
+
+/*! 
   \brief Read a frame from a session
   \param session the session to read from
   \param frame a NULL pointer to a frame to aim at the newly read frame
@@ -1118,6 +1217,6 @@
   \}
 */
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_event.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_event.h	(original)
+++ freeswitch/branches/james/src/include/switch_event.h	Sun Sep 10 07:09:34 2006
@@ -60,7 +60,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 /*! \brief An event Header */
 struct switch_event_header{
@@ -310,6 +310,6 @@
 #define switch_event_fire_data(event, data) switch_event_fire_detailed(__FILE__, (char * )__FUNCTION__, __LINE__, event, data)
 ///\}
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_frame.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_frame.h	(original)
+++ freeswitch/branches/james/src/include/switch_frame.h	Sun Sep 10 07:09:34 2006
@@ -38,7 +38,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 /*! \brief An abstraction of a data frame */
 struct switch_frame {
@@ -68,6 +68,6 @@
 	switch_frame_flag_t flags;
 };
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_ivr.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_ivr.h	(original)
+++ freeswitch/branches/james/src/include/switch_ivr.h	Sun Sep 10 07:09:34 2006
@@ -40,8 +40,10 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
+static const switch_state_handler_table_t noop_state_handler = {0};
+
 /**
  * @defgroup switch_ivr IVR Library
  * @ingroup core1
@@ -59,6 +61,8 @@
 */
 SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms);
 
+SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session);
+
 /*!
   \brief Wait for DTMF digits calling a pluggable callback function when digits are collected.
   \param session the session to read.
@@ -90,8 +94,25 @@
 																const char *terminators,
 																char *terminator,
 																unsigned int timeout);
-	
+
 /*!
+  \brief Record a session to disk
+  \param session the session to record
+  \param file the path to the file
+  \param fh file handle to use (NULL for builtin one)
+  \return SWITCH_STATUS_SUCCESS if all is well
+*/
+SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file,  switch_file_handle_t *fh);
+
+/*!
+  \brief Stop Recording a session
+  \param session the session to stop recording
+  \param file the path to the file
+  \return SWITCH_STATUS_SUCCESS if all is well
+*/
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, char *file);
+
+/*!
   \brief play a file from the disk to the session
   \param session the session to play the file too
   \param fh file handle to use (NULL for builtin one)
@@ -212,7 +233,7 @@
 
 /** @} */
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif
 

Modified: freeswitch/branches/james/src/include/switch_loadable_module.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_loadable_module.h	(original)
+++ freeswitch/branches/james/src/include/switch_loadable_module.h	Sun Sep 10 07:09:34 2006
@@ -43,7 +43,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 /*!
   \defgroup mods Loadable Module Functions
@@ -230,6 +230,6 @@
 SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void);
 ///\}
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_log.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_log.h	(original)
+++ freeswitch/branches/james/src/include/switch_log.h	Sun Sep 10 07:09:34 2006
@@ -40,7 +40,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 ///\defgroup log Logger Routines
 ///\ingroup core1
@@ -117,6 +117,6 @@
 SWITCH_DECLARE(switch_log_level_t) switch_log_str2level(const char *str);
 
 ///\}
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_module_interfaces.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_module_interfaces.h	(original)
+++ freeswitch/branches/james/src/include/switch_module_interfaces.h	Sun Sep 10 07:09:34 2006
@@ -41,7 +41,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 /*! \brief A table of functions to execute at various states 
 */
@@ -68,6 +68,8 @@
 	void *end;
 	switch_size_t data_size;
 	switch_size_t data_len;
+	switch_size_t alloc_len;
+	switch_size_t alloc_chunk;
 	switch_event_t *event;
 };
 
@@ -534,6 +536,6 @@
 	const struct switch_api_interface *next;
 };
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_platform.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_platform.h	(original)
+++ freeswitch/branches/james/src/include/switch_platform.h	Sun Sep 10 07:09:34 2006
@@ -34,7 +34,7 @@
 #ifndef SWITCH_PLATFORM_H
 #define SWITCH_PLATFORM_H
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 #ifdef __ICC
 #pragma warning (disable:810 869 981 279 1469 188)
@@ -141,6 +141,6 @@
 #define DoxyDefine(x)
 #endif
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_resample.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_resample.h	(original)
+++ freeswitch/branches/james/src/include/switch_resample.h	Sun Sep 10 07:09:34 2006
@@ -43,7 +43,7 @@
 #define SWITCH_RESAMPLE_H
 
 #include <switch.h>
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 #include <stdlib.h>
 
 /*!
@@ -156,7 +156,7 @@
 
 ///\}
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif
 

Modified: freeswitch/branches/james/src/include/switch_rtp.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_rtp.h	(original)
+++ freeswitch/branches/james/src/include/switch_rtp.h	Sun Sep 10 07:09:34 2006
@@ -38,7 +38,7 @@
 #ifndef SWITCH_RTP_H
 #define SWITCH_RTP_H
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 #define SWITCH_RTP_MAX_BUF_LEN 16384
 
@@ -373,6 +373,6 @@
   \}
 */
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_sqlite.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_sqlite.h	(original)
+++ freeswitch/branches/james/src/include/switch_sqlite.h	Sun Sep 10 07:09:34 2006
@@ -35,7 +35,7 @@
 #ifndef SWITCH_SQLITE_H
 #define SWITCH_SQLITE_H
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 #include <sqlite3.h>
 
@@ -1804,6 +1804,6 @@
 /** @} */
 /** @} */
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_stun.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_stun.h	(original)
+++ freeswitch/branches/james/src/include/switch_stun.h	Sun Sep 10 07:09:34 2006
@@ -37,7 +37,7 @@
 #ifndef _SWITCH_STUN_PARSER_H
 #define _SWITCH_STUN_PARSER_H
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 #define SWITCH_STUN_DEFAULT_PORT 3478
 #define SWITCH_STUN_PACKET_MIN_LEN 20
@@ -240,6 +240,6 @@
 #define switch_stun_packet_length(packet) ntohs(packet->header.length) + sizeof(switch_stun_packet_header_t)
 ///\}
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_types.h	(original)
+++ freeswitch/branches/james/src/include/switch_types.h	Sun Sep 10 07:09:34 2006
@@ -36,7 +36,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 #ifdef WIN32
 #define SWITCH_PATH_SEPARATOR "\\"
@@ -80,6 +80,12 @@
 	SWITCH_BITPACK_MODE_AAL2
 } switch_bitpack_mode_t;
 
+typedef enum {
+	SWITCH_ABC_TYPE_INIT,
+	SWITCH_ABC_TYPE_READ,
+	SWITCH_ABC_TYPE_WRITE,
+	SWITCH_ABC_TYPE_CLOSE,
+} switch_abc_type_t;
 
 typedef struct {
 	switch_byte_t *buf;
@@ -382,7 +388,8 @@
 CF_HOLD			= (1 <<  8) - Channel is on hold
 CF_SERVICE		= (1 <<  9) - Channel has a service thread
 CF_TAGGED		= (1 << 10) - Channel is tagged
-CF_WINNER		= (1 << 10) - Channel is the winner
+CF_WINNER		= (1 << 11) - Channel is the winner
+CF_CONTROLLED	= (1 << 12) - Channel is under control
 </pre>
  */
 
@@ -398,7 +405,8 @@
 	CF_HOLD			= (1 <<  8),
 	CF_SERVICE		= (1 <<  9),
 	CF_TAGGED		= (1 << 10),
-	CF_WINNER		= (1 << 11)
+	CF_WINNER		= (1 << 11),
+	CF_CONTROLLED	= (1 << 12)
 } switch_channel_flag_t;
 
 
@@ -444,6 +452,7 @@
 SWITCH_CODEC_FLAG_SILENCE =			(1 <<  4) - Silence
 SWITCH_CODEC_FLAG_FREE_POOL =		(1 <<  5) - Free codec's pool on destruction
 SWITCH_CODEC_FLAG_AAL2 =			(1 <<  6) - USE AAL2 Bitpacking
+SWITCH_CODEC_FLAG_PASSTHROUGH =		(1 <<  7) - Passthrough only
 </pre>
 */
 typedef enum {
@@ -453,7 +462,8 @@
 	SWITCH_CODEC_FLAG_SILENCE_STOP =	(1 <<  3),
 	SWITCH_CODEC_FLAG_SILENCE =			(1 <<  4),
 	SWITCH_CODEC_FLAG_FREE_POOL =		(1 <<  5),
-	SWITCH_CODEC_FLAG_AAL2 =			(1 <<  6)
+	SWITCH_CODEC_FLAG_AAL2 =			(1 <<  6),
+	SWITCH_CODEC_FLAG_PASSTHROUGH =		(1 <<  7)
 } switch_codec_flag_t;
 
 
@@ -571,6 +581,10 @@
     SWITCH_EVENT_CHANNEL_EXECUTE	- A channel has executed a module's application
 	SWITCH_EVENT_CHANNEL_BRIDGE     - A channel has bridged to another channel
 	SWITCH_EVENT_CHANNEL_UNBRIDGE   - A channel has unbridged from another channel
+    SWITCH_EVENT_CHANNEL_PROGRESS	- A channel has been parked
+    SWITCH_EVENT_CHANNEL_OUTGOING	- A channel has been unparked
+	SWITCH_EVENT_CHANNEL_PARK 		- A channel has been parked
+	SWITCH_EVENT_CHANNEL_UNPARK 	- A channel has been unparked
     SWITCH_EVENT_API				- An API call has been executed
     SWITCH_EVENT_LOG				- A LOG event has been triggered
     SWITCH_EVENT_INBOUND_CHAN		- A new inbound channel has been created
@@ -586,8 +600,7 @@
 	SWITCH_EVENT_DTMF				- DTMF was sent
 	SWITCH_EVENT_MESSAGE			- A Basic Message
 	SWITCH_EVENT_CODEC				- Codec Change
-	SWITCH_EVENT_PROGRESS			- Early Media
-	SWITCH_EVENT_OUTGOING			- Outgoing Channel
+	SWITCH_EVENT_BACKGROUND_JOB		- Background Job
     SWITCH_EVENT_ALL				- All events at once
 </pre>
 
@@ -604,6 +617,8 @@
 	SWITCH_EVENT_CHANNEL_UNBRIDGE,
 	SWITCH_EVENT_CHANNEL_PROGRESS,
 	SWITCH_EVENT_CHANNEL_OUTGOING,
+	SWITCH_EVENT_CHANNEL_PARK,
+	SWITCH_EVENT_CHANNEL_UNPARK,
 	SWITCH_EVENT_API,
 	SWITCH_EVENT_LOG,
 	SWITCH_EVENT_INBOUND_CHAN,
@@ -619,6 +634,7 @@
 	SWITCH_EVENT_DTMF,
 	SWITCH_EVENT_MESSAGE,
 	SWITCH_EVENT_CODEC,
+	SWITCH_EVENT_BACKGROUND_JOB,
 	SWITCH_EVENT_ALL
 } switch_event_types_t;
 
@@ -728,7 +744,9 @@
 typedef struct switch_file_interface switch_file_interface_t;
 typedef struct switch_speech_interface switch_speech_interface_t;
 typedef struct switch_directory_interface switch_directory_interface_t;
-
+typedef struct switch_core_port_allocator switch_core_port_allocator_t;
+typedef struct switch_media_bug switch_media_bug_t;
+typedef void (*switch_media_bug_callback_t)(switch_media_bug_t *, void *, switch_abc_type_t);
 typedef void (*switch_application_function_t)(switch_core_session_t *, char *);
 typedef void (*switch_event_callback_t)(switch_event_t *);
 typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t)(switch_core_session_t *);
@@ -773,7 +791,9 @@
 struct switch_channel;
 /*! \brief A core session representing a call and all of it's resources */
 struct switch_core_session;
+/*! \brief An audio bug */
+struct switch_media_bug;
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_utils.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_utils.h	(original)
+++ freeswitch/branches/james/src/include/switch_utils.h	Sun Sep 10 07:09:34 2006
@@ -40,7 +40,7 @@
 
 #include <switch.h>
 
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 #ifndef snprintf
 #define snprintf apr_snprintf
@@ -50,6 +50,12 @@
 #endif
 
 
+#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;
+
+
+
 /*!
   \brief Evaluate the truthfullness of a string expression
   \param expr a string expression
@@ -210,6 +216,6 @@
 #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);
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 #endif

Modified: freeswitch/branches/james/src/include/switch_xml.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_xml.h	(original)
+++ freeswitch/branches/james/src/include/switch_xml.h	Sun Sep 10 07:09:34 2006
@@ -65,7 +65,7 @@
 ///\defgroup xml1 XML Library Functions
 ///\ingroup core1
 ///\{
-BEGIN_EXTERN_C
+SWITCH_BEGIN_EXTERN_C
 
 #define SWITCH_XML_BUFSIZE 1024 // size of internal memory buffers
 
@@ -331,7 +331,7 @@
 ///\return the section mask
 SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(char *str);
 
-END_EXTERN_C
+SWITCH_END_EXTERN_C
 
 ///\}
 

Modified: freeswitch/branches/james/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/james/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/branches/james/src/mod/applications/mod_commands/mod_commands.c	Sun Sep 10 07:09:34 2006
@@ -260,7 +260,7 @@
 		return SWITCH_STATUS_SUCCESS;
 	}
 
-	if (switch_ivr_originate(NULL, &caller_session, aleg, timeout, NULL, cid_name, cid_num, NULL) != SWITCH_STATUS_SUCCESS) {
+	if (switch_ivr_originate(NULL, &caller_session, aleg, timeout, &noop_state_handler, cid_name, cid_num, NULL) != SWITCH_STATUS_SUCCESS) {
 		stream->write_function(stream, "Cannot Create Outgoing Channel! [%s]\n", aleg);
 		return SWITCH_STATUS_SUCCESS;
 	} 
@@ -268,10 +268,33 @@
 	caller_channel = switch_core_session_get_channel(caller_session);
 	assert(caller_channel != NULL);
 	switch_channel_clear_state_handler(caller_channel, NULL);
-	switch_core_session_rwunlock(caller_session);
 
-	switch_ivr_session_transfer(caller_session, exten, dp, context);
 
+	if (*exten == '&') {
+		switch_caller_extension_t *extension = NULL;
+		char *app_name = switch_core_session_strdup(caller_session, (exten + 1));
+		char *arg, *e;
+
+		if ((e = strchr(app_name, ')'))) {
+			*e = '\0';
+		}
+
+		if ((arg = strchr(app_name, '('))) {
+			*arg++ = '\0';
+		}
+
+		if ((extension = switch_caller_extension_new(caller_session, app_name, arg)) == 0) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "memory error!\n");
+			switch_channel_hangup(caller_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+			return SWITCH_STATUS_MEMERR;
+		}
+		switch_caller_extension_add_application(caller_session, extension, app_name, arg);
+		switch_channel_set_caller_extension(caller_channel, extension);
+		switch_channel_set_state(caller_channel, CS_EXECUTE);
+	} else {
+		switch_ivr_session_transfer(caller_session, exten, dp, context);
+	}
+	stream->write_function(stream, "Created Session: %s\n", switch_core_session_get_uuid(caller_session));
 	return SWITCH_STATUS_SUCCESS;;
 }
 

Modified: freeswitch/branches/james/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/james/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/branches/james/src/mod/applications/mod_conference/mod_conference.c	Sun Sep 10 07:09:34 2006
@@ -40,6 +40,10 @@
 #define CONF_EVENT_MAINT "conference::maintenence"
 #define CONF_DEFAULT_LEADIN 20
 
+#define CONF_DBLOCK_SIZE CONF_BUFFER_SIZE
+#define CONF_DBUFFER_SIZE CONF_BUFFER_SIZE
+#define CONF_DBUFFER_MAX 0
+
 typedef enum {
 	FILE_STOP_CURRENT,
 	FILE_STOP_ALL
@@ -197,6 +201,7 @@
 										  switch_core_session_t *session,
 										  char *bridgeto,
 										  uint32_t timeout,
+										  char *flags,
 										  char *cid_name,
 										  char *cid_num);
 static void conference_function(switch_core_session_t *session, char *data);
@@ -223,10 +228,6 @@
 }
 
 
-#define SMAX 32767
-#define SMIN -32768
-#define normalize_to_16bit(n) if (n > SMAX) n = SMAX; else if (n < SMIN) n = SMIN;
-
 static void switch_change_sln_volume(int16_t *data, uint32_t samples, int32_t vol)
 {
 	int16_t *p = data;
@@ -244,7 +245,7 @@
 
 	for (x = 0; x < samples; x++) {
 		b = (int32_t)((double)p[x] * mult);
-		normalize_to_16bit(b);
+		switch_normalize_to_16bit(b);
 		p[x] = (int16_t) b;
 	}
 }
@@ -595,7 +596,7 @@
 				
 						for (x = 0; x < imember->read / 2; x++) {
 							int32_t z = muxed[x] + bptr[x];
-							normalize_to_16bit(z);
+							switch_normalize_to_16bit(z);
 							muxed[x] = (int16_t)z;
 						}
 						
@@ -1018,7 +1019,7 @@
     }
 
 #ifdef WIN32
-	if (file[1] != ':') {
+	if (*(file +1) != ':' && *file != '/') {
 #else
 	if (*file != '/') {
 #endif
@@ -1399,7 +1400,7 @@
 					goto done;
 				} else if (!strcasecmp(argv[1], "dial")) {
 					if (argc > 2) {
-						conference_outcall(conference, NULL, argv[2], 60, argv[3], argv[4]);
+						conference_outcall(conference, NULL, argv[2], 60, argv[3], argv[4], argv[5]);
 						stream->write_function(stream, "OK\n");
 						goto done;
 					} else {
@@ -1557,7 +1558,6 @@
 						conference_member_t *member;
 
 						if ((member = conference_member_get(conference, id))) {
-							switch_clear_flag_locked(member, MFLAG_CAN_SPEAK);
 
 							if (argv[3]) {
 								switch_mutex_lock(member->flag_mutex);
@@ -1595,7 +1595,6 @@
 						conference_member_t *member;
 
 						if ((member = conference_member_get(conference, id))) {
-							switch_clear_flag_locked(member, MFLAG_CAN_SPEAK);
 
 							if (argv[3]) {
 								switch_mutex_lock(member->flag_mutex);
@@ -1633,7 +1632,6 @@
 						conference_member_t *member;
 
 						if ((member = conference_member_get(conference, id))) {
-							switch_clear_flag_locked(member, MFLAG_CAN_SPEAK);
 
 							if (argv[3]) {
 								switch_mutex_lock(member->flag_mutex);
@@ -2037,6 +2035,7 @@
 										  switch_core_session_t *session,
 										  char *bridgeto,
 										  uint32_t timeout,
+										  char *flags,
 										  char *cid_name,
 										  char *cid_num)
 {
@@ -2044,6 +2043,7 @@
 	switch_channel_t *peer_channel;
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	switch_channel_t *caller_channel = NULL;
+	char appdata[512];
 
 
 	if (switch_ivr_originate(session, &peer_session, bridgeto, timeout, &audio_bridge_peer_state_handlers, cid_name, cid_num, NULL) != SWITCH_STATUS_SUCCESS) {
@@ -2071,7 +2071,13 @@
 			goto done;
 		}
 		/* add them to the conference */
-		switch_caller_extension_add_application(peer_session, extension, (char *) global_app_name, conference->name);
+		if (flags) {
+			snprintf(appdata, sizeof(appdata), "%s +flags{%s}", conference->name, flags);
+			switch_caller_extension_add_application(peer_session, extension, (char *) global_app_name, appdata);
+		} else {
+			switch_caller_extension_add_application(peer_session, extension, (char *) global_app_name, conference->name);
+		}
+
 		switch_channel_set_caller_extension(peer_channel, extension);
 		switch_channel_set_state(peer_channel, CS_EXECUTE);
 
@@ -2177,23 +2183,19 @@
 		*dpin++ = '\0';
 	}
 
-	/* Open the config from the xml registry */
-	if (!(cxml = switch_xml_open_cfg(global_cf_name, &cfg, NULL))) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", global_cf_name);
-		goto done;
-	}
-
 	if ((profile_name = strchr(conf_name, '@'))) {
 		*profile_name++ = '\0';
 
+		/* Open the config from the xml registry */
+		if (!(cxml = switch_xml_open_cfg(global_cf_name, &cfg, NULL))) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", global_cf_name);
+			goto done;
+		}
+		
 		if ((profiles = switch_xml_child(cfg, "profiles"))) {
 			profile = switch_xml_find_child(profiles, "profile", "name", profile_name);
 		}
-	} else {
-		if ((profiles = switch_xml_child(cfg, "profiles"))) {
-			profile = switch_xml_find_child(profiles, "profile", "name", "default");
-		}
-	}
+	} 
 
 	if (isbr) {
 		char *uuid = switch_core_session_get_uuid(session);
@@ -2306,7 +2308,7 @@
 
 
 	if (!switch_strlen_zero(bridgeto) && strcasecmp(bridgeto, "none")) {
-		if (conference_outcall(conference, session, bridgeto, 60, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
+		if (conference_outcall(conference, session, bridgeto, 60, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
 			goto done;
 		}
 	}
@@ -2349,7 +2351,7 @@
 							   switch_core_session_get_pool(session));
 		
 		/* Setup an audio buffer for the resampled audio */
-		if (switch_buffer_create(pool, &member.resample_buffer, CONF_BUFFER_SIZE) != SWITCH_STATUS_SUCCESS) {
+		if (switch_buffer_create_dynamic(&member.resample_buffer, CONF_DBLOCK_SIZE, CONF_DBUFFER_SIZE, CONF_DBUFFER_MAX) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error Creating Audio Buffer!\n");
 			goto done;
 		}
@@ -2375,13 +2377,13 @@
 	}
 	
 	/* Setup an audio buffer for the incoming audio */
-	if (switch_buffer_create(pool, &member.audio_buffer, CONF_BUFFER_SIZE) != SWITCH_STATUS_SUCCESS) {
+	if (switch_buffer_create_dynamic(&member.audio_buffer, CONF_DBLOCK_SIZE, CONF_DBUFFER_SIZE, CONF_DBUFFER_MAX) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error Creating Audio Buffer!\n");
 		goto codec_done1;
 	}
 
 	/* Setup an audio buffer for the outgoing audio */
-	if (switch_buffer_create(pool, &member.mux_buffer, CONF_BUFFER_SIZE) != SWITCH_STATUS_SUCCESS) {
+	if (switch_buffer_create_dynamic(&member.mux_buffer, CONF_DBLOCK_SIZE, CONF_DBUFFER_SIZE, CONF_DBUFFER_MAX) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error Creating Audio Buffer!\n");
 		goto codec_done1;
 	}
@@ -2429,6 +2431,10 @@
 	switch_core_codec_destroy(&member.write_codec);
  done:
 
+	switch_buffer_destroy(&member.resample_buffer);
+	switch_buffer_destroy(&member.audio_buffer);
+	switch_buffer_destroy(&member.mux_buffer);
+	
 	/* Release the config registry handle */
 	if (cxml) {
 		switch_xml_free(cxml);

Modified: freeswitch/branches/james/src/mod/applications/mod_playback/mod_playback.c
==============================================================================
--- freeswitch/branches/james/src/mod/applications/mod_playback/mod_playback.c	(original)
+++ freeswitch/branches/james/src/mod/applications/mod_playback/mod_playback.c	Sun Sep 10 07:09:34 2006
@@ -133,6 +133,26 @@
 }
 
 
+static void record_session_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	channel = switch_core_session_get_channel(session);
+    assert(channel != NULL);
+
+	switch_ivr_record_session(session, data, NULL);	
+}
+
+
+static void stop_record_session_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	channel = switch_core_session_get_channel(session);
+    assert(channel != NULL);
+
+	switch_ivr_stop_record_session(session, data);	
+}
+
+
 static const switch_application_interface_t speak_application_interface = {
 	/*.interface_name */ "speak",
 	/*.application_function */ speak_function
@@ -145,11 +165,27 @@
 	&speak_application_interface
 };
 
+
+static const switch_application_interface_t record_session_application_interface = {
+	/*.interface_name */ "record_session",
+	/*.application_function */ record_session_function,
+	NULL,NULL,NULL,
+	&record_application_interface
+};
+
+
+static const switch_application_interface_t stop_record_session_application_interface = {
+	/*.interface_name */ "stop_record_session",
+	/*.application_function */ stop_record_session_function,
+	NULL,NULL,NULL,
+	&record_session_application_interface
+};
+
 static const switch_application_interface_t playback_application_interface = {
 	/*.interface_name */ "playback",
 	/*.application_function */ playback_function,
 	NULL,NULL,NULL,
-	/*.next*/				  &record_application_interface
+	/*.next*/				  &stop_record_session_application_interface
 };
 
 static const switch_loadable_module_interface_t mod_playback_module_interface = {

Modified: freeswitch/branches/james/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
==============================================================================
--- freeswitch/branches/james/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	(original)
+++ freeswitch/branches/james/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	Sun Sep 10 07:09:34 2006
@@ -42,7 +42,8 @@
 #include <swift.h>
 #include <switch.h>
 
-#define MY_BUF_LEN 1024 * 256
+#define MY_BUF_LEN 1024 * 32
+#define MY_BLOCK_SIZE MY_BUF_LEN
 
 static const char modname[] = "mod_cepstral";
 
@@ -119,7 +120,7 @@
 			return SWITCH_STATUS_MEMERR;
 		}
 
-		if (switch_buffer_create(sh->memory_pool, &cepstral->audio_buffer, MY_BUF_LEN) != SWITCH_STATUS_SUCCESS) {
+		if (switch_buffer_create_dynamic(&cepstral->audio_buffer, MY_BLOCK_SIZE, MY_BUF_LEN, 0) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Write Buffer Failed!\n");
 			return SWITCH_STATUS_MEMERR;
 		}
@@ -195,6 +196,8 @@
 	cepstral->port = NULL;
 	//cepstral->engine = NULL;
 	
+	switch_buffer_destroy(&cepstral->audio_buffer);
+
 	return SWITCH_STATUS_SUCCESS;
 }
 

Modified: freeswitch/branches/james/src/mod/codecs/mod_g722/mod_g722.c
==============================================================================
--- freeswitch/branches/james/src/mod/codecs/mod_g722/mod_g722.c	(original)
+++ freeswitch/branches/james/src/mod/codecs/mod_g722/mod_g722.c	Sun Sep 10 07:09:34 2006
@@ -53,16 +53,22 @@
 	if (!(encoding || decoding) || (!(context = switch_core_alloc(codec->memory_pool, sizeof(struct g722_context))))) { 
 		return SWITCH_STATUS_FALSE;
 	} else {
-		if (!(encoding || decoding)) {
-			
-			if (encoding) {
+		if (encoding) {
+			if(codec->implementation->samples_per_second == 16000){
 				g722_encode_init(&context->encoder_object, 64000, G722_PACKED);
+			} else {
+				g722_encode_init(&context->encoder_object, 64000, G722_SAMPLE_RATE_8000);
 			}
-			if (decoding) {
+		}
+		if (decoding) {
+			if(codec->implementation->samples_per_second == 16000){
 				g722_decode_init(&context->decoder_object, 64000, G722_PACKED);
+			} else {
+				g722_decode_init(&context->decoder_object, 64000, G722_SAMPLE_RATE_8000);
 			}
 		}
 	}
+
 	codec->private_info = context;
 	return SWITCH_STATUS_SUCCESS;	
 }
@@ -115,7 +121,7 @@
 
 /* Registration */
 
-static const switch_codec_implementation_t g722_implementation = {
+static const switch_codec_implementation_t g722_8k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 9,
 	/*.iananame */ "G722",
@@ -132,12 +138,31 @@
 	/*.encode */ switch_g722_encode,
 	/*.decode */ switch_g722_decode,
 	/*.destroy */ switch_g722_destroy,
-	///*.next */ &g711u_16k_implementation
 };
 
+static const switch_codec_implementation_t g722_16k_implementation = {
+	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
+	/*.ianacode */ 9,
+	/*.iananame */ "G722",
+	/*.samples_per_second */ 16000,
+	/*.bits_per_second */ 64000,
+	/*.microseconds_per_frame */ 20000,
+	/*.samples_per_frame */ 160,
+	/*.bytes_per_frame */ 320,
+	/*.encoded_bytes_per_frame */ 160,
+	/*.number_of_channels */ 1,
+	/*.pref_frames_per_packet */ 1,
+	/*.max_frames_per_packet */ 1,
+	/*.init */ switch_g722_init,
+	/*.encode */ switch_g722_encode,
+	/*.decode */ switch_g722_decode,
+	/*.destroy */ switch_g722_destroy,
+	/*.next */ &g722_8k_implementation
+};
+
 static const switch_codec_interface_t g722_codec_interface = {
 	/*.interface_name */ "g722",
-	/*.implementations */ &g722_implementation
+	/*.implementations */ &g722_16k_implementation
 };
 
 static switch_loadable_module_interface_t g722_module_interface = {

Modified: freeswitch/branches/james/src/mod/codecs/mod_g723_1/mod_g723_1.c
==============================================================================
--- freeswitch/branches/james/src/mod/codecs/mod_g723_1/mod_g723_1.c	(original)
+++ freeswitch/branches/james/src/mod/codecs/mod_g723_1/mod_g723_1.c	Sun Sep 10 07:09:34 2006
@@ -32,6 +32,8 @@
  *
  */  
 #include "switch.h"
+
+#ifndef G723_PASSTHROUGH
 #include "g723.h"
 
 #define TYPE_HIGH 0x0
@@ -45,19 +47,26 @@
 Flag UseVx = True;
 
 enum Crate WrkRate = Rate63;
+#endif
 
 static const char modname[] = "mod_g723_1";
 
+#ifndef G723_PASSTHROUGH
 struct g723_context {
 	struct cod_state encoder_object;
 	struct dec_state decoder_object;
 	float cod_float_buf[Frame];
 	float dec_float_buf[Frame];
 };
+#endif
 
 static switch_status_t switch_g723_init(switch_codec_t *codec, switch_codec_flag_t flags,
 									  const switch_codec_settings_t *codec_settings) 
 {
+#ifdef G723_PASSTHROUGH
+	codec->flags |= SWITCH_CODEC_FLAG_PASSTHROUGH;
+	return  SWITCH_STATUS_FALSE;
+#else
 	struct g723_context *context = NULL;
 	int encoding, decoding;
 
@@ -85,12 +94,15 @@
 
 		return SWITCH_STATUS_SUCCESS;
 	}
+#endif
 }
 
 
 static switch_status_t switch_g723_destroy(switch_codec_t *codec) 
 {
+#ifndef G723_PASSTHROUGH
 	codec->private_info = NULL;
+#endif
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -106,6 +118,10 @@
 										uint32_t *encoded_rate, 
 										unsigned int *flag) 
 {
+#ifdef G723_PASSTHROUGH
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
+	return SWITCH_STATUS_FALSE;
+#else
 	struct g723_context *context = codec->private_info;
 	int16_t *decoded_slin_buf = (int16_t *) decoded_data;
 	char *ebuf = (char *) encoded_data;
@@ -123,6 +139,7 @@
 	*encoded_data_len = codec->implementation->encoded_bytes_per_frame;
 
 	return SWITCH_STATUS_SUCCESS;
+#endif
 }
 
 static switch_status_t switch_g723_decode(switch_codec_t *codec, 
@@ -137,6 +154,10 @@
 										uint32_t *decoded_rate, 
 										unsigned int *flag) 
 {
+#ifdef G723_PASSTHROUGH
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
+	return SWITCH_STATUS_FALSE;
+#else
 	struct g723_context *context = codec->private_info;
 	int x;
 	int16_t *to_slin_buf = decoded_data;
@@ -153,11 +174,12 @@
 	*decoded_data_len = codec->implementation->bytes_per_frame;
 
 	return SWITCH_STATUS_SUCCESS;
+#endif
 }
 
 /* Registration */ 
 
-static const switch_codec_implementation_t g723_1_30ms_implementation = { 
+static const switch_codec_implementation_t g723_1_implementation = { 
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 4, 
 	/*.iananame */ "G723", 
@@ -169,49 +191,24 @@
 	/*.encoded_bytes_per_frame */ 24, 
 	/*.number_of_channels */ 1, 
 	/*.pref_frames_per_packet */ 1, 
-	/*.max_frames_per_packet */ 2, 
+	/*.max_frames_per_packet */ 4, 
 	/*.init */ switch_g723_init, 
 	/*.encode */ switch_g723_encode, 
 	/*.decode */ switch_g723_decode, 
 	/*.destroy */ switch_g723_destroy, 
 };
-#if 0
-static const switch_codec_implementation_t g723_1_60ms_implementation = { 
-	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
-	/*.ianacode */ 4, 
-	/*.iananame */ "G723", 
-	/*.samples_per_second */ 8000, 
-	/*.bits_per_second */ 6300, 
-	/*.microseconds_per_frame */ 60000, 
-	/*.samples_per_frame */ 240, 
-	/*.bytes_per_frame */ 480, 
-	/*.encoded_bytes_per_frame */ 24, 
-	/*.number_of_channels */ 1, 
-	/*.pref_frames_per_packet */ 2, 
-	/*.max_frames_per_packet */ 2, 
-	/*.init */ switch_g723_init, 
-	/*.encode */ switch_g723_encode, 
-	/*.decode */ switch_g723_decode, 
-	/*.destroy */ switch_g723_destroy, 
-};
-#endif
-static const switch_codec_interface_t g723_1_30ms_codec_interface = { 
+
+static const switch_codec_interface_t g723_1_codec_interface = { 
 	/*.interface_name */ "g723.1 6.3k", 
-	/*.implementations */ &g723_1_30ms_implementation, 
+	/*.implementations */ &g723_1_implementation, 
 };
-#if 0
-static const switch_codec_interface_t g723_1_60ms_codec_interface = { 
-	/*.interface_name */ "g723.1 6.3k", 
-	/*.implementations */ &g723_1_60ms_implementation, 
-	/*.next */ &g723_1_30ms_codec_interface
-};
-#endif
+
 static switch_loadable_module_interface_t g723_module_interface = { 
 	/*.module_name */ modname, 
 	/*.endpoint_interface */ NULL, 
 	/*.timer_interface */ NULL, 
 	/*.dialplan_interface */ NULL, 
-	/*.codec_interface */ &g723_1_30ms_codec_interface, 
+	/*.codec_interface */ &g723_1_codec_interface, 
 	/*.application_interface */ NULL 
 };
 

Modified: freeswitch/branches/james/src/mod/codecs/mod_g729/mod_g729.c
==============================================================================
--- freeswitch/branches/james/src/mod/codecs/mod_g729/mod_g729.c	(original)
+++ freeswitch/branches/james/src/mod/codecs/mod_g729/mod_g729.c	Sun Sep 10 07:09:34 2006
@@ -31,20 +31,27 @@
  * mod_g729.c -- G729 Codec Module
  *
  */  
-#include "switch.h"
-#include "g729.h"
 
 static const char modname[] = "mod_g729";
 
+#include "switch.h"
+
+#ifndef G729_PASSTHROUGH
+#include "g729.h"
+
 struct g729_context {
 	struct dec_state decoder_object;
 	struct cod_state encoder_object;
 };
+#endif
 
 static switch_status_t switch_g729_init(switch_codec_t *codec, switch_codec_flag_t flags,
 									  const switch_codec_settings_t *codec_settings) 
 {
-
+#ifdef G729_PASSTHROUGH
+	codec->flags |= SWITCH_CODEC_FLAG_PASSTHROUGH;
+	return SWITCH_STATUS_SUCCESS;
+#else 
 	struct g729_context *context = NULL;
 	int encoding, decoding;
 
@@ -68,11 +75,14 @@
 		return SWITCH_STATUS_SUCCESS;
 
 	}
+#endif
 }
 
 static switch_status_t switch_g729_destroy(switch_codec_t *codec) 
 {
+#ifndef G729_PASSTHROUGH
 	codec->private_info = NULL;
+#endif
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -88,6 +98,10 @@
 										uint32_t *encoded_rate, 
 										unsigned int *flag) 
 {
+#ifdef G729_PASSTHROUGH
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
+	return SWITCH_STATUS_FALSE;
+#else
 	struct g729_context *context = codec->private_info;
 	int cbret = 0;
 
@@ -117,6 +131,7 @@
 		}
 	}
 	return SWITCH_STATUS_SUCCESS;
+#endif
 }
 
 static switch_status_t switch_g729_decode(switch_codec_t *codec, 
@@ -131,6 +146,10 @@
 										uint32_t *decoded_rate, 
 										unsigned int *flag) 
 {
+#ifdef G729_PASSTHROUGH
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
+	return SWITCH_STATUS_FALSE;
+#else
 	struct g729_context *context = codec->private_info;
 	int divisor = 10;
 	int plen = 10;
@@ -194,6 +213,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 	return SWITCH_STATUS_SUCCESS;
+#endif
 }
 
 /* Registration */ 
@@ -237,49 +257,9 @@
 	&g729_10ms_8k_implementation
 };
 
-static const switch_codec_implementation_t g729a_10ms_8k_implementation = { 
-	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
-	/*.ianacode */ 18, 
-	/*.iananame */ "G729a", 
-	/*.samples_per_second */ 8000, 
-	/*.bits_per_second */ 32000, 
-	/*.microseconds_per_frame */ 10000, 
-	/*.samples_per_frame */ 80, 
-	/*.bytes_per_frame */ 160, 
-	/*.encoded_bytes_per_frame */ 10, 
-	/*.number_of_channels */ 1, 
-	/*.pref_frames_per_packet */ 1, 
-	/*.max_frames_per_packet */ 1, 
-	/*.init */ switch_g729_init, 
-	/*.encode */ switch_g729_encode, 
-	/*.decode */ switch_g729_decode, 
-	/*.destroy */ switch_g729_destroy, 
-	&g729_8k_implementation
-};
-
-static const switch_codec_implementation_t g729a_8k_implementation = { 
-	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
-	/*.ianacode */ 18, 
-	/*.iananame */ "G729a", 
-	/*.samples_per_second */ 8000, 
-	/*.bits_per_second */ 64000, 
-	/*.microseconds_per_frame */ 20000, 
-	/*.samples_per_frame */ 160, 
-	/*.bytes_per_frame */ 320, 
-	/*.encoded_bytes_per_frame */ 20, 
-	/*.number_of_channels */ 1, 
-	/*.pref_frames_per_packet */ 1, 
-	/*.max_frames_per_packet */ 1, 
-	/*.init */ switch_g729_init, 
-	/*.encode */ switch_g729_encode, 
-	/*.decode */ switch_g729_decode, 
-	/*.destroy */ switch_g729_destroy, 
-	&g729a_10ms_8k_implementation
-};
-
 static const switch_codec_interface_t g729_codec_interface = { 
 	/*.interface_name */ "g729", 
-	/*.implementations */ &g729a_8k_implementation, 
+	/*.implementations */ &g729_8k_implementation, 
 };
 
 static switch_loadable_module_interface_t g729_module_interface = { 

Modified: freeswitch/branches/james/src/mod/codecs/mod_g729/mod_g729.vcproj
==============================================================================
--- freeswitch/branches/james/src/mod/codecs/mod_g729/mod_g729.vcproj	(original)
+++ freeswitch/branches/james/src/mod/codecs/mod_g729/mod_g729.vcproj	Sun Sep 10 07:09:34 2006
@@ -25,7 +25,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="cscript /nologo &quot;$(InputDir)..\..\..\..\w32\vsnet\getlibs.vbs&quot; Mod_CodecG729 Debug"
+				CommandLine=""
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -109,7 +109,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="cscript /nologo &quot;$(InputDir)..\..\..\..\w32\vsnet\getlibs.vbs&quot; Mod_CodecG729 Release"
+				CommandLine=""
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -145,6 +145,170 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalDependencies="libg729.lib FreeSwitchCore.lib"
+				OutputFile="$(SolutionDir)$(OutDir)/mod/$(InputName).dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\..\..\w32\vsnet\$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/mod_g729.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug Passthrough|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\codec\libg729\src\include&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;G729_PASSTHROUGH"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				WarnAsError="true"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(SolutionDir)$(OutDir)/mod/$(InputName).dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\..\..\w32\vsnet\$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/mod_g729.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release Passthrough|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\codec\libg729\src\include&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;G729_PASSTHROUGH"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
 				OutputFile="$(SolutionDir)$(OutDir)/mod/$(InputName).dll"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="..\..\..\..\w32\vsnet\$(OutDir)"

Modified: freeswitch/branches/james/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Sun Sep 10 07:09:34 2006
@@ -283,17 +283,13 @@
 {
 	switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
 	const char *err;
-	int ms = 20;
+	int ms = 0;
 	switch_rtp_flag_t flags;
 
 	if (switch_rtp_ready(tech_pvt->rtp_session)) {
 		return 1;
 	}
 
-	if (!strncasecmp(tech_pvt->codec_name, "ilbc", 4)) {
-		ms = 30;
-	}
-
 	if (switch_core_codec_init(&tech_pvt->read_codec,
 							   tech_pvt->codec_name,
 							   tech_pvt->codec_rate,
@@ -1693,6 +1689,7 @@
 						if (!strncasecmp(name, "ilbc", 4)) {
 							name = "ilbc";
 						}
+						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "compare %s %d to %s %d\n", payloads[x].name, payloads[x].id, name, tech_pvt->codecs[y]->ianacode);
 						if (tech_pvt->codecs[y]->ianacode > 96) {
 							match = strcasecmp(name, payloads[x].name) ? 0 : 1;
 						} else {

Modified: freeswitch/branches/james/src/mod/endpoints/mod_exosip/mod_exosip.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_exosip/mod_exosip.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_exosip/mod_exosip.c	Sun Sep 10 07:09:34 2006
@@ -1439,17 +1439,13 @@
 
 		{
 			int rate = atoi(drate);
-			int ms = globals.codec_ms;
+			int ms = 0; //globals.codec_ms;
 
 
 			if (imp) {
 				ms = imp->microseconds_per_frame / 1000;
 			}
 
-			if (!strcasecmp(dname, "ilbc")) {
-				ms = 30;
-			}
-			
 			if (switch_core_codec_init(&tech_pvt->read_codec,
 									   dname,
 									   rate,
@@ -1938,12 +1934,8 @@
 	if (!switch_test_flag(tech_pvt, TFLAG_USING_CODEC)) {
 	
 		int rate = atoi(drate);
-		int ms = globals.codec_ms;
+		int ms = 0; //globals.codec_ms;
 
-		if (!strcasecmp(dname, "ilbc")) {
-			ms = 30;
-		}
-
 		if (imp) {
 			ms = imp->microseconds_per_frame / 1000;
 		}
@@ -2273,7 +2265,7 @@
 	}
 
 	if (!globals.codec_ms) {
-		globals.codec_ms = 20;
+		globals.codec_ms = 0;
 	}
 
 	if (!globals.port) {

Modified: freeswitch/branches/james/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_sofia/mod_sofia.c	Sun Sep 10 07:09:34 2006
@@ -550,7 +550,11 @@
 
 	if (tech_pvt->nh) {
 		if (!switch_test_flag(tech_pvt, TFLAG_BYE)) {
-			nua_bye(tech_pvt->nh, TAG_END());
+			if (switch_test_flag(tech_pvt, TFLAG_ANS)) {
+				nua_bye(tech_pvt->nh, TAG_END());
+			} else {
+				nua_cancel(tech_pvt->nh, TAG_END());
+			}
 		}
 		nua_handle_bind(tech_pvt->nh, NULL);
 		nua_handle_destroy(tech_pvt->nh);
@@ -833,8 +837,13 @@
 
 			if (tech_pvt->read_frame.datalen > 0) {
 				tech_pvt->last_read = switch_time_now();
-				bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame;
-				frames = (tech_pvt->read_frame.datalen / bytes);
+
+				if (tech_pvt->read_codec.implementation->encoded_bytes_per_frame) {
+					bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame;
+					frames = (tech_pvt->read_frame.datalen / bytes);
+				} else
+					frames = 1;
+
 				samples = frames * tech_pvt->read_codec.implementation->samples_per_frame;
 				ms = frames * tech_pvt->read_codec.implementation->microseconds_per_frame;
 				tech_pvt->timestamp_recv += (int32_t) samples;
@@ -884,8 +893,12 @@
 	switch_set_flag_locked(tech_pvt, TFLAG_WRITING);
 
 
-	bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame;
-	frames = ((int) frame->datalen / bytes);
+	if (tech_pvt->read_codec.implementation->encoded_bytes_per_frame) {
+		bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame;
+		frames = ((int) frame->datalen / bytes);
+	} else
+		frames = 1;
+
 	samples = frames * tech_pvt->read_codec.implementation->samples_per_frame;
 
 #if 0
@@ -1652,6 +1665,8 @@
 		profile->name = switch_core_strdup(profile->pool, xprofilename);
 
 		profile->dtmf_duration = 100;		
+		profile->codec_ms = 20;
+
 		for (param = switch_xml_child(xprofile, "param"); param; param = param->next) {
 			char *var = (char *) switch_xml_attr_soft(param, "name");
 			char *val = (char *) switch_xml_attr_soft(param, "value");
@@ -1729,10 +1744,6 @@
 			profile->rtpip = switch_core_strdup(profile->pool, "127.0.0.1");
 		}
 
-		if (!profile->codec_ms) {
-			profile->codec_ms = 20;
-		}
-		
 		if (!profile->sip_port) {
 			profile->sip_port = 5060;
 		}

Modified: freeswitch/branches/james/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	Sun Sep 10 07:09:34 2006
@@ -370,6 +370,8 @@
 
 	teletone_destroy_session(&tech_pvt->tone_session);
 
+	switch_buffer_destroy(&tech_pvt->dtmf_buffer);
+	
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -623,7 +625,7 @@
 
 	if (!tech_pvt->dtmf_buffer) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Allocate DTMF Buffer....");
-		if (switch_buffer_create(switch_core_session_get_pool(session), &tech_pvt->dtmf_buffer, 3192) != SWITCH_STATUS_SUCCESS) {
+		if (switch_buffer_create_dynamic(&tech_pvt->dtmf_buffer, 1024, 3192, 0) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR, "Failed to allocate DTMF Buffer!\n");
 			return SWITCH_STATUS_FALSE;
 		} else {

Modified: freeswitch/branches/james/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/branches/james/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/branches/james/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Sun Sep 10 07:09:34 2006
@@ -56,10 +56,10 @@
 	switch_mutex_t *flag_mutex;
 	uint32_t flags;
 	switch_log_level_t level;
-	char *retbuf;
 	char *ebuf;
 	uint8_t event_list[SWITCH_EVENT_ALL+1];
 	switch_hash_t *event_hash;
+	switch_thread_rwlock_t *rwlock;
 	struct listener *next;
 };
 
@@ -282,17 +282,20 @@
 					if (count == 1) {
 						switch_event_create(event, SWITCH_EVENT_MESSAGE);
 						switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Command", mbuf);
-					} else {
+					} else if (cur) {
 						char *var, *val;
-						var = mbuf;
-						if ((val = strchr(var, ':'))) {
-							*val++ = '\0';
-							while(*val == ' ') {
-								val++;
+						var = cur;
+						strip_cr(var);
+						if (!switch_strlen_zero(var)) {
+							if ((val = strchr(var, ':'))) {
+								*val++ = '\0';
+								while(*val == ' ') {
+									val++;
+								}
+							} 
+							if (var && val) {
+								switch_event_add_header(*event, SWITCH_STACK_BOTTOM, var, val);
 							}
-						} 
-						if (var && val) {
-							switch_event_add_header(*event, SWITCH_STACK_BOTTOM, var, val);
 						}
 					}
 					
@@ -385,6 +388,71 @@
 
 }
 
+struct api_command_struct {
+	char *api_cmd;
+	char *arg;
+	listener_t *listener;
+	char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
+	uint8_t bg;
+};
+
+static void *SWITCH_THREAD_FUNC api_exec(switch_thread_t *thread, void *obj)
+{
+
+	struct api_command_struct *acs = (struct api_command_struct *) obj;
+	switch_stream_handle_t stream = {0};
+
+	if (switch_thread_rwlock_tryrdlock(acs->listener->rwlock) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error! cannot get read lock.\n");
+		goto done;
+	}
+
+
+	SWITCH_STANDARD_STREAM(stream);
+
+	if (stream.data) {
+		if (switch_api_execute(acs->api_cmd, acs->arg, NULL, &stream) == SWITCH_STATUS_SUCCESS) {
+
+			if (acs->bg) {
+				switch_event_t *event;
+
+				if (switch_event_create(&event, SWITCH_EVENT_BACKGROUND_JOB) == SWITCH_STATUS_SUCCESS) {
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Job-UUID", acs->uuid_str);
+					switch_event_add_body(event, stream.data);
+					switch_event_fire(&event);
+				}
+			} else {
+				switch_size_t len;
+				char buf[1024];
+				len = strlen(stream.data) + 1;			
+				snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", len);
+				len = strlen(buf) + 1;
+				switch_socket_send(acs->listener->sock, buf, &len);
+				len = strlen(stream.data) + 1;
+				switch_socket_send(acs->listener->sock, stream.data, &len);
+			}
+		}
+		free(stream.data);
+	} else {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+	}
+
+	switch_thread_rwlock_unlock(acs->listener->rwlock);
+	
+
+ done:
+	if (acs && acs->bg) {
+		if (acs->api_cmd) {
+			free(acs->api_cmd);
+		}
+		if (acs->arg) {
+			free(acs->arg);
+		}
+		free(acs);
+	}
+	return NULL;
+	
+}
 static switch_status_t parse_command(listener_t *listener, switch_event_t *event, char *reply, uint32_t reply_len)
 {
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
@@ -419,38 +487,98 @@
 		goto done;
 	}
 	
-	if (!strncasecmp(cmd, "api ", 4)) {
+	if (!strncasecmp(cmd, "sendmsg", 7)) {
+		switch_core_session_t *session;
+		char *uuid = cmd + 8;
+
+
+		if (uuid) {
+			while(*uuid == ' ') {
+				uuid++;
+			}
+			strip_cr(uuid);
+		}
+
+		if (!uuid) {
+			uuid = switch_event_get_header(event, "session-id");
+		}
+
+		if ((session = switch_core_session_locate(uuid))) {
+			switch_channel_t *channel = switch_core_session_get_channel(session);
+			if (!switch_channel_test_flag(channel, CF_CONTROLLED)) {
+				switch_core_session_rwunlock(session);
+				session = NULL;
+			}
+		}
+		
+		if (session) {
+			if ((status = switch_core_session_queue_private_event(session, &event)) == SWITCH_STATUS_SUCCESS) {
+				snprintf(reply, reply_len, "+OK");
+			} else {
+				snprintf(reply, reply_len, "-ERR memory error");
+			}
+			switch_core_session_rwunlock(session);
+		} else {
+			snprintf(reply, reply_len, "-ERR invalid session id [%s]", uuid);
+		}
+
+		goto done;
+	
+	} else if (!strncasecmp(cmd, "api ", 4)) {
+		struct api_command_struct acs = {0};
 		char *api_cmd = cmd + 4;
-		switch_stream_handle_t stream = {0};
-		char *arg;
+		char *arg = NULL;
+		strip_cr(api_cmd);
 
-		if (!listener->retbuf) {
-			listener->retbuf = switch_core_alloc(listener->pool, CMD_BUFLEN);
+		if ((arg = strchr(api_cmd, ' '))) {
+			*arg++ = '\0';
 		}
 
-		stream.data = listener->retbuf;
-		stream.end = stream.data;
-		stream.data_size = CMD_BUFLEN;
-		stream.write_function = switch_console_stream_write;
+		acs.listener = listener;
+		acs.api_cmd = api_cmd;
+		acs.arg = arg;
+		acs.bg = 0;
 
+		api_exec(NULL, (void *) &acs);
+		snprintf(reply, reply_len, "+OK");
+
+		return SWITCH_STATUS_SUCCESS;
+	} else if (!strncasecmp(cmd, "bgapi ", 6)) {
+		struct api_command_struct *acs;
+		char *api_cmd = cmd + 6;
+		char *arg = NULL;
 		strip_cr(api_cmd);
 
 		if ((arg = strchr(api_cmd, ' '))) {
 			*arg++ = '\0';
 		}
-		
-		if (switch_api_execute(api_cmd, arg, NULL, &stream) == SWITCH_STATUS_SUCCESS) {
-			switch_size_t len;
-			char buf[1024];
 
-			len = strlen(listener->retbuf) + 1;			
-			snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", len);
-			len = strlen(buf) + 1;
-			switch_socket_send(listener->sock, buf, &len);
-			len = strlen(listener->retbuf) + 1;
-			switch_socket_send(listener->sock, listener->retbuf, &len);
-			return SWITCH_STATUS_SUCCESS;
-		} 
+		if ((acs = malloc(sizeof(*acs)))) {
+			switch_thread_t *thread;
+			switch_threadattr_t *thd_attr = NULL;
+			switch_uuid_t uuid;
+
+			memset(acs, 0, sizeof(*acs));
+			acs->listener = listener;
+			if (api_cmd) {
+				acs->api_cmd = strdup(api_cmd);
+			}
+			if (arg) {
+				acs->arg = strdup(arg);
+			}
+			acs->bg = 1;	
+			switch_threadattr_create(&thd_attr, listener->pool);
+			switch_threadattr_detach_set(thd_attr, 1);
+			switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
+			switch_thread_create(&thread, thd_attr, api_exec, acs, listener->pool);
+			switch_uuid_get(&uuid);
+			switch_uuid_format(acs->uuid_str, &uuid);
+			snprintf(reply, reply_len, "+OK Job-UUID: %s", acs->uuid_str);
+		} else {
+			snprintf(reply, reply_len, "-ERR memory error!");
+		}
+
+		return SWITCH_STATUS_SUCCESS;
 	} else if (!strncasecmp(cmd, "log", 3)) {
 
 		char *level_s;
@@ -643,8 +771,16 @@
 		remove_listener(listener);
 	}
 
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Thread done, waiting for children\n");
+
+	switch_thread_rwlock_wrlock(listener->rwlock);
+	switch_thread_rwlock_unlock(listener->rwlock);
+	
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Closed\n");
 
+
+
 	if (listener->pool) {
 		switch_memory_pool_t *pool = listener->pool;
 		switch_core_destroy_memory_pool(&pool);
@@ -734,6 +870,8 @@
 		if (rv) goto fail;
 		rv = switch_socket_create(&listen_list.sock, sa->family, SOCK_STREAM, APR_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;
 		rv = switch_socket_bind(listen_list.sock, sa);
 		if (rv) goto sock_fail;
 		rv = switch_socket_listen(listen_list.sock, 5);
@@ -742,7 +880,7 @@
 		break;
 	sock_fail:
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Socket Error!\n");
-		switch_yield(1000000);
+		switch_yield(100000);
 	}
 
 	listen_list.ready = 1;
@@ -771,6 +909,7 @@
 			break;
 		}
 		
+		switch_thread_rwlock_create(&listener->rwlock, listener_pool);
 		switch_queue_create(&listener->event_queue, SWITCH_CORE_QUEUE_LEN, listener_pool);
 		switch_queue_create(&listener->log_queue, SWITCH_CORE_QUEUE_LEN, listener_pool);
 

Modified: freeswitch/branches/james/src/mod/languages/mod_perl/fs_perl.pm
==============================================================================
--- freeswitch/branches/james/src/mod/languages/mod_perl/fs_perl.pm	(original)
+++ freeswitch/branches/james/src/mod/languages/mod_perl/fs_perl.pm	Sun Sep 10 07:09:34 2006
@@ -61,6 +61,7 @@
 *fs_channel_get_variable = *fs_perlc::fs_channel_get_variable;
 *fs_channel_set_state = *fs_perlc::fs_channel_set_state;
 *fs_ivr_play_file = *fs_perlc::fs_ivr_play_file;
+*fs_ivr_play_file2 = *fs_perlc::fs_ivr_play_file2;
 
 # ------- VARIABLE STUBS --------
 

Modified: freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig.c
==============================================================================
--- freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig.c	(original)
+++ freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig.c	Sun Sep 10 07:09:34 2006
@@ -6,8 +6,8 @@
 
 
 #ifdef _MSC_VER
-#include <perlibs.h>
-#pragma comment(lib, PERL_LIB)
+#include <php.h>
+#pragma comment(lib, PHP_LIB)
 #endif
 
 void fs_core_set_globals(void)
@@ -55,9 +55,15 @@
 	return 0;
 }
 
-void fs_console_log(char *msg)
+void fs_console_log(char *level_str, char *msg)
 {
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, msg);
+	switch_log_level_t level = SWITCH_LOG_DEBUG;
+
+	if (level_str) {
+		level = switch_log_str2level(level_str);
+	}
+	
+	switch_log_printf(SWITCH_CHANNEL_LOG, level, msg);
 }
 
 void fs_console_clean(char *msg)
@@ -67,7 +73,13 @@
 
 switch_core_session_t *fs_core_session_locate(char *uuid)
 {
-	return switch_core_session_locate(uuid);
+	switch_core_session_t *session;
+
+	if ((session = switch_core_session_locate(uuid))) {
+		switch_core_session_rwunlock(session);
+	}
+
+	return session;
 }
 
 void fs_channel_answer(switch_core_session_t *session)
@@ -123,6 +135,17 @@
 	}
 	
 	status = switch_ivr_play_file(session, NULL, file, timer_name, NULL, NULL, 0);
+	return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+}
+
+
+int fs_ivr_play_file2(switch_core_session_t *session,
+					  char *file)
+
+{
+	switch_status_t status;
+	
+	status = switch_ivr_play_file(session, NULL, file, NULL, NULL, NULL, 0);
 	return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
 }
 

Modified: freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig_wrap.c
==============================================================================
--- freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig_wrap.c	(original)
+++ freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig_wrap.c	Sun Sep 10 07:09:34 2006
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.26
+ * Version 1.3.21
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -8,113 +8,72 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
-/***********************************************************************
+/*************************************************************** -*- c -*-
+ * perl5/precommon.swg
  *
- *  This section contains generic SWIG labels for method/variable
- *  declarations/attributes, and other compiler dependent labels.
+ * Rename all exported symbols from common.swg, to avoid symbol
+ * clashes if multiple interpreters are included
  *
  ************************************************************************/
 
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-#  if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-#    define SWIGTEMPLATEDISAMBIGUATOR template
-#  else
-#    define SWIGTEMPLATEDISAMBIGUATOR 
-#  endif
-#endif
+#define SWIG_TypeRegister    SWIG_Perl_TypeRegister
+#define SWIG_TypeCheck       SWIG_Perl_TypeCheck
+#define SWIG_TypeCast        SWIG_Perl_TypeCast
+#define SWIG_TypeDynamicCast SWIG_Perl_TypeDynamicCast
+#define SWIG_TypeName        SWIG_Perl_TypeName
+#define SWIG_TypeQuery       SWIG_Perl_TypeQuery
+#define SWIG_TypeClientData  SWIG_Perl_TypeClientData
+#define SWIG_PackData        SWIG_Perl_PackData 
+#define SWIG_UnpackData      SWIG_Perl_UnpackData 
 
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-#   define SWIGINLINE inline
-# else
-#   define SWIGINLINE
-# endif
-#endif
 
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__) || defined(__ICC)
-#   define SWIGUNUSED __attribute__ ((unused)) 
-# else
-#   define SWIGUNUSED 
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods for Windows DLLs */
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#   if defined(STATIC_LINKED)
-#     define SWIGEXPORT
-#   else
-#     define SWIGEXPORT __declspec(dllexport)
-#   endif
-# else
-#   define SWIGEXPORT
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#   define SWIGSTDCALL __stdcall
-# else
-#   define SWIGSTDCALL
-# endif 
-#endif
-
-
 /***********************************************************************
- * swigrun.swg
+ * common.swg
  *
- *     This file contains generic CAPI SWIG runtime support for pointer
- *     type checking.
+ *     This file contains generic SWIG runtime support for pointer
+ *     type checking as well as a few commonly used macros to control
+ *     external linkage.
  *
+ * Author : David Beazley (beazley at cs.uchicago.edu)
+ *
+ * Copyright (c) 1999-2000, The University of Chicago
+ * 
+ * This file may be freely redistributed without license or fee provided
+ * this copyright message remains intact.
  ************************************************************************/
 
-/* This should only be incremented when either the layout of swig_type_info changes,
-   or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "2"
+#include <string.h>
+#include <switch.h>
 
-/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
-#ifdef SWIG_TYPE_TABLE
-# define SWIG_QUOTE_STRING(x) #x
-# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
-# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#  if defined(_MSC_VER) || defined(__GNUC__)
+#    if defined(STATIC_LINKED)
+#      define SWIGEXPORT(a) a
+#      define SWIGIMPORT(a) extern a
+#    else
+#      define SWIGEXPORT(a) __declspec(dllexport) a
+#      define SWIGIMPORT(a) extern a
+#    endif
+#  else
+#    if defined(__BORLANDC__)
+#      define SWIGEXPORT(a) a _export
+#      define SWIGIMPORT(a) a _export
+#    else
+#      define SWIGEXPORT(a) a
+#      define SWIGIMPORT(a) a
+#    endif
+#  endif
 #else
-# define SWIG_TYPE_TABLE_NAME
+#  define SWIGEXPORT(a) a
+#  define SWIGIMPORT(a) a
 #endif
 
-/*
-  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
-  
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
-*/
-
-#ifndef SWIGRUNTIME
-# define SWIGRUNTIME SWIGINTERN
+#ifdef SWIG_GLOBAL
+#  define SWIGRUNTIME(a) SWIGEXPORT(a)
+#else
+#  define SWIGRUNTIME(a) static a
 #endif
 
-#ifndef SWIGRUNTIMEINLINE
-# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
-#endif
-
-#include <string.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -122,141 +81,106 @@
 typedef void *(*swig_converter_func)(void *);
 typedef struct swig_type_info *(*swig_dycast_func)(void **);
 
-/* Structure to store inforomation on one type */
 typedef struct swig_type_info {
-  const char             *name;			/* mangled name of this type */
-  const char             *str;			/* human readable name of this type */
-  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
-  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
-  void                   *clientdata;		/* language specific type data */
+  const char             *name;
+  swig_converter_func     converter;
+  const char             *str;
+  void                   *clientdata;
+  swig_dycast_func        dcast;
+  struct swig_type_info  *next;
+  struct swig_type_info  *prev;
 } swig_type_info;
 
-/* Structure to store a type and conversion function used for casting */
-typedef struct swig_cast_info {
-  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
-  swig_converter_func     converter;		/* function to cast the void pointers */
-  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
-  struct swig_cast_info  *prev;			/* pointer to the previous cast */
-} swig_cast_info;
+#ifdef SWIG_NOINCLUDE
 
-/* Structure used to store module information
- * Each module generates one structure like this, and the runtime collects
- * all of these structures and stores them in a circularly linked list.*/
-typedef struct swig_module_info {
-  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
-  size_t                 size;		        /* Number of types in this module */
-  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
-  swig_type_info         **type_initial;	/* Array of initially generated type structures */
-  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
-  void                    *clientdata;		/* Language specific module data */
-} swig_module_info;
+SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *);
+SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *);
+SWIGIMPORT(void *)           SWIG_TypeCast(swig_type_info *, void *);
+SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **);
+SWIGIMPORT(const char *)     SWIG_TypeName(const swig_type_info *);
+SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *);
+SWIGIMPORT(void)             SWIG_TypeClientData(swig_type_info *, void *);
+SWIGIMPORT(char *)           SWIG_PackData(char *, void *, int);
+SWIGIMPORT(char *)           SWIG_UnpackData(char *, void *, int);
 
+#else
 
-/* 
-  Compare two type names skipping the space characters, therefore
-  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+static swig_type_info *swig_type_list = 0;
 
-  Return 0 when the two name types are equivalent, as in
-  strncmp, but skipping ' '.
-*/
-SWIGRUNTIME int
-SWIG_TypeNameComp(const char *f1, const char *l1,
-		  const char *f2, const char *l2) {
-  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
-    while ((*f1 == ' ') && (f1 != l1)) ++f1;
-    while ((*f2 == ' ') && (f2 != l2)) ++f2;
-    if (*f1 != *f2) return (int)(*f1 - *f2);
+/* Register a type mapping with the type-checking */
+SWIGRUNTIME(swig_type_info *)
+SWIG_TypeRegister(swig_type_info *ti) {
+  swig_type_info *tc, *head, *ret, *next;
+  /* Check to see if this type has already been registered */
+  tc = swig_type_list;
+  while (tc) {
+    if (strcmp(tc->name, ti->name) == 0) {
+      /* Already exists in the table.  Just add additional types to the list */
+      if (tc->clientdata) ti->clientdata = tc->clientdata;
+      head = tc;
+      next = tc->next;
+      goto l1;
+    }
+    tc = tc->prev;
   }
-  return (l1 - f1) - (l2 - f2);
-}
+  head = ti;
+  next = 0;
 
-/*
-  Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if not equal, 1 if equal
-*/
-SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
-  int equiv = 0;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (!equiv && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
-    }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
-    if (*ne) ++ne;
+  /* Place in list */
+  ti->prev = swig_type_list;
+  swig_type_list = ti;
+
+  /* Build linked lists */
+  l1:
+  ret = head;
+  tc = ti + 1;
+  /* Patch up the rest of the links */
+  while (tc->name) {
+    head->next = tc;
+    tc->prev = head;
+    head = tc;
+    tc++;
   }
-  return equiv;
+  if (next) next->prev = head;
+  head->next = next;
+  return ret;
 }
 
-/*
-  Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
-*/
-SWIGRUNTIME int
-SWIG_TypeCompare(const char *nb, const char *tb) {
-  int equiv = 0;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (!equiv && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
+/* Check the typename */
+SWIGRUNTIME(swig_type_info *) 
+SWIG_TypeCheck(char *c, swig_type_info *ty) {
+  swig_type_info *s;
+  if (!ty) return 0;        /* Void pointer */
+  s = ty->next;             /* First element always just a name */
+  do {
+    if (strcmp(s->name,c) == 0) {
+      if (s == ty->next) return s;
+      /* Move s to the top of the linked list */
+      s->prev->next = s->next;
+      if (s->next) {
+        s->next->prev = s->prev;
+      }
+      /* Insert s as second element in the list */
+      s->next = ty->next;
+      if (ty->next) ty->next->prev = s;
+      ty->next = s;
+      s->prev = ty;
+      return s;
     }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
-    if (*ne) ++ne;
-  }
-  return equiv;
+    s = s->next;
+  } while (s && (s != ty->next));
+  return 0;
 }
 
-
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
-/*
-  Check the typename
-*/
-SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+/* Cast a pointer up an inheritance hierarchy */
+SWIGRUNTIME(void *) 
+SWIG_TypeCast(swig_type_info *ty, void *ptr) {
+  if ((!ty) || (!ty->converter)) return ptr;
+  return (*ty->converter)(ptr);
 }
 
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
-SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
-}
-
-/*
-  Cast a pointer up an inheritance hierarchy
-*/
-SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
-  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
-}
-
-/* 
-   Dynamic pointer casting. Down an inheritance hierarchy
-*/
-SWIGRUNTIME swig_type_info *
+/* Dynamic pointer casting. Down an inheritance hierarchy */
+SWIGRUNTIME(swig_type_info *) 
 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
   swig_type_info *lastty = ty;
   if (!ty || !ty->dcast) return ty;
@@ -267,234 +191,84 @@
   return lastty;
 }
 
-/*
-  Return the name associated with this type
-*/
-SWIGRUNTIMEINLINE const char *
+/* Return the name associated with this type */
+SWIGRUNTIME(const char *)
 SWIG_TypeName(const swig_type_info *ty) {
   return ty->name;
 }
 
-/*
-  Return the pretty name associated with this type,
-  that is an unmangled type name in a form presentable to the user.
-*/
-SWIGRUNTIME const char *
-SWIG_TypePrettyName(const swig_type_info *type) {
-  /* The "str" field contains the equivalent pretty names of the
-     type, separated by vertical-bar characters.  We choose
-     to print the last name, as it is often (?) the most
-     specific. */
-  if (type->str != NULL) {
-    const char *last_name = type->str;
-    const char *s;
-    for (s = type->str; *s; s++)
-      if (*s == '|') last_name = s+1;
-    return last_name;
+/* Search for a swig_type_info structure */
+SWIGRUNTIME(swig_type_info *)
+SWIG_TypeQuery(const char *name) {
+  swig_type_info *ty = swig_type_list;
+  while (ty) {
+    if (ty->str && (strcmp(name,ty->str) == 0)) return ty;
+    if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
+    ty = ty->prev;
   }
-  else
-    return type->name;
+  return 0;
 }
 
-/* 
-   Set the clientdata field for a type
-*/
-SWIGRUNTIME void
+/* Set the clientdata field for a type */
+SWIGRUNTIME(void)
 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
-  swig_cast_info *cast = ti->cast;
-  /* if (ti->clientdata == clientdata) return; */
+  swig_type_info *tc, *equiv;
+  if (ti->clientdata == clientdata) return;
   ti->clientdata = clientdata;
-  
-  while (cast) {
-    if (!cast->converter) {
-      swig_type_info *tc = cast->type;
-      if (!tc->clientdata) {
-	SWIG_TypeClientData(tc, clientdata);
+  equiv = ti->next;
+  while (equiv) {
+    if (!equiv->converter) {
+      tc = swig_type_list;
+      while (tc) {
+        if ((strcmp(tc->name, equiv->name) == 0))
+          SWIG_TypeClientData(tc,clientdata);
+        tc = tc->prev;
       }
-    }    
-    cast = cast->next;
-  }
-}
-
-/*
-  Search for a swig_type_info structure only by mangled name
-  Search is a O(log #types)
-  
-  We start searching at module start, and finish searching when start == end.  
-  Note: if start == end at the beginning of the function, we go all the way around
-  the circular list.
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start, 
-                            swig_module_info *end, 
-		            const char *name) {
-  swig_module_info *iter = start;
-  do {
-    if (iter->size) {
-      register size_t l = 0;
-      register size_t r = iter->size - 1;
-      do {
-	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
-	register size_t i = (l + r) >> 1; 
-	const char *iname = iter->types[i]->name;
-	if (iname) {
-	  register int compare = strcmp(name, iname);
-	  if (compare == 0) {	    
-	    return iter->types[i];
-	  } else if (compare < 0) {
-	    if (i) {
-	      r = i - 1;
-	    } else {
-	      break;
-	    }
-	  } else if (compare > 0) {
-	    l = i + 1;
-	  }
-	} else {
-	  break; /* should never happen */
-	}
-      } while (l <= r);
     }
-    iter = iter->next;
-  } while (iter != end);
-  return 0;
-}
-
-/*
-  Search for a swig_type_info structure for either a mangled name or a human readable name.
-  It first searches the mangled names of the types, which is a O(log #types)
-  If a type is not found it then searches the human readable names, which is O(#types).
-  
-  We start searching at module start, and finish searching when start == end.  
-  Note: if start == end at the beginning of the function, we go all the way around
-  the circular list.
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start, 
-                     swig_module_info *end, 
-		     const char *name) {
-  /* STEP 1: Search the name field using binary search */
-  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
-  if (ret) {
-    return ret;
-  } else {
-    /* STEP 2: If the type hasn't been found, do a complete search
-       of the str field (the human readable name) */
-    swig_module_info *iter = start;
-    do {
-      register size_t i = 0;
-      for (; i < iter->size; ++i) {
-	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
-	  return iter->types[i];
-      }
-      iter = iter->next;
-    } while (iter != end);
+    equiv = equiv->next;
   }
-  
-  /* neither found a match */
-  return 0;
 }
 
-
-/* 
-   Pack binary data into a string
-*/
-SWIGRUNTIME char *
-SWIG_PackData(char *c, void *ptr, size_t sz) {
-  static const char hex[17] = "0123456789abcdef";
-  register const unsigned char *u = (unsigned char *) ptr;
-  register const unsigned char *eu =  u + sz;
-  for (; u != eu; ++u) {
-    register unsigned char uu = *u;
+/* Pack binary data into a string */
+SWIGRUNTIME(char *)
+SWIG_PackData(char *c, void *ptr, int sz) {
+  static char hex[17] = "0123456789abcdef";
+  int i;
+  unsigned char *u = (unsigned char *) ptr;
+  register unsigned char uu;
+  for (i = 0; i < sz; i++,u++) {
+    uu = *u;
     *(c++) = hex[(uu & 0xf0) >> 4];
     *(c++) = hex[uu & 0xf];
   }
   return c;
 }
 
-/* 
-   Unpack binary data from a string
-*/
-SWIGRUNTIME const char *
-SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
-  register unsigned char *u = (unsigned char *) ptr;
-  register const unsigned char *eu = u + sz;
-  for (; u != eu; ++u) {
-    register char d = *(c++);
-    register unsigned char uu = 0;
+/* Unpack binary data from a string */
+SWIGRUNTIME(char *)
+SWIG_UnpackData(char *c, void *ptr, int sz) {
+  register unsigned char uu = 0;
+  register int d;
+  unsigned char *u = (unsigned char *) ptr;
+  int i;
+  for (i = 0; i < sz; i++, u++) {
+    d = *(c++);
     if ((d >= '0') && (d <= '9'))
       uu = ((d - '0') << 4);
     else if ((d >= 'a') && (d <= 'f'))
       uu = ((d - ('a'-10)) << 4);
-    else 
-      return (char *) 0;
     d = *(c++);
     if ((d >= '0') && (d <= '9'))
       uu |= (d - '0');
     else if ((d >= 'a') && (d <= 'f'))
       uu |= (d - ('a'-10));
-    else 
-      return (char *) 0;
     *u = uu;
   }
   return c;
 }
 
-/* 
-   Pack 'void *' into a string buffer.
-*/
-SWIGRUNTIME char *
-SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
-  char *r = buff;
-  if ((2*sizeof(void *) + 2) > bsz) return 0;
-  *(r++) = '_';
-  r = SWIG_PackData(r,&ptr,sizeof(void *));
-  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
-  strcpy(r,name);
-  return buff;
-}
+#endif
 
-SWIGRUNTIME const char *
-SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
-  if (*c != '_') {
-    if (strcmp(c,"NULL") == 0) {
-      *ptr = (void *) 0;
-      return name;
-    } else {
-      return 0;
-    }
-  }
-  return SWIG_UnpackData(++c,ptr,sizeof(void *));
-}
-
-SWIGRUNTIME char *
-SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
-  char *r = buff;
-  size_t lname = (name ? strlen(name) : 0);
-  if ((2*sz + 2 + lname) > bsz) return 0;
-  *(r++) = '_';
-  r = SWIG_PackData(r,ptr,sz);
-  if (lname) {
-    strncpy(r,name,lname+1);
-  } else {
-    *r = 0;
-  }
-  return buff;
-}
-
-SWIGRUNTIME const char *
-SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
-  if (*c != '_') {
-    if (strcmp(c,"NULL") == 0) {
-      memset(ptr,0,sz);
-      return name;
-    } else {
-      return 0;
-    }
-  }
-  return SWIG_UnpackData(++c,ptr,sz);
-}
-
 #ifdef __cplusplus
 }
 #endif
@@ -503,7 +277,7 @@
  * perl5.swg
  *
  * Perl5 runtime library
- * $Header: /cvsroot/swig/SWIG/Lib/perl5/perlrun.swg,v 1.21 2005/02/01 00:08:17 wuzzeb Exp $
+ * $Header: /cvsroot/SWIG/Lib/perl5/perlrun.swg,v 1.14 2003/12/04 19:14:14 beazley Exp $
  * ----------------------------------------------------------------------------- */
 
 #define SWIGPERL
@@ -643,19 +417,19 @@
      SWIG_Perl_ConvertPacked(obj, p, s, type, flags)
 #endif
 
-/* Runtime API */
-#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule()
-#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer)
-
 /* Perl-specific API */
 #ifdef PERL_OBJECT
 #  define SWIG_MakePtr(sv, ptr, type, flags) \
      SWIG_Perl_MakePtr(pPerl, sv, ptr, type, flags)
+#  define SWIG_TypeCheckRV(rv, ty) \
+     SWIG_Perl_TypeCheckRV(pPerl, rv, ty)
 #  define SWIG_SetError(str) \
      SWIG_Perl_SetError(pPerl, str)
 #else
 #  define SWIG_MakePtr(sv, ptr, type, flags) \
      SWIG_Perl_MakePtr(sv, ptr, type, flags)
+#  define SWIG_TypeCheckRV(rv, ty) \
+     SWIG_Perl_TypeCheckRV(rv, ty)
 #  define SWIG_SetError(str) \
      SWIG_Perl_SetError(str)
 #  define SWIG_SetErrorSV(str) \
@@ -671,16 +445,48 @@
 #  define SWIG_MAYBE_PERL_OBJECT
 #endif
 
-static swig_cast_info *
+#ifdef SWIG_NOINCLUDE
+
+SWIGIMPORT(int)               SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *, void **, swig_type_info *, int flags);
+SWIGIMPORT(void)              SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *, void *, swig_type_info *, int flags);
+SWIGIMPORT(SV *)              SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *, swig_type_info *, int flags);
+SWIGIMPORT(void)              SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *, void *, int, swig_type_info *);
+SWIGIMPORT(int)               SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *, void *, int, swig_type_info *, int flags);
+SWIGIMPORT(swig_type_info *)  SWIG_Perl_TypeCheckRV(SWIG_MAYBE_PERL_OBJECT SV *rv, swig_type_info *ty);
+SWIGIMPORT(SV *)              SWIG_Perl_SetError(SWIG_MAYBE_PERL_OBJECT char *);
+
+#else
+
+SWIGRUNTIME(swig_type_info *)
 SWIG_Perl_TypeCheckRV(SWIG_MAYBE_PERL_OBJECT SV *rv, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(sv_derived_from(rv, (char *) iter->type->name), ty);
+  swig_type_info *s;
+  if (!ty) return 0;        /* Void pointer */
+  s = ty->next;             /* First element always just a name */
+  do {
+    if (sv_derived_from(rv, (char *) s->name)) {
+      if (s == ty->next) return s;
+      /* Move s to the top of the linked list */
+      s->prev->next = s->next;
+      if (s->next) {
+        s->next->prev = s->prev;
+      }
+      /* Insert s as second element in the list */
+      s->next = ty->next;
+      if (ty->next) ty->next->prev = s;
+      ty->next = s;
+      s->prev = ty;
+      return s;
+    }
+    s = s->next;
+  } while (s && (s != ty->next));
+  return 0;
 }
 
 /* Function for getting a pointer value */
 
-static int
+SWIGRUNTIME(int) 
 SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
-  swig_cast_info *tc;
+  swig_type_info *tc;
   void *voidptr = (void *)0;
 
   /* If magical, apply more magic */
@@ -696,9 +502,9 @@
       if (SvMAGICAL(tsv)) {
         mg = mg_find(tsv,'P');
         if (mg) {
-          sv = mg->mg_obj;
-          if (sv_isobject(sv)) {
-            tmp = SvIV((SV*)SvRV(sv));
+          SV *rsv = mg->mg_obj;
+          if (sv_isobject(rsv)) {
+            tmp = SvIV((SV*)SvRV(rsv));
           }
         }
       } else {
@@ -727,8 +533,7 @@
   }
   if (_t) {
     /* Now see if the types match */
-    char *_c = HvNAME(SvSTASH(SvRV(sv)));
-    tc = SWIG_TypeCheck(_c,_t);
+    tc = SWIG_TypeCheckRV(sv,_t);
     if (!tc) {
       *ptr = voidptr;
       return -1;
@@ -740,7 +545,7 @@
   return 0;
 }
 
-static void
+SWIGRUNTIME(void)
 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
   if (ptr && (flags & SWIG_SHADOW)) {
     SV *self;
@@ -769,14 +574,14 @@
   }
 }
 
-static SWIGINLINE SV *
+SWIGRUNTIME(SV *)
 SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
   SV *result = sv_newmortal();
   SWIG_MakePtr(result, ptr, t, flags);
   return result;
 }
 
-static void
+SWIGRUNTIME(void)
   SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
   char result[1024];
   char *r = result;
@@ -788,10 +593,10 @@
 }
 
 /* Convert a packed value value */
-static int
+SWIGRUNTIME(int)
 SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty, int flags) {
-  swig_cast_info *tc;
-  const char  *c = 0;
+  swig_type_info *tc;
+  char  *c = 0;
 
   if ((!obj) || (!SvOK(obj))) return -1;
   c = SvPV(obj, PL_na);
@@ -806,17 +611,17 @@
   return 0;
 }
 
-static SWIGINLINE void
+SWIGRUNTIME(void)
 SWIG_Perl_SetError(SWIG_MAYBE_PERL_OBJECT const char *error) {
   if (error) sv_setpv(perl_get_sv("@", TRUE), error);
 }
 
-static SWIGINLINE void
+SWIGRUNTIME(void)
 SWIG_Perl_SetErrorSV(SWIG_MAYBE_PERL_OBJECT SV *error) {
   if (error) sv_setsv(perl_get_sv("@", TRUE), error);
 }
 
-static void
+SWIGRUNTIME(void)
 SWIG_Perl_SetErrorf(const char *fmt, ...) {
   va_list args;
   va_start(args, fmt);
@@ -824,6 +629,8 @@
   va_end(args);
 }
 
+#endif
+
 /* Macros for low-level exception handling */
 #define SWIG_fail       goto fail
 #define SWIG_croak(x)   { SWIG_SetError(x); goto fail; }
@@ -895,31 +702,10 @@
 }
 
 
-static swig_module_info *
-SWIG_Perl_GetModule() {
-  static void *type_pointer = (void *)0;
-  SV *pointer;
 
-  /* first check if pointer already created */
-  if (!type_pointer) {
-    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
-    if (pointer && SvOK(pointer)) {
-      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
-    }
-  }
 
-  return (swig_module_info *) type_pointer;
-}
 
-static void
-SWIG_Perl_SetModule(swig_module_info *module) {
-  SV *pointer;
 
-  /* create a new pointer */
-  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
-  sv_setiv(pointer, PTR2IV(module));
-}
-
 #ifdef do_open
   #undef do_open
 #endif
@@ -974,29 +760,13 @@
 #ifdef ENTER
   #undef ENTER
 #endif
-#ifdef read
-  #undef read
-#endif
-#ifdef write
-  #undef write
-#endif
-#ifdef eof
-  #undef eof
-#endif
-#ifdef bool
-  #undef bool
-#endif
 
 
-
 /* -------- TYPES TABLE (BEGIN) -------- */
 
-#define SWIGTYPE_p_switch_core_session_t swig_types[0]
-#define SWIGTYPE_p_switch_input_callback_function_t swig_types[1]
+#define  SWIGTYPE_p_switch_core_session_t swig_types[0] 
+#define  SWIGTYPE_p_switch_input_callback_function_t swig_types[1] 
 static swig_type_info *swig_types[3];
-static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0};
-#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
-#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
 /* -------- TYPES TABLE (END) -------- */
 
@@ -1010,14 +780,31 @@
 #endif
 #ifndef PERL_OBJECT
 #ifndef MULTIPLICITY
-SWIGEXPORT void SWIG_init (CV* cv);
+SWIGEXPORT(void) SWIG_init (CV* cv);
 #else
-SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
+SWIGEXPORT(void) SWIG_init (pTHXo_ CV* cv);
 #endif
 #else
-SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
+SWIGEXPORT(void) SWIG_init (CV *cv, CPerlObj *);
 #endif
 
+extern void fs_core_set_globals(void);
+extern int fs_core_init(char *);
+extern int fs_core_destroy(void);
+extern int fs_loadable_module_init(void);
+extern int fs_loadable_module_shutdown(void);
+extern int fs_console_loop(void);
+extern void fs_console_log(char *,char *);
+extern void fs_console_clean(char *);
+extern switch_core_session_t *fs_core_session_locate(char *);
+extern void fs_channel_answer(switch_core_session_t *);
+extern void fs_channel_pre_answer(switch_core_session_t *);
+extern void fs_channel_hangup(switch_core_session_t *,char *);
+extern void fs_channel_set_variable(switch_core_session_t *,char *,char *);
+extern void fs_channel_get_variable(switch_core_session_t *,char *);
+extern void fs_channel_set_state(switch_core_session_t *,char *);
+extern int fs_ivr_play_file(switch_core_session_t *,char *,char *,switch_input_callback_function_t,void *,unsigned int);
+extern int fs_ivr_play_file2(switch_core_session_t *,char *);
 
 #include <switch.h>
 
@@ -1064,7 +851,7 @@
 
 XS(_wrap_fs_core_init) {
     {
-        char *arg1 = (char *) 0 ;
+        char *arg1 ;
         int result;
         int argvi = 0;
         dXSARGS;
@@ -1172,16 +959,19 @@
 
 XS(_wrap_fs_console_log) {
     {
-        char *arg1 = (char *) 0 ;
+        char *arg1 ;
+        char *arg2 ;
         int argvi = 0;
         dXSARGS;
         
-        if ((items < 1) || (items > 1)) {
-            SWIG_croak("Usage: fs_console_log(msg);");
+        if ((items < 2) || (items > 2)) {
+            SWIG_croak("Usage: fs_console_log(level_str,msg);");
         }
         if (!SvOK((SV*) ST(0))) arg1 = 0;
         else arg1 = (char *) SvPV(ST(0), PL_na);
-        fs_console_log(arg1);
+        if (!SvOK((SV*) ST(1))) arg2 = 0;
+        else arg2 = (char *) SvPV(ST(1), PL_na);
+        fs_console_log(arg1,arg2);
         
         
         XSRETURN(argvi);
@@ -1194,7 +984,7 @@
 
 XS(_wrap_fs_console_clean) {
     {
-        char *arg1 = (char *) 0 ;
+        char *arg1 ;
         int argvi = 0;
         dXSARGS;
         
@@ -1216,7 +1006,7 @@
 
 XS(_wrap_fs_core_session_locate) {
     {
-        char *arg1 = (char *) 0 ;
+        char *arg1 ;
         switch_core_session_t *result;
         int argvi = 0;
         dXSARGS;
@@ -1291,7 +1081,7 @@
 XS(_wrap_fs_channel_hangup) {
     {
         switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-        char *arg2 = (char *) 0 ;
+        char *arg2 ;
         int argvi = 0;
         dXSARGS;
         
@@ -1319,8 +1109,8 @@
 XS(_wrap_fs_channel_set_variable) {
     {
         switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-        char *arg2 = (char *) 0 ;
-        char *arg3 = (char *) 0 ;
+        char *arg2 ;
+        char *arg3 ;
         int argvi = 0;
         dXSARGS;
         
@@ -1350,7 +1140,7 @@
 XS(_wrap_fs_channel_get_variable) {
     {
         switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-        char *arg2 = (char *) 0 ;
+        char *arg2 ;
         int argvi = 0;
         dXSARGS;
         
@@ -1378,7 +1168,7 @@
 XS(_wrap_fs_channel_set_state) {
     {
         switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-        char *arg2 = (char *) 0 ;
+        char *arg2 ;
         int argvi = 0;
         dXSARGS;
         
@@ -1406,8 +1196,8 @@
 XS(_wrap_fs_ivr_play_file) {
     {
         switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-        char *arg2 = (char *) 0 ;
-        char *arg3 = (char *) 0 ;
+        char *arg2 ;
+        char *arg3 ;
         switch_input_callback_function_t arg4 ;
         void *arg5 = (void *) 0 ;
         unsigned int arg6 ;
@@ -1452,36 +1242,59 @@
 }
 
 
+XS(_wrap_fs_ivr_play_file2) {
+    {
+        switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+        char *arg2 ;
+        int result;
+        int argvi = 0;
+        dXSARGS;
+        
+        if ((items < 2) || (items > 2)) {
+            SWIG_croak("Usage: fs_ivr_play_file2(session,file);");
+        }
+        {
+            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t,0) < 0) {
+                SWIG_croak("Type error in argument 1 of fs_ivr_play_file2. Expected _p_switch_core_session_t");
+            }
+        }
+        if (!SvOK((SV*) ST(1))) arg2 = 0;
+        else arg2 = (char *) SvPV(ST(1), PL_na);
+        result = (int)fs_ivr_play_file2(arg1,arg2);
+        
+        ST(argvi) = sv_newmortal();
+        sv_setiv(ST(argvi++), (IV) result);
+        XSRETURN(argvi);
+        fail:
+        ;
+    }
+    croak(Nullch);
+}
 
-/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
-static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, 0};
-static swig_type_info _swigt__p_switch_input_callback_function_t = {"_p_switch_input_callback_function_t", "switch_input_callback_function_t *", 0, 0, 0};
 
-static swig_type_info *swig_type_initial[] = {
-  &_swigt__p_switch_core_session_t,
-  &_swigt__p_switch_input_callback_function_t,
-};
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
-static swig_cast_info _swigc__p_switch_core_session_t[] = {  {&_swigt__p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_switch_input_callback_function_t[] = {  {&_swigt__p_switch_input_callback_function_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_type_info _swigt__p_switch_core_session_t[] = {{"_p_switch_core_session_t", 0, "switch_core_session_t *", 0},{"_p_switch_core_session_t"},{0}};
+static swig_type_info _swigt__p_switch_input_callback_function_t[] = {{"_p_switch_input_callback_function_t", 0, "switch_input_callback_function_t *", 0},{"_p_switch_input_callback_function_t"},{0}};
 
-static swig_cast_info *swig_cast_initial[] = {
-  _swigc__p_switch_core_session_t,
-  _swigc__p_switch_input_callback_function_t,
+static swig_type_info *swig_types_initial[] = {
+_swigt__p_switch_core_session_t, 
+_swigt__p_switch_input_callback_function_t, 
+0
 };
 
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
 
 static swig_constant_info swig_constants[] = {
-{0,0,0,0,0,0}
+{0}
 };
 #ifdef __cplusplus
 }
 #endif
 static swig_variable_info swig_variables[] = {
-{0,0,0,0}
+{0}
 };
 static swig_command_info swig_commands[] = {
 {"fs_perlc::fs_core_set_globals", _wrap_fs_core_set_globals},
@@ -1500,169 +1313,24 @@
 {"fs_perlc::fs_channel_get_variable", _wrap_fs_channel_get_variable},
 {"fs_perlc::fs_channel_set_state", _wrap_fs_channel_set_state},
 {"fs_perlc::fs_ivr_play_file", _wrap_fs_ivr_play_file},
+{"fs_perlc::fs_ivr_play_file2", _wrap_fs_ivr_play_file2},
 {0,0}
 };
-/*************************************************************************
- * Type initialization:
- * This problem is tough by the requirement that no dynamic 
- * memory is used. Also, since swig_type_info structures store pointers to 
- * swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization. 
- * The idea is that swig generates all the structures that are needed. 
- * The runtime then collects these partially filled structures. 
- * The SWIG_InitializeModule function takes these initial arrays out of 
- * swig_module, and does all the lookup, filling in the swig_module.types
- * array with the correct data and linking the correct swig_cast_info
- * structures together.
 
- * The generated swig_type_info structures are assigned staticly to an initial 
- * array. We just loop though that array, and handle each type individually.
- * First we lookup if this type has been already loaded, and if so, use the
- * loaded structure instead of the generated one. Then we have to fill in the
- * cast linked list. The cast data is initially stored in something like a
- * two-dimensional array. Each row corresponds to a type (there are the same
- * number of rows as there are in the swig_type_initial array). Each entry in
- * a column is one of the swig_cast_info structures for that type.
- * The cast_initial array is actually an array of arrays, because each row has
- * a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it 
- * adding the casts to the list. The one last trick we need to do is making
- * sure the type pointer in the swig_cast_info struct is correct.
-
- * First off, we lookup the cast->type name to see if it is already loaded. 
- * There are three cases to handle:
- *  1) If the cast->type has already been loaded AND the type we are adding
- *     casting info to has not been loaded (it is in this module), THEN we
- *     replace the cast->type pointer with the type pointer that has already
- *     been loaded.
- *  2) If BOTH types (the one we are adding casting info to, and the 
- *     cast->type) are loaded, THEN the cast info has already been loaded by
- *     the previous module so we just ignore it.
- *  3) Finally, if cast->type has not already been loaded, then we add that
- *     swig_cast_info to the linked list (because the cast->type) pointer will
- *     be correct.
-**/
-
 #ifdef __cplusplus
-extern "C" {
-#endif
-    
-    SWIGRUNTIME void
-    SWIG_InitializeModule(void *clientdata) {
-        swig_type_info *type, *ret;
-        swig_cast_info *cast;
-        size_t i;
-        swig_module_info *module_head;
-        static int init_run = 0;
-        
-        clientdata = clientdata;
-        
-        if (init_run) return;
-        init_run = 1;
-        
-        /* Initialize the swig_module */
-        swig_module.type_initial = swig_type_initial;
-        swig_module.cast_initial = swig_cast_initial;
-        
-        /* Try and load any already created modules */
-        module_head = SWIG_GetModule(clientdata);
-        if (module_head) {
-            swig_module.next = module_head->next;
-            module_head->next = &swig_module;
-        } else {
-            /* This is the first module loaded */
-            swig_module.next = &swig_module;
-            SWIG_SetModule(clientdata, &swig_module);
-        }
-        
-        /* Now work on filling in swig_module.types */
-        for (i = 0; i < swig_module.size; ++i) {
-            type = 0;
-            
-            /* if there is another module already loaded */
-            if (swig_module.next != &swig_module) {
-                type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
-            }
-            if (type) {
-                /* Overwrite clientdata field */
-                if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
-            } else {
-                type = swig_module.type_initial[i];
-            }
-            
-            /* Insert casting types */
-            cast = swig_module.cast_initial[i];
-            while (cast->type) {
-                /* Don't need to add information already in the list */
-                ret = 0;
-                if (swig_module.next != &swig_module) {
-                    ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
-                }
-                if (ret && type == swig_module.type_initial[i]) {
-                    cast->type = ret;
-                    ret = 0;
-                }
-                
-                if (!ret) {
-                    if (type->cast) {
-                        type->cast->prev = cast;
-                        cast->next = type->cast;
-                    }
-                    type->cast = cast;
-                }
-                
-                cast++;
-            }
-            
-            /* Set entry in modules->types array equal to the type */
-            swig_module.types[i] = type;
-        }
-        swig_module.types[i] = 0;
-    }
-    
-    /* This function will propagate the clientdata field of type to
-    * any new swig_type_info structures that have been added into the list
-    * of equivalent types.  It is like calling
-    * SWIG_TypeClientData(type, clientdata) a second time.
-    */
-    SWIGRUNTIME void
-    SWIG_PropagateClientData(void) {
-        size_t i;
-        swig_cast_info *equiv;
-        static int init_run = 0;
-        
-        if (init_run) return;
-        init_run = 1;
-        
-        for (i = 0; i < swig_module.size; i++) {
-            if (swig_module.types[i]->clientdata) {
-                equiv = swig_module.types[i]->cast;
-                while (equiv) {
-                    if (!equiv->converter) {
-                        if (equiv->type && !equiv->type->clientdata)
-                        SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
-                    }
-                    equiv = equiv->next;
-                }
-            }
-        }
-    }
-    
-#ifdef __cplusplus
-}
-#endif
-
-
-
-#ifdef __cplusplus
 extern "C"
 #endif
 
 XS(SWIG_init) {
     dXSARGS;
     int i;
-    
-    SWIG_InitializeModule(0);
+    static int _init = 0;
+    if (!_init) {
+        for (i = 0; swig_types_initial[i]; i++) {
+            swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
+        }	
+        _init = 1;
+    }
     
     /* Install commands */
     for (i = 0; swig_commands[i].name; i++) {

Modified: freeswitch/branches/james/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/james/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/branches/james/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Sun Sep 10 07:09:34 2006
@@ -32,7 +32,8 @@
 #ifndef HAVE_CURL
 #define HAVE_CURL
 #endif
-#define JS_BUFFER_SIZE 131072
+#define JS_BUFFER_SIZE 1024 * 32
+#define JS_BLOCK_SIZE JS_BUFFER_SIZE
 #ifdef __ICC
 #pragma warning (disable:310 193 1418)
 #endif
@@ -2007,7 +2008,7 @@
 		}
 	}
 
-	switch_buffer_create(pool, &tto->audio_buffer, JS_BUFFER_SIZE);
+	switch_buffer_create_dynamic(&tto->audio_buffer, JS_BLOCK_SIZE, JS_BUFFER_SIZE, 0);
 	tto->pool = pool;
 	tto->obj = obj;
 	tto->cx = cx;
@@ -2027,6 +2028,8 @@
 			switch_core_timer_destroy(tto->timer);
 		}
 		teletone_destroy_session(&tto->ts);
+		switch_buffer_destroy(&tto->audio_buffer);
+		switch_buffer_destroy(&tto->loop_buffer);
 		switch_core_codec_destroy(&tto->codec);
 		pool = tto->pool;
 		tto->pool = NULL;
@@ -2088,7 +2091,7 @@
 			}
 			loops--;
 			if (!tto->loop_buffer) {
-				switch_buffer_create(tto->pool, &tto->loop_buffer, JS_BUFFER_SIZE);
+				switch_buffer_create_dynamic(&tto->loop_buffer, JS_BLOCK_SIZE, JS_BUFFER_SIZE, 0);
 			}
 		} 
 

Modified: freeswitch/branches/james/src/switch_buffer.c
==============================================================================
--- freeswitch/branches/james/src/switch_buffer.c	(original)
+++ freeswitch/branches/james/src/switch_buffer.c	Sun Sep 10 07:09:34 2006
@@ -34,10 +34,17 @@
 
 static uint32_t buffer_id = 0;
 
+typedef enum {
+	SWITCH_BUFFER_FLAG_DYNAMIC = (1 <<  0)
+} switch_buffer_flag_t;
+
 struct switch_buffer {
 	unsigned char *data;
 	switch_size_t used;
 	switch_size_t datalen;
+	switch_size_t max_len;
+	switch_size_t blocksize;
+	uint32_t flags;
 	uint32_t id;
 };
 
@@ -55,6 +62,37 @@
 	return SWITCH_STATUS_MEMERR;
 }
 
+SWITCH_DECLARE(switch_status_t) switch_buffer_create_dynamic(switch_buffer_t **buffer,
+															 switch_size_t blocksize,
+															 switch_size_t start_len,
+															 switch_size_t max_len)
+{
+	switch_buffer_t *new_buffer;
+
+	if ((new_buffer = malloc(sizeof(*new_buffer)))) {
+		memset(new_buffer, 0, sizeof(*new_buffer));
+
+		if (start_len) {
+			if (!(new_buffer->data = malloc(start_len))) {
+				free(new_buffer);
+				return SWITCH_STATUS_MEMERR;
+			}
+			memset(new_buffer->data, 0, start_len);
+		}
+
+		new_buffer->max_len = max_len;
+		new_buffer->datalen = start_len;
+		new_buffer->id = buffer_id++;
+		new_buffer->blocksize = blocksize;
+		switch_set_flag(new_buffer, SWITCH_BUFFER_FLAG_DYNAMIC);
+		
+		*buffer = new_buffer;
+		return SWITCH_STATUS_SUCCESS;
+	}
+
+	return SWITCH_STATUS_MEMERR;
+}
+
 SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer_t *buffer)
 {
 
@@ -69,7 +107,15 @@
 {
 	assert(buffer != NULL);
 
+	if (switch_test_flag(buffer, SWITCH_BUFFER_FLAG_DYNAMIC)) {
+		if (buffer->max_len) {
+			return (switch_size_t) (buffer->max_len - buffer->used);
+		}
+		return 1000000;
+	}
+
 	return (switch_size_t) (buffer->datalen - buffer->used);
+
 }
 
 SWITCH_DECLARE(switch_size_t) switch_buffer_inuse(switch_buffer_t *buffer)
@@ -131,8 +177,30 @@
 	assert(buffer != NULL);
 	assert(data != NULL);
 	assert(buffer->data != NULL);
+
+	freespace = buffer->datalen - buffer->used;
+
+	if (switch_test_flag(buffer, SWITCH_BUFFER_FLAG_DYNAMIC)) {
+		if (freespace < datalen) {
+			switch_size_t new_size, new_block_size;
+
+			new_size = buffer->datalen + datalen;
+			new_block_size = buffer->datalen + buffer->blocksize;
+
+			if (new_block_size > new_size) {
+				new_size = new_block_size;
+			}
+
+			if (!(buffer->data = realloc(buffer->data, new_size))) {
+				return 0;
+			}
+			
+			buffer->datalen = new_size;
+		}
+	}
 	
 	freespace = buffer->datalen - buffer->used;
+
 	if (freespace < datalen) {
 		return 0;
 	} else {
@@ -151,4 +219,14 @@
 
 	buffer->used = 0;
 	
+}
+
+SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer)
+{
+	if (*buffer && switch_test_flag((*buffer), SWITCH_BUFFER_FLAG_DYNAMIC)) {
+		free((*buffer)->data);
+		free(*buffer);
+	}
+
+	*buffer = NULL;
 }

Modified: freeswitch/branches/james/src/switch_channel.c
==============================================================================
--- freeswitch/branches/james/src/switch_channel.c	(original)
+++ freeswitch/branches/james/src/switch_channel.c	Sun Sep 10 07:09:34 2006
@@ -104,8 +104,8 @@
 	const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS];
 	int state_handler_index;
 	switch_hash_t *variables;
+	switch_hash_t *private_hash;
 	switch_channel_timetable_t *times;
-	void *private_info;
 	switch_call_cause_t hangup_cause;
 	int freq;
 	int bits;
@@ -163,7 +163,9 @@
 	}
 
 	switch_core_hash_init(&(*channel)->variables, pool);
-	switch_buffer_create(pool, &(*channel)->dtmf_buffer, 128);
+	switch_core_hash_init(&(*channel)->private_hash, pool);
+	switch_buffer_create_dynamic(&(*channel)->dtmf_buffer, 128, 128, 0);
+
 	switch_mutex_init(&(*channel)->dtmf_mutex, SWITCH_MUTEX_NESTED, pool);
 	switch_mutex_init(&(*channel)->flag_mutex, SWITCH_MUTEX_NESTED, pool);
 	switch_mutex_init(&(*channel)->profile_mutex, SWITCH_MUTEX_NESTED, pool);
@@ -281,6 +283,11 @@
 
 }
 
+SWITCH_DECLARE(void) switch_channel_uninit(switch_channel_t *channel)
+{
+	switch_buffer_destroy(&channel->dtmf_buffer);
+}
+
 SWITCH_DECLARE(switch_status_t) switch_channel_init(switch_channel_t *channel,
 												  switch_core_session_t *session,
 												  switch_channel_state_t state, uint32_t flags)
@@ -305,17 +312,17 @@
 	return switch_hash_first(pool, channel->variables);
 }
 
-SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, void *private_info)
+SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, char *key, void *private_info)
 {
 	assert(channel != NULL);
-	channel->private_info = private_info;
+	switch_core_hash_insert_dup(channel->private_hash, switch_core_session_strdup(channel->session, key), private_info);
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel)
+SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, char *key)
 {
 	assert(channel != NULL);
-	return channel->private_info;
+	return switch_core_hash_find(channel->private_hash, key);
 }
 
 SWITCH_DECLARE(switch_status_t) switch_channel_set_name(switch_channel_t *channel, char *name)
@@ -858,7 +865,8 @@
 		switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_NOTICE, "Hangup %s [%s] [%s]\n", 
 						  channel->name,
 						  state_names[last_state], switch_channel_cause2str(channel->hangup_cause));
-		if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_STATE) == SWITCH_STATUS_SUCCESS) {
+		if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_HANGUP) == SWITCH_STATUS_SUCCESS) {
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hangup-Cause", switch_channel_cause2str(channel->hangup_cause));
 			switch_channel_event_set_data(channel, event);
 			switch_event_fire(&event);
 		}

Modified: freeswitch/branches/james/src/switch_console.c
==============================================================================
--- freeswitch/branches/james/src/switch_console.c	(original)
+++ freeswitch/branches/james/src/switch_console.c	Sun Sep 10 07:09:34 2006
@@ -32,7 +32,7 @@
 #include <switch.h>
 #include <switch_console.h>
 #include <switch_version.h>
-#define CMD_BUFLEN 1024 * 1000
+#define CMD_BUFLEN 1024;
 
 
 SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, char *fmt, ...)
@@ -58,13 +58,37 @@
 	va_end(ap);
 	
 	if (data) {
-		switch_size_t len = handle->data_size - handle->data_len;
+		switch_size_t remaining = handle->data_size - handle->data_len;
+		switch_size_t need = strlen(data) + 1;
+		
+		
+		if ((remaining < need) && handle->alloc_len) {
+			switch_size_t new_len;
+			
+			if (need < handle->alloc_chunk) {
+				need = handle->alloc_chunk;
+			}
 
-		if (len <= strlen(data)) {
+			new_len = handle->data_size + need;
+			if ((handle->data = realloc(handle->data, new_len))) {
+				handle->data_size = handle->alloc_len = new_len;
+				buf = handle->data;
+
+				remaining = handle->data_size - handle->data_len;
+				handle->end = (uint8_t *)(handle->data) + handle->data_len;
+				end = handle->end;
+			} else {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+				free(data);
+				return SWITCH_STATUS_FALSE;
+			}
+		}
+
+		if (remaining < need) {
 			ret = -1;
 		} else {
 			ret = 0;
-			snprintf(end, len, data);
+			snprintf(end, remaining, data);
 			handle->data_len = strlen(buf);
 			handle->end = (uint8_t *)(handle->data) + handle->data_len;
 		}
@@ -75,7 +99,7 @@
 }
 
 
-static int switch_console_process(char *cmd, char *retbuf, int retlen)
+static int switch_console_process(char *cmd)
 {
 	char *arg = NULL;
 	switch_stream_handle_t stream = {0};
@@ -103,16 +127,19 @@
 	if ((arg = strchr(cmd, ' ')) != 0) {
 		*arg++ = '\0';
 	}
-
-	stream.data = retbuf;
-	stream.end = stream.data;
-	stream.data_size = retlen;
-	stream.write_function = switch_console_stream_write;
-	if (switch_api_execute(cmd, arg, NULL, &stream) == SWITCH_STATUS_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "API CALL [%s(%s)] output:\n%s\n", cmd, arg ? arg : "", retbuf);
+	
+	SWITCH_STANDARD_STREAM(stream);
+	if (stream.data) {
+		if (switch_api_execute(cmd, arg, NULL, &stream) == SWITCH_STATUS_SUCCESS) {
+			switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "API CALL [%s(%s)] output:\n%s\n", cmd, arg ? arg : "", stream.data);
+		} else {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Unknown Command: %s\n", cmd);
+		}
+		free(stream.data);
 	} else {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Unknown Command: %s\n", cmd);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
 	}
+
 	return 1;
 }
 
@@ -177,14 +204,10 @@
 	char hostname[256];
 	char cmd[2048];
 	int running = 1, activity = 1;
-	char *retbuf = (char *)malloc(CMD_BUFLEN);
 	switch_size_t x = 0;
 
-	assert(retbuf != NULL);
 	gethostname(hostname, sizeof(hostname));
 
-	memset(retbuf, 0, CMD_BUFLEN);
-
 	while (running) {
 		if (activity) {
 			switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "\nfreeswitch@%s> ", hostname);
@@ -207,11 +230,9 @@
 		}
 	
 		if (cmd[0]) {
-			*retbuf = '\0';
-			running = switch_console_process(cmd, retbuf, CMD_BUFLEN);
+			running = switch_console_process(cmd);
 		}
 	}
 	
-	free(retbuf);
 
 }

Modified: freeswitch/branches/james/src/switch_core.c
==============================================================================
--- freeswitch/branches/james/src/switch_core.c	(original)
+++ freeswitch/branches/james/src/switch_core.c	Sun Sep 10 07:09:34 2006
@@ -49,6 +49,18 @@
 #define SWITCH_EVENT_QUEUE_LEN 256
 #define SWITCH_SQL_QUEUE_LEN 2000
 
+
+struct switch_media_bug {
+	switch_buffer_t *raw_write_buffer;
+	switch_buffer_t *raw_read_buffer;
+	switch_media_bug_callback_t callback;
+	switch_mutex_t *read_mutex;
+	switch_mutex_t *write_mutex;
+	switch_core_session_t *session;
+	void *user_data;
+	struct switch_media_bug *next;
+};
+	
 struct switch_core_session {
 	uint32_t id;
 	char name[80];
@@ -88,6 +100,9 @@
 	char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
 	void *private_info;
 	switch_queue_t *event_queue;
+	switch_queue_t *private_event_queue;
+	switch_thread_rwlock_t *bug_rwlock;
+	switch_media_bug_t *bugs;
 };
 
 SWITCH_DECLARE_DATA switch_directories SWITCH_GLOBAL_dirs;
@@ -136,6 +151,236 @@
 	}
 }
 
+static void switch_core_media_bug_destroy(switch_media_bug_t *bug)
+{
+	switch_buffer_destroy(&bug->raw_read_buffer);
+	switch_buffer_destroy(&bug->raw_write_buffer);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *bug, switch_frame_t *frame)
+{
+	uint32_t bytes = 0;
+	uint8_t data[SWITCH_RECCOMMENDED_BUFFER_SIZE] = {0};
+	uint32_t datalen = 0;
+	int16_t *dp, *fp;
+	uint32_t x;
+	size_t rlen = switch_buffer_inuse(bug->raw_read_buffer);
+	size_t wlen = switch_buffer_inuse(bug->raw_write_buffer);
+	uint32_t blen;
+	size_t rdlen = 0;
+	uint32_t maxlen;
+
+	if (!rlen && !wlen) {
+		return SWITCH_STATUS_FALSE;
+	}
+
+	maxlen = sizeof(data) > frame->buflen ? frame->buflen :  sizeof(data);
+	if ((rdlen = rlen > wlen ? wlen : rlen) > maxlen) {
+		rdlen = maxlen;
+	}
+	
+	frame->datalen = 0;
+
+	if (rlen) {
+		switch_mutex_lock(bug->read_mutex);
+		
+		frame->datalen = (uint32_t) switch_buffer_read(bug->raw_read_buffer,
+													   frame->data,
+													   rdlen);
+		switch_mutex_unlock(bug->read_mutex);
+	}
+
+	if (wlen) {
+		switch_mutex_lock(bug->write_mutex);
+		datalen = (uint32_t) switch_buffer_read(bug->raw_write_buffer,
+												data,
+												rdlen);
+		switch_mutex_unlock(bug->write_mutex);
+	}
+
+	bytes = (datalen > frame->datalen) ? datalen : frame->datalen;
+
+	if (bytes) {
+		dp = (int16_t *) data;
+		fp = (int16_t *) frame->data;
+		
+		rlen = frame->datalen / 2;
+		wlen = datalen / 2;
+		blen = bytes / 2;
+		
+		for(x = 0; x < blen; x++) {
+			int32_t z = 0;
+
+			if (x < rlen) {
+				z += (int32_t) *(fp+x);
+			}
+			if (x < wlen) {
+				z += (int32_t)*(dp+x);
+			}
+			switch_normalize_to_16bit(z);
+			*(fp+x) = (int16_t) z;
+		}
+
+		frame->datalen = bytes;
+		return SWITCH_STATUS_SUCCESS;
+	}
+
+	return SWITCH_STATUS_FALSE;
+}
+
+#define MAX_BUG_BUFFER 1024 * 512
+SWITCH_DECLARE(switch_status_t) switch_core_media_bug_add(switch_core_session_t *session,
+														  switch_media_bug_callback_t callback,
+														  void *user_data,
+														  switch_media_bug_t **new_bug)
+
+{
+	switch_media_bug_t *bug;
+	switch_size_t bytes;
+
+	if (!(bug = switch_core_session_alloc(session, sizeof(*bug)))) {
+		return SWITCH_STATUS_MEMERR;
+	}
+
+	bug->callback = callback;
+	bug->user_data = user_data;
+	bug->session = session;
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Attaching BUG to %s\n", switch_channel_get_name(session->channel));
+	bytes = session->read_codec->implementation->bytes_per_frame * 2;
+	switch_buffer_create_dynamic(&bug->raw_read_buffer, bytes, bytes, MAX_BUG_BUFFER);
+	bytes = session->write_codec->implementation->bytes_per_frame * 2;
+	switch_buffer_create_dynamic(&bug->raw_write_buffer, bytes, bytes, MAX_BUG_BUFFER);
+	switch_mutex_init(&bug->read_mutex, SWITCH_MUTEX_NESTED, session->pool);
+	switch_mutex_init(&bug->write_mutex, SWITCH_MUTEX_NESTED, session->pool);
+
+	switch_thread_rwlock_wrlock(session->bug_rwlock);
+	bug->next = session->bugs;
+	session->bugs = bug;
+	switch_thread_rwlock_unlock(session->bug_rwlock);
+	*new_bug = bug;
+
+	if (bug->callback) {
+		bug->callback(bug, bug->user_data, SWITCH_ABC_TYPE_INIT);
+	}
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(switch_core_session_t *session)
+{
+	switch_media_bug_t *bp;
+
+	if (session->bugs) {
+		switch_thread_rwlock_wrlock(session->bug_rwlock);
+		for (bp = session->bugs; bp; bp = bp->next) {
+			if (bp->callback) {
+				bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_CLOSE);
+			}
+			switch_core_media_bug_destroy(bp);
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Removing BUG from %s\n", switch_channel_get_name(session->channel));
+		}
+		switch_thread_rwlock_unlock(session->bug_rwlock);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
+	return SWITCH_STATUS_FALSE;
+}
+
+SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(switch_core_session_t *session, switch_media_bug_t **bug)
+{
+	switch_media_bug_t *bp = NULL, *last = NULL;
+
+	if (session->bugs) {
+		switch_thread_rwlock_wrlock(session->bug_rwlock);
+		for (bp = session->bugs; bp; bp = bp->next) {
+			if (bp == *bug) {
+				if (last) {
+					last->next = bp->next;
+				} else {
+					session->bugs = bp->next;
+				}
+				break;
+			}
+			last = bp;
+		}
+		switch_thread_rwlock_unlock(session->bug_rwlock);
+
+		if (bp) {
+			if (bp->callback) {
+				bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_CLOSE);
+			}
+			switch_core_media_bug_destroy(bp);
+			*bug = NULL;
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Removing BUG from %s\n", switch_channel_get_name(session->channel));
+			return SWITCH_STATUS_SUCCESS;
+		}
+	}
+
+	return SWITCH_STATUS_FALSE;
+}
+
+struct switch_core_port_allocator {
+	switch_port_t start;
+	switch_port_t end;
+	switch_port_t next;
+	uint8_t inc;
+	switch_mutex_t *mutex;
+	switch_memory_pool_t *pool;
+};
+
+SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start,
+															   switch_port_t end,
+															   uint8_t inc,
+															   switch_core_port_allocator_t **new_allocator)
+{
+	switch_status_t status;
+	switch_memory_pool_t *pool;
+	switch_core_port_allocator_t *alloc;
+
+	if ((status = switch_core_new_memory_pool(&pool)) != SWITCH_STATUS_SUCCESS) {
+		return status;
+	}
+
+	if (!(alloc = switch_core_alloc(pool, sizeof(*alloc)))) {
+		switch_core_destroy_memory_pool(&pool);
+		return SWITCH_STATUS_MEMERR;
+	}
+	
+	alloc->start = start;
+	alloc->next = start;
+	alloc->end = end;
+	if (!(alloc->inc = inc)) {
+		alloc->inc = 2;
+	}
+	switch_mutex_init(&alloc->mutex, SWITCH_MUTEX_NESTED, pool);
+	alloc->pool = pool;
+	*new_allocator = alloc;
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+SWITCH_DECLARE(switch_port_t) switch_core_port_allocator_request_port(switch_core_port_allocator_t *alloc)
+{
+	switch_port_t port;
+
+	switch_mutex_lock(alloc->mutex);
+	port = alloc->next;
+	alloc->next = alloc->next + alloc->inc;
+	if (alloc->next > alloc->end) {
+		alloc->next = alloc->start;
+	}
+	switch_mutex_unlock(alloc->mutex);
+	return port;
+}
+
+SWITCH_DECLARE(void) switch_core_port_allocator_destroy(switch_core_port_allocator_t **alloc)
+{
+	switch_memory_pool_t *pool = (*alloc)->pool;
+	switch_core_destroy_memory_pool(&pool);
+	*alloc = NULL;
+}
+
 SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(char *filename)
 {
 	switch_core_db_t *db;
@@ -439,12 +684,15 @@
 			}
 			switch_set_flag(codec, SWITCH_CODEC_FLAG_FREE_POOL);
 		}
+
 		implementation->init(codec, flags, codec_settings);
 
 		return SWITCH_STATUS_SUCCESS;
 	} else {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Codec %s Exists but not at the desired implementation.\n",
-							  codec_name);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Codec %s Exists but not at the desired implementation. %dhz %dms\n",
+						  codec_name,
+						  rate,
+						  ms);
 	}
 
 	return SWITCH_STATUS_NOTIMPL;
@@ -1192,7 +1440,6 @@
 }
 
 SWITCH_DECLARE(switch_status_t) switch_core_session_queue_event(switch_core_session_t *session, switch_event_t **event)
-	 
 {
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
@@ -1238,12 +1485,58 @@
 	return status;
 }
 
+SWITCH_DECLARE(switch_status_t) switch_core_session_queue_private_event(switch_core_session_t *session, switch_event_t **event)
+{
+	switch_status_t status = SWITCH_STATUS_FALSE;
+
+	assert(session != NULL);
+
+	if (!session->private_event_queue) {
+		switch_queue_create(&session->private_event_queue, SWITCH_EVENT_QUEUE_LEN, session->pool);
+	}
+
+	if (session->private_event_queue) {
+		if (switch_queue_trypush(session->private_event_queue, *event) == SWITCH_STATUS_SUCCESS) {
+			*event = NULL;
+			status = SWITCH_STATUS_SUCCESS;
+		}
+	} 
+
+	return status;
+}
+
+SWITCH_DECLARE(int32_t) switch_core_session_private_event_count(switch_core_session_t *session)
+{
+	if (session->private_event_queue) {
+		return (int32_t) switch_queue_size(session->private_event_queue);
+	}
+
+	return -1;
+}
+
+SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch_core_session_t *session, switch_event_t **event)
+	 
+{
+	switch_status_t status = SWITCH_STATUS_FALSE;
+	void *pop;
+
+	assert(session != NULL);
+	
+	if (session->private_event_queue) {
+		if ((status = (switch_status_t) switch_queue_trypop(session->private_event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
+			*event = (switch_event_t *) pop;
+		}
+	}
+
+	return status;
+}
+
 SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_session_t *session, switch_frame_t **frame,
 															 int timeout, int stream_id)
 {
 	switch_io_event_hook_read_frame_t *ptr;
 	switch_status_t status;
-	int need_codec, perfect;
+	int need_codec, perfect, do_bugs = 0;
  top:
 	
 	status = SWITCH_STATUS_FALSE;
@@ -1301,6 +1594,11 @@
 		need_codec = TRUE;
 	}
 
+	if (session->bugs && !need_codec) {
+		do_bugs = 1;
+		need_codec = 1;
+	}
+
 	if (status == SWITCH_STATUS_SUCCESS && need_codec) {
 		switch_frame_t *enc_frame, *read_frame = *frame;
 
@@ -1353,14 +1651,32 @@
 			read_frame->rate = session->read_resampler->to_rate;
 		}
 
+		if (session->bugs) {
+			switch_media_bug_t *bp;
+			switch_thread_rwlock_rdlock(session->bug_rwlock);
+			for (bp = session->bugs; bp; bp = bp->next) {
+				switch_mutex_lock(bp->read_mutex);
+				switch_buffer_write(bp->raw_read_buffer, read_frame->data, read_frame->datalen);
+				if (bp->callback) {
+					bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ);
+				}
+				switch_mutex_unlock(bp->read_mutex);
+			}
+			switch_thread_rwlock_unlock(session->bug_rwlock);
+		}
+
+		if (do_bugs) {
+			goto done;
+		}
+
 		if (session->read_codec) {
 			if ((*frame)->datalen == session->read_codec->implementation->bytes_per_frame) {
 				perfect = TRUE;
 			} else {
 				if (!session->raw_read_buffer) {
-					switch_size_t bytes = session->read_codec->implementation->bytes_per_frame * 10;
+					switch_size_t bytes = session->read_codec->implementation->bytes_per_frame * 2;
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Engaging Read Buffer at %u bytes\n", bytes);
-					switch_buffer_create(session->pool, &session->raw_read_buffer, bytes);
+					switch_buffer_create_dynamic(&session->raw_read_buffer, bytes, bytes, 0);
 				}
 				if (!switch_buffer_write(session->raw_read_buffer, read_frame->data, read_frame->datalen)) {
 					status = SWITCH_STATUS_MEMERR;
@@ -1452,11 +1768,14 @@
 {
 	/* sweep theese under the rug, they wont be leaked they will be reclaimed
 	   when the session ends.
-	 */
-	session->raw_write_buffer = NULL;
-	session->raw_read_buffer = NULL;
+	*/
+
 	session->read_resampler = NULL;
 	session->write_resampler = NULL;
+
+	/* wipe theese, they will be recreated if need be */
+	switch_buffer_destroy(&session->raw_read_buffer);
+	switch_buffer_destroy(&session->raw_write_buffer);
 }
 
 SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_session_t *session, switch_frame_t *frame,
@@ -1465,7 +1784,7 @@
 
 	switch_status_t status = SWITCH_STATUS_FALSE;
 	switch_frame_t *enc_frame = NULL, *write_frame = frame;
-	unsigned int flag = 0, need_codec = 0, perfect = 0;
+	unsigned int flag = 0, need_codec = 0, perfect = 0, do_bugs = 0, do_write = 0;
 	switch_io_flag_t io_flag = SWITCH_IO_FLAG_NOOP;
 
 	assert(session != NULL);
@@ -1498,6 +1817,11 @@
 		need_codec = TRUE;
 	}
 
+	if (session->bugs && !need_codec) {
+		do_bugs = 1;
+		need_codec = 1;
+	}
+
 	if (need_codec) {
 		if (frame->codec) {
 			session->raw_write_frame.datalen = session->raw_write_frame.buflen;
@@ -1558,19 +1882,36 @@
 			write_frame->rate = session->write_resampler->to_rate;
 		}
 
-
+		if (session->bugs) {
+			switch_media_bug_t *bp;
+			switch_thread_rwlock_rdlock(session->bug_rwlock);
+			for (bp = session->bugs; bp; bp = bp->next) {
+				switch_mutex_lock(bp->write_mutex);
+				switch_buffer_write(bp->raw_write_buffer, write_frame->data, write_frame->datalen);
+				switch_mutex_unlock(bp->write_mutex);
+				if (bp->callback) {
+					bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_WRITE);
+				}
+			}
+			switch_thread_rwlock_unlock(session->bug_rwlock);
+		}
+		if (do_bugs) {
+			do_write = 1;
+			write_frame = frame;
+			goto done;
+		}
 		if (session->write_codec) {
 			if (write_frame->datalen == session->write_codec->implementation->bytes_per_frame) {
 				perfect = TRUE;
 			} else {
 				if (!session->raw_write_buffer) {
-					switch_size_t bytes = session->write_codec->implementation->bytes_per_frame * 10;
+					switch_size_t bytes = session->write_codec->implementation->bytes_per_frame * 2;
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
 										  "Engaging Write Buffer at %u bytes to accomodate %u->%u\n",
 										  bytes,
 										  write_frame->datalen, session->write_codec->implementation->bytes_per_frame);
 					if ((status =
-						 switch_buffer_create(session->pool, &session->raw_write_buffer, bytes)) != SWITCH_STATUS_SUCCESS) {
+						 switch_buffer_create_dynamic(&session->raw_write_buffer, bytes, bytes, 0)) != SWITCH_STATUS_SUCCESS) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Buffer Failed!\n");
 						return status;
 					}
@@ -1697,6 +2038,11 @@
 			}
 		}
 	} else {
+		do_write = 1;
+	}
+
+ done:
+	if (do_write) {
 		return perform_write(session, frame, timeout, io_flag, stream_id);
 	}
 
@@ -2536,6 +2882,11 @@
 		switch_event_fire(&event);
 	}
 
+	switch_core_media_bug_remove_all(*session);
+	switch_buffer_destroy(&(*session)->raw_read_buffer);
+	switch_buffer_destroy(&(*session)->raw_write_buffer);
+	switch_channel_uninit((*session)->channel);
+
 	pool = (*session)->pool;
 	*session = NULL;
 	apr_pool_destroy(pool);
@@ -2763,6 +3114,7 @@
 	session->enc_read_frame.buflen = sizeof(session->enc_read_buf);
 
 	switch_mutex_init(&session->mutex, SWITCH_MUTEX_NESTED, session->pool);
+	switch_thread_rwlock_create(&session->bug_rwlock, session->pool);
 	switch_thread_cond_create(&session->cond, session->pool);
 	switch_thread_rwlock_create(&session->rwlock, session->pool);
 

Modified: freeswitch/branches/james/src/switch_event.c
==============================================================================
--- freeswitch/branches/james/src/switch_event.c	(original)
+++ freeswitch/branches/james/src/switch_event.c	Sun Sep 10 07:09:34 2006
@@ -101,6 +101,8 @@
 	"CHANNEL_UNBRIDGE",
 	"CHANNEL_PROGRESS",
 	"CHANNEL_OUTGOING",
+	"CHANNEL_PARK",
+	"CHANNEL_UNPARK",
 	"API",
 	"LOG",
 	"INBOUND_CHAN",
@@ -116,6 +118,7 @@
 	"DTMF",
 	"MESSAGE",
 	"CODEC",
+	"BACKGROUND_JOB",
 	"ALL"
 };
 

Modified: freeswitch/branches/james/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/james/src/switch_ivr.c	(original)
+++ freeswitch/branches/james/src/switch_ivr.c	Sun Sep 10 07:09:34 2006
@@ -75,6 +75,90 @@
 	return status;
 }
 
+
+static void switch_ivr_parse_event(switch_core_session_t *session, switch_event_t *event)
+{
+	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);
+
+    assert(channel != NULL);
+	hlen = (switch_size_t) strlen(cmd);
+	cmd_hash = apr_hashfunc_default(cmd, &hlen);
+
+	if (!switch_strlen_zero(cmd)) {
+		if (cmd_hash == CMD_EXECUTE) {
+			const switch_application_interface_t *application_interface;
+			char *app_name = switch_event_get_header(event, "execute-app-name");
+			char *app_arg = switch_event_get_header(event, "execute-app-arg");
+						
+			if (app_name && app_arg) {
+				if ((application_interface = switch_loadable_module_get_application_interface(app_name))) {
+					if (application_interface->application_function) {
+						application_interface->application_function(session, app_arg);
+					}
+				}
+			}
+		} else if (cmd_hash == CMD_HANGUP) {
+			char *cause_name = switch_event_get_header(event, "hangup-cause");
+			switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
+
+			if (cause_name) {
+				cause = switch_channel_str2cause(cause_name);
+			}
+
+			switch_channel_hangup(channel, cause);
+		}
+	}
+}
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session)
+{
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
+	switch_channel_t *channel;
+	switch_frame_t *frame;
+	int stream_id;
+	switch_event_t *event;
+	
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);	
+
+	switch_channel_answer(channel);
+
+	if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_PARK) == SWITCH_STATUS_SUCCESS) {
+		switch_channel_event_set_data(channel, event);
+		switch_event_fire(&event);
+	}
+
+	switch_channel_set_flag(channel, CF_CONTROLLED);
+	while (switch_channel_ready(channel)) {
+		for (stream_id = 0; stream_id < switch_core_session_get_stream_count(session); stream_id++) {
+			if ((status = switch_core_session_read_frame(session, &frame, -1, stream_id)) == SWITCH_STATUS_SUCCESS) {
+				if (!SWITCH_READ_ACCEPTABLE(status)) {
+					break;
+				}
+
+				if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+					switch_ivr_parse_event(session, event);
+					switch_event_destroy(&event);
+				}
+
+			}
+		}
+	}
+	switch_channel_clear_flag(channel, CF_CONTROLLED);
+
+	if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNPARK) == SWITCH_STATUS_SUCCESS) {
+		switch_channel_event_set_data(channel, event);
+		switch_event_fire(&event);
+	}
+
+	return status;
+}
+
 SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_session_t *session,
 																 switch_input_callback_function_t input_callback,
 																 void *buf,
@@ -96,6 +180,12 @@
 
 		char dtmf[128];
 
+
+		if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+			switch_ivr_parse_event(session, event);
+			switch_event_destroy(&event);
+		}
+
 		if (switch_channel_has_dtmf(channel)) {
 			switch_channel_dequeue_dtmf(channel, dtmf, sizeof(dtmf));
 			status = input_callback(session, dtmf, SWITCH_INPUT_TYPE_DTMF, buf, buflen);
@@ -159,6 +249,7 @@
 
 	while(switch_channel_ready(channel)) {
 		switch_frame_t *read_frame;
+		switch_event_t *event;
 
 		if (timeout) {
 			elapsed = (unsigned int)((switch_time_now() - started) / 1000);
@@ -167,6 +258,11 @@
 			}
 		}
 		
+		if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+			switch_ivr_parse_event(session, event);
+			switch_event_destroy(&event);
+		}
+
 		if (switch_channel_has_dtmf(channel)) {
 			char dtmf[128];
 			switch_channel_dequeue_dtmf(channel, dtmf, sizeof(dtmf));
@@ -302,6 +398,12 @@
 		switch_size_t len;
 		switch_event_t *event;
 
+
+		if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+			switch_ivr_parse_event(session, event);
+			switch_event_destroy(&event);
+		}
+
 		if (input_callback || buf) {
 			/*
 			  dtmf handler function you can hook up to be executed when a digit is dialed during playback 
@@ -346,6 +448,138 @@
 	return status;
 }
 
+static void record_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
+{
+	switch_file_handle_t *fh = (switch_file_handle_t *) user_data;
+	uint8_t data[SWITCH_RECCOMMENDED_BUFFER_SIZE];
+	switch_frame_t frame = {0};
+
+	frame.data = data;
+	frame.buflen = SWITCH_RECCOMMENDED_BUFFER_SIZE;
+	
+	switch(type) {
+	case SWITCH_ABC_TYPE_INIT:
+		break;
+	case SWITCH_ABC_TYPE_CLOSE:
+		switch_core_file_close(fh);
+	case SWITCH_ABC_TYPE_READ:
+		if (fh) {
+			switch_size_t len;
+
+			if (switch_core_media_bug_read(bug, &frame) == SWITCH_STATUS_SUCCESS) {
+				len = (switch_size_t) frame.datalen / 2;
+				switch_core_file_write(fh, frame.data, &len);
+			}
+		}
+		break;
+	case SWITCH_ABC_TYPE_WRITE:
+		break;
+	}
+}
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, char *file) 
+{
+	switch_media_bug_t *bug;
+	switch_channel_t *channel = switch_core_session_get_channel(session);
+
+	assert(channel != NULL);
+	if ((bug = switch_channel_get_private(channel, file))) {
+		switch_channel_set_private(channel, file, NULL);
+		switch_core_media_bug_remove(session, &bug);
+		return SWITCH_STATUS_SUCCESS;
+	}
+	
+	return SWITCH_STATUS_FALSE;
+	
+}
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file,  switch_file_handle_t *fh)
+{
+	switch_channel_t *channel;
+	switch_codec_t *read_codec;
+	char *p;
+	const char *vval;
+	switch_media_bug_t *bug;
+	switch_status_t status;
+
+	if (!fh) {
+		if (!(fh = switch_core_session_alloc(session, sizeof(*fh)))) {
+			return SWITCH_STATUS_MEMERR;
+		}
+	}
+
+	channel = switch_core_session_get_channel(session);
+    assert(channel != NULL);
+
+    read_codec = switch_core_session_get_read_codec(session);
+    assert(read_codec != NULL);
+
+    fh->channels = read_codec->implementation->number_of_channels;
+    fh->samplerate = read_codec->implementation->samples_per_second;
+
+
+    if (switch_core_file_open(fh,
+                              file,
+                              SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT,
+                              switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
+        switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+        switch_core_session_reset(session);
+        return SWITCH_STATUS_GENERR;
+    }
+
+    switch_channel_answer(channel);
+
+	if ((p = switch_channel_get_variable(channel, "RECORD_TITLE"))) {
+		vval = (const char *) switch_core_session_strdup(session, p);
+		switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_TITLE, vval);
+		switch_channel_set_variable(channel, "RECORD_TITLE", NULL);
+	}
+
+	if ((p = switch_channel_get_variable(channel, "RECORD_COPYRIGHT"))) {
+		vval = (const char *) switch_core_session_strdup(session, p);
+		switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_COPYRIGHT, vval);
+		switch_channel_set_variable(channel, "RECORD_COPYRIGHT", NULL);
+	}
+
+	if ((p = switch_channel_get_variable(channel, "RECORD_SOFTWARE"))) {
+		vval = (const char *) switch_core_session_strdup(session, p);
+		switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_SOFTWARE, vval);
+		switch_channel_set_variable(channel, "RECORD_SOFTWARE", NULL);
+	}
+
+	if ((p = switch_channel_get_variable(channel, "RECORD_ARTIST"))) {
+		vval = (const char *) switch_core_session_strdup(session, p);
+		switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_ARTIST, vval);
+		switch_channel_set_variable(channel, "RECORD_ARTIST", NULL);
+	}
+
+	if ((p = switch_channel_get_variable(channel, "RECORD_COMMENT"))) {
+		vval = (const char *) switch_core_session_strdup(session, p);
+		switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_COMMENT, vval);
+		switch_channel_set_variable(channel, "RECORD_COMMENT", NULL);
+	}
+
+	if ((p = switch_channel_get_variable(channel, "RECORD_DATE"))) {
+		vval = (const char *) switch_core_session_strdup(session, p);
+		switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_DATE, vval);
+		switch_channel_set_variable(channel, "RECORD_DATE", NULL);
+	}
+
+	
+
+	if ((status = switch_core_media_bug_add(session,
+											record_callback,
+											fh,
+											&bug)) != SWITCH_STATUS_SUCCESS) {
+		switch_core_file_close(fh);
+		return status;
+	}
+
+	switch_channel_set_private(channel, file, bug);
+	
+	return SWITCH_STATUS_SUCCESS;
+}
+
 SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, 
 												   switch_file_handle_t *fh,
 												   char *file,
@@ -494,6 +728,12 @@
 		int last_speed = -1;
 		switch_event_t *event;
 	
+
+		if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+			switch_ivr_parse_event(session, event);
+			switch_event_destroy(&event);
+		}
+
 		if (input_callback || buf) {
 			/*
 			  dtmf handler function you can hook up to be executed when a digit is dialed during playback 
@@ -711,6 +951,11 @@
 	while(switch_channel_ready(channel)) {
 		switch_event_t *event;
 
+		if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+			switch_ivr_parse_event(session, event);
+			switch_event_destroy(&event);
+		}
+
 		if (input_callback || buf) {
 			/*
 			  dtmf handler function you can hook up to be executed when a digit is dialed during playback 
@@ -1015,8 +1260,13 @@
 				ans_a++;
 			}
 			
+			if (switch_core_session_dequeue_private_event(session_a, &event) == SWITCH_STATUS_SUCCESS) {
+				switch_channel_set_flag(chan_b, CF_HOLD);
+				switch_ivr_parse_event(session_a, event);
+				switch_channel_clear_flag(chan_b, CF_HOLD);
+				switch_event_destroy(&event);
+			}
 
-
 			/* if 1 channel has DTMF pass it to the other */
 			if (switch_channel_has_dtmf(chan_a)) {
 				char dtmf[128];
@@ -1092,8 +1342,8 @@
 	channel = switch_core_session_get_channel(session);
 	assert(channel != NULL);
 
-	if ((arg = switch_channel_get_private(channel))) {
-		switch_channel_set_private(channel, NULL);
+	if ((arg = switch_channel_get_private(channel, "_bridge_"))) {
+		switch_channel_set_private(channel, "_bridge_", NULL);
 		audio_bridge_thread(NULL, (void *) arg);
 	} else {
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
@@ -1308,7 +1558,7 @@
 	int32_t idx = -1;
 	switch_codec_t write_codec = {0};
 	switch_frame_t write_frame = {0};
-	uint8_t err = 0, fdata[1024];
+	uint8_t err = 0, fdata[1024], pass = 0;
 	char *file = NULL, *key = NULL, *odata, *var;
 
 	write_frame.data = fdata;
@@ -1453,11 +1703,15 @@
 		peer_channels[i] = switch_core_session_get_channel(peer_sessions[i]);
 		assert(peer_channels[i] != NULL);
 		
-		if (!table) {
+		if (table == &noop_state_handler) {
+			table = NULL;
+		} else if (!table) {
 			table = &audio_bridge_peer_state_handlers;
 		}
 
-		switch_channel_add_state_handler(peer_channels[i], table);
+		if (table) {
+			switch_channel_add_state_handler(peer_channels[i], table);
+		}
 
 		if (switch_core_session_runing(peer_sessions[i])) {
 			switch_channel_set_state(peer_channels[i], CS_RING);
@@ -1508,24 +1762,26 @@
 		read_codec = switch_core_session_get_read_codec(session);
 
 		assert(read_codec != NULL);
-		if (switch_core_codec_init(&write_codec,
-								   "L16",
-								   read_codec->implementation->samples_per_second,
-								   read_codec->implementation->microseconds_per_frame / 1000,
-								   1,
-								   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
-								   NULL,
-								   pool) == SWITCH_STATUS_SUCCESS) {
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Success L16@%uhz 1 channel %dms\n",
-							  read_codec->implementation->samples_per_second,
-							  read_codec->implementation->microseconds_per_frame / 1000);
-			write_frame.codec = &write_codec;
-			write_frame.datalen = read_codec->implementation->bytes_per_frame;
-			write_frame.samples = write_frame.datalen / 2;
-			memset(write_frame.data, 255, write_frame.datalen);
-		} else {
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec Error!");
-			switch_channel_hangup(caller_channel, SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE);
+		if (!(pass = (uint8_t)switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH))) {
+			if (switch_core_codec_init(&write_codec,
+									   "L16",
+									   read_codec->implementation->samples_per_second,
+									   read_codec->implementation->microseconds_per_frame / 1000,
+									   1,
+									   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
+									   NULL,
+									   pool) == SWITCH_STATUS_SUCCESS) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Success L16@%uhz 1 channel %dms\n",
+								  read_codec->implementation->samples_per_second,
+								  read_codec->implementation->microseconds_per_frame / 1000);
+				write_frame.codec = &write_codec;
+				write_frame.datalen = read_codec->implementation->bytes_per_frame;
+				write_frame.samples = write_frame.datalen / 2;
+				memset(write_frame.data, 255, write_frame.datalen);
+			} else {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec Error!");
+				switch_channel_hangup(caller_channel, SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE);
+			}
 		}
 	}
 
@@ -1539,7 +1795,7 @@
 			if (!SWITCH_READ_ACCEPTABLE(status)) {
 				break;
 			}
-			if (read_frame) {
+			if (read_frame && !pass) {
 				if (switch_core_session_write_frame(session, &write_frame, 1000, 0) != SWITCH_STATUS_SUCCESS) {
 					break;
 				}
@@ -1596,7 +1852,7 @@
 	if (odata) {
 		free(odata);
 	}
-	if (write_codec.implementation) {
+	if (!pass && write_codec.implementation) {
 		switch_core_codec_destroy(&write_codec);
 	}
 	return status;
@@ -1672,7 +1928,7 @@
 		switch_core_session_receive_message(session, &msg);
 
 		if (switch_core_session_read_lock(peer_session) == SWITCH_STATUS_SUCCESS) {
-			switch_channel_set_private(peer_channel, other_audio_thread);
+			switch_channel_set_private(peer_channel, "_bridge_", other_audio_thread);
 			switch_channel_set_state(peer_channel, CS_LOOPBACK);
 			audio_bridge_thread(NULL, (void *) this_audio_thread);
 
@@ -1691,7 +1947,8 @@
 			this_audio_thread->running = 0;
 			switch_mutex_unlock(this_audio_thread->mutex);
 
-			if (!switch_channel_test_flag(peer_channel, CF_TRANSFER) && switch_channel_get_state(peer_channel) < CS_HANGUP) {
+			if (!switch_channel_test_flag(peer_channel, CF_TRANSFER) && 
+				switch_channel_get_state(peer_channel) < CS_HANGUP) {
 				switch_core_session_kill_channel(peer_session, SWITCH_SIG_KILL);
 				switch_channel_hangup(peer_channel, SWITCH_CAUSE_NORMAL_CLEARING);
 			}

Modified: freeswitch/branches/james/src/switch_loadable_module.c
==============================================================================
--- freeswitch/branches/james/src/switch_loadable_module.c	(original)
+++ freeswitch/branches/james/src/switch_loadable_module.c	Sun Sep 10 07:09:34 2006
@@ -108,7 +108,7 @@
 		for (ptr = new_module->module_interface->codec_interface; ptr; ptr = ptr->next) {
 			for (impl = ptr->implementations; impl; impl = impl->next) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE,
-								  "Adding Codec '%s' (%s) %dkhz %dms\n",
+								  "Adding Codec '%s' (%s) %dhz %dms\n",
 								  impl->iananame,
 								  ptr->interface_name,
 								  impl->samples_per_second, impl->microseconds_per_frame / 1000);



More information about the Freeswitch-svn mailing list