Commit Graph

295 Commits

Author SHA1 Message Date
Andrey Volk 5b9d0244c5 FS-11903: Fix regression on Windows in switch_utils.h 2019-07-19 00:33:21 +04:00
Mike Jerris 382ecb6612 FS-11922: [core] improve switch_calc_bitrate 2019-07-18 00:53:14 +04:00
Anthony Minessale 4926eac49d FS-11918: [core] add function to see frame buffer len switch_frame_buffer_size 2019-07-18 00:35:56 +04:00
Sergey Khripchenko c546154d67 FS-11436 more granularly calculate 'samples' and modify requested 'fsp' accordingly
+ review all places where it used and reflect that 'fps' is (float)
2019-07-16 20:26:32 +04:00
Sergey Khripchenko be7c5331f6 FS-11436 RTP timestamp field incorrectly calculated based on fps 2019-07-16 20:26:24 +04:00
Mike Jerris eb84654383 FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_utils.h 2019-07-16 01:33:13 +04:00
Luis Azedo 60956d7f85 FS-11025 [core] allow/check ports in network lists 2019-03-06 11:56:03 +00:00
Mike Jerris 0367b3b023 FS-11382: [core] add switch_pool_strip_whitespace function to strip whitespace using pool allocation 2018-09-06 17:49:46 +00:00
Mike Jerris b03cde3c57 FS-11341: [core] clang static analyzer warning in switch_utils.h:switch_parse_cpu_string 2018-08-21 17:51:06 +00:00
Andrey Volk 5c4211e43d FS-11189: [Build-System] Windows build regression fix. 2018-07-24 17:46:38 +03:00
Andrey Volk 2323421b5a FS-11189: [Build-System] Fix Windows build. 2018-07-24 16:11:54 +03:00
Seven Du e1e8ebc0ab FS-11189: [core] add func to parse cpu string 2018-07-24 07:21:57 +00:00
Seven Du a0fd0a1b44 FS-11093 #resolve switch_true should return switch_bool_t 2018-07-24 07:21:50 +00:00
Piotr Gregor 1fdd58f533 FS-10778: Add support for MKI to SRTP
MKI support for SRTP has been tested on calls to/from
Telnyx's Skype for Business from/to local extension registered to FS
and between Skype for Business clients connected to FreeSWITCH.

SfB -> FreeSWITCH -> User 1004
   SRTP           RTP
   with
   MKI

SfB <- FreeSWITCH <- User 1004
   SRTP           RTP

SfB <-> FreeSWITCH <-> SfB
 SRTP/MKI      SRTP/MKI

Channel variable "rtp_secure_media_mki" was added to drive offering
of MKI on outbound SRTP from FS.

How to use rtp_secure_media_mki

Set rtp_secure_media_mki=true to offer MKI for outgoing SRTP (if SRTP is used) in inbound call.
Export rtp_secure_media=true to offer MKI for outgoing SRTP (if SRTP is used) on outbound call.
... or set it in the codec string for bridged calls

<action application="set" data="rtp_secure_media_mki=true"/>

<action application="export" data="rtp_secure_media_mki=true"/>

<action application="bridge" data="[absolute_codec_string=^^:PCMU:PCMA:G729,rtp_secure_media=true,rtp_secure_media_mki=true]sofia/external/+12404373253@169.55.36.24:5060;transport=tls"/>

EXAMPLES

1. Set example

 57     <extension name="telnyx_test_1_2">
 58         <condition field="destination_number" expression="^(0012404373253)$">
 59             <action application="set" data="rtp_secure_media=true"/>
 60             <action application="set" data="rtp_secure_media_mki=true"/>
 61             <action application="answer"/>
 62             <action application="bridge" data="user/1004@${domain_name}"/>
 63       </condition>
 64   </extension>

Description: SRTP will be used on outbound leg in incoming call due to rtp_secure_media=true
set and MKI will be offered in SDP. SRTP will not be used on a bridged call to extension 1004.

2. Export example

 75   <extension name="to_skype_for_business">
 76       <condition field="destination_number" expression="^(840531022)$">
 77           <action application="set" data="rtp_secure_media=optional"/>
 78           <action application="export" data="rtp_secure_media_mki=true"/>
 79           <action application="bridge" data="[absolute_codec_string=^^:PCMU:PCMA:G729,rtp_secure_media=true]sofia/external/+12404373728@169.55.36.24:5060;transport=tls"/>
 80       </condition>
 81   </extension>

Description: SRTP on inbound call has been set to optional therefore MKI will be used
on outbound SRTP in this call if SRTP is used at all. SRTP will be used on a bridged call
due to rtp_secure_media=true set in codec string and MKI will be used in offering SDP.

3. Bridging between Skype for Business clients: set

 97     <extension name="S4B_fs_S4B">
 98         <condition field="destination_number" expression="^(0012404373254)$">
 99             <action application="set" data="rtp_secure_media=true"/>
100             <action application="set" data="rtp_secure_media_mki=true"/>
101             <action application="bridge" data="[absolute_codec_string=^^:PCMU:PCMA:G729,rtp_secure_media=true]sofia/external/+12404373253@169.55.36.$
102       </condition>
103   </extension>

Result:
2017-11-27 19:00:26.977704 [NOTICE] switch_ivr_originate.c:527 Ring Ready sofia/external/+12404373728@telnyxlab.com!
2017-11-27 19:00:32.657687 [NOTICE] switch_core_media.c:1534 Skipping MKI due to empty index
2017-11-27 19:00:32.657687 [INFO] switch_rtp.c:4079 Activating audio Secure RTP SEND
2017-11-27 19:00:32.657687 [INFO] switch_rtp.c:4057 Activating audio Secure RTP RECV
2017-11-27 19:00:32.657687 [NOTICE] sofia.c:8419 Channel [sofia/external/%2B12404373253@169.55.36.24:5060] has been answered
2017-11-27 19:00:35.317702 [INFO] switch_rtp.c:4079 Activating audio Secure RTP SEND (with MKI)
2017-11-27 19:00:35.317702 [INFO] switch_rtp.c:4057 Activating audio Secure RTP RECV (with MKI)
2017-11-27 19:00:35.317702 [NOTICE] sofia_media.c:92 Pre-Answer sofia/external/+12404373728@telnyxlab.com!

Description: SRTP with MKI is used on outbound leg of inbound call (due to use on inbound leg of this call and "set").
Standard SRTP is used in both legs of outbound call, because rtp_secure_media_mki wasn't exported
or set in codec string for the outbound call.

4. Bridging between Skype for Business clients: Set and export

 97     <extension name="S4B_fs_S4B">
 98         <condition field="destination_number" expression="^(0012404373254)$">
 99             <action application="set" data="rtp_secure_media=true"/>
100             <action application="set" data="rtp_secure_media_mki=true"/>
101             <action application="export" data="rtp_secure_media_mki=true"/>
102             <action application="bridge" data="[absolute_codec_string=^^:PCMU:PCMA:G729,rtp_secure_media=true]sofia/external/+12404373253@169.55.36.24:5060;transport=tls"/>
103       </condition>
104   </extension>

Result:
2017-11-27 18:51:29.017689 [NOTICE] switch_ivr_originate.c:527 Ring Ready sofia/external/+12404373728@telnyxlab.com!
2017-11-27 18:51:35.097729 [INFO] switch_rtp.c:4079 Activating audio Secure RTP SEND (with MKI)
2017-11-27 18:51:35.097729 [INFO] switch_rtp.c:4057 Activating audio Secure RTP RECV (with MKI)
2017-11-27 18:51:35.097729 [NOTICE] sofia.c:8419 Channel [sofia/external/%2B12404373253@169.55.36.24:5060] has been answered
2017-11-27 18:51:37.797706 [INFO] switch_rtp.c:4079 Activating audio Secure RTP SEND (with MKI)
2017-11-27 18:51:37.797706 [INFO] switch_rtp.c:4057 Activating audio Secure RTP RECV (with MKI)

Description: Connecting Skype For Business client to Skype for Business client.
Send SRTP with MKI in both outbound streams:
	- for inbound call: MKI was offered in incoming call and enabled for outbound leg with "set"
	- for outbound call: MKI was enabled with "export"

5. Other examples

Setup to use SRTP with MKI only on the inbound SRTP on incoming call from Telnyx SfB
Tested dialing 0012404373253 from SfB to FS, leg SfB <-> FS uses SRTP with MKI
on inbound SRTP only

57     <extension name="telnyx_test_1_2">
58         <condition field="destination_number" expression="^(0012404373253)$">
59              <action application="set" data="rtp_secure_media=true"/>
61              <action application="answer"/>
62              <action application="bridge" data="user/1004@${domain_name}"/>
63       </condition>
64   </extension>

Result:
2017-11-23 20:44:35.406026 [INFO] mod_dialplan_xml.c:637 Processing Test02 <+12404373728>->0012404373253 in context public
2017-11-23 20:44:38.566022 [INFO] switch_rtp.c:4107 Activating audio Secure RTP SEND
2017-11-23 20:44:38.566022 [INFO] switch_rtp.c:4085 Activating audio Secure RTP RECV (with MKI)

Setup to send and receive SRTP with MKI on incoming call from Telnyx SfB
Tested dialing 0012404373253 from SfB to FS, leg SfB <-> FS uses SRTP with MKI
in both directions

57     <extension name="telnyx_test_1_2">
58         <condition field="destination_number" expression="^(0012404373253)$">
59     		<action application="set" data="rtp_secure_media=true"/>
60     		<action application="set" data="rtp_secure_media_mki"/>
61     		<action application="answer"/>
62     		<action application="bridge" data="user/1004@${domain_name}"/>
63       </condition>
64   </extension>

Result:
2017-11-23 20:42:06.026034 [INFO] mod_dialplan_xml.c:637 Processing Test02 <+12404373728>->0012404373253 in context public
2017-11-23 20:42:09.526034 [INFO] switch_rtp.c:4107 Activating audio Secure RTP SEND (with MKI)
2017-11-23 20:42:09.526034 [INFO] switch_rtp.c:4085 Activating audio Secure RTP RECV (with MKI)

Setup to offer MKI on outbound call to extension 1001 (X-Lite -> FS -> linphone)
Tested dialing 0012404373253 from user 1004, leg FS <-> 1001 uses SRTP with MKI

782     <extension name="telnyx_test_1_2">
783         <condition field="destination_number" expression="^(0012404373253)$">
784             <action application="export" data="rtp_secure_media_outbound=true"/>
785             <action application="export" data="rtp_secure_media_mki"/>
786             <action application="answer"/>
797             <action application="bridge" data="user/1001@${domain_name}"/>
798       </condition>
799   </extension>

Result:
2017-11-23 20:23:26.266034 [INFO] mod_dialplan_xml.c:637 Processing 1000 windows <1000>->0012404373253 in context default
2017-11-23 20:23:26.366035 [INFO] switch_rtp.c:4107 Activating audio Secure RTP SEND (with MKI)
2017-11-23 20:23:26.366035 [INFO] switch_rtp.c:4085 Activating audio Secure RTP RECV

SfB sometimes offers crypto with LIFETIME but no MKI index, e.g.:
a=crypto:5 AES_CM_128_HMAC_SHA1_80 inline:9OtFWi17H9E8ywlm0iazemjAqXu2RhJ3DZyo+VLJ|2^31

