[Freeswitch-branches] [commit] r2633 - in freeswitch/branches/mishehu: . 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_playback src/mod/asr_tts/mod_cepstral src/mod/codecs/mod_g723_1 src/mod/codecs/mod_g729 src/mod/endpoints/mod_wanpipe src/mod/event_handlers/mod_cdr src/mod/languages/mod_perl src/mod/languages/mod_php src/mod/languages/mod_python src/mod/languages/mod_ruby src/mod/languages/mod_spidermonkey

Freeswitch SVN mishehu at freeswitch.org
Sun Sep 10 23:55:22 EDT 2006


Author: mishehu
Date: Sun Sep 10 23:55:18 2006
New Revision: 2633

Added:
   freeswitch/branches/mishehu/src/mod/languages/mod_php/CHANGES
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_php/CHANGES
   freeswitch/branches/mishehu/src/mod/languages/mod_php/classFreeswitch.php
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_php/classFreeswitch.php
   freeswitch/branches/mishehu/src/mod/languages/mod_python/
      - copied from r2632, /freeswitch/trunk/src/mod/languages/mod_python/
   freeswitch/branches/mishehu/src/mod/languages/mod_python/Makefile
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_python/Makefile
   freeswitch/branches/mishehu/src/mod/languages/mod_python/freeswitch.py
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py
   freeswitch/branches/mishehu/src/mod/languages/mod_python/mod_python.c
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_python/mod_python.c
   freeswitch/branches/mishehu/src/mod/languages/mod_python/python.py
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_python/python.py
   freeswitch/branches/mishehu/src/mod/languages/mod_python/switch_swig.c
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_python/switch_swig.c
   freeswitch/branches/mishehu/src/mod/languages/mod_python/switch_swig.i
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_python/switch_swig.i
   freeswitch/branches/mishehu/src/mod/languages/mod_python/switch_swig_wrap.c
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_python/switch_swig_wrap.c
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/
      - copied from r2632, /freeswitch/trunk/src/mod/languages/mod_ruby/
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/README
      - copied unchanged from r2632, /freeswitch/trunk/src/mod/languages/mod_ruby/README
Modified:
   freeswitch/branches/mishehu/Freeswitch.sln
   freeswitch/branches/mishehu/libs/win32/apr-iconv/libapriconv.vcproj
   freeswitch/branches/mishehu/libs/win32/apr-util/libaprutil.vcproj
   freeswitch/branches/mishehu/libs/win32/apr/libapr.vcproj
   freeswitch/branches/mishehu/src/include/switch_buffer.h
   freeswitch/branches/mishehu/src/include/switch_channel.h
   freeswitch/branches/mishehu/src/include/switch_core.h
   freeswitch/branches/mishehu/src/include/switch_ivr.h
   freeswitch/branches/mishehu/src/include/switch_types.h
   freeswitch/branches/mishehu/src/include/switch_utils.h
   freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/branches/mishehu/src/mod/applications/mod_playback/mod_playback.c
   freeswitch/branches/mishehu/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g723_1/mod_g723_1.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.vcproj
   freeswitch/branches/mishehu/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/README
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.h
   freeswitch/branches/mishehu/src/mod/languages/mod_perl/fs_perl.pm
   freeswitch/branches/mishehu/src/mod/languages/mod_perl/switch_swig.c
   freeswitch/branches/mishehu/src/mod/languages/mod_perl/switch_swig_wrap.c
   freeswitch/branches/mishehu/src/mod/languages/mod_php/Makefile
   freeswitch/branches/mishehu/src/mod/languages/mod_php/apptest.php
   freeswitch/branches/mishehu/src/mod/languages/mod_php/freeswitch.php
   freeswitch/branches/mishehu/src/mod/languages/mod_php/mod_php.c
   freeswitch/branches/mishehu/src/mod/languages/mod_php/php_freeswitch.h
   freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig.c
   freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig_wrap.c
   freeswitch/branches/mishehu/src/mod/languages/mod_php/test.php
   freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/branches/mishehu/src/switch_buffer.c
   freeswitch/branches/mishehu/src/switch_channel.c
   freeswitch/branches/mishehu/src/switch_core.c
   freeswitch/branches/mishehu/src/switch_ivr.c

Log:
Fixed compile errors on mod_cdr's odbccdr.cpp.  Merged to trunk r2632

Modified: freeswitch/branches/mishehu/Freeswitch.sln
==============================================================================
--- freeswitch/branches/mishehu/Freeswitch.sln	(original)
+++ freeswitch/branches/mishehu/Freeswitch.sln	Sun Sep 10 23:55:18 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,38 +503,38 @@
 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}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g722", "src\mod\codecs\mod_g722\mod_g722.vcproj", "{D42518CC-7475-454D-B392-0E132C07D761}"
 	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{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_park", "src\mod\applications\mod_park\mod_park.vcproj", "{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}"
@@ -559,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

Modified: freeswitch/branches/mishehu/libs/win32/apr-iconv/libapriconv.vcproj
==============================================================================
--- freeswitch/branches/mishehu/libs/win32/apr-iconv/libapriconv.vcproj	(original)
+++ freeswitch/branches/mishehu/libs/win32/apr-iconv/libapriconv.vcproj	Sun Sep 10 23:55:18 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/mishehu/libs/win32/apr-util/libaprutil.vcproj
==============================================================================
--- freeswitch/branches/mishehu/libs/win32/apr-util/libaprutil.vcproj	(original)
+++ freeswitch/branches/mishehu/libs/win32/apr-util/libaprutil.vcproj	Sun Sep 10 23:55:18 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/mishehu/libs/win32/apr/libapr.vcproj
==============================================================================
--- freeswitch/branches/mishehu/libs/win32/apr/libapr.vcproj	(original)
+++ freeswitch/branches/mishehu/libs/win32/apr/libapr.vcproj	Sun Sep 10 23:55:18 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/mishehu/src/include/switch_buffer.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_buffer.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_buffer.h	Sun Sep 10 23:55:18 2006
@@ -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,6 +119,13 @@
  * \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);
+
 /** @} */
 
 SWITCH_END_EXTERN_C

Modified: freeswitch/branches/mishehu/src/include/switch_channel.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_channel.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_channel.h	Sun Sep 10 23:55:18 2006
@@ -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

Modified: freeswitch/branches/mishehu/src/include/switch_core.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_core.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_core.h	Sun Sep 10 23:55:18 2006
@@ -107,6 +107,50 @@
   \{ 
 */
 
+
+///\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
 ///\{
@@ -116,10 +160,13 @@
   \param start the starting port
   \param end the ending port
   \param inc the amount to increment each port
-  \param new pointer for the return value
+  \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);
+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

Modified: freeswitch/branches/mishehu/src/include/switch_ivr.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_ivr.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_ivr.h	Sun Sep 10 23:55:18 2006
@@ -94,7 +94,24 @@
 																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

Modified: freeswitch/branches/mishehu/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_types.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_types.h	Sun Sep 10 23:55:18 2006
@@ -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;
@@ -739,7 +745,8 @@
 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 *);
@@ -784,6 +791,8 @@
 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;
 
 SWITCH_END_EXTERN_C
 

Modified: freeswitch/branches/mishehu/src/include/switch_utils.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_utils.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_utils.h	Sun Sep 10 23:55:18 2006
@@ -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

Modified: freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c	Sun Sep 10 23:55:18 2006
@@ -294,7 +294,7 @@
 	} 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/mishehu/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c	Sun Sep 10 23:55:18 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
@@ -224,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;
@@ -245,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;
 	}
 }
@@ -596,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;
 						}
 						
@@ -1019,7 +1019,7 @@
     }
 
 #ifdef WIN32
-	if (file[1] != ':') {
+	if (*(file +1) != ':' && *file != '/') {
 #else
 	if (*file != '/') {
 #endif
@@ -2183,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);
@@ -2355,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;
 		}
@@ -2381,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;
 	}
@@ -2435,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/mishehu/src/mod/applications/mod_playback/mod_playback.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_playback/mod_playback.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_playback/mod_playback.c	Sun Sep 10 23:55:18 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/mishehu/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	(original)
+++ freeswitch/branches/mishehu/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	Sun Sep 10 23:55:18 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/mishehu/src/mod/codecs/mod_g723_1/mod_g723_1.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g723_1/mod_g723_1.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g723_1/mod_g723_1.c	Sun Sep 10 23:55:18 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/mishehu/src/mod/codecs/mod_g729/mod_g729.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.c	Sun Sep 10 23:55:18 2006
@@ -257,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/mishehu/src/mod/codecs/mod_g729/mod_g729.vcproj
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.vcproj	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.vcproj	Sun Sep 10 23:55:18 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/mishehu/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	Sun Sep 10 23:55:18 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/mishehu/src/mod/event_handlers/mod_cdr/README
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/README	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/README	Sun Sep 10 23:55:18 2006
@@ -59,6 +59,21 @@
 		<param name="chanvars_supp" value=""/> value is a comma separated list of supplemental channel variables to log.  Can be a wildcard (*) (optional)
 		<param name="chanvars_supp_repeat_fixed" value=""/> value is 0 for no, 1 for yes, and determines whether or not to repeat any of the fixed channel variables as key / value pairs in the chanvars table.
 
+Class:		OdbcCDR, located in odbccdr.h and odbccdr.cpp
+		This class logs the call detail record to an ODBC database using prepared
+		statements.  This class is similar to MysqlCDR in that the fixed channel variables are treated as additional columns on the main freeswitchcdr database table for improved normalization of the database.  As such, you need to specify the format of each fixed channel variable as well.  If you do not specify, it will default to a varchar column type, and will not execute if the table schema does not match.  Therefore it is very important to make sure that any fixed channel variables you log exist as columns on the table.  The supplemental channel variables are stored in a separate table using a key / value pair linking to the myuuid of the call.  Recommended to use at least one other logger in conjuction with this one just to be on the safe side, as failover handling of errors to write to the db are not yet implemented, and therefore there is a risk of data loss if the database connection is lost entirely (it will be limited to only those records created at the time of the loss of connection) or some other fatal error is encountered.  Additionally, since there is no uniform method to handling columns of type sequence/autoincrement/autonumber in the rdbms world, it should be noted that each row in the chanvars (supplemental channel variables) table will cost 36 bytes for the myuuid to be posted to it instead of 8 bytes for a bigint as in MysqlCDR.
+Configuration:  Section <odbccdr>
+		<param name="dsn" value=""/> - Not yet implemented, but meant for future use in ease of config
+		<param name="hostname" value=""/> - The hostname or IP of the backend server
+		<param name="username" value=""/> - The username used to authenticate to the backend server
+		<param name="password" value=""/> - The password used to authenticate to the backend server
+		<param name="dbname" value=""/> - The database to use for logging
+		<param name="main_db_table" value=""/> - Optional: the name of the main logging table (defaults to freeswitchcdr)
+		<param name="supp_chanvars_db_table" value=""/> - Optional: the name of the supplemental chanvars table (defaults to chanvars)
+		<param name="chanvars_fixed" value=""/> Is a comma separated list of key=type pairs.  Types are x for decimal, s for string (varchar), d for double, i for integer, t for tiny.  If no type is provided, it defaults that column to string (varchar).  It cannot accept wildcards (*).  (optional)
+		<param name="chanvars_supp" value=""/> value is a comma separated list of supplemental channel variables to log.  Can be a wildcard (*) (optional)
+		<param name="chanvars_supp_repeat_fixed" value=""/> value is 0 for no, 1 for yes, and determines whether or not to repeat any of the fixed channel variables as key / value pairs in the chanvars table.
+		
 FAQ:
 
 Q: Why C++?

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp	Sun Sep 10 23:55:18 2006
@@ -54,9 +54,9 @@
 		// Format the times
 		switch_size_t retsizecsd, retsizecad, retsizeced;  //csd == callstartdate, cad == callanswerdate, ced == callenddate, ceff == callenddate_forfile
 		char format[] = "%Y-%m-%d %T";
-		switch_strftime(odbc_callstartdate,&retsizecsd,sizeof(formattedcallstartdate),format,&tempcallstart);
-		switch_strftime(odbc_callanswerdate,&retsizecad,sizeof(formattedcallanswerdate),format,&tempcallanswer);
-		switch_strftime(odbc_callenddate,&retsizeced,sizeof(formattedcallenddate),format,&tempcallend);
+		switch_strftime(odbc_callstartdate,&retsizecsd,sizeof(odbc_callstartdate),format,&tempcallstart);
+		switch_strftime(odbc_callanswerdate,&retsizecad,sizeof(odbc_callanswerdate),format,&tempcallanswer);
+		switch_strftime(odbc_callenddate,&retsizeced,sizeof(odbc_callenddate),format,&tempcallend);
 		
 		if(chanvars_fixed_list.size() > 0)
 			process_channel_variables(chanvars_fixed_list,newchannel->channel);
