[Freeswitch-branches] [commit] r11086 - in freeswitch/branches/gmaruzz: . build conf conf/autoload_configs conf/dialplan conf/directory conf/directory/default conf/sip_profiles debian docs libs/esl libs/esl/getopt libs/esl/src libs/esl/src/include libs/libg722_1/src libs/portaudio/src/os/win libs/sofia-sip/libsofia-sip-ua/su libs/win32 libs/win32/flite libs/win32/pocketsphinx libs/win32/sphinxbase scripts src src/include src/mod/applications/mod_commands src/mod/applications/mod_conference src/mod/applications/mod_dptools src/mod/applications/mod_easyroute src/mod/applications/mod_limit src/mod/applications/mod_voicemail src/mod/endpoints/mod_iax src/mod/endpoints/mod_sofia src/mod/event_handlers/mod_erlang_event src/mod/event_handlers/mod_event_multicast src/mod/event_handlers/mod_event_socket src/mod/formats/mod_shout src/mod/languages/mod_managed src/mod/languages/mod_managed/managed src/mod/languages/mod_spidermonkey src/mod/xml_int/mod_xml_rpc support-d

FreeSWITCH SVN gmaruzz at freeswitch.org
Wed Jan 7 08:17:00 PST 2009


Author: gmaruzz
Date: Wed Jan  7 10:17:00 2009
New Revision: 11086

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

Added:
   freeswitch/branches/gmaruzz/Freeswitch.2008.express.sln
      - copied unchanged from r11085, /freeswitch/trunk/Freeswitch.2008.express.sln
   freeswitch/branches/gmaruzz/conf/autoload_configs/easyroute.conf.xml
      - copied unchanged from r11085, /freeswitch/trunk/conf/autoload_configs/easyroute.conf.xml
   freeswitch/branches/gmaruzz/libs/esl/fs_cli.conf
      - copied unchanged from r11085, /freeswitch/trunk/libs/esl/fs_cli.conf
   freeswitch/branches/gmaruzz/libs/esl/getopt/
      - copied from r11085, /freeswitch/trunk/libs/esl/getopt/
   freeswitch/branches/gmaruzz/libs/esl/getopt/getopt.h
      - copied unchanged from r11085, /freeswitch/trunk/libs/esl/getopt/getopt.h
   freeswitch/branches/gmaruzz/libs/esl/getopt/getopt_long.c
      - copied unchanged from r11085, /freeswitch/trunk/libs/esl/getopt/getopt_long.c
   freeswitch/branches/gmaruzz/scripts/easyroute_mysql.sql
      - copied unchanged from r11085, /freeswitch/trunk/scripts/easyroute_mysql.sql
   freeswitch/branches/gmaruzz/scripts/m4a-to-wav.sh
      - copied unchanged from r11085, /freeswitch/trunk/scripts/m4a-to-wav.sh
   freeswitch/branches/gmaruzz/src/mod/applications/mod_easyroute/
      - copied from r11085, /freeswitch/trunk/src/mod/applications/mod_easyroute/
   freeswitch/branches/gmaruzz/src/mod/applications/mod_easyroute/Makefile
      - copied unchanged from r11085, /freeswitch/trunk/src/mod/applications/mod_easyroute/Makefile
   freeswitch/branches/gmaruzz/src/mod/applications/mod_easyroute/mod_easyroute.c
      - copied unchanged from r11085, /freeswitch/trunk/src/mod/applications/mod_easyroute/mod_easyroute.c
Modified:
   freeswitch/branches/gmaruzz/Freeswitch.2008.sln
   freeswitch/branches/gmaruzz/Makefile.am
   freeswitch/branches/gmaruzz/build/modules.conf.in
   freeswitch/branches/gmaruzz/build/sounds_version.txt
   freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml
   freeswitch/branches/gmaruzz/conf/dialplan/default.xml
   freeswitch/branches/gmaruzz/conf/directory/default.xml
   freeswitch/branches/gmaruzz/conf/directory/default/brian.xml
   freeswitch/branches/gmaruzz/conf/sip_profiles/internal-ipv6.xml
   freeswitch/branches/gmaruzz/conf/vars.xml
   freeswitch/branches/gmaruzz/debian/changelog
   freeswitch/branches/gmaruzz/debian/freeswitch.install
   freeswitch/branches/gmaruzz/docs/ChangeLog
   freeswitch/branches/gmaruzz/docs/Doxygen.conf
   freeswitch/branches/gmaruzz/libs/esl/Makefile
   freeswitch/branches/gmaruzz/libs/esl/fs_cli.2008.vcproj
   freeswitch/branches/gmaruzz/libs/esl/fs_cli.c
   freeswitch/branches/gmaruzz/libs/esl/src/esl.2008.vcproj
   freeswitch/branches/gmaruzz/libs/esl/src/esl.c
   freeswitch/branches/gmaruzz/libs/esl/src/esl_event.c
   freeswitch/branches/gmaruzz/libs/esl/src/include/esl.h
   freeswitch/branches/gmaruzz/libs/esl/src/include/esl_config.h
   freeswitch/branches/gmaruzz/libs/esl/testclient.c
   freeswitch/branches/gmaruzz/libs/esl/testserver.c
   freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4.h
   freeswitch/branches/gmaruzz/libs/portaudio/src/os/win/pa_win_wdmks_utils.c
   freeswitch/branches/gmaruzz/libs/portaudio/src/os/win/pa_x86_plain_converters.c
   freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c
   freeswitch/branches/gmaruzz/libs/win32/Dowload 32khz Sounds.2008.vcproj
   freeswitch/branches/gmaruzz/libs/win32/Download 16khz Sounds.2008.vcproj
   freeswitch/branches/gmaruzz/libs/win32/Download 8khz Sounds.2008.vcproj
   freeswitch/branches/gmaruzz/libs/win32/flite/flite.2008.vcproj
   freeswitch/branches/gmaruzz/libs/win32/pocketsphinx/pocketsphinx.2008.vcproj
   freeswitch/branches/gmaruzz/libs/win32/sphinxbase/sphinxbase.2008.vcproj
   freeswitch/branches/gmaruzz/src/include/switch_channel.h
   freeswitch/branches/gmaruzz/src/include/switch_dso.h
   freeswitch/branches/gmaruzz/src/include/switch_ivr.h
   freeswitch/branches/gmaruzz/src/include/switch_rtp.h
   freeswitch/branches/gmaruzz/src/include/switch_types.h
   freeswitch/branches/gmaruzz/src/include/switch_xml.h
   freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_dptools/mod_dptools.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_limit/mod_limit.c
   freeswitch/branches/gmaruzz/src/mod/applications/mod_voicemail/mod_voicemail.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_iax/mod_iax.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.h
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_glue.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_reg.c
   freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
   freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
   freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
   freeswitch/branches/gmaruzz/src/mod/formats/mod_shout/Makefile
   freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/freeswitch_wrap.cxx
   freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/managed/swig.cs
   freeswitch/branches/gmaruzz/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/branches/gmaruzz/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
   freeswitch/branches/gmaruzz/src/switch_apr.c
   freeswitch/branches/gmaruzz/src/switch_channel.c
   freeswitch/branches/gmaruzz/src/switch_console.c
   freeswitch/branches/gmaruzz/src/switch_core.c
   freeswitch/branches/gmaruzz/src/switch_core_io.c
   freeswitch/branches/gmaruzz/src/switch_core_session.c
   freeswitch/branches/gmaruzz/src/switch_core_state_machine.c
   freeswitch/branches/gmaruzz/src/switch_dso.c
   freeswitch/branches/gmaruzz/src/switch_event.c
   freeswitch/branches/gmaruzz/src/switch_ivr.c
   freeswitch/branches/gmaruzz/src/switch_ivr_async.c
   freeswitch/branches/gmaruzz/src/switch_ivr_bridge.c
   freeswitch/branches/gmaruzz/src/switch_ivr_originate.c
   freeswitch/branches/gmaruzz/src/switch_log.c
   freeswitch/branches/gmaruzz/src/switch_rtp.c
   freeswitch/branches/gmaruzz/src/switch_xml.c
   freeswitch/branches/gmaruzz/support-d/.screenrc

