1
0
mirror of https://github.com/signalwire/freeswitch.git synced 2025-03-05 02:02:01 +00:00

Merge branch 'master' into v1.8

This commit is contained in:
Andrey Volk 2019-06-06 23:00:53 +04:00
commit f55c58fd8d
168 changed files with 22947 additions and 39055 deletions
Freeswitch.2017.sln
build
conf
configure.ac
debian
docs
freeswitch-config-rayo.specfreeswitch-sounds-en-ca-june.specfreeswitch-sounds-en-us-allison.specfreeswitch-sounds-en-us-callie.specfreeswitch-sounds-fr-ca-june.specfreeswitch-sounds-music.specfreeswitch-sounds-pt-BR-karina.specfreeswitch-sounds-ru-RU-elena.specfreeswitch-sounds-sv-se-jakob.specfreeswitch.spec
html5/verto
libs
scripts/ci
src

@ -564,8 +564,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cidlookup", "src\mod\ap
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_mongodb", "src\mod\event_handlers\mod_cdr_mongodb\mod_cdr_mongodb.2017.vcxproj", "{4DFF29B4-2976-447D-A8B3-43476451517C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ffmpeg", "libs\win32\ffmpeg\ffmpeg.2017.vcxproj", "{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{9388C266-C3FC-468A-92EF-0CBC35941412}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_mod_av", "src\mod\applications\mod_av\test\test_mod_av.2017.vcxproj", "{7926CB0D-62CE-4A09-AE94-1DA2BC92D625}"
@ -578,6 +576,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "48khz music", "libs\win32\S
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_signalwire", "src\mod\applications\mod_signalwire\mod_signalwire.2017.vcxproj", "{B19AE6FC-BFFF-428D-B483-3BBEAECCC618}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ffmpeg", "libs\win32\ffmpeg\ffmpeg.2017.vcxproj", "{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Setup.CA.DownloadOpenH264", "w32\Setup\CustomActions\Setup.CA.DownloadOpenH264\Setup.CA.DownloadOpenH264.csproj", "{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
All|Win32 = All|Win32
@ -2353,14 +2355,16 @@ Global
{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Debug|x64.ActiveCfg = Debug|x64
{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|Win32.ActiveCfg = Release|Win32
{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|x64.ActiveCfg = Release|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.ActiveCfg = Release|Win32
{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.Build.0 = Release|Win32
{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|x64.ActiveCfg = Release|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|x64.Build.0 = Release|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Debug|Win32.ActiveCfg = Debug|Win32
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Debug|x64.ActiveCfg = Debug|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Release|Win32.ActiveCfg = Release|Win32
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Release|x64.ActiveCfg = Release|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.ActiveCfg = Release-x264|Win32
{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.Build.0 = Release-x264|Win32
{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|x64.ActiveCfg = Release-x264|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|x64.Build.0 = Release-x264|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Debug|Win32.ActiveCfg = Debug-x264|Win32
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Debug|x64.ActiveCfg = Debug-openh264|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Debug|x64.Build.0 = Debug-openh264|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Release|Win32.ActiveCfg = Release-x264|Win32
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Release|x64.ActiveCfg = Release-openh264|x64
{7AEE504B-23B6-4B05-829E-7CD34855F146}.Release|x64.Build.0 = Release-openh264|x64
{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|Win32.ActiveCfg = Release|Win32
{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|Win32.Build.0 = Release|Win32
{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|x64.ActiveCfg = Release|x64
@ -2585,14 +2589,6 @@ Global
{4DFF29B4-2976-447D-A8B3-43476451517C}.Release|Win32.Build.0 = Release|Win32
{4DFF29B4-2976-447D-A8B3-43476451517C}.Release|x64.ActiveCfg = Release|x64
{4DFF29B4-2976-447D-A8B3-43476451517C}.Release|x64.Build.0 = Release|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.All|Win32.ActiveCfg = Release|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.All|Win32.Build.0 = Release|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.All|x64.ActiveCfg = Release|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.All|x64.Build.0 = Release|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Debug|Win32.ActiveCfg = Debug|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Debug|x64.ActiveCfg = Debug|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Release|Win32.ActiveCfg = Release|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Release|x64.ActiveCfg = Release|x64
{7926CB0D-62CE-4A09-AE94-1DA2BC92D625}.All|Win32.ActiveCfg = Release|Win32
{7926CB0D-62CE-4A09-AE94-1DA2BC92D625}.All|Win32.Build.0 = Release|Win32
{7926CB0D-62CE-4A09-AE94-1DA2BC92D625}.All|x64.ActiveCfg = Release|x64
@ -2641,6 +2637,28 @@ Global
{B19AE6FC-BFFF-428D-B483-3BBEAECCC618}.Release|Win32.Build.0 = Release|Win32
{B19AE6FC-BFFF-428D-B483-3BBEAECCC618}.Release|x64.ActiveCfg = Release|x64
{B19AE6FC-BFFF-428D-B483-3BBEAECCC618}.Release|x64.Build.0 = Release|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.All|Win32.ActiveCfg = Debug-openh264|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.All|Win32.Build.0 = Debug-openh264|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.All|x64.ActiveCfg = Debug-openh264|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.All|x64.Build.0 = Debug-openh264|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Debug|Win32.ActiveCfg = Debug-openh264|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Debug|x64.ActiveCfg = Debug-openh264|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Debug|x64.Build.0 = Debug-openh264|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Release|Win32.ActiveCfg = Debug-openh264|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Release|x64.ActiveCfg = Release-openh264|x64
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED}.Release|x64.Build.0 = Release-openh264|x64
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.All|Win32.ActiveCfg = Release|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.All|Win32.Build.0 = Release|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.All|x64.ActiveCfg = Release|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.All|x64.Build.0 = Release|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Debug|Win32.ActiveCfg = Debug|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Debug|Win32.Build.0 = Debug|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Debug|x64.ActiveCfg = Debug|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Debug|x64.Build.0 = Debug|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Release|Win32.ActiveCfg = Release|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Release|Win32.Build.0 = Release|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Release|x64.ActiveCfg = Release|x86
{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Release|x64.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -2845,12 +2863,12 @@ Global
{40C4E2A2-B49B-496C-96D6-C04B890F7F88} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{0A130A8B-3076-4619-BADF-9E86F621AEEC} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{4DFF29B4-2976-447D-A8B3-43476451517C} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
{7926CB0D-62CE-4A09-AE94-1DA2BC92D625} = {9388C266-C3FC-468A-92EF-0CBC35941412}
{EF62B845-A0CE-44FD-B8E6-475FE87D06C3} = {9388C266-C3FC-468A-92EF-0CBC35941412}
{8154C82D-58EE-4145-9DEC-A445A5AA3D6B} = {4F227C26-768F-46A3-8684-1D08A46FB374}
{EBD0B6B4-C5CA-46B0-BBC7-DBA71DF05D31} = {4F227C26-768F-46A3-8684-1D08A46FB374}
{B19AE6FC-BFFF-428D-B483-3BBEAECCC618} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{BC1FD72E-1CD5-4525-A7F5-17C5740BFDED} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {09840DE7-9208-45AA-9667-1A71EE93BD1E}

@ -75,10 +75,15 @@ then
[AC_MSG_ERROR([ei.h is unusable - are the erlang development headers installed?])]
)
else
ERLANG_MAJOR="`echo "$ERLANG_VER" | sed 's/\([[^.]][[^.]]*\).*/\1/'`"
ERLANG_MINOR="`echo "$ERLANG_VER" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`"
ERLANG_LDFLAGS="$ERLANG_LDFLAGS -lei"
AC_MSG_NOTICE([Your erlang seems OK, do not forget to enable mod_erlang_event in modules.conf])
AC_SUBST([ERLANG_CFLAGS], [$ERLANG_CFLAGS])
AC_SUBST([ERLANG_LDFLAGS], [$ERLANG_LDFLAGS])
AC_SUBST([ERLANG_VERSION], [$ERLANG_VER])
AC_SUBST([ERLANG_MAJOR], [$ERLANG_MAJOR])
AC_SUBST([ERLANG_MINOR], [$ERLANG_MINOR])
AM_CONDITIONAL([HAVE_ERLANG],[true])
fi

@ -125,6 +125,7 @@ formats/mod_sndfile
#formats/mod_ssml
formats/mod_tone_stream
#formats/mod_vlc
#formats/mod_opusfile
#languages/mod_basic
#languages/mod_java
languages/mod_lua

@ -26,6 +26,7 @@
<load module="mod_opus"/>
<load module="mod_sndfile"/>
<load module="mod_native_file"/>
<load module="mod_opusfile"/>
<load module="mod_local_stream"/>
<load module="mod_tone_stream"/>
<load module="mod_lua"/>

@ -62,6 +62,12 @@
<!-- determines the mode of detection, default is both amplitude and frequency -->
<param name="detection_mode" value="2"/>
<!-- number of detection threads running per each avmd session -->
<param name="detectors_n" value="36"/>
<!-- number of lagged detection threads running per each avmd session -->
<param name="detectors_lagged_n" value="1"/>
<!-- Per call settings end -->
</settings>
</configuration>

@ -250,17 +250,123 @@
<param name="caller-id-name" value="$${outbound_caller_name}"/>
<param name="caller-id-number" value="$${outbound_caller_id}"/>
<param name="comfort-noise" value="false"/>
<param name="conference-flags" value="video-floor-only|rfc-4579|livearray-sync|minimize-video-encoding"/>
<param name="conference-flags" value="livearray-json-status|json-events|video-floor-only|rfc-4579|livearray-sync|minimize-video-encoding|manage-inbound-video-bitrate|video-required-for-canvas|video-mute-exit-canvas|mute-detect"/>
<param name="video-auto-floor-msec" value="1000"/>
<param name="video-mode" value="mux"/>
<param name="video-layout-name" value="3x3"/>
<param name="video-layout-name" value="group:grid"/>
<param name="video-canvas-size" value="1920x1080"/>
<param name="video-canvas-bgcolor" value="#333333"/>
<param name="video-layout-bgcolor" value="#000000"/>
<param name="video-codec-bandwidth" value="1mb"/>
<param name="video-fps" value="15"/>
<param name="video-codec-bandwidth" value="3mb"/>
<param name="video-fps" value="30"/>
<!-- <param name="video-codec-config-profile-name" value="conference"/> -->
</profile>
<profile name="video-mcu-stereo-720">
<param name="domain" value="$${domain}"/>
<param name="rate" value="48000"/>
<param name="channels" value="2"/>
<param name="interval" value="20"/>
<param name="energy-level" value="200"/>
<!-- <param name="tts-engine" value="flite"/> -->
<!-- <param name="tts-voice" value="kal16"/> -->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<param name="alone-sound" value="conference/conf-alone.wav"/>
<param name="moh-sound" value="$${hold_music}"/>
<param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
<param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
<param name="kicked-sound" value="conference/conf-kicked.wav"/>
<param name="locked-sound" value="conference/conf-locked.wav"/>
<param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
<param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
<param name="pin-sound" value="conference/conf-pin.wav"/>
<param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
<param name="caller-id-name" value="$${outbound_caller_name}"/>
<param name="caller-id-number" value="$${outbound_caller_id}"/>
<param name="comfort-noise" value="false"/>
<param name="conference-flags" value="livearray-json-status|json-events|video-floor-only|rfc-4579|livearray-sync|minimize-video-encoding|manage-inbound-video-bitrate|video-required-for-canvas|video-mute-exit-canvas|mute-detect"/>
<param name="video-auto-floor-msec" value="1000"/>
<param name="video-mode" value="mux"/>
<param name="video-layout-name" value="3x3"/>
<param name="video-layout-name" value="group:grid"/>
<param name="video-canvas-size" value="1280x720"/>
<param name="video-canvas-bgcolor" value="#333333"/>
<param name="video-layout-bgcolor" value="#000000"/>
<param name="video-codec-bandwidth" value="3mb"/>
<param name="video-fps" value="30"/>
</profile>
<profile name="video-mcu-stereo-480">
<param name="domain" value="$${domain}"/>
<param name="rate" value="48000"/>
<param name="channels" value="2"/>
<param name="interval" value="20"/>
<param name="energy-level" value="200"/>
<!-- <param name="tts-engine" value="flite"/> -->
<!-- <param name="tts-voice" value="kal16"/> -->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<param name="alone-sound" value="conference/conf-alone.wav"/>
<param name="moh-sound" value="$${hold_music}"/>
<param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
<param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
<param name="kicked-sound" value="conference/conf-kicked.wav"/>
<param name="locked-sound" value="conference/conf-locked.wav"/>
<param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
<param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
<param name="pin-sound" value="conference/conf-pin.wav"/>
<param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
<param name="caller-id-name" value="$${outbound_caller_name}"/>
<param name="caller-id-number" value="$${outbound_caller_id}"/>
<param name="comfort-noise" value="false"/>
<param name="conference-flags" value="livearray-json-status|json-events|video-floor-only|rfc-4579|livearray-sync|minimize-video-encoding|manage-inbound-video-bitrate|video-required-for-canvas|video-mute-exit-canvas|mute-detect"/>
<param name="video-auto-floor-msec" value="1000"/>
<param name="video-mode" value="mux"/>
<param name="video-layout-name" value="3x3"/>
<param name="video-layout-name" value="group:grid"/>
<param name="video-canvas-size" value="640x480"/>
<param name="video-canvas-bgcolor" value="#333333"/>
<param name="video-layout-bgcolor" value="#000000"/>
<param name="video-codec-bandwidth" value="3mb"/>
<param name="video-fps" value="30"/>
</profile>
<profile name="video-mcu-stereo-320">
<param name="domain" value="$${domain}"/>
<param name="rate" value="48000"/>
<param name="channels" value="2"/>
<param name="interval" value="20"/>
<param name="energy-level" value="200"/>
<!-- <param name="tts-engine" value="flite"/> -->
<!-- <param name="tts-voice" value="kal16"/> -->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<param name="alone-sound" value="conference/conf-alone.wav"/>
<param name="moh-sound" value="$${hold_music}"/>
<param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
<param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
<param name="kicked-sound" value="conference/conf-kicked.wav"/>
<param name="locked-sound" value="conference/conf-locked.wav"/>
<param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
<param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
<param name="pin-sound" value="conference/conf-pin.wav"/>
<param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
<param name="caller-id-name" value="$${outbound_caller_name}"/>
<param name="caller-id-number" value="$${outbound_caller_id}"/>
<param name="comfort-noise" value="false"/>
<param name="conference-flags" value="livearray-json-status|json-events|video-floor-only|rfc-4579|livearray-sync|minimize-video-encoding|manage-inbound-video-bitrate|video-required-for-canvas|video-mute-exit-canvas|mute-detect"/>
<param name="video-auto-floor-msec" value="1000"/>
<param name="video-mode" value="mux"/>
<param name="video-layout-name" value="3x3"/>
<param name="video-layout-name" value="group:grid"/>
<param name="video-canvas-size" value="480x320"/>
<param name="video-canvas-bgcolor" value="#333333"/>
<param name="video-layout-bgcolor" value="#000000"/>
<param name="video-codec-bandwidth" value="3mb"/>
<param name="video-fps" value="30"/>
</profile>
<profile name="sla">
<param name="domain" value="$${domain}"/>

@ -102,9 +102,10 @@
<load module="mod_opus"/>
<!-- File Format Interfaces -->
<!--<load module="mod_av"/>-->
<load module="mod_av"/>
<load module="mod_sndfile"/>
<load module="mod_native_file"/>
<!--<load module="mod_opusfile"/>-->
<load module="mod_png"/>
<!-- <load module="mod_shell_stream"/> -->
<!--For icecast/mp3 streams/files-->

@ -23,10 +23,10 @@
<param name="mcast-ip" value="224.1.1.1"/>
<param name="mcast-port" value="1337"/>
<param name="rtp-ip" value="$${local_ip_v4}"/>
<!-- <param name="ext-rtp-ip" value=""/> -->
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="local-network" value="localnet.auto"/>
<param name="outbound-codec-string" value="opus,vp8"/>
<param name="inbound-codec-string" value="opus,vp8"/>
<param name="outbound-codec-string" value="opus,h264,vp8"/>
<param name="inbound-codec-string" value="opus,h264,vp8"/>
<param name="apply-candidate-acl" value="localnet.auto"/>
<param name="apply-candidate-acl" value="wan_v4.auto"/>
@ -47,8 +47,8 @@
<param name="blind-reg" value="false"/>
<param name="rtp-ip" value="$${local_ip_v6}"/>
<!-- <param name="ext-rtp-ip" value=""/> -->
<param name="outbound-codec-string" value="opus,vp8"/>
<param name="inbound-codec-string" value="opus,vp8"/>
<param name="outbound-codec-string" value="opus,h264,vp8"/>
<param name="inbound-codec-string" value="opus,h264,vp8"/>
<param name="apply-candidate-acl" value="wan_v6.auto"/>
<param name="apply-candidate-acl" value="rfc1918.auto"/>

@ -387,7 +387,7 @@
<action application="answer"/>
<action application="send_display" data="FreeSWITCH Conference|$1"/>
<action application="set" data="conference_member_flags=join-vid-floor"/>
<action application="conference" data="$1-${domain_name}@video-mcu-stereo"/>
<action application="conference" data="$1@video-mcu-stereo"/>
</condition>
</extension>
@ -410,7 +410,28 @@
<extension name="cdquality_conferences">
<condition field="destination_number" expression="^(35\d{2})$">
<action application="answer"/>
<action application="conference" data="$1-${domain_name}@video-mcu-stereo"/>
<action application="conference" data="$1@video-mcu-stereo"/>
</condition>
</extension>
<extension name="cdquality_conferences_720">
<condition field="destination_number" expression="^(36\d{2})$">
<action application="answer"/>
<action application="conference" data="$1@video-mcu-stereo-720"/>
</condition>
</extension>
<extension name="cdquality_conferences_480">
<condition field="destination_number" expression="^(37\d{2})$">
<action application="answer"/>
<action application="conference" data="$1@video-mcu-stereo-480"/>
</condition>
</extension>
<extension name="cdquality_conferences_320">
<condition field="destination_number" expression="^(38\d{2})$">
<action application="answer"/>
<action application="conference" data="$1@video-mcu-stereo-320"/>
</condition>
</extension>

@ -42,6 +42,12 @@
<action application="transfer" data="$1 XML default"/>
</condition>
</extension>
<extension name="public_conference_extensions">
<condition field="destination_number" expression="^(3[5-8][01][0-9])$">
<action application="transfer" data="$1 XML default"/>
</condition>
</extension>
<!--
You can place files in the public directory to get included.

@ -15,6 +15,7 @@ audio/mpg mp3
audio/x-mpegaudio mp3
audio/x-wave wav
audio/wave wav
audio/wav wav
#
# The section below was taken from Apache httpd Project at
# <https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types>

@ -63,8 +63,8 @@
-->
<param name="rtp-ip" value="$${local_ip_v4}"/>
<param name="sip-ip" value="$${local_ip_v4}"/>
<param name="ext-rtp-ip" value="auto-nat"/>
<param name="ext-sip-ip" value="auto-nat"/>
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_rtp_ip}"/>
<param name="rtp-timeout-sec" value="300"/>
<param name="rtp-hold-timeout-sec" value="1800"/>
<!--<param name="enable-3pcc" value="true"/>-->

@ -281,8 +281,8 @@
auto - Use guessed ip.
auto-nat - Use ip learned from NAT-PMP or UPNP
-->
<param name="ext-rtp-ip" value="auto-nat"/>
<param name="ext-sip-ip" value="auto-nat"/>
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_rtp_ip}"/>
<!-- rtp inactivity timeout -->
<param name="rtp-timeout-sec" value="300"/>

@ -256,8 +256,8 @@
127 - BV32
-->
<X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/>
<X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8"/>
<!--
xmpp_client_profile and xmpp_server_profile
@ -298,7 +298,7 @@
If unspecified, the bind_server_ip value is used.
Used by: sofia.conf.xml dingaling.conf.xml
-->
<X-PRE-PROCESS cmd="set" data="external_rtp_ip=stun:stun.freeswitch.org"/>
<X-PRE-PROCESS cmd="stun-set" data="external_rtp_ip=stun:stun.freeswitch.org"/>
<!-- external_sip_ip
Used as the public IP address for SDP.
@ -311,7 +311,7 @@
If unspecified, the bind_server_ip value is used.
Used by: sofia.conf.xml dingaling.conf.xml
-->
<X-PRE-PROCESS cmd="set" data="external_sip_ip=stun:stun.freeswitch.org"/>
<X-PRE-PROCESS cmd="stun-set" data="external_sip_ip=stun:stun.freeswitch.org"/>
<!-- unroll-loops
Used to turn on sip loopback unrolling.
@ -431,8 +431,8 @@
<!-- Video Settings -->
<!-- Setting the max bandwdith -->
<X-PRE-PROCESS cmd="set" data="rtp_video_max_bandwidth_in=1mb"/>
<X-PRE-PROCESS cmd="set" data="rtp_video_max_bandwidth_out=1mb"/>
<X-PRE-PROCESS cmd="set" data="rtp_video_max_bandwidth_in=3mb"/>
<X-PRE-PROCESS cmd="set" data="rtp_video_max_bandwidth_out=3mb"/>
<!-- WebRTC Video -->
<!-- Suppress CNG for WebRTC Audio -->

@ -449,19 +449,6 @@ elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
fi
fi
# Enable clang address sanitizer bit build
AC_ARG_ENABLE(address_sanitizer,
[AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
[enable_address_sanitizer="$enable_address_sanitizer"],
[enable_address_sanitizer="no"])
if test "${enable_address_sanitizer}" = "yes"; then
APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer)
APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer)
APR_ADDTO(LDFLAGS, -fsanitize=address)
fi
case "${ax_cv_c_compiler_vendor}" in
sun)
VISIBILITY_FLAG=-xldscope=hidden
@ -1389,6 +1376,14 @@ PKG_CHECK_MODULES([OPENCV], [opencv >= 2.4.5],[
AM_CONDITIONAL([HAVE_OPENCV],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])])
PKG_CHECK_MODULES([OPUSFILE_DECODE], [opusfile >= 0.5],[
AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[false])])
PKG_CHECK_MODULES([OPUSFILE_ENCODE], [libopusenc >= 0.1],[
AM_CONDITIONAL([HAVE_OPUSFILE_ENCODE],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUSFILE_ENCODE],[false])])
PKG_CHECK_MODULES([MAGICK], [ImageMagick >= 6.0.0],[
AM_CONDITIONAL([HAVE_MAGICK],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK],[false])])
@ -1599,6 +1594,7 @@ if test x$HAVE_OPENSSL = x1; then
APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_OPENSSL)
AC_CHECK_LIB(ssl, SSL_CTX_set_tlsext_use_srtp, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS_SRTP, 1, HAVE_OPENSSL_DTLS_SRTP), AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required]))
AC_CHECK_LIB(ssl, DTLSv1_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS, 1, HAVE_OPENSSL_DTLS), AC_MSG_ERROR([OpenSSL >= 1.0.1e and associaed developement headers required]))
AC_CHECK_LIB(ssl, DTLSv1_2_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLSv1_2_method, 1, [DTLS version 1.2 is available]))
else
AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required])
fi
@ -1810,6 +1806,18 @@ AC_SUBST(SNMP_LIBS)
CHECK_ERLANG
# Enable clang address sanitizer bit build
AC_ARG_ENABLE(address_sanitizer,
[AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
[enable_address_sanitizer="$enable_address_sanitizer"],
[enable_address_sanitizer="no"])
if test "${enable_address_sanitizer}" = "yes"; then
APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer)
APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer)
APR_ADDTO(LDFLAGS, -fsanitize=address)
fi
# we never use this, and hard setting it will make cross compile work better
ac_cv_file_dbd_apr_dbd_mysql_c=no
@ -1946,6 +1954,7 @@ AC_CONFIG_FILES([Makefile
src/mod/formats/mod_imagick/Makefile
src/mod/formats/mod_local_stream/Makefile
src/mod/formats/mod_native_file/Makefile
src/mod/formats/mod_opusfile/Makefile
src/mod/formats/mod_shell_stream/Makefile
src/mod/formats/mod_shout/Makefile
src/mod/formats/mod_sndfile/Makefile

@ -621,6 +621,11 @@ Module: formats/mod_webm
Description: Adds mod_webm
Adds mod_webm.
Module: formats/mod_opusfile
Description: mod_opusfile
Adds mod_opusfile.
Build-Depends: libopusfile-dev
## mod/languages
Module: languages/mod_basic

@ -3,22 +3,24 @@
[Unit]
Description=freeswitch
Wants=network-online.target
Requires=syslog.socket network.target local-fs.target
After=syslog.socket network.target network-online.target local-fs.target
Requires=network.target local-fs.target
After=network.target network-online.target local-fs.target
[Service]
; service
Type=forking
PIDFile=/run/freeswitch/freeswitch.pid
Environment="DAEMON_OPTS=-nonat"
Environment="USER=freeswitch"
Environment="GROUP=freeswitch"
EnvironmentFile=-/etc/default/freeswitch
ExecStartPre=/bin/chown -R freeswitch:freeswitch /var/lib/freeswitch /var/log/freeswitch /etc/freeswitch /usr/share/freeswitch /var/run/freeswitch
ExecStart=/usr/bin/freeswitch -u freeswitch -g freeswitch -ncwait $DAEMON_OPTS
ExecStartPre=/bin/chown -R ${USER}:${GROUP} /var/lib/freeswitch /var/log/freeswitch /etc/freeswitch /usr/share/freeswitch /var/run/freeswitch
ExecStart=/usr/bin/freeswitch -u ${USER} -g ${GROUP} -ncwait ${DAEMON_OPTS}
TimeoutSec=45s
Restart=always
; exec
User=root
Group=daemon
;User=${USER}
;Group=${GROUP}
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000

@ -469,3 +469,62 @@ EXHIBIT A -Mozilla Public License.
Original Code Source Code for Your Modifications.]
-------------------------------------------------------
About The Cisco-Provided Binary of OpenH264 Video Codec
-------------------------------------------------------
Cisco provides this program under the terms of the BSD license.
Additionally, this binary is licensed under Ciscos AVC/H.264 Patent Portfolio License from MPEG LA, at no cost to you, provided that the requirements and conditions shown below in the AVC/H.264 Patent Portfolio sections are met.
As with all AVC/H.264 codecs, you may also obtain your own patent license from MPEG LA or from the individual patent owners, or proceed at your own risk. Your rights from Cisco under the BSD license are not affected by this choice.
For more information on the OpenH264 binary licensing, please see the OpenH264 FAQ found at http://www.openh264.org/faq.html#binary
A corresponding source code to this binary program is available under the same BSD terms, which can be found at http://www.openh264.org
-----------
BSD License
-----------
Copyright © 2014 Cisco Systems, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------
AVC/H.264 Patent Portfolio License Notice
-----------------------------------------
The binary form of this Software is distributed by Cisco under the AVC/H.264 Patent Portfolio License from MPEG LA, and is subject to the following requirements, which may or may not be applicable to your use of this software:
THIS PRODUCT IS LICENSED UNDER THE AVC PATENT PORTFOLIO LICENSE FOR THE PERSONAL USE OF A CONSUMER OR OTHER USES IN WHICH IT DOES NOT RECEIVE REMUNERATION TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE AVC STANDARD (“AVC VIDEO”) AND/OR (ii) DECODE AVC VIDEO THAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL ACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER LICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS GRANTED OR SHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL INFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE HTTP://WWW.MPEGLA.COM
Accordingly, please be advised that content providers and broadcasters using AVC/H.264 in their service may be required to obtain a separate use license from MPEG LA, referred to as "(b) sublicenses" in the SUMMARY OF AVC/H.264 LICENSE TERMS from MPEG LA found at http://www.openh264.org/mpegla
---------------------------------------------
AVC/H.264 Patent Portfolio License Conditions
---------------------------------------------
In addition, the Cisco-provided binary of this Software is licensed under Cisco's license from MPEG LA only if the following conditions are met:
1. The Cisco-provided binary is separately downloaded to an end users device, and not integrated into or combined with third party software prior to being downloaded to the end users device;
2. The end user must have the ability to control (e.g., to enable, disable, or re-enable) the use of the Cisco-provided binary;
3. Third party software, in the location where end users can control the use of the Cisco-provided binary, must display the following text:
"OpenH264 Video Codec provided by Cisco Systems, Inc."
4. Any third-party software that makes use of the Cisco-provided binary must reproduce all of the above text, as well as this last condition, in the EULA and/or in another location where licensing information is to be presented to the end user.
v1.0

File diff suppressed because it is too large Load Diff

@ -0,0 +1,59 @@
-------------------------------------------------------
About The Cisco-Provided Binary of OpenH264 Video Codec
-------------------------------------------------------
Cisco provides this program under the terms of the BSD license.
Additionally, this binary is licensed under Ciscos AVC/H.264 Patent Portfolio License from MPEG LA, at no cost to you, provided that the requirements and conditions shown below in the AVC/H.264 Patent Portfolio sections are met.
As with all AVC/H.264 codecs, you may also obtain your own patent license from MPEG LA or from the individual patent owners, or proceed at your own risk. Your rights from Cisco under the BSD license are not affected by this choice.
For more information on the OpenH264 binary licensing, please see the OpenH264 FAQ found at http://www.openh264.org/faq.html#binary
A corresponding source code to this binary program is available under the same BSD terms, which can be found at http://www.openh264.org
-----------
BSD License
-----------
Copyright © 2014 Cisco Systems, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------
AVC/H.264 Patent Portfolio License Notice
-----------------------------------------
The binary form of this Software is distributed by Cisco under the AVC/H.264 Patent Portfolio License from MPEG LA, and is subject to the following requirements, which may or may not be applicable to your use of this software:
THIS PRODUCT IS LICENSED UNDER THE AVC PATENT PORTFOLIO LICENSE FOR THE PERSONAL USE OF A CONSUMER OR OTHER USES IN WHICH IT DOES NOT RECEIVE REMUNERATION TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE AVC STANDARD (“AVC VIDEO”) AND/OR (ii) DECODE AVC VIDEO THAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL ACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER LICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS GRANTED OR SHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL INFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE HTTP://WWW.MPEGLA.COM
Accordingly, please be advised that content providers and broadcasters using AVC/H.264 in their service may be required to obtain a separate use license from MPEG LA, referred to as "(b) sublicenses" in the SUMMARY OF AVC/H.264 LICENSE TERMS from MPEG LA found at http://www.openh264.org/mpegla
---------------------------------------------
AVC/H.264 Patent Portfolio License Conditions
---------------------------------------------
In addition, the Cisco-provided binary of this Software is licensed under Cisco's license from MPEG LA only if the following conditions are met:
1. The Cisco-provided binary is separately downloaded to an end users device, and not integrated into or combined with third party software prior to being downloaded to the end users device;
2. The end user must have the ability to control (e.g., to enable, disable, or re-enable) the use of the Cisco-provided binary;
3. Third party software, in the location where end users can control the use of the Cisco-provided binary, must display the following text:
"OpenH264 Video Codec provided by Cisco Systems, Inc."
4. Any third-party software that makes use of the Cisco-provided binary must reproduce all of the above text, as well as this last condition, in the EULA and/or in another location where licensing information is to be presented to the end user.
v1.0

@ -28,7 +28,8 @@
#
######################################################################################################################
%define version 1.7.0
%define nonparsedversion 1.7.0
%define version %(echo '%{nonparsedversion}' | sed 's/-//g')
%define release 1
%define fsname freeswitch
@ -74,7 +75,7 @@ Summary: Rayo configuration for the FreeSWITCH Open Source telephone platform.
Group: System/Libraries
Packager: Chris Rienzo
URL: http://www.freeswitch.org/
Source0: freeswitch-%{version}.tar.bz2
Source0: freeswitch-%{nonparsedversion}.tar.bz2
Requires: freeswitch
Requires: freeswitch-application-conference
Requires: freeswitch-application-esf
@ -103,7 +104,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
FreeSWITCH rayo server implementation.
%prep
%setup -b0 -q -n freeswitch-%{version}
%setup -b0 -q -n freeswitch-%{nonparsedversion}
%build
@ -164,6 +165,8 @@ FreeSWITCH rayo server implementation.
#
######################################################################################################################
%changelog
* Tue Apr 23 2019 - Andrey Volk
- Fix build for Stack 20.x
* Tue Jun 10 2014 crienzo@grasshopper.com
- Remove dependency to high resolution music and sounds files
- Remove dependency to specific FreeSWITCH package version

@ -2,7 +2,7 @@
# Copyright and license
##############################################################################
#
# Spec file for package freeswitch-sounds-en-ca-june (version 1.0.50-1)
# Spec file for package freeswitch-sounds-en-ca-june (version 1.0.51-1)
#
# Based on parts by Copyright (c) 2009 Patrick Laimbock
# Copyright (c) 2014 FreeSWITCH.org
@ -14,7 +14,7 @@
# Set variables
##############################################################################
%define version 1.0.50
%define version 1.0.51
%define release 1
%define fsname freeswitch
@ -314,5 +314,7 @@ popd
##############################################################################
%changelog
* Fri Apr 19 2019 Andrey Volk <andrey@signalwire.com> - 1.0.51-1
- version bump
* Fri Sep 12 2014 Ken Rice <krice@freeswitch.org> - 1.0.50-1
- created out of the spec file for june

@ -2,7 +2,7 @@
# Copyright and license
##############################################################################
#
# Spec file for package freeswitch-sounds-en-us-allison (version 1.0.0-1)
# Spec file for package freeswitch-sounds-en-us-allison (version 1.0.1-1)
#
# Copyright (c) 2009 Patrick Laimbock
# Some fixes and additions (c) 2011 Michal Bielicki
@ -20,7 +20,7 @@
# Set variables
##############################################################################
%define version 1.0.0
%define version 1.0.1
%define release 1
%define fsname freeswitch
@ -203,6 +203,7 @@ popd
%files -n freeswitch-sounds-en-us-allison-8000
%defattr(-,root,root,-)
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/alt/8000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/ascii/8000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/base256/8000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/conference/8000
@ -211,10 +212,10 @@ popd
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/directory/8000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/ivr/8000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/misc/8000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/phonetic-ascii/8000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/time/8000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/voicemail/8000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/zrtp/8000
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/alt/8000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/ascii/8000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/base256/8000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/conference/8000/*.wav
@ -223,13 +224,13 @@ popd
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/directory/8000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/ivr/8000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/misc/8000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/phonetic-ascii/8000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/time/8000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/voicemail/8000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/zrtp/8000/*.wav
%files -n freeswitch-sounds-en-us-allison-16000
%defattr(-,root,root,-)
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/alt/16000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/ascii/16000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/base256/16000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/conference/16000
@ -238,10 +239,10 @@ popd
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/directory/16000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/ivr/16000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/misc/16000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/phonetic-ascii/16000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/time/16000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/voicemail/16000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/zrtp/16000
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/alt/16000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/ascii/16000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/base256/16000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/conference/16000/*.wav
@ -250,13 +251,13 @@ popd
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/directory/16000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/ivr/16000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/misc/16000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/phonetic-ascii/16000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/time/16000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/voicemail/16000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/zrtp/16000/*.wav
%files -n freeswitch-sounds-en-us-allison-32000
%defattr(-,root,root,-)
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/alt/32000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/ascii/32000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/base256/32000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/conference/32000
@ -265,10 +266,10 @@ popd
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/directory/32000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/ivr/32000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/misc/32000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/phonetic-ascii/32000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/time/32000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/voicemail/32000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/zrtp/32000
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/alt/32000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/ascii/32000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/base256/32000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/conference/32000/*.wav
@ -277,13 +278,13 @@ popd
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/directory/32000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/ivr/32000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/misc/32000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/phonetic-ascii/32000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/time/32000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/voicemail/32000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/zrtp/32000/*.wav
%files -n freeswitch-sounds-en-us-allison-48000
%defattr(-,root,root,-)
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/alt/48000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/ascii/48000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/base256/48000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/conference/48000
@ -292,10 +293,10 @@ popd
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/directory/48000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/ivr/48000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/misc/48000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/phonetic-ascii/48000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/time/48000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/voicemail/48000
%attr(0750,freeswitch,daemon) %dir %{SOUNDSDIR}/en/us/allison/zrtp/48000
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/alt/48000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/ascii/48000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/base256/48000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/conference/48000/*.wav
@ -304,7 +305,6 @@ popd
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/directory/48000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/ivr/48000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/misc/48000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/phonetic-ascii/48000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/time/48000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/voicemail/48000/*.wav
%attr(0640,freeswitch,daemon) %{SOUNDSDIR}/en/us/allison/zrtp/48000/*.wav
@ -316,6 +316,9 @@ popd
##############################################################################
%changelog
* Fri Apr 19 2019 Andrey Volk <andrey@signalwire.com> - 1.0.1-1
- add missing alt folder and remove non-existing items
- bump up version
* Tue Jul 25 2017 Mike Jerris <mike@freeswitch.org> - 1.0.0-1
- update to FHS Layout for FreeSWITCH
- bump up version

@ -2,7 +2,7 @@
# Copyright and license
##############################################################################
#
# Spec file for package freeswitch-sounds-en-us-callie (version 1.0.18-1)
# Spec file for package freeswitch-sounds-en-us-callie (version 1.0.52-1)
#
# Copyright (c) 2009 Patrick Laimbock
# Some fixes and additions (c) 2011 Michal Bielicki
@ -20,7 +20,7 @@
# Set variables
##############################################################################
%define version 1.0.50
%define version 1.0.52
%define release 1
%define fsname freeswitch
@ -316,6 +316,8 @@ popd
##############################################################################
%changelog
* Fri Apr 19 2019 Andrey Volk <andrey@signalwire.com> - 1.0.52-1
- bump up version
* Sun Mar 05 2012 Ken Rice <krice@freeswitch.org> - 1.0.18-1
- update to FHS Layout for FreeSWITCH
- bump up version

@ -2,7 +2,7 @@
# Copyright and license
##############################################################################
#
# Spec file for package freeswitch-sounds-fr-ca-june (version 1.0.50-1)
# Spec file for package freeswitch-sounds-fr-ca-june (version 1.0.51-1)
#
# Based on parts by Copyright (c) 2009 Patrick Laimbock
# Copyright (c) 2014 FreeSWITCH.org
@ -14,7 +14,7 @@
# Set variables
##############################################################################
%define version 1.0.50
%define version 1.0.51
%define release 1
%define fsname freeswitch
@ -322,5 +322,7 @@ popd
##############################################################################
%changelog
* Fri Apr 19 2019 Andrey Volk <andrey@signalwire.com> - 1.0.51-1
- bump up version
* Fri Sep 12 2014 Ken Rice <krice@freeswitch.org> - 1.0.50-1
- created out of the spec file for june

@ -35,8 +35,8 @@
Summary: FreeSWITCH Music on Hold soundfiles
Name: freeswitch-sounds-music
Version: 1.0.50
Release: 2%{?dist}
Version: 1.0.52
Release: 1%{?dist}
License: MPL
Group: Productivity/Telephony/Servers
Packager: Joseph L. Casale <jcasale@activenetwerx.com>
@ -153,6 +153,8 @@ FreeSWITCH 48kHz Music On Hold soundfiles
%changelog
* Fri Apr 19 2019 Andrey Volk <andrey@signalwire.com> - 1.0.52-1
- bump up version
* Sat Jul 16 2011 Joseph Casale <jcasale@activenetwerx.com> 1.0.8-2
- Fix up for FreeSWITCH FHS and AutoBuild System
* Sat Jul 16 2011 Joseph Casale <jcasale@activenetwerx.com> 1.0.8-1

@ -2,7 +2,7 @@
# Copyright and license
##############################################################################
#
# Spec file for package freeswitch-sounds-pt-BR-karina (version 1.0.50-1)
# Spec file for package freeswitch-sounds-pt-BR-karina (version 1.0.51-1)
#
# Based on parts by Copyright (c) 2009 Patrick Laimbock
# Copyright (c) 2014 FreeSWITCH.org
@ -14,7 +14,7 @@
# Set variables
##############################################################################
%define version 1.0.50
%define version 1.0.51
%define release 1
%define fsname freeswitch
@ -314,5 +314,7 @@ popd
##############################################################################
%changelog
* Fri Apr 19 2019 Andrey Volk <andrey@signalwire.com> - 1.0.51-1
- bump up version
* Fri Sep 12 2014 Ken Rice <krice@freeswitch.org> - 1.0.50-1
- created out of the spec file for june

@ -2,7 +2,7 @@
# Copyright and license
##############################################################################
#
# Spec file for package freeswitch-sounds-ru-RU-elena (version 1.0.13-1)
# Spec file for package freeswitch-sounds-ru-RU-elena (version 1.0.51-1)
#
# Based on parts by Copyright (c) 2009 Patrick Laimbock
# Copyright (c) 2011 Michal Bielicki
@ -20,7 +20,7 @@
# Set variables
##############################################################################
%define version 1.0.50
%define version 1.0.51
%define release 1
%define fsname freeswitch
@ -320,6 +320,8 @@ popd
##############################################################################
%changelog
* Fri Apr 19 2019 Andrey Volk <andrey@signalwire.com> - 1.0.51-1
- bump up version
* Fri Sep 12 2014 Ken Rice <krice@freeswitch.org> - 1.0.50-1
- created out of the spec file for elena
* Mon Mar 06 2012 Ken Rice <krice@freeswitch.org> - 1.0.13-2

@ -2,7 +2,7 @@
# Copyright and license
##############################################################################
#
# Spec file for package freeswitch-sounds-sv-se-jakob (version 1.0.18-1)
# Spec file for package freeswitch-sounds-sv-se-jakob (version 1.0.50-1)
#
# Copyright (c) 2009 Patrick Laimbock
# Copied and modified for mod_say_sv (c) 2013 Jakob Sundberg

@ -37,7 +37,9 @@
%define build_mod_esl 0
%define build_mod_rayo 1
%define build_mod_ssml 1
%define build_mod_shout 0
%define build_mod_shout 1
%define build_mod_opusfile 0
%define build_mod_v8 0
%{?with_sang_tc:%define build_sng_tc 1 }
%{?with_sang_isdn:%define build_sng_isdn 1 }
@ -46,8 +48,11 @@
%{?with_timerfd:%define build_timerfd 1 }
%{?with_mod_esl:%define build_mod_esl 1 }
%{?with_mod_shout:%define build_mod_shout 1 }
%{?with_mod_opusfile:%define build_mod_opusfile 1 }
%{?with_mod_v8:%define build_mod_v8 1 }
%define version 1.7.0
%define nonparsedversion 1.7.0
%define version %(echo '%{nonparsedversion}' | sed 's/-//g')
%define release 1
######################################################################################################################
@ -116,7 +121,7 @@ Vendor: http://www.freeswitch.org/
# Source files and where to get them
#
######################################################################################################################
Source0: http://files.freeswitch.org/%{name}-%{version}.tar.bz2
Source0: http://files.freeswitch.org/%{name}-%{nonparsedversion}.tar.bz2
Source1: http://files.freeswitch.org/downloads/libs/v8-3.24.14.tar.bz2
Source2: http://files.freeswitch.org/downloads/libs/mongo-c-driver-1.1.0.tar.gz
Source3: http://files.freeswitch.org/downloads/libs/pocketsphinx-0.8.tar.gz
@ -189,7 +194,7 @@ BuildRequires: broadvoice-devel
BuildRequires: flite-devel
BuildRequires: ilbc2-devel
BuildRequires: g722_1-devel
BuildRequires: libcodec2-devel
BuildRequires: codec2-devel
BuildRequires: libsilk-devel
BuildRequires: libyuv-devel >= 0.0.1280
BuildRequires: lua-devel
@ -540,6 +545,7 @@ the entries aloud via a TTS engine
Summary: FreeSWITCH mod_signalwire
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
BuildRequires: libks signalwire-client-c
%description application-signalwire
Provides FreeSWITCH mod_signalwire
@ -1145,10 +1151,10 @@ a soundcard, etc.
Summary: Implements Media Steaming from arbitrary shell commands for the FreeSWITCH open source telephony platform
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Requires: libshout >= 2.3.1
Requires: libshout >= 2.2.2
Requires: libmpg123 >= 1.20.1
Requires: lame
BuildRequires: libshout-devel >= 2.3.1
BuildRequires: libshout-devel >= 2.2.2
BuildRequires: libmpg123-devel >= 1.20.1
BuildRequires: lame-devel
@ -1157,6 +1163,18 @@ Mod Shout is a FreeSWITCH module to allow you to stream audio from MP3s or a i
shoutcast stream.
%endif
%if %{build_mod_opusfile}
%package format-mod-opusfile
Summary: Plays Opus encoded files
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Requires: opusfile >= 0.5
BuildRequires: opusfile-devel >= 0.5
%description format-mod-opusfile
Mod Opusfile is a FreeSWITCH module to allow you to play Opus encoded files
%endif
%if %{build_mod_ssml}
%package format-ssml
Summary: Adds Speech Synthesis Markup Language (SSML) parser format for the FreeSWITCH open source telephony platform
@ -1202,12 +1220,14 @@ Requires: python
%description python
%if %{build_mod_v8}
%package v8
Summary: JavaScript support for the FreeSWITCH open source telephony platform, using Google V8 JavaScript engine
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
%description v8
%endif
######################################################################################################################
# FreeSWITCH Say Modules
@ -1415,7 +1435,7 @@ Basic vanilla config set for the FreeSWITCH Open Source telephone platform.
######################################################################################################################
%prep
%setup -b0 -q
%setup -b0 -q -n %{name}-%{nonparsedversion}
cp %{SOURCE1} libs/
cp %{SOURCE2} libs/
cp %{SOURCE3} libs/
@ -1546,6 +1566,9 @@ FORMATS_MODULES+=" formats/mod_shout "
%if %{build_mod_ssml}
FORMATS_MODULES+=" formats/mod_ssml"
%endif
%if %{build_mod_opusfile}
FORMATS_MODULES+=" formats/mod_opusfile"
%endif
######################################################################################################################
#
@ -1553,7 +1576,9 @@ FORMATS_MODULES+=" formats/mod_ssml"
#
######################################################################################################################
LANGUAGES_MODULES="languages/mod_lua languages/mod_perl languages/mod_python "
#LANGUAGES_MODULES+="languages/mod_v8"
%if %{build_mod_v8}
LANGUAGES_MODULES+="languages/mod_v8"
%endif
######################################################################################################################
#
@ -1623,6 +1648,8 @@ else
./rebootstrap.sh
fi
autoreconf --force --install
%configure -C \
--prefix=%{PREFIX} \
--exec-prefix=%{EXECPREFIX} \
@ -1911,6 +1938,7 @@ fi
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/amrwb.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/alsa.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/amqp.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/av.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/avmd.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/blacklist.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/callcenter.conf.xml
@ -1923,6 +1951,7 @@ fi
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/conference.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/conference_layouts.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/console.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/curl.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/db.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/dialplan_directory.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/dingaling.conf.xml
@ -1979,6 +2008,7 @@ fi
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/verto.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/voicemail.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/voicemail_ivr.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/vpx.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/xml_cdr.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/xml_curl.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/xml_rpc.conf.xml
@ -2397,12 +2427,14 @@ fi
%dir %attr(0750, freeswitch, daemon) %{sysconfdir}/autoload_configs
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/python.conf.xml
%if %{build_mod_v8}
%files v8
#%{MODINSTDIR}/mod_v8*.so*
#%{LIBDIR}/libv8.so
#%{LIBDIR}/libicui18n.so
#%{LIBDIR}/libicuuc.so
#%dir %attr(0750, freeswitch, daemon) %{sysconfdir}/autoload_configs
%{MODINSTDIR}/mod_v8*.so*
%{LIBDIR}/libv8.so
%{LIBDIR}/libicui18n.so
%{LIBDIR}/libicuuc.so
%endif
%dir %attr(0750, freeswitch, daemon) %{sysconfdir}/autoload_configs
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/v8.conf.xml
######################################################################################################################
@ -2553,6 +2585,8 @@ fi
#
######################################################################################################################
%changelog
* Tue Apr 23 2019 - Andrey Volk
- Fix build for Stack 20.x
* Tue Dec 11 2018 - Andrey Volk
- add mod_signalwire
* Sun Mar 13 2016 - Matthew Vale

File diff suppressed because it is too large Load Diff

@ -455,9 +455,11 @@
audio: false,
video: { deviceId: params.useCamera },
},
localVideo: self.options.localVideo,
localVideo: self.options.localVideo,
useCameraLabel: self.options.useCameraLabel,
useMicLabel: self.options.useMicLabel,
onsuccess: function(e) {self.options.localVideoStream = e; console.log("local video ready");},
onerror: function(e) {console.error("local video error!");}
onerror: function(e) {console.error("local video error!", e);}
});
}
@ -477,6 +479,8 @@
video: mediaParams.video
},
video: mediaParams.useVideo,
useCameraLabel: self.options.useCameraLabel,
useMicLabel: self.options.useMicLabel,
onsuccess: onSuccess,
onerror: onError
});
@ -504,7 +508,7 @@
if (obj.options.useMic !== "any") {
//audio.optional = [{sourceId: obj.options.useMic}];
audio.deviceId = {exact: obj.options.useMic};
audio.deviceId = assignMediaIdToConstraint(obj.options.useMic);
}
}
@ -514,9 +518,11 @@
audio: false,
video: { deviceId: obj.options.useCamera },
},
localVideo: obj.options.localVideo,
localVideo: obj.options.localVideo,
useCameraLabel: obj.options.useCameraLabel,
useMicLabel: obj.options.useMicLabel,
onsuccess: function(e) {obj.options.localVideoStream = e; console.log("local video ready");},
onerror: function(e) {console.error("local video error!");}
onerror: function(e) {console.error("local video error!", e); }
});
}
@ -571,9 +577,7 @@
if (obj.options.useCamera !== "any") {
//video.optional.push({sourceId: obj.options.useCamera});
video.deviceId = {
exact: obj.options.useCamera,
};
video = assignMediaIdToConstraint(obj.options.useCamera, video);
}
if (bestFrameRate) {
@ -661,7 +665,6 @@
onSuccess(self.options.useStream);
}
else if (mediaParams.audio || mediaParams.video) {
getUserMedia({
constraints: {
audio: mediaParams.audio,
@ -669,7 +672,9 @@
},
video: mediaParams.useVideo,
onsuccess: onSuccess,
onerror: onError
onerror: onError,
useCameraLabel: self.options.useCameraLabel,
useMicLabel: self.options.useMicLabel,
});
} else {
@ -762,12 +767,18 @@
};
// attachStream = MediaStream;
if (options.attachStream) peer.addStream(options.attachStream);
if (options.attachStream) {
// FreeSWITCH currently orders its answer SDP such that audio m-lines
// always come first, adding the tracks to the peer in that order
// prevents possible m-line ordering validation errors on the client.
options.attachStream.getAudioTracks().forEach(function(track) { peer.addTrack(track, options.attachStream) });
options.attachStream.getVideoTracks().forEach(function(track) { peer.addTrack(track, options.attachStream) });
}
// attachStreams[0] = audio-stream;
// attachStreams[1] = video-stream;
// attachStreams[2] = screen-capturing-stream;
if (options.attachStreams && options.attachStream.length) {
if (options.attachStreams && options.attachStreams.length) {
var streams = options.attachStreams;
for (var i = 0; i < streams.length; i++) {
peer.addStream(streams[i]);
@ -977,32 +988,77 @@
el.style.display = 'none';
}
function getUserMedia(options) {
var n = navigator,
media;
n.getMedia = n.getUserMedia;
n.getMedia(options.constraints || {
audio: true,
video: video_constraints
},
streaming, options.onerror ||
function(e) {
console.error(e);
});
function assureConstraintByLabel(constraint, fallbackLabel) {
if (fallbackLabel === undefined && constraint === undefined) {
return Promise.resolve(constraint);
}
function streaming(stream) {
if (typeof(assureMediaInputId) !== 'function') {
console.warn('Tried to use constraint fallbacks but did not found vendor function `assureMediaInputId` on window scope. Did you forget to import `vendor/media-device-id.js` before Verto?');
return Promise.resolve(constraint);
}
if (typeof(constraint) === 'object' && !constraint.deviceId) {
return Promise.resolve(constraint);
}
if (constraint.deviceId) {
if (typeof(constraint.deviceId) === 'string') {
return new Promise(function(resolve) {
assureMediaInputId(fallbackLabel, constraint.deviceId).then(function(id) {
resolve(Object.assign({}, constraint, { deviceId: id }));
}).catch(function() {
resolve(constraint);
});
});
}
if (typeof(constraint.deviceId) === 'object' && typeof(constraint.deviceId.exact) === 'string') {
return new Promise(function(resolve) {
assureMediaInputId(fallbackLabel, constraint.deviceId.exact).then(function(id) {
resolve(assignMediaIdToConstraint(id, constraint));
}).catch(function() {
resolve(constraint);
});
});
}
}
return Promise.resolve(constraint);
}
function trustyGetUserMedia(options, constraints) {
navigator.mediaDevices.getUserMedia(constraints).then(function(stream) {
if (options.localVideo) {
activateLocalVideo(options.localVideo, stream);
activateLocalVideo(options.localVideo, stream);
}
if (options.onsuccess) {
options.onsuccess(stream);
}
}).catch(options.onerror || function(e) {
console.error(e);
});
}
media = stream;
}
function assignMediaIdToConstraint(mediaId, rest) {
return Object.assign({}, rest || {}, { deviceId: { exact: mediaId } });
}
return media;
function getUserMedia(options) {
var constraints = options.constraints || {
audio: true,
video: video_constraints,
};
Promise.all([
assureConstraintByLabel(constraints.audio, options.useMicLabel),
assureConstraintByLabel(constraints.video, options.useCameraLabel),
]).then(function(assurances) {
trustyGetUserMedia(options, { audio: assurances[0], video: assurances[1] });
}).catch(function(error) {
console.error('Unexpected error on media id assurance attempts:', error, 'Options:', options);
});
}
$.FSRTC.resSupported = function(w, h) {
@ -1056,9 +1112,7 @@
};
if (cam !== "any") {
video.deviceId = {
exact: cam,
};
video = assignMediaIdToConstraint(cam, video);
}
getUserMedia({

@ -462,6 +462,7 @@
if (args["useCamera"]) {
verto.options.deviceParams["useCamera"] = args["useCamera"];
verto.options.deviceParams["useCameraLabel"] = args["useCameraLabel"];
}
var dialog = new $.verto.dialog($.verto.enum.direction.outbound, this, args);
@ -1938,6 +1939,7 @@
screenShare: false,
useCamera: false,
useMic: verto.options.deviceParams.useMic,
useMicLabel: verto.options.deviceParams.useMicLabel,
useSpeak: verto.options.deviceParams.useSpeak,
tag: verto.options.tag,
localTag: verto.options.localTag,
@ -1949,6 +1951,7 @@
if (!dialog.params.screenShare) {
dialog.params.useCamera = verto.options.deviceParams.useCamera;
dialog.params.useCameraLabel = verto.options.deviceParams.useCameraLabel;
}
dialog.verto = verto;
@ -1960,7 +1963,9 @@
dialog.attach = params.attach || false;
dialog.screenShare = params.screenShare || false;
dialog.useCamera = dialog.params.useCamera;
dialog.useCameraLabel = dialog.params.useCameraLabel;
dialog.useMic = dialog.params.useMic;
dialog.useMicLabel = dialog.params.useMicLabel;
dialog.useSpeak = dialog.params.useSpeak;
if (dialog.params.callID) {
@ -2099,7 +2104,9 @@
iceServers: verto.options.iceServers,
screenShare: dialog.screenShare,
useCamera: dialog.useCamera,
useCameraLabel: dialog.useCameraLabel,
useMic: dialog.useMic,
useMicLabel: dialog.useMicLabel,
useSpeak: dialog.useSpeak,
turnServer: verto.options.turnServer,
useStream: dialog.params.useStream
@ -2551,11 +2558,13 @@
dialog.params.callee_id_number = params.callee_id_number;
if (params.useCamera) {
dialog.useCamera = params.useCamera;
dialog.useCamera = params.useCamera;
dialog.useCameraLabel = params.useCameraLabel;
}
if (params.useMic) {
dialog.useMic = params.useMic;
dialog.useMic = params.useMic;
dialog.useMic = params.useMicLabel;
}
if (params.useSpeak) {

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -50,11 +50,14 @@ int main(void) {
hints.ai_socktype = SOCK_STREAM;
error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
if (error) {
freeaddrinfo(ai);
exit(1);
}
if (ai->ai_addr->sa_family != AF_INET) {
freeaddrinfo(ai);
exit(1);
}
freeaddrinfo(ai);
exit(0);
}
],[
@ -92,12 +95,15 @@ AC_DEFUN([APR_CHECK_GETADDRINFO_ADDRCONFIG], [
int main(int argc, char **argv) {
struct addrinfo hints, *ai;
int ret;
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_ADDRCONFIG;
return getaddrinfo("localhost", NULL, &hints, &ai) != 0;
ret = getaddrinfo("localhost", NULL, &hints, &ai) != 0;
freeaddrinfo(ai);
return ret;
}], [apr_cv_gai_addrconfig=yes],
[apr_cv_gai_addrconfig=no],
[apr_cv_gai_addrconfig=no])])

@ -136,7 +136,6 @@ AC_STRUCT_TM
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
#AC_CHECK_FUNCS([gethostname gettimeofday localtime_r memmove memset socket strcasecmp strchr strdup strncasecmp strstr])

@ -317,11 +317,10 @@ TELETONE_API(teletone_hit_type_t) teletone_dtmf_detect (teletone_dtmf_detect_sta
int sample;
int best_row;
int best_col;
char hit;
char hit = 0;
int limit;
teletone_hit_type_t r = 0;
hit = 0;
for (sample = 0; sample < samples; sample = limit) {
/* BLOCK_LEN is optimised to meet the DTMF specs. */
if ((samples - sample) >= (BLOCK_LEN - dtmf_detect_state->current_sample)) {

@ -256,7 +256,9 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone
int32_t s = teletone_dds_state_modulate_sample(&tones[i], 0);
sample += s;
}
sample /= freqlen;
if (freqlen) {
sample /= freqlen;
}
ts->buffer[ts->samples] = (teletone_audio_t)sample;
for (c = 1; c < ts->channels; c++) {

@ -66,7 +66,6 @@ AC_CHECK_TYPES([int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,uint64_t,int64_
AC_C_CONST
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset memcpy malloc free])
AC_CHECK_FUNCS([usleep nanosleep])
AC_CHECK_FUNCS([fopen fread])

@ -1 +1 @@
Wed Feb 21 15:29:04 CST 2018
Mon Feb 18 16:55:02 EST 2019

@ -940,12 +940,12 @@ static int nua_session_client_response(nua_client_request_t *cr,
char const *received = NULL;
#define LOG3(m) \
SU_DEBUG_3(("nua(%p): %s: %s %s in %u %s\n", \
SU_DEBUG_3(("nua(%p): %s: %s %s in %u %s (%u)\n", \
(void *)nh, cr->cr_method_name, (m), \
received ? received : "SDP", status, phrase))
received ? received : "SDP", status, phrase, cr->cr_answer_recv))
#define LOG5(m) \
SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s\n", \
(void *)nh, cr->cr_method_name, (m), received, status, phrase))
SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s (%u)\n", \
(void *)nh, cr->cr_method_name, (m), received, status, phrase, cr->cr_answer_recv))
retry:
@ -954,12 +954,16 @@ static int nua_session_client_response(nua_client_request_t *cr,
else if (!session_get_description(sip, &sdp, &len))
/* No SDP */;
else if (cr->cr_answer_recv) {
/* Ignore spurious answers after completing O/A */
//LOG3("ignoring duplicate");
//sdp = NULL;
// we need to make sure its *actually* a dup, so we can't assume for now.
cr->cr_answer_recv = 0;
goto retry;
if (cr->cr_answer_recv > status) {
LOG3("status is older than previous answer, ignoring");
sdp = NULL;
return 0;
} else {
// we need to make sure its *actually* a dup, so we can't assume for now.
LOG3("multiple answers received, processing");
cr->cr_answer_recv = 0;
goto retry;
}
}
else if (cr->cr_offer_sent) {
/* case 1: answer to our offer */

@ -1546,7 +1546,7 @@ static void parse_payload(sdp_parser_t *p, char *r, sdp_rtpmap_t **result)
else if (p->pr_config && r[0] == '*' && (r[1] == ' ' || r[1] == '\0')) {
PARSE_ALLOC(p, sdp_rtpmap_t, rm);
*result = rm; result = &rm->rm_next;
*result = rm;
rm->rm_predef = 1;
rm->rm_any = 1;

@ -104,6 +104,7 @@ char const
sip_603_Decline[] = "Decline",
sip_604_Does_not_exist_anywhere[] = "Does Not Exist Anywhere",
sip_606_Not_acceptable[] = "Not Acceptable",
sip_607_Unwanted[] = "Unwanted",
sip_687_Dialog_terminated[] = "Dialog Terminated"
;
@ -191,6 +192,7 @@ char const *sip_status_phrase(int status)
case 603: return sip_603_Decline;
case 604: return sip_604_Does_not_exist_anywhere;
case 606: return sip_606_Not_acceptable;
case 607: return sip_607_Unwanted;
case 687: return sip_687_Dialog_terminated;
}

@ -1422,6 +1422,15 @@ int sip_response_terminates_dialog(int response_code,
*/
*return_graceful_terminate_usage = 0;
return 0;
case 607: /** @par 607 Unwanted
This response is similar to 603, except it informs the caller
that the call is unwanted and may be blacklisted. Added by
RFC-8197
*/
*return_graceful_terminate_usage = 0;
return 0;
}
/* Do not change graceful_terminate */

@ -169,6 +169,8 @@ SOFIAPUBFUN char const *sip_status_phrase(int status);
#define SIP_604_DOES_NOT_EXIST_ANYWHERE 604, sip_604_Does_not_exist_anywhere
/** 606 Not Acceptable @HIDE */
#define SIP_606_NOT_ACCEPTABLE 606, sip_606_Not_acceptable
/** 607 Unwanted @HIDE */
#define SIP_607_UNWANTED 607, sip_607_Unwanted
/** 687 Dialog terminated @HIDE */
#define SIP_687_DIALOG_TERMINATED 687, sip_687_Dialog_terminated
@ -238,6 +240,7 @@ SOFIAPUBVAR char const sip_600_Busy_everywhere[];
SOFIAPUBVAR char const sip_603_Decline[];
SOFIAPUBVAR char const sip_604_Does_not_exist_anywhere[];
SOFIAPUBVAR char const sip_606_Not_acceptable[];
SOFIAPUBVAR char const sip_607_Unwanted[];
SOFIAPUBVAR char const sip_687_Dialog_terminated[];
SOFIA_END_DECLS

@ -1511,6 +1511,7 @@ static int response_phrase_test(void)
{ SIP_603_DECLINE },
{ SIP_604_DOES_NOT_EXIST_ANYWHERE },
{ SIP_606_NOT_ACCEPTABLE },
{ SIP_607_UNWANTED },
{ 0, NULL }
};
int i;

@ -386,7 +386,7 @@ void tport_dump_iovec(tport_t const *self, msg_t *msg,
size_t len = iov[i].mv_len;
if (len > n)
len = n;
if (fwrite(iov[i].mv_base, len, 1, mr->mr_dump_file) != len)
if (fwrite(iov[i].mv_base, len, 1, mr->mr_dump_file) != 1)
break;
n -= len;
}
@ -732,7 +732,7 @@ int tport_capt_msg_hepv3 (tport_t const *self, msg_t *msg, size_t n,
/* Capture ID */
hg->capt_id.chunk.vendor_id = htons(0x0000);
hg->capt_id.chunk.type_id = htons(0x000c);
hg->capt_id.data = htons(mr->mr_agent_id);
hg->capt_id.data = htonl(mr->mr_agent_id);
hg->capt_id.chunk.length = htons(sizeof(hg->capt_id));

@ -468,6 +468,9 @@ int tport_tls_recv(tport_t *self)
if (self->tp_master->mr_dump_file)
tport_dump_iovec(self, msg, n, iovec, veclen, "recv", "from");
if (self->tp_master->mr_capt_sock)
tport_capt_msg(self, msg, n, iovec, veclen, "recv");
/* Mark buffer as used */
msg_recv_commit(msg, N, 0);

@ -154,11 +154,6 @@ AC_FUNC_VPRINTF
AC_FUNC_MEMCMP
AC_FUNC_MEMMOVE
if test "${ax_cv_c_compiler_vendor}" = "gnu"
then
AC_FUNC_REALLOC
AC_FUNC_MALLOC
fi
AC_FUNC_SELECT_ARGTYPES
AX_C99_FUNC_LRINT

@ -190,6 +190,18 @@ AC_ARG_ENABLE(test-suites,
[enable_test_suites="$enableval"],
[enable_test_suites="no"])
# Enable clang address sanitizer bit build
AC_ARG_ENABLE(address_sanitizer,
[AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
[enable_address_sanitizer="$enable_address_sanitizer"],
[enable_address_sanitizer="no"])
if test "${enable_address_sanitizer}" = "yes"; then
APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer)
APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer)
APR_ADDTO(LDFLAGS, -fsanitize=address)
fi
AM_CONDITIONAL([TEST_SUITES],[test "${enable_test_suites}" != "no"])
AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -123,11 +123,11 @@ set_fs_ver () {
rpm_version="$major.$minor.$micro"
fi
sed -e "s|\(%define version \).*|\1$rpm_version|" \
sed -e "s|\(%define nonparsedversion \).*|\1$rpm_version|" \
freeswitch.spec > freeswitch.spec.$$
mv freeswitch.spec.$$ freeswitch.spec
sed -e "s|\(%define version \).*|\1$rpm_version|" \
sed -e "s|\(%define nonparsedversion \).*|\1$rpm_version|" \
freeswitch-config-rayo.spec > freeswitch-config-rayo.spec.$$
mv freeswitch-config-rayo.spec.$$ freeswitch-config-rayo.spec

@ -1,7 +1,7 @@
#!/bin/sh
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
declare -a specfiles=('freeswitch-sounds-en-ca-june.spec' 'freeswitch-sounds-fr-ca-june.spec' 'freeswitch-sounds-ru-RU-elena.spec' 'freeswitch-sounds-en-us-callie.spec' 'freeswitch-sounds-sv-se-jakob.spec')
declare -a specfiles=('freeswitch-sounds-en-ca-june.spec' 'freeswitch-sounds-en-us-allison.spec' 'freeswitch-sounds-fr-ca-june.spec' 'freeswitch-sounds-music.spec' 'freeswitch-sounds-pt-BR-karina.spec' 'freeswitch-sounds-ru-RU-elena.spec' 'freeswitch-sounds-en-us-callie.spec' 'freeswitch-sounds-sv-se-jakob.spec')
sdir="."
[ -n "${0%/*}" ] && sdir="${0%/*}"
@ -15,17 +15,17 @@ basedir=$(pwd);
if [ ! -d "$basedir/../freeswitch-sounds" ]; then
cd $basedir/..
git clone https://freeswitch.org/stash/scm/fs/freeswitch-sounds.git
git clone https://freeswitch.org/stash/scm/fs/freeswitch-sounds.git
else
cd $basedir/../freeswitch-sounds
git clean -fdx
git pull
git pull
fi
for i in "${specfiles[@]}"
do
cd $basedir/../freeswitch-sounds/sounds/trunk
cd $basedir/../freeswitch-sounds/
./dist.pl `echo $i|sed -e 's/freeswitch-sounds-//g' -e 's/\.spec//g' -e 's/-/\//g'`

@ -129,6 +129,7 @@ struct switch_core_session {
switch_audio_resampler_t *write_resampler;
switch_mutex_t *mutex;
switch_mutex_t *stack_count_mutex;
switch_mutex_t *resample_mutex;
switch_mutex_t *codec_read_mutex;
switch_mutex_t *codec_write_mutex;

@ -270,6 +270,9 @@ SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel_t *channel);
SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t *channel, const char *name, const char *val);
SWITCH_DECLARE(switch_status_t) switch_channel_set_log_tag(switch_channel_t *channel, const char *tagname, const char *tagvalue);
SWITCH_DECLARE(switch_status_t) switch_channel_get_log_tags(switch_channel_t *channel, switch_event_t **log_tags);
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_channel_t *channel,
const char *varname, const char *value, switch_bool_t var_check);
SWITCH_DECLARE(switch_status_t) switch_channel_add_variable_var_check(switch_channel_t *channel,

@ -2427,6 +2427,7 @@ SWITCH_DECLARE(const char *) switch_lookup_timezone(const char *tz_name);
SWITCH_DECLARE(switch_status_t) switch_strftime_tz(const char *tz, const char *format, char *date, size_t len, switch_time_t thetime);
SWITCH_DECLARE(switch_status_t) switch_time_exp_tz_name(const char *tz, switch_time_exp_t *tm, switch_time_t thetime);
SWITCH_DECLARE(void) switch_load_network_lists(switch_bool_t reload);
SWITCH_DECLARE(switch_bool_t) switch_check_network_list_ip_port_token(const char *ip_str, int port, const char *list_name, const char **token);
SWITCH_DECLARE(switch_bool_t) switch_check_network_list_ip_token(const char *ip_str, const char *list_name, const char **token);
#define switch_check_network_list_ip(_ip_str, _list_name) switch_check_network_list_ip_token(_ip_str, _list_name, NULL)
SWITCH_DECLARE(void) switch_time_set_monotonic(switch_bool_t enable);

@ -270,6 +270,10 @@ SWITCH_DECLARE(switch_rtp_stats_t *) switch_core_media_get_stats(switch_core_ses
SWITCH_DECLARE(void) switch_core_media_set_sdp_codec_string(switch_core_session_t *session, const char *r_sdp, switch_sdp_type_t sdp_type);
SWITCH_DECLARE(void) switch_core_media_merge_sdp_codec_string(switch_core_session_t *session, const char *r_sdp,
switch_sdp_type_t sdp_type, const char *codec_string);
SWITCH_DECLARE(void) switch_core_media_reset_autofix(switch_core_session_t *session, switch_media_type_t type);
SWITCH_DECLARE(void) switch_core_media_check_outgoing_proxy(switch_core_session_t *session, switch_core_session_t *o_session);
SWITCH_DECLARE(switch_status_t) switch_core_media_codec_chosen(switch_core_session_t *session, switch_media_type_t media);
@ -381,7 +385,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_print(switch_core_session_t
SWITCH_DECLARE(switch_status_t) switch_core_session_printf(switch_core_session_t *session, const char *fmt, ...);
SWITCH_DECLARE(switch_msrp_session_t *) switch_core_media_get_msrp_session(switch_core_session_t *session);
SWITCH_DECLARE(void) switch_core_media_set_smode(switch_core_session_t *session, switch_media_type_t type, switch_media_flow_t smode, switch_sdp_type_t sdp_type);
SWITCH_END_EXTERN_C
#endif

@ -215,7 +215,7 @@ SWITCH_DECLARE(int) switch_event_add_array(switch_event_t *event, const char *va
\param event pointer to the pointer to event to destroy
*/
SWITCH_DECLARE(void) switch_event_destroy(switch_event_t **event);
#define switch_event_safe_destroy(_event) if (_event) switch_event_destroy(_event)
#define switch_event_safe_destroy(_event) if (_event) switch_event_destroy(&_event)
/*!
\brief Duplicate an event

@ -293,6 +293,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(swit
\return SWITCH_STATUS_SUCCESS if all is well
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, const char *file, uint32_t limit, switch_file_handle_t *fh);
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session_event(switch_core_session_t *session, const char *file, uint32_t limit, switch_file_handle_t *fh, switch_event_t *variables);
SWITCH_DECLARE(switch_status_t) switch_ivr_transfer_recordings(switch_core_session_t *orig_session, switch_core_session_t *new_session);

@ -318,7 +318,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_exists(const char *mod);
\param err pointer to error message
\return the status
*/
SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir, char *fname, switch_bool_t force, const char **err);
SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(const char *dir, const char *fname, switch_bool_t force, const char **err);
/* Prototypes of module interface functions */
@ -328,7 +328,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir,
\param filename the path to the module's dll or so file
\return SWITCH_STATUS_SUCCESS on a successful load
*/
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(switch_loadable_module_interface_t ** module_interface, char *filename);
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(switch_loadable_module_interface_t ** module_interface, const char *filename);
SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void);
/*!

@ -65,6 +65,7 @@ SWITCH_BEGIN_EXTERN_C
/* To maintain abi, only add new elements to the end of this struct and do not delete any elements */
switch_text_channel_t channel;
switch_log_level_t slevel;
switch_event_t *tags;
} switch_log_node_t;
typedef switch_status_t (*switch_log_function_t) (const switch_log_node_t *node, switch_log_level_t level);

@ -578,7 +578,7 @@ SWITCH_DECLARE(switch_rtp_stats_t *) switch_rtp_get_stats(switch_rtp_t *rtp_sess
SWITCH_DECLARE(switch_byte_t) switch_rtp_check_auto_adj(switch_rtp_t *rtp_session);
SWITCH_DECLARE(void) switch_rtp_set_interdigit_delay(switch_rtp_t *rtp_session, uint32_t delay);
SWITCH_DECLARE(switch_status_t) switch_rtp_add_dtls(switch_rtp_t *rtp_session, dtls_fingerprint_t *local_fp, dtls_fingerprint_t *remote_fp, dtls_type_t type);
SWITCH_DECLARE(switch_status_t) switch_rtp_add_dtls(switch_rtp_t *rtp_session, dtls_fingerprint_t *local_fp, dtls_fingerprint_t *remote_fp, dtls_type_t type, uint8_t want_DTLSv1_2);
SWITCH_DECLARE(switch_status_t) switch_rtp_del_dtls(switch_rtp_t *rtp_session, dtls_type_t type);
SWITCH_DECLARE(dtls_state_t) switch_rtp_dtls_state(switch_rtp_t *rtp_session, dtls_type_t type);

@ -38,6 +38,7 @@
#endif
#include <openssl/crypto.h>
#include <openssl/pem.h>
#include <openssl/rand.h>
#include <openssl/conf.h>
#include <openssl/x509v3.h>
#ifndef OPENSSL_NO_ENGINE

@ -377,7 +377,9 @@ typedef enum {
SCF_DEBUG_SQL = (1 << 21),
SCF_API_EXPANSION = (1 << 22),
SCF_SESSION_THREAD_POOL = (1 << 23),
SCF_DIALPLAN_TIMESTAMPS = (1 << 24)
SCF_DIALPLAN_TIMESTAMPS = (1 << 24),
SCF_CPF_SOFT_PREFIX = (1 << 25),
SCF_CPF_SOFT_LOOKUP = (1 << 26)
} switch_core_flag_enum_t;
typedef uint32_t switch_core_flag_t;
@ -554,7 +556,7 @@ struct switch_filenames {
typedef struct switch_filenames switch_filenames;
SWITCH_DECLARE_DATA extern switch_filenames SWITCH_GLOBAL_filenames;
#define SWITCH_MAX_STACKS 16
#define SWITCH_MAX_STACKS 32
#define SWITCH_THREAD_STACKSIZE 240 * 1024
#define SWITCH_SYSTEM_THREAD_STACKSIZE 8192 * 1024
#define SWITCH_MAX_INTERVAL 120 /* we only do up to 120ms */
@ -578,7 +580,9 @@ typedef enum {
SWITCH_CPF_NONE = 0,
SWITCH_CPF_SCREEN = (1 << 0),
SWITCH_CPF_HIDE_NAME = (1 << 1),
SWITCH_CPF_HIDE_NUMBER = (1 << 2)
SWITCH_CPF_HIDE_NUMBER = (1 << 2),
SWITCH_CPF_SOFT_PREFIX = (1 << 3),
SWITCH_CPF_SOFT_LOOKUP = (1 << 4)
} switch_caller_profile_flag_enum_t;
typedef uint32_t switch_caller_profile_flag_t;
@ -713,6 +717,21 @@ typedef struct {
uint32_t init;
} switch_rtcp_numbers_t;
typedef struct {
uint16_t nack_count;
uint16_t fir_count;
uint16_t pli_count;
uint16_t sr_count;
uint16_t rr_count;
} switch_rtcp_video_counters_t;
typedef struct {
/* counters and stats for the incoming video stream and outgoing RTCP*/
switch_rtcp_video_counters_t video_in;
/* counters and stats for the outgoing video stream and incoming RTCP*/
switch_rtcp_video_counters_t video_out;
} switch_rtcp_video_stats_t;
typedef struct {
switch_rtp_numbers_t inbound;
switch_rtp_numbers_t outbound;
@ -1573,6 +1592,7 @@ typedef enum {
CF_STREAM_CHANGED,
CF_ARRANGED_BRIDGE,
CF_STATE_REPEAT,
CF_WANT_DTLSv1_2,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
/* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
CF_FLAG_MAX
@ -2170,7 +2190,13 @@ typedef enum {
SWITCH_CAUSE_INVALID_URL = 610,
SWITCH_CAUSE_INVALID_PROFILE = 611,
SWITCH_CAUSE_NO_PICKUP = 612,
SWITCH_CAUSE_SRTP_READ_ERROR = 613
SWITCH_CAUSE_SRTP_READ_ERROR = 613,
SWITCH_CAUSE_BOWOUT = 614,
SWITCH_CAUSE_BUSY_EVERYWHERE = 615,
SWITCH_CAUSE_DECLINE = 616,
SWITCH_CAUSE_DOES_NOT_EXIST_ANYWHERE = 617,
SWITCH_CAUSE_NOT_ACCEPTABLE = 618,
SWITCH_CAUSE_UNWANTED = 619
} switch_call_cause_t;
typedef enum {
@ -2642,7 +2668,8 @@ typedef enum {
typedef enum {
ICE_GOOGLE_JINGLE = (1 << 0),
ICE_VANILLA = (1 << 1),
ICE_CONTROLLED = (1 << 2)
ICE_CONTROLLED = (1 << 2),
ICE_LITE = (1 << 3)
} switch_core_media_ice_type_t;
typedef enum {

@ -46,6 +46,16 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_URL_UNSAFE "\r\n #%&+:;<=>?@[\\]^`{|}\""
#define MAX_NETWORK_PORTS 10
struct switch_network_port_range {
int port;
int ports[MAX_NETWORK_PORTS];
int min_port;
int max_port;
};
typedef struct switch_network_port_range switch_network_port_range_t;
typedef switch_network_port_range_t* switch_network_port_range_p;
static inline char *switch_get_hex_bytes(switch_byte_t *buf, switch_size_t datalen, char *new_buf, switch_size_t new_datalen)
{
@ -1270,6 +1280,12 @@ SWITCH_DECLARE(switch_status_t) switch_network_list_add_cidr_token(switch_networ
SWITCH_DECLARE(char *) switch_network_ipv4_mapped_ipv6_addr(const char* ip_str);
SWITCH_DECLARE(switch_status_t) switch_network_list_add_host_mask(switch_network_list_t *list, const char *host, const char *mask_str, switch_bool_t ok);
SWITCH_DECLARE(switch_status_t) switch_network_list_add_cidr_port_token(switch_network_list_t *list, const char *cidr_str, switch_bool_t ok, const char *token, switch_network_port_range_p port);
SWITCH_DECLARE(switch_status_t) switch_network_list_add_host_port_mask(switch_network_list_t *list, const char *host, const char *mask_str, switch_bool_t ok, switch_network_port_range_p port);
SWITCH_DECLARE(switch_bool_t) switch_network_list_validate_ip_port_token(switch_network_list_t *list, uint32_t ip, int port, const char **token);
SWITCH_DECLARE(switch_bool_t) switch_network_list_validate_ip6_port_token(switch_network_list_t *list, ip_t ip, int port, const char **token);
SWITCH_DECLARE(switch_bool_t) switch_network_list_validate_ip_token(switch_network_list_t *list, uint32_t ip, const char **token);
SWITCH_DECLARE(switch_bool_t) switch_network_list_validate_ip6_token(switch_network_list_t *list, ip_t ip, const char **token);
#define switch_network_list_validate_ip(_list, _ip) switch_network_list_validate_ip_token(_list, _ip, NULL);

@ -8,6 +8,8 @@ uninstall: $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES)
mod_skypopen-all: mod_gsmopen-all
mod_gsmopen-all: mod_spandsp-all
mod_unimrcp-all: mod_sofia-all
mod_rayo-all: mod_dingaling-all
mod_ssml-all: mod_rayo-all
$(OUR_MODULES) $(OUR_CLEAN_MODULES) $(OUR_INSTALL_MODULES) $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_MODULES) $(OUR_DISABLED_CLEAN_MODULES) $(OUR_DISABLED_INSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES):
@set fnord $$MAKEFLAGS; amf=$$2; \

@ -1,155 +1,219 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>mod_av</ProjectName>
<RootNamespace>mod_av</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{7AEE504B-23B6-4B05-829E-7CD34855F146}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(SolutionDir)w32\ffmpeg.props" />
<ImportGroup Label="ExtensionSettings">
</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\module_release.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\module_debug.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\module_release.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\module_debug.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="avcodec.c" />
<ClCompile Include="avformat.c" />
<ClCompile Include="mod_av.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\libs\win32\ffmpeg\ffmpeg.2017.vcxproj">
<Project>{bc1fd72e-1cd5-4525-a7f5-17c5740bfded}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\w32\Library\FreeSwitchCore.2017.vcxproj">
<Project>{202d7a4e-760d-4d0e-afa1-d7459ced30ff}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-x264|Win32">
<Configuration>Debug-x264</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-x264|x64">
<Configuration>Debug-x264</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-openh264|x64">
<Configuration>Debug-openh264</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-x264|Win32">
<Configuration>Release-x264</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-x264|x64">
<Configuration>Release-x264</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-openh264|x64">
<Configuration>Release-openh264</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>mod_av</ProjectName>
<RootNamespace>mod_av</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{7AEE504B-23B6-4B05-829E-7CD34855F146}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-x264|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-x264|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-x264|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-x264|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-openh264|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-openh264|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(SolutionDir)w32\ffmpeg.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-x264|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-x264|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_debug.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-x264|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-x264|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_debug.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-openh264|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-openh264|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_debug.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-x264|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-x264|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-openh264|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-x264|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-x264|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-openh264|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>"../../libvpx";$(SolutionDir)\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;HAVE_AV_CONFIG_H;_ISOC99_SOURCE;_FILE_OFFSET_BITS=64;_LARGEFILE_SOURCE;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WIN32_WINNT=0x0502;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4127;4018;4389;4146;4057;4204;4706;4305;4152;4324;4013;4100;4214;4273;4554;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\libs\libav\Win32\$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="avcodec.c" />
<ClCompile Include="avformat.c" />
<ClCompile Include="mod_av.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\libs\win32\ffmpeg\ffmpeg.2017.vcxproj">
<Project>{bc1fd72e-1cd5-4525-a7f5-17c5740bfded}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\w32\Library\FreeSwitchCore.2017.vcxproj">
<Project>{202d7a4e-760d-4d0e-afa1-d7459ced30ff}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -644,11 +644,11 @@ static switch_bool_t avmd_callback(switch_media_bug_t * bug, void *user_data, sw
case SWITCH_ABC_TYPE_CLOSE:
avmd_session_close(avmd_session);
switch_mutex_lock(avmd_globals.mutex);
switch_mutex_lock(avmd_globals.mutex);
if (avmd_globals.session_n > 0) {
--avmd_globals.session_n;
}
switch_mutex_unlock(avmd_globals.mutex);
switch_mutex_unlock(avmd_globals.mutex);
break;
default:
@ -1151,7 +1151,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_avmd_load) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No memory pool assigned!\n");
return SWITCH_STATUS_TERM;
}
switch_mutex_init(&avmd_globals.mutex, SWITCH_MUTEX_DEFAULT, pool);
switch_mutex_init(&avmd_globals.mutex, SWITCH_MUTEX_NESTED, pool);
avmd_globals.pool = pool;
if (avmd_load_xml_configuration(NULL) != SWITCH_STATUS_SUCCESS) {

@ -435,6 +435,7 @@ static struct {
switch_mutex_t *mutex;
switch_memory_pool_t *pool;
switch_event_node_t *node;
int agent_originate_timeout;
} globals;
#define CC_QUEUE_CONFIGITEM_COUNT 100
@ -1495,6 +1496,8 @@ static switch_status_t load_config(void)
globals.global_database_lock = switch_true(val);
} else if (!strcasecmp(var, "cc-instance-id")) {
globals.cc_instance_id = strdup(val);
} else if (!strcasecmp(var, "agent-originate-timeout")) {
globals.agent_originate_timeout = atoi(val);
}
}
}
@ -1511,9 +1514,11 @@ static switch_status_t load_config(void)
}
if (!globals.global_database_lock) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Disabling global database lock\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Disabling global database lock\n");
}
if (!globals.agent_originate_timeout) globals.agent_originate_timeout = 60;
/* Initialize database */
if (!(dbh = cc_get_db_handle())) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot open DB!\n");
@ -1707,7 +1712,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
dialstr = switch_channel_expand_variables(member_channel, h->originate_string);
switch_channel_set_app_flag_key(CC_APP_KEY, member_channel, CC_APP_AGENT_CONNECTING);
status = switch_ivr_originate(NULL, &agent_session, &cause, dialstr, 60, NULL, cid_name ? cid_name : h->member_cid_name, cid_number ? cid_number : h->member_cid_number, NULL, ovars, SOF_NONE, NULL, NULL);
status = switch_ivr_originate(NULL, &agent_session, &cause, dialstr, globals.agent_originate_timeout, NULL, cid_name ? cid_name : h->member_cid_name, cid_number ? cid_number : h->member_cid_number, NULL, ovars, SOF_NONE, NULL, NULL);
/* Search for loopback agent */
if (status == SWITCH_STATUS_SUCCESS) {

@ -3886,8 +3886,11 @@ SWITCH_STANDARD_API(uuid_broadcast_function)
flags = SMF_ECHO_ALEG | SMF_HOLD_BLEG;
}
switch_ivr_broadcast(argv[0], argv[1], flags);
stream->write_function(stream, "+OK Message sent\n");
if (switch_ivr_broadcast(argv[0], argv[1], flags) == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "+OK Message sent\n");
} else {
stream->write_function(stream, "-ERR invalid uuid\n");
}
}
switch_safe_free(mycmd);
@ -4657,14 +4660,16 @@ SWITCH_STANDARD_API(uuid_bridge_function)
return SWITCH_STATUS_SUCCESS;
}
#define SESS_REC_SYNTAX "<uuid> [start|stop|mask|unmask] <path> [<limit>]"
#define SESS_REC_SYNTAX "<uuid> [start|stop|mask|unmask] <path> [<limit>] [<recording_vars>]"
SWITCH_STANDARD_API(session_record_function)
{
switch_core_session_t *rsession = NULL;
char *mycmd = NULL, *argv[4] = { 0 };
char *mycmd = NULL, *argv[5] = { 0 };
char *uuid = NULL, *action = NULL, *path = NULL;
int argc = 0;
uint32_t limit = 0;
switch_event_t *vars = NULL;
char *new_fp = NULL;
if (zstr(cmd)) {
goto usage;
@ -4693,11 +4698,16 @@ SWITCH_STANDARD_API(session_record_function)
}
if (!strcasecmp(action, "start")) {
if (switch_ivr_record_session(rsession, path, limit, NULL) != SWITCH_STATUS_SUCCESS) {
if(argc > 3) {
switch_url_decode(argv[4]);
switch_event_create_brackets(argv[4], '{', '}',',', &vars, &new_fp, SWITCH_FALSE);
}
if (switch_ivr_record_session_event(rsession, path, limit, NULL, vars) != SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "-ERR Cannot record session!\n");
} else {
stream->write_function(stream, "+OK Success\n");
}
switch_event_safe_destroy(vars);
} else if (!strcasecmp(action, "stop")) {
if (switch_ivr_stop_record_session(rsession, path) != SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "-ERR Cannot stop record session!\n");
@ -4934,6 +4944,8 @@ SWITCH_STANDARD_API(break_function)
}
}
stream->write_function(stream, "+OK\n");
done:
if (psession) {

@ -810,10 +810,16 @@ switch_status_t conference_api_sub_hup(conference_member_t *member, switch_strea
switch_event_t *event;
if (member == NULL) {
if (stream != NULL) {
stream->write_function(stream, "-ERR Invalid member!\n");
}
return SWITCH_STATUS_GENERR;
}
conference_utils_member_clear_flag(member, MFLAG_RUNNING);
if (stream != NULL) {
stream->write_function(stream, "+OK hup %u\n", member->id);
}
if (member->conference && test_eflag(member->conference, EFLAG_HUP_MEMBER)) {
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
@ -1852,7 +1858,12 @@ switch_status_t conference_api_sub_vid_res(conference_obj_t *conference, switch_
}
if (canvas_w < 320 || canvas_h < 180) {
stream->write_function(stream, "-ERR Invalid size\n");
stream->write_function(stream, "-ERR Invalid size, [%dx%d] is too small\n", canvas_w, canvas_h);
return SWITCH_STATUS_SUCCESS;
}
if (canvas_w > 7680 || canvas_h > 4320) {
stream->write_function(stream, "-ERR Invalid size, [%dx%d] is too large.\n", canvas_w, canvas_h);
return SWITCH_STATUS_SUCCESS;
}
@ -1877,7 +1888,11 @@ switch_status_t conference_api_sub_vid_res(conference_obj_t *conference, switch_
id = 1;
}
conference_video_change_res(conference, canvas_w, canvas_h, id - 1);
if (conference_video_change_res(conference, canvas_w, canvas_h, id - 1) == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "+OK Resolution set to [%dx%d]\n", canvas_w, canvas_h);
} else {
stream->write_function(stream, "-ERR Resolution not set\n");
}
return SWITCH_STATUS_SUCCESS;
}
@ -3556,9 +3571,9 @@ switch_status_t conference_api_sub_dial(conference_obj_t *conference, switch_str
}
if (conference) {
conference_outcall(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], NULL, &cause, NULL, NULL);
conference_outcall(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], NULL, &cause, NULL, NULL, NULL);
} else {
conference_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], NULL, &cause, NULL, NULL);
conference_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], NULL, &cause, NULL, NULL, NULL);
}
stream->write_function(stream, "+OK Call Requested: result: [%s]\n", switch_channel_cause2str(cause));

