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

2023-10-20 Thread Benoît Panizzon via sr-users
Hi Gang

I just updated our dev plattform from 5.6 to 5.7

5.5 was working fine with TLS under Ubuntu Focal.
5.6 under Jammy started to dump cores.
5.7 still shows the same behaviour, usually shortly after a restart.

Oct 20 09:45:01 dev-cpereg01 kamailio[11925]: CRITICAL:  
[core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer 
(0x7f1bb0dd4bd8), called from tls: tls_init.c: ser_free(405), first free tls: 
tls_init.c: ser_free(405) - ignoring
Oct 20 09:45:11 dev-cpereg01 kamailio[11905]: ALERT:  [main.c:776]: 
handle_sigs(): child process 11924 exited by a signal 11
Oct 20 09:45:11 dev-cpereg01 kamailio[11905]: ALERT:  [main.c:779]: 
handle_sigs(): core was generated

Could anyone point me the correct direction on how to fix this issue?

Am I the only one seeing this issue?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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-20 Thread Benoît Panizzon via sr-users
Hi Antony

> Are you connecting to mysql?
> 
> We had similar sounding issues and adding this to kamailio.cfg made a
> difference
> modparam( "db_mysql", "opt_ssl_mode", 1 )

I am using MySQL, but I didn't deliberately configure it to use SSL.

I'm using TLS for SIP client registration on port 5061. So I was
hunting the issue down that rabbit hole.

https://www.kamailio.org/docs/modules/devel/modules/db_mysql.html#db_mysql.p.opt_ssl_mode

I try to force disable SSL for mysql off by setting this to 1.

Restarted, let's observe for a hour or so. Usually the crashes occur
after restarting. At the moment all 4 dev registrars have restarted
without crashing in the first 2 or so minute. So this somehow looks
promising!

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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-24 Thread Benoît Panizzon via sr-users
Hi James

> I used to have this problem, but I don't have it right now. I've never
> fixed the problem, but I'm on 5.6.1 now and it doesn't happen.
> What version have you got?

5.5 on production and 5.6 / 5.7 on development platform

Thank you for that hint. Checking if that also occurs on 5.6

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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] Dispatcher list reloading itself from file?!?

2023-11-10 Thread Benoît Panizzon via sr-users
Hi List

I wanted to take one of our cores down gracefully by not destroy
running dialogues to be able to implement a config change on Kamailio
5.5

For this I did:

kamctl dispatcher.remove ID SIP-URI, for every IC

This worked fine, Kamailio is instructed to reply 503 on out of
dialogue traffic from unknown endpoints causing the endpoints to
re-route traffic to the other core, eventually making it possible to
stop and restart Kamailio without harm.

dialog count was steadily decreasing, until after about 10 minutes
after removing the dispatcher URI's it started to increase again.

kamctl dispatcher.list shows me, all dispatcher URI I removed are back!

There is no ds_reload() being executed by calls.

In the module description, I find no hint, that the dispatcher config
is being reloaded from file in some interval or so.

What could be the cause of my removed dispatcher suddenly being back?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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 + DMQ: dlg_ontimeout() triggered on wrong node!

2023-11-20 Thread Benoît Panizzon via sr-users
Hello World!

Kamailio 5.5 in use.

I wonder, how I could prevent this issue.

modparam("dialog", "send_bye", 1)
modparam("dialog", "default_timeout", 21600)

in the corresponding route:
$dlg_ctx(timeout_route) = "DIALOG_TIMEOUT";
dlg_manage();

Dialog starts on Node01 and it's variables, status and timer are DMQ
synced to Node02

As both nodes have the same information, I guess both arm the timeout
trigger and sometimes the wrong node is more trigger friendly.

If dlg_ontimeout() is triggered on Node02 then:

* No Bye is send, as Node02 is not handling that Dialog.
* Dialog is removed from Memory on Node02 and state synced back to
  Node01
* Dialog is removed from Memory on Node01 too, but NOT from database [*1]
* Dialog CDR is never commited on Node01
* Call is never sent to timeout_route

And subsequent in dialog messages on Node01 result in:

dlg_onroute(): unable to find dialog

Did I misconfigure something?

Is there a way to make sure the timer is NOT triggered on the node not
handling the dialogue?