@@ -80,19 +80,20 @@
 bool OdbcCDR::activated = 0;
 char OdbcCDR::sql_query[1024] = "";
 std::string OdbcCDR::tmp_sql_query;
-char OdbcCDR::sql_query_chanvars[100] = "";
+char OdbcCDR::sql_query_chanvars[355] = "";
 char OdbcCDR::sql_query_ping[10] = "";
 SQLHENV OdbcCDR::ODBC_env=0;
 SQLHDBC OdbcCDR::ODBC_con=0;
 SQLHSTMT OdbcCDR::ODBC_stmt=0;
-MYSQL_STMT* OdbcCDR::stmt=0;
-MYSQL_STMT* OdbcCDR::stmt_chanvars=0;
+SQLHSTMT OdbcCDR::ODBC_stmt_chanvars = 0;
+SQLHSTMT OdbcCDR::ODBC_stmt_ping = 0;
 char OdbcCDR::dsn[255] = "";
 char OdbcCDR::hostname[255] = "";
 char OdbcCDR::username[255] ="";
 char OdbcCDR::dbname[255] = "";
 char OdbcCDR::password[255] = "";
 char OdbcCDR::tablename[255] = "";
+char OdbcCDR::tablename_chanvars[255] = "";
 //fstream OdbcCDR::tmpfile;
 
 void OdbcCDR::connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param)
@@ -114,7 +115,7 @@
 			if (!strcmp(var, "dsn"))
 			{
 				strncpy(dsn,val,strlen(val));
-				count_config_params++;
+				//count_config_params++;
 			}
 			else if (!strcmp(var, "hostname"))
 			{
@@ -177,18 +178,34 @@
 						repeat_fixed_in_supp = 1;
 				}
 			}
+			else if(!strcmp(var,"main_db_table"))
+			{
+				if(val != 0)
+					strncpy(tablename,val,strlen(val));
+			}
+			else if(!strcmp(var,"supp_chanvars_db_table"))
+			{
+				if(val != 0)
+					strncpy(tablename_chanvars,val,strlen(val));
+			}
+			
+			if(strlen(tablename) == 0)
+				strncpy(tablename,"freeswitchcdr",13);
+			
+			if(strlen(tablename_chanvars) && logchanvars)
+				strncpy(tablename_chanvars,"chanvars",8);
 		}
 		
 		if (count_config_params==5)
 			activated = 1;
 		else
-			switch_console_printf(SWITCH_CHANNEL_LOG,"You did not specify the minimum parameters for using this module.  You must specify a hostname, username, password, and database to use OdbcCDR.  You only supplied %d parameters.\n",count_config_params);
+			switch_console_printf(SWITCH_CHANNEL_LOG,"You did not specify the minimum parameters for using this module.  You must specify a DSN,hostname, username, password, and database to use OdbcCDR.  You only supplied %d parameters.\n",count_config_params);
 		
 		if(activated)
 		{
 			tmp_sql_query = "INSERT INTO ";
 			tmp_sql_query.append(tablename);
-			tmp_sql_query.append(" (callstartdate,callanswerdate,callenddate,originated,clid,src,dst,ani,ani2,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags";
+			tmp_sql_query.append(" (callstartdate,callanswerdate,callenddate,originated,clid,src,dst,ani,ani2,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags");
 			
 			int items_appended = 0;
 			
@@ -218,7 +235,7 @@
 	
 			std::string tempsql_query_chanvars = "INSERT INTO ";
 			tempsql_query_chanvars.append(tablename_chanvars);
-			tempsql_query_chanvars.append("(callid,varname,varvalue) VALUES(?,?,?)";
+			tempsql_query_chanvars.append("(callid,varname,varvalue) VALUES(?,?,?)");
 			memset(sql_query_chanvars,0,355);
 			strncpy(sql_query_chanvars,tempsql_query_chanvars.c_str(),tempsql_query_chanvars.size());
 
@@ -285,7 +302,7 @@
 	
 	// Turn off autocommit and have it preserve the cursors even after commit
 	SQLSetConnectAttr(ODBC_con, SQL_AUTOCOMMIT_OFF, NULL, 0);
-	SQLSetConnectAttr(ODBC_con, SQL_PC_ON, NULL, 0);
+	SQLSetConnectAttr(ODBC_con, SQL_CB_PRESERVE, NULL, 0);
 	
 	ODBC_res = SQLAllocHandle(SQL_HANDLE_STMT, ODBC_con, &ODBC_stmt);
 
@@ -322,7 +339,7 @@
 		}
 	}
 	
-	int ODBC_res = SQLAllocHandle(SQL_HANDLE_STMT, ODBC_con, &ODBC_stmt_ping);
+	ODBC_res = SQLAllocHandle(SQL_HANDLE_STMT, ODBC_con, &ODBC_stmt_ping);
 	
 	if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO))
 	{
@@ -330,7 +347,7 @@
 		SQLFreeHandle(SQL_HANDLE_STMT, ODBC_stmt_ping);
 	}
 	
-	ODBC_res = SQLPrepare(ODBC_stmt_ping, (unsigned char *)ping, SQL_NTS);
+	ODBC_res = SQLPrepare(ODBC_stmt_ping, (unsigned char *)sql_query_ping, SQL_NTS);
 	
 	if ((ODBC_res != SQL_SUCCESS) && (ODBC_res != SQL_SUCCESS_WITH_INFO))
 	{
@@ -382,7 +399,7 @@
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(dst), 0, dst, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(ani), 0, ani, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(ani2), 0, ani2, 0, 0);
-	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(diaplan), 0, dialplan, 0, 0);
+	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(dialplan), 0, dialplan, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, sizeof(myuuid), 0, myuuid, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, sizeof(destuuid), 0, destuuid, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(srcchannel), 0, srcchannel, 0, 0);
@@ -390,9 +407,8 @@
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(lastapp), 0, lastapp, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(lastdata), 0, lastdata, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_UBIGINT, SQL_BIGINT, 0, 0, &billusec, 0, 0);
-	add_parameter(billusec,MYSQL_TYPE_LONGLONG,0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_TINYINT, 0, 0, &disposition, 0, 0);
-	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_INT, SQL_INTEGER, 0, 0, &hangupcause, 0, 0);
+	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, &hangupcause, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_TINYINT, 0, 0, &amaflags, 0, 0);
 		
 	std::list<void*> temp_chanvars_holder; // This is used for any fixed chanvars, as we don't want things out of scope
@@ -446,7 +462,6 @@
 					
 					temp_chanvars_holder.push_back(x);
 					SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_TINYINT, 0, 0, x, 0, 0);
-					add_parameter(*x,MYSQL_TYPE_TINY,is_null);
 					break;
 				}
 				case CDR_STRING:
@@ -487,11 +502,19 @@
 		iEnd = chanvars_supp.end();
 		for(iItr = chanvars_supp.begin(); iItr != iEnd; iItr++)
 		{
+			std::vector<char> tempfirstvector(iItr->first.begin(), iItr->first.end());
+			tempfirstvector.push_back('\0');
+			char* varname_temp = &tempfirstvector[0];
+			
+			std::vector<char> tempsecondvector(iItr->second.begin(), iItr->second.end());
+			tempsecondvector.push_back('\0');
+			char* varvalue_temp = &tempsecondvector[0];
+			
 			SQLBindParameter(ODBC_stmt_chanvars, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, sizeof(myuuid), 0, myuuid, 0, 0);
 			
-			SQLBindParameter(ODBC_stmt_chanvars, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, iItr->first.size(), 0, iItr->first.c_str(), 0, 0);
+			SQLBindParameter(ODBC_stmt_chanvars, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, iItr->first.size(), 0, varname_temp, 0, 0);
 			
-			SQLBindParameter(ODBC_stmt_chanvars, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, iItr->second.size(), 0, iItr->second.c_str(), 0, 0);
+			SQLBindParameter(ODBC_stmt_chanvars, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, iItr->second.size(), 0, varvalue_temp, 0, 0);
 			
 			int ODBC_res_chanvars = SQLExecute(ODBC_stmt_chanvars);
 			if(ODBC_res_chanvars != SQL_SUCCESS && ODBC_res_chanvars != SQL_SUCCESS_WITH_INFO)
@@ -502,9 +525,9 @@
 	}
 			
 	if(errorstate)
-		SQLEndTrans(SQL_HANDLE_DBC,ODBC_con,SQL_ROLLBACK);
+		SQLEndTran(SQL_HANDLE_DBC,ODBC_con,SQL_ROLLBACK);
 	else
-		SQLEndTrans(SQL_HANDLE_DBC,ODBC_con,SQL_COMMIT);
+		SQLEndTran(SQL_HANDLE_DBC,ODBC_con,SQL_COMMIT);
 	
 	if(temp_chanvars_holder.size() > 0)
 	{
@@ -561,7 +584,7 @@
 	chanvars_fixed_types.clear();
 	connectionstate = 0;
 	tmp_sql_query.clear();
-	tmp_sql_query_chanvars.clear();
+	//tmp_sql_query_chanvars.clear();
 }
 
 void OdbcCDR::disconnect_stage_1()

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.h	Sun Sep 10 23:55:18 2006
@@ -94,6 +94,7 @@
 		char odbc_callanswerdate[128];
 		char odbc_callenddate[128];
 		void disconnect_stage_1();
+		void connect_to_database();
 };
 
 #endif

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_perl/fs_perl.pm
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_perl/fs_perl.pm	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_perl/fs_perl.pm	Sun Sep 10 23:55:18 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/mishehu/src/mod/languages/mod_perl/switch_swig.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_perl/switch_swig.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_perl/switch_swig.c	Sun Sep 10 23:55:18 2006
@@ -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)

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_perl/switch_swig_wrap.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_perl/switch_swig_wrap.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_perl/switch_swig_wrap.c	Sun Sep 10 23:55:18 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/mishehu/src/mod/languages/mod_php/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/Makefile	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/Makefile	Sun Sep 10 23:55:18 2006
@@ -10,7 +10,7 @@
 all:	depends $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PHPMOD).$(DYNAMIC_LIB_EXTEN)
 
 depends:
-	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install php-5.1.6.tar.gz --prefix=$(PREFIX) --enable-embed=static --enable-static --with-pic
+	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install php-5.1.6.tar.gz --prefix=$(PREFIX) --enable-embed=static --enable-static --with-pic --with-mysql --with-curl
 %.o:  %.c
 	$(CC) $(LCFLAGS) $(CFLAGS) -c $< -o $@
 

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/apptest.php
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/apptest.php	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/apptest.php	Sun Sep 10 23:55:18 2006
@@ -1,7 +1,17 @@
 <? 
-include("freeswitch.php");
-$session = fs_core_session_locate($uuid);
-fs_channel_answer($session);
-fs_ivr_play_file2($session, "/ram/sr8k.wav");
+/*
+
+  This application does not fall under the MPL.  Its 100% freeware
+  no code needs to be submitted back to us for this.
+  (c)2006 Brian Fertig 
+
+*/
+require("classFreeswitch.php");
+
+$fs = new fs_class_api;
+
+$fs->fs_answer($session);
+
+$fs->fs_play_file($session, "/ram/sr8k.wav");
 
 ?>

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/freeswitch.php
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/freeswitch.php	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/freeswitch.php	Sun Sep 10 23:55:18 2006
@@ -2,7 +2,7 @@
 
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.21
+ * Version 1.3.29
  * 
  * 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
@@ -16,7 +16,7 @@
 
 /* if our extension has not been loaded, do what we can */
 if (!extension_loaded("php_freeswitch")) {
-	if (!dl("php_freeswitch.so")) return;
+  if (!dl("php_freeswitch.so")) return;
 }
 
 

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/mod_php.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/mod_php.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/mod_php.c	Sun Sep 10 23:55:18 2006
@@ -24,12 +24,17 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
+ * Brian Fertig <brian.fertig at convergencetek.com>
  *
- *
  * mod_php.c -- PHP Module
  *
  */
 
+#if !defined(ZTS)
+#error "ZTS Needs to be defined."
+#endif
+
+
 #ifndef _REENTRANT
 #define _REENTRANT
 #endif
@@ -39,38 +44,75 @@
 #endif
 
 #include <sapi/embed/php_embed.h>
+//#include "php.h"
+//#include "php_variables.h"
+//#include "ext/standard/info.h"
+//#include "php_ini.h"
+//#include "php_globals.h"
+//#include "SAPI.h"
+//#include "php_main.h"
+//#include "php_version.h"
+//#include "TSRM.h"
+//#include "ext/standard/php_standard.h"
 
+
 #include <switch.h>
 
 const char modname[] = "mod_php";
 