@ -398,7 +398,7 @@ void conference_event_mod_channel_handler(const char *event_channel, cJSON *json
} else if (exec) {
cJSON_AddItemToObject(jdata, "conf-command", cJSON_CreateString(exec));
cJSON_AddItemToObject(jdata, "response", cJSON_CreateString((char *)stream.data));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ALERT,"RES [%s][%s]\n", exec, (char *)stream.data);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"RES [%s][%s]\n", exec, (char *)stream.data);
} else {
cJSON_AddItemToObject(jdata, "error", cJSON_CreateString("Invalid Command"));
}
@ -741,10 +741,12 @@ switch_status_t conference_event_add_data(conference_obj_t *conference, switch_e
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Domain", conference->domain);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Size", "%u", conference->count);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Ghosts", "%u", conference->count_ghosts);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Profile-Name", conference->profile_name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Unique-ID", conference->uuid_str);
switch_event_merge(event, conference->variables);
return status;
}

@ -939,6 +939,10 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
goto do_continue;
}
if (!switch_channel_test_app_flag(channel, CF_AUDIO)) {
goto do_continue;
}
/* if the member can speak, compute the audio energy level and */
/* generate events when the level crosses the threshold */
if (((conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_member_test_flag(member, MFLAG_HOLD)) ||
@ -1228,7 +1232,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
if (datalen) {
switch_size_t ok = 1;
/* Write the audio into the input buffer */
switch_mutex_lock(member->audio_in_mutex);
if (switch_buffer_inuse(member->audio_buffer) > flush_len) {

@ -76,6 +76,7 @@ void conference_member_bind_controls(conference_member_t *member, const char *co
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Conf-Profile", member->conference->profile_name);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Action", "request-controls");
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Controls", controls);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Fetch-Call-UUID", switch_core_session_get_uuid(member->session));
if (!(cxml = switch_xml_open_cfg(mod_conference_cf_name, &cfg, params))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", mod_conference_cf_name);
@ -762,7 +763,7 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
}
if ((var = switch_channel_get_variable_dup(member->channel, "conference_join_volume_in", SWITCH_FALSE, -1))) {
uint32_t id = atoi(var);
int id = atoi(var);
if (id > -5 && id < 5) {
member->volume_in_level = id;
@ -770,7 +771,7 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
}
if ((var = switch_channel_get_variable_dup(member->channel, "conference_join_volume_out", SWITCH_FALSE, -1))) {
uint32_t id = atoi(var);
int id = atoi(var);
if (id > -5 && id < 5) {
member->volume_out_level = id;
@ -779,15 +780,15 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
if ((var = switch_channel_get_variable_dup(member->channel, "conference_join_energy_level", SWITCH_FALSE, -1))) {
uint32_t id = atoi(var);
int id = atoi(var);
if (id > -5 && id < 5) {
if (id > -2 && id < 1801) {
member->energy_level = id;
}
}
if ((var = switch_channel_get_variable_dup(member->channel, "video_initial_canvas", SWITCH_FALSE, -1))) {
uint32_t id = atoi(var) - 1;
int id = atoi(var) - 1;
if (id < conference->canvas_count) {
member->canvas_id = id;
member->layer_timeout = DEFAULT_LAYER_TIMEOUT;
@ -795,7 +796,7 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
}
if ((var = switch_channel_get_variable_dup(member->channel, "video_initial_watching_canvas", SWITCH_FALSE, -1))) {
uint32_t id = atoi(var) - 1;
int id = atoi(var) - 1;
if (id == 0) {
id = conference->canvas_count;

@ -91,7 +91,6 @@ switch_status_t conference_record_stop(conference_obj_t *conference, switch_stre
switch_mutex_lock(conference->member_mutex);
for (member = conference->members; member; member = member->next) {
if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path))) {
conference->record_count--;
if (!conference_utils_test_flag(conference, CFLAG_CONF_RESTART_AUTO_RECORD) && member->rec && member->rec->autorec) {
stream->write_function(stream, "Stopped AUTO recording file %s (Auto Recording Now Disabled)\n", member->rec_path);
conference->auto_record = 0;
@ -155,7 +154,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
{
int16_t *data_buf;
conference_member_t smember = { 0 }, *member;
conference_record_t *rp, *last = NULL, *rec = (conference_record_t *) obj;
conference_record_t *rp, *rec = (conference_record_t *) obj;
conference_obj_t *conference = rec->conference;
uint32_t samples = switch_samples_per_packet(conference->rate, conference->interval);
uint32_t mux_used;
@ -422,6 +421,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
switch_core_file_close(&member->rec->fh);
}
conference->record_count--;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Recording of %s Stopped\n", rec->path);
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
@ -455,11 +455,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
switch_mutex_lock(conference->flag_mutex);
for (rp = conference->rec_node_head; rp; rp = rp->next) {
if (rec == rp) {
if (last) {
last->next = rp->next;
} else {
conference->rec_node_head = rp->next;
}
conference->rec_node_head = rp->next;
}
}
switch_mutex_unlock(conference->flag_mutex);

@ -2031,6 +2031,8 @@ video_layout_t *conference_video_get_layout(conference_obj_t *conference, const
layout_group_t *lg = NULL;
video_layout_t *vlayout = NULL;
if (!video_layout_name) return NULL;
if (video_layout_group) {
lg = switch_core_hash_find(conference->layout_group_hash, video_layout_group);
vlayout = conference_video_find_best_layout(conference, lg, 0, 0);

@ -611,7 +611,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
for (omember = conference->members; omember; omember = omember->next) {
switch_size_t ok = 1;
if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING)) {
if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING) || !switch_channel_test_flag(omember->channel, CF_AUDIO)) {
continue;
}
@ -667,13 +667,14 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
write_frame[x] = (int16_t) z;
}
switch_mutex_lock(omember->audio_out_mutex);
ok = switch_buffer_write(omember->mux_buffer, write_frame, bytes);
switch_mutex_unlock(omember->audio_out_mutex);
if (!ok) {
switch_mutex_unlock(conference->mutex);
goto end;
if (switch_channel_test_flag(omember->channel, CF_AUDIO)) {
switch_mutex_lock(omember->audio_out_mutex);
ok = switch_buffer_write(omember->mux_buffer, write_frame, bytes);
switch_mutex_unlock(omember->audio_out_mutex);
if (!ok) {
switch_mutex_unlock(conference->mutex);
goto end;
}
}
}
} else { /* There is no source audio. Push silence into all of the buffers */
@ -688,7 +689,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
for (omember = conference->members; omember; omember = omember->next) {
switch_size_t ok = 1;
if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING)) {
if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING) || !switch_channel_test_flag(omember->channel, CF_AUDIO)) {
continue;
}
@ -1133,7 +1134,8 @@ switch_xml_t add_x_tag(switch_xml_t x_member, const char *name, const char *valu
void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off)
{
conference_member_t *member = NULL;
switch_xml_t x_member = NULL, x_members = NULL, x_flags;
switch_xml_t x_member = NULL, x_members = NULL, x_flags, x_variables;
switch_event_header_t *hp;
int moff = 0;
char i[30] = "";
char *ival = i;
@ -1218,6 +1220,13 @@ void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, i
switch_snprintf(i, sizeof(i), "%d", switch_epoch_time_now(NULL) - conference->run_time);
switch_xml_set_attr_d(x_conference, "run_time", ival);
x_variables = switch_xml_add_child_d(x_conference, "variables", 0);
for (hp = conference->variables->headers; hp; hp = hp->next) {
switch_xml_t x_variable = switch_xml_add_child_d(x_variables, "variable", 0);
switch_xml_set_attr_d(x_variable, "name", hp->name);
switch_xml_set_attr_d(x_variable, "value", hp->value);
}
x_members = switch_xml_add_child_d(x_conference, "members", 0);
switch_assert(x_members);
@ -1339,7 +1348,8 @@ void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, i
void conference_jlist(conference_obj_t *conference, cJSON *json_conferences)
{
conference_member_t *member = NULL;
static cJSON *json_conference, *json_conference_members, *json_conference_member, *json_conference_member_flags;
static cJSON *json_conference, *json_conference_variables, *json_conference_members, *json_conference_member, *json_conference_member_flags;
switch_event_header_t *hp;
switch_assert(conference != NULL);
json_conference = cJSON_CreateObject();
@ -1379,6 +1389,11 @@ void conference_jlist(conference_obj_t *conference, cJSON *json_conferences)
cJSON_AddNumberToObject(json_conference, "max_members", conference->max_members);
}
cJSON_AddItemToObject(json_conference, "variables", json_conference_variables = cJSON_CreateObject());
for (hp = conference->variables->headers; hp; hp = hp->next) {
cJSON_AddStringToObject(json_conference_variables, hp->name, hp->value);
}
cJSON_AddItemToObject(json_conference, "members", json_conference_members = cJSON_CreateArray());
switch_mutex_lock(conference->member_mutex);
for (member = conference->members; member; member = member->next) {
@ -1498,7 +1513,10 @@ switch_status_t conference_outcall(conference_obj_t *conference,
char *cid_num,
char *profile,
switch_call_cause_t *cause,
switch_call_cause_t *cancel_cause, switch_event_t *var_event)
switch_call_cause_t *cancel_cause,
switch_event_t *var_event,
char** peer_uuid
)
{
switch_core_session_t *peer_session = NULL;
switch_channel_t *peer_channel;
@ -1608,6 +1626,10 @@ switch_status_t conference_outcall(conference_obj_t *conference,
if (switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {
switch_caller_extension_t *extension = NULL;
if(peer_uuid) {
*peer_uuid = switch_channel_get_uuid(peer_channel);
}
/* build an extension name object */
if ((extension = switch_caller_extension_new(peer_session, conference_name, conference_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Memory Error!\n");
@ -1654,6 +1676,7 @@ switch_status_t conference_outcall(conference_obj_t *conference,
void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread, void *obj)
{
struct bg_call *call = (struct bg_call *) obj;
char* peer_uuid = NULL;
if (call) {
switch_call_cause_t cause;
@ -1662,7 +1685,7 @@ void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread, void *o
conference_outcall(call->conference, call->conference_name,
call->session, call->bridgeto, call->timeout,
call->flags, call->cid_name, call->cid_num, call->profile, &cause, call->cancel_cause, call->var_event);
call->flags, call->cid_name, call->cid_num, call->profile, &cause, call->cancel_cause, call->var_event, &peer_uuid);
if (call->conference && test_eflag(call->conference, EFLAG_BGDIAL_RESULT) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
@ -1670,6 +1693,7 @@ void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread, void *o
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "bgdial-result");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Result", switch_channel_cause2str(cause));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-UUID", call->uuid);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Peer-UUID", peer_uuid);
switch_event_fire(&event);
}
@ -1715,6 +1739,8 @@ switch_status_t conference_outcall_bg(conference_obj_t *conference,
if (var_event) {
call->var_event = *var_event;
var_event = NULL;
} else {
switch_event_create_plain(&call->var_event, SWITCH_EVENT_GENERAL);
}
if (conference) {
@ -1743,6 +1769,9 @@ switch_status_t conference_outcall_bg(conference_obj_t *conference,
if (call_uuid) {
call->uuid = strdup(call_uuid);
if (call->var_event) {
switch_event_add_header_string(call->var_event, SWITCH_STACK_BOTTOM, "conference_bgdial_jobid", call->uuid);
}
}
if (profile) {
@ -1986,6 +2015,7 @@ SWITCH_STANDARD_APP(conference_function)
switch_assert(params);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "conference_name", conference_name);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile_name", profile_name);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Fetch-Call-UUID", switch_core_session_get_uuid(session));
/* Open the config from the xml registry */
if (!(cxml = switch_xml_open_cfg(mod_conference_cf_name, &cfg, params))) {
@ -2340,7 +2370,7 @@ SWITCH_STANDARD_APP(conference_function)
/* if we're using "bridge:" make an outbound call and bridge it in */
if (!zstr(bridgeto) && strcasecmp(bridgeto, "none")) {
switch_call_cause_t cause;
if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, NULL, &cause, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, NULL, &cause, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
goto done;
}
} else {
@ -3748,10 +3778,22 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
}
}
if (cfg.profile) {
switch_xml_t xml_profile_variables;
if ((xml_profile_variables = switch_xml_child(cfg.profile, "variables")) != NULL) {
for (xml_kvp = switch_xml_child(xml_profile_variables, "variable"); xml_kvp; xml_kvp = xml_kvp->next) {
char *var = (char *) switch_xml_attr_soft(xml_kvp, "name");
char *val = (char *) switch_xml_attr_soft(xml_kvp, "value");
if (var && val) {
conference_set_variable(conference, var, val);
}
}
}
}
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
conference_event_add_data(conference, event);
if(conference->verbose_events && channel) {
if (conference->verbose_events && channel) {
switch_channel_event_set_data(channel, event);
}
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "conference-create");

@ -1135,7 +1135,9 @@ switch_status_t conference_outcall(conference_obj_t *conference,
char *cid_num,
char *profile,
switch_call_cause_t *cause,
switch_call_cause_t *cancel_cause, switch_event_t *var_event);
switch_call_cause_t *cancel_cause,
switch_event_t *var_event,
char** peer_uuid);
switch_status_t conference_outcall_bg(conference_obj_t *conference,
char *conference_name,
switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name,

@ -587,6 +587,23 @@ SWITCH_STANDARD_APP(sched_heartbeat_function)
}
#define FILTER_CODECS_SYNTAX "<codec string>"
SWITCH_STANDARD_APP(filter_codecs_function)
{
const char *r_sdp;
switch_channel_t *channel = switch_core_session_get_channel(session);
r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
if (data && r_sdp) {
switch_core_media_merge_sdp_codec_string(session, r_sdp, SDP_TYPE_REQUEST, data);
switch_channel_set_variable(channel, "filter_codec_string", data);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Incomplete data\n");
}
}
#define HEARTBEAT_SYNTAX "[0|<seconds>]"
SWITCH_STANDARD_APP(heartbeat_function)
@ -2913,6 +2930,50 @@ SWITCH_STANDARD_APP(phrase_function)
}
SWITCH_STANDARD_APP(broadcast_function)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
char * uuid = switch_channel_get_uuid(channel);
switch_media_flag_t flags = SMF_ECHO_ALEG | SMF_ECHO_BLEG;
char *mycmd = NULL, *argv[4] = { 0 };
int argc = 0;
if (zstr(data)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid args for broadcast app\n");
return;
}
mycmd = switch_core_session_strdup(session, data);
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
if (argc > 2) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid args for broadcast app [%s]\n", data);
return;
} else {
if (argv[1]) {
if (switch_stristr("both", (argv[1]))) {
flags |= (SMF_ECHO_ALEG | SMF_ECHO_BLEG);
}
if (switch_stristr("aleg", argv[1])) {
flags |= SMF_ECHO_ALEG;
}
if (switch_stristr("bleg", argv[1])) {
flags &= ~SMF_HOLD_BLEG;
flags |= SMF_ECHO_BLEG;
}
if (switch_stristr("holdb", argv[1])) {
flags &= ~SMF_ECHO_BLEG;
flags |= SMF_HOLD_BLEG;
}
}
switch_ivr_broadcast(uuid, argv[0], flags);
switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "BROADCAST_SENT");
}
}
SWITCH_STANDARD_APP(playback_function)
{
switch_input_args_t args = { 0 };
@ -3190,40 +3251,43 @@ SWITCH_STANDARD_APP(record_session_unmask_function)
SWITCH_STANDARD_APP(record_session_function)
{
char *array[5] = {0};
char *args = NULL;
int argc;
char *path = NULL;
char *path_end;
uint32_t limit = 0;
switch_event_t *vars = NULL;
char *new_fp = NULL;
if (zstr(data)) {
return;
}
path = switch_core_session_strdup(session, data);
args = switch_core_session_strdup(session, data);
argc = switch_split(args, ' ', array);
/* Search for a space then a plus followed by only numbers at the end of the path,
if found trim any spaces to the left/right of the plus use the left side as the
path and right side as a time limit on the recording
*/
if (argc == 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "usage: <path> [+<timeout>] [{var1=x,var2=y}]\n");
}
/* if we find a + and the character before it is a space */
if ((path_end = strrchr(path, '+')) && path_end > path && *(path_end - 1) == ' ') {
char *limit_start = path_end + 1;
path = array[0];
/* not at the end and the rest is numbers lets parse out the limit and fix up the path */
if (*limit_start != '\0' && switch_is_number(limit_start) == SWITCH_TRUE) {
limit = atoi(limit_start);
/* back it off by one character to the char before the + */
path_end--;
/* trim spaces to the left of the plus */
while (path_end > path && *path_end == ' ') {
path_end--;
if (argc > 1) {
if (*array[1] == '+') {
limit = atoi(++array[1]);
if (argc > 2) {
switch_url_decode(array[2]);
switch_event_create_brackets(array[2], '{', '}',',', &vars, &new_fp, SWITCH_FALSE);
}
*(path_end + 1) = '\0';
} else {
switch_url_decode(array[1]);
switch_event_create_brackets(array[1], '{', '}',',', &vars, &new_fp, SWITCH_FALSE);
}
}
switch_ivr_record_session(session, path, limit, NULL);
switch_ivr_record_session_event(session, path, limit, NULL, vars);
switch_event_safe_destroy(vars);
}
SWITCH_STANDARD_APP(stop_record_session_function)
@ -5646,7 +5710,7 @@ void *SWITCH_THREAD_FUNC page_thread(switch_thread_t *thread, void *obj)
switch_mutex_unlock(pd->mutex);
}
switch_event_safe_destroy(&pd->var_event);
switch_event_safe_destroy(pd->var_event);
if (pool) {
switch_core_destroy_memory_pool(&pool);
@ -6460,6 +6524,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "enable_heartbeat", "Enable Media Heartbeat", "Enable Media Heartbeat",
heartbeat_function, HEARTBEAT_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "filter_codecs", "Filter Codecs", "Filter Codecs", filter_codecs_function, FILTER_CODECS_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "enable_keepalive", "Enable Keepalive", "Enable Keepalive",
keepalive_function, KEEPALIVE_SYNTAX, SAF_SUPPORT_NOMEDIA);
@ -6495,6 +6561,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "park_state", "Park State", "Park State", park_state_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "gentones", "Generate Tones", "Generate tones to the channel", gentones_function, "<tgml_script>[|<loops>]", SAF_NONE);
SWITCH_ADD_APP(app_interface, "playback", "Playback File", "Playback a file to the channel", playback_function, "<path>", SAF_NONE);
SWITCH_ADD_APP(app_interface, "broadcast", "Broadcast File", "Broadcast a file to the session", broadcast_function, "<path> <leg>", SAF_NONE);
SWITCH_ADD_APP(app_interface, "endless_playback", "Playback File Endlessly", "Endlessly Playback a file to the channel",
endless_playback_function, "<path>", SAF_NONE);
SWITCH_ADD_APP(app_interface, "loop_playback", "Playback File looply", "Playback a file to the channel looply for limted times",

@ -833,12 +833,14 @@ SWITCH_STANDARD_API(enum_function)
if (!strcasecmp(dest, "reload")) {
do_load();
stream->write_function(stream, "+OK ENUM Reloaded.\n");
switch_safe_free(mydata);
return SWITCH_STATUS_SUCCESS;
}
if (enum_lookup(root, dest, &results, NULL, session) != SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "No Match!\n");
switch_safe_free(mydata);
return SWITCH_STATUS_SUCCESS;
}

@ -416,10 +416,10 @@ static switch_status_t http_put(url_cache_t *cache, http_profile_t *profile, swi
if (!zstr(cache->ssl_cacert)) {
switch_curl_easy_setopt(curl_handle, CURLOPT_CAINFO, cache->ssl_cacert);
}
/* verify that the host name matches the cert */
if (!cache->ssl_verifyhost) {
switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0L);
}
}
/* verify that the host name matches the cert */
if (!cache->ssl_verifyhost) {
switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0L);
}
switch_curl_easy_perform(curl_handle);
switch_curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, httpRes);
@ -1098,6 +1098,7 @@ static switch_status_t http_get(url_cache_t *cache, http_profile_t *profile, cac
http_get_data_t get_data = {0};
long httpRes = 0;
int start_time_ms = switch_time_now() / 1000;
switch_CURLcode curl_status = CURLE_UNKNOWN_OPTION;
/* set up HTTP GET */
get_data.fd = 0;
@ -1117,6 +1118,7 @@ static switch_status_t http_get(url_cache_t *cache, http_profile_t *profile, cac
if ((get_data.fd = open(get_data.url->filename, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR)) > -1) {
switch_curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1);
switch_curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 10);
switch_curl_easy_setopt(curl_handle, CURLOPT_FAILONERROR, 1);
switch_curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1);
if (headers) {
switch_curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers);
@ -1140,12 +1142,14 @@ static switch_status_t http_get(url_cache_t *cache, http_profile_t *profile, cac
if (!zstr(cache->ssl_cacert)) {
switch_curl_easy_setopt(curl_handle, CURLOPT_CAINFO, cache->ssl_cacert);
}
/* verify that the host name matches the cert */
if (!cache->ssl_verifyhost) {
switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0L);
}
}
switch_curl_easy_perform(curl_handle);
/* verify that the host name matches the cert */
if (!cache->ssl_verifyhost) {
switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0L);
}
curl_status = switch_curl_easy_perform(curl_handle);
switch_curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &httpRes);
switch_curl_easy_cleanup(curl_handle);
close(get_data.fd);
@ -1155,7 +1159,7 @@ static switch_status_t http_get(url_cache_t *cache, http_profile_t *profile, cac
goto done;
}
if (httpRes == 200) {
if (curl_status == CURLE_OK) {
int duration_ms = (switch_time_now() / 1000) - start_time_ms;
if (duration_ms > 500) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "URL %s downloaded in %d ms\n", url->url, duration_ms);
@ -1167,7 +1171,7 @@ static switch_status_t http_get(url_cache_t *cache, http_profile_t *profile, cac
}
} else {
url->size = 0; // nothing downloaded or download interrupted
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Received HTTP error %ld trying to fetch %s\n", httpRes, url->url);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Received curl error %d HTTP error code %ld trying to fetch %s\n", curl_status, httpRes, url->url);
status = SWITCH_STATUS_GENERR;
goto done;
}
@ -1729,6 +1733,7 @@ static switch_status_t http_cache_file_open(switch_file_handle_t *handle, const
}
}
context->fh.pre_buffer_datalen = handle->pre_buffer_datalen;
if ((status = switch_core_file_open(&context->fh,
context->local_path,
handle->channels,
@ -1750,6 +1755,7 @@ static switch_status_t http_cache_file_open(switch_file_handle_t *handle, const
handle->interval = context->fh.interval;
handle->channels = context->fh.channels;
handle->flags |= SWITCH_FILE_NOMUX;
handle->pre_buffer_datalen = 0;
if (switch_test_flag((&context->fh), SWITCH_FILE_NATIVE)) {
switch_set_flag_locked(handle, SWITCH_FILE_NATIVE);
@ -1858,6 +1864,17 @@ static switch_status_t http_file_close(switch_file_handle_t *handle)
return status;
}
static switch_status_t http_cache_file_seek(switch_file_handle_t *handle, unsigned int *cur_sample, int64_t samples, int whence)
{
struct http_context *context = (struct http_context *)handle->private_info;
if (!handle->seekable) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "File is not seekable\n");
return SWITCH_STATUS_NOTIMPL;
}
return switch_core_file_seek(&context->fh, cur_sample, samples, whence);
}
static char *http_supported_formats[] = { "http", NULL };
static char *https_supported_formats[] = { "https", NULL };
static char *http_cache_supported_formats[] = { "http_cache", NULL };
@ -1901,6 +1918,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load)
file_interface->file_write = http_file_write;
file_interface->file_read_video = http_file_read_video;
file_interface->file_write_video = http_file_write_video;
file_interface->file_seek = http_cache_file_seek;
if (gcache.enable_file_formats) {
file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE);
@ -1912,6 +1930,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load)
file_interface->file_write = http_file_write;
file_interface->file_read_video = http_file_read_video;
file_interface->file_write_video = http_file_write_video;
file_interface->file_seek = http_cache_file_seek;
file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE);
file_interface->interface_name = modname;
@ -1922,6 +1941,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load)
file_interface->file_write = http_file_write;
file_interface->file_read_video = http_file_read_video;
file_interface->file_write_video = http_file_write_video;
file_interface->file_seek = http_cache_file_seek;
}
/* create the queue from configuration */

@ -110,7 +110,7 @@ typedef enum {
* TONE DETECTION WITH CADENCE
*/
#define MAX_TONES 32
#define MAX_TONES 128
#define STRLEN 128
/**
* Tone descriptor

@ -59,6 +59,25 @@ typedef enum {
T38_MODE_REFUSED = -1,
} t38_mode_t;
const char * get_t38_status(t38_mode_t mode)
{
const char *str = "off";
switch(mode) {
case T38_MODE_NEGOTIATED:
str = "negotiated";
break;
case T38_MODE_REQUESTED:
str = "requested";
break;
case T38_MODE_REFUSED:
str = "refused";
break;
default:
break;
}
return str;
}
struct pvt_s {
switch_core_session_t *session;
@ -316,6 +335,7 @@ static int phase_b_handler(void *user_data, int result)
}
switch_channel_set_variable(channel, "fax_ecm_used", (t30_stats.error_correcting_mode) ? "on" : "off");
switch_channel_set_variable(channel, "fax_t38_status", get_t38_status(pvt->t38_mode));
switch_channel_set_variable(channel, "fax_local_station_id", local_ident);
switch_channel_set_variable(channel, "fax_remote_station_id", far_ident);
switch_channel_set_variable(channel, "fax_remote_country", switch_str_nil(t30_get_rx_country(pvt->t30)));
@ -328,9 +348,10 @@ static int phase_b_handler(void *user_data, int result)
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Local station id: %s\n", local_ident);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Transfer Rate: %i\n", t30_stats.bit_rate);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "ECM status %s\n", (t30_stats.error_correcting_mode) ? "on" : "off");
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote country: %s\n", switch_str_nil(t30_get_rx_country(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote vendor: %s\n", switch_str_nil(t30_get_rx_vendor(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote model: %s\n", switch_str_nil(t30_get_rx_model(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38 status %s\n", get_t38_status(pvt->t38_mode));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote country: %s\n", switch_str_nil(t30_get_rx_country(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote vendor: %s\n", switch_str_nil(t30_get_rx_vendor(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote model: %s\n", switch_str_nil(t30_get_rx_model(pvt->t30)));
if (pvt->app_mode == FUNCTION_TX) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Total fax pages: %s\n", fax_document_total_pages);
}
@ -347,6 +368,7 @@ static int phase_b_handler(void *user_data, int result)
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "uuid", switch_core_session_get_uuid(session));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-transfer-rate", fax_transfer_rate);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-ecm-used", (t30_stats.error_correcting_mode) ? "on" : "off");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-t38-status", get_t38_status(pvt->t38_mode));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-local-station-id", local_ident);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-remote-station-id", far_ident);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-remote-country", switch_str_nil(t30_get_rx_country(pvt->t30)));
@ -546,9 +568,10 @@ static void phase_e_handler(void *user_data, int result)
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "ECM status %s\n", (t.error_correcting_mode) ? "on" : "off");
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote country: %s\n", switch_str_nil(t30_get_rx_country(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote vendor: %s\n", switch_str_nil(t30_get_rx_vendor(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote model: %s\n", switch_str_nil(t30_get_rx_model(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38 status %s\n", get_t38_status(pvt->t38_mode));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote country: %s\n", switch_str_nil(t30_get_rx_country(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote vendor: %s\n", switch_str_nil(t30_get_rx_vendor(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote model: %s\n", switch_str_nil(t30_get_rx_model(pvt->t30)));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "==============================================================================\n");
@ -564,6 +587,7 @@ static void phase_e_handler(void *user_data, int result)
switch_channel_set_variable(channel, "fax_result_text", t30_completion_code_to_str(result));
switch_channel_set_variable(channel, "fax_ecm_used", (t.error_correcting_mode) ? "on" : "off");
switch_channel_set_variable(channel, "fax_t38_status", get_t38_status(pvt->t38_mode));
switch_channel_set_variable(channel, "fax_local_station_id", local_ident);
switch_channel_set_variable(channel, "fax_remote_station_id", far_ident);
@ -616,6 +640,7 @@ static void phase_e_handler(void *user_data, int result)
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-bad-rows", fax_bad_rows);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-transfer-rate", fax_transfer_rate);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-ecm-used", (t.error_correcting_mode) ? "on" : "off");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-t38-status", get_t38_status(pvt->t38_mode));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-local-station-id", local_ident);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-remote-station-id", far_ident);
switch_event_fire(&event);

@ -1,13 +1,13 @@
include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_com_g729
VERSION=201506221434
VERSION=latest
if ISLINUX
G729INSTALLER = $(top_srcdir)/libs/fs-$(VERSION)-installer
LICSERVER=/usr/sbin/freeswitch_licence_server
VALIDATOR=$(bindir)/validator
LICSERVER=/usr/sbin/freeswitch-license-server
VALIDATOR=$(bindir)/freeswitch-license-validator
MOD=$(moddir)/mod_com_g729.so
BUILT_SOURCES = $(G729INSTALLER)

@ -94,7 +94,14 @@ typedef struct loopback_private_object loopback_private_t;
static struct {
int debug;
} globals;
int early_set_loopback_id;
int fire_bowout_event_bridge;
int ignore_channel_ready;
switch_call_cause_t bowout_hangup_cause;
int bowout_controlled_hangup;
int bowout_transfer_recordings;
int bowout_disable_on_inner_bridge;
} loopback_globals;
static switch_status_t channel_on_init(switch_core_session_t *session);
static switch_status_t channel_on_hangup(switch_core_session_t *session);
@ -263,6 +270,10 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_snprintf(name, sizeof(name), "loopback/%s-b", tech_pvt->caller_profile->destination_number);
switch_channel_set_name(b_channel, name);
if (loopback_globals.early_set_loopback_id) {
switch_channel_set_variable(channel, "loopback_leg", "B");
switch_channel_set_variable(channel, "is_loopback", "1");
}
if (tech_init(b_tech_pvt, b_session, switch_core_session_get_read_codec(session)) != SWITCH_STATUS_SUCCESS) {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_core_session_destroy(&b_session);
@ -320,7 +331,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
if (!zstr(argv[i])) {
const char *val = switch_channel_get_variable(channel, argv[i]);
if(!zstr(val)) {
if (!zstr(val)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Transfer variable [%s]=[%s] %s -> %s\n",
argv[i], val, switch_channel_get_name(channel), switch_channel_get_name(tech_pvt->other_channel));
@ -338,6 +349,8 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_channel_set_variable(channel, "other_loopback_leg_uuid", switch_channel_get_uuid(b_channel));
switch_channel_set_variable(b_channel, "other_loopback_leg_uuid", switch_channel_get_uuid(channel));
switch_channel_set_variable(b_channel, "other_loopback_from_uuid", switch_channel_get_variable(channel, "loopback_from_uuid"));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(b_session), SWITCH_LOG_DEBUG, "setting other_loopback_from_uuid on b leg to %s\n", switch_channel_get_variable(channel, "loopback_from_uuid"));
if (switch_core_session_thread_launch(b_session) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Error spawning thread\n");
@ -474,6 +487,7 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, "loopback::bowout") == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Resigning-UUID", switch_channel_get_uuid(channel));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Resigning-Peer-UUID", switch_channel_get_uuid(tech_pvt->other_channel));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Acquired-UUID", switch_channel_get_uuid(other_channel));
switch_event_fire(&event);
}
@ -485,12 +499,14 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
switch_channel_set_caller_profile(other_channel, clone);
}
switch_channel_set_variable(channel, "loopback_hangup_cause", "bowout");
switch_channel_set_variable(tech_pvt->channel, "loopback_bowout_other_uuid", switch_channel_get_uuid(other_channel));
switch_channel_caller_extension_masquerade(channel, other_channel, 0);
switch_channel_set_state(other_channel, CS_RESET);
switch_channel_wait_for_state(other_channel, NULL, CS_RESET);
switch_channel_set_state(other_channel, CS_EXECUTE);
switch_core_session_rwunlock(other_session);
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_UNSPECIFIED);
switch_channel_hangup(channel, loopback_globals.bowout_hangup_cause);
}
}
@ -588,6 +604,7 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
case SWITCH_SIG_BREAK:
break;
case SWITCH_SIG_KILL:
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL KILL\n", switch_channel_get_name(channel));
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
switch_clear_flag_locked(tech_pvt, TFLAG_LINKED);
switch_mutex_lock(tech_pvt->mutex);
@ -600,8 +617,6 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
break;
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL KILL\n", switch_channel_get_name(channel));
return SWITCH_STATUS_SUCCESS;
}
@ -700,7 +715,12 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
*frame = NULL;
if (!switch_channel_ready(channel)) {
goto end;
if (loopback_globals.ignore_channel_ready) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "CHANNEL NOT READY - IGNORED\n");
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "CHANNEL NOT READY\n");
goto end;
}
}
switch_core_timer_next(&tech_pvt->timer);
@ -840,6 +860,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
tech_pvt->other_tech_pvt &&
switch_test_flag(tech_pvt, TFLAG_BRIDGE) &&
!switch_test_flag(tech_pvt, TFLAG_BLEG) &&
(!loopback_globals.bowout_disable_on_inner_bridge || !switch_channel_test_flag(tech_pvt->channel, CF_INNER_BRIDGE)) &&
switch_test_flag(tech_pvt->other_tech_pvt, TFLAG_BRIDGE) &&
switch_channel_test_flag(tech_pvt->channel, CF_BRIDGED) &&
switch_channel_test_flag(tech_pvt->other_channel, CF_BRIDGED) &&
@ -889,8 +910,47 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
"%s detected bridge on both ends, attempting direct connection.\n", switch_channel_get_name(channel));
if (loopback_globals.bowout_transfer_recordings) {
switch_ivr_transfer_recordings(session, br_a);
switch_ivr_transfer_recordings(tech_pvt->other_session, br_b);
}
if (loopback_globals.fire_bowout_event_bridge) {
switch_event_t *event = NULL;
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, "loopback::direct") == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(tech_pvt->channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Resigning-UUID", switch_channel_get_uuid(tech_pvt->channel));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Resigning-Peer-UUID", switch_channel_get_uuid(tech_pvt->other_channel));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Connecting-Leg-A-UUID", switch_channel_get_uuid(ch_a));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Connecting-Leg-B-UUID", switch_channel_get_uuid(ch_b));
switch_event_fire(&event);
}
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, "loopback::direct") == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(tech_pvt->other_channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Resigning-UUID", switch_channel_get_uuid(tech_pvt->other_channel));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Resigning-Peer-UUID", switch_channel_get_uuid(tech_pvt->channel));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Connecting-Leg-A-UUID", switch_channel_get_uuid(ch_b));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Connecting-Leg-B-UUID", switch_channel_get_uuid(ch_a));
switch_event_fire(&event);
}
}
/* channel_masquerade eat your heart out....... */
switch_ivr_uuid_bridge(a_uuid, b_uuid);
switch_channel_set_variable(tech_pvt->channel, "loopback_hangup_cause", "bridge");
switch_channel_set_variable(tech_pvt->channel, "loopback_bowout_other_uuid", switch_channel_get_uuid(ch_a));
switch_channel_set_variable(tech_pvt->other_channel, "loopback_hangup_cause", "bridge");
switch_channel_set_variable(tech_pvt->other_channel, "loopback_bowout_other_uuid", switch_channel_get_uuid(ch_b));
if (loopback_globals.bowout_controlled_hangup) {
switch_channel_set_flag(tech_pvt->channel, CF_INTERCEPTED);
switch_channel_set_flag(tech_pvt->other_channel, CF_INTERCEPTED);
switch_channel_hangup(tech_pvt->channel, loopback_globals.bowout_hangup_cause);
switch_channel_hangup(tech_pvt->other_channel, loopback_globals.bowout_hangup_cause);
}
good_to_go = 1;
switch_mutex_unlock(tech_pvt->mutex);
}
@ -971,6 +1031,18 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
case SWITCH_MESSAGE_INDICATE_BRIDGE:
{
switch_set_flag_locked(tech_pvt, TFLAG_BRIDGE);
if (switch_test_flag(tech_pvt, TFLAG_BLEG)) {
if (msg->string_arg) {
switch_core_session_t *bridged_session;
switch_channel_t *bridged_channel;
if ((bridged_session = switch_core_session_force_locate(msg->string_arg)) != NULL) {
bridged_channel = switch_core_session_get_channel(bridged_session);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(bridged_session), SWITCH_LOG_DEBUG, "setting other_leg_true_id to %s\n", switch_channel_get_variable(channel, "other_loopback_from_uuid"));
switch_channel_set_variable(bridged_channel, "other_leg_true_id", switch_channel_get_variable(channel, "other_loopback_from_uuid"));
switch_core_session_rwunlock(bridged_session);
}
}
}
}
break;
case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
@ -1092,6 +1164,10 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
channel = switch_core_session_get_channel(*new_session);
switch_snprintf(name, sizeof(name), "loopback/%s-a", outbound_profile->destination_number);
switch_channel_set_name(channel, name);
if (loopback_globals.early_set_loopback_id) {
switch_channel_set_variable(channel, "loopback_leg", "A");
switch_channel_set_variable(channel, "is_loopback", "1");
}
if (tech_init(tech_pvt, *new_session, session ? switch_core_session_get_read_codec(session) : NULL) != SWITCH_STATUS_SUCCESS) {
switch_core_session_destroy(new_session);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
@ -1106,6 +1182,11 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
switch_channel_set_private(channel, "__loopback_vars__", clone);
}
if (ochannel) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(*new_session), SWITCH_LOG_DEBUG, "setting loopback_from_uuid to %s\n", switch_channel_get_uuid(ochannel));
switch_channel_set_variable(channel, "loopback_from_uuid", switch_channel_get_uuid(ochannel));
}
if (outbound_profile) {
char *dialplan = NULL, *context = NULL;
@ -1566,6 +1647,62 @@ static switch_io_routines_t null_channel_io_routines = {
/*.receive_message */ null_channel_receive_message
};
switch_status_t load_loopback_configuration(switch_bool_t reload)
{
switch_xml_t xml = NULL, x_lists = NULL, x_list = NULL, cfg = NULL;
switch_status_t status = SWITCH_STATUS_FALSE;
memset(&loopback_globals, 0, sizeof(loopback_globals));
loopback_globals.bowout_hangup_cause = SWITCH_CAUSE_NORMAL_UNSPECIFIED;
if ((xml = switch_xml_open_cfg("loopback.conf", &cfg, NULL))) {
status = SWITCH_STATUS_SUCCESS;
if ((x_lists = switch_xml_child(cfg, "settings"))) {
for (x_list = switch_xml_child(x_lists, "param"); x_list; x_list = x_list->next) {
const char *name = switch_xml_attr(x_list, "name");
const char *value = switch_xml_attr(x_list, "value");
if (zstr(name)) {
continue;
}
if (zstr(value)) {
continue;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s = %s\n", name, value);
if (!strcmp(name, "early-set-loopback-id")) {
loopback_globals.early_set_loopback_id = switch_true(value);
} else if (!strcmp(name, "fire-bowout-on-bridge")) {
loopback_globals.fire_bowout_event_bridge = switch_true(value);
} else if (!strcmp(name, "ignore-channel-ready")) {
loopback_globals.ignore_channel_ready = switch_true(value);
} else if (!strcmp(name, "bowout-hangup-cause")) {
loopback_globals.bowout_hangup_cause = switch_channel_str2cause(value);
} else if (!strcmp(name, "bowout-controlled-hangup")) {
loopback_globals.bowout_controlled_hangup = switch_true(value);
} else if (!strcmp(name, "bowout-transfer-recording")) {
loopback_globals.bowout_transfer_recordings = switch_true(value);
} else if (!strcmp(name, "bowout-disable-on-inner-bridge")) {
loopback_globals.bowout_disable_on_inner_bridge = switch_true(value);
}
}
}
switch_xml_free(xml);
}
return status;
}
static void loopback_reload_xml_event_handler(switch_event_t *event)
{
load_loopback_configuration(1);
}
SWITCH_MODULE_LOAD_FUNCTION(mod_loopback_load)
{
@ -1576,8 +1713,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_loopback_load)
return SWITCH_STATUS_TERM;
}
if (switch_event_reserve_subclass("loopback::direct") != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", "loopback::direct");
return SWITCH_STATUS_TERM;
}
memset(&globals, 0, sizeof(globals));
load_loopback_configuration(0);
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
@ -1593,6 +1734,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_loopback_load)
SWITCH_ADD_APP(app_interface, "unloop", "Tell loopback to unfold", "Tell loopback to unfold", unloop_function, "", SAF_NO_LOOPBACK);
if ((switch_event_bind(modname, SWITCH_EVENT_RELOADXML, NULL, loopback_reload_xml_event_handler, NULL) != SWITCH_STATUS_SUCCESS)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind our reloadxml handler!\n");
/* Not such severe to prevent loading */
}
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}
@ -1601,6 +1747,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_loopback_shutdown)
{
switch_event_free_subclass("loopback::bowout");
switch_event_free_subclass("loopback::direct");
switch_event_unbind_callback(loopback_reload_xml_event_handler);
return SWITCH_STATUS_SUCCESS;
}

