[Freeswitch-svn] [commit] r3092 - in freeswitch/branches/mishehu: . build conf libs/codec/gsm/src libs/iax/src libs/libdingaling libs/libdingaling/src libs/srtp/test libs/win32 libs/win32/pthread libs/win32/sofia src src/include src/mod/applications/mod_commands src/mod/applications/mod_conference src/mod/applications/mod_dptools src/mod/applications/mod_playback src/mod/applications/mod_rss src/mod/codecs/mod_amr src/mod/codecs/mod_g711 src/mod/codecs/mod_g722 src/mod/codecs/mod_g723_1 src/mod/codecs/mod_g726 src/mod/codecs/mod_g729 src/mod/codecs/mod_gsm src/mod/codecs/mod_ilbc src/mod/codecs/mod_l16 src/mod/codecs/mod_lpc10 src/mod/codecs/mod_speex src/mod/dialplans/mod_dialplan_xml src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_iax src/mod/endpoints/mod_portaudio src/mod/endpoints/mod_sofia src/mod/endpoints/mod_wanpipe src/mod/endpoints/mod_woomera src/mod/event_handlers/mod_cdr src/mod/event_handlers/mod_event_socket src/mod/languages/mod_spidermonkey w32/Library

Freeswitch SVN mishehu at freeswitch.org
Wed Oct 18 23:32:54 EDT 2006


Author: mishehu
Date: Wed Oct 18 23:32:52 2006
New Revision: 3092

Added:
   freeswitch/branches/mishehu/libs/libdingaling/src/config.h.in
      - copied unchanged from r3091, /freeswitch/trunk/libs/libdingaling/src/config.h.in
   freeswitch/branches/mishehu/libs/libdingaling/src/sha1.c
      - copied unchanged from r3091, /freeswitch/trunk/libs/libdingaling/src/sha1.c
   freeswitch/branches/mishehu/libs/libdingaling/src/sha1.h
      - copied unchanged from r3091, /freeswitch/trunk/libs/libdingaling/src/sha1.h
Modified:
   freeswitch/branches/mishehu/.indent.pro
   freeswitch/branches/mishehu/Freeswitch.sln
   freeswitch/branches/mishehu/Makefile.in
   freeswitch/branches/mishehu/build/buildlib.sh
   freeswitch/branches/mishehu/conf/freeswitch.xml
   freeswitch/branches/mishehu/indent_options.sh
   freeswitch/branches/mishehu/libs/codec/gsm/src/add.c
   freeswitch/branches/mishehu/libs/codec/gsm/src/gsm_encode.c
   freeswitch/branches/mishehu/libs/iax/src/md5.c
   freeswitch/branches/mishehu/libs/libdingaling/Makefile.am
   freeswitch/branches/mishehu/libs/libdingaling/Makefile.in
   freeswitch/branches/mishehu/libs/libdingaling/configure
   freeswitch/branches/mishehu/libs/libdingaling/configure.in
   freeswitch/branches/mishehu/libs/libdingaling/libdingaling.vcproj
   freeswitch/branches/mishehu/libs/libdingaling/src/libdingaling.c
   freeswitch/branches/mishehu/libs/libdingaling/src/libdingaling.h
   freeswitch/branches/mishehu/libs/srtp/test/   (props changed)
   freeswitch/branches/mishehu/libs/win32/Download SOFIA.vcproj
   freeswitch/branches/mishehu/libs/win32/pthread/pthread.vcproj
   freeswitch/branches/mishehu/libs/win32/sofia/libsofia_sip_ua_static.vcproj
   freeswitch/branches/mishehu/src/include/switch_caller.h
   freeswitch/branches/mishehu/src/include/switch_core.h
   freeswitch/branches/mishehu/src/include/switch_event.h
   freeswitch/branches/mishehu/src/include/switch_module_interfaces.h
   freeswitch/branches/mishehu/src/include/switch_platform.h
   freeswitch/branches/mishehu/src/include/switch_rtp.h
   freeswitch/branches/mishehu/src/include/switch_types.h
   freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/branches/mishehu/src/mod/applications/mod_dptools/mod_dptools.c
   freeswitch/branches/mishehu/src/mod/applications/mod_playback/mod_playback.c
   freeswitch/branches/mishehu/src/mod/applications/mod_rss/mod_rss.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_amr/Makefile
   freeswitch/branches/mishehu/src/mod/codecs/mod_amr/mod_amr.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g722/mod_g722.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g723_1/mod_g723_1.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g726/mod_g726.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_gsm/mod_gsm.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_ilbc/mod_ilbc.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_ilbc/mod_ilbc.vcproj
   freeswitch/branches/mishehu/src/mod/codecs/mod_l16/mod_l16.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_lpc10/mod_lpc10.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_speex/mod_speex.c
   freeswitch/branches/mishehu/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_dingaling/mod_dingaling.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_iax/mod_iax.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_portaudio/mod_portaudio.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/Makefile
   freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.vcproj
   freeswitch/branches/mishehu/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_woomera/mod_woomera.c
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/README
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.h
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/schema.sql
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
   freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/branches/mishehu/src/switch_caller.c
   freeswitch/branches/mishehu/src/switch_console.c
   freeswitch/branches/mishehu/src/switch_core.c
   freeswitch/branches/mishehu/src/switch_event.c
   freeswitch/branches/mishehu/src/switch_ivr.c
   freeswitch/branches/mishehu/src/switch_log.c
   freeswitch/branches/mishehu/src/switch_rtp.c
   freeswitch/branches/mishehu/w32/Library/FreeSwitchCore.vcproj

Log:
Merged in changes for the ani2 to be renamed to aniii.  Added the changes to the files not yet in trunk as well.  Merged to trunk r3091.

Modified: freeswitch/branches/mishehu/.indent.pro
==============================================================================
--- freeswitch/branches/mishehu/.indent.pro	(original)
+++ freeswitch/branches/mishehu/.indent.pro	Wed Oct 18 23:32:52 2006
@@ -1 +1 @@
--brs -npsl -di0 -br -ce -d0 -cli0 -npcs -nfc1 -ut -i4 -ts4 -l120 -cs -T size_t -T pieces -T switch_file_t -T switch_thread_cond_t -T switch_thread -T switch_threadattr_t -T switch_thread_start_t -T switch_socket_t -T switch_sockaddr_t -T switch_memory_pool -T switch_pollfd_t -T switch_pollset_t -T switch_time_t -T switch_time_exp_t -T switch_hash -T switch_hash_index_t -T switch_strmatch_pattern -T switch_uuid_t -T switch_queue_t -T switch_mutex_t -T __int8 -T __int16 -T __int32 -T __int64 -T int8_t -T int16_t -T int32_t -T int64_t -T long -T switch_core_db -T switch_core_session_message -T switch_audio_resampler -T switch_event_header -T switch_event -T switch_event_subclass -T switch_event_node -T switch_loadable_module -T switch_frame -T switch_channel -T switch_endpoint_interface -T switch_timer_interface -T switch_dialplan_interface -T switch_codec_interface -T switch_application_interface -T switch_api_interface -T switch_file_interface -T switch_file_handle -T switch_core_session -T switch_loadable_module_interface -T switch_caller_profile -T switch_caller_step -T switch_caller_extension -T switch_caller_application -T switch_event_handler_table -T switch_timer -T switch_codec -T switch_core_thread_session -T switch_codec_implementation -T switch_io_event_hook_outgoing_channel -T switch_io_event_hook_answer_channel -T switch_io_event_hook_receive_message -T switch_io_event_hook_read_frame -T switch_io_event_hook_write_frame -T switch_io_event_hook_kill_channel -T switch_io_event_hook_waitfor_read -T switch_io_event_hook_waitfor_write -T switch_io_event_hook_send_dtmf -T switch_io_routines -T switch_io_event_hooks -T switch_buffer -T switch_codec_settings -T switch_config  -T switch_lock_flag  -T switch_core_session_message_t  -T switch_stack_t  -T switch_status  -T switch_text_channel  -T switch_channel_state  -T switch_channel_flag  -T switch_signal  -T switch_codec_flag  -T switch_codec_type  -T switch_timer_flag  -T switch_file_flag  -T switch_io_flag  -T switch_event_t 
\ No newline at end of file
+-brs -npsl -di0 -br -ce -d0 -cli0 -npcs -nfc1 -ut -i4 -ts4 -l120 -cs -T size_t -T pieces -T swtich_size_t -T switch_int16_t -T switch_size_t -T switch_file_t -T switch_thread_cond_t -T switch_thread_id_t -T switch_thread_t -T switch_threadattr_t -T switch_thread_start_t -T switch_socket_t -T switch_sockaddr_t -T switch_port_t -T switch_memory_pool_t -T switch_pollfd_t -T switch_pollset_t -T switch_time_t -T switch_interval_time_t -T switch_time_exp_t -T switch_hash_t -T switch_hash_index_t -T switch_strmatch_pattern -T switch_uuid_t -T switch_queue_t -T switch_thread_rwlock_t -T switch_mutex_t -T switch_channel_timetable_t -T __int8 -T __int16 -T __int32 -T __int64 -T int8_t -T int16_t -T int32_t -T int64_t -T long -T switch_core_db_t -T switch_core_db_stmt_t -T switch_byte_t -T switch_directories -T switch_payload_t -T switch_rtp_t -T switch_core_session_message_t -T switch_event_header_t -T switch_event_t -T switch_event_subclass_t -T switch_event_node_t -T switch_loadable_module_t -T switch_frame_t -T switch_channel_t -T switch_file_handle_t -T switch_core_session_t -T switch_caller_profile_t -T switch_caller_extension_t -T switch_caller_application_t -T switch_state_handler_table_t -T switch_timer_t -T switch_codec_t -T switch_core_thread_session_t -T switch_codec_implementation_t -T switch_buffer_t -T switch_codec_settings_t -T switch_config_t -T switch_io_event_hook_outgoing_channel_t -T switch_io_event_hook_answer_channel_t -T switch_io_event_hook_receive_message_t -T switch_io_event_hook_receive_event_t -T switch_io_event_hook_read_frame_t -T switch_io_event_hook_write_frame_t -T switch_io_event_hook_kill_channel_t -T switch_io_event_hook_waitfor_read_t -T switch_io_event_hook_waitfor_write_t -T switch_io_event_hook_send_dtmf_t -T switch_io_routines_t -T switch_io_event_hooks_t -T switch_speech_handle_t -T switch_directory_handle_t -T switch_loadable_module_interface_t -T switch_endpoint_interface_t -T switch_timer_interface_t -T switch_dialplan_interface_t -T switch_codec_interface_t -T switch_application_interface_t -T switch_api_interface_t -T switch_file_interface_t -T switch_speech_interface_t -T switch_directory_interface_t -T switch_core_port_allocator_t -T switch_media_bug_t -T switch_stream_handle_t -T switch_core_time_duration_t  -T switch_log_node_t  -T switch_audio_resampler_t  -T switch_stun_message_t  -T switch_stun_attribute_t  -T switch_stun_error_t  -T switch_stun_type_t  -T switch_stun_packet_header_t  -T switch_stun_packet_attribute_t  -T switch_stun_packet_t  -T switch_stun_ip_t  -T switch_bitpack_mode_t  -T switch_abc_type_t  -T switch_bitpack_t  -T switch_audio_col_t  -T switch_xml_section_t  -T switch_vad_flag_t  -T switch_rtp_flag_t  -T switch_priority_t  -T switch_ivr_option_t  -T switch_core_session_message_types_t  -T switch_stack_t  -T switch_status_t  -T switch_log_level_t  -T switch_text_channel_t  -T switch_core_session_message_flag_t  -T switch_channel_state_t  -T switch_channel_flag_t  -T switch_frame_flag_t  -T switch_signal_t  -T switch_codec_flag_t  -T switch_speech_flag_t  -T switch_directory_flag_t  -T switch_codec_type_t  -T switch_timer_flag_t  -T switch_file_flag_t  -T switch_io_flag_t  -T switch_event_types_t  -T switch_input_type_t  -T switch_call_cause_t  -T switch_session_ctl_t  -T switch_xml_flag_t 
\ No newline at end of file

Modified: freeswitch/branches/mishehu/Freeswitch.sln
==============================================================================
--- freeswitch/branches/mishehu/Freeswitch.sln	(original)
+++ freeswitch/branches/mishehu/Freeswitch.sln	Wed Oct 18 23:32:52 2006
@@ -3,21 +3,21 @@
 # Visual Studio 2005
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchConsole", "w32\Console\FreeSwitchConsole.vcproj", "{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchCoreLib", "w32\Library\FreeSwitchCore.vcproj", "{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}"
 	ProjectSection(ProjectDependencies) = postProject
-		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761} = {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EEF031CB-FED8-451E-A471-91EC8D4F6750}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EEF031CB-FED8-451E-A471-91EC8D4F6750}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
+		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761} = {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g729", "src\mod\codecs\mod_g729\mod_g729.vcproj", "{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}"
@@ -27,42 +27,42 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsm", "src\mod\codecs\mod_gsm\mod_gsm.vcproj", "{4926323F-4EA8-4B7D-A3D3-65488725988F}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{8FD2E297-4096-47E5-9258-C48FF1841523} = {8FD2E297-4096-47E5-9258-C48FF1841523}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xmpp_event", "src\mod\event_handlers\mod_xmpp_event\mod_xmpp_event.vcproj", "{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sndfile", "src\mod\formats\mod_sndfile\mod_sndfile.vcproj", "{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4} = {3D0370CA-BED2-4657-A475-32375CBCB6E4}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4} = {3D0370CA-BED2-4657-A475-32375CBCB6E4}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_bridgecall", "src\mod\applications\mod_bridgecall\mod_bridgecall.vcproj", "{E1794405-29D4-466D-9BE3-DD2344C2A663}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_test", "src\mod\event_handlers\mod_event_test\mod_event_test.vcproj", "{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g711", "src\mod\codecs\mod_g711\mod_g711.vcproj", "{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}"
@@ -72,28 +72,28 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_iax", "src\mod\endpoints\mod_iax\mod_iax.vcproj", "{3A5B9131-F20C-4A85-9447-6C1610941CEE}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_playback", "src\mod\applications\mod_playback\mod_playback.vcproj", "{78100236-7CEA-4948-96CC-E8ED3160329C}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_PortAudio", "src\mod\endpoints\mod_portaudio\mod_PortAudio.vcproj", "{5FD31A25-5D83-4794-8BEE-904DAD84CE71}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{C30D35E4-7FC6-4E97-9BE5-4BC077BE0D4B} = {C30D35E4-7FC6-4E97-9BE5-4BC077BE0D4B}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_l16", "src\mod\codecs\mod_l16\mod_l16.vcproj", "{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}"
@@ -103,24 +103,24 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_softtimer", "src\mod\timers\mod_softtimer\mod_softtimer.vcproj", "{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_speex", "src\mod\codecs\mod_speex\mod_speex.vcproj", "{5580D60E-0F77-4716-9CD4-B8E5986FA375}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918} = {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_woomera", "src\mod\endpoints\mod_woomera\mod_woomera.vcproj", "{FE3540C5-3303-46E0-A69E-D92F775687F1}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"
@@ -143,19 +143,19 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_xml", "src\mod\dialplans\mod_dialplan_xml\mod_dialplan_xml.vcproj", "{07113B25-D3AF-4E04-BA77-4CD1171F022C}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ivrtest", "src\mod\applications\mod_ivrtest\mod_ivrtest.vcproj", "{419AA391-5F3F-4BFE-A869-9D154D62A792}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FreeSwitchSetup", "w32\Setup\Setup.vdproj", "{B17FFBE6-A942-4056-8346-B624FB5D995B}"
@@ -169,28 +169,28 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_directory", "src\mod\dialplans\mod_dialplan_directory\mod_dialplan_directory.vcproj", "{A27CCA23-1541-4337-81A4-F0A6413078A0}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_zeroconf", "src\mod\event_handlers\mod_zeroconf\mod_zeroconf.vcproj", "{C7705DC4-2088-493E-AF8D-65BC6D65C125}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{49C34584-B6DA-448F-83CF-27584DC9FC90} = {49C34584-B6DA-448F-83CF-27584DC9FC90}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{49C34584-B6DA-448F-83CF-27584DC9FC90} = {49C34584-B6DA-448F-83CF-27584DC9FC90}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_multicast", "src\mod\event_handlers\mod_event_multicast\mod_event_multicast.vcproj", "{784113EF-44D9-4949-835D-7065D3C7AD08}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libteletone", "libs\libteletone\libteletone.vcproj", "{89385C74-5860-4174-9CAF-A39E7C48909C}"
@@ -199,15 +199,15 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey", "src\mod\languages\mod_spidermonkey\mod_spidermonkey.vcproj", "{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{76D0A759-9C07-42D4-90A9-82AE15462C95} = {76D0A759-9C07-42D4-90A9-82AE15462C95}
-		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
 		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
+		{76D0A759-9C07-42D4-90A9-82AE15462C95} = {76D0A759-9C07-42D4-90A9-82AE15462C95}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ASR-TTS", "ASR-TTS", "{4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}"
@@ -229,35 +229,36 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_echo", "src\mod\applications\mod_echo\mod_echo.vcproj", "{0E2C6395-13B9-46E5-9264-8859D346018D}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ilbc", "src\mod\codecs\mod_ilbc\mod_ilbc.vcproj", "{D3EC0AFF-76FC-4210-A825-9A17410660A3}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {989BB874-7AF1-44CB-8E5C-CC8113D267E8}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dingaling", "src\mod\endpoints\mod_dingaling\mod_dingaling.vcproj", "{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}"
 	ProjectSection(ProjectDependencies) = postProject
 		{1906D736-08BD-4EE1-924F-B536249B9A54} = {1906D736-08BD-4EE1-924F-B536249B9A54}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
 		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_commands", "src\mod\applications\mod_commands\mod_commands.vcproj", "{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}"
@@ -271,54 +272,54 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_rpc", "src\mod\xml_int\mod_xml_rpc\mod_xml_rpc.vcproj", "{CBEC7225-0C21-4DA8-978E-1F158F8AD950}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94} = {356EC96D-4C9F-47B5-9083-FC328B87BA94}
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94} = {356EC96D-4C9F-47B5-9083-FC328B87BA94}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rss", "src\mod\applications\mod_rss\mod_rss.vcproj", "{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_conference", "src\mod\applications\mod_conference\mod_conference.vcproj", "{C24FB505-05D7-4319-8485-7540B44C8603}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dptools", "src\mod\applications\mod_dptools\mod_dptools.vcproj", "{B5881A85-FE70-4F64-8607-2CAAE52669C6}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_socket", "src\mod\event_handlers\mod_event_socket\mod_event_socket.vcproj", "{05515420-16DE-4E63-BE73-85BE85BA5142}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr", "src\mod\event_handlers\mod_cdr\mod_cdr.vcproj", "{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
@@ -343,8 +344,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre", "libs\win32\pcre\libpcre.vcproj", "{8D04B550-D240-4A44-8A18-35DA3F7038D9}"
 	ProjectSection(ProjectDependencies) = postProject
-		{91695C7C-7AD1-4782-9727-508F82D9C577} = {91695C7C-7AD1-4782-9727-508F82D9C577}
 		{1CED5987-A529-46DC-B30F-870D85FF9C94} = {1CED5987-A529-46DC-B30F-870D85FF9C94}
+		{91695C7C-7AD1-4782-9727-508F82D9C577} = {91695C7C-7AD1-4782-9727-508F82D9C577}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre Generate pcre_chartables.c", "libs\win32\pcre\pcre_chartables.c.vcproj", "{1CED5987-A529-46DC-B30F-870D85FF9C94}"
@@ -361,18 +362,18 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libapriconv", "libs\win32\apr-iconv\libapriconv.vcproj", "{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}"
 	ProjectSection(ProjectDependencies) = postProject
-		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C4854C1D-5478-4F87-AB62-36CCDDDBA3C7}
-		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
 		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
+		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C4854C1D-5478-4F87-AB62-36CCDDDBA3C7}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\apr-util\libaprutil.vcproj", "{F057DA7F-79E5-4B00-845C-EF446EF055E3}"
 	ProjectSection(ProjectDependencies) = postProject
-		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C4854C1D-5478-4F87-AB62-36CCDDDBA3C7}
-		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{E969F3E0-1043-482A-AD49-787B8356BA92} = {E969F3E0-1043-482A-AD49-787B8356BA92}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
+		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C4854C1D-5478-4F87-AB62-36CCDDDBA3C7}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Downloads", "_Downloads", "{C120A020-773F-4EA3-923F-B67AF28B750D}"
@@ -386,12 +387,10 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download APR-Util", "libs\win32\Download APR-Util.vcproj", "{E969F3E0-1043-482A-AD49-787B8356BA92}"
 	ProjectSection(ProjectDependencies) = postProject
-		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C4854C1D-5478-4F87-AB62-36CCDDDBA3C7}
 		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {5786D51D-1C6A-4BE1-8804-29954DB5258F}
+		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C4854C1D-5478-4F87-AB62-36CCDDDBA3C7}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download LIBRESAMPLE", "libs\win32\Download LIBRESAMPLE.vcproj", "{C3B50FF8-E49B-4589-B07A-4D7866980669}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PCRE", "libs\win32\Download PCRE.vcproj", "{91695C7C-7AD1-4782-9727-508F82D9C577}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download SQLITE", "libs\win32\Download SQLITE.vcproj", "{6B9217D6-8259-4817-B8A5-2FEAD349EDEB}"
@@ -426,8 +425,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSResponder static library", "libs\win32\howl\libmDNSResponder.vcproj", "{49C34584-B6DA-448F-83CF-27584DC9FC90}"
 	ProjectSection(ProjectDependencies) = postProject
-		{5927104D-C14C-4AC8-925C-4AB681762E75} = {5927104D-C14C-4AC8-925C-4AB681762E75}
 		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
+		{5927104D-C14C-4AC8-925C-4AB681762E75} = {5927104D-C14C-4AC8-925C-4AB681762E75}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download LIBSNDFILE", "libs\win32\Download LIBSNDFILE.vcproj", "{EFA9E76E-62A5-4237-B7E9-F39B8E174CD5}"
@@ -453,8 +452,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Abyss", "libs\win32\xmlrpc\Abyss.vcproj", "{356EC96D-4C9F-47B5-9083-FC328B87BA94}"
 	ProjectSection(ProjectDependencies) = postProject
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
 		{EC8D4AE8-0F3E-454A-BFB8-D56A5D9C0121} = {EC8D4AE8-0F3E-454A-BFB8-D56A5D9C0121}
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.vcproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}"
@@ -468,58 +467,58 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "js", "libs\win32\js\js.vcproj", "{204FA0DE-305D-4414-AE2E-F195A23F390D}"
 	ProjectSection(ProjectDependencies) = postProject
-		{76D0A759-9C07-42D4-90A9-82AE15462C95} = {76D0A759-9C07-42D4-90A9-82AE15462C95}
 		{B0AA13FC-636C-45A7-8EAE-663220679A75} = {B0AA13FC-636C-45A7-8EAE-663220679A75}
+		{76D0A759-9C07-42D4-90A9-82AE15462C95} = {76D0A759-9C07-42D4-90A9-82AE15462C95}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.vcproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}"
 	ProjectSection(ProjectDependencies) = postProject
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg726", "libs\codec\g726\libg726.vcproj", "{5A6A281A-AA50-470A-8305-202BDA1CD1BF}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g726", "src\mod\codecs\mod_g726\mod_g726.vcproj", "{486369EB-F150-4B56-BCC8-77B9E18FF5F5}"
 	ProjectSection(ProjectDependencies) = postProject
