GithubHelp home page GithubHelp logo

freeswitch / sofia-sip Goto Github PK

View Code? Open in Web Editor NEW
267.0 267.0 175.0 4.18 MB

Sofia-SIP is an open-source SIP User-Agent library, compliant with the IETF RFC3261 specification.

License: GNU Lesser General Public License v2.1

Makefile 0.83% M4 0.83% Batchfile 0.25% Shell 0.49% C 96.43% HTML 0.53% Awk 0.34% C++ 0.06% DIGITAL Command Language 0.03% Perl 0.04% sed 0.16%

sofia-sip's Introduction

sofia-sip's People

Contributors

adubovikov avatar andywolk avatar anthmfs avatar azzbcc avatar biiiang avatar briankwest avatar cdosoftei avatar crienzo avatar dyatsin avatar jakubkarolczyk avatar jlenk avatar lazedo avatar lucasmellos avatar mattst88 avatar micmac1 avatar mjerris avatar mochouinard avatar moises-silva avatar olafalejandro avatar pieerepi avatar prabhugithubme avatar quentusrex avatar s3rj1k avatar seven1240 avatar sjthomason avatar swk avatar tomponline avatar traud avatar traviscross avatar trevora-edge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sofia-sip's Issues

Crash on shutdown related to `pthread_key_delete()`

Hi,

I'm currently writing a SIP client using sofia (see https://source.puri.sm/Librem5/calls/-/merge_requests/270 if you're interested).
As it's a GTK application, I'm using libsofia-ua-glib (I'm mentioning this because I haven't yet managed write a "standalone" program that exhibits the same crash).

My problem happens because pthread_setspecific () is called on a key which has been destroyed by pthread_key_delete ()
as part of the cleanup after main() returns. pthread_setspecific () seems to be called from glib.

You can have a look at the following gdb session:

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/fortysixandtwo/git/calls/_build/tests/sip 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 3, __GI___pthread_key_create (key=0x555555599390, destr=0x7ffff7e85460) at pthread_key_create.c:28
28      pthread_key_create.c: No such file or directory.
(gdb) bt
#0  __GI___pthread_key_create (key=0x555555599390, destr=0x7ffff7e85460) at pthread_key_create.c:28
#1  0x00007ffff7eb85c7 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff7eb8bfa in g_private_get () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff7e85d5d in g_slice_alloc () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff7e5490e in g_hash_table_new_full () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7e77adb in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff7fe1fb2 in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffe7a8, env=env@entry=0x7fffffffe7b8) at dl-init.c:72
#7  0x00007ffff7fe20b9 in call_init (env=0x7fffffffe7b8, argv=0x7fffffffe7a8, argc=1, l=<optimized out>) at dl-init.c:30
#8  _dl_init (main_map=0x7ffff7ffe180, argc=1, argv=0x7fffffffe7a8, env=0x7fffffffe7b8) at dl-init.c:119
#9  0x00007ffff7fd30ca in _dl_start_user () at /lib64/ld-linux-x86-64.so.2
#10 0x0000000000000001 in  ()
#11 0x00007fffffffeaa8 in  ()
#12 0x0000000000000000 in  ()
(gdb) c
Continuing.

Breakpoint 1, __GI___pthread_setspecific (key=0, value=0x5555555998c0) at pthread_setspecific.c:33
33      pthread_setspecific.c: No such file or directory.
(gdb) c
Continuing.

Breakpoint 3, __GI___pthread_key_create (key=key@entry=0x7ffff5ee00cc <key>, destr=destr@entry=0x7ffff5edc670 <free_key_mem>) at pthread_key_create.c:28
28      pthread_key_create.c: No such file or directory.
(gdb) c
Continuing.

Breakpoint 1, __GI___pthread_setspecific (key=1, value=value@entry=0x5555555b9ea0) at pthread_setspecific.c:33
33      pthread_setspecific.c: No such file or directory.
(gdb) c
Continuing.

Breakpoint 2, main (argc=1, argv=0x7fffffffe7a8) at ../tests/test-sip.c:54
54        return 0;
(gdb) c
Continuing.

Breakpoint 4, __pthread_key_delete (key=0) at pthread_key_delete.c:29
29      pthread_key_delete.c: No such file or directory.
(gdb) bt
#0  __pthread_key_delete (key=0) at pthread_key_delete.c:29
#1  0x00007ffff6c84bfa in sofia_su_uniqueid_destructor () at /lib/libsofia-sip-ua.so.0
#2  0x00007ffff7fe2343 in _dl_fini () at dl-fini.c:138
#3  0x00007ffff6a764d7 in __run_exit_handlers
    (status=0, listp=0x7ffff6bf6718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#4  0x00007ffff6a7667a in __GI_exit (status=<optimized out>) at exit.c:139
#5  0x00007ffff6a5ed11 in __libc_start_main (main=
    0x555555563de0 <main>, argc=1, argv=0x7fffffffe7a8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe798)
    at ../csu/libc-start.c:342
#6  0x0000555555563e1a in _start ()
(gdb) c
Continuing.

Breakpoint 1, __GI___pthread_setspecific (key=0, value=0x5555555e2ff0) at pthread_setspecific.c:33
33      pthread_setspecific.c: No such file or directory.
(gdb) bt
#0  __GI___pthread_setspecific (key=0, value=0x5555555e2ff0) at pthread_setspecific.c:33
#1  0x00007ffff7eb8c7f in g_private_set () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff7e91140 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff7e86711 in g_slice_free1 () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff7e63317 in g_list_remove () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7419e97 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#6  0x00007ffff741aef9 in g_static_resource_fini () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#7  0x00007ffff7fe2343 in _dl_fini () at dl-fini.c:138
#8  0x00007ffff6a764d7 in __run_exit_handlers
    (status=0, listp=0x7ffff6bf6718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#9  0x00007ffff6a7667a in __GI_exit (status=<optimized out>) at exit.c:139
#10 0x00007ffff6a5ed11 in __libc_start_main (main=
    0x555555563de0 <main>, argc=1, argv=0x7fffffffe7a8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe798)
    at ../csu/libc-start.c:342
#11 0x0000555555563e1a in _start ()
(gdb) c
Continuing.
GLib (gthread-posix.c): Unexpected error from C library during 'pthread_setspecific': Invalid argument.  Aborting.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff6a5d537 in __GI_abort () at abort.c:79
#2  0x00007ffff7eb8592 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff7eb8c91 in g_private_set () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff7e91140 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7e86711 in g_slice_free1 () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff7e63317 in g_list_remove () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007ffff7419e97 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#8  0x00007ffff741aef9 in g_static_resource_fini () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#9  0x00007ffff7fe2343 in _dl_fini () at dl-fini.c:138
#10 0x00007ffff6a764d7 in __run_exit_handlers
    (status=0, listp=0x7ffff6bf6718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#11 0x00007ffff6a7667a in __GI_exit (status=<optimized out>) at exit.c:139
#12 0x00007ffff6a5ed11 in __libc_start_main (main=
    0x555555563de0 <main>, argc=1, argv=0x7fffffffe7a8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe798)
    at ../csu/libc-start.c:342
#13 0x0000555555563e1a in _start ()

Digging around the code I was wondering why pthread_key_delete () is even called at all and I think
the culprit is the done_once = 1 in
https://github.com/freeswitch/sofia-sip/blob/master/libsofia-sip-ua/su/su_uniqueid.c#L93

From a layman's point of view I would expect that it should be initialized to 0.
git blame tells me that change was introduced in 91a0c24 (but from a quick glance I didn't understand if there was a reason to initialize to 1).

Patch is incoming..

wrong format sip header of "Reason" to send 18x.

i try to send a 183 message with nua_respond,i want push a reason header there,like this

           nua_respond(tech_pvt->nh,
                  send_sip_code, p_send_sip_msg,
                  NUTAG_AUTOANSWER(0),
                  TAG_IF(sticky, NUTAG_PROXY(tech_pvt->record_route)),
                  TAG_IF(cid, SIPTAG_HEADER_STR(cid)),
                  SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
                  SOATAG_REUSE_REJECTED(1),
                  SOATAG_RTP_SELECT(1),
                  SOATAG_ADDRESS(tech_pvt->mparams.adv_sdp_audio_ip),
                  TAG_IF(call_info, SIPTAG_CALL_INFO_STR(call_info)),
                  TAG_IF(!zstr(extra_header), SIPTAG_HEADER_STR(extra_header)),
                  TAG_IF(switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote),
                         SIPTAG_HEADER_STR("X-FS-Support: " FREESWITCH_SUPPORT)),

                  TAG_IF(reason, SIPTAG_REASON_STR("SIP;cause=486;text=\"user busy\",Q.850;cause=17")),      // <----- this reason

                  TAG_IF(!zstr(session_id_header), SIPTAG_HEADER_STR(session_id_header)),
                  TAG_END());

This is what i'm hoping for:
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 0.0.0.0;branch=z9hG4bKmc088272DFSSg;received=0.0.0.0;rport=5060
sip:0.0.0.0;lr;vsf=AAAAABoNBQAGAgkKCAENeQwachsfBBwfBwAXMTI5;vst=AAAAABoPAQAHBAcCAQ4BcgkDbgAEHh8FBB4fBQIdCwcDNjA7dmlkZW8-
Call-ID: bccf3d78-1bc0-123b-4f8e-286ed488c9b2
From: sip:[email protected];tag=2U6peQZFH138a
To: sip:[email protected];tag=0012-126431-90ee161f42fec754
CSeq: 48941723 INVITE
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,REGISTER,INFO,UPDATE,PRACK,REFER,SUBSCRIBE,NOTIFY,MESSAGE
Contact: sip:0.0.0.0:5060
Require: 100rel
RSeq: 2
Reason: SIP;cause=486;text="user busy",Q.850;cause=17 <---------------Reason header style
P-Early-Media: sendrecv
P-Asserted-Service-Info: vrbt=10
Content-Length: 0

But that's what happened:
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 0.0.0.0;branch=z9hG4bKmc088272DFSSg;received=0.0.0.0;rport=5060
sip:0.0.0.0;lr;vsf=AAAAABoNBQAGAgkKCAENeQwachsfBBwfBwAXMTI5;vst=AAAAABoPAQAHBAcCAQ4BcgkDbgAEHh8FBB4fBQIdCwcDNjA7dmlkZW8-
Call-ID: bccf3d78-1bc0-123b-4f8e-286ed488c9b2
From: sip:[email protected];tag=2U6peQZFH138a
To: sip:[email protected];tag=0012-126431-90ee161f42fec754
CSeq: 48941723 INVITE
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,REGISTER,INFO,UPDATE,PRACK,REFER,SUBSCRIBE,NOTIFY,MESSAGE
Contact: sip:0.0.0.0:5060
Require: 100rel
RSeq: 2
Reason: SIP;cause=486;text="user busy" <-----------------Reason header style
Reason: Q.850;cause=17 <-----------------Reason header style

