Hello, excuse me for the question.
I compiled kamailio 4.2 from git with msilo.
kamailio.cfg
##############################
loadmodule "msilo.so"
# ------ msilo params -----
modparam("msilo", "db_url", DBURL)
modparam("msilo","from_address","sip:registrar@kamailio.org")
modparam("msilo","contact_hdr","Contact:registrar@192.168.1.3:5060;msilo=yes\r\n")
modparam("msilo","content_type_hdr","Content-Type: text/plain\r\n")
modparam("msilo","offline_message","*** User $rU is offline!")
But now, i don't know where introduce route code.
And in the documentation route coude tells "test only, REGISTER ok"
Are there code for secure production?
Thank you.
Hi,
When DROUTING table "dr_gateways" is very big (40000 rows) reloading the
module to memory take about 60 seconds !!!
My tests show 5000 rows takes 7-11 seconds......
It is very slow.
The rules table, with 40000 rows, loads immediately though.
Any ideas why?
Or how to get the process faster?
(I know the gateway table is too big. but, this is
the current implementation...)
kamailio version - 3.3.6 (48db34)
BR,
Uri
i build kamailio from latest 4.2 branch and got
CC (cc) [M textops.so] textops.o
textops.c: In function 'append_multibody_helper':
textops.c:1867:2: warning: implicit declaration of function 'get_mixed_part_delimiter' [-Wimplicit-function-declaration]
please fix asap.
-- juha
Hi,
Using method json_get_field i am able to extract json string. However, this
string comes with quotes which cause a hurdle in assigning to various
pseudo variables, for example,
--
json_get_field($redis(r=>value), "to_number", "$var(wim_to)");
json_get_field($redis(r=>value), "domain",
"$var(wim_domain)");
$uac_req(ruri)="sip:" + $var(wim_to) + "@" + $var(wim_domain);
--
This results in $uac_req(ruri) being set as.
sip:"49XXXXXXXX"@"sip.mydomain.com"
Which is obviously wrong and fails the transaction processing.
Is there any way to get rid of these quotes from json strings? One possible
way i can think of is using string transformation "s.substr", but there are
a lot of json strings i have in config and it is too hectic to transform
all of them. Is there any easier way out of this?
Thank you.
OK, sorry for the basic question, but I'm overwhelmed.
My install gives me a kamailio-basic.cfg, kamailio.cfg and
kamailio-oob.cfg. Is there any explanation as to the difference between
these? I assume "basic" is a simpler config, but I don't know what it
lacks vs. kamailio.cfg, and I have no idea what "oob" means ("out-of-band?")
The configs reference a kamailio-local.cfg. My assumption was that I
could place config changes here, but I see later that kamailio.cfg
changes some parameters. In particular, I set various auth_db parameters
in kamailio-local.cfg which kamailio.cfg changes later. So I don't
understand when I might want to use kamailio-local.
The config files refer me to a cookbook, but unless I'm missing
something, the cookbook is a long list of config directives. When I read
"cookbook" I assume I'm being directed to something containing recipes
like "how to enable web sockets," with step-by-step guides about which
config files to edit and what to add. Am I just missing that?
Is there a task-oriented getting started page that I'm missing, that
would help me set up a web socket-based SIP server? Then, when I hit the
inevitable issues, I can resolve specific problems rather than trying to
figure this all out from scratch? I see the documentation attached to
the web sockets module, but many of these docs include stand-alone
config snippets with no indication as to how to integrate them into a
larger config. For instance, the ephemeral auth module tells me how to
set up an ephemeral auth route but doesn't give me enough context to
place the snippet correctly in the 900+-line kamailio.cfg, and actually
I suspect it wouldn't work anyway since I see nothing about HTTP in the
kamailio.cfg.
Sorry if I seem frustrated. I'm willing to learn, I've just been handed
a jet engine and a few suggested tweaks, but not enough context to know
how to make them. :) I'll be learning more about SIP and what role a SIP
router plays, but it'd be helpful to be able to bootstrap a server so I
can learn by doing as well. I'd just like to provide audio/video
communication for a single SIP domain, authenticating against MongoDB
and with ephemeral auth so Javascript clients can get temporary
credentials. I don't want voicemail, outbound routing, etc. This seems
like it should be simple to achieve, but I don't know how or where to
start in a way that would allow me to build up.
Thanks.
Hello,
We want to use Kamailio (4.2) + RTPEngine (3.3) behind NAT. Unfortunately
the STUN Messages (Binding Requests) sent from remote peer (Google Chrome )
do not arrive at RTPEngine host.
I think they get blocked by the firewall. RTPEngine itself does not send
any STUN Messages until it get's the first message from the remote peer as
Google Chrome has the "active" role in DTLS Agreement.
Is there a way to tell RTPEngine to open the ports for remote peer, so that
the messages arrive?
When RTPEngine is not behind NAT, everything works as expected.
Kind regards,
Marko
Hey Community,
I've tried to google and view the docs for Kamailio about fr_inv_timer (and
other timers), but I don't think they do what I'm wanting.
Basically, I want to cancel an INVITE request and progress to the next
contact if the current contact has not send a non-100 provisional code or
final response after a certain amount of time.
Am I missing some obvious setting that I overlooked in my searches or do I
have to approach this 'manually' (aka, not just a setting)?
Any help is greatly appreciated.
Ryan Brindley
Hello. I'm attempting to set up Kamailio for the first time and have a
few questions.
1. The auth_db module specifically calls out MySQL, Postgres and flat
file databases, but makes no mention of the new MongoDB module. Is the
new MongoDB module supported as well and the docs just haven't been
updated to account for that?
2. In looking at the auth_db parameters, I see values for column names,
but nothing for a table/collection. How do I specify what table or
collection my user data is in?
3. How do I create HA1 strings? The docs state:
HA1 strings are MD5 hashes of username, password, and realm.
Is that:
md5(username+":"+password+":"+realm)
or something else?
Thanks.
Hello sr-users,
We have Kamailio (behind NAT) configured acting as a proxy in front of
some FreeSWITCH servers.
There appears to be something amiss with my inbound (dispatcher)
configuration which leads to misaddressing / misdelivery of the ACK
after 200 OK (outbound calls appear to be proxied correctly [1]).
Calls from the sip provider incoming to Kamailio are distributed by the
dispatcher module to the FS server (For testing in this simplified
scenario FS and Kamailio are on the same machine):
SIP provider (5060) sends an invite to Kamailio(5061), Kamailio
uses the dispatcher module to select a backend server and forwards the
INVITE to FS(5070) (see inbound-callflow.png; kamailio.ext and
kamailio.int are the same machine, just public/private addresses).
I notice that at no point is a Via/record-route header for the FS server
inserted into the forwarded session. I'm not actually certain this is a
requirement, but I can't think of another obvious way that Kamailio
could proxy the same session to the same FS server.
The 100 Trying seems unremarkable [2], I suspect the 200 OK [3] is
problematic. It has been proxied from the FS server, however contains no
reference to the FS server address either in the via headers nor
record-route (kamailio.int:5070). The incoming ACK [4] then appears to
be misdelivered / lost - Kamailio receives it on the private address and
forwards it to the public address rather than the FS server.
My configuration [5] is built based on the default configuration +
examples from the dispatcher module. There are some provisions for
FreeSWITCH internal/external profiles made so the configuration listens
on 2 different ports. This particular scenario should only use the 5061
port as it involves calls to an external sip provider (briefly 5060
should be proxied to FS:5080 and 5061 should be proxied to FS:5070 and
vice-versa).
If someone can see an issue with the configuration and/or point to an
error in the call flow (i.e. should FS be inserting the Via header?)
that would be greatly appreciated.
Thanks,
-nick
[1] Outbound call flow (see also outbound-callflow.png)
FS(port 5070) sends an invite to Kamailio(5061) (Kamailio is configured
in FS as an outbound proxy), INVITE contains Via header for the FS
server, Kamailio forwards to sip provider, and routes all messages back
and forth correctly.
[2] 100 Trying
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP
sip.provider.com:5060;branch=z9hG4bKfffb.7c81ee53.0;rport=5060
Via: SIP/2.0/UDP
far.external.ip;received=far.external.ip;rport=5060;branch=z9hG4bK4Qg7Ng27BvHrK
From: "Nicholas Gill" <sip:0384171966@far.external.ip>;tag=j3KQmpvmg6mvr
To: <sip:0390156842@sip.provider.com>
Call-ID: aa7174e7-d028-1232-4b95-001cc0dd11e9
CSeq: 66413636 INVITE
Server: kamailio (4.1.6 (x86_64/linux))
Content-Length: 0
[3] Proxied 200 OK (Kamailio -> Sip Provider)
SIP/2.0 200 OK
Via: SIP/2.0/UDP
sip.provider.com:5060;rport=5060;branch=z9hG4bKfffb.7c81ee53.0
Via: SIP/2.0/UDP
far.external.ip;received=far.external.ip;rport=5060;branch=z9hG4bK4Qg7Ng27BvHrK
Record-Route: <sip:kamailio.ext:5061;lr=on>
Record-Route: <sip:sip.provider.com;lr;ftag=j3KQmpvmg6mvr;did=0ec.84ff82b1>
From: "Nicholas Gill" <sip:0384171966@far.external.ip>;tag=j3KQmpvmg6mvr
To: <sip:0390156842@sip.provider.com>;tag=BFvQmggHrg74m
Call-ID: aa7174e7-d028-1232-4b95-001cc0dd11e9
CSeq: 66413636 INVITE
Contact: <sip:0390156842@kamailio.int:5070;transport=udp>
User-Agent: IMX
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE,
REGISTER, REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 270
X-FS-Support: update_display,send_info
[4] Incoming ACK (Sip Provider -> Kamailio)
ACK sip:0390156842@kamailio.ext:5061;transport=udp SIP/2.0
Record-Route: <sip:sip.provider.com;lr;ftag=j3KQmpvmg6mvr>
Via: SIP/2.0/UDP sip.provider.com:5060;branch=z9hG4bKfffb.7c81ee53.2
Via: SIP/2.0/UDP
far.external.ip;received=far.external.ip;rport=5060;branch=z9hG4bK509ZQBKB947aF
Route: <sip:kamailio.ext:5061;lr=on>
Max-Forwards: 69
From: "Nicholas Gill" <sip:0384171966@far.external.ip>;tag=j3KQmpvmg6mvr
To: <sip:0390156842@sip.provider.com>;tag=BFvQmggHrg74m
Call-ID: aa7174e7-d028-1232-4b95-001cc0dd11e9
CSeq: 66413636 ACK
Contact: <sip:gw+Exetel@far.external.ip:5060;transport=udp;gw=Exetel>
Proxy-Authorization: Digest username="0384171900",
realm="far.external.ip", nonce="xxxx", algorithm=MD5,
uri="sip:0390156842@sip.provider.com", response="xxxx"
Content-Length: 0
P-hint: rr-enforced
[5] Kamailio configuration (based on default configuration). Dispatcher
set 1 is FS internal profile (5080) and set 2 is external profile (5070)
...
#!define WITH_NAT
...
alias="kamailio.int:5060"
alias="kamailio.int:5061"
alias="kamailio.ext:5060"
alias="kamailio.ext:5061"
listen=udp:kamailio.int:5060 advertise kamailio.ext:5060
listen=udp:kamailio.int:5061 advertise kamailio.ext:5061
port=5060
port=5061
...
loadmodule "dispatcher.so"
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
#modparam("dispatcher", "ds_ping_interval", 60)
...
modparam("nathelper", "sipping_from", "sip:pinger@etellicom.com")
...
request_route {
...
# Not from FS servers gets dispatched to FS servers.
if(!ds_is_from_list("1") and !ds_is_from_list("2"))
{
route(DISPATCH);
}
# Requests from FS External profile routed out via specific port.
if(ds_is_from_list("2"))
$fs="udp:kamailio.int:5061";
...
}
route[DISPATCH] {
if(dst_port==5061)
{
$fs="udp:kamailio.int:5061";
# Hash over to uri for test purposes
if(!ds_select_dst("2", "2"))
{
send_reply("404", "No destination");
exit;
}
}
else
{
# Hash over to uri for test purposes
if(!ds_select_dst("1", "2"))
{
send_reply("404", "No destination");
exit;
}
}
xlog("L_DBG", "--- SCRIPT: going to <$ru> via <$du>\n");
t_on_failure("RTF_DISPATCH");
route(RELAY);
exit;
}
failure_route[RTF_DISPATCH] {
if (t_is_canceled()) {
exit;
}
# next DST - only for 500 or local timeout
if (t_check_status("500")
or (t_branch_timeout() and !t_branch_replied()))
{
if(ds_next_dst())
{
t_on_failure("RTF_DISPATCH");
route(RELAY);
exit;
}
}
}
...