Hello,
I have kamailio and rtpproxy running on the same server located behind a
router with NAT just like below.
UA(internet)---public ip---router(NAT)--Kamailio+RTPproxy(private
ip)--UA(private network)
There are several issues like one way audio.
I need users on the internet to communicate with each other, users on the
private network to communicate with each other, and users on the internet
and the private network to communicate with each other.
What is the best approach?
Best regards,
Clarence
Hi guys!
We have four a scripts that sends dlg.list command to kamailio through
xmlrpc. They are not executed simultaneously. Sometimes, we are getting
the following errors:
fm_search_defrag(): fm_search_defrag(0x7f212c25a000, 5273984); Free
fragment not found!2017-05-26T13:54:20.438736-03:00 drwsip02
/usr/local/sbin/kamailio[19833]: ERROR: <core> [mem/f_malloc.c:498]:
fm_malloc(): fm_malloc(0x7f212c25a000, 5273984) called from core:
tcp_main.c: tcpconn_new(957), module: core; Free fragment not
found!2017-05-26T13:54:20.439101-03:00 drwsip02
/usr/local/sbin/kamailio[19833]: ERROR: <core> [tcp_main.c:959]:
tcpconn_new(): mem. allocation failure2017-05-26T13:54:20.439344-03:00
drwsip02 /usr/local/sbin/kamailio[19833]: ERROR: <core> [tcp_main.c:3985]:
handle_new_connect(): tcpconn_new failed, closing socket
I all ready increased this two variables:
tcp_conn_wq_max=30000000
tcp_rd_buf_size=5273226
How can I see how much memory xmlrpc is using?
Any advice will be appreciated.
Thanks in advance!
Diego
Hi!
I am working successfully with Kamailio in my lab setup where Kamailio is
the SBC for Asterisk.
The network layout is looking like this:
SIP-Phone <== PUBLIC NET ==> Kamailio (SBC) <== PRIVATE NET ==> Asterisk
<== PUBLIC NET ==> Carrier
Each public network is reachable from the internet and has a local firewall
with IP whitelists.
The internal SIP transactions are UDP-only but for external phones I would
like to also listen for TCP/TLS.
For this layout to work with rtpproxy (before we move on to RTPengine), we
have to enable mhomed in Kamailio.
We also have some routing issues with packets leaving with the wrong IP via
rtpproxy (when call between carrier and external phone needs to be bridged).
Most examples show that Asterisk is deployed on the same network as the
external interface of Kamailio (-> Asterisk exposed to the public network).
In our tests, this works much better but I have great security concerns
because this Asterisk instance itself does not need to be reachable from
external.
How do other users deploy Kamailio in front of Asterisk or similar as SBC
to secure internals?
There is lot of docs for Kamailio's config but IMHO less for the setup as
DMZ (SBC) proxy.
Thank you very much.
Kind regards
Kevin
Kamailio didn't start listening on IP mentioned in Module RTPPROXY parameter Timeout_Socket<https://kamailio.org/docs/modules/5.1.x/modules/rtpproxy.html#rtpproxy.p.ti…>.
Below is my configuration file.
loadmodule "rtpproxy.so"
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
modparam("rtpproxy", "rtpproxy_tout", 1)
modparam("rtpproxy", "rtpproxy_retr", 2)
modparam("rtpproxy", "timeout_socket", "xmlrpc:http://127.0.0.1:8000/RPC2")
loadmodule "xmlrpc.so"
modparam("xmlrpc", "route", "XMLRPC");
modparam("xmlrpc", "mode", 1)
modparam("xmlrpc", "url_match", "^/RPC2")
when I type a command
$ netstat -nlp
it only shows SIP listening ports. Kamailio should also start listening on 127.0.0.1:8000.
Below are the RTPproxy logs, RTPproxy is also unable to bridge the media
DBUG:get_command:GLOBAL: received command "19083_4 Uc120,101 9a1060af660d4202976c419ab5300470 58.65.176.42 4000 1ea06d1eb0a8443697a08e568045598c;1"
INFO:rtpp_command_ul_handle:GLOBAL: new session 9a1060af660d4202976c419ab5300470, tag 1ea06d1eb0a8443697a08e568045598c;1 requested, type strong
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: new session on a port 35012 created, tag 1ea06d1eb0a8443697a08e568045598c;1
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: pre-filling caller's address with 58.65.176.42:4000
DBUG:rtpc_doreply:GLOBAL: sending reply "35012 51.38.201.3
"
DBUG:get_command:GLOBAL: received command "19083_5 Uc120,101 9a1060af660d4202976c419ab5300470 58.65.176.42 4022 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq;1 1ea06d1eb0a8443697a08e568045598c;1 xmlrpc:http://127.0.0.1:8000/RPC2"
INFO:rtpp_command_ul_handle:GLOBAL: new session 9a1060af660d4202976c419ab5300470, tag 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq;1 requested, type strong
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: new session on a port 35014 created, tag 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq;1
ERR:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: invalid socket name 1ea06d1eb0a8443697a08e568045598c;1
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: pre-filling caller's address with 58.65.176.42:4022
DBUG:rtpc_doreply:GLOBAL: sending reply "35014 51.38.201.3
"
DBUG:get_command:GLOBAL: received command "19086_4 D 9a1060af660d4202976c419ab5300470 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq 1ea06d1eb0a8443697a08e568045598c"
INFO:handle_delete:9a1060af660d4202976c419ab5300470: forcefully deleting session 1 on ports 35012/0
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTP stats: 0 in from callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTCP stats: 0 in from callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: session on ports 35012/0 is cleaned up
INFO:handle_delete:9a1060af660d4202976c419ab5300470: forcefully deleting session 1 on ports 35014/0
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTP stats: 0 in from callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTCP stats: 0 in from callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: session on ports 35014/0 is cleaned up
DBUG:rtpc_doreply:GLOBAL: sending reply "0
"
DBUG:get_command:GLOBAL: received command "19086_5 D 9a1060af660d4202976c419ab5300470 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq 1ea06d1eb0a8443697a08e568045598c"
INFO:handle_command:GLOBAL: delete request failed: session 9a1060af660d4202976c419ab5300470, tags 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq/1ea06d1eb0a8443697a08e568045598c not found
DBUG:rtpc_doreply:GLOBAL: sending reply "E50
But if I comment out the param "Timeout_Socket" then there is no issue in bridging the media.
Regards
Hamid R. Hashmi
Hi All,
I'm facing a strange problem of missing ACC record in case of parallel
call forking.
The scenario is the following:
- A subscriber with 1 device registered
- B subscriber with 2 device registered (B1 and B2)
CASE 1:
- A calls B
- B1 and B2 start ringing
- A hangups the call before B1 or B2 answers
Kamailio generates an ACC record.
CASE 2:
- A calls B
- B1 and B2 start ringing
- B1 rejects the call sending back a 486
- B2 is still ringing
- A hangups the call before B2 answers
Kamailio DOESN'T generate an ACC record.
We have Kamailio v5.1.4 with TM module enabled.
ACC configuration is the following:
modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 1)
modparam("acc", "detect_direction", 1)
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)
modparam("acc", "failed_transaction_flag", 3)
I increased debug level of TM and ACC modules and I added some debug
lines as well.
The difference between the two calls is that, after the CANCEL sent by A
is processed by Kamailio, in CASE 1 I have the following lines:
Aug 28 14:21:11 spce proxy[13188]: DEBUG: tm [t_hooks.c:258]:
run_trans_callbacks_internal(): DBG: trans=0x7f5a88049198, callback type
512, id 0 entered
Aug 28 14:21:11 spce proxy[13188]: DEBUG: acc [acc_logic.c:670]:
tmcb_func(): acc callback called for t(0x7f5a88049198) event type 512,
reply code 487
Aug 28 14:21:11 spce proxy[13188]: DEBUG: acc [acc_extra.h:63]:
free_strar_mem(): Freeing memory, type is 2, message_index 8, index i 0
Aug 28 14:21:11 spce proxy[13188]: DEBUG: acc [acc_extra.h:63]:
free_strar_mem(): Freeing memory, type is 2, message_index 8, index i 1
Aug 28 14:21:11 spce proxy[13188]: DEBUG: acc [acc_extra.h:63]:
free_strar_mem(): Freeing memory, type is 2, message_index 8, index i 2
Aug 28 14:21:11 spce proxy[13188]: DEBUG: acc [acc_extra.h:63]:
free_strar_mem(): Freeing memory, type is 2, message_index 8, index i 3
Aug 28 14:21:11 spce proxy[13188]: DEBUG: acc [acc_extra.h:63]:
free_strar_mem(): Freeing memory, type is 2, message_index 8, index i 4
Those debug lines are not printed for CASE 2.
Is there any configuration I'm missing or is it a bug?
Thank you very much for your support.
Marco
Kamailio SIP Server project is organizing a meeting of its developers
during September 27-28, 2018, hosted by sipgate.de in Dusseldorf, Germany.
The event is intended to facilitate the interaction between Kamailio
developers and to offer a convenient environment for working together on
several topics of high interest for the project, including writing code
for Kamailio and its tools, improving documentation, or discuss about
future development.
Everyone from the community is welcome to join. Please note we have a
limited capacity of 20 seats in the meeting room. Also, very important
to be aware that this is not an event to learn how to use Kamailio.
More details about the event, the venue, how to register, are available at:
- https://www.kamailio.org/w/developers-meeting/
Looking forward to those two intensive hacking Kamailio days in Dusseldorf!
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference -- www.kamailioworld.com
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.com
Hello
Although my question it's not related to Kamailio directly, but i think
someone could help in this strange behavior
in our tests, we have some clients under private networks, where the
provider of those networks implements CGNAT (NAT444) for it's customers to
reach internet
(Client Private IP) --->(Home router: Private to Private NAT)--->(FW with
CGNAT)---------------------------->(Kamailio Proxy Public IP)
Registration is performing fine, but making calls from this client had
strange problem as follow:
Client -------------INVITE--------------> Proxy
Proxy -------------Trying---------------->Client
Proxy--------------INVITE---------> Called Party
The called party should send Ringing msg, but the massage get lost
somewhere and didn't reach to the Proxy. Although all the IP's in sip
massages are public
i tried with STUN/TURN and NAThelper module solutions, but didn't help
is there any way to slove CGNAT with SIP in Kamailio?
Thanks in Advance
Hello,
Kamailio SIP Server v5.1.5 stable release is out.
This is a maintenance release of the latest stable branch, 5.1, that
includes fixes since the release of v5.1.4. There is no change to
database schema or configuration language structure that you have to do
on previous installations of v5.1.x. Deployments running previous v5.1.x
versions are strongly recommended to be upgraded to v5.1.5.
For more details about version 5.1.5 (including links and guidelines to
download the tarball or from GIT repository), visit:
* https://www.kamailio.org/w/2018/08/kamailio-v5-1-5-released/
RPM, Debian/Ubuntu packages will be available soon as well.
Many thanks to all contributing and using Kamailio!
Cheers,
Daniel
--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com
Hello,
We're running three instances of Kamailo v5.14 as registrars handling
registrations from ~2000 SIP clients, with one instance being primary and
the other two as backups.
The three of them are using the dmq and dmq_usrloc modules to synchronize
user locations, however after a couple of days of operation the two
failover instances show memory leak behaviors, with mem usage assigned to
the core taking all available resources.
When this happens we've noticed that:
- The shared memory used by the function "sip_msg_shm_clone" spikes (from
1kb to 1.5GB).
- The shared memory used by the function "dmq:worker.c:job_queue_push"
also increases, but not as much (from 1kb to 1MB)
- DMQ request are not being answered (with a 200 OK) by the affected
instance during this memory leak, which make us think that DMQ module
becomes unresponsive.
A few more notes:
- The failover instances are doing nothing except receiving replicated
contacts.
- The shared memory grows at the same rate on both instances, but the
critical behavior never happens at the same time.
- We are allocating 1GB memory on startup to each instance.
- We store the location DB in a psql DB and we load it at startup.
- We didn't find any errors in syslog, even at debug level.
Has anyone experienced a similar issue who can suggest a possible solution?
Thanks,
Rogelio Perez
Telnyx
Hi,
In a previous post ([SR-Users] Questions about changes between 5.0.1 and
5.0.7
<https://lists.kamailio.org/pipermail/sr-users/2018-August/102442.html> ), I
reported problem to upgrade my kamailio from 5.0.1 to 5.0.7-7 level.
With help from some people, it was finally fixed on my test server in my
lab.
Now I was expecting to do the same upgrade on a real server using these
packages:
kamailio-5.0.7-7.el7.x86_64.rpm
kamailio-ims-5.0.7-7.el7.x86_64.rpm
kamailio-mysql-5.0.7-7.el7.x86_64.rpm
kamailio-perl-5.0.7-7.el7.x86_64.rpm
kamailio-snmpstats-5.0.7-7.el7.x86_64.rpm
But kamailio failed to connect the local MySQL server :
Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]:
DEBUG: <core> [db.c:209]: db_bind_mod(): using db bind api for db_mysql
Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]:
DEBUG: <core> [db.c:314]: db_do_init2(): connection 0x7fef779958f8 not found
in pool
Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]:
DEBUG: db_mysql [km_my_con.c:98]: db_mysql_new_connection(): opening
connection: mysql://xxxx:xxxx@localhost/siprouter
Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]:
ERROR: db_mysql [km_my_con.c:129]: db_mysql_new_connection(): driver error:
Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (13 "Permission denied")
Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]:
ERROR: <core> [db.c:318]: db_do_init2(): could not add connection to the
pool
Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]:
ERROR: htable [ht_db.c:92]: ht_db_open_con(): failed to connect to the
database
Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]:
ERROR: <core> [core/sr_module.c:974]: init_mod(): Error while initializing
module htable (/usr/lib64/kamailio/modules/htable.so)
My "kamailio.cfg" contains the following command:
modparam("htable", "db_url",
"mysql://siprouter:password@localhost/siprouter")
The service unit : "/usr/lib/systemd/system/kamailio.service" content is :
[Unit]
Description=Kamailio (OpenSER) - the Open Source SIP Server
After=network.target mysql.service
[Service]
Type=simple
User=kamailio
Group=kamailio
Environment='CFGFILE=/etc/kamailio/kamailio.cfg'
Environment='SHM_MEMORY=1024'
Environment='PKG_MEMORY=8'
EnvironmentFile=-/etc/sysconfig/kamailio
ExecStart=/usr/sbin/kamailio -DD -P /var/run/kamailio/kamailio.pid -f
$CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY
Restart=on-failure
[Install]
WantedBy=multi-user.target
The "/etc/sysconfig/kamailio" content is :
#
# Kamailio startup options
#
#
# Kamailio startup options
#
# Set to yes to enable kamailio, once configured properly.
RUN_KAMAILIO=yes
# User to run as
USER=kamailio
# Group to run as
GROUP=kamailio
# Amount of shared memory to allocate for the running Kamailio server (in
Mb)
SHM_MEMORY=1024
# Amount of per-process (package) memory to allocate for Kamailio (in Mb)
PKG_MEMORY=8
Below the existing user in mysql :
mysql:root:(none)> use mysql;
Database changed
mysql:root:mysql> select user,host from user;
+-----------+-----------+
| user | host |
+-----------+-----------+
| myadmin | % |
| siprouter | % |
| kamailio | localhost |
| root | localhost |
+-----------+-----------+
I have a symlink to locate the my.cnf : ln -s /myqdata/mysiprdb/data/my.cnf
/etc/my.cnf
And also this link to fix a htable reload problem : ln -s
/myqdata/mysiprdb/data/mysiprdb.sock /var/lib/mysql/mysql.sock
I don't find what the problem is this time.
So if there is people that could help on the issue, thanks in advance.
Cordialement.
Patrick GINHOUX