Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Riccardo-78 opened this issue Jun 25, 2024 · 5 comments · May be fixed by #3424
Closed
Assignees
Labels

Comments

@Riccardo-78
Copy link

Riccardo-78 commented Jun 25, 2024

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

  • Operating System: Almalinux 8
  • OpenSIPS installation: official rpm packages

A similar issue was fixed in the past for request route

@Riccardo-78
Copy link
Author

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
Copy link
Member

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"); 
}

@bogdan-iancu bogdan-iancu self-assigned this Jul 2, 2024
@Riccardo-78
Copy link
Author

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

Copy link

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 github-actions bot added the stale label Jul 18, 2024
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants