|
@@ -10,7 +10,7 @@ Daniel-Constantin Mierla
|
|
|
|
|
|
<[email protected]>
|
|
<[email protected]>
|
|
|
|
|
|
- Copyright © 2011 asipto.com
|
|
|
|
|
|
+ Copyright © 2011 asipto.com
|
|
__________________________________________________________________
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
Table of Contents
|
|
@@ -28,10 +28,13 @@ Daniel-Constantin Mierla
|
|
|
|
|
|
4.1. sdp_remove_codecs_by_id(list)
|
|
4.1. sdp_remove_codecs_by_id(list)
|
|
4.2. sdp_remove_codecs_by_name(list)
|
|
4.2. sdp_remove_codecs_by_name(list)
|
|
- 4.3. sdp_keep_codecs_by_id(list)
|
|
|
|
- 4.4. sdp_keep_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.5. sdp_with_media(type)
|
|
- 4.6. sdp_print(level)
|
|
|
|
|
|
+ 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)
|
|
|
|
|
|
List of Examples
|
|
List of Examples
|
|
|
|
|
|
@@ -40,7 +43,10 @@ Daniel-Constantin Mierla
|
|
1.3. sdp_keep_codecs_by_id usage
|
|
1.3. sdp_keep_codecs_by_id usage
|
|
1.4. sdp_keep_codecs_by_name usage
|
|
1.4. sdp_keep_codecs_by_name usage
|
|
1.5. sdp_with_media usage
|
|
1.5. sdp_with_media usage
|
|
- 1.6. sdp_print 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
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
Chapter 1. Admin Guide
|
|
|
|
|
|
@@ -57,10 +63,13 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
4.1. sdp_remove_codecs_by_id(list)
|
|
4.1. sdp_remove_codecs_by_id(list)
|
|
4.2. sdp_remove_codecs_by_name(list)
|
|
4.2. sdp_remove_codecs_by_name(list)
|
|
- 4.3. sdp_keep_codecs_by_id(list)
|
|
|
|
- 4.4. sdp_keep_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.5. sdp_with_media(type)
|
|
- 4.6. sdp_print(level)
|
|
|
|
|
|
+ 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)
|
|
|
|
|
|
1. Overview
|
|
1. Overview
|
|
|
|
|
|
@@ -96,12 +105,15 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
4.1. sdp_remove_codecs_by_id(list)
|
|
4.1. sdp_remove_codecs_by_id(list)
|
|
4.2. sdp_remove_codecs_by_name(list)
|
|
4.2. sdp_remove_codecs_by_name(list)
|
|
- 4.3. sdp_keep_codecs_by_id(list)
|
|
|
|
- 4.4. sdp_keep_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.5. sdp_with_media(type)
|
|
- 4.6. sdp_print(level)
|
|
|
|
|
|
+ 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.1. sdp_remove_codecs_by_id(list)
|
|
|
|
|
|
+4.1. sdp_remove_codecs_by_id(list)
|
|
|
|
|
|
Remove the codecs provided in the parameter 'list' from all media
|
|
Remove the codecs provided in the parameter 'list' from all media
|
|
streams found in SDP payload. The parameter 'list' must be one or a
|
|
streams found in SDP payload. The parameter 'list' must be one or a
|
|
@@ -118,7 +130,7 @@ sdp_remove_codecs_by_id("0");
|
|
sdp_remove_codecs_by_id("0,8,3");
|
|
sdp_remove_codecs_by_id("0,8,3");
|
|
...
|
|
...
|
|
|
|
|
|
-4.2. sdp_remove_codecs_by_name(list)
|
|
|
|
|
|
+4.2. sdp_remove_codecs_by_name(list)
|
|
|
|
|
|
Remove the codecs provided in the parameter 'list' from all media
|
|
Remove the codecs provided in the parameter 'list' from all media
|
|
streams found in SDP payload. The parameter 'list' must be one or a
|
|
streams found in SDP payload. The parameter 'list' must be one or a
|
|
@@ -135,30 +147,36 @@ sdp_remove_codecs_by_name("PCMU");
|
|
sdp_remove_codecs_by_name("PCMU,PCMA,GSM");
|
|
sdp_remove_codecs_by_name("PCMU,PCMA,GSM");
|
|
...
|
|
...
|
|
|
|
|
|
-4.3. sdp_keep_codecs_by_id(list)
|
|
|
|
|
|
+4.3. sdp_keep_codecs_by_id(list [, mtype])
|
|
|
|
|
|
Keep only the codecs provided in the parameter 'list' from all media
|
|
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
|
|
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
|
|
comma separated list of numeric codec IDs. The parameter can be a
|
|
static string or a variable holding the list of numeric codec IDs.
|
|
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.
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
Example 1.3. sdp_keep_codecs_by_id usage
|
|
Example 1.3. sdp_keep_codecs_by_id usage
|
|
...
|
|
...
|
|
# keep only PCMU
|
|
# keep only PCMU
|
|
sdp_keep_codecs_by_id("0");
|
|
sdp_keep_codecs_by_id("0");
|
|
-# keep PCMU, PCMA and GSM
|
|
|
|
-sdp_keep_codecs_by_id("0,8,3");
|
|
|
|
|
|
+# 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)
|
|
|
|
|
|
+4.4. sdp_keep_codecs_by_name(list [, mtype])
|
|
|
|
|
|
Keep only the codecs provided in the parameter 'list' from all media
|
|
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
|
|
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
|
|
comma separated list of codec names. The parameter can be a static
|
|
string or a variable holding the list of codec names.
|
|
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.
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
Example 1.4. sdp_keep_codecs_by_name usage
|
|
Example 1.4. sdp_keep_codecs_by_name usage
|
|
@@ -169,7 +187,7 @@ sdp_keep_codecs_by_name("PCMU");
|
|
sdp_keep_codecs_by_name("PCMU,PCMA,GSM");
|
|
sdp_keep_codecs_by_name("PCMU,PCMA,GSM");
|
|
...
|
|
...
|
|
|
|
|
|
-4.5. sdp_with_media(type)
|
|
|
|
|
|
+4.5. sdp_with_media(type)
|
|
|
|
|
|
Return true of the SDP has 'media=type ...' line. Useful to check the
|
|
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
|
|
content of the RTP sessions, such as 'audio' or 'video'. The parameter
|
|
@@ -186,14 +204,61 @@ if(sdp_with_media("video"))
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-4.6. sdp_print(level)
|
|
|
|
|
|
+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
|
|
Print the SDP internal structure to log 'level'. The parameter can be
|
|
static integer or variable holding the integer value of the log level.
|
|
static integer or variable holding the integer value of the log level.
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.6. sdp_print usage
|
|
|
|
|
|
+ Example 1.9. sdp_print usage
|
|
...
|
|
...
|
|
# print the SDP
|
|
# print the SDP
|
|
sdp_print("1");
|
|
sdp_print("1");
|