Re: [SR-Users] sip domain

2020-03-05 Thread Daniel Tryba
On Tue, Mar 03, 2020 at 10:44:32PM -0500, Joli Martinez wrote:
> We have several SIP domains coming into our SBC.  I need to build a
> Kamailio box that will 302 the call to the appropriate server based on the
> domain.  If the call does not come in with a recognized domain I would like
> for it to 404 the call.  Not sure how to do this.  Can someone point me in
> the right direction?

You can create a redirect by changing the domain in the R-URI ($rd) and
sending a 302 with.
send_reply("302", "Redirect");

The logic how to choose which is the correct $rd is up to you.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Different REGISTER expires based on User-Agent

2020-02-11 Thread Daniel Tryba
On Tue, Feb 11, 2020 at 08:03:29AM +0900, mayamatakeshi wrote:
> Actually, my idea was to do something like this before handing the REGISTER
> to registrar save() function:
> remove_hf("Expires");
> append_hf("Expires: 200\r\n");
> However, this didn't work (or at least, it doesn't work with kamailio 4.3.7
> which is the one I use).

These changes aren't applied to the processing of the current message
until you call msg_apply_changes().
 
Try adding and see if it works.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Parsing exception when "user=phone" is present

2020-01-08 Thread Daniel Tryba
On Wed, Jan 08, 2020 at 03:52:09PM +, Duarte Rocha wrote:
> However, when "user=phone" is present, Kamailio's parser works differently.
> 
> Without "user=phone" -> {uri.user} is equal to
> "+49234598765;npdi;rn=+49-D123"
> With "user=phone" -> {uri.user} is equal to "+49234598765" .
> 
> I really need to access "rn" and "npdi" parameters in those cases. How can
> i do it when "user=phone" is present?
> Is there a way to disable the "user=phone" exception for parsing?

I guess you are looking for:

phone2tel=no

https://www.kamailio.org/wiki/cookbooks/5.3.x/core#phone2tel

If user=phone is present the URI should be parsed as a tel: URI. I guess
that has no parameters?

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Calculate call duration

2019-12-30 Thread Daniel Tryba
On Mon, Dec 30, 2019 at 12:04:47PM +, Duarte Rocha wrote:
> How sould a call duration be calculated?
> 
> Let's say the call creation on Kamailio as a proxy has those steps :
> 
> 1 - Invite is received
> 2 - Provisional responses
> 3 - 200 OK is received
> 4 - ACK to 200 OK is received
> 5 - BYE is received
> 6 - 200 OK to BYE is received
> 
> Should the duration begin to count on step 3 (200-Ok Received) or 4 (ACK
> received) ?
> Should it end on the step 5 or 6?
 
IMHO from 3 to 5.

If you choose 4 to start people can get an x (30) amount of seconds for
free by simply not sending an ACK. RTP will already be established and
there will be 2 way communication. Not receiving the ACK will result in
a teardown of the connection. But 30s free phone calls are enough for
most.

Same for 5, you got a BYE and the only option you have to not getting an
ACK is sending other BYEs and eventually tearing down the call. If you
stop RTP at this moment and propagate the BYE there is nothgin more you
can do IMHO.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Getting error in auth modules- Installing Kamalio 5.2

2019-12-24 Thread Daniel Tryba
On Tue, Dec 24, 2019 at 12:46:53PM +, Mahesh Kumar wrote:
> Hi Team,
> 
> Getting error in auth modules during Kamalio 5.2 installation and doing SIP
> routing, anyone know this why i am getting below error..??

The error is pretty self explanatory:
 
> config file /etc/kamailio/kamailio.cfg, line 1081, column 48: unknown
> command, missing loadmodule?
 
Did you load the module for the command on that line?

Hint: it is in the auth module.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] How can I make calls between the two domains?

2019-12-06 Thread Daniel Tryba
On Thu, Dec 05, 2019 at 10:38:10PM -0600, Yanko wrote:
> I have two virtual machines with two kamailo domains
> 
> VM1: Domain: 172.16.16.1
...
> VM2: Domain: 172.16.16.2
...
> In each domain I can make calls. For example, user 2000 can call 2001. User
> 3000 can call 3001.
> 
> How can I make calls between the two domains?
> 
> What modules do I need to load?
> How to configure the kamailio.cfg file?

You need to change the domain of the R-URI ($rd) to the other
IP address. You don't need any extra modules. You need to add some
logic, essentially you need to implement areacodes/prefixes. 

I'm not going to show you how, it is really simple and a good piece of
homework to do. ;)
But you need logic like this:
create a numberingplan you'd want to use. eg:
0161 == 172.16.16.1
0162 == 172.16.16.2

If the number ($rU) someone dials doesn't start with 0, it is a local number.
If it starts with 0, you have an areacode to match to figure out where
to send the call:

if($rU starts with 0)
{
if(areacode is 161)
{
$rd="172.16.16.1";
}
...
}

if(uri!=myself)
{
route(RELAY);
exit;
}
else
{
do local stuff.
}

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] RTPengine with rejected RE-INVITE when port is changing

2019-12-05 Thread Daniel Tryba
On Thu, Dec 05, 2019 at 09:37:51AM +, Laurent Schweizer wrote:
> Hello,
> 
> I already see old post about this :
> https://opensips.org/pipermail/users/2014-November/030451.html
> 
> but I???m interested to know if now they is a solution 
> 
> so the issue is a RE-INVITE rejected (415 Unsupported Media or 488 ) and the 
> RTP port is changing.
> Is that case the old RTP relay (I???m using RTPengine) is destroyed after 
> 30sec.
> Any way to restore them ?

I'm confused:
- opensips != kamailio
- rtpproxy != rtpengine

But RFC 3261 states (page 16):

   During the session, either Alice or Bob may decide to change the
   characteristics of the media session.  This is accomplished by
   sending a re-INVITE containing a new media description.  This re-
   INVITE references the existing dialog so that the other party knows
   that it is to modify an existing session instead of establishing a
   new session.  The other party sends a 200 (OK) to accept the change.
   The requestor responds to the 200 (OK) with an ACK.  If the other
   party does not accept the change, he sends an error response such as
   488 (Not Acceptable Here), which also receives an ACK.  However, the
   failure of the re-INVITE does not cause the existing call to fail -
   the session continues using the previously negotiated
   characteristics.  Full details on session modification are in Section
   14.

So if this happens with kamailio/rtpengine that is a bug in (I  presume) 
rtpengine.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Vendor Specific RBT Call Flow

2019-12-04 Thread Daniel Tryba
On Wed, Dec 04, 2019 at 02:25:33PM +, Hamid Hashmi wrote:
> Can the following call flow be implemented, if yes, can you give some 
> suggestions with modules information?


[RBT call flow]

Kamailio itself cannot AFAIK. You need to have something that plays
audio.  Maybe it can be implemented with rtpengine/proxy directly but
for me the easiest way would be to parallel fork to something like
asterisk that uses a 183 progress to play(back) any audio (and will never
answer).


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] tcp limit, too many open files

2019-11-29 Thread Daniel Tryba
On Thu, Nov 28, 2019 at 03:21:21PM +, David Villasmil wrote:
> Thanks Alex,
> 
> Do you know how to set it? First time doing thousands of tcp registrations..
> 

Depends on what init system you use. If you have to ask I pesume you are
using systemd (since they like to reinvent the wheel). The correct way
is to:
systemctl edit kamailio.service
and add:
[Service]
LimitNOFILE=65536

More quick and dirty:
edit /etc/systemd/system/kamailio.service.d/override.conf
and insert the same as above. And do a 
systemctl daemon-reload

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Encode host ip in Contact header for semi-stateless setup

2019-11-26 Thread Daniel Tryba
On Tue, Nov 26, 2019 at 10:57:57AM -0500, Daniel Greenwald wrote:
> Yes I've played with topoh but I need more than hiding, I need to store
> data (freeswitch's ip) in the contact header.

That can be done with set_contact_alias / handle_ruri_alias from the
nathelper module. But I guess you are aware of those, so maybe I just
don't understand what you are trying to accomplish and what parts you
have control over.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Problem with max tcp connections

2019-11-26 Thread Daniel Tryba
On Thu, Nov 21, 2019 at 07:49:28PM +0100, Jose Fco. Irles Dur?? wrote:
> Thanks for the info!
> 
> Tomorrow I'll test it with the 5.1.9 version.
> 

Well, the problem happened to me on 2 different loadbalancers (withing
24 hours where the loadbalancers had a near identical uptime) For about
35m no new connections can be established. Already established
connections work fine. I'm not seeing any queueing in to OS (netstat/ss)
After some time all works well again without doing anything to the 
machine/kamailio.

I could try to make a core dump if this happens again and the timing is more 
appropriate for that.

kamcmd> core.tcp_info 
{
readers: 4
max_connections: 4096
max_tls_connections: 2048
opened_connections: 617
opened_tls_connections: 0
write_queued_bytes: 0
}

tcp options in .cg:
tcp_max_connections=4096
tcp_connection_lifetime=3605

Only funny thing I see is that there are some TCP connections with a very high 
timeout:

{
id: 15453
type: TCP
state: CONN_OK
timeout: 268435455
lifetime: 3605
ref_count: 2
src_ip: a.b.c.d
src_port: 51196
dst_ip: e.f.g.h
dst_port: 5060
}

The timeout is either [0,3605] or 268435455. The high timeout ones
dissear quickly:

while sleep 1 ; do date; kamcmd core.tcp_list | grep 268435455; done

Tue Nov 26 10:29:21 CET 2019
Tue Nov 26 10:29:22 CET 2019
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
Tue Nov 26 10:29:23 CET 2019
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
Tue Nov 26 10:29:24 CET 2019
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
Tue Nov 26 10:29:25 CET 2019
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
Tue Nov 26 10:29:26 CET 2019
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
Tue Nov 26 10:29:27 CET 2019
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
timeout: 268435455
Tue Nov 26 10:29:28 CET 2019
timeout: 268435455
timeout: 268435455
Tue Nov 26 10:29:29 CET 2019
timeout: 268435455
timeout: 268435455


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] SDP Modification

2019-11-25 Thread Daniel Tryba
On Sun, Nov 24, 2019 at 07:35:47PM +0600, Sujit Roy wrote:
> How can i change  c= and o= in SDP  using RTPProxy ?

You must have read over it in the documentation:
https://www.kamailio.org/docs/modules/stable/modules/rtpproxy.html#rtpproxy.f.rtpproxy_ofrer

Thus by using the c and/or o flags your question might be answered.

If you need a complete example searching for "kamailio rtpproxy example
config" found this for me:
https://github.com/sipwise/kamailio/blob/master/etc/kamailio.cfg
(and many more).


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Problem with max tcp connections

