Module: sip-router
Branch: master
Commit: 2cf0bb2cf1b98ea54c0085a48da27e0db0f9d522
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2cf0bb2…
Author: Carsten Bock <lists(a)bock.info>
Committer: Carsten Bock <lists(a)bock.info>
Date: Wed Jan 6 16:38:04 2010 +0100
According to the docs, stream2uac / stream2uas should accept a "-1" as a valid
parameter, in order to repeat forever. With the old conversion, a value of "-1"
would be considered invalid.
Credits go to Min Wang (wang(a)basis-audionet.com) for finding and fixing this.
---
modules_k/nathelper/rtpproxy_stream.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules_k/nathelper/rtpproxy_stream.c
b/modules_k/nathelper/rtpproxy_stream.c
index 437cc5c..520bd2d 100644
--- a/modules_k/nathelper/rtpproxy_stream.c
+++ b/modules_k/nathelper/rtpproxy_stream.c
@@ -38,7 +38,6 @@
int
fixup_var_str_int(void **param, int param_no)
{
- unsigned long go_to;
int ret;
pv_elem_t *model;
str s;
@@ -57,10 +56,14 @@ fixup_var_str_int(void **param, int param_no)
}
*param = (void *)model;
} else if (param_no == 2) {
- go_to = str2s(*param, strlen(*param), &ret);
- if (ret == 0) {
+ /* According to
+ *
http://www.kamailio.org/docs/modules/1.5.x/nathelper.html#rtpproxy_stream2x…
+ * this could be -1 */
+ s.s = (char *)(*param);
+ s.len = strlen(s.s);
+ if (str2sint(&s, &ret)==0) {
pkg_free(*param);
- *param = (void *)go_to;
+ *param = (void *)ret;
} else {
LM_ERR("bad number <%s>\n", (char *)(*param));
return E_CFG;