Shall I try by setting the default_timeout and then use a timeout_avp
to set that timeout slightly lower AFTER the dialog has started? Or
would this be synced to the other node too?

I found out, session timer changes are not synced after an initial timer
was synced, so you can not extend the session timer after setting a
initial timeout. So maybe this is also true for dialog timeout?

[*1] this also explains why upon restarting kamailio, the dialog
suddenly is back and after timing out again, a CDR is then written with
a way too long duration.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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-20 Thread Benoît Panizzon via sr-users
Hi

> Shall I try by setting the default_timeout and then use a timeout_avp
> to set that timeout slightly lower AFTER the dialog has started? Or
> would this be synced to the other node too?

No, this does not work. Tested on our dev platform (Kamailio 5.6) by
setting default_timeout to 5 seconds and trying to lower this value to
3 seconds during call to force the timeout being triggered on the node
which is handling the call.

modparam("dialog", "default_timeout", 5 )
modparam("dialog", "timeout_avp", "$avp(dlgtimeout)")

$avp(dlgtimeout) = 3;
dlg_manage();

=> Still timing out after 5 seconds, about half the attempts on wrong
node.

dlg_manage();
$avp(dlgtimeout) = 3;

=> Still timing out after 5 seconds, same issue.

$dlg_ctx(default_timeout) = 3 

=> Invalid!

event_route[dialog:start] 
{
$avp(dlgtimeout) = 3
}

=> Still timing out after 5 seconds, same issue.

Ping Olle and Alex. Any idea how to fix this issue?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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-21 Thread Benoît Panizzon via sr-users
Hi

Some more testing...

It looks like, in REPLY_ROUTE

if (is_known_dlg()) {
dlg_set_timeout("3");
xlog("L_INFO", "$cfg(route): DEBUG DLG Lifetime 
$dlg(lifetime)\n");
}

indeed does set the lifetime to 3 seconds.

Unfortunately this is replicated on the other DMQ node which then again has
a 50% chance of wrongfully triggering timeout after 3 seconds instead
of what the default is. So no luck in setting a generous default lifetime and 
then
shortening the lifetime on the node handling the case to make sure it is
the one triggering the timeout.

I had a quick glimpse into the source. As an n00b coder, I think I
understand that the dmq message is parsed and then timer inserted or
updated on all dmq nodes when a DQM dialog message is received. I fear,
this causes this behaviour of the timer expiring on the wrong node.

So is this a bug? Shall I report an issue on github?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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] is_method_f(): cannot parse cseq header in xhttp:request event route?

2023-12-12 Thread Benoît Panizzon via sr-users
Hi all

I use event_route[xhttp:request] on Kamailio 5.5

Every time a xhttp request is processed I get this log entry:

ERROR: textops [textops.c:3541]: is_method_f(): cannot parse cseq header

Almost identical config on Kamailio 5.6 does not show this error.

Is that something that got fixed in 5.6?

I see a change in the documentation, While 5.5 does not state $rm can
be accessed, 5.6 states $rm contains the HTTP method.

Or do I somehow leak the http request to somewhere I call is_method() on
it after terminating the event route?

How should the event_route[xhttp:request] properly be terminated?

With 'return' or with 'exit'?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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] xavp_params_explode broken comma in value?

2024-01-12 Thread Benoît Panizzon via sr-users
Hey!

I'm hunting down an issue with xavp_params_explode, maybe somebody has
already come adross it and could confirm it exists and maybe know a
solution?

xavp_params_explode("a=foo;c=hello,world;e=baar", "x");

$xavp(x=>a) is 'foo'

but x=>c and x=>e are null

Am I right to assume the issue being caused by the comma? Is there a
way to allow a comma?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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: xavp_params_explode broken comma in value?

2024-01-12 Thread Benoît Panizzon via sr-users
Hi Daniel
 
> comma is not allowed in an unquoted value for SIP parameters because
> it is separator for header bodies that are set on the same header
> name. Practically the comma is the end of parameters list.

Thank you for your confirmation I was on the right track.

> It should work with:
> 
> xavp_params_explode("a=foo;c=\"hello,world\";e=baar", "x");

Any recipe on how to solve if the value is the 'authentication'
password taken from the database? As far as I understood the SIP RFC a
comma is permitted in the SIP password itself, as it is never present
cleartext in a sip header.