2019-11-21 Thread Daniel Tryba
On Thu, Nov 21, 2019 at 02:46:39PM +0100, Jose Fco. Irles Dur?? wrote:
> Hi
> 
> I have a kamailio 5.1.2 as load balancer and registration offloading,
> but I have a problem with the max tcp connections that it can handle.
> I suspect that is a linux limit, but I don't find the reason or config.
> When that limit arrives, I can't connect to kamailio and I receive
> "Connection reset by peer", but I can't view any error message in the
> logs.

I experienced the same with versions pre 5.1.9. It hasn't happened to me
with 5.1.9 yet, so I cannot say it was fixed. Additional changes I
applied where some sysctl tweaks:

net.core.somaxconn = 128
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_tw_buckets = 4096
net.ipv4.ip_local_port_range = 4096 65534
net.ipv4.tcp_syncookies = 0


Again, not really sure if these are related.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] _w_t_relay_to(): t_forward_noack failed when forwarding call

2019-11-08 Thread Daniel Tryba
On Fri, Nov 08, 2019 at 02:43:57PM +0200, Konstantinos Merentitis wrote:
> Right, apparently the incoming trunk sends a CANCEL request approx 20secs 
> after the initial INVITE, i suppose because the kamailio subscriber is not 
> answering, so the flow in my logs is normal.
> I should now rephrase my question and ask if there is a way to forward calls 
> that are not answered - is there a timer for this? can you please point me to 
> any direction?

See fr_inv_timer.
http://www.kamailio.org/docs/modules/5.2.x/modules/tm.html#tmp.p.fr_inv_timer

Which can be dynamically changed with 
http://www.kamailio.org/docs/modules/5.2.x/modules/tm.html#tm.f.t_set_fr
so if a user has voicemail enabled you could set it to 15s or else leave
it at 60/120s.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] _w_t_relay_to(): t_forward_noack failed when forwarding call

2019-11-08 Thread Daniel Tryba
On Thu, Nov 07, 2019 at 04:53:43PM +0200, Konstantinos Merentitis wrote:
> I tried to modify the failure route in order to also forward not answered 
> (failed?) calls to asterisk mailbox but i get the following error and the 
> call is never forwarded:

You appear to do the same thing I do, except setting $du to null. If the
user is REGISTERed $du will be set to their endpoint, changing $ru will
have no effect on routing.

So add 
$du=$null;
in the TOVOICEMAIL route before route(RELAY) and see what happens.
 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Group module

2019-11-07 Thread Daniel Tryba
On Wed, Nov 06, 2019 at 07:15:42PM +0100, Igor Olhovskiy wrote:
> 
> Hm... Maybe there is other module to achieve such functions?
> Best if it would be with cache :)
> But if no - regex also fine.

But if it works it works! I don't think there is a specific module to do
this but it is easy to implement yourself. What I don't like personally
about your solution is the use of the permission tables, you need
atleast 1 per user (unless users have the same ip).

Personally I do this by direct database queries in usr_preferences on
INVITEs and REGISTERs. You could use any database (depending on how you
store the ACL) and cache it in a htable.

My solution is mysql specific (inet_aton) and forces users to have
atleast 1 CIDR notated subnet:

if(!avp_db_query("select value from usr_preferences where username='$au' and 
attribute='acl' and
inet_aton(substring_index(value,'/',1))&(1 << 32) - 1 & ~((1 << (32 -
substring_index(value,'/',-1))) - 1)=inet_aton('$si')&(1 << 32) -
1 & ~((1 << (32 - substring_index(value,'/',-1))) - 1)"))
{
t_reply("404","Go away");
exit;
}

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio - failover setup

2019-11-04 Thread Daniel Tryba
On Tue, Oct 29, 2019 at 11:24:34AM -0400, Sergiu Pojoga wrote:
> Hi Daniel,
> 
> In an ideal world, DNS is, as you said, the easiest of approaches one can
> think of. However, not all endpoints support [properly] SRV failover.

And that is why you do both. Both a hot standby and multiple active
frontends. 

BTW I hate the hot standby keepalive/heartbeat/whatever solutions. They
work perfectly during testing, they fail in production. But luckily a
static kamailio.cfg itself (just playing a proxy) is very stable.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio - failover setup

2019-10-28 Thread Daniel Tryba
On Mon, Oct 28, 2019 at 06:03:09AM +0100, Youssef Boujraf wrote:
> I am looking for failover service of kamailio servers looks like
> haproxy but udp & tcp.
> 
> -??one domain name : sip.secure.com pointing my public ip address.
> - two kamailio server pointing same database content (user, whitelist,
> ...) no asterisk or pbx. Kamailio is used Only for signaling (users,
> whitelist & rtp)
> 
> Monitoring service : identify who is the kamailio server online,
> offline and the ability to force??all the SIP/RTP/MANAGEMENT
> connection from Kamailio Srv1 to Kamailio Srv2 and vice-versa ?

Why do these kind of failover setups at all? When I create these
failover setups they work perfectly during tests but fail during real
failures. With round robin A records, NAPTR and SRV you can have
multiple live servers. Only the endpoints what actually use a hardcoded
ipaddress will have problems in the case of a failure. 

The added benefit is scalability and easy maintenance.

The bad is there isn't a wiki entry on how to do it AFAIK.

BTW the shared database seems to be a bit deprecated (and a common point
of failure), look at DMQ if you have to start from scratch.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio weighted dispatch problems

2019-10-16 Thread Daniel Tryba
On Wed, Oct 16, 2019 at 08:51:35AM -0700, Jasen Hall wrote:
> I have tried an embarrassing variety of weights thinking I was
> misinterpreting the instructions. I've tried weight divisions of: 1/3,
> 10/30, 90/9, 90/10,100/0, 90/30, and more; all with the hopes of generating
> any variance in a straight split of the traffic. In every case I get an
> almost equal split of calls dispatched.

Well, maybe the problem isn't in the weights but your calls to
ds_select_*?

Using rweight with alog 11 I can say it works. So double check the
ds_select calls?

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] exit after www_challenge

2019-10-08 Thread Daniel Tryba
On Tue, Oct 08, 2019 at 11:07:44AM -0400, PICCORO McKAY Lenz wrote:
> i have the code with an exit, i dont know if are correct that "exit"
> in that line? or not? help me please?

They are correct (to me). After calling www_challenge() you want to stop
any further processing. Same for your 403 condition. If you only want
authenticated after that pooint exit will stop the processing of the
message.
 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Call limit through shared database

2019-09-30 Thread Daniel Tryba
On Sun, Sep 29, 2019 at 11:03:47AM +0300, Olli Attila wrote:
> modparam("dialog", "profiles_with_value", "concurrent_calls")
> modparam("dialog", "dlg_flag", 4)
> modparam("dialog", "db_url", DBURL)
> modparam("dialog", "db_mode", 1)
 
Have you tested with a lower value of
https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#dialog.p.update_period
I have it set to 5, but for some reason I'm not using get_profile_size

For inbound:
$var(maxchannels) = 0;
sql_xquery("ca", "select count(id) as c from dialog where xdata like 
'%maxchannels%$rU%' and timeout>unix_timestamp()", "ra");
$var(maxchannels)=$xavp(ra=>c);
sql_result_free("ra");

For outbound:
sql_xquery("ca", "select count(id) as c from dialog where xdata like 
'%maxchannels%$au%' and timeout>unix_timestamp()", "ra");
$var(maxchannels)=$xavp(ra=>c);
sql_result_free("ra");

Pasting the code here I see this isn't that secure since a user foo also
gets the number of calls for foobar counted against him! Off to put a "
before/after the username.
 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using static entries with usrloc

2019-09-20 Thread Daniel Tryba
On Fri, Sep 20, 2019 at 03:00:34PM +, Henning Westerholt wrote:
> > expires: I have it set to just before the end of the current unix time,
> >   2018-01-01 00:00:00
> 
> Hello,
> 
> you mean probably end of unix time at 03:14:07 UTC on 19 January 2038.

Doh, yes :)


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using static entries with usrloc

2019-09-20 Thread Daniel Tryba
On Fri, Sep 20, 2019 at 04:37:20PM +0300, George Diamantopoulos wrote:
> Am I right in thinking that merely INSERTing respective rows in kamailio's
> location DB backend will do the trick? Is there anything I need to worry
> about, like contacts being periodically purged? If yes, how do I prevent
> that from happening? And will kamailio always query the DB when performing
> location lookup or do I need to restart upon inserting new records (to
> purge caches, for example)?

I did the same (as in clients can choose to setup their endpoints this
way, but nobody is doing it at this moment).

This depends on what dbmode you have set. db_mode 3 will cache nothing
and do a DB lookup for all actions. This is also safe for what you are
wanting to to (in my experience).

> Lastly, I'm not sure how to treat some fields present in usrloc tables like
> ruid, expires (can I set this to NULL?), callid and cseq (which is
> irrelevant since there's no REGISTER), flags, cflags and methods.

ruid: doesn't matter (I set it to username)
expires: I have it set to just before the end of the current unix time,
 2018-01-01 00:00:00
callid: a unique random string (substr(md5(time().rand()),0,16))
cseq: 1
flags: 0 (?)
cflag: 128 (?)
methods: 6879 (?)

But doing it through kamcmd might be the better answer that is already
given.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] NAT problem

2019-09-17 Thread Daniel Tryba
On Mon, Sep 16, 2019 at 02:06:43PM +0200, Arnout Van Den Kieboom wrote:
> 
> If you need more info, feel free to ask!
> 

Start looking at the SDP contents involved. What are the rtp endpoints
in the them in the scenarios you are having problems with (the ipadress
in the c= line and the ports in the m= lines).

Also is rtpproxy_manage (or whatever you use) being called
unconditionally?

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Connect Kamailio to ITSPs?

2019-08-29 Thread Daniel Tryba
On Wed, Aug 28, 2019 at 05:01:28PM -0400, Aingaran Thirunadarajah wrote:
> Hello,
> Newbie here!
> Have Kamailio set up on a 512MB VPS. Created a couple of users, registered
> with Zoiper and can call between them.
> 
> I am looking for documentation to connect the server to other VoIP
> providers (Signalwire, Anveo, VOIP.ms etc.) to make & receive calls from
> the external network (DIDs) / PSTN
> 
> Can someone point me in the right direction?

You really be asking what these ITSP want/support.

But the answer will either be:
- REGISTER to receive calls, see:
  http://blog.miconda.eu/2010/10/best-of-new-in-kamailio-310-10.html
- accept some certain IPs to send INVITEs
  TIMTOWTDI, one of them is the dispatcher module with seperate ids per
  ITSP and ds_is_from_list to accept from them.
  
https://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher.f.ds_is_from_list

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] basic Kamailio frontend to Asterisk

2019-08-20 Thread Daniel Tryba
On Tue, Aug 20, 2019 at 10:22:26AM -0400, Travis Ryan wrote:
> What role is Kamailio to my Asterisk? Just an Outbound proxy? Do I need to
> still register the trunk from each Asterisk box "thru" the Kamailio proxy,
> etc?
> 
> Also, I'm merely accepting outside calls and then validating the caller and
> bridging them back out to the PSTN, so I don't have any local SIP clients,
> etc., so no need to register the sip devices, etc.

The real question is what do you need kamailio to do? You answer this
with as a simple proxy.

A possible solution for you is to use kamilio with the dispatcher module. One
id (1) for the PSTN side, one id (2) for the Asterisk side. If a call comes in
from 1, route it to 2 and v.v.

This makes the kamailio machine the "endpoint" for both PSTN and
Asterisk side.

With the "default" config that comes with kamailio all you need to do is
strip out anything from the accounting bit in request_route (line 508)
https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg
and insert something like:

if(ds_is_from_list("1",3))
{
$avp(dispatcherid)="2";
}
else if(ds_is_from_list("2",3))
{
$avp(dispatcherid)="1";
}
else
{
send_reply("403", "Go away");
exit;
}

route(DISPATCHER);
route(RELAY);

With route DISPATCHER being:
route[DISPATCHER]
{
if(!ds_select_dst($avp(dispatcherid), "4"))
{
send_reply("501", "No dispatcher available");
exit;
}

t_on_failure("RTF_DISPATCH");

return;
}

See 
https://kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher.ex.config
for more info on integrating the dispatcher module.

More advanced subjects to look at are:
-do you need an rtp proxy?
-do you need topology hiding?
-is NAT involved?

But leave them until you have a clue about how to use kamailio as a sip proxy 
in a
simple test environment (e.g. between 2 asterisk servers).

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] pike parameters doup when have dinamyc ip clients and scanners

2019-08-15 Thread Daniel Tryba
On Wed, Aug 14, 2019 at 02:52:45PM -0400, PICCORO McKAY Lenz wrote:
> > In my setups I have a limit of 64 requests per 2s. But I also have
> > whitelist (with/via the permissions module) for known high traffic
> > ipaddresses. Dimensioning the pike module for the known high traffic
> > hosts kind of defeats the purpose of using pike to detect strange
> > unwanted traffic. The correct numbers depend on your endpoints.
> >
> i cannot use whitelist due my experiment are for all dinamyc ip clients
> so what its the meaning of "depend on your endpoints" ?

You need to dimension pike to at least normal expected traffic from your
endpoints (and the max number of concurrent channels). If all your
endpoints are residential phonelines, you might expect 1 or 2 active
calls. In the worst case scenario you might "a few" call setups per
second, so maybe bursts of 10 messages per second.

But if you know you have a call center with 50 phones, with a queue to
accept bursts you might have more than 50 call setups in a worst case
scenario in a second so you might get 150 messages per second from this
endpoint (the queue answers directly, so 1 invite might result in a 100
trying, 180 ringing and a 200 OK within a second)

Since there is only 1 setting for pike you have to account for the
highest number of legit messages possible.

If you want to keep the pike max number of message lower, you'll need to
be creative. Like dynamically create a whitelist of known "excessive"
trunks (by username) and exclude the ipaddresses they register from from
pike.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] pike parameters doup when have dinamyc ip clients and scanners

2019-08-14 Thread Daniel Tryba
On Wed, Aug 14, 2019 at 08:47:02AM -0400, PICCORO McKAY Lenz wrote:
> you said: " A simple SIP phone will only send a couple of messages per
> second"
> 
> so if i have that special case with dinamyc ip in clients.. who could be
> better to not confuse those clients with intents of attacks?

I'm not sure what you are trying to say here.

In my setups I have a limit of 64 requests per 2s. But I also have
whitelist (with/via the permissions module) for known high traffic
ipaddresses. Dimensioning the pike module for the known high traffic
hosts kind of defeats the purpose of using pike to detect strange
unwanted traffic. The correct numbers depend on your endpoints.

if(src_ip!=myself && !allow_address("2", "$si", "$sp"))
{
   if($sht(ipban=>$si)!=$null)
   {
   # ip is already blocked
   exit;
   }

   if (!pike_check_req())
   {
   $sht(ipban=>$si) = 1;
   exit;


> oh, also i put for scanners that:
> 
> if($ua =~ "friendly-scanner") {
>xlog("L_ALERT", "friendly scanning incoming $rm IP:$si:$sp - R:$ruri -
> F:$fu - T:$tu - UA:$ua - $rm\n");
>   $sht(ipban=>$si) = 1;
>drop();
> }
> 
> so i ban the ip where the friendly scanner are made for a while, it's that
> correct?

Yes, this adds the source ip to the htable that is used to block further
requests. But my experience is that if you sent a 200 OK the scans
will stop for the older scanners. So you might want to add a
sl_send_reply("200", "OK");
before the drop.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] pike parameters doup when have dinamyc ip clients and scanners

2019-08-14 Thread Daniel Tryba
On Tue, Aug 13, 2019 at 03:57:36PM -0430, PICCORO McKAY Lenz wrote:
> # this it's my setup for pike due the dinamyc ip and devices over the 
> internet:
> modparam("pike", "sampling_time_unit", 4)
> modparam("pike", "reqs_density_per_unit", 80)
> modparam("pike", "remove_latency", 60)
> ...
> route {
>   if (!pike_check_req()) {
> xlog("L_ALERT","ALERT: pike block $rm from $fu (IP:$si:$sp)\n");
> exit;
>   }
>  ...
> }
> 
> 
> I put the remove latency in 60, so then due are dinamycally must
> remian in memory more (due any one will be a possible clilent), just
> ban if there are 180 (60*3) request each 4 seconds,
> 
> it's a good configuration or maybe i'm wrong please help me!

remove_latency doesn't do what you think it does:
https://kamailio.org/docs/modules/5.2.x/modules/pike.html#pike.p.remove_latency
=
3.3. remove_latency (integer)

Specifies for how long the IP address will be kept in memory after the
last request from that IP address. It's a sort of timeout value, in
seconds. Note that it is not the duration to keep the IP in state
'blocked'. An IP is unblocked next occurrence of 'sampling_time_unit'
that does not exceed 'reqs_density_per_unit'. Keeping an IP in memory
results in faster reaching of blocked state -- see the notes about the
limits of getting to state 'blocked'. 
=

With above settings a client will be banned if it sends more than 80
messages per 4s. And ipaddresses will be tracked by pike for at max 60s
after the last request.

The ban time is specified in the htable:
# - htable params -
# ip ban htable with autoexpire after 5 minutes
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")

Wheter the config id good depends on the behavior of your clients. A
simple SIP phone will only send a couple of messages per second. A
multitenant machine can send many depending on the number of channels
and trunks configured (and the way it may REGISTER, e.g. asterisk tries
to REGISTER all trunks at the same time (sequentially))



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio as UAC and NAPTR / sendsocket question

2019-07-04 Thread Daniel Tryba
On Wed, Jul 03, 2019 at 06:38:28PM +0200, Karsten Horsmann wrote:
> any one here that can imagine why force sendsocket generates an udp packet
> if the target accept only tcp? And without fs it generates an tcp packet.
> For uac registrations outbound?

Reading the cookbook documentation of force_send_socket raises
questions:
 Force to send the message from the specified socket (it _must_ be one
 of the sockets specified with the listen directive). If the
 protocol doesn't match (e.g. UDP message forced to a TCP
 socket) the closest socket of the same protocol is used. 

It relates to the listen directive, but if you are listening on a TCP
port/socket you can't use that port/socket to create new outbound
connections (to the best of my knowledge).

You already tried $fs but without proto and port:
https://www.kamailio.org/wiki/cookbooks/5.2.x/pseudovariables#fs_-_forced_socket
proto is taken from $du if missing and I guess port is 5060 if missing.
So if you are listening on 5060 tcp that can't be used for the outbound
message, 5060 from udp is the closed match perhaps.
 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Carrier Route installation Failed

2019-06-24 Thread Daniel Tryba
On Mon, Jun 24, 2019 at 10:52:36AM +0300, Amar Tinawi wrote:
> Thank you Karsten
> 
> i'll give a try
 
Karsten gives an excelent howto, but personally I use aptitude for these
situations. It gives you a list of all available package versions and
helps you with the conflicts that might surface.
 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 4.4.x CDR db accounting

2019-06-18 Thread Daniel Tryba
On Mon, Jun 17, 2019 at 05:18:42PM +0200, Laura wrote:
> ++--+--+-+-++
> | Field   | Type | Null | Key | Default | 
> Extra   
> ++--+--+-+-++
> | id | int(10) unsigned 
> | method | varchar(16)  
> | from_tag | varchar(64)   |
> | to_tag | varchar(64)  
> | callid | varchar(255) 
> | sip_code | varchar(3) 
> | sip_reason | varchar(128) | NO
> | time | datetime   
> | src_user | varchar(64)   |
> | src_domain | varchar(128) | NO
> | src_ip | varchar(64)  
> | dst_ouser   | varchar(64)   | 
> | dst_user | varchar(64)   |
> | dst_domain | varchar(128) | NO
> | info | varchar(128)   
> | time_a | datetime 
> 00:00:00 |  
> | unix_t | varchar(64)  
> | sign | int(1) 
> ++--+--+-+-++
> 
> info field is nothing come from any alter table from my side..
 
The table structure you have is based on
https://github.com/kamailio/kamailio/blob/4.4/examples/kamailio/acc-mysql.cfg

info, time_a, unix_t and sign is something someone at you side has added 
 
The config example listed also show how to populate custom fields in the
acc table:

modparam("acc", "db_extra", 
"src_user=$fU;src_domain=$fd;dst_user=$rU;dst_domain=$rd")

So add info and a variable and it should be stored in the table.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio doesn't start with TLS

2019-06-05 Thread Daniel Tryba
On Wed, Jun 05, 2019 at 01:18:32PM +0300,   wrote:
> When User and Group = kamailio I can't start kamailio.service at all. I get 
> errors ()??
> 
> >?? 04 15:00:52 p534507.kvmvps kamailio[23502]: 0(23502) ERROR:  
> >[core/tcp_main.c:2855]: tcp_init(): bind(9, 0x7fb6ef026f84, 16) on?? 
> >37.143.9.210:443 ??: Permission denied
> The question is why? If am using User and Group = root it works.
> 
> Group Kamailio exist and user too.

Check Karsten's message. That has the main reason for certificate
related issues: can the user you are trying to run a daemon as actually
access the needed files (the certificates).


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Modern SIP Trunking, Route on To: or INVITE Headers?

2019-05-21 Thread Daniel Tryba
On Tue, May 21, 2019 at 03:57:02PM +0200, Benoit Panizzon wrote:
...
> So if the Voice Switch is sending back the Register Contact in the
> INVITE, the PBX cannot use this field to determine which extension to
> ring.
> 
> So it has to use the To: Header.
> 
> Well, not in a forwarding scenario, the To: header does not contain a
> valid extension, and the PBX will either invoke a catch-all or simple
> reply with 404.
> 
> So how to work around this?
> 
> Well, you cannot send the Registration Contact in your INVITE Request,
> but the INVITE has to contain the called extension behind the PBX. All
> PBX which I know can work this way, this is even mostly the default.
> 
> BUT, if you have an SBC in between, this is getting tricky, as the SBC
> usually identifies an dynamic endpoint by the user sent as register
> contact and expects the invite to contain that contact.
...

RFC3327 Path tries to solve this problem. If that "SBC" doesn't support
Path all you can do is send the Contact from the REGISTER and leave it
to the SBC to solve its own problems.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using a single virtual domain in a multi-domain setup

2019-05-15 Thread Daniel Tryba
On Thu, May 16, 2019 at 12:37:50AM +1000, Rhys Hanrahan wrote:
> Hi Daniel,
> 
> Thanks for this, much appreciated. Was worried this approach was too much
> of a hack and not the right approach - but knowing someone else has gone
> this way gives me confidence it's a reasonable solution. Will try this out
> tomorrow.
 
There is a minor type in my mail:

you have to change the domain in the R-URI ($rd) before calling
lookup() since that function uses the R-URI.



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using a single virtual domain in a multi-domain setup

2019-05-15 Thread Daniel Tryba
On Wed, May 15, 2019 at 09:38:29PM +1000, Rhys Hanrahan wrote:
> Just to add I've also tried adding multiple alias= definitions, but have
> the same issue - kamailio says "user@fqdn" not found in usrloc when doing
> lookup(). Maybe I need to modify my lookup() call to use a hardcoded URI?
> But I haven't seen any examples where this was required for multidomain
> setups.
> 
> Would really appreciate some guidance as I'm quite stuck on this.

That is what I do. 

You can use the 3rd parameter to save()
https://www.kamailio.org/docs/modules/5.2.x/modules/registrar.html#registrar.f.save
to harmonize on save:
save("location","0x00","sip:$a...@you.domain.tld")

For REGISTERs and INVITEs you can check for specific allowed $rd and
rewrite $rd to whatever you use for save().

if(is_method("INVITE|REGISTER"))
{
 if($rd=="foo" || $rd=="bar")
 {
  $rd="foo";
 }
}
else
{
 send_reply("503","you got the wrong server");
}


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] CRM / Windows integration

