Hi,
Is there any configuration to fetch SIP response body received?.
My requirement is to fetch the SIP response body and save it into database.
Thanks,
Vivek
Hi,
I'm a beginner in the use of kamailio product, so I try below to explain my problem with my words:
1) PERL module issue :
Some years ago a SIP Router proxy running RedHat 6.2 was developped using the kamailio version 3.3 and the following packages used :
kamailio-3.3.2-1.1.1.x86_64.rpm
kamailio-snmpstats-3.3.2-1.1.1.x86_64.rpm
kamailio-mysql-3.3.2-1.1.1.x86_64.rpm
kamailio-perl-3.3.2-1.1.1.x86_64.rpm
We have the project to migrate this SIP Proxy to RedHat 7.1 and used the latest Kamailio v5.0.0 Release:
kamailio-5.0.0-24.1.x86_64.rpm
kamailio-mysql-5.0.0-24.1.x86_64.rpm
kamailio-snmpstats-5.0.0-24.1.x86_64.rpm
However I don't find the kamalio-perl package for RedHat 7.1. I see that the perl module has been renamed to 'app_perl' but I don't find it either for kamailio 5.0.0.
2) Kamailio.cfg script
Our proxy used the kamailio.cfg from the sample of the 3.3.3 release.
So can I reuse the same 3.3.3 kamailio.cfg file with the 5.0.0 release or should I migrate (rewrite it) from the 5.0.0 sample ?
So I'm looking for some help on these issues.
Is there people that had this case ?
Thanks in advance for any answer.
Cordialement
Patrick GINHOUX
PS : I just create my account today but don't get the email to validate it.
Hi Guys,
Who knows and can recommend a company a company where I could order Toll
free numbers for EU?.
I really appreciate any hint and sorry for the noise.
Regards,
--
Alberto Llamas
Telecommunications Engineer
dCAP | KPAC | SSCA
*"Internet is all about share"*
Hi guys,
we have a bunch of SIP phones behind a fire wall, with our kamalio
server out on the internet. Most of them are the older SPA92x series,
but we have some new SPA502g's.
We have no problems calling between 92x and 502's. How ever the 502's
calling each other do not get voice path.
I have noticed that the phones REGISTER differently:
AOR:: 5546@<our domain>
Contact:: sip:5546@<OUR OFFICE IP>:1032 Q=
Expires:: 180
Callid:: 4754c4f9-c67e1018(a)10.0.41.29
Cseq:: 43112
User-agent:: Cisco/SPA502G-7.6.2a
State:: CS_DIRTY
Flags:: 0
Cflag:: 0
Socket:: udp:<OUR SR IP>:5060
Methods:: 6815
AOR:: 5590(a)sip.skunkworks.net.au
Contact:: sip:5590@10.0.41.14:5060 Q=
Expires:: 1154
Callid:: 24435738-224b06db(a)10.0.41.14
Cseq:: 8012
User-agent:: Linksys/SPA921-5.1.8
Received:: sip:<OUR OFFICE IP>:1026
State:: CS_SYNC
Flags:: 0
Cflag:: 64
Socket:: udp:<OUR SR IP>:5060
Methods:: 4767
The older 921 has its private IP in the contact, where as the newer 502
has the external IP of our office in the contact.
Our file wall is a Watchguard T-10 (latest updates etc) with the SIP-ALG
running.
Any thoughts on where to start looking ?
Cheers,
Ben.
H all,
Recently, when I'm trying to load test Kamailio with a single proxy, it hung
at around 15000 TPS. I attached gdb to one of the kamailio processes and I
saw this:
(gdb) where
#0 0x00007fa8872366ad in __libc_send (fd=13, buf=0x7ffe6e0e5350, n=16,
flags=-2027723091) at ../sysdeps/unix/sysv/linux/x86_64/send.c:27
#1 0x00000000004eb635 in send_all (socket=13, data=0x7ffe6e0e5350,
data_len=16) at pass_fd.c:133
#2 0x00007fa4155a1b69 in tcp_close_connection (conn_id=28022) at
tcp_funcs.c:199
#3 0x00007fa4155a363f in cleanup (start=0x7fa4540c3ab8, end=0x7fa42f92dca0)
at tcp_funcs.c:337
#4 0x00007fa4155a1496 in timer_clean_tcp_connections (ticks=18583555,
param=0x0) at tcp_funcs.c:165
#5 0x0000000000617f79 in fork_basic_timer (child_id=-1, desc=0x7fa4155a88e0
"Connections cleanup timer", make_sock=1, f=0x7fa4155a0ac6
<timer_clean_tcp_connections>, param=0x0, interval=30) at timer_proc.c:79
#6 0x00007fa4155a5816 in child_init (rank=0) at tcp_mod.c:176
tcp_func.c is something I wrote myself, which is basically a timer that runs
periodically to try to clean up tcp connections that I no longer need. The
code for tcp_close_connection is taken directly from usrloc > urecord.c >
close_connection()
>From the gdb output above, it seems like send_all is blocked and never
returned, which led to my proxy to hang.
In kamailio/src/core/pass_fd.c, I saw this:
...
/** sends all data (takes care of signals) (assumes blocking fd)
* returns number of bytes sent or < 0 for an error */
int send_all(int socket, void* data, int data_len)
But in kamailio/doc/misc/TODO, I saw this:
...
x [tcp] make send_all, send non-blocking ready ?
x [tcp] tcp_send w/ timeout (to avoid waiting forever to send DOS)
So, my question is, is send_all() suppose to block or not?
I'm fairly new to how tcp and socket connection works. Any help will be
appreciated!
Thanks,
Robert
--
View this message in context: http://sip-router.1086192.n5.nabble.com/send-all-blocks-indefinitely-tp1569…
Sent from the Users mailing list archive at Nabble.com.
Hi,
Is it possible to instruct Kamailio to duplicate both incoming and outgoing messages automatically?
If not, if I set the flag and explicitly call sip_trace, will both messages be duplicated to the capture server?
Regards,
Grant Bagdasarian
CM
hi guys
i'm newbie to kamailio.
i've installed kamailio version 5 (and all the modules) from pkgs on a
jessie debian.
i have the below config on my kamailio.cfg
when i try to start kamailio service it throws the following error.
what's the problem?
- systemctl status kamailio:
kamailio.service - Kamailio (OpenSER) - the Open Source SIP Server
Loaded: loaded (/lib/systemd/system/kamailio.service; enabled)
Active: failed (Result: exit-code) since Wed 2017-03-15 19:01:17 IRST;
10s ago
Process: 9377 ExecStart=/usr/sbin/kamailio -P
/var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY -u
$USER -g $GROUP (code=exited, status=255)
Main PID: 1576 (code=exited, status=0/SUCCESS)
Mar 15 19:01:17 kamailio-debian kamailio[9377]: ERROR: <core>
[core/modparam.c:152]: set_mod_param_regex(): No module matching <jsonrpcs>
found
Mar 15 19:01:17 kamailio-debian kamailio[9377]: CRITICAL: <core>
[core/cfg.y:3404]: yyerror_at(): parse error in config file
/etc/kamailio/kamailio.cfg, line 103, column 72: Can't set module parameter
Mar 15 19:01:17 kamailio-debian kamailio[9377]: ERROR: <core>
[core/modparam.c:141]: set_mod_param_regex(): parameter
<ds_probing_threshhold> of type <2> not found in module <dispatcher>
Mar 15 19:01:17 kamailio-debian kamailio[9377]: CRITICAL: <core>
[core/cfg.y:3404]: yyerror_at(): parse error in config file
/etc/kamailio/kamailio.cfg, line 135, column 50: Can't set module parameter
Mar 15 19:01:17 kamailio-debian kamailio[9377]: ERROR: bad config file (4
errors)
Mar 15 19:01:17 kamailio-debian kamailio[9377]: INFO: <core>
[core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
Mar 15 19:01:17 kamailio-debian kamailio[9377]: loading modules under
config path: /usr/lib/x86_64-linux-gnu/kamailio/modules/
Mar 15 19:01:17 kamailio-debian systemd[1]: kamailio.service: control
process exited, code=exited status=255
Mar 15 19:01:17 kamailio-debian systemd[1]: Failed to start Kamailio
(OpenSER) - the Open Source SIP Server.
Mar 15 19:01:17 kamailio-debian systemd[1]: Unit kamailio.service entered
failed state.
- kamailio.cfg:
# *** To run in debug mode:
# - define WITH_DEBUG
#
#!ifndef DBURL
#!define DBURL "mysql://kamailio:kamailiorw@localhost/kamailio"
#!endif
####### Global Parameters #########
#!ifdef WITH_DEBUG
debug=4
log_stderror=yes
#!else
debug=2
log_stderror=no
#!endif
memdbg=5
memlog=5
# log_facility=LOG_LOCAL0
# Ds increasing debug...
debug=2
fork=yes
children=4
/* comment the next line to enable TCP */
disable_tcp=yes
/* uncomment the next line to disable the auto discovery of local aliases
based on revers DNS on IPs (default on) */
auto_aliases=no
/* add local domain aliases */
# alias="mysipserver.com"
port=5060
/* uncomment and configure the following line if you want Kamailio to
bind on a specific interface/port/proto (default bind on all available)
*/
# listen=udp:0.0.0.0:5060
# listen=127.0.0.1:5060
sip_warning=no
####### Modules Section ########
# set paths to location of modules (to sources or installation folders)
mpath="/usr/lib/x86_64-linux-gnu/kamailio/modules/"
#!ifdef WITH_MYSQL
loadmodule "db_mysql.so"
#!endif
loadmodule "mi_fifo.so"
loadmodule "kex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "mi_rpc.so"
loadmodule "acc.so"
loadmodule "dispatcher.so"
# ----------------- setting module-specific parameters ---------------
# ----- mi_fifo params -----
modparam("jsonrpcs", "fifo_name", "/var/run/kamailio/kamailio_rpc.fifo")
# ----- rr params -----
# add value to ;lr param to cope with most of the UAs
modparam("rr", "enable_full_lr", 1)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0)
# ----- acc params -----
modparam("acc", "log_flag", 1)
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_extra",
"src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;src_ip=$si")
# ----- tm params -----
modparam("tm", "fr_timer", 2000)
modparam("tm", "fr_inv_timer", 40000)
# ----- dispatcher params -----
# modparam("dispatcher", "db_url", DBURL)
# modparam("dispatcher", "table_name", "dispatcher")
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_ping_interval", 15)
modparam("dispatcher", "ds_probing_threshhold", 1)
modparam("dispatcher", "ds_ping_reply_codes", "class=2;class=3;class=4")
####### Routing Logic ########
# main request routing logic
route {
# per request initial checks
route(REQINIT);
# handle requests within SIP dialogs
route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
t_check_trans();
# record routing for dialog forming requests (in case they are
routed)
# - remove preloaded route headers
remove_hf("Route");
if (is_method("INVITE|SUBSCRIBE"))
record_route();
# account only INVITEs
if (is_method("INVITE"))
{
setflag(1); # do accounting
}
# dispatch destinations
route(DISPATCH);
# handle presence related requests
route(PRESENCE);
# handle registrations
route(REGISTRAR);
if ($rU==$null)
{
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
}
route[RELAY] {
if (!t_relay()) {
sl_reply_error();
}
exit;
}
# Per SIP request initial checks
route[REQINIT] {
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if(!sanity_check("1511", "7"))
{
xlog("Malformed SIP message from $si:$sp\n");
exit;
}
}
# Handle requests within SIP dialogs
route[WITHINDLG] {
if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
if (is_method("BYE")) {
setflag(1); # do accounting ...
setflag(3); # ... even if the transaction
fails
}
route(RELAY);
} else {
if (is_method("SUBSCRIBE") && uri == myself) {
# in-dialog subscribe requests
route(PRESENCE);
exit;
}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# non loose-route, but stateful ACK;
# must be 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;
}
}
# Handle SIP registrations
route[REGISTRAR] {
if(!is_method("REGISTER"))
return;
sl_send_reply("404", "No registrar");
exit;
}
# Presence server route
route[PRESENCE] {
if(!is_method("PUBLISH|SUBSCRIBE"))
return;
sl_send_reply("404", "Not here");
exit;
}
# Dispatch requests
route[DISPATCH] {
# Destination types:
#
http://kamailio.org/docs/modules/4.2.x/modules/dispatcher.html#dispatcher.f…
# 4 = round robin
# 9 = weight-based
# round robin dispatching on gateways group '1'
if(!ds_select_dst("1", "9"))
{
send_reply("404", "No destination");
exit;
}
t_set_fr(0,2000);
t_on_failure("ROUTE_ADVANCE");
route(RELAY);
exit;
}
event_route[dispatcher:dst-down] {
xlog("L_ERR", "Destination down: $rm $ru ($du)\n");
}
event_route[dispatcher:dst-up] {
xlog("L_ERR", "Destination up: $rm $ru\n");
}
failure_route[ROUTE_ADVANCE] {
if (t_is_canceled()) {
exit;
}
xlog("L_NOTICE", "Media server $du failed to answer, selecting
other one!\n");
if (t_check_status("503") || (t_branch_timeout() and
!t_branch_replied())) {
ds_mark_dst("ip");
# select the new destination
if(ds_next_dst())
{
# again set local timeout for reply
# xlog("L_NOTICE", "Selecting next route upon
failure\n");
t_set_fr(0,2000);
t_on_failure("ROUTE_ADVANCE");
route(RELAY);
exit;
}
else
{
#last available node failed to reply, no other
destinations available
send_reply("404", "No destination");
xlog("L_NOTICE","No destination, sent 404\n");
exit;
}
} else {
xlog("L_NOTICE","Unhandled failured route!\n");
}
}
Greetings,
I have a general question about the usage of SIP contact headers in the
context of using Kamailio as a SIP proxy.
________________________________
[ A ] --> [ Kamailio B ] ---> [ C ]
Node A originates a SIP invite, containing a valid via header and URI while
setting the contact address to a user@itself and delivers it to Kamailio B
which is acting as a SIP proxy.
Kamailio B then uses dispatcher routing to direct the Invite to node C,
adding a via line with its own information as well as a record-route header
with its own proxy information but retaining the same contact address from
A.
Node C establishes the call and then sends a re-invite to the Kamailio B
proxy which is in turn sent to Node A. Node A responds with a 200 OK
The problem arises when Node C tries to send an Ack in response to this 200
OK. The ack is being sent to the Contact address, rather than the routing
already established in the initial dialog.
________________________________
My question is: should kamailio be rewriting this contact address with its
own? Is that the best practice? My understanding is that the contact header
is more so related to future requests within the same dialog ONLY when a
record-route is not used.
I would appreciate any clarification on the RFC or best practices in this
scenario.
Thank you,
Jack Davis
Hi everyone,
I have the following problem:
I have a Kamailio server that is connected to several Asterisk servers for
load balacing in a LAN network with the IP's of 192.168.16.X.
I recently connected with another company that is supposed to send me calls
through the Kamailio server.
The problem is this:
I am connected to then with a cable from their network to mine. My port has
the address 10.9.18.198 and they come from the address 172.18.177.18.
When I get packets from their address (172...) I can see them getting to my
Kamailio server, but the Kamailio does not respond.
It only happens when I get packets from 172 source address.
If I get from 192 or 10 adresses from my LAN network it works, and if I get
packets from real world IP's through my WAN it works.
Does anyone have any idea why the Kamailio does'nt respond to packets from
172 adresses?
And how to fix this?
Thanks in advance!