Defaulting to no-mki SRTP in case key material doesn't contain MKI index.
2018-07-24 07:21:34 +00:00
Andrey Volk 5626d0b535 FS-10064: [mod_managed] Fix compile on windows. 2017-07-20 23:38:44 +03:00
Sergey Safarov df1ab07ca4 FS-9924: Removed extra space in source files 2017-02-09 23:59:49 -05:00
Mike Jerris ad183fdea4 FS-9809: [mod_sofia] url encode caller id number before sticking it in the from header in case we have non url safe chars in the cid number in the caller profile 2017-01-06 16:16:16 -06:00
Anthony Minessale c701ce6173 FS-9708 #resolve [RTP timing when doing repacketization] 2016-11-10 17:34:48 -06:00
Anthony Minessale 9b8a5edd3d FS-9638 2016-11-10 12:09:00 -06:00
Mike Jerris c4c460e7f2 FS-9581: fix signed/unsigned comparison build warning 2016-10-24 11:57:51 -04:00
Anthony Minessale c409499cd9 FS-9576 #resolve [Add Realtime Text] 2016-09-27 16:40:43 -05:00
Anthony Minessale 550029b80e FS-8811 #resolve [FS 1.7 crashes intermittently] 2016-03-04 16:56:55 -06:00
Anthony Minessale 6cd796a9bc FS-8293 add quality level 0 to conference (default is 1) and fix some logic in auto bw 2015-12-09 15:33:26 -06:00
Mike Jerris 6b5b1a3d86 FS-8389: [build] Fix msvc 2015 build warnings 2015-10-26 13:45:48 -04:00
Michael Giagnocavo ba9c44bbd0 FS-7885 Add getcputime command 2015-07-24 02:34:00 -06:00
Anthony Minessale f44af63d79 FS-7656 parse metadata from files and put video banner up if artist or title is set 2015-06-19 18:00:47 -05:00
Brian 2815994647 FS-7638 properly match ACL with IPv4 mapped IPv6 addresses 2015-06-11 10:41:33 -05:00
Michael Jerris 49778c34e5 FS-7258, FS-7571: [mod_xml_cdr] properly encode xml cdr for post to web server 2015-06-02 18:54:15 -05:00
Anthony Minessale 81094b3a0c FS-7499 adding some more refactoring towards better rtcp 2015-05-28 12:47:31 -05:00
Michael Jerris c7709a191b CID-1294436: handle null file paths to switch_is_file_path correctly 2015-05-28 12:47:25 -05:00
Anthony Minessale c312b50da7 FS-7515: update cv to use new alpha supported switch_image_t 2015-05-28 12:47:20 -05:00
Anthony Minessale 52d15f6398 FS-7505: clean up and support multiple formats to same extensions {modname=mod_vlc}rtmp://foo.com/flvplayback also move [/tmp]file to be {spool_path=/tmp} 2015-05-28 12:47:13 -05:00
Anthony Minessale 0d34e8ac77 FS-7500: add a framebuffer to reuse memory and use it to offload frame writing from video muxing thread to a dedicated write thread 2015-05-28 12:47:08 -05:00
Anthony Minessale 93db69ed03 FS-7500: can't use stristr for this 2015-05-28 12:47:04 -05:00
Anthony Minessale 1aa66ef30a FS-7513: do layers in order and reset when attaching 2015-05-28 12:46:58 -05:00
Anthony Minessale fcf32fd53d FS-7500 FS-7513: add video bandwidth control function and use it in mod_conference 2015-05-28 12:46:58 -05:00
Anthony Minessale f7fb5fbff3 FS-7500: forgot one 2015-05-28 12:46:58 -05:00
Anthony Minessale 1bb8c0a8fc FS-7500: fix signed error 2015-05-28 12:46:58 -05:00
Anthony Minessale a56e65bace FS-7513: add flag to choose between encoding each frame and using central encoder per codec, add parsing for floor fields and reservation fields in layouts, add param to control bandwidth for consolidated codecs, add audio-position attr to images in layout to sync with virtual HRTF 2015-05-28 12:46:58 -05:00
Anthony Minessale 0d626bc715 FS-7501: more factoring on vid buffer 2015-05-28 12:46:52 -05:00
Michael Jerris b90aa23cbd FS-7488: [mod_managed] fix build error 2015-04-28 11:59:15 -05:00
Anthony Minessale 76370f4d17 auto urlencode user portion of sip uri 2015-01-23 21:06:02 -06:00
Anthony Minessale 5ce5199be9 FS-6969 #resolve #comment This patch should accomplish the same and handle other platforms, please test 2014-11-07 08:38:01 -06:00
Anthony Minessale 24084adf77 %FEATURE Add new feature to filter the SDP on bypass_media calls to remove or limit codecs.
VARIABLE: bypass_media_sdp_filter

Can be set globally or per leg on the inbound side of a bypass_media bridge.

VALID FILTERS:

remove(): Removes the specified codec if it exists in the SDP.
only():   Removes all codecs besides the one specified (providing that it exists in the sdp) (will not remove telephone-event))

EXAMPLE 1 (remove everything leaving only g729):

  <action application="set" data="bypass_media_sdp_filter=only(g729)"/>
  <action application="set" data="bypass_media=true"/>
  <action application="bridge" data="sofia/internal/1238@conference.freeswitch.org"/>

EXAMPLE 2 (remove everything leaving only g729 and also remove dtmf):

  <action application="set" data="bypass_media_sdp_filter=only(g729)|remove(telephone-event)"/>
  <action application="set" data="bypass_media=true"/>
  <action application="bridge" data="sofia/internal/1238@conference.freeswitch.org"/>

EXAMPLE 3 (remove alaw and speex):

  <action application="set" data="bypass_media_sdp_filter=remove(pcma)|remove(speex)"/>
  <action application="set" data="bypass_media=true"/>
  <action application="bridge" data="sofia/internal/1238@conference.freeswitch.org"/>
2014-10-01 01:28:10 +05:00
Seven Du c02b2427e8 refactor http parsing and prevent read body more than content-length 2014-09-06 19:35:05 +08:00
Seven Du f5c0c13931 add http query string parsing and improve http header parsing 2014-09-06 17:21:58 +08:00
Seven Du f0b9407cca add http utils 2014-09-04 08:43:51 +08:00
Anthony Minessale fb274514df add switch_separate_file_params function so when using relative paths with bracketed params the full path can be constructed with the params in tact 2014-08-01 22:57:40 +05:00
Anthony Minessale 4f1b09a3ca add switch_socket_waitlist for waiting on multiple sockets and abstract it to poll and select so windows can use it too 2014-07-25 00:23:08 +05:00
Anthony Minessale a2921e269c update verto with some fixes and enhancements with reconnection 2014-07-18 01:04:04 +05:00