Quick example of what I do when receiving a REGISTER with credentials to pull 
the password:

$var(query) = "select user,password,language from sometable where auth_user = 
'" + $var(auth_user) + "' limit 1";
$var(qresult) = sql_xquery("database", "$var(query)", "userdata");
xavp_params_implode("userdata","$var(xuserdata)");

$var(xuserdata) is "user=JohnDoe;password=secret,password;language=de_CH"

This is the stored in an $sht to be cached and available for a while and 
reducde SQL queries.

I guess there is no way to have sql_xquery automatically quote result fields 
that need quoting.

I could probably do select user,concat('"',password,'"'),language from 
sometable?

This could also be a potential issue with variable injections via SQL. Immagine 
some use sets a password ";var=value" this would lead to this var being 
overwritten I guess.

We are moving towards storing ha1 hashed passwords, so that would solve my 
issue I guess.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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 assign xavp array to htable?

2024-01-25 Thread Benoît Panizzon via sr-users
Hi Alex

> sql_xquery("db", "SELECT ...", "stuff");
> 
> $var(i) = 0;
> 
> while(defined $xavp(stuff[$var(i)])) {
> $sht(tbl=>$xavp(stuff[$var(i)]=>id)) =
> $xavp(stuff[$var(i)]=>otherval); $var(i) = $var(i) + 1;
> }
> 
> etc.

Thank you. So there is no 'direct' way I missed. Ok, I'll find a way
around ;-)

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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 database duplicate keys issue

2024-01-25 Thread Benoît Panizzon via sr-users
Hi

I have come across an issue with the usrloc database on kamailio 5.6 and 5.7

Jan 26 07:19:45 dev-cpereg01 kamailio[2708456]: ERROR:  [db_query.c:244]: 
db_do_insert_cmd(): error while submitting query
Jan 26 07:19:45 dev-cpereg01 kamailio[2708456]: ERROR: usrloc [ucontact.c:686]: 
db_insert_ucontact(): inserting contact in db failed somedudetp0216 
(uloc-65b237f8-28983d-1)
Jan 26 07:19:45 dev-cpereg01 kamailio[2708456]: ERROR: usrloc [urecord.c:419]: 
wb_timer(): inserting contact into database failed (aor: somedudetp0216)

settings:

# - usrloc params -
modparam("usrloc", "db_url", DBLOCAL)
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "use_domain", 0)

modparam("usrloc", "ka_mode", 0)
modparam("usrloc", "ka_filter", 1)
modparam("usrloc", "timer_procs", 1)
modparam("usrloc", "ka_from", "sip:p...@sip.imp.ch")
modparam("usrloc", "server_id_filter", 1)

# Use DMQ to sync userloc
loadmodule "dmq_usrloc.so"  # Replicate usrloc via dmq

# Enable userloc sync
modparam("dmq_usrloc", "enable", 1)

# Do a full sync on start
modparam("dmq_usrloc", "sync", 1)

I assume, when kamailio is being restartet there are some expired entries still 
present in the database which kamailio tries to insert on a new registration.
This leads to this duplicate key error.

Is there a way to tell kamailio to use 'replace into' instread of 'insert into'?

Solution for now, is to manually delete expired entries from the database.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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 correctly drop a branch?

2024-01-26 Thread Benoît Panizzon via sr-users
Hi

https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#branch_name_-_branch_attributes

"Assigning $null to uri attribute will drop the branch, for the rest of
attributes will just set the value to null."

Where do I need to assing $null to the brach URI to get it dropped? And
what happens to the index, is there a gap, or do the subsequent
branches get re-indexed so they don't match with the ulc indexes anymore?

Actual example, I have multiple contacts I would like to add to branches.

Two of the contacts are from the location database + an additional
contact.

# Basic Branch:
$ru = $(ulc(aor=>addr)[0]);
$du = $(ulc(aor=>received)[0]);
$fs = $(ulc(aor=>socket)[0]);

# Additional Branch:
append_branch($(ulc(aor=>addr)[1]));
$(branch(dst_uri)[-1]) = $(ulc(aor=>received)[1]);
$(branch(send_socket)[-1]) = $(ulc(aor=>socket)[1]);

and so on, actually a loop over all ulc contacts.

