%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"/>
This commit is contained in:
Anthony Minessale
2014-10-01 01:28:10 +05:00
parent 92a66fb1e7
commit 24084adf77
9 changed files with 306 additions and 18 deletions
+2 -1
View File
@@ -678,7 +678,8 @@ SWITCH_DECLARE(void) switch_channel_release_device_record(switch_device_record_t
SWITCH_DECLARE(switch_status_t) switch_channel_bind_device_state_handler(switch_device_state_function_t function, void *user_data);
SWITCH_DECLARE(switch_status_t) switch_channel_unbind_device_state_handler(switch_device_state_function_t function);
SWITCH_DECLARE(const char *) switch_channel_device_state2str(switch_device_state_t device_state);
SWITCH_DECLARE(switch_status_t) switch_channel_pass_sdp(switch_channel_t *from_channel, switch_channel_t *to_channel, const char *sdp);
SWITCH_END_EXTERN_C
#endif
/* For Emacs:
+1 -1
View File
@@ -275,7 +275,7 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
SWITCH_DECLARE(switch_rtp_crypto_key_type_t) switch_core_media_crypto_str2type(const char *str);
SWITCH_DECLARE(const char *) switch_core_media_crypto_type2str(switch_rtp_crypto_key_type_t type);
SWITCH_DECLARE(int) switch_core_media_crypto_keylen(switch_rtp_crypto_key_type_t type);
SWITCH_DECLARE(char *) switch_core_media_filter_sdp(const char *sdp, const char *cmd, const char *arg);
SWITCH_END_EXTERN_C
#endif
+1
View File
@@ -418,6 +418,7 @@ SWITCH_DECLARE(switch_status_t) switch_frame_alloc(switch_frame_t **frame, switc
SWITCH_DECLARE(switch_status_t) switch_frame_dup(switch_frame_t *orig, switch_frame_t **clone);
SWITCH_DECLARE(switch_status_t) switch_frame_free(switch_frame_t **frame);
SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str);
SWITCH_DECLARE(switch_bool_t) switch_is_leading_number(const char *str);
SWITCH_DECLARE(char *) switch_find_parameter(const char *str, const char *param, switch_memory_pool_t *pool);
/*!