### Description
Goal: Build a destination set from multiple contacts gathered from multiple registered AoR.
Situation: assumptions, observations:
* lookup() returns success there are registered contacts for each AoR.
* All contacts have same q value.
* lookup() can only be called for one AoR, there is no way to call it for multiple AoR.
* If lookup() is called multiple times, only the destination set gathered by the last invocation is preserved, all other ones are overwritten.
* t_load_contacts() transfers the destination set into the $xavp(tm_contacts) but like lookup() initializes that
So I am trying to find a way to store/collate all destination sets into one and parallel fork a call to all contacts from multiple AoR.
Idea: Stack all contacts in $xavp(contact_stack) with the same structure as $xavp(tm_contacts) and append it to tm_contacts.
xavp_rm("contact_stack"); # Make sure this is not defined.
We are in a loop setting $var(lookupuri) to (sip:315996608@3cx-pbx.imp.ch and sip:315996608-1@157.161.4.181) {
lookup("location", "$var(lookupuri)");
t_load_contacts(0); # Now $xavp(tm_contacts) is populated
$xavp(contact_stack) = $xavp(tm_contacts); # Store contact set
}
xavp_rm("tm_contacts"); # Re Initialize tm_contacts to empty
$xavp(tm_contacts) = $xavp(contact_stack); # Restore tm_contacts from stacked set.
xlog("L_INFO", "$cfg(route): COUNT: $cnt($xavp(tm_contacts))\n"); # Make sure, the count matches what we expect.
xlog("L_INFO", "$cfg(route): Before t_next_contacts\n");
t_next_contacts(); # Load destination set => CRASH!
xlog("L_INFO", "$cfg(route): After t_next_contacts\n");
Log (some more infos logged I omitted in the example above)
```
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: Auth_aor_user[0] = 315996608
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: Sigprofile[0] = local
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: Lookupuri[0] = sip:315996608@3cx-pbx.imp.ch
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: LOOKUP sip:315996608@3cx-pbx.imp.ch SUCCESS!!!!
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: Auth_aor_user[1] = 315996608-1
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: Sigprofile[1] = local
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: Lookupuri[1] = sip:315996608-1@157.161.4.181
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: LOOKUP sip:315996608-1@157.161.4.181 SUCCESS!!!!
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: ADD to tm_contacts
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: COUNT: 4
Dec 10 16:18:05 dev-cpereg01 kamailio[3964710]: INFO: [1 0618269314 128182546-3942836285-478214563(a)prt-cbl-sbc1.imp.ch 2 INVITE]<script>: LOCATION: Before t_next_contacts
Dec 10 16:18:05 dev-cpereg01 kernel: [13747450.274883] traps: kamailio[3964710] general protection fault ip:55bc00e61f2b sp:7ffce62d7520 error:0 in kamailio[55bc00ba5000+457000]
```
#### Reproduction
Code above with: version: kamailio 5.7.6 (x86_64/linux) from official kamailio repository on ubuntu jammy.
#### Debugging Data
If required, I can try to enable coredumps.
#### Log Messages
Shown above
#### SIP Traffic
Probably not needed.
### Possible Solutions
None yet.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4063
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4063(a)github.com>
Considering that it hasn't been much activity around the internal libraries for long time, I was wondering if it still makes sense to keep them like they are or merge them in the core.
Recently, during the devel meeting, I relocated a couple of them to the archive. The `lib/binrpc` (and `print`) can have the same fate, being not actually used.
The srdb1 is very common and I guess it is very rare the case when a deployment is used without a module not depending on it (e.g., even if dispatcher is used with a list file, the code is still linked to this library).
The `trie` library is small and `ims` is actually a set of getter functions for message attribtues/headers.
The `srdb2` is not used much, but I think the right approach for it is to change the modules using it to `libsrdb1` and get rid of it completely sometime in the future. Till then the code is not big and can reside as part of the core.
The benefits I see are in simplifying the build system (current makefiles and hopefully soon-to-be-merged the one based on cmake), reducing also the time to compute compile and link dependencies; getting rid of packaging complexity (same library may be needed by different modules, which, when packaged separately, the library has to be in a 3rd package, or have dependency of the other module's package -- probably now the libs are shipped with the core package).
The code for libs can stay at the same location, so source code for modules doesn't need to be updated, just that they are compiled with the core, removing internal libs from makefiles.
Thinking that we go for 6.0.x, clarifying the plans for this component and cleaning it, if decided so, should fit well in such version number jump.
Opinions?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4041
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4041(a)github.com>
### Description
During source compilation on Fedora 40 I see an error
```
[2024-11-15T10:13:57.497Z] make[3]: Entering directory '/root/rpmbuild/BUILD/kamailio-6.0.0-dev3/src/lib/srdb2'
[2024-11-15T10:13:57.502Z] make[3]: 'libsrdb2.so.1.0' is up to date.
[2024-11-15T10:13:57.502Z] make[3]: Leaving directory '/root/rpmbuild/BUILD/kamailio-6.0.0-dev3/src/lib/srdb2'
[2024-11-15T10:13:57.504Z] LD (gcc) [M uid_uri_db.so] uid_uri_db.so
[2024-11-15T10:13:57.535Z] make[2]: --libs8: No such file or directory
[2024-11-15T10:13:57.569Z] make[2]: --libs8: No such file or directory
[2024-11-15T10:13:57.590Z] CC (gcc) [M dialplan.so] dialplan.o
[2024-11-15T10:13:58.005Z] CC (gcc) [M dialplan.so] dp_db.o
[2024-11-15T10:13:58.331Z] CC (gcc) [M dialplan.so] dp_repl.o
[2024-11-15T10:13:58.742Z] make[3]: Entering directory '/root/rpmbuild/BUILD/kamailio-6.0.0-dev3/src/lib/srdb1'
[2024-11-15T10:13:58.748Z] make[3]: 'libsrdb1.so.1.0' is up to date.
[2024-11-15T10:13:58.748Z] make[3]: Leaving directory '/root/rpmbuild/BUILD/kamailio-6.0.0-dev3/src/lib/srdb1'
[2024-11-15T10:13:58.749Z] LD (gcc) [M dialplan.so] dialplan.so
[2024-11-15T10:13:58.776Z] make[2]: --libs8: No such file or directory
[2024-11-15T10:13:58.808Z] make[2]: --libs8: No such file or directory
[2024-11-15T10:13:58.837Z] CC (gcc) [M lcr.so] hash.o
[2024-11-15T10:13:58.984Z] CC (gcc) [M lcr.so] lcr_mod.o
[2024-11-15T10:14:00.389Z] CC (gcc) [M lcr.so] lcr_rpc.o
[2024-11-15T10:14:00.518Z] make[3]: Entering directory '/root/rpmbuild/BUILD/kamailio-6.0.0-dev3/src/lib/srdb1'
[2024-11-15T10:14:00.528Z] make[3]: 'libsrdb1.so.1.0' is up to date.
[2024-11-15T10:14:00.528Z] make[3]: Leaving directory '/root/rpmbuild/BUILD/kamailio-6.0.0-dev3/src/lib/srdb1'
[2024-11-15T10:14:00.529Z] LD (gcc) [M lcr.so] lcr.so
[2024-11-15T10:14:00.564Z] make[2]: --libs8: No such file or directory
[2024-11-15T10:14:00.592Z] make[2]: --libs8: No such file or directory
[2024-11-15T10:14:00.623Z] CC (gcc) [M regex.so] regex_mod.o
[2024-11-15T10:14:00.952Z] LD (gcc) [M regex.so] regex.so
[2024-11-15T10:14:00.997Z] CC (gcc) [M app_jsdt.so] app_jsdt_api.o
[2024-11-15T10:14:01.437Z] CC (gcc) [M app_jsdt.so] app_jsdt_kemi_export.o
[2024-11-15T10:14:02.089Z] CC (gcc) [M app_jsdt.so] app_jsdt_mod.o
[2024-11-15T10:14:02.389Z] CC (gcc) [M app_jsdt.so] duk_module_node.o
[2024-11-15T10:14:02.470Z] CC (gcc) [M app_jsdt.so] duktape.o
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4025
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4025(a)github.com>