<!-- 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:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
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). -->
Hi !
topos+redis used in the folowing configuration:
modparam("ndb_redis", "server", "REDIS_SERVER") modparam("ndb_redis", "init_without_redis", 1) modparam("topos", "storage", "redis") modparam("topos_redis", "serverid", "srv1") modparam("topos", "contact_mode", 2) modparam("topos", "xavu_cfg", "_tps_") modparam("topos", "xavu_field_a_contact", "a_contact") modparam("topos", "xavu_field_b_contact", "b_contact") modparam("topos", "xavu_field_contact_host", "contact_host")
In the inital INVITE xavu variables a_contact and b_contact are set by script, topos work as expected at this point, but when the following in-dalog messages from upstream have Record-Route header, topos fails with error message:
Sep 13 18:50:01 gw481 /usr/sbin/kamailio[29874]: ERROR: {1 1 ACK 1-20643@87.250.237.98} topos [tps_storage.c:331]: tps_storage_fill_contact(): could not evaluate a_contact xavu Sep 13 18:50:01 gw481 /usr/sbin/kamailio[29874]: ERROR: {1 1 ACK 1-20643@87.250.237.98} topos [tps_storage.c:604]: tps_storage_record(): failed to store
In case of absent Record-Route headers the are no errors.
#### Debugging Data
Signaling dump and debug log in attachment.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
``` kamailio 5.5.1 (x86_64/linux) ```
* **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`) -->
``` Ubuntu 18.04.5 LTS ``` [dump.txt](https://github.com/kamailio/kamailio/files/7157118/dump.txt) [call.log](https://github.com/kamailio/kamailio/files/7157120/call.log)
I don't think is related to Record-Route, maybe to the presence of Contact in the ACK (usually is not).
Anyhow, the xavp seems to be required every time a Contact has to be generated when contact_mode = 2 -- that looks like what code requires. I replaced the use of avps with xavps, but my patch doesn't seem to affect what was in the initial implementation done by @henningw - maybe he can comment more and say if it's expected behaviour and a PR needs to be done to cover your case.
@miconda From a functionality point of view it should be ok to set the xavu during the processing of the initial request. But as you mentioned, the change went through a few iterations, also from my side. I will do some tests as well.
Hi !
We have different carriers, some of them send contact in ACK & BYE, some not, but problem persist only when in-Dialog messages have Record-Route header. I can't put here real conversations, but can reproduce signaling in lab.
Here is the signaling & debug log without contact in ACK, with Record-Route header present. [call1.log](https://github.com/kamailio/kamailio/files/7163114/call1.log) [dump1.txt](https://github.com/kamailio/kamailio/files/7163118/dump1.txt)
@Den4t - as I said I expect to be related to presence of Contact header, not to Record-Route header -- it happens that both are set in your example, but processing is related to contact header.
Anyhow, till is sorted out how it should work, you can check if the request within dialog has Contact header (or Record-Route if really is that case) and the set that xavu.
Didn't I show in the examples above that contact has nothing to do with it?
Aniway again, no Contact with Record-Route in ACK, have error in topos: [call4.log](https://github.com/kamailio/kamailio/files/7177215/call4.log) [dump4.txt](https://github.com/kamailio/kamailio/files/7177216/dump4.txt)
no Contact, no Record-Route, no error: [call5.log](https://github.com/kamailio/kamailio/files/7177218/call5.log) [dump5.txt](https://github.com/kamailio/kamailio/files/7177219/dump5.txt)
and the set that xavu
I do belive if i set xavu in in-Dialog messages topos will be work correctly, but as sayd @henningw:
Somehow I missed the comment without contact -- when I looked quickly at the code, the xavu is used if contact address is found, being after this piece of code:
``` if(dir==TPS_DIR_DOWNSTREAM) { sv = td->bs_contact; } else { sv = td->as_contact; } if(sv.len<=0) { /* no contact - skip */ return 0; } ```
But I do not use this mode with xavu and don't know what is supposed to do. I just wanted to give some hints.
Another idea, as the topos has the option to do Record-Route update (https://www.kamailio.org/docs/modules/stable/modules/topos.html#topos.p.rr_u...), might be somehow related.
If you do not enable Record-Route update, then you can remove the Record-Route headers for requests within dialog with remove_hf("Record-Route") and try to see if it works.
If you enable that option, then you also have to do record_route() for the requests within dialog.
Hi, @miconda !
I do not enable rr_update, but can confirm that with removing Record-Route from in-Dalog messages topos errors are gone. For now it seems to be a solution.
Somehow I missed the comment without contact -- when I looked quickly at the code, the xavu is used if contact address is found, being after this piece of code:
if(dir==TPS_DIR_DOWNSTREAM) { sv = td->bs_contact; } else { sv = td->as_contact; } if(sv.len<=0) { /* no contact - skip */ return 0; }
But I do not use this mode with xavu and don't know what is supposed to do. I just wanted to give some hints.
I think that contact variables filled by tps_pack_message in tps_request_sent function from Record-Route header: ``` Sep 16 13:55:16 gw481 /usr/sbin/kamailio[11425]: DEBUG: {1 1 ACK 1-12131@87.250.237.98} topos [tps_msg.c:1006]: tps_request_sent(): handling outgoing request (1, 0) Sep 16 13:55:16 gw481 /usr/sbin/kamailio[11425]: DEBUG: {1 1 ACK 1-12131@87.250.237.98} topos [tps_msg.c:415]: tps_pack_message(): compacted headers - x_via1: [SIP/2.0/UDP [2a02:6b8:0:6::5];branch=z9hG4bK7bb2.7dbc336ffe6a81233e57c387950431c8.0](83) - x_via2: [SIP/2.0/UDP 87.250.237.98:5070;received=87.250.237.98;rport=5070;branch=z9hG4bK-12131-1-5;sig=4100ba9a](102) - x_vbranch1: [z9hG4bK7bb2.7dbc336ffe6a81233e57c387950431c8.0](46) Sep 16 13:55:16 gw481 /usr/sbin/kamailio[11425]: DEBUG: {1 1 ACK 1-12131@87.250.237.98} topos [tps_msg.c:483]: tps_pack_message(): single record routing by proxy Sep 16 13:55:16 gw481 /usr/sbin/kamailio[11425]: DEBUG: {1 1 ACK 1-12131@87.250.237.98} topos [tps_msg.c:537]: tps_pack_message(): compacted headers - a_rr: [](0) - b_rr: [](0) - s_rr: [sip:87.250.237.98:5070;lr;ftag=1c1658248864;did=626.1edbf0d5](62) Sep 16 13:55:16 gw481 /usr/sbin/kamailio[11425]: DEBUG: {1 1 ACK 1-12131@87.250.237.98} topos [tps_msg.c:542]: tps_pack_message(): compacted headers - as_contact: [sip:87.250.237.98:5070;lr;ftag=1c1658248864;did=626.1edbf0d5](60) - bs_contact: [sip:87.250.237.98:5070;lr;ftag=1c1658248864;did=626.1edbf0d5](60) ```
I can not reproduce the problem, either with redis or DB. It sufficient to set the xavu in the request_route.
Pretty default cfg with the following additions: ``` root@kam03:/etc/kamailio# egrep "redis|topos" kamailio.cfg-2852 loadmodule "ndb_redis.so" loadmodule "topos_redis.so" loadmodule "topos.so" modparam("ndb_redis", "server", "name=srv1;addr=localhost;port=6379") modparam("ndb_redis", "init_without_redis", 1) modparam("topos", "storage", "redis") #modparam("topos", "storage", "db") modparam("topos_redis", "serverid", "srv1") modparam("topos", "contact_mode", 2) modparam("topos", "xavu_cfg", "tps") modparam("topos", "xavu_field_a_contact", "a_contact") modparam("topos", "xavu_field_b_contact", "b_contact") modparam("topos", "xavu_field_contact_host", "contact_host")
request_route { [...] $xavu(tps=>a_contact) = "A-side"; $xavu(tps=>b_contact) = "B-side"; [...] }
``` INVITE contact-1 -> contact-2:
INVITE sip:contact-2@116.203.XX.XXX:5066;ob SIP/2.0 Contact: sip:A-side@116.203.YY.YY;tps=btpsh-6152ec8f-6744-1
ACK contact-1 -> contact-2: ACK sip:contact-2@116.203.XX.XX:5066;alias=116.203.XX.XX~5066~1;ob SIP/2.0 Contact: sip:A-side@116.203.YY.YY;tps=btpsh-6152ec8f-6744-1
BYE contact-2 -> contact-1: BYE sip:contact-1@116.203.XX.XX:5095;ob SIP/2.0 Contact: sip:B-side@116.203.YY.YY;tps=atpsh-6152ec8f-6744-1
Kamailio from 5.5 branch: root@kam03:/usr/local/src/5.5# /usr/local/kamailio-5.5/sbin/kamailio -v version: kamailio 5.5.2 (x86_64/linux) 3b523f
I have found one regression introduced in c030fc5231d2a653. If *modparam("topos", "xavu_field_contact_host", "contact_host")* is not set, the module will not work in contact_mode 2. Its fixed in the referenced commit.
Close the issue, could not be reproduced. Pleaser re-open if you have more/new information.
Closed #2852.