From 03d93a43a38f2af44640f42e3fd0f8f2a073b108 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Sat, 27 Jan 2024 10:45:12 +0100 Subject: [PATCH] sdpops: docs for sdp line interator functions and variable --- src/modules/sdpops/doc/sdpops_admin.xml | 174 +++++++++++++++++++++++- 1 file changed, 173 insertions(+), 1 deletion(-) diff --git a/src/modules/sdpops/doc/sdpops_admin.xml b/src/modules/sdpops/doc/sdpops_admin.xml index 746b051f017..3c802d4cdf2 100644 --- a/src/modules/sdpops/doc/sdpops_admin.xml +++ b/src/modules/sdpops/doc/sdpops_admin.xml @@ -595,7 +595,174 @@ if(is_method("INVITE") && has_body("application/sdp")){ - +
+ + <function moreinfo="none">sdp_iterator_start(iname)</function> + + + Start an iterator for lines in the body of the current SIP message. + The parameter iname is used to identify the iterator. There + can be up to 4 iterators at the same time, with different name. + + + The parameter can be a dynamic string with variables. + + + This function can be used from ANY_ROUTE. + + + <function>sdp_iterator_start</function> usage + +... +sdp_iterator_start("s1"); +... + + +
+
+ + <function moreinfo="none">sdp_iterator_end(iname)</function> + + + Close the iterator identified by iname parameter. The iname value + must be the same used for sdp_iterator_start(). + + + The parameter can be dynamic string with variables. + + + This function can be used from ANY_ROUTE. + + + <function>sdp_iterator_end</function> usage + +... +sdp_iterator_end("s1"); +... + + +
+
+ + <function moreinfo="none">sdp_iterator_next(iname)</function> + + + Move the iterator to the next line in the body. It must + be called also after sdp_iterator_start() to get the first + header. + + + The return code is false when there is no other header in the list. + + + The SDP line is accessible via variable $sdpitval(iname) - it contains + also the EOL chars. + + + The parameter can be dynamic string with variables. + + + This function can be used from ANY_ROUTE. + + + <function>sdp_iterator_next</function> usage + +... + sdp_iterator_start("s1"); + while(sdp_iterator_next("s1")) { + xlog("body line: $sdpitval(s1)"); + } + sdp_iterator_end("s1"); +... + + +
+
+ + <function moreinfo="none">sdp_iterator_rm(iname)</function> + + + Remove the body line at the current iterator position. + + + The parameter can be dynamic string with variables. + + + This function can be used from ANY_ROUTE. + + + <function>sdp_iterator_rm</function> usage + +... + sdp_iterator_start("s1"); + while(sdp_iterator_next("s1")) { + if($sdpitval(s1)=~"abc") { + sdp_iterator_rm("s1"); + } + } + sdp_iterator_end("s1"); +... + + +
+
+ + <function moreinfo="none">sdp_iterator_append(iname, text)</function> + + + Add text after the line at the current iterator possition. + + + The parameters can be dynamic strings with variables. + + + This function can be used from ANY_ROUTE. + + + <function>sdp_iterator_append</function> usage + +... + sdp_iterator_start("s1"); + while(sdp_iterator_next("s1")) { + if($sdpitval(s1)=~"^a=info:xyz") { + sdp_iterator_append("s1", "a=info:abc\r\n"); + break; + } + } + sdp_iterator_end("s1"); +... + + +
+
+ + <function moreinfo="none">sdp_iterator_insert(iname, text)</function> + + + Add text before the line at the current iterator possition. + + + The parameters can be dynamic strings with variables. + + + This function can be used from ANY_ROUTE. + + + <function>sdp_iterator_insert</function> usage + +... + sdp_iterator_start("s1"); + while(sdp_iterator_next("s1")) { + if($sdpitval(s1)=~"^a=info:xyz") { + sdp_iterator_insert("s1", "a=info:abc\r\n"); + break; + } + } + sdp_iterator_end("s1"); +... + + +
@@ -622,6 +789,11 @@ if(is_method("INVITE") && has_body("application/sdp")){ Exported pseudo-variables are also documented at &kamwikilink;
+
+ <varname>$sdpitval( )</varname> + Return the value of to SDP line iterator with the given + name: $sdpitval(name). +