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