Hello all,
How can we handle stateless replies with kemi?
tm has the following param:
modparam("tm", "on_sl_reply", "stateless_replies")
What's the proper way to map the "stateless_reply" onreply_route to a
kemi function.
I'm playing with the app_jsdt module.
Thanks,
Ovidiu
Hi all
For rtpengine to correctly distinguish branched calls, the top-most via
branch= parameter should be passed to it.
I have attempted to use $via0 but that does not yet exist in Kamailio
5.4
So I did try to read $hdr(Via) which I guess returns an array and then
access:
but this returns the inbound via, not the one generated on the branched
call.
How can this be accomplished with kamailio 5.4?
--
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
______________________________________________________
Hi Kamailio users
How can I get a failure route to trigger in timeout-to-CANCEL in
a parallel forking scenario?
Parallel forking test scenario
1. one(the main - 0) branch picks up the call
2. 2nd branch sends CANCEL (expecting 487 etc) - but the callee does not
send any replies
Result:
No failure route handlers are called on timeout of this CANCEL - that is
kamailio attempts the CANCEL 4 times but neither
tm.t_on_failure_route, tm.t_on_branch_failure handlers are called.
Any suggestions on how to resolve this?
Regards
Shih-Ping
I'm looking for documentation//howto/advice/best practices for running
Kamailio under Kubernetes on AWS via Rancher. Specifically, how to manage
the public/Elastic IP. This is a load balancer (dispatcher) scenario with
rtpengine for receiving inbound calls from a DID provider, but a similar
configuration might be used for clients. I'm open to using an AWS load
balancer, and would like to scale with multiple Kamailio pods behind a
single public IP. I'd rather use Rancher-managed EC2 than pay extra for
EKS, unless EKS can cancel out its own cost. This sounds like it should be
a solved problem, just complex. I see blogs and videos out there, but it's
not always obvious if their content is current. Anyone want to help me peel
this onion?
-Calvin
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