# Lasst Additional Branch, point to other registrar, not to a usrloc location.
append_branch($ru);
$(branch(dst_uri)[-1]) = "sip:other-registrar:5060;transport=udp";
$fsn = "LocalUDPv4";
$(branch(send_socket)[-1]) = $fs;

t_on_branch("BR_T");

branch_route[BR_T]
{
$var(socket) = $(ulc(aor=>socket)[$T_branch_idx]);
if ($var(socket) == 0) {
xlog("L_INFO", "$cfg(route): DROPPING BRANCH: $T_branch_idx No 
local socket on this registrar\n");
$(branch(uri)[$T_branch_idx]) = $null;
}
}

I don't get this right! Call is still sent to that contact.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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 correctly drop a branch?

2024-01-26 Thread Benoît Panizzon via sr-users
Ok I re-worked this.

I'm not adding branches I don't want anymore.

But I still need to access:

$(ulc(aor=>user_agent)[INDEX]) from within the branch route to tweak
some headers for specific user agents.

The ulc INDEX does not match the Branch INDEX.

How can I pass an information into a branch route which is specific to
a branch route like the user_agent associated with the registration to
which the call is sent?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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-26 Thread Benoît Panizzon via sr-users
Hi Henning

Missed the first line with the specific issue:

Jan 26 07:27:45 dev-cpereg01 kamailio[2708456]: ERROR: db_mysql 
[km_dbase.c:122]: db_mysql_submit_query(): driver error on query: Duplicate 
entry 'uloc-65b237f8-28983d-1' for key 'location.ruid_idx' (1062)
Jan 26 07:27:45 dev-cpereg01 kamailio[2708456]: ERROR:  [db_query.c:244]: 
db_do_insert_cmd(): error while submitting query
Jan 26 07:27:45 dev-cpereg01 kamailio[2708456]: ERROR: usrloc [ucontact.c:686]: 
db_insert_ucontact(): inserting contact in db failed somedudetp0216 
(uloc-65b237f8-28983d-1)
Jan 26 07:27:45 dev-cpereg01 kamailio[2708456]: ERROR: usrloc [urecord.c:419]: 
wb_timer(): inserting contact into database failed (aor: somedudetp0216)

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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] Passing variables to branches (Re: Re: How to correctly drop a branch?)

2024-01-26 Thread Benoît Panizzon via sr-users
I finally worked it out.

$var(c) = 0; Branch Count

looping through the ul:

append_branch($(ulc(aor=>addr)[$var(i)]));
$(branch(dst_uri)[-1]) = $(ulc(aor=>received)[$var(i)]);
$(branch(send_socket)[-1]) = $(ulc(aor=>socket)[$var(i)]);
$avp(ua) = $(ulc(aor=>user_agent)[$var(i)]);
$var(c) = $var(c) + 1;