-
-
 static void php_function(switch_core_session_t *session, char *data)
 {
 	char *uuid = switch_core_session_get_uuid(session);
 	uint32_t ulen = strlen(uuid);
 	uint32_t len = strlen((char *) data) + ulen + 2;
 	char *mydata = switch_core_session_alloc(session, len);
-	int argc;
+	int argc, retval;
 	char *argv[5];
 	char php_code[1024]; 
 	void*** tsrm_ls = NULL;
-
+	
+	
 	snprintf(mydata, len, "%s %s", uuid, data);
 
-	argc = switch_separate_string(mydata, ' ',
-								  argv,
-								  (sizeof(argv) / sizeof(argv[0])));
-	
-	sprintf(php_code, "$uuid=\"%s\"; include(\"%s\");\n", argv[0], argv[1]);
-	php_embed_init(argc, argv, &tsrm_ls);
+	argc = 1; //switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 
+	//sprintf(php_code, "$uuid=\"%s\"; include(\"%s\");\n", argv[0], argv[1]);
+	sprintf(php_code, "include('%s');", argv[1]);
+
+	zend_file_handle script;
+	script.type = ZEND_HANDLE_FP;
+	script.filename = data;
+	script.opened_path = NULL;
+	script.free_filename = 0;
+	script.handle.fp = fopen(script.filename, "rb");	
+
+	//php_embed_init(argc, argv, &tsrm_ls);
+	if (php_request_startup(TSRMLS_C) == FAILURE) {
+		return;
+        }
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Starting Script %s\n",data);
+
+	retval = php_execute_script(&script TSRMLS_CC);	
+	php_request_shutdown(NULL);
+
+        return;
+
+
 	//PHP_EMBED_START_BLOCK(argc, argv);
-	zend_eval_string(php_code, NULL, "Embedded code" TSRMLS_CC);
-	//PHP_EMBED_END_BLOCK();
-	php_embed_shutdown(tsrm_ls);
+		//void*** tsrm_ls = NULL;
+		//zend_error_cb = myapp_php_error_cb;
+		//zend_eval_string(php_code, NULL, "MOD_PHP" TSRMLS_CC);
+//		zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, &script);
+		//if (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, &script) == SUCCESS)
+		    //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "There was a problem with the file\n");
+		//PHP_EMBED_END_BLOCK();
+//	php_embed_shutdown(tsrm_ls);
+		
 
+	//}else{
+	//    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "There was a problem with the file\n");	   
+	//}
 
 
 }
@@ -93,16 +135,21 @@
 	/*.directory_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+/*SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
 {
-	/* connect my internal structure to the blank pointer passed to me */
+	// connect my internal structure to the blank pointer passed to me 
 	*module_interface = &php_module_interface;
+	
+	sapi_startup(&mod_php_sapi_module);
+        mod_php_sapi_module.startup(&mod_php_sapi_module);
 
+
 	//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hello World!\n");
 
-	/* indicate that the module should continue to be loaded */
+	// indicate that the module should continue to be loaded 
 	return SWITCH_STATUS_SUCCESS;
 }
+*/
 
 /*
   Called when the system shuts down
@@ -119,3 +166,228 @@
   return SWITCH_STATUS_SUCCESS;
   }
 */
+
+
+zend_module_entry mod_php_module_entry = {
+        STANDARD_MODULE_HEADER,
+        "mod_php",
+        NULL,
+        NULL,
+        NULL,
+        NULL,
+        NULL,
+        NULL,
+        NO_VERSION_YET,
+        STANDARD_MODULE_PROPERTIES
+};
+
+
+static int sapi_mod_php_ub_write(const char *str, unsigned int str_length TSRMLS_DC)
+{ // This function partly based on code from asterisk_php
+
+  FILE *fp = fopen("mod_php.log", "a");
+  fwrite(str, str_length, sizeof(char), fp);
+  fclose(fp);
+
+
+        char buffer[4096];
+        int i, j = 0;
+        for(i = 0; i < str_length; i++) {
+                buffer[j++] = str[i];
+                if(str[i] == 10) { /* new line */
+                        buffer[j] = 0;
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
+                        j = 0;
+                }
+                else if(str[i] == 0) { /* null character */
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
+                        j = 0;
+                }
+                if(j == 4095) { /* don't overfill buffer */
+                        buffer[j] = 0;
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
+                        j = 0;
+                }
+        }
+        if(j) { /* stuff left over */
+                buffer[j] = 0;
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
+        }
+        return str_length;
+}
+
+
+void mod_php_error_handler(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args)
+{
+        char *buffer;
+        int buffer_len;
+        TSRMLS_FETCH();
+
+        buffer_len = vspprintf(&buffer, PG(log_errors_max_len), format, args);
+
+        if((EG(error_reporting) & type || (type & E_CORE)) && (PG(log_errors) || PG(display_errors))) {
+                char *error_type_str;
+
+                switch (type) {
+                        case E_ERROR:
+                        case E_CORE_ERROR:
+                        case E_COMPILE_ERROR:
+                        case E_USER_ERROR:
+                                error_type_str = "Fatal error";
+                                break;
+                        case E_WARNING:
+                        case E_CORE_WARNING:
+                        case E_COMPILE_WARNING:
+                        case E_USER_WARNING:
+                                error_type_str = "Warning";
+                                break;
+                        case E_PARSE:
+                                error_type_str = "Parse error";
+                                break;
+                        case E_NOTICE:
+                        case E_USER_NOTICE:
+                                error_type_str = "Notice";
+                                break;
+                        default:
+                                error_type_str = "Unknown error";
+                                break;
+                }
+
+                if(PG(log_errors)) {
+                        char *log_buffer;
+#ifdef PHP_WIN32
+                        if(type == E_CORE_ERROR || type == E_CORE_WARNING) {
+                                MessageBox(NULL, buffer, error_type_str, MB_OK|ZEND_SERVICE_MB_STYLE);
+                        }
+#endif
+                        spprintf(&log_buffer, 0, "PHP %s:  %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno);
+                        php_log_err(log_buffer TSRMLS_CC);
+                        efree(log_buffer);
+                }
+
+                if(PG(display_errors)) {
+                        char *prepend_string = INI_STR("error_prepend_string");
+                        char *append_string = INI_STR("error_append_string");
+                        char *error_format = "%s\n%s: %s in %s on line %d\n%s";
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, error_format, STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, 
+STR_PRINT(append_string));
+                }
+        }
+
+        /* Bail out if we can't recover */
+        switch(type) {
+                case E_CORE_ERROR:
+                case E_ERROR:
+                /*case E_PARSE: the parser would return 1 (failure), we can bail out nicely */
+                case E_COMPILE_ERROR:
+                case E_USER_ERROR:
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "\nPHP: %s exiting\n", error_filename);
+                        EG(exit_status) = 255;
+#if MEMORY_LIMIT
+                        /* restore memory limit */
+                        AG(memory_limit) = PG(memory_limit);
+#endif
+                        efree(buffer);
+                        zend_bailout();
+                        return;
+                        break;
+        }
+
+        /* Log if necessary */
+        if(PG(track_errors) && EG(active_symbol_table)) {
+                pval *tmp;
+
+                ALLOC_ZVAL(tmp);
+                INIT_PZVAL(tmp);
+                Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len);
+                Z_STRLEN_P(tmp) = buffer_len;
+                Z_TYPE_P(tmp) = IS_STRING;
+                zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL);
+        }
+        efree(buffer);
+}
+
+static int sapi_mod_php_header_handler(sapi_header_struct * sapi_header, sapi_headers_struct * sapi_headers TSRMLS_DC)
+{
+        return 0;
+}
+
+static int sapi_mod_php_send_headers(sapi_headers_struct * sapi_headers TSRMLS_DC)
+{
+        return SAPI_HEADER_SENT_SUCCESSFULLY;
+}
+
+static int sapi_mod_php_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+{
+        return 0;
+}
+
+static int mod_php_startup(sapi_module_struct *sapi_module)
+{
+        if(php_module_startup(sapi_module, &mod_php_module_entry, 1) == FAILURE) {
+                return FAILURE;
+        }
+        return SUCCESS;
+}
+
+static void mod_php_log_message(char *message)
+{
+         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s\n", message);
+}
+
+
+static char *sapi_mod_php_read_cookies(TSRMLS_D)
+{
+        return NULL;
+}
+
+static int mod_php_startup(sapi_module_struct *sapi_module);
+
+sapi_module_struct mod_php_sapi_module = {
+   "mod_php",                                  /* name */
+   "mod_php",                                  /* pretty name */
+
+   mod_php_startup,                        /* startup */
+   NULL,                 /* shutdown */
+
+   NULL,                                        /* activate */
+   NULL,                                        /* deactivate */
+
+   sapi_mod_php_ub_write,                      /* unbuffered write */
+   NULL,                                        /* flush */
+   NULL,                                        /* get uid */
+   NULL,                                        /* getenv */
+
+   php_error,                                   /* error handler */
+
+   sapi_mod_php_header_handler,                /* header handler */
+   sapi_mod_php_send_headers,                  /* send headers handler */
+   NULL,                                        /* send header handler */
+
+   sapi_mod_php_read_post,                     /* read POST data */
+   sapi_mod_php_read_cookies,                  /* read Cookies */
+
+   NULL,					/* register server variables */
+   mod_php_log_message,                        /* Log message */
+   NULL,                                        /* Get request time */
+
+   NULL,                                        /* Block interruptions */
+   NULL,                                        /* Unblock interruptions */
+
+   STANDARD_SAPI_MODULE_PROPERTIES
+};
+
+SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+{
+        /* connect my internal structure to the blank pointer passed to me */
+        *module_interface = &php_module_interface;
+
+        sapi_startup(&mod_php_sapi_module);
+        mod_php_sapi_module.startup(&mod_php_sapi_module);
+
+
+        //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hello World!\n");
+
+        /* indicate that the module should continue to be loaded */
+        return SWITCH_STATUS_SUCCESS;
+}

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/php_freeswitch.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/php_freeswitch.h	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/php_freeswitch.h	Sun Sep 10 23:55:18 2006
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.21
+ * Version 1.3.29
  * 
  * 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
@@ -40,6 +40,10 @@
 # define PHP_FREESWITCH_API
 #endif
 
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
 PHP_MINIT_FUNCTION(freeswitch);
 PHP_MSHUTDOWN_FUNCTION(freeswitch);
 PHP_RINIT_FUNCTION(freeswitch);
@@ -52,8 +56,8 @@
 ZEND_NAMED_FUNCTION(_wrap_fs_loadable_module_init);
 ZEND_NAMED_FUNCTION(_wrap_fs_loadable_module_shutdown);
 ZEND_NAMED_FUNCTION(_wrap_fs_console_loop);
-ZEND_NAMED_FUNCTION(_wrap_fs_console_log);
-ZEND_NAMED_FUNCTION(_wrap_fs_console_clean);
+ZEND_NAMED_FUNCTION(_wrap_fs_consol_log);
+ZEND_NAMED_FUNCTION(_wrap_fs_consol_clean);
 ZEND_NAMED_FUNCTION(_wrap_fs_core_session_locate);
 ZEND_NAMED_FUNCTION(_wrap_fs_channel_answer);
 ZEND_NAMED_FUNCTION(_wrap_fs_channel_pre_answer);
@@ -62,25 +66,14 @@
 ZEND_NAMED_FUNCTION(_wrap_fs_channel_get_variable);
 ZEND_NAMED_FUNCTION(_wrap_fs_channel_set_state);
 ZEND_NAMED_FUNCTION(_wrap_fs_ivr_play_file);
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_record_file);
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_sleep);
 ZEND_NAMED_FUNCTION(_wrap_fs_ivr_play_file2);
-/*If you declare any globals in php_freeswitch.h uncomment this:
-ZEND_BEGIN_MODULE_GLOBALS(freeswitch)
-ZEND_END_MODULE_GLOBALS(freeswitch)
-*/
-#ifdef ZTS
-#define FREESWITCH_D  zend_freeswitch_globals *freeswitch_globals
-#define FREESWITCH_DC  , FREESWITCH_D
-#define FREESWITCH_C  freeswitch_globals
-#define FREESWITCH_CC  , FREESWITCH_C
-#define FREESWITCH_SG(v)  (freeswitch_globals->v)
-#define FREESWITCH_FETCH()  zend_freeswitch_globals *freeswitch_globals = ts_resource(freeswitch_globals_id)
-#else
-#define FREESWITCH_D
-#define FREESWITCH_DC
-#define FREESWITCH_C
-#define FREESWITCH_CC
-#define FREESWITCH_SG(v)  (freeswitch_globals.v)
-#define FREESWITCH_FETCH()
-#endif
-
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_collect_digits_callback);
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_collect_digits_count);
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_originate);
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_session_transfer);
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_speak_text);
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_channel_get_variable);
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_channel_set_variable);
 #endif /* PHP_FREESWITCH_H */

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig.c	Sun Sep 10 23:55:18 2006
@@ -1,3 +1,34 @@
+/*
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthmct at yahoo.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Anthony Minessale II <anthmct at yahoo.com>
+ * Brian Fertig <brian.fertig at convergencetek.com>
+ *
+ * php_freeswitch.c -- PHP Module Framework
+ *
+ */
 #include <switch.h>
 #ifdef __ICC
 #pragma warning (disable:1418)
