Module: sip-router
Branch: master
Commit: 80f241b0b1e13021d3494aa7a489d313d6c03f5b
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=80f241b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon May 26 14:13:30 2014 +0200
core: added field to link sip msg in onsend structure
- to be used when opening an ongoing stream (tcp/tls) connection
---
onsend.h | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/onsend.h b/onsend.h
index d8511c2..bc6141b 100644
--- a/onsend.h
+++ b/onsend.h
@@ -43,10 +43,11 @@
#include "sr_compat.h"
struct onsend_info{
- union sockaddr_union* to;
- struct socket_info* send_sock;
- char* buf;
- int len;
+ union sockaddr_union* to; /* dest info */
+ struct socket_info* send_sock; /* local send socket */
+ char* buf; /* outgoing buffer */
+ int len; /* outgoing buffer len */
+ sip_msg_t *msg; /* original sip msg struct */
};
extern struct onsend_info* p_onsend;
@@ -61,7 +62,7 @@ extern struct onsend_info* p_onsend;
static inline int run_onsend(struct sip_msg* orig_msg, struct dest_info* dst,
char* buf, int len)
{
- struct onsend_info onsnd_info;
+ struct onsend_info onsnd_info = {0};
int ret;
struct run_act_ctx ra_ctx;
int backup_route_type;
@@ -74,6 +75,7 @@ static inline int run_onsend(struct sip_msg* orig_msg, struct dest_info*
dst,
onsnd_info.send_sock=dst->send_sock;
onsnd_info.buf=buf;
onsnd_info.len=len;
+ onsnd_info.msg=orig_msg;
p_onsend=&onsnd_info;
backup_route_type=get_route_type();
set_route_type(ONSEND_ROUTE);