[SR-Users] Re: replies using the wrong protocol

2024-06-20 Thread Benoit Panizzon via sr-users
Am Thu, 20 Jun 2024 14:14:11 -
schrieb smartin114--- via sr-users :

> Invite to carrier is good, sent over tls and so the reply from the carrier, 
> the 200 ok.  The ACK is sent via UDP and so is the Bye, which I didn't 
> include.

I fear I need more information and a complete example to see what might
be going wrong.

INVITE: FS => TLS => Kamailio => UDP => Carrier
some more messages
200 OK: Carrier => UDP => Kamailio => TLS => FS
and the ACK to the 200 OK, they are all fine?

So the Problem is the BYE when sent which direction? From the Carrier?

I assume this is the case.

Basically you need to look at the INVITE from the FS.

Does the Contact: header contain a transport=tls attribute? (According
to your example, it does)

So this information needs to be stored on the Carrier side (or whatever
B2BUA an the Carrier side handles the call) and when the carrier issues
a BYE the R-URI of that BYE needs to contain transport=tls as this is
the information, the last HOP towards the Fs side will be using when
all Route: Header have been consumed.

If this is NOT the case and transport=tls is missing in the BYE R-URI
the IMHO SIP implementation Carries side is 'broken', you face the same
issue I have had. :-)

If you are able to put other attributes in the invite Contact header,
and they are sent back the BYE from the Carrier, then you can copy the
transport value to a custom contact attribute (I use t=) and restore the
transport attribute on the R-URI from that.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: replies using the wrong protocol

2024-06-20 Thread Benoit Panizzon via sr-users
Hi

> Originating invite towards carrier.  Yes, the contact includes the 
> transport=tls.

I think I'm missing something.

Which message is not correctly routed?

The 200 OK reply to an INVITE which was initiated via transport tls? Or
messages in a new transaction of that call, possibly from the B to A
side?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: replies using the wrong protocol

2024-06-20 Thread Benoit Panizzon via sr-users
Hi

The INVITE would also be interesting.

Does the Contact: Header in the invite contain the transport=tls
attribute?

Souldn't the 200 OK reply contain at least one Record-Route (the lowest
one) stating transport=tls?

PS: I was facing a similar issue with a commercial SBC which, when
TLS/TCP is not licensed, has the oddity to remove the transport
attribute from the contact header and send new transactions in the same
dialog without specifying transport (defaulting to UDP). So I had to
create a copy the value of the transport header to a custom t=
contact attribute, which I then use to restore the U-URI transport
attribute towards the registrar handling the CPE connection.

> 200 OK from carrier
> SIP/2.0 200 OK
> Via:  SIP/2.0/TLS 
> KAM_PUB_IP:5061;branch=z9hG4bK18ff.3d856b8b0b007414ab2dec09cbabd574.0;i=a2
> Via:  SIP/2.0/TLS 
> FS_PUB_IP:5061;received=FS_PUB_IP;rport=56403;branch=z9hG4bKKaee61yyZ98De
> From:  "+14388006102" ;tag=XjQ5g4Ze5UaZp
> To:  ;tag=gK04d33797
> Call-ID: b99c2b65-a827-123d-1984-4201c0a80193
> CSeq:  84807919 INVITE
> Record-Route:  
> 
> Accept:  application/sdp, application/isup, application/dtmf, 
> application/dtmf-relay, multipart/mixed
> Contact:  
> Allow:  
> INVITE,ACK,CANCEL,BYE,REGISTER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH
> Require:  timer
> Supported:  timer
> Session-Expires:  1800;refresher=uac
> Content-Length:324
> Content-Disposition:  session; handling=required
> Content-Type:  application/sdp
> 
> v=0
> o=Sonus_UAC 913845 351585 IN IP4 CARRIER_PUB_IP
> s=SIP Media Capabilities
> c=IN IP4 206.146.100.22
> t=0 0
> m=audio 33168 RTP/SAVP 0 101
> a=crypto:1 AES_CM_128_HMAC_SHA1_80 
> inline:LfSgFSVqhXNWMSziOtwpEeYmNu0/kGiyuMVS8VXy
> a=rtpmap:0 PCMU/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-15
> a=sendrecv
> a=ptime:20
> 
> 
> ACK Kam is sending
> 
> ACK sip:933@CARRIER_PUB_IP:5061 SIP/2.0
> Via:  SIP/2.0/UDP 
> KAM_PUB_IP:5060;branch=z9hG4bK18ff.f8c56ea9cad44dc10408188224b923cf.0;i=a2
> Via:  SIP/2.0/TLS 
> FS_PUB_IP:5061;received=FS_PUB_IP;rport=56403;branch=z9hG4bKmK767vF2vjZ0S
> Max-Forwards:  69
> From:  "+14388006102" ;tag=XjQ5g4Ze5UaZp
> To:  ;tag=gK04d33797
> Call-ID: b99c2b65-a827-123d-1984-4201c0a80193
> CSeq:  84807919 ACK
> Contact:  
> Content-Length:  0
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
> 




Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Access avp vars in a cancel? How to pass information from an INVITE to a CANCEL?

2024-05-30 Thread Benoit Panizzon via sr-users
Hi

To determine, if rtpengine was engaged during an invite or not, I make
use of rr params for all messages in following transactions and I set
an avp for all messages in the current transaction.

When the call is canceled, I would need to call rtpengine_delete to
make sure rtpengine stops listening for rtp packets.

Unfortunately, the avp I set during the INVITE, does not seem to be
present while the CANCEL message is processed, despite to my
understanding being in the same transaction.

How can I pass some information from an INVITE to the corresponding
CANCEL?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] I'm looking for an get_rr_param() usage example

2024-05-27 Thread Benoit Panizzon via sr-users
Hi Gang

To process spiraling calls without the dialog module. I'm trying to use
a rr param to identify in which iteration I am.

So when I have a call spiraling through the same instance 3 times,
every time I process an invite I would do something like:

add_rr_param(";sp-count=$avp(sp-count)");

But to initialize that counter, I need to be able to read what is in
there beforehand.

if (check_route_param("sp-count=") {
get_route_param(msg, "sp-count", $avp(sp-count))
$avp(sp-count) = $avp(sp-count) + 1;
add_rr_param(";sp-count=$avp(sp-count)");
} else {
add_rr_param(";sp-count=1");
}

But what do I pass as msg parameter?

Is it the PV $msg(hdrs) ?

PS: I need this to append this to the call ID for rtpengine so I
hopefully can match new transactions no matter from which side they are
initiated to the correct rtp stream.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio works but voice is not present during the calls!

2024-04-29 Thread Benoit Panizzon via sr-users
Hi Christian

> this is interesting but when i install the package all start automatically.
> How can i disable this function (compilation for kernel module)?
> Maybe i need to install a different packege?

To disalbe kernel module usage:

rtpengine.conf

### for userspace forwarding only:
table = -1


Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Understanding NAT Flags

2024-04-29 Thread Benoit Panizzon via sr-users
Hi Alex

> I wouldn't worry too much about these. They're kind of an anachronism.

I just stumbled over your article:
https://www.cnblogs.com/shunzh/p/14360712.html

This helps a bit. After looking again at the issue I observe, I think I
have narrowed it down on the alias not being set on the replies.

So a 200 OK from a CPE behind nat, has a contact pointing to the IP
behind nat. Thus an ACK to that 200 OK is being routed to the IP behind
NAT.

I will keep digging into this and probably just have to get rid of
trying to understand how the NAT flags are being used in those examples
I found earlier.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Understanding NAT Flags

2024-04-29 Thread Benoit Panizzon via sr-users
Hi Gang

Somehow I don't get my head around NAT Flags and the nathelper module
https://www.kamailio.org/docs/modules/5.7.x/modules/nathelper.html

In the examples I found, there is: FLT_NATS and FLB_NATB

If I got it right, FLB_NATB is a branch flag, which shall indicate that
the device is 'B'ehind NAT, right?

It is being set, when FLT_NATS is set:

if(isflagset(FLT_NATS)) {
setbflag(FLB_NATB);
}

But when should FLT_NATS be set and what is it's meaning? The examples I
found don't tell me this.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to identify the instances of a looping call (including all replies and on all transactions)

2024-04-29 Thread Benoit Panizzon via sr-users
Hi List

I have stumbled over this challenge:

I have a kamailio server without dialog module. Only tmx module, acting
as registrar / rtpengine host.

If the call is routed over that server once, this works fine.

If the call is routed more than once (call from one location to another
on same registrar, call forwarding) then to correctly work, I would need
to engage rtpengine in a way to tell rtpengine to handle both call legs
separately.

By default, rtpengine identifies one call by Call-ID,FromTag,ToTag so
it considers all invocations to target one instance and on the 2nd
invocations it replaces the source rtp ip by it's own ip killing audio.

Using 'loop-protect' to prevent the 2nd invocation 'sort-of' works, but
not cleanly if I use different 'private' ip ranges on my voice core and
IC network to which CPE should not talk.

It is possible to pass a custom Call-ID to rtpengine. So this is how I
am considering finding a solution.

When passing the call-id to rtpengine I could append a leg identifier
to that call-id.

like $avp(rtp-callid) = $ci + $var(leg-id)

How could I reliably generate this leg-id / tell the legs apart?

Consider this situation:

  leg 1  leg 2
CPE-A => Kam-Reg => Routing Core => Kam-Reg => CPE-B

Also I wonder if I can use an AVP at all? From Kamailio's Point of
view, the first invite being routed twice could be the same transaction
with same shared AVP, right?

Is there a way to pass some information via flags appended route-header?
Or maybe use the count of via or route header to tell the legs apart?

Any ideas very appreciated.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Incoming IPv6 is send to IPv4 of the PBX instead of IPv6

2024-04-23 Thread Benoit Panizzon via sr-users
Hi Bernd

I also use dual-stack.

When the destination has an ipv6 and ipv4 address in the DNS, then
kamailio should be able to use either of those protocols to reach it.

So:

CPE => ipv4 => Kamailio => ipv6 => CPE

should work, if the involved CPE play along!

Example: Cisco SPA112 don't know about IPv6 IP addresses in SIP headers
and their parser uses ':' as hostname:port separator completely
breaking IPv6 addresses and building broken header in it's replies.

Also mind, the RTP stream. And ipv4 only CPE will not be able to
exchange RTP with an CPE advertising ipv6. So using ICE might help and
maybe even use rtpengine to tank different protocols on each leg.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio works but voice is not present during the calls!

2024-04-23 Thread Benoit Panizzon via sr-users
Ciao Christian

PCAP file would be easier to read. But let's see..

1st Leg:

Linode Client1 IP: 93.189.137.22 => Kamailio Server: 44.3.44.40
(73 from HB9EUE :-) )

That Linode Client has RTP on: 192.168.1.21

2nd Leg:

Kamailio (44.3.44.40) => Client2 (88.116.10.134) Grandstream

RTP Side 1: 192.168.1.21

Grandstream => Kamaililio 200 OK + SDP

Grandstream tells: RTP on: 188.116.10.134

So, the question is: Can 188.116.10.134 <=> 192.168.1.21 communicate
with each other?

I fear not! 192.168.1.21 is obviously behind NAT.

93.189.137.22 probably is a NAT router. Maybe it has a SIP ALG setting
which would take care to open ports and rewrite the RTP IP address? If
not, you loose!

Kamailio does nothing with the RTP audio stream. So both connected
clients would need to be able to directly send UDP packets to each
other.

OR: You need to 'backhaul' the rtp audio stream via some RTP proxy like
rtpengine which could detect NAT and try to send the RTP stream back
to the IP it received it from, instead of the one advertised in the
SDP.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio works but voice is not present during the calls!

2024-04-22 Thread Benoit Panizzon via sr-users
Ciao Christian

