[SR-Users] sql_xquery return 1 on 0 rows?

2021-11-05 Thread Benoît Panizzon
Dear List...

kamcmd> version
kamailio 5.4.7 (x86_64/linux)

Strange issue found.

According to: 
https://kamailio.org/docs/modules/5.4.x/modules/sqlops.html

I should get return value 2 if no rows returned:

$var(query) contains a query that does not match (number is not
assigned)

if (sql_xquery("impkam", "$var(query)", "assignedtn") == 1) {
if ($avp(debug) > 1) {
xlog("L_INFO", "$cfg(route): SQL Dump Result: 
$var(assignedtn) ROWS: $dbr(assignedtn=>rows) \n");
}
do stuff with the assigned number
} else {
do stuff in case that number is not assigned
}

Log Output:

CHECK_ASSIGNED_TN: SQL Dump Result: 0 ROWS: 0

So the return value of the query was == 1 but the result contains no
rows. How can that 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
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] STIR/SHAKEN public key

2021-11-05 Thread David Villasmil
Fantastic, thank you Oleg!
Seems to be working!

On Fri, 5 Nov 2021 at 09:15, Oleg Belousov  wrote:

> Hi, David.
> Our CA provided us a single file which consists of such 3 certs, in order
> you mentioned, so yes - you need to publish a single file in that order:
> your cert, CA cert, root cert.
> --
> obelousov.tel
>
>
> On Thu, Nov 4, 2021 at 9:57 PM David Villasmil <
> david.villasmil.w...@gmail.com> wrote:
>
>> Hello guys,
>>
>> So the PA sent us 3 files:
>>
>> 1- out cert
>> 2- the intermediate cert
>> 3- the root cert
>>
>> Should i copy those into a single file in that order and then publish
>> that as the cert.pem in
>>
>> *secsipid_add_identity("$fU", "$rU", "A", "",
>> "https://kamailio.org/stir/$rd/cert.pem
>> ", "/secsipid/$rd/key.pem");*
>>
>>
>> ??
>> Regards,
>>
>> David Villasmil
>> email: david.villasmil.w...@gmail.com
>> phone: +34669448337
>>
>>
>> On Thu, Nov 4, 2021 at 6:55 PM David Villasmil <
>> david.villasmil.w...@gmail.com> wrote:
>>
>>> Yep, that much was clear from the outset.
>>> The wording on the docs confused me, because it reads "public key". BUt
>>> now i see it's the cert and the client will get the pk from the cert.
>>> Thanks for taking the time to explain!
>>>
>>> Regards,
>>>
>>> David Villasmil
>>> email: david.villasmil.w...@gmail.com
>>> phone: +34669448337
>>>
>>>
>>> On Thu, Nov 4, 2021 at 6:35 PM Ben Kaufman 
>>> wrote:
>>>
 Not sure if it was clarified or not, but it should be an https URL from
 where your certificate can be downloaded, not the actual certificate 
 itself.



 *Ben Kaufman*



 *From:* sr-users  * On Behalf Of 
 *David
 Villasmil
 *Sent:* Thursday, November 4, 2021 12:00 PM
 *To:* Kamailio (SER) - Users Mailing List 
 *Subject:* Re: [SR-Users] STIR/SHAKEN public key



 Thanks Oleg, i misunderstood all that.

 Regards,



 David Villasmil

 email: david.villasmil.w...@gmail.com

 phone: +34669448337





 On Thu, Nov 4, 2021 at 4:58 PM Oleg Belousov 
 wrote:

 Hi.

 It should be certificate issued by CA certified by the Shaken Policy
 Administrator (iConnective in US)..

 --
 obelousov.tel
 





 On Thu, Nov 4, 2021 at 5:39 PM David Villasmil <
 david.villasmil.w...@gmail.com> wrote:

 Hello guys,

 I'm testing with 2 providers right now, and one of them is asking me to
 include my whole certificate on the

 *secsipid_add_identity(origTN, destTN, attest, origID, x5u, keyPath)*

 like:

 *secsipid_add_identity("$fU", "$rU", "A", "",
 "https://kamailio.org/stir/$rd/cert.pem
 ",
 "/secsipid/$rd/key.pem");*

 but it is stated that:

 *x5u is the HTTP URL referencing to the public key that should be used
 to verify the signature;*

 One provider is asking to put the cert there, the other hasn't asked
 that yet.

 So i'm  a little confused, should the x5u be the actual cert (with its
 intermediary?) or only the public key?

 Regards,

 David Villasmil

 email: david.villasmil.w...@gmail.com

 phone: +34669448337

 __
 Kamailio - Users Mailing List - Non Commercial Discussions
   * sr-users@lists.kamailio.org
 Important: keep the mailing list in the recipients, do not reply only
 to the sender!
 Edit mailing list options or unsubscribe:
   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
 

 __
 Kamailio - Users Mailing List - Non Commercial Discussions
 

Re: [SR-Users] STIR/SHAKEN public key

2021-11-05 Thread Oleg Belousov
Hi, David.
Our CA provided us a single file which consists of such 3 certs, in order
you mentioned, so yes - you need to publish a single file in that order:
your cert, CA cert, root cert.
--
obelousov.tel


On Thu, Nov 4, 2021 at 9:57 PM David Villasmil <
david.villasmil.w...@gmail.com> wrote:

> Hello guys,
>
> So the PA sent us 3 files:
>
> 1- out cert
> 2- the intermediate cert
> 3- the root cert
>
> Should i copy those into a single file in that order and then publish that
> as the cert.pem in
>
> *secsipid_add_identity("$fU", "$rU", "A", "",
> "https://kamailio.org/stir/$rd/cert.pem
> ", "/secsipid/$rd/key.pem");*
>
>
> ??
> Regards,
>
> David Villasmil
> email: david.villasmil.w...@gmail.com
> phone: +34669448337
>
>
> On Thu, Nov 4, 2021 at 6:55 PM David Villasmil <
> david.villasmil.w...@gmail.com> wrote:
>
>> Yep, that much was clear from the outset.
>> The wording on the docs confused me, because it reads "public key". BUt
>> now i see it's the cert and the client will get the pk from the cert.
>> Thanks for taking the time to explain!
>>
>> Regards,
>>
>> David Villasmil
>> email: david.villasmil.w...@gmail.com
>> phone: +34669448337
>>
>>
>> On Thu, Nov 4, 2021 at 6:35 PM Ben Kaufman 
>> wrote:
>>
>>> Not sure if it was clarified or not, but it should be an https URL from
>>> where your certificate can be downloaded, not the actual certificate itself.
>>>
>>>
>>>
>>> *Ben Kaufman*
>>>
>>>
>>>
>>> *From:* sr-users  * On Behalf Of *David
>>> Villasmil
>>> *Sent:* Thursday, November 4, 2021 12:00 PM
>>> *To:* Kamailio (SER) - Users Mailing List 
>>> *Subject:* Re: [SR-Users] STIR/SHAKEN public key
>>>
>>>
>>>
>>> Thanks Oleg, i misunderstood all that.
>>>
>>> Regards,
>>>
>>>
>>>
>>> David Villasmil
>>>
>>> email: david.villasmil.w...@gmail.com
>>>
>>> phone: +34669448337
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Nov 4, 2021 at 4:58 PM Oleg Belousov 
>>> wrote:
>>>
>>> Hi.
>>>
>>> It should be certificate issued by CA certified by the Shaken Policy
>>> Administrator (iConnective in US)..
>>>
>>> --
>>> obelousov.tel
>>> 
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Nov 4, 2021 at 5:39 PM David Villasmil <
>>> david.villasmil.w...@gmail.com> wrote:
>>>
>>> Hello guys,
>>>
>>> I'm testing with 2 providers right now, and one of them is asking me to
>>> include my whole certificate on the
>>>
>>> *secsipid_add_identity(origTN, destTN, attest, origID, x5u, keyPath)*
>>>
>>> like:
>>>
>>> *secsipid_add_identity("$fU", "$rU", "A", "",
>>> "https://kamailio.org/stir/$rd/cert.pem
>>> ",
>>> "/secsipid/$rd/key.pem");*
>>>
>>> but it is stated that:
>>>
>>> *x5u is the HTTP URL referencing to the public key that should be used
>>> to verify the signature;*
>>>
>>> One provider is asking to put the cert there, the other hasn't asked
>>> that yet.
>>>
>>> So i'm  a little confused, should the x5u be the actual cert (with its
>>> intermediary?) or only the public key?
>>>
>>> Regards,
>>>
>>> David Villasmil
>>>
>>> email: david.villasmil.w...@gmail.com
>>>
>>> phone: +34669448337
>>>
>>> __
>>> Kamailio - Users Mailing List - Non Commercial Discussions
>>>   * sr-users@lists.kamailio.org
>>> Important: keep the mailing list in the recipients, do not reply only to
>>> the sender!
>>> Edit mailing list options or unsubscribe:
>>>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>> 
>>>
>>> __
>>> Kamailio - Users Mailing List - Non Commercial Discussions
>>>   * sr-users@lists.kamailio.org
>>> Important: keep the mailing list in the recipients, do not reply only to
>>> the sender!
>>> Edit mailing list options or unsubscribe:
>>>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>