Merge branch 'master' of git.freeswitch.org:freeswitch

This commit is contained in:
Andrew Thompson 2010-07-17 14:50:32 -04:00
commit 4441d64c37
26 changed files with 1178 additions and 440 deletions

View File

@ -22,6 +22,7 @@
<!-- <load module="mod_event_multicast"/> -->
<load module="mod_event_socket"/>
<!-- <load module="mod_zeroconf"/> -->
<!-- <load module="mod_erlang_event"/> -->
<!-- Directory Interfaces -->
<!-- <load module="mod_ldap"/> -->

View File

@ -7,13 +7,15 @@ freeswitch (1.0.7)
build: apply fix for MODSOFIA-71 to windows build
build: Add more excludes to .gitignore (for Windows) (r:b6628d26/FSBUILD-269)
build: Bump version of en-us-callie sounds to 1.0.13 (r:ca0a69a3)
build: change build to use mod_spandsp instead of mod_fax and mod_voipcodecs (r: 988147a7)
build: add mod_spandsp to windows build (r: 4fa8be62)
build: change build to use mod_spandsp instead of mod_fax and mod_voipcodecs (r:988147a7)
build: add mod_spandsp to windows build (r:4fa8be62)
build: merge -j option for bootstrap (r:abb7d2e5/FSBUILD-237)
build: dont fail on bootstrap due to missing libs (r:ff960d78)
config: move limit.conf to db.conf
config: Update VM phrase macros to voice option then action on main, config menus
config: Remove 99xx extension numbers to avoid dp conflicts (r:0c9bb174/DP-17)
config: update config example for caller-id-type (r:8f03a7cd)
config: default to 48k since most sound cards can do that (r: 170404a4)
config: default to 48k since most sound cards can do that (r:170404a4)
core: Add RTCP support (FSRTP-14)
core: handle some errors on missing db handle conditions
core: add ... and shutdown as a fail-safe when no modules are loaded
@ -45,8 +47,9 @@ freeswitch (1.0.7)
core: (Win) bridge fails because session read lock failure (r:f8f91362/FSCORE-606)
core: Add option to hangup channel if record fails (r:a3e6bead/FSBUILD-591)
core: Crash when using tab completion on uuid_ commands (r:9637b89e/FSCORE-613)
core: fix uuid_media state change (r: 2cc59f1e/FSCORE-615)
core: add new callstate field to channels table (r: 0f133eae)
core: fix uuid_media state change (r:2cc59f1e/FSCORE-615)
core: add new callstate field to channels table (r:0f133eae)
core: fix leg_timeout issue (r:3fbd9e21/MODAPP-433)
embedded languages: Provide core level support for conditional Set Global Variable (r:c017c24b/FSCORE-612)
lang: Improve French phrase files (FSCONFIG-23)
libdingaling: fix race on shutdown causing crash (FSMOD-47)
@ -59,7 +62,7 @@ freeswitch (1.0.7)
libsopenzap: Add CLI tracing
libspandsp: Fixed a typo in spandsp's msvc/inttypes.h Updated sig_tone processing in spandsp to the latest, to allow moy to proceed with his signaling work.
libspandsp: removed a saturate16 from spandsp that was causing problems fixed a typo in the MSVC inttypes.h file for spandsp
libspandsp: Changes to the signaling tone detector to detect concurrent 2400Hz + 2600Hz tones. This passes voice immunity and other key tests, but it bounces a bit when transitions like 2400 -> 2400+2600 -> 2600 occur. Transitions between tone off and tone on are clean. (r: bc13e944)
libspandsp: Changes to the signaling tone detector to detect concurrent 2400Hz + 2600Hz tones. This passes voice immunity and other key tests, but it bounces a bit when transitions like 2400 -> 2400+2600 -> 2600 occur. Transitions between tone off and tone on are clean. (r:bc13e944)
mod_avmd: Initial check in - Advanced Voicemail Detect (r:10c6a30a) (by Eric Des Courtis)
mod_avmd: Add to windows build (r:df4bd935)
mod_cidlookup: null xml is bad (r:095815f8)
@ -67,9 +70,8 @@ freeswitch (1.0.7)
mod_commands: make break uuid_break and add cascade flag
mod_commands: add uuid_autoanswer command (now uuid_phone_event)
mod_commands: expand last patch to do hold as well and rename the command to uuid_phone_event
mod_commands: make break uuid_break and add cascade flag
mod_commands: allow uuid_break to interrupt one or all in a delimited string of files the same as several individual files (r: eba05c3c)
mod_commands: add show channels count auto-completion for mod_commands (r: 5ffc57e5/FSMOD-54)
mod_commands: allow uuid_break to interrupt one or all in a delimited string of files the same as several individual files (r:eba05c3c)
mod_commands: add show channels count auto-completion for mod_commands (r:5ffc57e5/FSMOD-54)
mod_conference: Fix reporting of volume up/down (MODAPP-419)
mod_conference: add last talking time per member to conference xml list
mod_conference: add terminate-on-silence conference param
@ -78,6 +80,8 @@ freeswitch (1.0.7)
mod_conference: fix relate nohear (r:f029ce07/MODAPP-428)
mod_db: fix stack corruption (MODAPP-407)
mod_dptools: add eavesdrop_enable_dtmf chan var (r:596c0012)
mod_dptools: Make park app not send 183 session progress (r:76932995/FSCORE-567)
mod_dptools: add block_dtmf and unblock_dtmf apps (r:d9eb0197)
mod_fifo: allow multiple dtmf to exit fifo, set fifo_caller_exit_key to specify which (MODAPP-420)
mod_freetdm: Fix for TON and NPI not passed through to channel variables on incoming calls
mod_freetdm: add pvt data to freetdm channels fix fxs features (r:9d456900)
@ -93,19 +97,19 @@ freeswitch (1.0.7)
mod_freetdm: run sched in the background if requested (r:22e8a442)
mod_freetdm: fix makefile and remove binary app (r:63d9768d)
mod_freetdm: add trace/notrace commands to trace input and output from channels (r:f4da0e5c)
mod_freetdm: add logging when failing to read a frame in mod_freetdm (r: e596fc2e)
mod_freetdm: add new logging macro (r: 75be3da8)
mod_freetdm: check for hw dtmf before enabling (r: b1fd88d7)
mod_freetdm: adding ftmod_sangoma_ss7 support (r: 94283355)
mod_freetdm: added SIGEVENT_COLLISION (r: 501f8704)
mod_freetdm: add logging when failing to read a frame in mod_freetdm (r:e596fc2e)
mod_freetdm: add new logging macro (r:75be3da8)
mod_freetdm: check for hw dtmf before enabling (r:b1fd88d7)
mod_freetdm: adding ftmod_sangoma_ss7 support (r:94283355)
mod_freetdm: added SIGEVENT_COLLISION (r:501f8704)
mod_gsmopen: copy from branch
mod_java: fix eventConsumer issue and add flush() method (r:7fd3aff6)
mod_java: Allow user defined java methods to be called at startup and shutdown of JVM (r: 1339e218/MODLANG-117)
mod_java: Allow user defined java methods to be called at startup and shutdown of JVM (r:1339e218/MODLANG-117)
mod_lcr: Expand variables (MODAPP-418)
mod_lcr: add enable_sip_redir parameter (r:70bf7a0a/MODAPP-427)
mod_loopback: add loopback_bowout_on_execute var to make 1 legged loopback calls bow out of the picture
mod_loopback: only execute app once in app mode (r: 64f58f2d)
mod_managed: Added wrapper for switch_event_bind for .net (r: a5f07a80/MODLANG-165)
mod_loopback: only execute app once in app mode (r:64f58f2d)
mod_managed: Added wrapper for switch_event_bind for .net (r:a5f07a80/MODLANG-165)
mod_mp4v: MP4V-ES passthru for washibechi on IRC
mod_nibblebill: free allocated mem at shutdown; free properly if using custom_sql
mod_nibblebill: Add SAF_SUPPORT_NOMEDIA to nibblebill
@ -122,7 +126,7 @@ freeswitch (1.0.7)
mod_sangoma_codec: Add sample config file
mod_sangoma_codec: added load/noload options for the supported codecs
mod_sangoma_codec: rename load/noload to register/noregister
mod_sangoma_codec: silence suppression (r: 73d9d56f)
mod_sangoma_codec: silence suppression (r:73d9d56f)
mod_say_es: fix grammar when saying dates and time (r:6bed19b2/MODAPP-429)
mod_say_zh: Number reading should now be OK for the whole range of integers for Cantonese and Mandarin
mod_skinny: Add the missing api files
@ -154,12 +158,14 @@ freeswitch (1.0.7)
mod_sofia: fire an event for gateway ping
mod_sofia: initial handling of udptl and t.38 re-invite
mod_sofia: Implement "redirect server" functionality with 300 Multiple Choices (r:e15abcf9/BOUNTY-18)
mod_sofia: allow video negotiation on re-invite (r: be92e5d/SFSIP-211)
mod_sofia: use rfc recommended default session timeout of 30 min according to RFC 4028 4.2 (r: 52cd8cdd/MODSOFIA-76)
mod_sofia: add sip_force_audio_fmtp (r: 6360264f)
mod_sofia: add sip_copy_multipart to work like sip_copy_custom_headers (r: a291af57)
mod_sofia: Rename sofia_glue_get_user_host to switch_split_user_domain and move to switch_utils. To allow use by other modules. (r: 3f7cafd7)
mod_sofia: allow the profile gateway config to set sip_cid_type for each gateway (r: 0152706f/BOUNTY-19)
mod_sofia: allow video negotiation on re-invite (r:be92e5d/SFSIP-211)
mod_sofia: use rfc recommended default session timeout of 30 min according to RFC 4028 4.2 (r:52cd8cdd/MODSOFIA-76)
mod_sofia: add sip_force_audio_fmtp (r:6360264f)
mod_sofia: add sip_copy_multipart to work like sip_copy_custom_headers (r:a291af57)
mod_sofia: Rename sofia_glue_get_user_host to switch_split_user_domain and move to switch_utils. To allow use by other modules. (r:3f7cafd7)
mod_sofia: allow the profile gateway config to set sip_cid_type for each gateway (r:0152706f/BOUNTY-19)
mod_sofia: Adding subject to SEND_MESSAGE (r:2e347c93)
mod_sofia: add multiple rtp-ip support to sofia profiles add extra rtp-ip params to a profile to add more ip which will be used round-robin as new calls progress. (r:22569d4a)
mod_spandsp: initial checkin of mod_fax/mod_voipcodecs merge into mod_spandsp (r:fa9a59a8)
mod_spandsp: rework of new mod_spandsp to have functions broken up into different c files (r:65400642)
mod_spandsp: improve duplicate digit detection and add 'min_dup_digit_spacing_ms' channel variable for use with the dtmf detector (r:eab4f246/FSMOD-45)
@ -175,9 +181,9 @@ freeswitch (1.0.7)
mod_xml_cdr: add force_process_cdr var to process b leg cdr on a case by case basis when b leg cdr is disabled (XML-17)
mod_xml_cdr: add leg param to query string (XML-24)
mod_xml_cdr: fix locked sessions (XML-26)
mod_xml_cdr: fix minor memory leaks and config bug (r: 19253d83/MODEVENT-62)
mod_xml_cdr: fix minor memory leaks and config bug (r:19253d83/MODEVENT-62)
sofia-sip: fix null derefernce segfault in soa (r:f356c5e6)
sofia-sip: extend timeout for session expires on short timeouts to be 90% of timeout instead of 1/3 to handle devices that do not refresh in time such as polycom (r: a7f48928/SFSIP-212)
sofia-sip: extend timeout for session expires on short timeouts to be 90% of timeout instead of 1/3 to handle devices that do not refresh in time such as polycom (r:a7f48928/SFSIP-212)
freeswitch (1.0.6)