> I set up a Kamailio SIP server in a virtual machine on a private network and 
> i connect to this with a WireGuard VPN.

Maybe, provide more insight

Your Kamailio-Server also acts as the WireGuard Server?
All your SIP clients connect using WireGuard?

Can you ping from one WireGuard client to another?

An usual WireGuard Set-Up would look like:

WG-Server: 192.168.10.1/24

Client 1: 192.168.10.2/24 allowed IP: 0.0.0.0/0 (if you route all
trafic through the tunnel or 192.168.10.0/24 if you only want to route
that network)

Client 2: 192.168.10.3/24 and same allowed IP.

If you by mistake configured a client with a /32 netmask, it will not
be able to communicate with the other client, will not be able to
exchange direct RTP data.

Also make sure, Kamailio indeed listens to 192.168.10.1 and not to a
different IP.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio works but voice is not present during the calls!

2024-04-22 Thread Benoit Panizzon via sr-users
Ciao Christian

Unless you use rtpengine or similar, Kamailio won't do anything with
RTP.

So I fear, you have to sniff the INVITE + DSP and 200 OK + SDP of one
of those calls without audio. (tcpdump -nvs0 port 5060 on the kamailio
host for example)

Look at the

c=IN and m=audio lines in the SDP

The c=IN contains the IP address, the m=audio the port

Can the IP in the INVITE directly communicate wit the IP in the 200 OK
Reply and vice versa, or is one of them a 'private' IP behind NAT?

Can you ping from one ip to the other? What does traceroute from one ip
to the other say?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Solution found: Race condition in dialog on 422 reply deletes variables.

2024-04-08 Thread Benoit Panizzon via sr-users
Hi all

I have found another solution:

Don't use: setflag(FLT_DLG);

call dlg_manage() on every message entering request_route before trying
to set dlg_vars.

On a 422 reply I now get two CDR, but that is OK as long as I have
correct dlg_vars on the second almost identical call (endpoint
immediately re-sending the invite with smaller session timer) which is
then connected and which I need for billing.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to relay SIP messages to specific registered user in Kamailio?

2024-04-02 Thread Benoit Panizzon via sr-users
Hi Omar

> Thanks for your replay. Lookup is depending on pseudo-variables and in my 
> case I want to lookup for a static user "test" which is not included in the 
> R-uri or not even the request SIP message.
> 
> So is there any another way to do it?

Not sure what you exactly want to do. You want to add an additional
branch to the ones you got from the location lookup?

https://kamailio.org/docs/modules/devel/modules/corex.html#corex.f.append_branch

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Branch Route trigger for Withindialog calls?

2024-03-21 Thread Benoit Panizzon via sr-users
Hi List

I am just wondering...

When I am sending the initial INVITE to a customer CPE, this goes
throug the whole location lookup and through a branch route in which I
make some last adjustments to the headers, like removing header the
customer shall not get (like P-Asserted-Identity which would reveal the
caller identity on a callerid restricted call).

On a Re-Invite (session timer refresh) the call is being routed by
loose_route() and immediately sent to RELAY.

uac_replace and uac_restore seem to work fine for stuff like To and
From Header. But how do I prevent unwanted header to disclose
information to the customer which should ne be disclosed?

Do I need to re-arm the branch trigger also for within dialog calls?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: append_hf not working

2024-03-11 Thread Benoit Panizzon via sr-users
Hi Calvin

> I'm trying to add something simple like the following:
> 
> append_hf("X-testheader: True\r\n", "From");
> 
> However, I don't see my X-testheader in a packet capture. Are there
> any common pitfalls that would prevent append_hf from working as
> expected?

Weird, I use this a lot and it always works. But I never attempted to
specify the header after which it should be appended. Does it work if
you don't specifiy "From"?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Using uac_replace_to when forwarding call to another endpoint

2024-03-07 Thread Benoit Panizzon via sr-users
Hi Matthew

> However in my scenario I wish to first try one endpoint and then if it gets
> a 4XX response forward it to another UAC, and update the TO accordingly.
> 
> Currently trying to call  uac_replace_to twice shows an error and corrupts
> the TO header. Is there a work around for this?

I have no solution, but the same issue. (at the moment more or less
solved by heavily using dialog variables).

Example scenario showing the issue: Numbers are in e164 format, but
towards the customer, shall be translated in localized format and
privacy observed. Assume customer has Call forward on busy active.

So the steps towards the issue are:

* Translate numbers from e164 to local
* If privacy: id replace numbers and display name with 'anonymous'
* branch to customer
* uac_replace
* Manage reply: 486 busy
** Add diversion header ;reason=busy
** Add CFW destination RURI
** dispatch back to routing core.

Towards core, I would need to revert uac_replace and use the original
headers again.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: loose_route false when using topos? At which point in the call flow, does topos restore the Route header?

2024-02-27 Thread Benoit Panizzon via sr-users
Hi

By setting: branch_expire to the same value as dialog_expire which is
12 hours, now my headers get correctly restored on UPDATE and BYE.

But in this UPDATE scenario:

CPE A => Registrar A (topos) => Core => Registrar B (topos) => CPE B

I now have the phenomena that the Contact Header is being removed from
the UPDATE by topos on Registrar B.

Any clue what could cause the issue?

I see that Registrar A is adding a P-SR-XUID hader. Maybe I could
filter that header out on the Core?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: loose_route false when using topos? At which point in the call flow, does topos restore the Route header?

2024-02-26 Thread Benoit Panizzon via sr-users
Hi Karsten

> did you use some kind of db backend for topos like redis or mysql?

Well, you have to, to be able to store the route and via sets :-)

MySQL in use.

We might have figured out a possible cause.

This is the topology:

CPE <=> Kamailio Registrar <=> Kamailio Core <=> Interconnections.

Registrar handles mainly registration, runs rtpengine and this shall be
the place to hide topology towards the CPE.

The core takes care of routing, is dialogue aware and generates CDR for
billing.

So in the situation of CPE A calling CPE B we have:

CPE A => Registrar => Core => Registrar => CPE B

So two legs of the same call running over the same Registrar. It looks
like this breaks topos. I'll further investigate in this situation.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Topos methods_nocontact parameter

2024-02-26 Thread Benoit Panizzon via sr-users
Hi John

> Those 5 vias remind me an old firmware of Cisco equipment. I think I found 
> that
> once and solved with sems or something else acting as b2bua. 

It's not a Cisco. It's an ARRIS CPE which used to be operated as
PacketCable CPE but for which also a SIP Firmware is available.

I would love to use Kamailio as Registrar, especially as NAT seems to
work much better directly on Kamailio compared to when we use our
commercial B2BUA SBC in between which completely messes up some
'multiple CPE behind same NAT IP' situations.

But we might have figured out, what breaks topos. It's when a call is
from one CPE to another, both on the same Registrar. So we have two
call legs with the same callID on one registrar and on one topos
instance.

May I ask what you used as B2BUA?

 Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__


pgpN9F4CGd_kM.pgp
Description: Digitale Signatur von OpenPGP
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] loose_route false when using topos? At which point in the call flow, does topos restore the Route header?

2024-02-26 Thread Benoit Panizzon via sr-users
Hi

https://lists.kamailio.org/pipermail/sr-users/2020-July/109801.html

I have the exact same issue.

When the B side is starting a new transaction (UPDATE to refresh the
session in my case) without topos enabled, that transaction contains
one or multiple route header and a to_tag.

Therefore loose_route() is true and the call is more or less sent to
route(RELAY) immediately without further checks.

If topos is enabled, all record-route header are removed and only one
Via sent to the CPE.
So when the CPE replies, there is no Route header.
Therefore loose_route returns false.

This makes me wonder, at which stage is topos restoring the route
headers? Shouldn't that happen before loose_route is evaluated?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Topos methods_nocontact parameter

2024-02-26 Thread Benoit Panizzon via sr-users
Hi Alex

> There are lots of strategies for reducing message size, although the 
> RFC-recommended (better said, mandated :-) approach is just to switch to TCP 
> whenever your message sizes come within 200 bytes of the MTU, if I'm not 
> mistaken.

Those CPE do not support TCP.

> Otherwise:
> 
> 1) Turn on compact (abbreviated) SIP headers;

I would love to do that. But can I somehow instruct kamailio to
translate all headers to their compact format?

> 2) Strip header fields you can do without. This is dangerous territory, but 
> clearly some headers are less important than others, like "Date" or "Allow";

Done that, removed User-Agent and some more. Still not enough if there
are 5 or more Via and RR header.

> 3) Do not offer any unnecessary codecs, reducing SDP bloat.

The message body is not the issue, this seems to be handled in a
different memory buffer. The CPE crashed with a 'memory buffer too
small' when composing the reply to an invite with 5 or more Via and RR
even with minimalistic SDP. On the other hand, I threw a huge SDP with
ICE and Crypto to that CPE and it handled it well when only one Via and
no RR was present (after being handled by topos).

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Topos methods_nocontact parameter

2024-02-26 Thread Benoit Panizzon via sr-users
Hi Alex

> Not really a great answer for you, but I think you should reconsider using 
> `topos` to reduce SIP message size. 
> 
> `topos` is complex and I'm not sure the added complexity pays off in this 
> case, from a purely thermodynamic point of view.

So, any idea how to solve the issue?

At the moment, we have a commercial B2BUA SBC in front of Kamailio.
This SBC has some severe limitations and bugs, costs a lot for
licensing and is declared end of life next year.

I would love to just get rid of it and let kamailio handle everything.
So far, thinks look much cleaner and work more like expected, without
the SBC. Even IPv6 and tls and even rtp-crypto work thanks to rtpengine.
We loose T.38 fallback, but who cares, this also was not reliable
before.

But I must make sure, all existing CPE still work and can cope with the
additional Via and RR header and this is where I stumbled over one
vendor which seems to have messed that up by allocating a too small
buffer for composing the reply message.

Yes, we will contact that vendor, but I would not wonder if the reply
will be that those devices have reached end of life and no bugfixes
will be made.

Now I am just fighting with topos again. When a CPE to which topology
was hidden is sending an UPDATE. topos is unable to route that update.
Investigating.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Topos methods_nocontact parameter

2024-02-26 Thread Benoit Panizzon via sr-users
Hi

I'm having another go at topos trying to solve an issue of sip messages
getting to big for certain clients to process.

Unfortunately some methods (ACK/PRACK/BYE probably CANCEL) do not
contain a contact header, therefore the topology is still revealed (and
potentially a lot of via header inserted increasing message size).

Is it safe to set methods_nocontact to an empty string to force
creation of a Contact header for every SIP method?

Is there another way to completely hide topology aka keeping header
small?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to keep SIP messages small, possibly below fragmentation limit?

2024-02-26 Thread Benoit Panizzon via sr-users
Good morning Henning

> one really effective way is the topos module. If you can not use this, you 
> could switch to compact sip header. This way you save some bytes per 
> header-field. But this is something that needs to be supported from the user 
> agent as well. You could remove not needed headers and SDP inside the 
> Kamailio, but this will probably not help you a lot. In the end the user 
> agents need to be fixed, probably.

topos requires database but not dialog, right?

I remember I ran into issues with topos which I was unable to solve.

We have a CPE <=> Registrar(kamailio) <=> Routing Core(kamailio) <=> IC
topology

Topology shall be hidden towards the CPE, not towards the core. But I
didn't manage to achieve this, sometimes topology was hidden towards
core causing call failure and incorrect restoring of Route/Via header.
As I recall this happened in call forwarding scenarios (initiated on the
registrar).

Btw, is there a way to convert all header to compact header? I'm not
sure if our CPE would support them, but it's worth a try.

Is there a function returning, or PV containing the sip packet size to
try to take actions like removing unnecessary header and codecs if a
packet is over a certain size?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Variable specific to branch reply?

2024-02-20 Thread Benoit Panizzon via sr-users
Hi all

I had a mistake in the branch routes, which caused the AVP not to get
added to the stack in a case. That's why I had such a hard time with
the indexes being all over the place.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Variable specific to branch reply?

2024-02-19 Thread Benoit Panizzon via sr-users
Hi List

avp stacking is starting to drive me crazy... Somehow I don't
understand what is going on in this situation:

I have a main branch, and add two more branches with append_branch()

I use a on_branch_route trigger:

branch_route[BR_TO_CPE]
{

[Here, some code setting $var(needbh)]

if ("yes" == $var(needbh)) {
xlog("L_INFO", "$cfg(route): BR_idx: $T_branch_idx BACKHAUL: 
YES to $nh(u) \n");
add_rr_param(";rtp=yes");
record_route();
$avp(backhaul) = "yes";
$avp(nexthop) = $nh(u);
rtpengine_manage($avp(rtp_to_cpe));
} else {
xlog("L_INFO", "$cfg(route): BR_idx: $T_branch_idx BACKHAUL: NO 
to $nh(u) \n");
record_route();
$avp(backhaul) = "yes";
$avp(nexthop) = $nh(u);
}
}

In the Logs, I see Branches Index 0,1,2 with the desired information.
So I have 3 values stacked in the avp backhaul and nexthop, right?

When I get a reply, I would like to determine if backhauling is required or not.

onreply_route[MANAGE_REPLY]
{
xlog("L_INFO", "MANAGE_REPLY: for BR_idx: $T_branch_idx\n");

while ($(avp(nexthop)[$var(i)]) != $null) {
xlog("L_INFO", "MANAGE_REPLY: DEBUG Branch: $T_branch_idx VAR 
IDX: $var(i) NH: $(avp(nexthop)[$var(i)]) \n");
$var(i) = $var(i) + 1;
}
}

So on EVERY reply, I would expect to get three "DEBUG" lines as I stacked 3 
AVP..

Bug I get only 2!

Why I am missing one of the stacked AVP? (the last one as it looks like)

Or is there any other way to access a arbitrary variable specific to a
branch on the reply to that branch?

PS: I don't need $avp(nexthop). It's just an easy way to make sure I
get the correct avp index for the branch I am interested in.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to query, if callid is handled by rtpengine module already?

2024-02-19 Thread Benoit Panizzon via sr-users
Hi Bastian

> you can add a Record Route parameter to the initial INVITE [1] and for that
> parameter after loose_route() for in-dialog INVITE [2]

Thank you, that looks promising.

But now I face another issue with parallel branching.

On the branch route I do add_rr_param(";rtp=yes") if I need to backhaul
RTP towards that $nh.
I also set $avp(rtp) = 1 to engage rtpengine on transaction replies in
my MANAGE_REPLY route.

check_rr_param works fine on subsequent transactions. But not on the
initial one with branches.

But assume I got two parallel branches. One needs rtp backhauling, the
other one does not.

How can I, within my MANAGE_REPLY route, figure out, if I am
processing a reply which needs backhauling or not?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: What happens when using exit or return in branch route in parallel branching?

2024-01-30 Thread Benoit Panizzon via sr-users
Hi Alex

Only drawback I have with this is, when cycling through registered
contacts and adding branches. I can only have one trigger.


> request_route {
>...
> 
>if(jittery) 
>t_on_branch("BRANCH_DECAF");
>else
>t_on_branch("BRANCH_REGULAR");

Actual situation. I have two registrars, each one shall only send
invites to CPE registerd locally (aka where the socket is not 0)

So I loop through the AOR and:

* append_branch, if contact if socket > 0
* append_branch to other registrar if branch count < registered contacts

But I have to handle some headers and rtpengine differently, for
branches to an actual customer CPE or the one which might add a call to
the other registrar to correctly send the invite though the sockets
present there.

But, in my last tests, comparing $du and $(branch(uri)[]) in every
branch, I found there is an off by one with the index!

While in Branch $T_branch_idx = 0. I get the correct URI in
$(branch(uri)[-1]) matching to $ds.
In $T_branch_idx = 1, $ds corresponds to  $(branch(uri)[0]) and so on.

This is utterly weird I would not have expected the index to be
negative.

But I'll have a shot at $nh, thanks for pointing that out!

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: What happens when using exit or return in branch route in parallel branching?

2024-01-30 Thread Benoit Panizzon via sr-users
Hi Alex

> As is often the case, there is a useful opportunity here to step back, switch 
> to decaf, and ask why you want to call 'exit' from a branch_route in the 
> first place. 

:-)

Actually I intended to call 'return(1)' to stop processing that actual
route and continue in the calling route at the point when all work is
done.

I wrapped everything in if/else and I am re-testing.

But on the first glimpse, I still seem to get corrupted stuff at a
certain point in branching like $du being null instead of the intended
destination of that branch.

Am I right, that $du should contain the sip URI of where the INVITE is
being routed to in the branch route? Or am I mistaking here?

In most of my branches, $du is correctly pointing to the next hop (so I
can use it to determine how to engage RTPengine), but sometimes it's
null and I still didn't figure out why.

I'll probably send another email with more details of what I try to
accomplish a bit later when done testing and still facing the issue.

Your help is very appreciated!

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Same number of max concurrent requests on backends

2024-01-30 Thread Benoit Panizzon via sr-users
Hi Unai

> It looks like now I have all pieces configured and I can see output when I 
> run "kamctl dialog show”. Is there a way to verify that the load balancing is 
> working as expected (aside from reproducing the production scenario)? Is 
> there any log to enable and/or look at? Any stats or module? Thank you

'kamctl dialog show' return all dialog from all DMQ synced notes.

'kamctl stats dialog' returns stats on the actual node. Those values are
also exposed via SNMP.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] What happens when using exit or return in branch route in parallel branching?

2024-01-30 Thread Benoit Panizzon via sr-users
Hi

I was wondering what exactly happens with parallel branching in this
situation:

branch_route[BR_T]
{
if (condition)
{
# Stuff below not required
exit or return
}

do other stuff before relaying

}

Will this break, stop the processing of all branches with higher
index as the one being processed? From what I observe, I fear this is
the case.

Could I safely use return(1) (vs return which probably is return(0)
thus eq exit)? Or would the only safe option be to wrap the 'other
stuff' in an else statement?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: usrloc database duplicate keys issue

2024-01-29 Thread Benoit Panizzon via sr-users
Hi Henning

> somehow the usrloc internal record id got duplicated. Are you seeing this 
> error frequently or just on some occasions, like the restart you mentioned?
> You can try to activate this parameter:
> https://kamailio.org/docs/modules/5.7.x/modules/usrloc.html#usrloc.p.db_insert_update

It only happens when restarting. I fear, there is some racing
condition when kamailio initially reads in the database and clients
re-register at the same time. Then the problem persists, and constantly
generates error entries in the log, until I delete the
eventually 'expired' entries from the database manually.

Dank you for pointing out: db_insert_update, I missed that option, that
sounds like the solution I was looking for.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to set a branch specific variable?

2024-01-25 Thread Benoit Panizzon via sr-users
Hi Gang

I would like to set a variable specific to the branch. Is there a way?

append_branch($var(aor1));
$(branch(dst_uri)[-1]) = $var($dst1)
$(branch(want_plus)[-1]) = 1;

append_branch($var(aor2));
$(branch(dst_uri)[-1]) = $var($dst2)
$(branch(want_plus)[-1]) = 0;

t_on_branch("BR_T");

branch_route[BR_T]
{
if ($branch(want_plus))
{
$rU = "+" + $rU;
}
}

Or would there be a way to query the index of the added branch so I
could stack an avp with that index to access in the branch route?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to assign xavp array to htable?

2024-01-25 Thread Benoit Panizzon via sr-users
Hi List

Via sql_xquery I get a stacked xavp aka array.

I would like to store that stacked xavp into a hash table for later usage in 
other transactions. Is this
possible?

Via xarp_parameters explode or implode does not work as that would stringy the 
same key multiple times.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to check for branches with a pending reply in MANAGE_REPLY to correctly handle rtpengine?

2024-01-23 Thread Benoit Panizzon via sr-users
Hi gang

location database contains multiple contacts for an AOR

The invite therefore is parallel branched to those multiple contacts.
Each reply from each branch is handled by MANAGE_REPLY.

rtpengine_manage() is called in MANAGE_REPLY to stop rtpengine
processing a failed call.

Unfortunately, if any of the contacts replies with an error
rtpengine_manage() will stop RTP processing.

Is there a way I could check if there are branches with a pending reply
from within MANAGE_REPLY so I could call rtpengine_manage() only when
the last reply (no pending replies) are present?

Hmm, realizing, if I process the last pending error reply and a prior
one got a positive reply, this would still kill media.

=> How do I solve this?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: trigger different branch route on branch added with append_branch

2024-01-18 Thread Benoit Panizzon via sr-users
>   Is there a way to trigger a branch route for only some of the
>   destinations added with append_branch? Or to trigger different
>   branch routes for different destinations in one set added with
>   append_branch?

Always the same, when the email is sent and I start thinking of
something else, I get the right idea!

Within the branch route, I guess I can check the destination URI and not
remove the X- Header when the destination URI points to the other
registrar.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] trigger different branch route on branch added with append_branch

2024-01-18 Thread Benoit Panizzon via sr-users
Hi List

Imagine the following situation:

Two Kamailio registrar proxies handling the same domain. Location
Information synced via DMQ.

So if a device registers we don't know on which of the two registrar
proxies.

Core proxy is dispatching calls to either one of those registrars.

Core also performs AOR database lookup and adds an X- header telling
which AOR the call is destined to.

Registrar performs lookup of that AOR in the location database and
routes the call to destination.

Problem: The call could be routed to the the registrar which does
not hold the active socket to that client.

Solution: reg_fetch_contacts, cycle the contacts and append_branch if
the contact has a local socket.

Next Problem: I use a failure_route to sent the call to voicemail, if
not registered, busy etc. This would trigger, if we have no
local socket for the registration which is on the other
registrar. So I have to find a way to send the call to the
other registrar.

I guess I can append_branch a branch pointing to the URI of the
other registrar. This would then succeed in reaching the
device. Also using the failure_route would work this way if
we get a remote error from behind the other registrar or no
registration at all.

Next Problem: I use a branch trigger to remove undesired header I do
not want to send to the customer. Now imagine that AOR has two
contacts, one on registered on each registrar proxy.

So I end up with two destinations added with append_branch to
the destination set.

One points to the device of the locally registered customer
device, the other one points to the other registrar where to
find the other device.

I use a branch route trigger to remove the X- Headers towards
the customer.
But I need to X- Header containing the destination AOR to still
be sent to the other registrar.

Is there a way to trigger a branch route for only some of the
destinations added with append_branch? Or to trigger different
branch routes for different destinations in one set added with
append_branch?

Or am I doing this completely wrong and there is an easier way? ;-)

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to change uri for db_mysql ?

2024-01-18 Thread Benoit Panizzon via sr-users
Hi

Just a guess:

https://www.kamailio.org/docs/modules/devel/modules/sqlops.html#idm85

If you define 'localhost' then the default socket (probably somewhere
in your MySQL config) ist taken.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: usrloc ka_mode - Flooding OPTIONS at same time?

2023-12-11 Thread Benoit Panizzon via sr-users
Hi Alex

> Perhaps it is helpful to ask a more basic question: why are you using 
> server-side keepalives?

Because of a *stupid* cloud hosted PBX vendor solution.

That vendor is hosting his PBX behind a NAT without SIP ALG.

NAT UDP Timeout 90 seconds!

That vendor refused to send any kind of keep-alive from his cloud PBX
instances. Her refuses to increase UDP keep alive. He considers keeping
the UDP session alive to be the task of the 'registrar'.

Apparently, all SIP provider in Switzerland send UDP keep alives once
per minute to all their customers, as we were the only one, where NAT
kept timing out rendering the cloud PBX instance behind NAT unreachable.

So I enabled this to make our 3 customers on that cloud platform happy.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] usrloc ka_mode - Flooding OPTIONS at same time?

2023-12-11 Thread Benoit Panizzon via sr-users
Hi

We have reached 2 registered CPE and start facing issues.

Am I observing correctly that when ka_mode 4 is enabled, OPTIONS are
send simultaneously to all registered CPE and not spread over the
interval?

They could be the cause very high pps peaks on network equipment?

If so, is there a way to spread the ka options over time so they don't
cause such high peaks?

Or even better, is there a way to enable them for only some customers
via a variable?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] stats.get_statistucs dialog: counter over/underrun?

2023-12-05 Thread Benoit Panizzon via sr-users
Hi List

Kamailio 5.5

# kamcmd stats.get_statistics dialog:
dialog:active_dialogs = 17
dialog:early_dialogs = 18446744073709551615
dialog:expired_dialogs = 0
dialog:failed_dialogs = 31198
dialog:processed_dialogs = 107519

Where could this early_dialog value come from?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to use: kamcmd ul.db_users? (solved)

2023-11-30 Thread Benoit Panizzon via sr-users
Hi

> But no matter how I try, I get a 500 error...
> 
> # kamcmd ul.db_users location

Still curious why this does not work.

> Or would I need to query this directly from the database?

Solved my requirement:
snmpget -Oqv -v 2c -c NotActualCommunity localhost 
KAMAILIO-SIP-SERVER-MIB::kamailioSIPRegCurrentUsers.0

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to use: kamcmd ul.db_users?

2023-11-30 Thread Benoit Panizzon via sr-users
Hi List

I want to find a way to check how many users are regsitered.

https://www.kamailio.org/docs/modules/devel/modules/usrloc.html#usrloc.r.db_users

But no matter how I try, I get a 500 error...

# kamcmd ul.db_users location

And yes, the table is called 'location'.

I did try to find out how kamctl ul show --brief pulls that
information, but did not succeed. Also that command takes way too long
how that we have several thousand registered users.

Or would I need to query this directly from the database?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to remove record-route and via from a forwarded call?

2023-11-27 Thread Benoit Panizzon via sr-users
Hi Daniel

> the B should not do record_route() when forwards back INVITE to A.

Right, moving record_route() from the beginning of request_route{} to
the branch routes requiring this, solved this for the RR header on my
registrar node.

> Via is for routing back replies, if you remove it, node B does
> retransmissions because it does not receives any response and will also
> send a failure code at some point.

Hmm, ok, so that is a problem, as replies with SDP are passed via B. My
attempt to set an AVP on cfw to remember we don't want to
rtpengine_manage() the reply, looks promising so far.
 
> Alternative is to send 302 or something else back to A, which does the
> redirect using script operations to fetch the contact address or
> uac_redirect module.

I would love to handle all call forwarding situations on the
registrar, so the core (running the dialog module for CDR and channel
count per customer) can rely on getting full call legs from one
dispatcher to another.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to remove record-route and via from a forwarded call?

2023-11-27 Thread Benoit Panizzon via sr-users
Hi Alex

> If you're having to think about how to do things that break basic SIP 
> semantics, it may be time to rethink your design. 

:-) We went into production far down that rabbit hole now. It would be
quite hard to pull out from that far in.

> More particularly, passing requests from A to B back to A, when A and B are 
> both proxies, is problematic. It will lead to potential call loops if the 
> request should find itself back at the same UA that originated the call. The 
> usual solution is to create a B-leg by laundering the call through a 
> lightweight, signalling-only B2BUA, such as SEMS.

At the moment, we have a commercial SBC which handles RTP, but that SBC
has a lot of limitation and is nearing EOL by the vendor, so we want to
get rid of it eventually.

So I'm working on adding rtpengine on the registrars and ran into that
issue.

In the meantime, I managed to get rid of the record-route headers by
calling record_route() in the branch route towards the customer. So if
this fails, I'm back with the original invite I send back to A which
does not contain B anymore in the route-set.

But that did not get me rid of the Via header, which I believe is added
by the TM module. So it would be nice to also find a way, not to
generate the via header on a specific branch (or generate the via
header on branch basis).

Well I'll attempt another way. I know when call forward was engaged,
so I could add an $avp(cfw) = 1 and not engage rtpengine when this is
set. So I would still have signaling via the registrar, but not mess
around with rtpengine trying to add itself in the RTP path.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to remove record-route and via from a forwarded call?

2023-11-27 Thread Benoit Panizzon via sr-users
Hi List

Two Kamailio Nodes situation.

Node A: Routing Instance.
Node B: Registrar Instance.

An invite is sent from Node A to B.

Customer registered on B is 'busy' as example.

B initiates Call Forwarding by adding a Diversion Header and sending
the Invite back to A with a new R-URI towards the CFB destination.

The Invite sent from B to A still has Node B in it's Record-Route. So
all subsequent SIP messages pass via B, which is not needed and cause
issue with rtpengine running on B.

I attempted to remove_record_route(); when sending the call back to A,
but this causes:

