Module: sip-router
Branch: master
Commit: bf48d46366eb50ebcaf0972d2524b65d3accdffa
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bf48d46…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Jul 27 19:34:35 2011 +0200
core: allow forcing send socket for replies
- patch by Marcus Hunger, closes FS#142
---
forward.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/forward.c b/forward.c
index 3e4aecd..690ff47 100644
--- a/forward.c
+++ b/forward.c
@@ -124,6 +124,8 @@ static int sock_inet = -1;
static int sock_inet6 = -1;
#endif /* USE_IPV6 */
+static void apply_force_send_socket(struct dest_info* dst, struct sip_msg* msg);
+
struct socket_info* get_out_socket(union sockaddr_union* to, int proto)
{
int* temp_sock;
@@ -829,6 +831,9 @@ int forward_reply(struct sip_msg* msg)
}
#endif
+
+ apply_force_send_socket(&dst, msg);
+
if (msg_send(&dst, new_buf, new_len)<0)
{
STATS_RPL_FWD_DROP();
@@ -850,3 +855,10 @@ error:
if (new_buf) pkg_free(new_buf);
return -1;
}
+
+static void apply_force_send_socket(struct dest_info* dst, struct sip_msg* msg)
+{
+ if (msg->force_send_socket != 0) {
+ dst->send_sock = get_send_socket(msg, &dst->to, dst->proto);
+ }
+}