-		{5A6A281A-AA50-470A-8305-202BDA1CD1BF} = {5A6A281A-AA50-470A-8305-202BDA1CD1BF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{5A6A281A-AA50-470A-8305-202BDA1CD1BF} = {5A6A281A-AA50-470A-8305-202BDA1CD1BF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg7xx", "libs\codec\g7xx\libg7xx.vcproj", "{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g722", "src\mod\codecs\mod_g722\mod_g722.vcproj", "{D42518CC-7475-454D-B392-0E132C07D761}"
 	ProjectSection(ProjectDependencies) = postProject
-		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_park", "src\mod\applications\mod_park\mod_park.vcproj", "{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download SOFIA", "libs\win32\Download SOFIA.vcproj", "{8B2CE7D1-77EF-45ED-927D-82147805440B}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.vcproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
 	ProjectSection(ProjectDependencies) = postProject
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
 		{8B2CE7D1-77EF-45ED-927D-82147805440B} = {8B2CE7D1-77EF-45ED-927D-82147805440B}
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PTHREAD", "libs\win32\Download PTHREAD.vcproj", "{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}"
@@ -531,18 +530,18 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g723_1", "src\mod\codecs\mod_g723_1\mod_g723_1.vcproj", "{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_native_file", "src\mod\formats\mod_native_file\mod_native_file.vcproj", "{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSwitch.NET", "src\dotnet\FreeSwitch.NET.csproj", "{251CAABC-16C3-4593-A491-603B908094E0}"
@@ -763,10 +762,6 @@
 		{E969F3E0-1043-482A-AD49-787B8356BA92}.Debug|Win32.Build.0 = Debug|Win32
 		{E969F3E0-1043-482A-AD49-787B8356BA92}.Release|Win32.ActiveCfg = Release|Win32
 		{E969F3E0-1043-482A-AD49-787B8356BA92}.Release|Win32.Build.0 = Release|Win32
-		{C3B50FF8-E49B-4589-B07A-4D7866980669}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C3B50FF8-E49B-4589-B07A-4D7866980669}.Debug|Win32.Build.0 = Debug|Win32
-		{C3B50FF8-E49B-4589-B07A-4D7866980669}.Release|Win32.ActiveCfg = Release|Win32
-		{C3B50FF8-E49B-4589-B07A-4D7866980669}.Release|Win32.Build.0 = Release|Win32
 		{91695C7C-7AD1-4782-9727-508F82D9C577}.Debug|Win32.ActiveCfg = Debug|Win32
 		{91695C7C-7AD1-4782-9727-508F82D9C577}.Debug|Win32.Build.0 = Debug|Win32
 		{91695C7C-7AD1-4782-9727-508F82D9C577}.Release|Win32.ActiveCfg = Release|Win32
@@ -984,7 +979,6 @@
 		{C4854C1D-5478-4F87-AB62-36CCDDDBA3C7} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 		{5786D51D-1C6A-4BE1-8804-29954DB5258F} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 		{E969F3E0-1043-482A-AD49-787B8356BA92} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{C3B50FF8-E49B-4589-B07A-4D7866980669} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 		{91695C7C-7AD1-4782-9727-508F82D9C577} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 		{6B9217D6-8259-4817-B8A5-2FEAD349EDEB} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 		{5C9C69D2-8B98-42DA-8D82-6E0B48446FAC} = {C120A020-773F-4EA3-923F-B67AF28B750D}

Modified: freeswitch/branches/mishehu/Makefile.in
==============================================================================
--- freeswitch/branches/mishehu/Makefile.in	(original)
+++ freeswitch/branches/mishehu/Makefile.in	Wed Oct 18 23:32:52 2006
@@ -53,7 +53,7 @@
 	ChangeLog INSTALL NEWS build/config/compile \
 	build/config/config.guess build/config/config.sub \
 	build/config/depcomp build/config/install-sh \
-	build/config/ltmain.sh build/config/missing mkinstalldirs
+	build/config/ltmain.sh build/config/missing
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.in

Modified: freeswitch/branches/mishehu/build/buildlib.sh
==============================================================================
--- freeswitch/branches/mishehu/build/buildlib.sh	(original)
+++ freeswitch/branches/mishehu/build/buildlib.sh	Wed Oct 18 23:32:52 2006
@@ -56,6 +56,12 @@
     fi
 fi
 
+if [ ! -f $root/.nothanks ] && [ $uncompressed/.complete -ot $uncompressed ] ; then 
+    echo remove stale .complete
+    rm $uncompressed/.complete
+    sh -c "cd $uncompressed && $MAKE clean distclean"
+fi
+
 if [ -f $uncompressed/.complete ] ; then
     echo $uncompressed already installed
     exit 0

Modified: freeswitch/branches/mishehu/conf/freeswitch.xml
==============================================================================
--- freeswitch/branches/mishehu/conf/freeswitch.xml	(original)
+++ freeswitch/branches/mishehu/conf/freeswitch.xml	Wed Oct 18 23:32:52 2006
@@ -116,7 +116,7 @@
       <profiles>
         <profile name="test">
           <registrations>
-            <registration name="asterlink">
+            <!-- <registration name="asterlink">
               <param name="register-scheme" value="Digest"/>
               <param name="register-realm" value=""/>
               <param name="register-username" value="1001"/>
@@ -125,7 +125,7 @@
               <param name="register-to" value="sip:1001 at 66.250.68.194"/>
               <param name="register-proxy" value="sip:66.250.68.194:5060"/>
               <param name="register-frequency" value="20"/>
-            </registration>
+            </registration> -->
           </registrations>
           <settings>
             <param name="debug" value="1"/>
@@ -278,6 +278,7 @@
         <param name="message" value="Jingle all the way"/>
         <param name="rtp-ip" value="10.0.0.1"/>
         <param name="auto-login" value="true"/>
+	<param name="auto-reply" value="Press *Call* to call FreeSWITCH and be sure to come to ClueCon! http://www.cluecon.com"/>
         <!-- SASL "plain" or "md5" -->
         <param name="sasl" value="plain"/>
         <!-- if the server where the jabber is hosted is not the same as the one in the jid -->

Modified: freeswitch/branches/mishehu/indent_options.sh
==============================================================================
--- freeswitch/branches/mishehu/indent_options.sh	(original)
+++ freeswitch/branches/mishehu/indent_options.sh	Wed Oct 18 23:32:52 2006
@@ -1,4 +1,4 @@
 #!/bin/bash
 echo -n "-brs -npsl -di0 -br -ce -d0 -cli0 -npcs -nfc1 -ut -i4 -ts4 -l120 -cs -T size_t " > .indent.pro
-grep typedef src/include/*.h | grep switch_ | grep -v "\*\|{" | perl -ne '@l = split; $l[2] =~ s/;//g ; print "-T $l[2] "' >> .indent.pro
+grep typedef src/include/*.h | grep switch_ | grep -v "\*\|{"  | sed -e s/struct// | perl -ne '@l = split; $l[2] =~ s/;//g ; print "-T $l[2] "' >> .indent.pro
 grep "} switch_" src/include/*.h | perl -ne '@l = split; $l[1] =~ s/;//g ; print " -T $l[1] "' >> .indent.pro

Modified: freeswitch/branches/mishehu/libs/codec/gsm/src/add.c
==============================================================================
--- freeswitch/branches/mishehu/libs/codec/gsm/src/add.c	(original)
+++ freeswitch/branches/mishehu/libs/codec/gsm/src/add.c	Wed Oct 18 23:32:52 2006
@@ -161,9 +161,9 @@
 word gsm_asl P2((a,n), word a, int n)
 {
 	if (n >= 16) return 0;
-	if (n <= -16) return -(a < 0);
+	if (n <= -16) return -(word)(a < 0);
 	if (n < 0) return gsm_asr(a, -n);
-	return a << n;
+	return (word)(a << n);
 }
 
 longword gsm_L_asr P2((a,n), longword a, int n)
@@ -182,12 +182,12 @@
 
 word gsm_asr P2((a,n), word a, int n)
 {
-	if (n >= 16) return -(a < 0);
+	if (n >= 16) return -(word)(a < 0);
 	if (n <= -16) return 0;
-	if (n < 0) return a << -n;
+	if (n < 0) return (word)(a << -n);
 
 #	ifdef	SASR
-		return a >> n;
+		return (word)(a >> n);
 #	else
 		if (a >= 0) return a >> n;
 		else return -(word)( -(uword)a >> n );

Modified: freeswitch/branches/mishehu/libs/codec/gsm/src/gsm_encode.c
==============================================================================
--- freeswitch/branches/mishehu/libs/codec/gsm/src/gsm_encode.c	(original)
+++ freeswitch/branches/mishehu/libs/codec/gsm/src/gsm_encode.c	Wed Oct 18 23:32:52 2006
@@ -347,106 +347,106 @@
 #endif	/* WAV49 */
 	{
 
-		*c++ =   ((GSM_MAGIC & 0xF) << 4)		/* 1 */
-		       | ((LARc[0] >> 2) & 0xF);
-		*c++ =   ((LARc[0] & 0x3) << 6)
-		       | (LARc[1] & 0x3F);
-		*c++ =   ((LARc[2] & 0x1F) << 3)
-		       | ((LARc[3] >> 2) & 0x7);
-		*c++ =   ((LARc[3] & 0x3) << 6)
+		*c++ =   (gsm_byte)(((GSM_MAGIC & 0xF) << 4)		/* 1 */
+		       | ((LARc[0] >> 2) & 0xF));
+		*c++ =   (gsm_byte)(((LARc[0] & 0x3) << 6)
+		       | (LARc[1] & 0x3F));
+		*c++ =   (gsm_byte)(((LARc[2] & 0x1F) << 3)
+		       | ((LARc[3] >> 2) & 0x7));
+		*c++ =   (gsm_byte)(((LARc[3] & 0x3) << 6)
 		       | ((LARc[4] & 0xF) << 2)
-		       | ((LARc[5] >> 2) & 0x3);
-		*c++ =   ((LARc[5] & 0x3) << 6)
+		       | ((LARc[5] >> 2) & 0x3));
+		*c++ =   (gsm_byte)(((LARc[5] & 0x3) << 6)
 		       | ((LARc[6] & 0x7) << 3)
-		       | (LARc[7] & 0x7);
-		*c++ =   ((Nc[0] & 0x7F) << 1)
-		       | ((bc[0] >> 1) & 0x1);
-		*c++ =   ((bc[0] & 0x1) << 7)
+		       | (LARc[7] & 0x7));
+		*c++ =   (gsm_byte)(((Nc[0] & 0x7F) << 1)
+		       | ((bc[0] >> 1) & 0x1));
+		*c++ =   (gsm_byte)(((bc[0] & 0x1) << 7)
 		       | ((Mc[0] & 0x3) << 5)
-		       | ((xmaxc[0] >> 1) & 0x1F);
-		*c++ =   ((xmaxc[0] & 0x1) << 7)
+		       | ((xmaxc[0] >> 1) & 0x1F));
+		*c++ =   (gsm_byte)(((xmaxc[0] & 0x1) << 7)
 		       | ((xmc[0] & 0x7) << 4)
 		       | ((xmc[1] & 0x7) << 1)
-		       | ((xmc[2] >> 2) & 0x1);
-		*c++ =   ((xmc[2] & 0x3) << 6)
+		       | ((xmc[2] >> 2) & 0x1));
+		*c++ =   (gsm_byte)(((xmc[2] & 0x3) << 6)
 		       | ((xmc[3] & 0x7) << 3)
-		       | (xmc[4] & 0x7);
-		*c++ =   ((xmc[5] & 0x7) << 5)			/* 10 */
+		       | (xmc[4] & 0x7));
+		*c++ =   (gsm_byte)(((xmc[5] & 0x7) << 5)			/* 10 */
 		       | ((xmc[6] & 0x7) << 2)
-		       | ((xmc[7] >> 1) & 0x3);
-		*c++ =   ((xmc[7] & 0x1) << 7)
+		       | ((xmc[7] >> 1) & 0x3));
+		*c++ =   (gsm_byte)(((xmc[7] & 0x1) << 7)
 		       | ((xmc[8] & 0x7) << 4)
 		       | ((xmc[9] & 0x7) << 1)
-		       | ((xmc[10] >> 2) & 0x1);
-		*c++ =   ((xmc[10] & 0x3) << 6)
+		       | ((xmc[10] >> 2) & 0x1));
+		*c++ =   (gsm_byte)(((xmc[10] & 0x3) << 6)
 		       | ((xmc[11] & 0x7) << 3)
-		       | (xmc[12] & 0x7);
-		*c++ =   ((Nc[1] & 0x7F) << 1)
-		       | ((bc[1] >> 1) & 0x1);
-		*c++ =   ((bc[1] & 0x1) << 7)
+		       | (xmc[12] & 0x7));
+		*c++ =   (gsm_byte)(((Nc[1] & 0x7F) << 1)
+		       | ((bc[1] >> 1) & 0x1));
+		*c++ =   (gsm_byte)(((bc[1] & 0x1) << 7)
 		       | ((Mc[1] & 0x3) << 5)
-		       | ((xmaxc[1] >> 1) & 0x1F);
-		*c++ =   ((xmaxc[1] & 0x1) << 7)
+		       | ((xmaxc[1] >> 1) & 0x1F));
+		*c++ =   (gsm_byte)(((xmaxc[1] & 0x1) << 7)
 		       | ((xmc[13] & 0x7) << 4)
 		       | ((xmc[14] & 0x7) << 1)
-		       | ((xmc[15] >> 2) & 0x1);
-		*c++ =   ((xmc[15] & 0x3) << 6)
+		       | ((xmc[15] >> 2) & 0x1));
+		*c++ =   (gsm_byte)(((xmc[15] & 0x3) << 6)
 		       | ((xmc[16] & 0x7) << 3)
-		       | (xmc[17] & 0x7);
-		*c++ =   ((xmc[18] & 0x7) << 5)
+		       | (xmc[17] & 0x7));
+		*c++ =   (gsm_byte)(((xmc[18] & 0x7) << 5)
 		       | ((xmc[19] & 0x7) << 2)
-		       | ((xmc[20] >> 1) & 0x3);
-		*c++ =   ((xmc[20] & 0x1) << 7)
+		       | ((xmc[20] >> 1) & 0x3));
+		*c++ =   (gsm_byte)(((xmc[20] & 0x1) << 7)
 		       | ((xmc[21] & 0x7) << 4)
 		       | ((xmc[22] & 0x7) << 1)
-		       | ((xmc[23] >> 2) & 0x1);
-		*c++ =   ((xmc[23] & 0x3) << 6)
+		       | ((xmc[23] >> 2) & 0x1));
+		*c++ =   (gsm_byte)(((xmc[23] & 0x3) << 6)
 		       | ((xmc[24] & 0x7) << 3)
-		       | (xmc[25] & 0x7);
-		*c++ =   ((Nc[2] & 0x7F) << 1)			/* 20 */
-		       | ((bc[2] >> 1) & 0x1);
-		*c++ =   ((bc[2] & 0x1) << 7)
+		       | (xmc[25] & 0x7));
+		*c++ =   (gsm_byte)(((Nc[2] & 0x7F) << 1)			/* 20 */
+		       | ((bc[2] >> 1) & 0x1));
+		*c++ =   (gsm_byte)(((bc[2] & 0x1) << 7)
 		       | ((Mc[2] & 0x3) << 5)
-		       | ((xmaxc[2] >> 1) & 0x1F);
-		*c++ =   ((xmaxc[2] & 0x1) << 7)
+		       | ((xmaxc[2] >> 1) & 0x1F));
+		*c++ =   (gsm_byte)(((xmaxc[2] & 0x1) << 7)
 		       | ((xmc[26] & 0x7) << 4)
 		       | ((xmc[27] & 0x7) << 1)
-		       | ((xmc[28] >> 2) & 0x1);
-		*c++ =   ((xmc[28] & 0x3) << 6)
+		       | ((xmc[28] >> 2) & 0x1));
+		*c++ =   (gsm_byte)(((xmc[28] & 0x3) << 6)
 		       | ((xmc[29] & 0x7) << 3)
-		       | (xmc[30] & 0x7);
-		*c++ =   ((xmc[31] & 0x7) << 5)
+		       | (xmc[30] & 0x7));
+		*c++ =   (gsm_byte)(((xmc[31] & 0x7) << 5)
 		       | ((xmc[32] & 0x7) << 2)
-		       | ((xmc[33] >> 1) & 0x3);
-		*c++ =   ((xmc[33] & 0x1) << 7)
+		       | ((xmc[33] >> 1) & 0x3));
+		*c++ =   (gsm_byte)(((xmc[33] & 0x1) << 7)
 		       | ((xmc[34] & 0x7) << 4)
 		       | ((xmc[35] & 0x7) << 1)
-		       | ((xmc[36] >> 2) & 0x1);
-		*c++ =   ((xmc[36] & 0x3) << 6)
+		       | ((xmc[36] >> 2) & 0x1));
+		*c++ =   (gsm_byte)(((xmc[36] & 0x3) << 6)
 		       | ((xmc[37] & 0x7) << 3)
-		       | (xmc[38] & 0x7);
-		*c++ =   ((Nc[3] & 0x7F) << 1)
-		       | ((bc[3] >> 1) & 0x1);
-		*c++ =   ((bc[3] & 0x1) << 7)
+		       | (xmc[38] & 0x7));
+		*c++ =   (gsm_byte)(((Nc[3] & 0x7F) << 1)
+		       | ((bc[3] >> 1) & 0x1));
+		*c++ =   (gsm_byte)(((bc[3] & 0x1) << 7)
 		       | ((Mc[3] & 0x3) << 5)
-		       | ((xmaxc[3] >> 1) & 0x1F);
-		*c++ =   ((xmaxc[3] & 0x1) << 7)
+		       | ((xmaxc[3] >> 1) & 0x1F));
+		*c++ =   (gsm_byte)(((xmaxc[3] & 0x1) << 7)
 		       | ((xmc[39] & 0x7) << 4)
 		       | ((xmc[40] & 0x7) << 1)
-		       | ((xmc[41] >> 2) & 0x1);
-		*c++ =   ((xmc[41] & 0x3) << 6)			/* 30 */
+		       | ((xmc[41] >> 2) & 0x1));
+		*c++ =   (gsm_byte)(((xmc[41] & 0x3) << 6)			/* 30 */
 		       | ((xmc[42] & 0x7) << 3)
-		       | (xmc[43] & 0x7);
-		*c++ =   ((xmc[44] & 0x7) << 5)
+		       | (xmc[43] & 0x7));
+		*c++ =   (gsm_byte)(((xmc[44] & 0x7) << 5)
 		       | ((xmc[45] & 0x7) << 2)
-		       | ((xmc[46] >> 1) & 0x3);
-		*c++ =   ((xmc[46] & 0x1) << 7)
+		       | ((xmc[46] >> 1) & 0x3));
+		*c++ =   (gsm_byte)(((xmc[46] & 0x1) << 7)
 		       | ((xmc[47] & 0x7) << 4)
 		       | ((xmc[48] & 0x7) << 1)
-		       | ((xmc[49] >> 2) & 0x1);
-		*c++ =   ((xmc[49] & 0x3) << 6)
+		       | ((xmc[49] >> 2) & 0x1));
+		*c++ =   (gsm_byte)(((xmc[49] & 0x3) << 6)
 		       | ((xmc[50] & 0x7) << 3)
-		       | (xmc[51] & 0x7);
+		       | (xmc[51] & 0x7));
 
 	}
 }

Modified: freeswitch/branches/mishehu/libs/iax/src/md5.c
==============================================================================
--- freeswitch/branches/mishehu/libs/iax/src/md5.c	(original)
+++ freeswitch/branches/mishehu/libs/iax/src/md5.c	Wed Oct 18 23:32:52 2006
@@ -23,6 +23,18 @@
 #  endif
 #endif
 
+#ifdef _MSC_VER
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN 1234
+#endif
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN 4321
+#endif
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
+#endif
+
 #if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN
 # define HIGHFIRST 1
 #elif __BYTE_ORDER == __LITTLE_ENDIAN || BYTE_ORDER == LITLE_ENDIAN

Modified: freeswitch/branches/mishehu/libs/libdingaling/Makefile.am
==============================================================================
--- freeswitch/branches/mishehu/libs/libdingaling/Makefile.am	(original)
+++ freeswitch/branches/mishehu/libs/libdingaling/Makefile.am	Wed Oct 18 23:32:52 2006
@@ -17,7 +17,7 @@
 AM_LDFLAGS += $(shell $(APU_CONFIG) --link-ld --libs )
 
 lib_LTLIBRARIES		= libdingaling.la
-libdingaling_la_SOURCES	= src/libdingaling.c
+libdingaling_la_SOURCES	= src/libdingaling.c src/sha1.c
 libdingaling_la_CFLAGS	= $(AM_CFLAGS)
 libdingaling_la_LDFLAGS	= 
 

Modified: freeswitch/branches/mishehu/libs/libdingaling/Makefile.in
==============================================================================
--- freeswitch/branches/mishehu/libs/libdingaling/Makefile.in	(original)
+++ freeswitch/branches/mishehu/libs/libdingaling/Makefile.in	Wed Oct 18 23:32:52 2006
@@ -39,9 +39,9 @@
 host_triplet = @host@
 DIST_COMMON = README $(am__configure_deps) $(library_include_HEADERS) \
 	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-	$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
-	compile config.guess config.sub depcomp install-sh ltmain.sh \
-	missing mkinstalldirs
+	$(top_srcdir)/configure $(top_srcdir)/src/config.h.in AUTHORS \
+	COPYING ChangeLog INSTALL NEWS compile config.guess config.sub \
+	depcomp install-sh ltmain.sh missing mkinstalldirs
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.in
@@ -50,6 +50,7 @@
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno configure.status.lineno
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
 CONFIG_CLEAN_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
@@ -62,9 +63,10 @@
 libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libdingaling_la_LIBADD =
-am_libdingaling_la_OBJECTS = libdingaling_la-libdingaling.lo
+am_libdingaling_la_OBJECTS = libdingaling_la-libdingaling.lo \
+	libdingaling_la-sha1.lo
 libdingaling_la_OBJECTS = $(am_libdingaling_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -210,7 +212,7 @@
 APR_CONFIG = $(prefix)/bin/apr-1-config
 APU_CONFIG = $(prefix)/bin/apu-1-config
 lib_LTLIBRARIES = libdingaling.la
-libdingaling_la_SOURCES = src/libdingaling.c
+libdingaling_la_SOURCES = src/libdingaling.c src/sha1.c
 libdingaling_la_CFLAGS = $(AM_CFLAGS)
 libdingaling_la_LDFLAGS = 
 library_includedir = $(prefix)/include
@@ -252,6 +254,23 @@
 	cd $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+src/config.h: src/stamp-h1
+	@if test ! -f $@; then \
+	  rm -f src/stamp-h1; \
+	  $(MAKE) src/stamp-h1; \
+	else :; fi
+
+src/stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status
+	@rm -f src/stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status src/config.h
+$(top_srcdir)/src/config.h.in:  $(am__configure_deps) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	rm -f src/stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f src/config.h src/stamp-h1
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
 	test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@@ -289,6 +308,7 @@
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libdingaling_la-libdingaling.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libdingaling_la-sha1.Plo at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@@ -318,6 +338,13 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdingaling_la_CFLAGS) $(CFLAGS) -c -o libdingaling_la-libdingaling.lo `test -f 'src/libdingaling.c' || echo '$(srcdir)/'`src/libdingaling.c
 
+libdingaling_la-sha1.lo: src/sha1.c
+ at am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdingaling_la_CFLAGS) $(CFLAGS) -MT libdingaling_la-sha1.lo -MD -MP -MF "$(DEPDIR)/libdingaling_la-sha1.Tpo" -c -o libdingaling_la-sha1.lo `test -f 'src/sha1.c' || echo '$(srcdir)/'`src/sha1.c; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libdingaling_la-sha1.Tpo" "$(DEPDIR)/libdingaling_la-sha1.Plo"; else rm -f "$(DEPDIR)/libdingaling_la-sha1.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/sha1.c' object='libdingaling_la-sha1.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdingaling_la_CFLAGS) $(CFLAGS) -c -o libdingaling_la-sha1.lo `test -f 'src/sha1.c' || echo '$(srcdir)/'`src/sha1.c
+
 mostlyclean-libtool:
 	-rm -f *.lo
 
@@ -661,7 +688,7 @@
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-libtool distclean-tags
+	distclean-hdr distclean-libtool distclean-tags
 
 dvi: dvi-recursive
 
@@ -713,11 +740,11 @@
 	clean-libtool clean-recursive ctags ctags-recursive dist \
 	dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
 	distcheck distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-recursive distclean-tags \
-	distcleancheck distdir distuninstallcheck dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-libLTLIBRARIES \
+	distclean-hdr distclean-libtool distclean-recursive \
+	distclean-tags distcleancheck distdir distuninstallcheck dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-libLTLIBRARIES \
 	install-library_includeHEADERS install-man install-strip \
 	installcheck installcheck-am installdirs installdirs-am \
 	maintainer-clean maintainer-clean-generic \

Modified: freeswitch/branches/mishehu/libs/libdingaling/configure
==============================================================================
--- freeswitch/branches/mishehu/libs/libdingaling/configure	(original)
+++ freeswitch/branches/mishehu/libs/libdingaling/configure	Wed Oct 18 23:32:52 2006
@@ -1947,6 +1947,8 @@
 
 
 
+          ac_config_headers="$ac_config_headers src/config.h"
+
 #AC_CONFIG_HEADER([])
 
 # Checks for programs.
@@ -3689,7 +3691,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3692 "configure"' > conftest.$ac_ext
+  echo '#line 3694 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -5268,7 +5270,7 @@
 
 
 # Provide some information about the compiler.
-echo "$as_me:5271:" \
+echo "$as_me:5273:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -6366,11 +6368,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6369: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6371: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6373: \$? = $ac_status" >&5
+   echo "$as_me:6375: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6628,11 +6630,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6631: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6633: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6635: \$? = $ac_status" >&5
+   echo "$as_me:6637: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6690,11 +6692,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6693: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6695: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6697: \$? = $ac_status" >&5
+   echo "$as_me:6699: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -8938,7 +8940,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8941 "configure"
+#line 8943 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9036,7 +9038,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9039 "configure"
+#line 9041 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11291,11 +11293,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11294: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11296: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11298: \$? = $ac_status" >&5
+   echo "$as_me:11300: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11353,11 +11355,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11356: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11358: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11360: \$? = $ac_status" >&5
+   echo "$as_me:11362: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12730,7 +12732,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12733 "configure"
+#line 12735 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12828,7 +12830,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12831 "configure"
+#line 12833 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13713,11 +13715,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13716: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13718: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13720: \$? = $ac_status" >&5
+   echo "$as_me:13722: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13775,11 +13777,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13778: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13780: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13782: \$? = $ac_status" >&5
+   echo "$as_me:13784: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15905,11 +15907,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15908: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15910: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15912: \$? = $ac_status" >&5
+   echo "$as_me:15914: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16167,11 +16169,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16170: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16172: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16174: \$? = $ac_status" >&5
+   echo "$as_me:16176: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16229,11 +16231,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16232: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16234: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16236: \$? = $ac_status" >&5
+   echo "$as_me:16238: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -18477,7 +18479,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18480 "configure"
+#line 18482 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18575,7 +18577,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18578 "configure"
+#line 18580 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -21107,6 +21109,251 @@
 
 #AC_CHECK_FUNCS([gethostname gettimeofday localtime_r memmove memset socket strcasecmp strchr strdup strncasecmp strstr])
 
+echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
+if test "${ac_cv_c_bigendian+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # See if sys/param.h defines the BYTE_ORDER macro.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ bogus endian macros
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_bigendian=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+# It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+  # try to guess the endianness by grepping values into an object file
+  ac_cv_c_bigendian=unknown
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+int
+main ()
+{
+ _ascii (); _ebcdic ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+  ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+  if test "$ac_cv_c_bigendian" = unknown; then
+    ac_cv_c_bigendian=no
+  else
+    # finding both strings is unlikely to happen, but who knows?
+    ac_cv_c_bigendian=unknown
+  fi
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+int
+main ()
+{
+  /* Are we little or big endian?  From Harbison&Steele.  */
+  union
+  {
+    long l;
+    char c[sizeof (long)];
+  } u;
+  u.l = 1;
+  exit (u.c[sizeof (long) - 1] == 1);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=no
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_bigendian=yes
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
+case $ac_cv_c_bigendian in
+  yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define __BYTE_ORDER __BIG_ENDIAN
+_ACEOF
+ ;;
+  no)
+
+cat >>confdefs.h <<\_ACEOF
+#define __BYTE_ORDER __LITTLE_ENDIAN
+_ACEOF
+ ;;
+  *)
+    { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+
+
+cat >>confdefs.h <<\_ACEOF
+#define __LITTLE_ENDIAN 1234
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define __BIG_ENDIAN 4321
+_ACEOF
+
+
           ac_config_files="$ac_config_files Makefile"
 
 
@@ -21184,39 +21431,8 @@
 }'
 fi
 
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section.  Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\),-D\1=\2,g
-t quote
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[	 `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output.  A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
+DEFS=-DHAVE_CONFIG_H
 
-
 ac_libobjs=
 ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
@@ -21570,10 +21786,15 @@
       --recheck    update $as_me by reconfiguring in the same conditions
   --file=FILE[:TEMPLATE]
 		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
 
 Configuration files:
 $config_files
 
+Configuration headers:
+$config_headers
+
 Configuration commands:
 $config_commands
 
@@ -21694,6 +21915,7 @@
   # Handling of arguments.
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
@@ -21706,6 +21928,7 @@
 # bizarre bug on SunOS 4.1.3.
 if $ac_need_defaults; then
   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
 fi
 
@@ -22081,6 +22304,251 @@
     rm -f $tmp/out
   fi
 
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X$ac_file : 'X\(//\)[^/]' \| \
+	 X$ac_file : 'X\(//\)$' \| \
+	 X$ac_file : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`/stamp-h$_am_stamp_count
 done
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF

Modified: freeswitch/branches/mishehu/libs/libdingaling/configure.in
==============================================================================
--- freeswitch/branches/mishehu/libs/libdingaling/configure.in	(original)
+++ freeswitch/branches/mishehu/libs/libdingaling/configure.in	Wed Oct 18 23:32:52 2006
@@ -5,6 +5,7 @@
 AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
 AM_INIT_AUTOMAKE(libdingaling,0.1)
 AC_CONFIG_SRCDIR([src])
+AC_CONFIG_HEADER([src/config.h])
 #AC_CONFIG_HEADER([])
 
 # Checks for programs.
@@ -31,6 +32,10 @@
 AC_TYPE_SIGNAL
 AC_FUNC_STRFTIME
 #AC_CHECK_FUNCS([gethostname gettimeofday localtime_r memmove memset socket strcasecmp strchr strdup strncasecmp strstr])
+
+AC_C_BIGENDIAN(AC_DEFINE([__BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([__BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
+AC_DEFINE([__LITTLE_ENDIAN],1234,[for the places where it is not defined])
+AC_DEFINE([__BIG_ENDIAN],4321,[for the places where it is not defined])
 
 AC_CONFIG_FILES([Makefile])
 

Modified: freeswitch/branches/mishehu/libs/libdingaling/libdingaling.vcproj
==============================================================================
--- freeswitch/branches/mishehu/libs/libdingaling/libdingaling.vcproj	(original)
+++ freeswitch/branches/mishehu/libs/libdingaling/libdingaling.vcproj	Wed Oct 18 23:32:52 2006
@@ -46,9 +46,10 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100;4706"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -107,9 +108,10 @@
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -170,9 +172,10 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="4"
+				DisableSpecificWarnings="4100"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -247,9 +250,10 @@
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;APR_DECLARE_STATIC;APU_DECLARE_STATIC"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -302,6 +306,10 @@
 			>
 			<File
 				RelativePath=".\src\libdingaling.c"
+				>
+			</File>
+			<File
+				RelativePath=".\src\sha1.c"
 				>
 			</File>
 		</Filter>

Modified: freeswitch/branches/mishehu/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/branches/mishehu/libs/libdingaling/src/libdingaling.c	(original)
+++ freeswitch/branches/mishehu/libs/libdingaling/src/libdingaling.c	Wed Oct 18 23:32:52 2006
@@ -60,7 +60,12 @@
 
 #include "ldl_compat.h"
 #include "libdingaling.h"
+#include "sha1.h"
 
+#ifdef _MSC_VER
+#pragma warning(disable:4127)
+#endif
+
 #define microsleep(x) apr_sleep(x * 1000)
 
 static int opt_timeout = 30;
@@ -89,6 +94,12 @@
 	int hit;
 };
 
+typedef enum {
+	CS_NEW,
+	CS_START,
+	CS_CONNECTED
+} ldl_handle_state_t;
+
 struct ldl_handle {
 	iksparser *parser;
 	iksid *acc;
@@ -116,6 +127,7 @@
 	apr_pool_t *pool;
 	void *private_info;
 	FILE *log_stream;
+	ldl_handle_state_t state;
 };
 
 struct ldl_session {
@@ -125,6 +137,7 @@
 	char *initiator;
 	char *them;
 	char *ip;
+	char *login;
 	ldl_payload_t payloads[LDL_MAX_PAYLOADS];
 	unsigned int payload_len;
 	ldl_candidate_t candidates[LDL_MAX_CANDIDATES];
@@ -193,7 +206,7 @@
 
 void ldl_session_send_msg(ldl_session_t *session, char *subject, char *body)
 {
-	ldl_handle_send_msg(session->handle, session->them, subject, body);
+	ldl_handle_send_msg(session->handle, session->login, session->them, subject, body);
 }
 
 ldl_status ldl_session_destroy(ldl_session_t **session_p)
@@ -235,14 +248,21 @@
 		*session_p = NULL;
 		return LDL_STATUS_MEMERR;
 	}
-	
 	memset(session, 0, sizeof(ldl_session_t));
 	apr_pool_create(&session->pool, globals.memory_pool);
 	session->id = apr_pstrdup(session->pool, id);
 	session->them = apr_pstrdup(session->pool, them);
-	if (me) {
-		session->initiator = apr_pstrdup(session->pool, me);
+	
+	//if (me) {
+	//session->initiator = apr_pstrdup(session->pool, them);
+	//} 
+
+	if (ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
+		session->login = apr_pstrdup(session->pool, me);
+	} else {
+		session->login = apr_pstrdup(session->pool, handle->login);
 	}
+
 	apr_hash_set(handle->sessions, session->id, APR_HASH_KEY_STRING, session);
 	apr_hash_set(handle->sessions, session->them, APR_HASH_KEY_STRING, session);
 	session->handle = handle;
@@ -259,7 +279,7 @@
 	return LDL_STATUS_SUCCESS;
 }
 
-static ldl_status parse_session_code(ldl_handle_t *handle, char *id, char *from, iks *xml, char *xtype)
+static ldl_status parse_session_code(ldl_handle_t *handle, char *id, char *from, char *to, iks *xml, char *xtype)
 {
 	ldl_session_t *session = NULL;
 	ldl_signal_t signal = LDL_SIGNAL_NONE;
@@ -267,7 +287,7 @@
 	char *msg = NULL;
 
 	if (!(session = apr_hash_get(handle->sessions, id, APR_HASH_KEY_STRING))) {
-		ldl_session_create(&session, handle, id, from, initiator);
+		ldl_session_create(&session, handle, id, from, to);
 		if (!session) {
 			return LDL_STATUS_MEMERR;
 		}
@@ -395,7 +415,7 @@
 							session->candidates[index].address = apr_pstrdup(session->pool, key);
 						}
 						if ((key = iks_find_attrib(tag, "port"))) {
-							session->candidates[index].port = atoi(key);
+							session->candidates[index].port = (uint16_t)atoi(key);
 						}
 						if (globals.debug) {
 							globals.logger(DL_LOG_DEBUG, 
@@ -433,7 +453,7 @@
 	}
 
 	if (handle->session_callback && signal) {
-		handle->session_callback(handle, session, signal, from, id, msg); 
+		handle->session_callback(handle, session, signal, to, from, id, msg); 
 	}
 
 	return LDL_STATUS_SUCCESS;
@@ -441,15 +461,230 @@
 
 const char *marker = "TRUE";
 
+static int on_disco_info(void *user_data, ikspak *pak)
+{
+	ldl_handle_t *handle = user_data;
+
+	if (pak->subtype == IKS_TYPE_RESULT) {
+		if (iks_find_with_attrib(pak->query, "feature", "var", "http://www.google.com/xmpp/protocol/voice/v1")) {
+			char *from = iks_find_attrib(pak->x, "from");
+			char id[1024];
+			char *resource;
+			struct ldl_buffer *buffer;
+			size_t x;
+
+			if (!apr_hash_get(handle->sub_hash, from, APR_HASH_KEY_STRING)) {
+				iks *msg;
+				apr_hash_set(handle->sub_hash, 	apr_pstrdup(handle->pool, from), APR_HASH_KEY_STRING, &marker);
+				msg = iks_make_s10n (IKS_TYPE_SUBSCRIBED, from, "Ding A Ling...."); 
+				apr_queue_push(handle->queue, msg);
+			}
+
+			apr_cpystrn(id, from, sizeof(id));
+			if ((resource = strchr(id, '/'))) {
+				*resource++ = '\0';
+			}
+
+			if (resource) {
+				for (x = 0; x < strlen(resource); x++) {
+					resource[x] = (char)tolower((int)resource[x]);
+				}
+			}
+
+			if (resource && strstr(resource, "talk") && (buffer = apr_hash_get(handle->probe_hash, id, APR_HASH_KEY_STRING))) {
+				apr_cpystrn(buffer->buf, from, buffer->len);
+				fflush(stderr);
+				buffer->hit = 1;
+			}
+		}
+		return IKS_FILTER_EAT;
+	}
+	
+	if (pak->subtype == IKS_TYPE_GET) {
+		iks *iq, *query, *tag;
+		uint8_t send = 0;
+
+		if ((iq = iks_new("iq"))) {
+			do {
+				iks_insert_attrib(iq, "from", handle->login);
+				iks_insert_attrib(iq, "to", pak->from->full);
+				iks_insert_attrib(iq, "id", pak->id);
+				iks_insert_attrib(iq, "type", "result");
+
+				if (!(query = iks_insert (iq, "query"))) {
+					break;
+				}
+				iks_insert_attrib(query, "xmlns", "http://jabber.org/protocol/disco#info");
+					
+				if (!(tag = iks_insert (query, "identity"))) {
+					break;
+				}
+				iks_insert_attrib(tag, "category", "client");
+				iks_insert_attrib(tag, "type", "voice");
+				iks_insert_attrib(tag, "name", "LibDingaLing");
+				
+
+				if (!(tag = iks_insert (query, "feature"))) {
+					break;
+				}
+				iks_insert_attrib(tag, "var", "http://jabber.org/protocol/disco#info");
+
+				if (!(tag = iks_insert (query, "feature"))) {
+					break;
+				}
+				iks_insert_attrib(tag, "var", "http://www.google.com/xmpp/protocol/voice/v1");
+				
+				iks_send(handle->parser, iq);
+				send = 1;
+			} while (0);
+
+			iks_delete(iq);
+		}
+
+		if (!send) {
+			globals.logger(DL_LOG_DEBUG, "Memory Error!\n");
+		}		
+	}
+
+	return IKS_FILTER_EAT;
+}
+
+static int on_component_disco_info(void *user_data, ikspak *pak)
+{
+	char *node = iks_find_attrib(pak->query, "node");
+	ldl_handle_t *handle = user_data;
+
+	if (pak->subtype == IKS_TYPE_RESULT) {
+		globals.logger(DL_LOG_DEBUG, "FixME!!! node=[%s]\n", node?node:"");		
+	} else if (pak->subtype == IKS_TYPE_GET) {
+		//	if (ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
+		if (node) {
+			
+		} else {
+			iks *iq, *query, *tag;
+			uint8_t send = 0;
+
+			if ((iq = iks_new("iq"))) {
+				do {
+					iks_insert_attrib(iq, "from", handle->login);
+					iks_insert_attrib(iq, "to", pak->from->full);
+					iks_insert_attrib(iq, "id", pak->id);
+					iks_insert_attrib(iq, "type", "result");
+
+					if (!(query = iks_insert (iq, "query"))) {
+						break;
+					}
+					iks_insert_attrib(query, "xmlns", "http://jabber.org/protocol/disco#info");
+					
+					if (!(tag = iks_insert (query, "identity"))) {
+						break;
+					}
+					iks_insert_attrib(tag, "category", "gateway");
+					iks_insert_attrib(tag, "type", "voice");
+					iks_insert_attrib(tag, "name", "LibDingaLing");
+				
+
+					if (!(tag = iks_insert (query, "feature"))) {
+						break;
+					}
+					iks_insert_attrib(tag, "var", "http://jabber.org/protocol/disco");
+
+					if (!(tag = iks_insert (query, "feature"))) {
+						break;
+					}
+					iks_insert_attrib(tag, "var", "jabber:iq:register");
+				
+					/*
+					if (!(tag = iks_insert (query, "feature"))) {
+						break;
+					}
+					iks_insert_attrib(tag, "var", "http://jabber.org/protocol/commands");
+					*/
+
+					if (!(tag = iks_insert (query, "feature"))) {
+						break;
+					}
+					iks_insert_attrib(tag, "var", "jabber:iq:gateway");
+
+					if (!(tag = iks_insert (query, "feature"))) {
+						break;
+					}
+					iks_insert_attrib(tag, "var", "jabber:iq:version");
+
+					if (!(tag = iks_insert (query, "feature"))) {
+						break;
+					}
+					iks_insert_attrib(tag, "var", "vcard-temp");
+
+					if (!(tag = iks_insert (query, "feature"))) {
+						break;
+					}
+					iks_insert_attrib(tag, "var", "jabber:iq:search");
+
+					iks_send(handle->parser, iq);
+					send = 1;
+				} while (0);
+
+				iks_delete(iq);
+			}
+
+			if (!send) {
+				globals.logger(DL_LOG_DEBUG, "Memory Error!\n");
+			}
+			
+		}
+	}
+
+	return IKS_FILTER_EAT;
+}
+
+
+
+static int on_disco_items(void *user_data, ikspak *pak)
+{
+	globals.logger(DL_LOG_DEBUG, "FixME!!!\n");
+	return IKS_FILTER_EAT;
+}
+
+static int on_disco_reg_in(void *user_data, ikspak *pak)
+{	
+	globals.logger(DL_LOG_DEBUG, "FixME!!!\n");
+	return IKS_FILTER_EAT;
+}
+
+static int on_disco_reg_out(void *user_data, ikspak *pak)
+{
+	globals.logger(DL_LOG_DEBUG, "FixME!!!\n");
+	return IKS_FILTER_EAT;
+}
+
 static int on_presence(void *user_data, ikspak *pak)
 {
 	ldl_handle_t *handle = user_data;
 	char *from = iks_find_attrib(pak->x, "from");
+	char *to = iks_find_attrib(pak->x, "to");
+	char *type = iks_find_attrib(pak->x, "type");
+	char *show = iks_find_cdata(pak->x, "show");
+	char *status = iks_find_cdata(pak->x, "status");
 	char id[1024];
 	char *resource;
 	struct ldl_buffer *buffer;
 	size_t x;
+	ldl_signal_t signal;
+
 	
+	if (type && !strcasecmp(type, "unavailable")) {
+		signal = LDL_SIGNAL_PRESENCE_OUT;
+	} else {
+		signal = LDL_SIGNAL_PRESENCE_IN;
+	}
+
+	if (!status) {
+		status = type;
+	}
+	
+	
+
 	if (!apr_hash_get(handle->sub_hash, from, APR_HASH_KEY_STRING)) {
 		iks *msg;
 		apr_hash_set(handle->sub_hash, 	apr_pstrdup(handle->pool, from), APR_HASH_KEY_STRING, &marker);
@@ -473,20 +708,104 @@
 		fflush(stderr);
 		buffer->hit = 1;
 	}
+	
+	if (!type || (type && strcasecmp(type, "probe"))) {
 
+		if (handle->session_callback) {
+			handle->session_callback(handle, NULL, signal, to, from, status ? status : "n/a", show ? show : "n/a");
+		}
+	}
+
+
 	return IKS_FILTER_EAT;
 }
 
+static void do_presence(ldl_handle_t *handle, char *from, char *to, char *type, char *message) 
+{
+	iks *pres;
+	char buf[512];
+	iks *tag;
 
+	if (!strchr(from, '/')) {
+		snprintf(buf, sizeof(buf), "%s/talk", from);
+		from = buf;
+	}
 
+	if ((pres = iks_new("presence"))) {
+		iks_insert_attrib(pres, "xmlns", "jabber:client");
+		if (from) {
+			iks_insert_attrib(pres, "from", from);
+		}
+		if (to) {
+			iks_insert_attrib(pres, "to", to);
+		}
+		if (type) {
+			iks_insert_attrib(pres, "type", type);
+		}
+
+
+
+		if (message) {			
+			if ((tag = iks_insert (pres, "status"))) {
+				iks_insert_cdata(tag, message ? message : "", 0);
+				if ((tag = iks_insert(pres, "c"))) {
+					iks_insert_attrib(tag, "node", "http://www.freeswitch.org/xmpp/client/caps");
+					iks_insert_attrib(tag, "ver", "1.0.0.1");
+					iks_insert_attrib(tag, "ext", "sidebar voice-v1");
+					iks_insert_attrib(tag, "client", "libdingaling2");
+					iks_insert_attrib(tag, "xmlns", "http://jabber.org/protocol/caps");
+				}
+			}
+		}
+	
+		apr_queue_push(handle->queue, pres);
+	}
+}
+
+static void do_roster(ldl_handle_t *handle) 
+{
+	if (handle->session_callback) {
+        handle->session_callback(handle, NULL, LDL_SIGNAL_ROSTER, NULL, handle->login, NULL, NULL);
+    }
+}
+
+static int on_unsubscribe(void *user_data, ikspak *pak)
+{
+	ldl_handle_t *handle = user_data;
+	char *from = iks_find_attrib(pak->x, "from");
+	char *to = iks_find_attrib(pak->x, "to");
+
+	if (handle->session_callback) {
+		handle->session_callback(handle, NULL, LDL_SIGNAL_SUBSCRIBE, to, from, NULL, NULL);
+	}
+
+	return IKS_FILTER_EAT;
+}
+
 static int on_subscribe(void *user_data, ikspak *pak)
 {
 	ldl_handle_t *handle = user_data;
 	char *from = iks_find_attrib(pak->x, "from");
+	char *to = iks_find_attrib(pak->x, "to");
 	iks *msg = iks_make_s10n (IKS_TYPE_SUBSCRIBED, from, "Ding A Ling...."); 
+
+	if (to && ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
+		iks_insert_attrib(msg, "from", to);
+	}
+
 	apr_queue_push(handle->queue, msg);
 	msg = iks_make_s10n (IKS_TYPE_SUBSCRIBE, from, "Ding A Ling...."); 
+
+	if (to && ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
+		iks_insert_attrib(msg, "from", to);
+	}
+
 	apr_queue_push(handle->queue, msg);
+
+	if (handle->session_callback) {
+		handle->session_callback(handle, NULL, LDL_SIGNAL_SUBSCRIBE, to, from, NULL, NULL);
+	}
+
 	return IKS_FILTER_EAT;
 }
 
@@ -508,7 +827,7 @@
 {
 	ldl_handle_t *handle = user_data;
 	char *from = iks_find_attrib(pak->x, "from");
-	//char *to = iks_find_attrib(pak->x, "to");
+	char *to = iks_find_attrib(pak->x, "to");
 	char *iqid = iks_find_attrib(pak->x, "id");
 	char *type = iks_find_attrib(pak->x, "type");
 	uint8_t is_result = strcasecmp(type, "result") ? 0 : 1;
@@ -522,9 +841,10 @@
 			if (!strcasecmp(iks_name(tag), "bind")) {
 				char *jid = iks_find_cdata(tag, "jid");
 				char *resource = strchr(jid, '/');
-				iks *iq, *x;
+				//iks *iq, *x;
 				handle->acc->resource = apr_pstrdup(handle->pool, resource);
 				handle->login = apr_pstrdup(handle->pool, jid);
+#if 0
 				if ((iq = iks_new("iq"))) {
 					iks_insert_attrib(iq, "type", "get");
 					iks_insert_attrib(iq, "id", "roster");
@@ -537,6 +857,7 @@
 					iks_delete(iq);
 					break;
 				}
+#endif
 			}
 			tag = iks_next_tag(tag);
 		}
@@ -561,10 +882,11 @@
 		if (!strcasecmp(name, "session")) {
 			char *id = iks_find_attrib(xml, "id");
 			//printf("SESSION type=%s name=%s id=%s\n", type, name, id);
-			if (parse_session_code(handle, id, from, xml, strcasecmp(type, "error") ? NULL : type) == LDL_STATUS_SUCCESS) {
+			if (parse_session_code(handle, id, from, to, xml, strcasecmp(type, "error") ? NULL : type) == LDL_STATUS_SUCCESS) {
 				iks *reply;
 				reply = iks_make_iq(IKS_TYPE_RESULT, NULL); 
 				iks_insert_attrib(reply, "to", from);
+				iks_insert_attrib(reply, "from", to);
 				iks_insert_attrib(reply, "id", iqid);
 				apr_queue_push(handle->queue, reply);
 			}
@@ -626,8 +948,89 @@
 	return 0;
 }
 
-static int on_stream(ldl_handle_t *handle, int type, iks * node)
+static void sha1_hash(char *out, char *in)
 {
+	sha_context_t sha;
+	char *p;
+	int x;
+	unsigned char digest[20];
+
+	SHA1Init(&sha);
+	
+	SHA1Update(&sha, (unsigned char *) in, (unsigned int)strlen(in));
+
+	SHA1Final(digest, &sha);
+
+	p = out;
+	for (x = 0; x < 20; x++) {
+		p += sprintf(p, "%2.2x", digest[x]);
+	}
+}
+
+
+static int on_stream_component(ldl_handle_t *handle, int type, iks *node)
+{
+	ikspak *pak = iks_packet(node);
+
+	switch (type) {
+	case IKS_NODE_START:
+		if (handle->state == CS_NEW) {
+			char secret[256];
+			char hash[256];
+			char handshake[512];
+			snprintf(secret, sizeof(secret), "%s%s", pak->id, handle->password);
+			sha1_hash(hash, secret);
+			snprintf(handshake, sizeof(handshake), "<handshake>%s</handshake>", hash);
+			iks_send_raw(handle->parser, handshake);
+			handle->state = CS_START;
+			if (iks_recv(handle->parser, 1) == 2) {
+				handle->state = CS_CONNECTED;
+				if (!ldl_test_flag(handle, LDL_FLAG_AUTHORIZED)) {
+					ldl_set_flag_locked(handle, LDL_FLAG_READY);
+					do_roster(handle);
+					if (handle->session_callback) {
+						handle->session_callback(handle, NULL, LDL_SIGNAL_LOGIN_SUCCESS, "user", "core", "Login Success", handle->login);
+					}
+					globals.logger(DL_LOG_DEBUG, "XMPP authenticated\n");
+					ldl_set_flag_locked(handle, LDL_FLAG_AUTHORIZED);
+				}
+			} else {
+				globals.logger(DL_LOG_ERR, "LOGIN ERROR!\n");
+				handle->state = CS_NEW;
+			}
+			break;
+		}
+		break;
+
+	case IKS_NODE_NORMAL:
+		break;
+
+	case IKS_NODE_ERROR:
+		globals.logger(DL_LOG_ERR, "NODE ERROR!\n");
+		return IKS_HOOK;
+
+	case IKS_NODE_STOP:
+		globals.logger(DL_LOG_ERR, "DISCONNECTED!\n");
+		return IKS_HOOK;
+	}
+	
+	
+	pak = iks_packet(node);
+	iks_filter_packet(handle->filter, pak);
+
+	if (handle->job_done == 1) {
+		return IKS_HOOK;
+	}
+    
+	if (node) {
+        iks_delete(node);
+	}
+
+	return IKS_OK;
+}
+
+static int on_stream(ldl_handle_t *handle, int type, iks *node)
+{
 	handle->counter = opt_timeout;
 
 	switch (type) {
@@ -690,20 +1093,20 @@
 		} else if (strcmp("failure", iks_name(node)) == 0) {
 			globals.logger(DL_LOG_DEBUG, "sasl authentication failed\n");
 			if (handle->session_callback) {
-				handle->session_callback(handle, NULL, LDL_SIGNAL_LOGIN_FAILURE, "core", "Login Failure", handle->login);
+				handle->session_callback(handle, NULL, LDL_SIGNAL_LOGIN_FAILURE, "user", "core", "Login Failure", handle->login);
 			}
 		} else if (strcmp("success", iks_name(node)) == 0) {
 			globals.logger(DL_LOG_DEBUG, "XMPP server connected\n");
 			iks_send_header(handle->parser, handle->acc->server);
 			ldl_set_flag_locked(handle, LDL_FLAG_CONNECTED);
 			if (handle->session_callback) {
-				handle->session_callback(handle, NULL, LDL_SIGNAL_CONNECTED, "core", "Server Connected", handle->login);
+				handle->session_callback(handle, NULL, LDL_SIGNAL_CONNECTED, "user", "core", "Server Connected", handle->login);
 			}
 		} else {
 			ikspak *pak;
 			if (!ldl_test_flag(handle, LDL_FLAG_AUTHORIZED)) {
 				if (handle->session_callback) {
-					handle->session_callback(handle, NULL, LDL_SIGNAL_LOGIN_SUCCESS, "core", "Login Success", handle->login);
+					handle->session_callback(handle, NULL, LDL_SIGNAL_LOGIN_SUCCESS, "user", "core", "Login Success", handle->login);
 				}
 				globals.logger(DL_LOG_DEBUG, "XMPP authenticated\n");
 				ldl_set_flag_locked(handle, LDL_FLAG_AUTHORIZED);
@@ -736,6 +1139,7 @@
 static int on_msg(void *user_data, ikspak *pak)
 {
 	char *cmd = iks_find_cdata(pak->x, "body");
+	char *to = iks_find_attrib(pak->x, "to");
 	char *from = iks_find_attrib(pak->x, "from");
 	char *subject = iks_find_attrib(pak->x, "subject");
 	ldl_handle_t *handle = user_data;
@@ -746,7 +1150,7 @@
 	}
 
 	if (handle->session_callback) {
-		handle->session_callback(handle, session, LDL_SIGNAL_MSG, from, subject ? subject : "N/A", cmd); 
+		handle->session_callback(handle, session, LDL_SIGNAL_MSG, to, from, subject ? subject : "N/A", cmd); 
 	}
 	
 	return 0;
@@ -771,18 +1175,13 @@
 	fprintf(stderr, "[%s]\n", data);
 }
 
-static void j_setup_filter(ldl_handle_t *handle, char *login)
+static void j_setup_filter(ldl_handle_t *handle)
 {
 	if (handle->filter) {
 		iks_filter_delete(handle->filter);
 	}
 	handle->filter = iks_filter_new();
 
-	/*
-	iks_filter_add_rule(handle->filter, on_msg, 0,
-						IKS_RULE_TYPE, IKS_PAK_MESSAGE,
-						IKS_RULE_SUBTYPE, IKS_TYPE_CHAT, IKS_RULE_FROM, login, IKS_RULE_DONE);
-	*/
 	iks_filter_add_rule(handle->filter, on_msg, handle, IKS_RULE_TYPE, IKS_PAK_MESSAGE, IKS_RULE_SUBTYPE, IKS_TYPE_CHAT, IKS_RULE_DONE);
 
 	iks_filter_add_rule(handle->filter, on_result, handle,
@@ -814,9 +1213,31 @@
 						IKS_RULE_SUBTYPE, IKS_TYPE_SUBSCRIBE,
 						IKS_RULE_DONE);
 
+	iks_filter_add_rule(handle->filter, on_unsubscribe, handle,
+						IKS_RULE_TYPE, IKS_PAK_S10N,
+						IKS_RULE_SUBTYPE, IKS_TYPE_UNSUBSCRIBE,
+						IKS_RULE_DONE);
+
 	iks_filter_add_rule(handle->filter, on_error, handle,
 						IKS_RULE_TYPE, IKS_PAK_IQ,
 						IKS_RULE_SUBTYPE, IKS_TYPE_ERROR, IKS_RULE_ID, "auth", IKS_RULE_DONE);
+
+
+
+	if (ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
+		iks_filter_add_rule(handle->filter, on_component_disco_info, handle, 
+							IKS_RULE_NS, "http://jabber.org/protocol/disco#info", IKS_RULE_DONE);
+		iks_filter_add_rule(handle->filter, on_disco_items, handle,
+							IKS_RULE_NS, "http://jabber.org/protocol/disco#items", IKS_RULE_DONE);
+		iks_filter_add_rule(handle->filter, on_disco_reg_in, handle,
+							IKS_RULE_SUBTYPE, IKS_TYPE_GET, IKS_RULE_NS, "jabber:iq:register", IKS_RULE_DONE);
+		iks_filter_add_rule(handle->filter, on_disco_reg_out, handle,
+							IKS_RULE_SUBTYPE, IKS_TYPE_SET, IKS_RULE_NS, "jabber:iq:register", IKS_RULE_DONE);
+	} else {
+		iks_filter_add_rule(handle->filter, on_disco_info, handle, 
+							IKS_RULE_NS, "http://jabber.org/protocol/disco#info", IKS_RULE_DONE);
+	}
+	
 }
 
 static void ldl_flush_queue(ldl_handle_t *handle)
@@ -910,26 +1331,35 @@
 {
 	while (ldl_test_flag(handle, LDL_FLAG_RUNNING)) {
 		int e;
+		char tmp[512], *sl;
 
-		handle->parser = iks_stream_new(IKS_NS_CLIENT, handle, (iksStreamHook *) on_stream);
+		handle->parser = iks_stream_new(ldl_test_flag(handle, LDL_FLAG_COMPONENT) ? IKS_NS_COMPONENT : IKS_NS_CLIENT,
+										handle,
+										(iksStreamHook *) (ldl_test_flag(handle, LDL_FLAG_COMPONENT) ? on_stream_component : on_stream));
+
 		if (globals.debug) {
 			iks_set_log_hook(handle->parser, (iksLogHook *) on_log);
 		}
-		handle->acc = iks_id_new(iks_parser_stack(handle->parser), jabber_id);
-		if (NULL == handle->acc->resource) {
+		
+		strncpy(tmp, jabber_id, sizeof(tmp)-1);
+		sl = strchr(tmp, '/');
+
+		if (!sl && !ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
 			/* user gave no resource name, use the default */
-			char tmp[512];
-			sprintf(tmp, "%s@%s/%s", handle->acc->user, handle->acc->server, "dingaling");
-			handle->acc = iks_id_new(iks_parser_stack(handle->parser), tmp);
+			snprintf(tmp + strlen(tmp), sizeof(tmp) - strlen(tmp), "/%s", "talk");
+		} else if (sl && ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
+			*sl = '\0';
 		}
+
+		handle->acc = iks_id_new(iks_parser_stack(handle->parser), tmp);
+
 		handle->password = pass;
 
-		j_setup_filter(handle, "fixme");
+		j_setup_filter(handle);
 
 		e = iks_connect_via(handle->parser,
 							handle->server ? handle->server : handle->acc->server,
 							handle->port ? handle->port : IKS_JABBER_PORT,
-							//handle->server ? handle->server : handle->acc->server);
 							handle->acc->server);
 
 		switch (e) {
@@ -1022,7 +1452,7 @@
 	snprintf(idbuf, sizeof(idbuf), "%u", myid);
 	iq = iks_new("iq");
 	iks_insert_attrib(iq, "xmlns", "jabber:client");
-	iks_insert_attrib(iq, "from", session->handle->login);
+	iks_insert_attrib(iq, "from", session->login);
 	iks_insert_attrib(iq, "to", session->them);
 	iks_insert_attrib(iq, "type", "set");
 	iks_insert_attrib(iq, "id", idbuf);
@@ -1074,6 +1504,11 @@
 	return session->them;
 }
 
+char *ldl_session_get_callee(ldl_session_t *session)
+{
+	return session->login;
+}
+
 void ldl_session_set_ip(ldl_session_t *session, char *ip)
 {
 	session->ip = apr_pstrdup(session->pool, ip);
@@ -1105,7 +1540,7 @@
 	iq = iks_new("iq");
 	iks_insert_attrib(iq, "type", "set");
 	iks_insert_attrib(iq, "id", idbuf);
-	iks_insert_attrib(iq, "from", session->handle->login);
+	iks_insert_attrib(iq, "from", session->login);
 	iks_insert_attrib(iq, "to", session->them);
 	sess = iks_insert (iq, "session");
     iks_insert_attrib(sess, "xmlns", "http://www.google.com/session");
@@ -1124,8 +1559,13 @@
 	return handle->private_info;
 }
 
-void ldl_handle_send_msg(ldl_handle_t *handle, char *to, char *subject, char *body)
+void ldl_handle_send_presence(ldl_handle_t *handle, char *from, char *to, char *type, char *message)
 {
+	do_presence(handle, from, to, type, message);
+}
+
+void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subject, char *body)
+{
 	iks *msg;
 
 	assert(handle != NULL);
@@ -1135,6 +1575,12 @@
 	msg = iks_make_msg(IKS_TYPE_NONE, to, body);
 	iks_insert_attrib(msg, "type", "chat");
 
+	if (!from) {
+		from = handle->login;
+	}
+
+	iks_insert_attrib(msg, "from", from);
+
 	if (subject) {
 		iks_insert_attrib(msg, "subject", subject);
 	}
@@ -1167,7 +1613,7 @@
 
 {
 	iks *iq, *sess, *tag;
-	unsigned int x, id;
+	unsigned int x, id = 0;
 
 
 	for (x = 0; x < clen; x++) {
@@ -1217,7 +1663,7 @@
 	return id;
 }
 
-char *ldl_handle_probe(ldl_handle_t *handle, char *id, char *buf, unsigned int len)
+char *ldl_handle_probe(ldl_handle_t *handle, char *id, char *from, char *buf, unsigned int len)
 {
 	iks *pres, *msg;
 	char *lid = NULL;
@@ -1233,11 +1679,13 @@
 
 	pres = iks_new("presence");
 	iks_insert_attrib(pres, "type", "probe");
+	iks_insert_attrib(pres, "from", from);
 	iks_insert_attrib(pres, "to", id);
 
 
 	apr_hash_set(handle->probe_hash, id, APR_HASH_KEY_STRING, &buffer);
 	msg = iks_make_s10n (IKS_TYPE_SUBSCRIBE, id, notice); 
+	iks_insert_attrib(pres, "from", from);
 	apr_queue_push(handle->queue, msg);
 	msg = iks_make_s10n (IKS_TYPE_SUBSCRIBED, id, notice); 
 	apr_queue_push(handle->queue, msg);
@@ -1250,6 +1698,7 @@
 		elapsed = (unsigned int)((apr_time_now() - started) / 1000);
 		if (elapsed > 5000 && ! again) {
 			msg = iks_make_s10n (IKS_TYPE_SUBSCRIBE, id, notice); 
+			iks_insert_attrib(pres, "from", from);
 			apr_queue_push(handle->queue, msg);
 			again++;
 		}
@@ -1268,6 +1717,74 @@
 }
 
 
+char *ldl_handle_disco(ldl_handle_t *handle, char *id, char *from, char *buf, unsigned int len)
+{
+	iks *iq, *query, *msg;
+	char *lid = NULL;
+	struct ldl_buffer buffer;
+	apr_time_t started;
+	unsigned int elapsed;
+	char *notice = "Call Me!";
+	int again = 0;
+	unsigned int myid;
+    char idbuf[80];
+
+	myid = next_id();
+    snprintf(idbuf, sizeof(idbuf), "%u", myid);
+
+	buffer.buf = buf;
+	buffer.len = len;
+	buffer.hit = 0;
+
+	if ((iq = iks_new("iq"))) {
+		if ((query = iks_insert(iq, "query"))) {
+			iks_insert_attrib(iq, "type", "get");
+			iks_insert_attrib(iq, "to", id);
+			iks_insert_attrib(iq,"from", from);
+			iks_insert_attrib(iq, "id", idbuf);
+			iks_insert_attrib(query, "xmlns", "http://jabber.org/protocol/disco#info");
+		} else {
+			iks_delete(iq);
+			globals.logger(DL_LOG_DEBUG, "Memory ERROR!\n");
+			return NULL;
+		}
+	} else {
+		globals.logger(DL_LOG_DEBUG, "Memory ERROR!\n");
+		return NULL;
+	}
+	
+	apr_hash_set(handle->probe_hash, id, APR_HASH_KEY_STRING, &buffer);
+	msg = iks_make_s10n (IKS_TYPE_SUBSCRIBE, id, notice); 
+	apr_queue_push(handle->queue, msg);
+	msg = iks_make_s10n (IKS_TYPE_SUBSCRIBED, id, notice); 
+	apr_queue_push(handle->queue, msg);
+	apr_queue_push(handle->queue, iq);
+
+	//schedule_packet(handle, next_id(), pres, LDL_RETRY);
+
+	started = apr_time_now();
+	for(;;) {
+		elapsed = (unsigned int)((apr_time_now() - started) / 1000);
+		if (elapsed > 5000 && ! again) {
+			msg = iks_make_s10n (IKS_TYPE_SUBSCRIBE, id, notice); 
+			apr_queue_push(handle->queue, msg);
+			again++;
+		}
+		if (elapsed > 10000) {
+			break;
+		}
+		if (buffer.hit) {
+			lid = buffer.buf;
+			break;
+		}
+		ldl_yield(1000);
+	}
+
+	apr_hash_set(handle->probe_hash, id, APR_HASH_KEY_STRING, NULL);
+	return lid;
+}
+
+
 unsigned int ldl_session_describe(ldl_session_t *session,
 								ldl_payload_t *payloads,
 								unsigned int plen,
@@ -1390,7 +1907,7 @@
 
 int8_t ldl_handle_ready(ldl_handle_t *handle)
 {
-	return ldl_test_flag(handle, LDL_FLAG_READY);
+	return (int8_t)ldl_test_flag(handle, LDL_FLAG_READY);
 }
 
 ldl_status ldl_handle_init(ldl_handle_t **handle,
@@ -1436,7 +1953,7 @@
 			new_handle->server = apr_pstrdup(pool, server);
 			if ((p = strchr(new_handle->server, ':'))) {
 				*p++ = '\0';
-				new_handle->port = atoi(p);
+				new_handle->port = (uint16_t)atoi(p);
 			}
 		}
 

Modified: freeswitch/branches/mishehu/libs/libdingaling/src/libdingaling.h
==============================================================================
--- freeswitch/branches/mishehu/libs/libdingaling/src/libdingaling.h	(original)
+++ freeswitch/branches/mishehu/libs/libdingaling/src/libdingaling.h	Wed Oct 18 23:32:52 2006
@@ -50,6 +50,7 @@
 #define LDL_MAX_CANDIDATES 10
 #define LDL_MAX_PAYLOADS 50
 #define LDL_RETRY 3
+#define IKS_NS_COMPONENT "jabber:component:accept"
 
 /*! \brief A structure to store a jingle candidate */
 struct ldl_candidate {
@@ -105,13 +106,14 @@
 	LDL_FLAG_AUTHORIZED = (1 << 2),
 	LDL_FLAG_READY = (1 << 3),
 	LDL_FLAG_CONNECTED = (1 << 4),
-	LDL_FLAG_QUEUE_RUNNING = (1 << 5),
+	LDL_FLAG_QUEUE_RUNNING = (1 << 5)
 } ldl_flag_t;
 
 typedef enum {
 	LDL_FLAG_TLS = (1 << 10),
 	LDL_FLAG_SASL_PLAIN = (1 << 11),
-	LDL_FLAG_SASL_MD5 = (1 << 12)
+	LDL_FLAG_SASL_MD5 = (1 << 12),
+	LDL_FLAG_COMPONENT = (1 << 13),
 } ldl_user_flag_t;
 
 typedef enum {
@@ -119,6 +121,11 @@
 	LDL_SIGNAL_INITIATE,
 	LDL_SIGNAL_CANDIDATES,
 	LDL_SIGNAL_MSG,
+	LDL_SIGNAL_PRESENCE_IN,
+	LDL_SIGNAL_PRESENCE_OUT,
+	LDL_SIGNAL_ROSTER,
+	LDL_SIGNAL_SUBSCRIBE,
+	LDL_SIGNAL_UNSUBSCRIBE,
 	LDL_SIGNAL_TERMINATE,
 	LDL_SIGNAL_ERROR,
 	LDL_SIGNAL_LOGIN_SUCCESS,
@@ -154,7 +161,7 @@
 #define DL_LOG_EMERG DL_PRE, 0
 
 typedef ldl_status (*ldl_loop_callback_t)(ldl_handle_t *);
-typedef ldl_status (*ldl_session_callback_t)(ldl_handle_t *, ldl_session_t *, ldl_signal_t, char *, char *, char *);
+typedef ldl_status (*ldl_session_callback_t)(ldl_handle_t *, ldl_session_t *, ldl_signal_t, char *, char *, char *, char *);
 typedef ldl_status (*ldl_response_callback_t)(ldl_handle_t *, char *);
 typedef void (*ldl_logger_t)(char *file, const char *func, int line, int level, char *fmt, ...);
 
@@ -264,6 +271,13 @@
 char *ldl_session_get_caller(ldl_session_t *session);
 
 /*!
+  \brief Get the callee name of a session
+  \param session the session to get the callee from
+  \return the callee name
+*/
+char *ldl_session_get_callee(ldl_session_t *session);
+
+/*!
   \brief Set the ip of a session
   \param session the session to set the ip on
   \param ip the ip
@@ -308,13 +322,25 @@
   \brief Perform a probe on a given id to resolve the proper Jingle Resource
   \param handle the connection handle to use.
   \param id the id to probe
+  \param from the from string
   \param buf a string to store the result
   \param len the size in bytes of the string
   \return a pointer to buf if a successful lookup was made otherwise NULL
 */
-char *ldl_handle_probe(ldl_handle_t *handle, char *id, char *buf, unsigned int len);
+char *ldl_handle_probe(ldl_handle_t *handle, char *id, char *from, char *buf, unsigned int len);
 
 /*!
+  \brief Perform a discovery on a given id to resolve the proper Jingle Resource
+  \param handle the connection handle to use.
+  \param id the id to probe
+  \param from the from string
+  \param buf a string to store the result
+  \param len the size in bytes of the string
+  \return a pointer to buf if a successful lookup was made otherwise NULL
+*/
+char *ldl_handle_disco(ldl_handle_t *handle, char *id, char *from, char *buf, unsigned int len);
+
+/*!
   \brief Signal a termination request on a given session
   \param session the session to terminate
   \return TRUE if the signal was sent.
@@ -338,13 +364,24 @@
 void ldl_session_send_msg(ldl_session_t *session, char *subject, char *body);
 
 /*!
+  \brief Send a presence notification to a target
+  \param handle the handle to send with
+  \param from the from address
+  \param to the to address
+  \param type the type of presence
+  \param message a status message
+*/
+void ldl_handle_send_presence(ldl_handle_t *handle, char *from, char *to, char *type, char *message);
+
+/*!
   \brief Send a message
   \param handle the conection handle
+  \param from the message sender
   \param to the message recipiant
   \param subject optional subject
   \param body body of the message
 */
-void ldl_handle_send_msg(ldl_handle_t *handle, char *to, char *subject, char *body);
+void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subject, char *body);
 
 /*!
   \brief Offer candidates to a potential session

Modified: freeswitch/branches/mishehu/libs/win32/Download SOFIA.vcproj
==============================================================================
--- freeswitch/branches/mishehu/libs/win32/Download SOFIA.vcproj	(original)
+++ freeswitch/branches/mishehu/libs/win32/Download SOFIA.vcproj	Wed Oct 18 23:32:52 2006
@@ -76,8 +76,8 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					Description="Downloading SOFIA."
-					CommandLine="if not exist &quot;$(ProjectDir)..\sofia-sip-1.12.3.2&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://svn.freeswitch.org/downloads/libs/sofia-sip-1.12.3.2.tar.gz &quot;$(ProjectDir)..&quot;&#x0D;&#x0A;"
-					Outputs="$(ProjectDir)..\sofia-sip-1.12.3.2"
+					CommandLine="if not exist &quot;$(ProjectDir)..\sofia-sip-1.12.3.4&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://svn.freeswitch.org/downloads/libs/sofia-sip-1.12.3.4.tar.gz &quot;$(ProjectDir)..&quot;&#x0D;&#x0A;"
+					Outputs="$(ProjectDir)..\sofia-sip-1.12.3.4"
 				/>
 			</FileConfiguration>
 			<FileConfiguration
@@ -86,8 +86,8 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					Description="Downloading SOFIA."
-					CommandLine="if not exist &quot;$(ProjectDir)..\sofia-sip-1.12.3.2&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://svn.freeswitch.org/downloads/libs/sofia-sip-1.12.3.2.tar.gz &quot;$(ProjectDir)..&quot;&#x0D;&#x0A;"
-					Outputs="$(ProjectDir)..\sofia-sip-1.12.3.2"
+					CommandLine="if not exist &quot;$(ProjectDir)..\sofia-sip-1.12.3.4&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://svn.freeswitch.org/downloads/libs/sofia-sip-1.12.3.4.tar.gz &quot;$(ProjectDir)..&quot;&#x0D;&#x0A;"
+					Outputs="$(ProjectDir)..\sofia-sip-1.12.3.4"
 				/>
 			</FileConfiguration>
 		</File>

Modified: freeswitch/branches/mishehu/libs/win32/pthread/pthread.vcproj
==============================================================================
--- freeswitch/branches/mishehu/libs/win32/pthread/pthread.vcproj	(original)
+++ freeswitch/branches/mishehu/libs/win32/pthread/pthread.vcproj	Wed Oct 18 23:32:52 2006
@@ -278,7 +278,7 @@
 		</Configuration>
 		<Configuration
 			Name="Release DLL|Win32"
-			OutputDirectory="$(SolutionDir)Debug"
+			OutputDirectory="$(SolutionDir)Release"
 			IntermediateDirectory="$(ConfigurationName)"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"

Modified: freeswitch/branches/mishehu/libs/win32/sofia/libsofia_sip_ua_static.vcproj
==============================================================================
--- freeswitch/branches/mishehu/libs/win32/sofia/libsofia_sip_ua_static.vcproj	(original)
+++ freeswitch/branches/mishehu/libs/win32/sofia/libsofia_sip_ua_static.vcproj	Wed Oct 18 23:32:52 2006
@@ -26,7 +26,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.2\win32\gawk.exe&quot; cscript /nologo &quot;$(ProjectDir)..\util.vbs&quot; Get http://svn.freeswitch.org/downloads/win32/gawk.exe &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.2\win32\&quot;&#x0D;&#x0A;cd /D &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.2\win32\&quot;&#x0D;&#x0A;&quot;autogen.cmd&quot;&#x0D;&#x0A;"
+				CommandLine="if not exist &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.4\win32\gawk.exe&quot; cscript /nologo &quot;$(ProjectDir)..\util.vbs&quot; Get http://svn.freeswitch.org/downloads/win32/gawk.exe &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.4\win32\&quot;&#x0D;&#x0A;cd /D &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.4\win32\&quot;&#x0D;&#x0A;&quot;autogen.cmd&quot;&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -43,7 +43,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;..\..\sofia-sip-1.12.3.2\win32&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\bnf&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\url&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nth&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\features&quot;;&quot;..\..\pthreads-w32-2-7-0-release&quot;;."
+				AdditionalIncludeDirectories="&quot;..\..\sofia-sip-1.12.3.4\win32&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\bnf&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\url&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nth&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\features&quot;;&quot;..\..\pthreads-w32-2-7-0-release&quot;;."
 				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -53,8 +53,9 @@
 				ObjectFile=".\Debug/"
 				ProgramDataBaseFileName=".\Debug/"
 				BrowseInformation="1"
-				WarningLevel="3"
+				WarningLevel="4"
 				SuppressStartupBanner="true"
+				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 			/>
 			<Tool
@@ -103,7 +104,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="if not exist &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.2\win32\gawk.exe&quot; cscript /nologo &quot;$(ProjectDir)..\util.vbs&quot; Get http://svn.freeswitch.org/downloads/win32/gawk.exe &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.2\win32\&quot;&#x0D;&#x0A;cd /D &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.2\win32\&quot;&#x0D;&#x0A;&quot;autogen.cmd&quot;&#x0D;&#x0A;"
+				CommandLine="if not exist &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.4\win32\gawk.exe&quot; cscript /nologo &quot;$(ProjectDir)..\util.vbs&quot; Get http://svn.freeswitch.org/downloads/win32/gawk.exe &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.4\win32\&quot;&#x0D;&#x0A;cd /D &quot;$(ProjectDir)..\..\sofia-sip-1.12.3.4\win32\&quot;&#x0D;&#x0A;&quot;autogen.cmd&quot;&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -121,7 +122,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="&quot;..\..\sofia-sip-1.12.3.2\win32&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\bnf&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\url&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nth&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport&quot;;&quot;..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\features&quot;;&quot;..\..\pthreads-w32-2-7-0-release&quot;;."
+				AdditionalIncludeDirectories="&quot;..\..\sofia-sip-1.12.3.4\win32&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\bnf&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\url&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nth&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport&quot;;&quot;..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\features&quot;;&quot;..\..\pthreads-w32-2-7-0-release&quot;;."
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB"
 				StringPooling="true"
 				RuntimeLibrary="2"
@@ -131,8 +132,9 @@
 				ObjectFile=".\Release/"
 				ProgramDataBaseFileName=".\Release/"
 				BrowseInformation="1"
-				WarningLevel="3"
+				WarningLevel="4"
 				SuppressStartupBanner="true"
+				Detect64BitPortabilityProblems="true"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -181,7 +183,7 @@
 				Filter="su*.c"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\inet_ntop.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\inet_ntop.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -203,7 +205,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\inet_pton.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\inet_pton.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -225,7 +227,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -247,7 +249,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_addrinfo.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_addrinfo.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -269,7 +271,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_alloc.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_alloc.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -291,7 +293,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_alloc_lock.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_alloc_lock.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -313,7 +315,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_bm.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_bm.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -335,7 +337,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_default_log.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_default_log.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -357,7 +359,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_errno.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_errno.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -379,7 +381,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_global_log.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_global_log.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -401,7 +403,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_localinfo.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_localinfo.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -423,7 +425,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_log.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_log.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -445,7 +447,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_md5.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_md5.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -467,11 +469,11 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_os_nw.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_os_nw.c"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_port.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_port.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -493,7 +495,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_root.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_root.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -515,7 +517,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_sprintf.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_sprintf.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -537,7 +539,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_strdup.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_strdup.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -559,7 +561,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_strlst.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_strlst.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -581,7 +583,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -603,7 +605,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_tag_io.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_tag_io.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -625,7 +627,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_taglist.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_taglist.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -647,7 +649,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_time.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_time.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -669,7 +671,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_time0.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_time0.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -691,7 +693,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_timer.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_timer.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -713,7 +715,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_uniqueid.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_uniqueid.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -735,7 +737,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_vector.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_vector.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -757,7 +759,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_wait.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_wait.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -783,7 +785,7 @@
 				Name="ipt"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt\base64.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt\base64.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -805,7 +807,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt\rc4.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt\rc4.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -827,7 +829,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt\string0.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt\string0.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -849,7 +851,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt\token64.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt\token64.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -876,7 +878,7 @@
 				Filter="url*.c"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\url\url.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\url\url.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -898,7 +900,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\url\url_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\url\url_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -920,7 +922,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\url\url_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\url\url_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -947,7 +949,7 @@
 				Filter="features*.c"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\features\features.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\features\features.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -974,7 +976,7 @@
 				Filter="bnf*.c"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\bnf\bnf.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\bnf\bnf.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1001,7 +1003,7 @@
 				Filter="msg*.c"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1023,7 +1025,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_auth.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_auth.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1045,7 +1047,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_basic.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_basic.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1067,7 +1069,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_date.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_date.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1089,7 +1091,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_generic.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_generic.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1111,7 +1113,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_header_copy.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_header_copy.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1133,7 +1135,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_header_make.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_header_make.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1155,7 +1157,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_mclass.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_mclass.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1177,7 +1179,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_mime.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_mime.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1199,7 +1201,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_mime_table.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_mime_table.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1221,7 +1223,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_parser.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_parser.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1243,7 +1245,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_parser_util.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_parser_util.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1265,7 +1267,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1291,7 +1293,7 @@
 				Name="clib replacement"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\memcspn.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\memcspn.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1313,7 +1315,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\memmem.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\memmem.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1335,7 +1337,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\memspn.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\memspn.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1357,7 +1359,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\strcasestr.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\strcasestr.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1379,7 +1381,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\strtoull.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\strtoull.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1405,7 +1407,7 @@
 				Name="sip"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_basic.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_basic.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1427,7 +1429,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_caller_prefs.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_caller_prefs.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1449,7 +1451,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_event.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_event.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1471,7 +1473,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_extra.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_extra.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1493,7 +1495,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_feature.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_feature.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1515,7 +1517,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_header.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_header.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1537,7 +1539,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_mime.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_mime.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1559,7 +1561,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_parser.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_parser.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1581,7 +1583,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_parser_table.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_parser_table.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1603,7 +1605,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_prack.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_prack.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1625,7 +1627,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_pref_util.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_pref_util.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1647,7 +1649,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_reason.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_reason.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1669,7 +1671,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_refer.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_refer.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1691,7 +1693,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_security.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_security.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1713,7 +1715,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_session.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_session.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1735,7 +1737,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_status.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_status.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1757,7 +1759,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1779,7 +1781,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_tag_class.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_tag_class.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1801,7 +1803,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1823,7 +1825,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_time.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_time.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1845,7 +1847,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_util.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_util.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1871,7 +1873,7 @@
 				Name="http"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\http_basic.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\http_basic.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1893,7 +1895,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\http_extra.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\http_extra.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1915,7 +1917,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\http_header.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\http_header.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1937,7 +1939,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\http_parser.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\http_parser.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1959,7 +1961,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\http_parser_table.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\http_parser_table.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -1981,7 +1983,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\http_status.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\http_status.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2003,7 +2005,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\http_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\http_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2025,7 +2027,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\http_tag_class.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\http_tag_class.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2047,7 +2049,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\http_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\http_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2073,7 +2075,7 @@
 				Name="nth"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nth\nth_client.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nth\nth_client.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2095,7 +2097,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nth\nth_server.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nth\nth_server.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2117,7 +2119,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nth\nth_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nth\nth_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2139,7 +2141,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nth\nth_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nth\nth_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2165,7 +2167,7 @@
 				Name="sresolv"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv\sres.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv\sres.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2187,7 +2189,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv\sres_blocking.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv\sres_blocking.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2209,7 +2211,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv\sres_cache.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv\sres_cache.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2231,7 +2233,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv\sresolv.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv\sresolv.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2257,7 +2259,7 @@
 				Name="nea"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea\nea.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea\nea.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2279,7 +2281,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea\nea_debug.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea\nea_debug.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2301,7 +2303,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea\nea_event.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea\nea_event.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2323,7 +2325,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea\nea_server.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea\nea_server.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2345,7 +2347,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea\nea_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea\nea_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2367,7 +2369,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea\nea_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea\nea_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2393,7 +2395,7 @@
 				Name="iptsec"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_client.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_client.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2415,7 +2417,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_common.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_common.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2437,7 +2439,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_digest.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_digest.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2459,7 +2461,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_module.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_module.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2481,7 +2483,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_module_http.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_module_http.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2503,7 +2505,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_module_sip.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_module_sip.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2525,7 +2527,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_plugin.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_plugin.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2547,7 +2549,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_plugin_delayed.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_plugin_delayed.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2569,7 +2571,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2591,7 +2593,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\auth_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\auth_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2613,7 +2615,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\iptsec_debug.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\iptsec_debug.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2639,7 +2641,7 @@
 				Name="stun"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\stun.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\stun.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2661,7 +2663,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\stun_common.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\stun_common.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2683,7 +2685,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\stun_dns.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\stun_dns.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2705,11 +2707,11 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\stun_internal.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\stun_internal.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\stun_mini.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\stun_mini.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2731,7 +2733,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\stun_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\stun_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2753,7 +2755,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\stun_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\stun_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2779,7 +2781,7 @@
 				Name="nua"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2801,7 +2803,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_common.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_common.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2823,7 +2825,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_dialog.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_dialog.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2845,11 +2847,11 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_dialog.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_dialog.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_event_server.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_event_server.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2871,7 +2873,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_message.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_message.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2893,11 +2895,11 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_notifier.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_notifier.c"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_options.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_options.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2919,7 +2921,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_params.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_params.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2941,11 +2943,11 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_params.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_params.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_publish.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_publish.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2967,7 +2969,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_register.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_register.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -2989,11 +2991,11 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_registrar.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_registrar.c"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_session.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_session.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3015,7 +3017,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_stack.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_stack.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3037,11 +3039,11 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_stack.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_stack.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_subnotref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_subnotref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3063,7 +3065,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3085,7 +3087,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\nua_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\nua_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3107,7 +3109,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\outbound.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\outbound.c"
 					>
 				</File>
 			</Filter>
@@ -3115,7 +3117,7 @@
 				Name="nta"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\nta.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\nta.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3137,7 +3139,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\nta_check.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\nta_check.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3159,7 +3161,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\nta_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\nta_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3181,7 +3183,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\nta_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\nta_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3203,7 +3205,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\sl_read_payload.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\sl_read_payload.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3225,7 +3227,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\sl_utils_log.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\sl_utils_log.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3247,7 +3249,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\sl_utils_print.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\sl_utils_print.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3273,7 +3275,7 @@
 				Name="tport"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3295,11 +3297,11 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_internal.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_internal.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_logging.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_logging.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3321,7 +3323,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_stub_sigcomp.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_stub_sigcomp.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3343,7 +3345,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_stub_stun.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_stub_stun.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3365,7 +3367,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3387,7 +3389,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3409,7 +3411,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_type_connect.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_type_connect.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3431,7 +3433,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_type_tcp.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_type_tcp.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3453,7 +3455,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_type_udp.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_type_udp.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3479,7 +3481,7 @@
 				Name="sdp"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp\sdp.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp\sdp.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3501,7 +3503,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp\sdp_parse.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp\sdp_parse.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3523,7 +3525,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp\sdp_print.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp\sdp_print.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3545,7 +3547,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp\sdp_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp\sdp_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3567,7 +3569,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp\sdp_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp\sdp_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3593,7 +3595,7 @@
 				Name="soa"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa\soa.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa\soa.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3615,11 +3617,11 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa\sofia-sip-1.12.3.2\soa_session.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa\sofia-sip-1.12.3.4\soa_session.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa\soa_static.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa\soa_static.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3641,7 +3643,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa\soa_tag.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa\soa_tag.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3663,7 +3665,7 @@
 					</FileConfiguration>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa\soa_tag_ref.c"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa\soa_tag_ref.c"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"
@@ -3695,123 +3697,123 @@
 				Filter="su*.h"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\htable.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\htable.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\htable2.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\htable2.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\rbtree.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\rbtree.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_addrinfo.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_addrinfo.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_alloc.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_alloc.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_alloc_stat.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_alloc_stat.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_bm.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_bm.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_config.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_config.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_debug.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_debug.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_errno.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_errno.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_localinfo.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_localinfo.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_log.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_log.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_md5.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_md5.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_module_debug.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_module_debug.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_os_nw.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_os_nw.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\su_port.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\su_port.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_source.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_source.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_strlst.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_strlst.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_tag.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_tag_class.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_tag_class.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_tag_inline.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_tag_inline.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_tag_io.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_tag_io.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_tagarg.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_tagarg.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_time.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_time.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_types.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_types.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_uniqueid.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_uniqueid.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_vector.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_vector.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\su_wait.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\su_wait.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\su\sofia-sip-1.12.3.2\tstdef.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\su\sofia-sip-1.12.3.4\tstdef.h"
 					>
 				</File>
 			</Filter>
@@ -3823,7 +3825,7 @@
 					>
 				</File>
 				<File
-					RelativePath="..\sofia-sip-1.12.3.2\su_configure.h"
+					RelativePath="..\sofia-sip-1.12.3.4\su_configure.h"
 					>
 				</File>
 				<File
@@ -3835,19 +3837,19 @@
 				Name="ipt headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt\sofia-sip-1.12.3.2\base64.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt\sofia-sip-1.12.3.4\base64.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt\sofia-sip-1.12.3.2\rc4.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt\sofia-sip-1.12.3.4\rc4.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt\sofia-sip-1.12.3.2\string0.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt\sofia-sip-1.12.3.4\string0.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\ipt\sofia-sip-1.12.3.2\token64.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\ipt\sofia-sip-1.12.3.4\token64.h"
 					>
 				</File>
 			</Filter>
@@ -3856,15 +3858,15 @@
 				Filter="url*.h"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\url\sofia-sip-1.12.3.2\url.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\url\sofia-sip-1.12.3.4\url.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\url\sofia-sip-1.12.3.2\url_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\url\sofia-sip-1.12.3.4\url_tag.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\url\sofia-sip-1.12.3.2\url_tag_class.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\url\sofia-sip-1.12.3.4\url_tag_class.h"
 					>
 				</File>
 			</Filter>
@@ -3873,7 +3875,7 @@
 				Filter="features*.h"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\features\sofia-sip-1.12.3.2\sofia_features.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\features\sofia-sip-1.12.3.4\sofia_features.h"
 					>
 				</File>
 			</Filter>
@@ -3882,11 +3884,11 @@
 				Filter="bnf*.h"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\bnf\sofia-sip-1.12.3.2\bnf.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\bnf\sofia-sip-1.12.3.4\bnf.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\bnf\sofia-sip-1.12.3.2\hostdomain.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\bnf\sofia-sip-1.12.3.4\hostdomain.h"
 					>
 				</File>
 			</Filter>
@@ -3894,63 +3896,63 @@
 				Name="msg headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_addr.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_addr.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_bnf.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_bnf.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_buffer.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_buffer.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_date.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_date.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_header.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_header.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\msg_internal.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\msg_internal.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_mclass.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_mclass.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_mclass_hash.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_mclass_hash.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_mime.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_mime.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_mime_protos.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_mime_protos.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_parser.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_parser.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_protos.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_protos.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_tag_class.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_tag_class.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\msg\sofia-sip-1.12.3.2\msg_types.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\msg\sofia-sip-1.12.3.4\msg_types.h"
 					>
 				</File>
 			</Filter>
@@ -3958,47 +3960,47 @@
 				Name="sip headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sofia-sip-1.12.3.2\sip.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sofia-sip-1.12.3.4\sip.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_extensions.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_extensions.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sofia-sip-1.12.3.2\sip_hclasses.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sofia-sip-1.12.3.4\sip_hclasses.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sofia-sip-1.12.3.2\sip_header.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sofia-sip-1.12.3.4\sip_header.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sip_internal.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sip_internal.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sofia-sip-1.12.3.2\sip_parser.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sofia-sip-1.12.3.4\sip_parser.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sofia-sip-1.12.3.2\sip_protos.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sofia-sip-1.12.3.4\sip_protos.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sofia-sip-1.12.3.2\sip_status.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sofia-sip-1.12.3.4\sip_status.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sofia-sip-1.12.3.2\sip_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sofia-sip-1.12.3.4\sip_tag.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sofia-sip-1.12.3.2\sip_tag_class.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sofia-sip-1.12.3.4\sip_tag_class.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sip\sofia-sip-1.12.3.2\sip_util.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sip\sofia-sip-1.12.3.4\sip_util.h"
 					>
 				</File>
 			</Filter>
@@ -4006,35 +4008,35 @@
 				Name="http headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\sofia-sip-1.12.3.2\http.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\sofia-sip-1.12.3.4\http.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\sofia-sip-1.12.3.2\http_hclasses.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\sofia-sip-1.12.3.4\http_hclasses.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\sofia-sip-1.12.3.2\http_header.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\sofia-sip-1.12.3.4\http_header.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\sofia-sip-1.12.3.2\http_parser.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\sofia-sip-1.12.3.4\http_parser.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\sofia-sip-1.12.3.2\http_protos.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\sofia-sip-1.12.3.4\http_protos.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\sofia-sip-1.12.3.2\http_status.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\sofia-sip-1.12.3.4\http_status.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\sofia-sip-1.12.3.2\http_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\sofia-sip-1.12.3.4\http_tag.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\http\sofia-sip-1.12.3.2\http_tag_class.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\http\sofia-sip-1.12.3.4\http_tag_class.h"
 					>
 				</File>
 			</Filter>
@@ -4042,11 +4044,11 @@
 				Name="nth headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nth\sofia-sip-1.12.3.2\nth.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nth\sofia-sip-1.12.3.4\nth.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nth\sofia-sip-1.12.3.2\nth_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nth\sofia-sip-1.12.3.4\nth_tag.h"
 					>
 				</File>
 			</Filter>
@@ -4054,23 +4056,23 @@
 				Name="sresolv headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv\sofia-resolv\sres.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv\sofia-resolv\sres.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv\sofia-resolv\sres_async.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv\sofia-resolv\sres_async.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv\sofia-resolv\sres_cache.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv\sofia-resolv\sres_cache.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv\sofia-resolv\sres_record.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv\sofia-resolv\sres_record.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sresolv\sofia-sip-1.12.3.2\sresolv.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sresolv\sofia-sip-1.12.3.4\sresolv.h"
 					>
 				</File>
 			</Filter>
@@ -4078,15 +4080,15 @@
 				Name="nea headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea\sofia-sip-1.12.3.2\nea.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea\sofia-sip-1.12.3.4\nea.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea\nea_debug.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea\nea_debug.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nea\sofia-sip-1.12.3.2\nea_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nea\sofia-sip-1.12.3.4\nea_tag.h"
 					>
 				</File>
 			</Filter>
@@ -4094,27 +4096,27 @@
 				Name="iptsec headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.2\auth_client.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.4\auth_client.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.2\auth_digest.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.4\auth_digest.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.2\auth_module.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.4\auth_module.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.2\auth_ntlm.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.4\auth_ntlm.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.2\auth_plugin.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.4\auth_plugin.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec\iptsec_debug.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec\iptsec_debug.h"
 					>
 				</File>
 			</Filter>
@@ -4122,15 +4124,15 @@
 				Name="stun headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\sofia-sip-1.12.3.2\stun.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\sofia-sip-1.12.3.4\stun.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\sofia-sip-1.12.3.2\stun_common.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\sofia-sip-1.12.3.4\stun_common.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\stun\sofia-sip-1.12.3.2\stun_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\stun\sofia-sip-1.12.3.4\stun_tag.h"
 					>
 				</File>
 			</Filter>
@@ -4138,11 +4140,11 @@
 				Name="nua headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\sofia-sip-1.12.3.2\nua.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\sofia-sip-1.12.3.4\nua.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nua\sofia-sip-1.12.3.2\nua_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nua\sofia-sip-1.12.3.4\nua_tag.h"
 					>
 				</File>
 			</Filter>
@@ -4150,27 +4152,27 @@
 				Name="nta headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\sofia-sip-1.12.3.2\nta.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\sofia-sip-1.12.3.4\nta.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\nta_internal.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\nta_internal.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\sofia-sip-1.12.3.2\nta_stateless.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\sofia-sip-1.12.3.4\nta_stateless.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\sofia-sip-1.12.3.2\nta_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\sofia-sip-1.12.3.4\nta_tag.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\sofia-sip-1.12.3.2\nta_tport.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\sofia-sip-1.12.3.4\nta_tport.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\nta\sofia-sip-1.12.3.2\sl_utils.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\nta\sofia-sip-1.12.3.4\sl_utils.h"
 					>
 				</File>
 			</Filter>
@@ -4178,19 +4180,19 @@
 				Name="tport headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\sofia-sip-1.12.3.2\tport.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\sofia-sip-1.12.3.4\tport.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\sofia-sip-1.12.3.2\tport_plugins.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\sofia-sip-1.12.3.4\tport_plugins.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\sofia-sip-1.12.3.2\tport_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\sofia-sip-1.12.3.4\tport_tag.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\tport\tport_tls.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\tport\tport_tls.h"
 					>
 				</File>
 			</Filter>
@@ -4198,11 +4200,11 @@
 				Name="sdp headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp\sofia-sip-1.12.3.2\sdp.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp\sofia-sip-1.12.3.4\sdp.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp\sofia-sip-1.12.3.2\sdp_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp\sofia-sip-1.12.3.4\sdp_tag.h"
 					>
 				</File>
 			</Filter>
@@ -4210,15 +4212,15 @@
 				Name="soa headers"
 				>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa\sofia-sip-1.12.3.2\soa.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa\sofia-sip-1.12.3.4\soa.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa\sofia-sip-1.12.3.2\soa_add.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa\sofia-sip-1.12.3.4\soa_add.h"
 					>
 				</File>
 				<File
-					RelativePath="..\..\sofia-sip-1.12.3.2\libsofia-sip-ua\soa\sofia-sip-1.12.3.2\soa_tag.h"
+					RelativePath="..\..\sofia-sip-1.12.3.4\libsofia-sip-ua\soa\sofia-sip-1.12.3.4\soa_tag.h"
 					>
 				</File>
 			</Filter>

Modified: freeswitch/branches/mishehu/src/include/switch_caller.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_caller.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_caller.h	Wed Oct 18 23:32:52 2006
@@ -73,7 +73,7 @@
 	/*! ANI (when applicable) */
 	char *ani;
 	/*! ANI II (when applicable) */
-	char *ani2;
+	char *aniii;
 	/*! RDNIS */
 	char *rdnis;
 	/*! Destination Number */
@@ -86,6 +86,8 @@
 	char *uuid;
 	/*! context */
 	char *context;
+	/*! flags */
+	switch_caller_profile_flag_t flags;
 	struct switch_caller_profile *next;
 };
 
@@ -157,7 +159,7 @@
   \param caller_id_number caller ID number
   \param network_addr network address
   \param ani ANI information
-  \param ani2 ANI II information
+  \param aniii ANI II information
   \param rdnis RDNIS
   \param source the source 
   \param context a logical context
@@ -171,7 +173,7 @@
 																	char *caller_id_number,
 																	char *network_addr,
 																	char *ani,
-																	char *ani2,
+																	char *aniii,
 																	char *rdnis,
 																	char *source,
 																	char *context,

Modified: freeswitch/branches/mishehu/src/include/switch_core.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_core.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_core.h	Wed Oct 18 23:32:52 2006
@@ -83,6 +83,8 @@
 	void *pointer_reply;
 	/*! optional arbitrary pointer reply's size */
 	switch_size_t pointer_reply_size;
+	/*! message flags */
+	switch_core_session_message_flag_t flags;
 };
 
 /*! \brief A generic object to pass as a thread's session object to allow mutiple arguements and a pool */
@@ -422,6 +424,22 @@
 SWITCH_DECLARE (switch_status_t) switch_core_session_message_send(char *uuid_str, switch_core_session_message_t *message);
 
 /*! 
+  \brief Queue a message on a session
+  \param session the session to queue the message to
+  \param message the message to queue
+  \return SWITCH_STATUS_SUCCESS if the message was queued
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_session_t *session, switch_core_session_message_t *message);
+
+/*! 
+  \brief DE-Queue an message on a given session
+  \param session the session to de-queue the message on
+  \param message the de-queued message
+  \return the  SWITCH_STATUS_SUCCESS if the message was de-queued
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_message(switch_core_session_t *session, switch_core_session_message_t **message);
+
+/*! 
   \brief Queue an event on another session using its uuid
   \param uuid_str the unique id of the session you want to send a message to
   \param event the event to send
@@ -823,6 +841,7 @@
   \brief Initialize a codec handle
   \param codec the handle to initilize
   \param codec_name the name of the codec module to use
+  \param fmtp codec parameters to send
   \param rate the desired rate (0 for any)
   \param ms the desired number of milliseconds (0 for any)
   \param channels the desired number of channels (0 for any)
@@ -832,13 +851,14 @@
   \return SWITCH_STATUS_SUCCESS if the handle is allocated
 */
 SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec, 
-													 char *codec_name, 
-													 uint32_t rate, 
-													 int ms, 
-													 int channels, 
-													 uint32_t flags,
-													 const switch_codec_settings_t *codec_settings, 
-													 switch_memory_pool_t *pool);
+													   char *codec_name, 
+													   char *fmtp,
+													   uint32_t rate, 
+													   int ms, 
+													   int channels, 
+													   uint32_t flags,
+													   const switch_codec_settings_t *codec_settings, 
+													   switch_memory_pool_t *pool);
 
 /*! 
   \brief Encode data using a codec handle

Modified: freeswitch/branches/mishehu/src/include/switch_event.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_event.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_event.h	Wed Oct 18 23:32:52 2006
@@ -97,6 +97,8 @@
 	void *bind_user_data;
 	/*! user data from the event sender */
 	void *event_user_data;
+	/*! unique key */
+	unsigned long key;
 	struct switch_event *next;
 };
 

Modified: freeswitch/branches/mishehu/src/include/switch_module_interfaces.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_module_interfaces.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_module_interfaces.h	Wed Oct 18 23:32:52 2006
@@ -442,6 +442,10 @@
 	const switch_codec_interface_t *codec_interface;
 	/*! the specific implementation of the above codec */
 	const switch_codec_implementation_t *implementation;
+	/*! fmtp line from remote sdp */
+	char *fmtp_in;
+	/*! fmtp line for local sdp */
+	char *fmtp_out;
 	/*! codec settings for this handle */
 	switch_codec_settings_t codec_settings;
 	/*! flags to modify behaviour */
@@ -460,6 +464,8 @@
 	switch_payload_t ianacode;
 	/*! the IANA code name */
 	char *iananame;
+	/*! default fmtp to send (can be overridden by the init function) */
+	char *fmtp;
 	/*! samples transferred per second */
 	uint32_t samples_per_second;
 	/*! bits transferred per second */

Modified: freeswitch/branches/mishehu/src/include/switch_platform.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_platform.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_platform.h	Wed Oct 18 23:32:52 2006
@@ -60,6 +60,16 @@
  */
 #pragma warning(disable:4152 4054 4100 4142 4200 4204 4706 4055 4214 4819 4132 4510 4512 4610)
 
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN 1234
+#endif
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN 4321
+#endif
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
+
 #if (_MSC_VER >= 1400) // VC8+
 #ifndef _CRT_SECURE_NO_DEPRECATE
 #define _CRT_SECURE_NO_DEPRECATE

Modified: freeswitch/branches/mishehu/src/include/switch_rtp.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_rtp.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_rtp.h	Wed Oct 18 23:32:52 2006
@@ -72,6 +72,7 @@
   \param ms_per_packet time in microseconds per packet
   \param flags flags to control behaviour
   \param crypto_key optional crypto key
+  \param timer_name timer interface to use
   \param err a pointer to resolve error messages
   \param pool a memory pool to use for the session
   \return the new RTP session or NULL on failure
@@ -98,6 +99,7 @@
   \param ms_per_packet time in microseconds per packet
   \param flags flags to control behaviour
   \param crypto_key optional crypto key
+  \param timer_name timer interface to use
   \param err a pointer to resolve error messages
   \param pool a memory pool to use for the session
   \return the new RTP session or NULL on failure

Modified: freeswitch/branches/mishehu/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_types.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_types.h	Wed Oct 18 23:32:52 2006
@@ -131,6 +131,11 @@
 #define SWITCH_FALSE 0
 #define SWITCH_CORE_QUEUE_LEN 100000
 
+typedef enum {
+	SWITCH_CPF_SCREEN = (1 << 0),
+	SWITCH_CPF_HIDE_NAME = (1 << 1),
+	SWITCH_CPF_HIDE_NUMBER = (1 << 2)
+} switch_caller_profile_flag_t;
 
 typedef enum {
 	SWITCH_AUDIO_COL_STR_TITLE                    = 0x01,
@@ -182,6 +187,7 @@
 	SWITCH_RTP_FLAG_BREAK		  - Stop what you are doing and return SWITCH_STATUS_BREAK
 	SWITCH_RTP_FLAG_MINI		  - Use mini RTP when possible
 	SWITCH_RTP_FLAG_DATAWAIT	  - Do not return from reads unless there is data even when non blocking
+	SWITCH_RTP_FLAG_BUGGY_2833    - Emulate the bug in cisco equipment to allow interop
 </pre>
  */
 typedef enum {
@@ -196,7 +202,8 @@
 	SWITCH_RTP_FLAG_VAD = (1 << 8),
 	SWITCH_RTP_FLAG_BREAK = ( 1 << 9),
 	SWITCH_RTP_FLAG_MINI = ( 1 << 10),
-	SWITCH_RTP_FLAG_DATAWAIT = (1 << 11)
+	SWITCH_RTP_FLAG_DATAWAIT = (1 << 11),
+	SWITCH_RTP_FLAG_BUGGY_2833 = (1 << 12)
 } switch_rtp_flag_t;
 
 /*!
@@ -247,7 +254,8 @@
 	SWITCH_MESSAGE_INDICATE_PROGRESS,
 	SWITCH_MESSAGE_INDICATE_BRIDGE,
 	SWITCH_MESSAGE_INDICATE_UNBRIDGE,
-	SWITCH_MESSAGE_INDICATE_TRANSFER
+	SWITCH_MESSAGE_INDICATE_TRANSFER,
+	SWITCH_MESSAGE_INDICATE_RINGING
 } switch_core_session_message_types_t;
 
 
@@ -348,6 +356,10 @@
 	SWITCH_CHANNEL_ID_EVENT
 } switch_text_channel_t;
 
+typedef enum {
+	SCSMF_DYNAMIC = (1 << 0)
+} switch_core_session_message_flag_t;
+
 #define SWITCH_UUID_FORMATTED_LENGTH APR_UUID_FORMATTED_LENGTH 	
 #define SWITCH_CHANNEL_LOG SWITCH_CHANNEL_ID_LOG, __FILE__, __FUNCTION__, __LINE__
 #define SWITCH_CHANNEL_LOG_CLEAN SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __FUNCTION__, __LINE__
@@ -610,6 +622,7 @@
 	SWITCH_EVENT_MODULE_LOAD		- Module was loaded
 	SWITCH_EVENT_DTMF				- DTMF was sent
 	SWITCH_EVENT_MESSAGE			- A Basic Message
+	SWITCH_EVENT_PRESENCE			- Presence Info
 	SWITCH_EVENT_CODEC				- Codec Change
 	SWITCH_EVENT_BACKGROUND_JOB		- Background Job
     SWITCH_EVENT_ALL				- All events at once
@@ -644,6 +657,9 @@
 	SWITCH_EVENT_MODULE_LOAD,
 	SWITCH_EVENT_DTMF,
 	SWITCH_EVENT_MESSAGE,
+	SWITCH_EVENT_PRESENCE_IN,
+	SWITCH_EVENT_PRESENCE_OUT,
+	SWITCH_EVENT_ROSTER,
 	SWITCH_EVENT_CODEC,
 	SWITCH_EVENT_BACKGROUND_JOB,
 	SWITCH_EVENT_ALL

Modified: freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c	Wed Oct 18 23:32:52 2006
@@ -454,7 +454,7 @@
         sprintf (sql, "select type, name from interfaces where type = '%s'", cmd);
     }
     else if (!strcmp(cmd,"application") || !strcmp(cmd,"api")) {
-        sprintf (sql, "select * from interfaces where type = '%s'", cmd);
+        sprintf (sql, "select name, description, syntax from interfaces where type = '%s'", cmd);
     }
     else if ( !strcmp(cmd,"calls")) {
         sprintf (sql, "select * from calls");
@@ -468,9 +468,9 @@
 		holder.print_title = 0;
 		if ((cmdname = strchr(cmd, ' ')) != 0) {
 			*cmdname++ = '\0';
-	        sprintf (sql, "select name, description, syntax from interfaces where type = 'api' and name = '%s'", cmdname);
+	        sprintf (sql, "select name, syntax, description from interfaces where type = 'api' and name = '%s'", cmdname);
 		} else {
-	        sprintf (sql, "select name, description, syntax from interfaces where type = 'api'");
+	        sprintf (sql, "select name, syntax, description from interfaces where type = 'api'");
 		}
     }
     else {
@@ -529,7 +529,7 @@
 	/*.interface_name */ "help",
 	/*.desc */ "Show help for all the api commands",
 	/*.function */ help_function,
-	/*.syntax */ "help",
+	/*.syntax */ "",
 	/*.next */ NULL
 };
 
@@ -537,7 +537,7 @@
 	/*.interface_name */ "fsctl",
 	/*.desc */ "control messages",
 	/*.function */ ctl_function,
-	/*.syntax */ "fsctl [hupall|pause|resume|shutdown]",
+	/*.syntax */ "[hupall|pause|resume|shutdown]",
 	/*.next */ &help_api_interface
 };
 
@@ -545,7 +545,7 @@
 	/*.interface_name */ "uuid_bridge",
 	/*.desc */ "uuid_bridge",
 	/*.function */ uuid_bridge_function,
-	/*.syntax */ "uuid_bridge <uuid> <other_uuid>",
+	/*.syntax */ "<uuid> <other_uuid>",
 	/*.next */ &ctl_api_interface
 };
 
@@ -553,7 +553,7 @@
 	/*.interface_name */ "status",
 	/*.desc */ "status",
 	/*.function */ status_function,
-	/*.syntax */ "status",
+	/*.syntax */ "",
 	/*.next */ &uuid_bridge_api_interface
 };
 
@@ -561,7 +561,7 @@
 	/*.interface_name */ "show",
 	/*.desc */ "Show",
 	/*.function */ show_function,
-	/*.syntax */ "show <blank>|codec|application|api|dialplan|file|timer|calls|channels",
+	/*.syntax */ "<blank>|codec|application|api|dialplan|file|timer|calls|channels",
 	/*.next */ &status_api_interface
 };
 
@@ -569,7 +569,7 @@
 	/*.interface_name */ "pause",
 	/*.desc */ "Pause",
 	/*.function */ pause_function,
-	/*.syntax */ "pause <uuid> <on|off>",
+	/*.syntax */ "<uuid> <on|off>",
 	/*.next */ &show_api_interface
 };
 
@@ -577,7 +577,7 @@
 	/*.interface_name */ "transfer",
 	/*.desc */ "Transfer",
 	/*.function */ transfer_function,
-	/*.syntax */ "transfer <uuid> <dest-exten> [<dialplan>] [<context>]",
+	/*.syntax */ "<uuid> <dest-exten> [<dialplan>] [<context>]",
 	/*.next */ &pause_api_interface
 };
 
@@ -585,7 +585,7 @@
 	/*.interface_name */ "load",
 	/*.desc */ "Load Module",
 	/*.function */ load_function,
-	/*.syntax */ "load <mod_name>",
+	/*.syntax */ "<mod_name>",
 	/*.next */ &transfer_api_interface
 };
 
@@ -593,7 +593,7 @@
 	/*.interface_name */ "reloadxml",
 	/*.desc */ "Reload XML",
 	/*.function */ reload_function,
-	/*.syntax */ "reloadxml",
+	/*.syntax */ "",
 	/*.next */ &load_api_interface,
 
 };
@@ -602,7 +602,7 @@
 	/*.interface_name */ "killchan",
 	/*.desc */ "Kill Channel",
 	/*.function */ kill_function,
-	/*.syntax */ "killchan <uuid>",
+	/*.syntax */ "<uuid>",
 	/*.next */ &reload_api_interface
 };
 
@@ -610,7 +610,7 @@
 	/*.interface_name */ "originate",
 	/*.desc */ "Originate a Call",
 	/*.function */ originate_function,
-	/*.syntax */ "originate <call url> <exten>|&<application_name>(<app_args>) [<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]",
+	/*.syntax */ "<call url> <exten>|&<application_name>(<app_args>) [<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]",
 	/*.next */ &kill_api_interface
 };
 

Modified: freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c	Wed Oct 18 23:32:52 2006
@@ -2343,6 +2343,7 @@
 	/* Setup a Signed Linear codec for reading audio. */
 	if (switch_core_codec_init(&member.read_codec,
 							   "L16",
+							   NULL,
 							   //conference->rate,
 							   read_codec->implementation->samples_per_second,
 							   //conference->interval,
@@ -2380,6 +2381,7 @@
 	/* Setup a Signed Linear codec for writing audio. */
 	if (switch_core_codec_init(&member.write_codec,
 							   "L16",
+							   NULL,
 							   conference->rate,
 							   //read_codec->implementation->samples_per_second,
 							   conference->interval,
@@ -2645,26 +2647,25 @@
 	/*.desc */ "Conference",
 	/*.function */ conf_function,
 	/*.syntax */ 
-		"conference commands\n"
-		"conference list [delim <string>]\n"
-		"conference <confname> list [delim <string>]\n"
-		"conference <confname> energy <member_id> [<newval>]\n"
-		"conference <confname> volume_in <member_id> [<newval>]\n"
-		"conference <confname> volume_out <member_id> [<newval>]\n"
-		"conference <confname> play <file_path> [<member_id>]\n"
-		"conference <confname> say <text>\n"
-		"conference <confname> saymember <member_id><text>\n"
-		"conference <confname> stop <[current|all]> [<member_id>]\n"
-		"conference <confname> kick <member_id>\n"
-		"conference <confname> mute <member_id>\n"
-		"conference <confname> unmute <member_id>\n"
-		"conference <confname> deaf <member_id>\n"
-		"conference <confname> undef <member_id>\n"
-		"conference <confname> relate <member_id> <other_member_id> [nospeak|nohear]\n"
-		"conference <confname> lock\n"
-		"conference <confname> unlock\n"
-		"conference <confname> dial <endpoint_module_name>/<destination>\n"
-		"conference <confname> transfer <member_id> <conference_name>\n",
+		"list [delim <string>]\n"
+		"<confname> list [delim <string>]\n"
+		"<confname> energy <member_id> [<newval>]\n"
+		"<confname> volume_in <member_id> [<newval>]\n"
+		"<confname> volume_out <member_id> [<newval>]\n"
+		"<confname> play <file_path> [<member_id>]\n"
+		"<confname> say <text>\n"
+		"<confname> saymember <member_id><text>\n"
+		"<confname> stop <[current|all]> [<member_id>]\n"
+		"<confname> kick <member_id>\n"
+		"<confname> mute <member_id>\n"
+		"<confname> unmute <member_id>\n"
+		"<confname> deaf <member_id>\n"
+		"<confname> undef <member_id>\n"
+		"<confname> relate <member_id> <other_member_id> [nospeak|nohear]\n"
+		"<confname> lock\n"
+		"<confname> unlock\n"
+		"<confname> dial <endpoint_module_name>/<destination>\n"
+		"<confname> transfer <member_id> <conference_name>",
 	/*.next */ 
 };
 

Modified: freeswitch/branches/mishehu/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_dptools/mod_dptools.c	Wed Oct 18 23:32:52 2006
@@ -24,6 +24,7 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
+ * Ken Rice, Asteria Solutions Group, Inc <ken at asteriasgi.com>
  *
  *
  * mod_dptools.c -- Raw Audio File Streaming Application Module
@@ -93,6 +94,42 @@
 	}
 }
 
+static void privacy_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	switch_caller_profile_t *caller_profile;
+	char *arg;
+
+	channel = switch_core_session_get_channel(session);
+    	assert(channel != NULL);		
+	
+	caller_profile = switch_channel_get_caller_profile(channel);
+
+	if (switch_strlen_zero(data)) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No privacy mode specified.\n");
+	} else {
+		arg = switch_core_session_strdup(session, data);
+
+		switch_set_flag(caller_profile, SWITCH_CPF_SCREEN);
+
+		if(!strcasecmp(arg, "no")) {
+			switch_clear_flag(caller_profile, SWITCH_CPF_HIDE_NAME);
+			switch_clear_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER);
+		} else if (!strcasecmp(arg, "yes")) {
+			switch_set_flag(caller_profile, SWITCH_CPF_HIDE_NAME | SWITCH_CPF_HIDE_NUMBER);
+		} else if (!strcasecmp(arg, "full")) {
+			switch_set_flag(caller_profile, SWITCH_CPF_HIDE_NAME | SWITCH_CPF_HIDE_NUMBER);
+		} else if (!strcasecmp(arg, "name")) {
+			switch_set_flag(caller_profile, SWITCH_CPF_HIDE_NAME);
+		} else if (!strcasecmp(arg, "number")) {
+			switch_set_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER);
+		} else {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID privacy mode specified. Use a valid mode [no|yes|name|full|number].\n");
+		}
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set Privacy to %s [%d]\n", arg, caller_profile->flags);
+	}
+}
+
 static void strftime_function(switch_core_session_t *session, char *data)
 {
 	char *argv[2];
@@ -132,7 +169,7 @@
 	/*.interface_name */ "strftime",
 	/*.desc */ "strftime",
 	/*.function */ strftime_api_function,
-	/*.syntax */ "strftime <format_string>",
+	/*.syntax */ "<format_string>",
 	/*.next */ NULL
 };
 
@@ -140,7 +177,7 @@
 	/*.interface_name */ "set",
 	/*.application_function */ set_function,
 	/* long_desc */ "Set a channel varaible for the channel calling the application.",
-	/* short_desc */ "Set a channel varaible.",
+	/* short_desc */ "Set a channel varaible",
 	/* syntax */ "<varname>=[<value>|_UNDEF_]",
 	/*.next */ NULL
 };
@@ -149,7 +186,7 @@
 	/*.interface_name */ "answer",
 	/*.application_function */ answer_function,
 	/* long_desc */ "Answer the call for a channel.",
-	/* short_desc */ "Answer the call.",
+	/* short_desc */ "Answer the call",
 	/* syntax */ "",
 	/*.next */ &set_application_interface
 
@@ -183,13 +220,22 @@
 	/* next */ &sleep_application_interface
 };
 
+static const switch_application_interface_t privacy_application_interface = {
+	/*.interface_name */ "privacy",
+	/*.application_function */ privacy_function,
+	/* long_desc */ "Set caller privacy on calls.",
+	/* short_desc */ "Set privacy on calls",
+	/* syntax */ "off|on|name|full|number",
+	/*.next */ &transfer_application_interface
+};
+
 static const switch_loadable_module_interface_t mod_dptools_module_interface = {
 	/*.module_name = */ modname,
 	/*.endpoint_interface = */ NULL,
 	/*.timer_interface = */ NULL,
 	/*.dialplan_interface = */ NULL,
 	/*.codec_interface = */ NULL,
-	/*.application_interface */ &transfer_application_interface,
+	/*.application_interface */ &privacy_application_interface,
 	/*.api_interface */ &dptools_api_interface
 };
 

Modified: freeswitch/branches/mishehu/src/mod/applications/mod_playback/mod_playback.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_playback/mod_playback.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_playback/mod_playback.c	Wed Oct 18 23:32:52 2006
@@ -47,7 +47,7 @@
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Digits %s\n", dtmf);
 		
 		if (*dtmf == '*') {
-			return SWITCH_STATUS_FALSE;
+			return SWITCH_STATUS_BREAK;
 		}
 	}
 		break;
@@ -101,6 +101,7 @@
 	switch_channel_t *channel;
 	char *timer_name = NULL;
 	char *file_name = NULL;
+	switch_status_t status;
 
 	file_name = switch_core_session_strdup(session, data);
 
@@ -113,7 +114,9 @@
 
 	switch_channel_pre_answer(channel);
 
-	if (switch_ivr_play_file(session, NULL, file_name, timer_name, on_dtmf, NULL, 0) != SWITCH_STATUS_SUCCESS) {
+	status = switch_ivr_play_file(session, NULL, file_name, timer_name, on_dtmf, NULL, 0);
+
+	if (!switch_channel_ready(channel) || (status != SWITCH_STATUS_SUCCESS && !SWITCH_STATUS_IS_BREAK(status))) {
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 	}
 	

Modified: freeswitch/branches/mishehu/src/mod/applications/mod_rss/mod_rss.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_rss/mod_rss.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_rss/mod_rss.c	Wed Oct 18 23:32:52 2006
@@ -255,6 +255,7 @@
 	
 	if (switch_core_codec_init(&speech_codec,
 							   "L16",
+							   NULL,
 							   (int)rate,
 							   interval,
 							   1,

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_amr/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_amr/Makefile	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_amr/Makefile	Wed Oct 18 23:32:52 2006
@@ -1,5 +1,5 @@
 CFLAGS += -I$(PREFIX)/include/amr
-LDFLAGS +=-lamrnb
+LDFLAGS +=-lamr
 
 all:	$(MODNAME).$(DYNAMIC_LIB_EXTEN)
 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_amr/mod_amr.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_amr/mod_amr.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_amr/mod_amr.c	Wed Oct 18 23:32:52 2006
@@ -32,7 +32,8 @@
  *
  */  
 #include "switch.h"
-#include "amr-nb/amr-nb.h"
+#include "amr/interf_enc.h"
+#include "amr/interf_dec.h"
 
 /*
  * Check section 8.1 of rfc3267 for possible sdp options.
@@ -60,41 +61,64 @@
 
 static const char modname[] = "mod_amr";
 
+typedef enum {
+	AMR_OPT_OCTET_ALIGN = (1 << 0),
+	AMR_OPT_CRC = (1 << 1),
+	AMR_OPT_MODE_CHANGE_NEIGHBOR = (1 << 2),
+	AMR_OPT_ROBUST_SORTING = (1 << 3),
+	AMR_OPT_INTERLEAVING = (1 << 4)
+} amr_flag_t;
+
+
+typedef enum {
+	GENERIC_PARAMETER_AMR_MAXAL_SDUFRAMES = 0,
+	GENERIC_PARAMETER_AMR_BITRATE,
+	GENERIC_PARAMETER_AMR_GSMAMRCOMFORTNOISE,
+	GENERIC_PARAMETER_AMR_GSMEFRCOMFORTNOISE,
+	GENERIC_PARAMETER_AMR_IS_641COMFORTNOISE,
+	GENERIC_PARAMETER_AMR_PDCEFRCOMFORTNOISE
+} amr_param_t;
+
+typedef enum {
+	AMR_BITRATE_475 = 0,
+	AMR_BITRATE_515,
+	AMR_BITRATE_590,
+	AMR_BITRATE_670,
+	AMR_BITRATE_740,
+	AMR_BITRATE_795,
+	AMR_BITRATE_1020,
+	AMR_BITRATE_1220
+} amr_bitrate_t;
+
+
 struct amr_context {
 	void *encoder_state;
 	void *decoder_state;
-	int enc_mode;
+	switch_byte_t enc_modes;
+	switch_byte_t enc_mode;
+	uint32_t change_period;
+	switch_byte_t max_ptime;
+	switch_byte_t ptime;
+	switch_byte_t channels;
+	switch_byte_t flags;
 };
 
-enum
-	{
-		GENERIC_PARAMETER_AMR_MAXAL_SDUFRAMES = 0,
-		GENERIC_PARAMETER_AMR_BITRATE,
-		GENERIC_PARAMETER_AMR_GSMAMRCOMFORTNOISE,
-		GENERIC_PARAMETER_AMR_GSMEFRCOMFORTNOISE,
-		GENERIC_PARAMETER_AMR_IS_641COMFORTNOISE,
-		GENERIC_PARAMETER_AMR_PDCEFRCOMFORTNOISE
-	};
 
-enum
-	{
-		AMR_BITRATE_475 = 0,
-		AMR_BITRATE_515,
-		AMR_BITRATE_590,
-		AMR_BITRATE_670,
-		AMR_BITRATE_740,
-		AMR_BITRATE_795,
-		AMR_BITRATE_1020,
-		AMR_BITRATE_1220
-	};
+#define AMR_DEFAULT_BITRATE AMR_BITRATE_1220
 
-#define AMR_Mode  7
+static struct {
+	switch_byte_t default_bitrate;
+} globals;
 
+
 static switch_status_t switch_amr_init(switch_codec_t *codec, switch_codec_flag_t flags,
 									  const switch_codec_settings_t *codec_settings) 
 {
 	struct amr_context *context = NULL;
 	int encoding, decoding;
+	int x, i, argc;
+	char *argv[10];
+	char fmtptmp[128];
 
 	encoding = (flags & SWITCH_CODEC_FLAG_ENCODE);
 	decoding = (flags & SWITCH_CODEC_FLAG_DECODE);
@@ -103,12 +127,80 @@
 		return SWITCH_STATUS_FALSE;
 	} else {
 
-		context->enc_mode = AMR_Mode; /* start in mode 7 */
+		if (codec->fmtp_in) {
+			argc = switch_separate_string(codec->fmtp_in, ';', argv, (sizeof(argv) / sizeof(argv[0])));
+			for(x = 0; x < argc; x++) {
+				char *data = argv[x];
+				char *arg;
+				while(*data && *data == ' ') {
+					data++;
+				}
+				if ((arg = strchr(data, '='))) {
+					*arg++ = '\0';
+					//printf("Codec arg %d [%s]=[%s]\n", x, data, arg);
+					if (!strcasecmp(data, "octet-align")) {
+						if (atoi(arg)) {
+							switch_set_flag(context, AMR_OPT_OCTET_ALIGN);
+						}
+					} else if (!strcasecmp(data, "mode-change-neighbor")) {
+						if (atoi(arg)) {
+							switch_set_flag(context, AMR_OPT_MODE_CHANGE_NEIGHBOR);
+						}
+					} else if (!strcasecmp(data, "crc")) {
+						if (atoi(arg)) {
+							switch_set_flag(context, AMR_OPT_CRC);
+						}
+					} else if (!strcasecmp(data, "robust-sorting")) {
+						if (atoi(arg)) {
+							switch_set_flag(context, AMR_OPT_ROBUST_SORTING);
+						}
+					} else if (!strcasecmp(data, "interveaving")) {
+						if (atoi(arg)) {
+							switch_set_flag(context, AMR_OPT_INTERLEAVING);
+						}
+					} else if (!strcasecmp(data, "mode-change-period")) {
+						context->change_period = atoi(arg);
+					} else if (!strcasecmp(data, "ptime")) {
+						context->ptime = (switch_byte_t)atoi(arg);
+					} else if (!strcasecmp(data, "channels")) {
+						context->channels = (switch_byte_t)atoi(arg);
+					} else if (!strcasecmp(data, "maxptime")) {
+						context->max_ptime = (switch_byte_t)atoi(arg);
+					} else if (!strcasecmp(data, "mode-set")) {
+						int y, m_argc;
+						char *m_argv[7];
+						m_argc = switch_separate_string(arg, ',', m_argv, (sizeof(m_argv) / sizeof(m_argv[0])));
+						for(y = 0; y < m_argc; y++) {
+							context->enc_modes |= (1 << atoi(m_argv[y]));
+						}
+					}
+				}
+
+			}
+		}
+
+		if (context->enc_modes) {
+			for (i = 7; i > -1; i++) {
+				if (context->enc_modes & (1 << i)) {
+					context->enc_mode = (switch_byte_t)i;
+					break;
+				}
+			}
+		}
+
+		if (!context->enc_mode) {
+			context->enc_mode = globals.default_bitrate;
+		}
+		
+		snprintf(fmtptmp, sizeof(fmtptmp), "octet-align=0; mode-set=%d", context->enc_mode);
+		codec->fmtp_out = switch_core_strdup(codec->memory_pool, fmtptmp);
+		
+		context->enc_mode = AMR_DEFAULT_BITRATE;
 		context->encoder_state = NULL;
 		context->decoder_state = NULL;
 
 		if (encoding) {
-			context->encoder_state = Encoder_Interface_init(0);
+			context->encoder_state = Encoder_Interface_init(1);
 		}
 
 		if (decoding) {
@@ -152,9 +244,9 @@
 	if (!context) {
 		return SWITCH_STATUS_FALSE;
 	}
+	
+	*encoded_data_len = Encoder_Interface_Encode( context->encoder_state, context->enc_mode, (int16_t *)decoded_data, (switch_byte_t *) encoded_data, 0);
 
-	*encoded_data_len = Encoder_Interface_Encode( context->encoder_state, context->enc_mode, (void *)decoded_data, encoded_data, 0 );
-
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -176,8 +268,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-	Decoder_Interface_Decode( context->decoder_state, (void *)encoded_data, (void *)decoded_data, 0 );
-
+	Decoder_Interface_Decode(context->decoder_state, (unsigned char *)encoded_data, (int16_t *)decoded_data, 0);
 	*decoded_data_len = codec->implementation->bytes_per_frame;
 
 	return SWITCH_STATUS_SUCCESS;
@@ -187,8 +278,9 @@
 
 static const switch_codec_implementation_t amr_implementation = { 
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
-	/*.ianacode */ 118, 
+	/*.ianacode */ 96, 
 	/*.iananame */ "AMR", 
+	/*.fmtp */ "octet-align=0",
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 0, 
 	/*.microseconds_per_frame */ 20000, 
@@ -221,6 +313,24 @@
 SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface,
 													 char *filename)
 {
+	char *cf = "amr.conf";
+	switch_xml_t cfg, xml, settings, param;
+
+	memset(&globals, 0, sizeof(globals));
+	globals.default_bitrate = AMR_DEFAULT_BITRATE;
+
+	if ((xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
+		if ((settings = switch_xml_child(cfg, "settings"))) {
+			for (param = switch_xml_child(settings, "param"); param; param = param->next) {
+				char *var = (char *) switch_xml_attr_soft(param, "name");
+				char *val = (char *) switch_xml_attr_soft(param, "value");
+				if (!strcasecmp(var, "default-bitrate")) {
+					globals.default_bitrate = (switch_byte_t)atoi(val);
+				}
+			}
+		}
+	}
+
 	/* connect my internal structure to the blank pointer passed to me */ 
 	*module_interface = &amr_module_interface;
 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.c	Wed Oct 18 23:32:52 2006
@@ -193,6 +193,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
 	/*.iananame */ "PCMU",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 19200,
 	/*.microseconds_per_frame */ 60000,
@@ -213,6 +214,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
 	/*.iananame */ "PCMU",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 96000,
 	/*.microseconds_per_frame */ 30000,
@@ -233,6 +235,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
 	/*.iananame */ "PCMU",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 16000,
 	/*.bits_per_second */ 128000,
 	/*.microseconds_per_frame */ 20000,
@@ -254,6 +257,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
 	/*.iananame */ "PCMU",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 64000,
 	/*.microseconds_per_frame */ 20000,
@@ -276,6 +280,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 8,
 	/*.iananame */ "PCMA",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 64000,
 	/*.microseconds_per_frame */ 20000,

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_g722/mod_g722.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g722/mod_g722.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g722/mod_g722.c	Wed Oct 18 23:32:52 2006
@@ -125,6 +125,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 9,
 	/*.iananame */ "G722",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 64000,
 	/*.microseconds_per_frame */ 20000,
@@ -144,6 +145,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 9,
 	/*.iananame */ "G722",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 16000,
 	/*.bits_per_second */ 64000,
 	/*.microseconds_per_frame */ 20000,

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_g723_1/mod_g723_1.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g723_1/mod_g723_1.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g723_1/mod_g723_1.c	Wed Oct 18 23:32:52 2006
@@ -183,6 +183,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 4, 
 	/*.iananame */ "G723", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 6300, 
 	/*.microseconds_per_frame */ 30000, 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_g726/mod_g726.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g726/mod_g726.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g726/mod_g726.c	Wed Oct 18 23:32:52 2006
@@ -219,6 +219,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 127, 
 	/*.iananame */ "G726-16", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 16000, 
 	/*.microseconds_per_frame */ 20000, 
@@ -239,6 +240,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 126, 
 	/*.iananame */ "G726-24", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 24000, 
 	/*.microseconds_per_frame */ 20000, 
@@ -258,6 +260,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 2, 
 	/*.iananame */ "G726-32", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 32000, 
 	/*.microseconds_per_frame */ 20000, 
@@ -277,6 +280,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 125, 
 	/*.iananame */ "G726-40", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 40000, 
 	/*.microseconds_per_frame */ 20000, 
@@ -298,6 +302,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 124, 
 	/*.iananame */ "AAL2-G726-16", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 16000, 
 	/*.microseconds_per_frame */ 20000, 
@@ -318,6 +323,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 123, 
 	/*.iananame */ "AAL2-G726-24", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 24000, 
 	/*.microseconds_per_frame */ 20000, 
@@ -337,6 +343,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 2, 
 	/*.iananame */ "AAL2-G726-32", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 32000, 
 	/*.microseconds_per_frame */ 20000, 
@@ -356,6 +363,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 122, 
 	/*.iananame */ "AAL2-G726-40", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 40000, 
 	/*.microseconds_per_frame */ 20000, 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.c	Wed Oct 18 23:32:52 2006
@@ -222,6 +222,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 18, 
 	/*.iananame */ "G729", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 32000, 
 	/*.microseconds_per_frame */ 10000, 
@@ -241,6 +242,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 18, 
 	/*.iananame */ "G729", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000, 
 	/*.bits_per_second */ 64000, 
 	/*.microseconds_per_frame */ 20000, 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_gsm/mod_gsm.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_gsm/mod_gsm.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_gsm/mod_gsm.c	Wed Oct 18 23:32:52 2006
@@ -136,6 +136,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 3, 
 		/*.iananame */ "gsm", 
+		/*.fmtp */ NULL,
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ 13200, 
 		/*.microseconds_per_frame */ 20000, 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_ilbc/mod_ilbc.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_ilbc/mod_ilbc.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_ilbc/mod_ilbc.c	Wed Oct 18 23:32:52 2006
@@ -49,7 +49,7 @@
 {
 	struct ilbc_context *context;
 	int encoding, decoding;
-	uint8_t ms = codec->implementation->microseconds_per_frame / 1000;
+	uint8_t ms = (uint8_t)(codec->implementation->microseconds_per_frame / 1000);
 
 
 	if (ms != 20 && ms != 30) {
@@ -189,6 +189,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 97, 
 		/*.iananame */ "iLBC", 
+		/*.fmtp */ NULL,
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_30MS*8*8000/BLOCKL_30MS,
 		/*.microseconds_per_frame */ 30000,
@@ -208,6 +209,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 97, 
 		/*.iananame */ "iLBC", 
+		/*.fmtp */ NULL,
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS, 
 		/*.microseconds_per_frame */ 20000,
@@ -230,6 +232,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 102, 
 		/*.iananame */ "iLBC", 
+		/*.fmtp */ NULL,
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_30MS*8*8000/BLOCKL_30MS,
 		/*.microseconds_per_frame */ 30000,
@@ -249,6 +252,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 102, 
 		/*.iananame */ "iLBC102", 
+		/*.fmtp */ NULL,
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS, 
 		/*.microseconds_per_frame */ 20000,
@@ -270,6 +274,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 97, 
 		/*.iananame */ "iLBC20ms",
+		/*.fmtp */ NULL,
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS, 
 		/*.microseconds_per_frame */ 20000,

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_ilbc/mod_ilbc.vcproj
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_ilbc/mod_ilbc.vcproj	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_ilbc/mod_ilbc.vcproj	Wed Oct 18 23:32:52 2006
@@ -48,7 +48,8 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
+				WarnAsError="true"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 			/>
@@ -127,7 +128,8 @@
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
+				WarnAsError="true"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 			/>

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_l16/mod_l16.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_l16/mod_l16.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_l16/mod_l16.c	Wed Oct 18 23:32:52 2006
@@ -93,6 +93,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
+	/*.fmtp */ NULL,
 	/*.samples_per_second = */ 32000,
 	/*.bits_per_second = */ 512000,
 	/*.microseconds_per_frame = */ 20000,
@@ -112,6 +113,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
+	/*.fmtp */ NULL,
 	/*.samples_per_second = */ 22050,
 	/*.bits_per_second = */ 352800,
 	/*.microseconds_per_frame = */ 20000,
@@ -132,6 +134,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
+	/*.fmtp */ NULL,
 	/*.samples_per_second = */ 16000,
 	/*.bits_per_second = */ 256000,
 	/*.microseconds_per_frame = */ 20000,
@@ -152,6 +155,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
+	/*.fmtp */ NULL,
 	/*.samples_per_second = */ 8000,
 	/*.bits_per_second = */ 128000,
 	/*.microseconds_per_frame = */ 20000,
@@ -173,6 +177,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 128000,
 	/*.microseconds_per_frame */ 30000,
@@ -194,6 +199,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 256000,
 	/*.microseconds_per_frame */ 60000,
@@ -214,6 +220,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 10,
 	/*.iananame */ "L16",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 512000,
 	/*.microseconds_per_frame */ 120000,

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_lpc10/mod_lpc10.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_lpc10/mod_lpc10.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_lpc10/mod_lpc10.c	Wed Oct 18 23:32:52 2006
@@ -171,6 +171,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 	/*.ianacode */ 7, 
 	/*.iananame */ "LPC", 
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 240, 
 	/*.microseconds_per_frame */ 22500, 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_speex/mod_speex.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_speex/mod_speex.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_speex/mod_speex.c	Wed Oct 18 23:32:52 2006
@@ -271,6 +271,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 102,
 	/*.iananame */ "speex",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 32000,
 	/*.bits_per_second */ 256000,
 	/*.nanoseconds_per_frame */ 20000,
@@ -290,6 +291,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 99,
 	/*.iananame */ "speex",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 16000,
 	/*.bits_per_second */ 22000,
 	/*.nanoseconds_per_frame */ 20000,
@@ -310,6 +312,7 @@
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 98,
 	/*.iananame */ "speex",
+	/*.fmtp */ NULL,
 	/*.samples_per_second */ 8000,
 	/*.bits_per_second */ 11000,
 	/*.nanoseconds_per_frame */ 20000,

Modified: freeswitch/branches/mishehu/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	(original)
+++ freeswitch/branches/mishehu/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	Wed Oct 18 23:32:52 2006
@@ -273,12 +273,12 @@
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Processing %s->%s!\n", caller_profile->caller_id_name,
 					  caller_profile->destination_number);
 	
-	snprintf(params, sizeof(params), "context=%s&dest=%s&cid_name=%s&cid_num=%s&netaddr=%s&ani=%s&ani2=%s&rdnis=%s&source=%s&chan_name=%s&uuid=%s", 
+	snprintf(params, sizeof(params), "context=%s&dest=%s&cid_name=%s&cid_num=%s&netaddr=%s&ani=%s&aniii=%s&rdnis=%s&source=%s&chan_name=%s&uuid=%s", 
 			caller_profile->context, caller_profile->destination_number,
 			caller_profile->caller_id_name, caller_profile->caller_id_number,
 			caller_profile->network_addr?caller_profile->network_addr:"", 
 			caller_profile->ani?caller_profile->ani:"", 
-			caller_profile->ani2?caller_profile->ani2:"",
+			caller_profile->aniii?caller_profile->aniii:"",
 			caller_profile->rdnis?caller_profile->rdnis:"", 
 			caller_profile->source, caller_profile->chan_name, caller_profile->uuid);
 

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Wed Oct 18 23:32:52 2006
@@ -34,17 +34,23 @@
 
 #define DL_CAND_WAIT 10000000
 #define DL_CAND_INITIAL_WAIT 2000000
+#define JINGLE_KEY 1
 
-
 #define DL_EVENT_LOGIN_SUCCESS "dingaling::login_success"
 #define DL_EVENT_LOGIN_FAILURE "dingaling::login_failure"
-#define DL_EVENT_MESSAGE "dingaling::message"
 #define DL_EVENT_CONNECTED "dingaling::connected"
 
 static const char modname[] = "mod_dingaling";
 
 static switch_memory_pool_t *module_pool = NULL;
 
+static char sub_sql[] =
+"CREATE TABLE subscriptions (\n"
+"   sub_from            VARCHAR(255),\n"
+"   sub_to          VARCHAR(255)\n"
+");\n";
+
+
 typedef enum {
 	TFLAG_IO = (1 << 0),
 	TFLAG_INBOUND = (1 << 1),
@@ -68,6 +74,7 @@
 	TFLAG_TIMER = ( 1 << 19),
 	TFLAG_TERM = ( 1 << 20),
 	TFLAG_TRANSPORT_ACCEPT = (1 << 21),
+	TFLAG_READY = (1 << 22),
 } TFLAGS;
 
 typedef enum {
@@ -95,6 +102,7 @@
     char *login;
     char *password;
     char *message;
+	char *auto_reply;
     char *dialplan;
     char *ip;
     char *extip;
@@ -103,6 +111,8 @@
     char *exten;
     char *context;
 	char *timer_name;
+	char *dbname;
+	switch_mutex_t *mutex;
     ldl_handle_t *handle;
     uint32_t flags;
     uint32_t user_flags;
@@ -172,11 +182,207 @@
 static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
 										   switch_io_flag_t flags, int stream_id);
 static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
-static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsession, ldl_signal_t signal, char *from, char *subject, char *msg);
+static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsession, ldl_signal_t signal, char *to, char *from, char *subject, char *msg);
 static ldl_status handle_response(ldl_handle_t *handle, char *id);
 static switch_status_t load_config(void);
 
 
+static int sub_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+	struct mdl_profile *profile = (struct mdl_profile *) pArg;
+
+	char *sub_from = argv[0];
+	char *sub_to = argv[1];
+	char *type = argv[2];
+	char *show = argv[3];
+
+	if (switch_strlen_zero(type)) {
+		type = NULL;
+	} else if (!strcasecmp(type, "unavailable")) {
+		show = NULL;
+	}
+
+
+	ldl_handle_send_presence(profile->handle, sub_to, sub_from, type, show);
+
+	return 0;
+}
+
+static int rost_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+	struct mdl_profile *profile = (struct mdl_profile *) pArg;
+
+	char *sub_from = argv[0];
+	char *sub_to = argv[1];
+	char *show = argv[2];
+
+
+	ldl_handle_send_presence(profile->handle, sub_to, sub_from, NULL, show);
+
+	return 0;
+}
+
+static void pres_event_handler(switch_event_t *event)
+{
+	struct mdl_profile *profile = NULL;
+	switch_hash_index_t *hi;
+    void *val;
+	char *from = switch_event_get_header(event, "from");
+	char *status= switch_event_get_header(event, "status");
+	char *show= switch_event_get_header(event, "show");
+	char *type = NULL;
+	char *sql;
+	switch_core_db_t *db;
+	char *p;
+
+	if (event->key == JINGLE_KEY) {
+		return;
+	}
+
+	if (status && !strcasecmp(status, "n/a")) {
+		status = show;
+		if (status && !strcasecmp(status, "n/a")) {
+			status = NULL;
+		}
+	}
+
+
+
+	switch(event->event_id) {
+	case SWITCH_EVENT_PRESENCE_IN:
+		if (!status) {
+			status = "Available";
+		}
+		break;
+	case SWITCH_EVENT_PRESENCE_OUT:
+		type = "unavailable";
+		break;
+	default:
+		break;
+	}
+	
+
+
+	if ((p = strchr(from, '/'))) {
+		*p = '\0';
+	}
+	
+	sql = switch_core_db_mprintf("select *,'%q','%q' from subscriptions where sub_to='%q'", type ? type : "", status ? status : "unavailable", from);
+	for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+		char *errmsg;
+        switch_hash_this(hi, NULL, NULL, &val);
+        profile = (struct mdl_profile *) val;
+
+        if (!(profile->user_flags & LDL_FLAG_COMPONENT)) {
+			continue;
+        }
+
+
+		if (sql) {
+			if (!(db = switch_core_db_open_file(profile->dbname))) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB %s\n", profile->dbname);
+				continue;
+			}
+			switch_mutex_lock(profile->mutex);
+			switch_core_db_exec(db, sql, sub_callback, profile, &errmsg);
+			switch_mutex_unlock(profile->mutex);
+			switch_core_db_close(db);
+		}
+		
+
+	}
+
+	switch_safe_free(sql);
+}
+
+static void chat_event_handler(switch_event_t *event)
+{
+	char *from = switch_event_get_header(event, "from");
+	char *to = switch_event_get_header(event, "to");
+	char *body = switch_event_get_body(event);
+	char *user, *host, *f_user, *f_host = NULL;
+	struct mdl_profile *profile = NULL;
+
+	if (from && (f_user = strdup(from))) {
+		if ((f_host = strchr(f_user, '@'))) {
+			*f_host++ = '\0';
+		}
+	}
+
+	if (to && (user = strdup(to))) {
+		if ((host = strchr(user, '@'))) {
+			*host++ = '\0';
+		}
+
+		if (f_host && (profile = switch_core_hash_find(globals.profile_hash, f_host))) {
+			ldl_handle_send_msg(profile->handle, from, to, NULL, body);
+		} else {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Profile %s\n", f_host ? f_host : "NULL");
+			return;
+		}
+
+		switch_safe_free(f_host);
+		free(user);
+	}
+
+}
+
+
+static void roster_event_handler(switch_event_t *event)
+{
+	char *status= switch_event_get_header(event, "status");
+	char *show= switch_event_get_header(event, "show");
+	char *event_type = switch_event_get_header(event, "event_type");
+	struct mdl_profile *profile = NULL;
+	switch_hash_index_t *hi;
+    void *val;
+	char *sql;
+	switch_core_db_t *db;
+
+	if (event->key == JINGLE_KEY) {
+		return;
+	}
+
+	if (status && !strcasecmp(status, "n/a")) {
+		status = show;
+		if (status && !strcasecmp(status, "n/a")) {
+			status = NULL;
+		}
+	}
+
+	if (switch_strlen_zero(event_type)) {
+		event_type="presence";
+	}
+
+	sql = switch_core_db_mprintf("select *,'%q' from subscriptions", show ? show : "unavilable");
+
+	for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+		char *errmsg;
+        switch_hash_this(hi, NULL, NULL, &val);
+        profile = (struct mdl_profile *) val;
+
+        if (!(profile->user_flags & LDL_FLAG_COMPONENT)) {
+			continue;
+        }
+
+
+		if (sql) {
+			if (!(db = switch_core_db_open_file(profile->dbname))) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB %s\n", profile->dbname);
+				continue;
+			}
+			switch_mutex_lock(profile->mutex);
+			switch_core_db_exec(db, sql, rost_callback, profile, &errmsg);
+			switch_mutex_unlock(profile->mutex);
+			switch_core_db_close(db);
+		}
+		
+	}
+
+	switch_safe_free(sql);
+
+}
+
 static void terminate_session(switch_core_session_t **session, int line, switch_call_cause_t cause)
 {
 	if (*session) {
@@ -188,31 +394,25 @@
  
 		tech_pvt = switch_core_session_get_private(*session);
 
+		if (!tech_pvt || !switch_test_flag(tech_pvt, TFLAG_READY)) {
+			switch_core_session_destroy(session);
+			return;
+		}
 
-		if (state < CS_INIT || !switch_core_session_running(*session)) {
-			if (state > CS_INIT && state < CS_HANGUP) {
-				channel_on_hangup(*session);
-			}
+		if (switch_test_flag(tech_pvt, TFLAG_TERM)) {
+			/*once is enough*/
+			return;
+		}
 
-			if (tech_pvt && tech_pvt->dlsession) {
-				ldl_session_set_private(tech_pvt->dlsession, NULL);
+		if (tech_pvt->dlsession) {
+			if (!switch_test_flag(tech_pvt, TFLAG_TERM)) {
+				ldl_session_terminate(tech_pvt->dlsession);
 			}
-			switch_core_session_destroy(session);
-		} else if (tech_pvt){
-			if (switch_test_flag(tech_pvt, TFLAG_TERM)) {
-				/*once is enough*/
-				return;
-			}
-
-			if (tech_pvt->dlsession) {
-				if (!switch_test_flag(tech_pvt, TFLAG_TERM)) {
-					ldl_session_terminate(tech_pvt->dlsession);
-				}
-				ldl_session_destroy(&tech_pvt->dlsession);
-			}
-			switch_set_flag_locked(tech_pvt, TFLAG_TERM);
+			ldl_session_destroy(&tech_pvt->dlsession);
 		}
 
+		switch_set_flag_locked(tech_pvt, TFLAG_TERM);
+	
 		if (state < CS_HANGUP) {
 			switch_channel_hangup(channel, cause);
 		}
@@ -304,6 +504,7 @@
 
 	if (switch_core_codec_init(&tech_pvt->read_codec,
 							   tech_pvt->codec_name,
+							   NULL,
 							   tech_pvt->codec_rate,
 							   ms,
 							   1,
@@ -321,6 +522,7 @@
 	
 	if (switch_core_codec_init(&tech_pvt->write_codec,
 							   tech_pvt->codec_name,
+							   NULL,
 							   tech_pvt->codec_rate,
 							   ms,
 							   1,
@@ -523,22 +725,15 @@
 	return 1;
 }
 
-static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread_t *thread, void *obj)
+static switch_status_t negotiate_media(switch_core_session_t *session)
 {
-	switch_core_session_t *session = obj;
-
+	switch_status_t ret = SWITCH_STATUS_FALSE;
 	switch_channel_t *channel;
 	struct private_object *tech_pvt = NULL;
 	switch_time_t started;
 	switch_time_t now;
 	unsigned int elapsed;
 
-	if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
-		/* too late */
-		return NULL;
-	}
-
-
 	tech_pvt = switch_core_session_get_private(session);
 	assert(tech_pvt != NULL);
 
@@ -590,7 +785,6 @@
 			goto done;
 		}
 		switch_yield(1000);
-		//printf("WAIT %s %d %d %d %d\n", switch_channel_get_name(channel), switch_test_flag(tech_pvt, TFLAG_TRANSPORT), switch_test_flag(tech_pvt, TFLAG_CODEC_READY), switch_test_flag(tech_pvt, TFLAG_RTP_READY), switch_test_flag(tech_pvt, TFLAG_ANSWER));
 	}
 	
 	if (switch_channel_get_state(channel) >= CS_HANGUP || switch_test_flag(tech_pvt, TFLAG_BYE)) {
@@ -606,36 +800,18 @@
 			goto out;
 		}
 		switch_channel_answer(channel);
-		//printf("***************************ANSWER\n");
-	} else {
-		switch_core_session_thread_launch(session);
-	}
-	switch_channel_set_state(channel, CS_INIT);
+	} 
+	ret = SWITCH_STATUS_SUCCESS;
+
 	goto done;
 	
  out:
 	terminate_session(&session,  __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
  done:
-	if (session) {
-		switch_core_session_rwunlock(session);
-	}
-	return NULL;
-}
 
-
-static void negotiate_thread_launch(switch_core_session_t *session)
-{
-	switch_thread_t *thread;
-	switch_threadattr_t *thd_attr = NULL;
-	
-	switch_threadattr_create(&thd_attr, switch_core_session_get_pool(session));
-	switch_threadattr_detach_set(thd_attr, 1);
-	switch_thread_create(&thread, thd_attr, negotiate_thread_run, session, switch_core_session_get_pool(session));
-
+	return ret;
 }
 
-
-
 /* 
    State methods they get called when the state changes to the specific state 
    returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
@@ -654,9 +830,13 @@
 
 	tech_pvt->read_frame.buflen = SWITCH_RTP_MAX_BUF_LEN;
 
-	/* Move Channel's State Machine to RING */
-	switch_channel_set_state(channel, CS_RING);
+	switch_set_flag(tech_pvt, TFLAG_READY);
 
+	if (negotiate_media(session) == SWITCH_STATUS_SUCCESS) {
+		/* Move Channel's State Machine to RING */
+		switch_channel_set_state(channel, CS_RING);
+	}
+
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -670,7 +850,7 @@
 
 	tech_pvt = switch_core_session_get_private(session);
 	assert(tech_pvt != NULL);
-
+	
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(channel));
 
 	return SWITCH_STATUS_SUCCESS;
@@ -808,14 +988,11 @@
 	assert(tech_pvt != NULL);
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DTMF [%s]\n", dtmf);
-	//snprintf(digits, sizeof(digits), "+%s\n", dtmf);
-	//ldl_handle_send_msg(tech_pvt->profile->handle, tech_pvt->recip, NULL, digits);
 
 	return switch_rtp_queue_rfc2833(tech_pvt->rtp_session,
 									dtmf,
 									100 * (tech_pvt->read_codec.implementation->samples_per_second / 1000));
 
-	//return SWITCH_STATUS_SUCCESS;
 }
 
 static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
