Skip to content

Commit 68f55e1

Browse files
committed
sl: If "reply_to_via" is set, send reply to IP/Port indicated in "Via"
1 parent d843fa6 commit 68f55e1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/sl/sl_funcs.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,14 @@ int sl_send_reply_helper(struct sip_msg *msg ,int code, const str *text)
154154
if ( msg->REQ_METHOD==METHOD_ACK)
155155
return 1;
156156

157-
update_sock_struct_from_ip( &to, msg );
157+
if (reply_to_via) {
158+
if (update_sock_struct_from_via(&to, msg, msg->via1 )==-1)
159+
{
160+
LM_ERR("cannot lookup reply dst: %.*s\n",
161+
msg->via1->host.len, msg->via1->host.s);
162+
goto error;
163+
}
164+
} else update_sock_struct_from_ip( &to, msg );
158165

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

0 commit comments

Comments
 (0)