mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
%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:
@@ -1231,6 +1231,25 @@ SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str)
|
||||
return r;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_bool_t) switch_is_leading_number(const char *str)
|
||||
{
|
||||
const char *p;
|
||||
switch_bool_t r = SWITCH_FALSE;
|
||||
|
||||
if (*str == '-' || *str == '+') {
|
||||
str++;
|
||||
}
|
||||
|
||||
for (p = str; p && *p; p++) {
|
||||
if ((*p == '.' || (*p > 47 && *p < 58))) {
|
||||
r = SWITCH_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(const char *) switch_stristr(const char *instr, const char *str)
|
||||
{
|
||||
/*
|
||||
|
Reference in New Issue
Block a user