[Freeswitch-branches] [commit] r5361 - in freeswitch/branches/greenlizard: . build conf scripts/contrib scripts/contrib/trixter scripts/contrib/trixter/xml-cdr scripts/contrib/trixter/xml-curl scripts/contrib/trixter/xml-curl/templates scripts/contrib/trixter/xml-curl/templates/switch1 scripts/contrib/trixter/xml-rpc scripts/contrib/trixter/xml-rpc/templates_c scripts/contrib/trixter/xml-rpc/themes scripts/contrib/trixter/xml-rpc/themes/default scripts/contrib/trixter/xml-rpc/themes/default/images scripts/contrib/trixter/xml-rpc/themes/es scripts/contrib/trixter/xml-rpc/themes/es/images scripts/socket/socket2me src src/include src/include/private src/mod/applications/mod_bridgecall src/mod/applications/mod_commands src/mod/applications/mod_conference src/mod/applications/mod_dptools src/mod/applications/mod_echo src/mod/applications/mod_enum src/mod/applications/mod_esf src/mod/applications/mod_ivrtest src/mod/applications/mod_park src/mod/applications/mod_playback src/mod/applications/mod_rss src/mod/applications/mod_skel src/mod/applications/mod_soundtouch src/mod/asr_tts/mod_cepstral src/mod/asr_tts/mod_lumenvox src/mod/codecs/mod_amr src/mod/codecs/mod_g711 src/mod/codecs/mod_g722 src/mod/codecs/mod_g723_1 src/mod/codecs/mod_g726 src/mod/codecs/mod_g729 src/mod/codecs/mod_gsm src/mod/codecs/mod_h26x src/mod/codecs/mod_ilbc src/mod/codecs/mod_l16 src/mod/codecs/mod_lpc10 src/mod/codecs/mod_speex src/mod/dialplans/mod_dialplan_directory src/mod/dialplans/mod_dialplan_xml src/mod/directories/mod_ldap src/mod/endpoints/mod_alsa src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_iax src/mod/endpoints/mod_portaudio src/mod/endpoints/mod_sofia src/mod/endpoints/mod_wanpipe src/mod/endpoints/mod_woomera src/mod/event_handlers/mod_cdr src/mod/event_handlers/mod_event_multicast src/mod/event_handlers/mod_event_socket src/mod/event_handlers/mod_event_test src/mod/event_handlers/mod_xmpp_event src/mod/event_handlers/mod_zeroconf src/mod/formats/mod_native_file src/mod/formats/mod_shout src/mod/formats/mod_sndfile src/mod/languages/mod_mono src/mod/languages/mod_perl src/mod/languages/mod_python src/mod/languages/mod_spidermonkey src/mod/loggers/mod_console src/mod/loggers/mod_syslog src/mod/say/mod_say_en src/mod/timers/mod_softtimer src/mod/xml_int/mod_xml_cdr src/mod/xml_int/mod_xml_curl src/mod/xml_int/mod_xml_rpc w32/Setup

Freeswitch SVN greenlizard at freeswitch.org
Thu Jun 14 12:39:07 EDT 2007


Author: greenlizard
Date: Thu Jun 14 12:39:04 2007
New Revision: 5361

Added:
   freeswitch/branches/greenlizard/scripts/contrib/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/Parse_XML_CDR.php
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/Parse_XML_CDR.php
   freeswitch/branches/greenlizard/scripts/contrib/trixter/conf-dtmf.pl   (props changed)
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/conf-dtmf.pl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/faxlib.jm
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/faxlib.jm
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-cdr/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-cdr/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-cdr/Parse_XML_CDR.php
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-cdr/Parse_XML_CDR.php
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-cdr/README
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-cdr/README
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-cdr/cdr.php
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-cdr/cdr.php
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/README
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/README
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/curlrouting.php
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/curlrouting.php
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/switch1/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/switch1/conference.conf.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/conference.conf.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/switch1/fail.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/fail.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/switch1/frompstn.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/frompstn.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/README
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/README
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/fsxmlrpc.inc
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/fsxmlrpc.inc
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/index.php
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/index.php
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/templates_c/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/templates_c/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/channels.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/channels.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/conference.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/conference.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/errors.inc
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/errors.inc
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/errors.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/errors.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/images/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/images/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/images/submit.gif   (props changed)
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/images/submit.gif
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/index.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/index.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/style.css
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/style.css
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/channels.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/channels.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/conference.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/conference.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/errors.inc
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/errors.inc
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/errors.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/errors.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/images/
      - copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/images/
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/images/submit.gif   (props changed)
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/images/submit.gif
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/index.tpl
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/index.tpl
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/style.css
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/style.css
   freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/xmlrpc.inc
      - copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/xmlrpc.inc
   freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/
      - copied from r5360, /freeswitch/trunk/src/mod/applications/mod_soundtouch/
   freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/Makefile
      - copied unchanged from r5360, /freeswitch/trunk/src/mod/applications/mod_soundtouch/Makefile
   freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp
      - copied unchanged from r5360, /freeswitch/trunk/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp
Removed:
   freeswitch/branches/greenlizard/src/mod/applications/mod_bridgecall/
   freeswitch/branches/greenlizard/src/mod/applications/mod_echo/
   freeswitch/branches/greenlizard/src/mod/applications/mod_park/
   freeswitch/branches/greenlizard/src/mod/applications/mod_playback/
Modified:
   freeswitch/branches/greenlizard/Freeswitch.sln
   freeswitch/branches/greenlizard/build/modules.conf.in
   freeswitch/branches/greenlizard/conf/default_context.xml
   freeswitch/branches/greenlizard/conf/modules.conf.xml
   freeswitch/branches/greenlizard/scripts/socket/socket2me/Makefile
   freeswitch/branches/greenlizard/src/include/private/switch_core_pvt.h
   freeswitch/branches/greenlizard/src/include/switch_apr.h
   freeswitch/branches/greenlizard/src/include/switch_core.h
   freeswitch/branches/greenlizard/src/include/switch_core_event_hook.h
   freeswitch/branches/greenlizard/src/include/switch_loadable_module.h
   freeswitch/branches/greenlizard/src/include/switch_module_interfaces.h
   freeswitch/branches/greenlizard/src/include/switch_platform.h
   freeswitch/branches/greenlizard/src/include/switch_types.h
   freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
   freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c
   freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c
   freeswitch/branches/greenlizard/src/mod/applications/mod_ivrtest/mod_ivrtest.c
   freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c
   freeswitch/branches/greenlizard/src/mod/applications/mod_skel/mod_skel.c
   freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
   freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/mod_lumenvox.cpp
   freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_lpc10/mod_lpc10.c
   freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c
   freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
   freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
   freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c
   freeswitch/branches/greenlizard/src/mod/endpoints/mod_alsa/mod_alsa.c
   freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c
   freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c
   freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
   freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h
   freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c
   freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
   freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c
   freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
   freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
   freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
   freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c
   freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
   freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
   freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c
   freeswitch/branches/greenlizard/src/mod/formats/mod_shout/mod_shout.c
   freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c
   freeswitch/branches/greenlizard/src/mod/languages/mod_mono/mod_mono.c
   freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c
   freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
   freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c
   freeswitch/branches/greenlizard/src/mod/loggers/mod_syslog/mod_syslog.c
   freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c
   freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c
   freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
   freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
   freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
   freeswitch/branches/greenlizard/src/switch_channel.c
   freeswitch/branches/greenlizard/src/switch_core_codec.c
   freeswitch/branches/greenlizard/src/switch_core_event_hook.c
   freeswitch/branches/greenlizard/src/switch_core_io.c
   freeswitch/branches/greenlizard/src/switch_core_media_bug.c
   freeswitch/branches/greenlizard/src/switch_ivr.c
   freeswitch/branches/greenlizard/src/switch_ivr_bridge.c
   freeswitch/branches/greenlizard/src/switch_loadable_module.c
   freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj

Log:
merge in trunk changes from revision 5309-5359

Modified: freeswitch/branches/greenlizard/Freeswitch.sln
==============================================================================
--- freeswitch/branches/greenlizard/Freeswitch.sln	(original)
+++ freeswitch/branches/greenlizard/Freeswitch.sln	Thu Jun 14 12:39:04 2007
@@ -44,12 +44,6 @@
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	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
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	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
 		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
@@ -68,12 +62,6 @@
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	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
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	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
 		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
@@ -128,12 +116,6 @@
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	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
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
 Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FreeSwitchSetup", "w32\Setup\Setup.vdproj", "{B17FFBE6-A942-4056-8346-B624FB5D995B}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Directories", "Directories", "{B8F5B47B-8568-46EB-B320-64C17D2A98BC}"
@@ -192,12 +174,6 @@
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 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
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	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}
@@ -367,12 +343,6 @@
 		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_park", "src\mod\applications\mod_park\mod_park.vcproj", "{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.vcproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
 	ProjectSection(ProjectDependencies) = postProject
 		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
@@ -584,6 +554,8 @@
 		configure.in = configure.in
 		Makefile.am = Makefile.am
 		build\modmake.sh = build\modmake.sh
+		build\modules.conf.in = build\modules.conf.in
+		libs\win32\util.vbs = libs\win32\util.vbs
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "m4", "m4", "{CDE9B06A-3C27-4987-8FAE-DF1006BC705D}"
@@ -651,12 +623,6 @@
 		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32
 		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32
 		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.ActiveCfg = Release|Win32
-		{E1794405-29D4-466D-9BE3-DD2344C2A663}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E1794405-29D4-466D-9BE3-DD2344C2A663}.Debug|Win32.Build.0 = Debug|Win32
-		{E1794405-29D4-466D-9BE3-DD2344C2A663}.Debug|x64.ActiveCfg = Debug|Win32
-		{E1794405-29D4-466D-9BE3-DD2344C2A663}.Release|Win32.ActiveCfg = Release|Win32
-		{E1794405-29D4-466D-9BE3-DD2344C2A663}.Release|Win32.Build.0 = Release|Win32
-		{E1794405-29D4-466D-9BE3-DD2344C2A663}.Release|x64.ActiveCfg = Release|Win32
 		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|Win32.ActiveCfg = Debug|Win32
 		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|Win32.Build.0 = Debug|Win32
 		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|x64.ActiveCfg = Debug|Win32
@@ -675,12 +641,6 @@
 		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.ActiveCfg = Release|Win32
 		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.Build.0 = Release|Win32
 		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|x64.ActiveCfg = Release|Win32
-		{78100236-7CEA-4948-96CC-E8ED3160329C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{78100236-7CEA-4948-96CC-E8ED3160329C}.Debug|Win32.Build.0 = Debug|Win32
-		{78100236-7CEA-4948-96CC-E8ED3160329C}.Debug|x64.ActiveCfg = Debug|Win32
-		{78100236-7CEA-4948-96CC-E8ED3160329C}.Release|Win32.ActiveCfg = Release|Win32
-		{78100236-7CEA-4948-96CC-E8ED3160329C}.Release|Win32.Build.0 = Release|Win32
-		{78100236-7CEA-4948-96CC-E8ED3160329C}.Release|x64.ActiveCfg = Release|Win32
 		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.ActiveCfg = Debug|Win32
 		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.Build.0 = Debug|Win32
 		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.ActiveCfg = Debug|Win32
@@ -721,12 +681,6 @@
 		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.ActiveCfg = Release|Win32
 		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.Build.0 = Release|Win32
 		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.ActiveCfg = Release|Win32
-		{419AA391-5F3F-4BFE-A869-9D154D62A792}.Debug|Win32.ActiveCfg = Debug|Win32
-		{419AA391-5F3F-4BFE-A869-9D154D62A792}.Debug|Win32.Build.0 = Debug|Win32
-		{419AA391-5F3F-4BFE-A869-9D154D62A792}.Debug|x64.ActiveCfg = Debug|Win32
-		{419AA391-5F3F-4BFE-A869-9D154D62A792}.Release|Win32.ActiveCfg = Release|Win32
-		{419AA391-5F3F-4BFE-A869-9D154D62A792}.Release|Win32.Build.0 = Release|Win32
-		{419AA391-5F3F-4BFE-A869-9D154D62A792}.Release|x64.ActiveCfg = Release|Win32
 		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|Win32.ActiveCfg = Debug
 		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.ActiveCfg = Debug with MySql
 		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.Build.0 = Debug with MySql
@@ -781,12 +735,6 @@
 		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|Win32
 		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32
 		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|Win32
-		{0E2C6395-13B9-46E5-9264-8859D346018D}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0E2C6395-13B9-46E5-9264-8859D346018D}.Debug|Win32.Build.0 = Debug|Win32
-		{0E2C6395-13B9-46E5-9264-8859D346018D}.Debug|x64.ActiveCfg = Debug|Win32
-		{0E2C6395-13B9-46E5-9264-8859D346018D}.Release|Win32.ActiveCfg = Release|Win32
-		{0E2C6395-13B9-46E5-9264-8859D346018D}.Release|Win32.Build.0 = Release|Win32
-		{0E2C6395-13B9-46E5-9264-8859D346018D}.Release|x64.ActiveCfg = Release|Win32
 		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32
 		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32
 		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|Win32
@@ -1015,12 +963,6 @@
 		{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.ActiveCfg = Release|Win32
 		{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.Build.0 = Release|Win32
 		{D42518CC-7475-454D-B392-0E132C07D761}.Release|x64.ActiveCfg = Release|Win32
-		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Debug|Win32.Build.0 = Debug|Win32
-		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Debug|x64.ActiveCfg = Debug|Win32
-		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|Win32.ActiveCfg = Release|Win32
-		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|Win32.Build.0 = Release|Win32
-		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|x64.ActiveCfg = Release|Win32
 		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32
 		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32
 		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.ActiveCfg = Debug|Win32
@@ -1165,15 +1107,10 @@
 		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
 		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
 		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{78100236-7CEA-4948-96CC-E8ED3160329C} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{E1794405-29D4-466D-9BE3-DD2344C2A663} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{419AA391-5F3F-4BFE-A869-9D154D62A792} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{0E2C6395-13B9-46E5-9264-8859D346018D} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{71A967D5-0E99-4CEF-A587-98836EE6F2EF} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{3850D93A-5F24-4922-BC1C-74D08C37C256} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}

Modified: freeswitch/branches/greenlizard/build/modules.conf.in
==============================================================================
--- freeswitch/branches/greenlizard/build/modules.conf.in	(original)
+++ freeswitch/branches/greenlizard/build/modules.conf.in	Thu Jun 14 12:39:04 2007
@@ -1,16 +1,12 @@
 loggers/mod_console
 loggers/mod_syslog
-applications/mod_bridgecall
 applications/mod_commands
 applications/mod_conference
 applications/mod_dptools
-applications/mod_echo
 applications/mod_enum
 #applications/mod_ivrtest
-#applications/mod_park
-applications/mod_playback
+#applications/mod_soundtouch
 #applications/mod_rss
-#applications/mod_skel
 #asr_tts/mod_cepstral
 #codecs/mod_amr
 codecs/mod_g711

Modified: freeswitch/branches/greenlizard/conf/default_context.xml
==============================================================================
--- freeswitch/branches/greenlizard/conf/default_context.xml	(original)
+++ freeswitch/branches/greenlizard/conf/default_context.xml	Thu Jun 14 12:39:04 2007
@@ -19,6 +19,24 @@
     </condition>
   </extension>
 
+  <extension name="9193">
+    <condition field="destination_number" expression="^9193$">
+      <action application="set" data="bridge_pre_execute_bleg_app=soundtouch"/>
+      <!-- send or recv indicates which direction the dtmf is parsed from 
+	   since this example is send and it's being called on the b leg
+	   the application will intercept the dtmf from being sent to the b leg 
+	   a.k.a. by the dtmf of the A leg.
+	   if it were 'recv' then it would be parsed when the dtmf was 
+	   received *from* the b leg so it could control itself.
+	   The optional keywords "read" and "write" will also change the stream replaced
+      -->
+      <action application="set" data="bridge_pre_execute_bleg_data=send -4s"/>
+      <action application="bridge" data="sofia/$${domain}/foo"/>
+    </condition>
+  </extension>
+
+
+
   <extension name="9192">
     <condition field="destination_number" expression="^9192$">
       <!-- Maintain Buffer of 128k of audio (default is 64k) -->

Modified: freeswitch/branches/greenlizard/conf/modules.conf.xml
==============================================================================
--- freeswitch/branches/greenlizard/conf/modules.conf.xml	(original)
+++ freeswitch/branches/greenlizard/conf/modules.conf.xml	Thu Jun 14 12:39:04 2007
@@ -33,13 +33,9 @@
     <!-- <load module="mod_woomera"/> -->
 
     <!-- Applications -->
-    <load module="mod_bridgecall"/>
     <load module="mod_commands"/>
     <load module="mod_conference"/>
     <load module="mod_dptools"/>
-    <load module="mod_echo"/>
-    <!--<load module="mod_park"/>-->
-    <load module="mod_playback"/>
 
     <!-- Dialplan Interfaces -->
     <!-- <load module="mod_dialplan_directory"/> -->

Modified: freeswitch/branches/greenlizard/scripts/socket/socket2me/Makefile
==============================================================================
--- freeswitch/branches/greenlizard/scripts/socket/socket2me/Makefile	(original)
+++ freeswitch/branches/greenlizard/scripts/socket/socket2me/Makefile	Thu Jun 14 12:39:04 2007
@@ -1,4 +1,5 @@
+all: socket2me
 socket2me: socket2me.c
-	$(CC) -Wall socket2me.c -o socket2me -l spandsp
+	$(CC) $(CFLAGS) socket2me.c -o socket2me -l spandsp
 clean:
 	rm socket2me

Modified: freeswitch/branches/greenlizard/src/include/private/switch_core_pvt.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/private/switch_core_pvt.h	(original)
+++ freeswitch/branches/greenlizard/src/include/private/switch_core_pvt.h	Thu Jun 14 12:39:04 2007
@@ -127,8 +127,10 @@
 struct switch_media_bug {
 	switch_buffer_t *raw_write_buffer;
 	switch_buffer_t *raw_read_buffer;
-	switch_frame_t *replace_frame_in;
-	switch_frame_t *replace_frame_out;
+	switch_frame_t *read_replace_frame_in;
+	switch_frame_t *read_replace_frame_out;
+	switch_frame_t *write_replace_frame_in;
+	switch_frame_t *write_replace_frame_out;
 	switch_media_bug_callback_t callback;
 	switch_mutex_t *read_mutex;
 	switch_mutex_t *write_mutex;

Modified: freeswitch/branches/greenlizard/src/include/switch_apr.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_apr.h	(original)
+++ freeswitch/branches/greenlizard/src/include/switch_apr.h	Thu Jun 14 12:39:04 2007
@@ -55,7 +55,7 @@
  * @{
  */
 /** The fundamental pool type */
-	typedef struct apr_pool_t switch_memory_pool_t;
+/* see switch types.h 	typedef struct apr_pool_t switch_memory_pool_t;*/
 
 
 /**

Modified: freeswitch/branches/greenlizard/src/include/switch_core.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_core.h	(original)
+++ freeswitch/branches/greenlizard/src/include/switch_core.h	Thu Jun 14 12:39:04 2007
@@ -142,14 +142,27 @@
   \brief Obtain a replace frame from a media bug
   \param bug the bug to get the data from
 */
-SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_replace_frame(switch_media_bug_t *bug);
+SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_write_replace_frame(switch_media_bug_t *bug);
 
 /*!
   \brief Set a return replace frame
   \param bug the bug to set the frame on
   \param frame the frame to set
 */
-SWITCH_DECLARE(void) switch_core_media_bug_set_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame);
+SWITCH_DECLARE(void) switch_core_media_bug_set_write_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame);
+
+/*!
+  \brief Obtain a replace frame from a media bug
+  \param bug the bug to get the data from
+*/
+SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_read_replace_frame(switch_media_bug_t *bug);
+
+/*!
+  \brief Set a return replace frame
+  \param bug the bug to set the frame on
+  \param frame the frame to set
+*/
+SWITCH_DECLARE(void) switch_core_media_bug_set_read_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame);
 
 /*!
   \brief Remove a media bug from the session
@@ -789,7 +802,15 @@
   \param dtmf string to send to the session
   \return SWITCH_STATUS_SUCCESS if the dtmf was written
 */
-SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_session_t *session, char *dtmf);
+SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_session_t *session, const char *dtmf);
+
+/*! 
+  \brief RECV DTMF on a session
+  \param session session to recv DTMF from
+  \param dtmf string to recv from the session
+  \return SWITCH_STATUS_SUCCESS if the dtmf is ok to queue
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_session_t *session, const char *dtmf);
 
 ///\}
 
@@ -1440,6 +1461,10 @@
   \return TRUE or FALSE
 */
 SWITCH_DECLARE(uint8_t) switch_core_session_compare(switch_core_session_t *a, switch_core_session_t *b);
+
+
+SWITCH_DECLARE(switch_loadable_module_interface_t *) switch_loadable_module_create_module_interface(switch_memory_pool_t *pool, const char *name);
+SWITCH_DECLARE(void *) switch_loadable_module_create_interface(switch_loadable_module_interface_t *mod, switch_module_interface_name_t iname);
 ///\}
 
 /*!

Modified: freeswitch/branches/greenlizard/src/include/switch_core_event_hook.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_core_event_hook.h	(original)
+++ freeswitch/branches/greenlizard/src/include/switch_core_event_hook.h	Thu Jun 14 12:39:04 2007
@@ -32,7 +32,8 @@
 #define SWITCH_EVENT_HOOKS_H
 
 #include <switch.h>
-SWITCH_BEGIN_EXTERN_C typedef struct switch_io_event_hooks switch_io_event_hooks_t;
+SWITCH_BEGIN_EXTERN_C 
+typedef struct switch_io_event_hooks switch_io_event_hooks_t;
 
 typedef struct switch_io_event_hook_outgoing_channel switch_io_event_hook_outgoing_channel_t;
 typedef struct switch_io_event_hook_receive_message switch_io_event_hook_receive_message_t;
@@ -45,9 +46,8 @@
 typedef struct switch_io_event_hook_waitfor_read switch_io_event_hook_waitfor_read_t;
 typedef struct switch_io_event_hook_waitfor_write switch_io_event_hook_waitfor_write_t;
 typedef struct switch_io_event_hook_send_dtmf switch_io_event_hook_send_dtmf_t;
+typedef struct switch_io_event_hook_recv_dtmf switch_io_event_hook_recv_dtmf_t;
 typedef struct switch_io_event_hook_state_change switch_io_event_hook_state_change_t;
-
-
 typedef switch_status_t (*switch_outgoing_channel_hook_t) (switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t *);
 typedef switch_status_t (*switch_receive_message_hook_t) (switch_core_session_t *, switch_core_session_message_t *);
 typedef switch_status_t (*switch_receive_event_hook_t) (switch_core_session_t *, switch_event_t *);
@@ -58,24 +58,24 @@
 typedef switch_status_t (*switch_kill_channel_hook_t) (switch_core_session_t *, int);
 typedef switch_status_t (*switch_waitfor_read_hook_t) (switch_core_session_t *, int, int);
 typedef switch_status_t (*switch_waitfor_write_hook_t) (switch_core_session_t *, int, int);
-typedef switch_status_t (*switch_send_dtmf_hook_t) (switch_core_session_t *, char *);
+typedef switch_status_t (*switch_send_dtmf_hook_t) (switch_core_session_t *, const char *);
+typedef switch_status_t (*switch_recv_dtmf_hook_t) (switch_core_session_t *, const char *);
 typedef switch_status_t (*switch_state_change_hook_t) (switch_core_session_t *);
 
 
-/*! \brief Node in which to store custom outgoing channel callback hooks */
+/*! \brief Node in which to store custom receive message callback hooks */
 struct switch_io_event_hook_outgoing_channel {
-	/*! the outgoing channel callback hook */
 	switch_outgoing_channel_hook_t outgoing_channel;
 	struct switch_io_event_hook_outgoing_channel *next;
 };
 
 /*! \brief Node in which to store custom receive message callback hooks */
 struct switch_io_event_hook_receive_message {
-	/*! the message callback hook */
 	switch_receive_message_hook_t receive_message;
 	struct switch_io_event_hook_receive_message *next;
 };
 
+
 /*! \brief Node in which to store custom receive message callback hooks */
 struct switch_io_event_hook_receive_event {
 	/*! the event callback hook */
@@ -139,9 +139,16 @@
 	struct switch_io_event_hook_send_dtmf *next;
 };
 
+/*! \brief Node in which to store custom recv dtmf channel callback hooks */
+struct switch_io_event_hook_recv_dtmf {
+	/*! the recv dtmf channel callback hook */
+	switch_recv_dtmf_hook_t recv_dtmf;
+	struct switch_io_event_hook_recv_dtmf *next;
+};
+
 /*! \brief Node in which to store state change callback hooks */
 struct switch_io_event_hook_state_change {
-	/*! the send dtmf channel callback hook */
+	/*! the state change channel callback hook */
 	switch_state_change_hook_t state_change;
 	struct switch_io_event_hook_state_change *next;
 };
@@ -170,106 +177,82 @@
 	switch_io_event_hook_waitfor_write_t *waitfor_write;
 	/*! a list of send dtmf hooks */
 	switch_io_event_hook_send_dtmf_t *send_dtmf;
+	/*! a list of recv dtmf hooks */
+	switch_io_event_hook_recv_dtmf_t *recv_dtmf;
 	/*! a list of state change hooks */
 	switch_io_event_hook_state_change_t *state_change;
 };
 
 extern switch_io_event_hooks_t switch_core_session_get_event_hooks(switch_core_session_t *session);
 