@@ -55,14 +86,19 @@
 	return 0;
 }
 
-void fs_console_log(char *msg)
+void fs_consol_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)
+	
+void fs_consol_clean(char *msg)
 {
-	switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, msg);
+        switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, msg);
 }
 
 switch_core_session_t *fs_core_session_locate(char *uuid)
@@ -116,6 +152,11 @@
 	}
 }
 
+
+/*
+IVR Routines!  You can do IVR in PHP NOW!
+*/
+
 int fs_ivr_play_file(switch_core_session_t *session,
 					 char *file,
 					 char *timer_name,
@@ -132,7 +173,27 @@
 	return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
 }
 
+int fs_switch_ivr_record_file(switch_core_session_t *session,
+						switch_file_handle_t *fh,
+						char *file,
+						switch_input_callback_function_t dtmf_callback,
+						void *buf,
+						unsigned int buflen)
+{  
+	switch_status_t status;
+	
+        status = switch_ivr_record_file(session, fh, file, dtmf_callback, buf, buflen);
+        return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+}
 
+int fs_switch_ivr_sleep(switch_core_session_t *session,
+					uint32_t ms)
+{
+	switch_status_t status;
+	status = switch_ivr_sleep(session, ms);
+	return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+}
+
 int fs_ivr_play_file2(switch_core_session_t *session,
 					  char *file)
 
@@ -142,4 +203,124 @@
 	status = switch_ivr_play_file(session, NULL, file, NULL, NULL, NULL, 0);
 	return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
 }
+
+
+int fs_switch_ivr_collect_digits_callback (switch_core_session_t *session,
+							switch_input_callback_function_t dtmf_callback,
+							void *buf,
+							unsigned int buflen)
+{
+        switch_status_t status;
+
+        status = switch_ivr_collect_digits_callback(session, dtmf_callback, buf, buflen);
+        return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+}
+
+int fs_switch_ivr_collect_digits_count  	(switch_core_session_t *session,
+					char *buf,
+					unsigned int buflen,
+					unsigned int maxdigits,
+					const char *terminators,
+					char *terminator,
+					unsigned int timeout)  
+{
+        switch_status_t status;
+
+        status = switch_ivr_collect_digits_count(session, buf, buflen, maxdigits, terminators, terminator, timeout);
+        return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+}
+
+/*int fs_switch_ivr_multi_threaded_bridge   (switch_core_session_t *session,
+					switch_core_session_t *peer_session,
+					switch_input_callback_function_t dtmf_callback,
+					void *session_data,
+					void *peer_session_data)  
+{
+        switch_status_t status;
+
+        status = switch_ivr_multi_threaded_bridge(session, peer_session, dtmf_callback, session_data, peer_session_data);
+        return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+}
+*/
+
+int fs_switch_ivr_originate       (switch_core_session_t *session,
+				switch_core_session_t **bleg,
+				char *  	bridgeto,
+				uint32_t  	timelimit_sec)
+				/*const switch_state_handler_table_t *table,
+				char *  	cid_name_override,
+				char *  	cid_num_override,
+				switch_caller_profile_t *caller_profile_override)  */
+{
+
+        switch_channel_t *caller_channel;
+        switch_core_session_t *peer_session;
+        unsigned int timelimit = 60;
+        char *var;
+
+        caller_channel = switch_core_session_get_channel(session);
+        assert(caller_channel != NULL);
+
+        if ((var = switch_channel_get_variable(caller_channel, "call_timeout"))) {
+                timelimit = atoi(var);
+        }
+        
+        if (switch_ivr_originate(session, &peer_session, bridgeto, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel!\n");
+                switch_channel_hangup(caller_channel, SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL);
+                return;
+        } else {
+                switch_ivr_multi_threaded_bridge(session, peer_session, NULL, NULL, NULL);
+        }
+
+
+}
+
+int fs_switch_ivr_session_transfer(switch_core_session_t *session,
+				char *extension,
+				char *dialplan,
+				char *context)  
+{
+        switch_status_t status;
+
+        status = switch_ivr_session_transfer(session,extension,dialplan,context);
+        return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+}
+
+int fs_switch_ivr_speak_text      (switch_core_session_t *session,
+				char *tts_name,
+				char *voice_name,
+				char *timer_name,
+				uint32_t  	rate,
+				switch_input_callback_function_t dtmf_callback,
+				char *text,
+				void *buf,
+				unsigned int buflen)  
+{
+        switch_status_t status;
+
+        status = switch_ivr_speak_text(session,tts_name,voice_name,timer_name,rate,dtmf_callback,text,buf,buflen);
+        return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+}
+
+
+/*
+
+*******  CHANNEL STUFF  *******
+
+*/
+
+char* fs_switch_channel_get_variable(switch_channel_t *channel, char *varname)
+{
+	return switch_channel_get_variable(channel, varname);
+}
+
+
+int fs_switch_channel_set_variable(switch_channel_t *channel, char *varname, char *value)
+{
+        switch_status_t status;
+
+        status = switch_channel_set_variable(channel, varname, value);
+        return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+}  
 

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig_wrap.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig_wrap.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig_wrap.c	Sun Sep 10 23:55:18 2006
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.21
+ * Version 1.3.29
  * 
  * 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,72 +8,284 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
-/*************************************************************** -*- c -*-
- * php4/precommon.swg
- *
- * Rename all exported symbols from common.swg, to avoid symbol
- * clashes if multiple interpreters are included
- *
- ************************************************************************/
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
 
-#define SWIG_TypeRegister    SWIG_PHP4_TypeRegister
-#define SWIG_TypeCheck       SWIG_PHP4_TypeCheck
-#define SWIG_TypeCast        SWIG_PHP4_TypeCast
-#define SWIG_TypeDynamicCast SWIG_PHP4_TypeDynamicCast
-#define SWIG_TypeName        SWIG_PHP4_TypeName
-#define SWIG_TypeQuery       SWIG_PHP4_TypeQuery
-#define SWIG_TypeClientData  SWIG_PHP4_TypeClientData
-#define SWIG_PackData        SWIG_PHP4_PackData 
-#define SWIG_UnpackData      SWIG_PHP4_UnpackData 
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC)
+#   if (__SUNPRO_CC <= 0x560)
+#     define SWIGTEMPLATEDISAMBIGUATOR template
+#   else
+#     define SWIGTEMPLATEDISAMBIGUATOR 
+#   endif
+# else
+#   define SWIGTEMPLATEDISAMBIGUATOR 
+# endif
+#endif
 
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
 
-/***********************************************************************
- * common.swg
- *
- *     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.
- ************************************************************************/
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
 
-#include <string.h>
-#include "switch.h"
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
 
-#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
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
 #  endif
-#else
-#  define SWIGEXPORT(a) a
-#  define SWIGIMPORT(a) a
 #endif
 
-#ifdef SWIG_GLOBAL
-#  define SWIGRUNTIME(a) SWIGEXPORT(a)
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* 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"
+
+/* 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)
 #else
-#  define SWIGRUNTIME(a) static a
+# define SWIG_TYPE_TABLE_NAME
 #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
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+	delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {			       
+          if (<need new object>) {		       
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;		       
+          } else {				       
+            *ptr = <ptr to old object>;	       
+            return SWIG_OLDOBJ;		       
+          } 				       
+        } else {				       
+          return SWIG_BADOBJ;		       
+        }					       
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+ 
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+#include "switch.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -81,106 +293,141 @@
 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;
-  swig_converter_func     converter;
-  const char             *str;
-  void                   *clientdata;
-  swig_dycast_func        dcast;
-  struct swig_type_info  *next;
-  struct swig_type_info  *prev;
+  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 */
+  int                    owndata;		/* flag if the structure owns the clientdata */
 } swig_type_info;
 
-#ifdef SWIG_NOINCLUDE
+/* 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;
 
-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);
+/* 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;
 
-#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 (*f1 > *f2) ? 1 : -1;
+  }
+  return (l1 - f1) - (l2 - 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;
+/*
+  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;
     }
-    tc = tc->prev;
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
   }
-  head = ti;
-  next = 0;
+  return equiv;
+}
 
-  /* 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++;
+/*
+  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;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
   }
-  if (next) next->prev = head;
-  head->next = next;
-  return ret;
+  return equiv;
 }
 
-/* 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;
-    }
-    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);
 }
 
-/* Dynamic pointer casting. Down an inheritance hierarchy */
-SWIGRUNTIME(swig_type_info *) 
+/*
+  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 *
 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
   swig_type_info *lastty = ty;
   if (!ty || !ty->dcast) return ty;
@@ -191,94 +438,251 @@
   return lastty;
 }
 
-/* Return the name associated with this type */
-SWIGRUNTIME(const char *)
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
 SWIG_TypeName(const swig_type_info *ty) {
   return ty->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;
+/*
+  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) return NULL;
+  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;
   }
-  return 0;
+  else
+    return type->name;
 }
 
-/* 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_type_info *tc, *equiv;
-  if (ti->clientdata == clientdata) return;
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
   ti->clientdata = 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;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+	SWIG_TypeClientData(tc, clientdata);
       }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  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);
     }
-    equiv = equiv->next;
+    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);
   }
+  
+  /* neither found a match */
+  return 0;
 }
 
-/* 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;
+/* 
+   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;
     *(c++) = hex[(uu & 0xf0) >> 4];
     *(c++) = hex[uu & 0xf];
   }
   return c;
 }
 
-/* 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++);
+/* 
+   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;
     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;
 }
 
-#endif
+/* 
+   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;
+}
 
+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
 
-/*
- * php4.swg
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
  *
- * PHP4 runtime library
+ * php4run.swg
  *
- */
+ * PHP4 runtime library
+ * ----------------------------------------------------------------------------- */
 
 #ifdef __cplusplus
 extern "C" {
@@ -306,6 +710,28 @@
 }
 #endif
 
+/* But in fact SWIG_ConvertPtr is the native interface for getting typed
+   pointer values out of zvals.  We need the TSRMLS_ macros for when we
+   make PHP type calls later as we handle php resources */
+#define SWIG_ConvertPtr(obj,pp,type,flags) SWIG_ZTS_ConvertPtr(obj,pp,type,flags TSRMLS_CC)
+
+
+#define SWIG_fail goto fail
+
+static char *default_error_msg = "Unknown error occurred";
+static int default_error_code = E_ERROR;
+
+#define SWIG_PHP_Arg_Error_Msg(argnum,extramsg) "Error in argument " #argnum " "#extramsg
+
+#define SWIG_PHP_Error(code,msg) ErrorCode() = code; ErrorMsg() = msg; SWIG_fail;
+
+#define SWIG_contract_assert(expr,msg) \
+  if (!(expr) ) { zend_printf("Contract Assert Failed %s\n",msg ); } else
+
+/* Standard SWIG API */
+#define SWIG_GetModule(clientdata) SWIG_Php4_GetModule()
+#define SWIG_SetModule(clientdata, pointer) SWIG_Php4_SetModule(pointer)
+
 /* used to wrap returned objects in so we know whether they are newobject
    and need freeing, or not */
 typedef struct _swig_object_wrapper {
@@ -313,56 +739,24 @@
   int newobject;
 } swig_object_wrapper;
 
-/* local scope self_constructors are set to 1 inside function wrappers
-   which are also class constructors, so that the php4.swg output typemaps
-   know whether or not to wrap returned objects in this_ptr or a new object */
-int self_constructor=0;
-
 /* empty zend destructor for types without one */
 static ZEND_RSRC_DTOR_FUNC(SWIG_landfill) {};
 
-/* This one makes old swig style string pointers but the php module doesn't
-   use these any more.  This is just left here for old times sake and may go */
-SWIGRUNTIME(void)
-SWIG_MakePtr(char *c, void *ptr, swig_type_info *ty) {
-  static char hex[17] = "0123456789abcdef";
-  unsigned long p, s;
-  char data[32], *r;
-
-  r = data;
-  p = (unsigned long) ptr;
-  if (p > 0) {
-    while (p > 0) {
-      s = p & 0xf;
-      *(r++) = hex[s];
-      p = p >> 4;
-    }
-    *r = '_';
-    while (r >= data) {
-      *(c++) = *(r--);
-    }
-    strcpy (c, ty->name);
-  } else {
-    strcpy (c, "NULL");
-  }
-}
-
-SWIGRUNTIME(void)
-SWIG_SetPointerChar(char **c, void *ptr, swig_type_info *type) {
-   char data[512];
-
-   SWIG_MakePtr(data, ptr, type);
-   *c = estrdup(data);
-}
-
 #define SWIG_SetPointerZval(a,b,c,d) SWIG_ZTS_SetPointerZval(a,b,c,d, SWIG_module_entry TSRMLS_CC)
 