@@ -885,7 +1062,6 @@
 			tech_pvt->timestamp_recv += (int32_t) samples;
 			tech_pvt->read_frame.samples = (int) samples;
 			tech_pvt->last_read = tech_pvt->read_frame.datalen;
-			//printf("READ bytes=%d payload=%d frames=%d samples=%d ms=%d ts=%d sampcount=%d\n", (int)tech_pvt->read_frame.datalen, (int)payload, (int)frames, (int)samples, (int)ms, (int)tech_pvt->timestamp_recv, (int)tech_pvt->read_frame.samples);
 			break;
 		}
 
@@ -944,15 +1120,13 @@
 
 	samples = frames * tech_pvt->read_codec.implementation->samples_per_frame;
 
-	//printf("%s send %d bytes %d samples in %d frames ts=%d\n", switch_channel_get_name(channel), frame->datalen, samples, frames, tech_pvt->timestamp_send);
-
 	if (switch_rtp_write_frame(tech_pvt->rtp_session, frame, samples) < 0) {
 		return SWITCH_STATUS_FALSE;
 	}
 	tech_pvt->timestamp_send += (int) samples;
 
 	switch_clear_flag_locked(tech_pvt, TFLAG_WRITING);
-	//switch_mutex_unlock(tech_pvt->rtp_lock);
+
 	return status;
 }
 
@@ -967,11 +1141,6 @@
 	tech_pvt = switch_core_session_get_private(session);
 	assert(tech_pvt != NULL);
 
-	
-
-	//if (!switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
-
-	//}
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -1115,6 +1284,7 @@
 		char sess_id[11] = "";
 		char *dnis = NULL;
 		char workspace[1024] = "";
+		char *p, *u, ubuf[512] = "", *user = NULL;;
 		
 		switch_copy_string(workspace, outbound_profile->destination_number, sizeof(workspace));
 		profile_name = workspace;
@@ -1130,13 +1300,23 @@
 			*dnis++ = '\0';
 		}
 
+		if ((p = strchr(profile_name, '@'))) {
+			*p++ = '\0';
+			u = profile_name;
+			profile_name = p;
+			snprintf(ubuf, sizeof(ubuf), "%s@%s/talk", u, profile_name);
+			user = ubuf;
+		} else {
+			user = mdl_profile->login;
+		}
+
 		if ((mdl_profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
 			if (!ldl_handle_ready(mdl_profile->handle)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Doh! we are not logged in yet!\n");
 				terminate_session(new_session,  __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 				return SWITCH_STATUS_GENERR;
 			}
-			if (!(full_id = ldl_handle_probe(mdl_profile->handle, callto, idbuf, sizeof(idbuf)))) {
+			if (!(full_id = ldl_handle_probe(mdl_profile->handle, callto, user, idbuf, sizeof(idbuf)))) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Unknown Recipient!\n");
 				terminate_session(new_session,  __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 				return SWITCH_STATUS_GENERR;
@@ -1187,7 +1367,7 @@
 		
 		switch_stun_random_string(sess_id, 10, "0123456789");
 
-		ldl_session_create(&dlsession, mdl_profile->handle, sess_id, full_id, mdl_profile->login);
+		ldl_session_create(&dlsession, mdl_profile->handle, sess_id, full_id, user);
 		tech_pvt->profile = mdl_profile;
 		ldl_session_set_private(dlsession, *new_session);
 		ldl_session_set_value(dlsession, "dnis", dnis);
@@ -1198,8 +1378,7 @@
 			terminate_session(new_session,  __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
             return SWITCH_STATUS_GENERR;
 		}
-		//tech_pvt->desc_id = ldl_session_describe(dlsession, NULL, 0, LDL_DESCRIPTION_INITIATE);
-		negotiate_thread_launch(*new_session);
+		switch_channel_set_state(channel, CS_INIT);
 		return SWITCH_STATUS_SUCCESS;
 
 	}
@@ -1228,16 +1407,31 @@
 		return SWITCH_STATUS_GENERR;
 	}
 
-	if (switch_event_reserve_subclass(DL_EVENT_MESSAGE) != SWITCH_STATUS_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!", DL_EVENT_MESSAGE);
+	if (switch_event_reserve_subclass(DL_EVENT_CONNECTED) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!", DL_EVENT_CONNECTED);
 		return SWITCH_STATUS_GENERR;
 	}
+	
+	if (switch_event_bind((char *) modname, SWITCH_EVENT_PRESENCE_IN, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+		return SWITCH_STATUS_GENERR;
+	}
 
-	if (switch_event_reserve_subclass(DL_EVENT_CONNECTED) != SWITCH_STATUS_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!", DL_EVENT_CONNECTED);
+	if (switch_event_bind((char *) modname, SWITCH_EVENT_PRESENCE_OUT, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
 		return SWITCH_STATUS_GENERR;
 	}
 
+	if (switch_event_bind((char *) modname, SWITCH_EVENT_ROSTER, SWITCH_EVENT_SUBCLASS_ANY, roster_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+		return SWITCH_STATUS_GENERR;
+	}
+
+	if (switch_event_bind((char *) modname, SWITCH_EVENT_MESSAGE, SWITCH_EVENT_SUBCLASS_ANY, chat_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+		return SWITCH_STATUS_GENERR;
+	}
+
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &channel_module_interface;
 
@@ -1345,6 +1539,8 @@
 	  	switch_set_flag(profile, TFLAG_TIMER);
 	} else if (!strcasecmp(var, "dialplan")) {
 		profile->dialplan = switch_core_strdup(module_pool, val);
+	} else if (!strcasecmp(var, "auto-reply")) {
+		profile->auto_reply = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "name")) {
 		profile->name = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "message")) {
@@ -1363,6 +1559,25 @@
 		if (switch_true(val)) {
 			profile->user_flags |= LDL_FLAG_TLS;
 		}
+	} else if (!strcasecmp(var, "component")) {
+		if (switch_true(val)) {
+			char dbname[256];
+			switch_core_db_t *db;
+
+			profile->user_flags |= LDL_FLAG_COMPONENT;
+			switch_mutex_init(&profile->mutex, SWITCH_MUTEX_NESTED, module_pool);
+			snprintf(dbname, sizeof(dbname), "dingaling_%s", profile->name);
+			profile->dbname = switch_core_strdup(module_pool, dbname);
+
+			if ((db = switch_core_db_open_file(profile->dbname))) {
+				switch_core_db_test_reactive(db, "select * from subscriptions", sub_sql);
+			} else {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open SQL Database!\n");
+				return;
+			}
+			switch_core_db_close(db);
+			
+		}
 	} else if (!strcasecmp(var, "sasl")) {
 		if (!strcasecmp(val, "plain")) {
 			profile->user_flags |= LDL_FLAG_SASL_PLAIN;
@@ -1550,8 +1765,29 @@
 }
 
 
+static void execute_sql(char *dbname, char *sql, switch_mutex_t *mutex)
+{
+	switch_core_db_t *db;
 
-static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsession, ldl_signal_t signal, char *from, char *subject, char *msg)
+	if (mutex) {
+		switch_mutex_lock(mutex);
+	}
+
+	if (!(db = switch_core_db_open_file(dbname))) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB %s\n", dbname);
+		goto end;
+	}
+	
+	switch_core_db_persistant_execute(db, sql, 25);
+	switch_core_db_close(db);
+
+ end:
+	if (mutex) {
+		switch_mutex_unlock(mutex);
+	}
+}
+
+static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsession, ldl_signal_t signal, char *to, char *from, char *subject, char *msg)
 {
 	struct mdl_profile *profile = NULL;
 	switch_core_session_t *session = NULL;
@@ -1559,7 +1795,8 @@
     struct private_object *tech_pvt = NULL;
 	switch_event_t *event;
 	ldl_status status = LDL_STATUS_SUCCESS;
-	
+	char *sql;
+
 	assert(handle != NULL);
 
 	if (!(profile = ldl_handle_get_private(handle))) {
@@ -1570,30 +1807,87 @@
 
 	if (!dlsession) {
 		switch(signal) {
+		case LDL_SIGNAL_UNSUBSCRIBE:
+			if ((profile->user_flags & LDL_FLAG_COMPONENT)) {
+
+				if ((sql = switch_core_db_mprintf("delete from subscriptions where sub_from='%q' and sub_to='%q';", from, to))) {
+					execute_sql(profile->dbname, sql, profile->mutex);
+					switch_core_db_free(sql);
+				}
+			}
+			break;
+
+		case LDL_SIGNAL_SUBSCRIBE:
+			if ((profile->user_flags & LDL_FLAG_COMPONENT)) {
+
+				if ((sql = switch_core_db_mprintf("insert into subscriptions values('%q','%q')", from, to))) {
+					execute_sql(profile->dbname, sql, profile->mutex);
+					switch_core_db_free(sql);
+				}
+			}
+			break;
+		case LDL_SIGNAL_ROSTER:
+			if (switch_event_create(&event, SWITCH_EVENT_ROSTER) == SWITCH_STATUS_SUCCESS) {
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "jingle");
+				//event->key = JINGLE_KEY;
+				switch_event_fire(&event);
+			}
+			break;
+		case LDL_SIGNAL_PRESENCE_IN:
+			if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "jingle");
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", subject);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "show", "%s", msg);
+				//event->key = JINGLE_KEY;
+				switch_event_fire(&event);
+			}
+
+			break;
+		case LDL_SIGNAL_PRESENCE_OUT:
+			if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) {
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "jingle");
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
+				//event->key = JINGLE_KEY;
+				switch_event_fire(&event);
+			}
+			break;
 		case LDL_SIGNAL_MSG:
-			if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", from);
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", subject);
-				switch_event_add_body(event, msg);
+			if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "jingle");
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s", to);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", "%s", subject);
+				event->key = JINGLE_KEY;
+				if (msg) {
+					switch_event_add_body(event, msg);
+				}
+
+				if (profile->auto_reply) {
+					ldl_handle_send_msg(handle, (profile->user_flags & LDL_FLAG_COMPONENT) ? to : profile->login, from, "", profile->auto_reply);
+				}
+
 				switch_event_fire(&event);
 			}
 			break;
 		case LDL_SIGNAL_LOGIN_SUCCESS:
 			if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_LOGIN_SUCCESS) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
 				switch_event_fire(&event);
 			}
 			break;
 		case LDL_SIGNAL_LOGIN_FAILURE:
 			if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_LOGIN_FAILURE) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
 				switch_event_fire(&event);
 			}
 			break;
 		case LDL_SIGNAL_CONNECTED:
 			if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_CONNECTED) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
 				switch_event_fire(&event);
 			}
 			break;
@@ -1651,12 +1945,11 @@
 				status = LDL_STATUS_FALSE;
 				goto done;
 			}
-
-
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating a session for %s\n", ldl_session_get_id(dlsession));
 			ldl_session_set_private(dlsession, session);
 			tech_pvt->dlsession = dlsession;
-			negotiate_thread_launch(session);
+			switch_channel_set_state(channel, CS_INIT);
+			switch_core_session_thread_launch(session);
 		} else {
 			status = LDL_STATUS_FALSE;
 			goto done;
@@ -1677,12 +1970,15 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "SESSION MSG [%s]\n", msg);
 		}
 
-		if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", from);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", subject);
-			switch_event_add_body(event, msg);
-
+		if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "jingle");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s", to);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", "%s", subject);
+			if (msg) {
+				switch_event_add_body(event, msg);
+			}
 			if (switch_core_session_queue_event(tech_pvt->session, &event) != SWITCH_STATUS_SUCCESS) {
 				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
 				switch_event_fire(&event);
@@ -1735,7 +2031,7 @@
 							name = "ilbc";
 						}
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "compare %s %d to %s %d\n", payloads[x].name, payloads[x].id, name, tech_pvt->codecs[y]->ianacode);
-						if (tech_pvt->codecs[y]->ianacode > 96) {
+						if (tech_pvt->codecs[y]->ianacode > 95) {
 							match = strcasecmp(name, payloads[x].name) ? 0 : 1;
 						} else {
 							match = (payloads[x].id == tech_pvt->codecs[y]->ianacode) ? 1 : 0;
@@ -1816,6 +2112,7 @@
 						char *context;
 						char *cid_name;
 						char *cid_num;
+						char *t, *them = NULL;
 
 						memset(payloads, 0, sizeof(payloads));
 
@@ -1827,6 +2124,18 @@
 
 						if (!(exten = ldl_session_get_value(dlsession, "dnis"))) {
 							exten = profile->exten;
+							if (!strcmp(exten, "_auto_")) {
+								if ((t = ldl_session_get_callee(dlsession))) {
+									if ((them = strdup(t))) {
+										char *p;
+										if ((p = strchr(them, '/'))) {
+											*p = '\0';
+										}
+										exten = them;
+									}
+								}
+								
+							}
 						}
 			
 						if (!(context = ldl_session_get_value(dlsession, "context"))) {
@@ -1852,7 +2161,7 @@
 																					  cid_num,
 																					  ldl_session_get_ip(dlsession),
 																					  ldl_session_get_value(dlsession, "ani"),
-																					  ldl_session_get_value(dlsession, "ani2"),
+																					  ldl_session_get_value(dlsession, "aniii"),
 																					  ldl_session_get_value(dlsession, "rdnis"),
 																					  (char *)modname,
 																					  context,
@@ -1864,6 +2173,8 @@
 							}
 						}
 
+						switch_safe_free(them);
+						
 						if (lanaddr) {
 							switch_set_flag_locked(tech_pvt, TFLAG_LANADDR);
 						}

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_iax/mod_iax.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_iax/mod_iax.c	Wed Oct 18 23:32:52 2006
@@ -373,6 +373,7 @@
 	}
 	if (switch_core_codec_init(&tech_pvt->read_codec,
 							   dname,
+							   NULL,
 							   srate,
 							   interval,
 							   1,
@@ -383,6 +384,7 @@
 	} else {
 		if (switch_core_codec_init(&tech_pvt->write_codec,
 								   dname,
+								   NULL,
 								   srate,
 								   interval,
 								   1,

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_portaudio/mod_portaudio.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_portaudio/mod_portaudio.c	Wed Oct 18 23:32:52 2006
@@ -768,6 +768,7 @@
 
 	if (switch_core_codec_init(&tech_pvt->read_codec,
 							   "L16",
+							   NULL,
 							   sample_rate,
 							   codec_ms,
 							   1,
@@ -778,6 +779,7 @@
 	} else {
 		if (switch_core_codec_init(&tech_pvt->write_codec,
 								   "L16",
+								   NULL,
 								   sample_rate,
 								   codec_ms,
 								   1,

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/Makefile	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/Makefile	Wed Oct 18 23:32:52 2006
@@ -1,6 +1,6 @@
 OS_ARCH         := $(subst /,_,$(shell uname -s | sed /\ /s//_/))
 VERSION = sofia-sip-1.12
-TARBALL = sofia-sip-1.12.3.2.tar.gz
+TARBALL = sofia-sip-1.12.3.4.tar.gz
 CFLAGS += -I. -I$(PREFIX)/include/$(VERSION)
 LDFLAGS += -lsofia-sip-ua
 LINKER=$(CC)
@@ -10,7 +10,7 @@
 all:	depends $(MODNAME).$(DYNAMIC_LIB_EXTEN)
 
 depends:
-	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install $(TARBALL) --prefix=$(PREFIX) --with-pic
+	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install $(TARBALL) --prefix=$(PREFIX) --with-pic --with-glib=no
 
 %.o:  %.c
 	$(CC) -fPIC $(CFLAGS) -c -o $@ $<

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.c	Wed Oct 18 23:32:52 2006
@@ -24,6 +24,7 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
+ * Ken Rice, Asteria Solutions Group, Inc <ken at asteriasgi.com>
  *
  *
  * mod_sofia.c -- SOFIA SIP Endpoint
@@ -42,6 +43,9 @@
 struct outbound_reg;
 typedef struct outbound_reg outbound_reg_t;
 
+struct sip_presence;
+typedef struct sip_presence sip_presence_t;
+
 struct sofia_profile;
 typedef struct sofia_profile sofia_profile_t;
 #define NUA_MAGIC_T sofia_profile_t
@@ -49,6 +53,7 @@
 struct sofia_private {
 	switch_core_session_t *session;
 	outbound_reg_t *oreg;
+	sip_presence_t *presence;
 };
 
 typedef struct sofia_private sofia_private_t;
@@ -61,15 +66,20 @@
 #define MY_EVENT_EXPIRE "sofia::expire"
 #define MULTICAST_EVENT "multicast::event"
 #define SOFIA_REPLACES_HEADER "_sofia_replaces_"
+#define SOFIA_USER_AGENT "FreeSWITCH(mod_sofia)"
+#define SIP_KEY 2
 
-
 #include <sofia-sip/nua.h>
 #include <sofia-sip/sip_status.h>
 #include <sofia-sip/sdp.h>
 #include <sofia-sip/sip_protos.h>
 #include <sofia-sip/auth_module.h>
 #include <sofia-sip/su_md5.h>
+#include <sofia-sip/su_log.h>
+#include <sofia-sip/nea.h>
 
+extern su_log_t tport_log[];
+
 static char reg_sql[] =
 "CREATE TABLE sip_registrations (\n"
 "   user            VARCHAR(255),\n"
@@ -79,6 +89,22 @@
 ");\n";
 
 
+static char sub_sql[] =
+"CREATE TABLE sip_subscriptions (\n"
+"   proto           VARCHAR(255),\n"
+"   user            VARCHAR(255),\n"
+"   host            VARCHAR(255),\n"
+"   sub_to_user     VARCHAR(255),\n"
+"   sub_to_host     VARCHAR(255),\n"
+"   event           VARCHAR(255),\n"
+"   contact         VARCHAR(255),\n"
+"   call_id         VARCHAR(255),\n"
+"   full_from       VARCHAR(255),\n"
+"   full_via        VARCHAR(255),\n"
+"   expires         INTEGER(8)"
+");\n";
+
+
 static char auth_sql[] =
 "CREATE TABLE sip_authentication (\n"
 "   user            VARCHAR(255),\n"
@@ -111,7 +137,8 @@
 	PFLAG_AUTH_CALLS = (1 << 0),
 	PFLAG_BLIND_REG = (1 << 1),
 	PFLAG_AUTH_ALL = (1 << 2),
-	PFLAG_FULL_ID = (1 << 3)
+	PFLAG_FULL_ID = (1 << 3),
+	PFLAG_PRESENCE = (1 << 4)
 } PFLAGS;
 
 typedef enum {
@@ -135,7 +162,8 @@
 	TFLAG_REFER = (1 << 17),
 	TFLAG_NOHUP = (1 << 18),
 	TFLAG_XFER = (1 << 19),
-	TFLAG_NOMEDIA = (1 << 20)
+	TFLAG_NOMEDIA = (1 << 20),
+	TFLAG_BUGGY_2833 = (1 << 21)
 } TFLAGS;
 
 static struct {
@@ -181,6 +209,14 @@
 	struct outbound_reg *next;
 };
 
+
+struct sip_presence {
+	sofia_private_t sofia_private;
+	nua_handle_t *nh;
+	sofia_profile_t *profile;
+};
+
+
 struct sofia_profile {
 	int debug;
 	char *name;
@@ -214,6 +250,10 @@
 	switch_mutex_t *ireg_mutex;
 	switch_mutex_t *oreg_mutex;
 	outbound_reg_t *registrations;
+	sip_presence_t *presence;
+	su_home_t *home;
+	switch_hash_t *profile_hash;
+	switch_hash_t *chat_hash;
 };
 
 
@@ -250,12 +290,19 @@
 	char *contact_url;
 	char *from_str;
 	char *rm_encoding;
+	char *rm_fmtp;
+	char *fmtp_out;
 	char *remote_sdp_str;
 	char *local_sdp_str;
 	char *dest;
 	char *key;
 	char *xferto;
 	char *kick;
+	char *origin;
+	char *hash_key;
+	char *chat_from;
+	char *chat_to;
+	char *e_dest;
 	unsigned long rm_rate;
 	switch_payload_t pt;
 	switch_mutex_t *flag_mutex;
@@ -490,7 +537,6 @@
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB %s\n", dbname);
 		goto end;
 	}
-	
 	switch_core_db_persistant_execute(db, sql, 25);
 	switch_core_db_close(db);
 
@@ -553,9 +599,12 @@
 	}
 	
 	snprintf(sql, sizeof(sql), "delete from sip_registrations where expires > 0 and expires < %ld", (long) now);
-	switch_core_db_persistant_execute(db, sql, 25);
+	switch_core_db_persistant_execute(db, sql, 1000);
 	snprintf(sql, sizeof(sql), "delete from sip_authentication where expires > 0 and expires < %ld", (long) now);
-	switch_core_db_persistant_execute(db, sql, 25);
+	switch_core_db_persistant_execute(db, sql, 1000);
+	snprintf(sql, sizeof(sql), "delete from sip_subscriptions where expires > 0 and expires < %ld", (long) now);
+	switch_core_db_persistant_execute(db, sql, 1000);
+
 	switch_mutex_unlock(profile->ireg_mutex);
 
 	switch_core_db_close(db);
@@ -632,7 +681,7 @@
 		}
 	}
 
-	if (tech_pvt->te > 96) {
+	if (tech_pvt->te > 95) {
 		snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->te);
 	}
 
@@ -640,16 +689,26 @@
 
 	if (tech_pvt->rm_encoding) {
 		snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%ld\n", tech_pvt->pt, tech_pvt->rm_encoding, tech_pvt->rm_rate);
+		if (tech_pvt->fmtp_out) {
+			snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", tech_pvt->pt, tech_pvt->fmtp_out);
+		}
+		if (tech_pvt->read_codec.implementation) {
+			snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=ptime:%d\n", tech_pvt->read_codec.implementation->microseconds_per_frame / 1000);
+		}
+
 	} else if (tech_pvt->num_codecs) {
 		int i;
 		for (i = 0; i < tech_pvt->num_codecs; i++) {
 			const switch_codec_implementation_t *imp = tech_pvt->codecs[i];
 			snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", imp->ianacode, imp->iananame, imp->samples_per_second);
+			if (imp->fmtp) {
+				snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", imp->ianacode, imp->fmtp);
+			}
 			snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=ptime:%d\n", imp->microseconds_per_frame / 1000);
 		}
 	}
 	
-	if (tech_pvt->te > 96) {
+	if (tech_pvt->te > 95) {
 		snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d telephone-event/8000\na=fmtp:%d 0-16\n", tech_pvt->te, tech_pvt->te);
 	}
 
@@ -787,11 +846,57 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
+char *encode_name(char *s) 
+{
+	char *ss, *sret;
+	uint32_t len;
+	char *at, *resource;
+	char *user;
+
+	if (!strchr(s, '/') && !strchr(s, '@')) {
+		return NULL;
+	}
+
+	if (!(ss = strdup(s))) {
+		return NULL;
+	}
+
+	user = ss;
+
+	resource = strchr(user, '/');
+	at = strchr(user, '@');
+	
+	if (resource) {
+		*resource++ = '\0';
+	}
+
+	len = (uint32_t)strlen(user) + 25;
+
+	if (at) {
+		*at++ = '\0';
+	}
+
+	if (!(sret = (char *) malloc(len))) {
+		return NULL;
+	}
+
+	memset(sret, 0, len);
+	snprintf(sret, len, "jingle+%s+%s", user, at);
+
+	free(ss);
+	
+
+	return sret;
+}
+
 static void do_invite(switch_core_session_t *session)
 {
+	char rpid[1024];
 	private_object_t *tech_pvt;
     switch_channel_t *channel = NULL;
 	switch_caller_profile_t *caller_profile;
+	char *cid_name, *cid_num_p = NULL, *cid_num;
+	char *e_dest = NULL;
 
     channel = switch_core_session_get_channel(session);
     assert(channel != NULL);
@@ -801,21 +906,44 @@
 
 	caller_profile = switch_channel_get_caller_profile(channel);
 
+	cid_name = (char *) caller_profile->caller_id_name;
+	cid_num = (char *) caller_profile->caller_id_number;
 	
+	if ((cid_num_p = encode_name(cid_num))) {
+		cid_num = cid_num_p;
+	}
 
 	if ((tech_pvt->from_str = switch_core_db_mprintf("\"%s\" <sip:%s@%s>", 
-													 (char *) caller_profile->caller_id_name, 
-													 (char *) caller_profile->caller_id_number,
+													 cid_name,
+													 cid_num,
 													 tech_pvt->profile->sipip
 													 ))) {
 
 		char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
 		
+
 		tech_choose_port(tech_pvt);
 		set_local_sdp(tech_pvt);
 
 		switch_set_flag_locked(tech_pvt, TFLAG_READY);
 
+		// forge a RPID for now KHR  -- Should wrap this in an if statement so it can be turned on and off
+		if (switch_test_flag(caller_profile, SWITCH_CPF_SCREEN)) {
+			char *priv = "no";
+			
+			if (switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME)) {
+				priv = "name";
+				if (switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER)) {
+					priv = "yes";
+				}
+			} else if (switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER)) {
+				priv = "yes";
+			}
+
+			snprintf(rpid, sizeof(rpid) - 1, "Remote-Party-ID: %s;party=calling;screen=yes;privacy=%s", tech_pvt->from_str, priv);
+								
+		}
+
 		if (!tech_pvt->nh) {
 			tech_pvt->nh = nua_handle(tech_pvt->profile->nua, NULL,
 									  SIPTAG_TO_STR(tech_pvt->dest),
@@ -828,7 +956,25 @@
 
 		}
 
+
+		if (tech_pvt->e_dest && (e_dest = strdup(tech_pvt->e_dest))) {
+			char *user = e_dest, *host = NULL;
+			char hash_key[256] = "";
+
+			if ((host = strchr(user, '@'))) {
+				*host++ = '\0';
+			}
+			snprintf(hash_key, sizeof(hash_key), "%s%s%s", user, host, cid_num);
+
+			tech_pvt->chat_from = tech_pvt->from_str;
+			tech_pvt->chat_to = tech_pvt->dest;
+			tech_pvt->hash_key = switch_core_session_strdup(tech_pvt->session, hash_key);
+			switch_core_hash_insert(tech_pvt->profile->chat_hash, tech_pvt->hash_key, tech_pvt);
+			
+		}
+
 		nua_invite(tech_pvt->nh,
+				   TAG_IF(rpid, SIPTAG_HEADER_STR(rpid)),
 				   SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 				   SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE),
 				   SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL),
@@ -838,12 +984,15 @@
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
 	}
 	
+	switch_safe_free(cid_num_p);
+
 }
 
 
 
 static void do_xfer_invite(switch_core_session_t *session)
 {
+	char rpid[1024];
 	private_object_t *tech_pvt;
     switch_channel_t *channel = NULL;
 	switch_caller_profile_t *caller_profile;
@@ -865,7 +1014,6 @@
 													 ))) {
 
 		char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
-		
 
 		tech_pvt->nh2 = nua_handle(tech_pvt->profile->nua, NULL,
 								  SIPTAG_TO_STR(tech_pvt->dest),
@@ -879,6 +1027,7 @@
 
 
 		nua_invite(tech_pvt->nh2,
+				   TAG_IF(rpid, SIPTAG_HEADER_STR(rpid)),
 				   SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 				   SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE),
 				   SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL),
@@ -909,6 +1058,7 @@
 
 	tech_pvt->read_frame.buflen = SWITCH_RTP_MAX_BUF_LEN;
 
+
 	switch_channel_set_variable(channel, "endpoint_disposition", "INIT");
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SOFIA INIT\n");
 
@@ -1040,6 +1190,9 @@
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s\n", 
 			  switch_channel_get_name(channel), switch_channel_cause2str(cause), sip_cause);
 
+	if (tech_pvt->hash_key) {
+		switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->hash_key);
+	}
 
 	if (tech_pvt->kick && (asession = switch_core_session_locate(tech_pvt->kick))) {
 		switch_channel_t *a_channel = switch_core_session_get_channel(asession);
@@ -1126,6 +1279,7 @@
 
 	if (switch_core_codec_init(&tech_pvt->read_codec,  
 							   tech_pvt->rm_encoding,
+							   tech_pvt->rm_fmtp,
 							   tech_pvt->rm_rate,
 							   tech_pvt->codec_ms,
 							   1,
@@ -1138,6 +1292,7 @@
 	} else {
 		if (switch_core_codec_init(&tech_pvt->write_codec,
 								   tech_pvt->rm_encoding,
+								   tech_pvt->rm_fmtp,
 								   tech_pvt->rm_rate,
 								   tech_pvt->codec_ms,
 								   1,
@@ -1158,6 +1313,7 @@
 				
 			switch_core_session_set_read_codec(tech_pvt->session, &tech_pvt->read_codec);
 			switch_core_session_set_write_codec(tech_pvt->session, &tech_pvt->write_codec);
+			tech_pvt->fmtp_out = switch_core_session_strdup(tech_pvt->session, tech_pvt->write_codec.fmtp_out);
 		}
 	}
 	return SWITCH_STATUS_SUCCESS;
@@ -1194,6 +1350,10 @@
 
 	flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_RAW_WRITE | SWITCH_RTP_FLAG_AUTOADJ | SWITCH_RTP_FLAG_DATAWAIT);
 
+	if (switch_test_flag(tech_pvt, TFLAG_BUGGY_2833)) {
+		flags |= SWITCH_RTP_FLAG_BUGGY_2833;
+	}
+
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "RTP [%s] %s:%d->%s:%d codec: %u ms: %d\n",
 					  switch_channel_get_name(channel),
 					  tech_pvt->local_sdp_audio_ip,
@@ -1292,7 +1452,9 @@
 			nua_respond(tech_pvt->nh, SIP_200_OK, 
 						SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 						SOATAG_AUDIO_AUX("cn telephone-event"),
+						NUTAG_INCLUDE_EXTRA_SDP(1),
 						TAG_END());
+			
 		}
 	}
 
@@ -1587,6 +1749,9 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Re-activate timed RTP!\n");
 		}
 		break;
+	case SWITCH_MESSAGE_INDICATE_RINGING:
+		nua_respond(tech_pvt->nh, SIP_180_RINGING, TAG_END());
+		break;
 	case SWITCH_MESSAGE_INDICATE_PROGRESS: {
 		struct private_object *tech_pvt;
 	    switch_channel_t *channel = NULL;
@@ -1629,6 +1794,42 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
+static switch_status_t sofia_receive_event(switch_core_session_t *session, switch_event_t *event)
+{
+	switch_channel_t *channel;
+    struct private_object *tech_pvt;
+	char *body;
+	nua_handle_t *msg_nh;
+
+    channel = switch_core_session_get_channel(session);
+    assert(channel != NULL);
+
+    tech_pvt = switch_core_session_get_private(session);
+    assert(tech_pvt != NULL);
+
+
+	if (!(body = switch_event_get_body(event))) {
+		body = "";
+	}
+
+	if (tech_pvt->hash_key) {
+		msg_nh = nua_handle(tech_pvt->profile->nua, NULL,
+							SIPTAG_FROM_STR(tech_pvt->chat_from),
+							NUTAG_URL(tech_pvt->chat_to),
+							SIPTAG_TO_STR(tech_pvt->chat_to),
+							SIPTAG_CONTACT_STR(tech_pvt->profile->url),
+							TAG_END());
+
+
+		nua_message(msg_nh,
+					SIPTAG_CONTENT_TYPE_STR("text/html"),
+					SIPTAG_PAYLOAD_STR(body),
+					TAG_END());
+	}
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
 static const switch_io_routines_t sofia_io_routines = {
 	/*.outgoing_channel */ sofia_outgoing_channel,
 	/*.answer_channel */ sofia_answer_channel,
@@ -1638,7 +1839,8 @@
 	/*.waitfor_read */ sofia_waitfor_read,
 	/*.waitfor_read */ sofia_waitfor_write,
 	/*.send_dtmf*/ sofia_send_dtmf,
-	/*.receive_message*/ sofia_receive_message
+	/*.receive_message*/ sofia_receive_message,
+	/*.receive_event*/ sofia_receive_event
 };
 
 static const switch_state_handler_table_t sofia_event_handlers = {
@@ -1667,6 +1869,33 @@
 	/*.application_interface */ NULL
 };
 
+
+static void logger(void *logarg, char const *fmt, va_list ap)
+{
+	char *data = NULL;
+
+	if (fmt) {
+#ifdef HAVE_VASPRINTF
+		int ret;
+		ret = vasprintf(&data, fmt, ap);
+		if ((ret == -1) || !data) {
+			return;
+		}
+#else
+		data = (char *) malloc(2048);
+		if (data) {
+			vsnprintf(data, 2048, fmt, ap);
+		} else { 
+			return;
+		}
+#endif
+	}
+	
+	switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, (char*) "%s", data);
+	free(data);
+}
+
+
 static switch_status_t sofia_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
 											  switch_core_session_t **new_session, switch_memory_pool_t *pool)
 {
@@ -1711,6 +1940,8 @@
 
 	if ((host = strchr(dest, '%'))) {
 		char buf[128];
+		*host = '@';
+		tech_pvt->e_dest = switch_core_session_strdup(nsession, dest);
 		*host++ = '\0';
 		if (find_reg_url(profile, dest, host, buf, sizeof(buf))) {
 			tech_pvt->dest = switch_core_session_strdup(nsession, buf);
@@ -1758,32 +1989,41 @@
 	tech_pvt = switch_core_session_get_private(session);
 	assert(tech_pvt != NULL);                                                                                                                               
 	
+	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);
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activate Buggy RFC2833 Mode!\n");
+		}
+	}
+
 	for (m = sdp->sdp_media; m ; m = m->m_next) {
 		if (m->m_type == sdp_media_audio) {
 			sdp_rtpmap_t *map;
 
 			for (map = m->m_rtpmaps; map; map = map->rm_next) {
 				int32_t i;
-								
+				
 				if (!strcasecmp(map->rm_encoding, "telephone-event")) {
 					tech_pvt->te = (switch_payload_t)map->rm_pt;
 				}
-
+				
 				for (i = 0; i < tech_pvt->num_codecs; i++) {
 					const switch_codec_implementation_t *imp = tech_pvt->codecs[i];
-								
-					if (map->rm_pt < 97) {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec Compare [%s:%d]/[%s:%d]\n", 
+									  map->rm_encoding, map->rm_pt, imp->iananame, imp->ianacode);
+					if (map->rm_pt < 96) {
 						match = (map->rm_pt == imp->ianacode) ? 1 : 0;
 					} else {
 						match = strcasecmp(map->rm_encoding, imp->iananame) ? 0 : 1;
 					}
-								
+					
 					if (match && (map->rm_rate == imp->samples_per_second)) {
 						tech_pvt->rm_encoding = switch_core_session_strdup(session, (char *)map->rm_encoding);
 						tech_pvt->pt = (switch_payload_t)map->rm_pt;
 						tech_pvt->rm_rate = map->rm_rate;
 						tech_pvt->codec_ms = imp->microseconds_per_frame / 1000;
 						tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(session, (char *)sdp->sdp_connection->c_address);
+						tech_pvt->rm_fmtp = switch_core_session_strdup(session, (char *)map->rm_fmtp);
 						tech_pvt->remote_sdp_audio_port = (switch_port_t)m->m_port;
 						break;
 					} else {
@@ -1855,6 +2095,166 @@
 	}
 }
 
+
+static void set_hash_key(char *hash_key, int32_t len, sip_t const *sip)
+{
+
+	snprintf(hash_key, len, "%s%s%s",
+			 (char *) sip->sip_from->a_url->url_user,
+			 (char *) sip->sip_from->a_url->url_host,
+			 (char *) sip->sip_to->a_url->url_user
+			 );	
+
+
+#if 0
+	/* nicer one we cant use in both directions >=0 */
+	snprintf(hash_key, len, "%s%s%s%s%s%s",
+			 (char *) sip->sip_to->a_url->url_user,
+			 (char *) sip->sip_to->a_url->url_host,
+			 (char *) sip->sip_to->a_url->url_params,
+			 
+			 (char *) sip->sip_from->a_url->url_user,
+			 (char *) sip->sip_from->a_url->url_host,
+			 (char *) sip->sip_from->a_url->url_params
+			 );	
+#endif
+
+}
+
+static void set_chat_hash(private_object_t *tech_pvt, sip_t const *sip)
+{
+	char hash_key[256] = "";
+	char buf[512];
+
+	if (!sip || tech_pvt->hash_key) {
+		return;
+	}
+
+	if (find_reg_url(tech_pvt->profile, (char *) sip->sip_from->a_url->url_user, (char *) sip->sip_from->a_url->url_host, buf, sizeof(buf))) {
+		tech_pvt->chat_from = sip_header_as_string(tech_pvt->home, (void *)sip->sip_to);
+		tech_pvt->chat_to = switch_core_session_strdup(tech_pvt->session, buf);
+		set_hash_key(hash_key, sizeof(hash_key), sip);
+	} else {
+		return;
+	}
+
+	
+
+	tech_pvt->hash_key = switch_core_session_strdup(tech_pvt->session, hash_key);
+	switch_core_hash_insert(tech_pvt->profile->chat_hash, tech_pvt->hash_key, tech_pvt);
+
+}
+
+
+static void sip_i_message(int status,
+						char const *phrase, 
+						nua_t *nua,
+						sofia_profile_t *profile,
+						nua_handle_t *nh,
+						sofia_private_t *sofia_private,
+						sip_t const *sip,
+						tagi_t tags[])
+{
+	if (sip) {
+		sip_from_t const *from = sip->sip_from;
+		char *from_user = NULL;
+		char *from_host = NULL;
+		sip_to_t const *to = sip->sip_to;
+		char *to_user = NULL;
+		char *to_host = NULL;
+		sip_subject_t const *sip_subject = sip->sip_subject;
+		sip_payload_t *payload = sip->sip_payload;
+		const char *subject = "n/a";
+		char *msg = NULL;
+
+		if (strstr((char*)sip->sip_content_type->c_subtype, "composing")) {
+			return;
+		}
+
+		if (from) {
+			from_user = (char *) from->a_url->url_user;
+			from_host = (char *) from->a_url->url_host;
+		}
+
+		if (to) {
+			to_user = (char *) to->a_url->url_user;
+			to_host = (char *) to->a_url->url_host;
+		}
+
+		if (payload) {
+			msg = payload->pl_data;
+		}
+
+		if (sip_subject) {
+			subject = sip_subject->g_value;
+		}
+
+		if (nh) {			
+			char hash_key[512];
+			private_object_t *tech_pvt;
+			switch_channel_t *channel;
+			switch_event_t *event;
+			char *to_addr;
+			char *from_addr;
+			char *p;
+
+			if ((p=strchr(to_user, '+'))) {
+				
+				if ((to_addr = strdup(++p))) {
+					p = strchr(to_addr, '+');
+					*p = '@';
+				}
+				
+			} else {
+				to_addr = switch_core_db_mprintf("%s@%s", to_user, to_host);
+			}
+
+			from_addr = switch_core_db_mprintf("%s@%s", from_user, from_host);
+
+			set_hash_key(hash_key, sizeof(hash_key), sip);
+			if ((tech_pvt = (private_object_t *) switch_core_hash_find(profile->chat_hash, hash_key))) {
+				channel = switch_core_session_get_channel(tech_pvt->session);
+				if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "sip");
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", tech_pvt->hash_key);
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s", to_addr);
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE");
+					event->key = SIP_KEY;
+					if (msg) {
+						switch_event_add_body(event, msg);
+					}
+					if (switch_core_session_queue_event(tech_pvt->session, &event) != SWITCH_STATUS_SUCCESS) {
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
+						switch_event_fire(&event);
+					}
+				}
+			} else {
+
+				if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "sip");
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from_addr);
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s", to_addr);
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE");
+					event->key = SIP_KEY;
+					if (msg) {
+						switch_event_add_body(event, msg);
+					}
+
+					switch_event_fire(&event);
+
+				}
+
+			}
+			switch_safe_free(to_addr);
+			switch_safe_free(from_addr);
+		}
+
+	}
+}
+
+
 static void sip_i_state(int status,
 						char const *phrase, 
 						nua_t *nua,
@@ -1871,7 +2271,10 @@
 	switch_channel_t *channel = NULL;
 	private_object_t *tech_pvt = NULL;
 	switch_core_session_t *session = sofia_private ? sofia_private->session : NULL;
-	const char *replaces_str;
+	const char *replaces_str = NULL;
+	char *uuid;
+	switch_core_session_t *other_session = NULL;
+	switch_channel_t *other_channel = NULL;
 
 	tl_gets(tags, 
 			NUTAG_CALLSTATE_REF(ss_state),
@@ -1893,6 +2296,8 @@
 		
 		tech_pvt->nh = nh;
 		
+		
+
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s entering state [%s]\n", 
 						  switch_channel_get_name(channel),
 						  nua_callstate_name(ss_state));
@@ -1901,6 +2306,7 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp);			
 			tech_pvt->remote_sdp_str = switch_core_session_strdup(session, (char *)r_sdp);
 			switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, (char *) r_sdp);
+
 		}
 	}
 
@@ -1914,9 +2320,36 @@
 		break;
 	case nua_callstate_proceeding:
 		if (channel) {
+			if (status == 180) {
+				if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
+					if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
+						switch_core_session_message_t msg;
+						msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING;
+						msg.from = __FILE__;
+						switch_core_session_receive_message(other_session, &msg);
+						switch_core_session_rwunlock(other_session);
+					}
+					
+				} else {
+					switch_core_session_message_t *msg;
+					if ((msg = malloc(sizeof(*msg)))) {
+						memset(msg, 0, sizeof(*msg));
+						msg->message_id = SWITCH_MESSAGE_INDICATE_RINGING;
+						msg->from = __FILE__;
+						switch_core_session_queue_message(session, msg);
+						switch_set_flag(msg, SCSMF_DYNAMIC);
+					}
+				}
+			}
 			if (r_sdp) {
 				if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
 					switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
+					switch_channel_set_flag(channel, CF_EARLY_MEDIA);
+					if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
+						other_channel = switch_core_session_get_channel(other_session);
+						switch_channel_pre_answer(other_channel);
+						switch_core_session_rwunlock(other_session);
+					}
 					return;
 				} else {
 					sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
@@ -1933,12 +2366,12 @@
 						sdp_parser_free(parser);
 					}
 
-
 					if (match) {
 						tech_choose_port(tech_pvt);
 						activate_rtp(tech_pvt);
 						switch_channel_set_variable(channel, "endpoint_disposition", "EARLY MEDIA");
 						switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
+						switch_channel_set_flag(channel, CF_EARLY_MEDIA);
 						return;
 					}
 					switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
@@ -1978,12 +2411,11 @@
 					if (match) {
 						nua_handle_t *bnh;
 						sip_replaces_t *replaces;
-					
 						switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED");
 						switch_channel_set_state(channel, CS_INIT);
 						switch_set_flag_locked(tech_pvt, TFLAG_READY);
 						switch_core_session_thread_launch(session);
-
+						
 						if (replaces_str && (replaces = sip_replaces_make(tech_pvt->home, replaces_str)) && (bnh = nua_handle_by_replaces(nua, replaces))) {
 							sofia_private_t *b_private;
 
@@ -2068,6 +2500,11 @@
 				if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
 					switch_set_flag_locked(tech_pvt, TFLAG_ANS);
 					switch_channel_set_flag(channel, CF_ANSWERED);
+					if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
+						other_channel = switch_core_session_get_channel(other_session);
+						switch_channel_answer(other_channel);
+						switch_core_session_rwunlock(other_session);
+					}
 					return;
 				} else {
 					sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
@@ -2110,13 +2547,15 @@
 		break;
 	case nua_callstate_terminated: 
 		if (session) {
-			switch_set_flag_locked(tech_pvt, TFLAG_BYE);
-			if (switch_test_flag(tech_pvt, TFLAG_NOHUP)) {
-				switch_clear_flag_locked(tech_pvt, TFLAG_NOHUP);
-				nua_handle_destroy(tech_pvt->nh);
-				tech_pvt->nh = NULL;
-			} else {
-				terminate_session(&session, sip_cause_to_freeswitch(status), __LINE__);
+			if (!switch_test_flag(tech_pvt, TFLAG_BYE)) {
+				switch_set_flag_locked(tech_pvt, TFLAG_BYE);
+				if (switch_test_flag(tech_pvt, TFLAG_NOHUP)) {
+					switch_clear_flag_locked(tech_pvt, TFLAG_NOHUP);
+					nua_handle_destroy(tech_pvt->nh);
+					tech_pvt->nh = NULL;
+				} else {
+					terminate_session(&session, sip_cause_to_freeswitch(status), __LINE__);
+				}
 			}
 		}
 		break;
@@ -2211,15 +2650,31 @@
 	switch_event_t *s_event;
 	char *from_user = (char *) from->a_url->url_user;
 	char *from_host = (char *) from->a_url->url_host;
-	char *contact_user = (char *) contact->m_url->url_user;
-	char *contact_host = (char *) contact->m_url->url_host;
+	char contact_str[256] = "";
 	char buf[512];
 	char *passwd = NULL;
 	uint8_t stale = 0, ret = 0, forbidden = 0;
 	auth_res_t auth_res;
 	long exptime = 60;
+	switch_event_t *event;
 
 
+	
+
+	if (sip->sip_contact) {
+		char *port = (char *) contact->m_url->url_port;
+		if (!port) {
+			port = "5060";
+		}
+		if (contact->m_url->url_params) {
+			snprintf(contact_str, sizeof(contact_str), "sip:%s@%s:%s;%s", 
+					 contact->m_url->url_user, contact->m_url->url_host, port, contact->m_url->url_params);
+		} else {
+			snprintf(contact_str, sizeof(contact_str), "sip:%s@%s:%s", 
+					 contact->m_url->url_user, contact->m_url->url_host, port);
+		}
+	}
+	
 	if (expires) {
 		exptime = expires->ex_delta;
 	} else if (contact->m_expires) {
@@ -2253,11 +2708,10 @@
 	} 
 
 	if (!authorization || stale) {
-		snprintf(params, sizeof(params), "from_user=%s&from_host=%s&contact_user=%s&contact_host=%s",
+		snprintf(params, sizeof(params), "from_user=%s&from_host=%s&contact=%s",
 				 from_user,
 				 from_host,
-				 contact_user,
-				 contact_host 
+				 contact_str
 				 );
 
 		
@@ -2348,30 +2802,26 @@
  reg:
 
 	if (!find_reg_url(profile, from_user, from_host, buf, sizeof(buf))) {
-		sql = switch_core_db_mprintf("insert into sip_registrations values ('%q','%q','sip:%q@%q',%ld)", 
+		sql = switch_core_db_mprintf("insert into sip_registrations values ('%q','%q','%q',%ld)", 
 									 from_user,
 									 from_host,
-									 contact_user,
-									 contact_host,
+									 contact_str,
 									 (long) time(NULL) + (long)exptime);
 
 	} else {
-		sql = switch_core_db_mprintf("update sip_registrations set contact='sip:%q@%q', expires=%ld where user='%q' and host='%q'",
-									 contact_user,
-                                     contact_host,
+		sql = switch_core_db_mprintf("update sip_registrations set contact='%q', expires=%ld where user='%q' and host='%q'",
+                                     contact_str,
 									 (long) time(NULL) + (long)exptime,
 									 from_user,
 									 from_host);
 		
 	}
 
-			
 	if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_REGISTER) == SWITCH_STATUS_SUCCESS) {
 		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile-name", "%s", profile->name);
 		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from-user", "%s", from_user);
 		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from-host", "%s", from_host);
-		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "contact-user", "%s", contact_user);
-		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "contact-host", "%s", contact_host);
+		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "contact", "%s", contact_str);
 		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%ld", (long)exptime);
 		switch_event_fire(&s_event);
 	}
@@ -2382,14 +2832,45 @@
 		sql = NULL;
 	}
 	
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Register from [%s@%s] contact [%s@%s] expires %ld\n", 
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Register from [%s@%s] contact [%s] expires %ld\n", 
 					  from_user, 
 					  from_host,
-					  contact_user,
-					  contact_host,
+					  contact_str,
 					  (long)exptime
 					  );
 
