Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 21/02/2002 19:24:13
Showing 2 changed files
... ...
@@ -1195,24 +1195,24 @@ int t_build_and_send_CANCEL(struct cell *Trans,unsigned int branch)
1195 1195
 	/* changhing method name*/
1196 1196
 	memcpy(cancel_buf,"CANCEL",6);
1197 1197
 	append_mem_block(p,CRLF,CRLF_LEN);
1198
-	
1199
-
1200 1198
 	/* insert our via */
1201
-	memcpy( p , via , via_len );
1202
-	p += via_len;
1199
+	append_mem_block(p,via,via_len);
1203 1200
 
1204 1201
 	/*other headers*/
1205 1202
 	for ( hdr=p_msg->headers ; hdr ; hdr=hdr->next )
1206 1203
 	{
1207
-		if ( hdr->type==HDR_FROM || hdr->type==HDR_CALLID ||
1208
-			hdr->type==HDR_TO || hdr->type==HDR_CSEQ )
1204
+		if(hdr->type==HDR_FROM||hdr->type==HDR_CALLID||hdr->type==HDR_TO)
1209 1205
 		{
1210 1206
 			append_mem_block(p,hdr->name.s,
1211 1207
 				((hdr->body.s+hdr->body.len)-hdr->name.s) );
1212 1208
 			append_mem_block(p, CRLF, CRLF_LEN );
1213
-			p+=CRLF_LEN;
1209
+		}else if ( hdr->type==HDR_CSEQ )
1210
+		{
1211
+			append_mem_block(p,hdr->name.s,
1212
+				((((struct cseq_body*)hdr->parsed)->method.s)-hdr->name.s));
1213
+			append_mem_block(p,"CANCEL" CRLF, 6+CRLF_LEN );
1214 1214
 		}
1215
-	}
1215
+}
1216 1216
 
1217 1217
 	/* User Agent header */
1218 1218
 	append_mem_block(p,USER_AGENT,USER_AGENT_LEN);
... ...
@@ -1222,6 +1222,10 @@ int t_build_and_send_CANCEL(struct cell *Trans,unsigned int branch)
1222 1222
 	append_mem_block(p,CRLF,CRLF_LEN);
1223 1223
 	/* end of message */
1224 1224
 	append_mem_block(p,CRLF,CRLF_LEN);
1225
+	*p=0;
1226
+	
1227
+
1228
+	DBG("LOCAL CANCEL = \n%s\n",cancel_buf);
1225 1229
 
1226 1230
 	pkg_free(via);
1227 1231
 	return 1;
... ...
@@ -1432,12 +1436,12 @@ void final_response_handler( void *attr)
1432 1436
 		DBG("DEBUG: final_response_handler:stop retransmission and"
1433 1437
 			" send 408 (t=%p)\n", r_buf->my_T);
1434 1438
 		reset_timer( hash_table, &(r_buf->retr_timer) );
1439
+		t_build_and_send_CANCEL( r_buf->my_T ,0);
1435 1440
 		/* dirty hack:t_send_reply would increase ref_count which would indeed
1436 1441
 		result in refcount++ which would not -- until timer processe's
1437 1442
 		T changes again; currently only on next call to t_send_reply from
1438 1443
 		FR timer; thus I fake the values now to avoid recalculating T
1439
-		and refcount++
1440
-		jku */
1444
+		and refcount++ JKU */
1441 1445
 		T=r_buf->my_T;
1442 1446
 		global_msg_id=T->inbound_request->id;
1443 1447
 
... ...
@@ -40,22 +40,6 @@ route{
40 40
                      sl_send_reply("483","To Many Hops");
41 41
                      drop();
42 42
              };
43
-             /*
44
-             if ( mf_is_maxfwd_present() )
45
-             {
46
-                   if ( !mf_decrement_maxfwd() )
47
-                   {
48
-                     log("SER : unable to decrement MAX_FORWARD!\n");
49
-                   };
50
-                   if ( mf_is_maxfwd_zero() )
51
-                   {
52
-                     log("SER: MAX FORWARD header is zero\n");
53
-                     drop();
54
-                   };
55
-             }else{
56
-                   mf_add_maxfwd_header( "10" );
57
-             }; */
58
-
59 43
 
60 44
              /*
61 45
              if (method=="INVITE")