-SWIGRUNTIME(void)
+static void
 SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject, zend_module_entry* module_entry TSRMLS_DC) {
   swig_object_wrapper *value=NULL;
-  /* No need to call SWIG_MakePtr here! */
+  /*
+   * First test for Null pointers.  Return those as PHP native NULL
+   */
+  if (!ptr ) {
+    ZVAL_NULL(z);
+    return;
+  }
   if (type->clientdata) {
-    if (! (*(int *)(type->clientdata))) zend_error(E_ERROR, "Type: %s failed to register with zend",type->name);
+    if (! (*(int *)(type->clientdata)))
+      zend_error(E_ERROR, "Type: %s failed to register with zend",type->name);
     value=(swig_object_wrapper *)emalloc(sizeof(swig_object_wrapper));
     value->ptr=ptr;
     value->newobject=newobject;
@@ -374,55 +768,6 @@
   }
 }
 
-/* This old-style routine converts an old string-pointer c into a real pointer
-   ptr calling making appropriate casting functions according to ty
-   We don't use this any more */
-SWIGRUNTIME(int)
-SWIG_ConvertPtr_(char *c, void **ptr, swig_type_info *ty) {
-   register int d;
-   unsigned long p;
-   swig_type_info *tc;
-
-   if(c == NULL) {
-   	*ptr = 0;
-	return 0;
-   }
-
-   p = 0;
-   if (*c != '_') {
-    *ptr = (void *) 0;
-    if (strcmp(c,"NULL") == 0) {
-	return 0;
-    } else {
-	goto type_error;
-    }
-  }
-
-    c++;
-    /* Extract hex value from pointer */
-    while ((d = *c)) {
-      if ((d >= '0') && (d <= '9'))
-        p = (p << 4) + (d - '0');
-      else if ((d >= 'a') && (d <= 'f'))
-        p = (p << 4) + (d - ('a'-10));
-      else
-        break;
-      c++;
-    }
-    *ptr = (void *) p;
-	
-    if(ty) {
-	tc = SWIG_TypeCheck(c,ty);
-	if(!tc) goto type_error;
-	*ptr = SWIG_TypeCast(tc, (void*)p);
-    }
-    return 0;
-
-type_error:
-
-    return -1;
-}
-
 /* This is a new pointer conversion routine
    Taking the native pointer p (which would have been converted from the old
    string pointer) and it's php type id, and it's type name (which also would
@@ -434,9 +779,9 @@
    SWIG_ZTS_ConvertResourcePtr which gets the type name from the resource
    and the registered zend destructors for which we have one per type each
    with the type name hard wired in. */
-SWIGRUNTIME(int)
+static int
 SWIG_ZTS_ConvertResourceData(void * p, int type, const char *type_name, void **ptr, swig_type_info *ty TSRMLS_DC) {
-  swig_type_info *tc;
+  swig_cast_info *tc;
 
   if (ty) {
     if (! type_name) {  
@@ -459,32 +804,30 @@
 /* This function fills ptr with a pointer of type ty by extracting the pointer
    and type info from the resource in z.  z must be a resource
    It uses SWIG_ZTS_ConvertResourceData to do the real work. */
-SWIGRUNTIME(int)
-SWIG_ZTS_ConvertResourcePtr(zval *z, void **ptr, swig_type_info *ty TSRMLS_DC) {
+static int
+SWIG_ZTS_ConvertResourcePtr(zval *z, void **ptr, swig_type_info *ty, int flags TSRMLS_DC) {
   swig_object_wrapper *value;
   void *p;
   int type;
   char *type_name;
 
   value = (swig_object_wrapper *) zend_list_find(z->value.lval,&type);
+  if ( flags && SWIG_POINTER_DISOWN ) {
+    value->newobject = 0;
+  }
   p = value->ptr;
   if (type==-1) return -1;
 
-  type_name=zend_rsrc_list_get_rsrc_type(z->value.lval);
+  type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC);
 
   return SWIG_ZTS_ConvertResourceData(p,type,type_name,ptr,ty TSRMLS_CC);
 }
 
-/* But in fact SWIG_ConvertPtr is the native interface for getting typed
-   pointer values out of zvals.  We need the TSRMLS_ macros for when we
-   make PHP type calls later as we handle php resources */
-#define SWIG_ConvertPtr(a,b,c) SWIG_ZTS_ConvertPtr(a,b,c TSRMLS_CC)
-
 /* We allow passing of a STRING or RESOURCE pointing to the object
    or an OBJECT whose _cPtr is a string or resource pointing to the object
    STRING pointers are very depracated */
-SWIGRUNTIME(int)
-SWIG_ZTS_ConvertPtr(zval *z, void **ptr, swig_type_info *ty TSRMLS_DC) {
+static int
+SWIG_ZTS_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags TSRMLS_DC) {
    char *c;
    zval *val;
    
@@ -499,14 +842,14 @@
        /* Don't co-erce to string if it isn't */
        if ((*_cPtr)->type==IS_STRING) c = Z_STRVAL_PP(_cPtr);
        else if ((*_cPtr)->type==IS_RESOURCE) {
-         return SWIG_ZTS_ConvertResourcePtr(*_cPtr,ptr,ty TSRMLS_CC);
+         return SWIG_ZTS_ConvertResourcePtr(*_cPtr,ptr,ty, flags TSRMLS_CC);
        } else goto type_error; /* _cPtr was not string or resource property */
      } else goto type_error; /* can't find property _cPtr */
    } else if (z->type==IS_RESOURCE) {
-     return SWIG_ZTS_ConvertResourcePtr(z,ptr,ty TSRMLS_CC);
-   } else if (z->type==IS_STRING) {
-     c = Z_STRVAL_P(z); 
-     return SWIG_ConvertPtr_(c,ptr,ty);
+     return SWIG_ZTS_ConvertResourcePtr(z,ptr,ty, flags TSRMLS_CC);
+   } if (z->type==IS_NULL ) {
+     *ptr = 0;
+     return 0;
    } else goto type_error;
 
 type_error:
@@ -514,13 +857,43 @@
     return -1;
 }
 
+static char const_name[] = "swig_runtime_data_type_pointer";
+static swig_module_info *SWIG_Php4_GetModule() {
+  zval *pointer;
+  swig_module_info *ret = 0;
 
+  MAKE_STD_ZVAL(pointer);
+
+  TSRMLS_FETCH();
+
+  if (zend_get_constant(const_name, sizeof(const_name), pointer TSRMLS_CC)) {
+    if (pointer->type == IS_LONG) {
+      ret = (swig_module_info *) pointer->value.lval;
+    }
+  } 
+  FREE_ZVAL(pointer);
+  return ret; 
+}
+
+static void SWIG_Php4_SetModule(swig_module_info *pointer) {
+  TSRMLS_FETCH();
+  REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, 0);
+}
+
+
 /* -------- TYPES TABLE (BEGIN) -------- */
 
-#define  SWIGTYPE_p_switch_core_session_t swig_types[0] 
-#define  SWIGTYPE_p_void swig_types[1] 
-#define  SWIGTYPE_p_switch_input_callback_function_t swig_types[2] 
-static swig_type_info *swig_types[4];
+#define SWIGTYPE_p_p_switch_core_session_t swig_types[0]
+#define SWIGTYPE_p_p_void swig_types[1]
+#define SWIGTYPE_p_switch_channel_t swig_types[2]
+#define SWIGTYPE_p_switch_core_session_t swig_types[3]
+#define SWIGTYPE_p_switch_file_handle_t swig_types[4]
+#define SWIGTYPE_p_switch_input_callback_function_t swig_types[5]
+#define SWIGTYPE_p_uint32_t swig_types[6]
+static swig_type_info *swig_types[8];
+static swig_module_info swig_module = {swig_types, 7, 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) -------- */
 
@@ -543,9 +916,31 @@
   |                                                                      |
   +----------------------------------------------------------------------+
  */
-#define SWIG_init	initfreeswitch
+ZEND_BEGIN_MODULE_GLOBALS(freeswitch)
+char *error_msg;
+int error_code;
+ZEND_END_MODULE_GLOBALS(freeswitch)
+ZEND_DECLARE_MODULE_GLOBALS(freeswitch)
+#ifdef ZTS
+#define ErrorMsg() TSRMG(freeswitch_globals_id, zend_freeswitch_globals *, error_msg )
+#define ErrorCode() TSRMG(freeswitch_globals_id, zend_freeswitch_globals *, error_code )
+#else
+#define ErrorMsg() (freeswitch_globals.error_msg)
+#define ErrorCode() (freeswitch_globals.error_code)
+#endif
 
-#define SWIG_name	"freeswitch"
+static void freeswitch_init_globals(zend_freeswitch_globals *freeswitch_globals ) {
+  freeswitch_globals->error_msg = default_error_msg;
+  freeswitch_globals->error_code = default_error_code;
+}
+static void freeswitch_destroy_globals(zend_freeswitch_globals *freeswitch_globals) { }
+
+void SWIG_ResetError() {
+  TSRMLS_FETCH();
+  ErrorMsg() = default_error_msg;
+  ErrorCode() = default_error_code;
+}
+#define SWIG_name  "freeswitch"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -557,23 +952,6 @@
 }
 #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 *);
-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"
 