@ -9,7 +9,7 @@ SOFIAUA_BUILDDIR=$(SOFIA_BUILDDIR)/libsofia-sip-ua
SOFIALA=$(SOFIAUA_BUILDDIR)/libsofia-sip-ua.la
mod_LTLIBRARIES = mod_sofia.la
mod_sofia_la_SOURCES = mod_sofia.c sofia.c sofia_glue.c sofia_presence.c sofia_reg.c sofia_media.c sip-dig.c rtp.c mod_sofia.h
mod_sofia_la_SOURCES = mod_sofia.c sofia.c sofia_json_api.c sofia_glue.c sofia_presence.c sofia_reg.c sofia_media.c sip-dig.c rtp.c mod_sofia.h
mod_sofia_la_CFLAGS = $(AM_CFLAGS) -I. $(SOFIA_CMD_LINE_CFLAGS)
mod_sofia_la_CFLAGS += -I$(SOFIAUA_DIR)/bnf -I$(SOFIAUA_BUILDDIR)/bnf
mod_sofia_la_CFLAGS += -I$(SOFIAUA_DIR)/http -I$(SOFIAUA_BUILDDIR)/http

@ -167,6 +167,7 @@
<ClCompile Include="sip-dig.c" />
<ClCompile Include="sofia.c" />
<ClCompile Include="sofia_glue.c" />
<ClCompile Include="sofia_json_api.c" />
<ClCompile Include="sofia_media.c" />
<ClCompile Include="sofia_presence.c" />
<ClCompile Include="sofia_reg.c" />

@ -340,6 +340,17 @@ static int hangup_cause_to_sip(switch_call_cause_t cause)
return 487;
case SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR:
return 483;
/* Custom mappings not part of RFC */
case SWITCH_CAUSE_BUSY_EVERYWHERE:
return 600;
case SWITCH_CAUSE_DECLINE:
return 603;
case SWITCH_CAUSE_DOES_NOT_EXIST_ANYWHERE:
return 604;
case SWITCH_CAUSE_NOT_ACCEPTABLE:
return 606;
case SWITCH_CAUSE_UNWANTED:
return 607;
default:
return 480;
}
@ -502,7 +513,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sending BYE to %s\n", switch_channel_get_name(channel));
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
nua_bye(tech_pvt->nh,
TAG_IF(tech_pvt->record_route, NUTAG_PROXY(tech_pvt->record_route)),
TAG_IF(!zstr(tech_pvt->route_uri), NUTAG_PROXY(tech_pvt->route_uri)),
SIPTAG_CONTACT(SIP_NONE),
TAG_IF(!zstr(reason), SIPTAG_REASON_STR(reason)),
TAG_IF(call_info, SIPTAG_CALL_INFO_STR(call_info)),
@ -2172,7 +2183,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
break;
case SWITCH_MESSAGE_INDICATE_RESPOND:
{
printf("WHAT THE FUCKING HELL? %d\n", switch_channel_test_flag(tech_pvt->channel, CF_AWAITING_STREAM_CHANGE));
if (switch_channel_test_flag(tech_pvt->channel, CF_AWAITING_STREAM_CHANGE)) {
switch_channel_clear_flag(tech_pvt->channel, CF_AWAITING_STREAM_CHANGE);
@ -2627,7 +2638,7 @@ static switch_status_t sofia_receive_event(switch_core_session_t *session, switc
typedef switch_status_t (*sofia_command_t) (char **argv, int argc, switch_stream_handle_t *stream);
static const char *sofia_state_names[] = {
const char *sofia_state_names[] = {
"UNREGED",
"TRYING",
"REGISTER",
@ -2755,7 +2766,7 @@ static int sql2str_callback(void *pArg, int argc, char **argv, char **columnName
return 0;
}
static uint32_t sofia_profile_reg_count(sofia_profile_t *profile)
uint32_t sofia_profile_reg_count(sofia_profile_t *profile)
{
struct cb_helper_sql2str cb;
char reg_count[80] = "";
@ -4363,6 +4374,8 @@ SWITCH_STANDARD_API(sofia_function)
func = cmd_status;
} else if (!strcasecmp(argv[0], "xmlstatus")) {
func = cmd_xml_status;
} else if (!strcasecmp(argv[0], "jsonstatus")) {
func = cmd_json_status;
} else if (!strcasecmp(argv[0], "filter")) {
if (argc > 1) {
if (!strcasecmp(argv[1],"off")) {
@ -6265,6 +6278,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
management_interface->relative_oid = "1001";
management_interface->management_function = sofia_manage;
add_sofia_json_apis(module_interface);
SWITCH_ADD_APP(app_interface, "sofia_sla", "private sofia sla function",
"private sofia sla function", sofia_sla_function, "<uuid>", SAF_NONE);

@ -303,12 +303,16 @@ typedef enum {
PFLAG_MAKE_EVERY_TRANSFER_A_NIGHTMARE,
PFLAG_FIRE_TRANFER_EVENTS,
PFLAG_BLIND_AUTH_ENFORCE_RESULT,
PFLAG_BLIND_AUTH_REPLY_403,
PFLAG_PROXY_HOLD,
PFLAG_PROXY_INFO,
PFLAG_PROXY_MESSAGE,
PFLAG_FIRE_BYE_RESPONSE_EVENTS,
PFLAG_AUTO_INVITE_100,
PFLAG_UPDATE_REFRESHER,
PFLAG_AUTH_REQUIRE_USER,
PFLAG_AUTH_CALLS_ACL_ONLY,
PFLAG_USE_PORT_FOR_ACL_CHECK,
/* No new flags below this line */
PFLAG_MAX
@ -786,6 +790,8 @@ struct sofia_profile {
int bind_attempt_interval;
char *proxy_notify_events;
char *proxy_info_content_types;
char *acl_inbound_x_token_header;
char *acl_proxy_x_token_header;
};
@ -964,6 +970,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
switch_status_t sofia_proxy_sip_i_message(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip,
sofia_dispatch_event_t *de, tagi_t tags[]);
void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, sofia_dispatch_event_t *de, tagi_t tags[]);
void sofia_handle_sip_i_invite_replaces(switch_core_session_t *session, switch_channel_t *channel, switch_channel_t *b_channel, char* uuid, private_object_t *tech_pvt, sip_call_info_t *call_info, sofia_profile_t *profile, char *is_nat, sip_t const *sip);
void sofia_reg_handle_sip_i_register(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t **sofia_private, sip_t const *sip,
@ -1163,6 +1170,11 @@ void sofia_glue_restart_all_profiles(void);
const char *sofia_state_string(int state);
void sofia_wait_for_reply(struct private_object *tech_pvt, nua_event_t event, uint32_t timeout);
/* sofia api */
switch_status_t cmd_json_status(char **argv, int argc, switch_stream_handle_t *stream);
uint32_t sofia_profile_reg_count(sofia_profile_t *profile);
void add_sofia_json_apis(switch_loadable_module_interface_t **module_interface);
/*
* Logging control functions
*/

@ -4591,6 +4591,10 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
sofia_clear_pflag(profile, PFLAG_MAKE_EVERY_TRANSFER_A_NIGHTMARE);
sofia_clear_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS);
sofia_clear_pflag(profile, PFLAG_BLIND_AUTH_ENFORCE_RESULT);
sofia_clear_pflag(profile, PFLAG_BLIND_AUTH_REPLY_403);
sofia_clear_pflag(profile, PFLAG_AUTH_REQUIRE_USER);
sofia_clear_pflag(profile, PFLAG_AUTH_CALLS_ACL_ONLY);
sofia_clear_pflag(profile, PFLAG_USE_PORT_FOR_ACL_CHECK);
profile->shutdown_type = "false";
profile->local_network = "localnet.auto";
sofia_set_flag(profile, TFLAG_ENABLE_SOA);
@ -5486,6 +5490,12 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
profile->nonce_ttl = atoi(val);
} else if (!strcasecmp(var, "max-auth-validity") && !zstr(val)) {
profile->max_auth_validity = atoi(val);
} else if (!strcasecmp(var, "auth-require-user")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_AUTH_REQUIRE_USER);
} else {
sofia_clear_pflag(profile, PFLAG_AUTH_REQUIRE_USER);
}
} else if (!strcasecmp(var, "accept-blind-reg")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_BLIND_REG);
@ -5901,6 +5911,28 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
} else {
sofia_clear_pflag(profile, PFLAG_BLIND_AUTH_ENFORCE_RESULT);
}
} else if (!strcasecmp(var, "blind-auth-reply-403")) {
if(switch_true(val)) {
sofia_set_pflag(profile, PFLAG_BLIND_AUTH_REPLY_403);
} else {
sofia_clear_pflag(profile, PFLAG_BLIND_AUTH_REPLY_403);
}
} else if (!strcasecmp(var, "auth-calls-acl-only")) {
if(switch_true(val)) {
sofia_set_pflag(profile, PFLAG_AUTH_CALLS_ACL_ONLY);
} else {
sofia_clear_pflag(profile, PFLAG_AUTH_CALLS_ACL_ONLY);
}
} else if (!strcasecmp(var, "use-port-for-acl-check")) {
if(switch_true(val)) {
sofia_set_pflag(profile, PFLAG_USE_PORT_FOR_ACL_CHECK);
} else {
sofia_clear_pflag(profile, PFLAG_USE_PORT_FOR_ACL_CHECK);
}
} else if (!strcasecmp(var, "apply-inbound-acl-x-token")) {
profile->acl_inbound_x_token_header = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "apply-proxy-acl-x-token")) {
profile->acl_proxy_x_token_header = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "proxy-hold")) {
if(switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PROXY_HOLD);
@ -9992,6 +10024,46 @@ void sofia_handle_sip_i_reinvite(switch_core_session_t *session,
}
switch_status_t sofia_locate_user(char* user, switch_core_session_t *session, sip_t const *sip, switch_xml_t* x_user)
{
char *username, *domain;
switch_event_t *v_event = NULL;
switch_status_t result = SWITCH_STATUS_FALSE;
if (!session) {
return SWITCH_STATUS_FALSE;
}
if (zstr(user)) {
return SWITCH_STATUS_FALSE;
}
if (!(username = switch_core_session_strdup(session, user))) {
return SWITCH_STATUS_FALSE;
}
if (!(domain = strchr(username, '@'))) {
return SWITCH_STATUS_FALSE;
}
*domain++ = '\0';
if (switch_event_create(&v_event, SWITCH_EVENT_REQUEST_PARAMS) == SWITCH_STATUS_SUCCESS) {
sip_unknown_t *un;
for (un = sip->sip_unknown; un; un = un->un_next) {
switch_event_add_header_string(v_event, SWITCH_STACK_BOTTOM, un->un_name, un->un_value);
};
}
result = switch_xml_locate_user_merged("id", username, domain, NULL, x_user, v_event);
if (v_event) {
switch_event_destroy(&v_event);
}
return result;
}
void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, sofia_dispatch_event_t *de, tagi_t tags[])
{
char key[128] = "";
@ -10181,14 +10253,23 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
int ok = 1;
char *last_acl = NULL;
const char *token = NULL;
int acl_port = sofia_test_pflag(profile, PFLAG_USE_PORT_FOR_ACL_CHECK) ? network_port : 0;
for (x = 0; x < profile->acl_count; x++) {
last_acl = profile->acl[x];
if ((ok = switch_check_network_list_ip_token(network_ip, last_acl, &token))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "verifying acl \"%s\" for ip/port %s:%i.\n",
switch_str_nil(last_acl), network_ip, acl_port);
if ((ok = switch_check_network_list_ip_port_token(network_ip, acl_port, last_acl, &token))) {
if (profile->acl_pass_context[x]) {
acl_context = profile->acl_pass_context[x];
}
if(!token && profile->acl_inbound_x_token_header) {
const char * x_auth_token = sofia_glue_get_unknown_header(sip, profile->acl_inbound_x_token_header);
if (!zstr(x_auth_token)) {
token = x_auth_token;
}
}
break;
}
@ -10213,75 +10294,105 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
}
} else {
int network_ip_is_proxy = 0;
const char* x_auth_ip = network_ip;
/* Check if network_ip is a proxy allowed to send us calls */
if (profile->proxy_acl_count) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%d acls to check for proxy\n", profile->proxy_acl_count);
}
for (x = 0; x < profile->proxy_acl_count; x++) {
last_acl = profile->proxy_acl[x];
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "checking %s against acl %s\n", network_ip, last_acl);
if (switch_check_network_list_ip_token(network_ip, last_acl, &token)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s is a proxy according to the %s acl\n", network_ip, last_acl);
network_ip_is_proxy = 1;
break;
for (x = 0; x < profile->proxy_acl_count; x++) {
last_acl = profile->proxy_acl[x];
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "checking %s against acl %s\n", network_ip, last_acl);
if (switch_check_network_list_ip_port_token(network_ip, network_port, last_acl, &token)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s is a proxy according to the %s acl\n", network_ip, last_acl);
network_ip_is_proxy = 1;
break;
}
}
}
/*
* if network_ip is a proxy allowed to send calls, check for auth
* ip header and see if it matches against the inbound acl
*/
if (network_ip_is_proxy) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "network ip is a proxy\n");
const char * x_auth_port = sofia_glue_get_unknown_header(sip, "X-AUTH-PORT");
int x_auth_port_i = sofia_test_pflag(profile, PFLAG_USE_PORT_FOR_ACL_CHECK) ? zstr(x_auth_port) ? 0 : atoi(x_auth_port) : 0;
for (un = sip->sip_unknown; un; un = un->un_next) {
if (!strcasecmp(un->un_name, "X-AUTH-IP")) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "found auth ip [%s] header of [%s]\n", un->un_name, un->un_value);
if (!zstr(un->un_value)) {
for (x = 0; x < profile->acl_count; x++) {
last_acl = profile->acl[x];
if ((ok = switch_check_network_list_ip_token(un->un_value, last_acl, &token))) {
switch_copy_string(proxied_client_ip, un->un_value, sizeof(proxied_client_ip));
break;
}
/*
* if network_ip is a proxy allowed to send calls,
* authorize call if proxy provided matched token header
*/
if (profile->acl_proxy_x_token_header) {
const char * x_auth_token = sofia_glue_get_unknown_header(sip, profile->acl_proxy_x_token_header);
if (!zstr(x_auth_token)) {
token = x_auth_token;
switch_copy_string(proxied_client_ip, x_auth_ip, sizeof(proxied_client_ip));
ok = 1;
}
}
if (!ok && (x_auth_ip = sofia_glue_get_unknown_header(sip, "X-AUTH-IP")) && !zstr(x_auth_ip)) {
for (x = 0; x < profile->acl_count; x++) {
last_acl = profile->acl[x];
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "verifying acl \"%s\" from proxy for ip/port %s:%i.\n",
switch_str_nil(last_acl), x_auth_ip, x_auth_port_i);
if ((ok = switch_check_network_list_ip_port_token(x_auth_ip, x_auth_port_i, last_acl, &token))) {
switch_copy_string(proxied_client_ip, x_auth_ip, sizeof(proxied_client_ip));
if (profile->acl_pass_context[x]) {
acl_context = profile->acl_pass_context[x];
}
break;
}
if (profile->acl_fail_context[x]) {
acl_context = profile->acl_fail_context[x];
} else {
acl_context = NULL;
}
}
} else {
x_auth_ip = network_ip;
}
}
if (!ok) {
if (!sofia_test_pflag(profile, PFLAG_AUTH_CALLS)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by acl \"%s\"\n", network_ip, switch_str_nil(last_acl));
if (!acl_context) {
nua_respond(nh, SIP_403_FORBIDDEN, TAG_END());
goto fail;
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "IP %s Rejected by acl \"%s\". Falling back to Digest auth.\n",
network_ip, switch_str_nil(last_acl));
}
} else {
if (ok) {
if (token) {
switch_set_string(acl_token, token);
}
if (sofia_test_pflag(profile, PFLAG_AUTH_CALLS)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "IP %s Approved by acl \"%s[%s]\". Access Granted.\n",
proxied_client_ip, switch_str_nil(last_acl), acl_token);
x_auth_ip, switch_str_nil(last_acl), acl_token);
switch_set_string(sip_acl_authed_by, last_acl);
switch_set_string(sip_acl_token, acl_token);
is_auth = 1;
}
} else {
if (!sofia_test_pflag(profile, PFLAG_AUTH_CALLS)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by acl \"%s\"\n", x_auth_ip, switch_str_nil(last_acl));
if (!acl_context) {
nua_respond(nh, SIP_403_FORBIDDEN, TAG_END());
goto fail;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "IP %s Rejected by acl \"%s\". Falling back to Digest auth.\n",
x_auth_ip, switch_str_nil(last_acl));
}
}
}
}
}
if (!is_auth && sofia_test_pflag(profile, PFLAG_AUTH_CALLS) && sofia_test_pflag(profile, PFLAG_AUTH_CALLS_ACL_ONLY)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "IP/Port %s %i Rejected by acls and auth-calls-acl-only flag is set, rejecting call\n",
network_ip, network_port);
nua_respond(nh, SIP_403_FORBIDDEN, TAG_END());
goto fail;
}
if (!is_auth && sofia_test_pflag(profile, PFLAG_AUTH_CALLS) && sofia_test_pflag(profile, PFLAG_BLIND_AUTH)) {
char *user;
char *user = NULL;
switch_status_t blind_result = SWITCH_STATUS_FALSE;
if (!strcmp(network_ip, profile->sipip) && network_port == profile->sip_port) {
@ -10290,15 +10401,14 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
if (sip && sip->sip_from) {
user = switch_core_session_sprintf(session, "%s@%s", sip->sip_from->a_url->url_user, sip->sip_from->a_url->url_host);
switch_event_create(&v_event, SWITCH_EVENT_REQUEST_PARAMS);
for (un = sip->sip_unknown; un; un = un->un_next) {
switch_event_add_header_string(v_event, SWITCH_STACK_BOTTOM, un->un_name, un->un_value);
};
blind_result = switch_ivr_set_user_extended(session, user, v_event);
switch_event_destroy(&v_event);
blind_result = sofia_locate_user(user, session, sip, &x_user);
}
if(!sofia_test_pflag(profile, PFLAG_BLIND_AUTH_ENFORCE_RESULT) || blind_result == SWITCH_STATUS_SUCCESS) {
if (!sofia_test_pflag(profile, PFLAG_BLIND_AUTH_ENFORCE_RESULT) || blind_result == SWITCH_STATUS_SUCCESS) {
is_auth++;
} else if (sofia_test_pflag(profile, PFLAG_BLIND_AUTH_REPLY_403)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "blind auth enforce 403 enabled and couldn't find user %s, rejecting call\n", user);
nua_respond(nh, SIP_403_FORBIDDEN, TAG_END());
goto fail;
}
}
@ -10342,11 +10452,13 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
if (*acl_token) {
switch_channel_set_variable(channel, "acl_token", acl_token);
if (strchr(acl_token, '@')) {
if (switch_ivr_set_user(session, acl_token) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Authenticating user %s\n", acl_token);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Error Authenticating user %s\n", acl_token);
if (sofia_locate_user(acl_token, session, sip, &x_user) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Authenticating user %s\n", acl_token);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Error Authenticating user %s\n", acl_token);
if (sofia_test_pflag(profile, PFLAG_AUTH_REQUIRE_USER)) {
nua_respond(nh, SIP_480_TEMPORARILY_UNAVAILABLE, TAG_END());
goto fail;
}
}
}
@ -11016,186 +11128,44 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
}
}
if (sip && sip->sip_replaces) {
msg_common_t *rp_common = sip->sip_replaces->rp_common;
switch_channel_set_variable(channel, "sip_replaces_call_id", sip->sip_replaces->rp_call_id);
if (rp_common && rp_common->h_class->hc_params) {
int i, n;
msg_param_t const *params = * (msg_param_t const **) ((char *)rp_common + rp_common->h_class->hc_params);
for (i = 0; params[i]; i++) {
msg_param_t param = params[i];
if (strchr(param, '=')) {
n = strcspn(param, "=");
switch_channel_set_variable_name_printf(channel, param + n + 1, "sip_replaces_%.*s", n, param);
} else {
switch_channel_set_variable_name_printf(channel, "true", "sip_replaces_%s", param);
}
}
}
}
if (bnh) {
sofia_private_t *b_private = NULL;
if ((b_private = nua_handle_magic(bnh))) {
switch_core_session_t *b_session = NULL;
if ((b_session = switch_core_session_locate(b_private->uuid))) {
switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
const char *bridge_uuid;
switch_caller_profile_t *orig_cp, *cp;
//const char *sent_name, *sent_number;
orig_cp = switch_channel_get_caller_profile(b_channel);
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->callee_id_name);
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->callee_id_number);
if (!call_info) {
tech_pvt->caller_profile->caller_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->caller_id_name);
tech_pvt->caller_profile->caller_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->caller_id_number);
}
if (orig_cp) {
cp = switch_caller_profile_dup(tech_pvt->caller_profile->pool, orig_cp);
switch_channel_set_originator_caller_profile(channel, cp);
}
#if 0
sent_name = switch_channel_get_variable(b_channel, "last_sent_callee_id_name");
sent_number = switch_channel_get_variable(b_channel, "last_sent_callee_id_number");
if (!zstr(sent_name) && !zstr(sent_number)) {
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, sent_name);
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, sent_number);
} else {
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) {
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->callee_id_name);
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->callee_id_number);
} else {
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->caller_id_name);
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->caller_id_number);
}
}
#endif
if (is_nat) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Setting NAT mode based on %s\n", is_nat);
}
tech_pvt->caller_profile->dialplan = "inline";
bridge_uuid = switch_channel_get_partner_uuid(b_channel);
if (call_info) {
switch_event_t *event = NULL;
if (!zstr(bridge_uuid) && switch_channel_test_flag(b_channel, CF_LEG_HOLDING)) {
const char *b_call_id = switch_channel_get_variable(b_channel, "sip_call_id");
if (b_call_id) {
char *sql = switch_mprintf("update sip_dialogs set call_info_state='idle' where call_id='%q'", b_call_id);
if (mod_sofia_globals.debug_sla > 1) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "QUERY SQL %s\n", sql);
}
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
switch_channel_presence(b_channel, "unknown", "idle", NULL);
}
switch_channel_set_flag(tech_pvt->channel, CF_SLA_INTERCEPT);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool,
"answer,intercept:%s", bridge_uuid);
if (sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)
&& switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_REPLACED) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(b_channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_replaced_by", sip->sip_call_id->i_id);
switch_event_fire(&event);
}
} else {
switch_caller_profile_t *bcp = switch_channel_get_caller_profile(b_channel);
if (switch_channel_test_flag(b_channel, CF_BRIDGE_ORIGINATOR)) {
switch_channel_set_flag(tech_pvt->channel, CF_BRIDGE_ORIGINATOR);
}
if (!zstr(bcp->callee_id_name)) {
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, bcp->callee_id_name);
}
if (!zstr(bcp->callee_id_number)) {
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, bcp->callee_id_number);
}
if (!zstr(bcp->caller_id_name)) {
tech_pvt->caller_profile->caller_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, bcp->caller_id_name);
}
if (!zstr(bcp->caller_id_number)) {
tech_pvt->caller_profile->caller_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, bcp->caller_id_number);
}
if (bcp->originatee_caller_profile) {
switch_caller_profile_t *cp;
cp = switch_caller_profile_dup(tech_pvt->caller_profile->pool,
bcp->originatee_caller_profile);
switch_channel_set_originatee_caller_profile(tech_pvt->channel, cp);
}
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool,
"answer,sofia_sla:%s", b_private->uuid);
}
} else {
char const *a_leg = NULL;
char const *nightmare_xfer_uuid = NULL;
switch_event_t *event = NULL;
if (sip->sip_replaces && sip->sip_replaces->rp_params && sip->sip_replaces->rp_call_id) {
a_leg = msg_header_find_param(sip->sip_replaces->rp_common, "a-leg");
}
if(a_leg && switch_true(a_leg)) {
switch_channel_mark_hold(b_channel, SWITCH_FALSE);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,intercept:%s", sip->sip_replaces->rp_call_id);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "call %s picked up on a-leg\n", sip->sip_replaces->rp_call_id);
if (sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)
&& switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_INTERCEPTED) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(b_channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "intercepted_by", sip->sip_call_id->i_id);
switch_event_fire(&event);
}
} else {
if ((nightmare_xfer_uuid = sofia_glue_get_unknown_header(sip, "X-FS-Refer-For"))) {
switch_channel_set_variable(b_channel, "transfer_refer_for", nightmare_xfer_uuid);
}
if ((nightmare_xfer_uuid = sofia_glue_get_unknown_header(sip, "X-FS-Refer-From"))) {
switch_channel_set_variable(b_channel, "transfer_refer_from", nightmare_xfer_uuid);
}
if (!zstr(bridge_uuid)) {
if (sip->sip_replaces && sip->sip_replaces->rp_params && sip->sip_replaces->rp_call_id && switch_channel_test_flag(b_channel, CF_BRIDGED) &&
switch_true(switch_find_parameter(*(sip->sip_replaces->rp_params), "early-only", switch_core_session_get_pool(session)))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "call %s intercept rejected\n", bridge_uuid);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "hangup:CALL_REJECTED");
} else {
switch_channel_mark_hold(b_channel, SWITCH_FALSE);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,intercept:%s", bridge_uuid);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "call %s intercepted\n", bridge_uuid);
if (sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_INTERCEPTED) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(b_channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "intercepted_by", sip->sip_call_id->i_id);
switch_event_fire(&event);
}
}
} else {
const char *b_app = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_VARIABLE);
const char *b_data = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_DATA_VARIABLE);
if (b_data && b_app) {
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s:%s", b_app, b_data);
} else if (b_app) {
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s", b_app);
}
if (sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)
&& switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_REPLACED) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(b_channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_replaced_by", sip->sip_call_id->i_id);
switch_event_fire(&event);
}
switch_channel_hangup(b_channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
}
}
}
sofia_handle_sip_i_invite_replaces(session, channel, b_channel, b_private->uuid, tech_pvt, call_info, profile, is_nat, sip);
switch_core_session_rwunlock(b_session);
}
}
nua_handle_unref(bnh);
} else if (sip && sip->sip_replaces && sip->sip_replaces->rp_call_id) {
switch_core_session_t *b_session = NULL;
if ((b_session = switch_core_session_locate((char*) sip->sip_replaces->rp_call_id))) {
switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
sofia_handle_sip_i_invite_replaces(session, channel, b_channel, (char*) sip->sip_replaces->rp_call_id, tech_pvt, call_info, profile, is_nat, sip);
switch_core_session_rwunlock(b_session);
}
}
if (tech_pvt->caller_profile) {
int first_history_info = 1;
@ -11410,6 +11380,183 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
}
void sofia_handle_sip_i_invite_replaces(switch_core_session_t *session, switch_channel_t *channel, switch_channel_t *b_channel, char* uuid, private_object_t *tech_pvt, sip_call_info_t *call_info, sofia_profile_t *profile, char *is_nat, sip_t const *sip)
{
const char *bridge_uuid;
switch_caller_profile_t *orig_cp, *cp;
//const char *sent_name, *sent_number;
orig_cp = switch_channel_get_caller_profile(b_channel);
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->callee_id_name);
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->callee_id_number);
if (!call_info) {
tech_pvt->caller_profile->caller_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->caller_id_name);
tech_pvt->caller_profile->caller_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->caller_id_number);
}
if (orig_cp) {
cp = switch_caller_profile_dup(tech_pvt->caller_profile->pool, orig_cp);
switch_channel_set_originator_caller_profile(channel, cp);
}
#if 0
sent_name = switch_channel_get_variable(b_channel, "last_sent_callee_id_name");
sent_number = switch_channel_get_variable(b_channel, "last_sent_callee_id_number");
if (!zstr(sent_name) && !zstr(sent_number)) {
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, sent_name);
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, sent_number);
} else {
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) {
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->callee_id_name);
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->callee_id_number);
} else {
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->caller_id_name);
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->caller_id_number);
}
}
#endif
if (is_nat) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Setting NAT mode based on %s\n", is_nat);
}
tech_pvt->caller_profile->dialplan = "inline";
bridge_uuid = switch_channel_get_partner_uuid(b_channel);
if (bridge_uuid) {
switch_core_session_t *bridge_session = NULL;
if ((bridge_session = switch_core_session_locate(bridge_uuid))) {
switch_core_session_rwunlock(bridge_session);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "could not locate partner_uuid %s, resetting\n", bridge_uuid);
bridge_uuid = NULL;
}
}
if (call_info) {
switch_event_t *event = NULL;
if (!zstr(bridge_uuid) && switch_channel_test_flag(b_channel, CF_LEG_HOLDING)) {
const char *b_call_id = switch_channel_get_variable(b_channel, "sip_call_id");
if (b_call_id) {
char *sql = switch_mprintf("update sip_dialogs set call_info_state='idle' where call_id='%q'", b_call_id);
if (mod_sofia_globals.debug_sla > 1) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "QUERY SQL %s\n", sql);
}
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
switch_channel_presence(b_channel, "unknown", "idle", NULL);
}
switch_channel_set_flag(tech_pvt->channel, CF_SLA_INTERCEPT);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool,
"answer,intercept:%s", bridge_uuid);
if (sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)
&& sip && sip->sip_call_id
&& switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_REPLACED) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(b_channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_replaced_by", sip->sip_call_id->i_id);
switch_event_fire(&event);
}
} else {
switch_caller_profile_t *bcp = switch_channel_get_caller_profile(b_channel);
if (switch_channel_test_flag(b_channel, CF_BRIDGE_ORIGINATOR)) {
switch_channel_set_flag(tech_pvt->channel, CF_BRIDGE_ORIGINATOR);
}
if (!zstr(bcp->callee_id_name)) {
tech_pvt->caller_profile->callee_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, bcp->callee_id_name);
}
if (!zstr(bcp->callee_id_number)) {
tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, bcp->callee_id_number);
}
if (!zstr(bcp->caller_id_name)) {
tech_pvt->caller_profile->caller_id_name = switch_core_strdup(tech_pvt->caller_profile->pool, bcp->caller_id_name);
}
if (!zstr(bcp->caller_id_number)) {
tech_pvt->caller_profile->caller_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, bcp->caller_id_number);
}
if (bcp->originatee_caller_profile) {
switch_caller_profile_t *cp;
cp = switch_caller_profile_dup(tech_pvt->caller_profile->pool,
bcp->originatee_caller_profile);
switch_channel_set_originatee_caller_profile(tech_pvt->channel, cp);
}
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool,
"answer,sofia_sla:%s", uuid);
}
} else {
char const *nightmare_xfer_uuid = NULL;
switch_event_t *event = NULL;
if (switch_channel_var_true(channel, "sip_replaces_a-leg")) {
switch_channel_mark_hold(b_channel, SWITCH_FALSE);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,intercept:%s", sip->sip_replaces->rp_call_id);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "call %s picked up on a-leg\n", sip->sip_replaces->rp_call_id);
if (sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)
&& sip && sip->sip_call_id
&& switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_INTERCEPTED) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(b_channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "intercepted_by", sip->sip_call_id->i_id);
switch_event_fire(&event);
}
} else {
if ((nightmare_xfer_uuid = sofia_glue_get_unknown_header(sip, "X-FS-Refer-For"))) {
switch_channel_set_variable(b_channel, "transfer_refer_for", nightmare_xfer_uuid);
}
if ((nightmare_xfer_uuid = sofia_glue_get_unknown_header(sip, "X-FS-Refer-From"))) {
switch_channel_set_variable(b_channel, "transfer_refer_from", nightmare_xfer_uuid);
}
if (!zstr(bridge_uuid)) {
if (sip->sip_replaces && sip->sip_replaces->rp_params && sip->sip_replaces->rp_call_id && switch_channel_test_flag(b_channel, CF_BRIDGED) &&
switch_true(switch_find_parameter(*(sip->sip_replaces->rp_params), "early-only", switch_core_session_get_pool(session)))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "call %s intercept rejected\n", bridge_uuid);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "hangup:CALL_REJECTED");
} else {
switch_channel_mark_hold(b_channel, SWITCH_FALSE);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,intercept:%s", bridge_uuid);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "call %s intercepted\n", bridge_uuid);
if (sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)
&& sip && sip->sip_call_id
&& switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_INTERCEPTED) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(b_channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "intercepted_by", sip->sip_call_id->i_id);
switch_event_fire(&event);
}
}
} else {
const char *b_app = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_VARIABLE);
const char *b_data = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_DATA_VARIABLE);
if (b_data && b_app) {
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s:%s", b_app, b_data);
} else if (b_app) {
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s", b_app);
}
if (sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)
&& sip && sip->sip_call_id
&& switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_REPLACED) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(b_channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_replaced_by", sip->sip_call_id->i_id);
switch_event_fire(&event);
}
switch_channel_hangup(b_channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
}
}
}
}
void sofia_handle_sip_i_options(int status,
char const *phrase,
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip,

@ -926,12 +926,21 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
rpid_domain = "cluecon.com";
}
if (!zstr(tech_pvt->dest)) {
dst = sofia_glue_get_destination(tech_pvt->dest);
}
/*
* Ignore transport chanvar and uri parameter for gateway connections
* since all of them have been already taken care of in mod_sofia.c:sofia_outgoing_channel()
*/
if (tech_pvt->transport == SOFIA_TRANSPORT_UNKNOWN && zstr(tech_pvt->gateway_name)) {
if ((p = (char *) switch_stristr("port=", url))) {
if (dst && dst->route_uri) {
p = dst->route_uri;
} else {
p = url;
}
if ((p = (char *) switch_stristr("port=", p))) {
p += 5;
tech_pvt->transport = sofia_glue_str2transport(p);
} else {
@ -1079,7 +1088,9 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|| ((val = switch_channel_get_variable(channel, "sip_sticky_contact")) && switch_true(val)))) {
sofia_set_flag(tech_pvt, TFLAG_NAT);
tech_pvt->record_route = switch_core_session_strdup(tech_pvt->session, url_str);
route_uri = tech_pvt->record_route;
if (!dst || !dst->route_uri) {
route_uri = tech_pvt->record_route;
}
session_timeout = SOFIA_NAT_SESSION_TIMEOUT;
switch_channel_set_variable(channel, "sip_nat_detected", "true");
}
@ -1251,7 +1262,9 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
}
if (!zstr(tech_pvt->dest)) {
dst = sofia_glue_get_destination(tech_pvt->dest);
if (!dst) {
dst = sofia_glue_get_destination(tech_pvt->dest);
}
if (dst->route_uri) {
route_uri = sofia_overcome_sip_uri_weakness(tech_pvt->session, dst->route_uri, tech_pvt->transport, SWITCH_TRUE, NULL, NULL);
@ -1449,6 +1462,7 @@ switch_call_cause_t sofia_glue_sip_cause_to_freeswitch(int status)
case 403:
case 407:
case 603:
case 607:
return SWITCH_CAUSE_CALL_REJECTED;
case 404:
return SWITCH_CAUSE_UNALLOCATED_NUMBER;

@ -0,0 +1,229 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2014, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Anthony Minessale II <anthm@freeswitch.org>
* Ken Rice <krice at freeswitch.org>
* Paul D. Tinsley <pdt at jackhammer.org>
* Bret McDanel <trixter AT 0xdecafbad.com>
* Raymond Chandler <intralanman@freeswitch.org>
* Emmanuel Schmidbauer <eschmidbauer@gmail.com>
* Kathleen King <kathleen.king@quentustech.com>
*
*
* mod_sofia.c -- SOFIA SIP Endpoint
*
*/
/* Best viewed in a 160 x 60 VT100 Terminal or so the line below at least fits across your screen*/
/*************************************************************************************************************************************************************/
#include "mod_sofia.h"
typedef switch_status_t (*sofia_command_t) (char **argv, int argc, switch_stream_handle_t *stream);
extern const char *sofia_state_names[];
switch_status_t build_sofia_status_json(cJSON * container)
{
sofia_profile_t *profile = NULL;
sofia_gateway_t *gp;
switch_hash_index_t *hi;
void *val;
const void *vvar;
switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_core_hash_first(mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
cJSON * jprofile = cJSON_CreateObject();
cJSON * jstatus = cJSON_CreateObject();
switch_core_hash_this(hi, &vvar, NULL, &val);
cJSON_AddItemToObject(container, (const char *)vvar, jprofile);
cJSON_AddItemToObject(jprofile, "status", jstatus);
profile = (sofia_profile_t *) val;
if (strcmp(vvar, profile->name)) {
cJSON_AddItemToObject(jstatus, "type", cJSON_CreateString("alias"));
cJSON_AddItemToObject(jstatus, "data", cJSON_CreateString(profile->name));
cJSON_AddItemToObject(jstatus, "state", cJSON_CreateString("ALIASED"));
} else {
cJSON_AddItemToObject(jstatus, "type", cJSON_CreateString("profile"));
cJSON_AddItemToObject(jstatus, "state", cJSON_CreateString(sofia_test_pflag(profile, PFLAG_RUNNING) ? "RUNNING" : "DOWN"));
cJSON_AddItemToObject(jstatus, "in-use", cJSON_CreateNumber(profile->inuse));
if (! sofia_test_pflag(profile, PFLAG_TLS) || ! profile->tls_only) {
cJSON_AddItemToObject(jstatus, "data", cJSON_CreateString(profile->url));
} else if (sofia_test_pflag(profile, PFLAG_TLS)) {
cJSON_AddItemToObject(jstatus, "data", cJSON_CreateString(profile->tls_url));
cJSON_AddItemToObject(jstatus, "transport", cJSON_CreateString("tls"));
} else if (profile->ws_bindurl) {
cJSON_AddItemToObject(jprofile, "data", cJSON_CreateString(profile->ws_bindurl));
cJSON_AddItemToObject(jprofile, "transport", cJSON_CreateString("ws"));
} else if (profile->wss_bindurl) {
cJSON_AddItemToObject(jprofile, "data", cJSON_CreateString(profile->wss_bindurl));
cJSON_AddItemToObject(jprofile, "transport", cJSON_CreateString("wss"));
}
if (profile->gateways) {
cJSON *gateways = cJSON_CreateObject();
cJSON_AddItemToObject(jprofile, "gateways", gateways);
for (gp = profile->gateways; gp; gp = gp->next) {
cJSON *gateway = cJSON_CreateObject();
cJSON_AddItemToObject(gateways, gp->name, gateway);
switch_assert(gp->state < REG_STATE_LAST);
cJSON_AddItemToObject(gateway, "type", cJSON_CreateString("gateway"));
cJSON_AddItemToObject(gateway, "data", cJSON_CreateString(gp->register_to));
cJSON_AddItemToObject(gateway, "state", cJSON_CreateString(sofia_state_names[gp->state]));
if (gp->state == REG_STATE_FAILED || gp->state == REG_STATE_TRYING) {
time_t now = switch_epoch_time_now(NULL);
if (gp->retry > now) {
cJSON_AddItemToObject(gateway, "retry", cJSON_CreateNumber(gp->retry - now));
} else {
cJSON_AddItemToObject(gateway, "retry", cJSON_CreateString("never"));
}
}
}
}
}
}
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
return SWITCH_STATUS_SUCCESS;
}
switch_status_t build_sofia_profile_info_json(cJSON * container)
{
sofia_profile_t *profile = NULL;
cJSON *item, *iter = container->child;
while(iter) {
if ( (profile = sofia_glue_find_profile(iter->string))) {
cJSON *info = cJSON_CreateObject();
cJSON_AddItemToObject(iter, "info", info);
cJSON_AddItemToObject(info, "domain-name", cJSON_CreateString(profile->domain_name ? profile->domain_name : "N/A"));
if (strcasecmp(iter->string, profile->name)) {
cJSON_AddItemToObject(info, "alias-of", cJSON_CreateString(switch_str_nil(profile->name)));
}
cJSON_AddItemToObject(info, "auto-nat", cJSON_CreateString(sofia_test_pflag(profile, PFLAG_AUTO_NAT) ? "true" : "false"));
cJSON_AddItemToObject(info, "db-name", cJSON_CreateString(profile->dbname ? profile->dbname : switch_str_nil(profile->odbc_dsn)));
cJSON_AddItemToObject(info, "pres-hosts", cJSON_CreateString(switch_str_nil(profile->presence_hosts)));
cJSON_AddItemToObject(info, "dialplan", cJSON_CreateString(switch_str_nil(profile->dialplan)));
cJSON_AddItemToObject(info, "context", cJSON_CreateString(switch_str_nil(profile->context)));
cJSON_AddItemToObject(info, "challenge-realm", cJSON_CreateString(zstr(profile->challenge_realm) ? "auto_to" : profile->challenge_realm));
item = cJSON_CreateStringArray((const char **)profile->rtpip, profile->rtpip_index);
cJSON_AddItemToObject(info, "rtp-ip", item);
cJSON_AddItemToObject(info, "ext-rtp-ip", cJSON_CreateString(profile->extrtpip));
cJSON_AddItemToObject(info, "sip-ip", cJSON_CreateString(switch_str_nil(profile->sipip)));
cJSON_AddItemToObject(info, "ext-sip-ip", cJSON_CreateString(switch_str_nil(profile->extsipip)));
if (! sofia_test_pflag(profile, PFLAG_TLS) || ! profile->tls_only) {
cJSON_AddItemToObject(info, "url", cJSON_CreateString(switch_str_nil(profile->url)));
cJSON_AddItemToObject(info, "bind-url", cJSON_CreateString(switch_str_nil(profile->bindurl)));
}
if (sofia_test_pflag(profile, PFLAG_TLS)) {
cJSON_AddItemToObject(info, "tls-url", cJSON_CreateString(switch_str_nil(profile->tls_url)));
cJSON_AddItemToObject(info, "tls-bind-url", cJSON_CreateString(switch_str_nil(profile->tls_bindurl)));
}
if (profile->ws_bindurl) {
cJSON_AddItemToObject(info, "ws-bind-url", cJSON_CreateString(switch_str_nil(profile->ws_bindurl)));
}
if (profile->wss_bindurl) {
cJSON_AddItemToObject(info, "wss-bind-url", cJSON_CreateString(switch_str_nil(profile->wss_bindurl)));
}
cJSON_AddItemToObject(info, "hold-music", cJSON_CreateString(switch_str_nil(profile->hold_music)));
cJSON_AddItemToObject(info, "outbound-proxy", cJSON_CreateString(zstr(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy));
sofia_glue_release_profile(profile);
}
iter = iter->next;
}
return SWITCH_STATUS_SUCCESS;
}
SWITCH_STANDARD_JSON_API(sofia_status_json_function)
{
cJSON *ret = cJSON_CreateObject();
cJSON *profiles = cJSON_CreateObject();
cJSON_AddItemToObject(ret, "profiles", profiles);
build_sofia_status_json(profiles);
*json_reply = ret;
return SWITCH_STATUS_SUCCESS;
}
SWITCH_STANDARD_JSON_API(sofia_status_info_json_function)
{
cJSON *ret = cJSON_CreateObject();
cJSON *profiles = cJSON_CreateObject();
cJSON_AddItemToObject(ret, "profiles", profiles);
build_sofia_status_json(profiles);
build_sofia_profile_info_json(profiles);
*json_reply = ret;
return SWITCH_STATUS_SUCCESS;
}
switch_status_t cmd_json_status(char **argv, int argc, switch_stream_handle_t *stream)
{
char * json;
cJSON *ret = cJSON_CreateObject();
cJSON *profiles = cJSON_CreateObject();
cJSON_AddItemToObject(ret, "profiles", profiles);
build_sofia_status_json(profiles);
build_sofia_profile_info_json(profiles);
json = cJSON_Print(ret);
stream->write_function(stream, "%s\n", json);
switch_safe_free(json);
cJSON_Delete(ret);
return SWITCH_STATUS_SUCCESS;
}
void add_sofia_json_apis(switch_loadable_module_interface_t **module_interface)
{
switch_json_api_interface_t *json_api_interface;
SWITCH_ADD_JSON_API(json_api_interface, "sofia.status", "sofia status JSON API", sofia_status_json_function, "");
SWITCH_ADD_JSON_API(json_api_interface, "sofia.status.info", "sofia status JSON API", sofia_status_info_json_function, "");
}
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
*/

@ -62,7 +62,8 @@ SWITCH_MODULE_DEFINITION(mod_verto, mod_verto_load, mod_verto_shutdown, mod_vert
#define strerror_r(errno, buf, len) strerror_s(buf, len, errno)
#endif
#define die(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, __VA_ARGS__); goto error
#define log_and_exit(severity, ...) switch_log_printf(SWITCH_CHANNEL_LOG, (severity), __VA_ARGS__); goto error
#define die(...) log_and_exit(SWITCH_LOG_WARNING, __VA_ARGS__)
#define die_errno(fmt) do { char errbuf[BUFSIZ] = {0}; strerror_r(errno, (char *)&errbuf, sizeof(errbuf)); die(fmt ", errno=%d, %s\n", errno, (char *)&errbuf); } while(0)
#define die_errnof(fmt, ...) do { char errbuf[BUFSIZ] = {0}; strerror_r(errno, (char *)&errbuf, sizeof(errbuf)); die(fmt ", errno=%d, %s\n", __VA_ARGS__, errno, (char *)&errbuf); } while(0)
@ -915,7 +916,7 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
}
if (!strcmp(login, "root")) {
if (!strcmp(login, "root") && jsock->profile->root_passwd) {
if (!(r = !strcmp(passwd, jsock->profile->root_passwd))) {
*code = CODE_AUTH_FAILED;
switch_snprintf(message, mlen, "Authentication Failure");
@ -1797,14 +1798,21 @@ done:
*wsh->buffer = '\0';
while(jsock->profile->running) {
int pflags = switch_wait_sock(jsock->client_socket, 3000, SWITCH_POLL_READ | SWITCH_POLL_ERROR | SWITCH_POLL_HUP);
int pflags;
if (wsh->ssl && SSL_pending(wsh->ssl) > 0) {
pflags = SWITCH_POLL_READ;
} else {
pflags = switch_wait_sock(jsock->client_socket, 3000, SWITCH_POLL_READ | SWITCH_POLL_ERROR | SWITCH_POLL_HUP);
}
if (jsock->drop) { die("%s Dropping Connection\n", jsock->name); }
if (pflags < 0 && (errno != EINTR)) { die_errnof("%s POLL FAILED", jsock->name); }
if (pflags & SWITCH_POLL_HUP) { die("%s POLL HANGUP DETECTED (peer closed its end of socket)\n", jsock->name); }
if (pflags & SWITCH_POLL_ERROR) { die("%s POLL ERROR\n", jsock->name); }
if (pflags & SWITCH_POLL_INVALID) { die("%s POLL INVALID SOCKET (not opened or already closed)\n", jsock->name); }
if (pflags & SWITCH_POLL_READ) {
if (pflags < 0 && (errno != EINTR)) { die_errnof("%s POLL FAILED with %d", jsock->name, pflags); }
if (pflags == 0) { /* keepalive socket poll timeout */ break; }
if (pflags > 0 && (pflags & SWITCH_POLL_HUP)) { log_and_exit(SWITCH_LOG_INFO, "%s POLL HANGUP DETECTED (peer closed its end of socket)\n", jsock->name); }
if (pflags > 0 && (pflags & SWITCH_POLL_ERROR)) { die("%s POLL ERROR\n", jsock->name); }
if (pflags > 0 && (pflags & SWITCH_POLL_INVALID)) { die("%s POLL INVALID SOCKET (not opened or already closed)\n", jsock->name); }
if (pflags > 0 && (pflags & SWITCH_POLL_READ)) {
ssize_t bytes;
bytes = ws_raw_read(wsh, wsh->buffer + wsh->datalen, wsh->buflen - wsh->datalen - 1, wsh->block);
@ -1834,8 +1842,6 @@ done:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "socket %s is going to handle a new request\n", jsock->name);
goto new_req;
}
} else {
break;
}
}
}
@ -1862,19 +1868,26 @@ static void client_run(jsock_t *jsock)
ws_close(&jsock->ws, WS_NONE);
goto error;
} else {
die("%s WS SETUP FAILED\n", jsock->name);
log_and_exit(SWITCH_LOG_NOTICE, "%s WS SETUP FAILED\n", jsock->name);
}
}
while(jsock->profile->running) {
int pflags = switch_wait_sock(jsock->client_socket, 50, SWITCH_POLL_READ | SWITCH_POLL_ERROR | SWITCH_POLL_HUP);
int pflags;
if (jsock->ws.ssl && SSL_pending(jsock->ws.ssl) > 0) {
pflags = SWITCH_POLL_READ;
} else {
pflags = switch_wait_sock(jsock->client_socket, 50, SWITCH_POLL_READ | SWITCH_POLL_ERROR | SWITCH_POLL_HUP);
}
if (jsock->drop) { die("%s Dropping Connection\n", jsock->name); }
if (pflags < 0 && (errno != EINTR)) { die_errnof("%s POLL FAILED", jsock->name); }
if (pflags & SWITCH_POLL_HUP) { die("%s POLL HANGUP DETECTED (peer closed its end of socket)\n", jsock->name); }
if (pflags & SWITCH_POLL_ERROR) { die("%s POLL ERROR\n", jsock->name); }
if (pflags & SWITCH_POLL_INVALID) { die("%s POLL INVALID SOCKET (not opened or already closed)\n", jsock->name); }
if (pflags & SWITCH_POLL_READ) {
if (pflags < 0 && (errno != EINTR)) { die_errnof("%s POLL FAILED with %d", jsock->name, pflags); }
if (pflags == 0) {/* socket poll timeout */ jsock_check_event_queue(jsock); }
if (pflags > 0 && (pflags & SWITCH_POLL_HUP)) { log_and_exit(SWITCH_LOG_INFO, "%s POLL HANGUP DETECTED (peer closed its end of socket)\n", jsock->name); }
if (pflags > 0 && (pflags & SWITCH_POLL_ERROR)) { die("%s POLL ERROR\n", jsock->name); }
if (pflags > 0 && (pflags & SWITCH_POLL_INVALID)) { die("%s POLL INVALID SOCKET (not opened or already closed)\n", jsock->name); }
if (pflags > 0 && (pflags & SWITCH_POLL_READ)) {
switch_ssize_t bytes;
ws_opcode_t oc;
uint8_t *data;
@ -1883,7 +1896,7 @@ static void client_run(jsock_t *jsock)
if (bytes < 0) {
if (bytes == -WS_RECV_CLOSE) {
die("%s Client sent close request\n", jsock->name);
log_and_exit(SWITCH_LOG_INFO, "%s Client sent close request\n", jsock->name);
} else {
die("%s BAD READ %" SWITCH_SSIZE_T_FMT "\n", jsock->name, bytes);
}
@ -1963,8 +1976,6 @@ static void client_run(jsock_t *jsock)
switch_set_flag(jsock, JPFLAG_CHECK_ATTACH);
}
}
} else {
jsock_check_event_queue(jsock);
}
}
@ -4410,8 +4421,9 @@ static int profile_one_loop(verto_profile_t *profile)
if ((res = switch_wait_socklist(pfds, max, 100)) < 0) {
if (errno != EINTR) {
die_errnof("%s POLL FAILED", profile->name);
die_errnof("%s POLL FAILED with %d", profile->name, res);
}
return 0;
}
if (res == 0) {
@ -4419,7 +4431,7 @@ static int profile_one_loop(verto_profile_t *profile)
}
for (x = 0; x < max; x++) {
if (pfds[x].revents & SWITCH_POLL_HUP) { die("%s POLL HANGUP DETECTED (peer closed its end of socket)\n", profile->name); }
if (pfds[x].revents & SWITCH_POLL_HUP) { log_and_exit(SWITCH_LOG_INFO, "%s POLL HANGUP DETECTED (peer closed its end of socket)\n", profile->name); }
if (pfds[x].revents & SWITCH_POLL_ERROR) { die("%s POLL ERROR\n", profile->name); }
if (pfds[x].revents & SWITCH_POLL_INVALID) { die("%s POLL INVALID SOCKET (not opened or already closed)\n", profile->name); }
if (pfds[x].revents & SWITCH_POLL_READ) {
@ -4523,9 +4535,9 @@ static int runtime(verto_profile_t *profile)
}
if (ok) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s MCAST Bound to %s:%d/%d\n", profile->name, profile->mcast_ip, profile->mcast_port, profile->mcast_port + 1);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s MCAST Bound to %s:%d/%d\n", profile->name, profile->mcast_ip, profile->mcast_port, profile->mcast_port + 1);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s MCAST Disabled\n", profile->name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s MCAST Disabled\n", profile->name);
}
}

@ -175,7 +175,7 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg)
char *format_fields[MAX_ROUTING_KEY_FORMAT_FIELDS+1];
int format_fields_size = 0;
memset(format_fields, 0, MAX_ROUTING_KEY_FORMAT_FIELDS + 1);
memset(format_fields, 0, (MAX_ROUTING_KEY_FORMAT_FIELDS + 1) * sizeof(char *));
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
goto err;

@ -3,12 +3,31 @@ MODNAME=mod_kazoo
if HAVE_ERLANG
KAZOO_DEFS=kazoo_definitions.o
mod_LTLIBRARIES = mod_kazoo.la
mod_kazoo_la_SOURCES = mod_kazoo.c kazoo_utils.c kazoo_node.c kazoo_event_stream.c kazoo_fetch_agent.c kazoo_commands.c kazoo_dptools.c
mod_kazoo_la_CFLAGS = $(AM_CFLAGS) @ERLANG_CFLAGS@ -D_REENTRANT
mod_kazoo_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_kazoo_la_SOURCES = mod_kazoo.c kazoo_utils.c kazoo_dptools.c kazoo_tweaks.c
mod_kazoo_la_SOURCES += kazoo_api.c kazoo_commands.c kazoo_config.c
mod_kazoo_la_SOURCES += kazoo_message.c
mod_kazoo_la_SOURCES += kazoo_ei_config.c kazoo_ei_utils.c kazoo_event_stream.c
mod_kazoo_la_SOURCES += kazoo_fetch_agent.c kazoo_node.c
mod_kazoo_la_SOURCES += kazoo_endpoints.c
mod_kazoo_la_SOURCES += kz_node.c
mod_kazoo_la_CFLAGS = $(AM_CFLAGS) @ERLANG_CFLAGS@ -D_REENTRANT -DERLANG_VERSION=@ERLANG_VERSION@ -DERLANG_MAJOR=@ERLANG_MAJOR@ -DERLANG_MINOR=@ERLANG_MINOR@
mod_kazoo_la_LIBADD = $(KAZOO_DEFS) $(switch_builddir)/libfreeswitch.la
mod_kazoo_la_LDFLAGS = -avoid-version -module -no-undefined -shared @ERLANG_LDFLAGS@
BUILT_SOURCES = $(KAZOO_DEFS)
$(KAZOO_DEFS): kazoo.conf.xml
.S.o: $<
@$(CC) $(CFLAGS) -o $@ -c $<
install-exec-am:
@install `which epmd` $(DESTDIR)$(bindir)/fs_epmd
else
install: error
all: error

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More