+
+
+	if (switch_event_create(&event, SWITCH_EVENT_ROSTER) == SWITCH_STATUS_SUCCESS) {
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "sip");
+		event->key = SIP_KEY;
+		switch_event_fire(&event);
+	}
+
+	if (exptime) {
+		if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "sip");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
+		
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Registered");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "show", "Registered");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
+			switch_event_fire(&event);
+		}
+	} else {
+		if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) {
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "sip");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
+		
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "unavailable");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "show", "unavailable");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
+			switch_event_fire(&event);
+		}
+	}
+
 	if (regtype == REG_REGISTER) {
 		nua_respond(nh, SIP_200_OK, SIPTAG_CONTACT(contact),
 					NUTAG_WITH_THIS(nua),
@@ -2401,7 +2882,157 @@
 }
 
 
+static void sip_i_subscribe(int status,
+						char const *phrase, 
+						nua_t *nua,
+						sofia_profile_t *profile,
+						nua_handle_t *nh,
+						sofia_private_t *sofia_private,
+						sip_t const *sip,
+						tagi_t tags[])
+{
+		if (sip) {
+			long exp;
+			sip_to_t const *to = sip->sip_to;
+			sip_from_t const *from = sip->sip_from;
+			sip_contact_t const *contact = sip->sip_contact;
+			char *from_user = NULL;
+			char *from_host = NULL;
+			char *to_user = NULL;
+			char *to_host = NULL;
+			char *sql, *event = NULL;
+			char *proto = "sip";
+			char *d_user = NULL;
+			char *contact_str = "";
+			char *call_id = NULL;
+			char *to_str = NULL;
+			char *full_from = NULL;
+			char *full_via = NULL;
 
+			if (from) {
+				from_user = (char *) from->a_url->url_user;
+				from_host = (char *) from->a_url->url_host;
+			}
+
+			if (contact) {
+				char *port = (char *) contact->m_url->url_port;
+				if (!port) {
+					port = "5060";
+				}
+
+				if (contact->m_url->url_params) {
+					contact_str = switch_core_db_mprintf("sip:%s@%s:%s;%s", 
+														 contact->m_url->url_user,
+														 contact->m_url->url_host, port, contact->m_url->url_params);
+				} else {
+					contact_str = switch_core_db_mprintf("sip:%s@%s:%s", 
+														 contact->m_url->url_user,
+														 contact->m_url->url_host, port);
+				}
+			}
+			
+			if (to) {
+				to_str = switch_core_db_mprintf("sip:%s@%s", to->a_url->url_user, to->a_url->url_host);//, to->a_url->url_port);
+			}
+
+			if (to) {
+				to_user = (char *) to->a_url->url_user;
+				to_host = (char *) to->a_url->url_host;
+			}
+
+			if (strchr(to_user, '+')) {
+				if ((proto = (d_user = strdup(to_user)))) {
+					if ((to_user = strchr(d_user, '+'))) {
+						*to_user++ = '\0';
+						if ((to_host = strchr(to_user, '+'))) {
+							*to_host++ = '\0';
+						}
+					}
+				}
+
+				if (!(proto && to_user && to_host)) {
+					nua_respond(nh, SIP_404_NOT_FOUND, TAG_END());
+					goto end;
+				}
+			}
+
+			call_id = sip_header_as_string(profile->home, (void *)sip->sip_call_id);
+			event = sip_header_as_string(profile->home, (void *)sip->sip_event);
+			full_from = sip_header_as_string(profile->home, (void *)sip->sip_from);
+			full_via = sip_header_as_string(profile->home, (void *)sip->sip_via);
+
+
+			exp = (long) time(NULL) + (sip->sip_expires ? sip->sip_expires->ex_delta : 60);
+
+
+			if ((sql = switch_core_db_mprintf("delete from sip_subscriptions where "
+											  "proto='%q' and user='%q' and host='%q' and sub_to_user='%q' and sub_to_host='%q' and event='%q';\n"
+											  "insert into sip_subscriptions values ('%q','%q','%q','%q','%q','%q','%q','%q','%q','%q',%ld)",
+											  proto,
+											  from_user,
+											  from_host,
+											  to_user,
+											  to_host,
+											  event,
+											  proto,
+											  from_user,
+											  from_host,
+											  to_user,
+											  to_host,
+											  event,
+											  contact_str,
+											  call_id,
+											  full_from,
+											  full_via,
+											  exp
+											  ))) {
+				execute_sql(profile->dbname, sql, profile->ireg_mutex);
+				switch_core_db_free(sql);
+			}
+
+			
+			nua_respond(nh, SIP_202_ACCEPTED,
+						SIPTAG_SUBSCRIPTION_STATE_STR("active;expires=3600"),
+						SIPTAG_FROM(sip->sip_to),
+						SIPTAG_TO(sip->sip_from),
+						SIPTAG_CONTACT_STR(to_str),
+						TAG_END());
+
+
+		end:
+			
+			if (event) {
+				su_free(profile->home, event);
+			}
+			if (call_id) {
+				su_free(profile->home, call_id);
+			}
+			if (full_from) {
+				su_free(profile->home, full_from);
+			}
+			if (full_via) {
+				su_free(profile->home, full_via);
+			}
+
+			switch_safe_free(d_user);
+			switch_safe_free(to_str);
+			switch_safe_free(contact_str);
+		}
+}
+
+static void sip_r_subscribe(int status,
+						char const *phrase, 
+						nua_t *nua,
+						sofia_profile_t *profile,
+						nua_handle_t *nh,
+						sofia_private_t *sofia_private,
+						sip_t const *sip,
+						tagi_t tags[])
+{
+
+}
+
+
 /*---------------------------------------*/
 static void sip_i_refer(nua_t *nua,
 						sofia_profile_t *profile,
@@ -2661,6 +3292,93 @@
 
 }
 
+
+static void sip_i_publish(nua_t *nua, 
+						  sofia_profile_t *profile,
+						  nua_handle_t *nh, 
+						  sofia_private_t *sofia_private,
+						  sip_t const *sip,
+						  tagi_t tags[])
+{
+	if (sip) {
+		sip_from_t const *from = sip->sip_from;
+		char *from_user = NULL;
+		char *from_host = NULL;
+		sip_payload_t *payload = sip->sip_payload;
+		char *event_type;
+
+		if (from) {
+			from_user = (char *) from->a_url->url_user;
+			from_host = (char *) from->a_url->url_host;
+		}
+
+		if (payload) {
+			switch_xml_t xml, note, person, tuple, status, basic;
+			switch_event_t *event;
+			uint8_t in = 0;
+
+			if ((xml = switch_xml_parse_str(payload->pl_data, strlen(payload->pl_data)))) {
+				char *status_txt = "", *note_txt = "";
+				
+				if ((tuple = switch_xml_child(xml, "tuple")) && (status = switch_xml_child(tuple, "status")) && (basic = switch_xml_child(status, "basic"))) {
+					status_txt = basic->txt;
+				}
+					
+				if ((person = switch_xml_child(xml, "dm:person")) && (note = switch_xml_child(person, "dm:note"))) {
+					note_txt = note->txt;
+				}
+
+				if (!strcasecmp(status_txt, "open")) {
+					if (switch_strlen_zero(note_txt)) {
+						note_txt = "Available";
+					}
+					in = 1;
+				} else if (!strcasecmp(status_txt, "closed")) {
+					if (switch_strlen_zero(note_txt)) {
+						note_txt = "Unavailable";
+					}
+				}
+				
+				event_type = sip_header_as_string(profile->home, (void *)sip->sip_event);
+
+				if (in) {
+					if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "sip");
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
+						
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", note_txt);
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "show", "%s", status_txt);
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "%s", event_type);
+						switch_event_fire(&event);
+					}
+				} else {
+					if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) {
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "sip");
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
+
+						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "%s", event_type);
+						switch_event_fire(&event);
+					}
+				}
+
+				if (event_type) {
+					su_free(profile->home, event_type);
+				}				
+
+				switch_xml_free(xml);
+			}
+			
+		}
+		
+	}
+
+	nua_respond(nh, SIP_200_OK, TAG_END());
+
+}
+
+
 static void sip_i_invite(nua_t *nua, 
 						 sofia_profile_t *profile,
 						 nua_handle_t *nh, 
@@ -2670,6 +3388,7 @@
 {
 	switch_core_session_t *session = sofia_private ? sofia_private->session : NULL;
 	char key[128] = "";
+	sip_unknown_t *un;
 
 
 	if (!session) {
@@ -2747,11 +3466,14 @@
 				return;
 			}
 
+
 			attach_private(session, profile, tech_pvt, username);
 
 			channel = switch_core_session_get_channel(session);
 			switch_channel_set_variable(channel, "endpoint_disposition", "INBOUND CALL");
+			set_chat_hash(tech_pvt, sip);
 			
+			
 			if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
 																	  (char *) from->a_url->url_user,
 																	  profile->dialplan,
@@ -2767,10 +3489,62 @@
 																	  (profile->pflags & PFLAG_FULL_ID) ? 
 																	  to_username : (char *) to_user
 																	  )) != 0) {
+
+				
+				for (un=sip->sip_unknown; un; un=un->un_next) {
+					// Loop thru Known Headers Here so we can do something with them
+					// John Doe <sip:+19018577141 at 209.247.16.1>;party=calling;screen=yes;privacy=off
+					if (!strncasecmp(un->un_name, "Remote-Party-ID", 15)) {
+						int argc, x, screen = 1;
+						char *mydata, *argv[10] = { 0 };
+						if (!switch_strlen_zero(un->un_value)) { 
+							if ((mydata = strdup(un->un_value))) {
+								argc = switch_separate_string(mydata, ';', argv, (sizeof(argv) / sizeof(argv[0]))); 
+
+								// Do We really need this at this time 
+								// clid_uri = argv[0];
+
+								for (x=1; x < argc && argv[x]; x++){
+									// we dont need to do anything with party yet we should only be seeing party=calling here anyway
+									// maybe thats a dangerous assumption bit oh well yell at me later
+									// if (!strncasecmp(argv[x], "party", 5)) {
+									//	party = argv[x];
+									// } else 
+									if (!strncasecmp(argv[x], "privacy=", 8)) {
+										char *arg = argv[x] + 9;
+
+										if(!strcasecmp(arg, "no")) {
+											switch_clear_flag(tech_pvt->caller_profile, SWITCH_CPF_HIDE_NAME);
+											switch_clear_flag(tech_pvt->caller_profile, SWITCH_CPF_HIDE_NUMBER);
+										} else if (!strcasecmp(arg, "yes")) {
+											switch_set_flag(tech_pvt->caller_profile, SWITCH_CPF_HIDE_NAME | SWITCH_CPF_HIDE_NUMBER);
+										} else if (!strcasecmp(arg, "full")) {
+											switch_set_flag(tech_pvt->caller_profile, SWITCH_CPF_HIDE_NAME | SWITCH_CPF_HIDE_NUMBER);
+										} else if (!strcasecmp(arg, "name")) {
+											switch_set_flag(tech_pvt->caller_profile, SWITCH_CPF_HIDE_NAME);
+										} else if (!strcasecmp(arg, "number")) {
+											switch_set_flag(tech_pvt->caller_profile, SWITCH_CPF_HIDE_NUMBER);
+										}
+									} else if (!strncasecmp(argv[x], "screen=", 7) && screen > 0) {
+										char *arg = argv[x] + 8;
+										if (!strcasecmp(arg, "no")) {
+											screen = 0;
+											switch_clear_flag(tech_pvt->caller_profile, SWITCH_CPF_SCREEN);
+										}
+									}
+								}
+								free(mydata);
+							}
+						}
+						break;
+					}
+				}
+
 				switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
 				switch_core_db_free(username);
 				switch_core_db_free(to_username);
 			}
+
 			switch_set_flag_locked(tech_pvt, TFLAG_INBOUND);
 			tech_pvt->sofia_private.session = session;
 			nua_handle_bind(nh, &tech_pvt->sofia_private);
@@ -2789,7 +3563,23 @@
 }
 
 
+static void sip_i_options(int status,
+						  char const *phrase,
+						  nua_t *nua,
+						  sofia_profile_t *profile,
+						  nua_handle_t *nh,
+						  sofia_private_t *sofia_private,
+						  sip_t const *sip,
+						  tagi_t tags[])
+{
+	nua_respond(nh, SIP_200_OK, 
+				//SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+				//SOATAG_AUDIO_AUX("cn telephone-event"),
+				//NUTAG_INCLUDE_EXTRA_SDP(1),
+				TAG_END());
+}
 
+
 static void sip_r_register(int status,
 						   char const *phrase,
 						   nua_t *nua,
@@ -2913,7 +3703,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
 			switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 			nua_respond(nh, SIP_401_UNAUTHORIZED, TAG_END());
-			return;
+			goto done;
 		}
 	}
 	
@@ -2939,6 +3729,10 @@
 		//sip_r_options(status, phrase, nua, profile, nh, sofia_private, sip, tags);
 		break;
 
+	case nua_i_options:
+		sip_i_options(status, phrase, nua, profile, nh, sofia_private, sip, tags);
+		break;
+
 	case nua_i_fork:
 		//sip_i_fork(status, phrase, nua, profile, nh, sofia_private, sip, tags);
 		break;
@@ -2947,6 +3741,10 @@
 		sip_i_invite(nua, profile, nh, sofia_private, sip, tags);
 		break;
 
+	case nua_i_publish:
+		sip_i_publish(nua, profile, nh, sofia_private, sip, tags);
+		break;
+
     case nua_i_register:
  		sip_i_register (nua, profile, nh, sofia_private, sip, tags);
         break;
@@ -2967,12 +3765,8 @@
 		//sip_i_bye(nua, profile, nh, sofia_private, sip, tags);
 		break;
 
-	case nua_r_message:
-		//sip_r_message(status, phrase, nua, profile, nh, sofia_private, sip, tags);
-		break;
-
 	case nua_i_message:
-		//sip_i_message(nua, profile, nh, sofia_private, sip, tags);
+		sip_i_message(status, phrase, nua, profile, nh, sofia_private, sip, tags);
 		break;
 
 	case nua_r_info:
@@ -2990,11 +3784,16 @@
 	case nua_i_refer:
 		sip_i_refer(nua, profile, nh, sofia_private, sip, tags);
 		break;
+
      
 	case nua_r_subscribe:
-		//sip_r_subscribe(status, phrase, nua, profile, nh, sofia_private, sip, tags);
+		sip_r_subscribe(status, phrase, nua, profile, nh, sofia_private, sip, tags);
 		break;
 
+	case nua_i_subscribe:
+		sip_i_subscribe(status, phrase, nua, profile, nh, sofia_private, sip, tags);
+		break;
+
 	case nua_r_unsubscribe:
 		//sip_r_unsubscribe(status, phrase, nua, profile, nh, sofia_private, sip, tags);
 		break;
@@ -3002,9 +3801,11 @@
 	case nua_r_publish:
 		//sip_r_publish(status, phrase, nua, profile, nh, sofia_private, sip, tags);
 		break;
-    
+	case nua_r_message:
 	case nua_r_notify:
-		//sip_r_notify(status, phrase, nua, profile, nh, sofia_private, sip, tags);
+		if (nh) {
+			nua_handle_destroy(nh);
+		}
 		break;
      
 	case nua_i_notify:
@@ -3031,11 +3832,12 @@
 		else
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s: unknown event %d\n", nua_event_name (event), event);
 	
-		//tl_print(stdout, "", tags);
 		break;
 
 	}
 
+ done:
+
 	if (session) {
 		switch_core_session_rwunlock(session);
 	}
@@ -3105,6 +3907,9 @@
 	switch_event_t *s_event;
 
 	profile->s_root = su_root_create(NULL);
+	profile->home = su_home_new(sizeof(*profile->home));
+	su_home_init(profile->home);
+
 	profile->nua = nua_create(profile->s_root, /* Event loop */
 							  event_callback, /* Callback for processing events */
 							  profile, /* Additional data to pass to callback */
@@ -3117,7 +3922,10 @@
 				   NUTAG_AUTOALERT(0),
 				   NUTAG_ALLOW("REGISTER"),
 				   NUTAG_ALLOW("REFER"),
+				   TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("PUBLISH")),
+				   TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ENABLEMESSAGE(1)),
 				   SIPTAG_SUPPORTED_STR("100rel, precondition"),
+				   SIPTAG_USER_AGENT_STR(SOFIA_USER_AGENT),
 				   TAG_END());
 				   
 
@@ -3129,18 +3937,23 @@
 							   TAG_END()); /* Last tag should always finish the sequence */
 
 		nua_set_params(node->nua,
-					   NUTAG_EARLY_MEDIA(1),
+				   NUTAG_EARLY_MEDIA(1),				   
 					   NUTAG_AUTOANSWER(0),
 					   NUTAG_AUTOALERT(0),
 					   NUTAG_ALLOW("REGISTER"),
+					   NUTAG_ALLOW("REFER"),
+					   TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("PUBLISH")),
+					   TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ENABLEMESSAGE(1)),
 					   SIPTAG_SUPPORTED_STR("100rel, precondition"),
+					   SIPTAG_USER_AGENT_STR(SOFIA_USER_AGENT),
 					   TAG_END());
 		
 	}
 
 
 	if ((db = switch_core_db_open_file(profile->dbname))) {
-		switch_core_db_test_reactive(db, "select * from sip_registrations", reg_sql);
+		switch_core_db_test_reactive(db, "select contact from sip_registrations", reg_sql);
+		switch_core_db_test_reactive(db, "select contact from sip_subscriptions", sub_sql);
 		switch_core_db_test_reactive(db, "select * from sip_authentication", auth_sql);
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open SQL Database!\n");
@@ -3151,10 +3964,6 @@
 	switch_mutex_init(&profile->ireg_mutex, SWITCH_MUTEX_NESTED, profile->pool);
 	switch_mutex_init(&profile->oreg_mutex, SWITCH_MUTEX_NESTED, profile->pool);
 
-	switch_mutex_lock(globals.mutex);
-	globals.running = 1;
-	switch_mutex_unlock(globals.mutex);
-
 	ireg_loops = IREG_SECONDS;
 	oreg_loops = OREG_SECONDS;
 
@@ -3164,6 +3973,37 @@
 		switch_event_fire(&s_event);
 	}
 
+	if (switch_event_create(&s_event, SWITCH_EVENT_PUBLISH) == SWITCH_STATUS_SUCCESS) {
+		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_sip._tcp");
+		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", profile->sip_port);
+		switch_event_fire(&s_event);
+	}
+
+	if (switch_event_create(&s_event, SWITCH_EVENT_PUBLISH) == SWITCH_STATUS_SUCCESS) {
+		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_sip._sctp");
+		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", profile->sip_port);
+		switch_event_fire(&s_event);
+	}
+
+	if (profile->pflags & PFLAG_PRESENCE) {
+		if (!(profile->presence = switch_core_alloc(profile->pool, sizeof(*profile->presence)))) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+			return NULL;
+		}
+
+		profile->presence->nh = nua_handle(profile->nua, NULL, SIPTAG_CONTACT_STR(profile->url), TAG_END());
+										   
+		profile->presence->sofia_private.presence = profile->presence;
+		nua_handle_bind(profile->presence->nh, &profile->presence->sofia_private);
+
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Creating presence for %s\n", profile->url);
+	}
+
+	switch_mutex_lock(globals.hash_mutex);
+	switch_core_hash_insert(globals.profile_hash, profile->name, profile);
+	switch_mutex_unlock(globals.hash_mutex);
+
+
 	while(globals.running == 1) {
 		if (++ireg_loops >= IREG_SECONDS) {
 			check_expire(profile, time(NULL));
@@ -3177,7 +4017,10 @@
 
 		su_root_step(profile->s_root, 1000);
 	}
+
+	su_home_deinit(profile->home);
 	
+
 	if (switch_event_create(&s_event, SWITCH_EVENT_UNPUBLISH) == SWITCH_STATUS_SUCCESS) {
 		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_sip._udp");
 		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", profile->sip_port);
@@ -3185,7 +4028,6 @@
 	}
 
 	su_root_destroy(profile->s_root);
-
 	pool = profile->pool;
 	switch_core_destroy_memory_pool(&pool);
 	switch_mutex_lock(globals.mutex);
@@ -3203,9 +4045,6 @@
 	switch_threadattr_create(&thd_attr, profile->pool);
 	switch_threadattr_detach_set(thd_attr, 1);
 	switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
-	switch_mutex_lock(globals.hash_mutex);
-	switch_core_hash_insert(globals.profile_hash, profile->name, profile);
-	switch_mutex_unlock(globals.hash_mutex);
 	switch_thread_create(&thread, thd_attr, profile_thread_run, profile, profile->pool);
 }
 
@@ -3219,12 +4058,28 @@
 	sofia_profile_t *profile = NULL;
 	char url[512] = "";
 
+	switch_mutex_lock(globals.mutex);
+	globals.running = 1;
+	switch_mutex_unlock(globals.mutex);
+
 	if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
 		status = SWITCH_STATUS_FALSE;
 		goto done;
 	}
 
+	if ((settings = switch_xml_child(cfg, "global_settings"))) {
+		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
+			if (!strcasecmp(var, "log-level")) {
+				su_log_set_level(NULL, atoi(val));
+			} else if (!strcasecmp(var, "log-level-trace")) {
+				su_log_set_level(tport_log, atoi(val));
+			}
+		}
+	}
+
 	if ((profiles = switch_xml_child(cfg, "profiles"))) {
 		for (xprofile = switch_xml_child(profiles, "profile"); xprofile; xprofile = xprofile->next) {
 			if (!(settings = switch_xml_child(xprofile, "settings"))) {
@@ -3254,6 +4109,7 @@
 				profile->name = switch_core_strdup(profile->pool, xprofilename);
 				snprintf(url, sizeof(url), "sofia_reg_%s", xprofilename);
 				profile->dbname = switch_core_strdup(profile->pool, url);
+				switch_core_hash_init(&profile->chat_hash, profile->pool);
 
 				profile->dtmf_duration = 100;		
 				profile->codec_ms = 20;
@@ -3291,6 +4147,10 @@
 						profile->sipdomain = switch_core_strdup(profile->pool, val);
 					} else if (!strcasecmp(var, "rtp-timer-name")) {
 						profile->timer_name = switch_core_strdup(profile->pool, val);
+					} else if (!strcasecmp(var, "manage-presence")) {
+						if (switch_true(val)) {
+							profile->pflags |= PFLAG_PRESENCE;
+						}
 					} else if (!strcasecmp(var, "auth-calls")) {
 						if (switch_true(val)) {
 							profile->pflags |= PFLAG_AUTH_CALLS;
@@ -3369,7 +4229,7 @@
 					profile->sipdomain = switch_core_strdup(profile->pool, profile->sipip);
 				}
 
-				snprintf(url, sizeof(url), "sip:%s@%s:%d", profile->name, profile->sipip, profile->sip_port);
+				snprintf(url, sizeof(url), "sip:mod_sofia@%s:%d", profile->sipip, profile->sip_port);
 				profile->url = switch_core_strdup(profile->pool, url);
 			}
 			if (profile) {
@@ -3443,6 +4303,7 @@
 							}
 							oreg->next = profile->registrations;
 							profile->registrations = oreg;
+
 						}
 					}
 				}
@@ -3469,8 +4330,7 @@
 	if ((subclass = switch_event_get_header(event, "orig-event-subclass")) && !strcasecmp(subclass, MY_EVENT_REGISTER)) {
 		char *from_user = switch_event_get_header(event, "orig-from-user");
 		char *from_host = switch_event_get_header(event, "orig-from-host");
-		char *contact_user = switch_event_get_header(event, "orig-contact-user");
-		char *contact_host = switch_event_get_header(event, "orig-contact-host");
+		char *contact_str = switch_event_get_header(event, "orig-contact");
 		char *exp_str = switch_event_get_header(event, "orig-expires");
 		long expires = (long)time(NULL) + atol(exp_str);
 		char *profile_name = switch_event_get_header(event, "orig-profile-name");
@@ -3484,16 +4344,14 @@
 
 
 		if (!find_reg_url(profile, from_user, from_host, buf, sizeof(buf))) {
-			sql = switch_core_db_mprintf("insert into sip_registrations values ('%q','%q','sip:%q@%q',%ld)", 
+			sql = switch_core_db_mprintf("insert into sip_registrations values ('%q','%q','%q',%ld)", 
 										 from_user,
 										 from_host,
-										 contact_user,
-										 contact_host,
+										 contact_str,
 										 expires);
 		} else {
-			sql = switch_core_db_mprintf("update sip_registrations set contact='sip:%q@%q', expires=%ld where user='%q' and host='%q'",
-										 contact_user,
-										 contact_host,
+			sql = switch_core_db_mprintf("update sip_registrations set contact='%q', expires=%ld where user='%q' and host='%q'",
+										 contact_str,
 										 expires,
 										 from_user,
 										 from_host);
@@ -3504,15 +4362,272 @@
 			execute_sql(profile->dbname, sql, profile->ireg_mutex);
 			switch_core_db_free(sql);
 			sql = NULL;
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Propagating registration for %s@%s->%s@%s\n", 
-							  from_user, from_host, contact_user, contact_host);
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Propagating registration for %s@%s->%s\n", 
+							  from_user, from_host, contact_str);
 
 		}
 
 	}
 }
 
+static int sub_callback(void *pArg, int argc, char **argv, char **columnNames){
+	sofia_profile_t *profile = (sofia_profile_t *) pArg;
+	char *pl;
+	char *id, *note;
+	uint32_t in = atoi(argv[0]);
+	char *msg = argv[1];
+	char *proto = argv[2];
+	char *user = argv[3];
+	char *host = argv[4];
+	char *sub_to_user = argv[5];
+	char *sub_to_host = argv[6];
+	char *event = argv[7];
+	char *contact = argv[8];
+	char *callid = argv[9];
+	char *full_from = argv[10];
+	char *full_via = argv[11];
+	nua_handle_t *nh;
+	char *doing;
+	char *to;
+	char *open;
+	
 
+	if (in) {
+		note = switch_core_db_mprintf("<dm:note>%s</dm:note>", msg);
+		doing="available";
+		open = "open";
+	} else {
+		note = NULL;
+		doing="unavailable";
+		open = "closed";
+	}
+
+	if (strcasecmp(proto, "sip")) {
+		/*encapsulate*/
+		id = switch_core_db_mprintf("sip:%s+%s+%s@%s", proto, sub_to_user, sub_to_host, host);
+	} else {
+		id = switch_core_db_mprintf("sip:%s@%s", sub_to_user, sub_to_host);
+	}
+
+	to = switch_core_db_mprintf("sip:%s@%s", user, host);
+	pl = switch_core_db_mprintf("<?xml version='1.0' encoding='UTF-8'?>\r\n"
+								"<presence xmlns='urn:ietf:params:xml:ns:pidf'\r\n"
+								"xmlns:dm='urn:ietf:params:xml:ns:pidf:data-model'\r\n"
+								"xmlns:rpid='urn:ietf:params:xml:ns:pidf:rpid'\r\n"
+								"xmlns:c='urn:ietf:params:xml:ns:pidf:cipid'\r\n"
+								"entity='pres:%s'>\r\n"
+								"<tuple id='t6a5ed77e'>\r\n"
+								"<status>\r\n"
+								"<basic>%s</basic>\r\n"
+								"</status>\r\n"
+								"</tuple>\r\n"
+								"<dm:person id='p06360c4a'>\r\n"
+								"<rpid:activities>\r\n"
+								"<rpid:%s/>\r\n"
+								"<rpid:unknown/>\r\n"
+								"</rpid:activities>%s</dm:person>\r\n"
+								"</presence>", id, open, doing, note);
+
+	nh = nua_handle(profile->nua, NULL,	TAG_END());
+					
+		
+	nua_notify(nh,
+			   NUTAG_URL(contact),
+			   SIPTAG_TO_STR(full_from),
+			   SIPTAG_FROM_STR(to),
+			   SIPTAG_CONTACT_STR(profile->url),
+			   SIPTAG_CALL_ID_STR(callid),
+			   SIPTAG_VIA_STR(full_via),
+			   SIPTAG_SUBSCRIPTION_STATE_STR("active;expires=3600"),
+			   SIPTAG_EVENT_STR(event),
+			   SIPTAG_CONTENT_TYPE_STR("application/pidf+xml"),
+			   SIPTAG_PAYLOAD_STR(pl),
+			   TAG_END());
+
+	switch_safe_free(id);
+	switch_safe_free(note);
+	switch_safe_free(pl);
+	switch_safe_free(to);
+
+	return 0;
+}
+
+static void chat_event_handler(switch_event_t *event)
+{
+	char *from = switch_event_get_header(event, "from");
+	char *to = switch_event_get_header(event, "to");
+	char *body = switch_event_get_body(event);
+	char buf[256];
+	char *user, *host;
+	sofia_profile_t *profile;
+	char *from_p = NULL, *from_pp = NULL;
+
+	if (event->key == SIP_KEY) {
+		return;
+	}
+
+	if (to && (user = strdup(to))) {
+		if ((host = strchr(user, '@'))) {
+			*host++ = '\0';
+		}
+
+		if (!host || !(profile = (sofia_profile_t *) switch_core_hash_find(globals.profile_hash, host))) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Profile %s\n", host ? host : "NULL");
+			return;
+		}
+
+		if (find_reg_url(profile, user, host, buf, sizeof(buf))) {
+			nua_handle_t *msg_nh;
+
+			if ((from_p = encode_name(from))) {
+				from_pp = switch_core_db_mprintf("\"%s\" <sip:%s@%s>", from, from_p, host);
+				from = from_pp;
+			}
+
+			msg_nh = nua_handle(profile->nua, NULL,
+								SIPTAG_FROM_STR(from),
+								NUTAG_URL(buf),
+								SIPTAG_TO_STR(buf),
+								SIPTAG_CONTACT_STR(profile->url),
+								TAG_END());
+
+
+			nua_message(msg_nh,
+						SIPTAG_CONTENT_TYPE_STR("text/html"),
+						SIPTAG_PAYLOAD_STR(body),
+						TAG_END());
+				
+		}
+		switch_safe_free(from_p);
+		switch_safe_free(from_pp);
+		free(user);
+	}
+		
+
+}
+
+static void pres_event_handler(switch_event_t *event)
+{
+	sofia_profile_t *profile;
+	switch_hash_index_t *hi;
+    void *val;
+	char *from = switch_event_get_header(event, "from");
+	char *status= switch_event_get_header(event, "status");
+	char *show= switch_event_get_header(event, "show");
+	char *event_type = switch_event_get_header(event, "event_type");
+	char *sql = NULL;
+	char *user = NULL, *host = NULL;
+	char *errmsg;
+	char *resource;
+	switch_core_db_t *db;
+
+	if (event->key == SIP_KEY) {
+		return;
+	}
+
+	if (event->event_id == SWITCH_EVENT_ROSTER) {
+		sql = switch_core_db_mprintf("select 1,'%q',* from sip_subscriptions where event='presence'", status ? status : "Available");
+
+		for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+			switch_hash_this(hi, NULL, NULL, &val);
+			profile = (sofia_profile_t *) val;
+			if (!(profile->pflags & PFLAG_PRESENCE)) {
+				continue;
+			}
+
+			if (sql) {
+				if (!(db = switch_core_db_open_file(profile->dbname))) {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB %s\n", profile->dbname);
+					continue;
+				}
+				switch_mutex_lock(profile->ireg_mutex);
+				switch_core_db_exec(db, sql, sub_callback, profile, &errmsg);
+				switch_mutex_unlock(profile->ireg_mutex);
+				switch_core_db_close(db);
+			}
+
+		}
+
+		return;
+	}
+
+	if (status && !strcasecmp(status, "n/a")) {
+		status = show;
+		if (status && !strcasecmp(status, "n/a")) {
+			status = NULL;
+		}
+	}
+
+	if (switch_strlen_zero(event_type)) {
+		event_type="presence";
+	}
+
+	if ((user = strdup(from))) {
+		if ((host = strchr(user, '@'))) {
+			*host++ = '\0';
+		}
+		if ((resource = strchr(host, '/'))) {
+			*resource++ = '\0';
+		}
+	} else {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
+		return;
+	}
+
+
+
+	if (!host) {
+		switch_safe_free(user);
+		return;
+	}
+	
+
+
+	switch(event->event_id) {
+	case SWITCH_EVENT_PRESENCE_IN:
+		if (!status) {
+			status = "Available";
+		}
+
+		sql = switch_core_db_mprintf("select 1,'%q',* from sip_subscriptions where event='%q' and sub_to_user='%q' and sub_to_host='%q'", 
+									 status , event_type, user, host);
+		break;
+	case SWITCH_EVENT_PRESENCE_OUT:
+		if (!status) {
+			status = "Unavailable";
+		}
+		sql = switch_core_db_mprintf("select 0,'%q',* from sip_subscriptions where event='%q' and sub_to_user='%q' and sub_to_host='%q'", 
+									 status, event_type, user, host);
+		break;
+	default:
+		break;
+	}
+
+    for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+        switch_hash_this(hi, NULL, NULL, &val);
+        profile = (sofia_profile_t *) val;
+        if (!(profile->pflags & PFLAG_PRESENCE)) {
+			continue;
+        }
+
+		if (sql) {
+			if (!(db = switch_core_db_open_file(profile->dbname))) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB %s\n", profile->dbname);
+				continue;
+			}
+			switch_mutex_lock(profile->ireg_mutex);
+			switch_core_db_exec(db, sql, sub_callback, profile, &errmsg);
+			switch_mutex_unlock(profile->ireg_mutex);
+			switch_core_db_close(db);
+		}
+
+	}
+
+	switch_safe_free(user);
+	switch_safe_free(sql);
+}
+
+
 SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
 {
 
@@ -3531,13 +4646,33 @@
 	}
 
 	su_init();
+	su_log_redirect(NULL, logger, NULL);
+	su_log_redirect(tport_log, logger, NULL);
 
-
 	switch_core_hash_init(&globals.profile_hash, module_pool);
 	switch_mutex_init(&globals.hash_mutex, SWITCH_MUTEX_NESTED, module_pool);
 
 	config_sofia(0);
 
