OpenSIPS / opensips

OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-level technical solution (performance, security and quality) to be used in professional SIP server platforms.
https://opensips.org
Other
1.27k stars 578 forks source link

[BUG] append_to_reply not working when t_reply_with_body is used inside a failure_route block #3422

Closed Riccardo-78 closed 1 month ago

Riccardo-78 commented 3 months ago

OpenSIPS version you are running

[root@box ~]# opensips -V
version: opensips 3.4.5 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: 6beb906e5
main.c compiled on 01:49:20 Apr 19 2024 with gcc 8

Describe the bug append_to_reply not working when t_reply_with_body is used inside a failure_route block. Only the body is present in the reply.

To Reproduce

failure_route[local_reply] {
    t_reply_with_body(404, "Not Found", "a b c"); 
    append_to_reply("Foo: bar\r\n");

Expected behavior

A sip reply with Foo: bar header and a body with content "a b c".

Relevant System Logs no errors found in the opensip log.

OS/environment information

A similar issue was fixed in the past for request route

Riccardo-78 commented 3 months ago

adding update_cloned_msg_from_msg( t->uas.request, msg); to w_t_reply_body for the FAILURE_ROUTE case fix the issue.

bogdan-iancu commented 3 months ago

Isn;t the order of the operations the other way around, like first adding the hdr to reply and then sending the reply, like:

failure_route[local_reply] {
    append_to_reply("Foo: bar\r\n");
    t_reply_with_body(404, "Not Found", "a b c"); 
}
Riccardo-78 commented 3 months ago

It doesn't work even if I put append_to_reply before t_reply_with_body

github-actions[bot] commented 2 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

github-actions[bot] commented 1 month ago

Marking as closed due to lack of progress for more than 30 days. If this issue is still relevant, please re-open it with additional details.