Hi,
Can any one help me with an example for RPC command sent over http?
My configuration works OK, I get the http request fine.
I lack the knowledge of how to send commands.....
For example, how do I send a command to list dialogs (dlg.list)?
Or to profile_get_size ?
Http://myserver:myport/http_rpc/dlg/?????????
Thanks,
Uri
I am using the following script to ban users failing to authenticate with
fail2ban:
My problem is that it logs attempts of users only existing to the database
I would like to modify it in order to log all FAILED authentication attempts
Is this possible?
# Authentication route
route[AUTH] {
#!ifdef WITH_AUTH
if(is_present_hf("Authorization"))
{
if($sht(a=>$au::auth_count)==3)
{
$var(exp) = $Ts - 900;
if($sht(a=>$au::last_auth) > $var(exp))
{
sl_send_reply("403", "Try later");
exit;
} else {
$sht(a=>$au::auth_count) = 0;
}
}
if(!www_authenticate("$td", "subscriber"))
{
switch ($retcode) {
case -1:
sl_send_reply("403", "Forbidden");
exit;
case -2:
#fixed null -> $null:
if($sht(a=>$au::auth_count) == $null)
$sht(a=>$au::auth_count) = 0;
$sht(a=>$au::auth_count) = $sht(a=>$au::auth_count) + 1;
xlog("User $fu Authenticating from ip $si\n");
if($sht(a=>$au::auth_count) == 3)
xlog("User $fU Authenticating for the 3d time from ip $si\n");
$sht(a=>$au::last_auth) = $Ts;
break;
}
www_challenge("$td"/*realm*/,"0"/*qop*/);
exit;
}
$sht(a=>$au::auth_count) = 0;
} else {
www_challenge("$td","0");
exit;
}
}
#!endif
i send sip reg request to kamailio then i dump tcp thent i got sip request
like(INVITE ,TO,FROM ,via header file)
but in kamailio.log file i am not got sip request what i need to do please
help me
my kamailio.log print this log in my terminal
/usr/local/sbin/kamailio[25086]:INFO:<core>[main.c:798]:sig_usr():Signal 15
received
/usr/local/sbin/kamailio[15085]:INFO:<core>[main.c:798]:sig_usr():Signal 15
received
/usr/local/sbin/kamailio[15079]:INFO:<core>[sctp_core.c:53]:sctp_core_destroy():SCTP
API not initialized
/usr/local/sbin/kamailio[15079]:INFO:<core>[sctp_core.c:75]:sctp_core_check_support():SCTP
API not enabled-if you want to use it load sctp module
/usr/local/sbin/kamailio[23190]:INFO:rr[../outbound/api.h:54]:ob_load_api():failed
to import bind_ob
/usr/local/sbin/kamailio[23190]:INFO:rr[rr-mod.c:174]:mod_init():outbound
module not available
/usr/local/sbin/kamailio[23190]:INFO:usrloc[hslot.c:51]:ul_init_locks():locks
aaray size 1024
/usr/local/sbin/kamailio[23190]:INFO:<core>[udp_server.c:150]:probe_max_receive_buffer():SO_RCVBUF
is initially 163840
/usr/local/sbin/kamailio[23190]:INFO:<core>[udp_server.c:150]:probe_max_receive_buffer():SO_RCVBUF
is finally 327680
/usr/local/sbin/kamailio[23198]:INFO:ctl[io_listener.c:210]:io_listen_loop():io_listen_loop:using
epoll_lt as the io watch method (auto detected)
i want to print
INVITE
TO
FROM
Via
header file in my kamailio.log
Hi Guys,
Using Centos 6.7, kamailio 4.2 and Ucarp I am testing multiple VIPs on the same server and having some issues.
I have ucarp running, with 1 Public and 1 Private VIP defined, and both are pingable and failover in a cluster.
The Public is for Subscribers to Register with, and the Private for Communication to the Asterisk media servers behind it.
My problem is kamailio when started states its listening on both the VIPS, however when I try and force_socket over the Private IP address, it states
ERROR: <core> [forward.c:218]: get_out_socket(): no socket foundMar 1 20:04:35 bt1proxy1 /usr/sbin/kamailio[20372]: ERROR: <core> [forward.c:220]: get_out_socket(): no corresponding socket found for(udp:10.70.0.72:5080)Mar 1 20:04:35 bt1proxy1 /usr/sbin/kamailio[20372]: ERROR: tm [t_fwd.c:520]: prepare_new_uac(): ERROR: can't fwd to af 2, proto 1 (no corresponding listening socket)
This is when listening on the VIP which is 10.70.0.75 and I also look to force_socket out of this IP. It just doesnt work, however if I use the physical interface on the server, that being 10.70.0.70, it works fine and forwards requests on the Private LAN.
I have added net.ipv4.ip_nonlocal_bind = 1 to sysctl.conf as well but no joy.
If 1 VIP is defined I have no issue, its just with 2, has anyone had this issue before ?
Any help would be great.
Many thanks
Jon
Hi:
I am sure this has been answered before on this list and I have tried the basic
answers I got from Google without any luck. Any suggests would be great.
The Kamailio host is running Oracle Linux 6.7 (64 bit) and is fully patched as
of today.
The Kamailio version is:
Server:: kamailio (4.3.4 (x86_64/linux))
Build:: mi_core.c compiled on 14:25:16 Nov 25 2015 with gcc 4.4.7
I have two major issues:
I am seeing this on my Kamailio log:
Mar 14 21:55:33 sipserver /usr/sbin/kamailio[24005]: ERROR: rtpproxy
[rtpproxy.c:1681]: send_rtpp_command(): can't send command to a RTP proxy
Mar 14 21:55:33 sipserver /usr/sbin/kamailio[24005]: ERROR: rtpproxy
[rtpproxy.c:1716]: send_rtpp_command(): proxy <udp:127.0.0.1:7722> does not
respond, disable it
Mar 14 21:55:33 sipserver /usr/sbin/kamailio[24005]: WARNING: rtpproxy
[rtpproxy.c:1573]: rtpp_test(): can't get version of the RTP proxy
Mar 14 21:55:33 sipserver /usr/sbin/kamailio[24005]: WARNING: rtpproxy
[rtpproxy.c:1610]: rtpp_test(): support for RTP proxy <udp:127.0.0.1:7722> has
been disabled temporarily
So the initial thought is that the proxy is not running, however I can see the
proxy is alive:
[root@sipserver boot]# ps -All | grep rtpproxy
5 S 498 2843 1 1 80 0 - 32524 hrtime ? 01:29:06 rtpproxy
When I do "netstat -a", I can see 24 established connections.
This is a small sample:
udp 0 0 localhost:47937 localhost:rtpproxy
ESTABLISHED
udp 0 0 localhost:38746 localhost:rtpproxy
ESTABLISHED
udp 0 0 localhost:33660 localhost:rtpproxy
ESTABLISHED
So I am not sure what is going on.
The second problem:
I see this in the Kamailio log:
Mar 14 22:05:33 sipserver /usr/sbin/kamailio[24000]: ERROR: db_mysql
[km_dbase.c:124]: db_mysql_submit_query(): driver error on query: PROCEDURE
kamailio.kamailio_rating does not exist (1305)
Mar 14 22:05:33 sipserver /usr/sbin/kamailio[24000]: ERROR: <core>
[db_query.c:181]: db_do_raw_query(): error while submitting query
Mar 14 22:05:33 sipserver /usr/sbin/kamailio[24000]: ERROR: sqlops
[sql_api.c:265]: sql_do_query(): cannot do the query [call
kamailio_rating('default')]
When I tried to create the database originally, the script that was part of the
package would not work. I therefore manually created the database so I am
thinking that something got left out. I have been over the schema and I am not
sure what is missing. The database is MySQL (5.5) running in a separate host.
Does anyone have an idea where to look what is missing? I was told that there is
some sort of script that can "repair" the Kamailio schema in the database but I
have not been able to find this magical script.
Thanks.
Kevin
I am using kamailio without database.
It works fine.
For some scenario, I would like to replace the from uri (using
mac_replace_from works fine) but using data I can accessed with a REST API.
I want to have different origination depending on the sipusername.
I need to have some synchronous request.
Have someone already these type of behaviour ?
Regards
Thibault
Hi everyone
How can I generate a random port number, one that is currently available to bind to.
I want to assign this to the media parameter in the sdp
thanks
Hi Cristina,
> But I have another problem related to registration process. After REGISTER-
> 401 Unauthorized-REGISTER-200 OK, the IMS client sends the SUBSCRIBE
> message (for the "reg" event package subscription) to the S-CSCF, the latter
> replies with NOTIFY and the client correctly responds with 200 OK. In order to
> be notified on any change of registration state for the client, also the P-CSCF
> sends the SUBSCRIBE message to the S-CSCF, the S-CSCF sends a NOTIFY to
> the proxy but, instead of replying with 200 OK, the P-CSCF replies with 404-
> Not Here (like it doesn't recognize that the recipient of the NOTIFY in the
> Req-URI is the P-CSCF itself).
>
> Have you ever seen similar issue?
I have now spent some time to reproduce the issue.
First of all: I had to adapt module reg_mod.c in ims_registrar_pcscf, because it containes a hardcoded P-CSCF address:
str pcscf_uri = str_init("sip:pcscf.ims.smilecoms.com:4060");
which is only valid for smilecoms.
Did you also change that?
Then I got exactly the same problem. I found that the P-CSCF config causes in the part "# Check for Subsequent requests:" a reject " sl_send_reply("404","Not here");"
I have doubts that this is correctly designed and have to dig deeper into the logic of the config-file.
Fact is: the NOTIFY request does not contain a Route header and as it not an ACK it goes straight to the reject.
Maybe any IMS expert can shed some light on this code as shown below:
# Check for Subsequent requests:
if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
if ($route_uri =~ "sip:mo@.*") {
setflag(FLT_MO);
}
if(!isdsturiset()) {
handle_ruri_alias();
}
# RTP-Relay, if necessary
route(RTPPROXY);
t_relay();
} else {
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# no loose-route, but stateful ACK;
# must be an ACK after a 487
# or e.g. 404 from upstream server
t_relay();
exit;
} else {
# ACK without matching transaction ... ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
BR Franz
Hi,
we have a load balancer which is handling a lot of SIP traffic all day.
There's always 20-40 Mbit SIP traffic going through. From time to time we
see in our logs messages like these:
Sep 16 09:46:28 ecker /usr/sbin/kamailio[25505]: ERROR: <core>
[udp_server.c:591]: udp_send(): ERROR: udp_send:
sendto(sock,0x7f2d9d6b3ce0,1321,0,46.237.225.126:5060,16): Operation not
permitted(1)
Sep 16 09:46:38 ecker /usr/sbin/kamailio[25194]: ERROR: <core>
[udp_server.c:591]: udp_send(): ERROR: udp_send:
sendto(sock,0x7efc982b8fc8,420,0,82.113.121.183:35794,16): Operation not
permitted(1)
Sep 16 09:46:40 ecker /usr/sbin/kamailio[25505]: ERROR: <core>
[udp_server.c:591]: udp_send(): ERROR: udp_send:
sendto(sock,0x7f2d9d6b3ce0,1338,0,5.158.137.9:55067,16): Operation not
permitted(1)
Sep 16 09:46:44 ecker /usr/sbin/kamailio[25183]: ERROR: <core>
[udp_server.c:591]: udp_send(): ERROR: udp_send:
sendto(sock,0x7efc982d9f48,450,0,178.165.131.197:37515,16): Operation not
permitted(1)
Sep 16 09:46:49 ecker /usr/sbin/kamailio[25643]: ERROR: <core>
[udp_server.c:591]: udp_send(): ERROR: udp_send:
sendto(sock,0x7f93fb624530,496,0,172.56.7.69:25643,16): Operation not
permitted(1)
Sep 16 09:46:55 ecker /usr/sbin/kamailio[25335]: ERROR: <core>
[udp_server.c:591]: udp_send(): ERROR: udp_send:
sendto(sock,0x7f41632cda98,598,0,80.215.234.139:3396,16): Operation not
permitted(1)
Sep 16 09:46:56 ecker /usr/sbin/kamailio[25345]: ERROR: <core>
[udp_server.c:591]: udp_send(): ERROR: udp_send:
sendto(sock,0x7f41632f4840,459,0,94.197.120.191:8225,16): Operation not
permitted(1)
I know that these messages can be produced by iptables blocking the
outbound traffic. But our outbound chain looks basically like this:
root@ecker:~# iptables-save | grep OUTPUT
:OUTPUT DROP [0:0]
-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-j ACCEPT
-A OUTPUT -m state --state INVALID -j DROP
-A OUTPUT -o lo -m state --state NEW -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -m state --state NEW -j ACCEPT
We don't have the nf_ct_sip module loaded, syslog doesn't say anything, and
even clearing all iptables rules doesn't eliminate those errors.
Has anyone ever seen this? It looks like a load thing, because at weekends
there are significantly less errors.
Thanks,
Sebastian