Modified: freeswitch/branches/gmaruzz/Freeswitch.2008.sln
==============================================================================
--- freeswitch/branches/gmaruzz/Freeswitch.2008.sln	(original)
+++ freeswitch/branches/gmaruzz/Freeswitch.2008.sln	Wed Jan  7 10:17:00 2009
@@ -831,6 +831,10 @@
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aprtoolkit", "libs\openmrcp\aprtoolkit\aprtoolkit.2008.vcproj", "{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_fsv", "src\mod\applications\mod_fsv\mod_fsv.2008.vcproj", "{E3246D17-E29B-4AB5-962A-C69B0C5837BB}"
 	ProjectSection(ProjectDependencies) = postProject
@@ -1726,6 +1730,7 @@
 		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.Build.0 = Debug|Any CPU
 		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.ActiveCfg = Debug|Any CPU
 		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.ActiveCfg = Release|Any CPU
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.Build.0 = Release|Any CPU
 		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.ActiveCfg = Release|Any CPU
 		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.ActiveCfg = Debug|Win32
 		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.Build.0 = Debug|Win32
@@ -1770,8 +1775,10 @@
 		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.Build.0 = Release|Win32
 		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.ActiveCfg = Release|Win32
 		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.Build.0 = Debug|Win32
 		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|x64.ActiveCfg = Debug|Win32
 		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.ActiveCfg = Release|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.Build.0 = Release|Win32
 		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|x64.ActiveCfg = Release|Win32
 		{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.ActiveCfg = Debug|Win32
 		{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.Build.0 = Debug|Win32

Modified: freeswitch/branches/gmaruzz/Makefile.am
==============================================================================
--- freeswitch/branches/gmaruzz/Makefile.am	(original)
+++ freeswitch/branches/gmaruzz/Makefile.am	Wed Jan  7 10:17:00 2009
@@ -158,13 +158,18 @@
 CLEANFILES     = src/include/switch_version.h src/include/switch_swigable_cpp.h
 BUILT_SOURCES  = src/include/switch_version.h src/include/switch_swigable_cpp.h
 
-bin_PROGRAMS = freeswitch
+bin_PROGRAMS = freeswitch fs_cli
+fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c libs/esl/src/esl_threadmutex.c libs/esl/fs_cli.c
 freeswitch_SOURCES = src/switch.c
-nodist_freeswitch_SOURCES = src/include/switch_version.h 
+nodist_freeswitch_SOURCES = src/include/switch_version.h
+fs_cli_CFLAGS = $(AM_CFLAGS) -Ilibs/esl/src/include 
+fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread
 freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS)
 freeswitch_LDFLAGS = $(AM_LDFLAGS) -rpath $(libdir)
 freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la
 if ADD_LIBEDIT
+fs_cli_CFLAGS += -DHAVE_EDITLINE -Ilibs/libedit/src
+fs_cli_LDADD = libs/libedit/src/.libs/libedit.a
 freeswitch_CFLAGS    += -Ilibs/libedit/src -DSWITCH_HAVE_LIBEDIT
 freeswitch_LDADD      += libs/libedit/src/.libs/libedit.a
 endif

Modified: freeswitch/branches/gmaruzz/build/modules.conf.in
==============================================================================
--- freeswitch/branches/gmaruzz/build/modules.conf.in	(original)
+++ freeswitch/branches/gmaruzz/build/modules.conf.in	Wed Jan  7 10:17:00 2009
@@ -11,6 +11,7 @@
 applications/mod_limit
 applications/mod_expr
 applications/mod_esf
+#applications/mod_easyroute
 applications/mod_fsv
 #applications/mod_soundtouch
 #applications/mod_rss

Modified: freeswitch/branches/gmaruzz/build/sounds_version.txt
==============================================================================
--- freeswitch/branches/gmaruzz/build/sounds_version.txt	(original)
+++ freeswitch/branches/gmaruzz/build/sounds_version.txt	Wed Jan  7 10:17:00 2009
@@ -1 +1 @@
-1.0.6
+1.0.7

Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml	Wed Jan  7 10:17:00 2009
@@ -150,7 +150,7 @@
       <!--<param name="tts-engine" value="flite"/>-->
       <!--<param name="tts-voice" value="kal16"/>-->
     </profile>
-    <!--
+
     <profile name="cdquality">
       <param name="domain" value="$${domain}"/>
       <param name="rate" value="48000"/>
@@ -173,6 +173,6 @@
       <param name="caller-id-number" value="$${outbound_caller_id}"/>
       <param name="comfort-noise" value="true"/>
     </profile>
-    -->
+
   </profiles>
 </configuration>

Modified: freeswitch/branches/gmaruzz/conf/dialplan/default.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/dialplan/default.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/dialplan/default.xml	Wed Jan  7 10:17:00 2009
@@ -188,13 +188,8 @@
     </extension>
 
     <extension name="extension-intercom">
-      <!-- <condition field="${sip_to_params}" expression="intercom\=true"/> -->
       <condition field="destination_number" expression="^8(10[01][0-9])$">
 	<action application="set" data="dialed_extension=$1"/>
-	<!-- This Alert-Info seems to be a case for Intercom for Polycom which sip_auto_answer=true covers already. -->
-	<!--<action application="export"><![CDATA[alert_info=<sip:${domain_name}>;Ring;Answer]]></action>-->
-	<action application="export"><![CDATA[sip_h_Call-Info=<sip:${domain_name}>;answer-after=0]]></action>
-	<action application="export" data="sip_invite_params=intercom=true"/>
 	<action application="export" data="sip_auto_answer=true"/>
 	<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
       </condition>
@@ -240,6 +235,24 @@
       </condition>
     </extension>
 
+    <extension name="group_dial_sales">
+      <condition field="destination_number" expression="^2000$">
+	<action application="bridge" data="${group_call(sales@${domain_name})}"/>
+      </condition>
+    </extension>
+
+    <extension name="group_dial_support">
+      <condition field="destination_number" expression="^2001$">
+	<action application="bridge" data="group/support@${domain_name}"/>
+      </condition>
+    </extension>
+
+    <extension name="group_dial_billing">
+      <condition field="destination_number" expression="^2002$">
+	<action application="bridge" data="group/billing@${domain_name}"/>
+      </condition>
+    </extension>
+
     <!-- voicemail operator extension -->
     <extension name="operator">
       <condition field="destination_number" expression="^operator$|^0$">
@@ -287,30 +300,69 @@
 	<action application="conference" data="$1-${domain_name}@ultrawideband"/>
       </condition>
     </extension>
+    <!-- MONO 48kHz conferences -->
+    <extension name="cdquality_conferences">
+      <condition field="destination_number" expression="^(33\d{2})$">
+	<action application="answer"/>
+	<action application="conference" data="$1-${domain_name}@cdquality"/>
+      </condition>
+    </extension>
     
     <!-- dial the freeswitch conference via SIP-->
     <extension name="freeswitch_public_conf_via_sip">
-      <condition field="destination_number" expression="^9(888|1616)$">
+      <condition field="destination_number" expression="^9(888|1616|3232)$">
 	<action application="bridge" data="sofia/${use_profile}/$1 at conference.freeswitch.org"/>
       </condition>
     </extension>
 
-    <!--This extension will start a conference and invite several people upon entering -->
-    <extension name="mad_boss">
+    <!--
+	This extension will start a conference and invite a group.
+	At anytime the participant can dial *2 to bridge directly to the boss. 
+	All other callers are then hung up on.
+    -->
+    <extension name="mad_boss_intercom">
       <condition field="destination_number" expression="^0911$">
+	<action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss1"/>
+	<action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
+	<action application="set" data="conference_auto_outcall_timeout=60"/>
+	<action application="set" data="conference_auto_outcall_flags=mute"/>
+	<action application="set" data="conference_auto_outcall_prefix={sip_auto_answer=true,execute_on_answer='bind_meta_app 2 a s1 intercept::${uuid}'}"/>
+	<action application="set" data="sip_exclude_contact=${network_addr}"/>
+	<action application="conference_set_auto_outcall" data="${group_call(sales)}"/>
+	<action application="conference" data="madboss_intercom1 at default+flags{endconf|deaf}"/>
+      </condition>
+    </extension>
 
+    <!--
+	This extension will start a conference and invite a few of people.
+	At anytime the participant can dial *2 to bridge directly to the boss. 
+	All other callers are then hung up on.
+    -->
+    <extension name="mad_boss_intercom">
+      <condition field="destination_number" expression="^0912$">
+	<action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss2"/>
+	<action application="set" data="conference_auto_outcall_caller_id_number=0912"/>
+	<action application="set" data="conference_auto_outcall_timeout=60"/>
+	<action application="set" data="conference_auto_outcall_flags=mute"/>
+	<action application="set" data="conference_auto_outcall_prefix={sip_auto_answer=true,execute_on_answer='bind_meta_app 2 a s1 intercept::${uuid}'}"/>
+	<action application="set" data="sip_exclude_contact=${network_addr}"/>
+	<action application="conference_set_auto_outcall" data="loopback/9999"/>
+	<action application="conference" data="madboss_intercom2 at default+flags{endconf|deaf}"/>
+      </condition>
+    </extension>
+
+    <!--This extension will start a conference and invite several people upon entering -->
+    <extension name="mad_boss">
+      <condition field="destination_number" expression="^0913$">
 	<!--These params effect the outcalls made once you join-->
 	<action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss"/>
 	<action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
 	<action application="set" data="conference_auto_outcall_timeout=60"/>
 	<action application="set" data="conference_auto_outcall_flags=none"/>
 	<!--<action application="set" data="conference_auto_outcall_announce=say:You have been called into an emergency conference"/>-->
-
 	<!--Add as many of these as you need, These are the people you are going to call-->
-	<action application="conference_set_auto_outcall" data="sofia/gateway/$${default_provider}/19184238080"/>
-	<action application="conference_set_auto_outcall" data="sofia/default/888 at conference.freeswitch.org"/>
-
-	<action application="conference" data="cool at default"/>
+	<action application="conference_set_auto_outcall" data="loopback/9999"/>
+	<action application="conference" data="madboss3 at default"/>
       </condition>
     </extension>
 

Modified: freeswitch/branches/gmaruzz/conf/directory/default.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/directory/default.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/directory/default.xml	Wed Jan  7 10:17:00 2009
@@ -31,7 +31,48 @@
       <variable name="transfer_fallback_extension" value="operator"/>
     </variables>
 
-    <X-PRE-PROCESS cmd="include" data="default/*.xml"/>
+    <groups>
+      <group name="default">
+	<users>
+	  <X-PRE-PROCESS cmd="include" data="default/*.xml"/>
+	</users>
+      </group>
+
+      <group name="sales">
+	<users>
+	  <!--
+	      type="pointer" is a pointer so you can have the 
+	      same user in multiple groups.  It basically means
+	      to keep searching for the user in the directory.
+	  -->
+	  <user id="1000" type="pointer"/>
+	  <user id="1001" type="pointer"/>
+	  <user id="1002" type="pointer"/>
+	  <user id="1003" type="pointer"/>
+	  <user id="1004" type="pointer"/>
+	</users>
+      </group>
+
+      <group name="billing">
+	<users>
+	  <user id="1005" type="pointer"/>
+	  <user id="1006" type="pointer"/>
+	  <user id="1007" type="pointer"/>
+	  <user id="1008" type="pointer"/>
+	  <user id="1009" type="pointer"/>
+	</users>
+      </group>
+
+      <group name="support">
+	<users>
+	  <user id="1010" type="pointer"/>
+	  <user id="1011" type="pointer"/>
+	  <user id="1012" type="pointer"/>
+	  <user id="1013" type="pointer"/>
+	  <user id="1014" type="pointer"/>
+	</users>
+      </group>
+    </groups>
 
   </domain>
 </include>

Modified: freeswitch/branches/gmaruzz/conf/directory/default/brian.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/directory/default/brian.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/directory/default/brian.xml	Wed Jan  7 10:17:00 2009
@@ -1,7 +1,7 @@
 <include>
   <!-- ipauth if you have an ip= in the user attributes ie ip="1.2.3.4"  -->
   <!-- <user id="brian" ip="1.2.3.4"> -->
-  <user id="brian" mailbox="9999" cidr="1.2.3.4/24"> 
+  <user id="brian" mailbox="9999" cidr="192.0.2.0/24">
     <!-- Outbound Registrations Related to this user -->
     <gateways>
       <!--<gateway name="asterlink.com">-->

Modified: freeswitch/branches/gmaruzz/conf/sip_profiles/internal-ipv6.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/sip_profiles/internal-ipv6.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/sip_profiles/internal-ipv6.xml	Wed Jan  7 10:17:00 2009
@@ -115,17 +115,6 @@
     <!-- set to true to have the profile determine stun is not useful and turn it off globally-->
     <!--<param name="stun-auto-disable" value="true"/>-->
 
-    <!-- TLS: disabled by default, set to "true" to enable -->
-    <param name="tls" value="$${internal_ssl_enable}"/>
-    <!-- additional bind parameters for TLS -->
-    <param name="tls-bind-params" value="transport=tls"/>
-    <!-- Port to listen on for TLS requests. (5061 will be used if unspecified) -->
-    <param name="tls-sip-port" value="$${internal_tls_port}"/>
-    <!-- Location of the agent.pem and cafile.pem ssl certificates (needed for TLS server) -->
-    <param name="tls-cert-dir" value="$${internal_ssl_dir}"/>
-    <!-- TLS version ("sslv23" (default), "tlsv1"). NOTE: Phones may not work with TLSv1 -->
-    <param name="tls-version" value="$${sip_tls_version}"/>
-
   </settings>
 </profile>
 

Modified: freeswitch/branches/gmaruzz/conf/vars.xml
==============================================================================
--- freeswitch/branches/gmaruzz/conf/vars.xml	(original)
+++ freeswitch/branches/gmaruzz/conf/vars.xml	Wed Jan  7 10:17:00 2009
@@ -80,6 +80,12 @@
   -->
   <X-PRE-PROCESS cmd="set" data="bind_server_ip=auto"/>
 
+  <!-- NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
+       
+       If you're going to load test FreeSWITCH please input real IP addresses
+       for external_rtp_ip and external_sip_ip
+  -->
+
   <!-- external_rtp_ip
        Used as the public IP address for SDP.
        Can be an ip address or a string like "stun:stun.server.com" 

Modified: freeswitch/branches/gmaruzz/debian/changelog
==============================================================================
--- freeswitch/branches/gmaruzz/debian/changelog	(original)
+++ freeswitch/branches/gmaruzz/debian/changelog	Wed Jan  7 10:17:00 2009
@@ -1,3 +1,296 @@
+freeswitch (1.0.2-1) unstable; urgency=low
+
+   * all: don't add module interfaces before returning from error conditions in module load functions (MDXMLINT-36)
+   * all: fixed multiple memory leaks
+   * all: improved module unloading/reloading support
+   * build: add support for --switchconfdir (FSBUILD-84)
+   * build: fixed netbsd build
+   * build: make freeswitch stop graceflly with /etc/init.d/freeswitch stop on debian add working dir to start-stop-dir so freeswitch dumps core in workdir
+   * build: multiple packaging fixes
+   * build: user freeswitch not added to audio group on deb install (FSBUILD-95)
+   * Configuration: many updates to default configuration
+   * core: Add ability to choose uuid from originate string, originate_uuid var (use at your own risk) 
+   * core: add bridge_generate_comfort_noise option for bridge to generate comfort noise to the A leg when there is no audio on the B leg
+   * core: add chan vars to param event during hangup hook
+   * core: add exec directive to xml preprocessor (not available on windows)
+   * core: add force_transfer_dialplan and force_transfer_context variables
+   * core: add hashing to event header lookup 
+   * core: add hits to tone_detect
+   * core: add last_dtmf_duration variable
+   * core: add msleep function to swigged languages
+   * core: add park_after_bridge variable
+   * core: add per leg timeouts and specific cause codes in reject_on_single_fail
+   * core: add runtime selection of the module dir (FSCORE-198)
+   * core: add scheduler support for heartbeat
+   * core: add session heartbeat feature
+   * core: add session.destroy psuedo method to sort of destroy a session at least for the sake of FS
+   * core: add session.unsetInputCallback
+   * core: add strftime format string validation for user supplied values
+   * core: add vars param to switch_ivr_originate for recursion (MODAPP-175)
+   * core: added a "group" concept to the user directory
+   * core: added ability to do dns lookup to find ip with host: like stun: (FSCORE-219)
+   * core: added better locking for codec changes during a call
+   * core: added current_application and current_application_data variables
+   * core: added error/ magic endpoint so modules can return error causes in situations like sofia_contact
+   * core: added read_result channel variable
+   * core: added support for "F" to indicate flash in dtmf (FSCORE-213)
+   * core: allow calls to be stolen from originate
+   * core: allow you to get the privacy bits in the caller_profile
+   * core: change dso code to load symbols local
+   * core: changes core flags to be array based so we have more
+   * core: eavesdrop causes the people being eavesdropped on to not hear ach other (MODAPP-140)
+   * core: expose time table to variable interface via caller field lookup 
+   * core: fix 100% cpu when sending parked call to moh (FSCORE-234)
+   * core: fix bridge app to make sure both channels are ready for media when one is only in ringing state
+   * core: fix buffer overflow (FSCORE-188)
+   * core: fix conference dial by allowing multiple braces in originate, fix bad pointer op (FSCORE-208)
+   * core: fix double detection of DTMF in IVR (FSCORE-221)
+   * core: fix hangup_after_bridge is false on a bridge started with the intercept app
+   * core: fix issue where pid file is accidentally truncated
+   * core: fix ivr timeout (FSCORE-181)
+   * core: fix memory leak in alias tab completion code
+   * core: fix min digits in read app
+   * core: fix out-of-bounds pointer in variable expansion (FSCORE-171)
+   * core: fix segfault in media bugs when in bypass media (FSCORE-193)
+   * core: fix segfault on gtalk to sip calls (FSCORE-212)
+   * core: fix segfault on reloadxml (FSCORE-176)
+   * core: fix segfault on trasfering eavesdopping party (FSCORE-210)
+   * core: fix segfault using switch_system function (FSCORE-196)
+   * core: fix session.bridge
+   * core: fix setting effective_caller_id_name / effective_caller_id_number on bridge dialstring (MODAPP-122)
+   * core: fix stream_raw_write (MODAPP-145)
+   * core: fix using resampling on ringback file
+   * core: fixed performance bottleneck in sqlite db's
+   * core: fixed race in reloadxml
+   * core: increment app before execute in case it returns to execute it will go to the next item in the list and not the same
+   * core: ivr menu max_failures and max_timeouts now default to 3 if not specified or invalid (less than 1) values are specified (FSCORE-244)
+   * core: ivr_menu max-timeouts option, result in ivr_menu_status var (FSCORE-183)
+   * core: let b legs use park_after_bridge too
+   * core: make events less verbose unless verbose_events is set
+   * core: parse private events during originate
+   * core: pass pdd data to a leg on oubound calls using bridge
+   * core: prevent crash in crazy situation with xml interface lookup failures (FSCORE-169)
+   * core: reduce cpu requirement for generated comfort noise
+   * core: remove interface names from core db on unload
+   * core: reworked timing resulting in significant performance increase and better rtp timing
+   * core: rewrite switch_play_and_get_digits (MODAPP-166)
+   * core: session.recordFile never terminates (MODLANG-79)
+   * core: session.transfer make dialplan and context optional
+   * core: set_user app now sets domain vars as well as user vars
+   * core: tone_detect not triggering app after tone detection (MODAPP-182)
+   * core: unprivileged user setting bigger stack for switch_system thread failure (FSCORE-197)
+   * core: user_exists returns false when fetching a user from XML Curl or other xml interfaces
+   * libesl: added c event socket library and fs_cli
+   * libsndfile: fix autoconf 2.62 support (LBSNDF-5)
+   * mod commands: add "all" modifier to "break" command
+   * mod_celt: added new module
+   * mod_commands: Add support for more than 2 variables to uuid_setvar_multi (MODAPP-171)
+   * mod_commands: Add support for passing the cause of hangup to the uuid_kill command (FSCORE-217)
+   * mod_commands: add attr lookup to user_data
+   * mod_commands: add domain_exists fsapi command
+   * mod_commands: add eval fsapi command
+   * mod_commands: add flush_dtmf app and uuid_flush_dtmf api command
+   * mod_commands: add fsctl send_sighup, fsctl shutdown asap, unsched_api commands
+   * mod_commands: add fsctl shutdown [elegant|restart|cancel]
+   * mod_commands: add new syntax to uuid_setvar to allow you to unset a var. <uuid> <var> [value]   (MODAPP-167)
+   * mod_commands: add reload fsapi command to reload a module
+   * mod_commands: add system fsapi and application (MODAPP-138)
+   * mod_commands: added hupall fsapi command
+   * mod_commands: added strftime_tz api command
+   * mod_commands: break all now stops broadcast too
+   * mod_commands: fix api command sent through sched_api was getting the last char lopped off
+   * mod_commands: fix race on transfer with -both
+   * mod_commands: fix system dialplan app problems (MODAPP-86)
+   * mod_commands: only send content-type on status when it really is http.
+   * mod_conference: add fsapi to stop async playback too
+   * mod_conference: add video caps to mod_conference with video follow audio
+   * mod_conference: better sound prefix handling when using say: and allow say: on kick sounds.
+   * mod_conference: fix race in record
+   * mod_conference: fix runaway thread when floor holder has no video and other people do have video
+   * mod_conference: fix seg when kicking many members quickly (MODAPP-129)
+   * mod_conference: fix segfault on invalid chat event
+   * mod_conference: perpetual sound does not auto-mute, you can do that yourself if you want it 
+   * mod_dialplan_xml: add Hunt- vars in dialplan lookup after transfer
+   * mod_dialplan_xml: fail call on extensions with nested conditions
+   * mod_dingaling: (LBDING-7) fix segfault on os x
+   * mod_dingaling: end call on ice timeout
+   * mod_dingaling: fix presence on jabber to be less protocol ambiguous
+   * mod_dingaling: fix segfault (LBDING-10)
+   * mod_dingaling: update to support latest client from google
+   * mod_dptools: add a mechanism to tell if a file played from sendmsg over event socket
+   * mod_dptools: add playback_terminator support to phrase and say app
+   * mod_dptools: add playback_terminator_used variable (MODAPP-132)
+   * mod_dptools: add presence application
+   * mod_dptools: fix originate api not parsing users properly (FSCORE-246)
+   * mod_dptools: fix record and record_session to create directory if it does not exist (FSCORE-250)
+   * mod_dptools: fixed limit and + parsing bug in record_session app (MODAPP-148)
+   * mod_dptools: remove_bugs added to remove all media bugs on a session
+   * mod_erlang_event: add new module
+   * mod_event_socket:  missing : after Content-Length in event socket (MODEVENT-33)
+   * mod_event_socket: add event socket listener filters
+   * mod_event_socket: add stateful listener fsapi commands for ajax-y type event interface over http
+   * mod_event_socket: fix arg parsing errors (MODEVENT-34)
+   * mod_event_socket: fix shutdown segfault race (MODEVENT-32)
+   * mod_event_socket: inbound connection to event_socket can now take over an existing channel with 'myevents <uuid>' to take on the behaviour of an outbound socket
+   * mod_event_socket: let any channel get messages
+   * mod_event_socket: make event socket wait for hangup on outbound mode and send disconnect message
+   * mod_expr: fix endless loop
+   * mod_fax: new module
+   * mod_fifo: add fifo_consumer_wrapup_time var (MODAPP-117)
+   * mod_fifo: added callback agents
+   * mod_fifo: honor keyword silence (MODAPP-118)
+   * mod_flite: added windows build
+   * mod_fsv: fix in a windows enviroment opening the record file in text mode. (MODAPP-169)
+   * mod_http: added new module
+   * mod_java: updated to new module api to support read/write locks on interface
+   * mod_limit: accept dialplan context for transfer (MODAPP-161)
+   * mod_limit: added hashtable based limit functions
+   * mod_limit: prevent empty error log message (MODAPP-134)
+   * mod_local_stream: add start_local_stream and stop_local_stream fsapi commands to start/stop dynamically (MODFORM-13)
+   * mod_local_stream: fix leak and improve error checking
+   * mod_local_stream: fix seg when no timer name specified in config file. (MODFORM-16)
+   * mod_loopback: add new module
+   * mod_lua: add local scripts directory support (MODLANG-86)
+   * mod_lua: don't eval blank string
+   * mod_lua: fix originate
+   * mod_lua: fix segfault (MODLANG-77)
+   * mod_lua: update to lua 5.1.4 (MODLANG-87)
+   * mod_lumenvox: removed
+   * mod_managed: new module replaces mod_mono now supports native .net runtime on windows as well
+   * mod_opal: added to trunk (still very beta)
+   * mod_perl: fix segfault (MODLANG-77)
+   * mod_pocketsphinx: fix rpm build
+   * mod_portaudio: fix cpu race on inbound call to pa when no ring file is set
+   * mod_radius_cdr: dictionary update for cause code changes (MODEVENT-27)
+   * mod_radius_cdr: fix unload (MODEVENT-29)
+   * mod_shout: add stereo recording broadcast support
+   * mod_shout: added windows build
+   * mod_shout: fix segfault when recording mp3's (MODFORM-12)
+   * mod_shout: improved stability of mp3 decoding
+   * mod_siren: added new module
+   * mod_sndfile added support to record 16bit for the various rates including 48kHz
+   * mod_sofia: Add filter to "sofia status profile XXX" (MODENDP-138)
+   * mod_sofia: Add force-register-db-domain which works in conjunction with force-register-domain. 
+   * mod_sofia: Add optional <variables> and <params> tag to <gateway> tag.
+   * mod_sofia: Challenge the right realm when to_host is outside the users domain. (MODENDP-136)
+   * mod_sofia: Improve notify messages through a proxy (MODENDP-147)
+   * mod_sofia: MWI for multiple domains (MODAPP-126)
+   * mod_sofia: Move "a=sendrecv" from session to media section of SDP (MODENDP-148)
+   * mod_sofia: add 200 OK re-invite without sdp
+   * mod_sofia: add custom sofia::gateway_state event (MODENDP-112)
+   * mod_sofia: add fire events for the refer SIP NOTIFY event package (MODENDP-152)
+   * mod_sofia: add more params for xml_curl directory lookup
+   * mod_sofia: add new auto vals for challenge-realm param <param name="challenge-realm" value="auto_from|auto_to|<hardcoded_val>"/>
+   * mod_sofia: add option to turn of auto_restart of sofia profiles on ip change
+   * mod_sofia: add params to use sip callid as uuid on inbound calls and uuid as sip callid on outbound calls
+   * mod_sofia: add parsing of Privacy header for privacy info (MODENDP-133)
+   * mod_sofia: add proto_specific_hangup_cause to both legs
+   * mod_sofia: add proxy 3pcc mode
+   * mod_sofia: add redirect variable to channel as well as partner channe (MODENDP-135)
+   * mod_sofia: add sip-forbid-register to user params to refuse to let a certian user register
+   * mod_sofia: add sip: into register-proxy when it's not specified
+   * mod_sofia: add sip_history_info var for inbound invites.
+   * mod_sofia: add sip_via_protocol variable
+   * mod_sofia: add sofia xmlstatus (MODENDP-156)
+   * mod_sofia: add support for params other than Replaces in Refer-To (MODENDP-143)
+   * mod_sofia: add support for profiles sharing databases so that you can have a domain that uses multiple profiles for split dns type setups
+   * mod_sofia: add support for refer transfer involving multiple machines 
+   * mod_sofia: add support to send a notify in the invite dialog by specifying the uuid of the call. (SFSIP-92)
+   * mod_sofia: add suppress_from_cidname var to not have display name in from header (MODENDP-153)
+   * mod_sofia: added sip_hangup_disposition variable
+   * mod_sofia: allow send_message and notify events to send a message/notify without a body if needed.
+   * mod_sofia: append -1 .. -N postfix after any X-headers as vars that have the same name
+   * mod_sofia: cache auth_gateway_name in sofia for challenged bye
+   * mod_sofia: cancel proxy or no-media mode if you purposely answer or pre_answer
+   * mod_sofia: correct result code mapping for Unallocated Number (MODENDP-124)
+   * mod_sofia: disable 100rel by default
+   * mod_sofia: don't accept crypto in the RTP/AVP (MODENDP-126)
+   * mod_sofia: don't put CN in sdp answer if it was not in the offer.
+   * mod_sofia: fix Incorrect IP address shows up in SDP "o" field when multiple external IPs available and FS not bound to first (MODENDP-132)
+   * mod_sofia: fix Wrong RTP media port destination after reinvite/UNHOLD (SFSIP-82)
+   * mod_sofia: fix bug on linksys where they lie about the ptime and handle linksys transfer problem
+   * mod_sofia: fix chat (send an IM) assumes that the user's profile is the same as their domain, which isn't necessarily so (SFSIP-83)
+   * mod_sofia: fix dtmf handling of broken info dtmf endpoints
+   * mod_sofia: fix eyebeam presence to be RFC compliant (MODENDP-144)
+   * mod_sofia: fix ip change detection when in proxy mode
+   * mod_sofia: fix register_proxy ignoring the paramaters (MODENDP-121)
+   * mod_sofia: fix remote session refresh triggers request glare (MODENDP-131)
+   * mod_sofia: fix rtp auto adjust running when it should not
+   * mod_sofia: fix rtp sent to wrong port after some re-INVITE scenarios (MODENDP-141)
+   * mod_sofia: fix sending of cn packets across bridge when we shouldn't
+   * mod_sofia: fix sqlite issue with select of the sip contact
+   * mod_sofia: fixed segfault on invalid presence payload
+   * mod_sofia: gateway ping needs to look for 501 (SFSIP-78)
+   * mod_sofia: handle multi contact register responses and register timeout better
+   * mod_sofia: improve gateway resilience
+   * mod_sofia: log ip and port you get reply to invite from
+   * mod_sofia: make multiple-registations=true use the contact method and call-id option to do it the old way
+   * mod_sofia: make proxy mode pull the port from m=image as well
+   * mod_sofia: make register-proxy preserve the url composed from proxy but target the packets to desired address (MODENDP-121)
+   * mod_sofia: many fixes for sonus rtp issues silence_when_idle=400 chanvar to send generated silence duing sleeps etc
+   * mod_sofia: many fixes in presence handling
+   * mod_sofia: passthrough t.38 fixes
+   * mod_sofia: pick ipv4 or ipv6 based on sipip instead of having mixed in sdp
+   * mod_sofia: send NOTIFY on TCP/UDP depending on the SUBSCRIBE (SFSIP-104)
+   * mod_sofia: setting profile option multiple-registrations=contact key multi reg off the contact string
+   * mod_sofia: wait for a reply on refer
+   * mod_soundtouch: fixes and improvements, many options changed (MODAPP-149)
+   * mod_soundtouch: updated to new module api
+   * mod_spidermonkey: Segmentation fault in check_hangup_hook at mod_spidermonkey.c:1589 (MODLANG-74)
+   * mod_spidermonkey: fix bug in apiExecute
+   * mod_spidermonkey: fix memory pool handling and leaks
+   * mod_spidermonkey: limit recursion busting through the stack (FSCORE-202)
+   * mod_spidermonkey: make session.getVariable return blank string not the word false 
+   * mod_spidermonkey_curl: add optional content-type arg
+   * mod_spidermonkey_odbc: fix numRows and add numCols
+   * mod_spidermonkey_odbc: fix segfault (MODLANG-75)
+   * mod_stress: new module for voice stress analysis
+   * mod_syslog: don't log blank lines (FSCORE-163)
+   * mod_tone_stream: let silence_stream://0 indicate perpetual silence
+   * mod_vmd: add new module to detect voicemail "beep"
+   * mod_voicemail: Add vm_alternate_greet_id param to directory entry (MODAPP-174)
+   * mod_voicemail: Patch to add voicemail preference controlling date announcement new param 'play-date-announcement' to values 'first' 'last' or 'never'  defaults to first to retain previous behavior (MODAPP-121)
+   * mod_voicemail: Update mwi light after delete vm via web. (MODAPP-124)
+   * mod_voicemail: add ability to get to options without listening to every saved message (MODAPP-115)
+   * mod_voicemail: add ability to skip greeting when leaving a voicemail. (MODAPP-181)
+   * mod_voicemail: add change-pass-key config file option
+   * mod_voicemail: add forwarding support
+   * mod_voicemail: add local dtmf driven alternat vm pass
+   * mod_voicemail: add proper notification of a vm message being too short
+   * mod_voicemail: add support for auth via a1-hash
+   * mod_voicemail: add the "storage-dir" parameter to be set on a per-user basis (MODAPP-133)
+   * mod_voicemail: add voicemail_greeting_path variable
+   * mod_voicemail: added voicemail_alternate_greet_id variable
+   * mod_voicemail: allow changing of password from voicemail to update user directory if using non-static config (MODAPP-156)
+   * mod_voicemail: created email date (int overflow)  (MODAPP-125)
+   * mod_voicemail: don't try to deliver vm when no file was recorded. (MODAPP-133)
+   * mod_voicemail: fix MWI with xml_curl used for directory (MODAPP-176)
+   * mod_voicemail: fix Voicemail messages occasionally lost / stranded (MODAPP-178)
+   * mod_voicemail: fix invalid event after message deleted (MODAPP-170)
+   * mod_voicemail: fix mwi for phones with multiple registrations problem (MODAPP-153)
+   * mod_voicemail: fix voicemail segfault on incorrect password (FSCORE-187)
+   * mod_voicemail: fix voicemail_inject error handling (MODAPP-133)
+   * mod_voicemail: fix voicemail_inject usage api call
+   * mod_voicemail: improve error checking (MODAPP-142)
+   * mod_voicemail: localize notification emails (MODAPP-139)
+   * mod_voicemail: make more multi-domain friendly (MODAPP-162)
+   * mod_voicemail: make playback created file macros optional (MODAPP-150)
+   * mod_voicemail: recognize operator key in more places (MODAPP-159)
+   * mod_voicemail: web interface displays incorrect created / last heard dates (MODAPP-123)
+   * mod_wanpipe: removed
+   * mod_xml_cdr: add https support
+   * mod_xml_cdr: add optional a-leg prefix to xml cdr filenames (MDXMLINT-39)
+   * mod_xml_cdr: add support for fallback webserver for cdr posting (FSCORE-238)
+   * mod_xml_curl: Allow specification of HTTP method, and dynamic expansion of variables in URI. (MDXMLINT-41)
+   * mod_xml_curl: added redirect following (max 10)
+   * mod_xml_ldap: almost a complete rewrite of this module
+   * mod_xml_rpc: allow setting of global realm without a global user (MDXMLINT-45)
+   * mod_xml_rpc: fix multiple segfaults
+   * mod_xml_rpc: fix segfault on originate via http
+   * sofia-sip: updated to 1.12.10 (plus a few patches)
+
+ -- Mike Jerris <mike at jerris.com>  Mon, 29 Dec 2008 14:46:00 -0500
+
 freeswitch (1.0.1-1) unstable; urgency=low
 
    * FIX: prevent intercept race condition that can also be solved with continue_on_fail=originator_cancel
@@ -295,7 +588,7 @@
      Fixed mod_iax race conditions
      Fixed ptime negotiation issues when re-packetizing
      Added ip based acl lists
-	
+   * 
  -- Michael Jerris <mike at jerris.com>  Wed, 9 Apr 2008 12:58:22 -0400
     
 freeswitch (1.0~rc1-1) unstable; urgency=low

Modified: freeswitch/branches/gmaruzz/debian/freeswitch.install
==============================================================================
--- freeswitch/branches/gmaruzz/debian/freeswitch.install	(original)
+++ freeswitch/branches/gmaruzz/debian/freeswitch.install	Wed Jan  7 10:17:00 2009
@@ -1,5 +1,6 @@
 opt/freeswitch/htdocs/*
 opt/freeswitch/bin/freeswitch
+opt/freeswitch/bin/fs_cli
 opt/freeswitch/bin/scripts/*
 opt/freeswitch/lib/libfreeswitch*.so*
 opt/freeswitch/lib/libopenzap*.so*

Modified: freeswitch/branches/gmaruzz/docs/ChangeLog
==============================================================================
--- freeswitch/branches/gmaruzz/docs/ChangeLog	(original)
+++ freeswitch/branches/gmaruzz/docs/ChangeLog	Wed Jan  7 10:17:00 2009
@@ -1,3 +1,294 @@
+freeswitch (1.0.2)
+
+	all: don't add module interfaces before returning from error conditions in module load functions (MDXMLINT-36)
+	all: fixed multiple memory leaks
+	all: improved module unloading/reloading support
+	build: add support for --switchconfdir (FSBUILD-84)
+	build: fixed netbsd build
+	build: make freeswitch stop graceflly with /etc/init.d/freeswitch stop on debian add working dir to start-stop-dir so freeswitch dumps core in workdir
+	build: multiple packaging fixes
+	build: user freeswitch not added to audio group on deb install (FSBUILD-95)
+	Configuration: many updates to default configuration
+	core: Add ability to choose uuid from originate string, originate_uuid var (use at your own risk) 
+	core: add bridge_generate_comfort_noise option for bridge to generate comfort noise to the A leg when there is no audio on the B leg
+	core: add chan vars to param event during hangup hook
+	core: add exec directive to xml preprocessor (not available on windows)
+	core: add force_transfer_dialplan and force_transfer_context variables
+	core: add hashing to event header lookup 
+	core: add hits to tone_detect
+	core: add last_dtmf_duration variable
+	core: add msleep function to swigged languages
+	core: add park_after_bridge variable
+	core: add per leg timeouts and specific cause codes in reject_on_single_fail
+	core: add runtime selection of the module dir (FSCORE-198)
+	core: add scheduler support for heartbeat
+	core: add session heartbeat feature
+	core: add session.destroy psuedo method to sort of destroy a session at least for the sake of FS
+	core: add session.unsetInputCallback
+	core: add strftime format string validation for user supplied values
+	core: add vars param to switch_ivr_originate for recursion (MODAPP-175)
+	core: added a "group" concept to the user directory
+	core: added ability to do dns lookup to find ip with host: like stun: (FSCORE-219)
+	core: added better locking for codec changes during a call
+	core: added current_application and current_application_data variables
+	core: added error/ magic endpoint so modules can return error causes in situations like sofia_contact
+	core: added read_result channel variable
+	core: added support for "F" to indicate flash in dtmf (FSCORE-213)
+	core: allow calls to be stolen from originate
+	core: allow you to get the privacy bits in the caller_profile
+	core: change dso code to load symbols local
+	core: changes core flags to be array based so we have more
+	core: eavesdrop causes the people being eavesdropped on to not hear ach other (MODAPP-140)
+	core: expose time table to variable interface via caller field lookup 
+	core: fix 100% cpu when sending parked call to moh (FSCORE-234)
+	core: fix bridge app to make sure both channels are ready for media when one is only in ringing state
+	core: fix buffer overflow (FSCORE-188)
+	core: fix conference dial by allowing multiple braces in originate, fix bad pointer op (FSCORE-208)
+	core: fix double detection of DTMF in IVR (FSCORE-221)
+	core: fix hangup_after_bridge is false on a bridge started with the intercept app
+	core: fix issue where pid file is accidentally truncated
+	core: fix ivr timeout (FSCORE-181)
+	core: fix memory leak in alias tab completion code
+	core: fix min digits in read app
+	core: fix out-of-bounds pointer in variable expansion (FSCORE-171)
+	core: fix segfault in media bugs when in bypass media (FSCORE-193)
+	core: fix segfault on gtalk to sip calls (FSCORE-212)
+	core: fix segfault on reloadxml (FSCORE-176)
+	core: fix segfault on trasfering eavesdopping party (FSCORE-210)
+	core: fix segfault using switch_system function (FSCORE-196)
+	core: fix session.bridge
+	core: fix setting effective_caller_id_name / effective_caller_id_number on bridge dialstring (MODAPP-122)
+	core: fix stream_raw_write (MODAPP-145)
+	core: fix using resampling on ringback file
+	core: fixed performance bottleneck in sqlite db's
+	core: fixed race in reloadxml
+	core: increment app before execute in case it returns to execute it will go to the next item in the list and not the same
+	core: ivr menu max_failures and max_timeouts now default to 3 if not specified or invalid (less than 1) values are specified (FSCORE-244)
+	core: ivr_menu max-timeouts option, result in ivr_menu_status var (FSCORE-183)
+	core: let b legs use park_after_bridge too
+	core: make events less verbose unless verbose_events is set
+	core: parse private events during originate
+	core: pass pdd data to a leg on oubound calls using bridge
+	core: prevent crash in crazy situation with xml interface lookup failures (FSCORE-169)
+	core: reduce cpu requirement for generated comfort noise
+	core: remove interface names from core db on unload
+	core: reworked timing resulting in significant performance increase and better rtp timing
+	core: rewrite switch_play_and_get_digits (MODAPP-166)
+	core: session.recordFile never terminates (MODLANG-79)
+	core: session.transfer make dialplan and context optional
+	core: set_user app now sets domain vars as well as user vars
+	core: tone_detect not triggering app after tone detection (MODAPP-182)
+	core: unprivileged user setting bigger stack for switch_system thread failure (FSCORE-197)
+	core: user_exists returns false when fetching a user from XML Curl or other xml interfaces
+	libesl: added c event socket library and fs_cli
+	libsndfile: fix autoconf 2.62 support (LBSNDF-5)
+	mod commands: add "all" modifier to "break" command
+	mod_celt: added new module
+	mod_commands: Add support for more than 2 variables to uuid_setvar_multi (MODAPP-171)
+	mod_commands: Add support for passing the cause of hangup to the uuid_kill command (FSCORE-217)
+	mod_commands: add attr lookup to user_data
+	mod_commands: add domain_exists fsapi command
+	mod_commands: add eval fsapi command
+	mod_commands: add flush_dtmf app and uuid_flush_dtmf api command
+	mod_commands: add fsctl send_sighup, fsctl shutdown asap, unsched_api commands
+	mod_commands: add fsctl shutdown [elegant|restart|cancel]
+	mod_commands: add new syntax to uuid_setvar to allow you to unset a var. <uuid> <var> [value]   (MODAPP-167)
+	mod_commands: add reload fsapi command to reload a module
+	mod_commands: add system fsapi and application (MODAPP-138)
+	mod_commands: added hupall fsapi command
+	mod_commands: added strftime_tz api command
+	mod_commands: break all now stops broadcast too
+	mod_commands: fix api command sent through sched_api was getting the last char lopped off
+	mod_commands: fix race on transfer with -both
+	mod_commands: fix system dialplan app problems (MODAPP-86)
+	mod_commands: only send content-type on status when it really is http.
+	mod_conference: add fsapi to stop async playback too
+	mod_conference: add video caps to mod_conference with video follow audio
+	mod_conference: better sound prefix handling when using say: and allow say: on kick sounds.
+	mod_conference: fix race in record
+	mod_conference: fix runaway thread when floor holder has no video and other people do have video
+	mod_conference: fix seg when kicking many members quickly (MODAPP-129)
+	mod_conference: fix segfault on invalid chat event
+	mod_conference: perpetual sound does not auto-mute, you can do that yourself if you want it 
+	mod_dialplan_xml: add Hunt- vars in dialplan lookup after transfer
+	mod_dialplan_xml: fail call on extensions with nested conditions
+	mod_dingaling: (LBDING-7) fix segfault on os x
+	mod_dingaling: end call on ice timeout
+	mod_dingaling: fix presence on jabber to be less protocol ambiguous
+	mod_dingaling: fix segfault (LBDING-10)
+	mod_dingaling: update to support latest client from google
+	mod_dptools: add a mechanism to tell if a file played from sendmsg over event socket
+	mod_dptools: add playback_terminator support to phrase and say app
+	mod_dptools: add playback_terminator_used variable (MODAPP-132)
+	mod_dptools: add presence application
+	mod_dptools: fix originate api not parsing users properly (FSCORE-246)
+	mod_dptools: fix record and record_session to create directory if it does not exist (FSCORE-250)
+	mod_dptools: fixed limit and + parsing bug in record_session app (MODAPP-148)
+	mod_dptools: remove_bugs added to remove all media bugs on a session
+	mod_erlang_event: add new module
+	mod_event_socket:  missing : after Content-Length in event socket (MODEVENT-33)
+	mod_event_socket: add event socket listener filters
+	mod_event_socket: add stateful listener fsapi commands for ajax-y type event interface over http
+	mod_event_socket: fix arg parsing errors (MODEVENT-34)
+	mod_event_socket: fix shutdown segfault race (MODEVENT-32)
+	mod_event_socket: inbound connection to event_socket can now take over an existing channel with 'myevents <uuid>' to take on the behaviour of an outbound socket
+	mod_event_socket: let any channel get messages
+	mod_event_socket: make event socket wait for hangup on outbound mode and send disconnect message
+	mod_expr: fix endless loop
+	mod_fax: new module
+	mod_fifo: add fifo_consumer_wrapup_time var (MODAPP-117)
+	mod_fifo: added callback agents
+	mod_fifo: honor keyword silence (MODAPP-118)
+	mod_flite: added windows build
+	mod_fsv: fix in a windows enviroment opening the record file in text mode. (MODAPP-169)
+	mod_http: added new module
+	mod_java: updated to new module api to support read/write locks on interface
+	mod_limit: accept dialplan context for transfer (MODAPP-161)
+	mod_limit: added hashtable based limit functions
+	mod_limit: prevent empty error log message (MODAPP-134)
+	mod_local_stream: add start_local_stream and stop_local_stream fsapi commands to start/stop dynamically (MODFORM-13)
+	mod_local_stream: fix leak and improve error checking
+	mod_local_stream: fix seg when no timer name specified in config file. (MODFORM-16)
+	mod_loopback: add new module
+	mod_lua: add local scripts directory support (MODLANG-86)
+	mod_lua: don't eval blank string
+	mod_lua: fix originate
+	mod_lua: fix segfault (MODLANG-77)
+	mod_lua: update to lua 5.1.4 (MODLANG-87)
+	mod_lumenvox: removed
+	mod_managed: new module replaces mod_mono now supports native .net runtime on windows as well
+	mod_opal: added to trunk (still very beta)
+	mod_perl: fix segfault (MODLANG-77)
+	mod_pocketsphinx: fix rpm build
+	mod_portaudio: fix cpu race on inbound call to pa when no ring file is set
+	mod_radius_cdr: dictionary update for cause code changes (MODEVENT-27)
+	mod_radius_cdr: fix unload (MODEVENT-29)
+	mod_shout: add stereo recording broadcast support
+	mod_shout: added windows build
+	mod_shout: fix segfault when recording mp3's (MODFORM-12)
+	mod_shout: improved stability of mp3 decoding
+	mod_siren: added new module
+	mod_sndfile added support to record 16bit for the various rates including 48kHz
+	mod_sofia: Add filter to "sofia status profile XXX" (MODENDP-138)
+	mod_sofia: Add force-register-db-domain which works in conjunction with force-register-domain. 
+	mod_sofia: Add optional <variables> and <params> tag to <gateway> tag.
+	mod_sofia: Challenge the right realm when to_host is outside the users domain. (MODENDP-136)
+	mod_sofia: Improve notify messages through a proxy (MODENDP-147)
+	mod_sofia: MWI for multiple domains (MODAPP-126)
+	mod_sofia: Move "a=sendrecv" from session to media section of SDP (MODENDP-148)
+	mod_sofia: add 200 OK re-invite without sdp
+	mod_sofia: add custom sofia::gateway_state event (MODENDP-112)
+	mod_sofia: add fire events for the refer SIP NOTIFY event package (MODENDP-152)
+	mod_sofia: add more params for xml_curl directory lookup
+	mod_sofia: add new auto vals for challenge-realm param <param name="challenge-realm" value="auto_from|auto_to|<hardcoded_val>"/>
+	mod_sofia: add option to turn of auto_restart of sofia profiles on ip change
+	mod_sofia: add params to use sip callid as uuid on inbound calls and uuid as sip callid on outbound calls
+	mod_sofia: add parsing of Privacy header for privacy info (MODENDP-133)
+	mod_sofia: add proto_specific_hangup_cause to both legs
+	mod_sofia: add proxy 3pcc mode
+	mod_sofia: add redirect variable to channel as well as partner channe (MODENDP-135)
+	mod_sofia: add sip-forbid-register to user params to refuse to let a certian user register
+	mod_sofia: add sip: into register-proxy when it's not specified
+	mod_sofia: add sip_history_info var for inbound invites.
+	mod_sofia: add sip_via_protocol variable
+	mod_sofia: add sofia xmlstatus (MODENDP-156)
+	mod_sofia: add support for params other than Replaces in Refer-To (MODENDP-143)
+	mod_sofia: add support for profiles sharing databases so that you can have a domain that uses multiple profiles for split dns type setups
+	mod_sofia: add support for refer transfer involving multiple machines 
+	mod_sofia: add support to send a notify in the invite dialog by specifying the uuid of the call. (SFSIP-92)
+	mod_sofia: add suppress_from_cidname var to not have display name in from header (MODENDP-153)
+	mod_sofia: added sip_hangup_disposition variable
+	mod_sofia: allow send_message and notify events to send a message/notify without a body if needed.
+	mod_sofia: append -1 .. -N postfix after any X-headers as vars that have the same name
+	mod_sofia: cache auth_gateway_name in sofia for challenged bye
+	mod_sofia: cancel proxy or no-media mode if you purposely answer or pre_answer
+	mod_sofia: correct result code mapping for Unallocated Number (MODENDP-124)
+	mod_sofia: disable 100rel by default
+	mod_sofia: don't accept crypto in the RTP/AVP (MODENDP-126)
+	mod_sofia: don't put CN in sdp answer if it was not in the offer.
+	mod_sofia: fix Incorrect IP address shows up in SDP "o" field when multiple external IPs available and FS not bound to first (MODENDP-132)
+	mod_sofia: fix Wrong RTP media port destination after reinvite/UNHOLD (SFSIP-82)
+	mod_sofia: fix bug on linksys where they lie about the ptime and handle linksys transfer problem
+	mod_sofia: fix chat (send an IM) assumes that the user's profile is the same as their domain, which isn't necessarily so (SFSIP-83)
+	mod_sofia: fix dtmf handling of broken info dtmf endpoints
+	mod_sofia: fix eyebeam presence to be RFC compliant (MODENDP-144)
+	mod_sofia: fix ip change detection when in proxy mode
+	mod_sofia: fix register_proxy ignoring the paramaters (MODENDP-121)
+	mod_sofia: fix remote session refresh triggers request glare (MODENDP-131)
+	mod_sofia: fix rtp auto adjust running when it should not
+	mod_sofia: fix rtp sent to wrong port after some re-INVITE scenarios (MODENDP-141)
+	mod_sofia: fix sending of cn packets across bridge when we shouldn't
+	mod_sofia: fix sqlite issue with select of the sip contact
+	mod_sofia: fixed segfault on invalid presence payload
+	mod_sofia: gateway ping needs to look for 501 (SFSIP-78)
+	mod_sofia: handle multi contact register responses and register timeout better
+	mod_sofia: improve gateway resilience
+	mod_sofia: log ip and port you get reply to invite from
+	mod_sofia: make multiple-registations=true use the contact method and call-id option to do it the old way
+	mod_sofia: make proxy mode pull the port from m=image as well
+	mod_sofia: make register-proxy preserve the url composed from proxy but target the packets to desired address (MODENDP-121)
+	mod_sofia: many fixes for sonus rtp issues silence_when_idle=400 chanvar to send generated silence duing sleeps etc
+	mod_sofia: many fixes in presence handling
+	mod_sofia: passthrough t.38 fixes
+	mod_sofia: pick ipv4 or ipv6 based on sipip instead of having mixed in sdp
+	mod_sofia: send NOTIFY on TCP/UDP depending on the SUBSCRIBE (SFSIP-104)
+	mod_sofia: setting profile option multiple-registrations=contact key multi reg off the contact string
+	mod_sofia: wait for a reply on refer
+	mod_soundtouch: fixes and improvements, many options changed (MODAPP-149)
+	mod_soundtouch: updated to new module api
+	mod_spidermonkey: Segmentation fault in check_hangup_hook at mod_spidermonkey.c:1589 (MODLANG-74)
+	mod_spidermonkey: fix bug in apiExecute
+	mod_spidermonkey: fix memory pool handling and leaks
+	mod_spidermonkey: limit recursion busting through the stack (FSCORE-202)
+	mod_spidermonkey: make session.getVariable return blank string not the word false 
+	mod_spidermonkey_curl: add optional content-type arg
+	mod_spidermonkey_odbc: fix numRows and add numCols
+	mod_spidermonkey_odbc: fix segfault (MODLANG-75)
+	mod_stress: new module for voice stress analysis
+	mod_syslog: don't log blank lines (FSCORE-163)
+	mod_tone_stream: let silence_stream://0 indicate perpetual silence
+	mod_vmd: add new module to detect voicemail "beep"
+	mod_voicemail: Add vm_alternate_greet_id param to directory entry (MODAPP-174)
+	mod_voicemail: Patch to add voicemail preference controlling date announcement new param 'play-date-announcement' to values 'first' 'last' or 'never'  defaults to first to retain previous behavior (MODAPP-121)
+	mod_voicemail: Update mwi light after delete vm via web. (MODAPP-124)
+	mod_voicemail: add ability to get to options without listening to every saved message (MODAPP-115)
+	mod_voicemail: add ability to skip greeting when leaving a voicemail. (MODAPP-181)
+	mod_voicemail: add change-pass-key config file option
+	mod_voicemail: add forwarding support
+	mod_voicemail: add local dtmf driven alternat vm pass
+	mod_voicemail: add proper notification of a vm message being too short
+	mod_voicemail: add support for auth via a1-hash
+	mod_voicemail: add the "storage-dir" parameter to be set on a per-user basis (MODAPP-133)
+	mod_voicemail: add voicemail_greeting_path variable
+	mod_voicemail: added voicemail_alternate_greet_id variable
+	mod_voicemail: allow changing of password from voicemail to update user directory if using non-static config (MODAPP-156)
+	mod_voicemail: created email date (int overflow)  (MODAPP-125)
+	mod_voicemail: don't try to deliver vm when no file was recorded. (MODAPP-133)
+	mod_voicemail: fix MWI with xml_curl used for directory (MODAPP-176)
+	mod_voicemail: fix Voicemail messages occasionally lost / stranded (MODAPP-178)
+	mod_voicemail: fix invalid event after message deleted (MODAPP-170)
+	mod_voicemail: fix mwi for phones with multiple registrations problem (MODAPP-153)
+	mod_voicemail: fix voicemail segfault on incorrect password (FSCORE-187)
+	mod_voicemail: fix voicemail_inject error handling (MODAPP-133)
+	mod_voicemail: fix voicemail_inject usage api call
+	mod_voicemail: improve error checking (MODAPP-142)
+	mod_voicemail: localize notification emails (MODAPP-139)
+	mod_voicemail: make more multi-domain friendly (MODAPP-162)
+	mod_voicemail: make playback created file macros optional (MODAPP-150)
+	mod_voicemail: recognize operator key in more places (MODAPP-159)
+	mod_voicemail: web interface displays incorrect created / last heard dates (MODAPP-123)
+	mod_wanpipe: removed
+	mod_xml_cdr: add https support
+	mod_xml_cdr: add optional a-leg prefix to xml cdr filenames (MDXMLINT-39)
+	mod_xml_cdr: add support for fallback webserver for cdr posting (FSCORE-238)
+	mod_xml_curl: Allow specification of HTTP method, and dynamic expansion of variables in URI. (MDXMLINT-41)
+	mod_xml_curl: added redirect following (max 10)
+	mod_xml_ldap: almost a complete rewrite of this module
+	mod_xml_rpc: allow setting of global realm without a global user (MDXMLINT-45)
+	mod_xml_rpc: fix multiple segfaults
+	mod_xml_rpc: fix segfault on originate via http
+	sofia-sip: updated to 1.12.10 (plus a few patches)
+
 freeswitch (1.0.1)
 
 	FIX: prevent intercept race condition that can also be solved with continue_on_fail=originator_cancel

Modified: freeswitch/branches/gmaruzz/docs/Doxygen.conf
==============================================================================
--- freeswitch/branches/gmaruzz/docs/Doxygen.conf	(original)
+++ freeswitch/branches/gmaruzz/docs/Doxygen.conf	Wed Jan  7 10:17:00 2009
@@ -4,7 +4,7 @@
 # Project related configuration options
 #---------------------------------------------------------------------------
 PROJECT_NAME           = FreeSWITCH
-PROJECT_NUMBER         = 1.0.1
+PROJECT_NUMBER         = 1.0.2
 OUTPUT_DIRECTORY       = .
 CREATE_SUBDIRS         = NO
 OUTPUT_LANGUAGE        = English

Modified: freeswitch/branches/gmaruzz/libs/esl/Makefile
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/Makefile	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/Makefile	Wed Jan  7 10:17:00 2009
@@ -1,11 +1,10 @@
-PWD=$(shell pwd)
-INCS=-I$(PWD)/src/include
+INCS=-Isrc/include
 LIBEDIT_DIR=../../libs/libedit
 DEBUG=-g -ggdb
 PICKY=-O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS=$(INCS) -D_GNU_SOURCE $(DEBUG) -I$(LIBEDIT_DIR)/src/ $(PICKY)
+CFLAGS=$(INCS) -DHAVE_EDITLINE $(DEBUG) -I$(LIBEDIT_DIR)/src/ $(PICKY)
 MYLIB=libesl.a
-LIBS=-lesl -lncurses -lpthread
+LIBS=-lncurses -lpthread -lesl
 LDFLAGS=-L.
 OBJS=src/esl.o src/esl_event.o src/esl_threadmutex.o src/esl_config.o
 SRC=src/esl.c src/esl_event.c src/esl_threadmutex.c src/esl_config.c

Modified: freeswitch/branches/gmaruzz/libs/esl/fs_cli.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/fs_cli.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/fs_cli.2008.vcproj	Wed Jan  7 10:17:00 2009
@@ -21,7 +21,6 @@
 			OutputDirectory="$(ConfigurationName)"
 			IntermediateDirectory="$(ConfigurationName)"
 			ConfigurationType="1"
-			InheritedPropertySheets="..\..\w32\winlibs.vsprops"
 			CharacterSet="2"
 			BuildLogFile="$(IntDir)\BuildLog $(ProjectName).htm"
 			>
@@ -43,8 +42,8 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(InputDir)\src\include&quot;"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				AdditionalIncludeDirectories="&quot;$(ProjectDir)getopt&quot;;&quot;$(ProjectDir)src/include&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
@@ -66,6 +65,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies="Ws2_32.lib"
 				OutputFile="$(SolutionDir)$(ConfigurationName)/fs_cli.exe"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="$(OutDir)"
@@ -103,7 +103,6 @@
 			OutputDirectory="$(ConfigurationName)"
 			IntermediateDirectory="$(ConfigurationName)"
 			ConfigurationType="1"
-			InheritedPropertySheets="..\..\w32\winlibs.vsprops"
 			CharacterSet="2"
 			BuildLogFile="$(IntDir)\BuildLog $(ProjectName).htm"
 			>
@@ -124,8 +123,8 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="&quot;$(InputDir)\src\include&quot;"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				AdditionalIncludeDirectories="&quot;$(ProjectDir)getopt&quot;;&quot;$(ProjectDir)src/include&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"
 				WarningLevel="4"
@@ -144,6 +143,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies="Ws2_32.lib"
 				OutputFile="$(SolutionDir)$(ConfigurationName)/fs_cli.exe"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="$(OutDir)"
@@ -191,6 +191,10 @@
 				RelativePath="fs_cli.c"
 				>
 			</File>
+			<File
+				RelativePath=".\getopt\getopt_long.c"
+				>
+			</File>
 		</Filter>
 		<Filter
 			Name="Header Files"
@@ -198,51 +202,7 @@
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
 			>
 			<File
-				RelativePath="..\..\src\include\switch.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_buffer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_caller.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_channel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_config.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_console.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_core.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_frame.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_loadable_module.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_module_interfaces.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_types.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\include\switch_utils.h"
+				RelativePath=".\getopt\getopt.h"
 				>
 			</File>
 		</Filter>

Modified: freeswitch/branches/gmaruzz/libs/esl/fs_cli.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/fs_cli.c	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/fs_cli.c	Wed Jan  7 10:17:00 2009
@@ -1,3 +1,7 @@
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <esl.h>
@@ -6,14 +10,45 @@
 #ifdef WIN32
 #define strdup(src) _strdup(src)
 #define usleep(time) Sleep(time/1000)
+#define fileno _fileno
+#define read _read
+#include <io.h>
 #else
 #include <sys/select.h>
+#include <unistd.h>
+#endif
+
+#include <getopt.h>
+
+#ifdef HAVE_EDITLINE
 #include <histedit.h>
-#define HAVE_EDITLINE
 #endif
 
 static char prompt_str[512] = "";
-static char hostname[512] = "";
+
+typedef struct {
+	char name[128];
+	char host[128];
+	esl_port_t port;
+	char pass[128];
+	int debug;
+	const char *console_fnkeys[12];
+	char loglevel[128];
+	int quiet;
+} cli_profile_t;
+
+static cli_profile_t profiles[128] = {{{0}}};
+static cli_profile_t internal_profile = {{ 0 }};
+static int pcount = 0;
+
+static esl_handle_t *global_handle;
+static cli_profile_t *global_profile;
+
+static int process_command(esl_handle_t *handle, const char *cmd);
+
+static int running = 1;
+static int thread_running = 0;
+
 
 #ifdef HAVE_EDITLINE
 static char *prompt(EditLine * e)
@@ -24,10 +59,86 @@
 static EditLine *el;
 static History *myhistory;
 static HistEvent ev;
-#endif
 
-static int running = 1;
-static int thread_running = 0;
+
+
+/*
+ * If a fnkey is configured then process the command
+ */
+static unsigned char console_fnkey_pressed(int i)
+{
+	const char *c;
+
+	assert((i > 0) && (i <= 12));
+
+	c = global_profile->console_fnkeys[i - 1];
+
+	/* This new line is necessary to avoid output to begin after the ">" of the CLI's prompt */
+	printf("%s\n", c);
+	printf("\n");
+	
+	if (c == NULL) {
+		esl_log(ESL_LOG_ERROR, "FUNCTION KEY F%d IS NOT BOUND, please edit your config.\n", i);
+		return CC_REDISPLAY;
+	}
+
+	if (process_command(global_handle, c)) {
+		running = thread_running = 0;
+	}
+
+	return CC_REDISPLAY;
+}
+
+static unsigned char console_f1key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(1);
+}
+static unsigned char console_f2key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(2);
+}
+static unsigned char console_f3key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(3);
+}
+static unsigned char console_f4key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(4);
+}
+static unsigned char console_f5key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(5);
+}
+static unsigned char console_f6key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(6);
+}
+static unsigned char console_f7key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(7);
+}
+static unsigned char console_f8key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(8);
+}
+static unsigned char console_f9key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(9);
+}
+static unsigned char console_f10key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(10);
+}
+static unsigned char console_f11key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(11);
+}
+static unsigned char console_f12key(EditLine * el, int ch)
+{
+	return console_fnkey_pressed(12);
+}
+
+#endif
 
 static void handle_SIGINT(int sig)
 {
@@ -35,9 +146,31 @@
 	return;
 }
 
-static const char* COLORS[] = { ESL_SEQ_DEFAULT_COLOR, ESL_SEQ_FRED, ESL_SEQ_FRED, 
-								ESL_SEQ_FRED, ESL_SEQ_FMAGEN, ESL_SEQ_FCYAN, ESL_SEQ_FGREEN, ESL_SEQ_FYELLOW };
 