View File

@ -355,7 +355,7 @@ const char *ESLevent::serialize(const char *format)
return "";
}
if (!strcasecmp(format, "json")) {
if (format && !strcasecmp(format, "json")) {
esl_event_serialize_json(event, &serialized_string);
return serialized_string;
}

View File

@ -1031,6 +1031,10 @@ tryagain:
ftdm_set_string(ftdmchan->caller_data.ani.digits, (char *)event->calling.digits);
ftdm_set_string(ftdmchan->caller_data.dnis.digits, (char *)event->called.digits);
ftdm_set_string(ftdmchan->caller_data.rdnis.digits, (char *)event->rdnis.digits);
if (event->custom_data_size) {
ftdm_set_string(ftdmchan->caller_data.raw_data, event->custom_data);
ftdmchan->caller_data.raw_data_len = event->custom_data_size;
}
if (strlen(event->calling_name)) {
ftdm_set_string(ftdmchan->caller_data.cid_name, (char *)event->calling_name);

View File

@ -48,19 +48,19 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\w32\extlib.props" />
<Import Project="..\..\w32\extdll.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\w32\extlib.props" />
<Import Project="..\..\w32\extdll.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\w32\extlib.props" />
<Import Project="..\..\w32\extdll.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\w32\extlib.props" />
<Import Project="..\..\w32\extdll.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
@ -79,7 +79,6 @@
<EnablePREfast>true</EnablePREfast>
</ClCompile>
<Link>
<ModuleDefinitionFile>$(ProjectDir)teletone.def</ModuleDefinitionFile>
<OptimizeReferences>false</OptimizeReferences>
<EnableCOMDATFolding>false</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@ -102,7 +101,6 @@
<EnablePREfast>true</EnablePREfast>
</ClCompile>
<Link>
<ModuleDefinitionFile>$(ProjectDir)teletone.def</ModuleDefinitionFile>
<OptimizeReferences>false</OptimizeReferences>
<EnableCOMDATFolding>false</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@ -120,7 +118,6 @@
<EnablePREfast>true</EnablePREfast>
</ClCompile>
<Link>
<ModuleDefinitionFile>$(ProjectDir)teletone.def</ModuleDefinitionFile>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
</Link>
</ItemDefinitionGroup>
@ -137,7 +134,6 @@
<EnablePREfast>true</EnablePREfast>
</ClCompile>
<Link>
<ModuleDefinitionFile>$(ProjectDir)teletone.def</ModuleDefinitionFile>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<TargetMachine>MachineX64</TargetMachine>
</Link>

View File

@ -73,17 +73,10 @@
if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\..\apr-util\include\apu.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu.h"
if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_config.h"
if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_want.h"</Command>
if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_want.h"
xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
</Command>
</PreBuildEvent>
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>$(IntDir)libaprutil.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<AdditionalOptions>/EHsc %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
@ -100,7 +93,6 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -111,12 +103,7 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(IntDir)libaprutil.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PreBuildEvent>
@ -125,17 +112,9 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\.
if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_config.h"
if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_want.h"
xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
</Command>
</PreBuildEvent>
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>$(IntDir)libaprutil.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<AdditionalOptions>/EHsc %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
@ -152,7 +131,6 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -163,12 +141,7 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(IntDir)libaprutil.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
@ -177,17 +150,9 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\.
if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_config.h"
if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_want.h"
xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
</Command>
</PreBuildEvent>
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>$(IntDir)libaprutil.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
@ -206,7 +171,6 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -214,17 +178,11 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir
<OptimizeReferences>true</OptimizeReferences>
<BaseAddress>0x6EE60000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)libaprutil-1.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(IntDir)libaprutil.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
@ -233,17 +191,9 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\.
if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_config.h"
if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" &gt; "$(ProjectDir)..\..\apr-util\include\apu_want.h"
xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
</Command>
</PreBuildEvent>
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>$(IntDir)libaprutil.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
@ -262,7 +212,6 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -274,12 +223,7 @@ if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(IntDir)libaprutil.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\apr-util\buckets\apr_brigade.c">

View File

@ -70,6 +70,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command>if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" &gt; "$(ProjectDir)..\..\apr\include\apr.h"
xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
</Command>
</PreBuildEvent>
<ClCompile>
@ -88,7 +89,6 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -100,16 +100,12 @@
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(IntDir)libapr.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PreBuildEvent>
<Command>if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" &gt; "$(ProjectDir)..\..\apr\include\apr.h"
xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
</Command>
</PreBuildEvent>
<ClCompile>
@ -128,7 +124,6 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -138,16 +133,12 @@
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(IntDir)libapr.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command>if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" &gt; "$(ProjectDir)..\..\apr\include\apr.h"
xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
</Command>
</PreBuildEvent>
<ClCompile>
@ -168,7 +159,6 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -179,16 +169,12 @@
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(IntDir)libapr.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
<Command>if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" &gt; "$(ProjectDir)..\..\apr\include\apr.h"
xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
</Command>
</PreBuildEvent>
<ClCompile>
@ -209,7 +195,6 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -220,12 +205,7 @@
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(IntDir)libapr.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\apr\atomic\win32\apr_atomic.c" />

View File

@ -120,12 +120,6 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\pcre;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -136,27 +130,11 @@
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\pcre;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -167,27 +145,8 @@
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
@ -199,27 +158,11 @@
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
@ -231,16 +174,6 @@
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Bscmake>

View File

@ -166,6 +166,7 @@ struct switch_core_session {
uint32_t track_duration;
uint32_t track_id;
switch_log_level_t loglevel;
uint32_t soft_lock;
};
struct switch_media_bug {

View File

@ -483,6 +483,7 @@ SWITCH_DECLARE(unsigned int) switch_core_session_started(_In_ switch_core_sessio
SWITCH_DECLARE(void *) switch_core_perform_permanent_alloc(_In_ switch_size_t memory, _In_z_ const char *file, _In_z_ const char *func, _In_ int line);
/*!
\brief Allocate memory from the main pool with no intention of returning it
\param _memory the number of bytes to allocate
@ -698,6 +699,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_loglevel(switch_core_ses
*/
SWITCH_DECLARE(switch_log_level_t) switch_core_session_get_loglevel(switch_core_session_t *session);
SWITCH_DECLARE(void) switch_core_session_soft_lock(switch_core_session_t *session, uint32_t sec);
SWITCH_DECLARE(void) switch_core_session_soft_unlock(switch_core_session_t *session);
/*!
\brief Retrieve the unique identifier from the core
\return a string representing the uuid
@ -1973,6 +1979,7 @@ SWITCH_DECLARE(void) switch_core_memory_reclaim_events(void);
SWITCH_DECLARE(void) switch_core_memory_reclaim_logger(void);
SWITCH_DECLARE(void) switch_core_memory_reclaim_all(void);
SWITCH_DECLARE(void) switch_core_setrlimits(void);
SWITCH_DECLARE(switch_time_t) switch_time_ref(void);
SWITCH_DECLARE(void) switch_time_sync(void);
/*!
\brief Get the current epoch time

View File

@ -235,9 +235,9 @@ SWITCH_STANDARD_API(time_test_function)
}
for (x = 1; x <= max; x++) {
then = switch_time_now();
then = switch_time_ref();
switch_yield(mss);
now = switch_time_now();
now = switch_time_ref();
diff = (int) (now - then);
stream->write_function(stream, "test %d sleep %ld %d\n", x, mss, diff);
total += diff;
@ -299,17 +299,17 @@ SWITCH_STANDARD_API(timer_test_function)
goto end;
}
start = switch_time_now();
start = switch_time_ref();
for (x = 1; x <= max; x++) {
then = switch_time_now();
then = switch_time_ref();
switch_core_timer_next(&timer);
now = switch_time_now();
now = switch_time_ref();
diff = (int) (now - then);
//stream->write_function(stream, "test %d sleep %ld %d\n", x, mss, diff);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Timer Test: %d sleep %d %d\n", x, mss, diff);
total += diff;
}
end = switch_time_now();
end = switch_time_ref();
switch_yield(250000);
@ -1599,7 +1599,7 @@ SWITCH_STANDARD_API(ctl_function)
arg = atoi(argv[1]);
}
switch_core_session_ctl(SCSC_MAX_SESSIONS, &arg);
stream->write_function(stream, "+OK max sessions: %f\n", arg);
stream->write_function(stream, "+OK max sessions: %d\n", arg);
} else if (!strcasecmp(argv[0], "min_idle_cpu")) {
double d = -1;
@ -4279,12 +4279,17 @@ end:
return SWITCH_STATUS_SUCCESS;
}
#define LIMIT_HASH_USAGE_USAGE "<backend> <realm> <id> [rate]"
#define LIMIT_HASH_USAGE_USAGE "<realm> <id> [rate] (Using deprecated limit api, check limit_usage with backend param)"
SWITCH_STANDARD_API(limit_hash_usage_function)
{
char *mydata = NULL;
mydata = switch_core_session_sprintf(session, "hash %s", cmd);
return limit_usage_function(mydata, session, stream);
if (!zstr(cmd)) {
mydata = switch_core_session_sprintf(session, "hash %s", cmd);
return limit_usage_function(mydata, session, stream);
} else {
stream->write_function(stream, "USAGE: limit_hash_usage %s\n", LIMIT_HASH_USAGE_USAGE);
return SWITCH_STATUS_SUCCESS;
}
}
#define LIMIT_STATUS_USAGE "<backend>"

View File

@ -2688,6 +2688,15 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
}
switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
switch_assert(params);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "as_channel", "true");
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "action", "user_call");
if (var_event) {
switch_event_merge(params, var_event);
}
if (var_event && (skip = switch_event_get_header(var_event, "user_recurse_variables")) && switch_false(skip)) {
if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) || (var = switch_event_get_header(var_event, "leg_timeout"))) {
timelimit = atoi(var);
@ -2695,13 +2704,6 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
var_event = NULL;
}
switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
switch_assert(params);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "as_channel", "true");
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "action", "user_call");
if (switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, &x_group, params) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n", user, domain);
cause = SWITCH_CAUSE_SUBSCRIBER_ABSENT;

File diff suppressed because it is too large Load Diff

View File

@ -486,8 +486,35 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_hash_load)
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown)
{
switch_hash_index_t *hi = NULL;
switch_scheduler_del_task_group("mod_hash");
switch_thread_rwlock_wrlock(globals.limit_hash_rwlock);
switch_thread_rwlock_wrlock(globals.db_hash_rwlock);
while ((hi = switch_hash_first(NULL, globals.limit_hash))) {
void *val = NULL;
const void *key;
switch_ssize_t keylen;
switch_hash_this(hi, &key, &keylen, &val);
free(val);
switch_core_hash_delete(globals.limit_hash, key);
}
while ((hi = switch_hash_first(NULL, globals.db_hash))) {
void *val = NULL;
const void *key;
switch_ssize_t keylen;
switch_hash_this(hi, &key, &keylen, &val);
free(val);
switch_core_hash_delete(globals.db_hash, key);
}
switch_thread_rwlock_unlock(globals.limit_hash_rwlock);
switch_thread_rwlock_unlock(globals.db_hash_rwlock);
switch_thread_rwlock_destroy(globals.db_hash_rwlock);
switch_thread_rwlock_destroy(globals.limit_hash_rwlock);

View File

@ -1311,11 +1311,11 @@ static switch_call_cause_t lcr_outgoing_channel(switch_core_session_t *session,
if (lcr_do_lookup(&routes) == SWITCH_STATUS_SUCCESS) {
if (channel) {
if (zstr(switch_channel_get_variable(channel, "import"))) {
switch_channel_set_variable(channel, "import", "lcr_carrier,lcr_rate");
switch_channel_set_variable(channel, "import", "lcr_carrier,lcr_rate,lcr_user_rate");
} else {
const char *tmp = switch_channel_get_variable(channel, "import");
if (!strstr(tmp, "lcr_carrier,lcr_rate")) {
switch_channel_set_variable_printf(channel, "import", "%s,lcr_carrier,lcr_rate", tmp);
if (!strstr(tmp, "lcr_carrier,lcr_rate,lcr_user_rate")) {
switch_channel_set_variable_printf(channel, "import", "%s,lcr_carrier,lcr_rate,lcr_user_rate", tmp);
}
}
}
@ -1440,11 +1440,11 @@ SWITCH_STANDARD_DIALPLAN(lcr_dialplan_hunt)
switch_channel_set_variable(channel, SWITCH_CONTINUE_ON_FAILURE_VARIABLE, "true");
switch_channel_set_variable(channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, "true");
if (zstr(switch_channel_get_variable(channel, "import"))) {
switch_channel_set_variable(channel, "import", "lcr_carrier,lcr_rate");
switch_channel_set_variable(channel, "import", "lcr_carrier,lcr_rate,lcr_user_rate");
} else {
const char *tmp = switch_channel_get_variable(channel, "import");
if (!strstr(tmp, "lcr_carrier,lcr_rate")) {
switch_channel_set_variable_printf(channel, "import", "%s,lcr_carrier,lcr_rate", tmp);
if (!strstr(tmp, "lcr_carrier,lcr_rate,lcr_user_rate")) {
switch_channel_set_variable_printf(channel, "import", "%s,lcr_carrier,lcr_rate,lcr_user_rate", tmp);
}
}
@ -1589,11 +1589,11 @@ SWITCH_STANDARD_APP(lcr_app_function)
switch_channel_set_variable(channel, "lcr_route_count", vbuf);
switch_channel_set_variable(channel, "lcr_auto_route", (char *)dig_stream.data);
if (zstr(switch_channel_get_variable(channel, "import"))) {
switch_channel_set_variable(channel, "import", "lcr_carrier,lcr_rate");
switch_channel_set_variable(channel, "import", "lcr_carrier,lcr_rate,lcr_user_rate");
} else {
const char *tmp = switch_channel_get_variable(channel, "import");
if (!strstr(tmp, "lcr_carrier,lcr_rate")) {
switch_channel_set_variable_printf(channel, "import", "%s,lcr_carrier,lcr_rate", tmp);
if (!strstr(tmp, "lcr_carrier,lcr_rate,lcr_user_rate")) {
switch_channel_set_variable_printf(channel, "import", "%s,lcr_carrier,lcr_rate,lcr_user_rate", tmp);
}
}
free(dig_stream.data);

View File

@ -684,6 +684,12 @@ void sofia_event_callback(nua_event_t event,
int locked = 0;
int check_destroy = 1;
if (!sofia_test_pflag(profile, PFLAG_RUNNING)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Profile is shutting down.\n");
return;
}
/* sofia_private will be == &mod_sofia_globals.keep_private whenever a request is done with a new handle that has to be
freed whenever the request is done */
if (nh && sofia_private == &mod_sofia_globals.keep_private) {

View File

@ -1823,7 +1823,7 @@ static JSBool session_set_variable(JSContext * cx, JSObject * obj, uintN argc, j
var = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
val = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
switch_channel_set_variable(channel, var, val);
switch_channel_set_variable_var_check(channel, var, val, SWITCH_FALSE);
*rval = BOOLEAN_TO_JSVAL(JS_TRUE);
} else {
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);

View File

@ -1072,18 +1072,19 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t
SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state)
{
switch_channel_state_t state, mystate, ostate;
ostate = switch_channel_get_state(channel);
switch_channel_state_t state, mystate;
for (;;) {
state = switch_channel_get_running_state(other_channel);
if (other_channel) {
state = switch_channel_get_running_state(other_channel);
}
mystate = switch_channel_get_running_state(channel);
if ((channel->state == channel->running_state && channel->running_state == want_state) ||
other_channel->state >= CS_HANGUP || channel->state >= CS_HANGUP) {
(other_channel && other_channel->state >= CS_HANGUP) || channel->state >= CS_HANGUP) {
break;
}
switch_cond_next();
switch_yield(20000);
}
}
@ -1225,16 +1226,22 @@ SWITCH_DECLARE(char *) switch_channel_get_cap_string(switch_channel_t *channel)
SWITCH_DECLARE(void) switch_channel_set_flag_value(switch_channel_t *channel, switch_channel_flag_t flag, uint32_t value)
{
int HELD = 0;
switch_assert(channel);
switch_assert(channel->flag_mutex);
switch_mutex_lock(channel->flag_mutex);
if (flag == CF_LEG_HOLDING && !channel->flags[flag] && channel->flags[CF_ANSWERED]) {
switch_channel_set_callstate(channel, CCS_HELD);
HELD = 1;
}
channel->flags[flag] = value;
switch_mutex_unlock(channel->flag_mutex);
if (HELD) {
switch_channel_set_callstate(channel, CCS_HELD);
}
if (flag == CF_OUTBOUND) {
switch_channel_set_variable(channel, "is_outbound", "true");
}
@ -1316,16 +1323,22 @@ SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, sw
SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flag)
{
int ACTIVE = 0;
switch_assert(channel != NULL);
switch_assert(channel->flag_mutex);
switch_mutex_lock(channel->flag_mutex);
if (flag == CF_LEG_HOLDING && channel->flags[flag] && channel->flags[CF_ANSWERED]) {
switch_channel_set_callstate(channel, CCS_ACTIVE);
ACTIVE = 1;
}
channel->flags[flag] = 0;
switch_mutex_unlock(channel->flag_mutex);
if (ACTIVE) {
switch_channel_set_callstate(channel, CCS_ACTIVE);
}
if (flag == CF_OUTBOUND) {
switch_channel_set_variable(channel, "is_outbound", NULL);
}
@ -1761,6 +1774,11 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Presence-Data", v);
}
if ((v = switch_channel_get_variable(channel, "presence_data_cols"))) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Presence-Data-Cols", v);
}
if ((v = switch_channel_get_variable(channel, "call_uuid"))) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Call-UUID", v);
}
@ -1813,13 +1831,15 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
SWITCH_DECLARE(void) switch_channel_event_set_extended_data(switch_channel_t *channel, switch_event_t *event)
{
switch_event_header_t *hi;
int x, global_verbos_events = 0;
int x, global_verbose_events = 0;
switch_mutex_lock(channel->profile_mutex);
switch_core_session_ctl(SCSC_VERBOSE_EVENTS, &global_verbos_events);
switch_core_session_ctl(SCSC_VERBOSE_EVENTS, &global_verbose_events);
if (global_verbos_events || switch_channel_test_flag(channel, CF_VERBOSE_EVENTS) ||
if (global_verbose_events ||
switch_channel_test_flag(channel, CF_VERBOSE_EVENTS) ||
switch_event_get_header(event, "presence-data-cols") ||
event->event_id == SWITCH_EVENT_CHANNEL_CREATE ||
event->event_id == SWITCH_EVENT_CHANNEL_ORIGINATE ||
event->event_id == SWITCH_EVENT_CHANNEL_UUID ||

View File

@ -38,6 +38,16 @@
struct switch_session_manager session_manager;
SWITCH_DECLARE(void) switch_core_session_soft_lock(switch_core_session_t *session, uint32_t sec)
{
session->soft_lock = sec;
}
SWITCH_DECLARE(void) switch_core_session_soft_unlock(switch_core_session_t *session)
{
session->soft_lock = 0;
}
#ifdef SWITCH_DEBUG_RWLOCKS
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(const char *uuid_str, const char *file, const char *func, int line)
#else
@ -569,11 +579,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit
switch_assert(session != NULL);
if (switch_channel_down(session->channel)) {
return SWITCH_STATUS_FALSE;
}
if ((status = switch_core_session_read_lock(session)) != SWITCH_STATUS_SUCCESS) {
if ((status = switch_core_session_read_lock_hangup(session)) != SWITCH_STATUS_SUCCESS) {
return status;
}
@ -610,7 +616,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit
goto end;
}
if (session->endpoint_interface->io_routines->receive_message) {
if (switch_channel_down(session->channel)) {
switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG, "%s skip receive message [%s] (channel is hungup already)\n",
switch_channel_get_name(session->channel), message_names[message->message_id]);
} else if (session->endpoint_interface->io_routines->receive_message) {
status = session->endpoint_interface->io_routines->receive_message(session, message);
}
@ -626,28 +637,29 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit
message->_func = NULL;
message->_line = 0;
switch (message->message_id) {
case SWITCH_MESSAGE_REDIRECT_AUDIO:
case SWITCH_MESSAGE_INDICATE_ANSWER:
case SWITCH_MESSAGE_INDICATE_PROGRESS:
case SWITCH_MESSAGE_INDICATE_BRIDGE:
case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
case SWITCH_MESSAGE_INDICATE_TRANSFER:
case SWITCH_MESSAGE_INDICATE_RINGING:
case SWITCH_MESSAGE_INDICATE_MEDIA:
case SWITCH_MESSAGE_INDICATE_NOMEDIA:
case SWITCH_MESSAGE_INDICATE_HOLD:
case SWITCH_MESSAGE_INDICATE_UNHOLD:
case SWITCH_MESSAGE_INDICATE_REDIRECT:
case SWITCH_MESSAGE_INDICATE_RESPOND:
case SWITCH_MESSAGE_INDICATE_BROADCAST:
case SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT:
case SWITCH_MESSAGE_INDICATE_DEFLECT:
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
break;
default:
break;
if (switch_channel_up(session->channel)) {
switch (message->message_id) {
case SWITCH_MESSAGE_REDIRECT_AUDIO:
case SWITCH_MESSAGE_INDICATE_ANSWER:
case SWITCH_MESSAGE_INDICATE_PROGRESS:
case SWITCH_MESSAGE_INDICATE_BRIDGE:
case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
case SWITCH_MESSAGE_INDICATE_TRANSFER:
case SWITCH_MESSAGE_INDICATE_RINGING:
case SWITCH_MESSAGE_INDICATE_MEDIA:
case SWITCH_MESSAGE_INDICATE_NOMEDIA:
case SWITCH_MESSAGE_INDICATE_HOLD:
case SWITCH_MESSAGE_INDICATE_UNHOLD:
case SWITCH_MESSAGE_INDICATE_REDIRECT:
case SWITCH_MESSAGE_INDICATE_RESPOND:
case SWITCH_MESSAGE_INDICATE_BROADCAST:
case SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT:
case SWITCH_MESSAGE_INDICATE_DEFLECT:
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
break;
default:
break;
}
}
end:
@ -1172,6 +1184,21 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t *thre
switch_core_session_run(session);
switch_core_media_bug_remove_all(session);
if (session->soft_lock) {
uint32_t loops = session->soft_lock * 10;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Session %" SWITCH_SIZE_T_FMT " (%s) Soft-Locked, "
"Waiting %u for external entities\n",
session->id, switch_channel_get_name(session->channel), session->soft_lock);
while(--loops > 0) {
if (!session->soft_lock) break;
switch_yield(100000);
}
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Session %" SWITCH_SIZE_T_FMT " (%s) Locked, Waiting on external entities\n",
session->id, switch_channel_get_name(session->channel));
switch_core_session_write_lock(session);

View File

@ -964,6 +964,45 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
return NULL;
}
static char *parse_presence_data_cols(switch_event_t *event)
{
char *cols[25] = { 0 };
int col_count = 0;
char *data_copy;
switch_stream_handle_t stream = { 0 };
int i;
char *r;
char col_name[128] = "";
const char *data = switch_event_get_header(event, "presence-data-cols");
if (zstr(data)) {
return NULL;
}
data_copy = strdup(data);
col_count = switch_split(data_copy, ':', cols);
SWITCH_STANDARD_STREAM(stream);
for (i = 0; i < col_count; i++) {
switch_snprintf(col_name, sizeof(col_name), "variable_%s", cols[i]);
stream.write_function(&stream, "%q='%q',", cols[i], switch_event_get_header_nil(event, col_name));
}
r = (char *) stream.data;
if (end_of(r) == ',') {
end_of(r) = '\0';
}
switch_safe_free(data_copy);
return r;
}
#define MAX_SQL 5
#define new_sql() switch_assert(sql_idx+1 < MAX_SQL); sql[sql_idx++]
@ -971,6 +1010,7 @@ static void core_event_handler(switch_event_t *event)
{
char *sql[MAX_SQL] = { 0 };
int sql_idx = 0;
char *extra_cols;
switch_assert(event);
@ -1053,7 +1093,8 @@ static void core_event_handler(switch_event_t *event)
break;
case SWITCH_EVENT_CHANNEL_HOLD:
case SWITCH_EVENT_CHANNEL_UNHOLD:
case SWITCH_EVENT_CHANNEL_EXECUTE:
case SWITCH_EVENT_CHANNEL_EXECUTE: {
new_sql() = switch_mprintf("update channels set application='%q',application_data='%q',"
"presence_id='%q',presence_data='%q' where uuid='%q' and hostname='%q'",
switch_event_get_header_nil(event, "application"),
@ -1061,18 +1102,30 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname")
);
}
break;
case SWITCH_EVENT_CHANNEL_ORIGINATE:
{
new_sql() = switch_mprintf("update channels set "
"presence_id='%q',presence_data='%q', call_uuid='%q' where uuid='%q' and hostname='%q'",
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
switch_event_get_header_nil(event, "channel-call-uuid"),
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
if ((extra_cols = parse_presence_data_cols(event))) {
new_sql() = switch_mprintf("update channels set "
"presence_id='%q',presence_data='%q', call_uuid='%q',%s where uuid='%q' and hostname='%q'",
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
switch_event_get_header_nil(event, "channel-call-uuid"),
extra_cols,
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
free(extra_cols);
} else {
new_sql() = switch_mprintf("update channels set "
"presence_id='%q',presence_data='%q', call_uuid='%q' where uuid='%q' and hostname='%q'",
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
switch_event_get_header_nil(event, "channel-call-uuid"),
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
}
}
@ -1124,19 +1177,37 @@ static void core_event_handler(switch_event_t *event)
case CS_DESTROY:
break;
case CS_ROUTING:
new_sql() = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',"
"ip_addr='%s',dest='%q',dialplan='%q',context='%q',presence_id='%q',presence_data='%q' "
"where uuid='%s' and hostname='%q'",
switch_event_get_header_nil(event, "channel-state"),
switch_event_get_header_nil(event, "caller-caller-id-name"),
switch_event_get_header_nil(event, "caller-caller-id-number"),
switch_event_get_header_nil(event, "caller-network-addr"),
switch_event_get_header_nil(event, "caller-destination-number"),
switch_event_get_header_nil(event, "caller-dialplan"),
switch_event_get_header_nil(event, "caller-context"),
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
if ((extra_cols = parse_presence_data_cols(event))) {
new_sql() = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',"
"ip_addr='%s',dest='%q',dialplan='%q',context='%q',presence_id='%q',presence_data='%q',%s "
"where uuid='%s' and hostname='%q'",
switch_event_get_header_nil(event, "channel-state"),
switch_event_get_header_nil(event, "caller-caller-id-name"),
switch_event_get_header_nil(event, "caller-caller-id-number"),
switch_event_get_header_nil(event, "caller-network-addr"),
switch_event_get_header_nil(event, "caller-destination-number"),
switch_event_get_header_nil(event, "caller-dialplan"),
switch_event_get_header_nil(event, "caller-context"),
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
extra_cols,
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
free(extra_cols);
} else {
new_sql() = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',"
"ip_addr='%s',dest='%q',dialplan='%q',context='%q',presence_id='%q',presence_data='%q' "
"where uuid='%s' and hostname='%q'",
switch_event_get_header_nil(event, "channel-state"),
switch_event_get_header_nil(event, "caller-caller-id-name"),
switch_event_get_header_nil(event, "caller-caller-id-number"),
switch_event_get_header_nil(event, "caller-network-addr"),
switch_event_get_header_nil(event, "caller-destination-number"),
switch_event_get_header_nil(event, "caller-dialplan"),
switch_event_get_header_nil(event, "caller-context"),
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
}
break;
default:
new_sql() = switch_mprintf("update channels set state='%s' where uuid='%s' and hostname='%q'",

View File

@ -623,7 +623,7 @@ SWITCH_DECLARE(void) CoreSession::setVariable(char *var, char *val)
{
this_check_void();
sanity_check_noreturn;
switch_channel_set_variable(channel, var, val);
switch_channel_set_variable_var_check(channel, var, val, SWITCH_FALSE);
}
SWITCH_DECLARE(const char *)CoreSession::getVariable(char *var)

View File

@ -1062,8 +1062,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a,
int var_count = 0;
char *next;
vdata = strdup(data);
vdatap = vdata;
vdatap = strdup(data);
vdata = vdatap;
end = switch_find_end_paren(vdata, a, b);
@ -1081,7 +1081,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a,
vdata++;
*end++ = '\0';
} else {
vdata = NULL;
free(vdatap);
return SWITCH_STATUS_FALSE;
}

View File

@ -515,12 +515,6 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
switch_safe_free(stream.data);
}
msg.string_arg = data->b_uuid;
msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE;
msg.from = __FILE__;
switch_core_session_receive_message(session_a, &msg);
if (!inner_bridge && switch_channel_up(chan_a)) {
if ((app_name = switch_channel_get_variable(chan_a, SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE))) {
switch_caller_extension_t *extension = NULL;
@ -1048,6 +1042,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
int inner_bridge = switch_channel_test_flag(caller_channel, CF_INNER_BRIDGE);
const char *var;
switch_call_cause_t cause;
switch_core_session_message_t msg = { 0 };
if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Call has no media... Redirecting to signal bridge.\n");
@ -1084,7 +1079,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
if (switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA) ||
switch_channel_test_flag(peer_channel, CF_RING_READY)) {
switch_core_session_message_t msg = { 0 };
const char *app, *data;
switch_channel_set_state(peer_channel, CS_CONSUME_MEDIA);
@ -1250,6 +1244,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
switch_event_fire(&event);
}
msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE;
msg.from = __FILE__;
msg.string_arg = switch_core_session_strdup(peer_session, switch_core_session_get_uuid(session));
switch_core_session_receive_message(peer_session, &msg);
msg.string_arg = switch_core_session_strdup(session, switch_core_session_get_uuid(peer_session));
switch_core_session_receive_message(session, &msg);
state = switch_channel_get_state(caller_channel);

View File

@ -32,6 +32,8 @@
*/
#include <switch.h>
#define QUOTED_ESC_COMMA 1
#define UNQUOTED_ESC_COMMA 2
static const switch_state_handler_table_t originate_state_handlers;
@ -2268,6 +2270,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
for (r = 0; r < or_argc; r++) {
char *p, *end = NULL;
const char *var_begin, *var_end;
int q = 0;
oglobals.hups = 0;
reason = SWITCH_CAUSE_NONE;
@ -2288,6 +2291,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
oglobals.progress = 0;
myflags = dftflags;
if (try > 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Originate attempt %d/%d in %d ms\n", try + 1, retries,
sleep_ms);
@ -2308,8 +2312,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
end = switch_find_end_paren(p, '[', ']');
}
if (*p == '\'') {
q = !q;
}
if (end && p < end && *p == ',') {
*p = '|';
if (q) {
*p = QUOTED_ESC_COMMA;
} else {
*p = UNQUOTED_ESC_COMMA;
}
}
if (p == end) {
@ -2450,7 +2462,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if (vdata && (var_begin = switch_stristr("origination_uuid=", vdata))) {
char tmp[512] = "";
var_begin += strlen("origination_uuid=");
var_end = strchr(var_begin, '|');
var_end = strchr(var_begin, UNQUOTED_ESC_COMMA);
if (var_end) {
strncpy(tmp, var_begin, var_end - var_begin);
@ -2467,7 +2479,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if (vdata && (var_begin = switch_stristr("origination_caller_id_number=", vdata))) {
var_begin += strlen("origination_caller_id_number=");
var_end = strchr(var_begin, '|');
var_end = strchr(var_begin, UNQUOTED_ESC_COMMA);
if (var_end) {
strncpy(variable_buffer, var_begin, var_end - var_begin);
@ -2487,7 +2499,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if (vdata && (var_begin = switch_stristr("origination_caller_id_name=", vdata))) {
var_begin += strlen("origination_caller_id_name=");
var_end = strchr(var_begin, '|');
var_end = strchr(var_begin, UNQUOTED_ESC_COMMA);
if (var_end) {
strncpy(variable_buffer, var_begin, var_end - var_begin);
@ -2507,7 +2519,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if (vdata && (var_begin = switch_stristr("origination_privacy=", vdata))) {
var_begin += strlen("origination_privacy=");
var_end = strchr(var_begin, '|');
var_end = strchr(var_begin, UNQUOTED_ESC_COMMA);
if (var_end) {
strncpy(variable_buffer, var_begin, var_end - var_begin);
@ -2556,16 +2568,27 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
}
}
if ((var_count = switch_separate_string(vdata, '|', var_array, (sizeof(var_array) / sizeof(var_array[0]))))) {
if ((var_count = switch_separate_string(vdata, UNQUOTED_ESC_COMMA, var_array, (sizeof(var_array) / sizeof(var_array[0]))))) {
int x = 0;
for (x = 0; x < var_count; x++) {
char *inner_var_array[2] = { 0 };
int inner_var_count;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "local variable string %d = [%s]\n",
x, var_array[x]);
char *p;
for (p = var_array[x]; p && *p; p++) {
if (*p == QUOTED_ESC_COMMA) {
*p = ',';
}
}
if ((inner_var_count =
switch_separate_string(var_array[x], '=',
inner_var_array, (sizeof(inner_var_array) / sizeof(inner_var_array[0])))) == 2) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "local variable string %d = [%s=%s]\n",
x, inner_var_array[0], inner_var_array[1]);
switch_event_add_header_string(local_var_event, SWITCH_STACK_BOTTOM, inner_var_array[0], inner_var_array[1]);
}

View File

@ -81,19 +81,18 @@ static switch_status_t limit_state_handler(switch_core_session_t *session)
switch_channel_state_t state = switch_channel_get_state(channel);
const char *vval = switch_channel_get_variable(channel, LIMIT_IGNORE_TRANSFER_VARIABLE);
const char *backendlist = switch_channel_get_variable(channel, LIMIT_BACKEND_VARIABLE);
int argc = 0;
char *argv[6] = { 0 };
char *mydata = NULL;
if (zstr(backendlist)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unset limit backendlist!\n");
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Unset limit backendlist!\n");
return SWITCH_STATUS_SUCCESS;
}
mydata = strdup(backendlist);
if (state >= CS_HANGUP || (state == CS_ROUTING && !switch_true(vval))) {
int argc = 0;
char *argv[6] = { 0 };
char *mydata = strdup(backendlist);
int x;
argc = switch_separate_string(mydata, ',', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
switch_limit_release(argv[x], session, NULL, NULL);
@ -101,7 +100,10 @@ static switch_status_t limit_state_handler(switch_core_session_t *session)
switch_core_event_hook_remove_state_change(session, limit_state_handler);
/* Remove limit_realm variable so we register another hook if limit is called again */
switch_channel_set_variable(channel, "limit_realm", NULL);
free(mydata);
}
return SWITCH_STATUS_SUCCESS;
}
@ -117,7 +119,7 @@ SWITCH_DECLARE(switch_status_t) switch_limit_incr(const char *backend, switch_co
/* locate impl, call appropriate func */
if (!(limit = get_backend(backend))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Limit subsystem %s not found!\n", backend);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Limit subsystem %s not found!\n", backend);
switch_goto_status(SWITCH_STATUS_GENERR, end);
}
@ -149,7 +151,7 @@ SWITCH_DECLARE(switch_status_t) switch_limit_release(const char *backend, switch
/* locate impl, call appropriate func */
if (!(limit = get_backend(backend))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Limit subsystem %s not found!\n", backend);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Limit subsystem %s not found!\n", backend);
switch_goto_status(SWITCH_STATUS_GENERR, end);
}

View File

@ -48,7 +48,10 @@
#define MAX_ELEMENTS 3600
#define IDLE_SPEED 100
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
/* For now enable WIN32_MONOTONIC on Windows 2003 Server and Windows XP systems for improved timer support */
/* GetSystemTimeAsFileTime does not update on timeBeginPeriod on these OS */
/* we leave the normal timer support as the default for now */
#if (defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)) || defined(WIN32_MONOTONIC)
static int MONO = 1;
#else
static int MONO = 0;
@ -67,6 +70,12 @@ static int COND = 1;
static int MATRIX = 1;
#ifdef WIN32
static switch_time_t win32_tick_time_since_start = -1;
static DWORD win32_last_get_time_tick = 0;
CRITICAL_SECTION timer_section;
#endif
#define ONEMS
#ifdef ONEMS
static int STEP_MS = 1;
@ -174,9 +183,9 @@ static switch_interval_time_t average_time(switch_interval_time_t t, int reps)
switch_time_t start, stop, sum = 0;
for (x = 0; x < reps; x++) {
start = switch_time_now();
start = switch_time_ref();
do_sleep(t);
stop = switch_time_now();
stop = switch_time_ref();
sum += (stop - start);
}
@ -335,22 +344,49 @@ static switch_time_t time_now(int64_t offset)
{
switch_time_t now;
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
#if (defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)) || defined(WIN32_MONOTONIC)
if (MONO) {
#ifndef WIN32
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
now = ts.tv_sec * APR_USEC_PER_SEC + (ts.tv_nsec / 1000) + offset;
#else
DWORD tick_now;
DWORD tick_diff;
tick_now = timeGetTime();
if (win32_tick_time_since_start != -1) {
EnterCriticalSection(&timer_section);
/* just add diff (to make it work more than 50 days). */
tick_diff = tick_now - win32_last_get_time_tick;
win32_tick_time_since_start += tick_diff;
win32_last_get_time_tick = tick_now;
now = (win32_tick_time_since_start * 1000) + offset;
LeaveCriticalSection(&timer_section);
} else {
/* If someone is calling us before timer is initialized,
* return the current tick + offset
*/
now = (tick_now * 1000) + offset;
}
#endif
} else {
#endif
now = switch_time_now();
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
#if (defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)) || defined(WIN32_MONOTONIC)
}
#endif
return now;
}
SWITCH_DECLARE(switch_time_t) switch_time_ref(void)
{
return time_now(0);
}
SWITCH_DECLARE(void) switch_time_sync(void)
{
runtime.reference = switch_time_now();
@ -999,6 +1035,9 @@ SWITCH_MODULE_LOAD_FUNCTION(softtimer_load)
#if defined(WIN32)
timeBeginPeriod(1);
InitializeCriticalSection(&timer_section);
win32_last_get_time_tick = timeGetTime();
win32_tick_time_since_start = win32_last_get_time_tick;
#endif
memset(&globals, 0, sizeof(globals));
@ -1054,6 +1093,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(softtimer_shutdown)
}
#if defined(WIN32)
timeEndPeriod(1);
win32_tick_time_since_start = -1; /* we are not initialized anymore */
DeleteCriticalSection(&timer_section);
#endif
if (TIMEZONES_LIST.hash) {