Module: kamailio
Branch: 5.7
Commit: c5ed0e65b2530443b1367986dac2b3da111c0701
URL: https://github.com/kamailio/kamailio/commit/c5ed0e65b2530443b1367986dac2b3d…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-01-11T08:04:58+08:00
tls: historical code comment on repeating SSL_CTX per worker
(cherry-pick from 29007ada5bc9e07ede3cdbce285f04d1298c0612)
---
Modified: src/modules/tls/tls_mod.c
---
Diff: https://github.com/…
[View More]kamailio/kamailio/commit/c5ed0e65b2530443b1367986dac2b3d…
Patch: https://github.com/kamailio/kamailio/commit/c5ed0e65b2530443b1367986dac2b3d…
---
diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c
index 7cad1b046e4..beaf1b7b70b 100644
--- a/src/modules/tls/tls_mod.c
+++ b/src/modules/tls/tls_mod.c
@@ -433,6 +433,16 @@ static int tls_engine_init();
int tls_fix_engine_keys(tls_domains_cfg_t *, tls_domain_t *, tls_domain_t *);
#endif
+/*
+ * OpenSSL 1.1.1+: SSL_CTX is repeated in each worker
+ *
+ * OpenSSL RSA blinding works in single-process multi-threaded mode
+ * and depends on pthread_self() to separate threads. In Kamailio multi-process workers
+ * pthread_self() will not necessarily be unique, this will result in incorrect BN
+ * operations���hence we create a separate SSL_CTX for each worker
+ *
+ * EC operations do not use pthread_self(), so could use shared SSL_CTX
+ */
static int mod_child(int rank)
{
if(tls_disable || (tls_domains_cfg == 0))
[View Less]
Module: kamailio
Branch: master
Commit: 29007ada5bc9e07ede3cdbce285f04d1298c0612
URL: https://github.com/kamailio/kamailio/commit/29007ada5bc9e07ede3cdbce285f04d…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-01-11T08:03:07+08:00
tls: historical code comment on repeating SSL_CTX per worker
---
Modified: src/modules/tls/tls_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/29007ada5bc9e07ede3cdbce285f04d……
[View More]Patch: https://github.com/kamailio/kamailio/commit/29007ada5bc9e07ede3cdbce285f04d…
---
diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c
index 7cad1b046e4..beaf1b7b70b 100644
--- a/src/modules/tls/tls_mod.c
+++ b/src/modules/tls/tls_mod.c
@@ -433,6 +433,16 @@ static int tls_engine_init();
int tls_fix_engine_keys(tls_domains_cfg_t *, tls_domain_t *, tls_domain_t *);
#endif
+/*
+ * OpenSSL 1.1.1+: SSL_CTX is repeated in each worker
+ *
+ * OpenSSL RSA blinding works in single-process multi-threaded mode
+ * and depends on pthread_self() to separate threads. In Kamailio multi-process workers
+ * pthread_self() will not necessarily be unique, this will result in incorrect BN
+ * operations���hence we create a separate SSL_CTX for each worker
+ *
+ * EC operations do not use pthread_self(), so could use shared SSL_CTX
+ */
static int mod_child(int rank)
{
if(tls_disable || (tls_domains_cfg == 0))
[View Less]
Module: kamailio
Branch: master
Commit: bbb81e5f6ef5744cc9b74302e8ecee6687199872
URL: https://github.com/kamailio/kamailio/commit/bbb81e5f6ef5744cc9b74302e8ecee6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-01-10T13:20:34+01:00
usrloc: docs for ka_randomize parameter
---
Modified: src/modules/usrloc/doc/usrloc_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/…
[View More]bbb81e5f6ef5744cc9b74302e8ecee6…
Patch: https://github.com/kamailio/kamailio/commit/bbb81e5f6ef5744cc9b74302e8ecee6…
---
diff --git a/src/modules/usrloc/doc/usrloc_admin.xml b/src/modules/usrloc/doc/usrloc_admin.xml
index 77b18989b4b..d7d78ae7b00 100644
--- a/src/modules/usrloc/doc/usrloc_admin.xml
+++ b/src/modules/usrloc/doc/usrloc_admin.xml
@@ -1481,6 +1481,31 @@ modparam("usrloc", "ka_interval", 30)
</example>
</section>
+ <section id="usrloc.p.ka_randomize">
+ <title><varname>ka_randomize</varname> (int)</title>
+ <para>
+ The parameter sets the the upper limit to the range of random seconds
+ to be added to ka_interval before checking if a new keepalive request
+ has to be sent. It should help to distribute better the sending of
+ keepalive requests. The keepalive for a location record is going to be
+ sent in a random fashion between (ka_interval + 0) and
+ (ka_interval + ka_randomize).
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>20</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>ka_randomize</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("usrloc", "ka_interval", 30)
+...
+</programlisting>
+ </example>
+ </section>
+
<section id="usrloc.p.ka_loglevel">
<title><varname>ka_loglevel</varname> (int)</title>
<para>
[View Less]
#### Pre-Submission Checklist
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] 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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature …
[View More](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 -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
This is the selectors feature for `lost` module.
The module still in development but the core functionality is working.
What need to do
1. separate feature into dedicated `.c` file;
2. rebase on current `lost` implementation;
3. add documentation;
4. add a unit test.
Would be fine if we can merge this into 5.5.
This branch based on e7d68556e3560f488c4f421731f78b3f9abe549e commit
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2705
-- Commit Summary --
* http_client: http_client_request (api) content-type header support
* lost: new features, attributes and a new function to dereference location
* lost: bug-fix due to a code formatting error
* lost: DOM level count fix
* http_client: duplicated code removed
* lost: README update
* lost: memory leak fix and code refactoring
* lost: implemented sectors
-- File Changes --
M src/modules/http_client/curl_api.c (1)
M src/modules/http_client/curl_api.h (3)
M src/modules/http_client/functions.c (30)
M src/modules/http_client/functions.h (14)
M src/modules/lost/doc/lost.xml (2)
M src/modules/lost/doc/lost_admin.xml (172)
M src/modules/lost/functions.c (921)
M src/modules/lost/functions.h (3)
M src/modules/lost/lost.c (754)
A src/modules/lost/naptr.c (255)
A src/modules/lost/naptr.h (38)
M src/modules/lost/pidf.c (5)
A src/modules/lost/response.c (991)
A src/modules/lost/response.h (131)
M src/modules/lost/utilities.c (532)
M src/modules/lost/utilities.h (65)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2705.patchhttps://github.com/kamailio/kamailio/pull/2705.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/2705
[View Less]
### Description
I've cloned Kamailio and tried to build with `make all` commands and the error below appeared:
```
module not found: modules/app_sqlang
make[1]: *** [Makefile:508: modules] Error 1
make[1]: Leaving directory '/usr/local/src/kamailio-devel/kamailio/src'
make: *** [Makefile:34: all] Error 2
```
the error wasn't occured before [9bb1976 "Makefile.groups: removed app_sqlang from modules list"](https://github.com/kamailio/kamailio/commit/9bb1976b4b7d52542a4de37144194bfc24649222) and …
[View More]just appered after pulling new commits.
### Troubleshooting
I could solve the issue by set `app_sqlang` as skip_modules or exclude_modules, it's also possible solve it by set in
```
make skip_modules="app_sqlang" cfg
```
* **Ubuntu 22.04**
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3705
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3705(a)github.com>
[View Less]
### Description
Using sip_trace() with different address arguments:
```
modparam("siptrace", "duplicate_uri", "sip:X.X.X.X:9060")
# siptrace till Homer
if(method == "REGISTER"){
sip_trace("sip:X.X.X.X:9060", "", "t");
}
# siptrace till Voipmonitor
if (is_method("INVITE|BYE|UPDATE|CANCEL")) {
sip_trace("sip:Y.Y.Y.Y:9060", "", "t");
}
```
Will send replies from auth_challenge to the address defined in duplicate_uri. So in the case above - no 407 are sent to "sip:Y.Y.Y.Y:9060", instead the …
[View More]are sent to "sip:X.X.X.X:9060" when challenging an Invite.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.6.5 (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
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3700
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3700(a)github.com>
[View Less]
Hello. I am trying to install Kamailio branch devel for using Volte on open5gs.
when compiled have this error:
gcrypt_mod.c:36:10: fatal error: gcrypt.h: No such file or directory
36 | #include <gcrypt.h>
| ^~~~~~~~~~
compilation terminated.
make[2]: *** [../../Makefile.rules:100: gcrypt_mod.o] Error 1
make[2]: Leaving directory '/usr/local/src/kamailio-devel/kamailio/src/modules/gcrypt'
make[1]: *** [Makefile:508: modules] Error 1
make[1]: Leaving directory '/usr/local/…
[View More]src/kamailio-devel/kamailio/src'
make: *** [Makefile:34: all] Error 2
I have installed the dependencies of crypt : libcrypto and libssl-dev.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3704
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3704(a)github.com>
[View Less]
Hello.
I have tried to install VoLTE Setup with Kamailio IMS on Ubuntu 22.04. but I face two errors:
1) IPsec-tools packages not supported for Ubuntu 22.04.
2) when I tried to compile Kamailio the cdp modules were not compiled and showed this error:
make[2]: Entering directory '/usr/local/src/kamailio/src/modules/cdp'
Makefile.defs defs skipped
gcc -shared -Wl,-O2 -Wl,-E -pthread -rdynamic -ldl -Wl,-Bsymbolic-functions acceptor.o acctstatemachine.o api_process.o authstatemachine.o …
[View More]cdp_functions.o cdp_load.o cdp_mod.o cdp_rpc.o cdp_stats.o common.o config.o configparser.o diameter_avp.o diameter_comm.o diameter_msg.o diameter_peer.o globals.o peer.o peermanager.o peerstatemachine.o receiver.o routing.o session.o tcp_accept.o timer.o transaction.o worker.o -lxml2 -lrt -lpthread -o cdp.so
/usr/bin/ld: cdp_mod.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: multiple definition of `dp_first_pid'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: first defined here
/usr/bin/ld: cdp_mod.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: multiple definition of `pid_list'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: first defined here
/usr/bin/ld: cdp_mod.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: multiple definition of `pid_list_lock'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: first defined here
/usr/bin/ld: diameter_peer.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: multiple definition of `dp_first_pid'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: first defined here
/usr/bin/ld: diameter_peer.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: multiple definition of `pid_list'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: first defined here
/usr/bin/ld: diameter_peer.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: multiple definition of `pid_list_lock'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: first defined here
/usr/bin/ld: receiver.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: multiple definition of `dp_first_pid'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: first defined here
/usr/bin/ld: receiver.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: multiple definition of `pid_list'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: first defined here
/usr/bin/ld: receiver.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: multiple definition of `pid_list_lock'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: first defined here
/usr/bin/ld: timer.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: multiple definition of `dp_first_pid'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: first defined here
/usr/bin/ld: timer.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: multiple definition of `pid_list'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: first defined here
/usr/bin/ld: timer.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: multiple definition of `pid_list_lock'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: first defined here
/usr/bin/ld: worker.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: multiple definition of `dp_first_pid'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:68: first defined here
/usr/bin/ld: worker.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: multiple definition of `pid_list'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:70: first defined here
/usr/bin/ld: worker.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: multiple definition of `pid_list_lock'; acceptor.o:/usr/local/src/kamailio/src/modules/cdp/diameter_peer.h:71: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [../../Makefile.rules:191: cdp.so] Error 1
make[2]: Leaving directory '/usr/local/src/kamailio/src/modules/cdp'
make[1]: *** [Makefile:511: modules] Error 1
make[1]: Leaving directory '/usr/local/src/kamailio/src'
make: *** [Makefile:34: all] Error 2
How can I solve it?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3701
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3701(a)github.com>
[View Less]
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/…
[View More]lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
I have 2 jsonrpc servers configured with different prio's. For testing, I have the servers configured to always delay the response to any request by more than the module's timout setting.
The (initial) request is sent to the first server. As this one times out, I would expect a retry to go to the second servers, but instead, all retries are sent to the same server. The backup server is never contacted. This makes the whole "prio" system seem a bit useless.
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
```
modparam("janssonrpcc", "server", "conn=test;addr=pc1;port=8081;priority=5;weight=10")
modparam("janssonrpcc", "server", "conn=test;addr=pc1;port=8082;priority=5;weight=10")
```
```
janssonrpc_request("test", "Test.Timeout", '[ { "Timout": 1000} ]', "route=JSONRPC_RESPONSE;retry=10;timeout=1000");
```
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### Log Messages
No useful logs are produced. I verified the described behavior on the jsonrpc server.
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
2023-02-23T16:59:34.585346+01:00 pc1 proxy1[340870]: INFO: janssonrpcc [janssonrpc_connect.c:361]: bev_connect(): Connecting to server pc1:8081 for conn rating.
2023-02-23T16:59:34.585420+01:00 pc1 proxy1[340870]: INFO: janssonrpcc [janssonrpc_connect.c:361]: bev_connect(): Connecting to server pc1:8082 for conn rating.
2023-02-23T16:59:34.585446+01:00 pc1 proxy1[340870]: INFO: janssonrpcc [janssonrpc_connect.c:290]: bev_connect_cb(): Connected to host pc1:8081
2023-02-23T16:59:34.585462+01:00 pc1 proxy1[340870]: INFO: janssonrpcc [janssonrpc_connect.c:290]: bev_connect_cb(): Connected to host pc1:8082
2023-02-23T17:05:10.903398+01:00 pc1 proxy1[340870]: WARNING: janssonrpcc [janssonrpc_request.c:247]: schedule_retry(): Number of retries exceeded. Failing request.
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
Retry in combination with a timeout and prio's is a bit tricky. When do what? Just retrying on the first prio makes the lower prio servers completely useless, while going to the next prio on every retry skips possibly useful high-prio servers and may exhaust the number of candidate servers very fast.
Best solution IMHO would be to first try every server in the highest prio, before going to the next prio. Do not do (exponential) backoff between these steps.
If there are still retries remaining after that, wrap around to the highest prio with the exponentional backoff delay.
With the above, failover considers all servers and failover between servers is fast while not overloading a single server.
BTW. If I configure multiple servers per prio, it seems to randomly select one of them for every (re)try. It never selects one form the next prio.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
5.6.1
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
(paste your output here)
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3378
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3378(a)github.com>
[View Less]
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, …
[View More]tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### 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 you're unsure about any of these, don't 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
- [ ] 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 -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #3653
#### Description
<!-- Describe your changes in detail -->
- Contacts are now added at the end of the list.
- hfl(Contact)[index] is now returning in the correct order.
Currently, if a sip message contains multiple Contacts or just 2, let's say
```
Contact: <sip:bob0@example.com>;expires=3600,<sip:bob1@example.com>;expires=3600,<sip:bob2@example.com>;expires=3600
Contact: <sip:bob3@example.com>;expires=3600,<sip:bob4@example.com>;expires=3600,<sip:bob5@example.com>;expires=3600
```
contacts are stored in the reversed order, ie bob2, bob1,bob0 and bob5,bob4,bob3.
This can be seen with a simple config file such as:
```
#kamailio.cfg
...
request_route {
...
xlog("L_INFO", "Contact headers: $hfl(Contact)\n");
xlog("L_INFO", "Contact headers 0: $(hfl(Contact)[0])\n");
xlog("L_INFO", "Contact headers 1: $(hfl(Contact)[1])\n");
xlog("L_INFO", "Contact headers 2: $(hfl(Contact)[2])\n");
xlog("L_INFO", "Contact headers 3: $(hfl(Contact)[3])\n");
xlog("L_INFO", "Contact headers 4: $(hfl(Contact)[4])\n");
xlog("L_INFO", "Contact headers 5: $(hfl(Contact)[5])\n");
xlog("L_INFO", "Contact headers 6: $(hfl(Contact)[6])\n");
xlog("L_INFO", "Contact headers 7: $(hfl(Contact)[7])\n");
xlog("L_INFO", "Contact headers -1: $(hfl(Contact)[-1])\n");
xlog("L_INFO", "Contact headers -2: $(hfl(Contact)[-2])\n");
xlog("L_INFO", "Contact headers -3: $(hfl(Contact)[-3])\n");
xlog("L_INFO", "Contact headers -4: $(hfl(Contact)[-4])\n");
xlog("L_INFO", "Contact headers -5: $(hfl(Contact)[-5])\n");
xlog("L_INFO", "Contact headers -6: $(hfl(Contact)[-6])\n");
```
that prints in the log all the contacts reversed:
```
Contact headers: <sip:bob2@example.com>;expires=3600
Contact headers 0: <sip:bob2@example.com>;expires=3600
Contact headers 1: <sip:bob1@example.com>;expires=3600
Contact headers 2: <sip:bob0@example.com>;expires=3600
Contact headers 3: <sip:bob5@example.com>;expires=3600
Contact headers 4: <sip:bob4@example.com>;expires=3600
Contact headers 5: <sip:bob3@example.com>;expires=3600
Contact headers 6: <null>
Contact headers 7: <null>
Contact headers -1: <sip:bob3@example.com>;expires=3600
Contact headers -2: <sip:bob4@example.com>;expires=3600
Contact headers -3: <sip:bob5@example.com>;expires=3600
Contact headers -4: <sip:bob0@example.com>;expires=3600
Contact headers -5: <sip:bob1@example.com>;expires=3600
Contact headers -6: <sip:bob2@example.com>;expires=3600
```
This PR fixes and produces:
```
Contact headers: <sip:bob0@example.com>;expires=3600
Contact headers 0: <sip:bob0@example.com>;expires=3600
Contact headers 1: <sip:bob1@example.com>;expires=3600
Contact headers 2: <sip:bob2@example.com>;expires=3600
Contact headers 3: <sip:bob3@example.com>;expires=3600
Contact headers 4: <sip:bob4@example.com>;expires=3600
Contact headers 5: <sip:bob5@example.com>;expires=3600
Contact headers 6: <null>
Contact headers 7: <null>
Contact headers -1: <null>
Contact headers -2: <sip:bob5@example.com>;expires=3600
Contact headers -3: <sip:bob4@example.com>;expires=3600
Contact headers -4: <sip:bob3@example.com>;expires=3600
Contact headers -5: <sip:bob2@example.com>;expires=3600
Contact headers -6: <sip:bob1@example.com>;expires=3600
```
The `contact headers -1: <null>` if fixed via #3697.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3698
-- Commit Summary --
* parser/contact: Change addition order to the end of list
-- File Changes --
M src/core/parser/contact/contact.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3698.patchhttps://github.com/kamailio/kamailio/pull/3698.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3698
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3698(a)github.com>
[View Less]
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/…
[View More]lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
I am working on extending $hfl and $hflc to support some more headers.
During some experimentation, I stumbled into some weird behavior regarding $(hfl(Route)[-1]) and negative indexing of $hfl pseudo-variable (also for Via, Contact).
Per the [docs ](https://www.kamailio.org/wikidocs/cookbooks/devel/pseudovariables/#hflname-header-field-with-list-of-bodies ): -1 index should print the last header found and so on (as stated by $hdr $hfl).
Right now, -1 produces null, and from -2 and onwards it prints correctly from the last one to the first one.
### Troubleshooting
#### Reproduction
```
#kamailio.cfg
...
request_route {
xlog("L_INFO", "Route headers hdr: $hdr(Route)\n");
xlog("L_INFO", "Route headers hfl: $hfl(Route)\n");
xlog("L_INFO", "Route headers count: $hflc(Route)\n");
xlog("L_INFO", "Route headers 0: $(hfl(Route)[0])\n");
xlog("L_INFO", "Route headers 1: $(hfl(Route)[1])\n");
xlog("L_INFO", "Route headers 4: $(hfl(Route)[4])\n");
xlog("L_INFO", "Route headers -1: $(hfl(Route)[-1])\n");
xlog("L_INFO", "Route headers -2: $(hfl(Route)[-2])\n");
xlog("L_INFO", "Route headers -3: $(hfl(Route)[-3])\n");
...
}
```
Seng a SIP message containing Route (but also applicable for VIA, Contact headers):
```
OPTIONS_MSG_2CONTACTS="OPTIONS sip:example.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bK123456789
Max-Forwards: 70
From: <sip:bob@example.com>;tag=123456789
To: <sip:alice@example.com>
Call-ID: 987654321(a)192.168.1.100
CSeq: 1 OPTIONS
Contact: <sip:bob@example.com>;expires=3600,<sip:bob2@example.com>;expires=3600,<sip:bob3@example.com>;expires=3600
Route: <sip:server1.example.com;lr;ftag=1234>, <sip:server2.example.com;lr;ftag=5678>, <sip:server3.example.com;lr;ftag=9012>
Route: <sip:server4.example.com;lr;ftag=1234>, <sip:server5.example.com;lr;ftag=5678>
Content-Length: 0
"
echo -e "$OPTIONS_MSG_2CONTACTS" | nc -u localhost 5060
```
See logs for logging details.
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
INFO: {1 1 OPTIONS 987654321(a)192.168.1.100} <script>: Route headers hdr: <sip:server1.example.com;lr;ftag=1234>, <sip:server2.example.com;lr;ftag=5678>, <sip:server3.example.com;lr;ftag=9012>
INFO: {1 1 OPTIONS 987654321(a)192.168.1.100} <script>: Route headers hfl: <sip:server1.example.com;lr;ftag=1234>
INFO: {1 1 OPTIONS 987654321(a)192.168.1.100} <script>: Route headers count: 5
INFO: {1 1 OPTIONS 987654321(a)192.168.1.100} <script>: Route headers 0: <sip:server1.example.com;lr;ftag=1234>
INFO: {1 1 OPTIONS 987654321(a)192.168.1.100} <script>: Route headers 1: <sip:server2.example.com;lr;ftag=5678>
INFO: {1 1 OPTIONS 987654321(a)192.168.1.100} <script>: Route headers 4: <sip:server5.example.com;lr;ftag=5678>
INFO: {1 1 OPTIONS 987654321(a)192.168.1.100} <script>: Route headers -1: <null>
INFO: {1 1 OPTIONS 987654321(a)192.168.1.100} <script>: Route headers -2: <sip:server5.example.com;lr;ftag=5678>
INFO: {1 1 OPTIONS 987654321(a)192.168.1.100} <script>: Route headers -3: <sip:server4.example.com;lr;ftag=1234>
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
In https://github.com/kamailio/kamailio/blob/e59c4415707f0995a0d5315b5601ae518…, the count should start at 0 ie.
```
n=0; // not n=1;
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
(paste your output here)
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
(paste your output here)
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3653
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3653(a)github.com>
[View Less]
Hello to all.
I have tried to install VoLTE Setup with Kamailio IMS on Ubuntu 18.04 from https://open5gs.org/open5gs/docs/tutorial/02-VoLTE-setup/
in step 16, Install RTPEngine, dpkg-checkbuilddeps have dependencies: libbcg729-dev, which is not in the repository of ubuntu 18.04 to install. How can install it?
dpkg-checkbuilddeps: error: Unmet build dependencies: libbcg729-dev
sudo apt install libbcg729-dev
Reading package lists... Done
Building dependency tree
Reading state information.…
[View More].. Done
E: Unable to locate package libbcg729-dev
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3703
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3703(a)github.com>
[View Less]