2019-05-09 Thread Daniel Tryba
On Thu, May 09, 2019 at 10:15:16AM +0100, Mark Boyce wrote:
> We???ve been asked a few times recently if we can do screen-pop of
> incoming calls (SalesForce CRM / Zoho Support) so that customers
> details pop up on the display as calls are delivered.  Similarly
> ???click to dial??? from such systems.
> 
> Such integrations exist for many commercial soft switches like 3CX /
> FreePBX.  We???re wondering if it can be done at the Kamailio layer
> just above the sip handset.
> 
> I haven???t yet dug in to what the APIs are to achieve this for
> system, equally a google of the subject came up with very little.  So
> I thought I???d ask here before reinventing the wheel. 

There is an example click to dial:
https://github.com/kamailio/kamailio/blob/master/misc/examples/scripts/ctd.sh
(never tested it myself)

Implement a http server(can be kamailio) that calls the script with
arguments. You are only limited by what you can do in your CRM with
regard to click to dial.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio bypassing RTP media

2019-05-03 Thread Daniel Tryba
On Fri, May 03, 2019 at 02:39:10PM +, Ali Taher wrote:
> I'm new to kamailio. I plan to setup a sip server cluster, Does
> someone can give me some suggestions if I can use kamailio as front server,
> which handle sip message and bypass rtp media
> message to backendserver, this mean the kamailio handle only sip message,
> the rtp packets are sent directed to backend server.

Kamailio is a SIP proxy, so by default it will just pass SIP messages
around like you require. 


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] auth by IP

2019-04-19 Thread Daniel Tryba
On Fri, Apr 19, 2019 at 11:38:50AM +0300, Yu Boot wrote:
> Added this before final "return", it still allow to call from any IP without
> registration. :(
> 
> > if(!allow_source_address() || $au==$null)
> > {
> > sl_send_reply("403","Go away!");
> > }

This code is in no way related to registrations. If you want to check
against the location database, you'll have to do this manually AFAIK. If
you store locations in a database you can select where received like
'sip:$si:%' with e.g. sql_ops

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] rtpengine_offer() with ICE not updating o= and m= IP addresses

2019-04-19 Thread Daniel Tryba
On Fri, Apr 19, 2019 at 08:52:30AM +, David Dean wrote:
> I'm using the following rtpengine_offer() to force the use of ICE relay and 
> also replace o= and m=
> ?? ??rtpengine_offer("replace-origin replace-session-connection 
> ICE=force-relay RTP");
> 
> The SDP is being updated to include an ICE relay candidate, but the IP 
> addresses in the o= and m= lines are not changing??to the servers IP address 
> (X.X.X.X).


This is a feature, not a bug: https://github.com/sipwise/rtpengine
"
* ICE
...
With force-relay, existing ICE candidates are left in place except relay
type candidates, and rtpengine inserts itself as a relay candidate. It
will also leave SDP c= and m= lines unchanged.

This flag operates independently of the replace flags.
"

Strange that media adress doesn't work, but try replace. Maybe that
works?


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] auth by IP

2019-04-19 Thread Daniel Tryba
On Fri, Apr 19, 2019 at 09:44:14AM +0300, Yu Boot wrote:
> Following code snippet from default kamailio.cfg never gives 403 if you
> smart enough to set "fromdomain" parameter on Asterisk to Kamailio's IP. How
> to fix it? I want password-based registration (which is OK now) and permit
> calls via Kamailio only from permitted IPs.

TIMTOWTDI but a fairly generic and easily extendable way is to use the
permissions module:
https://www.kamailio.org/docs/modules/stable/modules/permissions.html#permissions.f.allow_source_address
(or one of the variants):

if (!allow_source_address() || (from_uri!=myself && uri!=myself)) {
sl_send_reply("403","Not relaying");
exit;
}


Your remark regarding authentication might result in something like:
if(!allow_source_address() || $au==$null)
{
sl_send_reply("403","Go away!");
}

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] modifying via header from public IP to private IP

2019-04-08 Thread Daniel Tryba
On Mon, Apr 08, 2019 at 05:40:30PM +0530, vinod mn wrote:
> I have a cloud server, when I make call from a sip phone (registered with
> kamailio),
> in the INVITE header I am seeing the via header with public IP, is there
> any way that I can modify via header to send only the private IP.
> The calls are landing on another sip gateway, they will allow only the
> private IP.
> Please let me know, is it possible to replace.

Alex responded assuming you are talking about the UAC via headers. I
read this a from kamailio to the 3rd party sip server, in that case you
might want to look at the topos/topoh modules.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] accounting and db_redis

2019-03-27 Thread Daniel Tryba
> To answer my own question:
> 
> with 
> modparam("acc", "time_mode", 2)
> and 
> modparam("db_redis", "keys", "acc=entry:callid,time_attr:callid")
> you'd get a millisec resolution timer in the key for redis

Well scratch that, I wasn't looking correctly at the logs. This doesn't
work.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] accounting and db_redis

2019-03-27 Thread Daniel Tryba
> What does work is "time" instead of "time_hires". Since I have no idea
> what values are available (I guess the table names?) and time only has a
> 1 sec resolution, what is a correct version of time_hires?

To answer my own question:

with 
modparam("acc", "time_mode", 2)
and 
modparam("db_redis", "keys", "acc=entry:callid,time_attr:callid")
you'd get a millisec resolution timer in the key for redis


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] accounting and db_redis

2019-03-27 Thread Daniel Tryba
Under
https://www.kamailio.org/docs/modules/5.2.x/modules/db_redis.html#db_redis.sec.usage
there is an example for using db_redis for accounting. This doesn't
appear to work (5.2.2)
modparam("db_redis", "keys", "acc=entry:callid,time_hires:callid")

results in:
db_redis [redis_dbase.c:1886]: db_redis_insert(): inserting to prefix (table) 
'acc'
db_redis [redis_dbase.c:382]: db_redis_build_entry_keys(): build entry keys
db_redis [redis_dbase.c:295]: db_redis_find_query_key(): checking for existence 
of ent
db_redis [redis_dbase.c:306]: db_redis_find_query_key(): found key in entry key
db_redis [redis_dbase.c:133]: db_redis_val2str(): converting str value 
'1db9c0bc57291e
db_redis [redis_dbase.c:338]: db_redis_find_query_key(): entry key so far is 
'acc:entr
db_redis [redis_dbase.c:295]: db_redis_find_query_key(): checking for existence 
of entry key 'time_hires' in query
db_redis [redis_dbase.c:346]: db_redis_find_query_key(): key 'time_hires' for 
type 'entry' not found, unable to use this type
db_redis [redis_dbase.c:405]: db_redis_build_entry_keys(): Failed to create 
direct entry key, no matching key definition
db_redis [redis_dbase.c:1892]: db_redis_insert(): failed to build entry keys
db_redis [redis_dbase.c:1976]: db_redis_insert(): failed to do the insert

What does work is "time" instead of "time_hires". Since I have no idea
what values are available (I guess the table names?) and time only has a
1 sec resolution, what is a correct version of time_hires?

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] How fair is the rtpengine loadbalancing?

2019-03-19 Thread Daniel Tryba
I have 3 rtp backends defined with equal weights (33 each). But when I
look at the number of calls being handled the spreaded load is always
5:4:3 for the machines in the orderd listed:

modparam("rtpengine", "rtpengine_sock", "udp:10.235.32.60:7723=33
udp:10.235.32.59:7723=33 udp:10.235.32.58:7723=33")

Looking at select_rtpp_node_new I see nothing unfair happening (with my
total lack of knowledge of how the node set is populated).

Anybody else noticing this?

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Which RTP addon for RFC4040 Clearmode passthrough support ?

2019-03-15 Thread Daniel Tryba
On Fri, Mar 15, 2019 at 02:05:24PM +0100, Olivier wrote:
> I'm looking for a solution to integrate legacy devices to a SIP network.
> More precisely, I need to forward to and receive Clearmode RTP traffic (see
> [1]).
> 
> 1. Do you know any Kamailio-compliant RTP engine (rtpproxy, rtp engine, ..)
> that support this on a Debian host ?
> 2. Suggestion ?

I'd use rtpengine (had much better performance when I switched a couple
of years ago compared to rtpproxy). But since neither rtpengine and
rtpproxy do anything with the RTP stream (unless you tell it to) it
doesn't matter what the codec is, both should work AFAIK.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] rtpengine force-relay