+#define NEW_HOOK_DECL_ADD_P(_NAME) SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_##_NAME \
+															   (switch_core_session_t *session, switch_##_NAME##_hook_t _NAME)
 
+#define NEW_HOOK_DECL_REM_P(_NAME) SWITCH_DECLARE(switch_status_t) switch_core_event_hook_remove_##_NAME \
+																   (switch_core_session_t *session, switch_##_NAME##_hook_t _NAME)
 
-///\defgroup shooks Session Hook Callbacks
-///\ingroup core1
-///\{
-
-/*! 
-  \brief Add an event hook to be executed when a session requests an outgoing extension
-  \param session session to bind hook to
-  \param outgoing_channel hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_outgoing_channel(switch_core_session_t *session,
-																			switch_outgoing_channel_hook_t outgoing_channel);
-
-/*! 
-  \brief Add an event hook to be executed when a session sends a message
-  \param session session to bind hook to
-  \param receive_message hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_receive_message(switch_core_session_t *session, switch_receive_message_hook_t receive_message);
-
-/*! 
-  \brief Add an event hook to be executed when a session reads a frame
-  \param session session to bind hook to
-  \param  read_frame hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_read_frame(switch_core_session_t *session, switch_read_frame_hook_t read_frame);
-
-/*! 
-  \brief Add an event hook to be executed when a session reads a frame
-  \param session session to bind hook to
-  \param  video_read_frame hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_video_read_frame(switch_core_session_t *session, switch_read_frame_hook_t video_read_frame);
-
-/*! 
-  \brief Add an event hook to be executed when a session writes a frame
-  \param session session to bind hook to
-  \param write_frame hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_write_frame(switch_core_session_t *session, switch_write_frame_hook_t write_frame);
-
-/*! 
-  \brief Add an event hook to be executed when a session writes a video frame
-  \param session session to bind hook to
-  \param video_write_frame hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_video_write_frame(switch_core_session_t *session, switch_video_write_frame_hook_t video_write_frame);
-
-/*! 
-  \brief Add an event hook to be executed when a session kills a channel
-  \param session session to bind hook to
-  \param kill_channel hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_kill_channel(switch_core_session_t *session, switch_kill_channel_hook_t kill_channel);
-
-/*! 
-  \brief Add an event hook to be executed when a session waits for a read event
-  \param session session to bind hook to
-  \param waitfor_read hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_waitfor_read(switch_core_session_t *session, switch_waitfor_read_hook_t waitfor_read);
-
-/*! 
-  \brief Add an event hook to be executed when a session waits for a write event
-  \param session session to bind hook to
-  \param waitfor_write hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_waitfor_write(switch_core_session_t *session, switch_waitfor_write_hook_t waitfor_write);
-
-/*! 
-  \brief Add an event hook to be executed when a session sends dtmf
-  \param session session to bind hook to
-  \param send_dtmf hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_send_dtmf(switch_core_session_t *session, switch_send_dtmf_hook_t send_dtmf);
-
-/*! 
-  \brief Add an event hook to be executed when a session receives a state change signal
-  \param session session to bind hook to
-  \param state_change hook to bind
-  \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_state_change(switch_core_session_t *session, switch_state_change_hook_t state_change);
+#define NEW_HOOK_DECL(_NAME) NEW_HOOK_DECL_ADD_P(_NAME)					\
+	{																	\
+		switch_io_event_hook_##_NAME##_t *hook, *ptr;					\
+		assert(_NAME != NULL);											\
+		if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) { \
+			hook->_NAME = _NAME ;										\
+			if (! session->event_hooks._NAME ) {						\
+				session->event_hooks._NAME = hook;						\
+			} else {													\
+				for (ptr = session->event_hooks._NAME; ptr && ptr->next; ptr = ptr->next); \
+				ptr->next = hook;										\
+			}															\
+			return SWITCH_STATUS_SUCCESS;								\
+		}																\
+		return SWITCH_STATUS_MEMERR;									\
+	}																	\
+	NEW_HOOK_DECL_REM_P(_NAME)											\
+	{																	\
+		switch_io_event_hook_##_NAME##_t *ptr, *last = NULL;			\
+		assert(_NAME != NULL);											\
+		for (ptr = session->event_hooks._NAME; ptr; ptr = ptr->next) {	\
+			if (ptr->_NAME == _NAME) {									\
+				if (last) {												\
+					last->next = ptr->next;								\
+				} else {												\
+					session->event_hooks._NAME = ptr->next;				\
+				}														\
+				return SWITCH_STATUS_SUCCESS;							\
+			}															\
+			last = ptr;													\
+		}																\
+		return SWITCH_STATUS_FALSE;										\
+	}																	
+
+
+NEW_HOOK_DECL_ADD_P(outgoing_channel);
+NEW_HOOK_DECL_ADD_P(receive_message);
+NEW_HOOK_DECL_ADD_P(receive_event);
+NEW_HOOK_DECL_ADD_P(state_change);
+NEW_HOOK_DECL_ADD_P(read_frame);
+NEW_HOOK_DECL_ADD_P(write_frame);
+NEW_HOOK_DECL_ADD_P(video_read_frame);
+NEW_HOOK_DECL_ADD_P(video_write_frame);
+NEW_HOOK_DECL_ADD_P(kill_channel);
+NEW_HOOK_DECL_ADD_P(waitfor_read);
+NEW_HOOK_DECL_ADD_P(waitfor_write);
+NEW_HOOK_DECL_ADD_P(send_dtmf);
+NEW_HOOK_DECL_ADD_P(recv_dtmf);
+
+NEW_HOOK_DECL_REM_P(outgoing_channel);
+NEW_HOOK_DECL_REM_P(receive_message);
+NEW_HOOK_DECL_REM_P(receive_event);
+NEW_HOOK_DECL_REM_P(state_change);
+NEW_HOOK_DECL_REM_P(read_frame);
+NEW_HOOK_DECL_REM_P(write_frame);
+NEW_HOOK_DECL_REM_P(video_read_frame);
+NEW_HOOK_DECL_REM_P(video_write_frame);
+NEW_HOOK_DECL_REM_P(kill_channel);
+NEW_HOOK_DECL_REM_P(waitfor_read);
+NEW_HOOK_DECL_REM_P(waitfor_write);
+NEW_HOOK_DECL_REM_P(send_dtmf);
+NEW_HOOK_DECL_REM_P(recv_dtmf);
 ///\}
 
 SWITCH_END_EXTERN_C

Modified: freeswitch/branches/greenlizard/src/include/switch_loadable_module.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_loadable_module.h	(original)
+++ freeswitch/branches/greenlizard/src/include/switch_loadable_module.h	Thu Jun 14 12:39:04 2007
@@ -54,31 +54,32 @@
 	/*! the name of the module */
 	const char *module_name;
 	/*! the table of endpoints the module has implmented */
-	const switch_endpoint_interface_t *endpoint_interface;
+	switch_endpoint_interface_t *endpoint_interface;
 	/*! the table of timers the module has implmented */
-	const switch_timer_interface_t *timer_interface;
+	switch_timer_interface_t *timer_interface;
 	/*! the table of dialplans the module has implmented */
-	const switch_dialplan_interface_t *dialplan_interface;
+	switch_dialplan_interface_t *dialplan_interface;
 	/*! the table of codecs the module has implmented */
-	const switch_codec_interface_t *codec_interface;
+	switch_codec_interface_t *codec_interface;
 	/*! the table of applications the module has implmented */
-	const switch_application_interface_t *application_interface;
+	switch_application_interface_t *application_interface;
 	/*! the table of api functions the module has implmented */
-	const switch_api_interface_t *api_interface;
+	switch_api_interface_t *api_interface;
 	/*! the table of file formats the module has implmented */
-	const switch_file_interface_t *file_interface;
+	switch_file_interface_t *file_interface;
 	/*! the table of speech interfaces the module has implmented */
-	const switch_speech_interface_t *speech_interface;
+	switch_speech_interface_t *speech_interface;
 	/*! the table of directory interfaces the module has implmented */
-	const switch_directory_interface_t *directory_interface;
+	switch_directory_interface_t *directory_interface;
 	/*! the table of chat interfaces the module has implmented */
-	const switch_chat_interface_t *chat_interface;
+	switch_chat_interface_t *chat_interface;
 	/*! the table of say interfaces the module has implmented */
-	const switch_say_interface_t *say_interface;
+	switch_say_interface_t *say_interface;
 	/*! the table of asr interfaces the module has implmented */
-	const switch_asr_interface_t *asr_interface;
+	switch_asr_interface_t *asr_interface;
 	/*! the table of management interfaces the module has implmented */
-	const switch_management_interface_t *management_interface;
+	switch_management_interface_t *management_interface;
+	switch_memory_pool_t *pool;
 };
 
 /*!

Modified: freeswitch/branches/greenlizard/src/include/switch_module_interfaces.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_module_interfaces.h	(original)
+++ freeswitch/branches/greenlizard/src/include/switch_module_interfaces.h	Thu Jun 14 12:39:04 2007
@@ -44,7 +44,19 @@
 SWITCH_BEGIN_EXTERN_C
 /*! \brief A table of functions to execute at various states 
 */
-	struct switch_state_handler_table {
+
+typedef enum {
+	SWITCH_SHN_ON_INIT,
+	SWITCH_SHN_ON_RING,
+	SWITCH_SHN_ON_EXECUTE,
+	SWITCH_SHN_ON_HANGUP,
+	SWITCH_SHN_ON_LOOPBACK,
+	SWITCH_SHN_ON_TRANSMIT,
+	SWITCH_SHN_ON_HOLD,
+	SWITCH_SHN_ON_HIBERNATE
+} switch_state_handler_name_t;
+
+struct switch_state_handler_table {
 	/*! executed when the state changes to init */
 	switch_state_handler_t on_init;
 	/*! executed when the state changes to ring */
@@ -61,6 +73,7 @@
 	switch_state_handler_t on_hold;
 	/*! executed when the state changes to hibernate */
 	switch_state_handler_t on_hibernate;
+	void *padding[10];
 };
 
 struct switch_stream_handle {
@@ -77,32 +90,62 @@
 struct switch_io_event_hooks;
 
 
+typedef switch_call_cause_t 
+(*switch_io_outgoing_channel_t)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
+typedef switch_status_t (*switch_io_read_frame_t) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
+typedef switch_status_t (*switch_io_write_frame_t) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
+typedef switch_status_t (*switch_io_kill_channel_t) (switch_core_session_t *, int);
+typedef switch_status_t (*switch_io_waitfor_read_t) (switch_core_session_t *, int, int);
+typedef switch_status_t (*switch_io_waitfor_write_t) (switch_core_session_t *, int, int);
+typedef switch_status_t (*switch_io_send_dtmf_t) (switch_core_session_t *, char *);
+typedef switch_status_t (*switch_io_receive_message_t) (switch_core_session_t *, switch_core_session_message_t *);
+typedef switch_status_t (*switch_io_receive_event_t) (switch_core_session_t *, switch_event_t *);
+typedef switch_status_t (*switch_io_state_change_t) (switch_core_session_t *);
+typedef	switch_status_t (*switch_io_read_video_frame_t) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
+typedef switch_status_t (*switch_io_write_video_frame_t) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
+
+typedef enum {
+	SWITCH_IO_OUTGOING_CHANNEL,
+	SWITCH_IO_READ_FRAME,
+	SWITCH_IO_WRITE_FRAME,
+	SWITCH_IO_KILL_CHANNEL,
+	SWITCH_IO_WAITFOR_READ,
+	SWITCH_IO_WAITFOR_WRITE,
+	SWITCH_IO_SEND_DTMF,
+	SWITCH_IO_RECEIVE_MESSAGE,
+	SWITCH_IO_RECEIVE_EVENT,
+	SWITCH_IO_STATE_CHANGE,
+	SWITCH_IO_READ_VIDEO_FRAME,
+	SWITCH_IO_WRITE_VIDEO_FRAME
+} switch_io_routine_name_t;
+
 /*! \brief A table of i/o routines that an endpoint interface can implement */
 struct switch_io_routines {
 	/*! creates an outgoing session from given session, caller profile */
-	switch_call_cause_t (*outgoing_channel) (switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
+	switch_io_outgoing_channel_t outgoing_channel;
 	/*! read a frame from a session */
-	switch_status_t (*read_frame) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
+	switch_io_read_frame_t read_frame;
 	/*! write a frame to a session */
-	switch_status_t (*write_frame) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
+	switch_io_write_frame_t write_frame;
 	/*! send a kill signal to the session's channel */
-	switch_status_t (*kill_channel) (switch_core_session_t *, int);
+	switch_io_kill_channel_t kill_channel;
 	/*! wait for the session's channel to be ready to read audio */
-	switch_status_t (*waitfor_read) (switch_core_session_t *, int, int);
+	switch_io_waitfor_read_t waitfor_read;
 	/*! wait for the session's channel to be ready to write audio */
-	switch_status_t (*waitfor_write) (switch_core_session_t *, int, int);
+	switch_io_waitfor_write_t waitfor_write;
 	/*! send a string of DTMF digits to a session's channel */
-	switch_status_t (*send_dtmf) (switch_core_session_t *, char *);
+	switch_io_send_dtmf_t send_dtmf;
 	/*! receive a message from another session */
-	switch_status_t (*receive_message) (switch_core_session_t *, switch_core_session_message_t *);
+	switch_io_receive_message_t receive_message;
 	/*! queue a message for another session */
-	switch_status_t (*receive_event) (switch_core_session_t *, switch_event_t *);
+	switch_io_receive_event_t receive_event;
 	/*! change a sessions channel state */
-	switch_status_t (*state_change) (switch_core_session_t *);
+	switch_io_state_change_t state_change;
 	/*! read a video frame from a session */
-	switch_status_t (*read_video_frame) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
+	switch_io_read_video_frame_t read_video_frame;
 	/*! write a video frame to a session */
-	switch_status_t (*write_video_frame) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
+	switch_io_write_video_frame_t write_video_frame;
+	void *padding[10];
 };
 
 /*! \brief Abstraction of an module endpoint interface
@@ -116,16 +159,16 @@
 	const char *interface_name;
 
 	/*! channel abstraction methods */
-	const switch_io_routines_t *io_routines;
+	switch_io_routines_t *io_routines;
 
 	/*! state machine methods */
-	const switch_state_handler_table_t *state_handler;
+	switch_state_handler_table_t *state_handler;
 
 	/*! private information */
 	void *private_info;
 
 	/* to facilitate linking */
-	const struct switch_endpoint_interface *next;
+	struct switch_endpoint_interface *next;
 };
 
 /*! \brief Abstract handler to a timer module */
@@ -146,6 +189,14 @@
 	void *private_info;
 };
 
+typedef enum {
+	SWITCH_TIMER_FUNC_TIMER_INIT,
+	SWITCH_TIMER_FUNC_TIMER_NEXT,
+	SWITCH_TIMER_FUNC_TIMER_STEP,
+	SWITCH_TIMER_FUNC_TIMER_CHECK,
+	SWITCH_TIMER_FUNC_TIMER_DESTROY
+} switch_timer_func_name_t;
+
 /*! \brief A table of functions that a timer module implements */
 struct switch_timer_interface {
 	/*! the name of the interface */
@@ -160,7 +211,7 @@
 	switch_status_t (*timer_check) (switch_timer_t *);
 	/*! function to deallocate the timer */
 	switch_status_t (*timer_destroy) (switch_timer_t *);
-	const struct switch_timer_interface *next;
+	struct switch_timer_interface *next;
 };
 
 /*! \brief Abstract interface to a dialplan module */
@@ -169,7 +220,7 @@
 	const char *interface_name;
 	/*! the function to read an extension and set a channels dialpan */
 	switch_dialplan_hunt_function_t hunt_function;
-	const struct switch_dialplan_interface *next;
+	struct switch_dialplan_interface *next;
 };
 
 /*! \brief Abstract interface to a file format module */
@@ -192,7 +243,7 @@
 	switch_status_t (*file_get_string) (switch_file_handle_t *fh, switch_audio_col_t col, const char **string);
 	/*! list of supported file extensions */
 	char **extens;
-	const struct switch_file_interface *next;
+	struct switch_file_interface *next;
 };
 
 /*! an abstract representation of a file handle (some parameters based on compat with libsndfile) */
@@ -254,7 +305,7 @@
 	switch_status_t (*asr_check_results) (switch_asr_handle_t *ah, switch_asr_flag_t *flags);
 	/*! function to read results from the ASR */
 	switch_status_t (*asr_get_results) (switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags);
-	const struct switch_asr_interface *next;
+	struct switch_asr_interface *next;
 };
 
 /*! an abstract representation of an asr speech interface. */
@@ -293,7 +344,7 @@
 	void (*speech_numeric_param_tts) (switch_speech_handle_t *sh, char *param, int val);
 	void (*speech_float_param_tts) (switch_speech_handle_t *sh, char *param, double val);
 
-	const struct switch_speech_interface *next;
+	struct switch_speech_interface *next;
 };
 
 
@@ -322,7 +373,7 @@
 	const char *interface_name;
 	/*! function to pass down to the module */
 	switch_say_callback_t say_function;
-	const struct switch_say_interface *next;
+	struct switch_say_interface *next;
 };
 
 /*! \brief Abstract interface to a chat module */
@@ -331,7 +382,7 @@
 	const char *interface_name;
 	/*! function to open the directory interface */
 	switch_status_t (*chat_send) (char *proto, char *from, char *to, char *subject, char *body, char *hint);
-	const struct switch_chat_interface *next;
+	struct switch_chat_interface *next;
 };
 
 /*! \brief Abstract interface to a management module */
@@ -340,7 +391,7 @@
 	const char *relative_oid;
 	/*! function to open the directory interface */
 	switch_status_t (*management_function) (char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen);
-	const struct switch_management_interface *next;
+	struct switch_management_interface *next;
 };
 
 /*! \brief Abstract interface to a directory module */
@@ -358,7 +409,7 @@
 	/*! function to advance to the next name/value pair in the current record */
 	switch_status_t (*directory_next_pair) (switch_directory_handle_t *dh, char **var, char **val);
 
-	const struct switch_directory_interface *next;
+	struct switch_directory_interface *next;
 };
 
 /*! an abstract representation of a directory interface. */
@@ -476,7 +527,7 @@
 							   uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag);
 	/*! deinitalize a codec handle using this implementation */
 	switch_status_t (*destroy) (switch_codec_t *);
-	const struct switch_codec_implementation *next;
+	struct switch_codec_implementation *next;
 };
 
 /*! \brief Top level module interface to implement a series of codec implementations */
@@ -484,8 +535,8 @@
 	/*! the name of the interface */
 	const char *interface_name;
 	/*! a list of codec implementations related to the codec */
-	const switch_codec_implementation_t *implementations;
-	const struct switch_codec_interface *next;
+	switch_codec_implementation_t *implementations;
+	struct switch_codec_interface *next;
 };
 
 /*! \brief A module interface to implement an application */
@@ -502,7 +553,7 @@
 	const char *syntax;
 	/*! flags to control behaviour */
 	uint32_t flags;
-	const struct switch_application_interface *next;
+	struct switch_application_interface *next;
 };
 
 /*! \brief A module interface to implement an api function */
@@ -515,7 +566,7 @@
 	switch_api_function_t function;
 	/*! an example of the api syntax */
 	const char *syntax;
-	const struct switch_api_interface *next;
+	struct switch_api_interface *next;
 };
 
 SWITCH_END_EXTERN_C

Modified: freeswitch/branches/greenlizard/src/include/switch_platform.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_platform.h	(original)
+++ freeswitch/branches/greenlizard/src/include/switch_platform.h	Thu Jun 14 12:39:04 2007
@@ -146,10 +146,13 @@
 #endif
 #if defined(SWITCH_MOD_DECLARE_STATIC)
 #define SWITCH_MOD_DECLARE(type)		type __cdecl
+#define SWITCH_MOD_DECLARE_DATA
 #elif defined(MOD_EXPORTS)
 #define SWITCH_MOD_DECLARE(type)		__declspec(dllexport) type __cdecl
+#define SWITCH_MOD_DECLARE_DATA			__declspec(dllexport)
 #else
 #define SWITCH_MOD_DECLARE(type)		__declspec(dllimport) type __cdecl
+#define SWITCH_MOD_DECLARE_DATA			__declspec(dllimport)
 #endif
 #define SIGHUP SIGTERM
 #ifndef S_IRUSR
@@ -164,6 +167,7 @@
 #define SWITCH_DECLARE_NONSTD(type) type
 #define SWITCH_MOD_DECLARE(type) type
 #define SWITCH_DECLARE_DATA
+#define SWITCH_MOD_DECLARE_DATA
 #define SWITCH_THREAD_FUNC
 #endif
 #ifdef DOXYGEN

Modified: freeswitch/branches/greenlizard/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_types.h	(original)
+++ freeswitch/branches/greenlizard/src/include/switch_types.h	Thu Jun 14 12:39:04 2007
@@ -125,6 +125,22 @@
 
 
 typedef enum {
+	SWITCH_ENDPOINT_INTERFACE,
+	SWITCH_TIMER_INTERFACE,
+	SWITCH_DIALPLAN_INTERFACE,
+	SWITCH_CODEC_INTERFACE,
+	SWITCH_APPLICATION_INTERFACE,
+	SWITCH_API_INTERFACE,
+	SWITCH_FILE_INTERFACE,
+	SWITCH_SPEECH_INTERFACE,
+	SWITCH_DIRECTORY_INTERFACE,
+	SWITCH_CHAT_INTERFACE,
+	SWITCH_SAY_INTERFACE,
+	SWITCH_ASR_INTERFACE,
+	SWITCH_MANAGEMENT_INTERFACE
+} switch_module_interface_name_t;
+
+typedef enum {
 	SUF_NONE = 0,
 	SUF_THREAD_RUNNING = (1 << 0),
 	SUF_READY = (1 << 1),
@@ -196,6 +212,7 @@
 	SWITCH_ABC_TYPE_READ,
 	SWITCH_ABC_TYPE_WRITE,
 	SWITCH_ABC_TYPE_WRITE_REPLACE,
+	SWITCH_ABC_TYPE_READ_REPLACE,
 	SWITCH_ABC_TYPE_CLOSE
 } switch_abc_type_t;
 
@@ -742,14 +759,16 @@
 <pre>
 SMBF_READ_STREAM - Include the Read Stream
 SMBF_WRITE_STREAM - Include the Write Stream
-SMBF_WRITE_STREAM - Replace the Write Stream
+SMBF_WRITE_REPLACE - Replace the Write Stream
+SMBF_READ_REPLACE - Replace the Read Stream
 </pre>
 */
 typedef enum {
 	SMBF_BOTH = 0,
 	SMBF_READ_STREAM = (1 << 0),
 	SMBF_WRITE_STREAM = (1 << 1),
-	SMBF_WRITE_REPLACE = (1 << 2)
+	SMBF_WRITE_REPLACE = (1 << 2),
+	SMBF_READ_REPLACE = (1 << 3)
 } switch_media_bug_flag_t;
 
 /*!
@@ -968,6 +987,7 @@
 	SCSC_CHECK_RUNNING
 } switch_session_ctl_t;
 
+typedef struct apr_pool_t switch_memory_pool_t;
 typedef uint16_t switch_port_t;
 typedef uint8_t switch_payload_t;
 typedef struct switch_app_log switch_app_log_t;
@@ -1042,19 +1062,41 @@
 } switch_input_args_t;
 typedef switch_status_t (*switch_say_callback_t) (switch_core_session_t *session,
 												  char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args);
-typedef switch_status_t (*switch_module_load_t) (switch_loadable_module_interface_t **, char *);
-typedef switch_status_t (*switch_module_reload_t) (void);
-typedef switch_status_t (*switch_module_pause_t) (void);
-typedef switch_status_t (*switch_module_resume_t) (void);
-typedef switch_status_t (*switch_module_status_t) (void);
-typedef switch_status_t (*switch_module_runtime_t) (void);
-typedef switch_status_t (*switch_module_shutdown_t) (void);
 typedef struct switch_xml *switch_xml_t;
 typedef struct switch_core_time_duration switch_core_time_duration_t;
 typedef switch_xml_t(*switch_xml_search_function_t) (const char *section,
 													 const char *tag_name, const char *key_name, const char *key_value, const char *params,
 													 void *user_data);
 
+
+#define SWITCH_API_VERSION 1
+#define SWITCH_MODULE_LOAD_ARGS (switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool)
+#define SWITCH_MODULE_RUNTIME_ARGS (void)
+#define SWITCH_MODULE_SHUTDOWN_ARGS (void)
+typedef switch_status_t (*switch_module_load_t) SWITCH_MODULE_LOAD_ARGS ;
+typedef switch_status_t (*switch_module_runtime_t) SWITCH_MODULE_RUNTIME_ARGS ;
+typedef switch_status_t (*switch_module_shutdown_t) SWITCH_MODULE_SHUTDOWN_ARGS ;
+#define SWITCH_MODULE_LOAD_FUNCTION(name) switch_status_t name SWITCH_MODULE_LOAD_ARGS
+#define SWITCH_MODULE_RUNTIME_FUNCTION(name) switch_status_t name SWITCH_MODULE_RUNTIME_ARGS
+#define SWITCH_MODULE_SHUTDOWN_FUNCTION(name) switch_status_t name SWITCH_MODULE_SHUTDOWN_ARGS
+
+typedef struct switch_loadable_module_function_table {
+	int switch_api_version;
+	switch_module_load_t load;
+	switch_module_shutdown_t shutdown;
+	switch_module_runtime_t runtime;
+} switch_loadable_module_function_table_t;
+
+#define SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime)								\
+static const char modname[] =  #name ;														\
+SWITCH_MOD_DECLARE_DATA switch_loadable_module_function_table_t name##_module_interface = {	\
+	SWITCH_API_VERSION,																		\
+	load,																					\
+	shutdown,																				\
+	runtime																					\
+}
+
+
 /* things we don't deserve to know about */
 /*! \brief A channel */
 struct switch_channel;

Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c	Thu Jun 14 12:39:04 2007
@@ -36,8 +36,9 @@
 #include <switch.h>
 #include <switch_version.h>
 
+SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load);
+SWITCH_MODULE_DEFINITION(mod_commands, mod_commands_load, NULL, NULL);
 
-static const char modname[] = "mod_commands";
 static switch_api_interface_t ctl_api_interface;
 static switch_api_interface_t uuid_bridge_api_interface;
 static switch_api_interface_t session_record_api_interface;
@@ -1318,7 +1319,7 @@
 	/*.next */ &kill_api_interface
 };
 
-static const switch_loadable_module_interface_t mod_commands_module_interface = {
+static switch_loadable_module_interface_t commands_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ NULL,
 	/*.timer_interface */ NULL,
@@ -1328,10 +1329,10 @@
 	/*.api_interface */ &originate_api_interface
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
-	*module_interface = &mod_commands_module_interface;
+	*module_interface = &commands_module_interface;
 
 	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_NOUNLOAD;

Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c	Thu Jun 14 12:39:04 2007
@@ -33,7 +33,10 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_conference";
+SWITCH_MODULE_LOAD_FUNCTION(mod_conference_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_conference_shutdown);
+SWITCH_MODULE_DEFINITION(mod_conference, mod_conference_load, mod_conference_shutdown, NULL);
+
 static const char global_app_name[] = "conference";
 static char *global_cf_name = "conference.conf";
 static switch_api_interface_t conf_api_interface;
@@ -54,7 +57,8 @@
 
 typedef enum {
 	FILE_STOP_CURRENT,
-	FILE_STOP_ALL
+	FILE_STOP_ALL,
+	FILE_STOP_ASYNC
 } file_stop_t;
 
 /* Global Values */
@@ -176,6 +180,7 @@
 	char *exit_sound;
 	char *alone_sound;
 	char *perpetual_sound;
+	char *moh_sound;
 	char *ack_sound;
 	char *nack_sound;
 	char *muted_sound;
@@ -500,8 +505,14 @@
 			switch_event_fire(&event);
 		}
 
-		if (conference->count > 1 && conference->enter_sound) {
-			conference_play_file(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0);
+		if (conference->count > 1) {
+			if(conference->moh_sound) {
+				/* stop MoH if any */
+				conference_stop_file(conference, FILE_STOP_ASYNC);
+			}
+			if(conference->enter_sound) {
+				conference_play_file(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0);
+			}
 		}
 
 		channel = switch_core_session_get_channel(member->session);
@@ -541,6 +552,7 @@
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "add-member");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Size", "%u", conference->count);
 			switch_event_fire(&event);
 		}
 	}
@@ -638,6 +650,7 @@
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "del-member");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Size", "%u", conference->count);
 			switch_event_fire(&event);
 		}
 	}
@@ -686,7 +699,9 @@
 		int has_file_data = 0;
 
 		if (conference->perpetual_sound && !conference->fnode) {
-			conference_play_file(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 0);
+			conference_play_file(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 1);
+		} else if (conference->moh_sound && conference->count == 1 && !conference->fnode) {
+			conference_play_file(conference, conference->moh_sound, CONF_DEFAULT_LEADIN, NULL, 1);
 		}
 
 		/* Sync the conference to a single timing source */
@@ -1935,6 +1950,11 @@
 			conference->async_fnode->done++;
 			count++;
 		}
+	} else if (stop == FILE_STOP_ASYNC) {
+		if (conference->async_fnode) {
+			conference->async_fnode->done++;
+			count++;
+		}
 	} else {
 		if (conference->fnode) {
 			conference->fnode->done++;
@@ -3546,7 +3566,7 @@
 	return SWITCH_STATUS_FALSE;
 }
 
-static const switch_state_handler_table_t audio_bridge_peer_state_handlers = {
+static switch_state_handler_table_t audio_bridge_peer_state_handlers = {
 	/*.on_init */ NULL,
 	/*.on_ring */ audio_bridge_on_ring,
 	/*.on_execute */ NULL,
@@ -4318,7 +4338,7 @@
 	switch_thread_create(&thread, thd_attr, conference_record_thread_run, rec, rec->pool);
 }
 
-static const switch_application_interface_t conference_autocall_application_interface = {
+static switch_application_interface_t conference_autocall_application_interface = {
 	/*.interface_name */ "conference_set_auto_outcall",
 	/*.application_function */ conference_auto_function,
 	NULL, NULL, NULL,
@@ -4326,7 +4346,7 @@
 	/*.next */
 };
 
-static const switch_application_interface_t conference_application_interface = {
+static switch_application_interface_t conference_application_interface = {
 	/*.interface_name */ global_app_name,
 	/*.application_function */ conference_function,
 	NULL, NULL, NULL,
@@ -4411,7 +4431,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_chat_interface_t conference_chat_interface = {
+static switch_chat_interface_t conference_chat_interface = {
 	/*.name */ CONF_CHAT_PROTO,
 	/*.chat_send */ chat_send,
 
@@ -4543,6 +4563,7 @@
 	char *caller_controls = NULL;
 	char *member_flags = NULL;
 	char *perpetual_sound = NULL;
+	char *moh_sound = NULL;
 	uint32_t max_members = 0;
 	uint32_t anounce_count = 0;
 	char *maxmember_sound = NULL;
@@ -4592,6 +4613,8 @@
 			alone_sound = val;
 		} else if (!strcasecmp(var, "perpetual-sound")) {
 			perpetual_sound = val;
+		} else if (!strcasecmp(var, "moh-sound")) {
+			moh_sound = val;
 		} else if (!strcasecmp(var, "ack-sound")) {
 			ack_sound = val;
 		} else if (!strcasecmp(var, "nack-sound")) {
@@ -4713,6 +4736,10 @@
 		conference->mflags = MFLAG_CAN_SPEAK | MFLAG_CAN_HEAR;
 	}
 
+	if (!switch_strlen_zero(moh_sound)) {
+		conference->moh_sound = switch_core_strdup(conference->pool, moh_sound);
+	}
+
 	if (member_flags) {
 		set_mflags(member_flags, &conference->mflags);
 	}
@@ -4909,7 +4936,7 @@
 }
 
 /* Called by FreeSWITCH when the module loads */
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_conference_load)
 {
 	uint32_t i;
 	size_t nl, ol = 0;
@@ -4974,7 +5001,7 @@
 	return status;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_conference_shutdown)
 {
 	if (globals.running) {
 

Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c	Thu Jun 14 12:39:04 2007
@@ -34,10 +34,11 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_dptools";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load);
+SWITCH_MODULE_DEFINITION(mod_dptools, mod_dptools_load, NULL, NULL);
 
-static const switch_application_interface_t detect_speech_application_interface;
-static const switch_application_interface_t exe_application_interface;
+static switch_application_interface_t detect_speech_application_interface;
+static switch_application_interface_t exe_application_interface;
 
 static void detect_speech_function(switch_core_session_t *session, char *data)
 {
@@ -673,8 +674,276 @@
 	switch_ivr_stop_fax_detect_session(session);
 }
 
+static void echo_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+
+	switch_channel_answer(channel);
+
+	switch_channel_set_state(channel, CS_LOOPBACK);
+}
+
+static void park_function(switch_core_session_t *session, char *data)
+{
+	switch_ivr_park(session, NULL);
+
+}
+
+/********************************************************************************/
+/*						Playback/Record Functions								*/
+/********************************************************************************/
+
+/*
+  dtmf handler function you can hook up to be executed when a digit is dialed during playback 
+   if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
+*/
+static switch_status_t on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
+{
+
+
+	switch (itype) {
+	case SWITCH_INPUT_TYPE_DTMF:{
+			char *dtmf = (char *) input;
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Digits %s\n", dtmf);
+
+			if (*dtmf == '*') {
+				return SWITCH_STATUS_BREAK;
+			}
+		}
+		break;
+	default:
+		break;
+	}
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+static void speak_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	char buf[10];
+	char *argv[4] = { 0 };
+	int argc;
+	char *engine = NULL;
+	char *voice = NULL;
+	char *text = NULL;
+	char *mydata = NULL;
+	switch_codec_t *codec;
+	switch_input_args_t args = { 0 };
+
+	codec = switch_core_session_get_read_codec(session);
+	assert(codec != NULL);
+
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+
+	mydata = switch_core_session_strdup(session, data);
+	argc = switch_separate_string(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]));
+
+	engine = argv[0];
+	voice = argv[1];
+	text = argv[2];
+
+	if (!(engine && voice && text)) {
+		if (!engine) {
+			engine = "NULL";
+		}
+		if (!voice) {
+			voice = "NULL";
+		}
+		if (!text) {
+			text = "NULL";
+		}
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Params! [%s][%s][%s]\n", engine, voice, text);
+		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+	}
+
+	switch_channel_pre_answer(channel);
+
+	args.input_callback = on_dtmf;
+	args.buf = buf;
+	args.buflen = sizeof(buf);
+	switch_ivr_speak_text(session, engine, voice, codec->implementation->samples_per_second, text, &args);
+
+}
+
+static void playback_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	char *file_name = NULL;
+	switch_input_args_t args = { 0 };
+
+	file_name = switch_core_session_strdup(session, data);
+
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+
+	switch_channel_pre_answer(channel);
+
+	args.input_callback = on_dtmf;
+	switch_ivr_play_file(session, NULL, file_name, &args);
+
+}
+
+
+static void record_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	switch_status_t status;
+	uint32_t limit = 0;
+	char *path;
+	char *p;
+	switch_input_args_t args = { 0 };
+
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+
+	path = switch_core_session_strdup(session, data);
+	if ((p = strchr(path, '+'))) {
+		char *q = p - 1;
+		while(q && *q == ' ') {
+			*q = '\0';
+			q--;
+		}
+		*p++ = '\0';
+		limit = atoi(p);
+	}
+
+	args.input_callback = on_dtmf;
+	status = switch_ivr_record_file(session, NULL, path, &args, limit);
+
+	if (!switch_channel_ready(channel) || (status != SWITCH_STATUS_SUCCESS && !SWITCH_STATUS_IS_BREAK(status))) {
+		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+	}
+}
+
+
+static void record_session_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	char *p, *path = NULL;
+	uint32_t limit = 0;
 
-static const switch_api_interface_t strepoch_api_interface = {
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+
+	path = switch_core_session_strdup(session, data);
+	if ((p = strchr(path, '+'))) {
+		char *q = p - 1;
+		while(q && *q == ' ') {
+			*q = '\0';
+			q--;
+		}
+		*p++ = '\0';
+		limit = atoi(p);
+	}
+	
+	switch_ivr_record_session(session, path, limit, 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);
+}
+
+/********************************************************************************/
+/*								Bridge Functions								*/
+/********************************************************************************/
+
+static void audio_bridge_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *caller_channel;
+	switch_core_session_t *peer_session = NULL;
+	unsigned int timelimit = 60;
+	char *var;
+	uint8_t no_media_bridge = 0;
+	switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
+	uint8_t do_continue = 0;
+
+	if (switch_strlen_zero(data)) {
+		return;
+	}
+
+	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 ((var = switch_channel_get_variable(caller_channel, "continue_on_fail"))) {
+		do_continue = switch_true(var);
+	}
+
+	if (switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)
+		|| ((var = switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE)) && switch_true(var))) {
+		if (!switch_channel_test_flag(caller_channel, CF_ANSWERED)
+			&& !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
+			switch_channel_set_flag(caller_channel, CF_BYPASS_MEDIA);
+		} else {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is already up, delaying point-to-point mode 'till both legs are up.\n");
+			no_media_bridge = 1;
+		}
+	}
+
+	if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Originate Failed.  Cause: %s\n", switch_channel_cause2str(cause));
+		if (!do_continue && cause != SWITCH_CAUSE_NO_ANSWER) {
+			/* All Causes besides NO_ANSWER terminate the originating session unless continue_on_fail is set.
+			   We will pass the fail cause on when we hangup. */
+			switch_channel_hangup(caller_channel, cause);
+		}
+		/* Otherwise.. nobody answered.  Go back to the dialplan instructions in case there was more to do. */
+		return;
+	} else {
+		if (no_media_bridge) {
+			switch_channel_t *peer_channel = switch_core_session_get_channel(peer_session);
+			switch_frame_t *read_frame;
+			/* SIP won't let us redir media until the call has been answered #$^#%& so we will proxy any early media until they do */
+			while (switch_channel_ready(caller_channel) && switch_channel_ready(peer_channel)
+				   && !switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
+				switch_status_t status = switch_core_session_read_frame(peer_session, &read_frame, -1, 0);
+				uint8_t bad = 1;
+
+				if (SWITCH_READ_ACCEPTABLE(status)
+					&& switch_core_session_write_frame(session, read_frame, -1, 0) == SWITCH_STATUS_SUCCESS) {
+					bad = 0;
+				}
+				if (bad) {
+					switch_channel_hangup(caller_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+					switch_channel_hangup(peer_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+					goto end;
+				}
+			}
+
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Redirecting media to point-to-point mode.\n");
+			switch_ivr_nomedia(switch_core_session_get_uuid(session), SMF_FORCE);
+			switch_ivr_nomedia(switch_core_session_get_uuid(peer_session), SMF_FORCE);
+			switch_ivr_signal_bridge(session, peer_session);
+		} else {
+			if (switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)) {
+				switch_ivr_signal_bridge(session, peer_session);
+			} else {
+				switch_ivr_multi_threaded_bridge(session, peer_session, NULL, NULL, NULL);
+			}
+		}
+	end:
+		if (peer_session) {
+			switch_core_session_rwunlock(peer_session);
+		}
+	}
+}
+
+static switch_api_interface_t strepoch_api_interface = {
 	/*.interface_name */ "strepoch",
 	/*.desc */ "Convert a date string into epoch time",
 	/*.function */ strepoch_api_function,
@@ -682,7 +951,7 @@
 	/*.next */ NULL
 };
 