parse_headers(): bad header field [;lr;ftag=3910078620-883101371>

It looks like only the beginning of the RR header is removed leaving
back a competely broken line.

What is the propper was to remove a node from RR and Via routing?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Dialog + DMQ: dlg_ontimeout() triggered on wrong node!

2023-11-23 Thread Benoit Panizzon via sr-users
Hi

I'm opening an issue on github as I consider this a bug.

This fixes the issue:

route[DMQ_CAPTURE]
{
if(is_method("KDMQ"))
{
if(has_body("application/json") && $fU == 'dialog')
{
if (jansson_get("lifetime", $rb, "$var(lifetime)"))
{
$var(new_lifetime) = $var(lifetime) + 60; # Add 
60 seconds on DMQ peer to make sure it expires AFTER main node.
$var(newrb) = $rb;
jansson_set("integer", "lifetime", 
$var(new_lifetime), "$var(newrb)");
set_body("$var(newrb)","application/json");
msg_apply_changes();
}
}
dmq_handle_message();
exit;
}
}


Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: set_body() adding or replacing existing body?

2023-11-23 Thread Benoit Panizzon via sr-users
> Is there a way to crank up debug output in the dialog and/or dmq module?

debug=3 is what I was looking for.

And that looks good:

DEBUG: dialog [dlg_dmq.c:142]: dlg_dmq_handle_msg(): body: 
{"action":2,"h_entry":3217,"h_id":4523,"state":4,"start_ts":1700748833,"lifetime":43265,
 ...

That is the updated lifetime...

DEBUG: dialog [dlg_dmq.c:160]: dlg_dmq_handle_msg(): found field: lifetime

so my altered lifetime is received on the DMQ peer. But why don't I see
it inserted?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] set_body() adding or replacing existing body?

2023-11-23 Thread Benoit Panizzon via sr-users
Hi

I'm trying to change the lifetime timer on a KDMQ dialog message before
handing it with dmq_handle_message();

if(has_body("application/json") && $fU == 'dialog')
{
if (jansson_get("lifetime", $rb, "$var(lifetime)"))
{
xlog("L_INFO", "$cfg(route): DIALOG JSON 
action: $var(action) state: $var(state) lifetime: $var(lifetime)\n");
$var(new_lifetime) = $var(lifetime) + 60;
$var(newrb) = $rb;
jansson_set("integer", "lifetime", 
$var(new_lifetime), "$var(newrb)");
xlog("L_INFO", "$cfg(route): DIALOG JSON NEW: 
$var(newrb)\n");
set_body("$var(newrb)","application/json");
msg_apply_changes();
}
}
dmq_handle_message();
exit;

The JSON string looks good after that manipulation, it contains the
updated lifetime.

But dmq_handle_message() does not seem to get the body anymore. So I
wonder what set_body() exactly does. Is it replacing the body or
appending to it?

Is there a way to crank up debug output in the dialog and/or dmq module?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Dispatcher list reloading itself from file?!?

2023-11-13 Thread Benoit Panizzon via sr-users
Hi Daniel

> there is no automatic reload, be sure you do not have some timer routine
> (inside kamailio.cfg or cron.d) that does it, or an external application
> (e.g., management application).

Thank you, that was the cause. We have a cronjob which downloads rules
from a spit call blocklist supplier, puts them in various textdb htables
and mtrees and reloads them.

That script also preformed dispatcher.reload.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to check for presence of a file from a route? (Or any other way to tell kamailio not to accept new calls)

2023-11-13 Thread Benoit Panizzon via sr-users
Hi

I'm still looking for a better way to tell Kamailio that we want to
enter 'maintenance' and STAY in maintenance after a restart.

Maintenance is: Reject all messages without totag with 503 to prevent
creating new dialogues.

I could use a shared pv and the use kamcmd pv.shvSet to toggle it.

But when kamailio is restarted, that pv is also reset to it's initial
state. Not good, if I want to make sure the node stays in maintenance
mode after a restart as for example after pushing a config change via
ansible.

So what comes to my mind is to check for the presence of a file.

something like:

route[CHECK_MAINTENANCE]
{
if (!has_totag() && is_method("INVITE")) {
if (file_exist("/etc/kamailio/maintenance.flag")) {
xlog("L_ERR", "Maintenance flag present! Rejecting 
INVITE\n");
t_send_reply("503", "Maintenance mode - no new calls 
accepted");
exit;
}
}
}



Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Sequential fork with different Call-Ids

2023-11-09 Thread Benoit Panizzon via sr-users
Hi

> I have a scenario on wich requires sequential fork (up to 30 possible 
> destinations) with different
> Call-ID for each leg. I am using topoh module enabled, but it always puts the 
> same Call-ID.
> Someone have a solution for this scenario?

AFAIK that is not possible as Kamailio, being a proxy, will never
generate a new Call-ID.

I had the same issue. I have a core, which takes care or routing and
gathering CDR for billing (using the dialog module) and a registrar
which takes care of registration, location service and call forwarding.

Call Forwarding happens on the registrar for example on destination
busy.

So if a call takes the route Core => Registrar (CFW engaged) => Core

I also would have loved to get a different CDR for that 2nd leg on the
Core, so I have one to bill to the origin of the 1st leg and one to
bill to the origin of the 2nd leg.

I had to add a 'leg_history' variable to my CDR where I keep track of
how many legs are present and who originated which leg, so I can split
this in multiple CDR in the rating backend.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio 5.7 still segfaulting on TLS with Ubuntu Jammy

2023-10-31 Thread Benoit Panizzon via sr-users
Hi Anthony

You were spot on. Not a single crash occurred anymore after setting:

modparam( "db_mysql", "opt_ssl_mode", 1 )

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to filter out xhttp request in event_route[siptrace:msg]

2023-10-23 Thread Benoit Panizzon via sr-users
Hi Karsten

> how are you measure the traffic you don't want to your Homer? Print stuff
> in that Kamailio event route or something else?

Basically, I want to mirror sip messages to homer, only sip messages
relevant to calls, not anything else which might be processed by
kamailio.

modules.inc:loadmodule "siptrace.so"
modules.inc:modparam("siptrace", "trace_flag", 22);
modules.inc:modparam("siptrace", "trace_on", 1)
modules.inc:modparam("siptrace", "trace_mode", 1)
modules.inc:modparam("siptrace", "hep_mode_on", 1)
modules.inc:modparam("siptrace", "hep_version", 3)
modules.inc:modparam("siptrace", "hep_capture_id", HEP_CAP_AGENT)
modules.inc:modparam("siptrace", "duplicate_uri", HOMERSIPURI)

I also use the xhttp interface for jsonrpc and a custom API.

For this I have kamailio also listen to TCP port 8080 to have those API
xhttp requests clearly separated from call traffic.

But, as I understand, xhttp requests are initially handled as if they
were sip requests and get processed request_route{}

So my request route starts with:

request_route {

# Handle DMQ requests
route(DMQ_CAPTURE);

# Make sure we operate on the correct port (not on the xhttp one)
if ($Rp != 5060 && $Rp != 5061) {
xlog("L_ERROR", "REQUEST_ROUTE $rm to wrong port $Rp\n");
exit;
}

so all SIP method requests to port 8080 are being dropped.

I process xhttp traffic with the appropriate event route and of course
reject http requests to sip ports with the appropriate http error
message.

event_route[xhttp:request] {
if ($avp(debug) > 0) {
xlog("L_INFO", "$cfg(route): XHTTP Request to URI: $hu Port: $Rp BODY: 
$rb\n");
}
if ($Rp != 8080) {
# We got a HTTP Request on a sip port. Reject!
xhttp_reply("418", "I'm a teapot", "text/html", "I'm not a 
Web-Server!");
exit;
}
if ($hu =~ "^/RPC") {
### KAMAILIO JSONRCP pass-through
jsonrpc_dispatch();
} else if ($hu =~ "^/API") {
### IMPROWARE API

[...]

What I observe is the siptrace module being triggered right at the
start of request_route. This makes sense, I want to mirror every sip
message.

But his also causes mirroring of the xhttp requests and replies to port
8080.

Is there a way to prevent this?

siptrace has an event route capable of filtering, as I understand it is
only possible to filter on the SIP request method, not anything else:

event_route[siptrace:msg] {
if(is_method("KDMQ")) {
drop();
}
}

Do I miss something? How can I prevent/filter xhttp requests to be
mirrored by the siptrace module?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to filter out xhttp request in event_route[siptrace:msg]

2023-10-17 Thread Benoit Panizzon via sr-users
Hi

Further trying to eliminate every possible cause of UDP drops...

We use Homer as HEP server in conjunction with the siptrace module.

So to prevent DQM traffic to be sent to Homer I added:

event_route[siptrace:msg] {
if(is_method("KDMQ")) {
drop();
}
}

And had a closer look to the traffic sent to homer.

I noticed, also xhttp:requests, as far as I see the replies, not the
requests, get mirrored to homer.

xhttp is not a sip method I could match I guess.

The event_route[siptrace:msg] docs state only method can be filtered.
So I can not filter requests on the separate http port I listen on for
xhttp json-rpc requests.

How can I prevent xhttp traffic to be mirrored to homer by the siptrace
module?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Switching DMQ transport to TCP?

2023-10-17 Thread Benoit Panizzon via sr-users
Hi Gang

While still hunting DMQ issues, I noticed that the OS is reporting UDP
drops. Maybe DMQ packets? Would DMQ re-send a lost packet?

I increased OS UDP RX buffers times 10 and monitoring counters.

I also found that DMQ can use tcp or tls as transport.

Could this help to prevent loosing DMQ messages? Or is this prone to
cause new issues?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Dialog Module: enable_dmq and multiple nodes update SAME profiles_with_value counter?

2023-10-16 Thread Benoit Panizzon via sr-users
Hi Team

I'm still hunting down DMQ dialog issues.

https://www.kamailio.org/docs/modules/devel/modules/dialog.html#dialog.p.enable_dmq

Quote:
"Notably, it is not possible to send in-dialog requests on any but the
original proxy instance."

I make sure, that if a procied call (with same callID) is being
redirected from anywhere, it is send to the came dialog aware kamailio
instance it originated from. This seems to have fixed a lot of issues
with dialogues getting corrupted.

The two main purposed we use dialog is:

* CDR
* Channel Counting / Limiting

modparam("dialog", "profiles_with_value", "custprofilecounter");

Can a such profile WITH value be written from any node sharing dialog
via DMQ or is this bound to cause troubes?

Example.

Two call get to same customer, but over two different nodes.

Node A is getting a call:

set_dlg_profile("custprofilecounter","Customer7664");
get_profile_size("custprofilecounter","Customer7664","$var(busy_count)");

=> $var(busy_count) is now 1.
The profile is replicated to Node B and the value can be accessed there.

While Call on Node A is running, Node B is getting a call to same
customer:

set_dlg_profile("custprofilecounter","Customer7664");
get_profile_size("custprofilecounter","Customer7664","$var(busy_count)");

=> $var(busy_count) is now 2 on Node B.

Is this value being replicated BACK to Node A where the profile counter
originally was created?

As far as I have experienced, this is the case.

But what happens if the call on Node B is ending before the Call on
Node A? Will the counter being decreased also correctly be replicated
to Node A?

What happens the other way round?

What happens if both call end at the same time? Is a race condition
possible, or is there some sort of locking to prevent this?

Can I use profiles_with_value the way I use them? Or is this bound to
fail because it's not supported?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to validate re-invites without challenging them?

2023-09-19 Thread Benoit Panizzon
Hi List

At the moment, we challenge every invite (and re-invite) to make sure
the customer is authenticated.

Now we have one kind of PBX, which never does not authenticate when we
challenge a Re-Invite.

According to the vendor of that PBX's RFC interpretation, answering a
challenge to a re-invite is optional. If that is ignored by the PBX,
then the existing established dialog shall not end.

Unfortunately this causes the session timer to run out.

I am therefore wondering, if there is a safe way not to challenge
re-invites.

A Re-Invite contains a To-Tag. So I could bypass authentication on
presence of a to-Tag. But then, how do I prevent a customer to just set
a spoofed To-Tag to circumvent authentication?

Is there a feasible way?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Add Header to reply on failure_route

2023-09-18 Thread Benoit Panizzon
Am Mon, 18 Sep 2023 10:09:40 +0200
schrieb Benoit Panizzon :

>   append_to_reply("X-RR: (append reply) Final Dispatch Failure 
> $avp(dispgroup):$avp(trunkname)\r\n");

Found a mistake. append_to_reply works.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Add Header to reply on failure_route

2023-09-18 Thread Benoit Panizzon
Hi List

I'm attempting to add a header to a reply message on failure.

Situation:

Registrar => Core => (dispatcher list) => Various IC

I would like to know on the registrar, which of the dispatcher groups
failed.

What I attempted sofar:

failure_route[DISPATCH_FAILURE]
{
append_to_reply("X-RR: (append reply) Final Dispatch Failure 
$avp(dispgroup):$avp(trunkname)\r\n");
append_hf("X-RR: (append hf) Final Dispatch Failure 
$avp(dispgroup):$avp(trunkname)\r\n");

$avp(rstatus) = t_get_status_code();
$avp(rtext) = $T_rpl($rr);

$avp(rtext) = "REMOTE REPLY: " + $T_rpl($rr);
t_send_reply("$avp(rstatus)", "$avp(rtext)");
}

I only get status text is getting through to my reply. I would much prefer to 
add a header which I could then extract on the registrar. Am I missing 
something which could prevent addition of a header in a reply?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Skip/discard branch in branch route?

2023-09-11 Thread Benoit Panizzon

$(branch(dst_uri)[-1]) = $(ulc(aor=>received)[$var(i)]);

seems to be correct.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Skip/discard branch in branch route?

2023-09-11 Thread Benoit Panizzon
Hi Yuriy

I fear I still need some help

What I am doing now is:

if(reg_fetch_contacts("location", "$var(lookupuri)", "aor")) {
t_newtran();
xlog("L_INFO","$cfg(route): Existing registration contacts 
count: $(ulc(aor=>count))\n");
$var(i) = 0; # Location Contact Index
$var(c) = 0; # Valid Contact count
while($var(i) < $(ulc(aor=>count))) {
xlog("L_INFO","$cfg(route): $var(i): Contact-Address: 
$(ulc(aor=>addr)[$var(i)]) Socket: $(ulc(aor=>socket)[$var(i)]) RU: $ru\n");
if ($(ulc(aor=>socket)[$var(i)]) == 0) {
xlog("L_INFO","$cfg(route): $var(i): NO 
SOCKET\n");
} else {
if ($var(c) == 0) {
$ru = $(ulc(aor=>addr)[$var(i)]);
$du = $(ulc(aor=>received)[$var(i)]); # 
NAT
$fs = $(ulc(aor=>socket)[$var(i)]);
$var(c) = $var(c) + 1;
} else {

append_branch($(ulc(aor=>addr)[$var(i)]));
$(branch(uri)[-1]) = 
$(ulc(aor=>received)[$var(i)]); # NAT?
$(branch(send_socket)[-1]) = 
$(ulc(aor=>socket)[$var(i)]);
$var(c) = $var(c) + 1;
}
}
$var(i) = $var(i) + 1;
}
if ($var(c) == 0) {
xlog("L_INFO","$cfg(route): We have $var(c) local 
contacts! Reject\n");
send_reply("480", "Not local contact found");
exit;
}
xlog("L_INFO","$cfg(route): We have $var(c) local contacts!\n");
} else {
xlog("L_INFO","$cfg(route): We have contact at all!\n");
send_reply("480", "No registered");
exit;
}
t_on_branch("BR_TO_CPE");
t_on_failure("LOCATION_MANAGE_FAILURE");
route(RELAY);
exit;

When I look at the trace:

R-URI contains the user@ip:port from the location record. So each device 
different.
But all requests are sent to only one device! (probably $du as set on the first 
match)

branch_route[BR_TO_CPE]
{
if ($avp(debug) > 0) {
xlog("L_INFO", "$cfg(route): BR_idx: $T_branch_idx  
$avp(from_in) => $avp(destination) (Contact: $rU)\n");
}
$var(useragent) = $(ulc(aor=>user_agent)[$T_branch_idx]);
$var(reg_contact_addr) = $(ulc(aor=>addr)[$T_branch_idx]{uri.host});
$var(socket) = $(ulc(aor=>socket)[$T_branch_idx]);
if ($avp(debug) > 1) {
xlog("L_INFO", "$cfg(route): $(branch(uri)[$T_branch_idx]) via 
socket: $var(socket)\n");
}
}

On $T_branch_idx == 0 everything looks fine.

R-URI is correct, INVITE is sent to correct distination ip and port previsouly 
set.

On $T_branch_idx == 1 things stuff is wrong.

$(branch(uri)[$T_branch_idx]) returns 

R-URI contains the received URI without Username (which is what I set above)
But the request is sent to the same ip and destination as branch 0.

So I guess I mixed up $du and received.

Does $branch(dst_uri) correspond to $du?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to handle 302 redirects

2023-06-22 Thread Benoit Panizzon
Hi

This is how I handle them on the registrar:


[...]
# Record original destination before performing call forwarding
$avp(pre_redir_destination) = $rU;
[...]

Somewhere in the config we start reacting to replies from the
customer like when busy...

if (t_check_status("(486)|(600)")) {
$avp(cf_reason) = "user-busy";
route(CFB); # Check if Call Forward on Busy is active and if 
so, handle this
route(CFVM); # Check if Call Forward to Voicemail is active and 
if so, handle this
$avp(announcecode) = "BUSY"; # No Call Forward setting found to 
handle 'busy' so just send to media server and play BUSY tone.
t_send_reply("$avp(rstatus)", "$avp(rtext)");
exit;
}

Or the one you are looking for, when customer replies with 301 or 302:

if (t_check_status("(301)|(302)")) {
$avp(destination) = $(T_rpl($ct){tobody.user});
if ($avp(debug) > 0) {
xlog("L_INFO", "$cfg(route): Got REDIRECTION: 
$avp(rstatus) $avp(rtext) towards $T_rpl($ct) => $avp(destination) RU: $rU");
}
$avp(cf_reason) = "deflection";
t_on_branch("BR_REDIR_TO_CORE");
route(ROUTE_TO_CORE);
exit;
}

branch_route[BR_REDIR_TO_CORE]
{
if ($avp(debug) > 0) {
xlog("L_INFO", "$cfg(route): BR_idx: $T_branch_idx 
$avp(pre_redir_destination) NEW: $avp(destination) FROM: $avp(from_in) setting 
TO\n");
}
if (is_present_hf("X-OrigFrom")) { # Restore From we had before 
possible translation to customer
$fU = $(hdr(X-OrigFrom));
}
remove_hf("Diversion");
$avp(pai_in) = $avp(pre_redir_destination);
$var(newdi) = ";reason=" + $avp(cf_reason);
if ($avp(debug) > 0) {
xlog("L_INFO", "$cfg(route): Adding HEADER: $var(newdi)\n");
}
append_hf("Diversion: $var(newdi)\r\n");
$tU = $avp(destination);
$rU = $avp(destination);
}


Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: impossible to modify $tU twice

2023-06-15 Thread Benoit Panizzon
Hi David

If you change $tU outside a branch route, kamailio just appends the new
value to the existing one.

You have to use branch routes, the changes are only valid in the branch
so if the branch fails without the call being connected (and for
example a failure route is triggered) you can set $tU again in the next
branch.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio/MySQL Module compatibility with MySQL 8.0+

2023-06-12 Thread Benoit Panizzon
Hi

Kamailio 5.5 and 5.6
Server version: 8.0.33-0ubuntu0.20.04.2 (Ubuntu)

Using db_cluster

Only issue I occasionally observe is when a query times out or has some
other issue, then the query fails and is not retried on the next
cluster member. But I guess this is how db_cluster works and not
related to the underlying MySQL version.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] What is the best way to return a lot of data via JSONRPC and jansson?

2023-06-12 Thread Benoit Panizzon
Hi Team

To offer some diagnose functionality I created an API that returns the
location list via JSONRPC

But this creates huge variables.

Jun 12 09:43:32 prod-cpereg02 kamailio[2174548]: ERROR:  
[core/pvapi.c:1491]: pv_printf_mode(): no more space for spec value - printed:0 
token:8599 buffer:8192
Jun 12 09:43:32 prod-cpereg02 kamailio[2174548]: ERROR:  
[core/pvapi.c:1503]: pv_printf_mode(): buffer overflow -- increase the buffer 
size...

Already hitting the default limit and not sure this is the right way to
go as we will end up with thousands of registrations.

What is the best way to return larger ammounts of data out of kamailio?

Avoid using the JSONRPC and access the database externally?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: lost module: best practice handling delay caused by held / lis procedure?

2023-05-25 Thread Benoit Panizzon
Hi Sergey

> 3.1.1 WireLess
> 
> How do you want to route such call types without a postal code?

We only offer Fixed Landline Services. No mobile. So this is not the
issue. We know the 'installation' location of every fixed line.

Of course, if a customer takes his phone somewhere else, this is his
responsability. A location could also be labeled 'nomadic' to indicate
that it is uncertain.

I am in contact with the team @ Swisscom which runs the LIS server. I
guess I will be able to clarify many of those questions with them.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: lost module: best practice handling delay caused by held / lis procedure?

2023-05-23 Thread Benoit Panizzon
Hi Sergey

Swisscom is operating all the emergency call infrastructure in
Switzerland.

Most documentation is public:

https://www.swisscom.ch/en/business/enterprise/offer/alarming-solutions-ealarm-emergency/sos-database.html?campID=SC_emergencylocalization

Referring to this document:

https://documents.swisscom.com/product/filestore/lib/851d8bf5-d686-4a41-9907-a99caf4a5e6e/ng112_referencetestcases_switzerland_en.pdf

Swisscom is operating the ECSP consisting of LIS server, where we as
TSP (VSP) push the location information (postal address) for en
emergency call and the LIS Proxy, where the PSAP de references the URL.

So, when processing an emergency call on kamailio, I have somehow to
get the location information to the LIS server.

Kamailio offers a service to our customers, for this it does not need to
know the postal address of the caller. But it holds a reference to the
calling customer (also used for billing and all sort of stuff). Let's
call it the Customer ID.

So a registered customer is calling 112.

What Kamailio does:

* Authenticate INVITE (getting customer ID linked to authentication
  username)
* Pull more information from the customer profile like barred numbers
  sets, and a location ID (now using the zip code but about to extend
  this for better accuracy and handling some exceptions like
  large industry complexes that have an own fire brigade).
* Perform Lookup in local Database (could also be a textdb): Emergency
  Number 112 + postal code. Result: Destination PSAP Phone number!

So at this point we are fine, we know how to route that call to the
appropriate closest PSAP. But with NG112 we have to set a Geolocation
header to indicate the exact postal address and building ID (EGID) to
the PSAP.

Legacy Mode: PSAP looks up the address of the calling phone number in
the 'emergency' directory service, also operated by Swisscom. But this
has to be actively updated via a cumbersome API by all telephone
operators and I guess this does not work at all with some operators. So
pushing the location with the call is for sure the right way to go.

So my intention was:

modparam("http_client", "httpcon", 
"heldsrv=>http://localheld.example.com/api/held";);

$var(id) = "$var(customerID)";
$var(res) = lost_held_query("heldsrv", "$var(id)" , "$var(pidf)", "$var(url)", 
"$var(err)");

if ($var(res) == 200) {
 append_hf("Geolocation: $var(url)\r\n");
} else {
 xlog("L_ERROR", "HELD locationRequest for $var(customerID) failed with 
status: $var(res)\n");
}

On that local held server, the postal address linked to the CustomerID
in question could be looked up and pushed to the Swisscom LIS Server
which then returns the URL which the local held server is passing back
to me as the reply to the lost_held_query.

Am I doing this in an overcomplicated way?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: lost module: best practice handling delay caused by held / lis procedure?

2023-05-23 Thread Benoit Panizzon
Hi Sergey

Thank you for your reply.

>  if(is_method("REGISTER")) {
>sl_send_reply("100", "Checking your credentials");
>  } else {
>sl_send_reply("100", "Attempting to connect your call");
>  }

I left auto_inv_100 to 1 but I am now experimenting with calling
t_reply before doing the held lookup and that looks promising at the
moment.

> According to RFC5985 (https://www.rfc-editor.org/rfc/rfc5985.html) HELD
> request can contain "responseTime" attribute with values "emergencyRouting"
> and "emergencyDispatch".
> With high probability, your LIS server will get the first HELD request with
> "responseTime=emergencyRouting".
> That means do not require high accuracy of user location. In my opinion,
> you send the location of the last base station where the
> user registered last time.
> This a fast response.
> 
> And when the call is delivered to PSAP, your LIS server will receive a
> second HELD request with "responseTime=emergencyDispatch".
> On the second request, you need to return the real mobile user location.
> But at this time the call is answered and the location may be evaluated for
> several seconds.

We operate fixed line, no mobile service. So we know the exact location
(postal address + building identifier (EGID)) at the time of the call.

It's also not about routing. Calls to the nearest PSAP are
source-routed. So if a customer dials 112 we translate this to the
nearest PSAP operating emergency service 112.

I'm just anticipating what could go wrong or cause delays in the
chain to find out the best way to react to such issues.

Kamailio => HTTP => HELD-Server(inhouse) => HTTP => LIS-Server

PS: What I could not find in the Swiss NG112 documentation: If
transmitting the location to the LIS server fails. Is the Geolocation
header just ommited? Or is there a way to tell the PSAP there was a
failure transmitting the location to the LIS Server?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] lost module: best practice handling delay caused by held / lis procedure?

2023-05-23 Thread Benoit Panizzon
Hi gang

In 2024, Switzerland will start using NG112 (NG911) procedures to
transmit the caller location via Geolocation URL via LIS Server to a
PSAP.

So time to start testing this on my devel plattform. Kamailio ships
with the lost module which looks promising.

In short, the Procedure is as follows:

Customer calls emergency number.

Kamailio performs a http request to our inhouse HELD server with the
identification of the calling customer.

HELD server looks up the location of the caller and pushes a HELD XML
object to the Swiss LIS Server, which then is queried by the emergency
PSAP receiving the call. LIS server return and URL.

HELD server returns the URL to Kamailio.

Kamailio adds Geolocation Header with that URL and relays the call.

This takes some time and as the call is not yet being relayed while
waiting for the held request to complete, there is no 100 trying being
sent and the emergency call is bound to time out.

So, shall I call t_reply("100","Performing HELD lkup") before
calling the lost module? Or is there a better way?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] MySQL duplicate entry error on location after 5.5 => 5.6 upgrade

2023-05-22 Thread Benoit Panizzon
Hi list

Since updating 5.5 to 5.6 i often see this message in the logs:

ERROR: db_mysql [km_dbase.c:122]: db_mysql_submit_query(): driver error on 
query: Duplicate entry 'uloc-645ca178-f29e-1' for key 'location.ruid_idx' (1062)
ERROR:  [db_query.c:244]: db_do_insert_cmd(): error while submitting query
ERROR: usrloc [ucontact.c:687]: db_insert_ucontact(): inserting contact in db 
failed ** (uloc-645ca178-f29e-1)
ERROR: usrloc [urecord.c:420]: wb_timer(): inserting contact into database 
failed (aor: ***)

usrloc is dmq synced between two nodes. Were there some changes which
could have caused this issue?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Upgrade to 5.6.4 => [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer

2023-05-08 Thread Benoit Panizzon
Hi Daniel

> But I wanted to check if you started with --atexit=no cli param, because
> your error messages seemed linked to start up time.

Yes, --atexit=no parameter is set in the systemd file. Shall I try
without?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Upgrade to 5.6.4 => [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer

2023-05-08 Thread Benoit Panizzon
Hi Дилян

> in case Kamailio is linked with OpenSSL 3.0 it will fail.  Linking with 
> Openssl 1.1.1 works.

Version: 5.6.4+ubuntu22.04
Architecture: amd64
Maintainer: Kamailio Admin Group 
Installed-Size: 1072
Depends: kamailio (= 5.6.4+ubuntu22.04), libc6 (>= 2.34), libcurl4 (>= 7.16.2), 
libssl3 (>= 3.0.0~~alpha1)

# ldd /usr/lib/x86_64-linux-gnu/kamailio/modules/tls.so
linux-vdso.so.1 (0x7ffdf0517000)
libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x7fbc5f86f000)
libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 
(0x7fbc5f42c000)

So am I guessing right, that the Ubuntu Jammy package from kamailio.org
is linked against OpenSSL 3.0.0 causing those crashes?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: send reply from branch route?

2023-05-04 Thread Benoit Panizzon
Hi Alex

Thank you for your input. Determining if the call is for a locally
registered user seems pretty easy.

Now the next challenge...

There might be multiple registered contacts for an AOR using multiple
protocols and residing on different registrars.

I was considering using dispatcher mode 12 (parallel branching) towards
the registrars and just send a call to both our registrars node.

But what happens, if there is only one contact registered, obviously on
one registrar? The call sent to the 'wrong' registrar would get a reply
like 408 not registered and possibly trigger the failure route to
voicemail, while the other registrar is routing the call to the CPE?

Is there a solution for this scenario, or do I have to get rid of
having two registrars for redundancy and HA reasons and would better do
with only one node?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: send reply from branch route?

2023-05-04 Thread Benoit Panizzon
Hi Yuriy

> You don't need to do so in branch route. You can do this within
> request_route.

Bug accessing:

> > $var(socket) = $(ulc(aor=>socket)[$T_branch_idx]);

Is only possible in the branch route as I need that index, right?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] send reply from branch route?

2023-05-04 Thread Benoit Panizzon
Hello

Is there a possibility to send a reply from within a branch route?

Experimental case (yes, I know it's a non working set-up, but I just
wonder if that would be possible).

Two registrar nodes, location information shared between the two.

CPE registers via TLS, therefore the existing connection shall be used
towards the CPE and that only exists on one of the registrars.

So in the Branch Route I would like to do something like:

$var(socket) = $(ulc(aor=>socket)[$T_branch_idx]);

if ($var(socket) == 0) {
send_reply("503","no local socket");
}

This would cause the core routing instance to select the next registrar
from the dispatcher list which hopefully holds the active socket.

But none of the 'send_reply' variants seem to be allowed within a
branch route.

Or is there a better solution?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] rtpengine module: sdp offer in message reply, ip protocol version not passed to rtpengine?

2023-05-02 Thread Benoit Panizzon
Hi Team

I think, I might have found something that was overseen in the
rtpengine module.

A (ipv6) <=> rtpengine <=> B (ipv4)

Invite+SDP from B to A

It looks like this works as expected. A SDP c= line is created
containing an ipv6 address.

Invite, no SDP from A to B
Reply with SDP offer from B to A

The information about A being reachable via ipv6 and therefore an ipv6
c= line being required, could be taken from the via header of the reply.
But am I right to fear, that the rtpengine module does not do this at
the moment?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Sensible values for pike mudule?

2023-04-27 Thread Benoit Panizzon
Hi

Before I go too deep into try and error, I guess others have been there
too.

What are sensible value you use for the pike module to detect /
mitigate abusive behavior, especially dictionary attacks?

Are there better solutions that the pike module?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: TOPOS module: Topology hiding only for a specific host

2023-04-06 Thread Benoit Panizzon
Hi Stefan

> I would like to do topos on the SIP-Proxy direction PSTN but only for 
> specific hosts.

I ran in a quite similar issue with topos which made it unsuitable for
my needs.

Same situation:

CPE <=> Kamailio Registrar (TM Module) <=> Kamailio Routing Core
(Dialogue aware) <=> IC

I would like to hide topo towards the CPE, so they don't have to deal
with route-sets etc. (found some CPE which are and don't correctly set
route header)

But I need the routes towards the kamailio core.

When topos is used, topology is being hidded on both legs, towards CPE
and towards Core. This causes issues with Hairpin Calls (CPE to CPE)
via Core, as the Record-Route contains the registrar twice and topos
removing all Route header containing it's local IP.

If I try to drop topos on calls with destination core, topology hiding
is completely dropped from the transaction.

So any hints on how to do topology hiding on one leg only (towards one
ip only) is highly appreciated.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to require session timer and set a max session timer value?

2023-03-23 Thread Benoit Panizzon
Hi All

I would like to avoid having run away calls as good as possible.

For this, I would like to require timers and set the maximum expires
timer to say 1800

I had a look at the sst module, but I see no way to require timers or
to set a max timers value.

Do my intentions make sense? How did others accomplish this task?

Thanks for any hints!

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Sync NONCE between registrars?

2023-03-16 Thread Benoit Panizzon
Hi

We have two registrars.

Today I observed a CPE doing this:

CPE REGISTER (no auth) => Registrar 1 => 407 Challenge NONCE A

CPE REGISTER (auth to NONCE A => Registrar 2 => 407 Challenge NONCE B

CPE REGISTER (auth to NONCE B => Registrar 1 => 407 Challenge NONCE A

and so on.

Time on both registrars is in sync (I tought NONCE was based on time)

Is there a way to sync the NONCE so that both would accept
authentication based on the same NONCE?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: json RPC syntax

2023-03-14 Thread Benoit Panizzon
Hi Volker

An Example by which I query a profile counter:

 curl -X POST http://VoiceSwitch:8080/RPC -H 'Content-Type: application/json' 
-d '{"jsonrpc": "2.0", "method": "dlg.profile_get_size", "params" : 
["channels-inuse", "Customer-"], "id": 1}'

I think, with jsonrpc 2.0 you could pass an array of named parameters,
but I also struggled with that, just passing an array of parameters in
the right order did it for me.

Perl Snippel I just had at hand while elaborating how to use the
output and using the JSON::RPC2::Client and LWP::UserAgent modules.

my $ua = LWP::UserAgent->new();
my $h = HTTP::Headers->new(
Content_Type=> 'application/json'
);
my $client = JSON::RPC2::Client->new();

[...]

$method = "ul.dump";
@params = ();

($json_request, $call) = $client->call($method, @params);

$req =  HTTP::Request->new('POST', $reguri . $kamapi, $h, $json_request);
$res = $ua->request($req);

print "=== KAM RPC: $method ===\n";

#print $res->decoded_content;
print "\n";

my $ul = decode_json($res->decoded_content);

#print Dumper($ul);

#print Dumper($ul->{'result'}->{'Domains'}[0]->{'Domain'});

my @aors = @{$ul->{'result'}->{'Domains'}[0]->{'Domain'}->{'AoRs'}};

foreach my $aor (@aors) {
print " AOR [$aor->{'Info'}->{'AoR'}] =\n";
my @contacts = @{$aor->{'Info'}->{'Contacts'}};
foreach my $contact (@contacts) {
print "\t == contact ==\n";
print "\tAddress:\t$contact->{'Contact'}->{'Address'}\n";
print "\tExpires:\t$contact->{'Contact'}->{'Expires'}\n";
print "\tUser Agent:\t$contact->{'Contact'}->{'User-Agent'}\n";
}
}


Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] RFC specifying use of transport= attribute in Contact and RURI (Re: Re: New 'reverse' transaction not using correct transport protocol)

2023-03-09 Thread Benoit Panizzon
Hi Daniel, Alex and all

I'm having an argument with the Vendor of our SBC towards IC carriers.

According to $vendor tech, if the SIP Message was received via UDP, the
transport= attribute of the Contact Header has no meaning and therefore
the RURI of a following transaction (like BYE) will not contain a
transport attribute as the reply is sent via UDP.

This of course breaks communication CPE behind a kamailio proxy which
are connected via TCP or TLS.

I've been looking through RFC3261 and I find various examples how the
transport attribute can be used.

But I fail to find, that a transport received in the Contact header
MUST be re-used in the RURI of subsequent transactions within one
dialogue.

From my point of view, this is logical and this is how various devices
I have tested operate. But with a commercial vendor, if it's not in the
RFC it's no Bug and won't be fixed... Does anyone know in which section
(or maybe other RFC) this is covered?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Location / Registrar, TCP: Use existing TCP connection

2023-03-08 Thread Benoit Panizzon
Hi James

> It should automatically re-use an existing TCP connection.
> Can you give an example?

After digging more in this issue, it looks like I found the solution:

Upon successful REGISTER authentication I do:

if ($proto != 'udp') {
tcp_keepalive_enable("60", "5", "5");   # TCP KA once 
per minute
tcp_set_connection_lifetime("3605");# Live for one 
hour
force_tcp_alias();  # Force traffic 
back on existing session
if ($avp(debug) > 0) {
xlog("L_INFO", "$cfg(route): KEEP ALIVE engaged 
on $proto => ConID: $conid\n");
}
}

Especially force_tcp_alias() seems to make sure, communication TO the
CPE takes the existing TCP or TLS session towards the CPE and does not
create a new session.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: New 'reverse' transaction not using correct transport protocol

2023-03-06 Thread Benoit Panizzon
Hi Alex and Daniel

Thank you for the quick reply.

I have now also set double_rr = 2 but still no joy, same two RR header
are added as before.

modparam("rr", "enable_full_lr", 0)
modparam("rr", "append_fromtag", 1)
modparam("rr", "enable_double_rr", 2)

Situation, IP's and Usernames a bit mangled

CPE  Kamailio Reg  Kamailio Core  IC

CPE => Reg

INVITE sip:1...@dev-reg.example.com SIP/2.0
Via:  SIP/2.0/TCP [CPEIP]:5060;branch=z9hG4bK9b3c29e0dad0e5b9
Route:  
From:  "John Doe" ;tag=295116bd1a873e35
To:  
Contact:  

Reg => Core

INVITE sip:1...@dev-reg.example.com SIP/2.0
Record-Route:  
Record-Route:  
Via:  SIP/2.0/UDP 
[REGIP];branch=z9hG4bKff2c.bdf51fa760a7fbf45d63cf2dc6149cd5.0;i=3
Via:  SIP/2.0/TCP [CPEIP]:5060;branch=z9hG4bK9b3c29e0dad0e5b9
From:  "John Doe" ;tag=295116bd1a873e35
To:  
Contact:  

Core => IC

INVITE sip:+41NPRN@[ICIP]:5060 SIP/2.0
Record-Route:  
Record-Route:  
Record-Route:  
Via:  SIP/2.0/UDP [COREIP];branch=z9hG4bKff2c.cd37a51708f805c3a86ad51b01b2ad43.0
Via:  SIP/2.0/UDP 
[REGIP];branch=z9hG4bKff2c.bdf51fa760a7fbf45d63cf2dc6149cd5.0;i=3
Via:  SIP/2.0/TCP [CPEIP]:5060;branch=z9hG4bK9b3c29e0dad0e5b9
From:  "John Doe" ;tag=295116bd1a873e35
To:  
Contact:  

So what I understands, the last entry in the route set and the Contact
header state the last transport is TCP.

Omitting 180, prack, ack etc, as the don't cause a Problem. so right to BYE:

IC => CORE

BYE sip:@[CPEIP]:5060 SIP/2.0
Max-Forwards:  61
Route:  
Route:  
Route:  
To:  "John Doe" ;tag=295116bd1a873e35
From:  ;tag=3887096572-1655837278
CSeq:  2 BYE
Via:  SIP/2.0/UDP [ICIP]:5060;branch=z9hG4bKbf46cc2d5bdbf33cdb99543b438afb16

Indeed, the BYE does not specify transport=tcp, but the last entry in
the route does, so shouldn't that be used?

Core => Reg

BYE sip:@[CPEIP]:5060 SIP/2.0
Max-Forwards:  60
Route:  
Route:  
To:  "John Doe" ;tag=295116bd1a873e35
From:  ;tag=3887096572-1655837278
CSeq:  2 BYE
Allow:  
PUBLISH,MESSAGE,SUBSCRIBE,REFER,INFO,NOTIFY,REGISTER,OPTIONS,BYE,INVITE,ACK,CANCEL
Via:  SIP/2.0/UDP [COREIP];branch=z9hG4bKd2cd.cc6c4cfb9e956d20b30c2c8dc4fb653d.0
Via:  SIP/2.0/UDP [ICIP]:5060;branch=z9hG4bKbf46cc2d5bdbf33cdb99543b438afb16

Reg => CPE (transmitted via UDP!)

BYE sip:@[CPEIP]:5060 SIP/2.0
Max-Forwards:  59
To:  "John Doe" ;tag=295116bd1a873e35
From:  ;tag=3887096572-1655837278
CSeq:  2 BYE
Allow:  
PUBLISH,MESSAGE,SUBSCRIBE,REFER,INFO,NOTIFY,REGISTER,OPTIONS,BYE,INVITE,ACK,CANCEL
Via:  SIP/2.0/UDP [REGIP];branch=z9hG4bKd2cd.6a5e43e7f40c13088f744a6e8265f618.0
Via:  SIP/2.0/UDP [COREIP];branch=z9hG4bKd2cd.cc6c4cfb9e956d20b30c2c8dc4fb653d.0
Via:  SIP/2.0/UDP [ICIP]:5060;branch=z9hG4bKbf46cc2d5bdbf33cdb99543b438afb16

So indeed, the remote party in our IC does not specify transport=tcp in
the RURI. Does it have to do so?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] tcp_set_connection_lifetime => in respect to 'idle' connection?

2023-03-06 Thread Benoit Panizzon
Hi List

Digging further into my tcp/tls issues...

Upon successful authentication I call:

tcp_keepalive_enable("60", "5", "5");
tcp_set_connection_lifetime("120");

I tought, this would do to keep the connection alive.

I noticed, despite keepalive packets being exchanged, kamailio is
closing the connection after a bit more than 2 minutes.

I am right at assuming, that tcp_set_connection_lifetime is not related
to how long the connection is idle, but is counted from the SYN, no
matter if keepalives were successfully exchanged?

Does calling tcp_set_connection_lifetime() again restart the lifetime
like for 2 more minutes like in this example? Or would I have to keep
increase the value of the lifetime on each successful re-register to
keep it open?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] New 'reverse' transaction not using correct transport protocol

2023-03-06 Thread Benoit Panizzon
Hi

CPE registering with TCP (or TLS).
2nd leg is UDP.

Within one transaction (INVITE to OK including all ACK and PRACK)
transport is kept as desired for both legs.

But when the B side disconnects (sending BYE, new reverse transaction),
this is sent via UDP to the A CPE which initially talked TCP and thus
ignored.

record_route() is called on each leg.

What could I be missing?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Location / Registrar, TCP: Use existing TCP connection

2023-03-06 Thread Benoit Panizzon
Hi List

CPE behind Firewall, registering to Kamailio via TCP (or TLS).

When a call is sent to the CPE, kamailio attemts to open a new TCP
connection and is blocked by Firewall.

Is there an option to tell kamailio to use the existing registered TCP
connection?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to access rtpengine rtcp-metrics?

2023-03-02 Thread Benoit Panizzon
Hi all

I'm trying to incorporate rtcp data from rtpengine into our CDRS. So
trying with the first interesting value, the average mos.

modparam("rtpengine", "mos_average_pv", "$avp(mos_average)")

If I understood right, to get this variable set, I need to call
rtpengine_manage() on the message that terminates the call.


So on an established call, that is either BYE or the 200 OK to the BYE.
Right?

if ($rm == "BYE") {
 rtpengine_manage();
 xlog("L_INFO", "$cfg(route): $rm: MOSS: $avp(mos_average)\n");
}

onreply_route[MANAGE_REPLY]
{
[...]
rtpengine_manage();
xlog("L_INFO", "$cfg(route): $rm reply MOS: 
$avp(mos_average)\n");
}

Messages pass those blocks, $avp(mos_average) is 'null' no mater what.

What am I missing?

In the syslog output of rtpengine I see there is rtcp data.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Bug handling replies from multiple contacts of one AOR? (topos breaking route set on hairpin calls?)

2023-02-20 Thread Benoit Panizzon
Some update after more testing...

not droping topos to the core and setting

modparam("topos", "rr_update", 1)

solves some situations but has caused at least a new one.

Situation:

Two CPE on same Registrar.

A CPE => +
 + REGISTRAR <=> CORE
B CPE <= +

A is calling B. 

Call route: A CPE => Registrar => Core => Registrar => B CPE

In this example, there are four contacts registered B CPE. Each replies
with 180 ringing and requiring 100rel.

I see, topos is enumerating the 180 ringing contact user with

atpsh-someid-1
atpsh-someid-2
atpsh-someid-3
atpsh-someid-4

But on the second leg, towards A CPE, all 180 ringing have the SAME
contact username:

atpsh-63f39a4f-c0aa8-2

The CPE A replies PRACK to the first one and that PRACK is correctly
routed to CPE B

PRACK sip:atpsh-63f39a4f-c0aa8-2@IP SIP/2.0

That username is being translated to that first one from the first leg.

But with that PRACK routed and username translated AND the other side
acknowleding that PRACK with 200 OK. I fear topos discards all
information regarding that mapping as it considers the PRACK
transaction has ended.

The subsequent 180 RINGING which the CPE confirms with PRACK containing
the same contact userid again, is being rejectec with 404 and the whole
call is ending here with tangling ringing endpoints.

If I manage to pick up the call real quickly on the first CPE that
rings and the 200 OK to the INVITE is getting to the origin before the
404 occurs, the call is established.

So I fear, there is an issue with topos handling replies from various
contacts of the same AOR.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: topos breaking route set on hairpin calls?

2023-02-20 Thread Benoit Panizzon
Hi Henning

> you've seems to have already found a workaround, as posted later.
> 
> Generally, topos should work for PRACK, there were several enhancements/fixes 
> committed in the last year.

Unfortunately, I didn't get it working as I anticipated.

CPE - REGISTRAR - CORE

I would like to hide topology towards the CPE so it does not have to
deal with recorded routes or via headers and also to hide those ip
addresses from the customer.

But I need those header between REGISTRAR and CORE kamailio instances.

For call from registrar to core I use a branch route trigger.

Within that trigger I do:

branch_route[BR_TO_CORE]
{
if ($avp(debug) > 0) {
xlog("L_INFO", "$cfg(route): Branching to Core\n");
}
$avp(droptopos) = 1;
}

event_route[topos:msg-outgoing] {
# Drop topology hiding towards core. We need those route header!
if ($avp(droptopos) == 1) {
xlog("L_INFO", "$cfg(route):  DROP TOPOS\n");
drop;
}
$avp(droptopos) = 0;
}

Unfortunately this does not only affect the INVITE to the core, but
also drops topos on the other leg (replies like ringing and 200 OK from
core via registrar to customer) which then disclose all via information.

Is there a way to drop topos selectively only in one direction?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: topos vs topoh, any reason for putting a private IP in the Contact header?

2023-01-26 Thread Benoit Panizzon
Hi Patrick

Agreed, this could become an issue when we do dual stack ipv4 and ipv6
unless we use a hostname which will probably cause other issues.

> But overall sip compliant component must Always follow Route ip before 
> contact IP.

I will test how the know buggy client behaves.

While testing with topos I came across another issue.

Then I have topos enabled on a REG instance, I see this PRACK
handling:

CPE <=> KAM Reg <=> KAM Core <=> IC

CPE => Invite, supported: 100rel
CPE <= 180 RINGING, required: 100rel

CPE => PRACK => KAM Reg => PRACK to itself looping MANY times adding a
VIA Header on each loop.

I don't understand, why in this situation, the REG is sending PRACK
to itself.

As soon as I comment out topos PRACK is sent correctly to the party
reqesting 100rel.

Any hint where to look?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] topos vs topoh, any reason for putting a private IP in the Contact header?

2023-01-26 Thread Benoit Panizzon
Hi

I'm trying to work around Route-Header and Via Issues with the two
topology hiding modules topoh and topos and trying to figure out, which
one works better for our environment.

My conclusion so far:

topos creates very clean header, but needs a database or redis. I'm
always reluctant in adding more components which could fail or cause
load.

topoh also works, but it worries me a bit that according to the manual:
https://www.kamailio.org/docs/modules/devel/modules/topoh.html#topoh.p.mask_ip
a private IP is used to mask the contact header.

I have come across a CPE which, as far as I see, is misbehaving by
ALWAYS sending a PRACK to the Hostname or IP found in the Contact
header, and ignoring Route and Via Header.

So why using a private IP as 'mask' and not the IP or Hostname of the
actual kamailio instance?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] dialog: db_mode => 1, enable_dmq => 1 but entries not replicated to 2nd node DB

2023-01-24 Thread Benoit Panizzon
Hi

I am struggling with DMQ and dialog DB storage leading to orphan or
duplicate entries in database and not loading all dialog information
upon restart.

usrloc on the other side, also using local db storage and dmq, works
flawlessly even when restarting one node. All location information is
replicated between the databases via DMQ.

So trying to find what is different.

usrloc module:

modparam("usrloc", "db_url", DBLOCAL)
modparam("usrloc", "db_mode", 2)
modparam("dmq_usrloc", "enable", 1)
modparam("dmq_usrloc", "sync", 1)

dialog module:

modparam("dialog", "db_url", DBLOCAL )
modparam("dialog", "db_mode", 1 )
modparam("dialog", "db_skip_load", 0)
modparam("dialog", "enable_dmq", 1)

via kamcmd dlg.list I see that dialog information is being replicated
between the two nodes. But I can only find the dialog in the local
database of the node which is handling the call.

Is this the expected behavior?

I also just found how to create duplicate entries in the database...

* Run a call on Node A, verify the dialog information is store in the
  local database and replicated to node B via DMQ.

* Restart Kamailio on Node A.

There I suspect, node A is restoring Dialog Information via DMQ from
Node B and loading the same information from database, leaving
duplicates in dialog_vars.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Authenticated ACK: $au not set?

2023-01-16 Thread Benoit Panizzon
Hi Gang

I have this code snipplet:

if (has_credentials("$fd")) {
xlog("L_INFO", "$cfg(route): got $rm with credentials. Validate 
them!\n");
if ($aU == $null) {
xlog("L_INFO", "$cfg(route): no auth user, send 
challenge\n");
}
auth_challenge("$fd", "0");
exit;
}
}

Please don't ask if this makes sense, it's a constructed snipplet to show the 
situation.

If $rm is INVITE, this works fine, no challenge is being sent, $au is populated.
If $rm is ACK (some CPE seem to send the Credentials with each message) then 
$au is $null,
auth_challenge is called and fails.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Remove all Via Header or create custome Via Header

2022-12-22 Thread Benoit Panizzon
Hi out there!

While experimenting with the listen and adverize 'hostname' option I
came across a voice switch, which I suppose fails if the Via header is
not an IPv4 address.

There is a record_route_advertised_address(address) in the RR module,
to set a customer Record-Route Header.

Is there something similar for the Via header so I could try if having
an IP address instead of a hostname in the top-most Via would solve the
issue?

Or is there a way to remove all via header? Remove_hf("Via") in the
branch route trigger garbles the From: HF.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] How to unset_dlg_profile in request_route or react more quickly to CANCEL?

2022-12-19 Thread Benoit Panizzon
Hi List

Testing failure situations, I discovered unset_dlg_profile can
not be used in request_route:

I count the channels per customer in a dlg_profile to know when they
are busy. Residential POTS customer have 1 channel.

Now this situation (Trying to mimik POTS behavior)

Kamailio <=> CPE of 'John-Doe'

=> INVITE
set_dlg_profile of John-Doe is 0: Not busy
set_dlg_profile of John-Doe +1
<= 100 trying
<= 180 ringing

== LINK to CPE DISRUPTED ==

X<= 200 OK (not reaching kamailio)
CPE is sending 200 a couple of times and fails.
Caller is still hearing ringing tone as it never got 200 OK.

The caller does not want to wait longer and hangs up
=>X CANCEL (NOT reaching CPE)

This is the moment, on which I would like to unset_dlg_profile of
John-Doe to mark his channel available again.

But the CPE is never going to acknowledge this CANCEL with 487.

Unfortunately: unset_dlg_profile(): dialog delete profile cannot be used in 
request route

Only when kamailio has sent CANCEL a couple of times and the
failure_route for this CANCEL is triggered, I can remove the call
from the dlg_profile of that customer within failure_route.

If I am unlucky, in the meantime other calls get 'busy' instead of
being re-routed to the configured backup number of that customer.

Agreed, after a couple of seconds, the call goes to the failure
route and the dialogue is ending thus calls work as expected.
But wouldn't it be nice to be able to unset the
dlg_profile upon receiving the CANCEL instead on when the CANCEL
transaction is successful?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: DNS Host-Names in Via and Record-Route for more redundancy?

2022-12-19 Thread Benoit Panizzon
Hello World and Rick

> A quick update. Now it works. I guess the newly added DNS hostname was
> not yet fully propagated to all DNS caches.

I start doubting, this was a clever idea...

I wonder what solutions other have come up to.

After some testing I noticed: SIP ALG on NAT devices do work by IP, not
by hostname. So getting traffic from the kamailio instance they were not
talking too before (or did not register to) breaks on NAT situations.

Also SBC do not seem to respect the Via header and always sending
traffic back to the IP it received traffic from.

How do other build redundant, high available platforms with kamailio
avoiding those pitfalls?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


  1   2   >