[sr-dev] Re: [kamailio/kamailio] Warnings emitted when calling functions from dialplan module (Issue #3851)

2024-06-17 Thread Ben Kaufman via sr-dev
Problem still exists in 5.8.2.  Can this issue be re-opened?  

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3851#issuecomment-2173430421
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Warnings emitted when calling functions from dialplan module (Issue #3851)

2024-05-18 Thread Ben Kaufman via sr-dev
Is there any indication if this is a functional problem, or just a case of 
logging that should be reduced - I'm trying to gauge if I should hold off 
before upgrading.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3851#issuecomment-2118838919
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] [kamailio/kamailio] Warnings emitted when calling functions from dialplan module (Issue #3851)

2024-05-15 Thread Ben Kaufman via sr-dev
### Description

Calling functions from the `dialplan` module in 5.8 (`dp_translate()`, 
`dp_match()`) results in the following line being logged:

```
WARNING:  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
```

Is this a functional problem, or just a case of overly aggressive logging?

### Troubleshooting

 Reproduction
Reproducible with the following kamailio config:

```
#!KAMAILIO

loadmodule "pv"
loadmodule "db_sqlite"
loadmodule "xlog"
loadmodule "dialplan"

disable_tcp = true
force_rport = true

!!define DBFILE /etc/kamailio/kamailio.sqlite

modparamx("db_sqlite","db_set_readonly", "$def(DBFILE)")

modparamx("dialplan","db_url", "sqlite:///$def(DBFILE)")
modparam("dialplan", "attrs_pvar", "$avp(dp_attrs)")

request_route {
if ( $rm == "ACK" ) {
exit;
}

xinfo("$ci New request\n");

dp_match("1", "$rU");
exit;
}
```

The warning log is issued in 5.8 but not 5.7.  Reproduced by sending a request 
with SIPp:

```
sipp -sn uac  -m 1 -s 1555444 localhost
```

### Possible Solutions

Not sure if this is just a case of logging being overly aggressive, or an issue 
with the module's memory management.

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.8.1 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 
262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 12.2.0
```

Tested using docker `debian:12-slim` using the official packages from 
`http://deb.kamailio.org/kamailio58`


* **Operating System**:

Docker debian:12-slim,  but also observed in Alpine Linux/



-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3851
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-05-08 Thread Ben Kaufman via sr-dev
Issue auto marked marked as "stale", but the provided fix works.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-2101844186
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Less predictive algorithm for carrierroute hashing (Issue #3786)

2024-04-12 Thread Ben Kaufman via sr-dev
My guess is that md5 would be sufficient.  It's still odd feeling that CRC32 
wasn't getting sufficient randomization against the actual Call-Ids I was 
receiving.  Anything requiring OpenSSL and actual cryptographic-quality 
algorithms seems overkill, though.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3786#issuecomment-2051699184
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] DBURL can't read env params (Issue #3800)

2024-04-03 Thread Ben Kaufman via sr-dev
I don't think macro replacement works inside of strings. I believe you should 
be able to achieve what you want using 
[#!defexp](https://github.com/kamailio/kamailio-wiki/blob/main/docs/cookbooks/5.7.x/core.md#defexp),
 as the examples in the core documentation are nearly identical to your example.

```
#!define IPADDR 127.0.0.1

#!defexp SIPURI "sip:" + IPADDR + ":5060"
#!defexp QSIPURI '"sip:' + IPADDR + ':5060"'

#!defexp V16 1<<4
```

Another possibility is using `modparamx()` and interpolating your strings there:
```
#!defenv MYSQL_IP 

#!modparamx("permissions, "db_url", 
"mysql://kamailio:kamailio@$def(MYSQL_IP)/kamailio");
```

Or even just:
```
#!modparamx("permissions, "db_url", 
"mysql://kamailio:kamailio@$env(MYSQL_IP)/kamailio");
```

The last form having the advantage that it's not available via the 
`core.ppdefines_full` rpc function thus reducing one possible point of exposure.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3800#issuecomment-2035042424
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-27 Thread Ben Kaufman via sr-dev
Confirmed that this is working.  Will it get ported to 5.8 or will it be the 
next `major.minor` release?


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-2022908007
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-20 Thread Ben Kaufman via sr-dev
Is it possible to use the same logic for downloading (and caching) of the key 
as the `secsipid_check` function:

> If the keyPath parameter is empty, the function is downloading the key using 
> the URL from "info" parameter of the sIdentity, using the value of "timeout" 
> parameter to limit the download time


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-2009737204
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-20 Thread Ben Kaufman via sr-dev
Ah - I see the function takes three arguments.  The third argument only has "A" 
as an allowed value?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-2009659271
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-20 Thread Ben Kaufman via sr-dev
Sorry for the delayed reply - I had a few small issues compiling, but kamailio 
then fails to start with secsipid_verify() not found:

During startup:
```
 0(1) ERROR:  [core/cfg.y:3870]: yyparse(): cfg. parser: failed to find 
command secsipid_verify (params 2)
```

Versions:
```
[ben@NV0162~/projects/cnam_relay]$ dc exec cnam-sti-vs kamailio -v
version: kamailio 5.9.0-dev0 (x86_64/linux) 951ab1
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 
262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 951ab1
compiled on 21:42:15 Mar 19 2024 with gcc 12.2.0

[ben@NV0162~/projects/cnam_relay]$ dc exec cnam-sti-vs secsipidx -version
secsipidx v1.3.2
```

This is my Dockerfile in case I'm missing something in compilation:
```
FROM golang:1.22.1-bookworm AS secsipidbuilder
ARG SECSIPID_VERSION=v1.3.2
ENV GO111MODULE=off
RUNcd / \
&& git clone https://github.com/asipto/secsipidx.git \
&& cd secsipidx \
&& make \
&& make install \
&& cd / \
&& apt update \
&& apt upgrade -y \
&& apt install -y git make automake autoconf libtool libcurl4-openssl-dev \
  sngrep gnupg2 wget lsb-release openssl libssl-dev \
  pkg-config uuid-dev sip-tester \
&& apt install -y pkg-config gcc bison flex g++ libssl-dev libxml2-dev \
  libjson-c-dev libpcre3 libjansson-dev libpcre3-dev  \
  libhiredis-dev libsqlite3-dev libpq-dev libevent-dev \
  sqlite3 uuid-dev \
&& cd /secsipidx \
&& make install \
&& git clone \
-b master \
--single-branch https://github.com/kamailio/kamailio.git /kamailio \
&& cd /kamailio \
&& make include_modules="jansson json ndb_redis db_sqlite db_postgres \
 secsipid secsipid_proc http_async_client avpops \
 uuid" prefix="/" cfg \
&& make all \
&& make install \
&& apt clean \
&& apt-get autoremove --yes \
&& cd / \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ \
&& rm -rf /kamailio \
&& rm -rf /secsipidx

COPY etc/kamailio /etc/kamailio
```




-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-2009632594
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] [kamailio/kamailio] Less predictive algorithm for carrierroute hashing (Issue #3786)

2024-03-15 Thread Ben Kaufman via sr-dev
### Description

Carrierroute's CRC32 algorithm over call_id tends to produce poor call 
distribution under real world examples.  Having 4 records for a given 
carrier/domain combo (assuming no flags, mask, or scan_prefix) and a 
probability of `0.25` using a hash source of `call_id`  I observed over 800 
hundred consecutive calls from a carrier (bandwidth.com) where `CRC32(call_id) 
% 1000` was less than 250.  

To be fair, the module does what it says - it uses a CRC32 hash over the call 
id, however the data from the UA generating the call is yielding poor results.  
Would it be possible to change to an alternate hashing mechanism (or add 
another hashing mechanism, selectable via `modparam`) such as MD5?

### Expected behavior

Even distribution across all hosts provided.

 Actual observed behavior

Uneven distribution under real-world conditions.

 Debugging Data

I can provide a list of > 800 call-ids observed that all routed to the same 
endpoint.  These are pulled from real world calls, and while there's not much 
danger in just having call-id's I would still prefer not to post it into github 
for posterity.

 Log Messages

Log messages end up looking similar to this.  I validated that the number is 
the CRC32 hash of the call id, so it's not a bug in the module.

```
proxy-1  |  1(7) DEBUG: carrierroute [cr_func.c:449]: rewrite_on_rule(): 
searching for matching routing rules 1(7) DEBUG: carrierroute 
[prime_hash.c:66]: hash_func(): hash: 2417021133 % 1000 = 133
proxy-1  |  1(7) INFO: carrierroute [cr_func.c:689]: ki_cr_do_route_helper(): 
uri service was rewritten to sip:service@host-d, carrier 1, domain 1
```


### Possible Solutions

Ability to use MD5, kamailio's core hash function or other such hashing function

### Additional Information

Problem validate in 5.7.3, but since it's *correct* by module design, it 
shouldn't have changed in 5.8


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3786
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-11 Thread Ben Kaufman via sr-dev
I'll give the JWT module a peek.  Lack of caching is maybe an issue (but can be 
'farmed out' to something else for caching purposes).

Perhaps this would be better considered as an error with the existing 
`secsipid_check()` function in that it will only validate `shaken` passport 
types, and the ask should be simply to eliminate this check.

> _`secsipid_check(sIdentity, keyPath)`_
>
>Check the validity of the "sIdentity" parameter using the keys stored in the 
>file specified by "keyPath". If the keyPath parameter is empty, the function 
>is downloading the key using the URL from "info" parameter of the sIdentity, 
>using the value of "timeout" parameter to limit the download time. The 
>validity of the JWT in the sIdentity value is also checked against the 
>"expire" parameter.

The function notes, "Further checks can be done with config operations, 
decoding the JWT header and payload using {s.select} and {s.decode.base64t} 
transformations together with jansson module.", which is a very clean waay to 
handle this, and the function here should just be less opinionated on what is 
and isn't a valid Identity header?




-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-1988777507
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] [kamailio/kamailio] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-11 Thread Ben Kaufman via sr-dev
### Description

Currently secsipid has a method to sign arbitrary (json) data 
(`secsipid_sign`), however it has no converse method to check the signature.  
Currently, an attempt to check a `div` signature for example will yield a 
`-303` error (`SIPHdrInfo`).  Rather than trying to have full parsing for every 
possible type of Identity header (which are likely to increase in variety), it 
would be good to simply check "is this signature valid by trusted key", 
possibly validating the `iat` timestamp as well, but without any other opinions 
on the header values.


### Expected behavior

A feature to check only the signature of an identity header.


 Actual observed behavior

Currently the `secsipid_check_` family of functions fails for non- `shaken` 
passport types.


 Debugging Data

The following DIV identity header was generated by secsipid's  
`secsipid_sign()` function, so it should be possible to reverse this to 
validate the signature:

```
Identity: 
eyJhbGciOiJFUzI1NiIsInBwdCI6ImRpdiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9kLm10c2VjLm1lL2QzYTkvQmZUeGJVTlozS1FMLnBlbSJ9.eyJkZXN0Ijp7InRuIjpbIjE2MTI1NTU0MzIxIl19LCJpYXQiOiIxNzEwMTY5MzQ1Iiwib3JpZyI6eyJ0biI6IjE1NTU3MzU5MzA5In0sImRpdiI6eyJ0biI6IjE5NTI1NTU5ODc2In19.-0QF6-u6zgAQNoAhdiETuhAu7FuRDzxmFch_cTdhcbeWvUZ60NQXxdPM-JucpOtFaEdn9wnFreAZ_6vZoc_Phg;info=;alg=ES256;ppt=div
```

### Possible Solutions

Because it's fairly straight forward to investigate the JWT, it's not necessary 
to try to account for every possible passport type, etc.  The act of validating 
the signature is the complicated part, so a function that does only that would 
be convenient.

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.7.4 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 12.2.0
```

* **Operating System**:

Currently alpine linux 3.19 in a docker container, but it should be pretty 
reproducible everywhere.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] callout from event_route [tm:local-response] only occurs once (Issue #3064)

2023-12-22 Thread Ben Kaufman via sr-dev
I'll try to get around to this.  It was pretty simple to test if memory serves.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3064#issuecomment-1867686329
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] [kamailio/kamailio] `xavp_params_implode()` drops data from BIGINT datatype (Issue #3663)

2023-12-05 Thread Ben Kaufman via sr-dev
### Description

I came across the following while trying to serialize SQL data to xavp 
(`sql_xquery()`) and then serializing the result to htable using 
`xavp_params_implode()`.  One of the data columns has a type of `BIGINT`.  The 
resulting string had neither the key nor value.

I recognize that Kamailio does not currently have support for 64 bit integers 
and that adding support for it is probably not a trivial matter.  My request 
here is really that if the value is going to be dropped it would be good if 
`pv` would omit a warning.


 Reproduction

MySQL table:

```sql
CREATE TABLE dids (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
did varchar(11) NOT NULL,
route_id BIGINT NOT NULL,
failure_route_id INT NOT NULL,
description VARCHAR(255)
);
```

With data like this:
```sql
INSERT INTO dids
 ( did,route_id, failure_route_id, description ) VALUES
 ( '1551000',101, 1006, 'Alice' );
```

And the following Kamailio code:
```
$var(query) = "SELECT * "
   + "FROM dids "
   + "WHERE did = " + $(rU{sql.val.str});

sql_xquery("db", "$var(query)", "did_data");
xavp_params_implode("did_data", "$sht(did=>$rU)");
xinfo("Serialized query result: [$sht(did=>$rU)]\n");
```
The following log line results - the `route_id` is missing all together:
```
1(7) INFO: 

[sr-dev] Re: [kamailio/kamailio] Add function `secsipid_sign_privkey` to SECSIPID module (Issue #3620)

2023-10-30 Thread Ben Kaufman via sr-dev
Thank you. I think I'll be able to test tomorrow. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3620#issuecomment-1786078674
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] [kamailio/kamailio] Add function `secsipid_sign_privkey` to SECSIPID module (Issue #3620)

2023-10-27 Thread Ben Kaufman via sr-dev
### Description

Add a function `secsipid_sign_privkey(sheaders, spaypload, keyData)` that 
accepts a pseudovariable with the PEM data analagous to the difference between 
the following functions:

- `secsipid_build_identity(origTN, destTN, attest, origID, x5u, keyPath)`
- `secsipid_build_identity_prvkey(origTN, destTN, attest, origID, x5u, keyData)`

With the difference being that ``secsipid_build_identity()` takes a key file as 
it's argument, and ``secsipid_build_identity_privkey()` allows having the key 
data in a pseudovariable. 



-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3620
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] callout from event_route [tm:local-response] only occurs once (Issue #3064)

2023-07-10 Thread Ben Kaufman
This appears to be occurring in 5.6, 5.7, and devel- branch as well.  Simple 
example config:

```
#!KAMAILIO

loadmodule "pv"
loadmodule "tm"
loadmodule "xlog"

route {
xinfo("[$rm $ci-$cs] Src:[$si:$sp] RURI:[$ru] To:[$tu] From:[$fu]\n");

t_send_reply("404", "Not Found");
exit;
}

event_route[tm:local-response] {
xcrit("[$rm $ci-$cs] tm:local-response replied locally\n");
}
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3064#issuecomment-1629203660
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Permissions module `reload_delta` is not scoped to individual tables. (Issue #3318)

2023-01-05 Thread Ben Kaufman
Thank you.  I'll try to create a testing situation around this. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3318#issuecomment-1372373543
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Permissions module `reload_delta` is not scoped to individual tables. (Issue #3318)

2022-12-28 Thread Ben Kaufman
I'm calling them separately because there's no function to call them together. 
;)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3318#issuecomment-1366809182
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] [kamailio/kamailio] Permissions module `reload_delta` is not scoped to individual tables. (Issue #3318)

2022-12-28 Thread Ben Kaufman
### Description

The permissions module has two reload RPC commands, `permissions.addressReload` 
which reloads the `address` table, and `permissions.trustedReload`, which 
reloads the `trusted` table.

The module parameter `reload_delta` exists to prevent concurrent reloading of a 
single table:
> # 3.25. reload_delta (int)
> The number of seconds that have to be waited before executing a new RPC 
> reload. By default there is a rate limiting of maximum one reload in five 
> seconds.
> 
> If set to 0, no rate limit is configured. Note carefully: use this 
> configuration only in tests environments because executing two RPC reloads of 
> the same table at the same time can cause to kamailio to crash.

If one of the reload rpc commands is issues (i.e. `permissions.addressReload`), 
then the OTHER reload command (`permissions.trustedReload`) will be blocked, 
despite acting against two separate tables.


### Troubleshooting

Reproduced the issue.

 Reproduction

_(DB config for permissions module omitted for brevity)_
```
loadmodule "rtimer.so"
loadmodule "permissions.so"
loadmodule "jsonrpcs"

modparamx("rtimer", "timer", "name=permissions_reload;mode=0;interval=300")
modparam("rtimer", "exec", "timer=permissions_reload;route=RELOAD_PERMISSIONS")


route[RELOAD_PERMISSIONS] {
xnotice("Reloading trusted records\n");
jsonrpc_exec('{"jsonrpc": "2.0", "method": "permissions.trustedReload", 
"id": 1}');
xalert("jsonrpc response code: $jsonrpl(code) - the body is: 
$jsonrpl(body)\n");

xnotice("Reloading addresses\n");
jsonrpc_exec('{"jsonrpc": "2.0", "method": "permissions.addressReload", 
"id": 1}');
xalert("jsonrpc response code: $jsonrpl(code) - the body is: 
$jsonrpl(body)\n");

}
```

 Debugging Data

The above config yields output like this:

```
2(8) NOTICE: 

Re: [sr-dev] [kamailio/kamailio] APKBUILD: remove python2 references (PR #3258)

2022-10-11 Thread Ben Kaufman
> The Alpine automatic build does not work now. Required refactoring after 
> Docker Hub closed the CI-builds on the free accounts. A thing required to 
> write an automatic Alpine build using GitHub actions.
> 
> Let's write alpine automatic builds during the next mouth. If this does not 
> happen, then we can merge.

A few follow up questions on that:

1. Just so I understand correctly:  You're referencing the apk binaries that 
get push to the official Alpine Linux repos, correct?  Are you handling this / 
is any assistance, etc. needed?
2. This issue will probably need to be addressed first (or at least in 
conjunction) since even if your CI code was correct, build will fail due to 
inability to provide the depenancies, right?

With that said, this is far from a critical issue, so i see no reason to rush 
it either.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3258#issuecomment-1274745327
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] APKBUILD: remove python2 references (PR #3258)

2022-10-09 Thread Ben Kaufman
 Pre-Submission Checklist
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, 
...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook 
files
in `doc/` subfolder, the README file is autogenerated)

 Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

 Checklist:
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #3257

 Description
Do not build python2 module with default APKBUILD file due to python2 being 
sunsetted within Alpine Linux (there is no python2 APK).

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3258

-- Commit Summary --

  * APKBUILD: remove python2 references

-- File Changes --

M pkg/kamailio/alpine/APKBUILD (12)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/3258.patch
https://github.com/kamailio/kamailio/pull/3258.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3258
You are receiving this because you are subscribed to this thread.

Message ID: kamailio/kamailio/pull/3...@github.com
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] Building Alpine APKs fail due to sunsetting of Python2 (Issue #3257)

2022-10-09 Thread Ben Kaufman
### Description

Issues building `PYTHON` module on Alpine Linux due to [sunsetting of 
Python2](https://www.python.org/doc/sunset-python-2/).  The `python2` package 
(apk) has been removed from the current Alpine linux.  The APKBUILD file in the 
current Kamailio branches includes build settings for installing the Python 
(python2) module.  While I'm guessing it's possible to build python2 in the 
current Alpine container it was a conscious decision to no longer have a 
package for it.  Given this, what is the opinion about not building this by 
default within the APKBUILD file?


### Troubleshooting

Running `abuild -r` fails due to lack of python2 libraries.

 Reproduction

Running `abuild -r` fails due to lack of python2 libraries.

 Debugging Data

N/A

 Log Messages

N/A

 SIP Traffic
N/A


### Possible Solutions

In `APKBUILD`  remove references to `python2` and  `python` (but not 
`python3`).  I'll submit a pull request to do this.

### Additional Information

Kamailio 5.7 

* **Operating System**:

Alpine Linux  latest


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3257
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Failed to find command uac_auth (params 1) (#2672)

2021-03-11 Thread Ben Kaufman
It's the same result with a double quoted "1".

`if (uac_auth("1")) {`

 The error message looks like it can't find the command with this signature.
```
 0(24044) ERROR:  [core/cfg.y:3536]: yyparse(): cfg. parser: failed to 
find command uac_auth (params 1)
 0(24044) CRITICAL:  [core/cfg.y:3677]: yyerror_at(): parse error in 
config file /etc/kamailio/kamailio.cfg, line 30, column 21: unknown command, 
missing loadmodule?
```

This is testing in 5.5.0-dev4 from the Debian repository.


```version: kamailio 5.5.0-dev4 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, 
DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, 
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 8.3.0
```



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2672#issuecomment-796870256___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] Failed to find command uac_auth (params 1) (#2672)

2021-03-11 Thread Ben Kaufman
### Description

According to the documentation for the UAC module, the `uac_reg` command can 
accept an optional argument to use the pre-calculated HA1 format:

```
4.7.  uac_auth([mode])
This function can be called only from failure route and will build the 
authentication response header and insert it into the request without sending 
anything.

If mode is set to 1, then the password has to be provided in HA1 format. The 
parameter can be a static integer or a variable holding an integer value
```

However, when I attempt to use this in my configuration file, Kamailio fails to 
start.

### Troubleshooting

 Reproduction

The problem is reproducible in the 5.4, 5.4-nightly, and dev-nightly debian 
packages with the following config file:

```
#!KAMAILIO

loadmodule "tm"
loadmodule "sl"
loadmodule "pv"
loadmodule "uac"
loadmodule "rr"

modparam("uac","auth_username_avp","$avp(auser)")
modparam("uac","auth_password_avp","$avp(apass)")
modparam("uac","auth_realm_avp","$avp(arealm)")



request_route {

if( $rm == "INVITE" ) {
t_on_failure("TRUNKAUTH");
}

t_relay();
}

failure_route[TRUNKAUTH] {

$avp(auser)  = "user";
$avp(arealm) = "realm";
$avp(apass)  = "password";

if (uac_auth(1)) {
t_relay();
}
exit;
}
```

A check on syntax file syntax gives an error of:

```
$ sudo kamailio -eEc

 0(18427) ERROR:  [core/cfg.y:3451]: yyparse(): cfg. parser: failed to 
find command uac_auth (params 1)
 0(18427) CRITICAL:  [core/cfg.y:3592]: yyerror_at(): parse error in 
config file /etc/kamailio/kamailio.cfg, line 30, column 19: unknown command, 
missing loadmodule?

ERROR: bad config file (1 errors)
```

No failures are observed if the parameter is removed from line 30.  Changed 
from `if (uac_auth(1)) {` to `if (uac_auth()) {`.



### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.4.4 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, 
DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, 
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 8.3.0
```

* **Operating System**:



```
Linux aarenet-sipdir2 4.19.0-14-cloud-amd64 #1 SMP Debian 4.19.171-2 
(2021-01-30) x86_64 GNU/Linux
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2672___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] CSeq fails to increment on CANCEL in v5.4.3 (#2637)

2021-02-14 Thread Ben Kaufman
Config, Log, and SIP messaging attached.  The config file is simplified as much 
as I could for the purpose of reproducing this issue.


[kamailio_5.4.3.log](https://github.com/kamailio/kamailio/files/5978808/kamailio_5.4.3.log)

[SIP_Messages_noCseqIncrementOnCancel.txt](https://github.com/kamailio/kamailio/files/5978805/SIP_Messages_noCseqIncrementOnCancel.txt)

[kamailio.cfg.txt](https://github.com/kamailio/kamailio/files/5978811/kamailio.cfg.txt)


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2637#issuecomment-778865903___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] CSeq fails to increment on CANCEL in v5.4.3 (#2637)

2021-02-14 Thread Ben Kaufman
### Description

CSeq fails to increment on CANCEL in v5.4.3.  Possible regression of problem 
fixed in issue #918.  Not reproducible in v5.3.8, nor in v5.5 nightly debian 
package.

_Note:  I have another (production) system running v.5.4.1 that does not 
exhibit this behavior, so it's possible it broke in 5.4.2 or 5.4.3 
specifically._
 
### Troubleshooting

Compared behavior of 5.4.3 with 5.3.8 and 5.5 nightly Debian packages.

 Reproduction:
Using `track_cseq_updates` parameter in the Dialog module, the CSeq offset 
should be automatically tracked if the UAC module is performing authentication.


 Log Messages

Provided as attachment.

 SIP Traffic

Full SIP Dialog will be provided as attachment, but here is the call ladder 
from  v5.4.3 illustrating that the Cseq in Frames 12, 14, 15, and 16 do not 
increment downstream after authentication.  They should match the Cseq from the 
re-INVITE in frame 7.  In v5.3.8 and v5.5-nightly, using the same configuration 
file the Cseq in frame 12 is 2, matching the Cseq in the re-INVITE, and the 
downstream party then recognizes the transaction and responds to the cancel.
```
213.173.185.50:5060 10.0.0.4:5060   65.254.44.194:5060
─┬─   ─┬   ──┬─
#1   │INVITE (SDP) Cseq:1  │ │ 
 │ ──> │ │ 
#2   │  100 trying -- your call is │ │ 
 │ <── │ │ 
#3   │ │INVITE (SDP) Cseq:1  │ 
 │ │ ──> │ 
#4   │ │ 100 Trying  │ 
 │ │ <── │ 
#5   │ │  407 Proxy Authentication R │ 
 │ │ <── │ 
#6   │ │ ACK │ 
 │ │ ──> │ 
#7   │ │INVITE (SDP) Cseq:2  │ 
 │ │ ──> │ 
#8   │ │ 100 Trying  │ 
 │ │ <── │ 
#9   │ │  183 Session Progress (SDP) │ 
 │ │ <── │ 
#10  │  183 Session Progress (SDP) │ │ 
 │ <── │ │ 
#11  │   CANCEL Cseq:1 │ │ 
 │ ──> │ │ 
#12  │ │   CANCEL  Cseq:1│ 
 │ │ ──> │ 
#13  │200 canceling│ │ 
 │ <── │ │ 
#14  │ │   CANCEL  Cseq:1│ 
 │ │ >>> │ 
#15  │ │   CANCEL  Cseq:1│ 
 │ │ >>> │ 
#16  │ │   CANCEL  Cseq:1│ 
 │ │ >>> │ 

```

### Possible Solutions

This matches the description from issue #918.


### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.4.3 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, 
DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, 
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 8.3.0
```

* **Operating System**:



uname -a :
```
Linux aarenet-sipdir1 4.19.0-13-cloud-amd64 #1 SMP Debian 4.19.160-2 
(2020-11-28) x86_64 GNU/Linux
```

lsb_release -a:
```
No LSB modules are available.
Distributor ID: Debian
Description:Debian GNU/Linux 10 (buster)
Release:10
Codename:   buster
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2637___

Re: [sr-dev] [kamailio/kamailio] alias_db_lookup is returning `-1` if result is not found. Documentation implies it should return false. (#2517)

2020-10-19 Thread Ben Kaufman
Closed #2517.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2517#event-3895127332___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] alias_db_lookup is returning `-1` if result is not found. Documentation implies it should return false. (#2517)

2020-10-19 Thread Ben Kaufman
Thank you for the clarification.  I think that's enough to close the ticket.  
It's not "as *I* expect,"  but it's easier to change my expectations to the 
existing behavior than to expect the world to revolve around me.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2517#issuecomment-712388384___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] alias_db_lookup is returning `-1` if result is not found. Documentation implies it should return false. (#2517)

2020-10-19 Thread Ben Kaufman
Is my problem with the use of the negation operator?  Or should I be calling 
the function in the condition instead of assigning to a variable and then 
evaluating the variable?

```
$vn(alias_found) = alias_db_lookup("DbAliases");
if ( !$vn(alias_found) ) {
## I would expect this to execute if no alias is found.
   return;
}
## I would expect to reach here if the alias is found.
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2517#issuecomment-712372979___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] alias_db_lookup is returning `-1` if result is not found. Documentation implies it should return false. (#2517)

2020-10-19 Thread Ben Kaufman

### Description

alias_db_lookup is returning `-1` if result is not found.  The documentation 
says "The function returns TRUE if R-URI is alias and it was replaced by user's 
SIP uri."  The implication is that it should return FALSE if that is not the 
case.  Sample code:

```
$vn(init_ruri)   = $ru;
$vn(alias_found) = alias_db_lookup("DbAliases");
xlogl("L_NOTIFY", "$$vn(alias_found) is [$vn(alias_found)]\n");
if ( !$vn(alias_found) ) {
xlogl("L_NOTIFY", "No alias found for [$vn(init_ruri)]\n");
return;
}

xlogl("L_NOTIFY", "Found alias [$ru] for [$vn(init_ruri)]\n");
```

The value for $vn(alias_found) is -1 if there is no alias, and thus the  
condition never occurs. "Found alias" line always occurs, even if there is no 
record in the DB.

I think this should probably be considered a documentation issue, but I'm not 
sure what the other possible values are for return and their meanings.  Maybe 
there's a different value if an alias is found but not updated, etc?

### Troubleshooting

Example above

 Reproduction

Example above.

 Debugging Data

Not applicable

 Log Messages

N/A

 SIP Traffic

N/A

### Possible Solutions

Probably best to update documentation.  The statement,  "The function returns 
TRUE if R-URI is alias and it was replaced by user's SIP uri." implies that if 
that does not happen, then the return would be FALSE. 

### Additional Information

`5.4.1`

* **Operating System**:

Debian 10


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2517___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] Issue 2477 - Minor doc changes to Registrar module (#2478)

2020-09-15 Thread Ben Kaufman
 Pre-Submission Checklist
!-- Go over all points below, and after creating the PR, tick all the 
checkboxes that apply --
!-- All points should be verified, otherwise, read the CONTRIBUTING 
guidelines from above--
!-- If youre unsure about any of these, dont hesitate to ask on 
sr-dev mailing list --
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, 
...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook 
files
in `doc/` subfolder, the README file is autogenerated)

 Type Of Change
- [X] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

 Checklist:
!-- Go over all points below, and after creating the PR, tick the 
checkboxes that apply --
- [X] PR should be backported to stable branches
- [X] Tested changes locally
- [X] Related to issue #2477 

 Description
Minor doc changes to Registrar module as described in Issue #2477 

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/2478

-- Commit Summary --

  * registrar:  Update documentation
  * registrar:  Update documentation

-- File Changes --

M src/modules/registrar/doc/registrar_admin.xml (14)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/2478.patch
https://github.com/kamailio/kamailio/pull/2478.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2478
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] Minor doc changes to Registrar module (#2477)

2020-09-15 Thread Ben Kaufman


### Description

Use of acronym "HF" (header field) in the REGISTRAR is a bit obscure.  It 
probably makes sense to experienced Kamailio admins, but it's not immediately 
apparent to beginners.  Since there is little gained by using the acronym in 
this document it would be more friendly to use "header field".

Also, there is a double negative in section 4.1/flags/0x01:

```
0x01 - save the contacts only in memory cache without no DB operation;
```

The literal meaning of this sentence is that it performs a DB operation. This 
should be changed to  "with no" or possibly just "without", or even "with no".

### Expected behavior

Use 'header field' instead of 'HF'.  Use "with" instead of "without no".

 Actual observed behavior

As indicated above

 Debugging Data

Not applicable

 Log Messages

Not applicable


 SIP Traffic

Not applicable

### Possible Solutions

Use 'header field' instead of 'HF'.  Use "with" instead of "without no".

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

Exists in most recent code branch.

* **Operating System**:

Not applicable.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2477___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] DB_UNIXODBC always changes language and context (#1993)

2019-07-03 Thread Ben Kaufman
**tl;dr:**  This is a minor bug report for Kamailio, and regarding access to 
SQL Azure, I'd be happy to finance an Azure SQL database for testing if desired.



The issue is about _assumed_ behavior within the DB_UNIXODBC module.

The behavior in Azure SQL that is atypical, because trying to issue a ```USE``` 
query gives the following error:

```
USE statement is not supported to switch between databases. Use a new 
connection to connect to a different database.
```

I think @nakchak may be using an Azure SQL Server (managed instance) vs an 
Azure SQL Database (single database).  Here's my attempt and error trying to 
assign a default DB to a login in my Azure database:

Query:
```
Alter login kamailioRoTest  with default_database = ops-qa-sqldir1
```
Error:
```
Keyword or statement option 'default_database' is not supported in this version 
of SQL Server.
```


>From a purely functional standpoint (i.e. to get Kamailio **working** with the 
>Azure DB), the solution is to specify the database in the connection string 
>(see the ODBC.ini example in my original post).  The request is to have an 
>option to just have the module use the default DB from the connection and not 
>attempt to change to the DB once connected.  

Think of it like the following if using MySQL:

```
bash > mysql -D kamailio
mysql > USE kamailoio;
```

The second line is superfluous (but not problematic).  


For DB_UNIXODBC, setting the DB in the ODBC string WORKS currently.  It just 
clutters the log with errors. Thus, the bug report is not critical.





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1993#issuecomment-508170051___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] DB_UNIXODBC always changes language and context (#1993)

2019-06-26 Thread Ben Kaufman
I'm able to connect, the bug report here is more about the errors being written 
to the kamailio log.  

I'm also experiencing hangs, and hadn't considered that this could be from the 
ODBC connection, so I'll look into this. 

You indicate that you're working around this by proxying your query through a 
separate application, so I'm guessing that you're not using the Azure DB as the 
back end for other modules?  For example, I'm using azure as the back end for 
the UAC and db_alias modules, where db connectivity is set in modparams.  I'm 
not sure how I could push that through an external application.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1993#issuecomment-505856110___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] DB_UNIXODBC always changes language and context (#1993)

2019-06-25 Thread Ben Kaufman
### Description

Using DB_UNIXODBC with an Azure SQL database works, however when starting 
Kamailio, errors are shown for :

```
26(80403) ERROR: db_unixodbc [connection.c:219]: db_unixodbc_extract_error(): 
unixodbc:SQLDriverConnect=01000:3:5701:[Microsoft][ODBC Driver 17 for SQL 
Server][SQL Server]Changed database context to 'database-name'.
ERROR: db_unixodbc [connection.c:219]: db_unixodbc_extract_error(): 
unixodbc:SQLDriverConnect=01000:2:5703:[unixODBC][Microsoft][ODBC Driver 17 for 
SQL Server][SQL Server]Changed language setting to us_english.
```

Regarding changing the DB context, the database to be used is defined in my 
```odbc.ini``` file

```
[dsnName]
Driver=ODBC Driver 17 for SQL Server
Description=Azure MS SQL Server
Trace=No
Server=tcp:azure-sql-server-name.database.windows.net,1433
Encrypt=yes
TrustServerCertificate=no
Connection Timeout=30
Database=databaseName
```

I'm not able to `USE databaseName` when connecting to an Azure DB.  The default 
language is already US-English, and i'm guessing it's also Azure specific that 
it cannot be changed?

### Troubleshooting

I'm not sure what troubleshooting can be done with this.  The DB connection 
works, it's just these commands that fail, but since the result is already 
correct, it doesn't seem to functionally matter, aside from the errors being 
thrown.

 Reproduction

This can be reproduced using an Azure SQL database.  Create a single database 
and a dedicated user (with db_owner membership), and configure the ODBC 
connection as above.

 Debugging Data

I'm not sure any additional debugging information is available.  I'm happy to 
provide anything specific requested.



 Log Messages



```
26(80403) ERROR: db_unixodbc [connection.c:219]: db_unixodbc_extract_error(): 
unixodbc:SQLDriverConnect=01000:3:5701:[Microsoft][ODBC Driver 17 for SQL 
Server][SQL Server]Changed database context to 'database-name'.
ERROR: db_unixodbc [connection.c:219]: db_unixodbc_extract_error(): 
unixodbc:SQLDriverConnect=01000:2:5703:[unixODBC][Microsoft][ODBC Driver 17 for 
SQL Server][SQL Server]Changed language setting to us_english.
```


### Possible Solutions

I would suspect that a parameter could be added to the DB_UNIXODBC module to 
make each of these behaviors (changing database and changing language) 
optional.  Default config would retain the existing behavior, so it's just an 
override if desired.

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.1.8 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 6.3.0
```

* **Operating System**:

```
Debian Stretch:
4.19.0-0.bpo.4-cloud-amd64 #1 SMP Debian 4.19.28-2~bpo9+1 (2019-03-27) x86_64 
GNU/Linux
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1993___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev