Thanks, Henning
Yes, I added a return statement and it works around the problem in this case, but I'd not like to find the bug appearing somewhere else (in another route for example). Should I open a Github Issue for this sort of thing?
James
On Thu, 7 Nov 2024 at 16:42, Henning Westerholt hw@gilawa.com wrote:
Hello James,
good point, we were able to confirm this. There is an easy work-around by just adding an if statement around it.
Nevertheless, I agree that this is unexpected behaviour and should be further investigated.
Cheers,
Henning
-----Original Message----- From: James Browne via sr-users sr-users@lists.kamailio.org Sent: Freitag, 1. November 2024 14:02 To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Cc: James Browne james@frideo.com Subject: [SR-Users] Last line of onreply_route (drops reply)
Hi all I noticed, in my config, that if the last line of the reply_route is a function that does not succeed, then the SIP response is not relayed and kamailio throws an error. I've searched documentation to indicate why this might be, but I can't find anything, so this looks to me like a bug. I use 5.8.1 for testing.
Here's a sample config that shows what goes wrong. #################### #!KAMAILIO listen=udp:203.0.113.57:5060 debug=1 loadmodule "textops" request_route{exit;} reply_route{remove_hf_re("^X-Custom");} ####################
Here's a sample SIP message that works. When I send this to udp:203.0.113.57:5060, kamailio relays it. #################### SIP/2.0 200 Testing Via: SIP/2.0/UDP 203.0.113.57:5060;branch=z9hG4bK-d8754z Via: SIP/2.0/UDP 198.18.0.157:5060;branch=z9hG4bK-d8754z T: sip:c@s;tag=676fbf45 F: sip:c@s;tag=676fbf45 X-Custom: lkjdfl i: testing-XXX CSeq: 1 INFO l: 0 ####################
If I then remove the X-Custom header field from the SIP reply and try again, the message does not get relayed and I see this in the log.
5(1356) WARNING: <core> [core/receive.c:605]: receive_msg(): error while trying onreply script
If I put a log command after the remove_hf_re(), then the message gets relayed. It looks like the reply_route always fails if the last function is not successful. Is this normal or is it a bug?
James __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: