Hello, I am trying to compile Kamailio with all its modules statically
linked. How should I go about this?
I followed through the installation documentation but could not find any
information.
I tried passing all the modules I want to statically link in the
"static_modules" argument of `make` but it seems that definitions of
modules clash as such.
```
make static_modules="siputils rr"
```
```
/usr/bin/ld:
modules/rr/rr_mod.o:/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/rr/rr_mod.c:69:
multiple definition of `module_version';
modules/siputils/siputils.o:/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/siputils/siputils.c:78:
first defined here
/usr/bin/ld:
modules/rr/rr_mod.o:/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/rr/rr_mod.c:69:
multiple definition of `module_flags';
modules/siputils/siputils.o:/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/siputils/siputils.c:78:
first defined here
/usr/bin/ld:
modules/rr/rr_mod.o:/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/rr/rr_mod.c:69:
multiple definition of `module_interface_ver';
modules/siputils/siputils.o:/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/siputils/siputils.c:78:
first defined here
/usr/bin/ld:
modules/rr/rr_mod.o:/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/rr/rr_mod.c:166:
multiple definition of `exports';
modules/siputils/siputils.o:/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/siputils/siputils.c:241:
first defined here
/usr/bin/ld: modules/rr/rr_mod.o: in function `mod_register':
/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/rr/rr_mod.c:926:
multiple definition of `mod_register';
modules/siputils/siputils.o:/playground/fuzzing-targets/sip/kamailio-dfsan/src/modules/siputils/siputils.c:817:
first defined here
```
Any help would be appreciated. Thank you.
Hi all!
My team and I are finalizing implementation of STIR/SHAKEN. The flow has
been simplified and is something like: Call comes from SBC to Kamailio,
Kamailio makes an HTTP request to a REST API, response is received by
Kamailio (5.8.2) and depending on the response, it replies back to SBC with
a SIP 300 Multiple Choice of a SIP 4xx error, denying the call.
The INVITEs received by SBC may or may not contain the Identity header.
On Kamailio side, the following code gets the required headers to build the
JSON object sent to REST API:
route[HANDLE_STIRSHAKEN]
{
if (!is_method("INVITE")) {
return;
}
$var(requestTime) = $utimef(%s);
$var(ruri) = "$ru"; #request URI
$var(from) = "$hdr(From)"; #$fU From header
$var(to) = "$hdr(To)"; #$tU; To header
$var(contact) = "$hdr(Contact)"; #Contact header
$var(callID) = "$ci"; # Call ID
$var(identity) = "$hdr(Identity)"; # Identity header
jansson_set("string","from" , $var(from) ,
"$var(post)");
jansson_set("string","to" , $var(to) ,
"$var(post)");
jansson_set("string","r-uri" , $var(ruri) ,
"$var(post)");
jansson_set("string","contact" , $var(contact) ,
"$var(post)");
jansson_set("string","call-id" , $var(callID) ,
"$var(post)");
jansson_set("string","identity" , $var(identity) ,
"$var(post)");
http_connect("api1", "/stsh",
"application/json","$var(post)","$var(result)");
xlog("L_DEBUG", "HANDLE_STIRSHAKEN - Result = $var(result)\n");
[... do some other irrelevant stuff ...]
}
The usual INVITE is similar to this:
INVITE sip:+33142XXXXXX@10.242.XXX.YYY:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP
10.240.AAA.BBB:5064;branch=z9hG4bK+30f178b47ee25dd589f986ed7402b4eb3+sip+6+a64eb889
From: "+493XXXXXXX" <sip:+493XXXXXXX@10.240.AAA.BBB
;user=phone>;tag=10.240.AAA.BBB+6+ffe686f8+614d17a3
To: +33142XXXXXX <sip:+33142XXXXXX@10.242.XXX.YYY>
CSeq: 1 INVITE
Expires: 180
Content-Length: 234
Call-Info:
<sip:10.240.AAA.BBB:5064>;method="NOTIFY;Event=telephone-event;Duration=2000"
Supported: timer, 100rel
Contact: <sip:+493XXXXXXX@10.240.AAA.BBB:5064;user=phone>
Content-Type: application/sdp
Call-ID:
0gQAAC8WAAACBAAALxYAAHRfFdrMLbnN/iMYu2NTT6kvhuhZAFl7MG1V2ozJLUcXg9dxbyQZ/PtoswtdHtcv9g--(a)10.240.AAA.BBB
Min-SE: 90
Session-Expires: 90;refresher=uac
X-dtmf: 5
P-Asserted-Identity: "+493XXXXXXX" <sip:+493XXXXXXX@10.240.AAA.BBB>
Accept: application/sdp
Accept: application/dtmf-relay
Max-Forwards: 66
Allow: INVITE,CANCEL,BYE,ACK, INFO
Identity:
dGhpcyBpcyBzb21lIGR1bW15IGJhc2U2NCBlbmNvZGVkIElkZW50aXR5IGhlYWRlcg==.eW91IHdvdWxkIG5vdCBleHBlY3QgbWUgdG8gbGVhdmUgdGhlIHJlYWwgdmFsdWUgaGVyZSByaWdodD8=.dGhhbmtzIGZvciB5b3VyIGNvbXByZWhlbnNpb24=;info=<
https://someURL.com/with/some/parameter;sc697295b.cer>;alg=ES256;ppt=shaken
P-Origination-Id: 23A16F8B-F9AB-4536-9884-85C96EF3B964
P-Attestation-Indicator: C
has-sdp: present
[SDP stuff]
(I have replaced some of the values for obvious reasons).
- SBC is sending every 70 secs 2 automatically generated INVITEs to kamailio
- 1st call contains the Identity header, the other call does not contain
Identity header.
- Both calls have different Call-IDs and different FROM and TO values, so
they are different calls and can be perfectly found in logs as separated
calls
- Kamailio receives each call and extracts headers, as shown in code above,
and sends the JSON request to HTTP REST API
Here is the weird part.... every now and then, completely random, the JSON
object request sent to the HTTP REST API contains an Identity value,
supposedly extracted from the SIP header **but** the SIP message captured
in SNGrep doesn't have **any* I*dentity header!! In fact, in the kamailio
logs, where I sent the header values extracted from INVITE, the identity is
empty! BUT the JSON object has the identity set with value.
And the worst part is that, when this issue happens, the value of the
Identity set in JSON belongs to a completely different call that was
processed a few minutes before !
So I suspected about some Caching behaviour on the http_connect function
and added the following lines before sending the JSON to REST API:
if ( is_present_hf("Identity") ) {
jansson_set("string","identity",* $var(identity),* "$var(post)");
} else
jansson_set("string","identity", "", "$var(post)");
forcing the identity property of the JSON to an empty string, but this did
not work either!
I even added a new property which is the current timestamp making sure
every request was unique, and that did not work either!
The only way I could make it work was replacing the above lines using these
lines:
if ( is_present_hf("Identity") ) {
jansson_set("string","identity", *(a)hf_value2.Identity*,
"$var(post)");
} else
jansson_set("string","identity", "", "$var(post)");
So, instead of using $hdr(Identity) , Kamailio extracts the Identity header
using @hf_value2.Identity
Question: why is this behaviour? Could this be a bug somewhere?
Atenciosamente / Kind Regards / Cordialement / Un saludo,
*Sérgio Charrua*
hi,
i'm trying setup kamailio for simple CDR logging
versions - kamailio 5.7, rocky 9.4
i have configured and populate sqlite with "kamdbctl create"
kamailio.cfg
#CDR
loadmodule "db_sqlite.so"
loadmodule "acc.so"
modparam("acc", "cdr_enable", 1)
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)
modparam("acc", "db_url", "sqlite:///var/log/kamailio-cdr.sqlite")
modparam("acc", "time_mode", 3)
but i have this error
ERROR: db_sqlite [dbase.c:232]: db_sqlite_submit_query(): failed to
prepare statement: table acc has no column named time_attr
any ideas where can i find acc schema update for time_attr column?
bash# grep -Rni time_attr /usr/share/kamailio/db_sqlite/ shows nothing
Marek
Hello!
Is it possible to find out the name of the onreply_route that was set
before?
Something like this:
t_on_reply("MANAGE_REPLY");
...
if ( t_is_set("onreply_route") ) {
get_onreply_route_name();
...
}
--
BR,
Denys Pozniak
Hi Community,
Is it possible to append a branch to a transaction after the call is in a
ringing state? Say a call comes in and an AOR only has two contacts.
Branches are created to the contacts. A third comes in why the two are in
the ringing state. Can we create a branch to the third?
Hello,
I encountered a problem stopping Kamailio with FIPS OpenSSL:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007ff7292380ac in OPENSSL_sk_pop () from /lib64/libcrypto.so.3
Missing separate debuginfos, use: dnf debuginfo-install
kamailio-5.7.3-4816.x86_64
(gdb) bt
#0 0x00007ff7292380ac in OPENSSL_sk_pop () from /lib64/libcrypto.so.3
#1 0x00007ff72914bf5b in conf_modules_finish_int () from /lib64/libcrypto.so.3
#2 0x00007ff72914c694 in CONF_modules_unload () from /lib64/libcrypto.so.3
#3 0x00007ff7291efff9 in OPENSSL_cleanup () from /lib64/libcrypto.so.3
#4 0x00007ff72954702b in ?? ()
#5 0x0000000100061c08 in ?? ()
#6 0x00007ff7190566c8 in ?? ()
#7 0x00007ffccf196a20 in ?? ()
#8 0x000000000071da8a in futex_release (lock=0x7ff729f08b50 <syslog>)
at core/mem/../mem/../futexlock.h:134
#9 0x00000000006e9448 in destroy_tls () at core/tls_hooks.c:75
#10 0x000000000041f278 in cleanup (show_status=1) at main.c:594
#11 0x0000000000420af1 in shutdown_children (sig=15, show_status=1) at
main.c:721
#12 0x0000000000421717 in handle_sigs () at main.c:752
#13 0x0000000000430c88 in main_loop () at main.c:1988
#14 0x0000000000439d13 in main (argc=14, argv=0x7ffccf1973f8) at main.c:3212
(gdb)
Environment:
Oracle Linux Server 9.3
Kamailio 5.7.3
yum list --installed | grep ssl
openssl.x86_64 10:3.0.7-24.0.3.el9_fips
@tools
openssl-libs.x86_64 10:3.0.7-24.0.3.el9_fips
@tools
openssl-pkcs11.x86_64 0.4.11-7.el9
@anaconda
xmlsec1-openssl.x86_64 1.2.29-9.el9
@AppStream
What can I do for further investigation?
Thanks
Hello,
Recently encountered an issue with tsilo (that is using t_append_branches),
but not sure found a root cause.
So, I have a call, but aparently there are some "dead" TCP connections in a
"location" table
modparam("usrloc", "handle_lost_tcp", 0)
On call initialtion, INVITE's are sent to "last seen" location, but
aparently there is no answer and I assume it's in a state "trying to
establish TCP connection"
Obviously, there is no "100 Trying" answer on any outgoing INVITE.
Than, a REGISTER comes from a contact, that is supposed to be called.
Usual
ts_append("location", "$tu");
is called, but in the logs I see
[REGISTER] tm [t_append_branches.c:208]: t_append_branches(): failure to
add branches (-1)
If there is an active TCP connection, branches are added as expected. I'm
getting this only in a case of trying to establish a call to a "dead" TCP
connection.
What am I missing here or it sounds like a bug?
--
Best regards,
Ihor (Igor)
Hello guys,
i'm seeing something weird, and i'm working if you can let me know.
I have a kamailio in AWS with a private IP listening on several sockets:
Listening on
udp: 10.1.2.36:5070
udp: 10.1.2.36:5080
udp: 10.1.2.36:5160 advertise 4.3.2.1:5160
udp: 0.0.0.0:5066
tls: 10.1.2.36:443 advertise sip.something.com:443
tls: 10.1.2.36:444 advertise sip.something.com:444
tls: 10.1.2.36:5061
When forwarding a udp invite received on 10.1.2.36:5080 to a public ip
provider say on 8.8.8.8:5060, i'm forcing the outgoing socket with
force_socket via 10.1.2.36:5160. But the outgoing invite does NOT use 5160,
it uses some random port...
Anybody knows why this might be?
my problem is, that call goes to freeswitch... call is setup properly and
connects fine. But 15 minutes later the end provider sends back a reINVITE,
which freeswitch then sends TO THE RANDOM PORT kamailio used to send the
INVITE... but by this time kamailio doesn't seem to even see the packet...
help is greatly appreciated!
David
Regards,
David Villasmil
email: david.villasmil.work(a)gmail.com
Hi. I am using https://github.com/havfo/WEBRTC-to-SIP to have a web
sipcaller. it uses kamailio + rtpengine + web sipcaller (jssip)
right now it is working using internal kamailo account and can call to
another sip.
But I need to use websipcaller to call to voip provider. I tried to
register on my voip provider, and use just outbound websocket proxy, but
it not working giving 401
the config I am using is
https://github.com/havfo/WEBRTC-to-SIP/blob/master/etc/kamailio/kamailio.cfg
Please help adopt it to relay anything to external sip provider. I don't
know what I need, relay, sip trunk or path module.
kamailio configs are very hard for me to understand.
So I need it just as websocket proxy to my voip provider, that doesn't
support websocket.
thanks!