Browse code

- take protocol version from the request, as opposed to hardcoded value

Jan Janak authored on 15/12/2005 23:36:46
Showing 1 changed files
... ...
@@ -1644,7 +1644,7 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag,
1644 1644
 	}
1645 1645
 
1646 1646
 	/* first line */
1647
-	len += SIP_VERSION_LEN + 1/*space*/ + 3/*code*/ + 1/*space*/ +
1647
+	len += msg->first_line.u.request.version.len + 1/*space*/ + 3/*code*/ + 1/*space*/ +
1648 1648
 		text_len + CRLF_LEN/*new line*/;
1649 1649
 	/*headers that will be copied (TO, FROM, CSEQ,CALLID,VIA)*/
1650 1650
 	for ( hdr=msg->headers ; hdr ; hdr=hdr->next ) {
... ...
@@ -1716,8 +1716,9 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag,
1716 1716
 	/* filling the buffer*/
1717 1717
 	p=buf;
1718 1718
 	/* first line */
1719
-	memcpy( p , SIP_VERSION , SIP_VERSION_LEN );
1720
-	p += SIP_VERSION_LEN;
1719
+	memcpy( p , msg->first_line.u.request.version.s , 
1720
+		msg->first_line.u.request.version.len);
1721
+	p += msg->first_line.u.request.version.len;
1721 1722
 	*(p++) = ' ' ;
1722 1723
 	/*code*/
1723 1724
 	for ( i=2 , foo = code  ;  i>=0  ;  i-- , foo=foo/10 )