+#ifdef WIN32
+static HANDLE hStdout;
+static WORD wOldColorAttrs;
+static CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
+
+static WORD 
+#else
+static const char*
+#endif
+COLORS[] = { ESL_SEQ_DEFAULT_COLOR, ESL_SEQ_FRED, ESL_SEQ_FRED, 
+			ESL_SEQ_FRED, ESL_SEQ_FMAGEN, ESL_SEQ_FCYAN, ESL_SEQ_FGREEN, ESL_SEQ_FYELLOW };
+
+static int usage(char *name){
+	printf("Usage: %s [-H <host>] [-P <port>] [-p <secret>] [-d <level>] [-x command] [profile]\n\n", name);
+	printf("  -?,-h --help                    Usage Information\n");
+	printf("  -H, --host=hostname             Host to connect\n");
+	printf("  -P, --port=port                 Port to connect (1 - 65535)\n");
+	printf("  -p, --password=FILENAME         Password\n");
+	printf("  -x, --execute=command           Execute Command and Exit\n");
+	printf("  -l, --loglevel=command          Log Level\n");
+	printf("  -q, --quiet			          Disable logging\n");
+	printf("  -d, --debug=level               Debug Level (0 - 7)\n\n");
+	return 1;
+}
 
 static void *msg_thread_run(esl_thread_t *me, void *obj)
 {
@@ -59,26 +192,37 @@
 
 				if (!esl_strlen_zero(type)) {
 					if (!strcasecmp(type, "log/data")) {
-						int level = 0, tchannel = 0;
+						int level = 0;
 						const char *lname = esl_event_get_header(handle->last_event, "log-level");
-						const char *channel = esl_event_get_header(handle->last_event, "text-channel");
-						const char *file = esl_event_get_header(handle->last_event, "log-file");
-					
-						if (channel) {
-							tchannel = atoi(channel);
-						}
-
+#ifdef WIN32
+						DWORD len = (DWORD) strlen(handle->last_event->body);
+						DWORD outbytes = 0;
+#endif			
 						if (lname) {
 							level = atoi(lname);
 						}
-
-						if (tchannel == 0 || (file && !strcmp(file, "switch_console.c"))) {
-							printf("%s%s%s", COLORS[level], handle->last_event->body, ESL_SEQ_DEFAULT_COLOR);
-						}
+						
+						
+#ifdef WIN32
+						
+						SetConsoleTextAttribute(hStdout, COLORS[level]);
+						WriteFile(hStdout, handle->last_event->body, len, &outbytes, NULL);
+						SetConsoleTextAttribute(hStdout, wOldColorAttrs);
+#else
+						printf("%s%s%s", COLORS[level], handle->last_event->body, ESL_SEQ_DEFAULT_COLOR);
+#endif
+							
 						known++;
 					} else if (!strcasecmp(type, "text/disconnect-notice")) {
 						running = thread_running = 0;
 						known++;
+					} else if (!strcasecmp(type, "text/event-plain")) {
+						char *foo;
+						esl_event_serialize(handle->last_ievent, &foo, ESL_FALSE);
+						printf("RECV EVENT\n%s\n", foo);
+						free(foo);
+
+						known++;
 					}
 				}
 				
@@ -99,48 +243,77 @@
 
 static int process_command(esl_handle_t *handle, const char *cmd) 
 {
-	if (
-		!strcasecmp(cmd, "exit") ||
-		!strcasecmp(cmd, "quit") ||
-		!strcasecmp(cmd, "bye")
-		) {
-		return -1;
-	}
+	if ((*cmd == '/' && cmd++) || !strncasecmp(cmd, "...", 3)) {
+		
+		if (!strcasecmp(cmd, "help")) {
+			printf(
+				   "Command                    \tDescription\n"
+				   "-----------------------------------------------\n"
+				   "/help                      \tHelp\n"
+				   "/exit, /quit, /bye, ...    \tExit the program.\n"
+				   "/event, /noevent, /nixevent\tEvent commands.\n"
+				   "/log, /nolog               \tLog commands.\n"
+				   "/filter                    \tFilter commands.\n"
+				   "\n"
+				   );
+
+			goto end;
+		}
+
+		if (
+			!strcasecmp(cmd, "exit") ||
+			!strcasecmp(cmd, "quit") ||
+			!strcasecmp(cmd, "...") ||
+			!strcasecmp(cmd, "bye")
+			) {
+			esl_log(ESL_LOG_INFO, "Goodbye!\nSee you at ClueCon http://www.cluecon.com/\n");
+			return -1;
+		}
+
+		if (
+			!strncasecmp(cmd, "event", 5) || 
+			!strncasecmp(cmd, "noevent", 7) ||
+			!strncasecmp(cmd, "nixevent", 8) ||
+			!strncasecmp(cmd, "log", 3) || 
+			!strncasecmp(cmd, "nolog", 5) || 
+			!strncasecmp(cmd, "filter", 6)
+			) {
 
-	if (
-		!strncasecmp(cmd, "event", 5) || 
-		!strncasecmp(cmd, "noevent", 7) ||
-		!strncasecmp(cmd, "nixevent", 8) ||
-		!strncasecmp(cmd, "log", 3) || 
-		!strncasecmp(cmd, "nolog", 5) || 
-		!strncasecmp(cmd, "filter", 6)
-		) {
+			esl_send_recv(handle, cmd);	
 
-		esl_send_recv(handle, cmd);			
-		printf("%s\n", handle->last_sr_reply);
+			printf("%s\n", handle->last_sr_reply);
 
-		goto end;
+			goto end;
+		}
+		
+		if (!strncasecmp(cmd, "debug", 5)){
+			int tmp_debug = atoi(cmd+6);
+			if (tmp_debug > -1 && tmp_debug < 8){
+				esl_global_set_default_logger(tmp_debug);
+				printf("fs_cli debug level set to %d\n", tmp_debug);
+			} else {
+				printf("fs_cli debug level must be 0 - 7\n");
+			}
+			goto end;
+		}
+	
+		printf("Unknown command [%s]\n", cmd);
+	} else {
+		char cmd_str[1024] = "";
+
+		snprintf(cmd_str, sizeof(cmd_str), "api %s\n\n", cmd);
+		esl_send_recv(handle, cmd_str);
+		if (handle->last_sr_event && handle->last_sr_event->body) {
+			printf("%s\n", handle->last_sr_event->body);
+		}
 	}
 	
-	printf("Unknown command [%s]\n", cmd);
-
  end:
 
 	return 0;
 
 }
 
-typedef struct {
-	char name[128];
-	char host[128];
-	esl_port_t port;
-	char pass[128];
-} cli_profile_t;
-
-static cli_profile_t profiles[128] = {{{0}}};
-static int pcount;
-
-
 static int get_profile(const char *name, cli_profile_t **profile)
 {
 	int x;
@@ -155,86 +328,315 @@
 	return -1;
 }
 
+#ifndef HAVE_EDITLINE
+static char command_buf[2048] = "";
+
+static const char *basic_gets(int *cnt)
+{
+	int x = 0;
+
+	printf("%s", prompt_str);
+
+	memset(&command_buf, 0, sizeof(command_buf));
+	for (x = 0; x < (sizeof(command_buf) - 1); x++) {
+		int c = getchar();
+		if (c < 0) {
+			int y = read(fileno(stdin), command_buf, sizeof(command_buf) - 1);
+			command_buf[y - 1] = '\0';
+			break;
+		}
+		
+		command_buf[x] = (char) c;
+		
+		if (command_buf[x] == '\n') {
+			command_buf[x] = '\0';
+			break;
+		}
+	}
+
+	*cnt = x;
+
+	return command_buf;
+
+}
+#endif
+
+
+static void print_banner(FILE *stream)
+{
+	fprintf(stream,
+			
+
+			"           _____ ____     ____ _     ___            \n"
+			"          |  ___/ ___|   / ___| |   |_ _|           \n"
+			"          | |_  \\___ \\  | |   | |    | |            \n"
+			"          |  _|  ___) | | |___| |___ | |            \n"
+			"          |_|   |____/   \\____|_____|___|           \n"
+			"\n"
+			"*****************************************************\n"
+			"* Anthony Minessale II, Ken Rice, Michael Jerris    *\n"
+			"* FreeSWITCH (http://www.freeswitch.org)            *\n"
+			"* Brought to you by ClueCon http://www.cluecon.com/ *\n"
+			"*****************************************************\n"
+			"\n\n"
+			);
+}
+
+
+static void set_fn_keys(cli_profile_t *profile)
+{
+	profile->console_fnkeys[0] = "help";
+	profile->console_fnkeys[1] = "status";
+	profile->console_fnkeys[2] = "show channels";
+	profile->console_fnkeys[3] = "show calls";
+	profile->console_fnkeys[4] = "sofia status";
+	profile->console_fnkeys[5] = "reloadxml";
+	profile->console_fnkeys[6] = "/log console";
+	profile->console_fnkeys[7] = "/log debug";
+	profile->console_fnkeys[8] = "sofia status profile internal";
+	profile->console_fnkeys[9] = "fsctl pause";
+	profile->console_fnkeys[10] = "fsctl resume";
+	profile->console_fnkeys[11] = "version";
+}
+
+
 int main(int argc, char *argv[])
 {
 	esl_handle_t handle = {{0}};
 	int count = 0;
 	const char *line = NULL;
 	char cmd_str[1024] = "";
-	char hfile[512] = "/tmp/fs_cli_history";
-	char cfile[512] = "/tmp/fs_cli_config";
-	char *home = getenv("HOME");
 	esl_config_t cfg;
-	cli_profile_t *profile = &profiles[0];
-	int cur = 0;
-	
-	strncpy(profiles[0].host, "localhost", sizeof(profiles[0].host));
-	strncpy(profiles[0].pass, "ClueCon", sizeof(profiles[0].pass));
-	strncpy(profiles[0].name, "default", sizeof(profiles[0].name));
-	profiles[0].port = 8021;
-	pcount++;
+	cli_profile_t *profile = NULL;
+	int rv = 0;
+
+#ifndef WIN32
+	char hfile[512] = "/etc/fs_cli_history";
+	char cfile[512] = "/etc/fs_cli.conf";
+	char dft_cfile[512] = "/etc/fs_cli.conf";
+#else
+	char hfile[512] = "fs_cli_history";
+	char cfile[512] = "fs_cli.conf";
+	char dft_cfile[512] = "fs_cli.conf";
+#endif
+	char *home = getenv("HOME");
+	/* Vars for optargs */
+	int opt;
+	static struct option options[] = {
+		{"help", 0, 0, 'h'},
+		{"host", 1, 0, 'H'},
+		{"port", 1, 0, 'P'},
+		{"password", 1, 0, 'p'},
+		{"debug", 1, 0, 'd'},
+		{"execute", 1, 0, 'x'},
+		{"loglevel", 1, 0, 'l'},
+		{"quiet", 0, 0, 'q'},
+		{0, 0, 0, 0}
+	};
+
+	char temp_host[128];
+	int argv_host = 0;
+	char temp_pass[128];
+	int argv_pass = 0 ;
+	int temp_port = 0;
+	int argv_port = 0;
+	int temp_log = -1;
+	int argv_error = 0;
+	int argv_exec = 0;
+	char argv_command[256] = "";
+	char argv_loglevel[128] = "";
+	int argv_quiet = 0;
 	
+
+	strncpy(internal_profile.host, "127.0.0.1", sizeof(internal_profile.host));
+	strncpy(internal_profile.pass, "ClueCon", sizeof(internal_profile.pass));
+	strncpy(internal_profile.name, "internal", sizeof(internal_profile.name));
+	internal_profile.port = 8021;
+	set_fn_keys(&internal_profile);
+
+
 	if (home) {
 		snprintf(hfile, sizeof(hfile), "%s/.fs_cli_history", home);
-		snprintf(cfile, sizeof(cfile), "%s/.fs_cli_config", home);
+		snprintf(cfile, sizeof(cfile), "%s/.fs_cli_conf", home);
 	}
 	
 	signal(SIGINT, handle_SIGINT);
-	gethostname(hostname, sizeof(hostname));
 
-	handle.debug = 0;
-	esl_global_set_default_logger(7);
+	esl_global_set_default_logger(6); /* default debug level to 6 (info) */
+	
+	for(;;) {
+		int option_index = 0;
+		opt = getopt_long(argc, argv, "H:U:P:S:p:d:x:l:qh?", options, &option_index);
+		if (opt == -1) break;
+		switch (opt)
+		{
+			case 'H':
+				esl_set_string(temp_host, optarg);
+				argv_host = 1;
+				break;
+			case 'P':
+				temp_port= atoi(optarg);
+				if (temp_port > 0 && temp_port < 65536){
+					argv_port = 1;
+				} else {
+					printf("ERROR: Port must be in range 1 - 65535\n");
+					argv_error = 1;
+				}
+				break;
+			case 'p':
+				esl_set_string(temp_pass, optarg);
+				argv_pass = 1;
+				break;
+			case 'd':
+				temp_log=atoi(optarg);
+				if (temp_log < 0 || temp_log > 7){
+					printf("ERROR: Debug level should be 0 - 7.\n");
+					argv_error = 1;
+				} else {
+					esl_global_set_default_logger(temp_log);
+				}
+				break;
+			case 'x':
+				argv_exec = 1;
+				esl_set_string(argv_command, optarg);
+				break;
+			case 'l':
+				esl_set_string(argv_loglevel, optarg);
+				break;
+			case 'q':
+				argv_quiet = 1;
+				break;
+				
+			case 'h':
+			case '?':
+				print_banner(stdout);
+				usage(argv[0]);
+				return 0;
+			default:
+				opt = 0;
+		}
+	}
 	
-	if (esl_config_open_file(&cfg, cfile)) {
+	if (argv_error){
+		printf("\n");
+		return usage(argv[0]);
+	}
+
+	if (!(rv = esl_config_open_file(&cfg, cfile))) {
+		rv = esl_config_open_file(&cfg, dft_cfile);
+	}
+
+	if (rv) {
 		char *var, *val;
 		char cur_cat[128] = "";
 
 		while (esl_config_next_pair(&cfg, &var, &val)) {
 			if (strcmp(cur_cat, cfg.category)) {
-				cur++;
 				esl_set_string(cur_cat, cfg.category);
-				esl_set_string(profiles[cur].name, cur_cat);
-				esl_set_string(profiles[cur].host, "localhost");
-				esl_set_string(profiles[cur].pass, "ClueCon");
-				profiles[cur].port = 8021;
-				esl_log(ESL_LOG_INFO, "Found Profile [%s]\n", profiles[cur].name);
+				esl_set_string(profiles[pcount].name, cur_cat);
+				esl_set_string(profiles[pcount].host, "localhost");
+				esl_set_string(profiles[pcount].pass, "ClueCon");
+				profiles[pcount].port = 8021;
+				set_fn_keys(&profiles[pcount]);
+				esl_log(ESL_LOG_DEBUG, "Found Profile [%s]\n", profiles[pcount].name);
 				pcount++;
 			}
 			
 			if (!strcasecmp(var, "host")) {
-				esl_set_string(profiles[cur].host, val);
+				esl_set_string(profiles[pcount-1].host, val);
 			} else if (!strcasecmp(var, "password")) {
-				esl_set_string(profiles[cur].pass, val);
+				esl_set_string(profiles[pcount-1].pass, val);
 			} else if (!strcasecmp(var, "port")) {
 				int pt = atoi(val);
 				if (pt > 0) {
-					profiles[cur].port = (esl_port_t)pt;
+					profiles[pcount-1].port = (esl_port_t)pt;
 				}
-			}
+			} else if (!strcasecmp(var, "debug")) {
+				int dt = atoi(val);
+				if (dt > -1 && dt < 8){
+					 profiles[pcount-1].debug = dt;
+				}	
+ 			} else if(!strcasecmp(var, "loglevel")) {
+ 				esl_set_string(profiles[pcount-1].loglevel, val);
+ 			} else if(!strcasecmp(var, "quiet")) {
+ 				profiles[pcount-1].quiet = esl_true(val);
+			} else if (!strncasecmp(var, "key_F", 5)) {
+				char *key = var + 5;
+
+				if (key) {
+					int i = atoi(key);
+				
+					if (i > 0 && i < 13) {
+						profiles[pcount-1].console_fnkeys[i - 1] = strdup(val);
+					}
+				}
+			} 
 		}
 		esl_config_close_file(&cfg);
 	}
-
-	if (argv[1]) {
-		if (get_profile(argv[1], &profile)) {
-			esl_log(ESL_LOG_INFO, "Chosen profile %s does not exist using builtin default\n", argv[1]);
-			profile = &profiles[0];
-		} else {
-			esl_log(ESL_LOG_INFO, "Chosen profile %s\n", profile->name);
+	
+	if (optind < argc) {
+		get_profile(argv[optind], &profile);
+	}
+	
+	if (!profile) {
+		if (get_profile("default", &profile)) {
+			esl_log(ESL_LOG_DEBUG, "profile default does not exist using builtin profile\n");
+			profile = &internal_profile;
 		}
 	}
 
-	esl_log(ESL_LOG_INFO, "Using profile %s\n", profile->name);
-		
-	gethostname(hostname, sizeof(hostname));
-	snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", profile->name);
+	if (temp_log < 0 ) {
+		esl_global_set_default_logger(profile->debug);
+	}	
+
+	if (argv_host) {
+		esl_set_string(profile->host, temp_host);
+	}
+	if (argv_port) {
+		profile->port = (esl_port_t)temp_port;
+	}
+	if (argv_pass) {
+		esl_set_string(profile->pass, temp_pass);
+	}
+	
+	if (*argv_loglevel) {
+		esl_set_string(profile->loglevel, argv_loglevel);
+		profile->quiet = 0;
+	}
 
+	esl_log(ESL_LOG_DEBUG, "Using profile %s [%s]\n", profile->name, profile->host);
 	
+	if (argv_host) {
+		if (argv_port && profile->port != 8021) {
+			snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s:%u@%s> ", profile->host, profile->port, profile->name);
+		} else {
+			snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s@%s> ", profile->host, profile->name);
+		}
+	} else {
+		snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", profile->name);
+	}
+
 	if (esl_connect(&handle, profile->host, profile->port, profile->pass)) {
+		esl_global_set_default_logger(3);
 		esl_log(ESL_LOG_ERROR, "Error Connecting [%s]\n", handle.err);
 		return -1;
 	}
-	
+
+
+	if (argv_exec){
+		snprintf(cmd_str, sizeof(cmd_str), "api %s\n\n", argv_command);
+		esl_send_recv(&handle, cmd_str);
+		if (handle.last_sr_event && handle.last_sr_event->body) {
+			printf("%s\n", handle.last_sr_event->body);
+		}
+		esl_disconnect(&handle);
+		return 0;
+	} 
+
+	global_handle = &handle;
+	global_profile = profile;
+
 	esl_thread_create_detached(msg_thread_run, &handle);
 
 #ifdef HAVE_EDITLINE
@@ -243,6 +645,39 @@
 	el_set(el, EL_EDITOR, "emacs");
 	myhistory = history_init();
 
+	el_set(el, EL_ADDFN, "f1-key", "F1 KEY PRESS", console_f1key);
+	el_set(el, EL_ADDFN, "f2-key", "F2 KEY PRESS", console_f2key);
+	el_set(el, EL_ADDFN, "f3-key", "F3 KEY PRESS", console_f3key);
+	el_set(el, EL_ADDFN, "f4-key", "F4 KEY PRESS", console_f4key);
+	el_set(el, EL_ADDFN, "f5-key", "F5 KEY PRESS", console_f5key);
+	el_set(el, EL_ADDFN, "f6-key", "F6 KEY PRESS", console_f6key);
+	el_set(el, EL_ADDFN, "f7-key", "F7 KEY PRESS", console_f7key);
+	el_set(el, EL_ADDFN, "f8-key", "F8 KEY PRESS", console_f8key);
+	el_set(el, EL_ADDFN, "f9-key", "F9 KEY PRESS", console_f9key);
+	el_set(el, EL_ADDFN, "f10-key", "F10 KEY PRESS", console_f10key);
+	el_set(el, EL_ADDFN, "f11-key", "F11 KEY PRESS", console_f11key);
+	el_set(el, EL_ADDFN, "f12-key", "F12 KEY PRESS", console_f12key);
+
+	el_set(el, EL_BIND, "\033OP", "f1-key", NULL);
+	el_set(el, EL_BIND, "\033OQ", "f2-key", NULL);
+	el_set(el, EL_BIND, "\033OR", "f3-key", NULL);
+	el_set(el, EL_BIND, "\033OS", "f4-key", NULL);
+
+
+	el_set(el, EL_BIND, "\033[11~", "f1-key", NULL);
+	el_set(el, EL_BIND, "\033[12~", "f2-key", NULL);
+	el_set(el, EL_BIND, "\033[13~", "f3-key", NULL);
+	el_set(el, EL_BIND, "\033[14~", "f4-key", NULL);
+	el_set(el, EL_BIND, "\033[15~", "f5-key", NULL);
+	el_set(el, EL_BIND, "\033[17~", "f6-key", NULL);
+	el_set(el, EL_BIND, "\033[18~", "f7-key", NULL);
+	el_set(el, EL_BIND, "\033[19~", "f8-key", NULL);
+	el_set(el, EL_BIND, "\033[20~", "f9-key", NULL);
+	el_set(el, EL_BIND, "\033[21~", "f10-key", NULL);
+	el_set(el, EL_BIND, "\033[23~", "f11-key", NULL);
+	el_set(el, EL_BIND, "\033[24~", "f12-key", NULL);
+
+
 	if (myhistory == 0) {
 		esl_log(ESL_LOG_ERROR, "history could not be initialized\n");
 		goto done;
@@ -251,17 +686,31 @@
 	history(myhistory, &ev, H_SETSIZE, 800);
 	el_set(el, EL_HIST, history, myhistory);
 	history(myhistory, &ev, H_LOAD, hfile);
+
+
+#endif
+#ifdef WIN32
+	hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
+	if (hStdout != INVALID_HANDLE_VALUE && GetConsoleScreenBufferInfo(hStdout, &csbiInfo)) {
+		wOldColorAttrs = csbiInfo.wAttributes;
+	}
 #endif
 
-	snprintf(cmd_str, sizeof(cmd_str), "log info\n\n");
-	esl_send_recv(&handle, cmd_str);
+	if (!argv_quiet && !profile->quiet) {
+		snprintf(cmd_str, sizeof(cmd_str), "log %s\n\n", profile->loglevel);	
+		esl_send_recv(&handle, cmd_str);
+	}
+
+	print_banner(stdout);
 
-	esl_log(ESL_LOG_INFO, "FS CLI Ready.\n");
+	esl_log(ESL_LOG_INFO, "FS CLI Ready.\nenter /help for a list of commands.\n");
 
 	while (running) {
 
 #ifdef HAVE_EDITLINE
 		line = el_gets(el, &count);
+#else
+		line = basic_gets(&count);
 #endif
 
 		if (count > 1) {
@@ -282,19 +731,9 @@
 #ifdef HAVE_EDITLINE
 				history(myhistory, &ev, H_ENTER, line);
 #endif
-
-				if (!strncasecmp(cmd, "...", 3)) {
-					goto done;
-				} else if (*cmd == '/') {
-					if (process_command(&handle, cmd + 1)) {
-						running = 0;
-					}
-				} else {
-					snprintf(cmd_str, sizeof(cmd_str), "api %s\n\n", cmd);
-					esl_send_recv(&handle, cmd_str);
-					if (handle.last_sr_event) {
-						printf("%s\n", handle.last_sr_event->body);
-					}
+				
+				if (process_command(&handle, cmd)) {
+					running = 0;
 				}
 
 #ifdef HAVE_EDITLINE
@@ -309,10 +748,8 @@
 
 	}
 
-
- done:
-	
 #ifdef HAVE_EDITLINE
+ done:
 	history(myhistory, &ev, H_SAVE, hfile);
 
 	/* Clean up our memory */

Modified: freeswitch/branches/gmaruzz/libs/esl/src/esl.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/src/esl.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/src/esl.2008.vcproj	Wed Jan  7 10:17:00 2009
@@ -20,7 +20,7 @@
 			Name="Debug|Win32"
 			OutputDirectory="$(SolutionDir)Debug"
 			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
+			ConfigurationType="4"
 			CharacterSet="1"
 			>
 			<Tool
@@ -42,14 +42,14 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_EXPORTS"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="4"
 				WarnAsError="true"
-				DebugInformationFormat="4"
+				DebugInformationFormat="3"
 				DisableSpecificWarnings="4706;4100"
 				EnablePREfast="true"
 			/>
@@ -63,22 +63,12 @@
 				Name="VCPreLinkEventTool"
 			/>
 			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="Ws2_32.lib"
-				ModuleDefinitionFile=""
-				OptimizeReferences="1"
-				EnableCOMDATFolding="1"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				ImportLibrary="$(IntDir)/$(TargetName).lib"
+				Name="VCLibrarianTool"
 			/>
 			<Tool
 				Name="VCALinkTool"
 			/>
 			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
 				Name="VCXDCMakeTool"
 			/>
 			<Tool
@@ -88,9 +78,6 @@
 				Name="VCFxCopTool"
 			/>
 			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
 				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
@@ -98,7 +85,7 @@
 			Name="Release|Win32"
 			OutputDirectory="$(SolutionDir)Release"
 			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
+			ConfigurationType="4"
 			CharacterSet="1"
 			WholeProgramOptimization="1"
 			>
@@ -120,7 +107,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_EXPORTS"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"
 				WarningLevel="4"
@@ -139,20 +126,12 @@
 				Name="VCPreLinkEventTool"
 			/>
 			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="Ws2_32.lib"
-				ModuleDefinitionFile=""
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				ImportLibrary="$(IntDir)/$(TargetName).lib"
+				Name="VCLibrarianTool"
 			/>
 			<Tool
 				Name="VCALinkTool"
 			/>
 			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
 				Name="VCXDCMakeTool"
 			/>
 			<Tool
@@ -162,9 +141,6 @@
 				Name="VCFxCopTool"
 			/>
 			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
 				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>

Modified: freeswitch/branches/gmaruzz/libs/esl/src/esl.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/src/esl.c	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/src/esl.c	Wed Jan  7 10:17:00 2009
@@ -368,12 +368,14 @@
 {
 	char *txt;
 
+	if (!handle->connected) {
+		return ESL_FAIL;
+	}
+
 	esl_event_serialize(handle->last_ievent, &txt, ESL_TRUE);
 
-	if (handle->debug) {
-		esl_log(ESL_LOG_DEBUG, "SEND EVENT\n%s\n", txt);
-	}
-	
+	esl_log(ESL_LOG_DEBUG, "SEND EVENT\n%s\n", txt);
+		
 	send(handle->sock, "sendevent\n", 10, 0);
 	send(handle->sock, txt, strlen(txt), 0);
 	send(handle->sock, "\n\n", 2, 0);
@@ -390,6 +392,10 @@
 	char arg_buf[512] = "";
 	char send_buf[1292] = "";
 	
+	if (!handle->connected) {
+		return ESL_FAIL;
+	}
+
 	if (uuid) {
 		snprintf(cmd_buf, sizeof(cmd_buf), "sendmsg %s", uuid);
 	}
@@ -482,6 +488,16 @@
 	char sendbuf[256];
 	int rval = 0;
 	const char *hval;
+#ifdef WIN32
+	WORD wVersionRequested = MAKEWORD(2, 0);
+	WSADATA wsaData;
+	int err = WSAStartup(wVersionRequested, &wsaData);
+	if (err != 0) {
+		snprintf(handle->err, sizeof(handle->err), "WSAStartup Error");
+		return ESL_FAIL;
+	}
+
+#endif
 
 	if (!handle->mutex) {
 		esl_mutex_create(&handle->mutex);
@@ -562,24 +578,33 @@
 
 ESL_DECLARE(esl_status_t) esl_disconnect(esl_handle_t *handle)
 {
+	esl_mutex_t *mutex = handle->mutex;
+	esl_status_t status = ESL_FAIL;
+	
+	if (mutex) {
+		esl_mutex_lock(mutex);
+	}
+
 	esl_event_safe_destroy(&handle->last_event);
 	esl_event_safe_destroy(&handle->last_sr_event);
 	esl_event_safe_destroy(&handle->last_ievent);
 	esl_event_safe_destroy(&handle->info_event);
 
-	if (handle->mutex) {
-		esl_mutex_destroy(&handle->mutex);
-	}
-
 	if (handle->sock != ESL_SOCK_INVALID) {
 		closesocket(handle->sock);
 		handle->sock = ESL_SOCK_INVALID;
-		return ESL_SUCCESS;
+		status = ESL_SUCCESS;
 	}
 	
 	handle->connected = 0;
 
-	return ESL_FAIL;
+	if (mutex) {
+		esl_mutex_unlock(mutex);
+		esl_mutex_destroy(&mutex);
+	}
+
+
+	return status;
 }
 
 ESL_DECLARE(esl_status_t) esl_recv_event_timed(esl_handle_t *handle, uint32_t ms, esl_event_t **save_event)
@@ -589,6 +614,10 @@
 	int max, activity;
 	esl_status_t status = ESL_SUCCESS;
 
+	if (!handle->connected) {
+		return ESL_FAIL;
+	}
+
 	tv.tv_usec = ms * 1000;
 
 	esl_mutex_lock(handle->mutex);
@@ -624,7 +653,7 @@
 
  done:
 
-	esl_mutex_unlock(handle->mutex);
+	if (handle->mutex) esl_mutex_unlock(handle->mutex);
 
 	return status;
 
@@ -644,6 +673,11 @@
 	esl_ssize_t len;
 	int zc = 0;
 	
+
+	if (!handle->connected) {
+		return ESL_FAIL;
+	}
+
 	esl_mutex_lock(handle->mutex);
 
 	esl_event_safe_destroy(&handle->last_event);
@@ -689,9 +723,7 @@
 				
 				if (hname && hval) {
 					esl_url_decode(hval);
-					if (handle->debug > 1) {
-						esl_log(ESL_LOG_DEBUG, "RECV HEADER [%s] = [%s]\n", hname, hval);
-					}
+					esl_log(ESL_LOG_DEBUG, "RECV HEADER [%s] = [%s]\n", hname, hval);
 					esl_event_add_header_string(revent, ESL_STACK_BOTTOM, hname, hval);
 				}
 
@@ -783,10 +815,7 @@
 			
 				if (hname && hval) {
 					esl_url_decode(hval);
-
-					if (handle->debug > 1) {
-						esl_log(ESL_LOG_DEBUG, "RECV INNER HEADER [%s] = [%s]\n", hname, hval);
-					}
+					esl_log(ESL_LOG_DEBUG, "RECV INNER HEADER [%s] = [%s]\n", hname, hval);
 					esl_event_add_header_string(handle->last_ievent, ESL_STACK_BOTTOM, hname, hval);
 				}
 				
@@ -815,8 +844,8 @@
 				handle->last_ievent->body = body;
 			}
 
-
-			if (handle->debug) {
+			
+			if (esl_log_level >= 7) {
 				char *foo;
 				esl_event_serialize(handle->last_ievent, &foo, ESL_FALSE);
 				esl_log(ESL_LOG_DEBUG, "RECV EVENT\n%s\n", foo);
@@ -824,7 +853,7 @@
 			}
 		}
 		
-		if (handle->debug) {
+		if (esl_log_level >= 7) {
 			char *foo;
 			esl_event_serialize(revent, &foo, ESL_FALSE);
 			esl_log(ESL_LOG_DEBUG, "RECV MESSAGE\n%s\n", foo);
@@ -847,17 +876,19 @@
 {
 	const char *e = cmd + strlen(cmd) -1;
 	
-	if (handle->debug) {
-		esl_log(ESL_LOG_DEBUG, "SEND\n%s\n", cmd);
+	if (!handle->connected) {
+		return ESL_FAIL;
 	}
+
+	esl_log(ESL_LOG_DEBUG, "SEND\n%s\n", cmd);
 	
-	if (send(handle->sock, cmd, strlen(cmd), 0)) {
+	if (send(handle->sock, cmd, strlen(cmd), 0) != (int)strlen(cmd)) {
 		strerror_r(handle->errnum, handle->err, sizeof(handle->err));
 		return ESL_FAIL;
 	}
-
+	
 	if (!(*e == '\n' && *(e-1) == '\n')) {
-		if (send(handle->sock, "\n\n", 2, 0)) {
+		if (send(handle->sock, "\n\n", 2, 0) != 2) {
 			strerror_r(handle->errnum, handle->err, sizeof(handle->err));
 			return ESL_FAIL;
 		}
@@ -873,8 +904,16 @@
 	const char *hval;
 	esl_status_t status;
 	
+	if (!handle->connected) {
+		return ESL_FAIL;
+	}
+
 	esl_mutex_lock(handle->mutex);
-	esl_send(handle, cmd);
+
+	if ((status = esl_send(handle, cmd))) {
+		return status;
+	}
+
 	status = esl_recv_event(handle, &handle->last_sr_event);
 	
 	if (handle->last_sr_event) {

Modified: freeswitch/branches/gmaruzz/libs/esl/src/esl_event.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/src/esl_event.c	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/src/esl_event.c	Wed Jan  7 10:17:00 2009
@@ -313,41 +313,41 @@
 
 int vasprintf(char **ret, const char *format, va_list ap);
 
-static int esl_vasprintf(char **ret, const char *fmt, va_list ap)
-{
-#ifndef WIN32
-	return vasprintf(ret, fmt, ap);
-#else
-	char *buf;
-	int len;
-	size_t buflen;
-	va_list ap2;
-	char *tmp = NULL;
-
-#ifdef _MSC_VER
-#if _MSC_VER >= 1500
-	/* hack for incorrect assumption in msvc header files for code analysis */
-	__analysis_assume(tmp);
-#endif
-	ap2 = ap;
-#else
-	va_copy(ap2, ap);
-#endif
-
-	len = vsnprintf(tmp, 0, fmt, ap2);
-
-	if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {
-		len = vsnprintf(buf, buflen, fmt, ap);
-		*ret = buf;
-	} else {
-		*ret = NULL;
-		len = -1;
-	}
-
-	va_end(ap2);
-	return len;
-#endif
-}
+static int esl_vasprintf(char **ret, const char *fmt, va_list ap)
+{
+#if !defined(WIN32) && !defined(__sun)
+	return vasprintf(ret, fmt, ap);
+#else
+	char *buf;
+	int len;
+	size_t buflen;
+	va_list ap2;
+	char *tmp = NULL;
+
+#ifdef _MSC_VER
+#if _MSC_VER >= 1500
+	/* hack for incorrect assumption in msvc header files for code analysis */
+	__analysis_assume(tmp);
+#endif
+	ap2 = ap;
+#else
+	va_copy(ap2, ap);
+#endif
+
+	len = vsnprintf(tmp, 0, fmt, ap2);
+
+	if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {
+		len = vsnprintf(buf, buflen, fmt, ap);
+		*ret = buf;
+	} else {
+		*ret = NULL;
+		len = -1;
+	}
+
+	va_end(ap2);
+	return len;
+#endif
+}
 
 
 ESL_DECLARE(esl_status_t) esl_event_add_header(esl_event_t *event, esl_stack_t stack, const char *header_name, const char *fmt, ...)

Modified: freeswitch/branches/gmaruzz/libs/esl/src/include/esl.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/src/include/esl.h	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/src/include/esl.h	Wed Jan  7 10:17:00 2009
@@ -42,6 +42,15 @@
 typedef struct esl_event_header esl_event_header_t;
 typedef struct esl_event esl_event_t;
 
+#ifdef WIN32
+#define ESL_SEQ_FWHITE FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
+#define ESL_SEQ_FRED FOREGROUND_RED | FOREGROUND_INTENSITY
+#define ESL_SEQ_FMAGEN FOREGROUND_BLUE | FOREGROUND_RED
+#define ESL_SEQ_FCYAN FOREGROUND_GREEN | FOREGROUND_BLUE
+#define ESL_SEQ_FGREEN FOREGROUND_GREEN
+#define ESL_SEQ_FYELLOW FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
+#define ESL_SEQ_DEFAULT_COLOR ESL_SEQ_FWHITE
+#else
 #define ESL_SEQ_ESC "\033["
 /* Ansi Control character suffixes */
 #define ESL_SEQ_HOME_CHAR 'H'
@@ -95,6 +104,7 @@
 #define ESL_SEQ_CLEARLINE ESL_SEQ_ESC ESL_SEQ_CLEARLINE_CHAR_STR
 #define ESL_SEQ_CLEARLINEEND ESL_SEQ_ESC ESL_SEQ_CLEARLINEEND_CHAR
 #define ESL_SEQ_CLEARSCR ESL_SEQ_ESC ESL_SEQ_CLEARSCR_CHAR ESL_SEQ_HOME
+#endif
 
 #if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__NetBSD__)
 #define _XOPEN_SOURCE 600
@@ -246,7 +256,6 @@
 	esl_event_t *last_sr_event;
 	esl_event_t *last_ievent;
 	esl_event_t *info_event;
-	int debug;
 	int connected;
 	struct sockaddr_in addr;
 	esl_mutex_t *mutex;

Modified: freeswitch/branches/gmaruzz/libs/esl/src/include/esl_config.h
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/src/include/esl_config.h	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/src/include/esl_config.h	Wed Jan  7 10:17:00 2009
@@ -70,6 +70,34 @@
 #define esl_is_file_path(file) ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR))
 #endif
 
+/*!
+  \brief Evaluate the truthfullness of a string expression
+  \param expr a string expression
+  \return true or false 
+*/
+#define esl_true(expr)\
+(expr && ( !strcasecmp(expr, "yes") ||\
+!strcasecmp(expr, "on") ||\
+!strcasecmp(expr, "true") ||\
+!strcasecmp(expr, "enabled") ||\
+!strcasecmp(expr, "active") ||\
+!strcasecmp(expr, "allow") ||\
+atoi(expr))) ? 1 : 0
+
+/*!
+  \brief Evaluate the falsefullness of a string expression
+  \param expr a string expression
+  \return true or false 
+*/
+#define esl_false(expr)\
+(expr && ( !strcasecmp(expr, "no") ||\
+!strcasecmp(expr, "off") ||\
+!strcasecmp(expr, "false") ||\
+!strcasecmp(expr, "disabled") ||\
+!strcasecmp(expr, "inactive") ||\
+!strcasecmp(expr, "disallow") ||\
+!atoi(expr))) ? 1 : 0
+
 typedef struct esl_config esl_config_t;
 
 /*! \brief A simple file handle representing an open configuration file **/

Modified: freeswitch/branches/gmaruzz/libs/esl/testclient.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/testclient.c	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/testclient.c	Wed Jan  7 10:17:00 2009
@@ -7,8 +7,6 @@
 {
 	esl_handle_t handle = {{0}};
 
-	handle.debug = 1;
-	
 	esl_connect(&handle, "localhost", 8021, "ClueCon");
 
 	esl_send_recv(&handle, "api status\n\n");

Modified: freeswitch/branches/gmaruzz/libs/esl/testserver.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/esl/testserver.c	(original)
+++ freeswitch/branches/gmaruzz/libs/esl/testserver.c	Wed Jan  7 10:17:00 2009
@@ -13,7 +13,6 @@
 
 
 	esl_attach_handle(&handle, client_sock, addr);
-	handle.debug = 2;
 
 	printf("Connected! %d\n", handle.sock);
 	

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

Modified: freeswitch/branches/gmaruzz/libs/portaudio/src/os/win/pa_win_wdmks_utils.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/portaudio/src/os/win/pa_win_wdmks_utils.c	(original)
+++ freeswitch/branches/gmaruzz/libs/portaudio/src/os/win/pa_win_wdmks_utils.c	Wed Jan  7 10:17:00 2009
@@ -185,7 +185,8 @@
 int PaWin_WDMKS_QueryFilterMaximumChannelCount( void *wcharDevicePath, int isInput )
 {
     HANDLE deviceHandle;
-    int pinCount, pinId, i;
+    int pinCount, pinId;
+	ULONG i;
     int result = 0;
     KSPIN_DATAFLOW requiredDataflowDirection = (isInput ? KSPIN_DATAFLOW_OUT : KSPIN_DATAFLOW_IN );
     

Modified: freeswitch/branches/gmaruzz/libs/portaudio/src/os/win/pa_x86_plain_converters.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/portaudio/src/os/win/pa_x86_plain_converters.c	(original)
+++ freeswitch/branches/gmaruzz/libs/portaudio/src/os/win/pa_x86_plain_converters.c	Wed Jan  7 10:17:00 2009
@@ -124,7 +124,7 @@
 
 #define PA_DITHER_BITS_   (15)
 /* Multiply by PA_FLOAT_DITHER_SCALE_ to get a float between -2.0 and +1.99999 */
-#define PA_FLOAT_DITHER_SCALE_  (1.0 / ((1<<PA_DITHER_BITS_)-1))
+#define PA_FLOAT_DITHER_SCALE_  (1.0f / ((1<<PA_DITHER_BITS_)-1))
 static const float const_float_dither_scale_ = PA_FLOAT_DITHER_SCALE_;
 #define PA_DITHER_SHIFT_  ((32 - PA_DITHER_BITS_) + 1)
 

Modified: freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c
==============================================================================
--- freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c	(original)
+++ freeswitch/branches/gmaruzz/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c	Wed Jan  7 10:17:00 2009
@@ -242,21 +242,21 @@
   i = ser->ser_id;
 
   flags = (wait->events & SU_WAIT_IN) ? EV_ADD : EV_ADD | EV_DISABLE;
-  EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, (void *)i);
+  EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, (void *)(intptr_t)i);
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("kevent((%u, %s, %u, %p)) failed: %s\n",
-		wait->fd, "EVFILT_READ", flags, (void *)i, strerror(errno)));
+				wait->fd, "EVFILT_READ", flags, (void *)(intptr_t)i, strerror(errno)));
     return -1;
   }
 
   flags = (wait->events & SU_WAIT_OUT) ? EV_ADD : EV_ADD | EV_DISABLE;
-  EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, (void *)i);
+  EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, (void *)(intptr_t)i);
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     int error = errno;
     SU_DEBUG_0(("kevent((%u, %s, %u, %p)) failed: %s\n",
-		wait->fd, "EVFILT_WRITE", flags, (void *)i, strerror(error)));
+				wait->fd, "EVFILT_WRITE", flags, (void *)(intptr_t)i, strerror(error)));
 
-    EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, (void *)i);
+    EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, (void *)(intptr_t)i);
     kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL);
 
     errno = error;
@@ -294,17 +294,17 @@
 
   wait = ser->ser_wait;
 
-  EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, (void *)i);
+  EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, (void *)(intptr_t)i);
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("remove kevent((%u, %s, %s, %p)) failed: %s\n",
-		wait->fd, "EVFILT_READ", "EV_DELETE", (void *)i,
+				wait->fd, "EVFILT_READ", "EV_DELETE", (void *)(intptr_t)i,
 		strerror(errno)));
   }
 
-  EV_SET(ev, wait->fd, EVFILT_WRITE, EV_DELETE, 0, 0, (void *)i);
+  EV_SET(ev, wait->fd, EVFILT_WRITE, EV_DELETE, 0, 0, (void *)(intptr_t)i);
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("remove kevent((%u, %s, %s, %p)) failed: %s\n",
-		wait->fd, "EVFILT_WRITE", "EV_DELETE", (void *)i,
+				wait->fd, "EVFILT_WRITE", "EV_DELETE", (void *)(intptr_t)i,
 		strerror(errno)));
   }
 
@@ -461,21 +461,21 @@
   wait->events = events;
 
   flags = (wait->events & SU_WAIT_IN) ? EV_ADD | EV_ENABLE : EV_ADD | EV_DISABLE;
-  EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, (void *)index);
+  EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, (void *)(intptr_t)index);
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("modify kevent((%u, %s, %s, %p)) failed: %s\n",
 		wait->fd, "EVFILT_READ",
 		(events & SU_WAIT_IN) ? "EV_ENABLE" : "EV_DISABLE",
-		(void *)index, strerror(errno)));
+				(void *)(intptr_t)index, strerror(errno)));
   }
 
   flags = (wait->events & SU_WAIT_OUT) ? EV_ADD | EV_ENABLE : EV_ADD | EV_DISABLE;
-  EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, (void *)index);
+  EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, (void *)(intptr_t)index);
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("modify kevent((%u, %s, %s, %p)) failed: %s\n",
 		wait->fd, "EVFILT_WRITE",
 		(events & SU_WAIT_OUT) ? "EV_ENABLE" : "EV_DISABLE",
-		(void *)index, strerror(errno)));
+				(void *)(intptr_t)index, strerror(errno)));
   }
 
   return 0;
@@ -539,7 +539,7 @@
     struct su_register *ser;
     su_root_magic_t *magic;
 
-    index = (int)ev[j].udata;
+    index = (int)(intptr_t)ev[j].udata;
     if (index <= 0 || self->sup_max_index < index)
       continue;
     ser = self->sup_indices[index];

Modified: freeswitch/branches/gmaruzz/libs/win32/Dowload 32khz Sounds.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/win32/Dowload 32khz Sounds.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/win32/Dowload 32khz Sounds.2008.vcproj	Wed Jan  7 10:17:00 2009
@@ -75,7 +75,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					Description="Downloading 32khzsound."
-					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-32000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-32000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
+					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-32000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-32000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
 					Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\32000"
 				/>
 			</FileConfiguration>
@@ -85,7 +85,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					Description="Downloading 32khzsound."
-					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-32000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-32000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
+					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-32000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-32000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
 					Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\32000"
 				/>
 			</FileConfiguration>

Modified: freeswitch/branches/gmaruzz/libs/win32/Download 16khz Sounds.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/win32/Download 16khz Sounds.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/win32/Download 16khz Sounds.2008.vcproj	Wed Jan  7 10:17:00 2009
@@ -75,7 +75,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					Description="Downloading 16khzsound."
-					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-16000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-16000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
+					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-16000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-16000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
 					Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\16000"
 				/>
 			</FileConfiguration>
@@ -85,7 +85,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					Description="Downloading 16khzsound."
-					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-16000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-16000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
+					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-16000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-16000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
 					Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\16000"
 				/>
 			</FileConfiguration>

Modified: freeswitch/branches/gmaruzz/libs/win32/Download 8khz Sounds.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/win32/Download 8khz Sounds.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/win32/Download 8khz Sounds.2008.vcproj	Wed Jan  7 10:17:00 2009
@@ -75,7 +75,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					Description="Downloading 8khzsound."
-					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-8000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-8000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
+					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-8000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-8000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
 					Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\8000"
 				/>
 			</FileConfiguration>
@@ -85,7 +85,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					Description="Downloading 8khzsound."
-					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-8000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-8000-1.0.2.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
+					CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-8000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\music\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-8000-1.0.7.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;"
 					Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\8000"
 				/>
 			</FileConfiguration>

Modified: freeswitch/branches/gmaruzz/libs/win32/flite/flite.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/win32/flite/flite.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/win32/flite/flite.2008.vcproj	Wed Jan  7 10:17:00 2009
@@ -45,7 +45,7 @@
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
-				WarningLevel="3"
+				WarningLevel="0"
 				DebugInformationFormat="4"
 			/>
 			<Tool
@@ -108,7 +108,7 @@
 				MinimalRebuild="true"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
-				WarningLevel="3"
+				WarningLevel="0"
 				DebugInformationFormat="3"
 			/>
 			<Tool
@@ -127,9 +127,6 @@
 				Name="VCALinkTool"
 			/>
 			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
 				Name="VCXDCMakeTool"
 			/>
 			<Tool
@@ -139,9 +136,6 @@
 				Name="VCFxCopTool"
 			/>
 			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
 				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
@@ -721,15 +715,15 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\flite-1.3.99\lang\cmu_us_kal\voxdefs.h"
+				RelativePath="..\..\flite-1.3.99\lang\cmu_us_kal16\voxdefs.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\flite-1.3.99\lang\cmu_us_kal16\voxdefs.h"
+				RelativePath="..\..\flite-1.3.99\lang\cmu_time_awb\voxdefs.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\flite-1.3.99\lang\cmu_time_awb\voxdefs.h"
+				RelativePath="..\..\flite-1.3.99\lang\cmu_us_kal\voxdefs.h"
 				>
 			</File>
 		</Filter>
@@ -742,4 +736,4 @@
 	</Files>
 	<Globals>
 	</Globals>
-</VisualStudioProject>
\ No newline at end of file
+</VisualStudioProject>

Modified: freeswitch/branches/gmaruzz/libs/win32/pocketsphinx/pocketsphinx.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/win32/pocketsphinx/pocketsphinx.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/win32/pocketsphinx/pocketsphinx.2008.vcproj	Wed Jan  7 10:17:00 2009
@@ -59,7 +59,7 @@
 				AssemblerListingLocation=".\Release/"
 				ObjectFile=".\Release/"
 				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
+				WarningLevel="0"
 				SuppressStartupBanner="true"
 			/>
 			<Tool
@@ -145,7 +145,7 @@
 				AssemblerListingLocation=".\Debug/"
 				ObjectFile=".\Debug/"
 				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
+				WarningLevel="0"
 				SuppressStartupBanner="true"
 				DebugInformationFormat="4"
 			/>
@@ -278,11 +278,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\pocketsphinx-0.5.99\include\pocketsphinx.h"
+				RelativePath="..\..\..\include\pocketsphinx.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\..\include\pocketsphinx.h"
+				RelativePath="..\..\pocketsphinx-0.5.99\include\pocketsphinx.h"
 				>
 			</File>
 			<File

Modified: freeswitch/branches/gmaruzz/libs/win32/sphinxbase/sphinxbase.2008.vcproj
==============================================================================
--- freeswitch/branches/gmaruzz/libs/win32/sphinxbase/sphinxbase.2008.vcproj	(original)
+++ freeswitch/branches/gmaruzz/libs/win32/sphinxbase/sphinxbase.2008.vcproj	Wed Jan  7 10:17:00 2009
@@ -59,7 +59,7 @@
 				AssemblerListingLocation=".\Release/"
 				ObjectFile=".\Release/"
 				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
+				WarningLevel="0"
 				SuppressStartupBanner="true"
 			/>
 			<Tool
@@ -146,7 +146,7 @@
 				AssemblerListingLocation=".\Debug/"
 				ObjectFile=".\Debug/"
 				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
+				WarningLevel="0"
 				SuppressStartupBanner="true"
 				DebugInformationFormat="4"
 			/>
@@ -474,7 +474,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\fe\fe_interface.c"
@@ -497,8 +496,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\fe\fe_sigproc.c"
@@ -521,7 +518,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\fe\fe_warp.c"
@@ -544,7 +540,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\fe\fe_warp_affine.c"
@@ -567,7 +562,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\fe\fe_warp_inverse_linear.c"
@@ -590,7 +584,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\fe\fe_warp_piecewise_linear.c"
@@ -613,7 +606,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\feat\feat.c"
@@ -636,7 +628,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\filename.c"
@@ -659,7 +650,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\fe\fixlog.c"
@@ -682,7 +672,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\lm\fsg_model.c"
@@ -709,7 +698,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\glist.c"
@@ -732,7 +720,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\hash_table.c"
@@ -755,7 +742,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\heap.c"
@@ -778,7 +764,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\info.c"
@@ -801,7 +786,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\lm\jsgf.c"
@@ -836,7 +820,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\listelem_alloc.c"
@@ -871,7 +854,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\mmio.c"
@@ -918,7 +900,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxad\play_win32.c"
@@ -941,7 +922,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\profile.c"
@@ -964,7 +944,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxad\rec_win32.c"
@@ -987,7 +966,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\sbthread.c"
@@ -1014,7 +992,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\slapack_lite.c"
@@ -1037,7 +1014,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\strfuncs.c"
@@ -1060,7 +1036,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\util\unlimit.c"
@@ -1083,7 +1058,6 @@
 						PreprocessorDefinitions=""
 					/>
 				</FileConfiguration>
-
 			</File>
 			<File
 				RelativePath="..\..\sphinxbase-0.4.99\src\libsphinxbase\fe\yin.c"

Modified: freeswitch/branches/gmaruzz/src/include/switch_channel.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_channel.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_channel.h	Wed Jan  7 10:17:00 2009
@@ -472,6 +472,9 @@
 */
 SWITCH_DECLARE(void) switch_channel_event_set_data(_In_ switch_channel_t *channel, _In_ switch_event_t *event);
 
+SWITCH_DECLARE(void) switch_channel_event_set_basic_data(_In_ switch_channel_t *channel, _In_ switch_event_t *event);
+SWITCH_DECLARE(void) switch_channel_event_set_extended_data(_In_ switch_channel_t *channel, _In_ switch_event_t *event);
+
 /*!
   \brief Expand varaibles in a string based on the variables in a paticular channel
   \param channel channel to expand the variables from

Modified: freeswitch/branches/gmaruzz/src/include/switch_dso.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_dso.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_dso.h	Wed Jan  7 10:17:00 2009
@@ -30,10 +30,10 @@
 
 typedef void * switch_dso_data_t;
 
-void switch_dso_destroy(switch_dso_lib_t *lib);
-switch_dso_lib_t switch_dso_open(const char *path, int global, char **err);
-switch_dso_func_t switch_dso_func_sym(switch_dso_lib_t lib, const char *sym, char **err);
-void *switch_dso_data_sym(switch_dso_lib_t lib, const char *sym, char **err);
+SWITCH_DECLARE(void) switch_dso_destroy(switch_dso_lib_t *lib);
+SWITCH_DECLARE(switch_dso_lib_t) switch_dso_open(const char *path, int global, char **err);
+SWITCH_DECLARE(switch_dso_func_t) switch_dso_func_sym(switch_dso_lib_t lib, const char *sym, char **err);
+SWITCH_DECLARE(void *) switch_dso_data_sym(switch_dso_lib_t lib, const char *sym, char **err);
 
 
 #endif

Modified: freeswitch/branches/gmaruzz/src/include/switch_ivr.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_ivr.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_ivr.h	Wed Jan  7 10:17:00 2009
@@ -780,7 +780,7 @@
 
 	 SWITCH_DECLARE(switch_status_t) switch_ivr_bind_dtmf_meta_session(switch_core_session_t *session, uint32_t key,
 																	   switch_bind_flag_t bind_flags, const char *app);
-	 SWITCH_DECLARE(switch_status_t) switch_ivr_unbind_dtmf_meta_session(switch_core_session_t *session);
+     SWITCH_DECLARE(switch_status_t) switch_ivr_unbind_dtmf_meta_session(switch_core_session_t *session, uint32_t key);
 	 SWITCH_DECLARE(switch_status_t) switch_ivr_soft_hold(switch_core_session_t *session, const char *unhold_key, const char *moh_a, const char *moh_b);
 	 SWITCH_DECLARE(switch_status_t) switch_ivr_say(switch_core_session_t *session, const char *tosay, const char *module_name, const char *say_type,
 													const char *say_method, switch_input_args_t *args);

Modified: freeswitch/branches/gmaruzz/src/include/switch_rtp.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_rtp.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_rtp.h	Wed Jan  7 10:17:00 2009
@@ -431,6 +431,8 @@
 SWITCH_DECLARE(switch_status_t) switch_rtp_activate_stun_ping(switch_rtp_t *rtp_session, const char *stun_ip, switch_port_t stun_port,
 															  uint32_t packet_count, switch_bool_t funny);
 
+SWITCH_DECLARE(void) switch_rtp_intentional_bugs(switch_rtp_t *rtp_session, switch_rtp_bug_flag_t bugs);
+
 /*!
   \}
 */

Modified: freeswitch/branches/gmaruzz/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_types.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_types.h	Wed Jan  7 10:17:00 2009
@@ -179,7 +179,8 @@
 	SBF_DIAL_BLEG = (1 << 2),
 	SBF_EXEC_BLEG = (1 << 3),
 	SBF_EXEC_OPPOSITE = (1 << 4),
-	SBF_EXEC_SAME = (1 << 5)
+	SBF_EXEC_SAME = (1 << 5),
+	SBF_ONCE = (1 << 6)
 } switch_bind_flag_enum_t;
 typedef uint32_t switch_bind_flag_t;
 
@@ -460,6 +461,38 @@
 } switch_rtp_flag_enum_t;
 typedef uint32_t switch_rtp_flag_t;
 
+typedef enum {
+	RTP_BUG_NONE = 0, /* won't be using this one much ;) */
+
+	RTP_BUG_CISCO_SKIP_MARK_BIT_2833 = (1 << 0),
+	/* Some Cisco devices get mad when you send the mark bit on new 2833 because it makes
+	   them flush their jitterbuffer and the dtmf along with it.
+
+	   This flag will disable the sending of the mark bit on the first DTMF packet.
+	*/
+
+
+	RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833 = (1 << 1)
+	/*
+	  Sonus wrongly expects that, when sending a multi-packet 2833 DTMF event, The sender
+	  should increment the RTP timestamp in each packet when, in reality, the sender should
+	  send the same exact timestamp and increment the duration field in the 2833 payload.
+	  This allows a reconstruction of the duration if any of the packets are lost.
+
+	  final_duration - initial_timestamp = total_samples
+
+	  However, if the duration value exceeds the space allocated (16 bits), The sender should increment
+	  the timestamp one unit and reset the duration to 0. 
+	  
+	  Always sending a duration of 0 with a new timestamp should be tolerated but is rarely intentional
+	  and is mistakenly done by many devices.  
+	  The issue is that the Sonus expects everyone to do it this way instead of tolerating either way.
+	  Sonus will actually ignore every packet with the same timestamp before concluding if it's DTMF.
+	  
+	  This flag will cause each packet to have a new timestamp.
+	*/
+
+} switch_rtp_bug_flag_t;
 
 #ifdef _MSC_VER
 #pragma pack(push, r1, 1)
@@ -574,9 +607,23 @@
 	SWITCH_MESSAGE_INDICATE_DISPLAY,
 	SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY,
 	SWITCH_MESSAGE_INDICATE_AUDIO_SYNC,
+	SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA,
 	SWITCH_MESSAGE_INVALID
 } switch_core_session_message_types_t;
 
+typedef struct {
+	uint32_t T38MaxBitRate;
+	switch_bool_t T38FaxFillBitRemoval;
+	switch_bool_t T38FaxTranscodingMMR;
+	switch_bool_t T38FaxTranscodingJBIG;
+	const char *T38FaxRateManagement;
+	uint32_t T38FaxMaxBuffer;
+	uint32_t T38FaxMaxDatagram;
+	const char *T38FaxUdpEC;
+	const char *T38VendorInfo;
+	const char *ip;
+	uint32_t port;
+} switch_t38_options_t;
 
 /*!
   \enum switch_stack_t

Modified: freeswitch/branches/gmaruzz/src/include/switch_xml.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/include/switch_xml.h	(original)
+++ freeswitch/branches/gmaruzz/src/include/switch_xml.h	Wed Jan  7 10:17:00 2009
@@ -142,6 +142,7 @@
 ///\param value the value
 ///\return an xml node or NULL
 SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(switch_xml_t node, const char *childname, const char *attrname, const char *value);
+SWITCH_DECLARE(switch_xml_t) switch_xml_find_child_multi(switch_xml_t node, const char *childname, ...);
 
 ///\brief returns the next tag of the same name in the same section and depth or NULL
 ///\ if not found
@@ -334,11 +335,22 @@
 												  switch_event_t *params);
 
 SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(const char *domain_name, switch_event_t *params, switch_xml_t *root, switch_xml_t *domain);
+
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_group(const char *group_name,
+														const char *domain_name, 
+														switch_xml_t *root,
+														switch_xml_t *domain,
+														switch_xml_t *group,
+														switch_event_t *params);
+
 SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *key,
 													   const char *user_name,
 													   const char *domain_name,
 													   const char *ip,
-													   switch_xml_t *root, switch_xml_t *domain, switch_xml_t *user, switch_event_t *params);
+													   switch_xml_t *root, switch_xml_t *domain, switch_xml_t *user, switch_xml_t *ingroup, 
+													   switch_event_t *params);
+
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(const char *user_name, switch_xml_t domain, switch_xml_t *user, switch_xml_t *ingroup);
 
 ///\brief open a config in the core registry
 ///\param file_path the name of the config section e.g. modules.conf

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c	Wed Jan  7 10:17:00 2009
@@ -77,6 +77,245 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
+SWITCH_STANDARD_API(group_call_function)
+{
+	char *domain;
+	char *group_name = NULL;
+	char *flags;
+	int ok = 0;
+	switch_channel_t *channel = NULL;
+	char *fp = NULL;
+	const char *call_delim = ",";
+
+	if (switch_strlen_zero(cmd)) {
+		goto end;
+	}
+
+	if (session) {
+		channel = switch_core_session_get_channel(session);
+	}
+
+	group_name = strdup(cmd);
+	switch_assert(group_name);
+
+	if ((flags = strchr(group_name, '+'))) {
+		*flags++ = '\0';
+		for (fp = flags; fp && *fp; fp++) {
+			switch(*fp) {
+			case 'F':
+				call_delim = "|";
+				break;
+			case 'A':
+				call_delim = ",";
+				break;
+			default:
+				break;
+			}
+		}
+	}
+	
+	domain = strchr(group_name, '@');
+	
+	if (domain) {
+		*domain++ = '\0';
+	} else {
+		domain = switch_core_get_variable("domain");
+	}
+	
+	if (!switch_strlen_zero(domain)) {
+		switch_xml_t xml, x_domain, x_group;
+		switch_event_t *params;
+		switch_stream_handle_t dstream = { 0 };
+
+		SWITCH_STANDARD_STREAM(dstream);
+
+		switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
+		switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "group", group_name);
+		switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "domain", domain);
+		switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "action", "group_call");
+		
+		if (switch_xml_locate_group(group_name, domain, &xml, &x_domain, &x_group, params) == SWITCH_STATUS_SUCCESS) {
+			switch_xml_t x_user, x_users, x_param, x_params;
+			
+			if ((x_users = switch_xml_child(x_group, "users"))) {
+				ok++;
+				
+				for(x_user = switch_xml_child(x_users, "user"); x_user; x_user = x_user->next) {
+					const char *id = switch_xml_attr_soft(x_user, "id");
+					const char *dest = NULL;
+					char *d_dest = NULL;
+					
+					if ((x_params = switch_xml_child(x_domain, "params"))) {
+						for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
+							const char *var = switch_xml_attr(x_param, "name");
+							const char *val = switch_xml_attr(x_param, "value");
+
+							if (!strcasecmp(var, "group-dial-string")) {
+								dest = val;
+								break;
+							}
+
+							if (!strcasecmp(var, "dial-string")) {
+								dest = val;
+							}
+						}
+					}
+
+					if ((x_params = switch_xml_child(x_group, "params"))) {
+						for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
+							const char *var = switch_xml_attr(x_param, "name");
+							const char *val = switch_xml_attr(x_param, "value");
+
+							if (!strcasecmp(var, "group-dial-string")) {
+								dest = val;
+								break;
+							}
+
+							if (!strcasecmp(var, "dial-string")) {
+								dest = val;
+							}
+						}
+					}
+
+					if ((x_params = switch_xml_child(x_user, "params"))) {
+						for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
+							const char *var = switch_xml_attr(x_param, "name");
+							const char *val = switch_xml_attr(x_param, "value");
+							
+							if (!strcasecmp(var, "group-dial-string")) {
+								dest = val;
+								break;
+							}
+
+							if (!strcasecmp(var, "dial-string")) {
+								dest = val;
+							}
+						}
+					}
+					
+					if (dest) {
+						if (channel) {
+							switch_channel_set_variable(channel, "dialed_group", group_name);
+							switch_channel_set_variable(channel, "dialed_user", id);
+							switch_channel_set_variable(channel, "dialed_domain", domain);
+							d_dest = switch_channel_expand_variables(channel, dest);
+						} else {
+							switch_event_del_header(params, "dialed_user");
+							switch_event_del_header(params, "dialed_group");
+							switch_event_del_header(params, "dialed_domain");
+							switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "dialed_user", id);
+							switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "dialed_group", group_name);
+							switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "dialed_domain", domain);
+							d_dest = switch_event_expand_headers(params, dest);
+						}
+					} else {
+						d_dest = switch_mprintf("user/%s@%s", id, domain);
+					}
+					
+					if (d_dest) {
+						if (!switch_stristr("error/", d_dest)) {
+							dstream.write_function(&dstream, "%s%s", d_dest, call_delim);
+						}
+					
+						if (d_dest != dest) {
+							free(d_dest);
+						}
+					}
+				}
+
+				if (ok && dstream.data) {
+					char *data = (char *) dstream.data;
+					char c = end_of(data);
+					char *p;
+
+					if (c == ',' || c == '|') {
+						end_of(data) = '\0';
+					}
+					
+					for (p = data; p && *p; p++) {
+						if (*p == '{') {
+							*p = '[';
+						} else if (*p == '}') {
+							*p = ']';
+						}
+					}
+
+
+					stream->write_function(stream, "%s", data);
+					free(dstream.data);
+				} else {
+					ok = 0;
+				}
+				
+			}
+			switch_xml_free(xml);
+		}
+		switch_event_destroy(&params);
+	}
+
+ end:
+
+	switch_safe_free(group_name);
+	
+	if (!ok) {
+		stream->write_function(stream, "error/NO_ROUTE_DESTINATION");
+	}
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+SWITCH_STANDARD_API(in_group_function)
+{
+	switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group;
+	int argc;
+	char *mydata = NULL, *argv[2], *user, *domain;
+	char delim = ',';
+	switch_event_t *params = NULL;
+	const char *rval = "false";
+	char *group;
+	
+	if (switch_strlen_zero(cmd) || !(mydata = strdup(cmd))) {
+		goto end;
+	}
+
+	if ((argc = switch_separate_string(mydata, delim, argv, (sizeof(argv) / sizeof(argv[0])))) < 2) {
+		goto end;
+	}
+
+	user = argv[0];
+	group = argv[1];
+
+	if ((domain = strchr(user, '@'))) {
+		*domain++ = '\0';
+	} else {
+		domain = switch_core_get_variable("domain");
+	}
+
+	switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
+	switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "user", user);
+	switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "domain", domain);
+
+	if (switch_xml_locate_group(group, domain, &xml, &x_domain, &x_group, params) == SWITCH_STATUS_SUCCESS) {
+		switch_xml_t x_users;
+		if ((x_users = switch_xml_child(x_group, "users"))) {
+			if ((x_user = switch_xml_find_child(x_users, "user", "id", user))) {
+				rval = "true";
+			}
+		}
+	}
+
+  end:
+	
+	stream->write_function(stream, "%s", rval);
+	
+	switch_xml_free(xml);
+	free(mydata);
+	switch_event_destroy(&params);
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
 SWITCH_STANDARD_API(user_data_function)
 {
 	switch_xml_t x_domain, xml = NULL, x_user = NULL, x_param, x_params;
@@ -111,7 +350,7 @@
 	switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "type", type);
 	switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "key", key);
 
-	if (key && type && switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, params) == SWITCH_STATUS_SUCCESS) {
+	if (key && type && switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, NULL, params) == SWITCH_STATUS_SUCCESS) {
 		if (!strcmp(type, "attr")) {
 			const char *attr = switch_xml_attr_soft(x_user, key);
 			stream->write_function(stream, "%s", attr);
@@ -201,7 +440,7 @@
 		goto end;
 	}
 
-	if (switch_xml_locate_user(key, user, domain, NULL, &xml, &x_domain, &x_user, NULL) != SWITCH_STATUS_SUCCESS) {
+	if (switch_xml_locate_user(key, user, domain, NULL, &xml, &x_domain, &x_user, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
 		err = "can't find user";
 		goto end;
 	}
@@ -2940,6 +3179,9 @@
 	switch_api_interface_t *commands_api_interface;
 	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
 
+	SWITCH_ADD_API(commands_api_interface, "group_call", "Generate a dial string to call a group", group_call_function, "<group>[@<domain>]");
+	SWITCH_ADD_API(commands_api_interface, "in_group", "determine if a user is in a group", in_group_function, "<user>[@<domain>] <group_name>");
+
 	SWITCH_ADD_API(commands_api_interface, "uuid_flush_dtmf", "Flush dtmf on a given uuid", uuid_flush_dtmf_function, "<uuid>");
 	SWITCH_ADD_API(commands_api_interface, "md5", "md5", md5_function, "<data>");
 	SWITCH_ADD_API(commands_api_interface, "hupall", "hupall", hupall_api_function, "<cause> [<var> <value>]");

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_conference/mod_conference.c	Wed Jan  7 10:17:00 2009
@@ -264,6 +264,7 @@
 	int comfort_noise_level;
 	int video_running;
 	uint32_t eflags;
+	uint32_t verbose_events;
 } conference_obj_t;
 
 /* Relationship with another member */
@@ -308,6 +309,7 @@
 	switch_ivr_digit_stream_t *digit_stream;
 	switch_speech_handle_t lsh;
 	switch_speech_handle_t *sh;
+	uint32_t verbose_events;
 	struct conference_member *next;
 };
 
@@ -401,15 +403,21 @@
 	if (!member)
 		return status;
 
-	if (member->session) {
-		switch_channel_t *channel = switch_core_session_get_channel(member->session);
-		switch_channel_event_set_data(channel, event);
-	}
-
 	if (member->conference) {
 		status = conference_add_event_data(member->conference, event);
 	}
 
+	if (member->session) {
+		switch_channel_t *channel = switch_core_session_get_channel(member->session);
+		
+		if (member->verbose_events) {
+			switch_channel_event_set_data(channel, event);
+		} else {
+			switch_channel_event_set_basic_data(channel, event);
+		}
+		
+	}
+
 	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 
 	return status;
@@ -572,6 +580,7 @@
 	member->conference = conference;
 	member->next = conference->members;
 	member->energy_level = conference->energy_level;
+	member->verbose_events = conference->verbose_events;
 	conference->members = member;
 	switch_set_flag(member, MFLAG_INTREE);
 	switch_mutex_unlock(conference->member_mutex);
@@ -1543,6 +1552,13 @@
 	   and mux it with any audio from other channels. */
 
 	while (switch_test_flag(member, MFLAG_RUNNING) && switch_channel_ready(channel)) {
+
+		if (switch_channel_test_flag(channel, CF_SERVICE)) {
+			switch_yield(100000);
+			continue;
+		}
+
+
 		/* Read a frame. */
 		status = switch_core_session_read_frame(member->session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
 
@@ -1790,8 +1806,9 @@
 		const char *toval = switch_channel_get_variable(channel, "conference_auto_outcall_timeout");
 		const char *flags = switch_channel_get_variable(channel, "conference_auto_outcall_flags");
 		const char *ann = switch_channel_get_variable(channel, "conference_auto_outcall_announce");
+		const char *prefix = switch_channel_get_variable(channel, "conference_auto_outcall_prefix");
 		int to = 60;
-
+		
 		if (ann) {
 			member->conference->special_announce = switch_core_strdup(member->conference->pool, ann);
 		}
@@ -1806,7 +1823,20 @@
 		}
 
 		for (cp = call_list; cp; cp = cp->next) {
-			conference_outcall_bg(member->conference, NULL, NULL, cp->string, to, switch_str_nil(flags), cid_name, cid_num);
+			int argc;
+			char *argv[512] = { 0 };
+			char *cpstr = strdup(cp->string);
+			int x = 0;
+
+			switch_assert(cpstr);
+			argc = switch_separate_string(cpstr, ',', argv, (sizeof(argv) / sizeof(argv[0])));
+			for (x = 0; x < argc; x++) {
+				char *dial_str = switch_mprintf("%s%s", switch_str_nil(prefix), argv[x]);
+				switch_assert(dial_str);
+				conference_outcall_bg(member->conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num);
+				switch_safe_free(dial_str);
+			}
+			switch_safe_free(cpstr);
 		}
 	}
 	/* Fair WARNING, If you expect the caller to hear anything or for digit handling to be processed,      */