P-Early-Media: sendrecv
P-Asserted-Service-Info: vrbt=10
Content-Length: 0

I tried different approaches, but the effect was always the same:
SIPTAG_HEADER_STR("Reason: SIP;cause=486;text="user busy",Q.850;cause=17")
SIPTAG_REASON_STR("SIP;cause=486;text="user busy",Q.850;cause=17")
SIPTAG_REASON_STR("SIP;cause=486;text="user busy"\x2cQ.850;cause=17")
SIPTAG_REASON(sip_reason_make(nua_handle_get_home(tech_pvt->nh), "SIP;cause=486;text="user busy",Q.850;cause=17"))

They sliced up my string,two reason were sent separately,whether sofia can achieve the effect I want?

Broken build with libcheck >= 0.13.0

Quoted from signalwire/freeswitch#681

When building freeswitch in buildroot I see the following build failure.

Making all in s2check
make[8]: Entering directory '/home/buildroot/autobuild/instance-0/output-1/build/freeswitch-1.10.3/libs/sofia-sip/s2check'
	 COMPILE s2tcase.o
	 COMPILE s2base.o
	 COMPILE s2sip.o
	 COMPILE s2_localinfo.o
s2tcase.c: In function 's2_tcase_add_test':
s2tcase.c:60:27: warning: passing argument 2 of '_tcase_add_test' from incompatible pointer type [-Wincompatible-pointer-types]
       _tcase_add_test(tc, tf, name, signo, 0, start, end);
                           ^~
