Hi Matteo
I have used http_async_client and http_client in both Native & KEMI to good affect for handling SUBSCRIBE & NOTIFY flows however did have a few issues with formatting which took a bit of work to get right.
Just to note, something you may want to test. Initially I set about my task using http client within Python (aiohttp and ayncio) and stepped in and out of it from various points in the logic depending on the config I was using at the time. Under load this proved to be a bottle neck and failed load testing. The best options under load were using http_async_client or http_client modules which offered significantly better performance.
In the end we took a different approach of using Kafka Module as that had even better performance but that was a decision taken our side not through any fault of the http_async_client or http_client modules
Lewis
Mission Labs Limited is registered in England, company number 10040088. Trading Office: The Old Milk Depot, Bacup Rd, Rossendale, BB4 7FE. Registered office: The Scalpel, 18th Floor 52 Lime Street, London, EC3M 7AF. Email confidentiality notice: This message is private and confidential. If you have received this message in error, please notify us and remove it from your system. Please consider the environment before you print this email.
Hi List
I'm attempting to add a header to a reply message on failure.
Situation:
Registrar => Core => (dispatcher list) => Various IC
I would like to know on the registrar, which of the dispatcher groups
failed.
What I attempted sofar:
failure_route[DISPATCH_FAILURE]
{
append_to_reply("X-RR: (append reply) Final Dispatch Failure $avp(dispgroup):$avp(trunkname)\r\n");
append_hf("X-RR: (append hf) Final Dispatch Failure $avp(dispgroup):$avp(trunkname)\r\n");
$avp(rstatus) = t_get_status_code();
$avp(rtext) = $T_rpl($rr);
$avp(rtext) = "REMOTE REPLY: " + $T_rpl($rr);
t_send_reply("$avp(rstatus)", "$avp(rtext)");
}
I only get status text is getting through to my reply. I would much prefer to add a header which I could then extract on the registrar. Am I missing something which could prevent addition of a header in a reply?
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
______________________________________________________
Hello all :)
I'm struggling to add two headers to an http client request, but cannot
find a proper way to do it.
The headers are Authorization and Content-Type.
The first try is with http_client module, beside undocumented, is possible
to add multiple headers separating them with "\r\n". What I see is the
correct Authorization header, and two Content-Type headers, one with my
content type the other with x-www-form-urlencoded, which no one sets ?
Second try is with http_async_client which supports multiple headers, but
since I'm calling it from an xhttp event route, there's no transaction and
request cannot be suspended, so I cannot get results before sending out
xhttp response...
Any hint?
br,
Mat
Hi List
I wonder if some of the devs could look at the dialog code and maybe
confirm my observation of this supposed Bug in Kamailio 5.6
Situation:
Two Kamailio, dialog counters synced via DMQ and each node using a
local DB as dialog backend.
Goal is to count channel usage per customer.
modparam("dialog", "db_mode", 1 )
modparam("dialog", "enable_dmq", 1)
modparam("dialog", "h_id_start", -1) # Use server_id
modparam("dialog", "h_id_step", 2)
modparam("dialog", "profiles_with_value", "custcallcounter")
If 'JohnDoe' is involved in a call, I do:
set_dlg_profile("custcallcounter","JohnDoe");
To check how many calls are busy by JohnDoe I do:
get_profile_size("custcallcounter","JohnDoe","$var(channel_use)");
Picture this situation:
JohnDoe is initiating a first call via Node1:
Node1 created the dialogue and variables, writes them to the database
and replicates the dialog vars to Node2 => IN MEMORY
Nothing about the running dialog is being written to the Database on
Node2, but get_profile_size returns the count on Node2.
So while the first call aka dialog is running via Node1, JohnDoe is
initiating a second call, this time via Node2.
Node2 creates the dialog and writes this to the database. Then the
profile with Name 'JohnDoe' is INCREASED on Node2.
This is when I suddenly find the dialog_vars on the Node2 database
containing information about the dialog started on Node1. So I guess
writing to a dialog counter triggers the dialog_vars being written to
the Database.
When JohnDoe is ending it's first call, then the dialog and dialog_vars
are cleaned out of the database on Node1, but NOT on Node2
What I fear happens next: They dialog_vars remaining on the Database of
Node 2 accumulate more and more, making the database slower. When a
call happens to re use the same hash id and entry, things start going
really badly.
Could I be right?
--
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,
Is it possible to put a kind of license for Kamailio, in a way that it works for 1 week for example, and after that it will not process new requests?
Regards,
The client uses the TLS protocol registered and TCP Connection established . There is a problem now, sending message KSR.uac.uac_req_send() from the kamilio server to client failed sometimes,and the error is as follows:
“2023-09-04T17:22:01.515763+08:00 (3429) ERROR: tm [../../core/forward.h:292]: msg_send_buffer(): tcp_send failed
2023-09-04T17:22:01.515763+08:00 (3429) ERROR: tm [uac.c:678]: send_prepared_request_impl(): Attempt to send to precreated request failed ”. meantime, the client sending message to Kamalio server succeded, and the register status and tcp connection is normal.
After 30s, obtained the $uac_req(evcode) from the event_route[uac:reply] is 408.After this error appears, all the messages sent to this client are 408.
"
2023-08-29T03:48:43.738152+08:00 (3349) NOTICE: <script>: ===uac reply received, callid = 0B6ECB534AE24281AED9BBBC56B140A6`yangwang2`1693252093, code is: 408
2023-08-29T03:48:43.738825+08:00 (3349) NOTICE: <script>: ===uac reply received, callid = 0B6ECB534AE24281AED9BBBC56B140A6`yangwang2`1693252093, code is: 408
"
But from other information, the TCP connection is normal. Because from Kamailio to querying this user's Location, it has not changed all day. The client sends messages is also normal. That is, the user's registration and sending messages can receive 200 OK.
We use netstat commands to view the user's TCP connection information on the client and server, and the connection status is also normal.The status of the corresponding port of the TCP connection is ESTABLISHED.
client:
netstat -ano | findstr 49957
"172. 17. 47.125:49957 XXX.96.XXX.XXX:5061 ESTABLISHED 10516"
server:
"tcp 0 0 10.11.xx.xx:5061 xxx.xxx.xxx.xxx:49957 ESTABLISHED 3467/kamailio"
This client is normal after logging in, and the problem that occurs after a period of use (maybe some hours), and once it occurs, it fails until the user creates a new connection and logs back in. Not all users will appear.
Why is this the case? The socket connection is fine, but uac_req_send () get an ERROR?
I found a problem from the log file. Is it caused by duplicate callids pushed to the same user at the same second?
Looking forward to your answer, thank you very much
Script information that may be required
kamailio.cfg : tm mode
# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
# default retransmission timeout: 30sec
modparam("tm", "fr_timer", 30000)
# default invite retransmission timeout after 1xx: 120sec
modparam("tm", "fr_inv_timer", 120000)
modparam("tm", "auto_inv_100", 1)
kamalio.lua uac_req_send()
" --uac_req_send
KSR.pv.sets("$uac_req(hdrs)", hdrs)
KSR.pv.sets("$uac_req(method)", "MESSAGE")
KSR.pv.sets("$uac_req(ruri)", "sip:" .. to .. "@" .. KAM_DOMAIN)
KSR.pv.sets("$uac_req(furi)", "sip:" .. from .. "@" .. KAM_DOMAIN)
KSR.pv.sets("$uac_req(turi)", "sip:" .. to .. "@" .. KAM_DOMAIN)
KSR.pv.seti("$uac_req(evroute)", 1)
KSR.pv.sets("$uac_req(body)", content)
local ouri = (row.received ~= "" and row.received) or row.contact
KSR.pv.sets("$uac_req(ouri)", ouri)
local callid = rows[i].clientid .. "`" .. rows[i].username .. "`" .. os.time()
KSR.pv.sets("$uac_req(callid)", callid)
KSR.uac.uac_req_send()
Hello,
Im gathering ideas about routing based on caller number to multiple peers and -lets say- subscribers.
As far as i know we can route the calls with LCR based on prefix or the whole number to the LCR gateways which are specified in the LCR module gateway table.
This is working very well with public IP based "peers". We can route calls to these gateways.
But what can we do if we have to route to a "peer" which is behind NAT. Basically they have to REGISTER as a subscriber, but we cannot add a subscriber to the LCR gateway table, beacuse LCR module needs a directly reachable IP address with a fixed port.
Does anyone have any ideas on how to handle these mixed type peers?
Or maybe we have to add the fixed IP peers which are not REGISTERing to the usrloc database somehow and then we can do a lookup location based on $rU.
To make myself clear, it would be nice if we can handle those 2 types of our peers unifromly in terms of SIP routing, thats why im looking for a "unified" solution.
Thanks for your suggestions.
With kind regards,
Zoltan
Hi all
Is there a way to skip a branch in branch route?
Situation: Two registrar server with DMQ synced location database.
CPE register via TCP or TLS. To properly work, message have to be sent
over the existing TCP connection.
Multiple CPE register to one AOR.
CPE1 and CPE2 register to Registrar 1
CPE3 registers to Registrar 2
On Registrar 1 there is an established TCP connection to CPE1 and CPE2
but not to CPE3.
Within the Branch Route to the CPE I can check if there is a TCP
as the Branch Route is executed for every contact in that AOR:
branch_route[BR_TO_CPE]
{
[...]
$var(reg_contact_addr) = $(ulc(aor=>addr)[$T_branch_idx]{uri.host});
$var(socket) = $(ulc(aor=>socket)[$T_branch_idx]);
if ($var(socket) == 0) {
xlog("L_ERROR", "$cfg(route): No Socket for: $var(reg_contact_addr)");
}
[...]
}
This log an error if the socket is not present on the local registrar.
But is there a way to tell kamailio to skip/discard that contact?
My intention is to parallel branch from the core to both registrars,
that way all contacts would still get the call but via established
TCP socket (and in case of UDP and NAT via correct know ip for ALG port-forwarding).
--
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
______________________________________________________