[sr-dev] git:master: sdpops: documented the functions for keeping only a set of codecs

Daniel-Constantin Mierla miconda at gmail.com
Sat Aug 20 09:32:58 CEST 2011


Module: sip-router
Branch: master
Commit: fb92dde610813b6f305d31b380019053505e5628
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fb92dde610813b6f305d31b380019053505e5628

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sat Aug 20 08:33:38 2011 +0200

sdpops: documented the functions for keeping only a set of codecs

---

 modules/sdpops/README               |   72 +++++++++++++++++++++++++++-------
 modules/sdpops/doc/sdpops_admin.xml |   52 +++++++++++++++++++++++++
 2 files changed, 109 insertions(+), 15 deletions(-)

diff --git a/modules/sdpops/README b/modules/sdpops/README
index 6ce43ed..35f5566 100644
--- a/modules/sdpops/README
+++ b/modules/sdpops/README
@@ -10,7 +10,7 @@ Daniel-Constantin Mierla
 
    <miconda at gmail.com>
 
-   Copyright © 2011 asipto.com
+   Copyright © 2011 asipto.com
      __________________________________________________________________
 
    Table of Contents
@@ -28,15 +28,19 @@ Daniel-Constantin Mierla
 
               4.1. sdp_remove_codecs_by_id(list)
               4.2. sdp_remove_codecs_by_name(list)
-              4.3. sdp_with_media(type)
-              4.4. sdp_print(level)
+              4.3. sdp_keep_codecs_by_id(list)
+              4.4. sdp_keep_codecs_by_name(list)
+              4.5. sdp_with_media(type)
+              4.6. sdp_print(level)
 
    List of Examples
 
    1.1. sdp_remove_codecs_by_id usage
    1.2. sdp_remove_codecs_by_name usage
-   1.3. sdp_with_media usage
-   1.4. sdp_print 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_print usage
 
 Chapter 1. Admin Guide
 
@@ -53,8 +57,10 @@ Chapter 1. Admin Guide
 
         4.1. sdp_remove_codecs_by_id(list)
         4.2. sdp_remove_codecs_by_name(list)
-        4.3. sdp_with_media(type)
-        4.4. sdp_print(level)
+        4.3. sdp_keep_codecs_by_id(list)
+        4.4. sdp_keep_codecs_by_name(list)
+        4.5. sdp_with_media(type)
+        4.6. sdp_print(level)
 
 1. Overview
 
@@ -90,10 +96,12 @@ Chapter 1. Admin Guide
 
    4.1. sdp_remove_codecs_by_id(list)
    4.2. sdp_remove_codecs_by_name(list)
-   4.3. sdp_with_media(type)
-   4.4. sdp_print(level)
+   4.3. sdp_keep_codecs_by_id(list)
+   4.4. sdp_keep_codecs_by_name(list)
+   4.5. sdp_with_media(type)
+   4.6. 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
    streams found in SDP payload. The parameter 'list' must be one or a
@@ -110,7 +118,7 @@ sdp_remove_codecs_by_id("0");
 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
    streams found in SDP payload. The parameter 'list' must be one or a
@@ -127,7 +135,41 @@ sdp_remove_codecs_by_name("PCMU");
 sdp_remove_codecs_by_name("PCMU,PCMA,GSM");
 ...
 
-4.3.  sdp_with_media(type)
+4.3. sdp_keep_codecs_by_id(list)
+
+   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.
+
+   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
+sdp_keep_codecs_by_id("0,8,3");
+...
+
+4.4. sdp_keep_codecs_by_name(list)
+
+   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.
+
+   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
@@ -135,7 +177,7 @@ sdp_remove_codecs_by_name("PCMU,PCMA,GSM");
 
    This function can be used from ANY_ROUTE.
 
-   Example 1.3. sdp_with_media usage
+   Example 1.5. sdp_with_media usage
 ...
 # check for video stream
 if(sdp_with_media("video"))
@@ -144,14 +186,14 @@ if(sdp_with_media("video"))
 }
 ...
 
-4.4.  sdp_print(level)
+4.6. 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.4. sdp_print usage
+   Example 1.6. sdp_print usage
 ...
 # print the SDP
 sdp_print("1");
diff --git a/modules/sdpops/doc/sdpops_admin.xml b/modules/sdpops/doc/sdpops_admin.xml
index d571c66..9219b93 100644
--- a/modules/sdpops/doc/sdpops_admin.xml
+++ b/modules/sdpops/doc/sdpops_admin.xml
@@ -121,6 +121,58 @@ sdp_remove_codecs_by_name("PCMU,PCMA,GSM");
 	</section>
 	<section>
 	    <title>
+		<function moreinfo="none">sdp_keep_codecs_by_id(list)</function>
+	    </title>
+	    <para>
+			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.
+	    </para>
+		<para>
+			This function can be used from ANY_ROUTE.
+	    </para>
+		<example>
+		<title><function>sdp_keep_codecs_by_id</function> usage</title>
+		<programlisting format="linespecific">
+...
+# keep only PCMU
+sdp_keep_codecs_by_id("0");
+# keep PCMU, PCMA and GSM
+sdp_keep_codecs_by_id("0,8,3");
+...
+</programlisting>
+	    </example>
+	</section>
+	<section>
+	    <title>
+		<function moreinfo="none">sdp_keep_codecs_by_name(list)</function>
+	    </title>
+	    <para>
+			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.
+	    </para>
+		<para>
+			This function can be used from ANY_ROUTE.
+	    </para>
+		<example>
+		<title><function>sdp_keep_codecs_by_name</function> usage</title>
+		<programlisting format="linespecific">
+...
+# keep only PCMU
+sdp_keep_codecs_by_name("PCMU");
+# keep PCMU, PCMA and GSM
+sdp_keep_codecs_by_name("PCMU,PCMA,GSM");
+...
+</programlisting>
+	    </example>
+	</section>
+	<section>
+	    <title>
 		<function moreinfo="none">sdp_with_media(type)</function>
 	    </title>
 	    <para>




More information about the sr-dev mailing list