I noticed that sql_query does not (anymore) work when called from event route:
event_route [tcp:closed] { # Handle TCP connection close
# Delete possible leftover registration
if ($conid)
sql_query("sip_proxy_cache", "DELETE FROM location WHERE server_id=0 AND connection_id=$conid", "result");
}
The query produces errors:
2024-05-07T11:30:14.785915+03:00 siika /usr/bin/sip-proxy[2848078]: CRITICAL: sqlops [sqlops.c:213]: sql_check_connection(): no database handle with reconnect disabled
2024-05-07T11:30:14.785978+03:00 siika /usr/bin/sip-proxy[2848078]: ERROR: sqlops [sqlops.c:232]: sql_query(): invalid connection to database
2024-05-07T11:30:14.786013+03:00 siika /usr/bin/sip-proxy[2848078]: ERROR: sqlops [sqlops.c:237]: sql_query(): with query [DELETE FROM location WHERE server_id=0 AND connection_id=7]
I added the last debug message in order to find out where the error
comes from.
The same query works fine when executed from regular route.
Any ideas why the query fails from event_route?
-- Juha
Hi everyone,
I am trying to assign environment variable as follows
listen=udp:0.0.0.0:5060 advertise $env(MY_IP):5060
Looks like using the environment variable as above is an invalid
configuration.
Is there a way to use IP from env var to advertise. Even better, is there a
way to use result in a stun query as an advertised address?
Thank you,
Pavan Kumar
Hi all!
I'm testing some redirect scenarios with Kamailio 5.7.4 and using
Astterisk 13 and SIPp for unit testing.
The kamailio's script is simple and uses TM, HTTP_ASYNC_MODULE, JSONRPC,
JANSSON, RTJSON and XLog modules.
Request route is simple:
request_route {
route(HANDLE_OPTIONS);
route(HANDLE_RETRANS);
route(HANDLE_CANCEL);
route(REQINIT);
route(HANDLE_INVITE);
}
where HANDLE_RETRANS is:
route[HANDLE_RETRANS]{
# handle retransmissions
xlog("L_INFO","HANDLE_RETRANS - message type is $mt for method
$rm");
if (!is_method("ACK")) {
if(t_precheck_trans()) {
xlog("L_INFO","HANDLE_RETRANS - Precheck Trans");
t_check_trans();
xlog("L_INFO", "HANDLE_RETRANS - Exiting after
Retransmission check - method $rm");
exit;
}
xlog("L_INFO","HANDLE_RETRANS - Check Trans");
t_check_trans();
}
}
and HANDLE INVITE is:
route[HANDLE_INVITE]{
if (is_method("INVITE"))
{
xlog("L_INFO","MAIN - calling TO_CARRIER");
setflag(FLT_ACC);
route(TO_CARRIER);
exit;
}
}
The HTTP requests call a REST API returning a JSON object, that is iterated
and produces a CONTACT header containing multiple choices using
the append_branch() command.
The RELAY route is :
route[RELAY] {
# Sends a 300 Multiple Choices back to the proxy that requested the
routing lookup
xlog("L_INFO","REPLY_302 - send reply");
send_reply("300", "Multiple Choices");
xlog("L_INFO","REPLY_302 - exit");
exit;
}
Which returns indeed a Contact header with multiple contact choices.
When using Asterisk to originate a call to Kamailio, the SIP call flow is
as follows and terminates (SNGrep and TCPDump do not detect anything else):
SRC DST
INVITE (SDP)
──────────────────────────>
100 trying -- your call is
<──────────────────────────
300 Multiple Choices
<──────────────────────────
ACK
──────────────────────────>
However when using SIPp I get some retransmissions after the final ACK.
SRC DST
INVITE (SDP)
──────────────────────────>
100 trying -- your call is
<──────────────────────────
300 Multiple Choices
<──────────────────────────
ACK
──────────────────────────>
300 Multiple Choices
<<<────────────────────────
300 Multiple Choices
<<<────────────────────────
300 Multiple Choices
<<<────────────────────────
SIPp scenario is :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="Basic Sipstone UAC">
<!-- In client mode (sipp placing calls), the Call-ID MUST be -->
<!-- generated by sipp. To do so, use [call_id] keyword.
-->
<send retrans="500" start_rtd="true" rrs="true">
<![CDATA[
INVITE sip:[call_number]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
Max-Forwards: 70
From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
To: <sip:[call_number]@[remote_ip]:[remote_port]>
Contact: sip:sipp@[local_ip]:[local_port];transport=[transport]>
Call-ID: [call_id]
CSeq: 102 INVITE
User-Agent: SIPp
Supported: replaces, timer
Content-Type: application/sdp
Subject: Performance Test
Session-Expires: 3600;refresher=uas
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=SIPp
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
</send>
<recv response="100" rss="true"> </recv>
<recv response="300" rtd="true" rss="true">
<action>
<ereg regexp="\<([a-zA-Z0-9@.=;]+)[^>]+"
search_in="hdr"
header="Contact: "
assign_to="1"/>
<log message="INFO: 300 Contact Header: [$1]" />
<exec command="echo [$1] >> ./300_ContactHeader.txt" />
</action>
<action>
<ereg regexp="sip:.*@([0-9A-Za-z\.]+):([0-9]+);transport=([A-Z]+)"
search_in="hdr" header="Contact:" check_it="true"
assign_to="dummy,host,port,transport" />
</action>
</recv>
<!-- Reference variables="dummy" /-->
<!-- Send ACK for 180 Ringing
ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 -->
<send rrs="true">
<![CDATA[
ACK sip:[call_number]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
Max-Forwards: 70
From: <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
To: <sip:[call_number]@[remote_ip]:[remote_port]>[peer_tag_param]
Contact: <sip:sipp@[local_ip]:[local_port]>
Call-ID: [call_id]
CSeq: 102 ACK
User-Agent: SIPp
Content-Length: 0
]]>
</send>
<!-- definition of the response time repartition table (unit is ms) -->
<!-- ResponseTimeRepartition value="10, 50, 100, 150, 200, 500, 1000"/ -->
</scenario>
The question is : is there anything wrong with my kamailio script? or with
SIPp scenario? why does kamailio have different behaviours between Asterisk
and SIPp?
Any option to disable retransmissions on Kamailio ? (using UDP)
Thanks in advance,
*Sérgio Charrua*
Hi all,
I am using Kamailio 5.8.1 on a Debian 12 machine with topos and topoh
hiding the topology.
I have observed with modparam("topos", "mask_callid", 1), in-dialog
requests are relayed with the incorrect caller-id.
In the scenario, A calls B. The call is set up and the call-id for the
B-Leg is successfully masked. Then, when A sends a BYE, the BYE is
incorrectly relayed to B with the call-id of the A leg, and B replies with
a 481
If I disable masking the call-id, or disable topos/topoh entirely,
everything looks and works as it should. I have tested with 5.7.4 and the
behaviour is the same.
Does anyone have any ideas for where I should start looking?
Thanks
Matthew
Hi.
I have a question re: IMS SCSCF redundancy.:There are several SCSCF
instances, registration happens via SCSCF1, it goes down after that. UE
make MO call.. PCSCF resolves the common SCSCF fqdn and sends an invite to
available SCSCF2 which does not have UE profile as well as AS address
(which is received during registration SAR/SAA in iFC). There are 2 options
here, either to release the call (as per 3gpp spec upon specific release
code, eg 408/503 UE should perform re-registration - not happen in our case
unfortunately), or to send request for iFC (suspend the call, fire SAR,
receive SAA, check available services, etc) and upon success continue the
call (to AS first)/ Lke IMS Registrar SCSCF save function, but for the
invite. To continue the call without interaction with AS is not a good
idea..
Any advice or workaround on how to achieve desired SCSCF redundancy ?
--
obelousov.tel
Hello!
I have a problem when sending a response sl_send_reply("415", "The other party does not support video calling!"); in route[HTTP_REPLY].
When I make a request using http_async_query() to send a push notification to a mobile device, I need to process the response from the push server and respond with a SIP message to the client. Before sending the request I do $http_req(suspend) = 0;
What am I doing wrong? Why are $fU and $ru equal to null ?
#processing HTTP responses
route[HTTP_REPLY] {
if ($http_ok && $http_rs == 200) {
xlog("L_INFO", "route[HTTP_REPLY]: status $http_rs\n");
xlog("L_INFO", "route[HTTP_REPLY]: body $http_rb\n");
} else if($http_rs == 415 || $http_rs == "415") {
xlog("L_ERR", "route[HTTP_REPLY]: caller: $fU phone: $ru error: $http_err)\n");
send_reply("415", "The other party does not support video calling!");
} else {
xlog("L_ALERT", "route[HTTP_REPLY]: error $http_err)\n");
}
#exit;
}
Hi everyone. We are new to Kamailio and using Kamailio 5.8 with FreeSwitch.
We have the issue with the incoming call from our provider. They are dropping after 30 seconds. The client doesn't receive ACK from Kamailio. But FreeSwitch sends ACK to Kamailio. The outbound call is working fine. At the moment flow is our provider -> FreeSwitch -> Kamailio -> our web client. Could someone give us some directions please? Please find attached Kemi.py.
Thank you so much in advance

Hi all,
i have a problem with my Kamailio SIP Server.
I set up a Kamailio SIP server in a virtual machine on a private network and i connect to this with a WireGuard VPN.
The problem is that i can connect to the SIP server throught different clients and users and i can call the other users, the devices ring and i can answer to the calls but unfortunatly there is no audio during the call :(
I can't understand why, it seems all si OK, a year ago i set up another SIP server with the same configuration and all works correctly with it.
Can anyone help me to understand why? I can copy and paste here all the config files if you need it.
Thank you so much in advance
Christian
As an Official Adobe Bronze Solution Partner, we specialize in AEM development services, consulting, implementation, migration, and cloud services for your business.
Hello
Can anyone help answer these questions:
- if SIP Timer L and Timer M from RFC6026 has been defined at Kamailio (version v5.5.x)?
Timer L: Wait time for accepted INVITE request retransmits
Timer M: Wait time for retransmission of 2xx to INVITE or additional 2xx from other branches of a forked INVITE
- if no specific Timer defined, which timer will be used instead?
thanks
br
jenni