Skip to content

Commit

Permalink
sl: If "reply_to_via" is set, send reply to IP/Port indicated in "Via"
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbock committed Mar 7, 2024
1 parent d843fa6 commit 68f55e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/sl/sl_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,14 @@ int sl_send_reply_helper(struct sip_msg *msg ,int code, const str *text)
if ( msg->REQ_METHOD==METHOD_ACK)
return 1;

update_sock_struct_from_ip( &to, msg );
if (reply_to_via) {
if (update_sock_struct_from_via(&to, msg, msg->via1 )==-1)
{
LM_ERR("cannot lookup reply dst: %.*s\n",
msg->via1->host.len, msg->via1->host.s);
goto error;
}
} else update_sock_struct_from_ip( &to, msg );

/* if that is a redirection message, dump current message set to it */
if (code>=300 && code<400) {
Expand Down

0 comments on commit 68f55e1

Please sign in to comment.