@@ -2014,9 +2044,18 @@
 			}
 			switch_clear_flag_locked(member, MFLAG_FLUSH_BUFFER);
 		}
-
+		
 		switch_mutex_unlock(member->flag_mutex);
 
+
+		if (switch_core_session_private_event_count(member->session)) {
+			switch_channel_set_flag(channel, CF_SERVICE);
+			switch_ivr_parse_all_events(member->session);
+			switch_channel_clear_flag(channel, CF_SERVICE);
+			switch_set_flag_locked(member, MFLAG_FLUSH_BUFFER);
+			switch_core_session_set_read_codec(member->session, &member->read_codec);
+		}
+		
 		if (use_timer) {
 			switch_core_timer_next(&timer);
 		} else {
@@ -3024,6 +3063,140 @@
 	return ret_status;
 }
 
+
+static void add_x_tag(switch_xml_t x_member, const char *name, const char *value, int off)
+{
+	switch_size_t dlen = strlen(value) * 3;
+	char *data;
+	switch_xml_t x_tag;
+
+	x_tag = switch_xml_add_child_d(x_member, name, off);
+	switch_assert(x_tag);
+	
+	switch_zmalloc(data, dlen);
+
+	switch_url_encode(value, data, dlen);
+	switch_xml_set_txt_d(x_tag, data);
+	free(data);
+}
+
+static void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off)
+{
+	conference_member_t *member = NULL;
+	switch_xml_t x_member = NULL, x_members = NULL, x_flags;
+	int moff = 0;
+	char i[30] = "";
+	char *ival = i;
+	switch_assert(conference != NULL);
+	switch_assert(x_conference != NULL);
+	
+	switch_xml_set_attr_d(x_conference, "name", conference->name);
+	switch_snprintf(i, sizeof(i), "%d", conference->count);
+	switch_xml_set_attr_d(x_conference, "member-count", ival);
+
+	if (switch_test_flag(conference, CFLAG_LOCKED)) {
+		switch_xml_set_attr_d(x_conference, "locked", "true");
+	}
+
+	x_members = switch_xml_add_child_d(x_conference, "members", 0);
+	switch_assert(x_members);
+	
+	switch_mutex_lock(conference->member_mutex);
+
+	for (member = conference->members; member; member = member->next) {
+		switch_channel_t *channel;
+		switch_caller_profile_t *profile;
+		char *uuid;
+		char *name;
+		uint32_t count = 0;
+		switch_xml_t x_tag;
+		int toff = 0;
+		
+		if (switch_test_flag(member, MFLAG_NOCHANNEL)) {
+			continue;
+		}
+
+		uuid = switch_core_session_get_uuid(member->session);
+		channel = switch_core_session_get_channel(member->session);
+		profile = switch_channel_get_caller_profile(channel);
+		name = switch_channel_get_name(channel);
+
+		
+		x_member = switch_xml_add_child_d(x_members, "member", moff++);
+		switch_assert(x_member);
+
+		switch_snprintf(i, sizeof(i), "%d", member->id);
+
+		add_x_tag(x_member, "id", i, toff++);
+		add_x_tag(x_member, "uuid", uuid, toff++);
+		add_x_tag(x_member, "caller_id_name", profile->caller_id_name, toff++);
+		add_x_tag(x_member, "caller_id_number", profile->caller_id_number, toff++);
+		
+
+		x_flags = switch_xml_add_child_d(x_member, "flags", count++);
+		switch_assert(x_flags);
+
+		x_tag = switch_xml_add_child_d(x_flags, "can_hear", count++);
+		switch_xml_set_txt_d(x_tag, switch_test_flag(member, MFLAG_CAN_HEAR) ? "true" : "false");
+
+		x_tag = switch_xml_add_child_d(x_flags, "can_speak", count++);
+		switch_xml_set_txt_d(x_tag, switch_test_flag(member, MFLAG_CAN_SPEAK) ? "true" : "false");
+
+		x_tag = switch_xml_add_child_d(x_flags, "talking", count++);
+		switch_xml_set_txt_d(x_tag, switch_test_flag(member, MFLAG_TALKING) ? "true" : "false");
+
+		x_tag = switch_xml_add_child_d(x_flags, "has_video", count++);
+		switch_xml_set_txt_d(x_tag, switch_channel_test_flag(switch_core_session_get_channel(member->session), CF_VIDEO) ? "true" : "false");
+		
+		x_tag = switch_xml_add_child_d(x_flags, "has_floor", count++);
+		switch_xml_set_txt_d(x_tag, (member == member->conference->floor_holder) ? "true" : "false");
+		
+	}
+
+	switch_mutex_unlock(conference->member_mutex);
+}
+static switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
+{
+	int count = 0;
+	switch_hash_index_t *hi;
+	void *val;
+	switch_xml_t x_conference, x_conferences;
+	int off = 0;
+	char *ebuf;
+
+	x_conferences = switch_xml_new("conferences");
+	switch_assert(x_conferences);
+	
+	if (conference == NULL) {
+		for (hi = switch_hash_first(NULL, globals.conference_hash); hi; hi = switch_hash_next(hi)) {
+			switch_hash_this(hi, NULL, NULL, &val);
+			conference = (conference_obj_t *) val;
+			
+			x_conference = switch_xml_add_child_d(x_conferences, "conference", off++);
+			switch_assert(conference);
+
+			count++;
+			conference_xlist(conference, x_conference, off);
+
+		}
+	} else {
+		x_conference = switch_xml_add_child_d(x_conferences, "conference", off++);
+		switch_assert(conference);
+		count++;
+		conference_xlist(conference, x_conference, off);
+	}
+
+
+	ebuf = switch_xml_toxml(x_conferences, SWITCH_TRUE);
+
+	stream->write_function(stream, "%s", ebuf);
+
+	switch_xml_free(x_conferences);
+	free(ebuf);
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
 static switch_status_t conf_api_sub_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
 {
 	int ret_status = SWITCH_STATUS_GENERR;
@@ -3564,6 +3737,7 @@
 /* Entries in this list should be kept in sync with the enum above */
 static api_command_t conf_api_sub_commands[] = {
 	{"list", (void_fn_t) &conf_api_sub_list, CONF_API_SUB_ARGS_SPLIT, "<confname> list [delim <string>]"},
+	{"xml_list", (void_fn_t) &conf_api_sub_xml_list, CONF_API_SUB_ARGS_SPLIT, "<confname> xml_list"},
 	{"energy", (void_fn_t) &conf_api_sub_energy, CONF_API_SUB_MEMBER_TARGET,
 	 "<confname> energy <member_id|all|last> [<newval>]"},
 	{"volume_in", (void_fn_t) &conf_api_sub_volume_in, CONF_API_SUB_MEMBER_TARGET,
@@ -3764,6 +3938,8 @@
 			/* special case the list command, because it doesn't require a conference argument */
 			if (strcasecmp(argv[0], "list") == 0) {
 				conf_api_sub_list(NULL, stream, argc, argv);
+			} else if (strcasecmp(argv[0], "xml_list") == 0) {
+				conf_api_sub_xml_list(NULL, stream, argc, argv);
 			} else if (strcasecmp(argv[0], "help") == 0 || strcasecmp(argv[0], "commands") == 0) {
 				stream->write_function(stream, "%s\n", api_syntax);
 			} else if (argv[1] && strcasecmp(argv[1], "dial") == 0) {
@@ -3881,7 +4057,7 @@
 			goto done;
 		}
 		/* add them to the conference */
-		if (flags && !strcasecmp(flags, "none")) {
+		if (flags && strcasecmp(flags, "none")) {
 			switch_snprintf(appdata, sizeof(appdata), "%s+flags{%s}", conference_name, flags);
 			switch_caller_extension_add_application(peer_session, extension, (char *) global_app_name, appdata);
 		} else {
@@ -4059,15 +4235,20 @@
 	if (flags) {
 		if (strstr(flags, "mute")) {
 			*f &= ~MFLAG_CAN_SPEAK;
-		} else if (strstr(flags, "deaf")) {
+		}
+
+		if (strstr(flags, "deaf")) {
 			*f &= ~MFLAG_CAN_HEAR;
-		} else if (strstr(flags, "waste")) {
+		}
+
+		if (strstr(flags, "waste")) {
 			*f |= MFLAG_WASTE_BANDWIDTH;
-		} else if (strstr(flags, "endconf")) {
+		}
+
+		if (strstr(flags, "endconf")) {
 			*f |= MFLAG_ENDCONF;
 		}
 	}
-
 }
 
 static void clear_eflags(char *events, uint32_t *f)
@@ -4862,6 +5043,7 @@
 	switch_status_t status;
 	int comfort_noise_level = 0;
 	char *suppress_events = NULL;
+	char *verbose_events = NULL;
 	char *auto_record = NULL;
 
 	/* Validate the conference name */
@@ -4981,6 +5163,8 @@
 			}
 		} else if (!strcasecmp(var, "suppress-events") && !switch_strlen_zero(val)) {
 			suppress_events = val;
+		} else if (!strcasecmp(var, "verbose-events") && !switch_strlen_zero(val)) {
+			verbose_events = val;
 		} else if (!strcasecmp(var, "auto-record") && !switch_strlen_zero(val)) {
 			auto_record = val;
 		}
@@ -5140,6 +5324,10 @@
 	if (!switch_strlen_zero(auto_record)) {
 		conference->auto_record = switch_core_strdup(conference->pool, auto_record);
 	}
+
+	if (!switch_strlen_zero(verbose_events) && switch_true(verbose_events)) {
+		conference->verbose_events = 1;
+	}
 	
 	/* caller control configuration chores */
 	if (switch_ivr_digit_stream_parser_new(conference->pool, &conference->dtmf_parser) == SWITCH_STATUS_SUCCESS) {

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_dptools/mod_dptools.c	Wed Jan  7 10:17:00 2009
@@ -148,7 +148,21 @@
 	}
 }
 
-#define BIND_SYNTAX "<key> [a|b|ab] [a|b|o|s] <app>"
+#define UNBIND_SYNTAX "[<key>]"
+SWITCH_STANDARD_APP(dtmf_unbind_function)
+{
+	char *key = (char *) data;
+	int kval = 0;
+
+	if (key) {
+		kval = atoi(key);
+	}
+
+	switch_ivr_unbind_dtmf_meta_session(session, kval);
+
+}
+
+#define BIND_SYNTAX "<key> [a|b|ab] [a|b|o|s|1] <app>"
 SWITCH_STANDARD_APP(dtmf_bind_function)
 {
 	char *argv[4] = { 0 };
@@ -208,6 +222,10 @@
 			}
 		}
 
+		if (strchr(argv[2], '1')) {
+			bind_flags |= SBF_ONCE;
+		}
+		
 		if (switch_ivr_bind_dtmf_meta_session(session, kval, bind_flags, argv[3]) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Bind Error!\n");
 		}
@@ -2002,6 +2020,108 @@
 	return cause;
 }
 
+
+/* fake chan_group */
+switch_endpoint_interface_t *group_endpoint_interface;
+static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session,
+												 switch_event_t *var_event,
+												 switch_caller_profile_t *outbound_profile,
+												 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
+switch_io_routines_t group_io_routines = {
+	/*.outgoing_channel */ group_outgoing_channel
+};
+
+static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session,
+												 switch_event_t *var_event,
+												 switch_caller_profile_t *outbound_profile,
+												 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
+{
+	char *group;
+	switch_call_cause_t cause = SWITCH_CAUSE_NONE;
+	char *template = NULL, *dest = NULL;
+	switch_originate_flag_t myflags = SOF_NONE;
+	char *cid_name_override = NULL;
+	char *cid_num_override = NULL;
+	const char *var;
+	unsigned int timelimit = 60;
+	char *domain = NULL;
+	switch_channel_t *new_channel = NULL;
+
+	group = strdup(outbound_profile->destination_number);
+
+	if (!group) goto done;
+	
+	if ((domain = strchr(group, '@'))) {
+		*domain++ = '\0';
+	} else {
+		domain = switch_core_get_variable("domain");
+	}
+	
+	if (!domain) {
+		goto done;
+	}
+
+	template = switch_mprintf("${group_call(%s@%s)}", group, domain);
+	
+	if (session) {
+		switch_channel_t *channel = switch_core_session_get_channel(session);
+		dest = switch_channel_expand_variables(channel, template);
+		if ((var = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE))) {
+			timelimit = atoi(var);
+		}
+	} else if (var_event) {
+		dest = switch_event_expand_headers(var_event, template);
+	}
+	if (!dest) {
+		goto done;
+	}
+	
+	if (var_event) {
+		cid_name_override = switch_event_get_header(var_event, "origination_caller_id_name");
+		cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number");
+		if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE))) {
+			timelimit = atoi(var);
+		}
+	}
+	
+	if ((flags & SOF_FORKED_DIAL)) {
+		myflags |= SOF_NOBLOCK;
+	}
+	
+	
+	if (switch_ivr_originate(session, new_session, &cause, dest, timelimit, NULL, 
+							 cid_name_override, cid_num_override, NULL, var_event, myflags) == SWITCH_STATUS_SUCCESS) {
+		const char *context;
+		switch_caller_profile_t *cp;
+		
+		new_channel = switch_core_session_get_channel(*new_session);
+		
+		if ((context = switch_channel_get_variable(new_channel, "group_context"))) {
+			if ((cp = switch_channel_get_caller_profile(new_channel))) {
+				cp->context = switch_core_strdup(cp->pool, context);
+			}
+		}
+		switch_core_session_rwunlock(*new_session);
+	}
+
+
+ done:
+
+	if (dest && dest != template) {
+		switch_safe_free(dest);
+	}
+	
+	switch_safe_free(template);	
+
+	if (cause == SWITCH_CAUSE_NONE) {
+		cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
+	}
+
+	return cause;
+}
+
+
+
 /* fake chan_user */
 switch_endpoint_interface_t *user_endpoint_interface;
 static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
@@ -2017,7 +2137,7 @@
 												 switch_caller_profile_t *outbound_profile,
 												 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
 {
-	switch_xml_t x_domain = NULL, xml = NULL, x_user = NULL, x_param, x_params;
+	switch_xml_t x_domain = NULL, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params;
 	char *user = NULL, *domain = NULL;
 	const char *dest = NULL;
 	static switch_call_cause_t cause = SWITCH_CAUSE_NONE;
@@ -2030,20 +2150,24 @@
 
 	user = strdup(outbound_profile->destination_number);
 
-	if (!user)
-		goto done;
+	if (!user) goto done;
 
-	if (!(domain = strchr(user, '@'))) {
+	if ((domain = strchr(user, '@'))) {
+		*domain++ = '\0';
+	} else {
+		domain = switch_core_get_variable("domain");
+	}
+	
+	if (!domain) {
 		goto done;
 	}
-
-	*domain++ = '\0';
+	
 
 	switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
 	switch_assert(params);
 	switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "as_channel", "true");
 
-	if (switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, params) != SWITCH_STATUS_SUCCESS) {
+	if (switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, &x_group, params) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n", user, domain);
 		cause = SWITCH_CAUSE_SUBSCRIBER_ABSENT;
 		goto done;
@@ -2061,6 +2185,18 @@
 		}
 	}
 
+	if ((x_params = switch_xml_child(x_group, "params"))) {
+		for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
+			const char *var = switch_xml_attr(x_param, "name");
+			const char *val = switch_xml_attr(x_param, "value");
+
+			if (!strcasecmp(var, "dial-string")) {
+				dest = val;
+				break;
+			}
+		}
+	}
+
 	if ((x_params = switch_xml_child(x_user, "params"))) {
 		for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
 			const char *var = switch_xml_attr(x_param, "name");
@@ -2107,6 +2243,9 @@
 				switch_event_dup(&event, var_event);
 				switch_event_del_header(event, "dialer_user");
 				switch_event_del_header(event, "dialer_domain");
+				if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE))) {
+					timelimit = atoi(var);
+				}
 			} else {
 				switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS);
 				switch_assert(event);
@@ -2318,6 +2457,10 @@
 	error_endpoint_interface->interface_name = "error";
 	error_endpoint_interface->io_routines = &error_io_routines;
 
+	group_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
+	group_endpoint_interface->interface_name = "group";
+	group_endpoint_interface->io_routines = &group_io_routines;
+
 	user_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
 	user_endpoint_interface->interface_name = "user";
 	user_endpoint_interface->io_routines = &user_io_routines;
@@ -2389,6 +2532,8 @@
 				   SAF_NONE);
 	SWITCH_ADD_APP(app_interface, "bind_meta_app", "Bind a key to an application", "Bind a key to an application", dtmf_bind_function, BIND_SYNTAX,
 				   SAF_SUPPORT_NOMEDIA);
+	SWITCH_ADD_APP(app_interface, "unbind_meta_app", "Unbind a key from an application", "Unbind a key from an application", dtmf_unbind_function, 
+				   UNBIND_SYNTAX, SAF_SUPPORT_NOMEDIA);
 	SWITCH_ADD_APP(app_interface, "intercept", "intercept", "intercept", intercept_function, INTERCEPT_SYNTAX, SAF_NONE);
 	SWITCH_ADD_APP(app_interface, "eavesdrop", "eavesdrop on a uuid", "eavesdrop on a uuid", eavesdrop_function, eavesdrop_SYNTAX, SAF_NONE);
 	SWITCH_ADD_APP(app_interface, "three_way", "three way call with a uuid", "three way call with a uuid", three_way_function, threeway_SYNTAX, SAF_NONE);

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_limit/mod_limit.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_limit/mod_limit.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_limit/mod_limit.c	Wed Jan  7 10:17:00 2009
@@ -285,6 +285,8 @@
 		limit_execute_sql(sql, globals.mutex);
 		switch_safe_free(sql);
 		switch_core_event_hook_remove_state_change(session, db_state_handler);
+		/* Remove limit_realm variable so we register another hook if limit is called again */
+		switch_channel_set_variable(channel, "limit_realm", "");
 	}
 	return SWITCH_STATUS_SUCCESS;
 }
@@ -298,7 +300,7 @@
 	/* The call is either hung up, or is going back into the dialplan, decrement appropriate couters */
 	if (state == CS_HANGUP || state == CS_ROUTING) {	
 		switch_hash_index_t *hi;
-		switch_mutex_lock(globals.mutex);
+		switch_mutex_lock(globals.limit_hash_mutex);
 
 		/* Loop through the channel's hashtable which contains mapping to all the limit_hash_item_t referenced by that channel */
 		for(hi = switch_hash_first(NULL, channel_hash); hi; hi = switch_hash_next(hi))
@@ -317,7 +319,7 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Usage for %s is now %d\n", (const char*)key, item->total_usage);	
 		}
 		switch_core_event_hook_remove_state_change(session, hash_state_handler);
-		switch_mutex_unlock(globals.mutex);
+		switch_mutex_unlock(globals.limit_hash_mutex);
 	}
 	
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/applications/mod_voicemail/mod_voicemail.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/applications/mod_voicemail/mod_voicemail.c	Wed Jan  7 10:17:00 2009
@@ -1888,7 +1888,7 @@
 					switch_channel_event_set_data(channel, params);
 					
 					if (switch_xml_locate_user("id", myid, domain_name, switch_channel_get_variable(channel, "network_addr"),
-											   &xx_domain_root, &xx_domain, &xx_user, params) == SWITCH_STATUS_SUCCESS) {
+											   &xx_domain_root, &xx_domain, &xx_user, NULL, params) == SWITCH_STATUS_SUCCESS) {
 						switch_xml_free(xx_domain_root);
 					}
 
@@ -1981,7 +1981,7 @@
 					
 					
 					if (switch_xml_locate_user("id", myid, domain_name, switch_channel_get_variable(channel, "network_addr"),
-											   &x_domain_root, &x_domain, &x_user, params) != SWITCH_STATUS_SUCCESS) {
+											   &x_domain_root, &x_domain, &x_user, NULL, params) != SWITCH_STATUS_SUCCESS) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n", myid, domain_name);
 						ok = 0;
 					}
@@ -2261,7 +2261,9 @@
 		}
 		/*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send mail is %d, var is %s\n", send_mail, var);*/
 	}
-    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send mail is %d and that's my final answer\n", send_mail);
+
+    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deliver VM to %s@%s\n", myid, domain_name);
+
 	if (!switch_strlen_zero(vm_storage_dir)) {
 		dir_path = switch_mprintf("%s%s%s", vm_storage_dir, SWITCH_PATH_SEPARATOR, myid);
 	} else if (!switch_strlen_zero(profile->storage_dir)) {
@@ -2507,7 +2509,7 @@
 	vm_profile_t *profile;
 	char *dup = NULL, *user = NULL, *domain = NULL;
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
-	int istag = 0, isall = 0;
+	int isgroup = 0, isall = 0;
 	int argc = 0;
 	char *argv[4];
 	char *box, *path, *cid_num, *cid_name;
@@ -2540,9 +2542,9 @@
 		domain = user;
 	}
 
-	if (switch_stristr("tag=", user)) {
-		user += 4;
-		istag++;
+	if (switch_stristr("group=", user)) {
+		user += 6;
+		isgroup++;
 	} else if (user == domain) {
 		isall++;
 	}
@@ -2567,6 +2569,17 @@
 
 		switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
 		switch_assert(my_params);
+
+		if (isgroup) {
+			switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "group", user);
+		} else {
+			if (isall) {
+				switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "user", "_all_");
+			} else {
+				switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "user", user);
+			}
+		}
+
 		switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "domain", domain);
 		switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "purpose", "publish-vm");
 		
@@ -2581,24 +2594,66 @@
 
 		switch_core_new_memory_pool(&pool);
 		
-		if (!isall && !istag) {
-			if ((ut = switch_xml_find_child(x_domain, "user", "id", user))) {
+		
+		if (isgroup) {
+			switch_xml_t group = NULL, groups = NULL, users = NULL;
+			if ((groups = switch_xml_child(x_domain, "groups"))) {
+				if ((group = switch_xml_find_child_multi(groups, "group", "name", user, NULL))) {
+					if ((users = switch_xml_child(group, "users"))) {
+						for (ut = switch_xml_child(users, "user"); ut; ut = ut->next) {
+							const char *type = switch_xml_attr_soft(ut, "type");
+							
+							if (!strcasecmp(type, "pointer")) {
+								const char *uname = switch_xml_attr_soft(ut, "id");
+								switch_xml_t ux;
+
+								if (switch_xml_locate_user_in_domain(uname, x_domain, &ux, NULL) == SWITCH_STATUS_SUCCESS) {
+									switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
+									status = deliver_vm(profile, ux, domain, path, 0, "B", my_params, pool, cid_name, cid_num, SWITCH_TRUE);
+									switch_event_destroy(&my_params);
+								}
+								continue;
+							}
+							
+							switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
+							status = deliver_vm(profile, ut, domain, path, 0, "B", my_params, pool, cid_name, cid_num, SWITCH_TRUE);
+							switch_event_destroy(&my_params);
+						}
+					}
+				} else {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate group %s\n", user);
+				}
+			}
+		} else if (isall) {
+			switch_xml_t group = NULL, groups = NULL, users = NULL;
+			if ((groups = switch_xml_child(x_domain, "groups"))) {
+				for (group = switch_xml_child(groups, "group"); group; group = group->next) {
+					if ((users = switch_xml_child(group, "users"))) {
+						for (ut = switch_xml_child(users, "user"); ut; ut = ut->next) {
+							const char *type = switch_xml_attr_soft(ut, "type");
+							
+							if (!strcasecmp(type, "pointer")) {
+								continue;
+							}
+
+							switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
+							status = deliver_vm(profile, ut, domain, path, 0, "B", my_params, pool, cid_name, cid_num, SWITCH_TRUE);
+							switch_event_destroy(&my_params);
+						}
+					}
+				}
+			}
+			
+		} else {
+			switch_xml_t x_group = NULL;
+
+			if ((status = switch_xml_locate_user_in_domain(user, x_domain, &ut, &x_group)) == SWITCH_STATUS_SUCCESS) {
 				switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
 				status = deliver_vm(profile, ut, domain, path, 0, "B", my_params, pool, cid_name, cid_num, SWITCH_TRUE);
 				switch_event_destroy(&my_params);
 			} else {
 				status = SWITCH_STATUS_FALSE;
 			}
-		} else {
-			for (ut = switch_xml_child(x_domain, "user"); ut; ut = ut->next) {
-				const char *tag;
-
-				if (isall || (istag && (tag=switch_xml_attr(ut, "vm-tag")) && !strcasecmp(tag, user))) {
-					switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
-					status = deliver_vm(profile, ut, domain, path, 0, "B", my_params, pool, cid_name, cid_num, SWITCH_TRUE);
-					switch_event_destroy(&my_params);
-				}
-			}
 		}
 		
 		switch_core_destroy_memory_pool(&pool);
@@ -2679,7 +2734,7 @@
 		switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", id);
 
 		if (switch_xml_locate_user("id", id, domain_name, switch_channel_get_variable(channel, "network_addr"),
-								   &x_domain_root, &x_domain, &x_user, params) == SWITCH_STATUS_SUCCESS) {
+								   &x_domain_root, &x_domain, &x_user, NULL, params) == SWITCH_STATUS_SUCCESS) {
 			if ((x_params = switch_xml_child(x_user, "params"))) {
 				for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
 					const char *var = switch_xml_attr_soft(x_param, "name");
@@ -3562,7 +3617,7 @@
 	}
 }
 
-#define VM_INJECT_USAGE "[tag=]<box> <sound_file> [<cid_num>] [<cid_name>]"
+#define VM_INJECT_USAGE "[group=]<box> <sound_file> [<cid_num>] [<cid_name>]"
 SWITCH_STANDARD_API(voicemail_inject_api_function)
 {
 	if (voicemail_inject(cmd) == SWITCH_STATUS_SUCCESS) {

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_iax/mod_iax.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_iax/mod_iax.c	Wed Jan  7 10:17:00 2009
@@ -496,6 +496,7 @@
 
 	switch_clear_flag_locked(tech_pvt, TFLAG_IO);
 	switch_clear_flag_locked(tech_pvt, TFLAG_VOICE);
+	switch_clear_flag_locked(tech_pvt, TFLAG_CODEC);
 
 	if (tech_pvt->read_codec.implementation) {
 		switch_core_codec_destroy(&tech_pvt->read_codec);
@@ -1079,17 +1080,16 @@
 			case IAX_EVENT_VOICE:
 				if (tech_pvt && (tech_pvt->read_frame.datalen = iaxevent->datalen) != 0) {
 					if (channel && switch_channel_get_state(channel) <= CS_HANGUP) {
-						int bytes, frames;
+						int bytes = 0, frames = 1;
 
-						if (!switch_test_flag(tech_pvt, TFLAG_CODEC)) {
+						if (!switch_test_flag(tech_pvt, TFLAG_CODEC) || !tech_pvt->read_codec.implementation) {
+							switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
 							break;
 						}
-
+						
 						if (tech_pvt->read_codec.implementation->encoded_bytes_per_packet) {
 							bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_packet;
 							frames = (int) (tech_pvt->read_frame.datalen / bytes);
-						} else {
-							frames = 1;
 						}
 
 						tech_pvt->read_frame.samples = frames * tech_pvt->read_codec.implementation->samples_per_packet;

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.c	Wed Jan  7 10:17:00 2009
@@ -734,7 +734,8 @@
 									const char *val;
 									int rtp_timeout_sec = 0;
 									int rtp_hold_timeout_sec = 0;
-									
+								
+									tech_pvt->read_frame.datalen = 0;
 									tech_pvt->codec_ms = codec_ms;
 									switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, 
 													  "Changing codec ptime to %d. I bet you have a linksys/sipura =D\n", tech_pvt->codec_ms);
@@ -809,6 +810,10 @@
 						frames = (tech_pvt->read_frame.datalen / bytes);
 					}
 					tech_pvt->read_frame.samples = (int) (frames * tech_pvt->read_codec.implementation->samples_per_packet);
+
+					if (tech_pvt->read_frame.datalen == 0) {
+						continue;
+					}
 				}
 				break;
 			}
@@ -1054,13 +1059,30 @@
 
 	case SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT:
 		{
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending media re-direct:\n%s\n", msg->string_arg);
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Sending media re-direct:\n%s\n", 
+							  switch_channel_get_name(channel), msg->string_arg);
 			tech_pvt->local_sdp_str = switch_core_session_strdup(session, msg->string_arg);
 			switch_set_flag_locked(tech_pvt, TFLAG_SENT_UPDATE);
 			sofia_glue_do_invite(session);
 		}
 		break;
 
+
+	case SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA:
+		{
+			switch_t38_options_t *t38_options = (switch_t38_options_t *) msg->pointer_arg;
+
+			sofia_glue_set_image_sdp(tech_pvt, t38_options);
+
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Sending request for image media. %s\n", 
+							  switch_channel_get_name(channel), tech_pvt->local_sdp_str);
+							  
+			
+			switch_set_flag_locked(tech_pvt, TFLAG_SENT_UPDATE);
+			sofia_glue_do_invite(session);
+		}
+		break;
+
 	case SWITCH_MESSAGE_INDICATE_MEDIA:
 		{
 			uint32_t send_invite = 1;
@@ -2294,6 +2316,7 @@
 	private_object_t *tech_pvt = NULL;
 	switch_channel_t *nchannel;
 	char *host = NULL, *dest_to = NULL;
+	const char *hval = NULL;
 
 	*new_session = NULL;
 
@@ -2498,9 +2521,20 @@
 	*new_session = nsession;
 	cause = SWITCH_CAUSE_SUCCESS;
 
+	if ((hval = switch_event_get_header(var_event, "sip_auto_answer")) && switch_true(hval)) {
+		switch_channel_set_variable_printf(nchannel, "sip_h_Call-Info", "<sip:%s>;answer-after=0", profile->sipip);
+		switch_channel_set_variable(nchannel, "sip_invite_params", "intercom=true");
+	}
+
 	if (session) {
 		switch_channel_t *o_channel = switch_core_session_get_channel(session);
+		const char *vval = NULL;
 
+		if ((vval = switch_channel_get_variable(o_channel, "sip_auto_answer")) && switch_true(vval)) {
+			switch_channel_set_variable_printf(nchannel, "sip_h_Call-Info", "<sip:%s>;answer-after=0", profile->sipip);
+			switch_channel_set_variable(nchannel, "sip_invite_params", "intercom=true");
+		}
+		
 		switch_ivr_transfer_variable(session, nsession, SOFIA_REPLACES_HEADER);
 		switch_ivr_transfer_variable(session, nsession, "sip_auto_answer");
 		switch_ivr_transfer_variable(session, nsession, SOFIA_SIP_HEADER_PREFIX_T);

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.h	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.h	Wed Jan  7 10:17:00 2009
@@ -208,7 +208,7 @@
 	TFLAG_NOHUP = (1 << 18),
 	TFLAG_NOSDP_REINVITE = (1 << 19),
 	TFLAG_NAT = (1 << 20),
-	TFLAG_BUGGY_2833 = (1 << 21),
+	TFLAG_USEME = (1 << 21),
 	TFLAG_SIP_HOLD = (1 << 22),
 	TFLAG_INB_NOMEDIA = (1 << 23),
 	TFLAG_LATE_NEGOTIATION = (1 << 24),
@@ -552,6 +552,7 @@
 	uint32_t mismatch_count;
 	uint32_t last_codec_ms;
 	nua_event_t want_event;
+	switch_rtp_bug_flag_t rtp_bugs;
 };
 
 struct callback_t {
@@ -760,3 +761,4 @@
 const char * sofia_state_string(int state);
 switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force);
 void sofia_wait_for_reply(struct private_object *tech_pvt, nua_event_t event, uint32_t timeout);
+void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *t38_options);

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia.c	Wed Jan  7 10:17:00 2009
@@ -1186,12 +1186,25 @@
 	}
 
 	if (switch_true(parse)) {
-		switch_xml_t ut, gateways_tag;
+		switch_xml_t gts, gt, uts, ut, gateways_tag;
+		/* Backwards Compatibility */
 		for (ut = switch_xml_child(x_domain_tag, "user"); ut; ut = ut->next) {
 			if (((gateways_tag = switch_xml_child(ut, "gateways")))) {
 				parse_gateways(profile, gateways_tag);
 			}
 		}
+		/* New Method with <groups> tags and users are now inside a <users> tag */
+		for (gts = switch_xml_child(x_domain_tag, "groups"); gts; gts = gts->next) {
+			for (gt = switch_xml_child(gts, "group"); gt; gt = gt->next) {
+				for (uts = switch_xml_child(gt, "users"); uts; uts = uts->next) {
+					for (ut = switch_xml_child(uts, "user"); ut; ut = ut->next) {
+						if (((gateways_tag = switch_xml_child(ut, "gateways")))) {
+							parse_gateways(profile, gateways_tag);
+						}
+					}
+				}
+			}
+		}
 	}
 }
 
@@ -3549,6 +3562,22 @@
 
 				/* print debug info */
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "INFO DTMF(%c)\n", dtmf.digit);
+				
+				if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
+					const char *uuid;
+					switch_core_session_t *session_b;
+					
+					if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (session_b = switch_core_session_locate(uuid))) {
+						while (switch_channel_has_dtmf(channel)) {
+							switch_dtmf_t idtmf = { 0, 0 };
+							if (switch_channel_dequeue_dtmf(channel, &idtmf) == SWITCH_STATUS_SUCCESS) {
+								switch_core_session_send_dtmf(session_b, &idtmf);
+							}
+						}
+
+						switch_core_session_rwunlock(session_b);
+					}
+				}
 
 				/* Send 200 OK response */
 				nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_glue.c	Wed Jan  7 10:17:00 2009
@@ -35,6 +35,75 @@
 #include "mod_sofia.h"
 #include <switch_stun.h>
 
+void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *t38_options)
+{
+	char buf[2048];
+	const char *ip = t38_options->ip;
+	uint32_t port = t38_options->port;
+	const char *family = "IP4";
+
+	if (!ip) {
+		if (!(ip = tech_pvt->adv_sdp_audio_ip)) {
+			ip = tech_pvt->proxy_sdp_audio_ip;
+		}
+	}
+
+	if (!port) {
+		if (!(port = tech_pvt->adv_sdp_audio_port)) {
+			port = tech_pvt->proxy_sdp_audio_port;
+		}
+	}
+
+	if (!tech_pvt->owner_id) {
+		tech_pvt->owner_id = (uint32_t) switch_timestamp(NULL) - port;
+	}
+
+	if (!tech_pvt->session_id) {
+		tech_pvt->session_id = tech_pvt->owner_id;
+	}
+
+	tech_pvt->session_id++;
+
+	family = strchr(ip, ':') ? "IP6" : "IP4";
+	switch_snprintf(buf, sizeof(buf),
+					"v=0\n"
+					"o=FreeSWITCH %010u %010u IN %s %s\n"
+					"s=FreeSWITCH\n"
+					"c=IN %s %s\n" 
+					"t=0 0\n"
+					"m=image %d udptl t38\n"
+					"a=T38MaxBitRate:%d\n"
+					"%s"
+					"%s"
+					"%s"
+					"a=T38FaxRateManagement:%s\n"
+					"a=T38FaxMaxBuffer:%d\n"
+					"a=T38FaxMaxDatagram:%d\n"
+					"a=T38FaxUdpEC:%s\n"
+					"a=T38VendorInfo:%s\n",
+					
+					tech_pvt->owner_id, 
+					tech_pvt->session_id,
+					family,
+					ip,
+					family,
+					ip,
+					port,
+					
+					t38_options->T38MaxBitRate,
+					t38_options->T38FaxFillBitRemoval ? "a=T38FaxFillBitRemoval\n" : "",
+					t38_options->T38FaxTranscodingMMR ? "a=T38FaxTranscodingMMR\n" : "",
+					t38_options->T38FaxTranscodingJBIG ? "a=T38FaxTranscodingJBIG\n" : "",
+					t38_options->T38FaxRateManagement,
+					t38_options->T38FaxMaxBuffer,
+					t38_options->T38FaxMaxDatagram,
+					t38_options->T38FaxUdpEC,
+					t38_options->T38VendorInfo
+					);
+	
+	
+	tech_pvt->local_sdp_str = switch_core_session_strdup(tech_pvt->session, buf);
+}
 
 void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32_t port, const char *sr, int force)
 {
@@ -1775,10 +1844,6 @@
 		flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_DATAWAIT);
 	}
 
