[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] 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] Re: How to assign xavp array to htable?

2024-01-25 Thread Alex Balashov via sr-users



> On 25 Jan 2024, at 06:34, Benoit Panizzon via sr-users 
>  wrote:
> 
> 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?

You can always iterate through the XAVP array manually and perform your own 
data marshalling:

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.

-- Alex

-- 
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800

__
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: Is the Contact header required for the dialog module?

2024-01-25 Thread Alex Balashov via sr-users


> On 25 Jan 2024, at 03:35, Unai Rodriguez via sr-users 
>  wrote:
> 
> I tried this (and some variations) to no avail:
> 
> request_route {
>   insert_hf("Contact: $fu\r\n");
>   ...
>   ...
> 
> I see the Contact header inserted but after receiving the first SIP INVITE 
> (ie too late). Is there a way I can instruct the DIALOG module to use a value 
> of Contact that’s been computed dynamically on the config? Is it possible to 
> modify what Kamailio holds in memory for the value of Contact before the 
> dialog module processes it? Any other points on how I could deal with this 
> missing Contact header?

I believe that calling msg_apply_changes() will sync the change lumps to the 
in-memory message structure. 

Whether this will affect the version of the message that `dialog` operates on, 
I'm not 100% sure... 

-- Alex

-- 
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800

__
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] Re: Roadmap to next major Kamailio release series v5.8.x

2024-01-25 Thread Henning Westerholt via sr-users
Hello Daniel,

we will manage to commit an initial version of the module which some work in 
progress still open to the repository by the end of this month.

Thanks,

Henning

-- 
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

> -Original Message-
> From: Daniel-Constantin Mierla 
> Sent: Mittwoch, 24. Januar 2024 11:23
> To: Henning Westerholt ; Kamailio (SER) - Devel Mailing List
> 
> Cc: Kamailio (SER) - Users Mailing List 
> Subject: Re: Roadmap to next major Kamailio release series v5.8.x
> 
> Hello,
> 
> would it be possible to get the skeleton in the git repo or as PR for the new
> module by end of the month? It is still a week and completing missing parts 
> can
> be done during the testing phase.
> 
> Cheers,
> Daniel
> 
> On 23.01.24 10:13, Henning Westerholt wrote:
> > Hello Daniel,
> >
> > we are working on a new module right now (related to special logging for 
> > high
> CPS setups), which would be nice to integrate if possible. Its isolated, so 
> would not
> touch any other module and/or the core. There is also another core 
> refactoring in
> progress (to replace the atomic operations with the standard Linux kernel 
> support
> for better support of non-Intel/AMD architectures), but this probably needs to
> wait to the next release cycle then.
> >
> > Best regards,
> >
> > Henning Westerholt
> >
> > --
> > Henning Westerholt – https://skalatan.de/blog/ Kamailio services –
> > https://gilawa.com
> >
> >> -Original Message-
> >> From: Daniel-Constantin Mierla 
> >> Sent: Montag, 15. Januar 2024 11:33
> >> To: Henning Westerholt ; Kamailio (SER) - Devel
> >> Mailing List 
> >> Cc: busin...@lists.kamailio.org; Kamailio (SER) - Users Mailing List
> >> 
> >> Subject: Re: [Kamailio-Business] Roadmap to next major Kamailio
> >> release series v5.8.x
> >>
> >> Hello,
> >>
> >> first week of February is a semester school break in many regions, if
> >> someone announces that he has ongoing work to a new module/feature,
> >> then freezing can be postponed.
> >>
> >> But if not, I would rather do it earlier than waiting for nothing,
> >> because starting later could end up in getting closer the Catholic
> >> Easter, which is earlier this year, by end of March, a week before
> >> another holiday starts. Considering the constraints on late March and
> >> April, if not out by mid of March or so, next time frame will be end of 
> >> April or
> during May.
> >>
> >> Cheers,
> >> Daniel
> >>
> >> On 11.01.24 17:12, Henning Westerholt wrote:
> >>> Hello,
> >>>
> >>> early February as a freezing date sounds good to me, just to have
> >>> one full
> >> month after the holiday season/vacation period to allow other people
> >> to finish eventual contributions.
> >>> Cheers,
> >>>
> >>> Henning
> >>>
> >>> --
> >>> Henning Westerholt - https://skalatan.de/blog/ Kamailio services -
> >>> https://gilawa.com
> >>>
>  -Original Message-
>  From: Daniel-Constantin Mierla via business
>  
>  Sent: Mittwoch, 10. Januar 2024 10:11
>  To: Kamailio (SER) - Users Mailing List
>  ; Kamailio
>  (SER) - Devel Mailing List ;
>  busin...@lists.kamailio.org
>  Subject: [Kamailio-Business] Roadmap to next major Kamailio release
>  series v5.8.x
> 
>  Hello,
> 
>  discussed a bit during the online Kamailio devel meeting, it is
>  time to set the milestones towards the next major Kamailio release series
> v5.8.x.
> 
>  If no other suggestions that suit more developers, I would propose
>  to freeze by end of this month or early February, then test for
>  about 4 weeks as usual and release by end of February or during March.
> 
>  If anyone wants to add new features/modules, they have to be
>  published till freezing date, either pushed in the git repository
>  or proposed
> >> as pull request.
>  Cheers,
>  Daniel
> 
>  --
>  Daniel-Constantin Mierla (@ asipto.com) twitter.com/miconda --
>  linkedin.com/in/miconda Kamailio Consultancy, Training and
>  Development Services -- asipto.com Kamailio Advanced Training,
>  February 20-22, 2024 -- asipto.com Kamailio World Conference, April
>  18-19, 2024, Berlin -- kamailioworld.com
> 
>  ___
>  Kamailio (OpenSER) - business mailing list --
>  busin...@lists.kamailio.org To unsubscribe send an email to
>  business-le...@lists.kamailio.org
>  http://lists.openser-project.org/cgi-
>  bin/mailman/listinfo%(cgiext)s/%(_internal_name)s
> >> --
> >> Daniel-Constantin Mierla (@ asipto.com) twitter.com/miconda --
> >> linkedin.com/in/miconda Kamailio Consultancy, Training and
> >> Development Services -- asipto.com Kamailio Advanced Training,
> >> February 20-22, 2024 -- asipto.com Kamailio World Conference, April
> >> 18-19, 2024, Berlin -- kamailioworld.com
> 
> --
> Daniel-Constantin Mierla (@ asipto.com)
> twitter.com/miconda -- 

