2
0
Эх сурвалжийг харах

sdpops: documented sdp_print(...) and sdp_with_media(...)

Daniel-Constantin Mierla 14 жил өмнө
parent
commit
501df6bd29

+ 40 - 0
modules/sdpops/README

@@ -27,10 +27,14 @@ Daniel-Constantin Mierla
         4. Exported Functions
 
               4.1. sdp_remove_codecs_by_id(list)
+              4.2. sdp_with_media(type)
+              4.3. sdp_print(level)
 
    List of Examples
 
    1.1. sdp_remove_codecs_by_id usage
+   1.2. sdp_with_media usage
+   1.3. sdp_print usage
 
 Chapter 1. Admin Guide
 
@@ -46,6 +50,8 @@ Chapter 1. Admin Guide
    4. Exported Functions
 
         4.1. sdp_remove_codecs_by_id(list)
+        4.2. sdp_with_media(type)
+        4.3. sdp_print(level)
 
 1. Overview
 
@@ -80,6 +86,8 @@ Chapter 1. Admin Guide
 4. Exported Functions
 
    4.1. sdp_remove_codecs_by_id(list)
+   4.2. sdp_with_media(type)
+   4.3. sdp_print(level)
 
 4.1.  sdp_remove_codecs_by_id(list)
 
@@ -88,6 +96,8 @@ Chapter 1. Admin Guide
    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
@@ -95,3 +105,33 @@ sdp_remove_codecs_by_id("0");
 # remove PCMU, PCMA and GSM
 sdp_remove_codecs_by_id("0,8,3");
 ...
+
+4.2.  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.2. sdp_with_media usage
+...
+# check for video stream
+if(sdp_with_media("video"))
+{
+    # the session has a video stream
+}
+...
+
+4.3.  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.3. sdp_print usage
+...
+# print the SDP
+sdp_print("1");
+...

+ 51 - 1
modules/sdpops/doc/sdpops_admin.xml

@@ -67,7 +67,7 @@
 
 	<section>
 	<title>Exported Functions</title>
- 	<section>
+	<section>
 	    <title>
 		<function moreinfo="none">sdp_remove_codecs_by_id(list)</function>
 	    </title>
@@ -77,6 +77,9 @@
 			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.
+	    </para>
+		<para>
+			This function can be used from ANY_ROUTE.
 	    </para>
 		<example>
 		<title><function>sdp_remove_codecs_by_id</function> usage</title>
@@ -87,6 +90,53 @@ sdp_remove_codecs_by_id("0");
 # remove PCMU, PCMA and GSM
 sdp_remove_codecs_by_id("0,8,3");
 ...
+</programlisting>
+	    </example>
+	</section>
+	<section>
+	    <title>
+		<function moreinfo="none">sdp_with_media(type)</function>
+	    </title>
+	    <para>
+		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.
+	    </para>
+		<para>
+			This function can be used from ANY_ROUTE.
+	    </para>
+		<example>
+		<title><function>sdp_with_media</function> usage</title>
+		<programlisting format="linespecific">
+...
+# check for video stream
+if(sdp_with_media("video"))
+{
+    # the session has a video stream
+}
+...
+</programlisting>
+	    </example>
+	</section>
+	<section>
+	    <title>
+		<function moreinfo="none">sdp_print(level)</function>
+	    </title>
+	    <para>
+		Print the SDP internal structure to log 'level'. The
+		parameter can be static integer or variable holding the integer
+		value of the log level.
+	    </para>
+		<para>
+			This function can be used from ANY_ROUTE.
+	    </para>
+		<example>
+		<title><function>sdp_print</function> usage</title>
+		<programlisting format="linespecific">
+...
+# print the SDP
+sdp_print("1");
+...
 </programlisting>
 	    </example>
 	</section>