-static const switch_api_interface_t chat_api_interface = {
+static switch_api_interface_t chat_api_interface = {
 	/*.interface_name */ "chat",
 	/*.desc */ "chat",
 	/*.function */ chat_api_function,
@@ -690,7 +959,7 @@
 	/*.next */ &strepoch_api_interface
 };
 
-static const switch_api_interface_t dptools_api_interface = {
+static switch_api_interface_t dptools_api_interface = {
 	/*.interface_name */ "strftime",
 	/*.desc */ "strftime",
 	/*.function */ strftime_api_function,
@@ -698,7 +967,7 @@
 	/*.next */ &chat_api_interface
 };
 
-static const switch_api_interface_t presence_api_interface = {
+static switch_api_interface_t presence_api_interface = {
 	/*.interface_name */ "presence",
 	/*.desc */ "presence",
 	/*.function */ presence_api_function,
@@ -707,17 +976,97 @@
 };
 
 
-static const switch_application_interface_t fax_detect_application_interface = {
+static switch_application_interface_t bridge_application_interface = {
+	/*.interface_name */ "bridge",
+	/*.application_function */ audio_bridge_function,
+	/* long_desc */ "Bridge the audio between two sessions",
+	/* short_desc */ "Bridge Audio",
+	/* syntax */ "<channel_url>",
+	/* flags */ SAF_SUPPORT_NOMEDIA
+};
+
+static switch_application_interface_t speak_application_interface = {
+	/*.interface_name */ "speak",
+	/*.application_function */ speak_function,
+	/* long_desc */ "Speak text to a channel via the tts interface",
+	/* short_desc */ "Speak text",
+	/* syntax */ "<engine>|<voice>|<text>",
+	/* flags */ SAF_NONE,
+	&bridge_application_interface
+};
+
+static switch_application_interface_t record_application_interface = {
+	/*.interface_name */ "record",
+	/*.application_function */ record_function,
+	/* long_desc */ "Record a file from the channels input",
+	/* short_desc */ "Record File",
+	/* syntax */ "<path> [+time_limit_ms]",
+	/* flags */ SAF_NONE,
+	&speak_application_interface
+};
+
+
+static switch_application_interface_t record_session_application_interface = {
+	/*.interface_name */ "record_session",
+	/*.application_function */ record_session_function,
+	/* long_desc */ "Starts a background recording of the entire session",
+	/* short_desc */ "Record Session",
+	/* syntax */ "<path>",
+	/* flags */ SAF_NONE,
+	&record_application_interface
+};
+
+
+static switch_application_interface_t stop_record_session_application_interface = {
+	/*.interface_name */ "stop_record_session",
+	/*.application_function */ stop_record_session_function,
+	/* long_desc */ "Stops a background recording of the entire session",
+	/* short_desc */ "Stop Record Session",
+	/* syntax */ "<path>",
+	/* flags */ SAF_NONE,
+	&record_session_application_interface
+};
+
+static switch_application_interface_t playback_application_interface = {
+	/*.interface_name */ "playback",
+	/*.application_function */ playback_function,
+	/* long_desc */ "Playback a file to the channel",
+	/* short_desc */ "Playback File",
+	/* syntax */ "<path>",
+	/* flags */ SAF_NONE,
+	/*.next */ &stop_record_session_application_interface
+};
+static switch_application_interface_t park_application_interface = {
+	/*.interface_name */ "park",
+	/*.application_function */ park_function,
+	/* long_desc */ NULL,
+	/* short_desc */ NULL,
+	/* syntax */ NULL,
+	/* flags */ SAF_NONE,
+	/*.next */ &playback_application_interface
+};
+
+static switch_application_interface_t echo_application_interface = {
+	/*.interface_name */ "echo",
+	/*.application_function */ echo_function,
+	/* long_desc */ "Perform an echo test against the calling channel",
+	/* short_desc */ "Echo",
+	/* syntax */ "",
+	/* flags */ SAF_NONE,
+	/*.next */ &park_application_interface
+};
+
+static switch_application_interface_t fax_detect_application_interface = {
 	/*.interface_name */ "fax_detect",
 	/*.application_function */ fax_detect_session_function,
 	/* long_desc */ "Detect fax send tone",
 	/* short_desc */ "Detect faxes",
 	/* syntax */ "",
 	/* flags */ SAF_NONE,
-	/*.next */ NULL
+	/*.next */ &echo_application_interface
 };
 
-static const switch_application_interface_t stop_fax_detect_application_interface = {
+static switch_application_interface_t stop_fax_detect_application_interface = {
 	/*.interface_name */ "stop_fax_detect",
 	/*.application_function */ stop_fax_detect_session_function,
 	/* long_desc */ "Stop detecting fax send tones",
@@ -727,7 +1076,7 @@
 	/* next */ &fax_detect_application_interface
 };
 
-static const switch_application_interface_t dtmf_application_interface = {
+static switch_application_interface_t dtmf_application_interface = {
 	/*.interface_name */ "start_dtmf",
 	/*.application_function */ dtm_session_function,
 	/* long_desc */ "Detect inband dtmf on the session",
@@ -737,7 +1086,7 @@
 	/* next */ &stop_fax_detect_application_interface
 };
 
-static const switch_application_interface_t stop_dtmf_application_interface = {
+static switch_application_interface_t stop_dtmf_application_interface = {
 	/*.interface_name */ "stop_dtmf",
 	/*.application_function */ stop_dtmf_session_function,
 	/* long_desc */ "Stop detecting inband dtmf.",
@@ -747,7 +1096,7 @@
 	&dtmf_application_interface
 };
 
-static const switch_application_interface_t exe_application_interface = {
+static switch_application_interface_t exe_application_interface = {
 	/*.interface_name */ "execute_extension",
 	/*.application_function */ exe_function,
 	/*.long_desc */ "Execute an extension",
@@ -757,7 +1106,7 @@
 	/*.next */ &stop_dtmf_application_interface
 };
 
-static const switch_application_interface_t sched_transfer_application_interface = {
+static switch_application_interface_t sched_transfer_application_interface = {
 	/*.interface_name */ "sched_transfer",
 	/*.application_function */ sched_transfer_function,
 	/*.long_desc */ "Schedule a transfer in the future",
@@ -767,7 +1116,7 @@
 	/*.next */ &exe_application_interface
 };
 
-static const switch_application_interface_t sched_broadcast_application_interface = {
+static switch_application_interface_t sched_broadcast_application_interface = {
 	/*.interface_name */ "sched_broadcast",
 	/*.application_function */ sched_broadcast_function,
 	/*.long_desc */ "Schedule a broadcast in the future",
@@ -777,7 +1126,7 @@
 	/*.next */ &sched_transfer_application_interface
 };
 
-static const switch_application_interface_t sched_hangup_application_interface = {
+static switch_application_interface_t sched_hangup_application_interface = {
 	/*.interface_name */ "sched_hangup",
 	/*.application_function */ sched_hangup_function,
 	/*.long_desc */ "Schedule a hangup in the future",
@@ -788,7 +1137,7 @@
 };
 
 
-static const switch_application_interface_t queuedtmf_application_interface = {
+static switch_application_interface_t queuedtmf_application_interface = {
 	/*.interface_name */ "queue_dtmf",
 	/*.application_function */ queue_dtmf_function,
 	/* long_desc */ "Queue dtmf to be sent from a session",
@@ -798,7 +1147,7 @@
 	/*.next */ &sched_hangup_application_interface
 };
 
-static const switch_application_interface_t reject_application_interface = {
+static switch_application_interface_t reject_application_interface = {
 	/*.interface_name */ "reject",
 	/*.application_function */ reject_function,
 	/* long_desc */ "Send a reject message to a session.",
@@ -808,7 +1157,7 @@
 	/*.next */ &queuedtmf_application_interface
 };
 
-static const switch_application_interface_t redirect_application_interface = {
+static switch_application_interface_t redirect_application_interface = {
 	/*.interface_name */ "redirect",
 	/*.application_function */ redirect_function,
 	/* long_desc */ "Send a redirect message to a session.",
@@ -818,7 +1167,7 @@
 	/*.next */ &reject_application_interface
 };
 
-static const switch_application_interface_t ivr_application_interface = {
+static switch_application_interface_t ivr_application_interface = {
 	/*.interface_name */ "ivr",
 	/*.application_function */ ivr_application_function,
 	/* long_desc */ "Run an ivr menu.",
@@ -828,7 +1177,7 @@
 	/*.next */ &redirect_application_interface
 };
 
-static const switch_application_interface_t detect_speech_application_interface = {
+static switch_application_interface_t detect_speech_application_interface = {
 	/*.interface_name */ "detect_speech",
 	/*.application_function */ detect_speech_function,
 	/* long_desc */ "Detect speech on a channel.",
@@ -838,7 +1187,7 @@
 	/*.next */ &ivr_application_interface
 };
 
-static const switch_application_interface_t ring_ready_application_interface = {
+static switch_application_interface_t ring_ready_application_interface = {
 	/*.interface_name */ "ring_ready",
 	/*.application_function */ ring_ready_function,
 	/* long_desc */ "Indicate Ring_Ready on a channel.",
@@ -848,7 +1197,7 @@
 	/*.next */ &detect_speech_application_interface
 };
 
-static const switch_application_interface_t unset_application_interface = {
+static switch_application_interface_t unset_application_interface = {
 	/*.interface_name */ "unset",
 	/*.application_function */ unset_function,
 	/* long_desc */ "Unset a channel varaible for the channel calling the application.",
@@ -858,7 +1207,7 @@
 	/*.next */ &ring_ready_application_interface
 };
 
-static const switch_application_interface_t set_application_interface = {
+static switch_application_interface_t set_application_interface = {
 	/*.interface_name */ "set",
 	/*.application_function */ set_function,
 	/* long_desc */ "Set a channel varaible for the channel calling the application.",
@@ -868,7 +1217,7 @@
 	/*.next */ &unset_application_interface
 };
 
-static const switch_application_interface_t export_application_interface = {
+static switch_application_interface_t export_application_interface = {
 	/*.interface_name */ "export",
 	/*.application_function */ export_function,
 	/* long_desc */ "Set and export a channel varaible for the channel calling the application.",
@@ -878,7 +1227,7 @@
 	/*.next */ &set_application_interface
 };
 
-static const switch_application_interface_t info_application_interface = {
+static switch_application_interface_t info_application_interface = {
 	/*.interface_name */ "info",
 	/*.application_function */ info_function,
 	/* long_desc */ "Display Call Info",
@@ -888,7 +1237,7 @@
 	/*.next */ &export_application_interface
 };
 
-static const switch_application_interface_t log_application_interface = {
+static switch_application_interface_t log_application_interface = {
 	/*.interface_name */ "log",
 	/*.application_function */ log_function,
 	/* long_desc */ "Logs a channel varaible for the channel calling the application.",
@@ -899,7 +1248,7 @@
 };
 
 
-static const switch_application_interface_t hangup_application_interface = {
+static switch_application_interface_t hangup_application_interface = {
 	/*.interface_name */ "hangup",
 	/*.application_function */ hangup_function,
 	/* long_desc */ "Hangup the call for a channel.",
@@ -909,7 +1258,7 @@
 	/*.next */ &log_application_interface
 };
 
-static const switch_application_interface_t answer_application_interface = {
+static switch_application_interface_t answer_application_interface = {
 	/*.interface_name */ "answer",
 	/*.application_function */ answer_function,
 	/* long_desc */ "Answer the call for a channel.",
@@ -919,7 +1268,7 @@
 	/*.next */ &hangup_application_interface
 };
 
-static const switch_application_interface_t pre_answer_application_interface = {
+static switch_application_interface_t pre_answer_application_interface = {
 	/*.interface_name */ "pre_answer",
 	/*.application_function */ pre_answer_function,
 	/* long_desc */ "Pre-Answer the call for a channel.",
@@ -929,7 +1278,7 @@
 	/*.next */ &answer_application_interface
 };
 
-static const switch_application_interface_t eval_application_interface = {
+static switch_application_interface_t eval_application_interface = {
 	/*.interface_name */ "eval",
 	/*.application_function */ eval_function,
 	/* long_desc */ "Do Nothing",
@@ -939,7 +1288,7 @@
 	/*.next */ &pre_answer_application_interface
 };
 
-static const switch_application_interface_t phrase_application_interface = {
+static switch_application_interface_t phrase_application_interface = {
 	/*.interface_name */ "phrase",
 	/*.application_function */ phrase_function,
 	/* long_desc */ "Say a Phrase",
@@ -949,7 +1298,7 @@
 	/*.next */ &eval_application_interface
 };
 
-static const switch_application_interface_t strftime_application_interface = {
+static switch_application_interface_t strftime_application_interface = {
 	/*.interface_name */ "strftime",
 	/*.application_function */ strftime_function,
 	/* long_desc */ NULL,
@@ -959,7 +1308,7 @@
 	/*.next */ &phrase_application_interface
 };
 
-static const switch_application_interface_t sleep_application_interface = {
+static switch_application_interface_t sleep_application_interface = {
 	/*.interface_name */ "sleep",
 	/*.application_function */ sleep_function,
 	/* long_desc */
@@ -970,7 +1319,7 @@
 	/* next */ &strftime_application_interface
 };
 
-static const switch_application_interface_t transfer_application_interface = {
+static switch_application_interface_t transfer_application_interface = {
 	/*.interface_name */ "transfer",
 	/*.application_function */ transfer_function,
 	/* long_desc */ "Immediatly transfer the calling channel to a new extension",
@@ -980,7 +1329,7 @@
 	/* next */ &sleep_application_interface
 };
 
-static const switch_application_interface_t privacy_application_interface = {
+static switch_application_interface_t privacy_application_interface = {
 	/*.interface_name */ "privacy",
 	/*.application_function */ privacy_function,
 	/* long_desc */ "Set caller privacy on calls.",
@@ -990,7 +1339,7 @@
 	/*.next */ &transfer_application_interface
 };
 
-static const switch_loadable_module_interface_t mod_dptools_module_interface = {
+static switch_loadable_module_interface_t dptools_module_interface = {
 	/*.module_name = */ modname,
 	/*.endpoint_interface = */ NULL,
 	/*.timer_interface = */ NULL,
@@ -1000,23 +1349,17 @@
 	/*.api_interface */ &presence_api_interface
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
 {
 
 	/* connect my internal structure to the blank pointer passed to me */
-	*module_interface = &mod_dptools_module_interface;
+	*module_interface = &dptools_module_interface;
 
 
 	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_SUCCESS;
 }
 
-/* 'switch_module_runtime' will start up in a thread by itself just by having it exist 
-if it returns anything but SWITCH_STATUS_TERM it will be called again automaticly
-*/
-
-
-//switch_status_t switch_module_runtime(void)
 
 /* For Emacs:
  * Local Variables:

Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c	Thu Jun 14 12:39:04 2007
@@ -36,7 +36,8 @@
 #define closesocket close
 #endif
 
-static const char modname[] = "mod_enum";
+SWITCH_MODULE_LOAD_FUNCTION(mod_enum_load);
+SWITCH_MODULE_DEFINITION(mod_enum, mod_enum_load, NULL, NULL);
 
 struct enum_record {
 	int order;
@@ -684,13 +685,13 @@
 }
 
 
-static const switch_dialplan_interface_t enum_dialplan_interface = {
+static switch_dialplan_interface_t enum_dialplan_interface = {
 	/*.interface_name = */ "enum",
 	/*.hunt_function = */ enum_dialplan_hunt
 		/*.next = NULL */
 };
 
-static const switch_application_interface_t enum_application_interface = {
+static switch_application_interface_t enum_application_interface = {
 	/*.interface_name */ "enum",
 	/*.application_function */ enum_app_function,
 	/* long_desc */ "Perform an ENUM lookup",
@@ -721,7 +722,7 @@
 	/*.directory_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_enum_load)
 {
 
 	if (dns_init(0) < 0) {

Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c	Thu Jun 14 12:39:04 2007
@@ -31,7 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_esf";
+SWITCH_MODULE_LOAD_FUNCTION(mod_esf_load);
+SWITCH_MODULE_DEFINITION(mod_esf, mod_esf_load, NULL, NULL);
 
 struct ls_control_packet {
 	uint32_t unique_id;
@@ -227,7 +228,7 @@
 }
 
 
-static const switch_application_interface_t bcast_application_interface = {
+static switch_application_interface_t bcast_application_interface = {
 	/*.interface_name */ "esf_ls_page_group",
 	/*.application_function */ bcast_function,
 	NULL, NULL, NULL,
@@ -235,7 +236,7 @@
 	/*.next */ NULL
 };
 
-static const switch_loadable_module_interface_t mod_ivrtest_module_interface = {
+static switch_loadable_module_interface_t mod_ivrtest_module_interface = {
 	/*.module_name = */ modname,
 	/*.endpoint_interface = */ NULL,
 	/*.timer_interface = */ NULL,
@@ -244,7 +245,7 @@
 	/*.application_interface */ &bcast_application_interface
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_esf_load)
 {
 
 	/* connect my internal structure to the blank pointer passed to me */

Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_ivrtest/mod_ivrtest.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_ivrtest/mod_ivrtest.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_ivrtest/mod_ivrtest.c	Thu Jun 14 12:39:04 2007
@@ -31,9 +31,8 @@
  */
 #include <switch.h>
 
-
-static const char modname[] = "mod_ivrtest";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_ivrtest_load);
+SWITCH_MODULE_DEFINITION(mod_ivrtest, mod_ivrtest_load, NULL, NULL);
 
 /*
   dtmf handler function you can hook up to be executed when a digit is dialed during playback 
@@ -424,7 +423,7 @@
 
 }
 
-static const switch_state_handler_table_t state_handlers = {
+static switch_state_handler_table_t state_handlers = {
 	/*.on_init */ NULL,
 	/*.on_ring */ NULL,
 	/*.on_execute */ NULL,
@@ -435,7 +434,7 @@
 
 
 
-static const switch_application_interface_t bug_application_interface = {
+static switch_application_interface_t bug_application_interface = {
 	/*.interface_name */ "bugtest",
 	/*.application_function */ bugtest_function,
 	NULL, NULL, NULL,
@@ -443,7 +442,7 @@
 	/*.next */ NULL
 };
 
-static const switch_application_interface_t ivr_application_interface = {
+static switch_application_interface_t ivr_application_interface = {
 	/*.interface_name */ "ivrmenu",
 	/*.application_function */ ivr_application_function,
 	NULL, NULL, NULL,
@@ -451,7 +450,7 @@
 	/*.next */ &bug_application_interface
 };
 
-static const switch_application_interface_t xml_application_interface = {
+static switch_application_interface_t xml_application_interface = {
 	/*.interface_name */ "xml",
 	/*.application_function */ xml_function,
 	NULL, NULL, NULL,
@@ -459,7 +458,7 @@
 	/*.next */ &ivr_application_interface
 };
 
-static const switch_application_interface_t disast_application_interface = {
+static switch_application_interface_t disast_application_interface = {
 	/*.interface_name */ "disast",
 	/*.application_function */ disast_function,
 	NULL, NULL, NULL,
@@ -467,7 +466,7 @@
 	/*.next */ &xml_application_interface
 };
 
-static const switch_application_interface_t tts_application_interface = {
+static switch_application_interface_t tts_application_interface = {
 	/*.interface_name */ "tts",
 	/*.application_function */ tts_function,
 	NULL, NULL, NULL,
@@ -475,7 +474,7 @@
 	/*.next */ &disast_application_interface
 };
 
-static const switch_application_interface_t dirtest_application_interface = {
+static switch_application_interface_t dirtest_application_interface = {
 	/*.interface_name */ "dirtest",
 	/*.application_function */ dirtest_function,
 	NULL, NULL, NULL,
@@ -483,7 +482,7 @@
 	/*.next */ &tts_application_interface
 };
 
-static const switch_application_interface_t ivrtest_application_interface = {
+static switch_application_interface_t ivrtest_application_interface = {
 	/*.interface_name */ "ivrtest",
 	/*.application_function */ ivrtest_function,
 	NULL, NULL, NULL,
@@ -491,7 +490,7 @@
 	/*.next */ &dirtest_application_interface
 };
 
-static const switch_application_interface_t asrtest_application_interface = {
+static switch_application_interface_t asrtest_application_interface = {
 	/*.interface_name */ "asrtest",
 	/*.application_function */ asrtest_function,
 	NULL, NULL, NULL,
@@ -499,7 +498,7 @@
 	/*.next */ &ivrtest_application_interface
 };
 
-static const switch_loadable_module_interface_t mod_ivrtest_module_interface = {
+static switch_loadable_module_interface_t ivrtest_module_interface = {
 	/*.module_name = */ modname,
 	/*.endpoint_interface = */ NULL,
 	/*.timer_interface = */ NULL,
@@ -508,11 +507,11 @@
 	/*.application_interface */ &asrtest_application_interface
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_ivrtest_load)
 {
 
 	/* connect my internal structure to the blank pointer passed to me */
-	*module_interface = &mod_ivrtest_module_interface;
+	*module_interface = &ivrtest_module_interface;
 
 	/* test global state handlers */
 	switch_core_add_state_handler(&state_handlers);
@@ -521,12 +520,6 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-/* 'switch_module_runtime' will start up in a thread by itself just by having it exist 
-   if it returns anything but SWITCH_STATUS_TERM it will be called again automaticly
-*/
-
-
-//switch_status_t switch_module_runtime(void)
 
 /* For Emacs:
  * Local Variables:

Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c	Thu Jun 14 12:39:04 2007
@@ -31,7 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_rss";
+SWITCH_MODULE_LOAD_FUNCTION(mod_rss_load);
+SWITCH_MODULE_DEFINITION(mod_rss, mod_rss_load, NULL, NULL);
 
 typedef enum {
 	SFLAG_INSTRUCT = (1 << 0),
@@ -612,7 +613,7 @@
 	switch_core_session_reset(session);
 }
 
-static const switch_application_interface_t rss_application_interface = {
+static switch_application_interface_t rss_application_interface = {
 	/*.interface_name */ "rss",
 	/*.application_function */ rss_function,
 	NULL, NULL, NULL,
@@ -635,7 +636,7 @@
 };
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_rss_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &rss_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_skel/mod_skel.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_skel/mod_skel.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_skel/mod_skel.c	Thu Jun 14 12:39:04 2007
@@ -32,7 +32,11 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_skel";
+//SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skel_shutdown);
+//SWITCH_MODULE_RUNTIME_FUNCTION(mod_skel_runtime);
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_skel_load);
+SWITCH_MODULE_DEFINITION(mod_skel, mod_skel_load, NULL, NULL);
 
 static switch_loadable_module_interface_t skel_module_interface = {
 	/*.module_name */ modname,
@@ -47,7 +51,7 @@
 	/*.directory_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_skel_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &skel_module_interface;
@@ -60,7 +64,7 @@
 
 /*
   Called when the system shuts down
-SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skel_shutdown);
 {
 	return SWITCH_STATUS_SUCCESS;
 }
@@ -69,7 +73,7 @@
 /*
   If it exists, this is called in it's own thread when the module-load completes
   If it returns anything but SWITCH_STATUS_TERM it will be called again automaticly
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_skel_runtime);
 {
 	while(looping)
 	{

Modified: freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	Thu Jun 14 12:39:04 2007
@@ -51,7 +51,8 @@
 #undef SWIFT_FAILED
 #define SWIFT_FAILED(r) ((void *)(r) < (void *)0)
 
-static const char modname[] = "mod_cepstral";
+SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_load);
+SWITCH_MODULE_DEFINITION(mod_cepstral, mod_cepstral_load, NULL, NULL);
 
 static swift_engine *engine;
 
@@ -401,7 +402,7 @@
 
 }
 
-static const switch_speech_interface_t cepstral_speech_interface = {
+static switch_speech_interface_t cepstral_speech_interface = {
 	/*.interface_name */ "cepstral",
 	/*.speech_open */ cepstral_speech_open,
 	/*.speech_close */ cepstral_speech_close,
@@ -413,7 +414,7 @@
 	/*.speech_numeric_param_tts */ cepstral_float_param_tts
 };
 
-static const switch_loadable_module_interface_t cepstral_module_interface = {
+static switch_loadable_module_interface_t cepstral_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ NULL,
 	/*.timer_interface */ NULL,
@@ -426,7 +427,7 @@
 	/*.directory_interface */ NULL
 };
 
-switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_load)
 {
 
 	/* Open the Swift TTS Engine */

Modified: freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/mod_lumenvox.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/mod_lumenvox.cpp	(original)
+++ freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/mod_lumenvox.cpp	Thu Jun 14 12:39:04 2007
@@ -38,7 +38,9 @@
 #include <switch.h>
 #include <sstream>
 
-static const char modname[] = "mod_lumenvox";
+SWITCH_MODULE_LOAD_FUNCTION(mod_lumenvox_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_lumenvox_shutdown);
+SWITCH_MODULE_DEFINITION(mod_lumenvox, mod_lumenvox_load, mod_lumenvox_shutdown, NULL);
 
 typedef enum {
 	LVFLAG_HAS_TEXT = (1 << 0),
@@ -441,7 +443,7 @@
 	/*.asr_interface */ &lumenvox_asr_interface
 };
 
-switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_lumenvox_load)
 {
 	LVSpeechPort::RegisterAppLogMsg(log_callback, NULL, 5);
 	//LVSpeechPort::SetClientPropertyEx(PROP_EX_SRE_SERVERS, PROP_EX_VALUE_TYPE_STRING, (void *)"127.0.0.1");
@@ -453,7 +455,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_lumenvox_shutdown)
 {
 	return SWITCH_STATUS_UNLOAD;
 }

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c	Thu Jun 14 12:39:04 2007
@@ -32,7 +32,9 @@
  *
  */
 #include "switch.h"
-static const char modname[] = "mod_amr";
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load);
+SWITCH_MODULE_DEFINITION(mod_amr, mod_amr_load, NULL, NULL);
 
 #ifndef AMR_PASSTHROUGH
 #include "amr/interf_enc.h"
@@ -288,7 +290,7 @@
 
 /* Registration */
 
-static const switch_codec_implementation_t amr_implementation = {
+static switch_codec_implementation_t amr_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 96,
 	/*.iananame */ "AMR",
@@ -308,7 +310,7 @@
 	/*.destroy */ switch_amr_destroy,
 };
 
-static const switch_codec_interface_t amr_codec_interface = {
+static switch_codec_interface_t amr_codec_interface = {
 	/*.interface_name */ "GSM-AMR",
 	/*.implementations */ &amr_implementation,
 };
@@ -322,7 +324,7 @@
 	/*.application_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load)
 {
 #ifndef AMR_PASSTHROUGH
 	char *cf = "amr.conf";

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c	Thu Jun 14 12:39:04 2007
@@ -32,8 +32,8 @@
 #include <switch.h>
 #include <g7xx/g711.h>
 
-
-static const char modname[] = "mod_g711";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g711_load);
+SWITCH_MODULE_DEFINITION(mod_g711, mod_g711_load, NULL, NULL);
 
 
 static switch_status_t switch_g711u_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
@@ -182,7 +182,7 @@
 /* Registration */
 
 
-static const switch_codec_implementation_t g711u_8k_120ms_implementation = {
+static switch_codec_implementation_t g711u_8k_120ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
 	/*.iananame */ "PCMU",
@@ -202,7 +202,7 @@
 	/*.destroy */ switch_g711u_destroy
 };
 
-static const switch_codec_implementation_t g711u_8k_60ms_implementation = {
+static switch_codec_implementation_t g711u_8k_60ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
 	/*.iananame */ "PCMU",
@@ -223,7 +223,7 @@
 	/*.next */ &g711u_8k_120ms_implementation
 };
 
-static const switch_codec_implementation_t g711u_8k_30ms_implementation = {
+static switch_codec_implementation_t g711u_8k_30ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
 	/*.iananame */ "PCMU",
@@ -244,7 +244,7 @@
 	/*.next */ &g711u_8k_60ms_implementation
 };
 
-static const switch_codec_implementation_t g711u_8k_20ms_implementation = {
+static switch_codec_implementation_t g711u_8k_20ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
 	/*.iananame */ "PCMU",
@@ -265,7 +265,7 @@
 	/*.next */ &g711u_8k_30ms_implementation
 };
 
-static const switch_codec_implementation_t g711u_8k_10ms_implementation = {
+static switch_codec_implementation_t g711u_8k_10ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
 	/*.iananame */ "PCMU",
@@ -288,7 +288,7 @@
 
 
 
-static const switch_codec_implementation_t g711a_8k_120ms_implementation = {
+static switch_codec_implementation_t g711a_8k_120ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 8,
 	/*.iananame */ "PCMA",
@@ -308,7 +308,7 @@
 	/*.destroy */ switch_g711a_destroy
 };
 
-static const switch_codec_implementation_t g711a_8k_60ms_implementation = {
+static switch_codec_implementation_t g711a_8k_60ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 8,
 	/*.iananame */ "PCMA",
@@ -329,7 +329,7 @@
 	/*.next */ &g711a_8k_120ms_implementation
 };
 
-static const switch_codec_implementation_t g711a_8k_30ms_implementation = {
+static switch_codec_implementation_t g711a_8k_30ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 8,
 	/*.iananame */ "PCMA",
@@ -350,7 +350,7 @@
 	/*.next */ &g711a_8k_60ms_implementation
 };
 
-static const switch_codec_implementation_t g711a_8k_20ms_implementation = {
+static switch_codec_implementation_t g711a_8k_20ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 8,
 	/*.iananame */ "PCMA",
@@ -371,7 +371,7 @@
 	/*.next */ &g711a_8k_30ms_implementation
 };
 
-static const switch_codec_implementation_t g711a_8k_10ms_implementation = {
+static switch_codec_implementation_t g711a_8k_10ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 8,
 	/*.iananame */ "PCMA",
@@ -394,12 +394,12 @@
 
 
 
-static const switch_codec_interface_t g711a_codec_interface = {
+static switch_codec_interface_t g711a_codec_interface = {
 	/*.interface_name */ "g711 alaw",
 	/*.implementations */ &g711a_8k_10ms_implementation
 };
 
-static const switch_codec_interface_t g711u_codec_interface = {
+static switch_codec_interface_t g711u_codec_interface = {
 	/*.interface_name */ "g711 ulaw",
 	/*.implementations */ &g711u_8k_10ms_implementation,
 	/*.next */ &g711a_codec_interface
@@ -415,7 +415,7 @@
 };
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g711_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &g711_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c	Thu Jun 14 12:39:04 2007
@@ -33,7 +33,8 @@
 #include <switch.h>
 #include "g7xx/g722.h"
 
-static const char modname[] = "mod_g722";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g722_load);
+SWITCH_MODULE_DEFINITION(mod_g722, mod_g722_load, NULL, NULL);
 
 struct g722_context {
 	g722_decode_state_t decoder_object;
@@ -117,7 +118,7 @@
 
 /* Registration */
 
-static const switch_codec_implementation_t g722_8k_implementation = {
+static switch_codec_implementation_t g722_8k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 109,
 	/*.iananame */ "G722_8",
@@ -137,7 +138,7 @@
 	/*.destroy */ switch_g722_destroy,
 };
 
-static const switch_codec_implementation_t g722_16k_implementation = {
+static switch_codec_implementation_t g722_16k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 9,
 	/*.iananame */ "G722",
@@ -158,7 +159,7 @@
 	/*.next */ &g722_8k_implementation
 };
 
-static const switch_codec_interface_t g722_codec_interface = {
+static switch_codec_interface_t g722_codec_interface = {
 	/*.interface_name */ "g722",
 	/*.implementations */ &g722_16k_implementation
 };
@@ -172,7 +173,7 @@
 	/*.application_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g722_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &g722_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c	Thu Jun 14 12:39:04 2007
@@ -49,7 +49,8 @@
 enum Crate WrkRate = Rate63;
 #endif
 
-static const char modname[] = "mod_g723_1";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g723_1_load);
+SWITCH_MODULE_DEFINITION(mod_g723_1, mod_g723_1_load, NULL, NULL);
 
 #ifndef G723_PASSTHROUGH
 struct g723_context {
@@ -168,7 +169,7 @@
 
 /* Registration */
 
-static const switch_codec_implementation_t g723_1_implementation = {
+static switch_codec_implementation_t g723_1_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 4,
 	/*.iananame */ "G723",
@@ -188,7 +189,7 @@
 	/*.destroy */ switch_g723_destroy,
 };
 
-static const switch_codec_interface_t g723_1_codec_interface = {
+static switch_codec_interface_t g723_1_codec_interface = {
 	/*.interface_name */ "g723.1 6.3k",
 	/*.implementations */ &g723_1_implementation,
 };
@@ -202,7 +203,7 @@
 	/*.application_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g723_1_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &g723_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c	Thu Jun 14 12:39:04 2007
@@ -33,7 +33,8 @@
 #include "g72x.h"
 #include "switch_bitpack.h"
 
-static const char modname[] = "mod_g726";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g726_load);
+SWITCH_MODULE_DEFINITION(mod_g726, mod_g726_load, NULL, NULL);
 
 typedef int (*encoder_t) (int, int, g726_state *);
 typedef int (*decoder_t) (int, int, g726_state *);
@@ -203,7 +204,7 @@
 
 /* Registration */
 
-static const switch_codec_implementation_t g726_16k_implementation = {
+static switch_codec_implementation_t g726_16k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 127,
 	/*.iananame */ "G726-16",
@@ -224,7 +225,7 @@
 };
 
 
-static const switch_codec_implementation_t g726_24k_implementation = {
+static switch_codec_implementation_t g726_24k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 126,
 	/*.iananame */ "G726-24",
@@ -244,7 +245,7 @@
 	/*.destroy */ switch_g726_destroy,
 };
 
-static const switch_codec_implementation_t g726_32k_implementation = {
+static switch_codec_implementation_t g726_32k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 2,
 	/*.iananame */ "G726-32",
@@ -264,7 +265,7 @@
 	/*.destroy */ switch_g726_destroy,
 };
 
-static const switch_codec_implementation_t g726_40k_implementation = {
+static switch_codec_implementation_t g726_40k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 125,
 	/*.iananame */ "G726-40",
@@ -286,7 +287,7 @@
 
 
 
-static const switch_codec_implementation_t aal2_g726_16k_implementation = {
+static switch_codec_implementation_t aal2_g726_16k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 124,
 	/*.iananame */ "AAL2-G726-16",
@@ -307,7 +308,7 @@
 };
 
 
-static const switch_codec_implementation_t aal2_g726_24k_implementation = {
+static switch_codec_implementation_t aal2_g726_24k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 123,
 	/*.iananame */ "AAL2-G726-24",
@@ -327,7 +328,7 @@
 	/*.destroy */ switch_g726_destroy,
 };
 
-static const switch_codec_implementation_t aal2_g726_32k_implementation = {
+static switch_codec_implementation_t aal2_g726_32k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 2,
 	/*.iananame */ "AAL2-G726-32",
@@ -347,7 +348,7 @@
 	/*.destroy */ switch_g726_destroy,
 };
 
-static const switch_codec_implementation_t aal2_g726_40k_implementation = {
+static switch_codec_implementation_t aal2_g726_40k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 122,
 	/*.iananame */ "AAL2-G726-40",
@@ -367,50 +368,48 @@
 	/*.destroy */ switch_g726_destroy,
 };
 
-const switch_codec_interface_t g726_16k_codec_interface = {
+static switch_codec_interface_t g726_16k_codec_interface = {
 	/*.interface_name */ "G.726 16k",
 	/*.implementations */ &g726_16k_implementation,
 };
 
-const switch_codec_interface_t g726_24k_codec_interface = {
+static switch_codec_interface_t g726_24k_codec_interface = {
 	/*.interface_name */ "G.726 24k",
 	/*.implementations */ &g726_24k_implementation,
 	/*.next */ &g726_16k_codec_interface
 };
 
-const switch_codec_interface_t g726_32k_codec_interface = {
+static switch_codec_interface_t g726_32k_codec_interface = {
 	/*.interface_name */ "G.726 32k",
 	/*.implementations */ &g726_32k_implementation,
 	/*.next */ &g726_24k_codec_interface
 };
 
-const switch_codec_interface_t g726_40k_codec_interface = {
+static switch_codec_interface_t g726_40k_codec_interface = {
 	/*.interface_name */ "G.726 40k",
 	/*.implementations */ &g726_40k_implementation,
 	/*.next */ &g726_32k_codec_interface
 };
 
-
-
-const switch_codec_interface_t aal2_g726_16k_codec_interface = {
+static switch_codec_interface_t aal2_g726_16k_codec_interface = {
 	/*.interface_name */ "G.726 16k (aal2)",
 	/*.implementations */ &aal2_g726_16k_implementation,
 	/*.next */ &g726_40k_codec_interface
 };
 
-const switch_codec_interface_t aal2_g726_24k_codec_interface = {
+static switch_codec_interface_t aal2_g726_24k_codec_interface = {
 	/*.interface_name */ "G.726 24k (aal2)",
 	/*.implementations */ &aal2_g726_24k_implementation,
 	/*.next */ &aal2_g726_16k_codec_interface
 };
 
-const switch_codec_interface_t aal2_g726_32k_codec_interface = {
+static switch_codec_interface_t aal2_g726_32k_codec_interface = {
 	/*.interface_name */ "G.726 32k (aal2)",
 	/*.implementations */ &aal2_g726_32k_implementation,
 	/*.next */ &aal2_g726_24k_codec_interface
 };
 
-const switch_codec_interface_t aal2_g726_40k_codec_interface = {
+static switch_codec_interface_t aal2_g726_40k_codec_interface = {
 	/*.interface_name */ "G.726 40k (aal2)",
 	/*.implementations */ &aal2_g726_40k_implementation,
 	/*.next */ &aal2_g726_32k_codec_interface
@@ -427,7 +426,7 @@
 	/*.application_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g726_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &g726_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c	Thu Jun 14 12:39:04 2007
@@ -31,11 +31,11 @@
  * mod_g729.c -- G729 Codec Module
  *
  */
-
-static const char modname[] = "mod_g729";
-
 #include "switch.h"
 
+SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load);
+SWITCH_MODULE_DEFINITION(mod_g729, mod_g729_load, NULL, NULL);
+
 #ifndef G729_PASSTHROUGH
 #include "g729/g729.h"
 
@@ -212,7 +212,7 @@
 
 /* Registration */
 
-static const switch_codec_implementation_t g729_40ms_8k_implementation = {
+static switch_codec_implementation_t g729_40ms_8k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 18,
 	/*.iananame */ "G729",
@@ -232,7 +232,7 @@
 	/*.destroy */ switch_g729_destroy,
 };
 
-static const switch_codec_implementation_t g729_30ms_8k_implementation = {
+static switch_codec_implementation_t g729_30ms_8k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 18,
 	/*.iananame */ "G729",
@@ -253,7 +253,7 @@
 	&g729_40ms_8k_implementation
 };
 
-static const switch_codec_implementation_t g729_10ms_8k_implementation = {
+static switch_codec_implementation_t g729_10ms_8k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 18,
 	/*.iananame */ "G729",
@@ -274,7 +274,7 @@
 	&g729_30ms_8k_implementation
 };
 
-static const switch_codec_implementation_t g729_8k_implementation = {
+static switch_codec_implementation_t g729_8k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 18,
 	/*.iananame */ "G729",
@@ -295,7 +295,7 @@
 	&g729_10ms_8k_implementation
 };
 
-static const switch_codec_interface_t g729_codec_interface = {
+static switch_codec_interface_t g729_codec_interface = {
 	/*.interface_name */ "g729",
 	/*.implementations */ &g729_8k_implementation,
 	/*.next */ NULL
@@ -310,7 +310,7 @@
 	/*.application_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &g729_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c	Thu Jun 14 12:39:04 2007
@@ -31,7 +31,10 @@
  */
 #include "switch.h"
 #include "gsm.h"
-static const char modname[] = "mod_gsm";
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_gsm_load);
+SWITCH_MODULE_DEFINITION(mod_gsm, mod_gsm_load, NULL, NULL);
+
 struct gsm_context {
 	gsm encoder;
 	gsm decoder;
@@ -131,7 +134,7 @@
 
 
 /* Registration */
-static const switch_codec_implementation_t gsm_8k_implementation = {
+static switch_codec_implementation_t gsm_8k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 3,
 	/*.iananame */ "GSM",
@@ -150,7 +153,7 @@
 	/*.decode */ switch_gsm_decode,
 	/*.destroy */ switch_gsm_destroy,
 };
-static const switch_codec_interface_t gsm_codec_interface = {
+static switch_codec_interface_t gsm_codec_interface = {
 	/*.interface_name */ "gsm",
 	/*.implementations */ &gsm_8k_implementation,
 };
@@ -162,7 +165,8 @@
 	/*.codec_interface */ &gsm_codec_interface,
 	/*.application_interface */ NULL
 };
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_gsm_load)
 {
 
 	/* connect my internal structure to the blank pointer passed to me */

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c	Thu Jun 14 12:39:04 2007
@@ -31,8 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_h26x";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_h26x_load);
+SWITCH_MODULE_DEFINITION(mod_h26x, mod_h26x_load, NULL, NULL);
 
 static switch_status_t switch_h26x_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
 {
@@ -75,7 +75,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_codec_implementation_t h264_90000_implementation = {
+static switch_codec_implementation_t h264_90000_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_VIDEO,
 	/*.ianacode */ 99,
 	/*.iananame */ "H264",
@@ -96,7 +96,7 @@
 	/*.next = */
 };
 
-static const switch_codec_implementation_t h263_90000_implementation = {
+static switch_codec_implementation_t h263_90000_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_VIDEO,
 	/*.ianacode */ 34,
 	/*.iananame */ "H263",
@@ -117,7 +117,7 @@
 	/*.next = */&h264_90000_implementation
 };
 
-static const switch_codec_interface_t h26x_codec_interface = {
+static switch_codec_interface_t h26x_codec_interface = {
 	/*.interface_name */ "h26x video (passthru)",
 	/*.implementations */ &h263_90000_implementation
 };
@@ -132,8 +132,7 @@
 	/*.api_interface */ NULL,
 };
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_h26x_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &h26x_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c	Thu Jun 14 12:39:04 2007
@@ -34,7 +34,8 @@
 #include "iLBC_decode.h"
 #include "iLBC_define.h"
 
-static const char modname[] = "mod_ilbc";
+SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load);
+SWITCH_MODULE_DEFINITION(mod_ilbc, mod_ilbc_load, NULL, NULL);
 
 struct ilbc_context {
 	iLBC_Enc_Inst_t encoder;
@@ -181,7 +182,7 @@
 
 /* Registration */
 
-static const switch_codec_implementation_t ilbc_8k_30ms_implementation = {
+static switch_codec_implementation_t ilbc_8k_30ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 97,
 	/*.iananame */ "iLBC",
@@ -201,7 +202,7 @@
 	/*.destroy */ switch_ilbc_destroy
 };
 
-static const switch_codec_implementation_t ilbc_8k_20ms_implementation = {
+static switch_codec_implementation_t ilbc_8k_20ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 97,
 	/*.iananame */ "iLBC",
@@ -224,7 +225,7 @@
 
 
 
-static const switch_codec_implementation_t ilbc_102_8k_30ms_implementation = {
+static switch_codec_implementation_t ilbc_102_8k_30ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 102,
 	/*.iananame */ "iLBC",
@@ -244,7 +245,7 @@
 	/*.destroy */ switch_ilbc_destroy
 };
 
-static const switch_codec_implementation_t ilbc_102_8k_20ms_implementation = {
+static switch_codec_implementation_t ilbc_102_8k_20ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 102,
 	/*.iananame */ "iLBC102",
@@ -266,7 +267,7 @@
 };
 
 
-static const switch_codec_implementation_t ilbc_8k_20ms_nonext_implementation = {
+static switch_codec_implementation_t ilbc_8k_20ms_nonext_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 97,
 	/*.iananame */ "iLBC20ms",
@@ -287,18 +288,18 @@
 };
 
 
-static const switch_codec_interface_t ilbc_20ms_codec_interface = {
+static switch_codec_interface_t ilbc_20ms_codec_interface = {
 	/*.interface_name */ "ilbc",
 	/*.implementations */ &ilbc_8k_20ms_nonext_implementation
 };
 
-static const switch_codec_interface_t ilbc_102_codec_interface = {
+static switch_codec_interface_t ilbc_102_codec_interface = {
 	/*.interface_name */ "ilbc",
 	/*.implementations */ &ilbc_102_8k_20ms_implementation,
 	/*.next */ &ilbc_20ms_codec_interface
 };
 
-static const switch_codec_interface_t ilbc_codec_interface = {
+static switch_codec_interface_t ilbc_codec_interface = {
 	/*.interface_name */ "ilbc",
 	/*.implementations */ &ilbc_8k_20ms_implementation,
 	/*.next */ &ilbc_102_codec_interface
@@ -314,9 +315,7 @@
 	/*.application_interface */ NULL
 };
 
-
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load)
 {
 
 	/* connect my internal structure to the blank pointer passed to me */

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c	Thu Jun 14 12:39:04 2007
@@ -31,8 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_l16";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_l16_load);
+SWITCH_MODULE_DEFINITION(mod_l16, mod_l16_load, NULL, NULL);
 
 static switch_status_t switch_raw_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
 {
@@ -86,7 +86,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_codec_implementation_t raw_32k_60ms_implementation = {
+static switch_codec_implementation_t raw_32k_60ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 119,
 	/*.iananame */ "L16",
@@ -107,7 +107,7 @@
 		/*.next = */
 };
 
-static const switch_codec_implementation_t raw_32k_30ms_implementation = {
+static switch_codec_implementation_t raw_32k_30ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 119,
 	/*.iananame */ "L16",
@@ -128,7 +128,7 @@
 	/*.next = */ &raw_32k_60ms_implementation
 };
 
-static const switch_codec_implementation_t raw_32k_20ms_implementation = {
+static switch_codec_implementation_t raw_32k_20ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 119,
 	/*.iananame */ "L16",
@@ -149,7 +149,7 @@
 	/*.next = */ &raw_32k_30ms_implementation
 };
 
-static const switch_codec_implementation_t raw_32k_10ms_implementation = {
+static switch_codec_implementation_t raw_32k_10ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 119,
 	/*.iananame */ "L16",
@@ -170,7 +170,7 @@
 	/*.next = */ &raw_32k_20ms_implementation
 };
 
-static const switch_codec_implementation_t raw_22k_20ms_implementation = {
+static switch_codec_implementation_t raw_22k_20ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 118,
 	/*.iananame */ "L16",
@@ -191,7 +191,7 @@
 	/*.next = */ &raw_32k_10ms_implementation
 };
 
-static const switch_codec_implementation_t raw_16k_120ms_implementation = {
+static switch_codec_implementation_t raw_16k_120ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 117,
 	/*.iananame */ "L16",
@@ -212,7 +212,7 @@
 	/*.next */ &raw_22k_20ms_implementation
 };
 
-static const switch_codec_implementation_t raw_16k_60ms_implementation = {
+static switch_codec_implementation_t raw_16k_60ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 117,
 	/*.iananame */ "L16",
@@ -233,7 +233,7 @@
 	/*.next */ &raw_16k_120ms_implementation
 };
 
-static const switch_codec_implementation_t raw_16k_30ms_implementation = {
+static switch_codec_implementation_t raw_16k_30ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 117,
 	/*.iananame */ "L16",
@@ -254,7 +254,7 @@
 	/*.next */ &raw_16k_60ms_implementation
 };
 
-static const switch_codec_implementation_t raw_16k_20ms_implementation = {
+static switch_codec_implementation_t raw_16k_20ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 117,
 	/*.iananame */ "L16",
@@ -275,7 +275,7 @@
 	/*.next = */ &raw_16k_30ms_implementation
 };
 
-static const switch_codec_implementation_t raw_16k_10ms_implementation = {
+static switch_codec_implementation_t raw_16k_10ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 117,
 	/*.iananame */ "L16",
@@ -299,7 +299,7 @@
 ///////////////////////////////
 
 
-static const switch_codec_implementation_t raw_8k_120ms_implementation = {
+static switch_codec_implementation_t raw_8k_120ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
@@ -321,7 +321,7 @@
 };
 
 
-static const switch_codec_implementation_t raw_8k_60ms_implementation = {
+static switch_codec_implementation_t raw_8k_60ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
@@ -342,7 +342,7 @@
 	/*.next */ &raw_8k_120ms_implementation
 };
 
-static const switch_codec_implementation_t raw_8k_30ms_implementation = {
+static switch_codec_implementation_t raw_8k_30ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
@@ -362,7 +362,7 @@
 	/*.destroy */ switch_raw_destroy,
 	/*.next */ &raw_8k_60ms_implementation
 };
-static const switch_codec_implementation_t raw_8k_20ms_implementation = {
+static switch_codec_implementation_t raw_8k_20ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
@@ -385,7 +385,7 @@
 
 
 
-static const switch_codec_implementation_t raw_8k_10ms_implementation = {
+static switch_codec_implementation_t raw_8k_10ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
@@ -407,7 +407,7 @@
 };
 
 
-static const switch_codec_interface_t raw_codec_interface = {
+static switch_codec_interface_t raw_codec_interface = {
 	/*.interface_name */ "raw signed linear (16 bit)",
 	/*.implementations */ &raw_8k_10ms_implementation
 };
@@ -424,7 +424,7 @@
 };
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_l16_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &raw_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_lpc10/mod_lpc10.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_lpc10/mod_lpc10.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_lpc10/mod_lpc10.c	Thu Jun 14 12:39:04 2007
@@ -156,7 +156,7 @@
 
 /* Registration */
 
-static const switch_codec_implementation_t lpc10_implementation = {
+static switch_codec_implementation_t lpc10_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 7,
 	/*.iananame */ "LPC",

Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c	Thu Jun 14 12:39:04 2007
@@ -33,9 +33,10 @@
 #include <speex/speex.h>
 #include <speex/speex_preprocess.h>
 
-static const char modname[] = "mod_speex";
+SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load);
+SWITCH_MODULE_DEFINITION(mod_speex, mod_speex_load, NULL, NULL);
 
-static const switch_codec_settings_t default_codec_settings = {
+static switch_codec_settings_t default_codec_settings = {
 	/*.quality */ 5,
 	/*.complexity */ 5,
 	/*.enhancement */ 1,
@@ -261,7 +262,7 @@
 }
 
 /* Registration */
-static const switch_codec_implementation_t speex_32k_implementation = {
+static switch_codec_implementation_t speex_32k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 102,
 	/*.iananame */ "speex",
@@ -281,7 +282,7 @@
 	/*.destroy */ switch_speex_destroy
 };
 
-static const switch_codec_implementation_t speex_16k_implementation = {
+static switch_codec_implementation_t speex_16k_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 99,
 	/*.iananame */ "speex",
@@ -303,7 +304,7 @@
 };
 
 
-static const switch_codec_implementation_t speex_8k_60ms_implementation = {
+static switch_codec_implementation_t speex_8k_60ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 98,
 	/*.iananame */ "speex",
@@ -324,7 +325,7 @@
 	/*.next */ &speex_16k_implementation
 };
 
-static const switch_codec_implementation_t speex_8k_40ms_implementation = {
+static switch_codec_implementation_t speex_8k_40ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 98,
 	/*.iananame */ "speex",
@@ -347,7 +348,7 @@
 };
 
 
-static const switch_codec_implementation_t speex_8k_30ms_implementation = {
+static switch_codec_implementation_t speex_8k_30ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 98,
 	/*.iananame */ "speex",
@@ -368,7 +369,7 @@
 	/*.next */ &speex_8k_40ms_implementation
 };
 
-static const switch_codec_implementation_t speex_8k_20ms_implementation = {
+static switch_codec_implementation_t speex_8k_20ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 98,
 	/*.iananame */ "speex",
@@ -389,7 +390,7 @@
 	/*.next */ &speex_8k_30ms_implementation
 };
 
-static const switch_codec_interface_t speex_codec_interface = {
+static switch_codec_interface_t speex_codec_interface = {
 	/*.interface_name */ "speex",
 	/*.implementations */ &speex_8k_20ms_implementation
 };
@@ -403,7 +404,7 @@
 	/*.application_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &speex_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c	Thu Jun 14 12:39:04 2007
@@ -34,8 +34,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-
-static const char modname[] = "mod_dialplan_directory";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load);
+SWITCH_MODULE_DEFINITION(mod_dialplan_directory, mod_dialplan_directory_load, NULL, NULL);
 
 static struct {
 	char *directory_name;
@@ -151,13 +151,13 @@
 }
 
 
-static const switch_dialplan_interface_t directory_dialplan_interface = {
+static switch_dialplan_interface_t directory_dialplan_interface = {
 	/*.interface_name = */ "directory",
 	/*.hunt_function = */ directory_dialplan_hunt
 		/*.next = NULL */
 };
 
-static const switch_loadable_module_interface_t directory_dialplan_module_interface = {
+static switch_loadable_module_interface_t directory_dialplan_module_interface = {
 	/*.module_name = */ modname,
 	/*.endpoint_interface = */ NULL,
 	/*.timer_interface = */ NULL,
@@ -166,7 +166,7 @@
 	/*.application_interface = */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load)
 {
 
 	load_config();

Modified: freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	Thu Jun 14 12:39:04 2007
@@ -34,7 +34,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-static const char modname[] = "mod_dialplan_xml";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_xml_load);
+SWITCH_MODULE_DEFINITION(mod_dialplan_xml, mod_dialplan_xml_load, NULL, NULL);
 
 typedef enum {
 	BREAK_ON_TRUE,
@@ -377,13 +378,13 @@
 }
 
 
-static const switch_dialplan_interface_t dialplan_interface = {
+static switch_dialplan_interface_t dialplan_interface = {
 	/*.interface_name = */ "XML",
 	/*.hunt_function = */ dialplan_hunt
 		/*.next = NULL */
 };
 
-static const switch_loadable_module_interface_t dialplan_module_interface = {
+static switch_loadable_module_interface_t dialplan_module_interface = {
 	/*.module_name = */ modname,
 	/*.endpoint_interface = */ NULL,
 	/*.timer_interface = */ NULL,
@@ -392,7 +393,7 @@
 	/*.application_interface = */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_xml_load)
 {
 
 	/* connect my internal structure to the blank pointer passed to me */

Modified: freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c	Thu Jun 14 12:39:04 2007
@@ -40,7 +40,8 @@
 #include <ldap.h>
 #endif
 
-static const char modname[] = "mod_ldap";
+SWITCH_MODULE_LOAD_FUNCTION(mod_ldap_load);
+SWITCH_MODULE_DEFINITION(mod_ldap, mod_ldap_load, NULL, NULL);
 
 struct ldap_context {
 	LDAP *ld;
@@ -197,7 +198,7 @@
 }
 
 
-static const switch_directory_interface_t ldap_directory_interface = {
+static switch_directory_interface_t ldap_directory_interface = {
 	/*.interface_name */ "ldap",
 	/*.directory_open */ mod_ldap_open,
 	/*.directory_close */ mod_ldap_close,
@@ -207,7 +208,7 @@
 };
 
 
-static switch_loadable_module_interface_t skel_module_interface = {
+static switch_loadable_module_interface_t ldap_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ NULL,
 	/*.timer_interface */ NULL,
@@ -220,10 +221,10 @@
 	/*.directory_interface */ &ldap_directory_interface
 };
 
-switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_ldap_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
-	*module_interface = &skel_module_interface;
+	*module_interface = &ldap_module_interface;
 
 	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_alsa/mod_alsa.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_alsa/mod_alsa.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_alsa/mod_alsa.c	Thu Jun 14 12:39:04 2007
@@ -39,7 +39,9 @@
 
 #define MY_EVENT_RINGING "alsa::ringing"
 
-static const char modname[] = "mod_alsa";
+SWITCH_MODULE_LOAD_FUNCTION(mod_alsa_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_alsa_shutdown);
+SWITCH_MODULE_DEFINITION(mod_alsa, mod_alsa_load, mod_alsa_shutdown, NULL);
 
 static switch_memory_pool_t *module_pool = NULL;
 //static int running = 1;
@@ -733,7 +735,7 @@
 	/*.next */
 };
 
-static const switch_state_handler_table_t channel_event_handlers = {
+static switch_state_handler_table_t channel_event_handlers = {
 	/*.on_init */ channel_on_init,
 	/*.on_ring */ channel_on_ring,
 	/*.on_execute */ channel_on_execute,
@@ -742,7 +744,7 @@
 	/*.on_transmit */ channel_on_transmit
 };
 
-static const switch_io_routines_t channel_io_routines = {
+static switch_io_routines_t channel_io_routines = {
 	/*.outgoing_channel */ channel_outgoing_channel,
 	/*.read_frame */ channel_read_frame,
 	/*.write_frame */ channel_write_frame,
@@ -753,7 +755,7 @@
 	/*.receive_message */ channel_receive_message
 };
 
-static const switch_endpoint_interface_t channel_endpoint_interface = {
+static switch_endpoint_interface_t channel_endpoint_interface = {
 	/*.interface_name */ "alsa",
 	/*.io_routines */ &channel_io_routines,
 	/*.event_handlers */ &channel_event_handlers,
@@ -761,7 +763,7 @@
 	/*.next */ NULL
 };
 
-static const switch_loadable_module_interface_t channel_module_interface = {
+static switch_loadable_module_interface_t channel_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ &channel_endpoint_interface,
 	/*.timer_interface */ NULL,
@@ -825,7 +827,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_alsa_load)
 {
 
 	switch_status_t status;
@@ -943,7 +945,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_alsa_shutdown)
 {
 	deactivate_audio_device();
 

Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Thu Jun 14 12:39:04 2007
@@ -43,7 +43,9 @@
 #define DL_EVENT_CONNECTED "dingaling::connected"
 #define MDL_CHAT_PROTO "jingle"
 
-static const char modname[] = "mod_dingaling";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown);
+SWITCH_MODULE_DEFINITION(mod_dingaling, mod_dingaling_load, mod_dingaling_shutdown, NULL);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -1567,7 +1569,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_state_handler_table_t channel_event_handlers = {
+static switch_state_handler_table_t channel_event_handlers = {
 	/*.on_init */ channel_on_init,
 	/*.on_ring */ channel_on_ring,
 	/*.on_execute */ channel_on_execute,
@@ -1576,7 +1578,7 @@
 	/*.on_transmit */ channel_on_transmit
 };
 
-static const switch_io_routines_t channel_io_routines = {
+static switch_io_routines_t channel_io_routines = {
 	/*.outgoing_channel */ channel_outgoing_channel,
 	/*.read_frame */ channel_read_frame,
 	/*.write_frame */ channel_write_frame,
@@ -1588,7 +1590,7 @@
 	/*.receive_event */ channel_receive_event
 };
 
-static const switch_endpoint_interface_t channel_endpoint_interface = {
+static switch_endpoint_interface_t channel_endpoint_interface = {
 	/*.interface_name */ "dingaling",
 	/*.io_routines */ &channel_io_routines,
 	/*.event_handlers */ &channel_event_handlers,
@@ -1629,12 +1631,12 @@
 	/*.next */ &logout_api_interface
 };
 
-static const switch_chat_interface_t channel_chat_interface = {
+static switch_chat_interface_t channel_chat_interface = {
 	/*.name */ MDL_CHAT_PROTO,
 	/*.chat_send */ chat_send,
 };
 
-static const switch_loadable_module_interface_t channel_module_interface = {
+static switch_loadable_module_interface_t channel_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ &channel_endpoint_interface,
 	/*.timer_interface */ NULL,
@@ -1824,7 +1826,7 @@
 
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load)
 {
 
 	if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
@@ -1927,8 +1929,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown)
 {
 	sign_off();
 

Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c	Thu Jun 14 12:39:04 2007
@@ -31,6 +31,11 @@
  */
 #include <switch.h>
 
+SWITCH_MODULE_LOAD_FUNCTION(mod_iax_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_iax_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime);
+SWITCH_MODULE_DEFINITION(mod_iax, mod_iax_load, mod_iax_shutdown, mod_iax_runtime);
+
 #include <iax2.h>
 #include <iax-client.h>
 #include <iax2-parser.h>
@@ -38,8 +43,7 @@
 #include <sys/timeb.h>
 #endif
 
-static const char modname[] = "mod_iax";
-
+static switch_endpoint_interface_t *channel_endpoint_interface;
 static switch_memory_pool_t *module_pool = NULL;
 static int running = 1;
 
@@ -770,44 +774,6 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_state_handler_table_t channel_event_handlers = {
-	/*.on_init */ channel_on_init,
-	/*.on_ring */ channel_on_ring,
-	/*.on_execute */ channel_on_execute,
-	/*.on_hangup */ channel_on_hangup,
-	/*.on_loopback */ channel_on_loopback,
-	/*.on_transmit */ channel_on_transmit
-};
-
-static const switch_io_routines_t channel_io_routines = {
-	/*.outgoing_channel */ channel_outgoing_channel,
-	/*.read_frame */ channel_read_frame,
-	/*.write_frame */ channel_write_frame,
-	/*.kill_channel */ channel_kill_channel,
-	/*.waitfor_read */ channel_waitfor_read,
-	/*.waitfor_write */ channel_waitfor_write,
-	/*.send_dtmf */ channel_send_dtmf,
-	/*.receive_message*/ channel_receive_message
-};
-
-static const switch_endpoint_interface_t channel_endpoint_interface = {
-	/*.interface_name */ "iax",
-	/*.io_routines */ &channel_io_routines,
-	/*.event_handlers */ &channel_event_handlers,
-	/*.private */ NULL,
-	/*.next */ NULL
-};
-
-static const switch_loadable_module_interface_t channel_module_interface = {
-	/*.module_name */ modname,
-	/*.endpoint_interface */ &channel_endpoint_interface,
-	/*.timer_interface */ NULL,
-	/*.dialplan_interface */ NULL,
-	/*.codec_interface */ NULL,
-	/*.application_interface */ NULL
-};
-
-
 /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
 that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
 */
@@ -815,7 +781,7 @@
 													switch_caller_profile_t *outbound_profile,
 													switch_core_session_t **new_session, switch_memory_pool_t **pool)
 {
-	if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
+	if ((*new_session = switch_core_session_request(channel_endpoint_interface, pool)) != 0) {
 		private_t *tech_pvt;
 		switch_channel_t *channel;
 		switch_caller_profile_t *caller_profile;
@@ -875,17 +841,36 @@
 
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
-{
+static switch_state_handler_table_t channel_state_handlers = {
+	/*.on_init */ channel_on_init,
+	/*.on_ring */ channel_on_ring,
+	/*.on_execute */ channel_on_execute,
+	/*.on_hangup */ channel_on_hangup,
+	/*.on_loopback */ channel_on_loopback,
+	/*.on_transmit */ channel_on_transmit
+};
 
-	if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
-		return SWITCH_STATUS_TERM;
-	}
+static switch_io_routines_t channel_io_routines = {
+	/*.outgoing_channel */ channel_outgoing_channel,
+	/*.read_frame */ channel_read_frame,
+	/*.write_frame */ channel_write_frame,
+	/*.kill_channel */ channel_kill_channel,
+	/*.waitfor_read */ channel_waitfor_read,
+	/*.waitfor_write */ channel_waitfor_write,
+	/*.send_dtmf */ channel_send_dtmf,
+	/*.receive_message*/ channel_receive_message
+};
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_iax_load)
+{
 
+	module_pool = pool;
 
-	/* connect my internal structure to the blank pointer passed to me */
-	*module_interface = &channel_module_interface;
+	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
+	channel_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
+	channel_endpoint_interface->interface_name = modname;
+	channel_endpoint_interface->io_routines = &channel_io_routines;
+	channel_endpoint_interface->state_handler = &channel_state_handlers;
 
 	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_SUCCESS;
@@ -967,7 +952,7 @@
 	return status;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime)
 {
 	//int refresh;
 	struct iax_event *iaxevent = NULL;
@@ -1089,7 +1074,7 @@
 					switch_core_session_t *session;
 
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Inbound Channel %s!\n", iaxevent->ies.calling_name);
-					if ((session = switch_core_session_request(&channel_endpoint_interface, NULL)) != 0) {
+					if ((session = switch_core_session_request(channel_endpoint_interface, NULL)) != 0) {
 						private_t *tech_pvt;
 						switch_channel_t *channel;
 
@@ -1217,7 +1202,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_iax_shutdown)
 {
 	int x = 0;
 

Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c	Thu Jun 14 12:39:04 2007
@@ -39,7 +39,9 @@
 
 #define MY_EVENT_RINGING "portaudio::ringing"
 
-static const char modname[] = "mod_portaudio";
+SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_portaudio_shutdown);
+SWITCH_MODULE_DEFINITION(mod_portaudio, mod_portaudio_load, mod_portaudio_shutdown, NULL);
 
 static switch_memory_pool_t *module_pool = NULL;
 //static int running = 1;
@@ -780,7 +782,7 @@
 	/*.next */ &channel_call_interface
 };
 
-static const switch_state_handler_table_t channel_event_handlers = {
+static switch_state_handler_table_t channel_event_handlers = {
 	/*.on_init */ channel_on_init,
 	/*.on_ring */ channel_on_ring,
 	/*.on_execute */ channel_on_execute,
@@ -789,7 +791,7 @@
 	/*.on_transmit */ channel_on_transmit
 };
 
-static const switch_io_routines_t channel_io_routines = {
+static switch_io_routines_t channel_io_routines = {
 	/*.outgoing_channel */ channel_outgoing_channel,
 	/*.read_frame */ channel_read_frame,
 	/*.write_frame */ channel_write_frame,
@@ -800,7 +802,7 @@
 	/*.receive_message */ channel_receive_message
 };
 
-static const switch_endpoint_interface_t channel_endpoint_interface = {
+static switch_endpoint_interface_t channel_endpoint_interface = {
 	/*.interface_name */ "portaudio",
 	/*.io_routines */ &channel_io_routines,
 	/*.event_handlers */ &channel_event_handlers,
@@ -808,7 +810,7 @@
 	/*.next */ NULL
 };
 
-static const switch_loadable_module_interface_t channel_module_interface = {
+static switch_loadable_module_interface_t channel_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ &channel_endpoint_interface,
 	/*.timer_interface */ NULL,
@@ -872,7 +874,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load)
 {
 
 	switch_status_t status;
@@ -1039,7 +1041,7 @@
 	return status;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_portaudio_shutdown)
 {
 	if (globals.read_codec.implementation) {
 		switch_core_codec_destroy(&globals.read_codec);

Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c	Thu Jun 14 12:39:04 2007
@@ -38,8 +38,12 @@
 
 #include "mod_sofia.h"
 
+SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown);
+SWITCH_MODULE_DEFINITION(mod_sofia, mod_sofia_load, mod_sofia_shutdown, NULL);
+
 struct mod_sofia_globals mod_sofia_globals;
-const switch_endpoint_interface_t sofia_endpoint_interface;
+switch_endpoint_interface_t sofia_endpoint_interface;
 static switch_frame_t silence_frame = { 0 };
 static char silence_data[13] = "";
 
@@ -461,7 +465,7 @@
 
 	if (switch_test_flag(tech_pvt, TFLAG_IO)) {
 		switch_status_t status;
-
+		
 		if (!switch_test_flag(tech_pvt, TFLAG_RTP)) {
 			return SWITCH_STATUS_GENERR;
 		}
@@ -1260,7 +1264,7 @@
 
 }
 
-static const switch_io_routines_t sofia_io_routines = {
+static switch_io_routines_t sofia_io_routines = {
 	/*.outgoing_channel */ sofia_outgoing_channel,
 	/*.read_frame */ sofia_read_frame,
 	/*.write_frame */ sofia_write_frame,
@@ -1275,7 +1279,7 @@
 	/*.write_video_frame*/ sofia_write_video_frame
 };
 
-static const switch_state_handler_table_t sofia_event_handlers = {
+static switch_state_handler_table_t sofia_event_handlers = {
 	/*.on_init */ sofia_on_init,
 	/*.on_ring */ sofia_on_ring,
 	/*.on_execute */ sofia_on_execute,
@@ -1284,7 +1288,7 @@
 	/*.on_transmit */ sofia_on_transmit
 };
 
-const switch_endpoint_interface_t sofia_endpoint_interface = {
+switch_endpoint_interface_t sofia_endpoint_interface = {
 	/*.interface_name */ "sofia",
 	/*.io_routines */ &sofia_io_routines,
 	/*.event_handlers */ &sofia_event_handlers,
@@ -1292,7 +1296,7 @@
 	/*.next */ NULL
 };
 
-static const switch_chat_interface_t sofia_chat_interface = {
+static switch_chat_interface_t sofia_chat_interface = {
 	/*.name */ SOFIA_CHAT_PROTO,
 	/*.sofia_presence_chat_send */ sofia_presence_chat_send,
 
@@ -1303,7 +1307,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_management_interface_t sofia_management_interface = {
+static switch_management_interface_t sofia_management_interface = {
 	/*.relative_oid */ "1",
 	/*.management_function */ sofia_manage
 };
@@ -1316,7 +1320,7 @@
 	/*.next */ NULL
 };
 
-static const switch_loadable_module_interface_t sofia_module_interface = {
+static switch_loadable_module_interface_t sofia_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ &sofia_endpoint_interface,
 	/*.timer_interface */ NULL,
@@ -1497,7 +1501,7 @@
 	return cause;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
 {
 
 	silence_frame.data = silence_data;
@@ -1575,7 +1579,7 @@
 
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown)
 {
 	int sanity = 0;
 	

Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h	(original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h	Thu Jun 14 12:39:04 2007
@@ -45,7 +45,7 @@
 #include <switch_odbc.h>
 #endif
 
-static const char modname[] = "mod_sofia";
+#define MODNAME "mod_sofia"
 static const switch_state_handler_table_t noop_state_handler = { 0 };
 struct sofia_gateway;
 typedef struct sofia_gateway sofia_gateway_t;
@@ -465,7 +465,7 @@
 void sofia_glue_do_xfer_invite(switch_core_session_t *session);
 uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sip_t const *sip, 
 								  sofia_regtype_t regtype, char *key, uint32_t keylen, switch_event_t **v_event);
-extern const switch_endpoint_interface_t sofia_endpoint_interface;
+extern switch_endpoint_interface_t sofia_endpoint_interface;
 void sofia_presence_set_chat_hash(private_object_t *tech_pvt, sip_t const *sip);
 switch_status_t sofia_on_hangup(switch_core_session_t *session);
 char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup);

Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c	Thu Jun 14 12:39:04 2007
@@ -1931,7 +1931,7 @@
 	tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
 														 from_user,
 														 profile->dialplan,
-														 displayname, from_user, network_ip, NULL, NULL, NULL, modname, context, destination_number);
+														 displayname, from_user, network_ip, NULL, NULL, NULL, MODNAME, context, destination_number);
 
 	if (tech_pvt->caller_profile) {
 

Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	Thu Jun 14 12:39:04 2007
@@ -41,7 +41,9 @@
 #endif
 
 //#define DOTRACE
-static const char modname[] = "mod_wanpipe";
+SWITCH_MODULE_LOAD_FUNCTION(mod_wanpipe_load);
+SWITCH_MODULE_DEFINITION(mod_wanpipe, mod_wanpipe_load, NULL, NULL);
+
 #define STRLEN 15
 
 static switch_memory_pool_t *module_pool = NULL;
@@ -961,7 +963,7 @@
 }
 
 
-static const switch_io_routines_t wanpipe_io_routines = {
+static switch_io_routines_t wanpipe_io_routines = {
 	/*.outgoing_channel */ wanpipe_outgoing_channel,
 	/*.read_frame */ wanpipe_read_frame,
 	/*.write_frame */ wanpipe_write_frame,
@@ -972,7 +974,7 @@
 	/*.receive_message*/ wanpipe_receive_message
 };
 
-static const switch_state_handler_table_t wanpipe_state_handlers = {
+static switch_state_handler_table_t wanpipe_state_handlers = {
 	/*.on_init */ wanpipe_on_init,
 	/*.on_ring */ wanpipe_on_ring,
 	/*.on_execute */ NULL,
@@ -981,7 +983,7 @@
 	/*.on_transmit */ wanpipe_on_transmit
 };
 
-static const switch_endpoint_interface_t wanpipe_endpoint_interface = {
+static switch_endpoint_interface_t wanpipe_endpoint_interface = {
 	/*.interface_name */ "wanpipe",
 	/*.io_routines */ &wanpipe_io_routines,
 	/*.state_handlers */ &wanpipe_state_handlers,
@@ -989,7 +991,7 @@
 	/*.next */ NULL
 };
 
-static const switch_loadable_module_interface_t wanpipe_module_interface = {
+static switch_loadable_module_interface_t wanpipe_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ &wanpipe_endpoint_interface,
 	/*.timer_interface */ NULL,
@@ -1308,7 +1310,7 @@
 }
 #endif
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_wanpipe_load)
 {
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
@@ -1335,7 +1337,7 @@
 	}
 
 	/* connect my internal structure to the blank pointer passed to me */
-	*interface = &wanpipe_module_interface;
+	*module_interface = &wanpipe_module_interface;
 
 	/* indicate that the module should continue to be loaded */
 	return status;

Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c	Thu Jun 14 12:39:04 2007
@@ -48,7 +48,10 @@
 //#define MEDIA_ANSWER "ANSWER"
 //#define USE_ANSWER 1
 
-static const char modname[] = "mod_woomera";
+SWITCH_MODULE_LOAD_FUNCTION(mod_woomera_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_woomera_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_woomera_runtime);
+SWITCH_MODULE_DEFINITION(mod_woomera, mod_woomera_load, mod_woomera_shutdown, mod_woomera_runtime);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -438,7 +441,7 @@
 	return SWITCH_STATUS_GENERR;
 }
 
-static const switch_state_handler_table_t woomera_event_handlers = {
+static switch_state_handler_table_t woomera_event_handlers = {
 	/*.on_init */ woomera_on_init,
 	/*.on_ring */ woomera_on_ring,
 	/*.on_execute */ woomera_on_execute,
@@ -447,7 +450,7 @@
 	/*.on_transmit */ woomera_on_transmit
 };
 
-static const switch_io_routines_t woomera_io_routines = {
+static switch_io_routines_t woomera_io_routines = {
 	/*.outgoing_channel */ woomera_outgoing_channel,
 	/*.read_frame */ woomera_read_frame,
 	/*.write_frame */ woomera_write_frame,
@@ -456,7 +459,7 @@
 	/*.waitfor_write */ woomera_waitfor_write
 };
 
-static const switch_endpoint_interface_t woomera_endpoint_interface = {
+static switch_endpoint_interface_t woomera_endpoint_interface = {
 	/*.interface_name */ "woomera",
 	/*.io_routines */ &woomera_io_routines,
 	/*.event_handlers */ &woomera_event_handlers,
@@ -464,7 +467,7 @@
 	/*.next */ NULL
 };
 
-static const switch_loadable_module_interface_t woomera_module_interface = {
+static switch_loadable_module_interface_t woomera_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ &woomera_endpoint_interface,
 	/*.timer_interface */ NULL,
@@ -1269,7 +1272,7 @@
 	return NULL;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_woomera_runtime)
 {
 
 	woomera_thread_run(&default_profile);
@@ -1277,7 +1280,7 @@
 	return SWITCH_STATUS_TERM;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_woomera_shutdown)
 {
 	int x = 0;
 	woomera_profile_thread_running(&default_profile, 1, 0);
@@ -1291,7 +1294,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_woomera_load)
 {
 
 	struct woomera_profile *profile = &default_profile;

Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp	(original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp	Thu Jun 14 12:39:04 2007
@@ -40,7 +40,11 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-static const char modname[] = "mod_cdr - CDR Engine";
+SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_cdr_runtime);
+SWITCH_MODULE_DEFINITION(mod_cdr, mod_cdr_load, mod_cdr_shutdown, mod_cdr_runtime);
+
 static int RUNNING = 0;
 static CDRContainer *newcdrcontainer;
 static switch_memory_pool_t *module_pool;
@@ -104,7 +108,7 @@
 	/*.next */ &modcdr_queue_pause_api
 };
 
-static const switch_loadable_module_interface_t cdr_module_interface = {
+static switch_loadable_module_interface_t cdr_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ NULL,
 	/*.timer_interface */ NULL,
@@ -122,10 +126,10 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface **interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
-	*interface = &cdr_module_interface;
+	*module_interface = &cdr_module_interface;
 	
 	switch_core_add_state_handler(&state_handlers);
 	
@@ -142,7 +146,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_cdr_runtime)
 {
 	RUNNING = 1;
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_cdr made it to runtime.  Wee!\n");
@@ -196,7 +200,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_shutdown)
 {
 	delete newcdrcontainer;
 	switch_thread_rwlock_destroy(cdr_rwlock);

Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	Thu Jun 14 12:39:04 2007
@@ -32,7 +32,10 @@
 #include <switch.h>
 static char *MARKER = "1";
 
-static const char modname[] = "mod_event_multicast";
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime);
+SWITCH_MODULE_DEFINITION(mod_event_multicast, mod_event_multicast_load, mod_event_multicast_shutdown, mod_event_multicast_runtime);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -183,7 +186,7 @@
 };
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load)
 {
 
 	memset(&globals, 0, sizeof(globals));
@@ -246,7 +249,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown)
 {
 	int x = 0;
 
@@ -259,8 +262,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime)
 {
 	switch_event_t *local_event;
 	char buf[65536] = { 0 };

Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Thu Jun 14 12:39:04 2007
@@ -32,7 +32,11 @@
 #include <switch.h>
 #define CMD_BUFLEN 1024 * 1000
 
-static const char modname[] = "mod_event_socket";
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime);
+SWITCH_MODULE_DEFINITION(mod_event_socket, mod_event_socket_load, mod_event_socket_shutdown, mod_event_socket_runtime);
+
 static char *MARKER = "1";
 
 typedef enum {
@@ -136,11 +140,6 @@
 			if (event->event_id != SWITCH_EVENT_CUSTOM || (event->subclass && switch_core_hash_find(l->event_hash, event->subclass->name))) {
 				send = 1;
 			}
-		} else {
-			int x;
-			for(x = 0; x <= SWITCH_EVENT_ALL; x++) {
-				printf("%d ", l->event_list[x]);
-			}
 		}
 
 		if (send && switch_test_flag(l, LFLAG_MYEVENTS)) {
@@ -252,7 +251,7 @@
 }
 
 
-static const switch_application_interface_t socket_application_interface = {
+static switch_application_interface_t socket_application_interface = {
 	/*.interface_name */ "socket",
 	/*.application_function */ socket_function,
 	/* long_desc */ "Connect to a socket",
@@ -285,7 +284,7 @@
 	switch_mutex_unlock(listen_list.sock_mutex);
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown)
 {
 	listener_t *l;
 
@@ -305,8 +304,7 @@
 }
 
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &event_socket_module_interface;
@@ -1193,7 +1191,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
 {
 	switch_memory_pool_t *pool = NULL, *listener_pool = NULL;
 	switch_status_t rv;

Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c	Thu Jun 14 12:39:04 2007
@@ -31,7 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_event_test";
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_test_load);
+SWITCH_MODULE_DEFINITION(mod_event_test, mod_event_test_load, NULL, NULL);
 
 //#define TORTURE_ME
 
@@ -124,8 +125,7 @@
 }
 #endif
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_test_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &event_test_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c	Thu Jun 14 12:39:04 2007
@@ -32,7 +32,10 @@
 #include <switch.h>
 #include <iksemel.h>
 
-static const char modname[] = "mod_xmpp_event";
+SWITCH_MODULE_LOAD_FUNCTION(mod_xmpp_event_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xmpp_event_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xmpp_event_runtime);
+SWITCH_MODULE_DEFINITION(mod_xmpp_event, mod_xmpp_event_load, mod_xmpp_event_shutdown, mod_xmpp_event_runtime);
 
 static int RUNNING = 0;
 static iksfilter *my_filter;
@@ -397,7 +400,7 @@
 	/*.application_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_xmpp_event_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &xmpp_event_module_interface;
@@ -411,7 +414,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xmpp_event_shutdown)
 {
 
 	if (RUNNING) {
@@ -424,7 +427,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xmpp_event_runtime)
 {
 	RUNNING = 1;
 	xmpp_connect(globals.jid, globals.passwd);

Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c	Thu Jun 14 12:39:04 2007
@@ -35,7 +35,10 @@
 #endif
 #include <howl.h>
 
-static const char modname[] = "mod_zeroconf";
+SWITCH_MODULE_LOAD_FUNCTION(mod_zeroconf_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_zeroconf_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_zeroconf_runtime);
+SWITCH_MODULE_DEFINITION(mod_zeroconf, mod_zeroconf_load, mod_zeroconf_shutdown, mod_zeroconf_runtime);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -249,7 +252,7 @@
 
 static int RUNNING = 0;
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_zeroconf_shutdown)
 {
 	if (RUNNING == 1) {
 		RUNNING = -1;
@@ -258,8 +261,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_zeroconf_load)
 {
 
 	memset(&globals, 0, sizeof(globals));
@@ -298,7 +300,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_zeroconf_runtime)
 {
 
 	RUNNING = 1;

Modified: freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c	Thu Jun 14 12:39:04 2007
@@ -31,7 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_native_file";
+SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load);
+SWITCH_MODULE_DEFINITION(mod_native_file, mod_native_file_load, NULL, NULL);
 
 struct native_file_context {
 	switch_file_t *fd;
@@ -163,7 +164,7 @@
 
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load)
 {
 
 	const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS];

Modified: freeswitch/branches/greenlizard/src/mod/formats/mod_shout/mod_shout.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/formats/mod_shout/mod_shout.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/formats/mod_shout/mod_shout.c	Thu Jun 14 12:39:04 2007
@@ -37,14 +37,13 @@
 #include <lame.h>
 #include <curl/curl.h>
 
-
 #define OUTSCALE 8192
 #define MP3_SCACHE 16384
 #define MP3_DCACHE 8192
 
-static const char modname[] = "mod_shout";
-
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_shout_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_shout_shutdown);
+SWITCH_MODULE_DEFINITION(mod_shout, mod_shout_load, mod_shout_shutdown, NULL);
 
 static char *supported_formats[SWITCH_MAX_CODECS] = { 0 };
 
@@ -889,7 +888,7 @@
 	/*.directory_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_shout_load)
 {
 	supported_formats[0] = "shout";
 	supported_formats[1] = "mp3";
@@ -908,7 +907,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_shout_shutdown)
 {
 	curl_global_cleanup();
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c	Thu Jun 14 12:39:04 2007
@@ -32,7 +32,8 @@
 #include <switch.h>
 #include <sndfile.h>
 
-static const char modname[] = "mod_sndfile";
+SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load);
+SWITCH_MODULE_DEFINITION(mod_sndfile, mod_sndfile_load, NULL, NULL);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -361,7 +362,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load)
 {
 
 	if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {

Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_mono/mod_mono.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_mono/mod_mono.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_mono/mod_mono.c	Thu Jun 14 12:39:04 2007
@@ -50,7 +50,10 @@
 /* Managed functions */
 void mod_mono_switch_console_printf(switch_text_channel_t channel, char *file, const char *func, int line, char *fmt, char *msg);
 
-static const char modname[] = "mod_mono";
+SWITCH_MODULE_LOAD_FUNCTION(mod_mono_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_mono_shutdown);
+SWITCH_MODULE_DEFINITION(mod_mono, mod_mono_load, mod_mono_shutdown, NULL);
+
 static switch_memory_pool_t *mono_pool = NULL;
 
 static struct {
@@ -74,9 +77,9 @@
  * This function will initialise the memory pool and plugin hash for this module,
  * it will then initialise a new mono domain.
  */
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_mono_load)
 {
-	*interface = &mono_module_interface;
+	*module_interface = &mono_module_interface;
 
 	/* Initialise memory pool */
 	if (switch_core_new_memory_pool(&mono_pool) != SWITCH_STATUS_SUCCESS) {
@@ -158,7 +161,7 @@
  * Function for cleanly shutting down mod_mono
  * 
  */
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_mono_shutdown)
 {
 	if (globals.domain) {
 		mono_jit_cleanup(globals.domain);

Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c	Thu Jun 14 12:39:04 2007
@@ -43,7 +43,9 @@
 static char *embedding[] = { "", "-e", "" };
 EXTERN_C void xs_init(pTHX);
 
-static const char modname[] = "mod_perl";
+SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown);
+SWITCH_MODULE_DEFINITION(mod_perl, mod_perl_load, mod_perl_shutdown, NULL);
 
 static struct {
 	PerlInterpreter *my_perl;
@@ -77,7 +79,7 @@
 	destroy_perl(&my_perl);
 }
 
-static const switch_application_interface_t perl_application_interface = {
+static switch_application_interface_t perl_application_interface = {
 	/*.interface_name */ "perl",
 	/*.application_function */ perl_function,
 	NULL, NULL, NULL,
@@ -100,7 +102,7 @@
 };
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown)
 {
 	if (globals.my_perl) {
 		perl_destruct(globals.my_perl);
@@ -111,7 +113,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load)
 {
 
 	PerlInterpreter *my_perl;

Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c	Thu Jun 14 12:39:04 2007
@@ -49,7 +49,9 @@
 void init_freeswitch(void);
 static switch_api_interface_t python_run_interface;
 
-const char modname[] = "mod_python";
+SWITCH_MODULE_LOAD_FUNCTION(mod_python_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_python_shutdown);
+SWITCH_MODULE_DEFINITION(mod_python, mod_python_load, mod_python_shutdown, NULL);
 
 static void eval_some_python(char *uuid, char *args)
 {
@@ -219,7 +221,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_application_interface_t python_application_interface = {
+static switch_application_interface_t python_application_interface = {
 	/*.interface_name */ "python",
 	/*.application_function */ python_function,
 	NULL, NULL, NULL,
@@ -249,7 +251,7 @@
 	/*.directory_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_python_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &python_module_interface;
@@ -281,7 +283,7 @@
 
 /*
   Called when the system shuts down*/
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_python_shutdown)
 {
     PyInterpreterState *mainInterpreterState;
     PyThreadState *myThreadState;

Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Thu Jun 14 12:39:04 2007
@@ -38,8 +38,9 @@
 #include <curl/curl.h>
 #endif
 
-static const char modname[] = "mod_spidermonkey";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown);
+SWITCH_MODULE_DEFINITION(mod_spidermonkey, mod_spidermonkey_load, mod_spidermonkey_shutdown, NULL);
 
 static void session_destroy(JSContext * cx, JSObject * obj);
 static JSBool session_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval);
@@ -2392,6 +2393,8 @@
 				switch_channel_set_private(channel, "jss", NULL);
 			}
 
+			switch_core_event_hook_remove_state_change(jss->session, hanguphook);
+			
 			if (channel && switch_test_flag(jss, S_HUP)) {
 				switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
 			}
@@ -2981,7 +2984,7 @@
 }
 
 
-static const switch_application_interface_t ivrtest_application_interface = {
+static switch_application_interface_t ivrtest_application_interface = {
 	/*.interface_name */ "javascript",
 	/*.application_function */ js_dp_function,
 	/* long_desc */ "Run a javascript ivr on a channel",
@@ -3044,7 +3047,7 @@
 
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load)
 {
 	switch_status_t status;
 
@@ -3067,7 +3070,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown)
 {
 	curl_global_cleanup();
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c	Thu Jun 14 12:39:04 2007
@@ -31,7 +31,9 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_console";
+SWITCH_MODULE_LOAD_FUNCTION(mod_console_load);
+SWITCH_MODULE_DEFINITION(mod_console, mod_console_load, NULL, NULL);
+
 static const uint8_t STATIC_LEVELS[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
 static int COLORIZE = 0;
 #ifdef WIN32
@@ -188,7 +190,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_console_load)
 {
 	if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");

Modified: freeswitch/branches/greenlizard/src/mod/loggers/mod_syslog/mod_syslog.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/loggers/mod_syslog/mod_syslog.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/loggers/mod_syslog/mod_syslog.c	Thu Jun 14 12:39:04 2007
@@ -39,7 +39,10 @@
 #define DEFAULT_FORMAT   "[message]"
 #define MAX_LENGTH       1024
 
-static const char modname[] = "mod_syslog";
+SWITCH_MODULE_LOAD_FUNCTION(mod_syslog_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_syslog_shutdown);
+SWITCH_MODULE_DEFINITION(mod_syslog, mod_syslog_load, mod_syslog_shutdown, NULL);
+
 static switch_status_t load_config(void);
 
 static struct {
@@ -148,10 +151,10 @@
 	return 0;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_syslog_load)
 {
 	switch_status_t status;
-	*interface = &console_module_interface;
+	*module_interface = &console_module_interface;
 
 	if ((status = load_config()) != SWITCH_STATUS_SUCCESS) {
 		return status;
@@ -164,7 +167,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_unload(const switch_loadable_module_interface_t **interface)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_syslog_shutdown)
 {
 	closelog();
 

Modified: freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c	Thu Jun 14 12:39:04 2007
@@ -33,8 +33,8 @@
 #include <math.h>
 #include <ctype.h>
 
-static const char modname[] = "mod_say_en";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_say_en_load);
+SWITCH_MODULE_DEFINITION(mod_say_en, mod_say_en_load, NULL, NULL);
 
 #define say_num(num, t) {							\
 		char tmp[80];\
@@ -510,12 +510,12 @@
 	return SWITCH_STATUS_FALSE;
 }
 
-static const switch_say_interface_t es_say_interface = {
+static switch_say_interface_t es_say_interface = {
 	/*.name */ "es",
 	/*.say_function */ en_say,
 };
 
-static const switch_say_interface_t en_say_interface = {
+static switch_say_interface_t en_say_interface = {
 	/*.name */ "en",
 	/*.say_function */ en_say,
 	/*.next */ &es_say_interface
@@ -537,7 +537,7 @@
 	/*.asr_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_say_en_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &say_en_module_interface;

Modified: freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c	Thu Jun 14 12:39:04 2007
@@ -46,7 +46,11 @@
 	switch_mutex_t *mutex;
 } globals;
 
-static const char modname[] = "mod_softtimer";
+SWITCH_MODULE_LOAD_FUNCTION(mod_softtimer_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_softtimer_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_softtimer_runtime);
+SWITCH_MODULE_DEFINITION(mod_softtimer, mod_softtimer_load, mod_softtimer_shutdown, mod_softtimer_runtime);
+
 #define MAX_ELEMENTS 1000
 
 struct timer_private {
@@ -182,7 +186,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_timer_interface_t timer_interface = {
+static switch_timer_interface_t timer_interface = {
 	/*.interface_name */ "soft",
 	/*.timer_init */ timer_init,
 	/*.timer_next */ timer_next,
@@ -191,13 +195,13 @@
 	/*.timer_destroy */ timer_destroy
 };
 
-static const switch_loadable_module_interface_t mod_softtimer_module_interface = {
+static switch_loadable_module_interface_t softtimer_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ NULL,
 	/*.timer_interface */ &timer_interface
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_softtimer_load)
 {
 
 	if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
@@ -206,7 +210,7 @@
 	}
 
 	/* connect my internal structure to the blank pointer passed to me */
-	*module_interface = &mod_softtimer_module_interface;
+	*module_interface = &softtimer_module_interface;
 
 	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_SUCCESS;
@@ -218,7 +222,8 @@
 
 #define STEP_MS 1
 #define STEP_MIC 1000
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_softtimer_runtime)
 {
 	switch_time_t reference = switch_time_now();
 	uint32_t current_ms = 0;
@@ -267,8 +272,7 @@
 	return SWITCH_STATUS_TERM;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_softtimer_shutdown)
 {
 
 	if (globals.RUNNING) {

Modified: freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	Thu Jun 14 12:39:04 2007
@@ -32,7 +32,8 @@
 #include <sys/stat.h>
 #include <switch.h>
 
-static const char modname[] = "mod_xml_cdr";
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load);
+SWITCH_MODULE_DEFINITION(mod_xml_cdr, mod_xml_cdr_load, NULL, NULL);
 
 static switch_status_t my_on_hangup(switch_core_session_t *session)
 {
@@ -81,7 +82,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_state_handler_table_t state_handlers = {
+static switch_state_handler_table_t state_handlers = {
 	/*.on_init */ NULL,
 	/*.on_ring */ NULL,
 	/*.on_execute */ NULL,
@@ -91,7 +92,7 @@
 };
 
 
-static const switch_loadable_module_interface_t mod_xml_cdr_module_interface = {
+static switch_loadable_module_interface_t xml_cdr_module_interface = {
 	/*.module_name = */ modname,
 	/*.endpoint_interface = */ NULL,
 	/*.timer_interface = */ NULL,
@@ -100,12 +101,12 @@
 	/*.application_interface */ NULL
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load)
 {
 	/* test global state handlers */
 	switch_core_add_state_handler(&state_handlers);
 
-	*module_interface = &mod_xml_cdr_module_interface;
+	*module_interface = &xml_cdr_module_interface;
 
 	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c	Thu Jun 14 12:39:04 2007
@@ -31,7 +31,9 @@
 #include <switch.h>
 #include <curl/curl.h>
 
-static const char modname[] = "mod_xml_curl";
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown);
+SWITCH_MODULE_DEFINITION(mod_xml_curl, mod_xml_curl_load, mod_xml_curl_shutdown, NULL);
 
 struct xml_binding {
 	char *url;
@@ -229,7 +231,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &xml_curl_module_interface;
@@ -244,7 +246,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown)
 {
 	curl_global_cleanup();
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	(original)
+++ freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	Thu Jun 14 12:39:04 2007
@@ -42,7 +42,10 @@
 #include <xmlrpc-c/server.h>
 #include <xmlrpc-c/server_abyss.h>
 
-static const char modname[] = "mod_xml_rpc";
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime);
+SWITCH_MODULE_DEFINITION(mod_xml_rpc, mod_xml_rpc_load, mod_xml_rpc_shutdown, mod_xml_rpc_runtime);
 
 static switch_loadable_module_interface_t xml_rpc_module_interface = {
 	/*.module_name */ modname,
@@ -112,7 +115,7 @@
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load)
 {
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &xml_rpc_module_interface;
@@ -357,7 +360,7 @@
 	return val;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
 {
 	TServer abyssServer;
 	xmlrpc_registry *registryP;
@@ -402,7 +405,7 @@
 
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown)
 {
 	globals.running = 0;
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/branches/greenlizard/src/switch_channel.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_channel.c	(original)
+++ freeswitch/branches/greenlizard/src/switch_channel.c	Thu Jun 14 12:39:04 2007
@@ -208,7 +208,11 @@
 
 	assert(channel != NULL);
 
-	switch_mutex_lock(channel->dtmf_mutex);
+	switch_mutex_lock(channel->dtmf_mutex);	
+
+	if ((status = switch_core_session_recv_dtmf(channel->session, dtmf) != SWITCH_STATUS_SUCCESS)) {
+		goto done;
+	}
 
 	inuse = switch_buffer_inuse(channel->dtmf_buffer);
 	len = strlen(dtmf);
@@ -227,6 +231,9 @@
 		p++;
 	}
 	status = switch_buffer_write(channel->dtmf_buffer, dtmf, wr) ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_MEMERR;
+
+ done:
+
 	switch_mutex_unlock(channel->dtmf_mutex);
 
 	return status;

Modified: freeswitch/branches/greenlizard/src/switch_core_codec.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_codec.c	(original)
+++ freeswitch/branches/greenlizard/src/switch_core_codec.c	Thu Jun 14 12:39:04 2007
@@ -48,6 +48,9 @@
 	}
 
 	session->read_codec = codec;
+	session->raw_read_frame.codec = session->read_codec;
+	session->raw_write_frame.codec = session->read_codec;
+
 	return SWITCH_STATUS_SUCCESS;
 }
 

Modified: freeswitch/branches/greenlizard/src/switch_core_event_hook.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_event_hook.c	(original)
+++ freeswitch/branches/greenlizard/src/switch_core_event_hook.c	Thu Jun 14 12:39:04 2007
@@ -31,222 +31,18 @@
 #include "switch.h"
 #include "private/switch_core_pvt.h"
 
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_outgoing(switch_core_session_t *session, switch_outgoing_channel_hook_t outgoing_channel)
-{
-	switch_io_event_hook_outgoing_channel_t *hook, *ptr;
+		
 
-	assert(outgoing_channel != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->outgoing_channel = outgoing_channel;
-		if (!session->event_hooks.outgoing_channel) {
-			session->event_hooks.outgoing_channel = hook;
-		} else {
-			for (ptr = session->event_hooks.outgoing_channel; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_state_change(switch_core_session_t *session, switch_state_change_hook_t state_change)
-{
-	switch_io_event_hook_state_change_t *hook, *ptr;
-
-	assert(state_change != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->state_change = state_change;
-		if (!session->event_hooks.state_change) {
-			session->event_hooks.state_change = hook;
-		} else {
-			for (ptr = session->event_hooks.state_change; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_read_frame(switch_core_session_t *session, switch_read_frame_hook_t read_frame)
-{
-	switch_io_event_hook_read_frame_t *hook, *ptr;
-
-	assert(read_frame != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->read_frame = read_frame;
-		if (!session->event_hooks.read_frame) {
-			session->event_hooks.read_frame = hook;
-		} else {
-			for (ptr = session->event_hooks.read_frame; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_write_frame(switch_core_session_t *session, switch_write_frame_hook_t write_frame)
-{
-	switch_io_event_hook_write_frame_t *hook, *ptr;
-
-	assert(write_frame != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->write_frame = write_frame;
-		if (!session->event_hooks.write_frame) {
-			session->event_hooks.write_frame = hook;
-		} else {
-			for (ptr = session->event_hooks.write_frame; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_video_read_frame(switch_core_session_t *session, switch_video_read_frame_hook_t video_read_frame)
-{
-	switch_io_event_hook_video_read_frame_t *hook, *ptr;
-
-	assert(video_read_frame != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->video_read_frame = video_read_frame;
-		if (!session->event_hooks.video_read_frame) {
-			session->event_hooks.video_read_frame = hook;
-		} else {
-			for (ptr = session->event_hooks.video_read_frame; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_video_write_frame(switch_core_session_t *session, switch_video_write_frame_hook_t video_write_frame)
-{
-	switch_io_event_hook_video_write_frame_t *hook, *ptr;
-
-	assert(video_write_frame != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->video_write_frame = video_write_frame;
-		if (!session->event_hooks.video_write_frame) {
-			session->event_hooks.video_write_frame = hook;
-		} else {
-			for (ptr = session->event_hooks.video_write_frame; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_kill_channel(switch_core_session_t *session, switch_kill_channel_hook_t kill_channel)
-{
-	switch_io_event_hook_kill_channel_t *hook, *ptr;
-
-	assert(kill_channel != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->kill_channel = kill_channel;
-		if (!session->event_hooks.kill_channel) {
-			session->event_hooks.kill_channel = hook;
-		} else {
-			for (ptr = session->event_hooks.kill_channel; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_waitfor_read(switch_core_session_t *session, switch_waitfor_read_hook_t waitfor_read)
-{
-	switch_io_event_hook_waitfor_read_t *hook, *ptr;
-
-	assert(waitfor_read != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->waitfor_read = waitfor_read;
-		if (!session->event_hooks.waitfor_read) {
-			session->event_hooks.waitfor_read = hook;
-		} else {
-			for (ptr = session->event_hooks.waitfor_read; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_waitfor_write(switch_core_session_t *session, switch_waitfor_write_hook_t waitfor_write)
-{
-	switch_io_event_hook_waitfor_write_t *hook, *ptr;
-
-	assert(waitfor_write != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->waitfor_write = waitfor_write;
-		if (!session->event_hooks.waitfor_write) {
-			session->event_hooks.waitfor_write = hook;
-		} else {
-			for (ptr = session->event_hooks.waitfor_write; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-
-}
-
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_send_dtmf(switch_core_session_t *session, switch_send_dtmf_hook_t send_dtmf)
-{
-	switch_io_event_hook_send_dtmf_t *hook, *ptr;
-
-	assert(send_dtmf != NULL);
-	if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
-		hook->send_dtmf = send_dtmf;
-		if (!session->event_hooks.send_dtmf) {
-			session->event_hooks.send_dtmf = hook;
-		} else {
-			for (ptr = session->event_hooks.send_dtmf; ptr && ptr->next; ptr = ptr->next);
-			ptr->next = hook;
-
-		}
-
-		return SWITCH_STATUS_SUCCESS;
-	}
-
-	return SWITCH_STATUS_MEMERR;
-
-}
+NEW_HOOK_DECL(outgoing_channel)
+NEW_HOOK_DECL(receive_message)
+NEW_HOOK_DECL(receive_event)
+NEW_HOOK_DECL(state_change)
+NEW_HOOK_DECL(read_frame)
+NEW_HOOK_DECL(write_frame)
+NEW_HOOK_DECL(video_read_frame)
+NEW_HOOK_DECL(video_write_frame)
+NEW_HOOK_DECL(kill_channel)
+NEW_HOOK_DECL(waitfor_read)
+NEW_HOOK_DECL(waitfor_write)
+NEW_HOOK_DECL(send_dtmf)
+NEW_HOOK_DECL(recv_dtmf)

Modified: freeswitch/branches/greenlizard/src/switch_core_io.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_io.c	(original)
+++ freeswitch/branches/greenlizard/src/switch_core_io.c	Thu Jun 14 12:39:04 2007
@@ -225,7 +225,7 @@
 
 		if (session->bugs) {
 			switch_media_bug_t *bp, *dp, *last = NULL;
-
+			switch_bool_t ok = SWITCH_TRUE;
 			switch_thread_rwlock_rdlock(session->bug_rwlock);
 			for (bp = session->bugs; bp; bp = bp->next) {
 				if (bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) {
@@ -233,23 +233,35 @@
 					switch_buffer_write(bp->raw_read_buffer, read_frame->data, read_frame->datalen);
 					if (bp->callback) {
 						if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ) == SWITCH_FALSE || (bp->stop_time && bp->stop_time >= time(NULL))) {
-							bp->ready = 0;
-							if (last) {
-								last->next = bp->next;
-							} else {
-								session->bugs = bp->next;
-							}
-							switch_mutex_unlock(bp->read_mutex);
-							dp = bp;
-							bp = last;
-							switch_core_media_bug_close(&dp);
-							if (!bp) {
-								break;
-							}
-							continue;
+							ok = SWITCH_FALSE;
 						}
 					}
 					switch_mutex_unlock(bp->read_mutex);
+				} else if (switch_test_flag(bp, SMBF_READ_REPLACE)) {
+					do_bugs = 0;
+					if (bp->callback) {
+						bp->read_replace_frame_in = read_frame;
+						bp->read_replace_frame_out = NULL;
+						if ((ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ_REPLACE)) == SWITCH_TRUE) {
+							read_frame = bp->read_replace_frame_out;
+						}
+					}
+				}
+
+				if (ok == SWITCH_FALSE) {
+					bp->ready = 0;
+					if (last) {
+						last->next = bp->next;
+					} else {
+						session->bugs = bp->next;
+					}
+					dp = bp;
+					bp = last;
+					switch_core_media_bug_close(&dp);
+					if (!bp) {
+						break;
+					}
+					continue;
 				}
 				last = bp;
 			}
@@ -288,6 +300,7 @@
 					enc_frame = &session->raw_read_frame;
 				}
 				session->enc_read_frame.datalen = session->enc_read_frame.buflen;
+
 				assert(session->read_codec != NULL);
 				assert(enc_frame != NULL);
 				assert(enc_frame->data != NULL);
@@ -304,7 +317,6 @@
 				case SWITCH_STATUS_RESAMPLE:
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "fixme 1\n");
 				case SWITCH_STATUS_SUCCESS:
-					session->enc_read_frame.codec = session->read_codec;
 					session->enc_read_frame.samples = session->read_codec->implementation->bytes_per_frame / sizeof(int16_t);
 					session->enc_read_frame.timestamp = read_frame->timestamp;
 					session->enc_read_frame.rate = read_frame->rate;
@@ -315,7 +327,6 @@
 					*frame = &session->enc_read_frame;
 					break;
 				case SWITCH_STATUS_NOOP:
-					session->raw_read_frame.codec = session->read_codec;
 					session->raw_read_frame.samples = enc_frame->codec->implementation->samples_per_frame;
 					session->raw_read_frame.timestamp = read_frame->timestamp;
 					session->raw_read_frame.payload = enc_frame->codec->implementation->ianacode;
@@ -464,7 +475,7 @@
 			session->write_resampler->from_len = write_frame->datalen / 2;
 			switch_short_to_float(data, session->write_resampler->from, session->write_resampler->from_len);
 
-
+			
 
 			session->write_resampler->to_len = (uint32_t)
 				switch_resample_process(session->write_resampler, session->write_resampler->from,
@@ -497,10 +508,10 @@
 				} else if (switch_test_flag(bp, SMBF_WRITE_REPLACE)) {
 					do_bugs = 0;
 					if (bp->callback) {
-						bp->replace_frame_in = frame;
-						bp->replace_frame_out = NULL;
+						bp->write_replace_frame_in = write_frame;
+						bp->write_replace_frame_out = NULL;
 						if ((ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_WRITE_REPLACE)) == SWITCH_TRUE) {
-							write_frame = bp->replace_frame_out;
+							write_frame = bp->write_replace_frame_out;
 						}
 					}
 				}
@@ -790,14 +801,34 @@
 }
 
 
-SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_session_t *session, char *dtmf)
+SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_session_t *session, const char *dtmf)
+{
+	switch_io_event_hook_recv_dtmf_t *ptr;	
+	switch_status_t status;
+
+	for (ptr = session->event_hooks.recv_dtmf; ptr; ptr = ptr->next) {
+		if ((status = ptr->recv_dtmf(session, dtmf)) != SWITCH_STATUS_SUCCESS) {
+			return status;
+		}
+	}
+	return SWITCH_STATUS_SUCCESS;
+}
+
+SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_session_t *session, const char *dtmf)
 {
 	switch_io_event_hook_send_dtmf_t *ptr;
 	switch_status_t status = SWITCH_STATUS_FALSE;
-
+	
+	
+	for (ptr = session->event_hooks.send_dtmf; ptr; ptr = ptr->next) {
+		if ((status = ptr->send_dtmf(session, dtmf)) != SWITCH_STATUS_SUCCESS) {
+			return SWITCH_STATUS_SUCCESS;
+		}
+	}
+	
 	if (session->endpoint_interface->io_routines->send_dtmf) {
 		if (strchr(dtmf, 'w') || strchr(dtmf, 'W')) {
-			char *d;
+			const char *d;
 			for (d = dtmf; d && *d; d++) {
 				char digit[2] = { 0 };
 
@@ -815,16 +846,9 @@
 				}
 			}
 		} else {
-			status = session->endpoint_interface->io_routines->send_dtmf(session, dtmf);
+			status = session->endpoint_interface->io_routines->send_dtmf(session, (char *)dtmf);
 		}
 
-		if (status == SWITCH_STATUS_SUCCESS) {
-			for (ptr = session->event_hooks.send_dtmf; ptr; ptr = ptr->next) {
-				if ((status = ptr->send_dtmf(session, dtmf)) != SWITCH_STATUS_SUCCESS) {
-					break;
-				}
-			}
-		}
 	}
 
 	return status;

Modified: freeswitch/branches/greenlizard/src/switch_core_media_bug.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_media_bug.c	(original)
+++ freeswitch/branches/greenlizard/src/switch_core_media_bug.c	Thu Jun 14 12:39:04 2007
@@ -41,14 +41,24 @@
 }
 
 
-SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_replace_frame(switch_media_bug_t *bug)
+SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_write_replace_frame(switch_media_bug_t *bug)
 {
-	return bug->replace_frame_in;
+	return bug->write_replace_frame_in;
 }
 
-SWITCH_DECLARE(void) switch_core_media_bug_set_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame)
+SWITCH_DECLARE(void) switch_core_media_bug_set_write_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame)
 {
-	bug->replace_frame_out = frame;
+	bug->write_replace_frame_out = frame;
+}
+
+SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_read_replace_frame(switch_media_bug_t *bug)
+{
+	return bug->read_replace_frame_in;
+}
+
+SWITCH_DECLARE(void) switch_core_media_bug_set_read_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame)
+{
+	bug->read_replace_frame_out = frame;
 }
 
 SWITCH_DECLARE(void *) switch_core_media_bug_get_user_data(switch_media_bug_t *bug)
@@ -161,6 +171,18 @@
 		switch_thread_rwlock_unlock(session->bug_rwlock);
 	}
 
+	if (flags & SMBF_READ_REPLACE) {
+		switch_thread_rwlock_wrlock(session->bug_rwlock);
+		for (bp = session->bugs; bp; bp = bp->next) {
+			if (switch_test_flag(bp, SMBF_READ_REPLACE)) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Only one bug of this type allowed!\n");
+				switch_thread_rwlock_unlock(session->bug_rwlock);
+				return SWITCH_STATUS_GENERR;
+			}
+		}
+		switch_thread_rwlock_unlock(session->bug_rwlock);
+	}
+
 	if (!(bug = switch_core_session_alloc(session, sizeof(*bug)))) {
 		return SWITCH_STATUS_MEMERR;
 	}

Modified: freeswitch/branches/greenlizard/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_ivr.c	(original)
+++ freeswitch/branches/greenlizard/src/switch_ivr.c	Thu Jun 14 12:39:04 2007
@@ -871,6 +871,14 @@
 			context = new_profile->context;
 		}
 
+		if (switch_strlen_zero(context)) {
+			context = "default";
+		}
+
+		if (switch_strlen_zero(dialplan)) {
+			context = "XML";
+		}
+
 
 		switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, NULL);
 		if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))

Modified: freeswitch/branches/greenlizard/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_ivr_bridge.c	(original)
+++ freeswitch/branches/greenlizard/src/switch_ivr_bridge.c	Thu Jun 14 12:39:04 2007
@@ -120,7 +120,6 @@
 			char dtmf[128];
 			switch_channel_dequeue_dtmf(chan_a, dtmf, sizeof(dtmf));
 			switch_core_session_send_dtmf(session_b, dtmf);
-
 			if (input_callback) {
 				if (input_callback(session_a, dtmf, SWITCH_INPUT_TYPE_DTMF, user_data, 0) != SWITCH_STATUS_SUCCESS) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s ended call via DTMF\n", switch_channel_get_name(chan_a));
@@ -526,13 +525,13 @@
 	switch_copy_string(b_leg->b_uuid, switch_core_session_get_uuid(session), sizeof(b_leg->b_uuid));
 	b_leg->stream_id = stream_id;
 	b_leg->input_callback = input_callback;
-	b_leg->session_data = session_data;
+	b_leg->session_data = peer_session_data;
 
 	a_leg->session = session;
 	switch_copy_string(a_leg->b_uuid, switch_core_session_get_uuid(peer_session), sizeof(a_leg->b_uuid));
-	b_leg->stream_id = stream_id;
-	b_leg->input_callback = input_callback;
-	b_leg->session_data = peer_session_data;
+	a_leg->stream_id = stream_id;
+	a_leg->input_callback = input_callback;
+	a_leg->session_data = session_data;
 
 	switch_channel_add_state_handler(peer_channel, &audio_bridge_peer_state_handlers);
 
@@ -543,6 +542,8 @@
 	if (switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {
 		switch_event_t *event;
 		switch_core_session_message_t msg = { 0 };
+		const switch_application_interface_t *application_interface;
+		char *app, *data;
 
 		switch_channel_set_state(peer_channel, CS_HOLD);
 
@@ -555,6 +556,21 @@
 			switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_VARIABLE, switch_core_session_get_uuid(peer_session));
 			switch_channel_set_variable(peer_channel, SWITCH_BRIDGE_VARIABLE, switch_core_session_get_uuid(session));
 
+			if ((app = switch_channel_get_variable(caller_channel, "bridge_pre_execute_aleg_app"))) {
+				data = switch_channel_get_variable(caller_channel, "bridge_pre_execute_aleg_data");
+				if ((application_interface = switch_loadable_module_get_application_interface(app))) {
+					switch_core_session_exec(session, application_interface, data);
+				}
+			}
+			
+			if ((app = switch_channel_get_variable(caller_channel, "bridge_pre_execute_bleg_app"))) {
+				data = switch_channel_get_variable(caller_channel, "bridge_pre_execute_bleg_data");
+				if ((application_interface = switch_loadable_module_get_application_interface(app))) {
+					switch_core_session_exec(peer_session, application_interface, data);
+				}
+			}
+
+			
 			msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE;
 			msg.from = __FILE__;
 			msg.string_arg = switch_core_session_strdup(peer_session, switch_core_session_get_uuid(session));

Modified: freeswitch/branches/greenlizard/src/switch_loadable_module.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_loadable_module.c	(original)
+++ freeswitch/branches/greenlizard/src/switch_loadable_module.c	Thu Jun 14 12:39:04 2007
@@ -44,7 +44,7 @@
 	char *key;
 	char *filename;
 	int perm;
-	const switch_loadable_module_interface_t *module_interface;
+	switch_loadable_module_interface_t *module_interface;
 	void *lib;
 	switch_module_load_t switch_module_load;
 	switch_module_runtime_t switch_module_runtime;
@@ -636,11 +636,14 @@
 }
 
 
-static switch_status_t switch_loadable_module_load_file(char *filename, switch_loadable_module_t **new_module)
+static switch_status_t switch_loadable_module_load_file(char *path, char *filename, switch_loadable_module_t **new_module)
 {
 	switch_loadable_module_t *module = NULL;
 	switch_dso_handle_t *dso = NULL;
 	apr_status_t status = SWITCH_STATUS_SUCCESS;
+	switch_dso_handle_sym_t interface_struct_handle = NULL;
+	switch_loadable_module_function_table_t *mod_interface_functions = NULL;
+	char *struct_name = NULL;
 	switch_dso_handle_sym_t load_function_handle = NULL;
 	switch_dso_handle_sym_t shutdown_function_handle = NULL;
 	switch_dso_handle_sym_t runtime_function_handle = NULL;
@@ -651,10 +654,10 @@
 	char derr[512] = "";
 	switch_memory_pool_t *pool;
 
-	assert(filename != NULL);
+	assert(path != NULL);
 
 	*new_module = NULL;
-	status = switch_dso_load(&dso, filename, loadable_modules.pool);
+	status = switch_dso_load(&dso, path, loadable_modules.pool);
 
 	if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
@@ -668,15 +671,22 @@
 			break;
 		}
 
-		status = switch_dso_sym(&load_function_handle, dso, "switch_module_load");
-		load_func_ptr = (switch_module_load_t) (intptr_t) load_function_handle;
+		struct_name = switch_core_sprintf(pool, "%s_module_interface", filename);
+		status = switch_dso_sym(&interface_struct_handle, dso, struct_name);
+		if (interface_struct_handle) {
+			mod_interface_functions = interface_struct_handle;
+			load_func_ptr = mod_interface_functions->load;
+		} else {
+			status = switch_dso_sym(&load_function_handle, dso, "switch_module_load");
+			load_func_ptr = (switch_module_load_t) (intptr_t) load_function_handle;
+		}
 
 		if (load_func_ptr == NULL) {
 			err = "Cannot locate symbol 'switch_module_load' please make sure this is a vaild module.";
 			break;
 		}
 
-		status = load_func_ptr(&module_interface, filename);
+		status = load_func_ptr(&module_interface, pool);
 
 		if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_NOUNLOAD) {
 			err = "Module load routine returned an error";
@@ -701,19 +711,24 @@
 		if (pool) {
 			switch_core_destroy_memory_pool(&pool);
 		}
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Loading module %s\n**%s**\n", filename, err);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Loading module %s\n**%s**\n", path, err);
 		return SWITCH_STATUS_GENERR;
 	}
 
 	module->pool = pool;
-	module->filename = switch_core_strdup(module->pool, filename);
+	module->filename = switch_core_strdup(module->pool, path);
 	module->module_interface = module_interface;
 	module->switch_module_load = load_func_ptr;
 
-	switch_dso_sym(&shutdown_function_handle, dso, "switch_module_shutdown");
-	module->switch_module_shutdown = (switch_module_shutdown_t) (intptr_t) shutdown_function_handle;
-	switch_dso_sym(&runtime_function_handle, dso, "switch_module_runtime");
-	module->switch_module_runtime = (switch_module_runtime_t) (intptr_t) runtime_function_handle;
+	if (mod_interface_functions) {
+		module->switch_module_shutdown = mod_interface_functions->shutdown;
+		module->switch_module_runtime = mod_interface_functions->runtime;
+	} else {
+		switch_dso_sym(&shutdown_function_handle, dso, "switch_module_shutdown");
+		module->switch_module_shutdown = (switch_module_shutdown_t) (intptr_t) shutdown_function_handle;
+		switch_dso_sym(&runtime_function_handle, dso, "switch_module_runtime");
+		module->switch_module_runtime = (switch_module_runtime_t) (intptr_t) runtime_function_handle;
+	}
 
 	module->lib = dso;
 
@@ -728,7 +743,7 @@
 {
 	switch_size_t len = 0;
 	char *path;
-	char *file;
+	char *file, *dot;
 	switch_loadable_module_t *new_module = NULL;
 	switch_status_t status;
 
@@ -747,29 +762,28 @@
 
 	if (*file == '/') {
 		path = switch_core_strdup(loadable_modules.pool, file);
+		file = (char *)switch_cut_path(file);
+		if ((dot = strchr(file, '.'))) {
+			dot = '\0';
+		}
 	} else {
-		if (strchr(file, '.')) {
-			len = strlen(dir);
-			len += strlen(file);
-			len += 4;
-			path = (char *) switch_core_alloc(loadable_modules.pool, len);
-			snprintf(path, len, "%s%s%s", dir, SWITCH_PATH_SEPARATOR, file);
-		} else {
-			len = strlen(dir);
-			len += strlen(file);
-			len += 8;
-			path = (char *) switch_core_alloc(loadable_modules.pool, len);
-			snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
+		if ((dot = strchr(file, '.'))) {
+			dot = '\0';
 		}
+		len = strlen(dir);
+		len += strlen(file);
+		len += 8;
+		path = (char *) switch_core_alloc(loadable_modules.pool, len);
+		snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
 	}
 
 	switch_mutex_lock(loadable_modules.mutex);
 	if (switch_core_hash_find(loadable_modules.module_hash, file)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Module %s Already Loaded!\n", file);
-		*err = "Module already loadedn\n";
+		*err = "Module already loaded";
 		status = SWITCH_STATUS_FALSE;
-	} else if ((status = switch_loadable_module_load_file(path, &new_module) == SWITCH_STATUS_SUCCESS)) {
-		if ((status = switch_loadable_module_process((char *) file, new_module)) == SWITCH_STATUS_SUCCESS && runtime) {
+	} else if ((status = switch_loadable_module_load_file(path, file, &new_module) == SWITCH_STATUS_SUCCESS)) {
+		if ((status = switch_loadable_module_process(file, new_module)) == SWITCH_STATUS_SUCCESS && runtime) {
 			if (new_module->switch_module_runtime) {
 				switch_core_launch_thread(switch_loadable_module_exec, new_module, new_module->pool);
 			}
@@ -785,37 +799,11 @@
 
 SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir, char *fname, const char **err)
 {
-	char *path = NULL;
-	char *file = NULL;
 	switch_loadable_module_t *module = NULL;
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
-#ifdef WIN32
-	const char *ext = ".dll";
-#elif defined (MACOSX) || defined (DARWIN)
-	const char *ext = ".dylib";
-#else
-	const char *ext = ".so";
-#endif
-
-
-	if (!(file = strdup(fname))) {
-		abort();
-	}
-	
-	if (*file == '/') {
-		path = strdup(file);
-	} else {
-		if (strchr(file, '.')) {
-			path = switch_mprintf("%s%s%s", dir, SWITCH_PATH_SEPARATOR, file);
-		} else {
-			path = switch_mprintf("%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
-		}
-	}
-
-
 	switch_mutex_lock(loadable_modules.mutex);
-	if ((module = switch_core_hash_find(loadable_modules.module_hash, file))) {
+	if ((module = switch_core_hash_find(loadable_modules.module_hash, fname))) {
 		if (module->perm) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Module is not unloadable.\n");
 			*err = "Module is not unloadable";
@@ -829,9 +817,6 @@
 	}
 	switch_mutex_unlock(loadable_modules.mutex);
 
-	switch_safe_free(file);
-	switch_safe_free(path);
-
 	return status;
 
 }
@@ -870,7 +855,7 @@
 			break;
 		}
 
-		status = load_func_ptr(&module_interface, filename);
+		status = load_func_ptr(&module_interface, pool);
 
 		if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_NOUNLOAD) {
 			err = "Module load routine returned an error";
@@ -1212,7 +1197,7 @@
 		/* oh well we will use what we have */
 		array[i++] = codec_interface->implementations;
 
-	  found:
+	found:
 
 		if (i > arraylen) {
 			break;
@@ -1297,7 +1282,7 @@
 				}
 			}
 
-		  found:
+		found:
 
 			if (i > arraylen) {
 				break;
@@ -1348,6 +1333,84 @@
 	return status;
 }
 
+
+SWITCH_DECLARE(switch_loadable_module_interface_t *) switch_loadable_module_create_module_interface(switch_memory_pool_t *pool, const char *name)
+{
+	switch_loadable_module_interface_t *mod;
+
+	mod = switch_core_alloc(pool, sizeof(switch_loadable_module_interface_t));
+	assert(mod != NULL);
+
+	mod->pool = pool;
+
+	mod->module_name = switch_core_strdup(mod->pool, name);
+	
+	return mod;
+}
+
+#define ALLOC_INTERFACE(_TYPE_)	for(;;) {									\
+		switch_##_TYPE_##_interface_t *i, *ptr;							\
+		i = switch_core_alloc(mod->pool, sizeof(switch_##_TYPE_##_interface_t)); \
+		assert(i != NULL);												\
+		for (ptr = mod->_TYPE_##_interface; ptr && ptr->next; ptr = ptr->next); \
+		if (ptr) {														\
+			ptr->next = i;												\
+		} else {														\
+			mod->_TYPE_##_interface = i;								\
+		}																\
+																		\
+		return i; }
+
+
+SWITCH_DECLARE(void *) switch_loadable_module_create_interface(switch_loadable_module_interface_t *mod, switch_module_interface_name_t iname)
+{
+
+	switch(iname) {
+	case SWITCH_ENDPOINT_INTERFACE:
+		ALLOC_INTERFACE(endpoint);
+
+	case SWITCH_TIMER_INTERFACE:
+		ALLOC_INTERFACE(timer);
+		
+	case SWITCH_DIALPLAN_INTERFACE:
+		ALLOC_INTERFACE(dialplan);
+		
+	case SWITCH_CODEC_INTERFACE:
+		ALLOC_INTERFACE(codec);
+		
+	case SWITCH_APPLICATION_INTERFACE:
+		ALLOC_INTERFACE(application);
+		
+	case SWITCH_API_INTERFACE:
+		ALLOC_INTERFACE(api);
+		
+	case SWITCH_FILE_INTERFACE:
+		ALLOC_INTERFACE(file);
+		
+	case SWITCH_SPEECH_INTERFACE:
+		ALLOC_INTERFACE(speech);
+		
+	case SWITCH_DIRECTORY_INTERFACE:
+		ALLOC_INTERFACE(directory);
+		
+	case SWITCH_CHAT_INTERFACE:
+		ALLOC_INTERFACE(chat);
+		
+	case SWITCH_SAY_INTERFACE:
+		ALLOC_INTERFACE(say);
+		
+	case SWITCH_ASR_INTERFACE:
+		ALLOC_INTERFACE(asr);
+		
+	case SWITCH_MANAGEMENT_INTERFACE:
+		ALLOC_INTERFACE(management);
+		
+	default:
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid Module Type!\n");
+		return NULL;
+	}
+}
+
 /* For Emacs:
  * Local Variables:
  * mode:c

Modified: freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj
==============================================================================
--- freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj	(original)
+++ freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj	Thu Jun 14 12:39:04 2007
@@ -21,168 +21,270 @@
         }
         "Entry"
         {
+        "MsmKey" = "8:_0F091427EEA0245FBA87474748D35ABD"
+        "OwnerKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
         "MsmKey" = "8:_1273F63008CF585CA0E063E436B4646F"
         "OwnerKey" = "8:_2D09AB81AB8D45FF97E9DFA4DAC3465D"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
-        "OwnerKey" = "8:_UNDEFINED"
+        "MsmKey" = "8:_1273F63008CF585CA0E063E436B4646F"
+        "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_2814E641538B42EFA83525986A9D5AC1"
+        "MsmKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
-        "OwnerKey" = "8:_UNDEFINED"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_2D09AB81AB8D45FF97E9DFA4DAC3465D"
-        "OwnerKey" = "8:_UNDEFINED"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_2F2FEC549F02436EB87961BD1B9E5783"
-        "OwnerKey" = "8:_UNDEFINED"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_FB1B9FBDC3294F1C96DAC4246C013C22"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_318FCC99E8D143D6B4F9F534E63009B3"
-        "OwnerKey" = "8:_UNDEFINED"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_F84240319757424DB1C58AD0AD420127"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
-        "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
-        "OwnerKey" = "8:_3E37631016BC45B2B672FE23257D542B"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_EF14CB99F3414BB689D0CB0E6D6B8AB8"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
-        "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_E763C699DF0948B6984DDEB96A2DFD06"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
-        "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_D7EC5795A9C645AC8E129C2EE6D461ED"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
-        "OwnerKey" = "8:_EF14CB99F3414BB689D0CB0E6D6B8AB8"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_D6F0F5845FAD4707975CE012A33CD607"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_D1269F1E49D442CF8EAC96C23E60325D"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
-        "OwnerKey" = "8:_BB649A2C1ABE4895859025B09A240323"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_D0BB09AFB8D94B76918F0EE85BCCAD0A"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_C81AC700C1BC4A55B98DF12C0CBAFD6F"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_C105055EE271471A999CE7022E617EB7"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_B20769E090034897B32E3EA4EC1BA8A0"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
-        "OwnerKey" = "8:_A944ADCEDF884574A23F7BA5420A6BA1"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_B0A2E9B4C45D4098AFD734D0C4E3EAFB"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_AD2EB44FE6D548F2A8DA4F9F2CE817AC"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_A0D5F714A0F94250A1C39603B699AB82"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_87768631363249B2B301143C193612F7"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_83C1B93AD71B4F8F9E074F9607B60DF1"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_7358123D2D064AD1BC517911A8B23D1B"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_6E5C001E7A314DCEA0A4BF52BF74BCAD"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_684D96FA2BDD46909367E651099D8C4E"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_5A636BB90F7F4B86ACB8839EA2C899AA"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_3FBEFE0119944C6781F81104ECEF37CA"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_3E37631016BC45B2B672FE23257D542B"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_318FCC99E8D143D6B4F9F534E63009B3"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_2F2FEC549F02436EB87961BD1B9E5783"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "OwnerKey" = "8:_2D09AB81AB8D45FF97E9DFA4DAC3465D"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
         "OwnerKey" = "8:_2814E641538B42EFA83525986A9D5AC1"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
+        "MsmKey" = "8:_2814E641538B42EFA83525986A9D5AC1"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_2D09AB81AB8D45FF97E9DFA4DAC3465D"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_2F2FEC549F02436EB87961BD1B9E5783"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_318FCC99E8D143D6B4F9F534E63009B3"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
         "MsmKey" = "8:_329D8DAE6C01FCF026E9DFB48B932203"
         "OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
+        "MsmKey" = "8:_35FACDFFDDB943568B7588D14D0513A7"
+        "OwnerKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
         "MsmKey" = "8:_3E37631016BC45B2B672FE23257D542B"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
@@ -201,6 +303,18 @@
         }
         "Entry"
         {
+        "MsmKey" = "8:_525E8ED430D44113995AB8FBF1945569"
+        "OwnerKey" = "8:_548996CD77304E3598846F122E79431A"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_548996CD77304E3598846F122E79431A"
+        "OwnerKey" = "8:_D1269F1E49D442CF8EAC96C23E60325D"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
         "MsmKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
@@ -219,7 +333,7 @@
         }
         "Entry"
         {
-        "MsmKey" = "8:_69EB1A147CC2428435BDCA35014C96E1"
+        "MsmKey" = "8:_6A4CAD73F43678BF7C05E8FB41042F74"
         "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
         "MsmSig" = "8:_UNDEFINED"
         }
@@ -231,12 +345,6 @@
         }
         "Entry"
         {
-        "MsmKey" = "8:_72A8732C0C0C4D0EAAE89DBB82073335"
-        "OwnerKey" = "8:_UNDEFINED"
-        "MsmSig" = "8:_UNDEFINED"
-        }
-        "Entry"
-        {
         "MsmKey" = "8:_7358123D2D064AD1BC517911A8B23D1B"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
@@ -268,12 +376,6 @@
         "Entry"
         {
         "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
-        "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
-        "MsmSig" = "8:_UNDEFINED"
-        }
-        "Entry"
-        {
-        "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
         "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
         "MsmSig" = "8:_UNDEFINED"
         }
@@ -285,20 +387,14 @@
         }
         "Entry"
         {
-        "MsmKey" = "8:_91BA2668F87764F53188E93BC8D363D7"
-        "OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
-        "MsmSig" = "8:_UNDEFINED"
-        }
-        "Entry"
-        {
-        "MsmKey" = "8:_98CF7609810C41BABC219DFBA0A6075D"
-        "OwnerKey" = "8:_327123955D614480BF2995F2C39195DD"
+        "MsmKey" = "8:_8BDB1C76D7153C0CC909D697582518E3"
+        "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
-        "MsmKey" = "8:_9A293E8A356A4959BB6E541B7DC213CD"
-        "OwnerKey" = "8:_UNDEFINED"
+        "MsmKey" = "8:_91BA2668F87764F53188E93BC8D363D7"
+        "OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
@@ -339,6 +435,24 @@
         }
         "Entry"
         {
+        "MsmKey" = "8:_ADA22D44BCDEBA509E09A5D4C155AA41"
+        "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_ADA22D44BCDEBA509E09A5D4C155AA41"
+        "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_ADA22D44BCDEBA509E09A5D4C155AA41"
+        "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
         "MsmKey" = "8:_B0A2E9B4C45D4098AFD734D0C4E3EAFB"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
@@ -357,6 +471,12 @@
         }
         "Entry"
         {
+        "MsmKey" = "8:_BB7F62033A5B7A961202771F5A4E4995"
+        "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
         "MsmKey" = "8:_C105055EE271471A999CE7022E617EB7"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
@@ -417,12 +537,6 @@
         }
         "Entry"
         {
-        "MsmKey" = "8:_E4BCD553B2054B0F8BC67428E1A11674"
-        "OwnerKey" = "8:_UNDEFINED"
-        "MsmSig" = "8:_UNDEFINED"
-        }
-        "Entry"
-        {
         "MsmKey" = "8:_E763C699DF0948B6984DDEB96A2DFD06"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
@@ -648,6 +762,26 @@
             "IsDependency" = "11:FALSE"
             "IsolateTo" = "8:"
             }
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0F091427EEA0245FBA87474748D35ABD"
+            {
+            "SourcePath" = "8:js32.dll"
+            "TargetName" = "8:js32.dll"
+            "Tag" = "8:"
+            "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:TRUE"
+            "IsolateTo" = "8:"
+            }
             "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1273F63008CF585CA0E063E436B4646F"
             {
             "SourcePath" = "8:iphlpapi.dll"
@@ -688,10 +822,10 @@
             "IsDependency" = "11:TRUE"
             "IsolateTo" = "8:"
             }
-            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_69EB1A147CC2428435BDCA35014C96E1"
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_6A4CAD73F43678BF7C05E8FB41042F74"
             {
-            "SourcePath" = "8:libsqlite.dll"
-            "TargetName" = "8:libsqlite.dll"
+            "SourcePath" = "8:libteletone.dll"
+            "TargetName" = "8:libteletone.dll"
             "Tag" = "8:"
             "Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
             "Condition" = "8:"
@@ -704,7 +838,7 @@
             "SharedLegacy" = "11:FALSE"
             "PackageAs" = "3:1"
             "Register" = "3:1"
-            "Exclude" = "11:TRUE"
+            "Exclude" = "11:FALSE"
             "IsDependency" = "11:TRUE"
             "IsolateTo" = "8:"
             }
@@ -744,7 +878,27 @@
             "SharedLegacy" = "11:FALSE"
             "PackageAs" = "3:1"
             "Register" = "3:1"
-            "Exclude" = "11:TRUE"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:TRUE"
+            "IsolateTo" = "8:"
+            }
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8BDB1C76D7153C0CC909D697582518E3"
+            {
+            "SourcePath" = "8:libapr.dll"
+            "TargetName" = "8:libapr.dll"
+            "Tag" = "8:"
+            "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
             "IsDependency" = "11:TRUE"
             "IsolateTo" = "8:"
             }
@@ -784,7 +938,7 @@
             "SharedLegacy" = "11:FALSE"
             "PackageAs" = "3:1"
             "Register" = "3:1"
-            "Exclude" = "11:TRUE"
+            "Exclude" = "11:FALSE"
             "IsDependency" = "11:TRUE"
             "IsolateTo" = "8:"
             }
@@ -828,6 +982,46 @@
             "IsDependency" = "11:FALSE"
             "IsolateTo" = "8:"
             }
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_ADA22D44BCDEBA509E09A5D4C155AA41"
+            {
+            "SourcePath" = "8:ODBC32.dll"
+            "TargetName" = "8:ODBC32.dll"
+            "Tag" = "8:"
+            "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:TRUE"
+            "IsolateTo" = "8:"
+            }
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_BB7F62033A5B7A961202771F5A4E4995"
+            {
+            "SourcePath" = "8:libaprutil.dll"
+            "TargetName" = "8:libaprutil.dll"
+            "Tag" = "8:"
+            "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:TRUE"
+            "IsolateTo" = "8:"
+            }
             "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D7E82DD20D5B47395F635480C8E3A1D3"
             {
             "SourcePath" = "8:FreeSwitch.dll"
@@ -1610,7 +1804,7 @@
         }
         "MergeModule"
         {
-            "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_327123955D614480BF2995F2C39195DD"
+            "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_27200676A75147D0BB7FA5500BB31A6D"
             {
             "UseDynamicProperties" = "11:TRUE"
             "IsDependency" = "11:TRUE"
@@ -1624,7 +1818,7 @@
             "Feature" = "8:"
             "IsolateTo" = "8:"
             }
-            "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_98CF7609810C41BABC219DFBA0A6075D"
+            "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_35FACDFFDDB943568B7588D14D0513A7"
             {
             "UseDynamicProperties" = "11:TRUE"
             "IsDependency" = "11:TRUE"
@@ -1638,6 +1832,34 @@
             "Feature" = "8:"
             "IsolateTo" = "8:"
             }
+            "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_525E8ED430D44113995AB8FBF1945569"
+            {
+            "UseDynamicProperties" = "11:TRUE"
+            "IsDependency" = "11:TRUE"
+            "SourcePath" = "8:policy_8_0_microsoft_vc80_crt_x86.msm"
+                "Properties"
+                {
+                }
+            "LanguageId" = "3:0"
+            "Exclude" = "11:FALSE"
+            "Folder" = "8:"
+            "Feature" = "8:"
+            "IsolateTo" = "8:"
+            }
+            "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_548996CD77304E3598846F122E79431A"
+            {
+            "UseDynamicProperties" = "11:TRUE"
+            "IsDependency" = "11:TRUE"
+            "SourcePath" = "8:Microsoft_VC80_CRT_x86.msm"
+                "Properties"
+                {
+                }
+            "LanguageId" = "3:0"
+            "Exclude" = "11:FALSE"
+            "Folder" = "8:"
+            "Feature" = "8:"
+            "IsolateTo" = "8:"
+            }
         }
         "ProjectOutput"
         {
@@ -2005,34 +2227,6 @@
                 {
                 }
             }
-            "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_72A8732C0C0C4D0EAAE89DBB82073335"
-            {
-            "SourcePath" = "8:..\\..\\debug\\mod\\mod_playback.dll"
-            "TargetName" = "8:"
-            "Tag" = "8:"
-            "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
-            "Condition" = "8:"
-            "Transitive" = "11:FALSE"
-            "Vital" = "11:TRUE"
-            "ReadOnly" = "11:FALSE"
-            "Hidden" = "11:FALSE"
-            "System" = "11:FALSE"
-            "Permanent" = "11:FALSE"
-            "SharedLegacy" = "11:FALSE"
-            "PackageAs" = "3:1"
-            "Register" = "3:1"
-            "Exclude" = "11:FALSE"
-            "IsDependency" = "11:FALSE"
-            "IsolateTo" = "8:"
-            "ProjectOutputGroupRegister" = "3:1"
-            "OutputConfiguration" = "8:"
-            "OutputGroupCanonicalName" = "8:Built"
-            "OutputProjectGuid" = "8:{78100236-7CEA-4948-96CC-E8ED3160329C}"
-            "ShowKeyOutput" = "11:TRUE"
-                "ExcludeFilters"
-                {
-                }
-            }
             "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_7358123D2D064AD1BC517911A8B23D1B"
             {
             "SourcePath" = "8:..\\..\\debug\\mod\\mod_softtimer.dll"
@@ -2117,37 +2311,9 @@
                 {
                 }
             }
-            "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_9A293E8A356A4959BB6E541B7DC213CD"
-            {
-            "SourcePath" = "8:..\\..\\debug\\mod\\mod_bridgecall.dll"
-            "TargetName" = "8:"
-            "Tag" = "8:"
-            "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
-            "Condition" = "8:"
-            "Transitive" = "11:FALSE"
-            "Vital" = "11:TRUE"
-            "ReadOnly" = "11:FALSE"
-            "Hidden" = "11:FALSE"
-            "System" = "11:FALSE"
-            "Permanent" = "11:FALSE"
-            "SharedLegacy" = "11:FALSE"
-            "PackageAs" = "3:1"
-            "Register" = "3:1"
-            "Exclude" = "11:FALSE"
-            "IsDependency" = "11:FALSE"
-            "IsolateTo" = "8:"
-            "ProjectOutputGroupRegister" = "3:1"
-            "OutputConfiguration" = "8:"
-            "OutputGroupCanonicalName" = "8:Built"
-            "OutputProjectGuid" = "8:{E1794405-29D4-466D-9BE3-DD2344C2A663}"
-            "ShowKeyOutput" = "11:TRUE"
-                "ExcludeFilters"
-                {
-                }
-            }
             "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_A0D5F714A0F94250A1C39603B699AB82"
             {
-            "SourcePath" = "8:..\\..\\libs\\libteletone\\Debug\\libteletone.dll"
+            "SourcePath" = "8:..\\..\\debug\\libteletone.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
@@ -2175,7 +2341,7 @@
             }
             "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_A944ADCEDF884574A23F7BA5420A6BA1"
             {
-            "SourcePath" = "8:..\\..\\debug\\libsqlite.dll"
+            "SourcePath" = "8:..\\..\\libs\\win32\\sqlite\\Debug\\libsqlite.lib"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
@@ -2287,7 +2453,7 @@
             }
             "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_BB649A2C1ABE4895859025B09A240323"
             {
-            "SourcePath" = "8:..\\..\\debug\\libpcre.dll"
+            "SourcePath" = "8:..\\..\\libs\\win32\\pcre\\Debug\\libpcre.lib"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
@@ -2509,34 +2675,6 @@
                 {
                 }
             }
-            "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_E4BCD553B2054B0F8BC67428E1A11674"
-            {
-            "SourcePath" = "8:..\\..\\debug\\mod\\mod_echo.dll"
-            "TargetName" = "8:"
-            "Tag" = "8:"
-            "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
-            "Condition" = "8:"
-            "Transitive" = "11:FALSE"
-            "Vital" = "11:TRUE"
-            "ReadOnly" = "11:FALSE"
-            "Hidden" = "11:FALSE"
-            "System" = "11:FALSE"
-            "Permanent" = "11:FALSE"
-            "SharedLegacy" = "11:FALSE"
-            "PackageAs" = "3:1"
-            "Register" = "3:1"
-            "Exclude" = "11:FALSE"
-            "IsDependency" = "11:FALSE"
-            "IsolateTo" = "8:"
-            "ProjectOutputGroupRegister" = "3:1"
-            "OutputConfiguration" = "8:"
-            "OutputGroupCanonicalName" = "8:Built"
-            "OutputProjectGuid" = "8:{0E2C6395-13B9-46E5-9264-8859D346018D}"
-            "ShowKeyOutput" = "11:TRUE"
-                "ExcludeFilters"
-                {
-                }
-            }
             "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_E763C699DF0948B6984DDEB96A2DFD06"
             {
             "SourcePath" = "8:..\\..\\debug\\mod\\mod_PortAudio.dll"



More information about the Freeswitch-branches mailing list