-	if (switch_test_flag(tech_pvt, TFLAG_BUGGY_2833)) {
-		flags |= SWITCH_RTP_FLAG_BUGGY_2833;
-	}
-
 	if ((val = switch_channel_get_variable(tech_pvt->channel, "dtmf_type"))) {
 		if (!strcasecmp(val, "rfc2833")) {
 			tech_pvt->dtmf_type = DTMF_2833;
@@ -1923,7 +1988,9 @@
 		tech_pvt->ssrc = switch_rtp_get_ssrc(tech_pvt->rtp_session);
 		switch_set_flag(tech_pvt, TFLAG_RTP);
 		switch_set_flag(tech_pvt, TFLAG_IO);
-
+		
+		switch_rtp_intentional_bugs(tech_pvt->rtp_session, tech_pvt->rtp_bugs);
+		
 		if ((vad_in && inb) || (vad_out && !inb)) {
 			switch_rtp_enable_vad(tech_pvt->rtp_session, tech_pvt->session, &tech_pvt->read_codec, SWITCH_VAD_FLAG_TALKING);
 			switch_set_flag(tech_pvt, TFLAG_VAD);
@@ -2191,7 +2258,7 @@
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 	const char *val;
 	const char *crypto = NULL;
-	int got_crypto = 0, got_audio = 0, got_avp = 0, got_savp = 0;
+	int got_crypto = 0, got_audio = 0, got_avp = 0, got_savp = 0, got_udptl = 0;
 
 	switch_assert(tech_pvt != NULL);
 
@@ -2205,12 +2272,12 @@
 
 	if ((tech_pvt->origin = switch_core_session_strdup(session, (char *) sdp->sdp_origin->o_username))) {
 		if (strstr(tech_pvt->origin, "CiscoSystemsSIP-GW-UserAgent")) {
-			switch_set_flag_locked(tech_pvt, TFLAG_BUGGY_2833);
+			tech_pvt->rtp_bugs |= RTP_BUG_CISCO_SKIP_MARK_BIT_2833;
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activate Buggy RFC2833 Mode!\n");
 		}
 
 		if (strstr(tech_pvt->origin, "Sonus_UAC")) {
-			switch_set_flag_locked(tech_pvt, TFLAG_BUGGY_2833);
+			tech_pvt->rtp_bugs |= RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833;
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, 
 							  "Hello,\nI see you have a Sonus!\n"
 							  "FYI, Sonus cannot follow the RFC on the proper way to send DTMF.\n"
@@ -2252,9 +2319,42 @@
 			got_savp++;
 		} else if (m->m_proto == sdp_proto_rtp) {
 			got_avp++;
+		} else if (m->m_proto == sdp_proto_udptl) {
+			got_udptl++;
 		}
 
-		if (m->m_type == sdp_media_audio && m->m_port && !got_audio) {
+		if (got_udptl && m->m_type == sdp_media_image && m->m_port) {
+			switch_t38_options_t *t38_options = switch_core_session_alloc(tech_pvt->session, sizeof(switch_t38_options_t));
+			
+			for (attr = m->m_attributes; attr; attr = attr->a_next) {
+				if (!strcasecmp(attr->a_name, "T38MaxBitRate") && attr->a_value) { 
+					t38_options->T38MaxBitRate = (uint32_t) atoi(attr->a_value);
+				} else  if (!strcasecmp(attr->a_name, "T38FaxFillBitRemoval")) {
+					t38_options->T38FaxFillBitRemoval = SWITCH_TRUE;
+				} else  if (!strcasecmp(attr->a_name, "T38FaxTranscodingMMR")) {
+					t38_options->T38FaxTranscodingMMR = SWITCH_TRUE;
+				} else  if (!strcasecmp(attr->a_name, "T38FaxTranscodingJBIG")) {
+					t38_options->T38FaxTranscodingJBIG = SWITCH_TRUE;
+				} else  if (!strcasecmp(attr->a_name, "T38FaxRateManagement") && attr->a_value) {
+					t38_options->T38FaxRateManagement = switch_core_session_strdup(tech_pvt->session, attr->a_value);
+				} else  if (!strcasecmp(attr->a_name, "T38FaxMaxBuffer") && attr->a_value) {
+					t38_options->T38FaxMaxBuffer = (uint32_t) atoi(attr->a_value);
+				} else  if (!strcasecmp(attr->a_name, "T38FaxMaxDatagram") && attr->a_value) {
+					t38_options->T38FaxMaxDatagram = (uint32_t) atoi(attr->a_value);
+				} else  if (!strcasecmp(attr->a_name, "T38FaxUdpEC") && attr->a_value) {
+					t38_options->T38FaxUdpEC = switch_core_session_strdup(tech_pvt->session, attr->a_value);
+				} else  if (!strcasecmp(attr->a_name, "T38VendorInfo") && attr->a_value) {
+					t38_options->T38VendorInfo = switch_core_session_strdup(tech_pvt->session, attr->a_value);
+				}
+			}
+
+			switch_channel_set_variable(tech_pvt->channel, "has_t38", "true");
+			switch_channel_set_private(tech_pvt->channel, "t38_options", t38_options);
+
+			switch_channel_set_flag(tech_pvt->channel, CF_PROXY_MEDIA);
+			switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA);
+
+		} else if (m->m_type == sdp_media_audio && m->m_port && !got_audio) {
 			sdp_rtpmap_t *map;
 
 			for (attr = m->m_attributes; attr; attr = attr->a_next) {

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_reg.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_reg.c	Wed Jan  7 10:17:00 2009
@@ -1064,6 +1064,8 @@
 
 	if (regtype == REG_REGISTER) {
 		char exp_param[128] = "";
+		char date[80] = "";
+
 		s_event = NULL;
 
 		if (exptime) {
@@ -1086,7 +1088,12 @@
 			}
 		}
 		
-		nua_respond(nh, SIP_200_OK, SIPTAG_CONTACT(sip->sip_contact), TAG_IF(path_val, SIPTAG_PATH_STR(path_val)), NUTAG_WITH_THIS(nua), TAG_END());
+		switch_rfc822_date(date, switch_timestamp_now());
+		nua_respond(nh, SIP_200_OK, SIPTAG_CONTACT(sip->sip_contact),
+					TAG_IF(path_val, SIPTAG_PATH_STR(path_val)),
+					NUTAG_WITH_THIS(nua),
+					SIPTAG_DATE_STR(date),
+					TAG_END());
 
 		if (s_event) {
 			switch_event_fire(&s_event);
@@ -1245,8 +1252,8 @@
 			break;
 		default:
 			sofia_private->gateway->state = REG_STATE_FAILED;
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Registration Failed with status %d. failure #%d\n", 
-							  sofia_private->gateway->name, status, ++sofia_private->gateway->failures);
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Registration Failed with status %s [%d]. failure #%d\n", 
+							  sofia_private->gateway->name, switch_str_nil(phrase), status, ++sofia_private->gateway->failures);
 			break;
 		}
 		if (ostate != sofia_private->gateway->state) {
@@ -1394,7 +1401,7 @@
 	const char *a1_hash = NULL;
 	char *sql;
 	char *mailbox = NULL;
-	switch_xml_t domain, xml = NULL, user, param, uparams, dparams;
+	switch_xml_t domain, xml = NULL, user, param, uparams, dparams, group = NULL, gparams = NULL;
 	char hexdigest[2 * SU_MD5_DIGEST_SIZE + 1] = "";
 	char *domain_name = NULL;
 	switch_event_t *params = NULL;
@@ -1529,7 +1536,7 @@
 	}
 
 	if (switch_xml_locate_user("id", switch_strlen_zero(username) ? "nobody" : username, 
-							   domain_name, ip, &xml, &domain, &user, params) != SWITCH_STATUS_SUCCESS) {
+							   domain_name, ip, &xml, &domain, &user, &group, params) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n"
 						  "You must define a domain called '%s' in your directory and add a user with the id=\"%s\" attribute\n"
 						  "and you must configure your device to use the proper domain in it's authentication credentials.\n"
@@ -1545,6 +1552,9 @@
 
 	dparams = switch_xml_child(domain, "params");
 	uparams = switch_xml_child(user, "params");
+	if (group) {
+		gparams = switch_xml_child(group, "params");
+	}
 
 	if (!(dparams || uparams)) {
 		ret = AUTH_OK;
@@ -1575,6 +1585,30 @@
 		}
 	}
 
+	if (gparams) {
+		for (param = switch_xml_child(gparams, "param"); param; param = param->next) {
+			const char *var = switch_xml_attr_soft(param, "name");
+			const char *val = switch_xml_attr_soft(param, "value");
+
+			if (!strcasecmp(var, "sip-forbid-register") && switch_true(val)) {
+				ret = AUTH_FORBIDDEN;
+				goto end;
+			}
+
+			if (!strcasecmp(var, "password")) {
+				passwd = val;
+			}
+
+			if (!strcasecmp(var, "auth-acl")) {
+				auth_acl = val;
+			}
+
+			if (!strcasecmp(var, "a1-hash")) {
+				a1_hash = val;
+			}
+		}
+	}
+
 	if (uparams) {
 		for (param = switch_xml_child(uparams, "param"); param; param = param->next) {
 			const char *var = switch_xml_attr_soft(param, "name");
@@ -1670,7 +1704,7 @@
 			switch_event_create(v_event, SWITCH_EVENT_REQUEST_PARAMS);
 		}
 		if (v_event && *v_event) {
-			switch_xml_t xparams[2];
+			switch_xml_t xparams[3];
 			int i = 0;
 
 			switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "sip_mailbox", mailbox);
@@ -1684,11 +1718,15 @@
 				xparams[i++] = dparams;
 			}
 
+			if (group && (gparams = switch_xml_child(group, "variables"))) {
+				xparams[i++] = gparams;
+			}
+
 			if ((uparams = switch_xml_child(user, "variables"))) {
 				xparams[i++] = uparams;
 			}
 
-			if (dparams || uparams) {
+			if (i <= 3) {
 				int j = 0;
 
 				for (j = 0; j < i; j++) {

Modified: freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c	Wed Jan  7 10:17:00 2009
@@ -142,25 +142,28 @@
 	switch_mutex_lock(globals.listener_mutex);
 	for (l = listen_list.listeners; l; l = l->next) {
 		if (switch_test_flag(l, LFLAG_LOG) && l->level >= node->level) {
-			char *data = strdup(node->data);
-			if (data) {
-				if (switch_queue_trypush(l->log_queue, data) == SWITCH_STATUS_SUCCESS) {
-					if (l->lost_logs) {
-						int ll = l->lost_logs;
-						switch_event_t *event;
-						l->lost_logs = 0;
-						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Lost %d log lines!\n", ll);
-						if (switch_event_create(&event, SWITCH_EVENT_TRAP) == SWITCH_STATUS_SUCCESS) {
-							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "info", "lost %d log lines", ll);
-							switch_event_fire(&event);
-						}
+
+			switch_log_node_t *dnode = malloc(sizeof(*node));
+			switch_assert(dnode);
+			*dnode = *node;
+			dnode->data = strdup(node->data);
+			switch_assert(dnode->data);
+
+			if (switch_queue_trypush(l->log_queue, dnode) == SWITCH_STATUS_SUCCESS) {
+				if (l->lost_logs) {
+					int ll = l->lost_logs;
+					switch_event_t *event;
+					l->lost_logs = 0;
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Lost %d log lines!\n", ll);
+					if (switch_event_create(&event, SWITCH_EVENT_TRAP) == SWITCH_STATUS_SUCCESS) {
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "info", "lost %d log lines", ll);
+						switch_event_fire(&event);
 					}
-				} else {
-					switch_safe_free(data);
-					l->lost_logs++;
 				}
 			} else {
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
+				switch_safe_free(dnode->data);
+				switch_safe_free(dnode);
+				l->lost_logs++;
 			}
 		}
 	}
@@ -268,6 +271,8 @@
 static void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event)
 {
 	int i;
+	char *uuid = switch_event_get_header(event, "unique-id");
+
 	switch_event_header_t *hp;
 
 	for (i = 0, hp = event->headers; hp; hp = hp->next, i++);
@@ -275,7 +280,13 @@
 	if (event->body)
 		i++;
 
-	ei_x_encode_list_header(ebuf, i);
+	ei_x_encode_list_header(ebuf, i+1);
+
+	if (uuid) {
+		ei_x_encode_string(ebuf, switch_event_get_header(event, "unique-id"));
+	} else {
+		ei_x_encode_atom(ebuf, "undefined");
+	}
 
 	for (hp = event->headers; hp; hp = hp->next) {
 		ei_x_encode_tuple_header(ebuf, 2);
@@ -936,7 +947,7 @@
 			}
 
 			switch_core_session_t *session;
-			if ((session = switch_core_session_locate(uuid))) {
+			if (!switch_strlen_zero(uuid) && (session = switch_core_session_locate(uuid))) {
 			} else {
 				ei_x_encode_tuple_header(rbuf, 2);
 				ei_x_encode_atom(rbuf, "error");
@@ -980,6 +991,9 @@
 					ei_x_encode_atom(rbuf, "error");
 					ei_x_encode_atom(rbuf, "badmem");
 				}
+
+				/* release the lock returned by switch_core_locate_session */
+				switch_core_session_rwunlock(session);
 				break;
 
 sendmsg_fail:
@@ -1262,20 +1276,48 @@
 		/* send out any pending crap in the log queue */
 		if (switch_test_flag(listener, LFLAG_LOG)) {
 			if (switch_queue_trypop(listener->log_queue, &pop) == SWITCH_STATUS_SUCCESS) {
-				char *data = (char *) pop;
+				switch_log_node_t *dnode = (switch_log_node_t *) pop;
 
-				if (data) {
+				if (dnode->data) {
 					ei_x_buff lbuf;
 					ei_x_new_with_version(&lbuf);
 					ei_x_encode_tuple_header(&lbuf, 2);
 					ei_x_encode_atom(&lbuf, "log");
-					ei_x_encode_string(&lbuf, data);
+					ei_x_encode_list_header(&lbuf, 6);
+
+					ei_x_encode_tuple_header(&lbuf, 2);
+					ei_x_encode_atom(&lbuf, "level");
+					ei_x_encode_char(&lbuf, (unsigned char)dnode->level);
+
+					ei_x_encode_tuple_header(&lbuf, 2);
+					ei_x_encode_atom(&lbuf, "text_channel");
+					ei_x_encode_char(&lbuf, (unsigned char)dnode->level);
+
+					ei_x_encode_tuple_header(&lbuf, 2);
+					ei_x_encode_atom(&lbuf, "file");
+					ei_x_encode_string(&lbuf, dnode->file);
+	
+					ei_x_encode_tuple_header(&lbuf, 2);
+					ei_x_encode_atom(&lbuf, "func");
+					ei_x_encode_string(&lbuf, dnode->func);
+
+					ei_x_encode_tuple_header(&lbuf, 2);
+					ei_x_encode_atom(&lbuf, "line");
+					ei_x_encode_ulong(&lbuf, (unsigned long)dnode->line);
+
+					ei_x_encode_tuple_header(&lbuf, 2);
+					ei_x_encode_atom(&lbuf, "data");
+					ei_x_encode_string(&lbuf, dnode->data);
+
+					ei_x_encode_empty_list(&lbuf);
 
 					switch_mutex_lock(listener->sock_mutex);
 					ei_send(listener->sockfd, &listener->log_pid, lbuf.buff, lbuf.index);
 					switch_mutex_unlock(listener->sock_mutex);
 
 					ei_x_free(&lbuf);
+					free(dnode->data);
+					free(dnode);
 				}
 			}
 		}

Modified: freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	Wed Jan  7 10:17:00 2009
@@ -332,7 +332,7 @@
 			}
 
 			if (var && strlen(var) > 1) {
-				switch_event_add_body(local_event, var);
+				switch_event_add_body(local_event, "%s", var);
 			}
 
 			switch_event_fire(&local_event);

Modified: freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Wed Jan  7 10:17:00 2009
@@ -473,6 +473,7 @@
 	}
 	switch_mutex_unlock(globals.listener_mutex);
 
+	switch_yield(1000000);
 
 
 	return SWITCH_STATUS_SUCCESS;
@@ -627,15 +628,67 @@
 
 		switch_mutex_unlock(listener->filter_mutex);
 
+	} else if (!strcasecmp(wcmd, "stop-logging")) {
+		char *id = switch_event_get_header(stream->param_event, "listen-id");
+		uint32_t idl = 0;
+
+		if (id) {
+			idl = (uint32_t) atol(id);
+		}
+
+		if (!(listener = find_listener(idl))) {
+			stream->write_function(stream, "<data><reply type=\"error\">Invalid Listen-ID</reply></data>\n");
+            goto end;
+		}
+
+		if (switch_test_flag(listener, LFLAG_LOG)) {
+			switch_clear_flag_locked(listener, LFLAG_LOG);
+			stream->write_function(stream, "<data><reply type=\"success\">Not Logging</reply></data>\n");
+		} else {
+			stream->write_function(stream, "<data><reply type=\"error\">Not Logging</reply></data>\n");
+		}
+
+		goto end;
+
+	} else if (!strcasecmp(wcmd, "set-loglevel")) {
+		char *loglevel = switch_event_get_header(stream->param_event, "loglevel");
+		char *id = switch_event_get_header(stream->param_event, "listen-id");
+		uint32_t idl = 0;
+
+		if (id) {
+			idl = (uint32_t) atol(id);
+		}
+
+		if (!(listener = find_listener(idl))) {
+			stream->write_function(stream, "<data><reply type=\"error\">Invalid Listen-ID</reply></data>\n");
+            goto end;
+		}
+
+		if (loglevel) {
+			switch_log_level_t ltype = switch_log_str2level(loglevel);
+			if (ltype != SWITCH_LOG_INVALID) {
+				listener->level = ltype;
+				switch_set_flag(listener, LFLAG_LOG);
+				stream->write_function(stream, "<data><reply type=\"success\">Log Level %s</reply></data>\n", loglevel);
+			} else {
+				stream->write_function(stream, "<data><reply type=\"error\">Invalid Level</reply></data>\n");
+			}
+		} else {
+			stream->write_function(stream, "<data><reply type=\"error\">Invalid Syntax</reply></data>\n");
+		}
+
+		goto end;
+
 	} else if (!strcasecmp(wcmd, "create-listener")) {
 		char *events = switch_event_get_header(stream->param_event, "events");
+		char *loglevel = switch_event_get_header(stream->param_event, "loglevel");
 		switch_memory_pool_t *pool;
 		char *next, *cur;
 		uint32_t count = 0, key_count = 0;
 		uint8_t custom = 0;
 		char *edup;
 		
-		if (switch_strlen_zero(events)) {
+		if (switch_strlen_zero(events) && switch_strlen_zero(loglevel)) {
 			stream->write_function(stream, "<data><reply type=\"error\">Missing parameter!</reply></data>\n");
 			goto end;
 		}
@@ -651,64 +704,81 @@
 		switch_set_flag(listener, LFLAG_AUTHED);
 		switch_set_flag(listener, LFLAG_STATEFUL);
 		switch_queue_create(&listener->event_queue, SWITCH_CORE_QUEUE_LEN, listener->pool);
+		switch_queue_create(&listener->log_queue, SWITCH_CORE_QUEUE_LEN, listener->pool);
+
+		if (loglevel) {
+			switch_log_level_t ltype = switch_log_str2level(loglevel);
+			if (ltype != SWITCH_LOG_INVALID) {
+				listener->level = ltype;
+				switch_set_flag(listener, LFLAG_LOG);
+			}
+		}
 		switch_thread_rwlock_create(&listener->rwlock, listener->pool);
 		listener->id = next_id();
 		listener->timeout = 60;
 		listener->last_flush = switch_timestamp(NULL);
 		
-		if (switch_stristr("xml", format)) {
-			listener->format = EVENT_FORMAT_XML;
-		} else {
-			listener->format = EVENT_FORMAT_PLAIN;
-		}
+		if (events) {
+			char delim = ',';
 
-		edup = strdup(events);
-		
-		for (cur = edup; cur; count++) {
-			switch_event_types_t type;
+			if (switch_stristr("xml", format)) {
+				listener->format = EVENT_FORMAT_XML;
+			} else {
+				listener->format = EVENT_FORMAT_PLAIN;
+			}
+			
+			edup = strdup(events);
 
-			if ((next = strchr(cur, ' '))) {
-				*next++ = '\0';
+			if (strchr(edup, ' ')) {
+				delim = ' ';
 			}
 
-			if (custom) {
-				switch_core_hash_insert(listener->event_hash, cur, MARKER);
-			} else if (switch_name_event(cur, &type) == SWITCH_STATUS_SUCCESS) {
-				key_count++;
-				if (type == SWITCH_EVENT_ALL) {
-					uint32_t x = 0;
-					for (x = 0; x < SWITCH_EVENT_ALL; x++) {
-						listener->event_list[x] = 1;
-					}
-				}
-				if (type <= SWITCH_EVENT_ALL) {
-					listener->event_list[type] = 1;
+			for (cur = edup; cur; count++) {
+				switch_event_types_t type;
+				
+				if ((next = strchr(cur, delim))) {
+					*next++ = '\0';
 				}
-				if (type == SWITCH_EVENT_CUSTOM) {
-					custom++;
+
+				if (custom) {
+					switch_core_hash_insert(listener->event_hash, cur, MARKER);
+				} else if (switch_name_event(cur, &type) == SWITCH_STATUS_SUCCESS) {
+					key_count++;
+					if (type == SWITCH_EVENT_ALL) {
+						uint32_t x = 0;
+						for (x = 0; x < SWITCH_EVENT_ALL; x++) {
+							listener->event_list[x] = 1;
+						}
+					}
+					if (type <= SWITCH_EVENT_ALL) {
+						listener->event_list[type] = 1;
+					}
+					if (type == SWITCH_EVENT_CUSTOM) {
+						custom++;
+					}
 				}
+				
+				cur = next;
 			}
-
-			cur = next;
-		}
 		
 
-		switch_safe_free(edup);
+			switch_safe_free(edup);
 
-		if (!key_count) {
-			switch_core_hash_destroy(&listener->event_hash);
-			switch_core_destroy_memory_pool(&listener->pool);
-			stream->write_function(stream, "<data><reply type=\"error\">No keywords supplied</reply></data>\n");
-			goto end;
+			if (!key_count) {
+				switch_core_hash_destroy(&listener->event_hash);
+				switch_core_destroy_memory_pool(&listener->pool);
+				stream->write_function(stream, "<data><reply type=\"error\">No keywords supplied</reply></data>\n");
+				goto end;
+			}
 		}
 
-
 		switch_set_flag_locked(listener, LFLAG_EVENTS);
 		add_listener(listener);
 		stream->write_function(stream, "<data>\n");
 		stream->write_function(stream, " <reply type=\"success\">Listener %u Created</reply>\n", listener->id);
 		xmlize_listener(listener, stream);
 		stream->write_function(stream, "</data>\n");
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating event-sink listener [%u]\n", listener->id);
 
 		goto end;
 	} else if (!strcasecmp(wcmd, "destroy-listener")) {		
@@ -720,6 +790,7 @@
 		}
 
 		if ((listener = find_listener(idl))) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying event-sink listener [%u]\n", idl);
 			remove_listener(listener);
 			stream->write_function(stream, "<data>\n <reply type=\"success\">listener %u destroyed</reply>\n", listener->id);
 			xmlize_listener(listener, stream);
@@ -727,6 +798,7 @@
 			expire_listener(&listener);
 			goto end;
 		} else {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Request to destroy unknown event-sink listener [%u]\n", idl);
 			stream->write_function(stream, "<data><reply type=\"error\">Can't find listener</reply></data>\n");
 			goto end;
 		}
@@ -749,7 +821,38 @@
 		listener->last_flush = switch_timestamp(NULL);
 		stream->write_function(stream, "<data>\n <reply type=\"success\">Current Events Follow</reply>\n");			
 		xmlize_listener(listener, stream);
-		stream->write_function(stream, "<events>\n");			
+
+		if (switch_test_flag(listener, LFLAG_LOG)) {
+			stream->write_function(stream, "<log_data>\n");
+
+			while (switch_queue_trypop(listener->log_queue, &pop) == SWITCH_STATUS_SUCCESS) {
+				switch_log_node_t *dnode = (switch_log_node_t *) pop;
+				int encode_len = (strlen(dnode->data) * 3) + 1;
+				char *encode_buf = malloc(encode_len);
+				
+				switch_assert(encode_buf);
+				
+				memset(encode_buf, 0, encode_len);
+				switch_url_encode((char *) dnode->data, encode_buf, encode_len);
+				
+
+				stream->write_function(stream, "<log log-level=\"%d\" text-channel=\"%d\" log-file=\"%s\" log-func=\"%s\" log-line=\"%d\">%s</log>\n",
+									   dnode->level,
+									   dnode->channel,
+									   dnode->file,
+									   dnode->func,
+									   dnode->line,
+									   encode_buf
+									   );
+				free(encode_buf);
+				free(dnode->data);
+				free(dnode);
+			}
+
+			stream->write_function(stream, "</log_data>\n");
+		}
+
+		stream->write_function(stream, "<events>\n");
 
 		while (switch_queue_trypop(listener->event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
 			char *etype;
@@ -821,6 +924,9 @@
 
 	switch_mutex_init(&globals.listener_mutex, SWITCH_MUTEX_NESTED, pool);
 
+	memset(&listen_list, 0, sizeof(listen_list));
+	switch_mutex_init(&listen_list.sock_mutex, SWITCH_MUTEX_NESTED, pool);
+
 	if (switch_event_bind_removable(modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
 		return SWITCH_STATUS_GENERR;
@@ -1482,7 +1588,7 @@
 			ltype = switch_log_str2level(level_s);
 		}
 
-		if (ltype && ltype != SWITCH_LOG_INVALID) {
+		if (ltype != SWITCH_LOG_INVALID) {
 			listener->level = ltype;
 			switch_set_flag(listener, LFLAG_LOG);
 			switch_snprintf(reply, reply_len, "+OK log level %s [%d]", level_s, listener->level);
@@ -1824,7 +1930,7 @@
 	switch_mutex_unlock(listener->filter_mutex);
 	if (listener->sock) {
 		char disco_buf[512] = "";
-		const char message[] = "Disconnected, goodbye!\nSee you at ClueCon http://www.cluecon.com!\n";
+		const char message[] = "Disconnected, goodbye!\nSee you at ClueCon http://www.cluecon.com/ !!!\n";
 		int mlen = strlen(message);
 		
 		switch_snprintf(disco_buf, sizeof(disco_buf), "Content-Type: text/disconnect-notice\nContent-Length: %d\n\n", mlen);
@@ -1927,17 +2033,12 @@
 	listener_t *listener;
 	uint32_t x = 0;
 
-	memset(&listen_list, 0, sizeof(listen_list));
-	config();
-
 	if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "OH OH no pool\n");
 		return SWITCH_STATUS_TERM;
 	}
 
-
-	switch_mutex_init(&listen_list.sock_mutex, SWITCH_MUTEX_NESTED, pool);
-
+	config();
 
 	for (;;) {
 		rv = switch_sockaddr_info_get(&sa, prefs.ip, SWITCH_INET, prefs.port, 0, pool);

Modified: freeswitch/branches/gmaruzz/src/mod/formats/mod_shout/Makefile
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/formats/mod_shout/Makefile	(original)
+++ freeswitch/branches/gmaruzz/src/mod/formats/mod_shout/Makefile	Wed Jan  7 10:17:00 2009
@@ -30,7 +30,7 @@
 	$(GETLIB) $(MPG123).tar.gz
 
 $(MPG123_DIR)/Makefile: $(MPG123_DIR)
-	cd $(MPG123_DIR) && CFLAGS=$(AM_CFLAGS) ./configure --disable-shared --with-pic
+	cd $(MPG123_DIR) && CFLAGS=$(AM_CFLAGS) ./configure --disable-shared --with-pic CPPFLAGS= LDFLAGS=
 	$(TOUCH_TARGET)
 
 $(MPG123LA): $(MPG123_DIR)/Makefile
@@ -41,7 +41,7 @@
 	$(GETLIB) $(LAME).tar.gz
 
 $(LAME_DIR)/Makefile: $(LAME_DIR)
-	cd $(LAME_DIR) && ./configure $(DEFAULT_ARGS) --disable-decoder
+	cd $(LAME_DIR) && ./configure $(DEFAULT_ARGS) --disable-decoder CPPFLAGS= LDFLAGS=
 	$(TOUCH_TARGET)
 
 $(LAMELA): $(LAME_DIR)/Makefile
@@ -52,7 +52,7 @@
 	$(GETLIB) $(SHOUT).tar.gz
 
 $(SHOUT_DIR)/Makefile: $(SHOUT_DIR)
-	cd $(SHOUT_DIR) && ./configure $(DEFAULT_ARGS) --without-speex --without-vorbis --without-ogg
+	cd $(SHOUT_DIR) && ./configure $(DEFAULT_ARGS) --without-speex --without-vorbis --without-ogg CPPFLAGS= LDFLAGS=
 	$(TOUCH_TARGET)
 
 $(SHOUTLA): $(SHOUT_DIR)/Makefile

Modified: freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/freeswitch_wrap.cxx
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/freeswitch_wrap.cxx	(original)
+++ freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/freeswitch_wrap.cxx	Wed Jan  7 10:17:00 2009
@@ -2290,7 +2290,7 @@
   int jresult ;
   int result;
   
-  result = (int) 32;
+  result = (int) 48;
   
   jresult = result; 
   return jresult;
@@ -2312,7 +2312,7 @@
   int jresult ;
   int result;
   
-  result = (int) (2*32*(120+10));
+  result = (int) 4096;
   
   jresult = result; 
   return jresult;
@@ -2600,6 +2600,302 @@
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38MaxBitRate_set(void * jarg1, unsigned long jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  uint32_t arg2 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (uint32_t)jarg2; 
+  if (arg1) (arg1)->T38MaxBitRate = arg2;
+  
+}
+
+
+SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_t38_options_t_T38MaxBitRate_get(void * jarg1) {
+  unsigned long jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  uint32_t result;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (uint32_t) ((arg1)->T38MaxBitRate);
+  jresult = (unsigned long)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxFillBitRemoval_set(void * jarg1, int jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  switch_bool_t arg2 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (switch_bool_t)jarg2; 
+  if (arg1) (arg1)->T38FaxFillBitRemoval = arg2;
+  
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxFillBitRemoval_get(void * jarg1) {
+  int jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  switch_bool_t result;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (switch_bool_t) ((arg1)->T38FaxFillBitRemoval);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxTranscodingMMR_set(void * jarg1, int jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  switch_bool_t arg2 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (switch_bool_t)jarg2; 
+  if (arg1) (arg1)->T38FaxTranscodingMMR = arg2;
+  
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxTranscodingMMR_get(void * jarg1) {
+  int jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  switch_bool_t result;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (switch_bool_t) ((arg1)->T38FaxTranscodingMMR);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxTranscodingJBIG_set(void * jarg1, int jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  switch_bool_t arg2 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (switch_bool_t)jarg2; 
+  if (arg1) (arg1)->T38FaxTranscodingJBIG = arg2;
+  
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxTranscodingJBIG_get(void * jarg1) {
+  int jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  switch_bool_t result;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (switch_bool_t) ((arg1)->T38FaxTranscodingJBIG);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxRateManagement_set(void * jarg1, char * jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (char *)jarg2; 
+  {
+    if (arg2) {
+      arg1->T38FaxRateManagement = (char const *) (new char[strlen((const char *)arg2)+1]);
+      strcpy((char *)arg1->T38FaxRateManagement, (const char *)arg2);
+    } else {
+      arg1->T38FaxRateManagement = 0;
+    }
+  }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxRateManagement_get(void * jarg1) {
+  char * jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (char *) ((arg1)->T38FaxRateManagement);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxMaxBuffer_set(void * jarg1, unsigned long jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  uint32_t arg2 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (uint32_t)jarg2; 
+  if (arg1) (arg1)->T38FaxMaxBuffer = arg2;
+  
+}
+
+
+SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxMaxBuffer_get(void * jarg1) {
+  unsigned long jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  uint32_t result;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (uint32_t) ((arg1)->T38FaxMaxBuffer);
+  jresult = (unsigned long)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxMaxDatagram_set(void * jarg1, unsigned long jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  uint32_t arg2 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (uint32_t)jarg2; 
+  if (arg1) (arg1)->T38FaxMaxDatagram = arg2;
+  
+}
+
+
+SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxMaxDatagram_get(void * jarg1) {
+  unsigned long jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  uint32_t result;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (uint32_t) ((arg1)->T38FaxMaxDatagram);
+  jresult = (unsigned long)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxUdpEC_set(void * jarg1, char * jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (char *)jarg2; 
+  {
+    if (arg2) {
+      arg1->T38FaxUdpEC = (char const *) (new char[strlen((const char *)arg2)+1]);
+      strcpy((char *)arg1->T38FaxUdpEC, (const char *)arg2);
+    } else {
+      arg1->T38FaxUdpEC = 0;
+    }
+  }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxUdpEC_get(void * jarg1) {
+  char * jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (char *) ((arg1)->T38FaxUdpEC);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38VendorInfo_set(void * jarg1, char * jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (char *)jarg2; 
+  {
+    if (arg2) {
+      arg1->T38VendorInfo = (char const *) (new char[strlen((const char *)arg2)+1]);
+      strcpy((char *)arg1->T38VendorInfo, (const char *)arg2);
+    } else {
+      arg1->T38VendorInfo = 0;
+    }
+  }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_t38_options_t_T38VendorInfo_get(void * jarg1) {
+  char * jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (char *) ((arg1)->T38VendorInfo);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_ip_set(void * jarg1, char * jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (char *)jarg2; 
+  {
+    if (arg2) {
+      arg1->ip = (char const *) (new char[strlen((const char *)arg2)+1]);
+      strcpy((char *)arg1->ip, (const char *)arg2);
+    } else {
+      arg1->ip = 0;
+    }
+  }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_t38_options_t_ip_get(void * jarg1) {
+  char * jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (char *) ((arg1)->ip);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_port_set(void * jarg1, unsigned long jarg2) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  uint32_t arg2 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  arg2 = (uint32_t)jarg2; 
+  if (arg1) (arg1)->port = arg2;
+  
+}
+
+
+SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_t38_options_t_port_get(void * jarg1) {
+  unsigned long jresult ;
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  uint32_t result;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  result = (uint32_t) ((arg1)->port);
+  jresult = (unsigned long)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_t38_options_t() {
+  void * jresult ;
+  switch_t38_options_t *result = 0 ;
+  
+  result = (switch_t38_options_t *)new switch_t38_options_t();
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_t38_options_t(void * jarg1) {
+  switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
+  
+  arg1 = (switch_t38_options_t *)jarg1; 
+  delete arg1;
+  
+}
+
+
 SWIGEXPORT void SWIGSTDCALL CSharp_switch_input_args_t_input_callback_set(void * jarg1, void * jarg2) {
   switch_input_args_t *arg1 = (switch_input_args_t *) 0 ;
   switch_input_callback_function_t arg2 = (switch_input_callback_function_t) 0 ;
@@ -6323,6 +6619,38 @@
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_lock_codec_write(void * jarg1) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  
+  arg1 = (switch_core_session_t *)jarg1; 
+  switch_core_session_lock_codec_write(arg1);
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_unlock_codec_write(void * jarg1) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  
+  arg1 = (switch_core_session_t *)jarg1; 
+  switch_core_session_unlock_codec_write(arg1);
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_lock_codec_read(void * jarg1) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  
+  arg1 = (switch_core_session_t *)jarg1; 
+  switch_core_session_lock_codec_read(arg1);
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_unlock_codec_read(void * jarg1) {
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  
+  arg1 = (switch_core_session_t *)jarg1; 
+  switch_core_session_unlock_codec_read(arg1);
+}
+
+
 SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_get_read_impl(void * jarg1, void * jarg2) {
   int jresult ;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
@@ -19729,7 +20057,7 @@
   {
     size_t ii;
     switch_byte_t *b = (switch_byte_t *) arg1->write_frame_data;
-    for (ii = 0; ii < (size_t)(2*32*(120+10)); ii++) b[ii] = *((switch_byte_t *) arg2 + ii);
+    for (ii = 0; ii < (size_t)4096; ii++) b[ii] = *((switch_byte_t *) arg2 + ii);
   }
 }
 
@@ -21417,13 +21745,15 @@
 }
 
 
-SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_unbind_dtmf_meta_session(void * jarg1) {
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_unbind_dtmf_meta_session(void * jarg1, unsigned long jarg2) {
   int jresult ;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  uint32_t arg2 ;
   switch_status_t result;
   
   arg1 = (switch_core_session_t *)jarg1; 
-  result = (switch_status_t)switch_ivr_unbind_dtmf_meta_session(arg1);
+  arg2 = (uint32_t)jarg2; 
+  result = (switch_status_t)switch_ivr_unbind_dtmf_meta_session(arg1,arg2);
   jresult = result; 
   return jresult;
 }
@@ -22378,6 +22708,16 @@
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_intentional_bugs(void * jarg1, int jarg2) {
+  switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
+  switch_rtp_bug_flag_t arg2 ;
+  
+  arg1 = (switch_rtp_t *)jarg1; 
+  arg2 = (switch_rtp_bug_flag_t)jarg2; 
+  switch_rtp_intentional_bugs(arg1,arg2);
+}
+
+
 SWIGEXPORT void SWIGSTDCALL CSharp_switch_log_node_t_data_set(void * jarg1, char * jarg2) {
   switch_log_node_t *arg1 = (switch_log_node_t *) 0 ;
   char *arg2 = (char *) 0 ;
@@ -22592,6 +22932,29 @@
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_log_node_t_channel_set(void * jarg1, int jarg2) {
+  switch_log_node_t *arg1 = (switch_log_node_t *) 0 ;
+  switch_text_channel_t arg2 ;
+  
+  arg1 = (switch_log_node_t *)jarg1; 
+  arg2 = (switch_text_channel_t)jarg2; 
+  if (arg1) (arg1)->channel = arg2;
+  
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_log_node_t_channel_get(void * jarg1) {
+  int jresult ;
+  switch_log_node_t *arg1 = (switch_log_node_t *) 0 ;
+  switch_text_channel_t result;
+  
+  arg1 = (switch_log_node_t *)jarg1; 
+  result = (switch_text_channel_t) ((arg1)->channel);
+  jresult = result; 
+  return jresult;
+}
+
+
 SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_log_node_t() {
   void * jresult ;
   switch_log_node_t *result = 0 ;
@@ -23109,6 +23472,21 @@
 }
 
 
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_xml_find_child_multi(void * jarg1, char * jarg2) {
+  void * jresult ;
+  switch_xml_t arg1 = (switch_xml_t) 0 ;
+  char *arg2 = (char *) 0 ;
+  void *arg3 = 0 ;
+  switch_xml_t result;
+  
+  arg1 = (switch_xml_t)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (switch_xml_t)switch_xml_find_child_multi(arg1,(char const *)arg2,arg3);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
 SWIGEXPORT char * SWIGSTDCALL CSharp_switch_xml_attr(void * jarg1, char * jarg2) {
   char * jresult ;
   switch_xml_t arg1 = (switch_xml_t) 0 ;
@@ -23428,7 +23806,29 @@
 }
 
 
-SWIGEXPORT int SWIGSTDCALL CSharp_switch_xml_locate_user(char * jarg1, char * jarg2, char * jarg3, char * jarg4, void * jarg5, void * jarg6, void * jarg7, void * jarg8) {
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_xml_locate_group(char * jarg1, char * jarg2, void * jarg3, void * jarg4, void * jarg5, void * jarg6) {
+  int jresult ;
+  char *arg1 = (char *) 0 ;
+  char *arg2 = (char *) 0 ;
+  switch_xml_t *arg3 = (switch_xml_t *) 0 ;
+  switch_xml_t *arg4 = (switch_xml_t *) 0 ;
+  switch_xml_t *arg5 = (switch_xml_t *) 0 ;
+  switch_event_t *arg6 = (switch_event_t *) 0 ;
+  switch_status_t result;
+  
+  arg1 = (char *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (switch_xml_t *)jarg3; 
+  arg4 = (switch_xml_t *)jarg4; 
+  arg5 = (switch_xml_t *)jarg5; 
+  arg6 = (switch_event_t *)jarg6; 
+  result = (switch_status_t)switch_xml_locate_group((char const *)arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_xml_locate_user(char * jarg1, char * jarg2, char * jarg3, char * jarg4, void * jarg5, void * jarg6, void * jarg7, void * jarg8, void * jarg9) {
   int jresult ;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
@@ -23437,7 +23837,8 @@
   switch_xml_t *arg5 = (switch_xml_t *) 0 ;
   switch_xml_t *arg6 = (switch_xml_t *) 0 ;
   switch_xml_t *arg7 = (switch_xml_t *) 0 ;
-  switch_event_t *arg8 = (switch_event_t *) 0 ;
+  switch_xml_t *arg8 = (switch_xml_t *) 0 ;
+  switch_event_t *arg9 = (switch_event_t *) 0 ;
   switch_status_t result;
   
   arg1 = (char *)jarg1; 
@@ -23447,8 +23848,27 @@
   arg5 = (switch_xml_t *)jarg5; 
   arg6 = (switch_xml_t *)jarg6; 
   arg7 = (switch_xml_t *)jarg7; 
-  arg8 = (switch_event_t *)jarg8; 
-  result = (switch_status_t)switch_xml_locate_user((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7,arg8);
+  arg8 = (switch_xml_t *)jarg8; 
+  arg9 = (switch_event_t *)jarg9; 
+  result = (switch_status_t)switch_xml_locate_user((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7,arg8,arg9);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_xml_locate_user_in_domain(char * jarg1, void * jarg2, void * jarg3, void * jarg4) {
+  int jresult ;
+  char *arg1 = (char *) 0 ;
+  switch_xml_t arg2 = (switch_xml_t) 0 ;
+  switch_xml_t *arg3 = (switch_xml_t *) 0 ;
+  switch_xml_t *arg4 = (switch_xml_t *) 0 ;
+  switch_status_t result;
+  
+  arg1 = (char *)jarg1; 
+  arg2 = (switch_xml_t)jarg2; 
+  arg3 = (switch_xml_t *)jarg3; 
+  arg4 = (switch_xml_t *)jarg4; 
+  result = (switch_status_t)switch_xml_locate_user_in_domain((char const *)arg1,arg2,arg3,arg4);
   jresult = result; 
   return jresult;
 }

Modified: freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/managed/swig.cs
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/managed/swig.cs	(original)
+++ freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/managed/swig.cs	Wed Jan  7 10:17:00 2009
@@ -1499,6 +1499,22 @@
     freeswitchPINVOKE.switch_core_session_unset_write_codec(SWIGTYPE_p_switch_core_session.getCPtr(session));
   }
 
+  public static void switch_core_session_lock_codec_write(SWIGTYPE_p_switch_core_session session) {
+    freeswitchPINVOKE.switch_core_session_lock_codec_write(SWIGTYPE_p_switch_core_session.getCPtr(session));
+  }
+
+  public static void switch_core_session_unlock_codec_write(SWIGTYPE_p_switch_core_session session) {
+    freeswitchPINVOKE.switch_core_session_unlock_codec_write(SWIGTYPE_p_switch_core_session.getCPtr(session));
+  }
+
+  public static void switch_core_session_lock_codec_read(SWIGTYPE_p_switch_core_session session) {
+    freeswitchPINVOKE.switch_core_session_lock_codec_read(SWIGTYPE_p_switch_core_session.getCPtr(session));
+  }
+
+  public static void switch_core_session_unlock_codec_read(SWIGTYPE_p_switch_core_session session) {
+    freeswitchPINVOKE.switch_core_session_unlock_codec_read(SWIGTYPE_p_switch_core_session.getCPtr(session));
+  }
+
   public static switch_status_t switch_core_session_get_read_impl(SWIGTYPE_p_switch_core_session session, switch_codec_implementation impp) {
     switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_get_read_impl(SWIGTYPE_p_switch_core_session.getCPtr(session), switch_codec_implementation.getCPtr(impp));
     return ret;
@@ -3262,8 +3278,8 @@
     return ret;
   }
 
-  public static switch_status_t switch_ivr_unbind_dtmf_meta_session(SWIGTYPE_p_switch_core_session session) {
-    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_unbind_dtmf_meta_session(SWIGTYPE_p_switch_core_session.getCPtr(session));
+  public static switch_status_t switch_ivr_unbind_dtmf_meta_session(SWIGTYPE_p_switch_core_session session, uint key) {
+    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_unbind_dtmf_meta_session(SWIGTYPE_p_switch_core_session.getCPtr(session), key);
     return ret;
   }
 
@@ -3524,6 +3540,10 @@
     return ret;
   }
 
+  public static void switch_rtp_intentional_bugs(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_bug_flag_t bugs) {
+    freeswitchPINVOKE.switch_rtp_intentional_bugs(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)bugs);
+  }
+
   public static switch_status_t switch_log_init(SWIGTYPE_p_apr_pool_t pool, switch_bool_t colorize) {
     switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_log_init(SWIGTYPE_p_apr_pool_t.getCPtr(pool), (int)colorize);
     return ret;
@@ -3602,6 +3622,12 @@
     return ret;
   }
 
+  public static switch_xml switch_xml_find_child_multi(switch_xml node, string childname) {
+    IntPtr cPtr = freeswitchPINVOKE.switch_xml_find_child_multi(switch_xml.getCPtr(node), childname);
+    switch_xml ret = (cPtr == IntPtr.Zero) ? null : new switch_xml(cPtr, false);
+    return ret;
+  }
+
   public static string switch_xml_attr(switch_xml xml, string attr) {
     string ret = freeswitchPINVOKE.switch_xml_attr(switch_xml.getCPtr(xml), attr);
     return ret;
@@ -3718,8 +3744,18 @@
     return ret;
   }
 
-  public static switch_status_t switch_xml_locate_user(string key, string user_name, string domain_name, string ip, SWIGTYPE_p_p_switch_xml root, SWIGTYPE_p_p_switch_xml domain, SWIGTYPE_p_p_switch_xml user, switch_event arg7) {
-    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_xml_locate_user(key, user_name, domain_name, ip, SWIGTYPE_p_p_switch_xml.getCPtr(root), SWIGTYPE_p_p_switch_xml.getCPtr(domain), SWIGTYPE_p_p_switch_xml.getCPtr(user), switch_event.getCPtr(arg7));
+  public static switch_status_t switch_xml_locate_group(string group_name, string domain_name, SWIGTYPE_p_p_switch_xml root, SWIGTYPE_p_p_switch_xml domain, SWIGTYPE_p_p_switch_xml group, switch_event arg5) {
+    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_xml_locate_group(group_name, domain_name, SWIGTYPE_p_p_switch_xml.getCPtr(root), SWIGTYPE_p_p_switch_xml.getCPtr(domain), SWIGTYPE_p_p_switch_xml.getCPtr(group), switch_event.getCPtr(arg5));
+    return ret;
+  }
+
+  public static switch_status_t switch_xml_locate_user(string key, string user_name, string domain_name, string ip, SWIGTYPE_p_p_switch_xml root, SWIGTYPE_p_p_switch_xml domain, SWIGTYPE_p_p_switch_xml user, SWIGTYPE_p_p_switch_xml ingroup, switch_event arg8) {
+    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_xml_locate_user(key, user_name, domain_name, ip, SWIGTYPE_p_p_switch_xml.getCPtr(root), SWIGTYPE_p_p_switch_xml.getCPtr(domain), SWIGTYPE_p_p_switch_xml.getCPtr(user), SWIGTYPE_p_p_switch_xml.getCPtr(ingroup), switch_event.getCPtr(arg8));
+    return ret;
+  }
+
+  public static switch_status_t switch_xml_locate_user_in_domain(string user_name, switch_xml domain, SWIGTYPE_p_p_switch_xml user, SWIGTYPE_p_p_switch_xml ingroup) {
+    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_xml_locate_user_in_domain(user_name, switch_xml.getCPtr(domain), SWIGTYPE_p_p_switch_xml.getCPtr(user), SWIGTYPE_p_p_switch_xml.getCPtr(ingroup));
     return ret;
   }
 
@@ -4927,6 +4963,78 @@
   [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_rtp_hdr_t")]
   public static extern void delete_switch_rtp_hdr_t(HandleRef jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38MaxBitRate_set")]
+  public static extern void switch_t38_options_t_T38MaxBitRate_set(HandleRef jarg1, uint jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38MaxBitRate_get")]
+  public static extern uint switch_t38_options_t_T38MaxBitRate_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxFillBitRemoval_set")]
+  public static extern void switch_t38_options_t_T38FaxFillBitRemoval_set(HandleRef jarg1, int jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxFillBitRemoval_get")]
+  public static extern int switch_t38_options_t_T38FaxFillBitRemoval_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxTranscodingMMR_set")]
+  public static extern void switch_t38_options_t_T38FaxTranscodingMMR_set(HandleRef jarg1, int jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxTranscodingMMR_get")]
+  public static extern int switch_t38_options_t_T38FaxTranscodingMMR_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxTranscodingJBIG_set")]
+  public static extern void switch_t38_options_t_T38FaxTranscodingJBIG_set(HandleRef jarg1, int jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxTranscodingJBIG_get")]
+  public static extern int switch_t38_options_t_T38FaxTranscodingJBIG_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxRateManagement_set")]
+  public static extern void switch_t38_options_t_T38FaxRateManagement_set(HandleRef jarg1, string jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxRateManagement_get")]
+  public static extern string switch_t38_options_t_T38FaxRateManagement_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxMaxBuffer_set")]
+  public static extern void switch_t38_options_t_T38FaxMaxBuffer_set(HandleRef jarg1, uint jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxMaxBuffer_get")]
+  public static extern uint switch_t38_options_t_T38FaxMaxBuffer_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxMaxDatagram_set")]
+  public static extern void switch_t38_options_t_T38FaxMaxDatagram_set(HandleRef jarg1, uint jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxMaxDatagram_get")]
+  public static extern uint switch_t38_options_t_T38FaxMaxDatagram_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxUdpEC_set")]
+  public static extern void switch_t38_options_t_T38FaxUdpEC_set(HandleRef jarg1, string jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxUdpEC_get")]
+  public static extern string switch_t38_options_t_T38FaxUdpEC_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38VendorInfo_set")]
+  public static extern void switch_t38_options_t_T38VendorInfo_set(HandleRef jarg1, string jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38VendorInfo_get")]
+  public static extern string switch_t38_options_t_T38VendorInfo_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_ip_set")]
+  public static extern void switch_t38_options_t_ip_set(HandleRef jarg1, string jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_ip_get")]
+  public static extern string switch_t38_options_t_ip_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_port_set")]
+  public static extern void switch_t38_options_t_port_set(HandleRef jarg1, uint jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_port_get")]
+  public static extern uint switch_t38_options_t_port_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_new_switch_t38_options_t")]
+  public static extern IntPtr new_switch_t38_options_t();
+
+  [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_t38_options_t")]
+  public static extern void delete_switch_t38_options_t(HandleRef jarg1);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_input_args_t_input_callback_set")]
   public static extern void switch_input_args_t_input_callback_set(HandleRef jarg1, HandleRef jarg2);
 
@@ -5782,6 +5890,18 @@
   [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_unset_write_codec")]
   public static extern void switch_core_session_unset_write_codec(HandleRef jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_lock_codec_write")]
+  public static extern void switch_core_session_lock_codec_write(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_unlock_codec_write")]
+  public static extern void switch_core_session_unlock_codec_write(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_lock_codec_read")]
+  public static extern void switch_core_session_lock_codec_read(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_unlock_codec_read")]
+  public static extern void switch_core_session_unlock_codec_read(HandleRef jarg1);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_read_impl")]
   public static extern int switch_core_session_get_read_impl(HandleRef jarg1, HandleRef jarg2);
 
@@ -9320,7 +9440,7 @@
   public static extern int switch_ivr_bind_dtmf_meta_session(HandleRef jarg1, uint jarg2, uint jarg3, string jarg4);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_unbind_dtmf_meta_session")]
-  public static extern int switch_ivr_unbind_dtmf_meta_session(HandleRef jarg1);
+  public static extern int switch_ivr_unbind_dtmf_meta_session(HandleRef jarg1, uint jarg2);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_soft_hold")]
   public static extern int switch_ivr_soft_hold(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
@@ -9535,6 +9655,9 @@
   [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_stun_ping")]
   public static extern int switch_rtp_activate_stun_ping(HandleRef jarg1, string jarg2, ushort jarg3, uint jarg4, int jarg5);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_intentional_bugs")]
+  public static extern void switch_rtp_intentional_bugs(HandleRef jarg1, int jarg2);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_log_node_t_data_set")]
   public static extern void switch_log_node_t_data_set(HandleRef jarg1, string jarg2);
 
@@ -9583,6 +9706,12 @@
   [DllImport("mod_managed", EntryPoint="CSharp_switch_log_node_t_userdata_get")]
   public static extern string switch_log_node_t_userdata_get(HandleRef jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_log_node_t_channel_set")]
+  public static extern void switch_log_node_t_channel_set(HandleRef jarg1, int jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_log_node_t_channel_get")]
+  public static extern int switch_log_node_t_channel_get(HandleRef jarg1);
+
   [DllImport("mod_managed", EntryPoint="CSharp_new_switch_log_node_t")]
   public static extern IntPtr new_switch_log_node_t();
 
@@ -9706,6 +9835,9 @@
   [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_find_child")]
   public static extern IntPtr switch_xml_find_child(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_find_child_multi")]
+  public static extern IntPtr switch_xml_find_child_multi(HandleRef jarg1, string jarg2);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_attr")]
   public static extern string switch_xml_attr(HandleRef jarg1, string jarg2);
 
@@ -9769,8 +9901,14 @@
   [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_locate_domain")]
   public static extern int switch_xml_locate_domain(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_locate_group")]
+  public static extern int switch_xml_locate_group(string jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4, HandleRef jarg5, HandleRef jarg6);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_locate_user")]
-  public static extern int switch_xml_locate_user(string jarg1, string jarg2, string jarg3, string jarg4, HandleRef jarg5, HandleRef jarg6, HandleRef jarg7, HandleRef jarg8);
+  public static extern int switch_xml_locate_user(string jarg1, string jarg2, string jarg3, string jarg4, HandleRef jarg5, HandleRef jarg6, HandleRef jarg7, HandleRef jarg8, HandleRef jarg9);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_locate_user_in_domain")]
+  public static extern int switch_xml_locate_user_in_domain(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_open_cfg")]
   public static extern IntPtr switch_xml_open_cfg(string jarg1, HandleRef jarg2, HandleRef jarg3);
@@ -16062,7 +16200,8 @@
   SBF_DIAL_BLEG = (1 << 2),
   SBF_EXEC_BLEG = (1 << 3),
   SBF_EXEC_OPPOSITE = (1 << 4),
-  SBF_EXEC_SAME = (1 << 5)
+  SBF_EXEC_SAME = (1 << 5),
+  SBF_ONCE = (1 << 6)
 }
 
 }
@@ -18462,6 +18601,7 @@
   SWITCH_MESSAGE_INDICATE_DISPLAY,
   SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY,
   SWITCH_MESSAGE_INDICATE_AUDIO_SYNC,
+  SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA,
   SWITCH_MESSAGE_INVALID
 }
 
@@ -22265,6 +22405,16 @@
     } 
   }
 
+  public switch_text_channel_t channel {
+    set {
+      freeswitchPINVOKE.switch_log_node_t_channel_set(swigCPtr, (int)value);
+    } 
+    get {
+      switch_text_channel_t ret = (switch_text_channel_t)freeswitchPINVOKE.switch_log_node_t_channel_get(swigCPtr);
+      return ret;
+    } 
+  }
+
   public switch_log_node_t() : this(freeswitchPINVOKE.new_switch_log_node_t(), true) {
   }
 
@@ -22561,6 +22711,23 @@
 
 namespace FreeSWITCH.Native {
 
+public enum switch_rtp_bug_flag_t {
+  RTP_BUG_NONE = 0,
+  RTP_BUG_CISCO_SKIP_MARK_BIT_2833 = (1 << 0),
+  RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833 = (1 << 1)
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 public enum switch_rtp_crypto_direction_t {
   SWITCH_RTP_CRYPTO_SEND,
   SWITCH_RTP_CRYPTO_RECV,
@@ -23986,6 +24153,163 @@
 
 namespace FreeSWITCH.Native {
 
+using System;
+using System.Runtime.InteropServices;
+
+public class switch_t38_options_t : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal switch_t38_options_t(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(switch_t38_options_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~switch_t38_options_t() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchPINVOKE.delete_switch_t38_options_t(swigCPtr);
+      }
+      swigCPtr = new HandleRef(null, IntPtr.Zero);
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public uint T38MaxBitRate {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_T38MaxBitRate_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_t38_options_t_T38MaxBitRate_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public switch_bool_t T38FaxFillBitRemoval {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_T38FaxFillBitRemoval_set(swigCPtr, (int)value);
+    } 
+    get {
+      switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_t38_options_t_T38FaxFillBitRemoval_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public switch_bool_t T38FaxTranscodingMMR {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_T38FaxTranscodingMMR_set(swigCPtr, (int)value);
+    } 
+    get {
+      switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_t38_options_t_T38FaxTranscodingMMR_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public switch_bool_t T38FaxTranscodingJBIG {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_T38FaxTranscodingJBIG_set(swigCPtr, (int)value);
+    } 
+    get {
+      switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_t38_options_t_T38FaxTranscodingJBIG_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public string T38FaxRateManagement {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_T38FaxRateManagement_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_t38_options_t_T38FaxRateManagement_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint T38FaxMaxBuffer {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_T38FaxMaxBuffer_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_t38_options_t_T38FaxMaxBuffer_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint T38FaxMaxDatagram {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_T38FaxMaxDatagram_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_t38_options_t_T38FaxMaxDatagram_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public string T38FaxUdpEC {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_T38FaxUdpEC_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_t38_options_t_T38FaxUdpEC_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public string T38VendorInfo {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_T38VendorInfo_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_t38_options_t_T38VendorInfo_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public string ip {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_ip_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_t38_options_t_ip_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint port {
+    set {
+      freeswitchPINVOKE.switch_t38_options_t_port_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_t38_options_t_port_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public switch_t38_options_t() : this(freeswitchPINVOKE.new_switch_t38_options_t(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 public enum switch_text_channel_t {
   SWITCH_CHANNEL_ID_LOG,
   SWITCH_CHANNEL_ID_LOG_CLEAN,

Modified: freeswitch/branches/gmaruzz/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Wed Jan  7 10:17:00 2009
@@ -42,7 +42,7 @@
 
 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);
+SWITCH_MODULE_DEFINITION_EX(mod_spidermonkey, mod_spidermonkey_load, mod_spidermonkey_shutdown, NULL, SMODF_GLOBAL_SYMBOLS);
 
 #define METHOD_SANITY_CHECK()  if (!jss || !jss->session) {				\
 		eval_some_js("~throw new Error(\"You must call the session.originate method before calling this method!\");", cx, obj, rval); \
@@ -882,50 +882,54 @@
 static switch_status_t sm_load_file(char *filename)
 {
 	sm_loadable_module_t *module = NULL;
-	switch_dso_handle_t *dso = NULL;
+	switch_dso_lib_t dso = NULL;
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
-	switch_dso_handle_sym_t function_handle = NULL;
+	switch_loadable_module_function_table_t *function_handle = NULL;
 	spidermonkey_init_t spidermonkey_init = NULL;
 	const sm_module_interface_t *module_interface = NULL, *mp;
-
-	int loading = 1;
+	char *derr = NULL;
 	const char *err = NULL;
-	char derr[512] = "";
 
 	switch_assert(filename != NULL);
 
-	status = switch_dso_load(&dso, filename, module_manager.pool);
+	if (!(dso = switch_dso_open(filename, 1, &derr))) {
+		status = SWITCH_STATUS_FALSE;
+	}
 
-	while (loading) {
-		if (status != SWITCH_STATUS_SUCCESS) {
-			switch_dso_error(dso, derr, sizeof(derr));
-			err = derr;
-			break;
-		}
+	if (derr || status != SWITCH_STATUS_SUCCESS) {
+		err = derr;
+		goto err;
+	}
 
-		status = switch_dso_sym(&function_handle, dso, "spidermonkey_init");
-		spidermonkey_init = (spidermonkey_init_t) (intptr_t) function_handle;
+	function_handle = switch_dso_data_sym(dso, "spidermonkey_init", &derr);
 
-		if (spidermonkey_init == NULL) {
-			err = "Cannot Load";
-			break;
-		}
+	if (!function_handle || derr) {
+		status = SWITCH_STATUS_FALSE;
+		err = derr;
+		goto err;
+	}
 
-		if (spidermonkey_init(&module_interface) != SWITCH_STATUS_SUCCESS) {
-			err = "Module load routine returned an error";
-			break;
-		}
+	spidermonkey_init = (spidermonkey_init_t) (intptr_t) function_handle;
 
-		if (!(module = (sm_loadable_module_t *) switch_core_permanent_alloc(sizeof(*module)))) {
-			err = "Could not allocate memory\n";
-			break;
-		}
+	if (spidermonkey_init == NULL) {
+		err = "Cannot Load";
+		goto err;
+	}
+
+	if (spidermonkey_init(&module_interface) != SWITCH_STATUS_SUCCESS) {
+		err = "Module load routine returned an error";
+		goto err;
+	}
 
-		loading = 0;
+	if (!(module = (sm_loadable_module_t *) switch_core_permanent_alloc(sizeof(*module)))) {
+		err = "Could not allocate memory\n";
 	}
 
-	if (err) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Loading module %s\n**%s**\n", filename, err);
+ err:
+
+	if (err || !module) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Loading module %s\n**%s**\n", filename, switch_str_nil(err));
+		switch_safe_free(derr);
 		return SWITCH_STATUS_GENERR;
 	}
 

Modified: freeswitch/branches/gmaruzz/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	Wed Jan  7 10:17:00 2009
@@ -95,10 +95,12 @@
 	if (!globals.port) {
 		globals.port = 8080;
 	}
-	if (user && pass && realm) {
+	if (realm) {
 		set_global_realm(realm);
-		set_global_user(user);
-		set_global_pass(pass);
+		if (user && pass) {
+			set_global_user(user);
+			set_global_pass(pass);
+		}
 	}
 	switch_xml_free(xml);
 
@@ -176,6 +178,7 @@
 				if ((dp = strchr(user, '@'))) {
 					*dp++ = '\0';
 					domain_name = dp;
+					at++;
 				}
 				
 				if (!domain_name) {
@@ -194,19 +197,21 @@
 					goto fail;
 				}
 
-				switch_snprintf(z, sizeof(z), "%s:%s", globals.user, globals.pass);
-				Base64Encode(z, t);
+				if (!switch_strlen_zero(globals.user)) {
+					switch_snprintf(z, sizeof(z), "%s:%s", globals.user, globals.pass);
+					Base64Encode(z, t);
 
-				if (!strcmp(p, t)) {
-					r->requestInfo.user = strdup(user);
-					goto authed;
+					if (!strcmp(p, t)) {
+						r->requestInfo.user = strdup(user);
+						goto authed;
+					}
 				}
 
 				switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
 				switch_assert(params);
 				switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", "check");
 
-				if (switch_xml_locate_user("id", user, domain_name, NULL, &x_domain_root, &x_domain, &x_user, params) != SWITCH_STATUS_SUCCESS) {
+				if (switch_xml_locate_user("id", user, domain_name, NULL, &x_domain_root, &x_domain, &x_user, NULL, params) != SWITCH_STATUS_SUCCESS) {
 					switch_event_destroy(&params);
 					goto fail;
 				}
@@ -496,7 +501,7 @@
 		}
 	}
 
-	if (!fs_user || !strcmp(fs_user, globals.user)) {
+	if (!fs_user || (!switch_strlen_zero(globals.user) && !strcmp(fs_user, globals.user))) {
 		auth = 1;
 	} else {
 		if (!j) {

Modified: freeswitch/branches/gmaruzz/src/switch_apr.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_apr.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_apr.c	Wed Jan  7 10:17:00 2009
@@ -761,9 +761,9 @@
 
 SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from, switch_socket_t *sock, int32_t flags, char *buf, size_t *len)
 {
-	apr_status_t r;
+	apr_status_t r = SWITCH_STATUS_GENERR;
 
-	if ((r = apr_socket_recvfrom(from, sock, flags, buf, len)) == APR_SUCCESS) {
+	if (from && sock && (r = apr_socket_recvfrom(from, sock, flags, buf, len)) == APR_SUCCESS) {
 		from->port = ntohs(from->sa.sin.sin_port);
 		/* from->ipaddr_ptr = &(from->sa.sin.sin_addr);
 		 * from->ipaddr_ptr = inet_ntoa(from->sa.sin.sin_addr);

Modified: freeswitch/branches/gmaruzz/src/switch_channel.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_channel.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_channel.c	Wed Jan  7 10:17:00 2009
@@ -1140,13 +1140,12 @@
 	return channel->state;
 }
 
-SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, switch_event_t *event)
+SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *channel, switch_event_t *event)
 {
 	switch_caller_profile_t *caller_profile, *originator_caller_profile = NULL, *originatee_caller_profile = NULL;
-	switch_event_header_t *hi;
 	switch_codec_t *codec;
 	char state_num[25];
-	int x;
+
 	switch_mutex_lock(channel->profile_mutex);
 
 	if ((caller_profile = switch_channel_get_caller_profile(channel))) {
@@ -1178,7 +1177,7 @@
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Name", switch_str_nil(codec->implementation->iananame));
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Rate", "%u", codec->implementation->actual_samples_per_second);
 	}
-	
+
 	/* Index Caller's Profile */
 	if (caller_profile) {
 		switch_caller_profile_event_set_data(caller_profile, "Caller", event);
@@ -1199,7 +1198,16 @@
 		}
 	}
 
+	switch_mutex_unlock(channel->profile_mutex);
+}
+
+SWITCH_DECLARE(void) switch_channel_event_set_extended_data(switch_channel_t *channel, switch_event_t *event)
+{
+	switch_event_header_t *hi;
+	int x;
 
+	switch_mutex_lock(channel->profile_mutex);
+	
 	if (switch_channel_test_flag(channel, CF_VERBOSE_EVENTS) || 
 		event->event_id == SWITCH_EVENT_CHANNEL_ORIGINATE ||
 		event->event_id == SWITCH_EVENT_CHANNEL_UUID ||
@@ -1235,6 +1243,17 @@
 	switch_mutex_unlock(channel->profile_mutex);
 }
 
+
+SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, switch_event_t *event)
+{
+	switch_mutex_lock(channel->profile_mutex);
+	switch_channel_event_set_basic_data(channel, event);
+	switch_channel_event_set_extended_data(channel, event);
+	switch_mutex_unlock(channel->profile_mutex);
+}
+
+
+
 SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
 {
 	char *uuid = NULL;
@@ -1628,8 +1647,8 @@
 
 	msg.message_id = SWITCH_MESSAGE_INDICATE_PROGRESS;
 	msg.from = channel->name;
-	status = switch_core_session_receive_message(channel->session, &msg);
-
+	status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
+	
 	if (status == SWITCH_STATUS_SUCCESS) {
 		switch_channel_perform_mark_pre_answered(channel, file, func, line);
 	} else {
@@ -1660,7 +1679,7 @@
 
 	msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING;
 	msg.from = channel->name;
-	status = switch_core_session_receive_message(channel->session, &msg);
+	status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
 
 	if (status == SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Ring Ready %s!\n", channel->name);
@@ -1765,7 +1784,7 @@
 
 	msg.message_id = SWITCH_MESSAGE_INDICATE_ANSWER;
 	msg.from = channel->name;
-	status = switch_core_session_receive_message(channel->session, &msg);
+	status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
 
 	if (status == SWITCH_STATUS_SUCCESS) {
 		switch_channel_perform_mark_answered(channel, file, func, line);

Modified: freeswitch/branches/gmaruzz/src/switch_console.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_console.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_console.c	Wed Jan  7 10:17:00 2009
@@ -249,10 +249,18 @@
 
 	SWITCH_STANDARD_STREAM(stream);
 	if (stream.data) {
+		FILE *handle = switch_core_get_console();
+
 		if (switch_api_execute(cmd, arg, NULL, &stream) == SWITCH_STATUS_SUCCESS) {
-			switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "API CALL [%s(%s)] output:\n%s\n", cmd, arg ? arg : "", (char *) stream.data);
+			if (handle) {
+				fprintf(handle, "API CALL [%s(%s)] output:\n%s\n", cmd, arg ? arg : "", (char *) stream.data);
+				fflush(handle);
+			}
 		} else {
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Unknown Command: %s\n", cmd);
+			if (handle) {
+				fprintf(handle, "Unknown Command: %s\n", cmd);
+				fflush(handle);
+			}
 		}
 		free(stream.data);
 	} else {

Modified: freeswitch/branches/gmaruzz/src/switch_core.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_core.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_core.c	Wed Jan  7 10:17:00 2009
@@ -168,7 +168,7 @@
 
 SWITCH_DECLARE(void) switch_core_remove_state_handler(const switch_state_handler_table_t *state_handler)
 {
-	int index, total = 0;
+	int index, tmp_index = 0;
 	const switch_state_handler_table_t *tmp[SWITCH_MAX_STATE_HANDLERS+1] = { 0 };
 	
 	switch_mutex_lock(runtime.global_mutex);
@@ -179,13 +179,12 @@
 		if (cur == state_handler) {
 			continue;
 		}
-		tmp[index] = runtime.state_handlers[index];
-		total++;
+		tmp[tmp_index++] = cur;
 	}
 
 	runtime.state_handler_index = 0;
 
-	for (index = 0; index < total; index++) {
+	for (index = 0; index < tmp_index; index++) {
 		runtime.state_handlers[runtime.state_handler_index++] = tmp[index];
 	}
 	switch_mutex_unlock(runtime.global_mutex);
@@ -881,7 +880,7 @@
 					if (domain) {
 						switch_event_t *my_params = NULL;
 						switch_xml_t x_domain, xml_root;
-						switch_xml_t ut;
+						switch_xml_t gt, gts, ut, uts;
 
 						switch_event_create(&my_params, SWITCH_EVENT_GENERAL);
 						switch_assert(my_params);
@@ -914,6 +913,32 @@
 								free(token);
 							}
 						}
+
+						for (gts = switch_xml_child(x_domain, "groups"); gts; gts = gts->next) {
+							for (gt = switch_xml_child(gts, "group"); gt; gt = gt->next) {
+								for (uts = switch_xml_child(gt, "users"); uts; uts = uts->next) {
+									for (ut = switch_xml_child(uts, "user"); ut; ut = ut->next) {
+										const char *user_cidr = switch_xml_attr(ut, "cidr");
+										const char *id = switch_xml_attr(ut, "id");
+										
+										if (id && user_cidr) {
+											char *token = switch_mprintf("%s@%s", id, domain);
+											switch_assert(token);
+											
+											if (switch_network_list_add_cidr_token(list, user_cidr, ok, token) == SWITCH_STATUS_SUCCESS) {
+												switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding %s (%s) [%s] to list %s\n", 
+																  user_cidr, ok ? "allow" : "deny", switch_str_nil(token), name);
+											} else {
+												switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Adding %s (%s) [%s] to list %s\n",
+																  user_cidr, ok ? "allow" : "deny", switch_str_nil(token), name);
+											}
+											free(token);
+										}
+									}
+								}
+							}
+						}
+
 						switch_xml_free(xml_root);
 					} else if (cidr) {
 						if (switch_network_list_add_cidr(list, cidr, ok) == SWITCH_STATUS_SUCCESS) {

Modified: freeswitch/branches/gmaruzz/src/switch_core_io.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_core_io.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_core_io.c	Wed Jan  7 10:17:00 2009
@@ -539,10 +539,6 @@
 	switch_mutex_unlock(session->read_codec->mutex);
 	switch_mutex_unlock(session->codec_read_mutex);
 
-	if (switch_core_session_private_event_count(session)) {
-		switch_ivr_parse_all_events(session);
-	}
-
 	return status;
 }
 
@@ -571,7 +567,7 @@
 
 	switch_status_t status = SWITCH_STATUS_FALSE;
 	switch_frame_t *enc_frame = NULL, *write_frame = frame;
-	unsigned int flag = 0, need_codec = 0, perfect = 0, do_bugs = 0, do_write = 0, do_resample = 0, ptime_mismatch = 0, pass_cng = 0;
+	unsigned int flag = 0, need_codec = 0, perfect = 0, do_bugs = 0, do_write = 0, do_resample = 0, ptime_mismatch = 0, pass_cng = 0, resample = 0;
 	
 	switch_assert(session != NULL);
 	switch_assert(frame != NULL);
@@ -645,6 +641,7 @@
 
 	if (!need_codec) {
 		do_write = TRUE;
+		write_frame = frame;
 		goto done;
 	}
 
@@ -674,6 +671,7 @@
 
 		switch (status) {
 		case SWITCH_STATUS_RESAMPLE:
+			resample++;
 			write_frame = &session->raw_write_frame;
 			if (!session->write_resampler) {
 				switch_mutex_lock(session->resample_mutex);
@@ -842,6 +840,7 @@
 
 			switch (status) {
 			case SWITCH_STATUS_RESAMPLE:
+				resample++;
 				/* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fixme 2\n"); */
 			case SWITCH_STATUS_SUCCESS:
 				session->enc_write_frame.codec = session->write_codec;
@@ -916,6 +915,7 @@
 														  &session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
 						switch (status) {
 						case SWITCH_STATUS_RESAMPLE:
+							resample++;
 							session->enc_write_frame.codec = session->write_codec;
 							session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t);
 							session->enc_write_frame.m = frame->m;
@@ -987,9 +987,14 @@
 							switch_mutex_unlock(session->resample_mutex);
 
 						}
+
 						if (flag & SFF_CNG) {
 							switch_set_flag(write_frame, SFF_CNG);
 						}
+						
+						if (ptime_mismatch || resample) {
+							write_frame->timestamp = 0;
+						}
 
 						if ((status = perform_write(session, write_frame, flags, stream_id)) != SWITCH_STATUS_SUCCESS) {
 							break;
@@ -1003,8 +1008,12 @@
 	
  done:
 
+	if (ptime_mismatch || resample) {
+		write_frame->timestamp = 0;
+	}
+
 	if (do_write) {
-		status = perform_write(session, frame, flags, stream_id);
+		status = perform_write(session, write_frame, flags, stream_id);
 	}
 	
  error:

Modified: freeswitch/branches/gmaruzz/src/switch_core_session.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_core_session.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_core_session.c	Wed Jan  7 10:17:00 2009
@@ -421,28 +421,29 @@
 }
 
 static const char *message_names[] = {
-	"SWITCH_MESSAGE_REDIRECT_AUDIO",
-	"SWITCH_MESSAGE_TRANSMIT_TEXT",
-	"SWITCH_MESSAGE_INDICATE_ANSWER",
-	"SWITCH_MESSAGE_INDICATE_PROGRESS",
-	"SWITCH_MESSAGE_INDICATE_BRIDGE",
-	"SWITCH_MESSAGE_INDICATE_UNBRIDGE",
-	"SWITCH_MESSAGE_INDICATE_TRANSFER",
-	"SWITCH_MESSAGE_INDICATE_RINGING",
-	"SWITCH_MESSAGE_INDICATE_MEDIA",
-	"SWITCH_MESSAGE_INDICATE_NOMEDIA",
-	"SWITCH_MESSAGE_INDICATE_HOLD",
-	"SWITCH_MESSAGE_INDICATE_UNHOLD",
-	"SWITCH_MESSAGE_INDICATE_REDIRECT",
-	"SWITCH_MESSAGE_INDICATE_RESPOND",
-	"SWITCH_MESSAGE_INDICATE_BROADCAST",
-	"SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT",
-	"SWITCH_MESSAGE_INDICATE_DEFLECT",
-	"SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ",
-	"SWITCH_MESSAGE_INDICATE_DISPLAY",
-	"SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY",
-	"SWITCH_MESSAGE_INDICATE_AUDIO_SYNC",
-	"SWITCH_MESSAGE_INVALID"
+	"REDIRECT_AUDIO",
+	"TRANSMIT_TEXT",
+	"ANSWER",
+	"PROGRESS",
+	"BRIDGE",
+	"UNBRIDGE",
+	"TRANSFER",
+	"RINGING",
+	"MEDIA",
+	"NOMEDIA",
+	"HOLD",
+	"UNHOLD",
+	"REDIRECT",
+	"RESPOND",
+	"BROADCAST",
+	"MEDIA_REDIRECT",
+	"DEFLECT",
+	"VIDEO_REFRESH_REQ",
+	"DISPLAY",
+	"TRANSCODING_NECESSARY",
+	"AUDIO_SYNC",
+	"REQUEST_IMAGE_MEDIA",
+	"INVALID"
 };
 
 SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(switch_core_session_t *session, 

Modified: freeswitch/branches/gmaruzz/src/switch_core_state_machine.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_core_state_machine.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_core_state_machine.c	Wed Jan  7 10:17:00 2009
@@ -206,6 +206,7 @@
 
 //static switch_hash_t *stack_table = NULL;
 static Hash stack_table;
+static switch_mutex_t *stack_mutex = NULL;
 
 #if defined (__GNUC__) && defined (LINUX) && defined (HAVE_EXECINFO_H)
 #include <execinfo.h>
@@ -244,9 +245,14 @@
 	switch_thread_id_t thread_id;
 	jmp_buf *env;
 
-	if (sig && (thread_id = switch_thread_self())
-		&& (env = (jmp_buf *) sqlite3HashFind(&stack_table, &thread_id, sizeof(thread_id)))) {
-		//&& (env = (jmp_buf *) switch_core_hash_find(stack_table, (char *)&thread_id, sizeof(thread_id)))) {
+	if (!sig) return;
+
+	thread_id = switch_thread_self();
+	switch_mutex_lock(stack_mutex);
+	env = (jmp_buf *) sqlite3HashFind(&stack_table, &thread_id, sizeof(thread_id));
+	switch_mutex_unlock(stack_mutex);
+
+	if (thread_id && env) {
 		print_trace();
 		longjmp(*env, sig);
 	} else {
@@ -259,7 +265,10 @@
 {
 
 	if (switch_test_flag((&runtime), SCF_CRASH_PROT)) {
+		switch_mutex_init(&stack_mutex, SWITCH_MUTEX_NESTED, pool);
+		switch_mutex_lock(stack_mutex);
 		sqlite3HashInit(&stack_table, SQLITE_HASH_BINARY, 0);
+		switch_mutex_unlock(stack_mutex);
 	}
 }
 
@@ -328,8 +337,9 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Thread has crashed for channel %s\n", switch_channel_get_name(session->channel));
 			switch_channel_hangup(session->channel, SWITCH_CAUSE_CRASH);
 		} else {
+			switch_mutex_lock(stack_mutex);
 			sqlite3HashInsert(&stack_table, &thread_id, sizeof(thread_id), (void *) &env);
-			//apr_hash_set(stack_table, &thread_id, sizeof(thread_id), &env);
+			switch_mutex_unlock(stack_mutex);
 		}
 	}
 
@@ -399,6 +409,8 @@
 					
 					STATE_MACRO(hangup, "HANGUP");
 					
+					switch_core_media_bug_remove_all(session);
+
 					hook_var = switch_channel_get_variable(session->channel, SWITCH_API_HANGUP_HOOK_VARIABLE);
 					if (switch_true(switch_channel_get_variable(session->channel, SWITCH_SESSION_IN_HANGUP_HOOK_VARIABLE))) {
 						use_session = session;

Modified: freeswitch/branches/gmaruzz/src/switch_dso.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_dso.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_dso.c	Wed Jan  7 10:17:00 2009
@@ -24,14 +24,14 @@
 
 #ifdef WIN32
 
-void switch_dso_destroy(switch_dso_lib_t *lib) {
+SWITCH_DECLARE(void) switch_dso_destroy(switch_dso_lib_t *lib) {
 	if (lib && *lib) {
 		FreeLibrary(*lib);
 		*lib = NULL;
 	}
 }
 
-switch_dso_lib_t switch_dso_open(const char *path, int global, char **err) {
+SWITCH_DECLARE(switch_dso_lib_t) switch_dso_open(const char *path, int global, char **err) {
     HINSTANCE lib;
 	
 	lib = LoadLibraryEx(path, NULL, 0);
@@ -48,7 +48,7 @@
 	return lib;
 }
 
-switch_dso_func_t switch_dso_func_sym(switch_dso_lib_t lib, const char *sym, char **err) {
+SWITCH_DECLARE(switch_dso_func_t) switch_dso_func_sym(switch_dso_lib_t lib, const char *sym, char **err) {
 	FARPROC func = GetProcAddress(lib, sym);
 	if (!func) {
 		DWORD error = GetLastError();
@@ -57,7 +57,7 @@
 	return (switch_dso_func_t)func;
 }
 
-void *switch_dso_data_sym(switch_dso_lib_t lib, const char *sym, char **err) {
+SWITCH_DECLARE(void *) switch_dso_data_sym(switch_dso_lib_t lib, const char *sym, char **err) {
 	FARPROC addr = GetProcAddress(lib, sym);
 	if (!addr) {
 		DWORD error = GetLastError();

Modified: freeswitch/branches/gmaruzz/src/switch_event.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_event.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_event.c	Wed Jan  7 10:17:00 2009
@@ -930,13 +930,20 @@
 
 static switch_xml_t add_xml_header(switch_xml_t xml, char *name, char *value, int offset)
 {
-	switch_xml_t header = switch_xml_add_child_d(xml, "header", offset);
-
+	switch_xml_t header = switch_xml_add_child_d(xml, name, offset);
+	
 	if (header) {
-		switch_xml_set_attr_d(header, "name", name);
-		switch_xml_set_attr_d(header, "value", value);
+		int encode_len = (strlen(value) * 3) + 1;
+		char *encode_buf = malloc(encode_len);
+		
+		switch_assert(encode_buf);
+ 
+		memset(encode_buf, 0, encode_len);
+		switch_url_encode((char *) value, encode_buf, encode_len);
+		switch_xml_set_txt_d(header, encode_buf);
+		free(encode_buf);
 	}
-
+	
 	return header;
 }
 
@@ -948,6 +955,7 @@
 	switch_xml_t xml = NULL;
 	uint32_t off = 0;
 	va_list ap;
+	switch_xml_t xheaders = NULL;
 
 	if (!(xml = switch_xml_new("event"))) {
 		return xml;
@@ -972,8 +980,11 @@
 		}
 	}
 
-	for (hp = event->headers; hp; hp = hp->next) {
-		add_xml_header(xml, hp->name, hp->value, off++);
+	if ((xheaders = switch_xml_add_child_d(xml, "headers", off++))) {
+		int hoff = 0;
+		for (hp = event->headers; hp; hp = hp->next) {
+			add_xml_header(xheaders, hp->name, hp->value, hoff++);
+		}
 	}
 
 	if (!switch_strlen_zero(data)) {
@@ -1032,7 +1043,7 @@
 	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Date-Local", date);
 	switch_rfc822_date(date, ts);
 	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Date-GMT", date);
-	switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Event-Date-timestamp", "%" SWITCH_UINT64_T_FMT, (uint64_t) ts);
+	switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Event-Date-Timestamp", "%" SWITCH_UINT64_T_FMT, (uint64_t) ts);
 	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Calling-File", switch_cut_path(file));
 	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Calling-Function", func);
 	switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Event-Calling-Line-Number", "%d", line);

Modified: freeswitch/branches/gmaruzz/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_ivr.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_ivr.c	Wed Jan  7 10:17:00 2009
@@ -41,6 +41,7 @@
 SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms, switch_bool_t sync, switch_input_args_t *args)
 {
 	switch_channel_t *channel = switch_core_session_get_channel(session);
+	int media_ready = 0;
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	switch_time_t start = switch_timestamp_now(), now, done = switch_timestamp_now() + (ms * 1000);
 	switch_frame_t *read_frame, cng_frame = { 0 };
@@ -53,10 +54,19 @@
 	switch_codec_t codec = { 0 };
 	int sval = 0;
 	const char *var;
+
+	if (!switch_channel_test_flag(channel, CF_PROXY_MODE) && !switch_channel_media_ready(channel) && !switch_channel_test_flag(channel, CF_SERVICE)) {
+		if ((status = switch_channel_pre_answer(channel)) != SWITCH_STATUS_SUCCESS) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot establish media.\n");
+			return SWITCH_STATUS_FALSE;
+		}
+	}
+
+	media_ready = (switch_channel_media_ready(channel) && !switch_channel_test_flag(channel, CF_SERVICE));
 	
-	if ((var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE)) && (sval = atoi(var))) {
+	if (ms > 100 && media_ready && (var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE)) && (sval = atoi(var))) {
 		switch_core_session_get_read_impl(session, &imp);
-	
+		
 		if (switch_core_codec_init(&codec,
 								   "L16",
 								   NULL,
@@ -81,12 +91,10 @@
 		write_frame.datalen = imp.decoded_bytes_per_packet;
 		write_frame.samples = write_frame.datalen / sizeof(int16_t);
 
-		if (!switch_channel_media_ready(channel)) {
-			if ((status = switch_channel_pre_answer(channel)) != SWITCH_STATUS_SUCCESS) {
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot establish media.\n");
-				return SWITCH_STATUS_FALSE;
-			}
-		}
+	}
+
+	if (!write_frame.datalen) {
+		sval = 0;
 	}
 
 	cng_frame.data = data;
@@ -94,7 +102,7 @@
 	cng_frame.buflen = 2;
 	switch_set_flag((&cng_frame), SFF_CNG);
 
-	if (sync && !switch_channel_test_flag(channel, CF_PROXY_MODE)) {
+	if (sync && media_ready) {
 		switch_channel_audio_sync(channel);
 	}
 	
@@ -161,29 +169,25 @@
 			}
 		}
 
-		if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
+		if (!media_ready) {
 			switch_cond_next();
 			continue;
 		}
 
-		if (switch_channel_test_flag(channel, CF_SERVICE) ||
-			(!switch_channel_test_flag(channel, CF_ANSWERED) && !switch_channel_test_flag(channel, CF_EARLY_MEDIA))) {
-			switch_cond_next();
-		} else {
-			status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
-			if (!SWITCH_READ_ACCEPTABLE(status)) {
-				break;
-			}
+		status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
+
+		if (!SWITCH_READ_ACCEPTABLE(status)) {
+			break;
 		}
 
-		if (sval) {
+		if (sval && write_frame.datalen) {
 			switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.samples, sval);
 			switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
 		} else {
 			switch_core_session_write_frame(session, &cng_frame, SWITCH_IO_FLAG_NONE, 0);
 		}
 	}
-
+	
 	if (write_frame.codec) {
 		switch_core_codec_destroy(&codec);
 	}
@@ -1920,7 +1924,7 @@
 
 SWITCH_DECLARE(switch_status_t) switch_ivr_set_user(switch_core_session_t *session, const char *data)
 {
-	switch_xml_t x_domain, xml = NULL, x_user, x_param, x_params;
+	switch_xml_t x_domain, xml = NULL, x_user, x_param, x_params, x_group = NULL;
 	char *user, *mailbox, *domain;
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 	switch_status_t status = SWITCH_STATUS_FALSE;
@@ -1937,7 +1941,7 @@
 
 	*domain++ = '\0';
 
-	if (switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, NULL) != SWITCH_STATUS_SUCCESS) {
+	if (switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, &x_group, NULL) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "can't find user [%s@%s]\n", user, domain);
 		goto done;
 	}
@@ -1959,6 +1963,17 @@
 		}
 	}
 
+	if (x_group && (x_params = switch_xml_child(x_group, "variables"))) {
+		for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) {
+			const char *var = switch_xml_attr(x_param, "name");
+			const char *val = switch_xml_attr(x_param, "value");
+
+			if (var && val) {
+				switch_channel_set_variable(channel, var, val);
+			}
+		}
+	}
+
 	if ((x_params = switch_xml_child(x_user, "variables"))) {
 		for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) {
 			const char *var = switch_xml_attr(x_param, "name");

Modified: freeswitch/branches/gmaruzz/src/switch_ivr_async.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_ivr_async.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_ivr_async.c	Wed Jan  7 10:17:00 2009
@@ -1445,6 +1445,44 @@
 
 #define SWITCH_META_VAR_KEY "__dtmf_meta"
 
+typedef struct {
+	switch_core_session_t *session;
+	const char *app;
+	int flags;
+} bch_t;
+
+static void *SWITCH_THREAD_FUNC bcast_thread(switch_thread_t *thread, void *obj)
+{
+	bch_t *bch = (bch_t *) obj;
+
+	switch_ivr_broadcast(switch_core_session_get_uuid(bch->session), bch->app, bch->flags);
+
+	return NULL;
+
+}
+static void broadcast_in_thread(switch_core_session_t *session, const char *app, int flags)
+{
+	switch_thread_t *thread;
+	switch_threadattr_t *thd_attr = NULL;
+	switch_memory_pool_t *pool;
+	bch_t *bch;
+	
+	switch_assert(session);
+
+	pool = switch_core_session_get_pool(session);
+	
+	bch = switch_core_session_alloc(session, sizeof(*bch));
+	bch->session = session;
+	bch->app = app;
+	bch->flags = flags;
+	
+	
+	switch_threadattr_create(&thd_attr, pool);
+	switch_threadattr_detach_set(thd_attr, 1);
+	switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
+	switch_thread_create(&thread, thd_attr, bcast_thread, bch, pool);
+}
+
 static switch_status_t meta_on_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf, switch_dtmf_direction_t direction)
 {
 	switch_channel_t *channel = switch_core_session_get_channel(session);
@@ -1497,7 +1535,7 @@
 
 			if (ok && md->sr[direction].map[dval].app) {
 				uint32_t flags = md->sr[direction].map[dval].flags;
-
+				
 				if ((md->sr[direction].map[dval].bind_flags & SBF_EXEC_OPPOSITE)) {
 					if (direction == SWITCH_DTMF_SEND) {
 						flags |= SMF_ECHO_ALEG;
@@ -1520,7 +1558,19 @@
 
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Processing meta digit '%c' [%s]\n",
 								  switch_channel_get_name(channel), dtmf->digit, md->sr[direction].map[dval].app);
-				switch_ivr_broadcast(switch_core_session_get_uuid(session), md->sr[direction].map[dval].app, flags);
+
+				if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
+					broadcast_in_thread(session, md->sr[direction].map[dval].app, flags | SMF_REBRIDGE);
+				} else {
+					switch_ivr_broadcast(switch_core_session_get_uuid(session), md->sr[direction].map[dval].app, flags);
+				}
+
+				if ((md->sr[direction].map[dval].bind_flags & SBF_ONCE)) {
+					memset(&md->sr[direction].map[dval], 0, sizeof(md->sr[direction].map[dval]));
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Unbinding meta digit '%c'\n",
+									  switch_channel_get_name(channel), dtmf->digit);
+				}
+
 			} else {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s Ignoring meta digit '%c' not mapped\n",
 								  switch_channel_get_name(channel), dtmf->digit);
@@ -1534,10 +1584,26 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_unbind_dtmf_meta_session(switch_core_session_t *session)
+SWITCH_DECLARE(switch_status_t) switch_ivr_unbind_dtmf_meta_session(switch_core_session_t *session, uint32_t key)
 {
 	switch_channel_t *channel = switch_core_session_get_channel(session);
-	switch_channel_set_private(channel, SWITCH_META_VAR_KEY, NULL);
+	
+	if (key) {
+		dtmf_meta_data_t *md = switch_channel_get_private(channel, SWITCH_META_VAR_KEY);
+		
+		if (!md || key > 9) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid key %u\n", key);
+			return SWITCH_STATUS_FALSE;
+		}
+		
+		memset(&md->sr[SWITCH_DTMF_RECV].map[key], 0, sizeof(md->sr[SWITCH_DTMF_RECV].map[key]));
+		memset(&md->sr[SWITCH_DTMF_SEND].map[key], 0, sizeof(md->sr[SWITCH_DTMF_SEND].map[key]));
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "UnBound A-Leg: %d\n", key);
+
+	} else {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "UnBound A-Leg: ALL\n");
+		switch_channel_set_private(channel, SWITCH_META_VAR_KEY, NULL);
+	}
 
 	return SWITCH_STATUS_SUCCESS;
 }
@@ -1566,7 +1632,7 @@
 			md->sr[SWITCH_DTMF_RECV].map[key].app = switch_core_session_strdup(session, app);
 			md->sr[SWITCH_DTMF_RECV].map[key].flags |= SMF_HOLD_BLEG;
 			md->sr[SWITCH_DTMF_RECV].map[key].bind_flags = bind_flags;
-
+			
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Bound A-Leg: %d %s\n", key, app);
 		}
 		if ((bind_flags & SBF_DIAL_BLEG)) {
@@ -2134,6 +2200,10 @@
 		other_session = NULL;
 	}
 
+	if (switch_stristr("record", app)) {
+		nomedia = 0;
+	}
+
 	if ((flags & SMF_ECHO_ALEG)) {
 		if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");

Modified: freeswitch/branches/gmaruzz/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_ivr_bridge.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_ivr_bridge.c	Wed Jan  7 10:17:00 2009
@@ -829,8 +829,8 @@
 			switch_channel_set_variable(peer_channel, SWITCH_BRIDGE_VARIABLE, switch_core_session_get_uuid(session));
 
 			if (!switch_channel_media_ready(caller_channel) || 
-				!(switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA))) {
-				if ((status = switch_ivr_wait_for_answer(session, peer_session)) != SWITCH_STATUS_SUCCESS) {
+				(!switch_channel_test_flag(peer_channel, CF_ANSWERED) && !switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA))) {
+				if ((status = switch_ivr_wait_for_answer(session, peer_session)) != SWITCH_STATUS_SUCCESS || !switch_channel_ready(caller_channel)) {
 					switch_channel_state_t w_state = switch_channel_get_state(caller_channel);
 					switch_channel_hangup(peer_channel, SWITCH_CAUSE_ALLOTTED_TIMEOUT);
 					if (w_state < CS_HANGUP && w_state != CS_ROUTING && w_state != CS_PARK && 
@@ -850,6 +850,7 @@
 					switch_core_session_rwunlock(peer_session);
 					goto done;
 				}
+
 				if (switch_channel_test_flag(peer_channel, CF_ANSWERED) && !switch_channel_test_flag(caller_channel, CF_ANSWERED)) {
 					switch_channel_answer(caller_channel);
 				}
@@ -1187,7 +1188,7 @@
 		switch_channel_answer(rchannel);
 	}
 
-	switch_channel_set_state_flag(rchannel, CF_TRANSFER);
+ 	switch_channel_set_state_flag(rchannel, CF_TRANSFER);
 	switch_channel_set_state(rchannel, CS_PARK);
 	
 	if (bchannel) {

Modified: freeswitch/branches/gmaruzz/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_ivr_originate.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_ivr_originate.c	Wed Jan  7 10:17:00 2009
@@ -39,6 +39,16 @@
 {
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
+	if (!switch_channel_test_flag(channel, CF_PROXY_MODE)) {
+		while (switch_channel_get_state(channel) == CS_CONSUME_MEDIA && !switch_channel_test_flag(channel, CF_TAGGED)) {
+			if (!switch_channel_media_ready(channel)) {
+				switch_yield(10000);
+			} else {
+				switch_ivr_sleep(session, 10, SWITCH_FALSE, NULL);
+			}
+		}
+	}
+
 	switch_channel_clear_state_handler(channel, &originate_state_handlers);
 
 	return SWITCH_STATUS_FALSE;
@@ -324,7 +334,7 @@
 	}
 
 	if ((switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA))) {
-		return SWITCH_STATUS_SUCCESS;
+		goto end;
 	}
 
 	switch_zmalloc(write_frame.data, SWITCH_RECOMMENDED_BUFFER_SIZE);
@@ -545,7 +555,9 @@
 
 	switch_safe_free(write_frame.data);
 
-	return status;
+ end:
+
+	return (!caller_channel || switch_channel_ready(caller_channel)) ? status : SWITCH_STATUS_FALSE;
 }
 
 static void process_import(switch_core_session_t *session, switch_channel_t *peer_channel)

Modified: freeswitch/branches/gmaruzz/src/switch_log.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_log.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_log.c	Wed Jan  7 10:17:00 2009
@@ -122,6 +122,7 @@
 		if (!LEVELS[x]) {
 			break;
 		}
+
 		if (!strcasecmp(LEVELS[x], str)) {
 			level = (switch_log_level_t) x;
 			break;

Modified: freeswitch/branches/gmaruzz/src/switch_rtp.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_rtp.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_rtp.c	Wed Jan  7 10:17:00 2009
@@ -199,6 +199,7 @@
 	switch_port_t stun_port;
 	int from_auto;
 	uint32_t cng_count;
+	switch_rtp_bug_flag_t rtp_bugs;
 };
 
 static int global_init = 0;
@@ -486,6 +487,11 @@
 	return port;
 }
 
+SWITCH_DECLARE(void) switch_rtp_intentional_bugs(switch_rtp_t *rtp_session, switch_rtp_bug_flag_t bugs)
+{
+	rtp_session->rtp_bugs = bugs;
+}
+
 SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_session, const char *host, switch_port_t port, const char **err)
 {
 	switch_socket_t *new_sock = NULL, *old_sock = NULL;
@@ -1204,7 +1210,7 @@
 							  rtp_session->dtmf_data.timestamp_dtmf,
 							  rtp_session->dtmf_data.out_digit_sofar,
 							  rtp_session->dtmf_data.out_digit_sub_sofar, rtp_session->dtmf_data.out_digit_dur, rtp_session->seq);
-			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BUGGY_2833)) {
+			if (rtp_session->rtp_bugs & RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833) {
 				rtp_session->dtmf_data.timestamp_dtmf = rtp_session->last_write_ts + samples;
 			}
 		}
@@ -1257,7 +1263,7 @@
 			switch_rtp_write_manual(rtp_session,
 									rtp_session->dtmf_data.out_digit_packet,
 									4,
-									switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BUGGY_2833) ? 0 : 1,
+									rtp_session->rtp_bugs & RTP_BUG_CISCO_SKIP_MARK_BIT_2833 ? 0 : 1,
 									rtp_session->te, rtp_session->dtmf_data.timestamp_dtmf, &flags);
 
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send start packet for [%c] ts=%u dur=%d/%d/%d seq=%d\n",

Modified: freeswitch/branches/gmaruzz/src/switch_xml.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/switch_xml.c	(original)
+++ freeswitch/branches/gmaruzz/src/switch_xml.c	Wed Jan  7 10:17:00 2009
@@ -300,6 +300,62 @@
 	return p;
 }
 
+SWITCH_DECLARE(switch_xml_t) switch_xml_find_child_multi(switch_xml_t node, const char *childname, ...)
+{
+	switch_xml_t p = NULL;
+	const char *names[256] = {0};
+	const char *vals[256] = {0};
+	int x, i = 0;
+	va_list ap;
+	const char *attrname, *value = NULL;
+
+	va_start(ap, childname);
+	
+	while(i < 255) {
+		if ((attrname = va_arg(ap, const char *))) {
+			value = va_arg(ap, const char *);
+		}
+		if (attrname && value) {
+			names[i] = attrname;
+			vals[i] = value;
+		} else {
+			break;
+		}
+		i++;
+	}
+
+	va_end(ap);
+
+	if (!(childname && i)) {
+		return node;
+	}
+	
+	for (p = switch_xml_child(node, childname); p; p = p->next) {
+		for (x = 0; x < i; x++) {
+			if (names[x] && vals[x]) {
+				const char *aname = switch_xml_attr(p, names[x]);
+
+				if (aname) {
+					if (*vals[x] == '!') {
+						const char *sval = vals[x] + 1;
+						if (sval && strcasecmp(aname, sval)) {
+							goto done;
+						}
+					} else {
+						if (!strcasecmp(aname, vals[x])) {
+							goto done;
+						}
+					}
+				}
+			}
+		}
+	}
+
+ done:
+
+	return p;
+}
+
 // returns the first child tag with the given name or NULL if not found
 SWITCH_DECLARE(switch_xml_t) switch_xml_child(switch_xml_t xml, const char *name)
 {
@@ -1528,6 +1584,112 @@
 	return status;
 }
 
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_group(const char *group_name,
+														const char *domain_name, 
+														switch_xml_t *root,
+														switch_xml_t *domain,
+														switch_xml_t *group,
+														switch_event_t *params)
+{
+	switch_status_t status = SWITCH_STATUS_FALSE;
+	switch_event_t *my_params = NULL;
+	switch_xml_t groups = NULL;
+
+	*root = NULL;
+	*group = NULL;
+	*domain = NULL;
+
+	if (!params) {
+		switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
+		switch_assert(my_params);
+		params = my_params;
+	}
+
+	if (group_name) {
+		switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "group_name", group_name);
+	}
+
+	if (domain_name) {
+		switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "domain", domain_name);
+	}
+
+	if ((status = switch_xml_locate_domain(domain_name, params, root, domain)) != SWITCH_STATUS_SUCCESS) {
+		goto end;
+	}
+	
+	status = SWITCH_STATUS_FALSE;
+
+	if ((groups = switch_xml_child(*domain, "groups"))) {
+		if ((*group = switch_xml_find_child(groups, "group", "name", group_name))) {
+			status = SWITCH_STATUS_SUCCESS;
+		}
+	}
+
+ end:
+
+	if (my_params) {
+		switch_event_destroy(&my_params);
+	}
+
+	return status;
+}
+
+static switch_status_t find_user_in_tag(switch_xml_t tag, const char *ip, const char *user_name, const char *key, switch_event_t *params, switch_xml_t *user)
+{
+	const char *type = "!pointer";
+	const char *val;
+
+	if (params && (val = switch_event_get_header(params, "user_type"))) {
+		if (!strcasecmp(val, "any")) {
+			type = NULL;
+		} else {
+			type = val;
+		}
+	}
+
+	if (ip) {
+		if ((*user = switch_xml_find_child_multi(tag, "user", "ip", ip, "type", type, NULL))) {
+			return SWITCH_STATUS_SUCCESS;
+		}
+	} 
+
+	if (user_name) {
+		if (params && switch_event_get_header(params, (char *) "mailbox")) {
+			if ((*user = switch_xml_find_child_multi(tag, "user", "mailbox", user_name, "type", type, NULL))) {
+				return SWITCH_STATUS_SUCCESS;
+			}
+		}
+
+		if ((*user = switch_xml_find_child_multi(tag, "user", key, user_name, "type", type, NULL))) {
+			return SWITCH_STATUS_SUCCESS;
+		}
+	}
+	
+	return SWITCH_STATUS_FALSE;
+	
+}
+
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(const char *user_name, switch_xml_t domain, switch_xml_t *user, switch_xml_t *ingroup)
+{
+	switch_xml_t group = NULL, groups = NULL, users = NULL;
+	switch_status_t status = SWITCH_STATUS_FALSE;
+	
+	if ((groups = switch_xml_child(domain, "groups"))) {
+		for (group = switch_xml_child(groups, "group"); group; group = group->next) {
+			if ((users = switch_xml_child(group, "users"))) {
+				if ((status = find_user_in_tag(users, NULL, user_name, "id", NULL, user)) == SWITCH_STATUS_SUCCESS) {
+					if (ingroup) {
+						*ingroup = group;
+					}
+					break;
+				}
+			}
+		}
+	}
+
+	return status;
+}
+
 SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *key,
 													   const char *user_name,
 													   const char *domain_name, 
@@ -1535,15 +1697,21 @@
 													   switch_xml_t *root,
 													   switch_xml_t *domain,
 													   switch_xml_t *user,
+													   switch_xml_t *ingroup,
 													   switch_event_t *params)
 {
 	switch_status_t status = SWITCH_STATUS_FALSE;
-	switch_event_t *my_params = NULL;
-
+	switch_event_t *my_params = NULL, *search_params = NULL;
+	switch_xml_t group = NULL, groups = NULL, users = NULL;
+	
 	*root = NULL;
 	*user = NULL;
 	*domain = NULL;
 
+	if (ingroup) {
+		*ingroup = NULL;
+	}
+
 	if (!params) {
 		switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
 		switch_assert(my_params);
@@ -1570,26 +1738,27 @@
 	
 	status = SWITCH_STATUS_FALSE;
 
-	if (ip) {
-		if ((*user = switch_xml_find_child(*domain, "user", "ip", ip))) {
-			status = SWITCH_STATUS_SUCCESS;
-			goto end;
-		}
-	} 
+	if (params != my_params) {
+		search_params = params;
+	}
 
-	if (user_name) {
-		if (params != my_params && switch_event_get_header(params, (char *) "mailbox")) {
-			if ((*user = switch_xml_find_child(*domain, "user", "mailbox", user_name))) {
-				status = SWITCH_STATUS_SUCCESS;
-				goto end;
+	if ((groups = switch_xml_child(*domain, "groups"))) {
+		for (group = switch_xml_child(groups, "group"); group; group = group->next) {
+			if ((users = switch_xml_child(group, "users"))) {
+				if ((status = find_user_in_tag(users, ip, user_name, key, params, user)) == SWITCH_STATUS_SUCCESS) {
+					if (ingroup) {
+						*ingroup = group;
+					}
+					break;
+				}
 			}
 		}
+	}
 
-		if ((*user = switch_xml_find_child(*domain, "user", key, user_name))) {
-			status = SWITCH_STATUS_SUCCESS;
-			goto end;
-		}
+	if (status != SWITCH_STATUS_SUCCESS) {
+		status = find_user_in_tag(*domain, ip, user_name, key, params, user);
 	}
+	
 
  end:
 

Modified: freeswitch/branches/gmaruzz/support-d/.screenrc
==============================================================================
--- freeswitch/branches/gmaruzz/support-d/.screenrc	(original)
+++ freeswitch/branches/gmaruzz/support-d/.screenrc	Wed Jan  7 10:17:00 2009
@@ -1,2 +1,3 @@
+startup_message off
 escape ^\b
 defscrollback 500000



More information about the Freeswitch-branches mailing list