branch_route[BR_T]
{
$var(uax) = $var(c) - $T_branch_idx - 1;
xlog("L_INFO", "$cfg(route): BR_idx: $T_branch_idx UAX: $var(uax) User 
Agent: $(avp(ua)[$var(uax)]) \n");
route(FILTER_USERAGENT); # Do user_agent specific stuff.
}

I hope append_branch works by adding at the end of the index and never 
inserting a branch in between.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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-26 Thread Benoît Panizzon via sr-users
Hi Fred

> Did you upgrade the database (assuming an upgrade from pre-5.6):
> 
> https://www.kamailio.org/wikidocs/install/upgrade/5.5.x-to-5.6.0/

Yes I did. I even remember reading this article.

That is the only change, right?

-- add index on connection_id for usrloc module location table
CREATE INDEX tcpcon_idx ON location (`connection_id`);

show create table location:


CREATE TABLE `location` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `ruid` varchar(64) NOT NULL DEFAULT '',
  `username` varchar(64) NOT NULL DEFAULT '',
  `domain` varchar(64) DEFAULT NULL,
  `contact` varchar(512) NOT NULL DEFAULT '',
  `received` varchar(128) DEFAULT NULL,
  `path` varchar(512) DEFAULT NULL,
  `expires` datetime NOT NULL DEFAULT '2030-05-28 21:32:15',
  `q` float(10,2) NOT NULL DEFAULT '1.00',
  `callid` varchar(255) NOT NULL DEFAULT 'Default-Call-ID',
  `cseq` int NOT NULL DEFAULT '1',
  `last_modified` datetime NOT NULL DEFAULT '2000-01-01 00:00:01',
  `flags` int NOT NULL DEFAULT '0',
  `cflags` int NOT NULL DEFAULT '0',
  `user_agent` varchar(255) NOT NULL DEFAULT '',
  `socket` varchar(64) DEFAULT NULL,
  `methods` int DEFAULT NULL,
  `instance` varchar(255) DEFAULT NULL,
  `reg_id` int NOT NULL DEFAULT '0',
  `server_id` int NOT NULL DEFAULT '0',
  `connection_id` int NOT NULL DEFAULT '0',
  `keepalive` int NOT NULL DEFAULT '0',
  `partition` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ruid_idx` (`ruid`),
  KEY `account_contact_idx` (`username`,`domain`,`contact`),
  KEY `expires_idx` (`expires`),
  KEY `connection_idx` (`server_id`,`connection_id`),
  KEY `tcpcon_idx` (`connection_id`)
) ENGINE=InnoDB

Yes, that key is present!

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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 Benoît Panizzon via sr-users
Hi Alex

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

Thank you, using the $nh variables within the branch route solved all
my issues with trying to determine where that branch is being sent to
to correct handle some special CPE cases and rtpengine.

Now for example I can correctly hint with IP protocol shall be used by
rtpengine depending if the CPE is using legacy v4 or modern v6 IP :-)

Still needs some testing to see what realy happens if the first branch
is using IPv4 (RTP with IPv4) and the next one is using IPv6 (RTP with
IPv6 for SAME callid) and then the first one picks up the call. Is
rtpengine stuck with IPv6 or will it listen to both protocols because
it processed two offer for the same callid?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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 query, if callid is handled by rtpengine module already?

2024-02-16 Thread Benoît Panizzon via sr-users
Hi

I have come across this challenge:

Initial invite (no to_tag) has is authenticated and has credentials. So
a lookup for the username is made to determine if the customer needs
backhauling, thus rtpengine needs to be engaged.

On a subsequent invite (re-invite to change codec or to refresh
session timer) there is a to_tag so it is being routed without sending
a challenge and has no auth username.

I don't use dialog on the registrar. This is another transaction. So I
don't know, if I need to engage rtpengine on that DSP or not.

What is the best way to find out, if rtpengine is already handling that
callid?

if(rtpengine_query_v("j", "$var(dummy)")) {
rtpengine_manage();
}

basically works, but generates a couple of ugly error messages in the
log as rtpengine_query_v does not find the call.

Is there a nicer way?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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 keep SIP messages small, possibly below fragmentation limit?

2024-02-23 Thread Benoît Panizzon via sr-users
Hi

In the process of getting rid of our commercial B2Bua SBC and handling
all clients directly via Kamailio...

We have come across some (unfortunately many we have in use) CPE which
have an issue with fragmented packets or which simply do not allocate
enough memory to parse or create messages of a certain size. Their SIP
stack just crashes with errors like 'message to large for send buffer'
and similar.

This affects messages with containing as little as 5 via
and 4 record-route header and a couple of codec in the SDP.

Is there a recipe for trying to keep packets as small as possible?

I would like to avoid using the topos module as I issues with this
module completely failing in certain situations.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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] dlg_vars of existing dialog not set after loose_route()

2024-04-05 Thread Benoît Panizzon via sr-users
Hi Gang

I have a strange issue after upgrading to 5.7

I use dlg_vars to keep some information until the end of the call to
write them in a CDR.

One of those variables records the timestamp of the first invite to
determine how long it took from the invite to the 'connection
established' if at all.

The CDR is written when the BYE is being processed by the dialog module.

Strangely, since updating to 5.7 (used to work with 5.5 and 5.6 I
think, but I could be mistaking as other changes were made to the
config) my dialog variables are null when BYE is being processed.

reading the docs, I learned that that dlg_var are only polulated after
loose_route() has been called.

So I added some logging statement to track if the BYE in question is
processed by loose_route().

Yes, it is, loose_route() returns success on the BYE in question. But
when I log the content of my dlg_var after loose_route() it is still
null.

Any idea what the cause could be?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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] Handling 422 Message (was: Re: dlg_vars of existing dialog not set after loose_route())

2024-04-05 Thread Benoît Panizzon via sr-users
Hi

After more intensive testing, I narrowed the issue down.

CPE A => Kamailio+dialog => CPE B

CPE A is sending an INVITE with a session timer too smal for CPE B.

CPE B replies with 422.

This causes the dialog module to trigger the 'call failed' event and
attempt to delete the dialog data.

CPA A does not consider the call failed. It repeats the INVITE with
CSEQ + 1 and with the session timer as desired by CPE B.

The call is then processed as if in dialog, but some, strangely not
all, dialog variables are lost.

I fear the repeated invite with identical callID and from_tag causes a
race condition in handling the dialog variables.

I see there are two attempts by the dialog module to write a CDR with
the same callID. After processing the 422 and when the call ends while
processing BYE.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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] Race condition in dialog on 422 reply deletes variables.

2024-04-06 Thread Benoît Panizzon via sr-users
Hi all

I fear I have found a race condition when a new dialog is
being created right after the old one with identical callid is
being deleted. I logged a dialog variable on each message and reply
and this is what I found:

=> INVITE
Initial dialog variable set.
<= 422 in 'failure route'
dialog variable still present
422 is being relayed
event_route[dialog:failed] triggered
dialog variable present
CDR written
=> ACK to 422
dialog variable present.
=> INVITE (same Callid/ftag/cseq++ session timer according 422)
Initial dialog variable set
<= 200 OK+SDP (manage_reply)
event_route[dialog:start] triggered
### dialog variable set during the INVITE is lost!
Probably all dialog variables set in the dialog unconfirmed stage are
lost at this point.

I fear, some mechanism that is still cleaning out the previous dialog
with the same callID is a bit over enthusiastic and also cleans out the
dialog variables set after the new invite for the same call.

I found a work-around by using AVP variables during the unconfirmed
stage and then use event_route[dialog:start] to set the desired dialog
variables from those AVP.

I also had a quick peek at the code. It looks like every reply
status >= 300 is considered a failure in unconfirmed dialog state. Not
sure if this is true for the 422 status, this does not terminate a call
but causes the caller to re-issue the invite.

=> More testing ongoing.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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: Access avp vars in a cancel? How to pass information from an INVITE to a CANCEL?

2024-05-30 Thread Benoît Panizzon via sr-users
Hi Alex

> You can use $T_inv(...) to access attributes of the original INVITE
> transaction, to which the CANCEL pertains:
> 
> https://www.kamailio.org/wikidocs/cookbooks/5.8.x/pseudovariables/#t_invpv

Thank you, I'll check that out.

> However, you may instead consider the attractive simplicity of just
> calling rtpengine_delete() for every CANCEL, regardless of whether
> RTPEngine was engaged. If the  tuple is not
> recognised by RTPEngine, no harm, no foul -- not an even error. Yes,
> there is the overhead of a synchronous round trip to RTPEngine
> involved in this. However, in most cases, the consequences aren't too
> significant.

Unfortunately, life sometimes is not that simple, like when you have to
find a way to process spiralling calls with rtpengine.

And yes, unfortunately loop-protect is not the solution as some codec
quicks are needed depending on the direction of the call.

For this to work, each spiral needs to pass an unique callID to
rtpengine. So adding a counter to the real callID, let's call it extraID
did the trick (with an X- header and adding a rr_param to process
messages the other way round etc.)

But i got stuck when trying to nicely tell rtpengine to stop listening
for callID-extraID on a CANCEL as I have not yet found a way to get
hold of that extraID.

rtpengine will eventually time out, but I try to tidy up correctly.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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: Access avp vars in a cancel? How to pass information from an INVITE to a CANCEL?

2024-05-30 Thread Benoît Panizzon via sr-users
Hi Alex

> Curious: why is this necessary? Is there a possibility there is an
> unnecessary complicating assumption at the root of your setup?
> 
> Maybe not, but I have to wonder.

*sigh* yes I guess you may ask. Somehow I think we do 'normal' VSP
business, but it looks like we seem to have a complicated set-up.

Our set-up basically looks like this:

We have a core kamailio node taking care of dialog handling, CDR
gathering for billing, routing and which has interconnections to other
VSP, voicemail etc. but they are more or less firewalled from the
internet.

We have a registrar kamailio node taking care of connected customer,
dynamic registrations, authentication facing the bad dangerous
internet. No dialog module enable! This node does not know how to route
stuff.
It his relatively simple minded. If the call is from a customer, route
it to the core who will then account for the call and know how to route.
If the call is from the core, then look up the location and route to
the customer if registered. Of course there is more like failure
handling, call forwarding handling etc. but you get the basic idea.

At the moment, we use a commercial SBC to handle RTP on the
interconnection side to other VSP, but also to proxy RTP
and registrations from customer CPE. Especially with registrations it's
not always behaving according to SIP standard and causes a lot of
issues.
But also on the interconnection to other VSP side, it has some
limitations, for example it can't stand crypto in an SDP and will reply
with 450 (or whatever the sip code is to reject an SDP) when crypto is
present. It also considers ipv6 addresses to be something that needs
rejecting.

We want to get rid of the SBC, especially on the side towards our
customer, the sooner the better.

Hey we could allow customers to encrypt their RTP traffic and talk a
modern ip protocol!

So, as the registrar are facing the bad and dangerous internet anyway I
somehow prefer to keep our core kamailio a bit behind firewalls, my
conclusion was to run rtpengine on the registrar any maybe also benefit
from some advantages with firewalls and cpe who prefer to exchange RTP
and Signaling to the same IP.

Now picture customer A on the registrar calling customer B on the same
registrar.

The registrar authenticates the caller, rtpengine maybe talks ipv6 and
crypto as suggested by the caller, throws in some ICE magic etc. all
nice stuff to do with the customer. But as the registrar instance has no
clue where the destination number is, it just routes the call to the
core. As the destination could be behind our SBC, or maybe another VSP
which only accepts IPv4, I have to make sure I remove crypto and use
IPv4 in the SDP towards the core.

Well, now the call is on the core, the routing table for the
destination is looked up. Hey, it's also a customer of ours, let's
route the call back to the registrar!

The registrar look up the location table and determines what ip
version and protocol that customer is registered with, if it's IPv6 then
activate ICE. Offer Crypto!

Well, for this to work, I need to run the call separately through
rtpengine again, with a different callID. If I activate loop-protect on
rtpengine, then the settings which are compatible towards our SBC and
interconnection would be sent to the customer as the 2nd invocation of
rtpengine would be ignored.

I hope this makes sense.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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: Assistance Needed: Converting 11-Digit US Numbers to E.164 in Kamailio

2024-05-31 Thread Benoît Panizzon via sr-users
Hi Kumar

> Before writing the code, I want to know if there is already a
> solution to this problem in one of the modules, so that I won't
> reinvent the wheel.

US numbers are fixed lenght 11 digits? What is the usual representation
of a 'local' US number? Does it start with a 0?

I do this (to translate Swiss local numbers to e164):

$var(check_number) = "012 345 67 89" # local number example, use $rU or $fU or 
whatever you want to translate.
route(TRANSLATE_TO_e164);
$rU = $var(result);

route[TRANSLATE_TO_e164]
{
$var(result) = 'invalid';
$var(check_number) = $(var(check_number){s.rmws}); # Remove spaces
if ($var(check_number) =~ "^\+") {
$var($result) = $var(check_number); # Already e164
} else if ($var(check_number) =~ "^00") {
# international number in local notation replace 00 by +
$var(result) = "+" + $(var(check_number){s.substr,2,0});
} else if ($var(check_number) =~ "^0") {
# Swiss number in local notation replace 0 by +41
$var(result) = "+41" + $(var(check_number){s.substr,1,0});
}
}

And of course I have a corresponding TRANSLATE_TO_LOCAL to display numbers to 
the customer in a format they are used to in Switzerland.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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: Access avp vars in a cancel? How to pass information from an INVITE to a CANCEL?

2024-05-31 Thread Benoît Panizzon via sr-users
Hi

> 
>   
>   
>   
>   
>   
>data="[sip_h_X-PGPX=${uuid}]sofia/internal/$1@${sendto}"/>  application="hangup"/> 
> 
> I was not aware it was that simple. Thank you for the education!

Indeed. I was considering asterisk as I tend to use what I know.
But with Asterisk I would have to add quite some config to pass on
required additional customer sip header.

If that's that simple with FreeSwitch and header can be transparently
passed on, I'll have a look at it.

This would also solve another problem. We have some CPE with limited
memory which struggle with a long record-route list.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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: Parsing Error with SIP 607 Response

2024-05-31 Thread Benoît Panizzon via sr-users
Hi Mustafa

> SIP/2.0 607.

I didn't check the RFC. But doesnt a reply need to be in the format

SIP/2.0 XXX AA

Is the text missing after the numerical error code?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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] Recommendation for a signaling B2BUA to work with Kamailio on Ubuntu

2024-06-07 Thread Benoît Panizzon via sr-users
Hi

I wonder if anyone could maybe recommend what to use as signaling B2BUA
to work with Kamailio to handle spiralling / looping calls and to reduce
the number of Route, Via Header and message size, which cause issue
with a large number of CPE.

Requirements:
* New CallID needs to be generated
* Handling Route and Via
* ~ 2000 concurrent calls.
* Preserving custom SIP X- header
* Routing NOTIFY for MWI etc.

Handling RTP is not required!

What I have been looking at more closely:

= FreeSwitch =

Got stuck trying to solve the dependencies to get it to run/build on
ubuntu jammy.
Has anyone experience in running it in a docker container? Will it
perform?

= Sippy =

Very small, very simple, unfortunately removes customer SIP headers and
does not forward NOTIFY. (It's python, so maybe this could be easily
implemented/fixed).

= SEMS =

Does not seem to be actively developed in the last, couple of years.
Looks quite bloated to me for what I need.

= Asterisk =

Each customer header has to be copied, wants to handle RTP and bridge
by issuing Re-Invites. Not sure how to route stuff like NOTIFY.
Also from experience I fear asterisk would translate sip reply codes
(like 608 and 607) it does not know to some 4XX default.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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: Disable topos for a specific peering IP

2024-09-05 Thread Benoît Panizzon via sr-users
Hey!

> I'm still trying to figure out how to implement an exception from
> topos processing for a specific type of SIP device (IP is not fixed)
> based on User-Agent.
> If anyone has any ideas, I'd appreciate some help!

I have been in the same situation. I have a registrar that handles UAs
and has a connection to our core routing instance. It also handles call
forwarding.

So when a call is directed to a registered UAs I want to engage topos,
but when the UAs times out or is unreachable and CFW is engaged
(sending the call back to the core to route to the CFW destination), I
wanted to revert engaged topos.

=> I found no way to do that. Further more, if the call is looped back
from the core to another customer on the same registrar, topos is
getting confused and breaks.

If you find a solution, I would be very happy to hear how you solved
reverting topos for a specific ip or for specific situations after it
was engaged.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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: Disable topos for a specific peering IP

2024-09-06 Thread Benoît Panizzon via sr-users
Hi Denys

> I'm testing the logic below, for now, it looks very promising.
> It seems like there is access to dialog variables.
> 
>  /*
>  SIP-UA (Snom)<--> Kamailio (w/o topos)  <--> FreeSWITCH
>  SIP-UA (Yealink) <--> Kamailio (with topos) <--> FreeSWITCH

Ok I think I know, why this does work for you, but not for me.

We have a very similar situation, where we use kamailio as registrar
like you do, but another kamailio (in router role) where you use
FreeSwitch.

The situation where we had calls signaling being completely messed up
by topos would be...

Call from Switch through Kamailio (with topos) to Yealink.
Yealink is busy!
Kamailio with topos activated at that moment, engages failure route.
Failure route determines YeaLink customer wants call forward on busy to
another number.
Kamailio routes call to Switch to take care to route to call to the CFW
destination.
Switch determines, that CFW destination is the number of the Snom UA.
Switch routes call to Kamailio (first call leg still present with topos
engaged).
Switch (in case it is Kamailio, it is a proxy, same CallID, same
FromTag from topos point of view)

=> Now things break. (don't ask me about the exact details how they
broke, it was just not behaving as expected).

I guess in your situation this works, as FreeSwitch probably works as a
B2BUA, therefore when the call is routed to kamailio a 2nd time, it has
a different CallID and FromTag and thus does not break the first
existing call-leg still known to the kamailio registrar.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
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: