Hi,
I would like to propose a patch in which the dialog duration displayed
in the cdrs is:
/0 -> timed-out not acknowledged dialogs
duration from creation to timeout -> timed-out acknowledged dialogs
/
I am still testing the solution for the master branch while tests pass
on a previous version.
Any comments on the code? (I am not particularly proud of the string
defines in the dlg_cb.h, but am unsure where to include some const
variable accessible to both acc and dialog to pass as calback param for
dialog expiration)
Thank you,
Lucian Balaceanu
Hello,
I have a problem with building hiredis + ndb_redis. The problem is with
hiredis rather than ndb_redis directly, but I am not sure how to best
handle it and would be grateful for any advice.
The problem is that somewhere with the recent Hiredis 0.13.0 release[1],
they came to use the following nested struct in the hiredis.h header:
---
/* Context for a connection to Redis */
typedef struct redisContext {
...
struct {
char *path;
} unix; /* line 158 */
...
} redisContext;
---
It appears the GNU compilers do not like the use of 'unix' as an identifier:
---
[root@proxy ndb_redis]# make
CC (gcc) [M ndb_redis.so] ndb_redis_mod.o
In file included from redis_client.h:27,
from ndb_redis_mod.c:38:
/usr/local/include/hiredis/hiredis.h:158: error: expected identifier or
‘(’ before numeric constant
make: *** [ndb_redis_mod.o] Error 1
---
Indeed, a quick test against a normal gcc installation on CentOS 6.6
reveals that 'unix' is a defined constant:
---
[root@proxy ~]# echo -e "#include <stdio.h>\n#include <stdlib.h>\nint
main() { printf(\"%d\\\n\", unix); return 1; }" > ns.c
[root@proxy ~]# make ns
cc ns.c -o ns
[root@proxy ~]# ./ns
1
---
The authors of hiredis themselves note this problem in a recent commit:
---
commit d8145d79ce715054980938c751067ebaa541573c
Author: Jan-Erik Rediger <janerik(a)fnordig.de>
Date: Thu Apr 16 22:51:32 2015 +0200
Always compile with C99 standard.
Turns out: gnu9x defines `unix` to 1, making it unusable as a variable
name.
---
So, their solution is to compile with -std=c99, which works fine.
The problem is that a) ndb_redis isn't compiled with -std=c99 and b) my
superficial effort at making it compile that way did not bear fruit:
---
[root@rproxy01 ndb_redis]# make MOD_CFLAGS='-fPIC -DPIC $(CFLAGS) -std=c99'
CC (gcc) [M ndb_redis.so] ndb_redis_mod.o
In file included from ../../parser/../mem/shm_mem.h:47,
from ../../parser/../ut.h:64,
from ../../parser/../ip_addr.h:50,
from ../../parser/msg_parser.h:61,
from ../../sr_module.h:62,
from ndb_redis_mod.c:32:
/usr/include/sys/ipc.h:25:3: warning: #warning "Files using this header
must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
In file included from ../../parser/../mem/../atomic/atomic_native.h:53,
from ../../parser/../mem/../futexlock.h:44,
from ../../parser/../mem/../lock_ops.h:85,
from ../../parser/../mem/shm_mem.h:75,
from ../../parser/../ut.h:64,
from ../../parser/../ip_addr.h:50,
from ../../parser/msg_parser.h:61,
from ../../sr_module.h:62,
from ndb_redis_mod.c:32:
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_inc_int’:
../../parser/../mem/../atomic/atomic_x86.h:226: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:226: error: (Each undeclared
identifier is reported only once
../../parser/../mem/../atomic/atomic_x86.h:226: error: for each function
it appears in.)
../../parser/../mem/../atomic/atomic_x86.h:226: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_dec_int’:
../../parser/../mem/../atomic/atomic_x86.h:227: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:227: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_and_int’:
../../parser/../mem/../atomic/atomic_x86.h:228: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:228: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_or_int’:
../../parser/../mem/../atomic/atomic_x86.h:229: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:229: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘atomic_inc_and_test_int’:
../../parser/../mem/../atomic/atomic_x86.h:230: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:230: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘atomic_dec_and_test_int’:
../../parser/../mem/../atomic/atomic_x86.h:231: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:231: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘atomic_get_and_set_int’:
../../parser/../mem/../atomic/atomic_x86.h:232: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:232: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘atomic_cmpxchg_int’:
../../parser/../mem/../atomic/atomic_x86.h:233: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:233: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_add_int’:
../../parser/../mem/../atomic/atomic_x86.h:234: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:234: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_inc_long’:
../../parser/../mem/../atomic/atomic_x86.h:236: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:236: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_dec_long’:
../../parser/../mem/../atomic/atomic_x86.h:237: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:237: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_and_long’:
../../parser/../mem/../atomic/atomic_x86.h:238: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:238: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_or_long’:
../../parser/../mem/../atomic/atomic_x86.h:239: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:239: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘atomic_inc_and_test_long’:
../../parser/../mem/../atomic/atomic_x86.h:240: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:240: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘atomic_dec_and_test_long’:
../../parser/../mem/../atomic/atomic_x86.h:241: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:241: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘atomic_get_and_set_long’:
../../parser/../mem/../atomic/atomic_x86.h:242: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:242: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘atomic_cmpxchg_long’:
../../parser/../mem/../atomic/atomic_x86.h:243: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:243: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘atomic_add_long’:
../../parser/../mem/../atomic/atomic_x86.h:244: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:244: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘mb_atomic_set_int’:
../../parser/../mem/../atomic/atomic_x86.h:299: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:299: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘mb_atomic_set_long’:
../../parser/../mem/../atomic/atomic_x86.h:312: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:312: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function ‘mb_atomic_get_int’:
../../parser/../mem/../atomic/atomic_x86.h:331: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:331: error: expected ‘;’
before ‘volatile’
../../parser/../mem/../atomic/atomic_x86.h: In function
‘mb_atomic_get_long’:
../../parser/../mem/../atomic/atomic_x86.h:342: error: ‘asm’ undeclared
(first use in this function)
../../parser/../mem/../atomic/atomic_x86.h:342: error: expected ‘;’
before ‘volatile’
In file included from ../../parser/../mem/../lock_ops.h:85,
from ../../parser/../mem/shm_mem.h:75,
from ../../parser/../ut.h:64,
from ../../parser/../ip_addr.h:50,
from ../../parser/msg_parser.h:61,
from ../../sr_module.h:62,
from ndb_redis_mod.c:32:
../../parser/../mem/../futexlock.h: In function ‘futex_get’:
../../parser/../mem/../futexlock.h:110: warning: implicit declaration of
function ‘syscall’
ndb_redis_mod.c: At top level:
../../parser/parse_param.h:156: warning: inline function ‘parse_param’
declared but never defined
make: *** [ndb_redis_mod.o] Error 1
---
There are two separate problems here:
1) My invocation of 'make' above may betray an insufficient
understanding the Makefile chain & build process. Is there something I'm
doing wrong there?
2) In choosing to work around the issue this way, hiredis has imposed
the requirement on GNU C users to compile any applications utilising
hiredis with C99 themselves. This doesn't seem like a good solution. Is
there a more 'elegant' fix here? It seems to me they ought to rename
that 'unix' struct member.
The blame-worthy hiredis commit seems to be this one:
---
commit d9e0b0f6abfbb8918f73607bdfcc707d0df3fd41
Author: Jan-Erik Rediger <janerik(a)fnordig.de>
Date: Thu Apr 16 19:28:12 2015 +0200
Implement a reconnect method for the client context
Originally implemented by @abedra as part of #306.
In case a write or read times out, we force an error state, because we
can't guarantuee that the next read will get the right data.
Instead we need to reconnect to have a clean-state connection, which is
now easily possible with this method.
i.e.
/* Context for a connection to Redis */
typedef struct redisContext {
int err; /* Error flags, 0 when there is no error */
@@ -136,6 +141,20 @@ typedef struct redisContext {
int flags;
char *obuf; /* Write buffer */
redisReader *reader; /* Protocol reader */
+
+ enum redisConnectionType connection_type;
+ struct timeval *timeout;
+
+ struct {
+ char *host;
+ char *source_addr;
+ int port;
+ } tcp;
+
+ struct {
+ char *path;
+ } unix;
+
} redisContext;
---
Reverting to the parent commit,
b872919463fbc04c3a8fde113cb9ae89dfcb3859, seems to fix the problem.
That's my workaround for now.
Thanks!
-- Alex
[1] Around 16 Apr 2015.
--
Alex Balashov | Principal | Evariste Systems LLC
303 Perimeter Center North, Suite 300
Atlanta, GA 30346
United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Hi, I am trying to develop module for Kamailio and I am wondering how to
change some of SDP fields.
I have function where I cast `sip_msg`'s `body` to `sdp_info` structure and
within this function I am changing some fields in `sessions` and `streams`
list.
I am able to see changes when I am printing them after message leaves the
function but Kamailio sends the original message not the changed one. Do I
need somehow let the Kamailio know that the message was changed and it
should rebuild `buf` field? Or I need to change directly `buf` field within
`sip_msg`?
If you need some more details to be able to help me with my problem please
ask freely. Or maybe if I need to rephrase my problem just let me know.
Thanks in advance
Module: kamailio
Branch: master
Commit: 294427ca8343391616b1db6be670a7acb66b069c
URL: https://github.com/kamailio/kamailio/commit/294427ca8343391616b1db6be670a7a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-04-28T15:21:58+02:00
mi_fifo: updated documentation for fifo_name parameter
---
Modified: modules/mi_fifo/README
Modified: modules/mi_fifo/doc/mi_fifo_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/294427ca8343391616b1db6be670a7a…
Patch: https://github.com/kamailio/kamailio/commit/294427ca8343391616b1db6be670a7a…
---
diff --git a/modules/mi_fifo/README b/modules/mi_fifo/README
index ed42377..a9a8303 100644
--- a/modules/mi_fifo/README
+++ b/modules/mi_fifo/README
@@ -111,9 +111,15 @@ Chapter 1. Admin Guide
4.1. fifo_name (string)
The name of the FIFO file to be created for listening and reading
- external commands.
+ external commands. If the value is a file name or does not start with
+ '/', the FIFO file is created in the 'run_dir'. The 'run_dir' is a core
+ parameter that can specify where to create runtime files, its default
+ value is '/var/run/kamailio/'.
- Default value is NONE.
+ Default value is 'Kamailio_fifo'.
+
+ The full path used by default for FIFO file is
+ '/var/run/kamailio/Kamailio_fifo'
Example 1.1. Set fifo_name parameter
...
diff --git a/modules/mi_fifo/doc/mi_fifo_admin.xml b/modules/mi_fifo/doc/mi_fifo_admin.xml
index 714772d..4b25035 100644
--- a/modules/mi_fifo/doc/mi_fifo_admin.xml
+++ b/modules/mi_fifo/doc/mi_fifo_admin.xml
@@ -86,13 +86,20 @@
<title><varname>fifo_name</varname> (string)</title>
<para>
The name of the FIFO file to be created for listening and
- reading external commands.
+ reading external commands. If the value is a file name or does
+ not start with '/', the FIFO file is created in the 'run_dir'. The
+ 'run_dir' is a core parameter that can specify where to create
+ runtime files, its default value is '/var/run/kamailio/'.
</para>
<para>
<emphasis>
- Default value is NONE.
+ Default value is '&kamailio;_fifo'.
</emphasis>
</para>
+ <para>
+ The full path used by default for FIFO file is
+ '/var/run/kamailio/&kamailio;_fifo'
+ </para>
<example>
<title>Set <varname>fifo_name</varname> parameter</title>
<programlisting format="linespecific">