Table of Contents
sdp_remove_codecs_by_id(list)
sdp_remove_codecs_by_name(list)
sdp_keep_codecs_by_id(list [, mtype])
sdp_keep_codecs_by_name(list [, mtype])
sdp_with_media(type)
sdp_remove_media(type)
sdp_with_codecs_by_id(list)
sdp_with_codecs_by_name(list)
sdp_print(level)
sdp_get(avpvar)
List of Examples
sdp_remove_codecs_by_id
usagesdp_remove_codecs_by_name
usagesdp_keep_codecs_by_id
usagesdp_keep_codecs_by_name
usagesdp_with_media
usagesdp_remove_media
usagesdp_with_codecs_by_id
usagesdp_with_codecs_by_name
usagesdp_print
usagesdp_get
usageTable of Contents
sdp_remove_codecs_by_id(list)
sdp_remove_codecs_by_name(list)
sdp_keep_codecs_by_id(list [, mtype])
sdp_keep_codecs_by_name(list [, mtype])
sdp_with_media(type)
sdp_remove_media(type)
sdp_with_codecs_by_id(list)
sdp_with_codecs_by_name(list)
sdp_print(level)
sdp_get(avpvar)
This module provides function for checking and managing the SDP payloads of SIP messages.
Examples of what this module offers: remove codecs from SDP, check the media stream types, return attributes of SDP document. For the full least of the features provided by this module and the implementation state, read further to the list of exported functions.
Remove the codecs provided in the parameter 'list' from all media streams found in SDP payload. The parameter 'list' must be one or a comma separated list of numeric codec IDs. The parameter can be a static string or a variable holding the list of numeric codec IDs.
This function can be used from ANY_ROUTE.
Example 1.1. sdp_remove_codecs_by_id
usage
... # remove PCMU sdp_remove_codecs_by_id("0"); # remove PCMU, PCMA and GSM sdp_remove_codecs_by_id("0,8,3"); ...
Remove the codecs provided in the parameter 'list' from all media streams found in SDP payload. The parameter 'list' must be one or a comma separated list of codec names. The parameter can be a static string or a variable holding the list of codec names.
This function can be used from ANY_ROUTE.
Example 1.2. sdp_remove_codecs_by_name
usage
... # remove PCMU sdp_remove_codecs_by_name("PCMU"); # remove PCMU, PCMA and GSM sdp_remove_codecs_by_name("PCMU,PCMA,GSM"); ...
Keep only the codecs provided in the parameter 'list' from all media streams found in SDP payload. The parameter 'list' must be one or a comma separated list of numeric codec IDs. The parameter can be a static string or a variable holding the list of numeric codec IDs.
Optional parameter mtype can be provided to apply the operations only to the streams matching m=mtype.
This function can be used from ANY_ROUTE.
Example 1.3. sdp_keep_codecs_by_id
usage
... # keep only PCMU sdp_keep_codecs_by_id("0"); # keep PCMU, PCMA and GSM in audio stream sdp_keep_codecs_by_id("0,8,3", "audio"); ...
Keep only the codecs provided in the parameter 'list' from all media streams found in SDP payload. The parameter 'list' must be one or a comma separated list of codec names. The parameter can be a static string or a variable holding the list of codec names.
Optional parameter mtype can be provided to apply the operations only to the streams matching m=mtype.
This function can be used from ANY_ROUTE.
Example 1.4. sdp_keep_codecs_by_name
usage
... # keep only PCMU sdp_keep_codecs_by_name("PCMU"); # keep PCMU, PCMA and GSM sdp_keep_codecs_by_name("PCMU,PCMA,GSM"); ...
Return true of the SDP has 'media=type ...' line. Useful to check the content of the RTP sessions, such as 'audio' or 'video'. The parameter can be static string or variable holding the media type.
This function can be used from ANY_ROUTE.
Example 1.5. sdp_with_media
usage
... # check for video stream if(sdp_with_media("video")) { # the session has a video stream } ...
Remove the streams that match on 'm=type ...' line. The parameter can be static string or variable holding the media type.
This function can be used from ANY_ROUTE.
Returns true if any of the codecs provided in the parameter 'list' from all media streams is found in SDP payload. The parameter 'list' must be one or a comma separated list of numeric codec IDs. The parameter can be a static string or a variable holding the list of numeric codec IDs.
This function can be used from ANY_ROUTE.
Example 1.7. sdp_with_codecs_by_id
usage
... # test for PCMU if(sdp_with_codecs_by_id("0")) { ... } # test for PCMU, PCMA or GSM if(sdp_with_codecs_by_id("0,8,3")) { ... } ...
Returns true if any of the codecs provided in the parameter 'list' from all media streams is found in SDP payload. The parameter 'list' must be one or a comma separated list of codec names. The parameter can be a static string or a variable holding the list of codec names.
This function can be used from ANY_ROUTE.
Example 1.8. sdp_with_codecs_by_name
usage
... # test for PCMU if(sdp_with_codecs_by_id("PCMU")) { ... } # test for PCMU, PCMA or GSM if(sdp_with_codecs_by_id("PCMU,PCMA,GSM")) { ... } ...
Print the SDP internal structure to log 'level'. The parameter can be static integer or variable holding the integer value of the log level.
This function can be used from ANY_ROUTE.