In file included from s2tcase.c:35:
/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-musleabihf/sysroot/usr/include/check.h:331:69: note: expected 'const TTest *' {aka 'const struct TTest *'} but argument is of type 'TFun' {aka 'void (*)(int)'}
 CK_DLL_EXP void CK_EXPORT _tcase_add_test(TCase * tc, const TTest * ttest,
                                                       ~~~~~~~~~~~~~~^~~~~
s2tcase.c:60:31: warning: passing argument 3 of '_tcase_add_test' makes integer from pointer without a cast [-Wint-conversion]
       _tcase_add_test(tc, tf, name, signo, 0, start, end);
                               ^~~~
In file included from s2tcase.c:35:
/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-musleabihf/sysroot/usr/include/check.h:332:47: note: expected 'int' but argument is of type 'const char *'
                                           int _signal, int allowed_exit_value,
                                           ~~~~^~~~~~~
s2tcase.c:60:7: error: too many arguments to function '_tcase_add_test'
       _tcase_add_test(tc, tf, name, signo, 0, start, end);
       ^~~~~~~~~~~~~~~
In file included from s2tcase.c:35:_tcase_add_test(tc, tf, name, signo, 0, start, end);
/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-musleabihf/sysroot/usr/include/check.h:331:27: note: declared here
 CK_DLL_EXP void CK_EXPORT _tcase_add_test(TCase * tc, const TTest * ttest,
                           ^~~~~~~~~~~~~~~

Freeswitch does not send out ACK if 180 is received immediately after 200

For the following case,

  1. Verto client makes an outgoing call, Freeswitch sends out SIP INVITE
  2. Freeswitch receives SIP 200 with SDP at 20:45:38.448156
  3. Freeswitch receives SIP 18x with SDP almost at the same time as 200 at 20:45:38.448484
  4. Freeswitch pre-answers the call

415f16d6-f6f7-11eb-bbd0-b7c8b33bf083 2021-08-06 20:45:38.436313 [NOTICE] [19984] sofia.c:7331 Pre-Answer sofia/external/1xxxxxxxxxx!
415f16d6-f6f7-11eb-bbd0-b7c8b33bf083 2021-08-06 20:45:38.436313 [DEBUG] [19984] switch_channel.c:3492 (sofia/external/12025267500) Callstate Change DOWN -> EARLY
nua.c:639 nua_ack() nua: nua_ack: entering
nua_stack.c:529 nua_signal() nua(0x7f4c14002d30): sent signal r_ack
nua.c:366 nua_handle_magic() nua: nua_handle_magic: entering
nua.c:366 nua_handle_magic() nua: nua_handle_magic: entering
nua_stack.c:569 nua_stack_signal() nua(0x7f4c14002d30): recv signal r_ack
nua_stack.c:271 nua_stack_event() nua(0x7f4c14002d30): event i_error 900 No response to ACK
nua_stack.c:359 nua_application_event() nua: nua_application_event: entering
nua.c:366 nua_handle_magic() nua: nua_handle_magic: entering

Freeswitch does not send out ACK and gets 200 transmissions and the call fails.

The change is to drop 18x in sofia if 200 is already received.

https://github.com/freeswitch/sofia-sip/blob/master/libsofia-sip-ua/nta/nta.c#L9451

I added the following code to drop the 18x if 200 is already received.

 if (status < 200) {
     SU_DEBUG_5(("nta: Received 1xx response for INVITE client transaction %d\n", status));
     SU_DEBUG_5(("original->orq_status %d, %p\n", original->orq_status, (void *)original));
     SU_DEBUG_5(("orq->orq_status %d, %p\n", orq->orq_status, (void *)orq));
    if (original == orq && original->orq_status == 200) {
        msg_destroy(msg);
        return 0;
    }

Does not compile with libssl-1.1

/usr/bin/ld: ../libsofia-sip-ua/.libs/libsofia-sip-ua.a(tport_type_ws.o): in function `tport_ws_deinit_primary':
tport_type_ws.c:(.text+0x45): undefined reference to `SSL_CTX_free'
/usr/bin/ld: ../libsofia-sip-ua/.libs/libsofia-sip-ua.a(tport_type_ws.o): in function `tport_ws_init_primary_secure':
tport_type_ws.c:(.text+0xd4c): undefined reference to `TLS_server_method'
/usr/bin/ld: tport_type_ws.c:(.text+0xd70): undefined reference to `SSL_CTX_new'
/usr/bin/ld: tport_type_ws.c:(.text+0xd99): undefined reference to `SSL_CTX_sess_set_remove_cb'
/usr/bin/ld: tport_type_ws.c:(.text+0xdd9): undefined reference to `tls_log_errors'
/usr/bin/ld: tport_type_ws.c:(.text+0xdf9): undefined reference to `SSL_CTX_set_options'
/usr/bin/ld: tport_type_ws.c:(.text+0xe14): undefined reference to `SSL_CTX_set_options'
/usr/bin/ld: tport_type_ws.c:(.text+0xe2f): undefined reference to `SSL_CTX_set_options'
/usr/bin/ld: tport_type_ws.c:(.text+0xe4a): undefined reference to `SSL_CTX_set_options'
/usr/bin/ld: tport_type_ws.c:(.text+0xe74): undefined reference to `SSL_CTX_use_certificate_chain_file'
/usr/bin/ld: tport_type_ws.c:(.text+0xe8e): undefined reference to `tls_log_errors'
/usr/bin/ld: tport_type_ws.c:(.text+0xeb3): undefined reference to `SSL_CTX_use_certificate_file'
/usr/bin/ld: tport_type_ws.c:(.text+0xecd): undefined reference to `tls_log_errors'
/usr/bin/ld: tport_type_ws.c:(.text+0xef7): undefined reference to `SSL_CTX_use_PrivateKey_file'
/usr/bin/ld: tport_type_ws.c:(.text+0xf11): undefined reference to `tls_log_errors'
/usr/bin/ld: tport_type_ws.c:(.text+0xf2c): undefined reference to `SSL_CTX_check_private_key'
/usr/bin/ld: tport_type_ws.c:(.text+0xf46): undefined reference to `tls_log_errors'
/usr/bin/ld: tport_type_ws.c:(.text+0xf65): undefined reference to `SSL_CTX_set_cipher_list'
/usr/bin/ld: tport_type_ws.c:(.text+0xf7f): undefined reference to `tls_log_errors'
/usr/bin/ld: ../libsofia-sip-ua/.libs/libsofia-sip-ua.a(ws.o): in function `sha1_digest':
ws.c:(.text+0x32d): undefined reference to `SHA1_Init'
/usr/bin/ld: ws.c:(.text+0x34f): undefined reference to `SHA1_Update'
/usr/bin/ld: ws.c:(.text+0x362): undefined reference to `SHA1_Final'
/usr/bin/ld: ../libsofia-sip-ua/.libs/libsofia-sip-ua.a(ws.o): in function `ws_raw_read':
ws.c:(.text+0xd60): undefined reference to `SSL_read'
/usr/bin/ld: ws.c:(.text+0xd85): undefined reference to `SSL_get_error'
/usr/bin/ld: ../libsofia-sip-ua/.libs/libsofia-sip-ua.a(ws.o): in function `ws_raw_write':
ws.c:(.text+0xf6e): undefined reference to `SSL_write'
/usr/bin/ld: ws.c:(.text+0x1002): undefined reference to `SSL_get_error'
/usr/bin/ld: ../libsofia-sip-ua/.libs/libsofia-sip-ua.a(ws.o): in function `establish_logical_layer':
ws.c:(.text+0x123a): undefined reference to `SSL_new'
/usr/bin/ld: ws.c:(.text+0x1286): undefined reference to `SSL_set_fd'
/usr/bin/ld: ws.c:(.text+0x1296): undefined reference to `SSL_accept'
/usr/bin/ld: ws.c:(.text+0x12e3): undefined reference to `SSL_get_error'
/usr/bin/ld: ../libsofia-sip-ua/.libs/libsofia-sip-ua.a(ws.o): in function `ws_destroy':
ws.c:(.text+0x15bf): undefined reference to `SSL_shutdown'
/usr/bin/ld: ws.c:(.text+0x15dd): undefined reference to `SSL_get_error'
/usr/bin/ld: ws.c:(.text+0x15f2): undefined reference to `SSL_free'
collect2: error: ld returned 1 exit status

build warnings

I already fixed some build warnings in #92

the following warnings seems from the new identity change which I'm not sure.

sip_basic.c:2885:15: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          uri = pp + 1;
              ^ ~~~~~~
sip_basic.c:2905:40: warning: passing 'msg_param_t **' (aka 'const char ***') to parameter of type 'const msg_param_t **' (aka 'const char *const **') discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
          if (msg_params_d(home, &ext, &params) >= 0) {
                                       ^~~~~~~
./../msg/sofia-sip/msg_parser.h:280:27: note: passing argument to parameter 'return_params' here
                                  msg_param_t const **return_params);

Many missing files when compiling libsofia_sip_ua_static with VS 2017

I'm trying to compile libsofia_sip_ua_static with VS 2017.
in version sofia-sip-1.13.3 many files are missing
in version sofia-sip-1.12.11 the files have been present

I tried to understand when and why they have been deleted but had no luck with:
git log --full-history -1 -- libsofia-sip-ua\msg\sofia-sip\msg_protos.h
git log --full-history -1 -- libsofia-sip-ua\url\url_tag_ref.c

Any idea why the files are missing?

I'm also curious if you would like to update the *.vcxproj files or build instructions somehow since you do not include binary pthread (POSIX Threads for Windows) anymore?
In the old folder of sofia-sip-1.12.11\win32\pthread you included:

ChangeLog
md5.sum.txt
pthread.h
pthreadVC2.dll
pthreadVC2.lib
sched.h
semaphore.h

but now there isn't any reference where to get pthread from.
I suppose it's: https://sourceforge.net/projects/pthreads4w/files/

Here my compile log:

1>c1 : fatal error C1083: unable to open file (source): "..\..\libsofia-sip-ua\url\url_tag_ref.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\msg\sofia-sip\msg_header.h(312): fatal error C1083: Unable to open file (include): "sofia-sip/msg_protos.h": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\tport_tag_ref.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_port.h(547): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_uniqueid.c(85): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_port.h(547): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_port.h(547): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_root.c(46): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_port.h(547): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_port.h(547): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_log.c(46): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_localinfo.c(1385): error C2220: Warning is interpreted as error, no object file was generated.
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_localinfo.c(1385): warning C4456: declaration of "flags" hides previous local declaration
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_localinfo.c(1336): note: See declaration of "flags".
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_port.h(547): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_alloc_lock.c(40): fatal error C1083: Unable to open file (include): "pthread.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_alloc.c(933): error C2220: Warning is interpreted as error, no object file was generated.
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_alloc.c(933): warning C4456: declaration of "sub" hides previous local declaration
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\su\su_alloc.c(915): note: See declaration of "sub".
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\stun\stun_tag_ref.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\stun\stun_internal.h(55): fatal error C1083: Unable to open file (include): "openssl/sha.h": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\soa\soa_tag_ref.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\soa\soa.c(2382): error C2220: Warning is interpreted as error, no object file was generated.
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\soa\soa.c(2382): warning C4457: Declaration of "c" hides function parameter
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\soa\soa.c(2241): note: See declaration of "c".
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\soa\soa.c(2488): warning C4456: Declaration of "address" hides previous local declaration
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\soa\soa.c(2247): note: See declaration of "address".
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\sip_tag_ref.c": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\sip\sip_tag.c": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\sip\sip_parser_table.c": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\sdp\sdp_tag_ref.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nta\sofia-sip\nta_tag.h(42): fatal error C1083: Unable to open file (include): "sofia-sip/sip_tag.h": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\nua\nua_tag_ref.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\sofia-sip\nua_tag.h(48): fatal error C1083: Unable to open file (include): "sofia-sip/sip_tag.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_subnotref.c(48): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_session.c(43): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_server.c(45): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_registrar.c(46): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_register.c(47): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_publish.c(45): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_params.c(43): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_options.c(45): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_notifier.c(46): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_message.c(43): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_extension.c(43): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_event_server.c(44): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nua\nua_dialog.c(45): fatal error C1083: Unable to open file (include): "sofia-sip/sip_protos.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nta\sofia-sip\nta_tag.h(42): fatal error C1083: Unable to open file (include): "sofia-sip/sip_tag.h": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\nth\nth_tag_ref.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nth\sofia-sip\nth_tag.h(46): fatal error C1083: Unable to open file (include): "sofia-sip/http_tag.h": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nth\sofia-sip\nth_tag.h(46): fatal error C1083: Unable to open file (include): "sofia-sip/http_tag.h": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\nta\nta_tag_ref.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nta\sofia-sip\nta_tag.h(42): fatal error C1083: Unable to open file (include): "sofia-sip/sip_tag.h": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\nea\nea_tag_ref.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\nta\sofia-sip\nta_tag.h(42): fatal error C1083: Unable to open file (include): "sofia-sip/sip_tag.h": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\msg_mime_table.c": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\iptsec\auth_tag_ref.c": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\http\http_tag_ref.c": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\http\http_tag.c": No such file or directory
1>c1 : fatal error C1083: Unable to open file (source): "..\..\libsofia-sip-ua\http\http_parser_table.c": No such file or directory
1>e:\sofia-sip-1.13.3\libsofia-sip-ua\features\features.c(39): fatal error C1083: Unable to open file (include): "sofia-sip/sofia_features.h": No such file or directory

1.13.4: test suite is failing

Source tree configured with:

%configure \
        --disable-rpath \
        --disable-static \
        --disable-stun \
        --with-doxygen \

and test suite is failing with:

==============================================================
   sofia-sip 1.13.4: libsofia-sip-ua/sresolv/test-suite.log
==============================================================

# TOTAL: 3
# PASS:  1
# SKIP:  1
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: check_sres_sip
====================

Running suite(s): Unit tests for SIP URI resolver
89%: Checks: 19, Failures: 2, Errors: 0
check_sres_sip.c:809:F:1 - Test simple resolving:found_naptr3:0: Failure 'ai->ai_protocol != TPPROTO_TCP' occurred
check_sres_sip.c:901:F:1 - Test simple resolving:found_srv:0: Failure 'ai->ai_protocol != TPPROTO_TCP' occurred
FAIL check_sres_sip (exit status: 1)

SKIP: run_test_sresolv
======================

./run_test_sresolv: line 59: type: named: not found
test_sresolv: there is no BIND 9 named in you path, skipping
SKIP run_test_sresolv (exit status: 77)

============================================================================
Testsuite summary for sofia-sip 1.13.4
============================================================================
# TOTAL: 3
# PASS:  1
# SKIP:  1
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See libsofia-sip-ua/sresolv/test-suite.log
============================================================================
make[4]: *** [Makefile:931: test-suite.log] Error 1
make[4]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/sofia-sip-1.13.4/libsofia-sip-ua/sresolv'
make[3]: *** [Makefile:1039: check-TESTS] Error 2
make[2]: *** [Makefile:1127: check-am] Error 2
make[1]: *** [Makefile:613: check-recursive] Error 1

Please let me know if you need more details.

SIP 180 with 100rel is not PRACK'ed if it arrives after a 183

Scenario: freeswitch with 100rel enabled on sofia profile. A telco with some IMS on the back.

  • FreeSWITCH invites telco
  • Telco sends out 183/SDP which is PRACK'ed as expected
  • Telco sends out 180/SDP (in this scenario the SDP is the same as 183) and the message gets ignored, no PRACK
  • Telco continues sending 180 as expected
  • Telco aborts call because of PRACK timeout

Looking into the code a somewhat naive commit has been done in nua_session.c which is 0ebb555

This patch assumes that SIP status codes are sequential but they are not :)
The original problem https://freeswitch.org/jira/browse/FS-11452 was about a provisional response received after 200OK and was fixed with the above commit.

Since is ok to receive 180 after 183 (and even receiving a sequence of them!) I think that the above patch can be reworked to be more conservative in the original idea without breaking the above, lecit scenario.

Will submit a PR asap.

Build failure without openssl

Building sofia-sip without openssl will result in the following build failure:

In file included from tport_ws.h:43,
                 from tport_type_ws.c:38:
ws.h:26:10: fatal error: openssl/ssl.h: No such file or directory
 #include <openssl/ssl.h>
          ^~~~~~~~~~~~~~~

This build failure is due to the fact that nth unconditionally uses openssl since
5b4103a

As a result, configure.ac should be updated to disable nth if openssl is not found or the http module should only use openssl when it is available.

Genesys Cloud SIP integration with TLS fails when sofia global siptrace on

Genesys Cloud SIP trunk works fine when using TCP UDP. It also work when using TLS. It fails when using TLS and we have sofia global siptrace on. TCP dump shows connection reset with multiple retransmissions

fs-genesys-TLS-5061-TRACES_ON.txt

Freeswitch version affected : 1.10.5 and 1.10.7
Sofia version affected : 1.13.2 and 1.13.7-37

PORT STATE SERVICE
5061/tcp open sip-tls
| ssl-enum-ciphers:
| TLSv1.2:
| ciphers:
| TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - strong
| TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - strong
| TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - strong
| TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - strong
| TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - strong
| TLS_ECDHE_RSA_WITH_RC4_128_SHA - strong
| TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA - broken
| TLS_ECDH_anon_WITH_AES_128_CBC_SHA - broken
| TLS_ECDH_anon_WITH_AES_256_CBC_SHA - broken
| TLS_ECDH_anon_WITH_RC4_128_SHA - broken
| TLS_RSA_WITH_3DES_EDE_CBC_SHA - strong
| TLS_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_RSA_WITH_AES_128_CBC_SHA256 - strong
| TLS_RSA_WITH_AES_128_GCM_SHA256 - strong
| TLS_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_RSA_WITH_AES_256_CBC_SHA256 - strong
| TLS_RSA_WITH_AES_256_GCM_SHA384 - strong
| TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - strong
| TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - strong
| TLS_RSA_WITH_IDEA_CBC_SHA - weak
| TLS_RSA_WITH_RC4_128_SHA - strong
| TLS_RSA_WITH_SEED_CBC_SHA - strong
| compressors:
| NULL
|_ least strength: broken

How to force new TCP/TLS connection for every new outgoing call?

We are making outgoing calls to a load-balanced SBC which has two nodes. Since freeswitch is reusing the same open TCP/TLS socket to the SBC for every outgoing call, the load is not getting distributed across the two nodes of the SBC. All the calls are going to the same node.

If we can force each new call to use a different TCP connection, the load will get distributed evenly. Is there any configuration that makes this possible?

During FreeSWITCH shutdown, 410 responses prevent some client to retry requests

I noticed that during FreeSWITCH shutdown, some requests (both INVITEs and REGISTERs) are answered with a "410 Gone" response.
Maybe this is the code involved:

SR_STATUS1(sr, SIP_410_GONE); /* 410 terminates dialog */

I am facing some issues with some SIP endpoints that read the "410 Gone" (they get as a REGISTER response) as a user problem and specifically a user "permanent" problem.
So they stop sending out REGISTERs, and they don't register themselves anymore even if the server is up again.

RFC3161, §21.4.10

   The requested resource is no longer available at the server and no
   forwarding address is known.  This condition is expected to be
   considered permanent.  If the server does not know, or has no
   facility to determine, whether or not the condition is permanent, the
   status code 404 (Not Found) SHOULD be used instead.

In a case where the pending requests are dropped (due to a shutdown of the sip stack)... would not be better to "signal" this to the endpoints as a server "problem" thus with a 5xx-6xx response?

Thanks.

debian glib bindings

Hi! With the latest freeswitch 1.10.4 release it appears the debian-release repo now ships a binary for libsofia-sip-ua0 with a version number of 1.12.12-20~f5d44540d3~buster, and that usage of this library is required to run freeswitch (I get missing symbol errors in mod_sofia without it). debian10(buster) provides glib bindings for their version of libsofia-sip-ua0 via the libsofia-sip-ua-glib3 package, that some applications of interest (the osmocom cellular core network sip connector) depend on. These bindings are specific to the build of the library. Would this project be willing to re-enable glib bindings for their build to not break compatibility with other debian software? I can provide a pull request for this support, but wanted to open a tracking issue for discussion.

Thanks for your work supporting and keeping this library up to date-- the official debian version is quite old by comparison!

FreeSwitch 1.10.7 Crashs every day

Hello,

FreeSwitch crashs one or two times every 24 hours , the FS version is 1.10.7 ,the OS is centos 7 ,the only error messages in /var/log/messages is :
Apr 25 12:19:43 localhost systemd: freeswitch.service: main process exited, code=killed, status=8/FPE
Apr 25 12:19:43 localhost systemd: Unit freeswitch.service entered failed state.
Apr 25 12:19:43 localhost systemd: freeswitch.service failed.

Backtrace:

Core was generated by `/usr/local/fs1.10.7/bin/freeswitch -nonat'.
Program terminated with signal SIGFPE, Arithmetic exception.
#0 0x00007f1651eb87e8 in su_block_add () from /usr/local/lib/libsofia-sip-ua.so.0
[Current thread is 1 (LWP 45853)]

(gdb) where
#0 0x00007f36d8db1c3d in su_block_add (b=0x7f36945a3ce0, p=0x7f3694a73170) at su_alloc.c:339
#1 0x00007f36d8db21f2 in sub_alloc (home=0x7f36944eea20, sub=0x7f36945a3ce0, size=80,
zero=do_calloc) at su_alloc.c:527
#2 0x00007f36d8db3d2f in su_zalloc (home=0x7f36944eea20, size=80) at su_alloc.c:1574
#3 0x00007f36d8d3dcf9 in outgoing_make_a_aaaa_query (orq=0x7f36945a4a40) at nta.c:10343
#4 0x00007f36d8d3d32e in outgoing_resolve_next (orq=0x7f36945a4a40) at nta.c:10124
#5 0x00007f36d8d3eda7 in outgoing_answer_srv (orq=0x7f36945a4a40, q=0x7f36945a4c20,
answers=0x7f369411dfa0) at nta.c:10707
#6 0x00007f36d8da5fd9 in sres_query_report_error (q=0x7f36945a4c20, answers=0x7f369411dfa0)
at sres.c:2990
#7 0x00007f36d8da6368 in sres_resend_dns_query (res=0x7f3694002960, q=0x7f36945a4c20,
timeout=0) at sres.c:3090
#8 0x00007f36d8da725b in sres_resolver_report_error (res=0x7f3694002960, socket=129,
errcode=111, remote=0x7f36ab318450, remotelen=16,
info=0x7f36ab3183d0 "icmp type=3 code=3 reported by 127.0.0.1") at sres.c:3439
#9 0x00007f36d8da6f29 in sres_resolver_error (res=0x7f3694002960, socket=129) at sres.c:3353
#10 0x00007f36d8db078d in sres_sofia_poll (magic=0x7f36ac001180, w=0x7f3694000ff4,
reg=0x7f3694003790) at sresolv.c:357
#11 0x00007f36d8db69ac in su_epoll_port_wait_events (self=0x7f36940008c0, tout=0)
at su_epoll_port.c:510
#12 0x00007f36d8dbc17f in su_port_wait_events (self=0x7f36940008c0, timeout=0) at su_port.h:318
#13 0x00007f36d8dbd481 in su_root_yield (self=0x7f3694001130) at su_root.c:904
#14 0x00007f36d8d71ffd in nua_stack_timer (nua=0x7f36ac001180, t=0x7f36940011e0, a=0x0)
at nua_stack.c:739
#15 0x00007f36d8dc69f9 in su_timer_expire (timers=0x7f3694000908, timeout=0x7f36ab318cd8,
now=...) at su_timer.c:585
#16 0x00007f36d8db4ee2 in su_base_port_run (self=0x7f36940008c0) at su_base_port.c:339
#17 0x00007f36d8dbc1aa in su_port_run (self=0x7f36940008c0) at su_port.h:326
#18 0x00007f36d8dbd284 in su_root_run (self=0x7f3694001130) at su_root.c:819
#19 0x00007f36d8dbb933 in su_pthread_port_clone_main (varg=0x7f36d8abb4a0)
at su_pthread_port.c:343
#20 0x00007f36e6ec9e65 in start_thread () from /lib64/libpthread.so.0
#21 0x00007f36e651e88d in __libc_ifunc_impl_list () from /lib64/libc.so.6
#22 0x0000000000000000 in ?? ()

Thanks!

Why add assert for outgoing_timer_bf

assert(q->q_head != orq || (int32_t)(orq->orq_timeout - now) > 0);

assert(q->q_head != orq || (int32_t)(orq->orq_timeout - now) > 0) maybe failed if inserting same orq to queue when calling function flow like this: outgoing_timer_bf->outgoing_timeout->outgoing_try_another->outgoing_resolve_next->outgoing_prepare_send->outgoing_send->outgoing_trying->outgoing_queue.
So I have 2 questions about this code:

  1. Why add assert for outgoing_timer_bf?
  2. There are many asserts in sofia code that will abort process if assert failed. Why not print error/ warning log instead of assert?
    Thank you in advance!

No contact header with master

We're using sofia-sip in the osmo-sip-connector to connect our MSC (mobile switching center) to a SIP endpoint to handle voice calls.
We've implemented a test cases with TTCN-3 which can be found https://github.com/osmocom/osmo-ttcn3-hacks/blob/master/sip/SIP_Tests.ttcn

When linking against the latest debian version (1.12.11+20110422.1-2.1+b1) everything is fine.
The SIP INVITE contains an contact header which is generated by sofia.

When linking against the latest sofia-sip (git f6f29b4) the Contact header in the INVITE is missing and our test cases are failing.

@matt9j bisected the problem to afb119a. Reverting this commit on top of git f6f29b4 helps a little bit. The INVITE contains now a Contact header but the nua_callback() receive a half broken sip struct. Suddenly sip->sip_payload has invalid data (not NULL with broken pointer) while most of the other data in the sip struct is valid and correct.

SDP parser doesn't associate PTIME value with corresponding codec in SDP with multiple audio media entries

SOFIA-SIP SDP parser doesn't associate CODEC entry with corresponding PTIME value while parsing SDP with multiple audio media entries. Like for example:

m=audio [media_port] RTP/AVP 96 9 124 104 105 0 8 116 15 3 18 4 101
a=rtpmap:96 mpeg4-generic/0/0
a=fmtp:96 profile-level-id=0;mode=generic
a=rtpmap:9 G722/8000
a=ptime:20
a=rtpmap:124 iSAC/16000
a=rtpmap:104 G7221/16000
a=fmtp:104 bitrate=32000
a=ptime:60
a=rtpmap:105 G7221/16000
a=fmtp:105 bitrate=24000
a=ptime:60
a=rtpmap:0 PCMU/8000
a=ptime:40
a=rtpmap:8 PCMA/8000
a=ptime:20
a=rtpmap:116 iLBC/8000
a=ptime:60
a=maxptime:60
a=fmtp:116 mode=30
a=rtpmap:15 G728/8000
a=ptime:30
a=rtpmap:3 GSM/8000
a=ptime:20
a=rtpmap:4 G723/8000
a=ptime:30
a=rtpmap:18 G729/8000
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

As a result of that, it forces application code (like for example FreeSWITCH mod_sofia module) that uses parsed by SOFIA-SIP stack SDP to use the last PTIME value for any of the negotiated CODEC entries.

WSS errors because of SSL_Shutdown() after close()

Hello,

we have recognized issues when wss connections are closed and the socket is reused by another connection.

When looking at ws_destroy() in ws.c we can see that SSL_shutdown() is called after close() of a socket.
We also recognized that ws_destroy() is sometimes called far after ws_close().
But "SSL_shutdown() tries to send the close_notify shutdown alert to the peer" (from openssl docs).
To send the TLS close notify it uses the socket handle that is still stored in the ssl connection context. But since the socket is already closed its socket handle could be reused for another connection. So the TLS close notify will be send over the wrong connection.

With this bug we have seen invalid TLS packets on other WSS connections which breaks the new TLS session.
We have also seen invalid TLS packets on ESL connections. This will break proper receive handling of ESL events.

To solve these problems we think that SSL_shutodwn() must always be called before calling close() for the socket.

We have run some tests changing ws_close() to call SSL_shutdown() before closing the socket. This seems to fix all recognized problems.

Memory Leak on Invites with Content-Type: multipart/mixed

Hi,
we're using libsofia-1.13.3 and encountered a Memory Leak when Invites with Multipart Content are received. So we double-checked with the latest freeswitch (1.10.7-release-19) on debian 10 and found a similar leak.

Our Test: We're just sending invites with a large multipart content which are not further processed (Invite -> 407 ) and freeswitch memory consumption grows rapidly. I guess it's the same memory leak there as in our application.

We believe the leak is located near nua_session_server_init() @ nua_session.c where the msg_multipart_parse() function is called, which allocates some memory which seems not to be freed by the end of the session.

Is there someone here who can double-check this and let us know if it's safe to free the multipart memory, e.g. at the end of each call?

This can be triggered easily with sipp:

sipp -sf invite.xml -t t1 $remote-Server$ -r 10 -m 1000 -l 1000

with the following invite.xml:

invite.xml.txt

thanks for any hint.

Warning when using NUTAG_CALLSTATE_REF macros

Pass to get call state enum nua_callstate and receive warning.

warning: incompatible pointer types passing 'enum nua_callstate *' to parameter of type 'int *' [-Wincompatible-pointer-types]
        NUTAG_CALLSTATE_REF(state),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sofia-sip-1.13/sofia-sip/nua_tag.h:489:64: note: expanded from macro 'NUTAG_CALLSTATE_REF'
#define c(x) nutag_callstate_ref, tag_int_vr(&(x))
                                                               ^~~~
/usr/include/sofia-sip-1.13/sofia-sip/su_tag.h:183:39: note: passing argument to parameter 'vp' here
su_inline tag_value_t tag_int_vr(int *vp) { return (tag_value_t)vp; }

compilation warnings with GCC-11.2

make[4]: Entering directory '/home/src/sofia-sip/libsofia-sip-ua/su'
COMPILE addrinfo.o
LTCOMPILE su.lo
LTCOMPILE su_errno.lo
LTCOMPILE su_addrinfo.lo
LTCOMPILE su_alloc.lo
su_alloc.c:1893:38: warning: argument 1 of type ‘su_home_stat_t[1]’ with mismatched bound [-Warray-parameter=]
1893 | void su_home_stat_add(su_home_stat_t total[1], su_home_stat_t const hs[1])
| ~~~~~~~~~~~~~~~^~~~~~~~
In file included from su_alloc.c:186:
sofia-sip/su_alloc_stat.h:54:46: note: previously declared as ‘su_home_stat_t *’
54 | SU_DLL void su_home_stat_add(su_home_stat_t *total,
| ~~~~~~~~~~~~~~~~^~~~~
su_alloc.c:1893:69: warning: argument 2 of type ‘const su_home_stat_t[1]’ with mismatched bound [-Warray-parameter=]
1893 | void su_home_stat_add(su_home_stat_t total[1], su_home_stat_t const hs[1])
| ~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from su_alloc.c:186:
sofia-sip/su_alloc_stat.h:55:52: note: previously declared as ‘const su_home_stat_t *’
55 | su_home_stat_t const *hs);
| ~~~~~~~~~~~~~~~~~~~~~~^~
LTCOMPILE su_alloc_lock.lo

......

     LTCOMPILE su_timer.lo

In file included from su_timer.c:36:
sofia-sip/heap.h:163:54: warning: argument 2 of type ‘su_timer_queue_t[1]’ {aka ‘su_timer_ heap_t[1]’} with mismatched bound [-Warray-parameter=]
163 | scope int prefix##resize(void *realloc_arg, heaptype h[1], size_t new_size)
su_timer.c:211:1: note: in expansion of macro ‘HEAP_BODIES’
211 | HEAP_BODIES(su_inline, su_timer_queue_t, timers_, su_timer_t *,
| ^~~~~~~~~~~
su_timer.c:181:25: note: previously declared as ‘su_timer_queue_t *’ {aka ‘su_timer_heap_t *’}
181 | HEAP_DECLARE(su_inline, su_timer_queue_t, timers_, su_timer_t *);
sofia-sip/heap.h:112:34: note: in definition of macro ‘HEAP_DECLARE’
112 | scope int prefix##resize(void *, heaptype *, size_t);
| ^~~~~~~~
sofia-sip/heap.h:201:52: warning: argument 2 of type ‘su_timer_queue_t[1]’ {aka ‘su_timer_ heap_t[1]’} with mismatched bound [-Warray-parameter=]
201 | scope int prefix##free(void *realloc_arg, heaptype h[1])
su_timer.c:211:1: note: in expansion of macro ‘HEAP_BODIES’
211 | HEAP_BODIES(su_inline, su_timer_queue_t, timers_, su_timer_t *,
| ^~~~~~~~~~~
su_timer.c:181:25: note: previously declared as ‘su_timer_queue_t *’ {aka ‘su_timer_heap_t *’}
181 | HEAP_DECLARE(su_inline, su_timer_queue_t, timers_, su_timer_t *);
sofia-sip/heap.h:113:32: note: in definition of macro ‘HEAP_DECLARE’
113 | scope int prefix##free(void *, heaptype *); \

....

     LTCOMPILE su_localinfo.lo

su_localinfo.c:1171:40: warning: argument 1 of type ‘const su_localinfo_t[1]’ {aka ‘const struct su_localinfo_s[1]’} with mismatched bound [-Warray-parameter=]
1171 | int bsd_localinfo(su_localinfo_t const hints[1],
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
su_localinfo.c:78:26: note: previously declared as ‘const su_localinfo_t *’ {aka ‘const st ruct su_localinfo_s *’}
78 | static int bsd_localinfo(su_localinfo_t const *, su_localinfo_t **);

...

     LTCOMPILE sres.lo

In file included from sres.c:95:
sres.c:1714:33: warning: argument 2 of type ‘sres_qtable_t[]’ {aka ‘struct sres_qtable_s[] ’} with mismatched bound [-Warray-parameter=]
1714 | HTABLE_BODIES_WITH(sres_qtable, qt, sres_query_t, SRES_QUERY_HASH,
./../su/sofia-sip/htable.h:130:32: note: in definition of macro ‘HTABLE_BODIES_WITH’
130 | prefix##_t pr[],
| ^~
sres.c:383:33: note: previously declared as ‘sres_qtable_t[1]’ {aka ‘struct sres_qtable_s[ 1]’}
383 | HTABLE_PROTOS_WITH(sres_qtable, qt, sres_query_t, unsigned, size_t);
./../su/sofia-sip/htable.h:103:58: note: in definition of macro ‘HTABLE_PROTOS_WITH’
103 | HTABLE_SCOPE int prefix##_resize(su_home_t *, prefix##_t pr[1], size_t);
| ^~
LTCOMPILE sres_cache.lo
In file included from sres_cache.c:68:
sres_cache.c:656:33: warning: argument 2 of type ‘sres_htable_t[]’ {aka ‘struct sres_htabl e_s[]’} with mismatched bound [-Warray-parameter=]
656 | HTABLE_BODIES_WITH(sres_htable, ht, sres_rr_hash_entry_t, SRES_HENTRY_HASH,
./../su/sofia-sip/htable.h:130:32: note: in definition of macro ‘HTABLE_BODIES_WITH’
130 | prefix##_t pr[],
| ^~
sres_cache.c:139:33: note: previously declared as ‘sres_htable_t[1]’ {aka ‘struct sres_hta ble_s[1]’}
139 | HTABLE_PROTOS_WITH(sres_htable, ht, sres_rr_hash_entry_t, unsigned, size_t);
./../su/sofia-sip/htable.h:103:58: note: in definition of macro ‘HTABLE_PROTOS_WITH’
103 | HTABLE_SCOPE int prefix##resize(su_home_t *, prefix##t pr[1], size_t);
| ^~
In file included from sres_cache.c:69:
./../su/sofia-sip/heap.h:163:54: warning: argument 2 of type ‘sres_heap_t[1]’ with mismatc hed bound [-Warray-parameter=]
163 | scope int prefix##resize(void *realloc_arg, heaptype h[1], size_t new_size)
sres_cache.c:684:1: note: in expansion of macro ‘HEAP_BODIES’
684 | HEAP_BODIES(static inline,
| ^~~~~~~~~~~
sres_cache.c:93:29: note: previously declared as ‘sres_heap_t *’
93 | HEAP_DECLARE(static inline, sres_heap_t, sres_heap
, sres_rr_hash_entry_t *);
./../su/sofia-sip/heap.h:112:34: note: in definition of macro ‘HEAP_DECLARE’
112 | scope int prefix##resize(void *, heaptype *, size_t);
| ^~~~~~~~
./../su/sofia-sip/heap.h:201:52: warning: argument 2 of type ‘sres_heap_t[1]’ with mismatc hed bound [-Warray-parameter=]
201 | scope int prefix##free(void *realloc_arg, heaptype h[1])
sres_cache.c:684:1: note: in expansion of macro ‘HEAP_BODIES’
684 | HEAP_BODIES(static inline,
| ^~~~~~~~~~~
sres_cache.c:93:29: note: previously declared as ‘sres_heap_t *’
93 | HEAP_DECLARE(static inline, sres_heap_t, sres_heap
, sres_rr_hash_entry_t *);
./../su/sofia-sip/heap.h:113:32: note: in definition of macro ‘HEAP_DECLARE’
113 | scope int prefix##free(void *, heaptype *); \

.....

     LTCOMPILE msg_date.lo

msg_date.c: In function ‘time_d’:
msg_date.c:146:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
146 | if (!IS_LWS(s)) return -1; skip_lws(&s);
| ^~
In file included from msg_date.c:47:
./../bnf/sofia-sip/bnf.h:92:22: note: ...this statement, but the latter is misleadingly in dented as if it were guarded by the ‘if’
92 | #define skip_lws(ss) (
(ss) += span_lws(*(ss)))
| ^
msg_date.c:146:33: note: in expansion of macro ‘skip_lws’
146 | if (!IS_LWS(*s)) return -1; skip_lws(&s);
| ^~~~~~~~
msg_date.c: In function ‘msg_date_d’:
msg_date.c:251:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
251 | if (mon < 0 || !IS_LWS(*s)) return -1; s++;
| ^~
msg_date.c:251:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
251 | if (mon < 0 || !IS_LWS(*s)) return -1; s++;

.....

     LTCOMPILE sip_basic.lo

sip_basic.c: In function ‘sip_identity_d’:
sip_basic.c:2884:15: warning: assignment discards ‘const’ qualifier from pointer target ty pe [-Wdiscarded-qualifiers]
2884 | uri = pp + 1;
| ^
sip_basic.c:2906:40: warning: passing argument 3 of ‘msg_params_d’ from incompatible point er type [-Wincompatible-pointer-types]
2906 | if (msg_params_d(home, &ext, &params) >= 0) {
| ^~~~~~~
| |
| const char ***
In file included from sofia-sip/sip_parser.h:52,
from sip_basic.c:46:
./../msg/sofia-sip/msg_parser.h:280:55: note: expected ‘const char * const**’ but argument is of type ‘const char ***’
280 | msg_param_t const **return_params);
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~

.....

     LTCOMPILE http_parser.lo

http_parser.c: In function ‘http_method_d’:
http_parser.c:467:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentatio n]
467 | if (MATCH(s, "PUT")) code = http_method_put; break;
| ^~
http_parser.c:467:58: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
467 | if (MATCH(s, "PUT")) code = http_method_put; break;
| ^~~~~
http_parser.c:466:13: warning: this ‘else’ clause does not guard... [-Wmisleading-indentat ion]
466 | else
| ^~~~
http_parser.c:467:58: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
467 | if (MATCH(s, "PUT")) code = http_method_put; break;
| ^~~~~
LTCOMPILE http_header.lo
http_header.c: In function ‘http_request_complete’:
http_header.c:73:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
73 | if (!http->http_host)
| ^~
http_header.c:76:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
76 | for (pl = http->http_payload; pl; pl = pl->pl_next)
| ^~~

.....

             from stun.c:48:

/usr/include/openssl/ssl.h:1884:1: note: declared here
1884 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_client_method(void))
| ^~~~~~~~~~~~~~~~~~
In file included from stun.c:48:
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wun used-value]
90 | SU_DEBUG_5(("%s: %s: %s\n", func, #what, su_strerror(err))),
| ^
stun.c:1362:7: note: in expansion of macro ‘STUN_ERROR’
1362 | STUN_ERROR(errno, SSL_CTX_new);
| ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wun used-value]
90 | SU_DEBUG_5(("%s: %s: %s\n", func, #what, su_strerror(err))),
| ^
stun.c:1368:7: note: in expansion of macro ‘STUN_ERROR’
1368 | STUN_ERROR(errno, SSL_CTX_set_cipher_list);
| ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wun used-value]
90 | SU_DEBUG_5(("%s: %s: %s\n", func, #what, su_strerror(err))),
| ^
stun.c:1378:7: note: in expansion of macro ‘STUN_ERROR’
1378 | STUN_ERROR(err, connect);
| ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wun used-value]
90 | SU_DEBUG_5(("%s: %s: %s\n", func, #what, su_strerror(err))),
| ^
stun.c:1444:9: note: in expansion of macro ‘STUN_ERROR’
1444 | STUN_ERROR(errno, SSL_write);
| ^~~~~~~~~~
stun.c: In function ‘stun_bind_callback’:
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wun used-value]
90 | SU_DEBUG_5(("%s: %s: %s\n", func, #what, su_strerror(err))),
| ^
stun.c:1685:5: note: in expansion of macro ‘STUN_ERROR’
1685 | STUN_ERROR(err, recvfrom);
| ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wun used-value]
90 | SU_DEBUG_5(("%s: %s: %s\n", func, #what, su_strerror(err))),
| ^
stun.c:1690:5: note: in expansion of macro ‘STUN_ERROR’
1690 | STUN_ERROR(err, recvfrom);
| ^~~~~~~~~~
stun.c: In function ‘stun_sendto_timer_cb’:
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wun used-value]
90 | SU_DEBUG_5(("%s: %s: %s\n", func, #what, su_strerror(err))),
| ^
stun.c:2280:5: note: in expansion of macro ‘STUN_ERROR’
2280 | STUN_ERROR(errno, stun_sendto_timer_cb);
| ^~~~~~~~~~

.....

     LTCOMPILE nta.lo

In file included from nta.c:79:
nta.c:4164:32: warning: argument 2 of type ‘leg_htable_t[]’ {aka ‘struct leg_htable_s[]’} with mismatched bound [-Warray-parameter=]
4164 | HTABLE_BODIES_WITH(leg_htable, lht, nta_leg_t, HTABLE_HASH_LEG, size_t, hash_value _t);
./../su/sofia-sip/htable.h:130:32: note: in definition of macro ‘HTABLE_BODIES_WITH’
130 | prefix##_t pr[],
| ^~
nta.c:674:32: note: previously declared as ‘leg_htable_t[1]’ {aka ‘struct leg_htable_s[1]’ }
674 | HTABLE_PROTOS_WITH(leg_htable, lht, nta_leg_t, size_t, hash_value_t);
./../su/sofia-sip/htable.h:103:58: note: in definition of macro ‘HTABLE_PROTOS_WITH’
103 | HTABLE_SCOPE int prefix##_resize(su_home_t *, prefix##_t pr[1], size_t);
| ^~
nta.c:5289:37: warning: argument 2 of type ‘incoming_htable_t[]’ {aka ‘struct incoming_hta ble_s[]’} with mismatched bound [-Warray-parameter=]
5289 | HTABLE_BODIES_WITH(incoming_htable, iht, nta_incoming_t, HTABLE_HASH_IRQ,
./../su/sofia-sip/htable.h:130:32: note: in definition of macro ‘HTABLE_BODIES_WITH’
130 | prefix##_t pr[],
| ^~
nta.c:688:37: note: previously declared as ‘incoming_htable_t[1]’ {aka ‘struct incoming_ht able_s[1]’}
688 | HTABLE_PROTOS_WITH(incoming_htable, iht, nta_incoming_t, size_t, hash_value_t);
./../su/sofia-sip/htable.h:103:58: note: in definition of macro ‘HTABLE_PROTOS_WITH’
103 | HTABLE_SCOPE int prefix##_resize(su_home_t *, prefix##_t pr[1], size_t);
| ^~
nta.c:7265:37: warning: argument 2 of type ‘outgoing_htable_t[]’ {aka ‘struct outgoing_hta ble_s[]’} with mismatched bound [-Warray-parameter=]
7265 | HTABLE_BODIES_WITH(outgoing_htable, oht, nta_outgoing_t, HTABLE_HASH_ORQ,
./../su/sofia-sip/htable.h:130:32: note: in definition of macro ‘HTABLE_BODIES_WITH’
130 | prefix##_t pr[],
| ^~
nta.c:734:37: note: previously declared as ‘outgoing_htable_t[1]’ {aka ‘struct outgoing_ht able_s[1]’}
734 | HTABLE_PROTOS_WITH(outgoing_htable, oht, nta_outgoing_t, size_t, hash_value_t);
./../su/sofia-sip/htable.h:103:58: note: in definition of macro ‘HTABLE_PROTOS_WITH’
103 | HTABLE_SCOPE int prefix##_resize(su_home_t *, prefix##_t pr[1], size_t);
| ^~

.....

     LTCOMPILE nth_client.lo

In file included from nth_client.c:79:
nth_client.c:252:31: warning: argument 2 of type ‘hc_htable_t[]’ {aka ‘struct hc_htable_s[ ]’} with mismatched bound [-Warray-parameter=]
252 | HTABLE_BODIES_WITH(hc_htable, hct, nth_client_t, HTABLE_HASH_CLIENT,
./../su/sofia-sip/htable.h:130:32: note: in definition of macro ‘HTABLE_BODIES_WITH’
130 | prefix##t pr[],
| ^~
nth_client.c:243:31: note: previously declared as ‘hc_htable_t[1]’ {aka ‘struct hc_htable
s[1]’}
243 | HTABLE_PROTOS_WITH(hc_htable, hct, nth_client_t, uintptr_t, size_t);
./../su/sofia-sip/htable.h:103:58: note: in definition of macro ‘HTABLE_PROTOS_WITH’
103 | HTABLE_SCOPE int prefix##_resize(su_home_t *, prefix##_t pr[1], size_t);
| ^~

.....

     LTCOMPILE nua_stack.lo

nua_stack.c: In function ‘nua_stack_deinit’:
nua_stack.c:243:45: warning: extra tokens at end of #endif directive [-Wendif-labels]
243 | #endif /* End NRC Boston */}
| ^
nua_stack.c: At top level:
nua_stack.c:729:42: warning: argument 1 of type ‘su_msg_t *[1]’ {aka ‘struct su_msg_s *[1] ’} with mismatched bound [-Warray-parameter=]
729 | void nua_destroy_event(nua_saved_event_t saved[1])
| ~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from nua_stack.c:69:
sofia-sip/nua.h:378:55: note: previously declared as ‘su_msg_t **’ {aka ‘struct su_msg_s * *’}
378 | SOFIAPUBFUN void nua_destroy_event(nua_saved_event_t *saved);
| ~~~~~~~~~~~~~~~~~~~^~~~~

.....

Repo version tagging

Could we get some tags on the repo for versions?
E.g. v1.12.x or v1.13

Would help getting build automation to run cleaner for downstream use.

SUBSCRIBE missing Contact-header

I am creating a SIP SUBSCRIBE message via janus and noticed, that the SIP-packet created is missing a mandatory Contact-header line.

transport tls is not supported ?

On the current master (and also with the package available in debian 1.12.11)
I'm having trouble connecting securely (over tls) with a server.
The problem persists no matter which client/tool (sip-options, sofsip_cli, empathy or my own code) I'm using.

Running with SOFIA_DEBUG set I usually get errors like
nta(0x558295c0fef0): transport tls is not supported
or nta outgoing create: no transport protocol

Here you can find a sample session with sip-options

$ SOFIA_DEBUG=3 sip-options -a "sip:pbx-ext.chilly.cloud;transport=tls" 
nta(0x558295c0fef0): transport tls is not supported 
SIP/2.0 503 DNS Error 
Via: SIP/2.0/UDP 10.0.2.15:60666;branch=z9hG4bKDF709t04eX92F 
From: sip:10.0.2.15;tag=D1NHX8yrKrZFQ 
To: sip:pbx-ext.chilly.cloud;tag=eaFaZ3Fvg1N2j 
Call-ID: b5898b23-b898-1239-59a7-525400123456 
CSeq: 954232495 OPTIONS 
Content-Length: 0

It says DNS Error but I can't find any queries in my resolvers logs.

This time using the ip instead of domain name

$ SOFIA_DEBUG=3 sip-options -a "sip:208.97.62.12:5061;transport=tls"
nta outgoing create: no transport protocol
SIP/2.0 503 No transport
Via: SIP/2.0/UDP 10.0.2.15:60139;branch=z9hG4bKUcgvc8aregZ2r
From: sip:10.0.2.15;tag=Uv5c56r2ZKKBN
To: sip:208.97.62.12;tag=v5y56195vv9Xg
Call-ID: a6335111-b960-1239-bfb3-525400123456
CSeq: 954253963 OPTIONS
Content-Length: 0

connection failed WSS client using Sofia sip stack v1.13.6

Hello Team ,

     we are building WSS client in Android using sofia sip stack ,currently we are observing  issue in SSL ,tport connect below is the error thrown from the stack .

tport_tls.c:960 tls_connect() tls_connect(0x7f31b8065450): events CONNECTING
tport_tls.c:960 tls_connect() tls_connect(0x7f31b8065450): events NEGOTIATING
tport_tls.c:157 tls_log_errors() TLS setup failed: 00000001:(null):(null):(null)
tport_tls.c:157 tls_log_errors() TLS setup failed: 14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

Appreciate any solution for the above also suggest any samples for WSS client

Thanks in Advance .

Possibly broken ABI on minor version bump

Hello! I am trying to use a version of libsofia-sip-ua0 compatible with the latest freeswitch releases in the freeswitch debian-release repository (libsofia-sip-ua0 version 1.12.12) with existing software which depends on the debian version 1.12.11+20110422.1-2.1+b1. I would have expected the libraries to be compatible given only the minor version bump, but I am encountering runtime segfaults with the new library. I am able to fix the segfault problem by recompiling dependent programs on the new version of the library, which indicates to me it may not be a drop-in replacement for the existing library and probably has a different abi. I had to build from source to enable glib3 bindings, so there may be an issue with my environment though. Has the library been tested to be compatible with applications built against 1.12.11?

Build failure with --enable-sctp

While trying to build with --enable-sctp I got the following error during compilation:

tport_type_sctp.c: In function ‘tport_sctp_init_socket’:
tport_type_sctp.c:206:10: error: variable ‘initmsg’ has initializer but incomplete type
  206 |   struct sctp_initmsg initmsg = { 0 };
      |          ^~~~~~~~~~~~
tport_type_sctp.c:206:35: warning: excess elements in struct initializer
  206 |   struct sctp_initmsg initmsg = { 0 };
      |                                   ^
tport_type_sctp.c:206:35: note: (near initialization for ‘initmsg’)
tport_type_sctp.c:206:23: error: storage size of ‘initmsg’ isn’t known
  206 |   struct sctp_initmsg initmsg = { 0 };
      |                       ^~~~~~~
tport_type_sctp.c:211:36: error: ‘SCTP_INITMSG’ undeclared (first use in this function)
  211 |   if (setsockopt(socket, SOL_SCTP, SCTP_INITMSG, &initmsg, sizeof initmsg) < 0)
      |                                    ^~~~~~~~~~~~
tport_type_sctp.c:211:36: note: each undeclared identifier is reported only once for each function it appears in
tport_type_sctp.c:206:23: warning: unused variable ‘initmsg’ [-Wunused-variable]
  206 |   struct sctp_initmsg initmsg = { 0 };

Turns out I was missing a dependency (libsctp-dev).
Looking at https://github.com/freeswitch/sofia-sip/blob/master/libsofia-sip-ua/tport/tport_type_sctp.c#L46

#if HAVE_NETINET_SCTP_H
#include <netinet/sctp.h>
#endif

I'm wondering if this can be built at all without HAVE_NETINET_SCTP_H and if not if we can make
the configure script fail when --enable-sctp is provided but the header files are not found (HAVE_SCTP defined but HAVE_NET_INET_SCTP_H not defined)

test_soa fails

test_soa.c:2156: test_soa test_address_in_offer() FAILED: c->c_addrtype != c_addrtype or 2 != 1
test_soa.c:2247: test_soa test_address_selection() FAILED: test_address_in_offer(a, "11.12.13.14", sdp_addr_ip4, "11.12.13.14", sdp_addr_ip4) != 0 or 1 != 0
test_soa.c:955: test_soa test_codec_selection() FAILED: rm->rm_pt != 96 or 97 != 96
FAIL test_soa (exit status: 1)

memory leak in tport.c with unreachable tcp sip clients

hi all,

i think there is a problem in how sofia sip handles the list of closed secondary transports in the primary port structure (the pri_closed field in the tport_primary struct).

To make this easily inspectable, i added the following logs to the tplist_insert and tplist_remove functions and connected a SIP client using the TCP transport:

diff --git a/libsofia-sip-ua/tport/tport.c b/libsofia-sip-ua/tport/tport.c
index db81749..fb408cf 100644
--- a/libsofia-sip-ua/tport/tport.c
+++ b/libsofia-sip-ua/tport/tport.c
@@ -133,19 +133,24 @@ RBTREE_BODIES(su_inline, tprb, tport_t,
 
 static void tplist_insert(tport_t **list, tport_t *tp)
 {
+  SU_DEBUG_0(("%s(%p)\n", __func__, (void *)tp));
   if (*list == NULL)
     *list = tp;
   else
     tp->tp_right = *list, (*list)->tp_left = tp, *list = tp;
 
+  int size = 0;
   for (tp = *list; tp; tp = tp->tp_right) {
+    size++;
     assert(tp->tp_left == NULL || tp == tp->tp_left->tp_right);
     assert(tp->tp_right == NULL || tp == tp->tp_right->tp_left);
   }
+  SU_DEBUG_0(("%s(%p): after insert, list len is %d\n", __func__, (void *)tp, s
 }
 
 static void tplist_remove(tport_t **list, tport_t *tp)
 {
+  SU_DEBUG_0(("%s(%p)\n", __func__, (void *)tp));
   if (*list == tp) {
     *list = tp->tp_right; assert(tp->tp_left == NULL);
   }

everything seems fine under normal circumstances, and, having the all-reg-options-ping option on, the following is printed when a ping is sent to a reachable client:

first ping:
tport.c:136 tplist_insert() tplist_insert(0x7ff51c02b980)
tport.c:156 tplist_insert() tplist_insert((nil)): after insert, list len is 1
tport.c:161 tplist_remove() tplist_remove(0x7ff51c02b980)

second ping:
tport.c:136 tplist_insert() tplist_insert(0x7ff51c02b190)
tport.c:156 tplist_insert() tplist_insert((nil)): after insert, list len is 1
tport.c:161 tplist_remove() tplist_remove(0x7ff51c02b190)

So, when a new connection is established and closed, a new port is inserted and then correctly removed.

However, if the client disappears abruptly (no network, firewall rule, client crash, etc.) the following is logged:

first ping:
tport.c:136 tplist_insert() tplist_insert(0x7ff51c0a4220)
tport.c:156 tplist_insert() tplist_insert((nil)): after insert, list len is 1

second ping:
tport.c:136 tplist_insert() tplist_insert(0x7ff51c0295c0)
tport.c:156 tplist_insert() tplist_insert((nil)): after insert, list len is 2

third ping:
tport.c:136 tplist_insert() tplist_insert(0x7ff51c02ae50)
tport.c:156 tplist_insert() tplist_insert((nil)): after insert, list len is 3
2022-07-05 15:49:27.988995 100.00% [WARNING] sofia.c:6551 Sip user '[email protected]' is now Unreachable

As you can see, the port is never removed from the list.

This causes two main problems:

  • the main one is the memory leak, which is evident in case of mobile apps, which tends to close the connection when sleeping
  • if sofia is compiled with assert()s on, the tplist_insert function scans the entire list every time an insert is done, causing a noticeable cpu usage (verified with perf top -p $(pidof freeswitch) -K) when a sufficient number of ports has accumulated

Also, ports from this list are not removed if the sip client reconnects, deregisters, if the expire for the registration is reached etc.

The only way to empty that list is to restart the sofia profile (because closing the primary transport will zap all the secondaries, closed and not closed)

Right now i'm testing the following solution, which seems to make sense for me, but i'm no expert in sofia internals

diff --git a/libsofia-sip-ua/tport/tport.c b/libsofia-sip-ua/tport/tport.c
index db81749..fb408cf 100644
--- a/libsofia-sip-ua/tport/tport.c
+++ b/libsofia-sip-ua/tport/tport.c
@@ -2592,8 +2597,10 @@ void tport_error_report(tport_t *self, int errcode,
   }
 
   /* Close connection */
-  if (!self->tp_closed && errcode > 0 && tport_has_connection(self))
+  if (!self->tp_closed && errcode > 0 && tport_has_connection(self)) {
      tport_close(self);
+    tport_set_secondary_timer(self);
+  }
 }
 
 /** Accept a new connection.

Sofia Resolver is unable to handle the response from secondary DNS server when Primary is unreachable

I am using Sofia resolver libsofia-sip-ua to resolve FQDNs, currently I configured /etc/resolv.conf as

nameserver 2.2.2.2 (Unreachable)
nameserver 10.74.137.221 (Reachable)

I am using sofia synchrnous query with sres_blocking_query API. I see request is going to primary DNS which is not reachable and then to secondary DNS, and seeing a response from secondary DNS but sofia lib is unable to handle the response
Its showing POLLERR.
TCPDUMP OUTPUTs :
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
11:54:10.200277 IP 10.174.75.65.59263 > 2.2.2.2.domain: 62235+ A? radius1.example.com. (37)
11:54:10.200288 IP 10.174.75.65.59263 > 2.2.2.2.domain: 62235+ A? radius1.example.com. (37)
11:54:10.200291 IP 10.174.75.65.59263 > 2.2.2.2.domain: 62235+ A? radius1.example.com. (37)
11:54:10.201063 IP 10.174.75.65.21250 > 2.2.2.2.domain: 5568+ PTR? 2.2.2.2.in-addr.arpa. (38)
11:54:10.201067 IP 10.174.75.65.21250 > 2.2.2.2.domain: 5568+ PTR? 2.2.2.2.in-addr.arpa. (38)
11:54:10.201070 IP 10.174.75.65.21250 > 2.2.2.2.domain: 5568+ PTR? 2.2.2.2.in-addr.arpa. (38)
11:54:11.201309 IP 10.174.75.65.19237 > 10.74.137.221.domain: 62235+ A? radius1.example.com. (37)
11:54:11.201318 IP 10.174.75.65.19237 > 10.74.137.221.domain: 62235+ A? radius1.example.com. (37)
11:54:11.201322 IP 10.174.75.65.19237 > 10.74.137.221.domain: 62235+ A? radius1.example.com. (37)
11:54:11.201766 IP 10.74.137.221.domain > 10.174.75.65.19237: 62235- 1/1/1 A 10.174.75.160 (88)
11:54:11.201766 IP 10.74.137.221.domain > 10.174.75.65.19237: 62235- 1/1/1 A 10.174.75.160 (88)
11:54:11.201766 IP 10.74.137.221.domain > 10.174.75.65.19237: 62235*- 1/1/1 A 10.174.75.160 (88)

Is this bug in sofia resolver code ? Can anyone help on this to resolve?

Thanks.
Saurabha Badhai

Misleading error message: bind fails, but the wrong port is shown

2021-04-19 09:36:53.873384 [ERR] sofia.c:3259 Error Creating SIP UA for profile: external (sip:[email protected]:5060;maddr=172.30.100.134;transport=udp,tcp) ATTEMPT 1 (RETRY IN 5 SEC)

After debugging and discovering deeper flags ("Sample Export" equivalent to "sofia loglevel all 9", from "Sofia SIP Stack"):
...
tport.c:1622 tport_bind_server() tport_bind_server(0x7f51340051e0) to ws/172.30.100.134:80/sip
tport.c:1694 tport_bind_server() tport_bind_server(0x7f51340051e0): calling tport_listen for ws
tport_bind_socket 764, bind error: errno=98
tport.c:621 tport_alloc_primary() tport_alloc_primary(0x7f51340051e0): new primary tport 0x7f51340102b0
tport.c:727 tport_listen() tport_listen(0x7f51340051e0): bind(pf=2 ws/[172.30.100.134]:80): Address already in use
nta.c:2240 nta_agent_add_tport() nta: bind(172.30.100.134:80;transport=ws): Address already in use

It is not 5060 as stated, but 80 because nginx was running. Also errno would be nice in the message, when available.

retrocompatibility issue with automatic contact generation in invite

We are having issues using this library with software previously compiled using the original sofia-sip hosted at sourceforge.

In particulare there is an issue with automatic contact generation during an invite. It seems that commit afb119a is not retrocompatible and broke some existing software. Also, it seems to go against the documentation which states that a contact header is generated if the library user does not provide one esplicitly and does not pass the SIPTAG_CONTACT(NULL) option.

One example is the janus webtrc gateway which seems to not be compatible with this repo, while working with the original sofia-sip library. This is the relevant issue. The problem there is that the contact header is now missing, since it relied on the sofia stack to automatically generate it (as per the docs). Everything is fixed by reverting the aformentioned commit.

Any thoughts? What is the rationale of the change?

Thanks

EDIT: this is related to #25

Safari iOS 15 WebSocket Issue

WebSocket connections from Safari on iOS 15 that are terminated by Sofia no longer work. It's unclear to me if this is a Sofia issue, or a Safari issue.

The issue only occurs on iOS not on Mac OS, and appears to be related to Apple making the default WebSocket implementation on iOS 15 NSURLSession, which both enables permessage-deflate and seems to require packet fragmentation be supported by WebSocket servers.

There's some more information here, and also some logs from iOS 15 with NSURLSession enabled/disabled.

Settings -> Safari -> Advanced -> Experimental Features -> NSURLSession WebSocket -> Enabled (Default):

2021-09-28 13:50:02.597050 tport.c:2777 tport_wakeup_pri() tport_wakeup_pri(0x563434235070): events IN
2021-09-28 13:50:02.597246 tport.c:880 tport_alloc_secondary() tport_alloc_secondary(0x563434235070): new secondary tport 0x5634342864a0
2021-09-28 13:50:02.598478 tport.c:2668 tport_accept() tport_accept(0x5634342864a0): new connection from wss/<REDCATED>:60058
2021-09-28 13:50:02.598596 tport.c:2801 tport_wakeup() tport_wakeup(0x5634342864a0): events IN
2021-09-28 13:50:02.598622 tport.c:2892 tport_recv_event() tport_recv_event(0x5634342864a0)
2021-09-28 13:50:02.600992 tport.c:2324 tport_set_secondary_timer() tport(0x5634342864a0): reset timer
2021-09-28 13:50:02.767810 tport.c:2801 tport_wakeup() tport_wakeup(0x5634342864a0): events IN
2021-09-28 13:50:02.767902 tport.c:2892 tport_recv_event() tport_recv_event(0x5634342864a0)
2021-09-28 13:50:02.778371 tport.c:2324 tport_set_secondary_timer() tport(0x5634342864a0): reset timer
2021-09-28 13:50:04.558878 tport.c:2801 tport_wakeup() tport_wakeup(0x5634342864a0): events IN
2021-09-28 13:50:04.558973 tport.c:2892 tport_recv_event() tport_recv_event(0x5634342864a0)
2021-09-28 13:50:04.559061 tport_type_ws.c:232 tport_recv_stream_ws() tport_recv_stream_ws(0x5634342864a0): su_getmsgsize(): Host is down (112) N=-1002
2021-09-28 13:50:04.559087 tport.c:2185 tport_shutdown0() tport_shutdown0(0x5634342864a0, 2)
2021-09-28 13:50:04.559109 tport.c:2118 tport_close() tport_close(0x5634342864a0): wss/<REDACTED>:60058
2021-09-28 13:50:04.559160 tport.c:2291 tport_set_secondary_timer() tport(0x5634342864a0): set timer at 0 ms because zap
2021-09-28 13:50:04.559188 tport_type_ws.c:541 tport_ws_deinit_secondary() 0x5634342864a0 destroy wss transport 0x563434286690.

Settings -> Safari -> Advanced -> Experimental Features -> NSURLSession WebSocket -> Disabled:

2021-09-28 13:53:33.872933 tport.c:2777 tport_wakeup_pri() tport_wakeup_pri(0x563434235070): events IN
2021-09-28 13:53:33.873064 tport.c:880 tport_alloc_secondary() tport_alloc_secondary(0x563434235070): new secondary tport 0x5634342864a0
2021-09-28 13:53:33.874281 tport.c:2668 tport_accept() tport_accept(0x5634342864a0): new connection from wss/<REDCATED>:53754
2021-09-28 13:53:33.874343 tport.c:2801 tport_wakeup() tport_wakeup(0x5634342864a0): events IN
2021-09-28 13:53:33.874367 tport.c:2892 tport_recv_event() tport_recv_event(0x5634342864a0)
2021-09-28 13:53:33.876512 tport.c:2324 tport_set_secondary_timer() tport(0x5634342864a0): reset timer
2021-09-28 13:53:34.033473 tport.c:2801 tport_wakeup() tport_wakeup(0x5634342864a0): events IN
2021-09-28 13:53:34.033564 tport.c:2892 tport_recv_event() tport_recv_event(0x5634342864a0)
2021-09-28 13:53:34.196041 tport.c:2324 tport_set_secondary_timer() tport(0x5634342864a0): reset timer
2021-09-28 13:53:35.573279 tport.c:2801 tport_wakeup() tport_wakeup(0x5634342864a0): events IN
2021-09-28 13:53:35.573372 tport.c:2892 tport_recv_event() tport_recv_event(0x5634342864a0)
2021-09-28 13:53:35.573436 tport.c:2324 tport_set_secondary_timer() tport(0x5634342864a0): reset timer
2021-09-28 13:53:35.574167 tport.c:2801 tport_wakeup() tport_wakeup(0x5634342864a0): events IN
2021-09-28 13:53:35.574219 tport.c:2892 tport_recv_event() tport_recv_event(0x5634342864a0)
2021-09-28 13:53:35.574277 tport.c:3233 tport_recv_iovec() tport_recv_iovec(0x5634342864a0) msg 0x56343425cf80 from (wss/<REDCATED>:53754) has 2534 bytes, veclen = 1
2021-09-28 13:53:35.574654 recv 2534 bytes from wss/[88.97.37.172]:53754 at 13:53:35.574334:
INVITE sip:<REDCATED>@<REDCATED> SIP/2.0
Via: SIP/2.0/WSS 0nnlvh8hdp5f.invalid;branch=z9hG4bK9980660
To: <sip:<REDCATED>@<REDCATED>>
From: <sip:[email protected]>;tag=bqj69r6g68
CSeq: 1 INVITE
Call-ID: glptrde74u92motvkk9t
Max-Forwards: 70
Contact: <sip:[email protected];transport=ws;ob>
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound
User-Agent: SIP.js/0.20.0
Content-Type: application/sdp
Content-Length: 1971

Multiple sockets high CPU usage in iOS

In an incoming call scenario, when the iOS app in background or in locked screen mode, we are getting the initial PushKit notification ( the ghost call) and in between getting the real call, the Sofia stack is creating multiple sockets which are left dangling and we have 200% CPU usage and then crash which seem to user like call has terminated.

In a very simplified form this is what is happening

  1. PushKit comes.
  2. Stack tries to make socket to the non-existent call
  3. Application via stack tells server “I’m here send me SDP”
  4. Stack makes new socket every 500ms until SDP comes from server - this could be 5 seconds (or more) so we have ten sockets open
  5. We get the SDP and make a proper socket connection. We now have one socket that is doing a call and the rest are still there doing their socket things chewing up CPU.

Appreciate how we can handle this when we get incoming call on IOS via PushKit?

compiler warnings on debian 10

I already fixed some in #60 , there's more remaining.

In file included from stun.c:48:
stun.c: In function ‘stun_tls_callback’:
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:1318:5: note: in expansion of macro ‘STUN_ERROR’
     STUN_ERROR(one, SO_ERROR);
     ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:1350:7: note: in expansion of macro ‘STUN_ERROR’
       STUN_ERROR(errno, stun_make_sharedsecret_req);
       ^~~~~~~~~~
stun.c:1358:5: warning: ‘TLSv1_client_method’ is deprecated [-Wdeprecated-declarations]
     ctx = SSL_CTX_new(TLSv1_client_method());
     ^~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/sha.h:13,
                 from stun_internal.h:55,
                 from stun.c:48:
/usr/include/openssl/ssl.h:1879:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_client_method(void))
 ^~~~~~~~~~~~~~~~~~
In file included from stun.c:48:
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:1362:7: note: in expansion of macro ‘STUN_ERROR’
       STUN_ERROR(errno, SSL_CTX_new);
       ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:1368:7: note: in expansion of macro ‘STUN_ERROR’
       STUN_ERROR(errno, SSL_CTX_set_cipher_list);
       ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:1378:7: note: in expansion of macro ‘STUN_ERROR’
       STUN_ERROR(err, connect);
       ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:1444:2: note: in expansion of macro ‘STUN_ERROR’
  STUN_ERROR(errno, SSL_write);
  ^~~~~~~~~~
stun.c: In function ‘stun_bind_callback’:
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:1685:5: note: in expansion of macro ‘STUN_ERROR’
     STUN_ERROR(err, recvfrom);
     ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:1690:5: note: in expansion of macro ‘STUN_ERROR’
     STUN_ERROR(err, recvfrom);
     ^~~~~~~~~~
stun.c: In function ‘stun_sendto_timer_cb’:
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:2280:5: note: in expansion of macro ‘STUN_ERROR’
     STUN_ERROR(errno, stun_sendto_timer_cb);
     ^~~~~~~~~~
stun.c: In function ‘stun_test_lifetime’:
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:2743:5: note: in expansion of macro ‘STUN_ERROR’
     STUN_ERROR(errno, su_setblocking);
     ^~~~~~~~~~
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun.c:2761:5: note: in expansion of macro ‘STUN_ERROR’
     STUN_ERROR(errno, getsockname);
     ^~~~~~~~~~
In file included from stun_common.c:44:
stun_common.c: In function ‘stun_send_message’:
stun_internal.h:90:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   SU_DEBUG_5(("%s: %s: %s\n", __func__, #what, su_strerror(err))), \
                                                                  ^
stun_common.c:650:5: note: in expansion of macro ‘STUN_ERROR’
     STUN_ERROR(errno, sendto);
     ^~~~~~~~~~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.