Help is needed. I know I have seen a similar problem either via email or
google search but for the life of me I cannot find it now.
I am using:
Ubuntu:
5.4.0-144-generic #161-Ubuntu SMP Fri Feb 3 14:49:04 UTC 2023 x86_64 x86_64
x86_64 GNU/Linux
Kamailio:
version: kamailio 5.3.9 (x86_64/linux) -- This is a dev platform and I can
update kamailio if needed.
I am trying to query a mongodb collection for the phone number stored under
“did” as an integer and make a decision based on the returned result
(boolean is sufficient for this decision).
I don’t know what I am doing wrong here. Any help will be well appreciated
##### This is the insert statement into the telephone db from a linux script
db.c$coll.insertOne({"did":parseInt($(cut -d_ -f 1 <<< $1)),
"callDesc":$(cut -d_ -f 1 <<< $1)}))" >> $(cut -d_ -f 1 <<< $1).js
did is stored as an integer and the callDesc is stored as presented by $rU
{ "_id" : ObjectId("641580b4863678d0ba38d69a"), "did" : 1XXXXXXXXXX,
"callDesc" : 1XXXXXXXXXXXX }
> db.c234.find()
{ "_id" : ObjectId("641580b4863678d0ba38d69a"), "did" : 2XXXXXXXXXXXX,
"callDesc" : 2XXXXXXXXXXXX }
> db.c234.find()
{ "_id" : ObjectId("641580b4863678d0ba38d69a"), "did" : 3XXXXXXXXXXXX,
"callDesc" : 3XXXXXXXXXXXX }
>
Kamailio config:
.....
.....
# --- mongodb module loaded 202201082322
loadmodule "ndb_mongodb.so"
if (uri==myself)
{
sl_send_reply("100", "Trying to check if uri is myself $rU
$ru");
#return;
#Adding this to test connection to mongodb…. This worked
and the reply was sent to the endpoint
if(*mongodb_cmd_simple*("mongodbsrv1", "telephone", "cXXX”,
"{ \"collStats\": \"cXXX\” }", "mgr1"))
{
sl_send_reply("183", "I got inside this message
loop $rU found in mongodb");
xlog("response from mongodb is
[[$mongodb(mgr1=>value)]]\n");
}
# End of the test
#This is to run the actual db query to test if the phone number is in the
mongodb…. I am not successful at this query even when the number is known
to be in the database
if(*mongodb_find_one*("mongodbsrv1", "telephone", "cXXX”,
"{\"did\" : \"$rU\" }", "mongoResponse1"))
{
# Route to confirmed route here -- 202302212032
sl_send_reply("183", "I got inside this mongodb
message loop");
route(CONFIRMED_ROUTE);
xlog("response from mongodb is
[[$mongodb(mongoResponse1=>value)]]\n");
}
else
{
route(UNCONFIRMED_ROUTE);
}
}
#append_hf("P-hint: outbound\r\n");
route(RELAY);
#exit;
}
Please help.
--
-----
Ekunwe
Tel: 601.497.3932
Hi Kamailians!
A new CVE with a critical severity level was published recently for an almost three year old bug,
which was also fixed and released three years ago (CVE-2020-27507).
The issue was fixed in Kamailio 5.4.2 and is not present in newer releases.
The Kamailio project has unfortunately not been involved in the CVE process or
been informed about this old issue being published at this time.
We take vulnerability handling seriously and our process is documented at:
https://www.kamailio.org/wikidocs/security/policy/
The latest stable branch is 5.6, with v5.6.4 released out of it.
Reference:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=2020-27507
Best regards and thanks for flying Kamailio!
The Kamailio dev team
through
/Olle
Hello,
I am trying to get json RPCs running. simpleequests seem to work, but I can't figure out how to pass parameters. For example
curl --header 'Content-Type: application/json' --data-binary '{"id": 1,"jsonrpc": "2.0", "method": "ul.db_users" }' http://localhost:8081/RPC/
{
"jsonrpc": "2.0",
"error": {
"code": 500,
"message": "Not enough parameters (table to lookup)"
},
"id": 1
}
According to http://www.kamailio.org/docs/docbooks/3.2.x/rpc_api/rpc_api.html#rpc.gettin… parameters dont have names and according to http://www.kamailio.org/docs/modules/devel/modules/usrloc.html#usrloc.r.db_… 1 parameter is required.
I guessed adding "params":"location" => no error anymore, but still no result:
curl --header 'Content-Type: application/json' --data-binary '{"id": 1,"jsonrpc": "2.0", "method": "ul.db_users", "params":"location"}' http://localhost:8081/RPC/
{
"jsonrpc": "2.0",
"result": {
},
"id": 1
}
Same result (no error) if I pass "params":"nonsense", so "params" seems to be kind of ignored ...
What's the correct json syntax here or in general?
Best regards,
Volker
Hello all,
While using KEMI with app_jsdt I noticed the following possible
regression between 5.5 and 5.6.
The following config is working ok on 5.5 but throws an error on 5.6:
ERROR: app_jsdt [app_jsdt_api.c:555]: app_jsdt_run_ex(): js loading
state not initialized (call: ksr_htable_event)
kamailio.cfg:
debug=2
children=1
log_facility=LOG_LOCAL0
log_name="k"
mpath="/home/osas/src/kamailio/src/modules"
loadmodule "htable/htable.so"
modparam("htable", "event_callback", "ksr_htable_event")
modparam("htable", "event_callback_mode", 1)
loadmodule "kemix/kemix.so"
loadmodule "app_jsdt/app_jsdt.so"
modparam("app_jsdt", "load", "/usr/local/etc/kamailio/kamailio.js")
cfgengine "jsdt"
kamailio.js:
function ksr_htable_event(evname) {
KSR.info("ksr_htable_event(" + evname + ")\n");
}
function ksr_request_route() {
KSR.x.exit();
}
If we load the htable module after app_jsdt, then the error is gone.
Is there something new during init in 5.6 that requires specific
module loading order?
-ovidiu
Hi,
I’ve got a situation where I catch a 302 redirect in a failure_route (branch #1), and use the Contact to set a custom header (append_hf()).
This custom header is utilised on the subsequent branch (branch #2), but if that branch fails (e.g. due to 4xx-5xx response), the custom header is not preserved on subsequent branches (branch #3+).
What’s the best way to preserve it across subsequent branches? The documentation for msg_apply_changes() says it cannot be used once the transaction is already created, and in any case, I have other branch-level changes in branch #2 that I _would_ like to revert on subsequent branch attempts (i.e. branch #3).
I can certainly devise a transaction-persistent vehicle for this value which can be checked on every branch, but I wondered if there’s an easier and more best-practical way.
Thanks!
— Alex
--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800
Hello,
I am using kamailio to register the webrtc client and routes the calls to
asterisk using pjsip. I am having no voice on both ends. Logs are attached
witht this email.
Mar 24 13:06:58 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[control] Received command 'offer' from 10.13.1.127:59841
Mar 24 13:06:58 debian rtpengine[7345]: NOTICE: [8asmubtpv46ac7nrfk57]:
[core] Creating new call
Mar 24 13:06:58 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[control] Replying to 'offer' from 10.13.1.127:59841 (elapsed time 0.016067
sec)
Mar 24 13:06:58 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[control] Received command 'answer' from 10.13.1.127:52045
Mar 24 13:06:58 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[control] Replying to 'answer' from 10.13.1.127:52045 (elapsed time
0.000997 sec)
Mar 24 13:06:58 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[ice] ICE negotiated: peer for component 1 is 10.13.1.170:15634
Mar 24 13:06:58 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[ice] ICE negotiated: local interface 10.13.1.127
Mar 24 13:06:58 debian rtpengine[7345]: ERR:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[core] SRTP output wanted, but no crypto suite was negotiated
Mar 24 13:06:58 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[control] Received command 'answer' from 10.13.1.127:52045
Mar 24 13:06:58 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[control] Replying to 'answer' from 10.13.1.127:52045 (elapsed time
0.000786 sec)
Mar 24 13:06:58 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[crypto] DTLS: Peer certificate accepted
Mar 24 13:06:58 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[crypto] DTLS-SRTP successfully negotiated using AES_CM_128_HMAC_SHA1_80
Mar 24 13:06:58 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[crypto] DTLS-SRTP successfully negotiated using AES_CM_128_HMAC_SHA1_80
Mar 24 13:06:58 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[ice] ICE negotiated: peer for component 1 is 10.13.1.170:15634
Mar 24 13:06:58 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[ice] ICE negotiated: local interface 10.13.1.127
Mar 24 13:07:02 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[core] Confirmed peer address as 10.13.1.170:15634
Mar 24 13:07:02 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[core] Kernelizing media stream: 10.13.1.170:15634 -> 10.13.1.127:10940 |
10.13.1.127:10960 -> 192.168.30.200:53489
Mar 24 13:07:02 debian rtpengine[7345]: WARNING:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[core] No support for kernel packet forwarding available (encryption cipher
or HMAC not supported by kernel module)
Mar 24 13:07:02 debian rtpengine[7345]: NOTICE:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[core] Setting 'non-forwarding' flag for kernel stream due to lack of sinks
Mar 24 13:07:03 debian rtpengine[7345]: ERR:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[rtcp] SRTCP output wanted, but no crypto suite was negotiated
Mar 24 13:07:03 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[core] Removing media stream from kernel: local 10.13.1.127:10940
Mar 24 13:07:03 debian rtpengine[7345]: INFO:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[core] Kernelizing media stream: 10.13.1.170:15634 -> 10.13.1.127:10940 |
10.13.1.127:10960 -> 192.168.30.200:53489
Mar 24 13:07:03 debian rtpengine[7345]: WARNING:
[8asmubtpv46ac7nrfk57/223df8fa-8106-48af-844f-33f97530a0d8/1 port 10940]:
[core] No support for kernel packet forwarding available (encryption cipher
or HMAC not supported by kernel module)
Mar 24 13:07:04 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[control] Received command 'delete' from 10.13.1.127:52045
Mar 24 13:07:04 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] Scheduling deletion of call branch '9693uq66f0' (via-branch '') in
30 seconds
Mar 24 13:07:04 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] Scheduling deletion of call branch
'223df8fa-8106-48af-844f-33f97530a0d8' (via-branch '') in 30 seconds
Mar 24 13:07:04 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] Scheduling deletion of entire call in 30 seconds
Mar 24 13:07:04 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[control] Replying to 'delete' from 10.13.1.127:52045 (elapsed time
0.001463 sec)
Mar 24 13:07:17 debian /usr/local/sbin/kamailio[13362]: INFO: <script>:
10.13.1.170 authentication bypassed for sip:developer@10.13.1.127
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] Final packet stats:
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] --- Tag '9693uq66f0', created 0:36 ago for branch ''
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] --- subscribed to '223df8fa-8106-48af-844f-33f97530a0d8'
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] --- subscription for '223df8fa-8106-48af-844f-33f97530a0d8'
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] ------ Media #1 (audio over UDP/TLS/RTP/SAVPF) using unknown codec
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] --------- Port 10.13.1.127:10960 <> 192.168.30.200:53489, SSRC
0, in 0 p, 0 b, 292 e, 36 ts, out 0 p, 0 b, 0 e
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] --- Tag '223df8fa-8106-48af-844f-33f97530a0d8', created 0:36 ago for
branch ''
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] --- subscribed to '9693uq66f0'
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] --- subscription for '9693uq66f0'
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] ------ Media #1 (audio over UDP/TLS/RTP/SAVPF) using opus/48000/2
Mar 24 13:07:34 debian rtpengine[7345]: INFO: [8asmubtpv46ac7nrfk57]:
[core] --------- Port 10.13.1.127:10940 <> 10.13.1.170:15634, SSRC
1ada0b2b, in 292 p, 40137 b, 1 e, 30 ts, out 2 p, 1449 b, 0 e
Hi,
I need to use a database that may sometimes timeout and I'd like to give a
conditional sip response based on whether there was a timeout or not. I'm
using sqlops with mysql modules. Does anyone know if that's possible ?
Thanks,
Leon
Hi List
Cisco-SPA112 does reply to an invite containing Record-Route header
with one Route: Header containing a comma separated list of those hops.
It looks like kamailio fails to parse them and correctly route for
example an ACK to a 200 OK.
Is this a known issue? Is there a solution?
--
Mit freundlichen Grüssen
-Benoît Panizzon- @ HomeOffice und normal erreichbar
--
I m p r o W a r e A G - Leiter Commerce Kunden
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
______________________________________________________
Hello,
We have a Kamailio 5.2.7 server with WebRTC enabled. However, a WebRTC
client at https://tryit.jssip.net/ is unable to connect on either Chrome or
Firefox. In the Kamailio log we see the lines below. In tls.cfg we have
"verify_certificate = no" and "require_certificate = no" for both
[server:default] and [client:default]. Would anyone be able to help us with
this?
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_domain.c:1159]:
tls_lookup_private_key(): Private key lookup for SSL_CTX-0x14baf1cbb090:
(nil)
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_domain.c:749]:
sr_ssl_ctx_info_callback(): SSL handshake done
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_domain.c:737]:
sr_ssl_ctx_info_callback(): SSL handshake started
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_domain.c:741]:
sr_ssl_ctx_info_callback(): SSL renegotiation initiated by client
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_domain.c:749]:
sr_ssl_ctx_info_callback(): SSL handshake done
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_domain.c:737]:
sr_ssl_ctx_info_callback(): SSL handshake started
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_domain.c:741]:
sr_ssl_ctx_info_callback(): SSL renegotiation initiated by client
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_domain.c:749]:
sr_ssl_ctx_info_callback(): SSL handshake done
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_server.c:424]:
tls_accept(): TLS accept successful
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_server.c:431]:
tls_accept(): tls_accept: new connection from xx.xx.xx.xx:39816 using
TLSv1.3 TLS_AES_256_GCM_SHA384 256
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_server.c:434]:
tls_accept(): tls_accept: local socket: yy.yy.yy.yy:8443
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_server.c:445]:
tls_accept(): tls_accept: client did not present a certificate
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: tls [tls_server.c:1189]:
tls_read_f(): Reading on a renegotiation of connection (n:532) (0)
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: <core>
[core/tcp_read.c:1527]: tcp_read_req(): EOF
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: <core>
[core/io_wait.h:602]: io_watch_del(): DBG: io_watch_del (0x562ffde66d00,
17, -1, 0x10) fd_no=4 called
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: <core>
[core/tcp_read.c:1680]: release_tcpconn(): releasing con 0x14baf4cc1ec8,
state -1, fd=17, id=665 ([xx.xx.xx.xx]:39816 -> [xx.xx.xx.xx]:8443)
Mar 22 01:25:28 br /sbin/kamailio[25259]: DEBUG: <core>
[core/tcp_read.c:1684]: release_tcpconn(): extra_data 0x14baf289ea30
Mar 22 01:25:28 br /sbin/kamailio[25291]: DEBUG: <core>
[core/tcp_main.c:3320]: handle_tcp_child(): reader response= 14baf4cc1ec8,
-1 from 1
Mar 22 01:25:28 br /sbin/kamailio[25291]: DEBUG: tls [tls_server.c:683]:
tls_h_close(): Closing SSL connection 0x14baf289ea30
Thanks very much,
--
David Cunningham, Voisonics Limited
http://voisonics.com/
USA: +1 213 221 1092
New Zealand: +64 (0)28 2558 3782
Hi All
I would like to avoid having run away calls as good as possible.
For this, I would like to require timers and set the maximum expires
timer to say 1800
I had a look at the sst module, but I see no way to require timers or
to set a max timers value.
Do my intentions make sense? How did others accomplish this task?
Thanks for any hints!
Mit freundlichen Grüssen
-Benoît Panizzon-
--
I m p r o W a r e A G - Leiter Commerce Kunden
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
______________________________________________________