Module: sip-router
Branch: master
Commit: 4e4069330fd44e454c7db19b5d944dbe4ca46a39
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4e40693…
Author: pd <peter.dunkley(a)crocodile-rcs.com>
Committer: pd <peter.dunkley(a)crocodile-rcs.com>
Date: Fri Oct 14 13:55:24 2011 +0100
modules/app_lua: Fix to lua_sr_pv_is_null()
- Previously this function returned an error when it could not retrieve the pv
(for example if it did not exist). As Lua is not a language in which you
have to declare variables not existing is equivalent to NULL. This function
now treats a pv that does not exist as NULL.
---
modules/app_lua/app_lua_sr.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/app_lua/app_lua_sr.c b/modules/app_lua/app_lua_sr.c
index 1271ba2..3a2bf72 100644
--- a/modules/app_lua/app_lua_sr.c
+++ b/modules/app_lua/app_lua_sr.c
@@ -1081,8 +1081,9 @@ static int lua_sr_pv_is_null (lua_State *L)
memset(&val, 0, sizeof(pv_value_t));
if(pv_get_spec_value(env_L->msg, &pvs, &val) != 0)
{
- LM_ERR("unable to get pv value for [%s]\n", pvn.s);
- return 0;
+ LM_NOTICE("unable to get pv value for [%s]\n", pvn.s);
+ lua_pushboolean(L, 1);
+ return 1;
}
if(val.flags&PV_VAL_NULL)
{
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#167 - $hdr(SomeHeader)[$var(i)] fails when $var(i) is 0
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Not a bug
Additional comments about closing: Invalid for our project.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=167
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#167 - $hdr(SomeHeader)[$var(i)] fails when $var(i) is 0
User who did this - Daniel-Constantin Mierla (miconda)
----------
I tested and it works fine with master branch. Very likely the bug does not affect our project, it was quite a lot of refactoring to pseudo-variables in kamailio since v1.4.x, which I guess it is the core still in place for the other project that forked at that time.
I am closing the bug as invalid. Re-open and paste here the error messages that you get in case you test and find problems.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=167#comment303
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.
Daniel-Constantin Mierla has taken ownership of the following task:
FS#167 - $hdr(SomeHeader)[$var(i)] fails when $var(i) is 0
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=167
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.
A new Flyspray task has been opened. Details are below.
User who did this - Walter Doekes (wdoekes)
Attached to Project - sip-router
Summary - $hdr(SomeHeader)[$var(i)] fails when $var(i) is 0
Task Type - Bug Report
Category - Module
Status - Unconfirmed
Assigned To -
Operating System - All
Severity - Low
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - Hi,
when using $hdr(SomeHeader)[0], you get the 0th index.
when using $hdr(SomeHeadeR)[$var(i)] when $var(i) is 0, you get an error.
Reported initially for opensips:
https://sourceforge.net/tracker/?func=detail&aid=3423601&group_id=232389&at…
I haven't tested the code in kamailio, but I saw the same pattern. It looks very much like you're affected as well.
Regards,
Walter Doekes
OSSO B.V.
P.S. You'll want to remove the C++-style comments from the patch obviously. They're there for clarification only.
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=167
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.
Hey Guys,
sipcapture is failing to build on Solaris. I am just dumping the trace here
as I don't have time to look at it now. I will however take a look when I
get a chance.
CC (gcc) [M sipcapture.so] sipcapture.o
In file included from sipcapture.c:76:
sipcapture.h:28: error: syntax error before "u_int8_t"
sipcapture.h:28: warning: no semicolon at end of struct or union
sipcapture.h:29: warning: type defaults to `int' in declaration of `hp_l'
sipcapture.h:29: warning: data definition has no type or storage class
sipcapture.h:30: error: syntax error before "hp_f"
sipcapture.h:30: warning: type defaults to `int' in declaration of `hp_f'
sipcapture.h:30: warning: data definition has no type or storage class
sipcapture.h:31: error: syntax error before "hp_p"
sipcapture.h:31: warning: type defaults to `int' in declaration of `hp_p'
sipcapture.h:31: warning: data definition has no type or storage class
sipcapture.h:32: error: syntax error before "hp_sport"
sipcapture.h:32: warning: type defaults to `int' in declaration of
`hp_sport'
sipcapture.h:32: warning: data definition has no type or storage class
sipcapture.h:33: error: syntax error before "hp_dport"
sipcapture.h:33: warning: type defaults to `int' in declaration of
`hp_dport'
sipcapture.h:33: warning: data definition has no type or storage class
sipcapture.c: In function `mod_init':
sipcapture.c:469: error: `IPPROTO_IPIP' undeclared (first use in this
function)
sipcapture.c:469: error: (Each undeclared identifier is reported only once
sipcapture.c:469: error: for each function it appears in.)
sipcapture.c: In function `hep_msg_received':
sipcapture.c:638: error: invalid application of `sizeof' to incomplete type
`hep_hdr'
sipcapture.c:648: error: dereferencing pointer to incomplete type
sipcapture.c:658: error: dereferencing pointer to incomplete type
sipcapture.c:658: error: dereferencing pointer to incomplete type
sipcapture.c:658: error: dereferencing pointer to incomplete type
sipcapture.c:658: error: dereferencing pointer to incomplete type
sipcapture.c:658: error: dereferencing pointer to incomplete type
sipcapture.c:663: error: dereferencing pointer to incomplete type
sipcapture.c:663: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:664: error: dereferencing pointer to incomplete type
sipcapture.c:670: error: dereferencing pointer to incomplete type
sipcapture.c:671: error: dereferencing pointer to incomplete type
sipcapture.c:672: error: dereferencing pointer to incomplete type
sipcapture.c:677: error: dereferencing pointer to incomplete type
sipcapture.c:677: error: dereferencing pointer to incomplete type
sipcapture.c:677: error: dereferencing pointer to incomplete type
sipcapture.c:677: error: dereferencing pointer to incomplete type
sipcapture.c:677: error: dereferencing pointer to incomplete type
sipcapture.c:681: error: invalid application of `sizeof' to incomplete type
`hep_hdr'
sipcapture.c:688: error: dereferencing pointer to incomplete type
sipcapture.c:712: error: dereferencing pointer to incomplete type
sipcapture.c:733: error: dereferencing pointer to incomplete type
sipcapture.c:736: error: dereferencing pointer to incomplete type
sipcapture.c: In function `raw_capture_socket':
sipcapture.c:1333: error: `IPPROTO_IPIP' undeclared (first use in this
function)
make[1]: *** [sipcapture.o] Error 1
make: *** [modules] Error 1
Cheers
Jason