[Freeswitch-branches] [commit] r6742 - in freeswitch/branches/stkn/sofia-exp/trunk: . build conf/autoload_configs conf/dialplan conf/lang/en conf/lang/en/vm conf/sip_profiles docs/phrase libs/sofia-sip libs/sofia-sip/libsofia-sip-ua/sresolv libs/sofia-sip/libsofia-sip-ua/stun libs/sofia-sip/libsofia-sip-ua/su libs/win32/sofia src src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_iax src/mod/endpoints/mod_portaudio src/mod/endpoints/mod_sofia src/mod/formats/mod_local_stream src/mod/xml_int/mod_xml_rpc
Author: stkn Date: Thu Dec 13 05:11:23 2007 New Revision: 6742 Modified: freeswitch/branches/stkn/sofia-exp/trunk/Freeswitch.2008.sln freeswitch/branches/stkn/sofia-exp/trunk/build/modules.conf.in freeswitch/branches/stkn/sofia-exp/trunk/conf/autoload_configs/local_stream.conf.xml freeswitch/branches/stkn/sofia-exp/trunk/conf/dialplan/default.xml freeswitch/branches/stkn/sofia-exp/trunk/conf/lang/en/en.xml freeswitch/branches/stkn/sofia-exp/trunk/conf/lang/en/vm/sounds.xml freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/default.xml freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/nat.xml freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/outbound.xml freeswitch/branches/stkn/sofia-exp/trunk/docs/phrase/phrase_en.xml freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/configure.gnu freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.c freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_global_log.c freeswitch/branches/stkn/sofia-exp/trunk/libs/win32/sofia/libsofia_sip_ua_static.2008.vcproj freeswitch/branches/stkn/sofia-exp/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_iax/mod_iax.c freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.2008.vcproj freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia.c freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c freeswitch/branches/stkn/sofia-exp/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c freeswitch/branches/stkn/sofia-exp/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_io.c freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_session.c freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_state_machine.c Log: Merge changes from trunk Modified: freeswitch/branches/stkn/sofia-exp/trunk/Freeswitch.2008.sln ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/Freeswitch.2008.sln (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/Freeswitch.2008.sln Thu Dec 13 05:11:23 2007 @@ -128,6 +128,7 @@ ProjectSection(SolutionItems) = preProject conf\sip_profiles\default.xml = conf\sip_profiles\default.xml conf\sip_profiles\nat.xml = conf\sip_profiles\nat.xml + conf\sip_profiles\outbound.xml = conf\sip_profiles\outbound.xml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang", "lang", "{09455AA9-C243-4F16-A1A1-A016881A2765}" Modified: freeswitch/branches/stkn/sofia-exp/trunk/build/modules.conf.in ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/build/modules.conf.in (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/build/modules.conf.in Thu Dec 13 05:11:23 2007 @@ -44,7 +44,7 @@ formats/mod_native_file formats/mod_sndfile #formats/mod_shout -#formats/mod_local_stream +formats/mod_local_stream #languages/mod_python languages/mod_spidermonkey languages/mod_spidermonkey_teletone Modified: freeswitch/branches/stkn/sofia-exp/trunk/conf/autoload_configs/local_stream.conf.xml ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/conf/autoload_configs/local_stream.conf.xml (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/conf/autoload_configs/local_stream.conf.xml Thu Dec 13 05:11:23 2007 @@ -1,11 +1,11 @@ <configuration name="local_stream.conf" description="stream files from local dir"> -<directory name="moh_8000" path="$${base_dir}/sounds/music/8000"> +<directory name="moh/8000" path="$${base_dir}/sounds/music/8000"> <param name="rate" value="8000"/> <param name="channels" value="1"/> <param name="interval" value="2"/> <param name="timer_name" value="soft"/> </directory> -<directory name="moh_16000" path="$${base_dir}/sounds/music/16000"> +<directory name="moh/16000" path="$${base_dir}/sounds/music/16000"> <param name="rate" value="16000"/> <param name="channels" value="1"/> <param name="interval" value="2"/> Modified: freeswitch/branches/stkn/sofia-exp/trunk/conf/dialplan/default.xml ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/conf/dialplan/default.xml (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/conf/dialplan/default.xml Thu Dec 13 05:11:23 2007 @@ -184,7 +184,7 @@ <extension name="hold_music"> <condition field="destination_number" expression="^9999$"> <action application="answer"/> - <action application="playback" data="local_stream://moh_${read_rate}"/> + <action application="playback" data="local_stream://moh"/> </condition> </extension> Modified: freeswitch/branches/stkn/sofia-exp/trunk/conf/lang/en/en.xml ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/conf/lang/en/en.xml (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/conf/lang/en/en.xml Thu Dec 13 05:11:23 2007 @@ -1,7 +1,7 @@ <include> - <language name="en" sound-path="/snds" tts-engine="cepstral" tts-voice="callie"> + <language name="en" sound-path="$${base_dir}/sounds/en/us/callie" tts-engine="cepstral" tts-voice="callie"> <X-PRE-PROCESS cmd="include" data="demo/demo.xml"/> <!--voicemail_en_tts is purely implemented with tts, we need a files based implementation too --> - <X-PRE-PROCESS cmd="include" data="vm/tts.xml"/> + <X-PRE-PROCESS cmd="include" data="vm/sounds.xml"/> </language> </include> Modified: freeswitch/branches/stkn/sofia-exp/trunk/conf/lang/en/vm/sounds.xml ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/conf/lang/en/vm/sounds.xml (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/conf/lang/en/vm/sounds.xml Thu Dec 13 05:11:23 2007 @@ -200,6 +200,23 @@ </input> </macro> + <macro name="marked-urgent"> + <input pattern="^(.*)$"> + <match> + <action function="play-file" data="voicemail/vm-urgent.wav"/> + <action function="play-file" data="voicemail/vm-message.wav"/> + </match> + </input> + </macro> + + <macro name="saved"> + <input pattern="^(.*)$"> + <match> + <action function="play-file" data="voicemail/vm-saved.wav"/> + </match> + </input> + </macro> + <macro name="voicemail_greeting_selected"> <input pattern="^(.*)$"> <match> Modified: freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/default.xml ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/default.xml (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/default.xml Thu Dec 13 05:11:23 2007 @@ -16,6 +16,8 @@ <settings> <param name="debug" value="0"/> + <param name="sip-trace" value="no"/> + <param name="log-level" value="0"/> <param name="context" value="public"/> <param name="rfc2833-pt" value="101"/> <param name="sip-port" value="5060"/> @@ -26,7 +28,7 @@ <param name="rtp-timer-name" value="soft"/> <param name="rtp-ip" value="$${local_ip_v4}"/> <param name="sip-ip" value="$${local_ip_v4}"/> - <param name="hold-music" value="local_stream://moh_8000"/> + <param name="hold-music" value="local_stream://moh"/> <!--enable to use presense and mwi --> <param name="manage-presence" value="true"/> <!--max number of open dialogs in proceeding --> Modified: freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/nat.xml ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/nat.xml (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/nat.xml Thu Dec 13 05:11:23 2007 @@ -6,6 +6,8 @@ <settings> <param name="debug" value="0"/> + <param name="sip-trace" value="no"/> + <param name="log-level" value="0"/> <param name="rfc2833-pt" value="101"/> <param name="sip-port" value="5070"/> <param name="dialplan" value="XML"/> @@ -13,7 +15,7 @@ <param name="dtmf-duration" value="100"/> <param name="codec-prefs" value="$${global_codec_prefs}"/> <param name="use-rtp-timer" value="true"/> - <param name="hold-music" value="local_stream://moh_8000"/> + <param name="hold-music" value="local_stream://moh"/> <param name="rtp-timer-name" value="soft"/> <param name="manage-presence" value="true"/> <param name="inbound-codec-negotiation" value="generous"/> Modified: freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/outbound.xml ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/outbound.xml (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/conf/sip_profiles/outbound.xml Thu Dec 13 05:11:23 2007 @@ -11,13 +11,15 @@ <settings> <param name="debug" value="0"/> + <param name="sip-trace" value="no"/> + <param name="log-level" value="0"/> <param name="rfc2833-pt" value="101"/> <param name="sip-port" value="5080"/> <param name="dialplan" value="XML"/> <param name="context" value="public"/> <param name="dtmf-duration" value="100"/> <param name="codec-prefs" value="$${global_codec_prefs}"/> - <param name="hold-music" value="local_stream://moh_8000"/> + <param name="hold-music" value="local_stream://moh"/> <param name="use-rtp-timer" value="true"/> <param name="rtp-timer-name" value="soft"/> <param name="manage-presence" value="true"/> Modified: freeswitch/branches/stkn/sofia-exp/trunk/docs/phrase/phrase_en.xml ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/docs/phrase/phrase_en.xml (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/docs/phrase/phrase_en.xml Thu Dec 13 05:11:23 2007 @@ -211,16 +211,17 @@ <prompt phrase="deleted" filename="vm-deleted.wav"/> <prompt phrase="in folder inbox" filename="vm-in_folder.wav"/> <prompt phrase="to return the call now" filename="vm-return_call.wav"/> + <prompt phrase="urgent" filename="vm-urgent.wav"/> </voicemail> <conference> - <prompt phrase="'TONE'" filename="ack.wav" type="tone"/> - <prompt phrase="'TONE'" filename="nack.wav" type="tone"/> - <prompt phrase="The conference is muted." filename="mute.wav"/> - <prompt phrase="The conference is unmuted." filename="unmuted.wav"/> + <prompt phrase="NULL" filename="ack.wav" type="tone"/> + <prompt phrase="NULL" filename="nack.wav" type="tone"/> + <prompt phrase="You are now muted." filename="mute.wav"/> + <prompt phrase="You are now unmuted." filename="unmuted.wav"/> <prompt phrase="You are currently the only person in this conference." filename="alone.wav"/> - <prompt phrase="'NONE'" filename="perpetual.wav" type="music"/> - <prompt phrase="'NONE'" filename="enter.wav" type="tone"/> - <prompt phrase="'NONE'" filename="exit.wav" type="tone"/> + <prompt phrase="NULL" filename="perpetual.wav" type="music"/> + <prompt phrase="NULL" filename="enter.wav" type="tone"/> + <prompt phrase="NULL" filename="exit.wav" type="tone"/> <prompt phrase="You have been kicked from this conference." filename="kicked.wav"/> <prompt phrase="This conference is locked." filename="locked.wav"/> <prompt phrase="The conference is now locked." filename="is-locked.wav"/> Modified: freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/configure.gnu ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/configure.gnu (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/configure.gnu Thu Dec 13 05:11:23 2007 @@ -1,3 +1,3 @@ #! /bin/sh -./configure "$@" --with-pic --with-glib=no --disable-shared +CFLAGS="$CFLAGS -DSU_DEBUG=0" ./configure "$@" --with-pic --with-glib=no --disable-shared Modified: freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c Thu Dec 13 05:11:23 2007 @@ -567,12 +567,16 @@ extern char const SRESOLV_DEBUG[]; /* dummy declaration for Doxygen */ #endif +#ifndef SU_DEBUG +#define SU_DEBUG 3 +#endif + /**Debug log for @b sresolv module. * * The sresolv_log is the log object used by @b sresolv module. The level of * #sresolv_log is set using #SRESOLV_DEBUG environment variable. */ -su_log_t sresolv_log[] = { SU_LOG_INIT("sresolv", "SRESOLV_DEBUG", 3) }; +su_log_t sresolv_log[] = { SU_LOG_INIT("sresolv", "SRESOLV_DEBUG", SU_DEBUG) }; /** Internal errors */ enum { Modified: freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.c Thu Dec 13 05:11:23 2007 @@ -74,8 +74,12 @@ static char const __func__[] = "stun"; #endif +#ifndef SU_DEBUG +#define SU_DEBUG 3 +#endif + /** STUN log. */ -su_log_t stun_log[] = { SU_LOG_INIT("stun", "STUN_DEBUG", 3) }; +su_log_t stun_log[] = { SU_LOG_INIT("stun", "STUN_DEBUG", SU_DEBUG) }; /**@var STUN_DEBUG * Modified: freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_global_log.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_global_log.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_global_log.c Thu Dec 13 05:11:23 2007 @@ -47,7 +47,9 @@ * * @sa <sofia-sip/su_debug.h>, su_log_global */ +#ifdef DOXYGEN extern char const SU_DEBUG[]; +#endif #ifdef SU_DEBUG #define SU_DEBUG_ SU_DEBUG Modified: freeswitch/branches/stkn/sofia-exp/trunk/libs/win32/sofia/libsofia_sip_ua_static.2008.vcproj ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/libs/win32/sofia/libsofia_sip_ua_static.2008.vcproj (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/libs/win32/sofia/libsofia_sip_ua_static.2008.vcproj Thu Dec 13 05:11:23 2007 @@ -44,7 +44,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""..\..\sofia-sip\win32";"..\..\sofia-sip\libsofia-sip-ua\su";"..\..\sofia-sip\libsofia-sip-ua\ipt";"..\..\sofia-sip\libsofia-sip-ua\sresolv";"..\..\sofia-sip\libsofia-sip-ua\bnf";"..\..\sofia-sip\libsofia-sip-ua\url";"..\..\sofia-sip\libsofia-sip-ua\msg";"..\..\sofia-sip\libsofia-sip-ua\sip";"..\..\sofia-sip\libsofia-sip-ua\nta";"..\..\sofia-sip\libsofia-sip-ua\nua";"..\..\sofia-sip\libsofia-sip-ua\iptsec";"..\..\sofia-sip\libsofia-sip-ua\http";"..\..\sofia-sip\libsofia-sip-ua\nth";"..\..\sofia-sip\libsofia-sip-ua\nea";"..\..\sofia-sip\libsofia-sip-ua\sdp";"..\..\sofia-sip\libsofia-sip-ua\soa";"..\..\sofia-sip\libsofia-sip-ua\stun";"..\..\sofia-sip\libsofia-sip-ua\tport";"..\..\sofia-sip\libsofia-sip-ua\features";"..\..\pthreads-w32-2-7-0-release";." - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -123,7 +123,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories=""..\..\sofia-sip\win32";"..\..\sofia-sip\libsofia-sip-ua\su";"..\..\sofia-sip\libsofia-sip-ua\ipt";"..\..\sofia-sip\libsofia-sip-ua\sresolv";"..\..\sofia-sip\libsofia-sip-ua\bnf";"..\..\sofia-sip\libsofia-sip-ua\url";"..\..\sofia-sip\libsofia-sip-ua\msg";"..\..\sofia-sip\libsofia-sip-ua\sip";"..\..\sofia-sip\libsofia-sip-ua\nta";"..\..\sofia-sip\libsofia-sip-ua\nua";"..\..\sofia-sip\libsofia-sip-ua\iptsec";"..\..\sofia-sip\libsofia-sip-ua\http";"..\..\sofia-sip\libsofia-sip-ua\nth";"..\..\sofia-sip\libsofia-sip-ua\nea";"..\..\sofia-sip\libsofia-sip-ua\sdp";"..\..\sofia-sip\libsofia-sip-ua\soa";"..\..\sofia-sip\libsofia-sip-ua\stun";"..\..\sofia-sip\libsofia-sip-ua\tport";"..\..\sofia-sip\libsofia-sip-ua\features";"..\..\pthreads-w32-2-7-0-release";." - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" Modified: freeswitch/branches/stkn/sofia-exp/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj Thu Dec 13 05:11:23 2007 @@ -43,7 +43,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""..\..\sofia-sip\win32";"..\..\sofia-sip\libsofia-sip-ua\su";"..\..\sofia-sip\libsofia-sip-ua\ipt";"..\..\sofia-sip\libsofia-sip-ua\sresolv";"..\..\sofia-sip\libsofia-sip-ua\bnf";"..\..\sofia-sip\libsofia-sip-ua\url";"..\..\sofia-sip\libsofia-sip-ua\msg";"..\..\sofia-sip\libsofia-sip-ua\sip";"..\..\sofia-sip\libsofia-sip-ua\nta";"..\..\sofia-sip\libsofia-sip-ua\nua";"..\..\sofia-sip\libsofia-sip-ua\iptsec";"..\..\sofia-sip\libsofia-sip-ua\http";"..\..\sofia-sip\libsofia-sip-ua\nth";"..\..\sofia-sip\libsofia-sip-ua\nea";"..\..\sofia-sip\libsofia-sip-ua\sdp";"..\..\sofia-sip\libsofia-sip-ua\soa";"..\..\sofia-sip\libsofia-sip-ua\stun";"..\..\sofia-sip\libsofia-sip-ua\tport";"..\..\sofia-sip\libsofia-sip-ua\features";"..\..\pthreads-w32-2-7-0-release";." - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -122,7 +122,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories=""..\..\sofia-sip\win32";"..\..\sofia-sip\libsofia-sip-ua\su";"..\..\sofia-sip\libsofia-sip-ua\ipt";"..\..\sofia-sip\libsofia-sip-ua\sresolv";"..\..\sofia-sip\libsofia-sip-ua\bnf";"..\..\sofia-sip\libsofia-sip-ua\url";"..\..\sofia-sip\libsofia-sip-ua\msg";"..\..\sofia-sip\libsofia-sip-ua\sip";"..\..\sofia-sip\libsofia-sip-ua\nta";"..\..\sofia-sip\libsofia-sip-ua\nua";"..\..\sofia-sip\libsofia-sip-ua\iptsec";"..\..\sofia-sip\libsofia-sip-ua\http";"..\..\sofia-sip\libsofia-sip-ua\nth";"..\..\sofia-sip\libsofia-sip-ua\nea";"..\..\sofia-sip\libsofia-sip-ua\sdp";"..\..\sofia-sip\libsofia-sip-ua\soa";"..\..\sofia-sip\libsofia-sip-ua\stun";"..\..\sofia-sip\libsofia-sip-ua\tport";"..\..\sofia-sip\libsofia-sip-ua\features";"..\..\pthreads-w32-2-7-0-release";." - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Thu Dec 13 05:11:23 2007 @@ -433,7 +433,7 @@ switch (event->event_id) { case SWITCH_EVENT_PRESENCE_PROBE: if (proto) { - char *sql; + char *subsql; char *to = switch_event_get_header(event, "to"); char *f_host = NULL; if (to) { @@ -443,9 +443,9 @@ } if (f_host && (profile = switch_core_hash_find(globals.profile_hash, f_host))) { - if (to && (sql = switch_mprintf("select * from jabber_subscriptions where sub_to='%q' and sub_from='%q'", to, from))) { - mdl_execute_sql_callback(profile, profile->mutex, sql, sin_callback, profile); - switch_safe_free(sql); + if (to && (subsql = switch_mprintf("select * from jabber_subscriptions where sub_to='%q' and sub_from='%q'", to, from))) { + mdl_execute_sql_callback(profile, profile->mutex, subsql, sin_callback, profile); + switch_safe_free(subsql); } } } @@ -1461,6 +1461,10 @@ } } + if (!tech_pvt->read_codec.implementation) { + return SWITCH_STATUS_GENERR; + } + if (!switch_test_flag(tech_pvt, TFLAG_IO)) { return SWITCH_STATUS_SUCCESS; } @@ -1747,9 +1751,9 @@ char *them; them = strdup(tech_pvt->them); if (them) { - char *p; - if ((p = strchr(them, '/'))) { - *p = '\0'; + char *ptr; + if ((ptr = strchr(them, '/'))) { + *ptr = '\0'; } ldl_handle_send_msg(mdl_profile->handle, tech_pvt->us, them, "", cid_msg); } @@ -1853,43 +1857,43 @@ static switch_status_t init_profile(mdl_profile_t *profile, uint8_t login) { - if (profile && profile->login && profile->password && profile->dialplan && profile->message && profile->ip && profile->name && profile->exten) { - ldl_handle_t *handle; + ldl_handle_t *handle; - if (switch_test_flag(profile, TFLAG_TIMER) && !profile->timer_name) { - profile->timer_name = switch_core_strdup(module_pool, "soft"); - } + if (!profile) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid Profile\n"); + return SWITCH_STATUS_FALSE; + } - if (login) { - if (ldl_handle_init(&handle, - profile->login, - profile->password, - profile->server, - profile->user_flags, profile->message, handle_loop, handle_signalling, handle_response, profile) == LDL_STATUS_SUCCESS) { - profile->handle = handle; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Started Thread for %s@%s\n", profile->login, profile->dialplan); - switch_core_hash_insert(globals.profile_hash, profile->name, profile); - handle_thread_launch(handle); - } - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created Profile for %s@%s\n", profile->login, profile->dialplan); - switch_core_hash_insert(globals.profile_hash, profile->name, profile); - } - } else { + if (!(profile->login && profile->password && profile->dialplan && profile->message && profile->ip && profile->name && profile->exten)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "Invalid Profile\n" - "login[%s]\n" - "pass[%s]\n" - "dialplan[%s]\n" - "message[%s]\n" - "rtp-ip[%s]\n" - "name[%s]\n" - "exten[%s]\n", profile->login, profile->password, profile->dialplan, profile->message, profile->ip, profile->name, - profile->exten); + "Invalid Profile\n" "login[%s]\n" "pass[%s]\n" "dialplan[%s]\n" + "message[%s]\n" "rtp-ip[%s]\n" "name[%s]\n" "exten[%s]\n", + profile->login, profile->password, profile->dialplan, profile->message, profile->ip, profile->name, profile->exten); return SWITCH_STATUS_FALSE; } + if (switch_test_flag(profile, TFLAG_TIMER) && !profile->timer_name) { + profile->timer_name = switch_core_strdup(module_pool, "soft"); + } + + if (!login) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created Profile for %s@%s\n", profile->login, profile->dialplan); + switch_core_hash_insert(globals.profile_hash, profile->name, profile); + return SWITCH_STATUS_SUCCESS; + } + + if (ldl_handle_init(&handle, + profile->login, + profile->password, + profile->server, + profile->user_flags, profile->message, handle_loop, handle_signalling, handle_response, profile) == LDL_STATUS_SUCCESS) { + profile->handle = handle; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Started Thread for %s@%s\n", profile->login, profile->dialplan); + switch_core_hash_insert(globals.profile_hash, profile->name, profile); + handle_thread_launch(handle); + } + return SWITCH_STATUS_SUCCESS; } @@ -1919,6 +1923,7 @@ static void set_profile_val(mdl_profile_t *profile, char *var, char *val) { + if (!var) return; if (!strcasecmp(var, "login")) { profile->login = switch_core_strdup(module_pool, val); @@ -1953,9 +1958,9 @@ } else if (!strcasecmp(var, "message")) { profile->message = switch_core_strdup(module_pool, val); } else if (!strcasecmp(var, "rtp-ip")) { - profile->ip = switch_core_strdup(module_pool, strcasecmp(val, "auto") ? val : globals.guess_ip); + profile->ip = switch_core_strdup(module_pool, strcasecmp(switch_str_nil(val), "auto") ? switch_str_nil(val) : globals.guess_ip); } else if (!strcasecmp(var, "ext-rtp-ip")) { - profile->extip = switch_core_strdup(module_pool, strcasecmp(val, "auto") ? val : globals.guess_ip); + profile->extip = switch_core_strdup(module_pool, strcasecmp(switch_str_nil(val), "auto") ? switch_str_nil(val) : globals.guess_ip); } else if (!strcasecmp(var, "server")) { profile->server = switch_core_strdup(module_pool, val); } else if (!strcasecmp(var, "rtp-timer-name")) { @@ -1967,9 +1972,9 @@ profile->user_flags |= LDL_FLAG_TLS; } } else if (!strcasecmp(var, "sasl")) { - if (!strcasecmp(val, "plain")) { + if (val && !strcasecmp(val, "plain")) { profile->user_flags |= LDL_FLAG_SASL_PLAIN; - } else if (!strcasecmp(val, "md5")) { + } else if (val && !strcasecmp(val, "md5")) { profile->user_flags |= LDL_FLAG_SASL_MD5; } } else if (!strcasecmp(var, "exten")) { @@ -1980,7 +1985,7 @@ if (switch_true(val)) { switch_set_flag(profile, TFLAG_AUTO); } - } else if (!strcasecmp(var, "vad")) { + } else if (!strcasecmp(var, "vad") && val) { if (!strcasecmp(val, "in")) { switch_set_flag(profile, TFLAG_VAD_IN); } else if (!strcasecmp(val, "out")) { @@ -2091,7 +2096,7 @@ return SWITCH_STATUS_SUCCESS; } - if (!strncasecmp(argv[0], "profile=", 8)) { + if (argv[0] && !strncasecmp(argv[0], "profile=", 8)) { char *profile_name = argv[0] + 8; profile = switch_core_hash_find(globals.profile_hash, profile_name); @@ -2108,7 +2113,7 @@ for (x = 0; x < argc; x++) { var = argv[x]; - if ((val = strchr(var, '='))) { + if (var && (val = strchr(var, '='))) { *val++ = '\0'; set_profile_val(profile, var, val); } @@ -2182,11 +2187,12 @@ if (!profile) { profile = switch_core_alloc(module_pool, sizeof(*profile)); } + set_profile_val(profile, var, val); } - if (type && !strcasecmp(type, "component")) { + if (profile && type && !strcasecmp(type, "component")) { char dbname[256]; switch_core_db_t *db; Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_iax/mod_iax.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_iax/mod_iax.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_iax/mod_iax.c Thu Dec 13 05:11:23 2007 @@ -150,7 +150,7 @@ static char *ast2str(int ast) { int x; - for (x = 0; x < 32; x++) { + for (x = 0; x < 19; x++) { if ((1 << x) == ast) { return AST_IANA[x].name; } @@ -216,8 +216,6 @@ unsigned int *format, unsigned int *cababilities, unsigned short *samprate, iax_io_t io) { char *dname = NULL; - //int rate = 8000; - //int codec_ms = 20; switch_channel_t *channel; const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS]; int num_codecs = 0; @@ -226,11 +224,12 @@ uint32_t interval = 0; if (globals.codec_string) { - if ((num_codecs = switch_loadable_module_get_codecs_sorted(codecs, SWITCH_MAX_CODECS, globals.codec_order, globals.codec_order_last)) <= 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n"); - return SWITCH_STATUS_GENERR; - } - } else if (((num_codecs = switch_loadable_module_get_codecs(codecs, SWITCH_MAX_CODECS))) <= 0) { + num_codecs = switch_loadable_module_get_codecs_sorted(codecs, SWITCH_MAX_CODECS, globals.codec_order, globals.codec_order_last); + } else { + num_codecs = switch_loadable_module_get_codecs(codecs, SWITCH_MAX_CODECS); + } + + if (num_codecs <= 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n"); return SWITCH_STATUS_GENERR; } @@ -246,6 +245,8 @@ } } + switch_assert(codecs[0]); + if (io == IAX_SET) { mixed_cap = (local_cap & *cababilities); } else { @@ -1104,9 +1105,6 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Inbound Channel %s!\n", iaxevent->ies.calling_name); if ((session = switch_core_session_request(iax_endpoint_interface, NULL)) != 0) { - private_t *tech_pvt; - switch_channel_t *channel; - switch_core_session_add_stream(session, NULL); if ((tech_pvt = (private_t *) switch_core_session_alloc(session, sizeof(private_t))) != 0) { channel = switch_core_session_get_channel(session); Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c Thu Dec 13 05:11:23 2007 @@ -1730,6 +1730,11 @@ goto done; } + if (!argv[0]) { + stream->write_function(stream, "Unknown Command\n"); + goto done; + } + if (!strcasecmp(argv[0], "call")) { func = place_call; } else if (!strcasecmp(argv[0], "help")) { Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.2008.vcproj ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.2008.vcproj (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.2008.vcproj Thu Dec 13 05:11:23 2007 @@ -39,7 +39,7 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories=""$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua";"$(InputDir)..\..\..\..\libs\sofia-sip\win32";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf"" + AdditionalIncludeDirectories=""$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua";"$(InputDir)..\..\..\..\libs\sofia-sip\win32";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport"" PreprocessorDefinitions="LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB" UsePrecompiledHeader="0" DisableSpecificWarnings="4201" @@ -105,7 +105,7 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories=""$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua";"$(InputDir)..\..\..\..\libs\sofia-sip\win32";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf"" + AdditionalIncludeDirectories=""$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua";"$(InputDir)..\..\..\..\libs\sofia-sip\win32";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf";"$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport"" PreprocessorDefinitions="LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB" UsePrecompiledHeader="0" DisableSpecificWarnings="4201" Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Thu Dec 13 05:11:23 2007 @@ -556,6 +556,10 @@ } } + if (!tech_pvt->read_codec.implementation) { + return SWITCH_STATUS_GENERR; + } + if (switch_test_flag(tech_pvt, TFLAG_HUP)) { return SWITCH_STATUS_FALSE; } @@ -834,7 +838,7 @@ char *reason = NULL; if (switch_channel_test_flag(channel, CF_ANSWERED)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Call is already answered, Rejecting with hangup\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Call is already answered, Rejecting with hangup\n"); switch_channel_hangup(channel, SWITCH_CAUSE_CALL_REJECTED); } else { @@ -860,11 +864,11 @@ if (switch_strlen_zero(to_host)) { to_host = switch_channel_get_variable(channel, "sip_to_host"); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Challanging call %s\n", to_uri); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Challenging call %s\n", to_uri); sofia_reg_auth_challange(NULL, tech_pvt->profile, tech_pvt->nh, REG_INVITE, to_host, 0); switch_channel_hangup(channel, SWITCH_CAUSE_USER_CHALLENGE); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Rejecting with %d %s\n", code, reason); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Rejecting with %d %s\n", code, reason); nua_respond(tech_pvt->nh, code, reason, TAG_END()); } } @@ -1356,6 +1360,7 @@ "sofia help\n" "sofia profile <profile_name> [start|stop|restart|flush_inbound_reg|[register|unregister] [<gateway name>|all]] [reloadxml]\n" "sofia status [[profile | gateway] <name>]\n" + "sofia loglevel [0-9]\n" "--------------------------------------------------------------------------------\n"; if (session) { @@ -1372,7 +1377,7 @@ goto done; } - if (!(argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { + if (!(argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) || !argv[0]) { stream->write_function(stream, "%s", usage_string); goto done; } @@ -1381,6 +1386,20 @@ func = cmd_profile; } else if (!strcasecmp(argv[0], "status")) { func = cmd_status; + } else if (!strcasecmp(argv[0], "loglevel")) { + if (argc > 1 && argv[1]) { + int level; + level = atoi(argv[1]); + if (level >= 0 && level <= 9) { + su_log_set_level(NULL, atoi(argv[1])); + stream->write_function(stream, "Sofia-sip log level set to [%d]", level); + } else { + stream->write_function(stream, "%s", usage_string); + } + } else { + stream->write_function(stream, "%s", usage_string); + } + goto done; } else if (!strcasecmp(argv[0], "help")) { stream->write_function(stream, "%s", usage_string); goto done; Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Thu Dec 13 05:11:23 2007 @@ -149,7 +149,8 @@ TFLAG_INB_NOMEDIA = (1 << 23), TFLAG_LATE_NEGOTIATION = (1 << 24), TFLAG_SDP = (1 << 25), - TFLAG_VIDEO = (1 << 26) + TFLAG_VIDEO = (1 << 26), + TFLAG_TPORT_LOG = (1 << 27) } TFLAGS; struct mod_sofia_globals { Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia.c Thu Dec 13 05:11:23 2007 @@ -36,8 +36,19 @@ #include "mod_sofia.h" #include "sofia-sip/msg_parser.h" #include "sofia-sip/sip_extra.h" +#include "sofia-sip/tport_tag.h" extern su_log_t tport_log[]; +extern su_log_t iptsec_log[]; +extern su_log_t nea_log[]; +extern su_log_t nta_log[]; +extern su_log_t nth_client_log[]; +extern su_log_t nth_server_log[]; +extern su_log_t nua_log[]; +extern su_log_t soa_log[]; +extern su_log_t sresolv_log[]; +extern su_log_t stun_log[]; + static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, char const *phrase, @@ -334,6 +345,7 @@ uint32_t ireg_loops = 0; uint32_t gateway_loops = 0; switch_event_t *s_event; + int tportlog = 0; switch_mutex_lock(mod_sofia_globals.mutex); mod_sofia_globals.threads++; @@ -350,6 +362,10 @@ goto end; } + if (switch_test_flag(profile, TFLAG_TPORT_LOG)) { + tportlog = 1; + } + profile->nua = nua_create(profile->s_root, /* Event loop */ sofia_event_callback, /* Callback for processing events */ profile, /* Additional data to pass to callback */ @@ -357,6 +373,7 @@ TAG_IF(profile->pflags & PFLAG_TLS, NUTAG_SIPS_URL(profile->tls_bindurl)), TAG_IF(profile->pflags & PFLAG_TLS, NUTAG_CERTIFICATE_DIR(profile->tls_cert_dir)), NTATAG_UDP_MTU(65536), + TAG_IF(tportlog, TPTAG_LOG(1)), TAG_END()); /* Last tag should always finish the sequence */ if (!profile->nua) { @@ -759,8 +776,6 @@ 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)); } } } @@ -817,7 +832,8 @@ profile->debug = atoi(val); } else if (!strcasecmp(var, "use-rtp-timer") && switch_true(val)) { switch_set_flag(profile, TFLAG_TIMER); - + } else if (!strcasecmp(var, "sip-trace") && switch_true(val)) { + switch_set_flag(profile, TFLAG_TPORT_LOG); } else if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) { #ifdef SWITCH_HAVE_ODBC profile->odbc_dsn = switch_core_strdup(profile->pool, val); @@ -1049,8 +1065,8 @@ } if (profile->bind_params) { - char *url = profile->bindurl; - profile->bindurl = switch_core_sprintf(profile->pool, "%s;%s", url, profile->bind_params); + char *bindurl = profile->bindurl; + profile->bindurl = switch_core_sprintf(profile->pool, "%s;%s", bindurl, profile->bind_params); } /* Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Thu Dec 13 05:11:23 2007 @@ -1051,6 +1051,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force) { + int ms; if (tech_pvt->read_codec.implementation) { if (!force) { @@ -1085,32 +1086,38 @@ NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); return SWITCH_STATUS_FALSE; - } else { - if (switch_core_codec_init(&tech_pvt->write_codec, - tech_pvt->iananame, - tech_pvt->rm_fmtp, - tech_pvt->rm_rate, - tech_pvt->codec_ms, - 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags, - NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); - return SWITCH_STATUS_FALSE; - } else { - int ms; - tech_pvt->read_frame.rate = tech_pvt->rm_rate; - ms = tech_pvt->write_codec.implementation->microseconds_per_frame / 1000; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set Codec %s %s/%ld %d ms %d samples\n", - switch_channel_get_name(tech_pvt->channel), tech_pvt->iananame, tech_pvt->rm_rate, tech_pvt->codec_ms, - tech_pvt->read_codec.implementation->samples_per_frame - ); - tech_pvt->read_frame.codec = &tech_pvt->read_codec; - - 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); - } + } + + if (switch_core_codec_init(&tech_pvt->write_codec, + tech_pvt->iananame, + tech_pvt->rm_fmtp, + tech_pvt->rm_rate, + tech_pvt->codec_ms, + 1, + SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags, + NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); + return SWITCH_STATUS_FALSE; + } + + tech_pvt->read_frame.rate = tech_pvt->rm_rate; + ms = tech_pvt->write_codec.implementation->microseconds_per_frame / 1000; + + if (!tech_pvt->read_codec.implementation) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); + return SWITCH_STATUS_FALSE; } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set Codec %s %s/%ld %d ms %d samples\n", + switch_channel_get_name(tech_pvt->channel), tech_pvt->iananame, tech_pvt->rm_rate, tech_pvt->codec_ms, + tech_pvt->read_codec.implementation->samples_per_frame + ); + tech_pvt->read_frame.codec = &tech_pvt->read_codec; + + 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; } Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Thu Dec 13 05:11:23 2007 @@ -341,23 +341,23 @@ case SWITCH_EVENT_PRESENCE_PROBE: if (proto) { char *to = switch_event_get_header(event, "to"); - char *user, *euser, *host, *p; + char *probe_user, *probe_euser, *probe_host, *p; - if (!to || !(user = strdup(to))) { + if (!to || !(probe_user = strdup(to))) { return; } - if ((host = strchr(user, '@'))) { - *host++ = '\0'; + if ((probe_host = strchr(probe_user, '@'))) { + *probe_host++ = '\0'; } - euser = user; - if ((p = strchr(euser, '+'))) { - euser = (p + 1); + probe_euser = probe_user; + if ((p = strchr(probe_euser, '+'))) { + probe_euser = (p + 1); } - if (euser && host && + if (probe_euser && probe_host && (sql = switch_mprintf("select sip_user,sip_host,status,rpid,'' from sip_registrations where sip_user='%q' and sip_host='%q'", - euser, host)) && (profile = sofia_glue_find_profile(host))) { + probe_euser, probe_host)) && (profile = sofia_glue_find_profile(probe_host))) { sofia_glue_execute_sql_callback(profile, SWITCH_FALSE, @@ -725,17 +725,17 @@ from_host = "n/a"; } - if (strstr(to_user, "ext+") || strstr(to_user, "user+")) { - char proto[80]; + if (to_user && (strstr(to_user, "ext+") || strstr(to_user, "user+"))) { + char protocol[80]; char *p; - switch_copy_string(proto, to_user, sizeof(proto)); - if ((p = strchr(proto, '+'))) { + switch_copy_string(protocol, to_user, sizeof(protocol)); + if ((p = strchr(protocol, '+'))) { *p = '\0'; } if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "proto", proto); + switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "proto", protocol); switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "login", "%s", profile->name); switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, to_host); switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "rpid", "active"); @@ -754,7 +754,7 @@ } } - if (strchr(to_user, '+')) { + if (to_user && strchr(to_user, '+')) { char *h; if ((proto = (d_user = strdup(to_user)))) { if ((my_to_user = strchr(d_user, '+'))) { Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Thu Dec 13 05:11:23 2007 @@ -89,9 +89,8 @@ NUTAG_CALLSTATE_REF(ss_state), SIPTAG_FROM_STR(gateway_ptr->register_from), TAG_END()))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "registering %s\n", gateway_ptr->name); - if (!(gateway_ptr->sofia_private = malloc(sizeof(*gateway_ptr->sofia_private)))) { - abort(); - } + gateway_ptr->sofia_private = malloc(sizeof(*gateway_ptr->sofia_private)); + switch_assert(gateway_ptr->sofia_private); memset(gateway_ptr->sofia_private, 0, sizeof(*gateway_ptr->sofia_private)); gateway_ptr->sofia_private->gateway = gateway_ptr; @@ -404,7 +403,7 @@ authorization = sip->sip_proxy_authorization; } - if ((profile->pflags & PFLAG_BLIND_REG)) { + if (regtype == REG_REGISTER && (profile->pflags & PFLAG_BLIND_REG)) { goto reg; } @@ -462,7 +461,6 @@ if (!authorization || stale) { sofia_reg_auth_challange(nua, profile, nh, regtype, to_host, stale); - if (regtype == REG_REGISTER) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Requesting Registration from: [%s@%s]\n", to_user, to_host); } @@ -642,7 +640,7 @@ if (expi != sofia_private->gateway->freq) { sofia_private->gateway->freq = expi; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Changing expire time to %d by request of proxy %s\n", expi, sofia_private->gateway->register_proxy); } @@ -841,7 +839,7 @@ dparams = switch_xml_child(domain, "params"); uparams = switch_xml_child(user, "params"); - if (!(dparams && uparams)) { + if (!(dparams || uparams)) { ret = AUTH_OK; goto skip_auth; } @@ -882,9 +880,6 @@ } if (!a1_hash) { - su_md5_t ctx; - char *input; - input = switch_mprintf("%s:%s:%s", username, realm, passwd); su_md5_init(&ctx); su_md5_strupdate(&ctx, input); Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c Thu Dec 13 05:11:23 2007 @@ -224,7 +224,7 @@ handle->speed = 0; handle->private_info = context; handle->interval = source->interval; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Opening Stream [%s] %dhz\n", path, handle->samplerate); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Opening Stream [%s] %dhz\n", path, handle->samplerate); switch_mutex_init(&context->audio_mutex, SWITCH_MUTEX_NESTED, handle->memory_pool); if (switch_buffer_create_dynamic(&context->audio_buffer, 512, 1024, 0) != SWITCH_STATUS_SUCCESS) { Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c Thu Dec 13 05:11:23 2007 @@ -780,21 +780,22 @@ ServerAddHandler(&globals.abyssServer, handler_hook); ServerAddHandler(&globals.abyssServer, auth_hook); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Starting HTTP Port %d, DocRoot [%s]\n", globals.port, SWITCH_GLOBAL_dirs.htdocs_dir); - while (globals.running) { - //ServerRunOnce2(&globals.abyssServer, ABYSS_FOREGROUND); - ServerRun(&globals.abyssServer); - } - + ServerRun(&globals.abyssServer); + globals.running = 0; - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_TERM; } SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown) { + globals.abyssServer.running = 0; - globals.running = 0; + shutdown(globals.abyssServer.listensock, 2); + while(globals.running) { + switch_yield(100000); + } return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_io.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_io.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_io.c Thu Dec 13 05:11:23 2007 @@ -200,6 +200,11 @@ read_frame = &session->raw_read_frame; break; case SWITCH_STATUS_NOOP: + if (session->read_resampler) { + switch_resample_destroy(&session->read_resampler); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating read resampler\n"); + } + status = SWITCH_STATUS_SUCCESS; break; case SWITCH_STATUS_BREAK: @@ -220,6 +225,7 @@ goto done; } } +#if 0 if (session->read_resampler) { short *data = read_frame->data; @@ -232,6 +238,7 @@ read_frame->datalen = session->read_resampler->to_len * 2; read_frame->rate = session->read_resampler->to_rate; } +#endif if (session->bugs) { switch_media_bug_t *bp, *dp, *last = NULL; @@ -518,6 +525,10 @@ case SWITCH_STATUS_BREAK: return SWITCH_STATUS_SUCCESS; case SWITCH_STATUS_NOOP: + if (session->write_resampler) { + switch_resample_destroy(&session->write_resampler); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating write resampler\n"); + } write_frame = frame; status = SWITCH_STATUS_SUCCESS; break; @@ -742,6 +753,10 @@ write_frame = &session->enc_write_frame; break; case SWITCH_STATUS_NOOP: + if (session->read_resampler) { + switch_resample_destroy(&session->read_resampler); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating read resampler\n"); + } enc_frame->codec = session->write_codec; enc_frame->samples = enc_frame->datalen / sizeof(int16_t); enc_frame->timestamp = frame->timestamp; Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_session.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_session.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_session.c Thu Dec 13 05:11:23 2007 @@ -684,7 +684,7 @@ switch_set_flag(session, SSF_DESTROYED); switch_core_session_rwunlock(session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Session %"SWITCH_SIZE_T_FMT" (%s) Ended\n", + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Session %"SWITCH_SIZE_T_FMT" (%s) Ended\n", session->id, switch_channel_get_name(session->channel)); switch_core_session_destroy(&session); return NULL; Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_state_machine.c ============================================================================== --- freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_state_machine.c (original) +++ freeswitch/branches/stkn/sofia-exp/trunk/src/switch_core_state_machine.c Thu Dec 13 05:11:23 2007 @@ -132,7 +132,7 @@ char *expanded = NULL; int nomedia = 0; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Execute %s(%s)\n", + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Execute %s(%s)\n", extension->current_application->application_name, switch_str_nil(extension->current_application->application_data)); if ((application_interface = switch_loadable_module_get_application_interface(extension->current_application->application_name)) == 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Application %s\n", extension->current_application->application_name);
participants (1)
-
Freeswitch SVN