name mode size
..
doc 040000
Makefile 100644 222B
README 100644 7.82kB
api.h 100644 584B
sdpops_data.c 100644 8.56kB
sdpops_data.h 100644 1.13kB
sdpops_mod.c 100644 21.69kB
README
SDPOPS Module Daniel-Constantin Mierla <miconda@gmail.com> Edited by Daniel-Constantin Mierla <miconda@gmail.com> Copyright � 2011 asipto.com __________________________________________________________________ Table of Contents 1. Admin Guide 1. Overview 2. Dependencies 2.1. Kamailio Modules 2.2. External Libraries or Applications 3. Parameters 4. Functions 4.1. sdp_remove_codecs_by_id(list) 4.2. sdp_remove_codecs_by_name(list) 4.3. sdp_keep_codecs_by_id(list [, mtype]) 4.4. sdp_keep_codecs_by_name(list [, mtype]) 4.5. sdp_with_media(type) 4.6. sdp_remove_media(type) 4.7. sdp_with_codecs_by_id(list) 4.8. sdp_with_codecs_by_name(list) 4.9. sdp_print(level) 4.10. sdp_get(avpvar) List of Examples 1.1. sdp_remove_codecs_by_id usage 1.2. sdp_remove_codecs_by_name usage 1.3. sdp_keep_codecs_by_id usage 1.4. sdp_keep_codecs_by_name usage 1.5. sdp_with_media usage 1.6. sdp_remove_media usage 1.7. sdp_with_codecs_by_id usage 1.8. sdp_with_codecs_by_name usage 1.9. sdp_print usage 1.10. sdp_get usage Chapter 1. Admin Guide Table of Contents 1. Overview 2. Dependencies 2.1. Kamailio Modules 2.2. External Libraries or Applications 3. Parameters 4. Functions 4.1. sdp_remove_codecs_by_id(list) 4.2. sdp_remove_codecs_by_name(list) 4.3. sdp_keep_codecs_by_id(list [, mtype]) 4.4. sdp_keep_codecs_by_name(list [, mtype]) 4.5. sdp_with_media(type) 4.6. sdp_remove_media(type) 4.7. sdp_with_codecs_by_id(list) 4.8. sdp_with_codecs_by_name(list) 4.9. sdp_print(level) 4.10. sdp_get(avpvar) 1. Overview 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. 2. Dependencies 2.1. Kamailio Modules 2.2. External Libraries or Applications 2.1. Kamailio Modules The following modules must be loaded before this module: * none. 2.2. External Libraries or Applications The following libraries or applications must be installed before running Kamailio with this module loaded: * None 3. Parameters The module does not export any config parameter yet. 4. Functions 4.1. sdp_remove_codecs_by_id(list) 4.2. sdp_remove_codecs_by_name(list) 4.3. sdp_keep_codecs_by_id(list [, mtype]) 4.4. sdp_keep_codecs_by_name(list [, mtype]) 4.5. sdp_with_media(type) 4.6. sdp_remove_media(type) 4.7. sdp_with_codecs_by_id(list) 4.8. sdp_with_codecs_by_name(list) 4.9. sdp_print(level) 4.10. sdp_get(avpvar) 4.1. sdp_remove_codecs_by_id(list) 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"); ... 4.2. sdp_remove_codecs_by_name(list) 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"); ... 4.3. sdp_keep_codecs_by_id(list [, mtype]) 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"); ... 4.4. sdp_keep_codecs_by_name(list [, mtype]) 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"); ... 4.5. sdp_with_media(type) 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 } ... 4.6. sdp_remove_media(type) 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. Example 1.6. sdp_remove_media usage ... # remove video stream sdp_remove_media("video"); ... 4.7. sdp_with_codecs_by_id(list) 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")) { ... } ... 4.8. sdp_with_codecs_by_name(list) 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")) { ... } ... 4.9. sdp_print(level) 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. Example 1.9. sdp_print usage ... # print the SDP sdp_print("1"); ... 4.10. sdp_get(avpvar) Store the SDP part of message body in an AVP. Return 1 if SDP is found, -1 on error and -2 if there is no SDP part in the message body. This function can be used from ANY_ROUTE. Example 1.10. sdp_get usage ... sdp_get("$avp(sdp)"); ...