[sr-dev] git:pd/websocket: core: Updated Via and Record-Route generation for WebSockets
Peter Dunkley
peter.dunkley at crocodile-rcs.com
Sun Jul 1 23:22:11 CEST 2012
Module: sip-router
Branch: pd/websocket
Commit: ba0ff3123a223365c07a0d2ffa85d2d150f86bce
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ba0ff3123a223365c07a0d2ffa85d2d150f86bce
Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date: Sun Jul 1 22:20:36 2012 +0100
core: Updated Via and Record-Route generation for WebSockets
---
msg_translator.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/msg_translator.c b/msg_translator.c
index 2c38000..4793e64 100644
--- a/msg_translator.c
+++ b/msg_translator.c
@@ -648,7 +648,7 @@ static inline int lumps_len(struct sip_msg* msg, struct lump* lumps,
break; \
case SUBST_RCV_PROTO: \
if (msg->rcv.bind_address){ \
- switch(msg->rcv.bind_address->proto){ \
+ switch(msg->rcv.proto){ \
case PROTO_NONE: \
case PROTO_UDP: \
case PROTO_TCP: \
@@ -681,7 +681,7 @@ static inline int lumps_len(struct sip_msg* msg, struct lump* lumps,
new_len+=1+recv_port_str->len; \
}\
/*add;transport=xxx*/ \
- switch(msg->rcv.bind_address->proto){ \
+ switch(msg->rcv.proto){ \
case PROTO_NONE: \
case PROTO_UDP: \
break; /* udp is the default */ \
@@ -727,7 +727,7 @@ static inline int lumps_len(struct sip_msg* msg, struct lump* lumps,
break; \
case SUBST_SND_PROTO: \
if (send_sock){ \
- switch(send_sock->proto){ \
+ switch(send_info->proto){ \
case PROTO_NONE: \
case PROTO_UDP: \
case PROTO_TCP: \
@@ -762,7 +762,7 @@ static inline int lumps_len(struct sip_msg* msg, struct lump* lumps,
new_len+=1+send_port_str->len; \
}\
/*add;transport=xxx*/ \
- switch(send_sock->proto){ \
+ switch(send_info->proto){ \
case PROTO_NONE: \
case PROTO_UDP: \
break; /* udp is the default */ \
@@ -1042,7 +1042,7 @@ static inline void process_lumps( struct sip_msg* msg,
recv_port_str->len); \
offset+=recv_port_str->len; \
}\
- switch(msg->rcv.bind_address->proto){ \
+ switch(msg->rcv.proto){ \
case PROTO_NONE: \
case PROTO_UDP: \
break; /* nothing to do, udp is default*/ \
@@ -1137,7 +1137,7 @@ static inline void process_lumps( struct sip_msg* msg,
send_port_str->len); \
offset+=send_port_str->len; \
}\
- switch(send_sock->proto){ \
+ switch(send_info->proto){ \
case PROTO_NONE: \
case PROTO_UDP: \
break; /* nothing to do, udp is default*/ \
@@ -1182,7 +1182,7 @@ static inline void process_lumps( struct sip_msg* msg,
break; \
case SUBST_RCV_PROTO: \
if (msg->rcv.bind_address){ \
- switch(msg->rcv.bind_address->proto){ \
+ switch(msg->rcv.proto){ \
case PROTO_NONE: \
case PROTO_UDP: \
memcpy(new_buf+offset, "udp", 3); \
@@ -1217,7 +1217,7 @@ static inline void process_lumps( struct sip_msg* msg,
break; \
case SUBST_SND_PROTO: \
if (send_sock){ \
- switch(send_sock->proto){ \
+ switch(send_info->proto){ \
case PROTO_NONE: \
case PROTO_UDP: \
memcpy(new_buf+offset, "udp", 3); \
@@ -2437,7 +2437,9 @@ char* via_builder( unsigned int *len,
}else if (send_info->proto==PROTO_SCTP){
memcpy(line_buf+MY_VIA_LEN-4, "SCTP ", 5);
}else if (send_info->proto==PROTO_WS){
- memcpy(line_buf+MY_VIA_LEN-4, "WS ", 2);
+ memcpy(line_buf+MY_VIA_LEN-4, "WS ", 3);
+ }else if (send_info->proto==PROTO_WSS){
+ memcpy(line_buf+MY_VIA_LEN-4, "WSS ", 4);
}else{
LOG(L_CRIT, "BUG: via_builder: unknown proto %d\n", send_info->proto);
return 0;
More information about the sr-dev
mailing list