2019-03-15 Thread Daniel Tryba
On Fri, Mar 15, 2019 at 12:37:16PM +0200, Vitalii Aleksandrov wrote:
> Oh, it actually does. If you use ICE=force, rtpengine removes all ICE
> candidates and inserts its own and both call participant can't to talk to
> each other directly but still can use ICE to establish media streams to
> rtpengine. ICE=force-relay does another cool thing. Using it call
> participants try to talk directly and if they can't (both behind NAT) they
> can still use "relay" candidate inserted by rtpengine and exchange media via
> it. I just need a mixed behavior like default + force-relay and don't want
> to hack rtpengine sources and then maintain my patches when need to update
> it.

How is this any different than the default ICE setting (without rewriting
rtp)? rtpengine will add itself to ICE candidates (with a lower priority
than already present ICE). Allowing the rtpengine to be skipped entirely
if there is a better (higher priority) ICE candidate.

endpoint A with ICE support <-> rtpengine with ICE <-> endpoint B with ICE

Here RTP can go directly from A to B.
If any point doesn't support ICE, the rtpengine will be used (with ICE
for the endpoint that does support ICE) if rtpengine rewrites RTP for
legacy endpoints.

The problem of removing ICE is more apparent with more parties involved:
a <-> r1 <-> r2 <-> b

if a,r1 and r2 have ICE support but b doens't, do you want a to
communicate with r1 or r2? If you remove ICE with force-relay, it will
talk to r1, if you "do nothing", it may talk to r2 as ICE candidate.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] rtpengine force-relay

2019-03-14 Thread Daniel Tryba
On Thu, Mar 14, 2019 at 06:01:41PM +0200, Vitalii Aleksandrov wrote:
> > What is wrong with the default behavior? That adds ICE records and
> > rewrites SDP c=.
> When a call goes through multiple proxies and every proxy inserts itself SDP
> becomes really huge. What I like in "force-relay" is that it removes
> previously inserted "relay" candidates and inserts itself. Hope rtpengine
> will still talk to those relay candidates on incoming leg if "host" are not
> reachable. So I'm satisfied with "force-relay" when call to ICE supported
> phone, but when callee can't do ICE I'm in trouble.

ICE is end to end. rtpengine does nothing with other ICE candidates
(AFAIK). So removing those other candidates defeats the purpose IMHO.
You might as well remove any ICE and simply rewrite DSP


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] rtpengine force-relay

2019-03-14 Thread Daniel Tryba
On Thu, Mar 14, 2019 at 02:47:24PM +0200, Vitalii Aleksandrov wrote:
> Well it's mostly rtpengine question but didn't know where should I send it
> and probably the answer will be more or less useful for kamailio users.

I get the feeling. You could open an issue in github, but
sipwise/rtpengine devs frequent here.
 
> By default if an offer has ICE candidates rtpengine leaves them untouched
> and just inserts itself as an additional low priority candidate and also
> rewrites c= line for the callee without ICE support. Using ICE=force-relay
> rtpengine inserts itself as a "relay" candidate what is great but doesn't
> touch c= line and callee without ICE have no chance to send RTP to
> rtpengine.
> Is it possible somehow to make a third behavior like force-relay + rtpengine
> IP in c= param? It would allow any callee to send media to rtpengine
> regardless of ICE support.

What is wrong with the default behavior? That adds ICE records and
rewrites SDP c=.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio Peer Trunk in Asterisk

2019-03-13 Thread Daniel Tryba
On Wed, Mar 13, 2019 at 06:01:39AM +0800, Isravel Raja Thangamani wrote:
> What I want is, I want to register the Kamailio Trunk in an asterisk with
> Username Password authentication,
> 
> My current setup for making that,
> 
> VoIP Provider -> Kamailio(Public) -> Asterisk(Randomly Changing Public IP,
> Broadband Connection)
> 
> I want to register Kamailio SIP in asterisk trunk so that I can forward the
> incoming calls to asterisk via SIP extension

For this requirement you dont need to register.
 
> [kamailio]
> host=172.18.1.1
> user=user
> secret=password
> type=friend
> disallow=all
> allow=ulaw
> context=trunkinbound

If the host is fixed you don't need to register to make this work. If
you don't want to authenticate invites after a register you need the
insecure option in your peer config.

But the uac module was already suggested to handle authentication
requests and initiate registers.
 
> Let me know if anyone doesn't understand my concern

I dont' understand why. Why not have asterisk register to kamailio? That
way you:
-keep kamailio config simple (enable NAT detection and registrar in the
 default/example config)
-don't have to worry about detecting the chaning ip adress
-don't have to any portforwarding tricks on the asterisk side

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio not recognizing SIP requests

2019-03-06 Thread Daniel Tryba
On Tue, Mar 05, 2019 at 04:22:12PM +, Sergio Charrua wrote:
> Content-Length: 262
> 
> v=0
> o=root 1219665045 1219665045 IN IP4 55.66.77.88
> s=SomeSIPGateway
> c=IN IP4 55.66.77.88
> t=0 0
> m=audio 14326 RTP/AVP 0 8 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=ptime:20
> a=sendrecv

This is not a complete message. So kamailio might be waiting for 10 more
characters before processing. Send the client on a diet or try with tcp
(if enabled on the server). Or maybe your capture is incomplete due to
udp fragmentation.
 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] How to Absorb First Leg Re-Invites when no Response from Second Leg Invites

2019-03-01 Thread Daniel Tryba
On Fri, Mar 01, 2019 at 08:23:11AM -0600, JR Richardson wrote:
> My mind is not right on this one, need a pointer. Here is the simple scenario:
> Carrier> The end device is a static IP, the proxy dips database and knows where
> to send numbers destined for the end device, but if there is no
> response from the end device (it's off-line), how do I time-out the
> transaction and send a 503 'Service Unavailable' back to the first leg
> for the carrier to stop re-invites?
> 
> I assume I need a new [FAIL_TWO] route that handles this event.

You need a failure route and to set the timeout on an INVITE
see:
https://www.kamailio.org/docs/modules/5.2.x/modules/tm.html#tmp.p.fr_inv_timer
Set the INVITE to endpoint to 30s with t_set_fr
check in the failure route for a 408:

if (t_check_status("408"))
{
send_reply("503","Service Unavailable");
exit;
}


But you might want to send a 4xx (eg 480) or 6xx (603) instead of 503.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio/asterisk no call with sound if use rtpproxy/rtpengine

2019-02-28 Thread Daniel Tryba
On Thu, Feb 28, 2019 at 09:03:30AM -0400, PICCORO McKAY Lenz wrote:
> hih thanks for your respond, but seems you dont paid attention to my
> problem, with ports opened and redirected to pulbic ip with the AWS
> firewalling (tech support) call have sound, but and later NAT traversal
> with rtpproxy as i understand in simple we must have:
> phone/caller-->[-->rtpproxy->kamailio->asterisk->kamailio->rtpproxy
> -]->phone/dest
> then there's no sound...

You wrote something else in your original message:
exposing asterisk RTP 1-3 makes it function. 

I read that to be an indication that rtp(proxy|engine) isn't rewriting.
 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio/asterisk no call with sound if use rtpproxy/rtpengine

2019-02-28 Thread Daniel Tryba
On Wed, Feb 27, 2019 at 04:04:45PM -0400, PICCORO McKAY Lenz wrote:
> 
> N]OTE: the public ip are not a real interface in the kamailio/rtppropxy
> machine, are provided by the service AWS at amazon! a NAT kind i guess!
> 

But how are you calling rtp(proxy|engine) from kamailio? I think you
need to call rtpengine with the direction option to accomplish what you
want in your setup. Also look at the INVITEs (on kamailio) to debug what
happens with regards to SDP rewriting.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Parallel Forking

2019-02-21 Thread Daniel Tryba
On Thu, Feb 21, 2019 at 02:59:03PM +0100, Jan-Hendrik D??rner wrote:
> I would like to get parallel forking working on my Kamailio installation, but 
> I have trouble to accomplish that.
[serial forking!]
> Is there any working Kamailio example-config, where I can actual see the 
> parallel forking working?

I don't understand what you want to accomplish regarding to parallel by
looking at serial examples? The "default" config implements parallel
forking. If a lookup return multiple locations, they will be be called
parallel. So what are you trying to do?


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Not able to connect kamailio via SIP Client

2019-02-21 Thread Daniel Tryba
On Thu, Feb 21, 2019 at 04:55:40PM +0530, Prabhat Kumar wrote:
> When i try to login via SIP Client(zoiper) i am getting the following error.
> 
> Feb 21 11:20:26 ip-10-0-0-121 /usr/local/sbin/kamailio[21131]: INFO:
>  [core/parser/parse_fline.c:144]: parse_first_line():
> ERROR:parse_first_line: method not followed by SP
> Feb 21 11:20:26 ip-10-0-0-121 /usr/local/sbin/kamailio[21131]: ERROR:
>  [core/parser/parse_fline.c:257]: parse_first_line():
> parse_first_line: bad message (offset: 0)
> Feb 21 11:20:26 ip-10-0-0-121 /usr/local/sbin/kamailio[21131]: ERROR:
>  [core/parser/msg_parser.c:675]: parse_msg(): ERROR: parse_msg:
> message=
> Feb 21 11:20:26 ip-10-0-0-121 /usr/local/sbin/kamailio[21131]: ERROR:
>  [core/receive.c:199]: receive_msg(): core parsing of SIP
> message failed (114.241.140.68:4569/1)
> 
> 
> How can i fix this problem?

By learning how to debug problems.

Read the error: 
parse_first_line: method not followed by SP
parse_first_line: bad message (offset: 0)

So there is something wrong with the message (esp. the first line)
somehow. Now use tools to capture this message (tcpdump/ngrep/wireshark)
and check if there is something wrong with the message (read the related
SIP RFCs to figure out how the message should look). The error mentions
"method not followed by SP(ace?)". So what does the first line look
like?

If the message is bad, fix the client.  If the message isn't, you either
have found a kamailio bug or more likely made a mistake in your config.
Either way, enable more logging for debugging.
https://www.kamailio.org/dokuwiki/doku.php/tutorials:debug-syslog-messages
gives some info. If you still need help, then give the relevant input and
config.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Dispatcher No destinations available

2019-02-18 Thread Daniel Tryba
On Fri, Feb 15, 2019 at 07:23:07PM +0100, Cristian Livadaru wrote:
> You are AWESOME!
> That's exactly what happened, the call went to first asterisk, that one sent
> it further to the client trunk which responded with SIP 500, kamailio sent
> it to the next one, sip 500 again and thus blocking both asterisks from
> receiving any further traffic.
> 
> Thank you very very very much!

Glad so see you could learn from my own mistakes :)


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Dispatcher No destinations available

2019-02-15 Thread Daniel Tryba
On Fri, Feb 15, 2019 at 05:13:21PM +0100, Cristian Livadaru wrote:
> Hi,
> I have a Kamailio running as Load Balancer and it works great but since a
> couple of weeks I kept noticing 404s in Homer and when looked into it they
> came from Kamailio.
...
> The two asterisks behind it seem fine and I can???t really see why this
> started happening. Also I thing that returning 404 might be misleading,
> wouldn???t it be better if I would return 503 instead?

That is up to you to decide. I'd suggest a 480.
 
> I enabled debugging in Kamailio but can???t really seem to notice anything
> wrong here:
...

Find out why the dispatcher endpoints are out of order according to
kamailio (look at the OPTIONS in homer).

Also you set a destination inactive if 1 request to a backend fails
(dsmakr ip). You might want to reconsider, it might be the cause of your
problems. Imagine a call is coming in to a partially deprovisioned
number, the asterisk answers with a failure, gets marked as inactive.
Dispatcher retries to the other one and that also fails and gets marked
as inactive. Any call that comes in before the probing enables the
backends will fail immediatly.

So also look at INVITEs just before the problem in homer.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio/Dispatcher failure routing to SRV record

2019-02-13 Thread Daniel Tryba
On Wed, Feb 13, 2019 at 04:03:52PM +, Jesse Strahn wrote:
> I have a server running Kamailio with dispatcher. I am trying to
> direct calls from kamailio to an SRV record but am receiving a 404
> error on the calls. If I instead place one of the hostnames from the
> SRV record in my dispatcher.list, the call completes fine.
 
These same question was asked last week, see 
https://kamailio.org/docs/modules/stable/modules/dispatcher.html#idm1045825996
you need to set the correct bit (4) in flags.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio TOPOS fail

2019-02-11 Thread Daniel Tryba
On Mon, Feb 11, 2019 at 09:07:04AM -0800, Julien Chavanton wrote:
> Hi Marco, not sure if it is the same issue, but I am looking at a problem I
> am facing where in-dialog requests are failing after 3 minutes.
> 
> It seems you are also using topos_redis
> 
> Tracing TOPOS traffic is seems some leg related infomation is set to expire
> after 3 minutes.
> 

Noticed this a long time ago, apparantly never made a bug report:
https://lists.kamailio.org/pipermail/sr-users/2018-March/100835.html



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] trace sip msg topos

2019-02-11 Thread Daniel Tryba
On Fri, Feb 08, 2019 at 11:08:03AM -0800, Julien Chavanton wrote:
> The solution that worked for me was to use :
> 
> trace_mode=1
> 
> This is capturing both version of the message, I think  this is about using
> a core event hook instead of a transaction callback

Although this is not the solution Guissepe is looking for (he wants to
log local to syslog). siptrace/HEP/homer is a great tool to log any
message and have a decent interface to search them.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio 5.2.0 with empty table of rtpengine - kamailio doesn't start

2019-02-04 Thread Daniel Tryba
On Mon, Feb 04, 2019 at 01:33:32PM +0100, Victor Seva wrote:
> Hi there,
> 
> Is in my TODO list to integrate aptly into our deb build environment.
> https://github.com/sipwise/kamailio-deb-jenkins/issues/9

Okay, good to know that others see this as a "problem". I'll wait
patiently for this enhancement.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio 5.2.0 with empty table of rtpengine - kamailio doesn't start

2019-02-04 Thread Daniel Tryba
On Fri, Feb 01, 2019 at 05:44:45PM +0100, Enrico Bandiera wrote:
> Hello, going back to 5.2.0 is actually not possible anymore if you didn't
> save locally the distro packages because right now on the repos only
> Kamailio 5.2.1 is available

I made the same conclusion with an upgrade to 5.1.6 from 5.1.4. A
rollback wasn't possible. Looking into aptly or debmirror to create a
local repository with history.

But maybe the maintainer can keep older versions?

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] ERROR : EAGAIN and write queue full or failed for tcp Connection

2019-01-31 Thread Daniel Tryba
On Thu, Jan 31, 2019 at 12:01:26PM +, YASIN CANER wrote:
> 
> Kamailio gave this error that couldnt bind tcp connection other side.
> 

No idea, what might be wrong with you conf. But you might start by
making a packetdump (of all traffic except eg ssh on all interfaces) to
see if the problem is related to kamailio or some network related config
on the machine.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio-lb fails after topos enabled.

2019-01-25 Thread Daniel Tryba
On Fri, Jan 25, 2019 at 10:19:45AM -0300, Marcos Pytel wrote:
> Could you help me to catch the coredump file?

Please keep the mailinglist in the loop.

> When I execute bt full the systems shows "no symbols". What package i need to 
> perform it?

I don't know what the sipwise config is, but it if is (anything like)
debian the normal kamailio package is strippped of debugging symbols.
You'll need to install the debug package (kamailio-dbg in debian).


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio-lb fails after topos enabled.

2019-01-25 Thread Daniel Tryba
On Thu, Jan 24, 2019 at 02:30:06PM -0300, Marcos Pytel wrote:
> I'm using Kamailio version: kamailio 5.1.6 (x86_64/linux).
> 
> When I enabled topos, after a few minutes i get this erros in the log file
> and the LB Service goes down.:
> 
> Jan 24 13:20:21 sipwise lb[30130]: ERROR: ndb_redis [redis_client.c:903]:
> redisc_exec_argv(): Redis error: Server closed the connection

I had an issue with topos/redis (which was fixed swiftly by Daniel) but
that does not seem to apply here 
(https://github.com/kamailio/kamailio/issues/1784)
There is not much insight I can give other than: was redis really
unreachable at that moment? Maybe you could give some more info (like
the redis/topos config you are using)?



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Additional Param Check in ConsumeCredential Auth

2019-01-22 Thread Daniel Tryba
On Tue, Jan 22, 2019 at 12:08:34PM +0530, Prabhat Kumar wrote:
> Is there any function for username authentication? as we have for password
> i.e. pv_www_authenticate(realm, passwd, flags)

I guess your only option for now is to use KEMI and your favorite
scripting language available there.

>  Also how can i modify username before authentication?

We are talking about digest authentication (rfc 2617), changing the
username will result in a failed hash. So I'm lost at what you are
trying to accomplish.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Additional Param Check in ConsumeCredential Auth

2019-01-21 Thread Daniel Tryba
On Mon, Jan 21, 2019 at 06:55:32PM +0530, Prabhat Kumar wrote:
> How can i modify username before consuming credentials set in *$au*
> variable. I tried $au=$_s("xyz:"+$au); but it says "*read only pvar in
> assignment left side*"
> ERROR: bad config file (1 errors)

$au is readonly. My workaround is to set $avp(au) and use that instead
of $au

>  I have also tried "*rewriteuser("xyz:$au");*" but its not working.

rewriteuser is the same a $rU

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio OPTIONS Round-Trip

2019-01-15 Thread Daniel Tryba
On Tue, Jan 15, 2019 at 03:57:54PM +0100, Daniel-Constantin Mierla wrote:
> some off-topic remarks, maybe you can do something about or others can
> confirm/infirm what I am seeing:
> 
> ?? 1) I am subscribed to sr-users mailing list with two email accounts, I
> get your email on my secondary account, bit not on gmail, which is the
> one I use actively. The thing is that it is not even in Spam folder in
> gmail, so it might be that other people using gmail do not get your
> messages. I do not know the reason, might be that gmail simply rejects
> mail.ru domain (there is a lot of spam I get from that domain on my
> private email server). Anyone else with a gmail address getting the
> messages from @mail.ru addresses?

Spamassassin flags mail.ru as a highly likely abuse domain (but set the
points by default to 0.00, so it is no dropping it). More likely is a
DKIM validation failure I'm getting from my MTA, but I only set a
positive score to these kind of failures and since there is no other
spam likelyhoods it is accepted. Normally gmail accepts my DKIM signed
but mangled by mailinglists with a strict drop of DKIM fails DMARC
setup, but having other possible indicators might suggest mail is simply
dropped for mail.ru with invalid DKIM by Google.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio OPTIONS Round-Trip

2019-01-15 Thread Daniel Tryba
On Tue, Jan 15, 2019 at 03:20:10PM +0300, Soltanici Ilie wrote:
> OK, that looks interesting - and I think I would able to generate such 
> options from kamailio??- but how do??I?? measure the time for a response for 
> this request?
> Is there any variables which can provide response time for some requests?

I have no idea how to do this from within kamailio, but I guess you
might use KEMI to accomplish that.

My solution is to do this all externally to kamailio, not for timing but
reachability notifications to endusers (check every 15s and alert if no
responses (or active registrations) for more than 60s. But since I build
a hash of endpoints it is easy to add a time (in milli or micro seconds)
for sending and receiving.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio OPTIONS Round-Trip

2019-01-15 Thread Daniel Tryba
On Sun, Jan 13, 2019 at 10:08:31PM +0300, Soltanici Ilie wrote:
> With Asterisk, we are able to get some peer round-trip connection statistic 
> by setting qualify=yes for the specified peer. 
> It sends periodic OPTIONS to the peer and calculates the time round trip time.
> It's something like - "Status: OK (30 ms)".
> Is there any way to achieve this in Kamailio by using nathelper??module, or 
> any other?

I think the only way to do this is to make this yourself (tm). In your
favorite scripting language, query the locations and fire OPTIONS and
measure the time for a response (if any) on basis of the "random" callid
you create. If you route these requests through kamailio you will
prevent any NAT problems or connection with TCP endpoints.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] User connection history

2019-01-10 Thread Daniel Tryba
On Thu, Jan 10, 2019 at 08:53:43AM +0100, Jos?? Antonio Guti??rrez Delgado 
wrote:
> Hello, what I need to know is when that user has been registered for the
> last time or, if possible, all the times he has been registered.
> 
> If you could tell me how the RPC commands are used, I would be very
> grateful, because I am starting with the servers and I do not master it
> very much.

RPC will only give you the current state. Something like
kamcmd ul.lookup location username
should give you the current info.

