Hello,

this behaviour is there from the beginning, maybe it went unnoticed so
far and if not in the documentation, it can be updated to reflect it.
While I was not the developer of the config interpreter at that time,
the reason behind is that the processing of the reply is considered failed.

Because of it, the default config file has return as last action in
these routing blocks.

Cheers,
Daniel

On 11.11.24 09:46, Henning Westerholt via sr-users wrote:
> Hi James,
>
> sure, you can open a github issue about it. If it’s a bug it should be fixed, 
> if its not a bug at least some documentation would be great.
>
> Cheers,
>
> Henning
>
>> -----Original Message-----
>> From: James Browne <[email protected]>
>> Sent: Freitag, 8. November 2024 16:38
>> To: Henning Westerholt <[email protected]>
>> Cc: Kamailio (SER) - Users Mailing List <[email protected]>
>> Subject: Re: [SR-Users] Last line of onreply_route (drops reply)
>>
>> 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 <[email protected]> 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 <[email protected]>
>>>> Sent: Freitag, 1. November 2024 14:02
>>>> To: Kamailio (SER) - Users Mailing List
>>>> <[email protected]>
>>>> Cc: James Browne <[email protected]>
>>>> 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 [email protected]
>>>> Important: keep the mailing list in the recipients, do not reply
>>>> only to the sender!
>>>> Edit mailing list options or unsubscribe:
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:


-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:

Reply via email to