Module: sip-router
Branch: master
Commit: a4bdf3c9c951e052b2db1d3967999f662b7438a5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a4bdf3c…
Author: Klaus Darilion <klaus.mailinglists(a)pernau.at>
Committer: Klaus Darilion <klaus.mailinglists(a)pernau.at>
Date: Wed Sep 8 14:57:48 2010 +0200
improve documentation of is_direction() function
---
modules_k/rr/README | 45 +++++++++++++++++++++-------------------
modules_k/rr/doc/rr_admin.xml | 20 ++++++++++--------
2 files changed, 35 insertions(+), 30 deletions(-)
diff --git a/modules_k/rr/README b/modules_k/rr/README
index d4a7038..11ee6a9 100644
--- a/modules_k/rr/README
+++ b/modules_k/rr/README
@@ -241,7 +241,7 @@ modparam("rr", "add_username", 1)
5.5. check_route_param(re)
5.6. is_direction(dir)
-5.1. loose_route()
+5.1. loose_route()
The function performs routing of SIP requests which contain a route
set. The name is a little bit confusing, as this function also routes
@@ -275,7 +275,7 @@ modparam("rr", "add_username", 1)
loose_route();
...
-5.2. record_route() and record_route(string)
+5.2. record_route() and record_route(string)
The function adds a new Record-Route header field. The header field
will be inserted in the message before any other Record-Route header
@@ -293,7 +293,7 @@ loose_route();
record_route();
...
-5.3. record_route_preset(string)
+5.3. record_route_preset(string)
This function will put the string into Record-Route, don't use unless
you know what you are doing.
@@ -310,7 +310,7 @@ record_route();
record_route_preset("1.2.3.4:5090");
...
-5.4. add_rr_param(param)
+5.4. add_rr_param(param)
Adds a parameter to the Record-Route URI (param must be in
";name=value" format. The function may be called also before or after
@@ -329,7 +329,7 @@ record_route_preset("1.2.3.4:5090");
add_rr_param(";nat=yes");
...
-5.5. check_route_param(re)
+5.5. check_route_param(re)
The function checks if the URI parameters of the local Route header
(corresponding to the local server) matches the given regular
@@ -348,30 +348,33 @@ if (check_route_param("nat=yes")) {
}
...
-5.6. is_direction(dir)
+5.6. is_direction(dir)
- The function checks the flow direction of the request. As for checking
- it's used the "ftag" Route header parameter, the append_fromtag (see
- Section 4.2, "append_fromtag (integer)" module parameter must be
- enabled. Also this must be called only after loose_route() (see
- Section 5.1, " loose_route() ").
+ The function checks the flow direction of in-dialog requests. This
+ function uses the "ftag" prameter from the Route header, therefore the
+ append_fromtag (see Section 4.2, "append_fromtag (integer)" module
+ parameter must be enabled. Also this must be called only after
+ loose_route() (see Section 5.1, " loose_route() ").
The function returns true if the "dir" is the same with the request's
flow direction.
- The "downstream" (UAC to UAS) direction is relative to the initial
- request that created the dialog.
+ The "downstream" direction means that the request is in the same
+ direction as the initial request that created the dialog.
Meaning of the parameters is as follows:
* dir - string containing the direction to be checked. It may be
- "upstream" (from UAS to UAC) or "downstream" (UAC to UAS).
+ "upstream" (from callee to caller) or "downstream" (caller to
+ callee).
This function can be used from REQUEST_ROUTE.
Example 1.11. is_direction usage
...
-if (is_direction("upstream")) {
- xdbg("upstream request ($rm)\n");
+if (is_direction("downstream")) {
+ xdbg("in-dialog request from caller to callee (downstream) ($rm)\n");
+} else {
+ xdbg("in-dialog request from callee to caller (upstream) ($rm)\n");
}
...
@@ -408,7 +411,7 @@ Chapter 2. Developer Guide
1.4. get_route_param( msg, name, val)
1.5. register_rrcb( callback, param)
-1.1. add_rr_param( msg, param)
+1.1. add_rr_param( msg, param)
Adds a parameter to the requests's Record-Route URI (param must be in
";name=value" format).
@@ -421,7 +424,7 @@ Chapter 2. Developer Guide
* str* param - parameter to be added to the Record-Route header - it
must be in ";name=value" format.
-1.2. check_route_param( msg, re)
+1.2. check_route_param( msg, re)
The function checks for the request "msg" if the URI parameters of the
local Route header (corresponding to the local server) matches the
@@ -436,7 +439,7 @@ Chapter 2. Developer Guide
* regex_t* param - compiled regular expression to be checked against
the Route header parameters.
-1.3. is_direction( msg, dir)
+1.3. is_direction( msg, dir)
The function checks the flow direction of the request "msg". As for
checking it's used the "ftag" Route header parameter, the
@@ -452,7 +455,7 @@ Chapter 2. Developer Guide
* int dir - direction to be checked against. It may be
"RR_FLOW_UPSTREAM" or "RR_FLOW_DOWNSTREAM".
-1.4. get_route_param( msg, name, val)
+1.4. get_route_param( msg, name, val)
The function search in to the "msg"'s Route header parameters the
parameter called "name" and returns its value into "val". It must be
@@ -468,7 +471,7 @@ Chapter 2. Developer Guide
* str *val - returns the value of the searched Route header parameter
if found. It might be empty string if the parameter had no value.
-1.5. register_rrcb( callback, param)
+1.5. register_rrcb( callback, param)
The function register a new callback (along with its parameter). The
callback will be called when a loose route will be performed for the
diff --git a/modules_k/rr/doc/rr_admin.xml b/modules_k/rr/doc/rr_admin.xml
index 296daa4..24dee9b 100644
--- a/modules_k/rr/doc/rr_admin.xml
+++ b/modules_k/rr/doc/rr_admin.xml
@@ -396,9 +396,9 @@ if (check_route_param("nat=yes")) {
<title>
<function moreinfo="none">is_direction(dir)</function>
</title>
- <para>The function checks the flow direction of the request.
- As for checking it's used the <quote>ftag</quote> Route header
- parameter, the append_fromtag (see <xref linkend="append-fromtag-id"/>
+ <para>The function checks the flow direction of in-dialog requests.
+ This function uses the <quote>ftag</quote> prameter from the Route header,
+ therefore the append_fromtag (see <xref linkend="append-fromtag-id"/>
module parameter must be enabled. Also this must be called only after
loose_route() (see <xref linkend="loose-route-id"/>).
</para>
@@ -407,16 +407,16 @@ if (check_route_param("nat=yes")) {
the request's flow direction.
</para>
<para>
- The <quote>downstream</quote> (UAC to UAS) direction is relative to the
- initial request that created the dialog.
+ The <quote>downstream</quote> direction means that the request is in the same
+ direction as the initial request that created the dialog.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>dir</emphasis> - string containing the direction to be
- checked. It may be <quote>upstream</quote> (from UAS to UAC) or
- <quote>downstream</quote> (UAC to UAS).
+ checked. It may be <quote>upstream</quote> (from callee to caller) or
+ <quote>downstream</quote> (caller to callee).
</para>
</listitem>
</itemizedlist>
@@ -427,8 +427,10 @@ if (check_route_param("nat=yes")) {
<title><function>is_direction</function> usage</title>
<programlisting format="linespecific">
...
-if (is_direction("upstream")) {
- xdbg("upstream request ($rm)\n");
+if (is_direction("downstream")) {
+ xdbg("in-dialog request from caller to callee (downstream) ($rm)\n");
+} else {
+ xdbg("in-dialog request from callee to caller (upstream) ($rm)\n");
}
...
</programlisting>
Hi!
I just wanted to clone the repository via ssh:
$ git clone ssh://darilion@git.sip-router.org/sip-router
ssh: connect to host git.sip-router.org port 22: Connection timed out
Were there some changes how git is used over ssh?
Thanks
Klaus
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#87 - make install fails with a bash syntax error
User who did this - Dmitry Goncharov (Dmitry)
----------
Hmm, the tracker has spoiled indentation.
Find the same in the attachment.
----------
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=87#comment124
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#87 - make install fails with a bash syntax error
User who did this - Dmitry Goncharov (Dmitry)
----------
make install-sr-man runs w/o errors.
Adding a whitespace between "" and ; makes no difference.
The following is a verbose run which produces an error.
$ git diff |cat
diff --git a/Makefile b/Makefile
index 210d277..cdfc687 100644
--- a/Makefile
+++ b/Makefile
@@ -918,7 +918,7 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
fi; \
fi
@# other configs
- @for r in $(C_INSTALL_CFGS) ""; do \
+ for r in $(C_INSTALL_CFGS) ""; do \
if [ -n "$$r" ]; then \
if [ -f "$$r" ]; then \
n=`basename "$$r"` ; \
$
$
$ make install-cfg
Makefile.defs defs skipped
for r in ""; do \
if [ -n "$r" ]; then \
if [ -f "$r" ]; then \
n=`basename "$r"` ; \
sed -e "s#/usr/[^:]*lib/kamailio/modules\([:/\"]\)#/usr/local/lib/kamailio/modules\1#g" -e "s#/usr/[^:]*lib/kamailio/modules_k\([:/\"]\)#/usr/local/lib/kamailio/modules_k\1#g" \
< "$r" \
> "//etc/kamailio/$n.sample" ; \
chmod 644 "//etc/kamailio/$n.sample" ; \
if [ -z "" -a \
! -f "//etc/kamailio/$n" ]; \
then \
mv -f "//etc/kamailio/$n.sample" \
"//etc/kamailio/$n"; \
fi ; \
else \
echo "ERROR: $r not found" ; \
if [ 1 =hen \; then \
exit 1; \
fi ; \
fi ; \
fi ; \
done; true
/bin/sh: -c: line 18: syntax error near unexpected token `fi'
/bin/sh: -c: line 18: ` fi ; \'
make: *** [install-cfg] Error 1
$
Note, the line "if [ 1 =hen \; then \". This is the syntax error.
"hen" is a part of "then".
This run with the sed expression moved left a couple of tabs.
$ git diff | cat
diff --git a/Makefile b/Makefile
index 210d277..8ce9429 100644
--- a/Makefile
+++ b/Makefile
@@ -918,12 +918,12 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
fi; \
fi
@# other configs
- @for r in $(C_INSTALL_CFGS) ""; do \
+ for r in $(C_INSTALL_CFGS) ""; do \
if [ -n "$$r" ]; then \
if [ -f "$$r" ]; then \
n=`basename "$$r"` ; \
sed $(foreach m,$(modules_dirs),\
- -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
+ -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
< "$$r" \
> "$(cfg_prefix)/$(cfg_dir)$$n.sample" ; \
chmod 644 "$(cfg_prefix)/$(cfg_dir)$$n.sample" ; \
$
$
$
$ make install-cfg
Makefile.defs defs skipped
for r in ""; do \
if [ -n "$r" ]; then \
if [ -f "$r" ]; then \
n=`basename "$r"` ; \
sed -e "s#/usr/[^:]*lib/kamailio/modules\([:/\"]\)#/usr/local/lib/kamailio/modules\1#g" -e "s#/usr/[^:]*lib/kamailio/modules_k\([:/\"]\)#/usr/local/lib/kamailio/modules_k\1#g" \
< "$r" \
> "//etc/kamailio/$n.sample" ; \
chmod 644 "//etc/kamailio/$n.sample" ; \
if [ -z "" -a \
! -f "//etc/kamailio/$n" ]; \
then \
mv -f "//etc/kamailio/$n.sample" \
"//etc/kamailio/$n"; \
fi ; \
else \
echo "ERROR: $r not found" ; \
if [ 1 = then \then \
exit 1; \
fi ; \
fi ; \
fi ; \
done; true
/bin/sh: -c: line 18: syntax error near unexpected token `fi'
/bin/sh: -c: line 18: ` fi ; \'
make: *** [install-cfg] Error 1
$
The offending line is different.
"do" moved to the next line.
$ git diff | cat
diff --git a/Makefile b/Makefile
index 210d277..11531bf 100644
--- a/Makefile
+++ b/Makefile
@@ -918,7 +918,8 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
fi; \
fi
@# other configs
- @for r in $(C_INSTALL_CFGS) ""; do \
+ for r in $(C_INSTALL_CFGS) ""; \
+ do \
if [ -n "$$r" ]; then \
if [ -f "$$r" ]; then \
n=`basename "$$r"` ; \
$
$
$ make install-cfg
Makefile.defs defs skipped
for r in ""; \
do \
if [ -n "$r" ]; then \
if [ -f "$r" ]; then \
n=`basename "$r"` ; \
sed -e "s#/usr/[^:]*lib/kamailio/modules\([:/\"]\)#/usr/local/lib/kamailio/modules\1#g" -e "s#/usr/[^:]*lib/kamailio/modules_k\([:/\"]\)#/usr/local/lib/kamailio/modules_k\1#g" \
< "$r" \
> "//etc/kamailio/$n.sample" ; \
chmod 644 "//etc/kamailio/$n.sample" ; \
if [ -z "" -a \
! -f "//etc/kamailio/$n" ]; \
then \
mv -f "//etc/kamailio/$n.sample" \
"//etc/kamailio/$n"; \
fi ; \
else \
echo "ERROR: $r not found" ; \
if [ 1 = 1 ] ; then \
exit 1; \
fi ; \
fi ; \
fi ; \
done; true
# radius dictionary
touch //etc/kamailio//dictionary.kamailio
install -m 644 etc/dictionary.kamailio //etc/kamailio/
$
The offending line is okay.
Placing a space between , and \ in the sed expression makes the offending line syntactically correct.
The issue looks like a buffer overflow.
Also tried with bash-3.2.51. The result is the same.
HTH
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=87#comment123
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: master
Commit: 35c2d3cd07905fb15faffd289004e1f78c8cc60c
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=35c2d3c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Sep 8 12:30:19 2010 +0200
dispatcher(k): updated docs for ds_ping_method
- statement was obsoleted
- reported by klaus.lists at inode.at
---
modules_k/dispatcher/README | 4 ++--
modules_k/dispatcher/doc/dispatcher_admin.xml | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules_k/dispatcher/README b/modules_k/dispatcher/README
index b458910..39fb84e 100644
--- a/modules_k/dispatcher/README
+++ b/modules_k/dispatcher/README
@@ -431,8 +431,8 @@ Note
3.16. ds_ping_method (string)
With this Method you can define, with which method you want to probe
- the failed gateways. This method is only available, if compiled with
- the probing of failed gateways enabled.
+ the gateways. Pinging gateways feature depends on ds_ping_interval
+ parameter.
Default value is “OPTIONS”.
diff --git a/modules_k/dispatcher/doc/dispatcher_admin.xml b/modules_k/dispatcher/doc/dispatcher_admin.xml
index 592e7f9..90a8044 100644
--- a/modules_k/dispatcher/doc/dispatcher_admin.xml
+++ b/modules_k/dispatcher/doc/dispatcher_admin.xml
@@ -415,8 +415,8 @@ modparam("dispatcher", "force_dst", 1)
<section>
<title><varname>ds_ping_method</varname> (string)</title>
<para>
- With this Method you can define, with which method you want to probe the failed gateways.
- This method is only available, if compiled with the probing of failed gateways enabled.
+ With this Method you can define, with which method you want to probe the gateways.
+ Pinging gateways feature depends on ds_ping_interval parameter.
</para>
<para>
<emphasis>