But for the history you have to add some logic like Dmitri already
suggested. Personally I xlog any authentication request (for use with
fail2ban to block bruteforces). Something like this works for me:

if (is_method("REGISTER|INVITE"))
{
   $var(authenticated)=www_authenticate("$rd", "subscriber");
   xlog("L_ALERT","AUTHENTICATE[$var(authenticated)]: $rm from $fu to $tu 
(IP:$si:$sp) $rd\n");

   if ($var(authenticated)!=1) 
   {
  www_challenge("$rd", "1");
  exit;
   }

   consume_credentials();
}


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] User connection history

2019-01-09 Thread Daniel Tryba
On Wed, Jan 09, 2019 at 05:30:52PM +0100, Jos?? Antonio Guti??rrez Delgado 
wrote:
> Hi, I would like to know if there is a possibility to see a user's
> connection history, or at least their last connection. Thank you

Define connection?

If you want to see where INVITEs are coming from see the dialog module:
https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#dlg.r.list

If you want to see where REGISTERs are coming from,
see the location database:
https://kamailio.org/docs/modules/5.1.x/modules/usrloc.html#usrloc.r.dump

Alternatively you can log these messages to any place you want in any
format you want.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 5.1.6 Debian Package -> SEGFAULT

2019-01-08 Thread Daniel Tryba
On Tue, Jan 08, 2019 at 12:08:23PM +0100, Daniel-Constantin Mierla wrote:
> > Yes. I initially had it enabled but later disabled it for testing with a
> > drop in the event_route and never removed it. In 5.1.3 there was no
> > problem, the moment I updated to 5.1.6 the segfaults began and continued
> > til I removed topos/redis from the config.
> 
> There was some work done for supporting PRACK, I do not recall exactly
> when it was done, but could be the cause...

The good news is that even though kamailio crashed a few time per day,
the impact was minimal. I haven't seen any calls fail, kamailio was back
up and running within 3 or 4 seconds, well within retry timeouts.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 5.1.6 Debian Package -> SEGFAULT

2019-01-08 Thread Daniel Tryba
On Tue, Jan 08, 2019 at 11:40:56AM +0100, Daniel-Constantin Mierla wrote:
> > My crashes don't appear to be related, see
> > https://github.com/kamailio/kamailio/issues/1784
> > Mine are triggered by topos/redis, even though I have topos disabled
> > with an even route.
> 
> I requested some extra info from the corefile on the back tracker.

Updated the info.
 
> To understand properly the use case: you have topos and topos_redis, but
> you use the event_route to "drop" doing topology stripping?

Yes. I initially had it enabled but later disabled it for testing with a
drop in the event_route and never removed it. In 5.1.3 there was no
problem, the moment I updated to 5.1.6 the segfaults began and continued
til I removed topos/redis from the config.



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 5.1.6 Debian Package -> SEGFAULT

2019-01-07 Thread Daniel Tryba
On Mon, Jan 07, 2019 at 04:21:35PM +, Floimair Florian wrote:
> This turned out to be unrelated to Kamailio itself in our case.
> The problem was that the systemd-journald of the systemd version shipped with 
> Debian stretch was sometimes eating up our CPU time on a single-core VM.
> After upgrading to systemd from stretch-backports we no longer had any issues.

Thanks for the feedback. Haven't seen the problem you describe with
systemd yet. Will investigate since we are a Debian shop.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Best place to change mem settings

2019-01-03 Thread Daniel Tryba
On Thu, Jan 03, 2019 at 07:06:51PM +, Duarte Rocha wrote:
> As far as i can tell, i have 3 ways to permanently change the memory
> settings in Kamailio :
> 
> /etc/init.d/kamailio , /etc/default/kamailio and src/core/config.h.
> 
> What's the priority between them? If i have different values in all 3 of
> them, which one will be used? Which is one is the best to use reliably?
> 
> I recently upgraded my Kamailio from 5.0 to 5.2 and i need 12Mb of PKG.
> Before starting the new version for the first time i changed the values in
> /etc/default and the memory error didn't go away. It only worked after i
> changed it in core/config.h and recompilled. After that, i started Kamailio
> and i could do the changes in /etc/default without any problem. Does this
> happen for a reason?

You should look into what your platform does these days. Linux distros
infected with systemd don't work the same way they did the last 2x
years. Looking at how Debian does things (tm):
- /etc/init.d/kamailio that script will not be executed anymore, there
  are systemd binding at the top (". /lib/lsb/init-functions") that will
  detect there is systemd magic and will use that instead. You can
  disable this by setting a certain variable (you'll have to search
  that somewhere). 5.0 might not have had this functionality in the
  init.d file, 5.1.x has, so I guess 5.2 also has.
- /etc/default/kamailio included from /etc/init.d/kamailio (but see
  above) and from the systemd magic stuff (see output of "systemctl cat
  kamailio.service"), but if you are trying get coredump you see the
  variable from the default file isn't used anywhere (and as such
  setting DUMP_CORE=yes doesn't do anything anymore (spoiler: set
  "LimitCORE=unlimited" in a "[Service]" section with systemctl edit
  kamailio.service))
- src/core/config.h compile time hardcoded, not a very good option to
  change anything runtime.

If you use any other distro, checkout what that does these days.
Yesterdays knowledge is useless with systemd.

BTW you might not have read it between the lines: I hate systemd.
Almost everything that broke in the last couple of years can be traced
back to systemd (sure it fixed a few things and appears to be reasonable
stable these days, but you can only get one first impression and systemd
fucked it up bigtime for me).

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 5.1.6 Debian Package -> SEGFAULT

2019-01-03 Thread Daniel Tryba
On Wed, Jan 02, 2019 at 03:25:55PM +0100, Daniel-Constantin Mierla wrote:
> However, there was no follow up, Florian said he has to monitor after doing
> some fixes on the system and see how it goes. Since then I haven't see
> another update, so if you can get gdb backtrace, we can see if it is
> related or not.

My crashes don't appear to be related, see
https://github.com/kamailio/kamailio/issues/1784
Mine are triggered by topos/redis, even though I have topos disabled
with an even route.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 5.1.6 Debian Package -> SEGFAULT

2019-01-02 Thread Daniel Tryba
On Tue, Oct 09, 2018 at 01:09:46PM +0200, Daniel-Constantin Mierla wrote:
> Hello,
> 
> does it happen that you have the pcap with the sip trace for this call?
> If yes, can you send it to me (can be sent directly if you have some
> sensitive data there)?
> 

Is there any progress on debugging this? I'm also seeing crashes a few
times a day on 2 specific machines (running the same config) since the
update (while others are just running fine).

I'll see if I can provide the necessary information if needed.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] [EXT] Re: Using a network STUN Server

2018-12-27 Thread Daniel Tryba
On Wed, Dec 26, 2018 at 06:08:20PM +, Wilkins, Steve wrote:
> Thank you, I just was not sure what else would cause the relayed packets to 
> not be sent out to my fios router.  As mentioned, I can pick any other server 
> in my network and I can see, in the pcap file, that the relay is attempted to 
> the selected server.  I verified our ACL and it is it open for TCP output to 
> any IP and Port so that is not the issue.

Sounds like a missing (default) gateway.

BTW what you might be looking for is achieved with setting $dd (or the
complete $du). If set kamailio will send the message to the given
destination.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] set_advertised_address

2018-12-05 Thread Daniel Tryba
On Wed, Dec 05, 2018 at 09:40:38AM +0100, Kjeld Flarup wrote:
> Yes, the Phones may be on either local LAN (Wifi) and Internet via mobile
> data.

How about use different local address, 1 with an advertise for external
clients, 1 without. Have local DNS resolv to the 1 ip without advertise.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Response VIA Header

2018-11-29 Thread Daniel Tryba
On Thu, Nov 29, 2018 at 02:32:02PM +0300, Soltanici Ilie wrote:
> We have a Kamailio Instance running on Public IP Address, one of our ISP 
> cannot send ACK back to us because we are sending 100 Trying - without 
> "received" parameter.
> Is there any way in Kamailio to force a "received" parameter in the via 
> header for 100 Trying Message?

