rem: via=via_builder(&via_len, Trans->uac[branch].request.send_sock, &branch_str, 0, Trans->uac[branch].request.send_sock->proto );
add: via=via_builder(&via_len, Trans->uac[branch].request.dst.send_sock, &branch_str, 0, Trans->uac[branch].request.dst.proto );
context: char *build_local(struct cell *Trans,unsigned int branch,	unsigned int *len, char *method, int method_len, str *to){	char                *cancel_buf, *p, *via;	unsigned int         via_len;	struct hdr_field    *hdr;	char branch_buf[MAX_BRANCH_PARAM_LEN];	int branch_len;	str branch_str;	if ( Trans->uac[branch].last_received<100)	{		DBG("DEBUG: build_local: no response ever received"			" : dropping local request! \n");		goto error;	}	/* method, separators, version: "CANCEL sip:p2@iptel.org SIP/2.0" */	*len=SIP_VERSION_LEN + method_len + 2 /* spaces */ + CRLF_LEN;	*len+=Trans->uac[branch].uri.len;	/*via*/	if (!t_calc_branch(Trans,  branch, 		branch_buf, &branch_len ))		goto error;	branch_str.s=branch_buf;	branch_str.len=branch_len;	via=via_builder(&via_len, Trans->uac[branch].request.send_sock,		&branch_str, 0, Trans->uac[branch].request.send_sock->proto );	if (!via)	{		LOG(L_ERR, "ERROR: t_build_and_send_CANCEL: "			"no via header got from builder\n");		goto error;	}	*len+= via_len;	/*headers*/#ifdef PRESERVE_ZT	*len+=Trans->from.len+CRLF_LEN		+Trans->callid.len+CRLF_LEN		+to->len+CRLF_LEN		/* CSeq: 101 CANCEL */		+Trans->cseq_n.len+1+method_len+CRLF_LEN; #else	*len+=Trans->from.len+Trans->callid.len+to->len+		+Trans->cseq_n.len+1+method_len+CRLF_LEN; #endif	/* copy'n'paste Route headers */	if (!Trans->local) {		for ( hdr=Trans->uas.request->headers ; hdr ; hdr=hdr->next )			 if (hdr->type==HDR_ROUTE)#ifdef PRESERVE_ZT				*len+=((hdr->body.s+hdr->body.len ) - hdr->name.s ) + 					CRLF_LEN ;#else				*len+=hdr->len;#endif	}	/* User Agent */	if (server_signature) {		*len += USER_AGENT_LEN + CRLF_LEN;	}	/* Content Length, EoM */	*len+=CONTENT_LENGTH_LEN+1 + CRLF_LEN + CRLF_LEN;	cancel_buf=shm_malloc( *len+1 );	if (!cancel_buf)	{		LOG(L_ERR, "ERROR: t_build_and_send_CANCEL: cannot allocate memory\n");		goto error01;	}	p = cancel_buf;	append_mem_block( p, method, method_len );	append_mem_block( p, " ", 1 );	append_str( p, Trans->uac[branch].uri );	append_mem_block( p, " " SIP_VERSION CRLF, 1+SIP_VERSION_LEN+CRLF_LEN );	/* insert our via */	append_mem_block(p,via,via_len);	/*other headers*/#ifdef PRESERVE_ZT	append_str( p, Trans->from );	append_mem_block( p, CRLF, CRLF_LEN );	append_str( p, Trans->callid );	append_mem_block( p, CRLF, CRLF_LEN );	append_str( p, *to );	append_mem_block( p, CRLF, CRLF_LEN );#else	append_str( p, Trans->from );	append_str( p, Trans->callid );	append_str( p, *to );#endif	append_str( p, Trans->cseq_n );	append_mem_block( p, " ", 1 );	append_mem_block( p, method, method_len );	append_mem_block( p, CRLF, CRLF_LEN );	if (!Trans->local)  {		for ( hdr=Trans->uas.request->headers ; hdr ; hdr=hdr->next )			if(hdr->type==HDR_ROUTE) {#ifdef PRESERVE_ZT				append_mem_block(p, hdr->name.s,					hdr->body.s+hdr->body.len-hdr->name.s );				append_mem_block(p, CRLF, CRLF_LEN );#else				append_mem_block(p, hdr->name.s, hdr->len );#endif			}	}	/* User Agent header */	if (server_signature) {		append_mem_block(p,USER_AGENT CRLF, USER_AGENT_LEN+CRLF_LEN );	}	/* Content Length, EoM */	append_mem_block(p, CONTENT_LENGTH "0" CRLF CRLF ,		CONTENT_LENGTH_LEN+1 + CRLF_LEN + CRLF_LEN);	*p=0;	pkg_free(via);	return cancel_buf;error01:	pkg_free(via);error:	return NULL;}