@@ -583,41 +961,33 @@
 /* entry subsection */
 /* Every non-class user visible function must have an entry here */
 function_entry freeswitch_functions[] = {
-	ZEND_NAMED_FE(fs_core_set_globals,
-		_wrap_fs_core_set_globals, NULL)
-	ZEND_NAMED_FE(fs_core_init,
-		_wrap_fs_core_init, NULL)
-	ZEND_NAMED_FE(fs_core_destroy,
-		_wrap_fs_core_destroy, NULL)
-	ZEND_NAMED_FE(fs_loadable_module_init,
-		_wrap_fs_loadable_module_init, NULL)
-	ZEND_NAMED_FE(fs_loadable_module_shutdown,
-		_wrap_fs_loadable_module_shutdown, NULL)
-	ZEND_NAMED_FE(fs_console_loop,
-		_wrap_fs_console_loop, NULL)
-	ZEND_NAMED_FE(fs_console_log,
-		_wrap_fs_console_log, NULL)
-	ZEND_NAMED_FE(fs_console_clean,
-		_wrap_fs_console_clean, NULL)
-	ZEND_NAMED_FE(fs_core_session_locate,
-		_wrap_fs_core_session_locate, NULL)
-	ZEND_NAMED_FE(fs_channel_answer,
-		_wrap_fs_channel_answer, NULL)
-	ZEND_NAMED_FE(fs_channel_pre_answer,
-		_wrap_fs_channel_pre_answer, NULL)
-	ZEND_NAMED_FE(fs_channel_hangup,
-		_wrap_fs_channel_hangup, NULL)
-	ZEND_NAMED_FE(fs_channel_set_variable,
-		_wrap_fs_channel_set_variable, NULL)
-	ZEND_NAMED_FE(fs_channel_get_variable,
-		_wrap_fs_channel_get_variable, NULL)
-	ZEND_NAMED_FE(fs_channel_set_state,
-		_wrap_fs_channel_set_state, NULL)
-	ZEND_NAMED_FE(fs_ivr_play_file,
-		_wrap_fs_ivr_play_file, NULL)
-	ZEND_NAMED_FE(fs_ivr_play_file2,
-		_wrap_fs_ivr_play_file2, NULL)
-	{NULL, NULL, NULL}
+  ZEND_NAMED_FE(fs_core_set_globals,_wrap_fs_core_set_globals, NULL)
+  ZEND_NAMED_FE(fs_core_init,_wrap_fs_core_init, NULL)
+  ZEND_NAMED_FE(fs_core_destroy,_wrap_fs_core_destroy, NULL)
+  ZEND_NAMED_FE(fs_loadable_module_init,_wrap_fs_loadable_module_init, NULL)
+  ZEND_NAMED_FE(fs_loadable_module_shutdown,_wrap_fs_loadable_module_shutdown, NULL)
+  ZEND_NAMED_FE(fs_console_loop,_wrap_fs_console_loop, NULL)
+  ZEND_NAMED_FE(fs_consol_log,_wrap_fs_consol_log, NULL)
+  ZEND_NAMED_FE(fs_consol_clean,_wrap_fs_consol_clean, NULL)
+  ZEND_NAMED_FE(fs_core_session_locate,_wrap_fs_core_session_locate, NULL)
+  ZEND_NAMED_FE(fs_channel_answer,_wrap_fs_channel_answer, NULL)
+  ZEND_NAMED_FE(fs_channel_pre_answer,_wrap_fs_channel_pre_answer, NULL)
+  ZEND_NAMED_FE(fs_channel_hangup,_wrap_fs_channel_hangup, NULL)
+  ZEND_NAMED_FE(fs_channel_set_variable,_wrap_fs_channel_set_variable, NULL)
+  ZEND_NAMED_FE(fs_channel_get_variable,_wrap_fs_channel_get_variable, NULL)
+  ZEND_NAMED_FE(fs_channel_set_state,_wrap_fs_channel_set_state, NULL)
+  ZEND_NAMED_FE(fs_ivr_play_file,_wrap_fs_ivr_play_file, NULL)
+  ZEND_NAMED_FE(fs_switch_ivr_record_file,_wrap_fs_switch_ivr_record_file, NULL)
+  ZEND_NAMED_FE(fs_switch_ivr_sleep,_wrap_fs_switch_ivr_sleep, NULL)
+  ZEND_NAMED_FE(fs_ivr_play_file2,_wrap_fs_ivr_play_file2, NULL)
+  ZEND_NAMED_FE(fs_switch_ivr_collect_digits_callback,_wrap_fs_switch_ivr_collect_digits_callback, NULL)
+  ZEND_NAMED_FE(fs_switch_ivr_collect_digits_count,_wrap_fs_switch_ivr_collect_digits_count, NULL)
+  ZEND_NAMED_FE(fs_switch_ivr_originate,_wrap_fs_switch_ivr_originate, NULL)
+  ZEND_NAMED_FE(fs_switch_ivr_session_transfer,_wrap_fs_switch_ivr_session_transfer, NULL)
+  ZEND_NAMED_FE(fs_switch_ivr_speak_text,_wrap_fs_switch_ivr_speak_text, NULL)
+  ZEND_NAMED_FE(fs_switch_channel_get_variable,_wrap_fs_switch_channel_get_variable, NULL)
+  ZEND_NAMED_FE(fs_switch_channel_set_variable,_wrap_fs_switch_channel_set_variable, NULL)
+ {NULL, NULL, NULL}
 };
 
 zend_module_entry freeswitch_module_entry = {
@@ -641,501 +1011,1025 @@
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
-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_void[] = {{"_p_void", 0, "void *", 0},{"_p_void"},{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_type_info _swigt__p_p_switch_core_session_t = {"_p_p_switch_core_session_t", "switch_core_session_t **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_void = {"_p_p_void", "void **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_file_handle_t = {"_p_switch_file_handle_t", "switch_file_handle_t *", 0, 0, (void*)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, (void*)0, 0};
+static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *", 0, 0, (void*)0, 0};
 
-static swig_type_info *swig_types_initial[] = {
-_swigt__p_switch_core_session_t, 
-_swigt__p_void, 
-_swigt__p_switch_input_callback_function_t, 
-0
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_p_switch_core_session_t,
+  &_swigt__p_p_void,
+  &_swigt__p_switch_channel_t,
+  &_swigt__p_switch_core_session_t,
+  &_swigt__p_switch_file_handle_t,
+  &_swigt__p_switch_input_callback_function_t,
+  &_swigt__p_uint32_t,
 };
 
+static swig_cast_info _swigc__p_p_switch_core_session_t[] = {  {&_swigt__p_p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_void[] = {  {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_channel_t[] = {  {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}};
+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_file_handle_t[] = {  {&_swigt__p_switch_file_handle_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_cast_info _swigc__p_uint32_t[] = {  {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}};
 
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_p_switch_core_session_t,
+  _swigc__p_p_void,
+  _swigc__p_switch_channel_t,
+  _swigc__p_switch_core_session_t,
+  _swigc__p_switch_file_handle_t,
+  _swigc__p_switch_input_callback_function_t,
+  _swigc__p_uint32_t,
+};
+
+
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
 
+/* end header section */
 /* vdecl subsection */
+static int le_swig__p_switch_channel_t=0; /* handle for  */
+static int le_swig__p_switch_file_handle_t=0; /* handle for  */
 static int le_swig__p_switch_core_session_t=0; /* handle for  */
-static int le_swig__p_void=0; /* handle for  */
+static int le_swig__p_p_switch_core_session_t=0; /* handle for  */
+static int le_swig__p_p_void=0; /* handle for  */
+static int le_swig__p_uint32_t=0; /* handle for  */
 static int le_swig__p_switch_input_callback_function_t=0; /* handle for  */
 /* end vdecl subsection */
 /* wrapper section */
 ZEND_NAMED_FUNCTION(_wrap_fs_core_set_globals) {
-    zval **args[1];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
-    }
-    if(((ZEND_NUM_ARGS() + argbase )!= 0) || (zend_get_parameters_array_ex(0-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
-    }
-    
-    fs_core_set_globals();
-    
-    
+  zval **args[0];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 0) || (zend_get_parameters_array_ex(0, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  fs_core_set_globals();
+  
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
 ZEND_NAMED_FUNCTION(_wrap_fs_core_init) {
-    char *arg1 ;
-    int result;
-    zval **args[2];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
-    }
-    if(((ZEND_NUM_ARGS() + argbase )!= 1) || (zend_get_parameters_array_ex(1-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
-    }
-    
-    
-    convert_to_string_ex(((0<argbase)?(&this_ptr):(args[0-argbase])));
-    arg1 = (char *) Z_STRVAL_PP(((0<argbase)?(&this_ptr):(args[0-argbase])));
-    
-    result = (int)fs_core_init(arg1);
-    
-    
+  char *arg1 = (char *) 0 ;
+  int result;
+  zval **args[1];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 1) || (zend_get_parameters_array_ex(1, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[0]);
+    arg1 = (char *) Z_STRVAL_PP(args[0]);
+    /*@SWIG@*/;
+  }
+  result = (int)fs_core_init(arg1);
+  {
     ZVAL_LONG(return_value,result);
-    
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
 ZEND_NAMED_FUNCTION(_wrap_fs_core_destroy) {
-    int result;
-    zval **args[1];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
-    }
-    if(((ZEND_NUM_ARGS() + argbase )!= 0) || (zend_get_parameters_array_ex(0-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
-    }
-    
-    result = (int)fs_core_destroy();
-    
-    
+  int result;
+  zval **args[0];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 0) || (zend_get_parameters_array_ex(0, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  result = (int)fs_core_destroy();
+  {
     ZVAL_LONG(return_value,result);
-    
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
 ZEND_NAMED_FUNCTION(_wrap_fs_loadable_module_init) {
-    int result;
-    zval **args[1];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
-    }
-    if(((ZEND_NUM_ARGS() + argbase )!= 0) || (zend_get_parameters_array_ex(0-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
-    }
-    
-    result = (int)fs_loadable_module_init();
-    
-    
+  int result;
+  zval **args[0];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 0) || (zend_get_parameters_array_ex(0, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  result = (int)fs_loadable_module_init();
+  {
     ZVAL_LONG(return_value,result);
-    
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
 ZEND_NAMED_FUNCTION(_wrap_fs_loadable_module_shutdown) {
-    int result;
-    zval **args[1];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
-    }
-    if(((ZEND_NUM_ARGS() + argbase )!= 0) || (zend_get_parameters_array_ex(0-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
-    }
-    
-    result = (int)fs_loadable_module_shutdown();
-    
-    
+  int result;
+  zval **args[0];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 0) || (zend_get_parameters_array_ex(0, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  result = (int)fs_loadable_module_shutdown();
+  {
     ZVAL_LONG(return_value,result);
-    
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
 ZEND_NAMED_FUNCTION(_wrap_fs_console_loop) {
-    int result;
-    zval **args[1];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
-    }
-    if(((ZEND_NUM_ARGS() + argbase )!= 0) || (zend_get_parameters_array_ex(0-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
-    }
-    
-    result = (int)fs_console_loop();
-    
-    
+  int result;
+  zval **args[0];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 0) || (zend_get_parameters_array_ex(0, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  result = (int)fs_console_loop();
+  {
     ZVAL_LONG(return_value,result);
-    
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_console_log) {
-    char *arg1 ;
-    zval **args[2];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_consol_log) {
+  char *arg1 = (char *) 0 ;
+  char *arg2 = (char *) 0 ;
+  zval **args[2];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 2) || (zend_get_parameters_array_ex(2, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[0]);
+    arg1 = (char *) Z_STRVAL_PP(args[0]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  fs_consol_log(arg1,arg2);
+  
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_fs_consol_clean) {
+  char *arg1 = (char *) 0 ;
+  zval **args[1];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 1) || (zend_get_parameters_array_ex(1, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[0]);
+    arg1 = (char *) Z_STRVAL_PP(args[0]);
+    /*@SWIG@*/;
+  }
+  fs_consol_clean(arg1);
+  
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_fs_core_session_locate) {
+  char *arg1 = (char *) 0 ;
+  switch_core_session_t *result = 0 ;
+  zval **args[1];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 1) || (zend_get_parameters_array_ex(1, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[0]);
+    arg1 = (char *) Z_STRVAL_PP(args[0]);
+    /*@SWIG@*/;
+  }
+  result = (switch_core_session_t *)fs_core_session_locate(arg1);
+  {
+    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_switch_core_session_t, 0);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_fs_channel_answer) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  zval **args[1];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 1) || (zend_get_parameters_array_ex(1, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_channel_answer. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 1) || (zend_get_parameters_array_ex(1-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  fs_channel_answer(arg1);
+  
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_fs_channel_pre_answer) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  zval **args[1];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 1) || (zend_get_parameters_array_ex(1, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_channel_pre_answer. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    
-    
-    convert_to_string_ex(((0<argbase)?(&this_ptr):(args[0-argbase])));
-    arg1 = (char *) Z_STRVAL_PP(((0<argbase)?(&this_ptr):(args[0-argbase])));
-    
-    fs_console_log(arg1);
-    
-    
+  }
+  fs_channel_pre_answer(arg1);
+  
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_console_clean) {
-    char *arg1 ;
-    zval **args[2];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_channel_hangup) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  zval **args[2];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 2) || (zend_get_parameters_array_ex(2, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_channel_hangup. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 1) || (zend_get_parameters_array_ex(1-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  fs_channel_hangup(arg1,arg2);
+  
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_fs_channel_set_variable) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  zval **args[3];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 3) || (zend_get_parameters_array_ex(3, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_channel_set_variable. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    
-    
-    convert_to_string_ex(((0<argbase)?(&this_ptr):(args[0-argbase])));
-    arg1 = (char *) Z_STRVAL_PP(((0<argbase)?(&this_ptr):(args[0-argbase])));
-    
-    fs_console_clean(arg1);
-    
-    
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[2]);
+    arg3 = (char *) Z_STRVAL_PP(args[2]);
+    /*@SWIG@*/;
+  }
+  fs_channel_set_variable(arg1,arg2,arg3);
+  
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_core_session_locate) {
-    char *arg1 ;
-    switch_core_session_t *result;
-    zval **args[2];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_channel_get_variable) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  zval **args[2];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 2) || (zend_get_parameters_array_ex(2, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_channel_get_variable. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 1) || (zend_get_parameters_array_ex(1-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  fs_channel_get_variable(arg1,arg2);
+  
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_fs_channel_set_state) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  zval **args[2];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 2) || (zend_get_parameters_array_ex(2, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_channel_set_state. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    
-    
-    convert_to_string_ex(((0<argbase)?(&this_ptr):(args[0-argbase])));
-    arg1 = (char *) Z_STRVAL_PP(((0<argbase)?(&this_ptr):(args[0-argbase])));
-    
-    result = (switch_core_session_t *)fs_core_session_locate(arg1);
-    
-    
-    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_switch_core_session_t, 0);
-    
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  fs_channel_set_state(arg1,arg2);
+  
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_channel_answer) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    zval **args[2];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_ivr_play_file) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  switch_input_callback_function_t arg4 ;
+  void *arg5 = (void *) 0 ;
+  unsigned int arg6 ;
+  int result;
+  switch_input_callback_function_t *tmp4 ;
+  zval **args[6];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 6) || (zend_get_parameters_array_ex(6, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_ivr_play_file. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 1) || (zend_get_parameters_array_ex(1-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[2]);
+    arg3 = (char *) Z_STRVAL_PP(args[2]);
+    /*@SWIG@*/;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[3], (void **) &tmp4, SWIGTYPE_p_switch_input_callback_function_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of fs_ivr_play_file. Expected SWIGTYPE_p_switch_input_callback_function_t");
     }
-    
-    
-    if(SWIG_ConvertPtr(*((0<argbase)?(&this_ptr):(args[0-argbase])), (void **) &arg1, SWIGTYPE_p_switch_core_session_t) < 0) {
-        zend_error(E_ERROR, "Type error in argument %d of fs_channel_answer. Expected %s", 1-argbase, SWIGTYPE_p_switch_core_session_t->name);
+    arg4 = *tmp4;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, 0, 0) < 0) {
+      /* Allow NULL from php for void* */
+      if ((*args[4])->type==IS_NULL) arg5=0;
+      else
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of fs_ivr_play_file. Expected SWIGTYPE_p_p_void");
     }
-    
-    fs_channel_answer(arg1);
-    
-    
+  }
+  {
+    /*@SWIG:CONVERT_INT_IN@*/
+    convert_to_long_ex(args[5]);
+    arg6 = (unsigned int) Z_LVAL_PP(args[5]);
+    /*@SWIG@*/;
+  }
+  result = (int)fs_ivr_play_file(arg1,arg2,arg3,arg4,arg5,arg6);
+  {
+    ZVAL_LONG(return_value,result);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_channel_pre_answer) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    zval **args[2];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_record_file) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  switch_file_handle_t *arg2 = (switch_file_handle_t *) 0 ;
+  char *arg3 = (char *) 0 ;
+  switch_input_callback_function_t arg4 ;
+  void *arg5 = (void *) 0 ;
+  unsigned int arg6 ;
+  int result;
+  switch_input_callback_function_t *tmp4 ;
+  zval **args[6];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 6) || (zend_get_parameters_array_ex(6, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_switch_ivr_record_file. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 1) || (zend_get_parameters_array_ex(1-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_switch_file_handle_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of fs_switch_ivr_record_file. Expected SWIGTYPE_p_switch_file_handle_t");
     }
-    
-    
-    if(SWIG_ConvertPtr(*((0<argbase)?(&this_ptr):(args[0-argbase])), (void **) &arg1, SWIGTYPE_p_switch_core_session_t) < 0) {
-        zend_error(E_ERROR, "Type error in argument %d of fs_channel_pre_answer. Expected %s", 1-argbase, SWIGTYPE_p_switch_core_session_t->name);
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[2]);
+    arg3 = (char *) Z_STRVAL_PP(args[2]);
+    /*@SWIG@*/;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[3], (void **) &tmp4, SWIGTYPE_p_switch_input_callback_function_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of fs_switch_ivr_record_file. Expected SWIGTYPE_p_switch_input_callback_function_t");
     }
-    
-    fs_channel_pre_answer(arg1);
-    
-    
+    arg4 = *tmp4;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, 0, 0) < 0) {
+      /* Allow NULL from php for void* */
+      if ((*args[4])->type==IS_NULL) arg5=0;
+      else
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of fs_switch_ivr_record_file. Expected SWIGTYPE_p_p_void");
+    }
+  }
+  {
+    /*@SWIG:CONVERT_INT_IN@*/
+    convert_to_long_ex(args[5]);
+    arg6 = (unsigned int) Z_LVAL_PP(args[5]);
+    /*@SWIG@*/;
+  }
+  result = (int)fs_switch_ivr_record_file(arg1,arg2,arg3,arg4,arg5,arg6);
+  {
+    ZVAL_LONG(return_value,result);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_channel_hangup) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    zval **args[3];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_sleep) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  uint32_t arg2 ;
+  int result;
+  uint32_t *tmp2 ;
+  zval **args[2];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 2) || (zend_get_parameters_array_ex(2, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_switch_ivr_sleep. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 2) || (zend_get_parameters_array_ex(2-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[1], (void **) &tmp2, SWIGTYPE_p_uint32_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of fs_switch_ivr_sleep. Expected SWIGTYPE_p_uint32_t");
     }
-    
-    
-    if(SWIG_ConvertPtr(*((0<argbase)?(&this_ptr):(args[0-argbase])), (void **) &arg1, SWIGTYPE_p_switch_core_session_t) < 0) {
-        zend_error(E_ERROR, "Type error in argument %d of fs_channel_hangup. Expected %s", 1-argbase, SWIGTYPE_p_switch_core_session_t->name);
+    arg2 = *tmp2;
+  }
+  result = (int)fs_switch_ivr_sleep(arg1,arg2);
+  {
+    ZVAL_LONG(return_value,result);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_fs_ivr_play_file2) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  int result;
+  zval **args[2];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 2) || (zend_get_parameters_array_ex(2, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_ivr_play_file2. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    
-    
-    convert_to_string_ex(args[1-argbase]);
-    arg2 = (char *) Z_STRVAL_PP(args[1-argbase]);
-    
-    fs_channel_hangup(arg1,arg2);
-    
-    
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  result = (int)fs_ivr_play_file2(arg1,arg2);
+  {
+    ZVAL_LONG(return_value,result);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_channel_set_variable) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    char *arg3 ;
-    zval **args[4];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_collect_digits_callback) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  switch_input_callback_function_t arg2 ;
+  void *arg3 = (void *) 0 ;
+  unsigned int arg4 ;
+  int result;
+  switch_input_callback_function_t *tmp2 ;
+  zval **args[4];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 4) || (zend_get_parameters_array_ex(4, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_switch_ivr_collect_digits_callback. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 3) || (zend_get_parameters_array_ex(3-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[1], (void **) &tmp2, SWIGTYPE_p_switch_input_callback_function_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of fs_switch_ivr_collect_digits_callback. Expected SWIGTYPE_p_switch_input_callback_function_t");
     }
-    
-    
-    if(SWIG_ConvertPtr(*((0<argbase)?(&this_ptr):(args[0-argbase])), (void **) &arg1, SWIGTYPE_p_switch_core_session_t) < 0) {
-        zend_error(E_ERROR, "Type error in argument %d of fs_channel_set_variable. Expected %s", 1-argbase, SWIGTYPE_p_switch_core_session_t->name);
+    arg2 = *tmp2;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[2], (void **) &arg3, 0, 0) < 0) {
+      /* Allow NULL from php for void* */
+      if ((*args[2])->type==IS_NULL) arg3=0;
+      else
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of fs_switch_ivr_collect_digits_callback. Expected SWIGTYPE_p_p_void");
     }
-    
-    
-    convert_to_string_ex(args[1-argbase]);
-    arg2 = (char *) Z_STRVAL_PP(args[1-argbase]);
-    
-    
-    convert_to_string_ex(args[2-argbase]);
-    arg3 = (char *) Z_STRVAL_PP(args[2-argbase]);
-    
-    fs_channel_set_variable(arg1,arg2,arg3);
-    
-    
+  }
+  {
+    /*@SWIG:CONVERT_INT_IN@*/
+    convert_to_long_ex(args[3]);
+    arg4 = (unsigned int) Z_LVAL_PP(args[3]);
+    /*@SWIG@*/;
+  }
+  result = (int)fs_switch_ivr_collect_digits_callback(arg1,arg2,arg3,arg4);
+  {
+    ZVAL_LONG(return_value,result);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_channel_get_variable) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    zval **args[3];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_collect_digits_count) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  unsigned int arg3 ;
+  unsigned int arg4 ;
+  char *arg5 = (char *) 0 ;
+  char *arg6 = (char *) 0 ;
+  unsigned int arg7 ;
+  int result;
+  zval **args[7];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 7) || (zend_get_parameters_array_ex(7, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_switch_ivr_collect_digits_count. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 2) || (zend_get_parameters_array_ex(2-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
-    }
-    
-    
-    if(SWIG_ConvertPtr(*((0<argbase)?(&this_ptr):(args[0-argbase])), (void **) &arg1, SWIGTYPE_p_switch_core_session_t) < 0) {
-        zend_error(E_ERROR, "Type error in argument %d of fs_channel_get_variable. Expected %s", 1-argbase, SWIGTYPE_p_switch_core_session_t->name);
-    }
-    
-    
-    convert_to_string_ex(args[1-argbase]);
-    arg2 = (char *) Z_STRVAL_PP(args[1-argbase]);
-    
-    fs_channel_get_variable(arg1,arg2);
-    
-    
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_INT_IN@*/
+    convert_to_long_ex(args[2]);
+    arg3 = (unsigned int) Z_LVAL_PP(args[2]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_INT_IN@*/
+    convert_to_long_ex(args[3]);
+    arg4 = (unsigned int) Z_LVAL_PP(args[3]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[4]);
+    arg5 = (char *) Z_STRVAL_PP(args[4]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[5]);
+    arg6 = (char *) Z_STRVAL_PP(args[5]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_INT_IN@*/
+    convert_to_long_ex(args[6]);
+    arg7 = (unsigned int) Z_LVAL_PP(args[6]);
+    /*@SWIG@*/;
+  }
+  result = (int)fs_switch_ivr_collect_digits_count(arg1,arg2,arg3,arg4,(char const *)arg5,arg6,arg7);
+  {
+    ZVAL_LONG(return_value,result);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_channel_set_state) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    zval **args[3];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_originate) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  switch_core_session_t **arg2 = (switch_core_session_t **) 0 ;
+  char *arg3 = (char *) 0 ;
+  uint32_t arg4 ;
+  int result;
+  uint32_t *tmp4 ;
+  zval **args[4];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 4) || (zend_get_parameters_array_ex(4, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_switch_ivr_originate. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 2) || (zend_get_parameters_array_ex(2-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of fs_switch_ivr_originate. Expected SWIGTYPE_p_p_switch_core_session_t");
     }
-    
-    
-    if(SWIG_ConvertPtr(*((0<argbase)?(&this_ptr):(args[0-argbase])), (void **) &arg1, SWIGTYPE_p_switch_core_session_t) < 0) {
-        zend_error(E_ERROR, "Type error in argument %d of fs_channel_set_state. Expected %s", 1-argbase, SWIGTYPE_p_switch_core_session_t->name);
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[2]);
+    arg3 = (char *) Z_STRVAL_PP(args[2]);
+    /*@SWIG@*/;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[3], (void **) &tmp4, SWIGTYPE_p_uint32_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of fs_switch_ivr_originate. Expected SWIGTYPE_p_uint32_t");
     }
-    
-    
-    convert_to_string_ex(args[1-argbase]);
-    arg2 = (char *) Z_STRVAL_PP(args[1-argbase]);
-    
-    fs_channel_set_state(arg1,arg2);
-    
-    
+    arg4 = *tmp4;
+  }
+  result = (int)fs_switch_ivr_originate(arg1,arg2,arg3,arg4);
+  {
+    ZVAL_LONG(return_value,result);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_ivr_play_file) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    char *arg3 ;
-    switch_input_callback_function_t arg4 ;
-    void *arg5 = (void *) 0 ;
-    unsigned int arg6 ;
-    int result;
-    zval **args[7];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_session_transfer) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  int result;
+  zval **args[4];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 4) || (zend_get_parameters_array_ex(4, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_switch_ivr_session_transfer. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 6) || (zend_get_parameters_array_ex(6-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[2]);
+    arg3 = (char *) Z_STRVAL_PP(args[2]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[3]);
+    arg4 = (char *) Z_STRVAL_PP(args[3]);
+    /*@SWIG@*/;
+  }
+  result = (int)fs_switch_ivr_session_transfer(arg1,arg2,arg3,arg4);
+  {
+    ZVAL_LONG(return_value,result);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_ivr_speak_text) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  uint32_t arg5 ;
+  switch_input_callback_function_t arg6 ;
+  char *arg7 = (char *) 0 ;
+  void *arg8 = (void *) 0 ;
+  unsigned int arg9 ;
+  int result;
+  uint32_t *tmp5 ;
+  switch_input_callback_function_t *tmp6 ;
+  zval **args[9];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 9) || (zend_get_parameters_array_ex(9, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_switch_ivr_speak_text. Expected SWIGTYPE_p_switch_core_session_t");
     }
-    
-    
-    if(SWIG_ConvertPtr(*((0<argbase)?(&this_ptr):(args[0-argbase])), (void **) &arg1, SWIGTYPE_p_switch_core_session_t) < 0) {
-        zend_error(E_ERROR, "Type error in argument %d of fs_ivr_play_file. Expected %s", 1-argbase, SWIGTYPE_p_switch_core_session_t->name);
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[2]);
+    arg3 = (char *) Z_STRVAL_PP(args[2]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[3]);
+    arg4 = (char *) Z_STRVAL_PP(args[3]);
+    /*@SWIG@*/;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[4], (void **) &tmp5, SWIGTYPE_p_uint32_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of fs_switch_ivr_speak_text. Expected SWIGTYPE_p_uint32_t");
     }
-    
-    
-    convert_to_string_ex(args[1-argbase]);
-    arg2 = (char *) Z_STRVAL_PP(args[1-argbase]);
-    
-    
-    convert_to_string_ex(args[2-argbase]);
-    arg3 = (char *) Z_STRVAL_PP(args[2-argbase]);
-    
-    {
-        switch_input_callback_function_t * argp;
-        if(SWIG_ConvertPtr(*args[3-argbase], (void **) &argp, SWIGTYPE_p_switch_input_callback_function_t) < 0) {
-            zend_error(E_ERROR, "Type error in argument %d of fs_ivr_play_file. Expected %s", 4-argbase, SWIGTYPE_p_switch_input_callback_function_t->name);
-        }
-        arg4 = *argp;
+    arg5 = *tmp5;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[5], (void **) &tmp6, SWIGTYPE_p_switch_input_callback_function_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of fs_switch_ivr_speak_text. Expected SWIGTYPE_p_switch_input_callback_function_t");
     }
-    
-    if(SWIG_ConvertPtr(*args[4-argbase], (void **) &arg5, 0) < 0) {
-        /* Allow NULL from php for void* */
-        if ((*args[4-argbase])->type==IS_NULL) arg5=0;
-        else zend_error(E_ERROR, "Type error in argument %d of fs_ivr_play_file. Expected %s", 5-argbase, SWIGTYPE_p_void->name);
+    arg6 = *tmp6;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[6]);
+    arg7 = (char *) Z_STRVAL_PP(args[6]);
+    /*@SWIG@*/;
+  }
+  {
+    if(SWIG_ConvertPtr(*args[7], (void **) &arg8, 0, 0) < 0) {
+      /* Allow NULL from php for void* */
+      if ((*args[7])->type==IS_NULL) arg8=0;
+      else
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 8 of fs_switch_ivr_speak_text. Expected SWIGTYPE_p_p_void");
     }
-    
-    
-    convert_to_long_ex(args[5-argbase]);
-    arg6 = (unsigned int) Z_LVAL_PP(args[5-argbase]);
-    
-    result = (int)fs_ivr_play_file(arg1,arg2,arg3,arg4,arg5,arg6);
-    
-    
+  }
+  {
+    /*@SWIG:CONVERT_INT_IN@*/
+    convert_to_long_ex(args[8]);
+    arg9 = (unsigned int) Z_LVAL_PP(args[8]);
+    /*@SWIG@*/;
+  }
+  result = (int)fs_switch_ivr_speak_text(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
+  {
     ZVAL_LONG(return_value,result);
-    
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
-ZEND_NAMED_FUNCTION(_wrap_fs_ivr_play_file2) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    int result;
-    zval **args[3];
-    int argbase=0 ;
-    
-    if (this_ptr && this_ptr->type==IS_OBJECT) {
-        /* fake this_ptr as first arg (till we can work out how to do it better */
-        argbase++;
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_channel_get_variable) {
+  switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *result = 0 ;
+  zval **args[2];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 2) || (zend_get_parameters_array_ex(2, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_channel_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_switch_channel_get_variable. Expected SWIGTYPE_p_switch_channel_t");
     }
-    if(((ZEND_NUM_ARGS() + argbase )!= 2) || (zend_get_parameters_array_ex(2-argbase, args)!= SUCCESS)) {
-        WRONG_PARAM_COUNT;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  result = (char *)fs_switch_channel_get_variable(arg1,arg2);
+  {
+    if(!result) {
+      ZVAL_NULL(return_value);
+    } else {
+      ZVAL_STRING(return_value,result, 1);
     }
-    
-    
-    if(SWIG_ConvertPtr(*((0<argbase)?(&this_ptr):(args[0-argbase])), (void **) &arg1, SWIGTYPE_p_switch_core_session_t) < 0) {
-        zend_error(E_ERROR, "Type error in argument %d of fs_ivr_play_file2. Expected %s", 1-argbase, SWIGTYPE_p_switch_core_session_t->name);
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_fs_switch_channel_set_variable) {
+  switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  int result;
+  zval **args[3];
+  
+  SWIG_ResetError();
+  if(((ZEND_NUM_ARGS() )!= 3) || (zend_get_parameters_array_ex(3, args)!= SUCCESS)) {
+    WRONG_PARAM_COUNT;
+  }
+  
+  {
+    /* typemap(in) SWIGTYPE * */
+    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_switch_channel_t, 0) < 0) {
+      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of fs_switch_channel_set_variable. Expected SWIGTYPE_p_switch_channel_t");
     }
-    
-    
-    convert_to_string_ex(args[1-argbase]);
-    arg2 = (char *) Z_STRVAL_PP(args[1-argbase]);
-    
-    result = (int)fs_ivr_play_file2(arg1,arg2);
-    
-    
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[1]);
+    arg2 = (char *) Z_STRVAL_PP(args[1]);
+    /*@SWIG@*/;
+  }
+  {
+    /*@SWIG:CONVERT_STRING_IN@*/
+    convert_to_string_ex(args[2]);
+    arg3 = (char *) Z_STRVAL_PP(args[2]);
+    /*@SWIG@*/;
+  }
+  result = (int)fs_switch_channel_set_variable(arg1,arg2,arg3);
+  {
     ZVAL_LONG(return_value,result);
-    
+  }
+  return;
+fail:
+  zend_error(ErrorCode(),ErrorMsg());
 }
 
 
 /* NEW Destructor style */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_switch_channel_t) {
+  /* bah! No destructor for this simple type!! */
+}
+/* NEW Destructor style */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_switch_file_handle_t) {
+  /* bah! No destructor for this simple type!! */
+}
+/* NEW Destructor style */
 static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_switch_core_session_t) {
-/* bah! No destructor for this simple type!! */
+  /* bah! No destructor for this simple type!! */
 }
 /* NEW Destructor style */
-static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_void) {
-/* bah! No destructor for this simple type!! */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_p_switch_core_session_t) {
+  /* bah! No destructor for this simple type!! */
 }
 /* NEW Destructor style */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_p_void) {
+  /* bah! No destructor for this simple type!! */
+}
+/* NEW Destructor style */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_uint32_t) {
+  /* bah! No destructor for this simple type!! */
+}
+/* NEW Destructor style */
 static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_switch_input_callback_function_t) {
-/* bah! No destructor for this simple type!! */
+  /* bah! No destructor for this simple type!! */
 }
-
-
-
-
 /* end wrapper section */
 /* init section */
 #ifdef __cplusplus
@@ -1146,23 +2040,238 @@
 }
 #endif
 
-PHP_MSHUTDOWN_FUNCTION(freeswitch)
-{
-    return SUCCESS;
+#define SWIG_php_minit PHP_MINIT_FUNCTION(freeswitch)
+/* -----------------------------------------------------------------------------
+ * 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" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  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 */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+  
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+
+    /* 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 */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+	type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } 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;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+	if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+	  cast->type = ret;
+	  ret = 0;
+	} else {
+	  /* Check for casting already in the list */
+	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+	  if (!ocast) ret = 0;
+	}
+      }
+
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        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;
+
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+  printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
 }
-PHP_MINIT_FUNCTION(freeswitch)
-{
-    int i;
-    for (i = 0; swig_types_initial[i]; i++) {
-        swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
+
+/* 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
+#if 0
+{ /* c-mode */
+#endif
+}
+#endif
+
+
+  SWIG_php_minit {
+    SWIG_InitializeModule(0);
+
 /* oinit subsection */
+ZEND_INIT_MODULE_GLOBALS(freeswitch, freeswitch_init_globals, freeswitch_destroy_globals);
 
 /* Register resource destructors for pointer types */
+le_swig__p_switch_channel_t=zend_register_list_destructors_ex(_wrap_destroy_p_switch_channel_t,NULL,(char *)(SWIGTYPE_p_switch_channel_t->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_switch_channel_t,&le_swig__p_switch_channel_t);
+le_swig__p_switch_file_handle_t=zend_register_list_destructors_ex(_wrap_destroy_p_switch_file_handle_t,NULL,(char *)(SWIGTYPE_p_switch_file_handle_t->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_switch_file_handle_t,&le_swig__p_switch_file_handle_t);
 le_swig__p_switch_core_session_t=zend_register_list_destructors_ex(_wrap_destroy_p_switch_core_session_t,NULL,(char *)(SWIGTYPE_p_switch_core_session_t->name),module_number);
 SWIG_TypeClientData(SWIGTYPE_p_switch_core_session_t,&le_swig__p_switch_core_session_t);
-le_swig__p_void=zend_register_list_destructors_ex(_wrap_destroy_p_void,NULL,(char *)(SWIGTYPE_p_void->name),module_number);
-SWIG_TypeClientData(SWIGTYPE_p_void,&le_swig__p_void);
+le_swig__p_p_switch_core_session_t=zend_register_list_destructors_ex(_wrap_destroy_p_p_switch_core_session_t,NULL,(char *)(SWIGTYPE_p_p_switch_core_session_t->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_p_switch_core_session_t,&le_swig__p_p_switch_core_session_t);
+le_swig__p_p_void=zend_register_list_destructors_ex(_wrap_destroy_p_p_void,NULL,(char *)(SWIGTYPE_p_p_void->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_p_void,&le_swig__p_p_void);
+le_swig__p_uint32_t=zend_register_list_destructors_ex(_wrap_destroy_p_uint32_t,NULL,(char *)(SWIGTYPE_p_uint32_t->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_uint32_t,&le_swig__p_uint32_t);
 le_swig__p_switch_input_callback_function_t=zend_register_list_destructors_ex(_wrap_destroy_p_switch_input_callback_function_t,NULL,(char *)(SWIGTYPE_p_switch_input_callback_function_t->name),module_number);
 SWIG_TypeClientData(SWIGTYPE_p_switch_input_callback_function_t,&le_swig__p_switch_input_callback_function_t);
 CG(active_class_entry) = NULL;
@@ -1172,6 +2281,8 @@
 }
 PHP_RINIT_FUNCTION(freeswitch)
 {
+/* rinit section */
+
 /* cinit subsection */
 /* end cinit subsection */
 
@@ -1180,8 +2291,16 @@
 
     return SUCCESS;
 }
+PHP_MSHUTDOWN_FUNCTION(freeswitch)
+{
+/* shutdown section */
+
+    return SUCCESS;
+}
 PHP_RSHUTDOWN_FUNCTION(freeswitch)
 {
+/* rshutdown section */
+
     return SUCCESS;
 }
 PHP_MINFO_FUNCTION(freeswitch)

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/test.php
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/test.php	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/test.php	Sun Sep 10 23:55:18 2006
@@ -1,10 +1,8 @@
 <?
+include("classFreeswitch.php");
 
-include("freeswitch.php");
+$fs = new fs_class_api;
 
-fs_core_set_globals();
-fs_core_init("");
-fs_loadable_module_init();
-fs_console_loop();
-fs_core_destroy();
-?>
\ No newline at end of file
+$fs->fs_start();
+
+?>

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Sun Sep 10 23:55:18 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/mishehu/src/switch_buffer.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_buffer.c	(original)
+++ freeswitch/branches/mishehu/src/switch_buffer.c	Sun Sep 10 23:55:18 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/mishehu/src/switch_channel.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_channel.c	(original)
+++ freeswitch/branches/mishehu/src/switch_channel.c	Sun Sep 10 23:55:18 2006
@@ -164,7 +164,8 @@
 
 	switch_core_hash_init(&(*channel)->variables, pool);
 	switch_core_hash_init(&(*channel)->private_hash, pool);
-	switch_buffer_create(pool, &(*channel)->dtmf_buffer, 128);
+	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);
@@ -280,6 +281,11 @@
 
 	return bytes;
 
+}
+
+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,

Modified: freeswitch/branches/mishehu/src/switch_core.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_core.c	(original)
+++ freeswitch/branches/mishehu/src/switch_core.c	Sun Sep 10 23:55:18 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];
@@ -89,6 +101,8 @@
 	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;
@@ -137,6 +151,175 @@
 	}
 }
 
+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;
@@ -146,7 +329,10 @@
 	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_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;
@@ -1350,7 +1536,7 @@
 {
 	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;
@@ -1408,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;
 
@@ -1460,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;
@@ -1559,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,
@@ -1572,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);
@@ -1605,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;
@@ -1665,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;
 					}
@@ -1804,6 +2038,11 @@
 			}
 		}
 	} else {
+		do_write = 1;
+	}
+
+ done:
+	if (do_write) {
 		return perform_write(session, frame, timeout, io_flag, stream_id);
 	}
 
@@ -2643,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);
@@ -2870,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/mishehu/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_ivr.c	(original)
+++ freeswitch/branches/mishehu/src/switch_ivr.c	Sun Sep 10 23:55:18 2006
@@ -448,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,
@@ -1630,7 +1762,7 @@
 		read_codec = switch_core_session_get_read_codec(session);
 
 		assert(read_codec != NULL);
-		if (!(pass = switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH))) {
+		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,



More information about the Freeswitch-branches mailing list