What version are you using? I'm not doing anything special and the 100
Trying contains a received parameter. Maybe force_rport=yes introduces
this?

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] KAMAILIO 4.2 - RTPPROXY config confirmation - error message from systemctl status kamailio.service -l (ERROR:

2018-11-22 Thread Daniel Tryba
On Wed, Nov 21, 2018 at 06:24:22PM +0100, ybouj...@by-research.be wrote:
...
>   xlog("NATMANAGE coei\n");
...

> Is it an issue with the public ip address configured in the rtpproxy
> (/etc/default/rtpproxy)?

There is no issue. Please take a look at 
https://www.kamailio.org/docs/modules/5.1.x/modules/xlog.html#xlog.f.xlog
xlog logs strings to some log file, the default level/severity is error.
Combine that with a retarted launcher like systemd and you might get the
impression there is something wrong where there isn't.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] KAMAILIO 4.2 - RTPPROXY config confirmation - error message from systemctl status kamailio.service -l (ERROR:

2018-11-21 Thread Daniel Tryba
On Tue, Nov 20, 2018 at 10:41:51PM +0100, ybouj...@by-research.be wrote:
> 
> WHEN I MAKE AN INVITE FROM 801 TO 803, I HAVE THIS ERROR MESSAGE : 
> 
> KAMAILIO SERVICE (ERROR: 

Re: [SR-Users] topos without db?

2018-11-13 Thread Daniel Tryba
On Mon, Nov 12, 2018 at 10:11:06PM +0100, Henning Westerholt wrote:
> > What is the difference between topoh and topos?
> > I am using topoh which works fine without DB and only needs the mask_key to
> > be the same on the nodes.
> > Is there a benefit for using a DB and the topos module?
> > [..]
> 
> the two modules use a different storage scheme (apart from some functions 
> that 
> are only available for one of them). The topos module will store its data it 
> in a database, so it don't need to add the hidden header parameter to the SIP 
> message. The topoh module store this data in the SIP message, so the size of 
> the message is increased.

The main functional difference IMHO is topos doesn't/cannot rewrite
callid. If you ahve a call scenario with a stupid PBX and users that
call their own DIDs you might need topoh.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Single session start

2018-11-12 Thread Daniel Tryba
On Mon, Nov 12, 2018 at 09:59:10AM +0100, Jos?? Antonio Guti??rrez Delgado 
wrote:
> Hi, I would like to know if it is possible to make the last register of a
> user the active register and if possible the only one.
> I'm with an Android application and sometimes I can not deregister properly
> before the new registration, for example when the network changes, so there
> are times when the hanging signals do not work correctly when there is more
> than one register for a user.
> Is it possible to avoid that there is more than one register for a user? Is
> it possible to configure the last register to delete the previous ones or
> to be a single register?
> Thanks in advance and I await your answers.

Take a look at the second argument for save()

https://www.kamailio.org/docs/modules/5.1.x/modules/registrar.html#registrar.f.save
Set it to "0x04" to override any other location.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Store TLS handshake date from Kamailio to an external DB

2018-11-01 Thread Daniel Tryba
On Thu, Nov 01, 2018 at 09:20:46AM +, Toffi Bossol wrote:
> my use case will be:
>
>- We use two Kamailio instances (A and B)   
> 
>- A Client registers to a Kamailio A using TLS (SIP over TLS). The TLS 
> session data shall be stored into an external DB.
>- Kamailio A is now unreachable.
>- The client sends a register to Kamailio B over TLS.
>- Kamailio B shall look into the external DB and checks that there is 
> already a TLS session data and can reuse it.   

In order to make a SIP over TLS handshake, there has to be a new
handshake. So the old data is stale and unusable.


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Diversion headers access and message too long error

2018-10-30 Thread Daniel Tryba
On Mon, Oct 29, 2018 at 05:27:27PM +0100, Joan Salvatella wrote:
> On this setup we are facing 2 issues:
>- *Diversion headers access: *Currently, Kamailio only supports access
>to the last diversion header but since we are receiving traffic from Twilio
>(it sets the last Diversion header) we are unable to see if the caller was
>diverted to our SIP trunk. Is there a workaround for this? Any external
>module that would support this use case?

You mean $di points to last Diversion header?
You can access nth header with same name with
$(hdr(name)[n])

See
https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#hdr_name_-_headers
 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio with Asterisk as Media Relay

2018-10-08 Thread Daniel Tryba
On Mon, Oct 08, 2018 at 07:16:43AM -0400, Alex Balashov wrote:
> The SDP-bearing INVITE and response are simply passed along as-is by
> Kamailio, and it is the SDP which specifies where the media goes. So, if
> endpoint A calls through Kamailio proxy B to Asterisk server C via SIP,
> A and C will negotiate media amongst themselves without any intervention
> or special measures on your part whatsoever.

In theory, but with Asterisk in the middle be prepared to have this fail
since it initially is in the loop regarding RTP and can negotiate
incompatible RTP legs between AB and BC which will not be fixed when
Asterisk leaves the RTP path. Mainly I experience this with
dtmf/telephone-events mapping, e.g.: a=rtpmap:101 telephone-event/8000
If a and c have different values, dtmf will fail.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio rtp connection

2018-09-28 Thread Daniel Tryba
On Fri, Sep 28, 2018 at 11:47:12AM +0200, Pieter Muller wrote:
> If I insert my public IP under:
> # - start RTPProxy:
> #rtpproxy -l _your_public_ip_ -s udp:localhost:7722
> # - option for NAT SIP OPTIONS keepalives: WITH_NATSIPPING
> 
> Must I also modify UDP part below:
> 
> #!ifdef WITH_NAT
> # - rtpproxy params -
> modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
> 
> or can I leave it as is.
> I have 1 NIC running private to VSP and 1NIC Public facing...So my mind is 
> telling me to keep it as 127.0.0.1???

127.0.0.1 (on port 7722) is used to communicate from kamailio to
rtpproxy, so you can keep that.

Never had to use rtpproxy to bridge between private and public networks,
but if you check the archives of this list you should find some examples
(keywords might be multi homed or bridged rtp)

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Forcing outbound transport to TCP

2018-09-28 Thread Daniel Tryba
On Fri, Sep 28, 2018 at 10:07:09AM +0200, Ivan Ribakov wrote:
> In a basic scenario of one2one call, I was able to make Kamailio to forward 
> INVITE to callee over TCP by issuing a REGISTER request with 
> ???transport=tcp??? parameter. Although it worked, as far as I understand 
> that means all communication with the callee will be happening over TCP. I 
> would like to be able to change transport dynamically so looking for a way to 
> do that from config file.
...
> Any pointers as to how can I modify the outbound message transport? Do I need 
> to use some extra modules or can it be achieved with a basic setup?

You can do this by explicitly calling t_relay_to_tcp() instead of
t_relay().

For example I modified route[RELAY] for a specific destination that
wants TCP for large INVITEs.

if($avp(dispatcherid)=="1" && $ml>1249)
{
if(!t_relay_to_tcp())
{
if(!t_relay())
{
sl_reply_error();
}
}
}
else
{
if(!t_relay())
{
sl_reply_error();
}
}


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio rtp connection

2018-09-27 Thread Daniel Tryba
On Thu, Sep 27, 2018 at 10:03:24AM +0200, Pieter Muller wrote:
> VoIP Supplier (IP:161.161.252.20{Private Net}) ? Connect via routing to
> Kamailio Server(155.155.16.2 eno2{private Net}),Kamailio
> Server(187.221.197.252 eno1{public facing})?connect to PBX(public IP set in
> dispatcher) ? connect to RTP server(Public IP)
> 
> Now the problem is that if you call in Number@161.161.252.20
>   is send to kamailio, kamailio then sends it
> down to dispatcher IP and that PBX responds directly back via rtp server to
> 161.161.252.20. The 161.161.252.20 IP is private and cannot be reached from
> the cloud and vice versa . How do I get kamailio to be the middle man
> between 161.161.252.20 and RTP server(all traffic must go via the kamailio
> server) Is there specific modules I must load.

You need to use an RTP proxy to achieve this. So yes you need to load
extra modules and configure kamailio for this proxying. If you take a
look at
https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg
and search for rtpproxy. The really really short explanation:
you need to call rtpproxy_manage for calls that you want to rewrite rtp
for.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] usr location

2018-09-20 Thread Daniel Tryba
On Thu, Sep 20, 2018 at 12:54:30AM -0300, volga...@networklab.ca wrote:
> User location lookup looks like can't handle long $rU like
> 10102-ce72256df4945bc472ed9c27a1037f46.
> It always return -3  404 not found.


This username is only 38 chars long, I have a username in a 5.1.4
environment with 39 chars that works just fine.

What backend for storage of location are you using? If it is a sql
backend, what length is the username in the location table?



signature.asc
Description: PGP signature
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Forward SIP request between two Kamailio servers

2018-09-14 Thread Daniel Tryba
On Thu, Sep 13, 2018 at 08:19:00AM +, Nathanael Eneroth wrote:
> UA1<--->KAM1<>KAM2<>UA2
> int1int1  int3  int3
> int2  int2
> 
 
> I would like KAM1 to forward all SIP requests destined to int3 via
> KAM2 and vice versa. I am aware of the routing logic in
> 'kamailio.cfg', but i find rather excessive. Pseudo code of what i'm
> trying to achieve:

This is a very basic question, but I can't find any explanation/examples
about how to do this. Routing calls happens on
either 
$du 
https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#du_-_destination_uri
of 
$ru 
https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#ru_-_request_uri

You can manipulate components like the domain with $dd/$rd. Changing
them and than calling t_relay() will route the calls to somewhere else.
Regaring you examples: TIMTOWTDI

> if (is_method("INVITE")) {
>  if(dst_ip == int3)
>  set_next_kamailio_server(KAM2)
> }

if()
{
$rd="ip/dnsofkam2";
route(RELAY);
exit;
}
 
 
> Or:
> 
> if (is_method("INVITE")) {
>  if(callee is unkown)
>  ask_kamailio_server(KAM2)
> }

if(!location())
{
$rd="ip/dnsofkam2";
route(RELAY);
exit;
}

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] null $au

2018-09-06 Thread Daniel Tryba
On Wed, Sep 05, 2018 at 06:36:20PM -0400, Alex Balashov wrote:
> Just grab it right before the consume_credentials() block, after all the 
> challenge stuff. 

consume_credentials() doesn't reset/clear $au, so anywhere after the
first if or after the route(that authenticates) will do.



signature.asc
Description: PGP signature
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] load-balance to registered trunks?

2018-09-03 Thread Daniel Tryba
On Mon, Sep 03, 2018 at 10:58:22AM +0100, David Villasmil wrote:
> Interesting approach! Though i don't think that will work for me. I've been
> looking into my requirements, and I'd need to do weight-based distribution
> instead of load-balance,  also what i need is to add destinations to the
> dispatcher lists dynamically. I was thinking of adding them dynamically
> when they register, but the module doesn't have a function to reload the
> list via the config script, or a db_mode as on other modules. This one is
> going to be tricky...

I asked just about the same question (but for registered endusers) some
time ago and finally settled for updating the q value for all locations
for that user to a random value (0-1) during each request to that user by
directly updating the database (shared among a cluster of kamailio
registrars).



signature.asc
Description: PGP signature
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Dispatcher question

2018-08-31 Thread Daniel Tryba
On Fri, Aug 31, 2018 at 12:11:53PM +0200, Igor Olhovskiy wrote:
> Can I somehow dump xavp_dst var to check if ds_select_dst is correct?

You could use pv_xavp_print():
https://www.kamailio.org/docs/modules/5.1.x/modules/pv.html#pv.f.pv_xavp_print

If there is a better way I'd like to know myself.


signature.asc
Description: PGP signature
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Struggling with RTPProxy and RTPEngine

2018-08-23 Thread Daniel Tryba
On Thu, Aug 23, 2018 at 11:39:32AM +, Wilkins, Steve wrote:
> If RTPEngine is on the same server as Kamailio (Asterisk being on
> another server), and RTP traffic is sent to and from RTPEngine, then
> the provider only needs to whitelist one IP-Address.  I thought with
> RTPEngine that all RTP traffic would go through it and then it would
> pass it on to the correct destination.  Is this correct? 

Yes it is, if you tell kamailio to rewrite SDP by calling rtpengine
functions.

During your previous messages I never got the idea you were talking
about an uplink/provider interconnect (might be me just skimming your
mails). But without a config (of kamailio and rtpengine and a clear
network topology) it is not possible to tell what the problem is.

The standard config in the kamailio repo does NAT checks before calling
rtpengine, if you scrap those conditions it will trigger rtpengine on
all calls. 



signature.asc
Description: PGP signature
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Struggling with RTPProxy and RTPEngine

2018-08-23 Thread Daniel Tryba
On Thu, Aug 23, 2018 at 04:43:40AM -0400, Alex Balashov wrote:
> The expectation that the RTP will come from the same place as the
> signalling does exist in some sclerotic telco interconnects, since big
> brand SBCs would ordinarily meet this need and big brand SBCs are the
> only thing sclerotic telcos understand.

What a lovely word: sclerotic. First time I've ever seen it :)
But yes, in those cases I'm using a combined kamailio/rtpengine
instance. 


signature.asc
Description: PGP signature
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


  1   2   3   >