+	if (switch_event_bind((char *) modname, SWITCH_EVENT_MESSAGE, SWITCH_EVENT_SUBCLASS_ANY, chat_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+		return SWITCH_STATUS_GENERR;
+	}
+
+	if (switch_event_bind((char *) modname, SWITCH_EVENT_PRESENCE_IN, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+		return SWITCH_STATUS_GENERR;
+	}
+
+	if (switch_event_bind((char *) modname, SWITCH_EVENT_PRESENCE_OUT, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+		return SWITCH_STATUS_GENERR;
+	}
+
+	if (switch_event_bind((char *) modname, SWITCH_EVENT_ROSTER, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+		return SWITCH_STATUS_GENERR;
+	}
 
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &sofia_module_interface;

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.vcproj
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.vcproj	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.vcproj	Wed Oct 18 23:32:52 2006
@@ -42,7 +42,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\bnf&quot;"
+				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\bnf&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -126,7 +126,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.2\libsofia-sip-ua\bnf&quot;"
+				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip-1.12.3.4\libsofia-sip-ua\bnf&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	Wed Oct 18 23:32:52 2006
@@ -346,7 +346,7 @@
 	}
 
 	if (switch_core_codec_init
-		(&tech_pvt->read_codec, "L16", rate, 20, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
+		(&tech_pvt->read_codec, "L16", NULL, rate, 20, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
 		 switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Cannot set read codec\n", switch_channel_get_name(channel));
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
@@ -354,7 +354,7 @@
 	}
 
 	if (switch_core_codec_init
-		(&tech_pvt->write_codec, "L16", rate, 20, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
+		(&tech_pvt->write_codec, "L16", NULL, rate, 20, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
 		 switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Cannot set read codec\n", switch_channel_get_name(channel));
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
@@ -1211,7 +1211,7 @@
 
 	if ((session = switch_core_session_request(&wanpipe_endpoint_interface, NULL))) {
 		struct private_object *tech_pvt;
-		char ani2str[4] = "";
+		char aniiistr[4] = "";
 		//wanpipe_tdm_api_t tdm_api;
 
 		switch_core_session_add_stream(session, NULL);
@@ -1229,8 +1229,8 @@
 			return 0;
 		}
 
-		if (event->ring.ani2 >= 0) {
-			snprintf(ani2str, 5, "%.2d", event->ring.ani2);
+		if (event->ring.aniii >= 0) {
+			snprintf(aniiistr, 5, "%.2d", event->ring.aniii);
 		}
 
 		if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
@@ -1239,7 +1239,7 @@
 																  "FreeSWITCH",
 																  event->ring.callingnum,
 																  event->ring.callingani,
-																  switch_strlen_zero(ani2str) ? NULL : ani2str,
+																  switch_strlen_zero(aniiistr) ? NULL : aniiistr,
 																  NULL,
 																  NULL,
 																  (char *)modname,

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_woomera/mod_woomera.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_woomera/mod_woomera.c	Wed Oct 18 23:32:52 2006
@@ -211,7 +211,7 @@
 	tech_pvt->frame.data = tech_pvt->databuf;
 
 	if (switch_core_codec_init
-		(&tech_pvt->read_codec, "L16", rate, 30, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
+		(&tech_pvt->read_codec, "L16", NULL, rate, 30, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
 		 switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Cannot set read codec\n", switch_channel_get_name(channel));
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
@@ -219,7 +219,7 @@
 	}
 
 	if (switch_core_codec_init
-		(&tech_pvt->write_codec, "L16", rate, 30, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
+		(&tech_pvt->write_codec, "L16", NULL, rate, 30, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
 		 switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Cannot set read codec\n", switch_channel_get_name(channel));
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/README
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/README	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/README	Wed Oct 18 23:32:52 2006
@@ -85,6 +85,9 @@
 Q: What would an example configuration look like?
 A: Here is an excerpt from the freeswitch XML configuration file:
 
+Q: What happened to the ani2 field?
+A: Oops, you caught us.  The real name for is it aniii.  You will need to update any database schemas or external handlers for this change.
+
 	<configuration name="mod_cdr.conf" description="CDR Configuration">
 		<pddcdr>
 			<param name="path" value="/work/temp/pddcdr"/>

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.cpp	Wed Oct 18 23:32:52 2006
@@ -73,7 +73,7 @@
 		memset(dstchannel,0,80);
 		memset(network_addr,0,40);
 		memset(ani,0,80);
-		memset(ani2,0,80);
+		memset(aniii,0,80);
 		memset(lastapp,0,80);
 		memset(lastdata,0,255);
 
@@ -82,62 +82,60 @@
 		callanswerdate = newchannel->timetable->answered;
 		callenddate = newchannel->timetable->hungup;
 	
-		if (newchannel->callerprofile) 
-		{
+		if (newchannel->callerprofile) {
 			if(newchannel->callerprofile->caller_id_name != 0)
 			{
-				strncpy(clid,newchannel->callerprofile->caller_id_name,sizeof(clid));
-				//strncat(clid," <",2);
-				//if(newchannel->callerprofile->caller_id_number != 0 )
-				//	strncat(clid,newchannel->callerprofile->caller_id_number,79-(strlen(clid)+strlen(newchannel->callerprofile->caller_id_number)));
-				//strncat(clid,">",1);
+				strncpy(clid,newchannel->callerprofile->caller_id_name,strlen(newchannel->callerprofile->caller_id_name));
+				strncat(clid," <",2);
+				if(newchannel->callerprofile->caller_id_number != 0 )
+					strncat(clid,newchannel->callerprofile->caller_id_number,strlen(clid)+strlen(newchannel->callerprofile->caller_id_number));
+				strncat(clid,">",1);
 			}
 			
 			// Get the ANI information if it's set
 			if(newchannel->callerprofile->ani != 0)
-				strncpy(ani,newchannel->callerprofile->ani,sizeof(ani));
-			if(newchannel->callerprofile->ani2 != 0)
-				strncpy(ani2,newchannel->callerprofile->ani2,sizeof(ani2));
+				strncpy(ani,newchannel->callerprofile->ani,strlen(newchannel->callerprofile->ani));
+			if(newchannel->callerprofile->aniii != 0)
+				strncpy(aniii,newchannel->callerprofile->aniii,strlen(newchannel->callerprofile->aniii));
 		
 			if(newchannel->callerprofile->dialplan != 0)
-				strncpy(dialplan,newchannel->callerprofile->dialplan,sizeof(dialplan));
+				strncpy(dialplan,newchannel->callerprofile->dialplan,strlen(newchannel->callerprofile->dialplan));
 		
 			if(newchannel->callerprofile->network_addr != 0)
-				strncpy(network_addr,newchannel->callerprofile->network_addr,sizeof(network_addr));
+				strncpy(network_addr,newchannel->callerprofile->network_addr,strlen(newchannel->callerprofile->network_addr));
 		}
 
 		originated = newchannel->originate;
 	
 		if(newchannel->originateprofile && newchannel->originateprofile->uuid != 0)
-			strncpy(destuuid,newchannel->originateprofile->uuid,sizeof(destuuid));
+			strncpy(destuuid,newchannel->originateprofile->uuid,strlen(newchannel->originateprofile->uuid));
 	
 		// We still need to check if this is originated or not
 		if(originated == 0)
 		{
-			if (newchannel->callerprofile) 
-			{
+			if (newchannel->callerprofile) {
 				if(newchannel->callerprofile->destination_number != 0)
-					strncpy(src,newchannel->callerprofile->destination_number,sizeof(src));
+					strncpy(src,newchannel->callerprofile->destination_number,strlen(newchannel->callerprofile->destination_number));
 				if(newchannel->callerprofile->caller_id_number != 0)
-					strncpy(dst,newchannel->callerprofile->caller_id_number,sizeof(dst));
+					strncpy(dst,newchannel->callerprofile->caller_id_number,strlen(newchannel->callerprofile->caller_id_number));
 			}
 			if(newchannel->originateprofile && newchannel->originateprofile->chan_name != 0)
-				strncpy(dstchannel,newchannel->originateprofile->chan_name,sizeof(dstchannel));
+				strncpy(dstchannel,newchannel->originateprofile->chan_name,strlen(newchannel->originateprofile->chan_name));
 		}
 		else
 		{
 			if (newchannel->callerprofile) {
 				if(newchannel->callerprofile->caller_id_number != 0)
-					strncpy(src,newchannel->callerprofile->caller_id_number,sizeof(src));
+					strncpy(src,newchannel->callerprofile->caller_id_number,strlen(newchannel->callerprofile->caller_id_number));
 				if(newchannel->callerprofile->destination_number != 0)
-					strncpy(dst,newchannel->callerprofile->destination_number,sizeof(dst));
+					strncpy(dst,newchannel->callerprofile->destination_number,strlen(newchannel->callerprofile->destination_number));
 			}
 			if(newchannel->originateprofile && newchannel->originateprofile->chan_name != 0)
-				strncpy(dstchannel,newchannel->originateprofile->chan_name,sizeof(dstchannel));
+				strncpy(dstchannel,newchannel->originateprofile->chan_name,strlen(newchannel->originateprofile->chan_name));
 		}
 		
-		strncpy(myuuid,newchannel->callerprofile->uuid,sizeof(myuuid));
-		strncpy(srcchannel,newchannel->callerprofile->chan_name,sizeof(srcchannel));
+		strncpy(myuuid,newchannel->callerprofile->uuid,strlen(newchannel->callerprofile->uuid));
+		strncpy(srcchannel,newchannel->callerprofile->chan_name,strlen(newchannel->callerprofile->chan_name));
 		
 		if(switch_channel_test_flag(newchannel->channel,CF_ANSWERED))
 		{
@@ -158,9 +156,9 @@
 			if(newchannel->callerextension->last_application != 0)
 			{
 				if(newchannel->callerextension->last_application->application_name != 0)
-					strncpy(lastapp,newchannel->callerextension->last_application->application_name,sizeof(lastapp));
+					strncpy(lastapp,newchannel->callerextension->last_application->application_name,strlen(newchannel->callerextension->last_application->application_name));
 				if(newchannel->callerextension->last_application->application_data != 0)
-					strncpy(lastdata,newchannel->callerextension->last_application->application_data,sizeof(lastdata));
+					strncpy(lastdata,newchannel->callerextension->last_application->application_data,strlen(newchannel->callerextension->last_application->application_data));
 			}
 		
 		amaflags=0;

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.h	Wed Oct 18 23:32:52 2006
@@ -90,7 +90,7 @@
 		char srcchannel[80];
 		char dstchannel[80];
 		char ani[80];
-		char ani2[80];
+		char aniii[80];
 		char network_addr[40];
 		char lastapp[80];
 		char lastdata[255]; 

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.cpp	Wed Oct 18 23:32:52 2006
@@ -234,7 +234,7 @@
 	outputfile << srcchannel << "\",\"";
 	outputfile << dstchannel << "\",\"";
 	outputfile << ani << "\",\"";
-	outputfile << ani2 << "\",\"";
+	outputfile << aniii << "\",\"";
 	outputfile << network_addr << "\",\"";
 	outputfile << lastapp << "\",\"";
 	outputfile << lastdata << "\",\"";

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h	Wed Oct 18 23:32:52 2006
@@ -88,7 +88,7 @@
 		long unsigned int srcchannel_length;
 		long unsigned int dstchannel_length;
 		long unsigned int ani_length;
-		long unsigned int ani2_length;
+		long unsigned int aniii_length;
 		long unsigned int lastapp_length;
 		long unsigned int lastdata_length;
 		// Now a couple internal methods

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp	Wed Oct 18 23:32:52 2006
@@ -115,7 +115,7 @@
 			if (!strcmp(var, "dsn"))
 			{
 				strncpy(dsn,val,strlen(val));
-				//count_config_params++;
+				count_config_params+=4;
 			}
 			else if (!strcmp(var, "hostname"))
 			{
@@ -196,7 +196,7 @@
 				strncpy(tablename_chanvars,"chanvars",8);
 		}
 		
-		if (count_config_params==5)
+		if (count_config_params==4)
 			activated = 1;
 		else
 			switch_console_printf(SWITCH_CHANNEL_LOG,"You did not specify the minimum parameters for using this module.  You must specify a DSN,hostname, username, password, and database to use OdbcCDR.  You only supplied %d parameters.\n",count_config_params);
@@ -205,7 +205,7 @@
 		{
 			tmp_sql_query = "INSERT INTO ";
 			tmp_sql_query.append(tablename);
-			tmp_sql_query.append(" (callstartdate,callanswerdate,callenddate,originated,clid,src,dst,ani,ani2,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags");
+			tmp_sql_query.append(" (callstartdate,callanswerdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags");
 			
 			int items_appended = 0;
 			
@@ -398,7 +398,7 @@
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(src), 0, src, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(dst), 0, dst, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(ani), 0, ani, 0, 0);
-	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(ani2), 0, ani2, 0, 0);
+	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(aniii), 0, aniii, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(dialplan), 0, dialplan, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, sizeof(myuuid), 0, myuuid, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, sizeof(destuuid), 0, destuuid, 0, 0);

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.cpp	Wed Oct 18 23:32:52 2006
@@ -170,7 +170,7 @@
 		outputfile << "\t\'srcchannel\' = \'" << srcchannel << "\'," << std::endl;
 		outputfile << "\t\'dstchannel\' = \'" << dstchannel << "\'," << std::endl;
 		outputfile << "\t\'ani\' = \'" << ani << "\'," << std::endl;
-		outputfile << "\t\'ani2\' = \'" << ani2 << "\'," << std::endl;
+		outputfile << "\t\'aniii\' = \'" << aniii << "\'," << std::endl;
 		outputfile << "\t\'network_addr\' = \'" << network_addr << "\'," << std::endl;
 		outputfile << "\t\'lastapp\' = \'" << lastapp << "\'," << std::endl;
 		outputfile << "\t\'lastdata\' = \'" << lastdata << "\'," << std::endl;

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/schema.sql
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/schema.sql	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/schema.sql	Wed Oct 18 23:32:52 2006
@@ -8,7 +8,7 @@
 	src varchar(80) NOT NULL,
 	dst varchar(80) NOT NULL,
 	ani varchar(80) default "",
-	ani2 varchar(80) default "",
+	aniii varchar(80) default "",
 	dialplan varchar(80) default "",
 	myuuid char(36) NOT NULL,
 	destuuid char(36) NOT NULL,
@@ -31,4 +31,4 @@
 	varvalue varchar(255) default ""
 );
 
-create index callid_index on chanvars(callid,varname);
\ No newline at end of file
+create index callid_index on chanvars(callid,varname);

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp	Wed Oct 18 23:32:52 2006
@@ -138,7 +138,7 @@
 		
 		if(activated)
 		{
-			tmp_sql_query = "INSERT INTO freeswitchcdr  (callstartdate,callanswerdate,callenddate,originated,clid,src,dst,ani,ani2,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags";
+			tmp_sql_query = "INSERT INTO freeswitchcdr  (callstartdate,callanswerdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags";
 			
 			int items_appended = 0;
 			

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.cpp	Wed Oct 18 23:32:52 2006
@@ -173,7 +173,7 @@
 		outputfile << "\t<srcchannel data=\"" << srcchannel << "\" />" << std::endl;
 		outputfile << "\t<dstchannel data=\"" << dstchannel << "\" />" << std::endl;
 		outputfile << "\t<ani data=\"" << ani << "\" />" << std::endl;
-		outputfile << "\t<ani2 data=\"" << ani2 << "\" />" << std::endl;
+		outputfile << "\t<aniii data=\"" << aniii << "\" />" << std::endl;
 		outputfile << "\t<network_addr data=\"" << network_addr << "\" />" << std::endl;
 		outputfile << "\t<lastapp data=\"" << lastapp << "\" />" << std::endl;
 		outputfile << "\t<lastdata data=\"" << lastdata << "\" />" << std::endl;

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Wed Oct 18 23:32:52 2006
@@ -327,9 +327,9 @@
 
 					if (data) {
 						snprintf(buf, sizeof(buf), "Content-Type: log/data\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", strlen(data));
-						len = strlen(buf) + 1;
+						len = strlen(buf);
 						switch_socket_send(listener->sock, buf, &len);
-						len = strlen(data) + 1;
+						len = strlen(data);
 						switch_socket_send(listener->sock, data, &len);
 					
 						free(data);
@@ -367,16 +367,16 @@
 						}
 					}
 			
-					len = strlen(packet) + 1;
+					len = strlen(packet);
 
 					snprintf(hbuf, sizeof(hbuf), "Content-Length: %"APR_SSIZE_T_FMT"\n" 
 							 "Content-Type: text/event-%s\n"
 							 "\n", len, etype);
 
-					len = strlen(hbuf) + 1;
+					len = strlen(hbuf);
 					switch_socket_send(listener->sock, hbuf, &len);
 
-					len = strlen(packet) + 1;
+					len = strlen(packet);
 					switch_socket_send(listener->sock, packet, &len);
 
 					if (xmlstr) {
@@ -430,11 +430,11 @@
 			} else {
 				switch_size_t len;
 				char buf[1024];
-				len = strlen(stream.data) + 1;			
+				len = strlen(stream.data);			
 				snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", len);
-				len = strlen(buf) + 1;
+				len = strlen(buf);
 				switch_socket_send(acs->listener->sock, buf, &len);
-				len = strlen(stream.data) + 1;
+				len = strlen(stream.data);
 				switch_socket_send(acs->listener->sock, stream.data, &len);
 			}
 		}
@@ -781,7 +781,7 @@
 
 	snprintf(buf, sizeof(buf), "Content-Type: auth/request\n\n");
 		
-	len = strlen(buf) + 1;
+	len = strlen(buf);
 	switch_socket_send(listener->sock, buf, &len);
 		
 
@@ -800,7 +800,7 @@
 		}
 		if (!switch_strlen_zero(reply)) {
 			snprintf(buf, sizeof(buf), "Content-Type: command/reply\nReply-Text: %s\n\n", reply);
-			len = strlen(buf) + 1;
+			len = strlen(buf);
 			switch_socket_send(listener->sock, buf, &len);
 		}
 		break;
@@ -830,7 +830,7 @@
 
 		if (!switch_strlen_zero(reply)) {
 			snprintf(buf, sizeof(buf), "Content-Type: command/reply\nReply-Text: %s\n\n", reply);
-			len = strlen(buf) + 1;
+			len = strlen(buf);
 			switch_socket_send(listener->sock, buf, &len);
 		}
 			

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Wed Oct 18 23:32:52 2006
@@ -1235,7 +1235,7 @@
 /*********************************************************************************/
 enum session_tinyid {
 	SESSION_NAME, SESSION_STATE,
-	PROFILE_DIALPLAN, PROFILE_CID_NAME, PROFILE_CID_NUM, PROFILE_IP, PROFILE_ANI, PROFILE_ANI2, PROFILE_DEST
+	PROFILE_DIALPLAN, PROFILE_CID_NAME, PROFILE_CID_NUM, PROFILE_IP, PROFILE_ANI, PROFILE_ANI_II, PROFILE_DEST
 };
 
 static JSFunctionSpec session_methods[] = {
@@ -1266,7 +1266,7 @@
 	{"caller_id_num", PROFILE_CID_NUM, JSPROP_READONLY|JSPROP_PERMANENT}, 
 	{"network_addr", PROFILE_IP, JSPROP_READONLY|JSPROP_PERMANENT}, 
 	{"ani", PROFILE_ANI, JSPROP_READONLY|JSPROP_PERMANENT}, 
-	{"ani2", PROFILE_ANI2, JSPROP_READONLY|JSPROP_PERMANENT}, 
+	{"aniii", PROFILE_ANI_II, JSPROP_READONLY|JSPROP_PERMANENT}, 
 	{"destination", PROFILE_DEST, JSPROP_READONLY|JSPROP_PERMANENT}, 
 	{0}
 };
@@ -1325,9 +1325,9 @@
 			*vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, caller_profile->ani));
 		}
 		break;
-	case PROFILE_ANI2:
+	case PROFILE_ANI_II:
 		if (caller_profile) {
-			*vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, caller_profile->ani2));
+			*vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, caller_profile->aniii));
 		}
 		break;
 	case PROFILE_DEST:
@@ -1402,7 +1402,7 @@
 		char *cid_num = "";
 		char *network_addr = "";
 		char *ani = "";
-		char *ani2 = "";
+		char *aniii = "";
 		char *rdnis = "";
 		char *context = "";
 		char *username = NULL;
@@ -1442,7 +1442,7 @@
 			ani = JS_GetStringBytes(JS_ValueToString(cx, argv[7]));
 		}
 		if (argc > 8) {
-			ani2 = JS_GetStringBytes(JS_ValueToString(cx, argv[8]));
+			aniii = JS_GetStringBytes(JS_ValueToString(cx, argv[8]));
 		}
 		if (argc > 9) {
 			rdnis = JS_GetStringBytes(JS_ValueToString(cx, argv[9]));
@@ -1467,7 +1467,7 @@
 												   cid_num,
 												   network_addr,
 												   ani,
-												   ani2,
+												   aniii,
 												   rdnis,
 												   (char *)modname,
 												   context,
@@ -1985,6 +1985,7 @@
 
 	if (switch_core_codec_init(&tto->codec,
 							   "L16",
+							   NULL,
 							   read_codec->implementation->samples_per_second,
 							   read_codec->implementation->microseconds_per_frame / 1000,
 							   read_codec->implementation->number_of_channels,

Modified: freeswitch/branches/mishehu/src/switch_caller.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_caller.c	(original)
+++ freeswitch/branches/mishehu/src/switch_caller.c	Wed Oct 18 23:32:52 2006
@@ -39,7 +39,7 @@
 																	char *caller_id_number,
 																	char *network_addr,
 																	char *ani,
-																	char *ani2, 
+																	char *aniii, 
 																	char *rdnis,
 																	char *source,
 																	char *context,
@@ -59,11 +59,12 @@
 		profile->caller_id_number = switch_core_strdup(pool, caller_id_number);
 		profile->network_addr = switch_core_strdup(pool, network_addr);
 		profile->ani = switch_core_strdup(pool, ani);
-		profile->ani2 = switch_core_strdup(pool, ani2);
+		profile->aniii = switch_core_strdup(pool, aniii);
 		profile->rdnis = switch_core_strdup(pool, rdnis);
 		profile->source = switch_core_strdup(pool, source);
 		profile->context = switch_core_strdup(pool, context);
 		profile->destination_number = switch_core_strdup(pool, destination_number);
+		switch_set_flag(profile, SWITCH_CPF_SCREEN);
 	}
 
 	return profile;
@@ -79,7 +80,7 @@
 		profile->dialplan = switch_core_session_strdup(session, tocopy->dialplan);
 		profile->caller_id_name = switch_core_session_strdup(session, tocopy->caller_id_name);
 		profile->ani = switch_core_session_strdup(session, tocopy->ani);
-		profile->ani2 = switch_core_session_strdup(session, tocopy->ani2);
+		profile->aniii = switch_core_session_strdup(session, tocopy->aniii);
 		profile->caller_id_number = switch_core_session_strdup(session, tocopy->caller_id_number);
 		profile->network_addr = switch_core_session_strdup(session, tocopy->network_addr);
 		profile->rdnis = switch_core_session_strdup(session, tocopy->rdnis);
@@ -88,6 +89,7 @@
 		profile->source = switch_core_session_strdup(session, tocopy->source);
 		profile->context = switch_core_session_strdup(session, tocopy->context);
 		profile->chan_name = switch_core_session_strdup(session, tocopy->chan_name);
+		profile->flags = tocopy->flags;
 	}
 
 	return profile;
@@ -107,8 +109,8 @@
 	if (!strcasecmp(name, "ani")) {
 		return caller_profile->ani;
 	}
-	if (!strcasecmp(name, "ani2")) {
-		return caller_profile->ani2;
+	if (!strcasecmp(name, "aniii")) {
+		return caller_profile->aniii;
 	}
 	if (!strcasecmp(name, "caller_id_number")) {
 		return caller_profile->caller_id_number;
@@ -167,9 +169,9 @@
 		snprintf(header_name, sizeof(header_name), "%s-ANI", prefix);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->ani);
 	}
-	if (caller_profile->ani2) {
-		snprintf(header_name, sizeof(header_name), "%s-ANI2", prefix);
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->ani2);
+	if (caller_profile->aniii) {
+		snprintf(header_name, sizeof(header_name), "%s-ANI-II", prefix);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->aniii);
 	}
 	if (caller_profile->destination_number) {
 		snprintf(header_name, sizeof(header_name), "%s-Destination-Number", prefix);
@@ -195,6 +197,17 @@
 		snprintf(header_name, sizeof(header_name), "%s-Channel-Name", prefix);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->chan_name);
 	}
+
+	snprintf(header_name, sizeof(header_name), "%s-Screen-Bit", prefix);
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_SCREEN) ? "yes" : "no");
+
+	snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Name", prefix);
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME) ? "yes" : "no");
+
+	snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Number", prefix);
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "yes" : "no");
+
+
 
 }
 

Modified: freeswitch/branches/mishehu/src/switch_console.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_console.c	(original)
+++ freeswitch/branches/mishehu/src/switch_console.c	Wed Oct 18 23:32:52 2006
@@ -52,7 +52,7 @@
 	ret = vasprintf(&data, fmt, ap);
 #else
 	if ((data = (char *) malloc(2048))) {
-		vsnprintf(data, 2048, fmt, ap);
+		ret = vsnprintf(data, 2048, fmt, ap);
 	}
 #endif
 	va_end(ap);
@@ -152,7 +152,7 @@
 	ret = vasprintf(&data, fmt, ap);
 #else
 	data = (char *) malloc(2048);
-	vsnprintf(data, 2048, fmt, ap);
+	ret = vsnprintf(data, 2048, fmt, ap);
 #endif
 	va_end(ap);
 	if (ret == -1) {

Modified: freeswitch/branches/mishehu/src/switch_core.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_core.c	(original)
+++ freeswitch/branches/mishehu/src/switch_core.c	Wed Oct 18 23:32:52 2006
@@ -50,6 +50,7 @@
 #endif
 
 #define SWITCH_EVENT_QUEUE_LEN 256
+#define SWITCH_MESSAGE_QUEUE_LEN 256
 #define SWITCH_SQL_QUEUE_LEN 2000
 
 #define SWITCH_BUFFER_BLOCK_FRAMES 25
@@ -105,6 +106,7 @@
 	char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
 	void *private_info;
 	switch_queue_t *event_queue;
+	switch_queue_t *message_queue;
 	switch_queue_t *private_event_queue;
 	switch_thread_rwlock_t *bug_rwlock;
 	switch_media_bug_t *bugs;
@@ -652,7 +654,7 @@
 	return session->write_codec;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec, char *codec_name, uint32_t rate, int ms,
+SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec, char *codec_name, char *fmtp, uint32_t rate, int ms,
 													 int channels, uint32_t flags,
 													 const switch_codec_settings_t *codec_settings,
 													 switch_memory_pool_t *pool)
@@ -684,7 +686,7 @@
 		codec->codec_interface = codec_interface;
 		codec->implementation = implementation;
 		codec->flags = flags;
-
+		
 		if (pool) {
 			codec->memory_pool = pool;
 		} else {
@@ -694,6 +696,10 @@
 			switch_set_flag(codec, SWITCH_CODEC_FLAG_FREE_POOL);
 		}
 
+		if (fmtp) {
+			codec->fmtp_in = switch_core_strdup(codec->memory_pool, fmtp);
+		}
+
 		implementation->init(codec, flags, codec_settings);
 
 		return SWITCH_STATUS_SUCCESS;
@@ -1309,29 +1315,32 @@
 
 	if (endpoint_interface->io_routines->outgoing_channel) {
 		if (session) {
-			char *ecaller_id_name = NULL, *ecaller_id_number = NULL;
 			channel = switch_core_session_get_channel(session);
+			if (caller_profile) {			
+				char *ecaller_id_name = NULL, *ecaller_id_number = NULL;
+
+				ecaller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name");
+				ecaller_id_number = switch_channel_get_variable(channel, "effective_caller_id_number");
 			
-			ecaller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name");
-			ecaller_id_number = switch_channel_get_variable(channel, "effective_caller_id_number");
-			
-			if (ecaller_id_name || ecaller_id_number) {
-				if (caller_profile) {
+				if (ecaller_id_name || ecaller_id_number) {
 					outgoing_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
 																 caller_profile->username,
 																 caller_profile->dialplan,
-																 ecaller_id_name ? ecaller_id_name : caller_profile->caller_id_name,
-																 ecaller_id_number ? ecaller_id_number : caller_profile->caller_id_number,
+																 ecaller_id_name,
+																 ecaller_id_number,
 																 caller_profile->network_addr,
 																 caller_profile->ani,
-																 caller_profile->ani2, 
+																 caller_profile->aniii, 
 																 caller_profile->rdnis,
 																 caller_profile->source,
 																 caller_profile->context,
 																 caller_profile->destination_number);
-					
-				}
+					outgoing_profile->flags = caller_profile->flags;
+				} 
 			}
+			if (!outgoing_profile) {
+				outgoing_profile = switch_channel_get_caller_profile(channel);
+			}
 		}
 		
 		if ((status = endpoint_interface->io_routines->outgoing_channel(session,
@@ -1355,14 +1364,13 @@
 
 	if (*new_session) {
 		switch_caller_profile_t *profile = NULL, *peer_profile = NULL, *cloned_profile = NULL;
-		switch_channel_t *peer_channel = NULL;
 		switch_event_t *event;
-		switch_channel_t *new_channel = switch_core_session_get_channel(*new_session);
+		switch_channel_t *peer_channel = switch_core_session_get_channel(*new_session);
 
 		if (session && channel) {
 			profile = switch_channel_get_caller_profile(channel);
 		}
-		if ((peer_channel = switch_core_session_get_channel(*new_session)) != 0) {
+		if (peer_channel) {
 			peer_profile = switch_channel_get_caller_profile(peer_channel);
 		}
 
@@ -1380,7 +1388,7 @@
 		}
 
 		if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_OUTGOING) == SWITCH_STATUS_SUCCESS) {
-			switch_channel_event_set_data(new_channel, event);
+			switch_channel_event_set_data(peer_channel, event);
 			switch_event_fire(&event);
 		}
 	}
@@ -1409,8 +1417,7 @@
 	return status;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_core_session_receive_message(switch_core_session_t *session,
-																  switch_core_session_message_t *message)
+SWITCH_DECLARE(switch_status_t) switch_core_session_receive_message(switch_core_session_t *session, switch_core_session_message_t *message)
 {
 	switch_io_event_hook_receive_message_t *ptr;
 	switch_status_t status = SWITCH_STATUS_FALSE;
@@ -1425,12 +1432,45 @@
 				}
 			}
 		}
-	} 
+	}
+	return status;
+}
 
+SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_session_t *session, switch_core_session_message_t *message)
+{
+	switch_status_t status = SWITCH_STATUS_FALSE;
+
+	assert(session != NULL);
+
+	if (!session->message_queue) {
+		switch_queue_create(&session->message_queue, SWITCH_MESSAGE_QUEUE_LEN, session->pool);
+	}
+
+	if (session->message_queue) {
+		if (switch_queue_trypush(session->message_queue, message) == SWITCH_STATUS_SUCCESS) {
+			status = SWITCH_STATUS_SUCCESS;
+		}
+	}
+
 	return status;
 }
 
+SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_message(switch_core_session_t *session, switch_core_session_message_t **message)
+{
+	switch_status_t status = SWITCH_STATUS_FALSE;
+	void *pop;
 
+	assert(session != NULL);
+	
+	if (session->message_queue) {
+		if ((status = (switch_status_t) switch_queue_trypop(session->message_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
+			*message = (switch_core_session_message_t *) pop;
+		}
+	}
+
+	return status;
+}
+
 SWITCH_DECLARE(switch_status_t) switch_core_session_receive_event(switch_core_session_t *session, switch_event_t **event)
 	 
 {
@@ -1566,6 +1606,7 @@
 	switch_io_event_hook_read_frame_t *ptr;
 	switch_status_t status;
 	int need_codec, perfect, do_bugs = 0;
+	unsigned int flag = 0;
  top:
 	
 	status = SWITCH_STATUS_FALSE;
@@ -1632,7 +1673,6 @@
 		switch_frame_t *enc_frame, *read_frame = *frame;
 
 		if (read_frame->codec) {
-			unsigned int flag = 0;
 			session->raw_read_frame.datalen = session->raw_read_frame.buflen;
 			status = switch_core_codec_decode(read_frame->codec,
 											  session->read_codec,
@@ -1714,8 +1754,6 @@
 			}
 
 			if (perfect || switch_buffer_inuse(session->raw_read_buffer) >= session->read_codec->implementation->bytes_per_frame) {
-				unsigned int flag = 0;
-
 				if (perfect) {
 					enc_frame = *frame;
 					session->raw_read_frame.rate = (*frame)->rate;
@@ -1769,6 +1807,10 @@
  done:
 	if (!(*frame)) {
 		status = SWITCH_STATUS_FALSE;
+	} else {
+		if (flag & SFF_CNG) {
+			switch_set_flag((*frame), SFF_CNG);
+		}
 	}
 
 	return status;
@@ -1984,7 +2026,9 @@
 					write_frame = NULL;
 					return status;
 				}
-
+				if (flag & SFF_CNG) {
+					switch_set_flag(write_frame, SFF_CNG);
+				}
 				status = perform_write(session, write_frame, timeout, io_flag, stream_id);
 				return status;
 			} else {
@@ -2058,6 +2102,9 @@
 								write_frame->samples = session->read_resampler->to_len;
 								write_frame->datalen = session->read_resampler->to_len * 2;
 								write_frame->rate = session->read_resampler->to_rate;
+							}
+							if (flag & SFF_CNG) {
+								switch_set_flag(write_frame, SFF_CNG);
 							}
 							if ((status = perform_write(session, write_frame, timeout, io_flag, stream_id)) != SWITCH_STATUS_SUCCESS) {
 								break;

Modified: freeswitch/branches/mishehu/src/switch_event.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_event.c	(original)
+++ freeswitch/branches/mishehu/src/switch_event.c	Wed Oct 18 23:32:52 2006
@@ -123,6 +123,9 @@
 	"MODULE_LOAD",
 	"DTMF",
 	"MESSAGE",
+	"PRESENCE_IN",
+	"PRESENCE_OUT",
+	"ROSTER",
 	"CODEC",
 	"BACKGROUND_JOB",
 	"ALL"
@@ -477,7 +480,7 @@
 
 	va_list ap;
 	va_start(ap, fmt);
-	vsnprintf(data, sizeof(data), fmt, ap);
+	ret = vsnprintf(data, sizeof(data), fmt, ap);
 	va_end(ap);
 
 	if (ret == -1) {
@@ -585,6 +588,8 @@
 		(*event)->body = DUP(todup->body);
 	}
 
+	(*event)->key = todup->key;
+
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -602,7 +607,7 @@
 		ret = vasprintf(&data, fmt, ap);
 #else
 		data = (char *) malloc(2048);
-		vsnprintf(data, 2048, fmt, ap);
+		ret = vsnprintf(data, 2048, fmt, ap);
 #endif
 		va_end(ap);
 		if (ret == -1) {
@@ -672,7 +677,7 @@
 		ret = vasprintf(&data, fmt, ap);
 #else
 		data = (char *) malloc(2048);
-		vsnprintf(data, 2048, fmt, ap);
+		ret = vsnprintf(data, 2048, fmt, ap);
 #endif
 		va_end(ap);
 		if (ret == -1) {

Modified: freeswitch/branches/mishehu/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_ivr.c	(original)
+++ freeswitch/branches/mishehu/src/switch_ivr.c	Wed Oct 18 23:32:52 2006
@@ -378,6 +378,7 @@
 	codec_name = "L16";
 	if (switch_core_codec_init(&codec,
 							   codec_name,
+							   NULL,
 							   read_codec->implementation->samples_per_second,
 							   read_codec->implementation->microseconds_per_frame / 1000,
 							   read_codec->implementation->number_of_channels,
@@ -710,6 +711,7 @@
 
 		if (switch_core_codec_init(&codec,
 								   codec_name,
+								   NULL,
 								   fh->samplerate,
 								   interval,
 								   fh->channels,
@@ -1177,6 +1179,7 @@
 
 	if (switch_core_codec_init(&codec,
 							   codec_name,
+							   NULL,
 							   (int)rate,
 							   interval,
 							   1,
@@ -1239,9 +1242,9 @@
 {
 	switch_core_thread_session_t *his_thread, *data = obj;
 	int *stream_id_p;
-	int stream_id = 0, ans_a = 0, ans_b = 0;
+	int stream_id = 0, pre_b = 0, ans_a = 0, ans_b = 0, originator = 0;
 	switch_input_callback_function_t input_callback;
-	switch_core_session_message_t msg = {0};
+	switch_core_session_message_t *message, msg = {0};
 	void *user_data;
 
 	switch_channel_t *chan_a, *chan_b;
@@ -1265,10 +1268,13 @@
 	chan_a = switch_core_session_get_channel(session_a);
 	chan_b = switch_core_session_get_channel(session_b);
 
-
 	ans_a = switch_channel_test_flag(chan_a, CF_ANSWERED);
-	ans_b = switch_channel_test_flag(chan_b, CF_ANSWERED);
+	if ((originator = switch_channel_test_flag(chan_a, CF_ORIGINATOR))) {
+		pre_b = switch_channel_test_flag(chan_a, CF_EARLY_MEDIA);
+		ans_b = switch_channel_test_flag(chan_b, CF_ANSWERED);
+	}
 
+
 	switch_channel_set_flag(chan_a, CF_BRIDGED);
 
 	while (switch_channel_ready(chan_a) && data->running > 0 && his_thread->running > 0) {
@@ -1291,64 +1297,65 @@
 			break;
 		}
 
-		if (!switch_channel_test_flag(chan_a, CF_HOLD)) {
-			/* If this call is running on early media and it answers for real, pass it along... */
-			if (!ans_b && switch_channel_test_flag(chan_a, CF_ANSWERED)) {
-				if (!switch_channel_test_flag(chan_b, CF_ANSWERED)) {
-					switch_channel_answer(chan_b);
+		if (switch_core_session_dequeue_private_event(session_a, &event) == SWITCH_STATUS_SUCCESS) {
+			switch_channel_set_flag(chan_b, CF_HOLD);
+			switch_ivr_parse_event(session_a, event);
+			switch_channel_clear_flag(chan_b, CF_HOLD);
+			switch_event_destroy(&event);
+		}
+
+		/* if 1 channel has DTMF pass it to the other */
+		if (switch_channel_has_dtmf(chan_a)) {
+			char dtmf[128];
+			switch_channel_dequeue_dtmf(chan_a, dtmf, sizeof(dtmf));
+			switch_core_session_send_dtmf(session_b, dtmf);
+
+			if (input_callback) {
+				if (input_callback(session_a, dtmf, SWITCH_INPUT_TYPE_DTMF, user_data, 0) != SWITCH_STATUS_SUCCESS) {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s ended call via DTMF\n", switch_channel_get_name(chan_a));
+					switch_mutex_lock(data->mutex);
+					data->running = -1;
+					switch_mutex_unlock(data->mutex);
+					break;
 				}
-				ans_b++;
 			}
+		}
 
-			if (!ans_a && switch_channel_test_flag(chan_b, CF_ANSWERED)) {
-				if (!switch_channel_test_flag(chan_a, CF_ANSWERED)) {
-					switch_channel_answer(chan_a);
-				}
-				ans_a++;
+		if (switch_core_session_dequeue_event(session_a, &event) == SWITCH_STATUS_SUCCESS) {
+			if (input_callback) {
+				status = input_callback(session_a, event, SWITCH_INPUT_TYPE_EVENT, user_data, 0);
 			}
-			
-			if (switch_core_session_dequeue_private_event(session_a, &event) == SWITCH_STATUS_SUCCESS) {
-				switch_channel_set_flag(chan_b, CF_HOLD);
-				switch_ivr_parse_event(session_a, event);
-				switch_channel_clear_flag(chan_b, CF_HOLD);
+
+			if (switch_core_session_receive_event(session_b, &event) != SWITCH_STATUS_SUCCESS) {
 				switch_event_destroy(&event);
 			}
 
-			/* if 1 channel has DTMF pass it to the other */
-			if (switch_channel_has_dtmf(chan_a)) {
-				char dtmf[128];
-				switch_channel_dequeue_dtmf(chan_a, dtmf, sizeof(dtmf));
-				switch_core_session_send_dtmf(session_b, dtmf);
+		}
 
-				if (input_callback) {
-					if (input_callback(session_a, dtmf, SWITCH_INPUT_TYPE_DTMF, user_data, 0) != SWITCH_STATUS_SUCCESS) {
-						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s ended call via DTMF\n", switch_channel_get_name(chan_a));
-						switch_mutex_lock(data->mutex);
-						data->running = -1;
-						switch_mutex_unlock(data->mutex);
-						break;
-					}
-				}
+		if (switch_core_session_dequeue_message(session_b, &message) == SWITCH_STATUS_SUCCESS) {
+			switch_core_session_receive_message(session_a, message);
+			if (switch_test_flag(message, SCSMF_DYNAMIC)) {
+				switch_safe_free(message);
 			}
-
-			if (switch_core_session_dequeue_event(session_a, &event) == SWITCH_STATUS_SUCCESS) {
-				if (input_callback) {
-					status = input_callback(session_a, event, SWITCH_INPUT_TYPE_EVENT, user_data, 0);
-				}
-
-				if (switch_core_session_receive_event(session_b, &event) != SWITCH_STATUS_SUCCESS) {
-					switch_event_destroy(&event);
-				}
-
-			}
+		}
  
+		if (!ans_a && originator) {
+			if (!ans_b && switch_channel_test_flag(chan_b, CF_ANSWERED)) {
+				switch_channel_answer(chan_a);
+				ans_a++;
+			} else if (!pre_b && switch_channel_test_flag(chan_b, CF_EARLY_MEDIA)) {
+				switch_channel_pre_answer(chan_a);
+				pre_b++;
+			}
+			switch_yield(10000);
+			continue;
 		}
 
 		/* read audio from 1 channel and write it to the other */
 		status = switch_core_session_read_frame(session_a, &read_frame, -1, stream_id);
 
 		if (SWITCH_READ_ACCEPTABLE(status)) {
-			if (status != SWITCH_STATUS_BREAK) {
+			if (status != SWITCH_STATUS_BREAK && !switch_channel_test_flag(chan_a, CF_HOLD)) {
 				if (switch_core_session_write_frame(session_b, read_frame, -1, stream_id) != SWITCH_STATUS_SUCCESS) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "write: %s Bad Frame....[%u] Bubye!\n",
 									  switch_channel_get_name(chan_b), read_frame->datalen);
@@ -1363,10 +1370,7 @@
 			data->running = -1;
 			switch_mutex_unlock(data->mutex);
 		}
-
-		//switch_yield(1000);
 	}
-
 	
 	msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE;
 	msg.from = __FILE__;
@@ -1819,6 +1823,7 @@
 															   caller_caller_profile->source,
 															   caller_caller_profile->context,
 															   chan_data);
+				caller_profiles[i]->flags = caller_caller_profile->flags;
 				pool = NULL;
 			} else {
 				if (!cid_name_override) {
@@ -1842,7 +1847,7 @@
 																   caller_profile_override->caller_id_number,
 																   caller_profile_override->network_addr, 
 																   caller_profile_override->ani,
-																   caller_profile_override->ani2,
+																   caller_profile_override->aniii,
 																   caller_profile_override->rdnis,
 																   caller_profile_override->source,
 																   caller_profile_override->context,
@@ -1931,17 +1936,16 @@
 
 		}
 	endfor1:
-
+		
 		if (session && !switch_channel_test_flag(caller_channel, CF_NOMEDIA)) {
 			switch_codec_t *read_codec = NULL;
 
-			switch_channel_pre_answer(caller_channel);
 			read_codec = switch_core_session_get_read_codec(session);
-
 			assert(read_codec != NULL);
 			if (!(pass = (uint8_t)switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH))) {
 				if (switch_core_codec_init(&write_codec,
 										   "L16",
+										   NULL,
 										   read_codec->implementation->samples_per_second,
 										   read_codec->implementation->microseconds_per_frame / 1000,
 										   1,
@@ -1965,6 +1969,16 @@
 		while ((!caller_channel || switch_channel_ready(caller_channel)) && 
 			   check_channel_status(peer_channels, peer_sessions, and_argc, &idx, file, key) && ((time(NULL) - start) < (time_t)timelimit_sec)) {
 
+			if (session && or_argc == 1 && and_argc == 1) { /* when there is only 1 channel to call and bridge */
+				switch_core_session_message_t *message = NULL;
+				if (switch_core_session_dequeue_message(peer_sessions[0], &message) == SWITCH_STATUS_SUCCESS) {
+					switch_core_session_receive_message(session, message);
+					if (switch_test_flag(message, SCSMF_DYNAMIC)) {
+						switch_safe_free(message);
+					}
+				}
+			}
+
 			/* read from the channel while we wait if the audio is up on it */
 			if (session && !switch_channel_test_flag(caller_channel, CF_NOMEDIA) && 
 				(switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA))) {
@@ -2007,13 +2021,17 @@
 			goto done;
 		}
 
-		if (caller_channel && switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
+		if (caller_channel) {
 			char *val;
-
 			if (switch_channel_test_flag(peer_channel, CF_NOMEDIA) && (val = switch_channel_get_variable(peer_channel, SWITCH_R_SDP_VARIABLE))) {
 				switch_channel_set_variable(caller_channel, SWITCH_L_SDP_VARIABLE, val);
 			}
-			switch_channel_answer(caller_channel);
+
+			if (switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
+				switch_channel_answer(caller_channel);
+			} else if (switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {
+				switch_channel_pre_answer(caller_channel);
+			}
 		}
 
 		if (switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {

Modified: freeswitch/branches/mishehu/src/switch_log.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_log.c	(original)
+++ freeswitch/branches/mishehu/src/switch_log.c	Wed Oct 18 23:32:52 2006
@@ -196,7 +196,7 @@
 	ret = vasprintf(&data, fmt, ap);
 #else
 	data = (char *) malloc(2048);
-	vsnprintf(data, 2048, fmt, ap);
+	ret = vsnprintf(data, 2048, fmt, ap);
 #endif
 	va_end(ap);
 	if (ret == -1) {

Modified: freeswitch/branches/mishehu/src/switch_rtp.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_rtp.c	(original)
+++ freeswitch/branches/mishehu/src/switch_rtp.c	Wed Oct 18 23:32:52 2006
@@ -732,7 +732,7 @@
 				switch_rtp_write_manual(rtp_session,
 										rtp_session->dtmf_data.out_digit_packet,
 										4,
-										1,
+ 										switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BUGGY_2833) ? 0 : 1,
 										rtp_session->te,
 										rtp_session->dtmf_data.timestamp_dtmf,
 										rtp_session->dtmf_data.out_digit_seq++,
@@ -1317,6 +1317,7 @@
 	
 	if (switch_core_codec_init(&rtp_session->vad_data.vad_codec,
 							   codec->implementation->iananame,
+							   NULL,
 							   codec->implementation->samples_per_second,
 							   codec->implementation->microseconds_per_frame / 1000,
 							   codec->implementation->number_of_channels,

Modified: freeswitch/branches/mishehu/w32/Library/FreeSwitchCore.vcproj
==============================================================================
--- freeswitch/branches/mishehu/w32/Library/FreeSwitchCore.vcproj	(original)
+++ freeswitch/branches/mishehu/w32/Library/FreeSwitchCore.vcproj	Wed Oct 18 23:32:52 2006
@@ -43,7 +43,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;&quot;..\..\libs\libresample-0.1.3\include&quot;"
+				AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libresample\include"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -136,7 +136,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;&quot;..\..\libs\libresample-0.1.3\include&quot;"
+				AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libresample\include"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;CRASH_PROT"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="2"



More information about the Freeswitch-svn mailing list