[SR-Users] Re: Is the Contact header required for the dialog module?

2024-01-25 Thread Unai Rodriguez via sr-users
I tried this (and some variations) to no avail:

request_route {
  insert_hf("Contact: $fu\r\n");
  ...
  ...

I see the Contact header inserted but after receiving the first SIP INVITE (ie 
too late). Is there a way I can instruct the DIALOG module to use a value of 
Contact that’s been computed dynamically on the config? Is it possible to 
modify what Kamailio holds in memory for the value of Contact before the dialog 
module processes it? Any other points on how I could deal with this missing 
Contact header?

Thank you so much

With best wishes,
Unai Rodriguez
On 24 Jan 2024 at 13:54 +0100, Alex Balashov via sr-users 
, wrote:
> Hi,
>
> Contact is mandatory in INVITEs. Per RFC 3261 § 8.1.1.8 ("Contact"):
>
> The Contact header field MUST be present and contain exactly one SIP
> or SIPS URI in any request that can result in the establishment of a
> dialog. For the methods defined in this specification, that includes
> only the INVITE request.
>
> -- Alex
>
> > On 24 Jan 2024, at 05:42, Unai Rodriguez via sr-users 
> >  wrote:
> >
> > Dear List,
> >
> > I’m trying to set up the dialog module and I keep getting the error "bad 
> > sip message or missing Contact hdr”:
> >
> > ---
> > Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 
> > 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog 
> > [dlg_handlers.c:219]: populate_leg_info(): bad sip message or missing 
> > Contact hdr
> > Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 
> > 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog 
> > [dlg_handlers.c:952]: dlg_new_dialog(): could not add further info to the 
> > dialog
> > ---
> >
> > This is for MRCP traffic and the SIP INVITEs do not contain the Contact 
> > header. They look like this:
> >
> > 
> > INVITE sip:some.mrcp.server.example.com:8060 SIP/2.0
> > Via: SIP/2.0/TCP 10.10.10.10:5099;branch=z9hG4bK5Kpey3r13SBNQ
> > Max-Forwards: 70
> > From: ;tag=134a3eKD2a8Ua
> > To: 
> > Call-ID: 051df0ff-3541-123d-f090-02f373ff014c
> > CSeq: 78491159 INVITE
> > User-Agent: google_stt
> > Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, 
> > NOTIFY, REFER, UPDATE
> > Supported: timer, 100rel
> > Content-Type: application/sdp
> > Content-Disposition: session
> > Content-Length: 329
> >
> > v=0
> > o=FreeSWITCH 2474358185109188492 5282339568667506935 IN IP4 10.10.10.10
> > s=-
> > c=IN IP4 10.10.10.10
> > t=0 0
> > m=application 9 TCP/MRCPv2 1
> > a=setup:active
> > a=connection:new
> > a=resource:speechrecog
> > a=cmid:1
> > m=audio 12034 RTP/AVP 0 8 96
> > a=rtpmap:0 PCMU/8000
> > a=rtpmap:8 PCMA/8000
> > a=rtpmap:96 L16/8000
> > a=sendonly
> > a=mid:1
> > 
> >
> > According to the RFC, the Contact header is not mandatory 
> > (https://datatracker.ietf.org/doc/html/rfc3261#section-8.1.1) and I don’t 
> > have an easy way of adding the Contact header to the INVITEs. Is there a 
> > way to configure Kamailio’s dialog module to do without the Contact header? 
> > Any pointers appreciated.
> >
> > Thank you so much
> >
> > With best wishes,
> > Unai Rodriguez
> > __
> > 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:
>
> --
> Alex Balashov
> Principal Consultant
> Evariste Systems LLC
> Web: https://evaristesys.com
> Tel: +1-706-510-6800
>
> __
> 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:
__
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: